/** * Hooks bridge — runs Claude Code / native-plugin shell hooks against hoocode events. * * Claude Code hooks are shell commands wired to named events and matched by tool * name. hoocode hooks are TypeScript handlers on the {@link ExtensionEvent} union. * This bridge registers handlers that shell out per the hook protocol and translate * stdin JSON + exit codes + stdout JSON back into hoocode result objects. * * Protocol (faithful to Claude Code): * - Input: a JSON object on stdin describing the event. * - Exit 0: success. stdout may carry a JSON decision; for prompt/session events * plain stdout is treated as additional context. * - Exit 2: blocking error. stderr (or JSON `reason`) is the block reason. * - Other non-zero: non-blocking error (logged, not surfaced to the model). * - Optional stdout JSON: `{ decision: "block"|"approve", reason, permissionDecision }`. */ import type { ExtensionAPI } from "../types.js"; import type { PluginHooksConfig } from "./manifest.js"; /** * Register all hook events for one plugin against the ExtensionAPI. * `onError` reports non-blocking failures (kept off the model's path). */ export declare function installPluginHooks(hoo: ExtensionAPI, hooks: PluginHooksConfig, root: string, vars: Record, onError: (message: string) => void): void; //# sourceMappingURL=hooks-bridge.d.ts.map