HostAdapter
Defined in: types/dist/host.d.ts:79
The host-adapter contract. An adapter package translates a host’s lifecycle into the abstract events the core already speaks, declares its capabilities, extracts payloads, and installs itself into the host.
Only the core-facing surface is pinned here. Install option shapes are intrinsically host-specific, so they are left as type parameters rather than coupled to any one host. Runtime plumbing a host needs internally (request routing, locating its own install) is a documented responsibility, not part of this type — see the “write your own adapter” guide.
Type Parameters
Section titled “Type Parameters”HookOpts
Section titled “HookOpts”HookOpts = unknown
host-specific options for HostAdapter.installHooks
CommandOpts
Section titled “CommandOpts”CommandOpts = unknown
host-specific options for HostAdapter.installCommands
Properties
Section titled “Properties”capabilities
Section titled “capabilities”
readonlycapabilities:object
Defined in: types/dist/host.d.ts:83
What the host environment can do.
agentIdentification?
Section titled “agentIdentification?”
optionalagentIdentification?:boolean
blockingHooks
Section titled “blockingHooks”blockingHooks: (
"session-start"|"user-prompt"|"pre-tool-edit"|"post-tool-edit"|"session-stop"|"subagent-result"|"subagent-start"|"skill-invoke")[]
hooks: (
"session-start"|"user-prompt"|"pre-tool-edit"|"post-tool-edit"|"session-stop"|"subagent-result"|"subagent-start"|"skill-invoke")[]
skillSystem
Section titled “skillSystem”skillSystem:
"none"|"native"|"prompted"
slashCommands
Section titled “slashCommands”slashCommands:
boolean
streamingOutput
Section titled “streamingOutput”streamingOutput:
boolean
subagentSpawn
Section titled “subagentSpawn”subagentSpawn:
"none"|"native"|"shell-out"
contractVersion
Section titled “contractVersion”
readonlycontractVersion:number
Defined in: types/dist/host.d.ts:81
Contract version this adapter targets; must equal ADAPTER_CONTRACT_VERSION.
Methods
Section titled “Methods”extractPayload()
Section titled “extractPayload()”extractPayload(
raw):ExtractedPayload|undefined
Defined in: types/dist/host.d.ts:87
Extract the normalized payload from a host’s raw event.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”ExtractedPayload | undefined
installCommands()
Section titled “installCommands()”installCommands(
root,options?):unknown
Defined in: types/dist/host.d.ts:91
Install the host’s slash-command (or equivalent) surface, under project root.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”CommandOpts
Returns
Section titled “Returns”unknown
installHooks()
Section titled “installHooks()”installHooks(
root,options?):unknown
Defined in: types/dist/host.d.ts:89
Wire the host’s lifecycle hooks to the cadence shim, under project root.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”HookOpts
Returns
Section titled “Returns”unknown
mapEvent()
Section titled “mapEvent()”mapEvent(
hostEvent,toolName?):"session-start"|"user-prompt"|"pre-tool-edit"|"post-tool-edit"|"session-stop"|"subagent-result"|"subagent-start"|"skill-invoke"|null
Defined in: types/dist/host.d.ts:85
Map a host lifecycle event name to its abstract event, or null if unmapped.
Parameters
Section titled “Parameters”hostEvent
Section titled “hostEvent”string
toolName?
Section titled “toolName?”string
Returns
Section titled “Returns”"session-start" | "user-prompt" | "pre-tool-edit" | "post-tool-edit" | "session-stop" | "subagent-result" | "subagent-start" | "skill-invoke" | null