export interface HookInstallConfig { readonly configPath: string; readonly format: 'claude-settings' | 'opencode-plugin' | 'opencode2-plugin' | 'grok-hooks'; /** Claude read-isolation: merge the shared settings `env` map into a * per-bot settings file before installing hooks. Shared values win so * rotated auth/provider/proxy settings refresh on every cold spawn; global * hooks and unrelated top-level settings are deliberately not inherited. */ readonly inheritClaudeEnvFrom?: string; /** 可选:SessionStart 就绪 hook 命令。 * - claude-settings:写全局 settings.json * - grok-hooks:写 `~/.grok/hooks/*.json` 的 SessionStart * 见 adapters/cli/types.ts 同名字段。 */ readonly sessionStartCommand?: string; /** 可选:UserPromptSubmit per-turn 上下文 hook 命令(#794)。 * 仅 claude-settings:写全局 settings.json 的 hooks.UserPromptSubmit。 */ readonly userPromptSubmitCommand?: string; } /** * TRAE now routes native user-input through its RPC app-server. Remove only * legacy botmux `hook traex` entries so they cannot race the RPC bridge and * emit a duplicate Ask card. A hook group may contain multiple commands, so * strip only the botmux entry and preserve unrelated user hooks in that group. */ export declare function cleanupTraexAskHooks(configPaths: readonly string[]): void; /** * Read-only preflight used by the worker before it arms the ready gate. * Installation is intentionally best-effort, so the gate must not assume that * a requested SessionStart hook actually reached the CLI's effective config. */ export declare function hasInstalledSessionReadyHook(hookInstall: HookInstallConfig): boolean; /** * Read-only preflight: is the botmux UserPromptSubmit hook present in the * settings file the CLI actually reads? 结构化匹配(不像 * hasInstalledSessionReadyHook 那样按完整字符串相等——dev checkout 与 npm global * 的 cli.js 路径不同,精确匹配会把已安装的 hook 误判为未安装)。 */ export declare function hasInstalledPromptHook(hookInstall: HookInstallConfig): boolean; /** 按实际 settings 路径做 preflight。read-isolation 下 CLI 经 CLAUDE_CONFIG_DIR * 实际读的是 per-bot BOT_HOME/claude/settings.json,不是全局那份——调用方需传入 * effective 路径(与 worker 的 effectiveReadyHookInstall 改写同逻辑)。 */ export declare function hasInstalledPromptHookAtPath(configPath: string): boolean; export declare function hasInstalledPromptHookCached(configPath: string): boolean; /** * 幂等地将 botmux ask hook 安装到指定 CLI 的配置文件。 * * @param cliId - CLI 标识符(用于日志) * @param hookInstall - adapter 提供的安装描述(configPath + format) * @param hookCommand - botmux hook 子命令的完整调用字符串 * 例如:"/usr/bin/node /path/to/cli.js hook claude-code" */ export declare function installHook(cliId: string, hookInstall: HookInstallConfig, hookCommand: string): void; //# sourceMappingURL=hook-installer.d.ts.map