Skip to main content

Module process_extension

Module process_extension 

Source
Expand description

Process-hosted extension contract (roadmap phases 64, 95, and 97).

A process extension is a non-Rust child process that registers ordinary extension services (inference engines, event sinks, tool providers, subagent dispatchers, task executors) through a manifest and speaks newline-delimited JSON-RPC 2.0 over stdio. These DTOs are the canonical protocol: the Rust host serializes them as-is and child implementations (e.g. the Python POCs, the Cursor SDK TypeScript extension) must round-trip them without raw unowned JSON.

Method names (host -> child requests unless noted):

  • extension/initialize
  • inference/listModels
  • inference/streamTurn
  • inference/event (child -> host notification)
  • subagents/definitions
  • subagents/dispatch
  • subagents/event (child -> host notification)
  • subagents/cancel
  • tasks/spec
  • tasks/execute
  • tasks/event (child -> host notification)
  • tasks/cancel
  • tools/call
  • events/handle (host -> child notification)
  • extension/event (child -> host notification)
  • extension/shutdown

Structs§

ProcessEventFilter
Prefix filter over canonical event kinds, e.g. ["turn.", "inference."].
ProcessEventsHandleNotification
events/handle notification payload (host -> child).
ProcessExtensionConfig
One [[process_extensions]] config entry. env is an explicit allowlist — the host never forwards its full environment.
ProcessExtensionManifest
The manifest TOML shipped next to a process extension.
ProcessExtensionOwnedEvent
extension/event notification payload (child -> host): a typed, extension-owned event. Payloads must already be redacted by the child; the host additionally enforces a size cap before re-emitting.
ProcessInferenceEventNotification
inference/event notification payload (child -> host). The host routes by stream_id and converts event into the runtime inference stream.
ProcessInitializeParams
extension/initialize params (host -> child).
ProcessInitializeResult
extension/initialize result (child -> host).
ProcessListModelsParams
inference/listModels params.
ProcessListModelsResult
ProcessStreamTurnAck
ProcessStreamTurnParams
inference/streamTurn params: a canonical request plus turn provenance.
ProcessSubagentCancelParams
subagents/cancel params (host -> child request; result is empty).
ProcessSubagentDefinitionsParams
subagents/definitions params (host -> child).
ProcessSubagentDefinitionsResult
subagents/definitions result (child -> host).
ProcessSubagentDispatchAck
ProcessSubagentDispatchParams
subagents/dispatch params: a canonical request plus parent provenance and a host-chosen dispatch id the child must echo and stream against.
ProcessSubagentEventNotification
subagents/event notification payload (child -> host). The host routes by dispatch_id; completed/failed are terminal.
ProcessTaskCancelParams
tasks/cancel params (host -> child request; result is empty).
ProcessTaskEventNotification
tasks/event notification payload (child -> host). The host routes by execution_id; completed/failed are terminal.
ProcessTaskExecuteAck
ProcessTaskExecuteParams
tasks/execute params: canonical task input plus execution provenance and a host-chosen execution id the child must echo and stream against.
ProcessTaskSpecParams
tasks/spec params (host -> child).
ProcessTaskSpecResult
tasks/spec result (child -> host).
ProcessToolCallParams
tools/call params (host -> child): one invocation of a tool the manifest declared under a tool_provider service.
ProcessToolCallResult
tools/call result (child -> host): the subset of the native crate::tools::ToolResult a child populates. content becomes the model-visible text, optional data carries a structured payload, and is_error marks a tool-level failure without failing the turn.

Enums§

ProcessProvidedService
A manifest service declaration; mirrors ProvidedService variants the process host supports. Tool providers declare their ToolSpecs statically so the registry can be built deterministically without spawning the child.
ProcessSubagentEvent
ProcessTaskEvent

Constants§

METHOD_EVENTS_HANDLE
METHOD_EXTENSION_EVENT
METHOD_INFERENCE_EVENT
METHOD_INITIALIZE
METHOD_LIST_MODELS
METHOD_SHUTDOWN
METHOD_STREAM_TURN
METHOD_SUBAGENTS_CANCEL
METHOD_SUBAGENTS_DEFINITIONS
METHOD_SUBAGENTS_DISPATCH
METHOD_SUBAGENTS_EVENT
METHOD_TASKS_CANCEL
METHOD_TASKS_EVENT
METHOD_TASKS_EXECUTE
METHOD_TASKS_SPEC
METHOD_TOOLS_CALL
PROCESS_EXTENSION_PROTOCOL_VERSION
Protocol version spoken by the host; children must echo a compatible version from extension/initialize. Bumped to 0.2.0 when subagent dispatcher, task executor (phase 95), and tool provider (phase 97) services were added.

Functions§

manifest_checksum
FNV-1a 64-bit checksum (hex) of the manifest bytes. Not cryptographic — it only detects manifest drift between host config and child package.
validate_initialize_echo
Validates the child’s initialize echo against the configured manifest. Mismatches fail closed: the host refuses to register services from a child that disagrees about identity, API, or provided services.
validate_manifest
Validates the manifest against the host’s supported extension API.