For AI agents: the complete documentation index is available at https://scriptedalchemy.github.io/agent-bundle/llms.txt, the full documentation bundle is available at https://scriptedalchemy.github.io/agent-bundle/llms-full.txt, and this page is available as Markdown at https://scriptedalchemy.github.io/agent-bundle/api/interfaces/api.TargetHookContract.md.
  • English
  • Interface: TargetHookContract

    Properties

    commandRoot

    readonly commandRoot: string


    documentEntry?

    readonly optional documentEntry?: (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?

    readonly optional documentEnvelope?: (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

    readonly encodePlaygroundInput: (input, nativeEvent) => Readonly<Record<string, unknown>>

    Parameters

    input

    Readonly<Record<string, unknown>>

    nativeEvent

    string

    Returns

    Readonly<Record<string, unknown>>


    encodePlaygroundOutput

    readonly encodePlaygroundOutput: (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

    readonly eventNames: Readonly<Partial<Record<CanonicalHookEvent, string>>>


    eventRouteNames?

    readonly optional eventRouteNames?: 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?

    readonly optional hostContractRevision?: string


    indexedWrappers?

    readonly optional indexedWrappers?: 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

    readonly manifestPath: string


    matchers

    readonly matchers: Readonly<Partial<Record<CanonicalHookTool, string>>>


    nativeEventStarter?

    readonly optional nativeEventStarter?: (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?

    readonly optional readNativeCommands?: (document) => TargetNativeHookCommandsReadResult

    Parameters

    document

    unknown

    Returns

    TargetNativeHookCommandsReadResult


    wrapperPath

    readonly wrapperPath: (hook) => string

    Parameters

    hook

    NormalizedHook

    Returns

    string


    wrapperSource

    readonly wrapperSource: (entry) => string

    Parameters

    entry

    TargetHookWrapper

    Returns

    string