Skip to content
Français

CopilotHookDecisions

import type { CopilotHookDecisions } from "@elie-laloum/outpost/core";
  • sessionStartRequired
    { readonly additionalContext?: 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.
  • userPromptSubmittedRequired
    never
    Accepted native output for userPromptSubmitted; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • userPromptTransformedRequired
    { readonly modifiedTransformedPrompt?: string; }
    Accepted native output for userPromptTransformed; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • preToolUseRequired
    { readonly permissionDecision?: "allow" | "deny" | "ask"; readonly permissionDecisionReason?: string; readonly modifiedArgs?: 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.
  • postToolUseRequired
    { readonly modifiedResult?: { readonly resultType: "success" | "failure"; readonly textResultForLlm: string; }; readonly additionalContext?: string; }
    Accepted native output for postToolUse; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • postToolUseFailureRequired
    { readonly additionalContext?: string; }
    Accepted native output for postToolUseFailure; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • permissionRequestRequired
    { readonly behavior?: "allow" | "deny"; readonly message?: string; readonly interrupt?: boolean; }
    Accepted native output for permissionRequest; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • agentStopRequired
    { readonly decision?: "block" | "allow"; readonly reason?: string; }
    Accepted native output for agentStop; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • subagentStartRequired
    { readonly additionalContext?: string; }
    Accepted native output for subagentStart; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • subagentStopRequired
    { readonly decision?: "block" | "allow"; readonly reason?: string; readonly modifiedResponse?: string; }
    Accepted native output for subagentStop; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • preCompactRequired
    never
    Accepted native output for preCompact; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • notificationRequired
    { readonly additionalContext?: string; }
    Accepted native output for notification; never means this event accepts no callback decision. Returning nothing preserves the native flow.
  • errorOccurredRequired
    never
    Accepted native output for errorOccurred; never means this event accepts no callback decision. Returning nothing preserves the native flow.
export interface CopilotHookDecisions {
  readonly sessionStart: {
    readonly additionalContext?: string;
  };
  readonly sessionEnd: never;
  readonly userPromptSubmitted: never;
  readonly userPromptTransformed: {
    readonly modifiedTransformedPrompt?: string;
  };
  readonly preToolUse: {
    readonly permissionDecision?: "allow" | "deny" | "ask";
    readonly permissionDecisionReason?: string;
    readonly modifiedArgs?: Readonly<Record<string, unknown>>;
    readonly additionalContext?: string;
  };
  readonly postToolUse: {
    readonly modifiedResult?: {
      readonly resultType: "success" | "failure";
      readonly textResultForLlm: string;
    };
    readonly additionalContext?: string;
  };
  readonly postToolUseFailure: {
    readonly additionalContext?: string;
  };
  readonly permissionRequest: {
    readonly behavior?: "allow" | "deny";
    readonly message?: string;
    readonly interrupt?: boolean;
  };
  readonly agentStop: {
    readonly decision?: "block" | "allow";
    readonly reason?: string;
  };
  readonly subagentStart: {
    readonly additionalContext?: string;
  };
  readonly subagentStop: {
    readonly decision?: "block" | "allow";
    readonly reason?: string;
    readonly modifiedResponse?: string;
  };
  readonly preCompact: never;
  readonly notification: {
    readonly additionalContext?: string;
  };
  readonly errorOccurred: never;
}