Skip to content
Français

CopilotHookEvents

import type { CopilotHookEvents } from "@elie-laloum/outpost/core";
  • sessionStartRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly source?: string; readonly initialPrompt?: string; }
    Native sessionStart payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • sessionEndRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly reason?: string; }
    Native sessionEnd payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • userPromptSubmittedRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly prompt: string; }
    Native userPromptSubmitted payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • userPromptTransformedRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly prompt: string; readonly transformedPrompt?: string; }
    Native userPromptTransformed payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • preToolUseRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly toolName: string; readonly toolArgs?: unknown; }
    Native preToolUse payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • postToolUseRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly toolName: string; readonly toolArgs?: unknown; readonly toolResult?: unknown; }
    Native postToolUse payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • postToolUseFailureRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly toolName: string; readonly toolArgs?: unknown; readonly error?: unknown; }
    Native postToolUseFailure payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • permissionRequestRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly toolName: string; readonly toolArgs?: unknown; }
    Native permissionRequest payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • agentStopRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly stop_hook_active?: boolean; readonly transcriptPath?: string; readonly stopReason?: "end_turn"; }
    Native agentStop payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • subagentStartRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly agentName?: string; readonly transcriptPath?: string; readonly agentDisplayName?: string; readonly agentDescription?: string; }
    Native subagentStart payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • subagentStopRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly agentName?: string; readonly agentId?: string; readonly agentType?: string; readonly transcriptPath?: string; readonly agentDisplayName?: string; readonly response?: string; readonly stopReason?: "end_turn"; }
    Native subagentStop payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • preCompactRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly trigger?: "manual" | "auto"; readonly transcriptPath?: string; readonly customInstructions?: string; }
    Native preCompact payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • notificationRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly notification_type?: string; readonly message?: string; }
    Native notification payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
  • errorOccurredRequired
    { readonly sessionId: string; readonly timestamp: number; readonly cwd: string; readonly error?: { readonly message: string; readonly name: string; readonly stack?: string; }; readonly errorContext?: "model_call" | "tool_execution" | "system" | "user_input"; readonly recoverable?: boolean; }
    Native errorOccurred payload from Copilot, retained with its original field names. Unknown additional native fields are tolerated at runtime.
export interface CopilotHookEvents {
  readonly sessionStart: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly source?: string;
    readonly initialPrompt?: string;
  };
  readonly sessionEnd: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly reason?: string;
  };
  readonly userPromptSubmitted: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly prompt: string;
  };
  readonly userPromptTransformed: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly prompt: string;
    readonly transformedPrompt?: string;
  };
  readonly preToolUse: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly toolName: string;
    readonly toolArgs?: unknown;
  };
  readonly postToolUse: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly toolName: string;
    readonly toolArgs?: unknown;
    readonly toolResult?: unknown;
  };
  readonly postToolUseFailure: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly toolName: string;
    readonly toolArgs?: unknown;
    readonly error?: unknown;
  };
  readonly permissionRequest: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly toolName: string;
    readonly toolArgs?: unknown;
  };
  readonly agentStop: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly stop_hook_active?: boolean;
    readonly transcriptPath?: string;
    readonly stopReason?: "end_turn";
  };
  readonly subagentStart: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly agentName?: string;
    readonly transcriptPath?: string;
    readonly agentDisplayName?: string;
    readonly agentDescription?: string;
  };
  readonly subagentStop: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly agentName?: string;
    readonly agentId?: string;
    readonly agentType?: string;
    readonly transcriptPath?: string;
    readonly agentDisplayName?: string;
    readonly response?: string;
    readonly stopReason?: "end_turn";
  };
  readonly preCompact: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly trigger?: "manual" | "auto";
    readonly transcriptPath?: string;
    readonly customInstructions?: string;
  };
  readonly notification: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly notification_type?: string;
    readonly message?: string;
  };
  readonly errorOccurred: {
    readonly sessionId: string;
    readonly timestamp: number;
    readonly cwd: string;
    readonly error?: {
      readonly message: string;
      readonly name: string;
      readonly stack?: string;
    };
    readonly errorContext?:
      "model_call" | "tool_execution" | "system" | "user_input";
    readonly recoverable?: boolean;
  };
}