Skip to content
Français

CodexHookDecisions

import type { CodexHookDecisions } from "@elie-laloum/outpost/core";
  • SessionStartRequired
    string | { readonly decision?: "block"; readonly reason?: string; readonly hookSpecificOutput?: { readonly hookEventName: "SessionStart"; readonly additionalContext?: string; }; readonly continue?: boolean; readonly stopReason?: string; readonly suppressOutput?: boolean; readonly systemMessage?: string; readonly terminalSequence?: string; }
    Accepted native output for SessionStart; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • SessionEndRequired
    never
    Accepted native output for SessionEnd; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • UserPromptSubmitRequired
    string | { readonly decision?: "block"; readonly reason?: string; readonly hookSpecificOutput?: { readonly hookEventName: "UserPromptSubmit"; readonly additionalContext?: string; }; readonly continue?: boolean; readonly stopReason?: string; readonly suppressOutput?: boolean; readonly systemMessage?: string; readonly terminalSequence?: string; }
    Accepted native output for UserPromptSubmit; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • PreToolUseRequired
    { readonly systemMessage?: string; readonly decision?: "block"; readonly reason?: string; readonly hookSpecificOutput?: { readonly hookEventName: "PreToolUse"; readonly permissionDecision?: "allow" | "deny"; readonly permissionDecisionReason?: string; readonly updatedInput?: Readonly<Record<string, unknown>>; readonly additionalContext?: string; }; }
    Accepted native output for PreToolUse; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • PermissionRequestRequired
    { readonly systemMessage?: string; readonly hookSpecificOutput?: { readonly hookEventName: "PermissionRequest"; readonly decision?: { readonly behavior: "allow" | "deny"; readonly message?: string; }; }; }
    Accepted native output for PermissionRequest; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • PostToolUseRequired
    { readonly systemMessage?: string; readonly continue?: boolean; readonly stopReason?: string; readonly decision?: "block"; readonly reason?: string; readonly hookSpecificOutput?: { readonly hookEventName: "PostToolUse"; readonly additionalContext?: string; }; }
    Accepted native output for PostToolUse; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • PreCompactRequired
    { readonly continue?: boolean; readonly stopReason?: string; readonly suppressOutput?: boolean; readonly systemMessage?: string; readonly terminalSequence?: string; }
    Accepted native output for PreCompact; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • PostCompactRequired
    { readonly continue?: boolean; readonly stopReason?: string; readonly suppressOutput?: boolean; readonly systemMessage?: string; readonly terminalSequence?: string; }
    Accepted native output for PostCompact; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • SubagentStartRequired
    string | { readonly decision?: "block"; readonly reason?: string; readonly hookSpecificOutput?: { readonly hookEventName: "SubagentStart"; readonly additionalContext?: string; }; readonly continue?: boolean; readonly stopReason?: string; readonly suppressOutput?: boolean; readonly systemMessage?: string; readonly terminalSequence?: string; }
    Accepted native output for SubagentStart; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • SubagentStopRequired
    { readonly decision?: "block"; readonly reason?: string; readonly continue?: boolean; readonly stopReason?: string; readonly suppressOutput?: boolean; readonly systemMessage?: string; readonly terminalSequence?: string; }
    Accepted native output for SubagentStop; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • StopRequired
    { readonly decision?: "block"; readonly reason?: string; readonly continue?: boolean; readonly stopReason?: string; readonly suppressOutput?: boolean; readonly systemMessage?: string; readonly terminalSequence?: string; }
    Accepted native output for Stop; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • InterruptRequired
    { readonly systemMessage?: string; }
    Accepted native output for Interrupt; never means this event accepts no callback decision. Returning nothing preserves the native flow.
export interface CodexHookDecisions {
  readonly SessionStart:
    | string
    | {
        readonly decision?: "block";
        readonly reason?: string;
        readonly hookSpecificOutput?: {
          readonly hookEventName: "SessionStart";
          readonly additionalContext?: string;
        };
        readonly continue?: boolean;
        readonly stopReason?: string;
        readonly suppressOutput?: boolean;
        readonly systemMessage?: string;
        readonly terminalSequence?: string;
      };
  readonly SessionEnd: never;
  readonly UserPromptSubmit:
    | string
    | {
        readonly decision?: "block";
        readonly reason?: string;
        readonly hookSpecificOutput?: {
          readonly hookEventName: "UserPromptSubmit";
          readonly additionalContext?: string;
        };
        readonly continue?: boolean;
        readonly stopReason?: string;
        readonly suppressOutput?: boolean;
        readonly systemMessage?: string;
        readonly terminalSequence?: string;
      };
  readonly PreToolUse: {
    readonly systemMessage?: string;
    readonly decision?: "block";
    readonly reason?: string;
    readonly hookSpecificOutput?: {
      readonly hookEventName: "PreToolUse";
      readonly permissionDecision?: "allow" | "deny";
      readonly permissionDecisionReason?: string;
      readonly updatedInput?: Readonly<Record<string, unknown>>;
      readonly additionalContext?: string;
    };
  };
  readonly PermissionRequest: {
    readonly systemMessage?: string;
    readonly hookSpecificOutput?: {
      readonly hookEventName: "PermissionRequest";
      readonly decision?: {
        readonly behavior: "allow" | "deny";
        readonly message?: string;
      };
    };
  };
  readonly PostToolUse: {
    readonly systemMessage?: string;
    readonly continue?: boolean;
    readonly stopReason?: string;
    readonly decision?: "block";
    readonly reason?: string;
    readonly hookSpecificOutput?: {
      readonly hookEventName: "PostToolUse";
      readonly additionalContext?: string;
    };
  };
  readonly PreCompact: {
    readonly continue?: boolean;
    readonly stopReason?: string;
    readonly suppressOutput?: boolean;
    readonly systemMessage?: string;
    readonly terminalSequence?: string;
  };
  readonly PostCompact: {
    readonly continue?: boolean;
    readonly stopReason?: string;
    readonly suppressOutput?: boolean;
    readonly systemMessage?: string;
    readonly terminalSequence?: string;
  };
  readonly SubagentStart:
    | string
    | {
        readonly decision?: "block";
        readonly reason?: string;
        readonly hookSpecificOutput?: {
          readonly hookEventName: "SubagentStart";
          readonly additionalContext?: string;
        };
        readonly continue?: boolean;
        readonly stopReason?: string;
        readonly suppressOutput?: boolean;
        readonly systemMessage?: string;
        readonly terminalSequence?: string;
      };
  readonly SubagentStop: {
    readonly decision?: "block";
    readonly reason?: string;
    readonly continue?: boolean;
    readonly stopReason?: string;
    readonly suppressOutput?: boolean;
    readonly systemMessage?: string;
    readonly terminalSequence?: string;
  };
  readonly Stop: {
    readonly decision?: "block";
    readonly reason?: string;
    readonly continue?: boolean;
    readonly stopReason?: string;
    readonly suppressOutput?: boolean;
    readonly systemMessage?: string;
    readonly terminalSequence?: string;
  };
  readonly Interrupt: {
    readonly systemMessage?: string;
  };
}