/** * HostAdapters — one hook entry point, many agent hosts. * * HostRecall and FixCapture read one payload shape: Claude Code's PostToolUse (`tool_name`, * `tool_input`, `tool_response`, `session_id`, `cwd`). Every other host that can put text in * the model's context after a tool call uses its own names for the same facts, so each gets a * translator in and a formatter out, and the decision of when to speak stays in one place. * * Written against each host's published hook contract (Sept 2026): * - claude — PostToolUse; reply `hookSpecificOutput.additionalContext`. * - codex — PostToolUse with Claude's shape; tools `Bash`, `apply_patch`, `Edit`, `Write`. Codex * has no Read tool — it reads files through the shell — so reads are recovered from * the command line (see shellReadTargets). Same reply as claude. * - cursor — `postToolUse` / `postToolUseFailure`; tools `Read`, `Shell`, `Write`; the tool's * result arrives JSON-stringified in `tool_output`. Reply `{ additional_context }`. * - opencode — no hook protocol; a plugin's `tool.execute.after` appends to the tool output. * The plugin (see openCodeHooks) forwards `{ tool, sessionID, args, output, metadata, * directory }` and appends whatever plain text comes back. * * Unknown fields are ignored and missing ones make the adapter return nothing: a payload this * code doesn't understand must produce silence, never a guess. */ export type Host = 'claude' | 'codex' | 'cursor' | 'opencode'; export declare const HOSTS: Host[]; /** Claude Code's PostToolUse shape — what HostRecall and FixCapture consume. */ export interface NormalizedPayload { session_id: string; cwd?: string; tool_name: string; tool_input: Record; tool_response?: any; } /** * Files a shell command reads (`cat a.ts`, `sed -n '1,80p' a.ts`, `head -50 a.ts | …`). Only * arguments that exist as files count, which also skips sed scripts and flag values. */ export declare function shellReadTargets(command: string, cwd: string): string[]; /** Files named in an apply_patch body (`*** Update File: src/a.ts`). */ export declare function patchTargets(patch: string, cwd: string): string[]; /** Translate one host payload into zero or more Claude-shaped payloads. Never throws. */ export declare function normalizeHostPayload(host: Host, raw: unknown): NormalizedPayload[]; /** What the hook prints on stdout for `note` — empty string means print nothing. */ export declare function formatHostOutput(host: Host, note: string, event?: string): string; export declare function parseHost(value: string | undefined): Host; //# sourceMappingURL=HostAdapters.d.ts.map