/**
 * installCodexHooks — wire instar's safety gates into a Codex CLI agent's
 * native hook system, the Codex mirror of `installClaudeSettings`.
 *
 * Spec: docs/specs/codex-enforcement-hook-layer.md
 *
 * WHY: on Claude agents, instar's gates (external-operation, response-review,
 * grounding, deferral, session-start, topic-context) are enforced via
 * `.claude/settings.json` hooks. On Codex agents nothing enforced them — the
 * gates were awareness-only. Codex CLI supports a Claude-compatible blocking
 * hook system (verified: developers.openai.com/codex/hooks — PreToolUse can
 * deny via `permissionDecision` or exit-2; events incl. SessionStart,
 * PreToolUse, PermissionRequest, PostToolUse, UserPromptSubmit, Stop). This
 * writes the gate registrations into Codex's discovery path.
 *
 * SCOPING (correctness-critical): writes the **per-project**
 * `<projectDir>/.codex/hooks.json`, NOT the global `~/.codex/hooks.json`.
 * The global root is shared with the operator's personal desktop Codex and
 * every other Codex project on the machine — global enforcement hooks would
 * intercept the operator's personal sessions. Per-project `.codex/` is a
 * documented Codex discovery path and scopes the gates to this agent only.
 *
 * Invocation contract (Codex): the command receives the event JSON on stdin
 * (no args), runs with the session cwd as working directory. We register
 * absolute paths so discovery does not depend on cwd. The gate scripts'
 * Codex-payload parsing is handled by the framework shim (spec P2); this
 * module only writes the registrations.
 *
 * Idempotent + merge-safe: instar-owned entries are identified by a command
 * path under `.instar/hooks/instar/` and replaced on every run; any
 * user-added Codex hooks are preserved untouched.
 */
/** Marker that identifies an instar-owned hook command (for merge-safe replace). */
export declare const INSTAR_HOOK_PATH_MARKER = ".instar/hooks/instar/";
/**
 * The autonomous-loop driver hook lives in the autonomous skill, not under
 * `.instar/hooks/instar/`, so it needs its own ownership marker — used both to build
 * its command path and to let groupIsInstarOwned() recognize (and replace, never
 * duplicate) the autonomous Stop group on every re-install.
 */
export declare const CODEX_AUTONOMOUS_HOOK_MARKER = ".claude/skills/autonomous/hooks/autonomous-stop-hook.sh";
interface CodexHookHandler {
    type: 'command';
    command: string;
    timeout?: number;
}
interface CodexHookGroup {
    matcher?: string;
    hooks: CodexHookHandler[];
}
/** Build the instar-owned hook groups for each Codex event, with absolute script paths. */
export declare function buildInstarCodexHookGroups(projectDir: string): Record<string, CodexHookGroup[]>;
/**
 * Write/merge instar gate hooks into `<projectDir>/.codex/hooks.json`.
 * Preserves any user-added hooks; replaces instar-owned entries.
 */
export declare function installCodexHooks(projectDir: string): string;
export {};
//# sourceMappingURL=installCodexHooks.d.ts.map