import type { ProductProfile } from "./profile.js"; /** hookを起動するNodeと、製品が同梱するhook入口の絶対path。 */ export type HookRuntime = { command: string; script: string; args?: readonly string[]; }; /** * Claude Codeの設定へ書くhookのcommand。shellを通す形で書く。 * `args`を付ける直接起動の形は、同じ設定を読むGrokが`args`を落として`command`だけを動かす(nodeが入力のJSONをscriptとして読んで失敗する)。 * - POSIX: `sh -c`で動く。`exec`でshをnodeへ置き換え、Claude Codeをhookの直接の親に保つ。 * - Windows: PowerShellで動かす(GrokもPowerShellで動かす)。PowerShellは終了codeを0か1へ丸めるので、asyncRewakeの2をそのまま返す。 * `$LASTEXITCODE`とは書かない。Grokが`$名前`を環境変数として読み、未設定としてhookを動かさない。 */ export declare function claudeParentHookCommand(hook: HookRuntime, platform?: NodeJS.Platform): { command: string; shell?: "powershell"; }; export declare function claudeParentHookEntries(profile: ProductProfile, hook: HookRuntime, platform?: NodeJS.Platform): Record[]; }[]>; export declare function mergeClaudeParentHooks(profile: ProductProfile, file: string, hook: HookRuntime): "configured" | "unchanged"; /** * 配送に要る全てのeventに、当製品のhookがあるか(設定を読むだけ。形は旧・新のどちらでもよい)。 * SessionStartは求めない。無い登録(0.4.1まで)でも配送は成り立ち、起動し直した会話は最初の番の終わりから受け取る。 */ export declare function claudeParentHooksRegistered(profile: ProductProfile, document: unknown): boolean; /** 登録済みの当製品のhookが指す入口のpath。入口のfileが残っているかを製品が確かめるために使う。 */ export declare function claudeParentHookScripts(profile: ProductProfile, document: unknown): string[]; /** hookを持たない旧版へ戻す前に、当製品の登録だけを除く。 */ export declare function removeClaudeParentHooks(profile: ProductProfile, file: string): "removed" | "unchanged"; export declare function cursorParentHookCommand(hook: HookRuntime): string; /** * commandが、その名前のfileを指しているか。名前の前はpathの区切りか引用符か空白、後ろは引用符か空白か末尾に限る。 * 部分一致で見ると、`cursor-parent-hook.js`が他製品の`gpt-connector-cursor-parent-hook.js`にも当たり、他製品のhookを消す。 */ export declare function commandNamesFile(command: string, file: string): boolean; export declare function mergeCursorParentHooks(profile: ProductProfile, file: string, hook: HookRuntime): "configured" | "unchanged"; export declare function removeCursorParentHooks(profile: ProductProfile, file: string): "removed" | "unchanged";