/** * The `timeout` of every command hook this module registers, in seconds. * Claude Code applies 60 seconds to a command hook that has none. The value is * written into settings.json so the bound is visible in the file. */ export declare const HOOK_TIMEOUT_SECONDS = 60; type HookEntry = { matcher: string; hooks: Array<{ type: string; command: string; timeout?: number; }>; }; /** The two events the board loop needs, and the flag each one passes. */ export declare const BOARD_HOOKS: ReadonlyArray<{ event: string; mode: 'claim' | 'close'; }>; /** * The command Claude Code runs for one half of the loop. * * Both paths are quoted because either can contain a space — a Windows home * directory ("C:\\Users\\First Last") reaches here, and an unquoted command * splits at it. */ export declare function boardHookCommand(execPath: string, cliEntry: string, mode: 'claim' | 'close'): string; /** * True when this hook entry is one of ours. * * It answers for two shapes. The first is the CLI command above. The second is * `chat_recall_task_hook.sh`, a wrapper that shipped briefly and did nothing * but pipe stdin to that same command — a registration pointing at it survives * an upgrade, and the script it names is gone, so it must be recognised to be * cleaned up. */ export declare function isBoardHookEntry(entry: unknown): boolean; /** The `[event, entry]` pairs for a settings.json. */ export declare function boardHookEntries(execPath: string, cliEntry: string): Array<[string, HookEntry]>; /** * The events of the message hook's turn runs. SessionStart tells the session * its own id; the prompt and the turn end deliver what already waits; * SessionEnd marks the session ended so a parent stops waiting for it. */ export declare const MESSAGE_HOOK_EVENTS: readonly string[]; /** * The events that start the waiter. It runs in the background (asyncRewake) * until a message arrives, then exits 2 and Claude Code wakes the session; the * turn that follows ends in a Stop, which starts the next waiter. */ export declare const MESSAGE_WAITER_EVENTS: readonly string[]; /** * How long Claude Code leaves the waiter running, in seconds. * * Claude Code enforces `timeout` on an asyncRewake hook, unlike a plain async * one, and kills it at 600 s when the entry sets none. Nothing starts another * waiter while the session is idle, so a session idle for longer than that went * deaf: a message to it waited until its user typed, which started a turn and * delivered the message with the prompt. A day outlives any real idle period, * and the waiter still ends with the session (it watches the session's own * process) or with the first message (exit 2, which wakes the session). */ export declare const MESSAGE_WAITER_TIMEOUT_SECONDS = 86400; /** The command Claude Code runs for the message hook. Both paths quoted, as above. */ export declare function messageHookCommand(execPath: string, hookEntry: string, waiter?: boolean): string; /** True when this hook entry is the message hook, its turn run or its waiter. */ export declare function isMessageHookEntry(entry: unknown): boolean; /** True when this hook entry is the waiter. */ export declare function isMessageWaiterEntry(entry: unknown): boolean; /** * True when the waiter entry carries the lifetime this version needs. * * A profile written before the waiter had a timeout keeps a waiter that dies * after 600 s, and `ensureHooks` must replace it even when the version it * recorded has not changed. */ export declare function isCurrentMessageWaiterEntry(entry: unknown): boolean; type HookCommand = { type: string; command: string; asyncRewake?: boolean; timeout?: number; }; /** The `[event, entry]` pairs for the message hook: the turn runs, then the waiters. */ export declare function messageHookEntries(execPath: string, hookEntry: string): Array<[string, { matcher: string; hooks: HookCommand[]; }]>; /** Resolve the CLI entry that a hook should run. */ export declare function resolveCliEntry(distDir: string): string; /** Resolve the message hook bundle that sits beside the CLI. */ export declare function resolveMessageHookEntry(distDir: string): string; export {}; //# sourceMappingURL=board-hooks.d.ts.map