Interface: TargetHookContract
Properties
commandRoot
readonlycommandRoot:string
documentEntry?
readonlyoptionaldocumentEntry?: (input) =>Record<string,unknown>
Shapes one generated hook command into the host's per-event array entry.
Defaults to the Claude/Codex grouped shape; Cursor's document keeps flat
{ command, matcher?, timeout? } entries.
Parameters
input
TargetHookDocumentEntryInput
Returns
Record<string, unknown>
documentEnvelope?
readonlyoptionaldocumentEnvelope?: (hooks) =>Record<string,unknown>
Wraps the per-event groups into the host's document root; defaults to { hooks }.
Parameters
hooks
Record<string, unknown[]>
Returns
Record<string, unknown>
encodePlaygroundInput
readonlyencodePlaygroundInput: (input,nativeEvent) =>Readonly<Record<string,unknown>>
Parameters
input
Readonly<Record<string, unknown>>
nativeEvent
string
Returns
Readonly<Record<string, unknown>>
encodePlaygroundOutput
readonlyencodePlaygroundOutput: (result,canonicalEvent,nativeEvent) =>Readonly<Record<string,unknown>> |undefined
Parameters
result
Readonly<Record<string, unknown>> | undefined
canonicalEvent
"stop" | "sessionStart" | "beforeTool" | "afterTool" | "agentStart" | "agentStop" | "workspaceOpen"
nativeEvent
string
Returns
Readonly<Record<string, unknown>> | undefined
eventNames
readonlyeventNames:Readonly<Partial<Record<CanonicalHookEvent,string>>>
eventRouteNames?
readonlyoptionaleventRouteNames?:Readonly<Partial<Record<"session/start"|"tool/before"|"tool/after"|"stop"|"agent/start"|"agent/stop"|"workspace/open"|"session/end"|"prompt/submit"|"tool/failure"|"compact/before"|"compact/after"|"permission/request"|"permission/denied"|"stop/failure"|"file/change"|"config/change"|"task/create"|"task/complete"|"agent/idle",string>>>
hostContractRevision?
readonlyoptionalhostContractRevision?:string
indexedWrappers?
readonlyoptionalindexedWrappers?:false
False when this contract plans host-document wrapper variants of hooks whose canonical wrappers another contract already indexes; the canonical hook index keeps exactly one entry per hook and target.
manifestPath
readonlymanifestPath:string
matchers
readonlymatchers:Readonly<Partial<Record<CanonicalHookTool,string>>>
nativeEventStarter?
readonlyoptionalnativeEventStarter?: (canonicalEvent) =>Readonly<Record<string,unknown>> |undefined
Minimal checked-in host envelope for semantic lifecycle replay.
Parameters
canonicalEvent
"session/start" | "tool/before" | "tool/after" | "stop" | "agent/start" | "agent/stop" | "workspace/open" | "session/end" | "prompt/submit" | "tool/failure" | "compact/before" | "compact/after" | "permission/request" | "permission/denied" | "stop/failure" | "file/change" | "config/change" | "task/create" | "task/complete" | "agent/idle"
Returns
Readonly<Record<string, unknown>> | undefined
readNativeCommands?
readonlyoptionalreadNativeCommands?: (document) =>TargetNativeHookCommandsReadResult
Parameters
document
unknown
Returns
TargetNativeHookCommandsReadResult
wrapperPath
readonlywrapperPath: (hook) =>string
Parameters
hook
NormalizedHook
Returns
string
wrapperSource
readonlywrapperSource: (entry) =>string
Parameters
entry
Returns
string