Skip to content
mercury framework
GitHub

PluginRuntimeContributions

PluginRuntimeContributions = object

Defined in: types/plugin-types/index.ts:272

The env/model-dependent half of a plugin’s contributions, produced by build() (which may be async, e.g. to validate its own config before building its tool). Every field optional: a plugin may contribute nothing.

  • postProcess: the result transform for the plugin’s own tool (see CliPostProcessor). A formatter decorator may wrap it to render a display; the composition then hands the final one to sessionTools (which is why the factory takes it as an argument rather than closing over it — the wrapping happens after build() returns).
  • sessionTools: builds the plugin’s model-facing tools for one turn, given the session context and the plugin’s (possibly decorated) post-processor. This is how a tool reaches the model without the core knowing what it is.
  • toolStatusDescribers: one per tool name the plugin contributes, turning a tool call’s input into the one-line status shown while it runs, in the turn’s person’s language (t) — so the core can label a plugin’s tool without knowing it’s a CLI.
  • postTurnGuards: run over the model’s finished text (see PostTurnGuard).
  • login: how a plugin acting as person logs one in (see PersonLogin).

optional login?: PersonLogin

Defined in: types/plugin-types/index.ts:274


optional postProcess?: CliPostProcessor

Defined in: types/plugin-types/index.ts:273


optional postTurnGuards?: PostTurnGuard[]

Defined in: types/plugin-types/index.ts:277


optional sessionTools?: (ctx, postProcess?) => Record<string, Tool>

Defined in: types/plugin-types/index.ts:275

SessionToolContext

CliPostProcessor

Record<string, Tool>


optional toolStatusDescribers?: Record<string, (input, t) => string>

Defined in: types/plugin-types/index.ts:276