/**
 * @fileoverview Claude Code hooks configuration generator.
 *
 * Generates `.claude/settings.local.json` with hook definitions that POST
 * to Codeman's `/api/hook-event` endpoint when Claude Code fires hooks.
 * Uses `$CODEMAN_API_URL`, `$CODEMAN_SESSION_ID`, and `$CODEMAN_HOOK_SECRET_FILE`
 * env vars (set on every managed session) so the config is static per case
 * directory and free of secret values.
 *
 * Key exports:
 * - `generateHooksConfig()` — returns hooks object for settings.local.json
 * - `writeHooksConfig(casePath)` — writes hooks + env config to disk
 * - `updateCaseEnvVars(casePath, envVars)` — merges env vars into settings
 *
 * Hook events generated: `idle_prompt`, `permission_prompt`, `elicitation_dialog`,
 * `stop`, `teammate_idle`, `task_completed`
 *
 * Hook categories: `Notification` (3 matchers), `Stop` (1), `TeammateIdle` (1),
 * `TaskCompleted` (1)
 *
 * @dependencies types (HookEventType), config/auth-config (HOOK_TIMEOUT_MS)
 * @consumedby web/server (session creation), session-cli-builder (env setup)
 *
 * @module hooks-config
 */
/**
 * Generates the hooks section for .claude/settings.local.json
 *
 * The hook commands read stdin JSON from Claude Code (contains tool_name,
 * tool_input, etc.) and forward it as the `data` field to Codeman's API.
 * Env vars are resolved at runtime by the shell, so the config is static
 * per case directory.
 */
export declare function generateHooksConfig(): {
    hooks: Record<string, unknown[]>;
};
/**
 * Remove a subset of env keys from .claude/settings.local.json.env if present.
 * Used during the disk→tmux-setenv migration: when the caller is actively setting
 * a fresh value for a Codeman-managed key, any stale disk entry for THAT KEY is
 * superseded and should be removed. Keys NOT in `keysToRemove` are left alone
 * (they may be user-managed). No-op if the file/keys don't exist.
 */
export declare function stripCaseEnvKeys(casePath: string, keysToRemove: readonly string[]): Promise<void>;
/**
 * Updates env vars in .claude/settings.local.json for the given case path.
 * Merges with existing env field; removes vars set to empty string.
 */
export declare function updateCaseEnvVars(casePath: string, envVars: Record<string, string>): Promise<void>;
/**
 * Updates the `model` field in .claude/settings.local.json for the given case path.
 * Pass a non-empty string to set, or empty/null to remove.
 */
export declare function updateCaseModel(casePath: string, model: string | null): Promise<void>;
/**
 * Writes hooks config to .claude/settings.local.json in the given case path.
 * Merges with existing file content, only touching the `hooks` key.
 */
export declare function writeHooksConfig(casePath: string): Promise<void>;
/**
 * Self-heal a case's hooks block so the COD-91 unconditional hook-secret gate keeps
 * accepting its hook events.
 *
 * `writeHooksConfig` only runs when a case is first CREATED. Cases created before the
 * X-Codeman-Hook-Secret header was added (COD-54, 2026-06-10) keep hook curls in their
 * settings.local.json that POST to /api/hook-event WITHOUT the secret — which, once the
 * gate requires it unconditionally (COD-91), silently 401 on a password-protected
 * install. This refreshes the hooks block so those stale curls regain the header.
 *
 * Deliberately surgical: regenerates ONLY when settings.local.json already contains
 * Codeman's own hook curls (they target `/api/hook-event`) that lack the secret header.
 * No-op when the file/hooks are absent (we never impose hooks on a user who removed
 * them), when the hooks aren't ours, or when the secret is already present — so it never
 * clobbers a user's customizations and is cheap enough to call on every Claude spawn.
 */
export declare function refreshStaleHookSecret(casePath: string): Promise<void>;
/**
 * The plan-usage statusLine exporter command. Mirrors the hook `curlCmd` pattern:
 * reads Claude Code's statusline stdin JSON, POSTs `{sessionId,data}` to Codeman,
 * and prints the response body (a compact "⟳ 5h 15% · 7d 34%" footer) back to
 * stdout so the in-terminal statusline stays useful. Env vars resolve at runtime
 * (present in every managed session via tmux setenv), so the config is static.
 */
export declare function generateStatusLineCommand(): string;
/**
 * Add or remove Codeman's plan-usage statusLine exporter in
 * `.claude/settings.local.json`. Only ever touches a statusLine that is OURS
 * (command targets `/api/status-telemetry`), so a user's hand-authored
 * statusLine is never removed OR overwritten — on both the enable and disable
 * paths we bail out when an existing statusLine isn't ours. Callers gate on
 * Claude mode. Merges, preserving all other keys (hooks, env, model).
 */
export declare function applyStatusLineConfig(casePath: string, enabled: boolean): Promise<void>;
//# sourceMappingURL=hooks-config.d.ts.map