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/initializeinference/listModelsinference/streamTurninference/event(child -> host notification)subagents/definitionssubagents/dispatchsubagents/event(child -> host notification)subagents/canceltasks/spectasks/executetasks/event(child -> host notification)tasks/canceltools/callevents/handle(host -> child notification)extension/event(child -> host notification)extension/shutdown
Structs§
- Process
Event Filter - Prefix filter over canonical event kinds, e.g.
["turn.", "inference."]. - Process
Events Handle Notification events/handlenotification payload (host -> child).- Process
Extension Config - One
[[process_extensions]]config entry.envis an explicit allowlist — the host never forwards its full environment. - Process
Extension Manifest - The manifest TOML shipped next to a process extension.
- Process
Extension Owned Event extension/eventnotification 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.- Process
Inference Event Notification inference/eventnotification payload (child -> host). The host routes bystream_idand convertseventinto the runtime inference stream.- Process
Initialize Params extension/initializeparams (host -> child).- Process
Initialize Result extension/initializeresult (child -> host).- Process
List Models Params inference/listModelsparams.- Process
List Models Result - Process
Stream Turn Ack - Process
Stream Turn Params inference/streamTurnparams: a canonical request plus turn provenance.- Process
Subagent Cancel Params subagents/cancelparams (host -> child request; result is empty).- Process
Subagent Definitions Params subagents/definitionsparams (host -> child).- Process
Subagent Definitions Result subagents/definitionsresult (child -> host).- Process
Subagent Dispatch Ack - Process
Subagent Dispatch Params subagents/dispatchparams: a canonical request plus parent provenance and a host-chosen dispatch id the child must echo and stream against.- Process
Subagent Event Notification subagents/eventnotification payload (child -> host). The host routes bydispatch_id;completed/failedare terminal.- Process
Task Cancel Params tasks/cancelparams (host -> child request; result is empty).- Process
Task Event Notification tasks/eventnotification payload (child -> host). The host routes byexecution_id;completed/failedare terminal.- Process
Task Execute Ack - Process
Task Execute Params tasks/executeparams: canonical task input plus execution provenance and a host-chosen execution id the child must echo and stream against.- Process
Task Spec Params tasks/specparams (host -> child).- Process
Task Spec Result tasks/specresult (child -> host).- Process
Tool Call Params tools/callparams (host -> child): one invocation of a tool the manifest declared under atool_providerservice.- Process
Tool Call Result tools/callresult (child -> host): the subset of the nativecrate::tools::ToolResulta child populates.contentbecomes the model-visible text, optionaldatacarries a structured payload, andis_errormarks a tool-level failure without failing the turn.
Enums§
- Process
Provided Service - A manifest service declaration; mirrors
ProvidedServicevariants the process host supports. Tool providers declare theirToolSpecs statically so the registry can be built deterministically without spawning the child. - Process
Subagent Event - Process
Task Event
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.