Plugins#

Generated from crates/node/plugin.d.ts via sphinx-js.

deregister#

Remove a previously registered plugin kind.

Deletes the plugin kind from the registry so future config validation and initialization calls can no longer reference it. Kind: function

Parameters#

  • pluginKind string: Registered plugin kind identifier to remove.

Returns#

  • boolean: true when a plugin kind was removed, otherwise false.

Remarks#

  • Active runtime registrations remain until clear() or the next successful initialize(...).

register#

Register a plugin kind with JavaScript validation and registration hooks.

Adapts the higher-level Plugin object contract to the native callback shape expected by the Node binding. Kind: function

Parameters#

  • pluginKind string: Unique plugin kind identifier to register.

  • plugin Plugin: Plugin implementation with validate and register hooks.

Remarks#

  • Omitting plugin.validate makes the plugin permissive during validation; plugin.register still runs later during initialize.

listKinds#

List registered plugin kinds.

Returns the plugin kind identifiers currently known to the global registry so callers can inspect what can be referenced from plugin configs. Kind: function

Returns#

  • string[]: The registered plugin kind names.

Remarks#

  • The list reflects registry state only; it does not indicate whether a plugin kind is currently active in the runtime configuration.

report#

Return the last successfully activated plugin report.

Exposes the most recent activation report emitted by the native plugin system without triggering validation or registration work. Kind: function

Returns#

  • ConfigReport: The last activation report, if one exists.

Remarks#

  • This returns null until initialize succeeds at least once in the current process.

clear#

Clear the active plugin configuration.

Removes the currently active component registrations while leaving plugin kinds in the registry so they can be reused by a later initialization call. Kind: function

Remarks#

  • Registered plugin kinds remain available after the active config is cleared.

initialize#

Validate and activate a plugin configuration.

Replaces the current active config, invokes each enabled component’s registration hooks, and resolves with the final activation report. Kind: function

Parameters#

  • config PluginConfig: Plugin configuration document to activate.

Returns#

  • Promise<ConfigReport>: A promise resolving to the activation report.

Remarks#

  • Partial plugin registration is rolled back if activation fails, and the promise rejects with the underlying validation or setup error.

validate#

Validate a plugin configuration without activating it.

Runs the same config validation pipeline used by initialization while leaving the active plugin registry and runtime configuration unchanged. Kind: function

Parameters#

  • config PluginConfig: Candidate plugin configuration document.

Returns#

  • ConfigReport: A structured validation report with diagnostics.

Remarks#

  • Use this to surface warnings or incompatibilities before replacing the active plugin configuration.

ComponentSpec#

Create a plugin component entry for a plugin config document.

Packages a plugin kind, component-local config, and enablement flag into the object shape expected by PluginConfig.components. Kind: function

Parameters#

  • kind string: Registered plugin kind to reference.

  • config Record<string, Json>: Component-local config passed to plugin hooks.

  • options { enabled?: boolean; }: Optional component-level flags.

Returns#

  • ComponentSpec: A ComponentSpec ready to insert into a plugin config.

Remarks#

  • Setting options.enabled = false preserves the component for validation while skipping runtime registration during initialize.

defaultConfig#

Create an empty plugin configuration.

Returns the canonical top-level config shape with version = 1 and no configured components so callers can build a document incrementally before validating or activating it. Kind: function

Returns#

  • PluginConfig: A new PluginConfig object ready for mutation or validation.

Remarks#

  • Mutating the returned object does not affect runtime state until it is passed to initialize.

Plugin#

Plugin callback contract. Kind: interface

Members#

  • validate? unknown: Validate one component-local config object.

  • register unknown: Install middleware and subscribers for one component instance.

Throwing aborts the current initialization and triggers rollback.

PluginContext#

Component-scoped registration context passed to plugin handlers. Kind: interface

Members#

  • registerSubscriber unknown: Register an infallible event subscriber for this component.

  • registerToolSanitizeRequestGuardrail unknown: Register a tool sanitize-request guardrail for this component.

  • registerToolSanitizeResponseGuardrail unknown: Register a tool sanitize-response guardrail for this component.

  • registerToolConditionalExecutionGuardrail unknown: Register a tool conditional-execution guardrail for this component.

  • registerLlmSanitizeRequestGuardrail unknown: Register an LLM sanitize-request guardrail for this component.

  • registerLlmSanitizeResponseGuardrail unknown: Register an LLM sanitize-response guardrail for this component.

  • registerLlmConditionalExecutionGuardrail unknown: Register an LLM conditional-execution guardrail for this component.

  • registerLlmRequestIntercept unknown: Register an LLM request intercept for this component.

  • registerLlmExecutionIntercept unknown: Register an LLM execution intercept for this component.

  • registerLlmStreamExecutionIntercept unknown: Register an LLM streaming execution intercept for this component.

  • registerToolRequestIntercept unknown: Register a tool request intercept for this component.

  • registerToolExecutionIntercept unknown: Register a tool execution intercept for this component.

PluginConfig#

Canonical plugin configuration document. Kind: interface

Members#

  • version? number

  • components? { kind: string; enabled?: boolean; config?: Record<string, Json>; }[]

  • policy? ConfigPolicy

ComponentSpec#

One top-level plugin component. Kind: interface

Members#

  • kind string

  • enabled? boolean

  • config? Record<string, Json>

ConfigReport#

Validation or activation report for a plugin configuration. Kind: interface

Members#

  • diagnostics ConfigDiagnostic[]

ConfigDiagnostic#

One validation or compatibility diagnostic produced by the plugin system. Kind: interface

Members#

  • level "error" | "warning"

  • code string

  • component? string

  • field? string

  • message string

ConfigPolicy#

Plugin-level policy for unknown or unsupported plugin configuration. Kind: interface

Members#

  • unknown_component? UnsupportedBehavior

  • unknown_field? UnsupportedBehavior

  • unsupported_value? UnsupportedBehavior

UnsupportedBehavior#

Policy behavior for unsupported configuration.

Alias Of: "ignore" | "warn" | "error"

Json#

No description available.

Alias Of: any