Plugin Designdoc/{zh,en}/design/plugins/README.md

Orquelo v2 Plugin Design

Status: 2026-11-13. Built and tested: everything in sections 1–7 and 11, including all three forms (builtin; manifest plugins with MCP servers, skills and command hooks; process pl

Status: 2026-11-13. Built and tested: everything in sections 1–7 and 11, including all three forms (builtin; manifest plugins with MCP servers, skills and command hooks; process plugins for every role), options and secrets, policy, trust on change, management (revisions, reload, install from sources and catalogs, the admin tool), importing Claude Code and Codex plugins, and the M6 zero-change acceptance (record). Not built: natural-language plugin creation as a ready-made skill (section 8; the admin tool it needs exists), MCP resources and prompts, an operating-system sandbox (G11), and the lower-priority items B13–B15 and B17 of the benchmark. Linux and Windows have not been run natively.

To write a plugin, start with the plugin developer guide: quick starts, the plugin.yaml reference and the wire protocol for any language.

The plugin design review of 2026-11-14 records nine open findings, reproduction evidence, proposed changes, and acceptance criteria.

1. Goals

  1. A new channel, model, tool, skill set, or Runtime is a plugin; the Host does not change.
  2. A plugin can be written in Go (builtin), in any language (process), or with no code at all (manifest: MCP servers and skills, such as a 12306 rail plugin).
  3. All three forms share one manifest, one configuration path, one authorization path, and one set of conformance tests.
  4. A plugin gets only what the operator grants it; what a plugin declares is a request, not a grant.

2. Two Objects

ObjectWhat it isWhere it lives
PluginA manifest plus its files: Go code compiled into the binary, an executable, or a directory of declarations and resourcesplugin.yaml (builtin: embedded with go:embed)
InstanceOne configured use of a plugin: its id, its configuration, the plugins it may use, and where it appliesAn entry under plugins: in the Host configuration

The same plugin can have several instances, for example two Feishu apps or two model routes. Instances never share configuration, credentials, or state. The original design's Package, Installation, Instance, Binding, and Catalog objects collapse into these two: a binding is a field of the configuration, and the catalog of tools a Run sees is computed when the Run starts and pinned in the Run.

3. The Manifest

Every plugin has a plugin.yaml. For builtin plugins it is embedded in the binary and Manifest() returns it, so there is one format for every form.

yaml
1name: rail-12306             # stable id: lowercase letters, digits, hyphens
2version: 0.1.0
3description: China rail tickets through the 12306 MCP server.   # English; shown to operators and models
4host: ">=0.1.0 <1.0.0"       # Host versions this plugin works with
5publisher: orquelo           # a claim shown to operators; the Host records the actual source
6default: available           # enabled: part of the starter config (orquelo init); available: only when an operator adds it
7platforms: [darwin]          # optional: os or os/arch; elsewhere unavailable (platform_unsupported)
8works_with: {transports: [feishu]}   # optional: only with these channels
9execution: manifest          # builtin | process | manifest; manifest when omitted
10roles: [tool, skill]
11resumable: false             # runtimes only: may continue from a checkpoint after a restart
12requires: [model]            # roles it needs to find among the instances it uses
13needs_grants: [identity]     # grants its calls cannot work without (manage, review, conversation, identity, schedule, egress, rewrite)
14egress: in_process           # how its traffic follows egress routes: in_process (Env.Proxy) | env (proxy variables); ADR 0011
15idempotent_send: true        # delivery plugins: the delivery id is the service's idempotency key (P102); an instance offering plugin.SendIdempotence answers for itself
16permissions:                 # requested, shown at install; never a grant
17  network: true
18options:                     # typed settings an operator fills in
19  token: {type: string, title: rail-12306.token, required: true, sensitive: true}
20  region: {type: string, title: rail-12306.region, enum: [cn, us], default: cn}
21config_schema:               # JSON Schema 2020-12 for the instance configuration
22  type: object
23  properties: {}
24display:                     # message keys for operator interfaces
25  name: rail-12306.name
26  description: rail-12306.description
27locales:
28  default: en-US
29  files: {en-US: locales/en-US.json, zh-CN: locales/zh-CN.json}
30# Form-specific sections:
31process:                     # execution: process
32  command: {darwin/arm64: bin/darwin-arm64/rail, linux/amd64: bin/linux-amd64/rail, windows/amd64: bin/windows-amd64/rail.exe}
33  args: []
34mcp_servers: []              # execution: manifest (section 5)
35skills: []                   # execution: manifest, or any plugin with the skill role

Rules:

  • ◆Roles are the extension points: transport, trigger, runtime, presentation, delivery, tool, model, skill, and the hook roles service, context, observer, guard and reviewer. A plugin is used only in the roles it declares. Hook roles have fixed powers:
  • ◆context adds reference material before a turn; it can only add.
  • ◆observer reads committed events from a durable cursor; it changes nothing.
  • ◆guard can only restrict: deny a tool call (Check), refuse a run's input before any runtime sees it (CheckInput), withhold a tool result or add a note (CheckResult), or ask for more work on a final answer (CheckCompletion). A guard that fails denies or withholds.
  • ◆reviewer decides approvals instead of a person (approve, deny, or escalate), but only with the operator's grants: [review]; any error escalates to a person.
  • ◆Guards and reviewers of every instance in a call chain apply.
  • ◆Validation happens at load time. The manifest must match its schema. The instance configuration must match config_schema. A process plugin must have a command for the current platform. Every requires entry must be met by a used instance, every depends entry by an installed plugin in range, and every prerequisite for this platform by its check (dependencies and prerequisites); every needs_grants entry must be among the instance's grants, so a model is never offered tools that can only fail (Feishu #101). Failing any of these makes that instance unavailable with a stated reason (config_invalid, platform_unsupported, requirement_missing, dependency_missing, prerequisite_missing, option_missing, grant_missing), and a missing prerequisite names its fix. Only the connections that use it stop; the rest of the Host runs.
  • ◆Where a plugin comes from, and when it is active. All plugins in this repository live in one plugins/ tree, whatever their form; the form is the manifest's execution, not the directory. Builtin plugins are compiled in through plugins/all; the other directories are loaded through plugin_dirs. A name is looked up as a builtin first; when a plugin_dirs directory that is not a builtin's own has the same name, the instance is unavailable with an error naming both, instead of silently running the builtin (2026-11-26: a new builtin schedule took an installed schedule transport and the Host stopped). publisher says who publishes a plugin; orquelo plugins shows it with default, platforms and works_with. Shipping a plugin never activates it: only instances in the configuration run. orquelo init writes a starter configuration from the plugins marked default: enabled. It wires the first transport, trigger, runtime, presentation and delivery into one connection, puts the other default tools, skills and models in the runtime's uses, fills a config property marked x-instance: <role> with the id of an instance offering that role, and writes required properties and those marked x-init: true as ${ENV} placeholders.
  • ◆Platform and channel limits. On a platform not in platforms, an instance is unavailable with platform_unsupported before it is constructed; a builtin with platform-only code keeps its manifest registered on every platform and puts the code behind build tags. A plugin with works_with.transports cannot be wired as the trigger, runtime, presentation or delivery of a connection whose transport is another plugin (the configuration is refused), and its tools and skills apply only in connections whose transport is listed, for example a Feishu digital twin only in Feishu, or computer use only on darwin.
  • ◆Text for people is localized. Operator interfaces (CLI, cards, forms) show display keys from the plugin's own locales files, namespaced by plugin name, falling back to en-US and then to the key. Model-facing text (descriptions, skills, tool descriptions) has one English version.

4. Instances, Grants, and Scope

yaml
1plugins:
2  - id: kimi
3    plugin: openai
4    config: {base_url: "https://api.kimi.com/coding/v1", api_key: "${KIMI_API_KEY}", model: kimi-for-coding}
5  - id: rail
6    plugin: rail-12306
7    scope:                    # where this instance applies; omitted means everywhere
8      users: ["feishu:ou_123"]
9      conversations: [direct]
10      connections: [feishu]
11    approval: ["book_*"]      # extra tools that need approval; can only add
12    exclude: ["delete_*"]     # tools and skills of this instance to hide
13  - id: agent
14    plugin: agent
15    uses: [kimi, rail, files] # the only plugins this instance may call
16plugin_dirs: [plugins]        # where process and manifest plugins are found

What a Run may do is the intersection of the following:

  • ◆the roles each plugin declares;
  • ◆the runtime's uses list;
  • ◆each used instance's scope, checked against the Run's principal, conversation, and connection;
  • ◆approval rules: the plugin's, the instance's, and the Agent's allow/ask/deny;
  • ◆the current state: an instance that is disabled or unavailable offers nothing.

When a Run first lists its tools, the Host pins the catalog in the Run: each tool name with its provider and a digest of its definition. A recovered Run sees the same catalog. A tool whose definition changed, or that appeared later, is not offered and is refused if called, so a name never silently means a different tool. The Host still checks grants on every call, so revoking a grant takes effect at once.

Options and secrets. A plugin declares typed options (string, number, boolean, file, directory) with a title, an optional default and enum, required, and sensitive. An instance sets plain options under options: in the Host configuration. Sensitive ones are stored with orquelo secret set INSTANCE NAME (the value is read from stdin), or come from ${ENV}; they never appear in a manifest, a plugin directory, a log or a listing. The Host resolves values at load (configuration, then the secret store, then the default), checks types, and makes an instance with a missing required option unavailable with option_missing. Plugins receive the values in Env.Options; manifest plugins may use ${option.KEY} in MCP commands, arguments, URLs, environment and headers. At call time a plugin can also keep secrets for the current principal (GetSecret, PutSecret, DeleteSecret), for example a user's own token; another instance or principal never sees them. Secrets are encrypted with AES-256-GCM using a key file in the state directory.

Operator policy. policy: in the Host configuration limits every instance, and no plugin can relax it: allow_plugins and deny_plugins (name patterns), forms (allowed execution forms), mcp_commands (the only executables MCP servers may run), and deny_tools (tool names removed from every catalog and refused).

Trust on change. A directory plugin runs only after it is approved: orquelo plugin install and orquelo install approve what they install, and a directory put into a plugin directory by hand is unavailable with not_approved until an operator runs orquelo plugin approve NAME. If its files change later, the plugin is unavailable with changed_since_approved until an operator runs orquelo plugin approve NAME. The digest covers every file but .git and Finder's .DS_Store; a symbolic link counts as its target and, when it leads to a file outside the directory, as that file's content, and a link to a directory outside makes the plugin unavailable. A process plugin's process.command must be a file in its directory, so what runs is what was approved (Feishu #254, 2026-11-28).

Tenants, users and principals. A tenant owns users; a connection names its tenant (tenant, default default). A user (us_…) is a person within a tenant; a principal (pr_…) is one of the user's accounts on one connection, e.g. a Feishu open_id under one app. The first message from an account creates its user. A user links accounts with a one-time code: the identity tool plugin (granted grants: [identity]) returns a code on one account, and sending it from the other account within 10 minutes proves both belong to one user, whose rows are merged; accounts of different tenants are never linked; operators can also run orquelo identity link. Approvals can be answered from any of the approver's linked accounts, and per-user secrets and usage limits follow the user (Principal.User). Every data table carries tenant_id and user_id, copied at insert from the principal or the run (internal/store/tenancy.go); Host-wide tables (plugin trust, configuration revisions, control requests, Host status, installs, observer cursors) carry neither. orquelo identity show CONN:USER shows the user an account belongs to and all of its accounts.

Identity comes only from the Host. A principal is the configured connection plus the sender's id as the Transport reported it, and a plugin cannot name a different one. There is one tenant in v2. Scopes by user, conversation, and connection cover the per-user and per-chat cases, and a tenant field is added only when there is a second tenant.

5. Manifest Plugins: MCP and Skills

A manifest plugin is a directory with no code:

text
plugins/rail-12306/
  plugin.yaml
  locales/en-US.json, locales/zh-CN.json
  skills/plan-trip/SKILL.md
  skills/plan-trip/stations.md        # a resource the skill refers to

The complete plugin.yaml; the last two sections exist only in the manifest form:

yaml
1name: rail-12306
2version: 0.1.0
3description: China rail tickets through the 12306 MCP server.
4host: ">=0.1.0 <1.0.0"
5execution: manifest
6roles: [tool, skill]
7permissions: {network: true}
8display: {name: rail-12306.name, description: rail-12306.description}
9locales: {default: en-US, files: {en-US: locales/en-US.json, zh-CN: locales/zh-CN.json}}
10mcp_servers:
11  - name: rail
12    command: [npx, -y, 12306-mcp]     # stdio; or url: https://example.com/mcp for Streamable HTTP
13    env: {}                           # values may use ${ENV}
14    tools: {include: ["*"], exclude: []}
15    approval: ["book_*"]              # the author's default: these tools need approval
16skills:
17  - skills/plan-trip

The author's approval list and the instance's approval list in the Host configuration add up; an operator can add tools that need approval but cannot remove the author's.

MCP servers become tools. A generic MCP client, part of the Host's plugin loader, handles every MCP server:

  • ◆It starts the server when its tools are first needed. It restarts the server with backoff after a crash and stops it at shutdown. It refreshes the tool list on notifications/tools/list_changed; the new list applies to new Runs.
  • ◆Tool names are <instance>__<tool>, which matches ^[A-Za-z_][A-Za-z0-9_-]{0,63}$ and so is valid on every model family.
  • ◆${PLUGIN_ROOT} (the plugin directory) and ${PLUGIN_DATA} (the instance's data directory, kept across updates) may be used in commands, arguments, URLs, environment values and headers.
  • ◆A server runs in the instance's data directory, so a log or cache it writes where it runs is no change to the approved plugin files (Feishu #243). A leading ./ in its command names the plugin's own file; other files of the plugin are named with ${PLUGIN_ROOT}.
  • ◆If tool discovery fails after an earlier success, the last good list stays in use. A server's instructions reach the model as reference material when the manifest declares the context role.
  • ◆Each skill and MCP server has its own status (orquelo plugins -c shows it). A broken skill or server is skipped; the rest of the plugin keeps working.
  • ◆Each call passes through the Broker's ledger like any other tool: intent is recorded before the effect. If a call's outcome is unknown after a crash, the call is reported as unknown. It is never re-sent.
  • ◆Text content becomes the tool result. Images and embedded files become artifacts. An elicitation (a server asking the user for input during a call) becomes a question to the person behind that call: a single yes/no field is asked as an approval, other fields one question each, and a link as a question answered Done; secrets and nested fields are declined. The call stays open while the person answers, past ask_grace: it cannot be resumed later (found with Feishu #259, 2026-11-28). MCP resources and prompts are not offered yet.

Skills. A skill is a directory with a SKILL.md file in the open Agent Skills layout: front matter with name and description, then the instructions. It is disclosed in three levels:

LevelEnters the model contextSize
Card: name and descriptionAlways, in the skill list of the system promptAbout 100 tokens
BodyWhen the model calls load_skill(name)Under 5,000 tokens recommended
ResourcesWhen the instructions lead the model to read them, via load_skill(name, file)Never loaded as a whole

A skill grants nothing. Any action it leads to goes through the same tools, approvals, and grants as everything else. Skills can also come from builtin and process plugins that declare the skill role. When two instances offer a skill with the same name, the name is ambiguous: both are left out and the collision is logged, until an operator hides one with exclude.

Command hooks. A manifest plugin may declare hooks: commands run at fixed events, each filling one role the manifest must declare. pre_tool (may deny the call or ask for approval), post_tool (may add a note), user_input (may refuse the input or add context), stop and subagent_stop (may ask for more work) fill guard; session_start (adds context on a session's first run) fills context; pre_compact (names facts a summary must keep) fills observer; permission_request (approves or denies an approval, only with grants: [review]) fills reviewer. A hook reads a JSON event on stdin and answers with JSON on stdout or exits with code 2 to block, using Claude Code's protocol, so its hook scripts work unchanged. Every matching hook runs in manifest order and answers merge deny > ask > allow. match is empty or * for all tools, otherwise a case-insensitive regular expression over the tool name. Commands run without a shell in the plugin directory, receive PLUGIN_ROOT, PLUGIN_DATA and CLAUDE_PLUGIN_OPTION_<KEY>, are limited by policy.mcp_commands, and time out after 10 s by default; the Host's bound grows with a longer timeout. A failing hook denies unless it declares on_error: ignore. The payloads, answers, order, merge and failure rules are in hooks.

The original design's declarative form, with a driverRef to an installed driver, becomes this fixed set of adapters. A new kind of declaration needs a new adapter, and that adapter is written as a builtin plugin.

6. Process Plugins

A process plugin is an executable that speaks JSON-RPC 2.0 over stdio with Content-Length framing. The Host launches the platform's command without a shell, in the instance's data directory, so a log or cache it writes where it runs is no change to the approved plugin files (Feishu #243); in process.args a leading ./ or ${PLUGIN_ROOT} names the plugin's own files and ${PLUGIN_DATA} that directory. stdout carries only protocol frames; stderr is captured, capped, and redacted into the log. initialize returns the manifest, and the Host rejects the process if the manifest differs from plugin.yaml. The methods are the role methods; calls back into the Host (host/submit, host/progress, host/ask, host/call_tool, host/chat, host/artifact_*) travel the other way on the same connection. A crashed process is restarted with backoff. Its in-flight calls end as unknown and are reconciled through the ledger by their idempotency keys; they are never replayed blindly. A Go SDK (pkg/plugin/serve) lets a Go plugin run in either form unchanged.

7. Lifecycle and Management

The configuration file is the desired state. Every version the Host loads, and every change made through the commands below, is stored as a numbered revision in the state database.

CommandEffect
orquelo plugins -c CONFIGInstances with localized name, version, roles, status and reason; components of manifest plugins
orquelo plugin install -c CONFIG [-upgrade] [-yes] SOURCEOne transaction with the plugins it depends on (found by name in the catalogs) and the prerequisites they declare; system packages need -yes or the policy allow_system_installs, and a failure rolls back the plugins it added (details). Fetches a catalog name, a local directory, git+URL#<full commit>[:subdir], or https://…tgz|zip#sha256=… into a staging directory; validates the manifest, refuses builtin names, checks the policy and Host range; swaps it in atomically (an upgrade keeps a backup until the swap succeeds); approves its content and records the installation
orquelo plugin doctor -c CONFIG [-yes] NAMEChecks the prerequisites of an installed or builtin plugin and installs the missing ones under the same rules
orquelo plugin add -c CONFIG [-uses a,b] [-option K=V]… ID PLUGINAdds an instance
orquelo plugin enable|disable -c CONFIG IDTurns an instance on or off without removing it
orquelo plugin remove -c CONFIG [-force] IDRefuses while connections or other instances refer to it, and while unfinished runs use it unless -force cancels them; the data directory is kept
orquelo plugin approve -c CONFIG NAMEApproves the current files of a directory plugin
orquelo secret set|delete -c CONFIG INSTANCE NAMEStores (from stdin) or deletes a sensitive option
orquelo config history|rollback -c CONFIG [REV]Lists revisions; restores one
orquelo reload -c CONFIGApplies the file to the running Host. Runs already started, and their sub-tasks, keep their generation; reload says so in its output (Feishu #226). A reload that would stop a working connection (its transport, trigger, runtime, presentation or delivery becomes unavailable) fails with that connection's error, and the current configuration keeps running

Edits change the YAML node by node, so comments are kept. Each edit is validated, written only if the file did not change since it was read, recorded as a revision, and applied by asking the running Host to reload through a control table in the state database (no signals, so it works on every platform). Reload builds a new generation next to the running one. If the build fails, the current generation keeps serving and the reason is returned. If it succeeds, transports and services restart on the new generation; runs already started finish on the instances they started with, and the old instances close when their last run ends.

Catalogs. catalogs: in the Host configuration lists where installable plugins are described: a local catalog.yaml (plugins: [{name, version, description, source}]) or Claude Code marketplace.json, an https URL to one, or git+URL#<commit> of a repository holding one. orquelo plugin search -c CONFIG [TEXT] lists entries, orquelo plugin install -c CONFIG NAME installs one by name, and the admin tool shows them as available. Entries whose source is not pinned to a commit or hash are skipped. Verified with the official Claude Code marketplace at a pinned commit (315 entries; code-review installed by name).

Importing Claude Code and Codex plugins. When a source has no plugin.yaml but a Claude Code manifest (.claude-plugin/plugin.json), a Codex manifest (.codex-plugin/plugin.json) or a portable Agent Plugins plugin.json, install converts it into a manifest plugin and lists what it did. Skills are kept; commands become skills (so /name still works); MCP servers from .mcp.json, mcp.json or inline mcpServers are kept, with ${CLAUDE_PLUGIN_ROOT} and ${CLAUDE_PLUGIN_DATA} mapped to ${PLUGIN_ROOT} and ${PLUGIN_DATA} and ${user_config.KEY} to ${option.KEY}; userConfig becomes options. Claude Code hooks for PreToolUse, PostToolUse, UserPromptSubmit, Stop, SubagentStop, SessionStart, PreCompact and PermissionRequest become command hooks with on_error: ignore (Claude Code treats failing hooks as non-blocking); hook commands that need a shell, and other hook events, are reported. Agents, output styles, LSP servers, workflows, themes, monitors, channels, apps, bin/ and legacy SSE servers have no counterpart yet and are reported as left out. Verified by installing the official frontend-design and hookify plugins from GitHub at a pinned commit; hookify's hooks run in the instance's data directory, so its rule files are placed there rather than in a project directory.

The same operations are offered to Agents by the builtin admin tool plugin. It works only for an instance the operator granted with grants: [manage], and every change needs an admin's approval (approver: admin). Configuring the whole Host through it in natural language, without commands and without a restart, is designed in configuration (2026-11-26, not built).

8. Natural-language Plugin Creation (M7)

The user says: "Wrap the 12306 MCP into a plugin; only I may query trains in Feishu direct chats; no booking." An Agent with the plugin-author skill, the files tool, and the admin tool works through these steps:

  1. Start the given MCP server in a sandbox directory, and list its real tools and schemas.
  2. Write a manifest plugin directory: plugin.yaml with mcp_servers, a tool include list with no booking tools, and a skill drafted from the discovered tools.
  3. Show the manifest, the scope (users: [the requester], conversations: [direct]), and the grants as a diff.
  4. Call plugin_install and plugin_add. Each call is approved by an admin on a card, and the plugin is in use from the next message.

No mechanism here is specific to 12306, and the Agent never invents tools that discovery did not return.

9. What Happened to Each Original Feature

Original featurev2Milestone
One manifest for every package typeKept: plugin.yaml; builtin embeddedM2
Execution builtin / process / declarativeKept as builtin / process / manifest; driver indirection droppedM2, M5, M4
Package, Installation, Instance, Binding, CatalogMerged into Plugin and Instance; the catalog is pinned per RunM2
Provenance, isolation, and grants modeled separatelyKept: source (builtin or installed directory) is recorded; grants are only uses, scope, and approvals; an isolation profile for process plugins (working directory and environment allowlist)M5
permissionsRequested and scopeSupportMerged into permissions, which is informationalM2
Scope selectors (tenant, user, group, channel, trigger, agent, runtime)Kept as users, conversations, connections; agent and runtime are covered by uses; tenant and group are added with the second tenant or a group directoryM2
Config Schema, secret references, diffs, CAS revisions, rollbackKept: JSON Schema, ${ENV} and secrets file, revisions with CAS, rollbackM2, M7
Hot update and drainKept: reload with old instances drainedM7
Install, enable, disable, upgrade, uninstall with blockersKept as CLI commands and admin toolsM7
Dependencies, version resolution, locksSimplified: requires checked at load; content digest recorded at install; resolution and download wait for a registryM7, later
Registry, publish, signatures, archive digestsDeferred until there is a registry; a registry is a separate service, not part of the Hostlater
Platform targets per OS and architectureKept: process.command per platform; unsupported means unavailable with a reasonM5
Display text and locales per plugin, namespacedKeptM2
Extension definitions, five modes, priorities, registration transactionsSimplified: roles are the extension points; Agent hooks follow three rules (contributions add, guards only deny, observers only read); the whole registry is swapped atomicallyM2, M7
Skills: card, body, resources; sources; precedenceKept; project and user skill directories followM4
MCP adapter: discovery, tools, catalog refresh, elicitationKept; MCP resources and prompts follow when a scenario needs themM4
Declarative composition and natural-language creation (12306)Kept as a skill plus the admin toolM7
Remote capabilities through connectorsMCP Streamable HTTP; other remote protocols are pluginsM4
Work leases, Host ownership, generations, multi-nodeDropped: single node, single process (owner decision 2026-11-06)—
Artifact retention policy pluginsHost retention setting now; a policy role is added with its scenariolater
Cron and webhook triggersTransport plugins that submit events; no Host timer neededlater
Validation matrix and conformance testsKept: pkg/plugin/plugintest per role; all three forms pass the same suiteM4, M5

10. Acceptance

  • ◆The 12306 manifest plugin is installed as a directory and used from a Feishu direct chat; the Host diff is zero.
  • ◆The same tool plugin passes the conformance suite as builtin and as process.
  • ◆A tool outside a Run's uses or scope is never listed to the model. Calling it anyway is refused.
  • ◆A revoked instance stops at the next call.
  • ◆An instance with invalid configuration, or with no command for the current platform, is reported unavailable with a reason. Other connections keep working.
  • ◆A failed reload leaves the old registry serving. A successful reload lets started Runs finish on their old instances.
  • ◆plugin remove refuses while a Run, question, or delivery uses the instance.
  • ◆Display text renders in zh-CN and en-US. A missing key falls back deterministically.

11. Host Contract Additions for Later Products

A comparison with Claude Code, Codex and DSH adds further plugin-layer gaps (B1–B18) and the order to close them: see plugin benchmark.

Applying the future product requirements to this design (plugin scenarios) found fourteen gaps. Each addition below is generic. All of them land before the M6 freeze, so that Memory, Wiki, media, external runtimes, more channels, schedules, A2A, ACP, Computer Use, unified login, and the Feishu digital twin are plugins with a zero Host diff.

GapAdditionMilestone
G1 Call contextEvery call from the Host into a plugin carries a CallContext filled by the Host from the Run: run, calling instance, principal, person, conversation, connection, the call chain, and whether the session is shared (Shared, 2026-12-05). Plugins read it and cannot set itM2
G2 Calls from any roleThe host API of every role offers CallTool, Chat, and Embed, limited to the instance's own uses. A nested call keeps the original principal, has only the grants both instances hold, has a depth of at most four, and refuses cyclesM2
G3 Plugin storageA private data directory per instance (state_dir/plugins/<id>/). A credential store keyed by instance and person or principal, encrypted with a Host key file, readable only by the instance that wrote itdata directory M2; credentials before M6
G4 Background servicesA service role: Serve(ctx, host) runs for the instance's lifetime and is restarted with backoff. A transport is a service that may submit eventsM3
G5 Agent hookscontext returns reference items before a model call; it can only add, and a failure or timeout omits it with a record. observer receives committed events (run finished, delivery sent, question answered) from a durable cursor per instance, at least once, and cannot change anything. guard may deny a prepared tool call; a required guard that fails deniesM3
G6 Output targetsOutputs and questions may name other targets, on any connection. The instance's targets grant must allow them, for example the principal's own direct chat or listed conversations. Each target has its own deliveryM2
G7 Rich contentEvents carry attachments as artifacts that the transport stored. Model messages and tool results carry parts: text, image, or file by artifact reference. A model manifest declares its input modalities. Embed is an optional model methodM2
G8 Long operationsA tool marked long may return pending with a poll time. The Run waits with a deadline, and the Host calls the tool again with the same idempotency key. After a restart, a long tool is called again with its key; any other tool whose outcome is unknown is reported, never re-sentbefore M6
G9 Run control for API channelsA transport may query the state and outputs of runs from its own connection, and cancel thembefore M6
G10 IdentityA person links principals on several connections. An identity role runs login flows: device authorization, a localhost callback, or a one-time code sent to the bot in a direct chat. The Host links two principals only when the flow proves both. An approver can be a personbefore M6
G11 EgressThe http tool enforces its own allowlist. Process plugins receive a proxy setting. An operating-system sandbox is future work and stays documented as a limitdocumented
G12 Cross-channel answersA question may be answered from any conversation where the approver is verified, not only where it was askedM2
G13 Usage limitsThe Host meters model usage through Chat per principal and per run, against configured limitsbefore M6
G14 Localized Host textHost notices are message keys with parameters. Presentation renders them in the locale of the conversation or user, with deterministic fallbackM2