export type HookTrigger = 'on_spec_created' | 'on_spec_status_change' | 'on_drift_detected' | 'on_commit';
export type HookActionType = 'run_tool' | 'log_message' | 'set_variable' | 'notify';
export interface HookActionRunTool {
    type: 'run_tool';
    /** MCP tool name to invoke (e.g. 'validate', 'audit') */
    tool: string;
    /** Tool arguments — merged with event payload at execution time */
    args: Record<string, unknown>;
}
export interface HookActionLog {
    type: 'log_message';
    /** Message template — supports {{trigger}}, {{specId}}, {{projectId}} */
    message: string;
}
export interface HookActionSetVariable {
    type: 'set_variable';
    key: string;
    value: string;
}
export interface HookActionNotify {
    type: 'notify';
    /** Plain-language notification message */
    message: string;
}
export type HookAction = HookActionRunTool | HookActionLog | HookActionSetVariable | HookActionNotify;
export interface HookFilter {
    /** Only fire when spec status changes FROM this value */
    fromStatus?: string;
    /** Only fire when spec status changes TO this value */
    toStatus?: string;
    /** Only fire for specs matching this ID glob pattern */
    specIdPattern?: string;
}
export interface HookDefinition {
    id: string;
    name: string;
    description: string;
    trigger: HookTrigger;
    /** Optional conditions for conditional firing */
    filter?: HookFilter;
    /** Ordered list of actions to execute */
    actions: HookAction[];
    enabled: boolean;
    createdAt: string;
    updatedAt: string;
}
export type HookExecutionStatus = 'success' | 'failed' | 'skipped';
export interface HookExecutionLog {
    id: string;
    hookId: string;
    hookName: string;
    trigger: HookTrigger;
    /** Event payload that triggered the hook */
    payload: HookEventPayload;
    status: HookExecutionStatus;
    /** Execution depth — used for recursion guard */
    depth: number;
    /** Actions that were attempted and their outcomes */
    actionResults: HookActionResult[];
    executedAt: string;
    durationMs: number;
    errorMessage?: string;
}
export interface HookActionResult {
    actionType: HookActionType;
    status: HookExecutionStatus;
    output?: string;
    errorMessage?: string;
}
export interface HookEventPayloadBase {
    projectId: string;
    timestamp: string;
}
export interface HookEventPayloadSpecCreated extends HookEventPayloadBase {
    trigger: 'on_spec_created';
    specId: string;
    specTitle: string;
    specType: string;
}
export interface HookEventPayloadStatusChange extends HookEventPayloadBase {
    trigger: 'on_spec_status_change';
    specId: string;
    specTitle: string;
    fromStatus: string;
    toStatus: string;
}
export interface HookEventPayloadDriftDetected extends HookEventPayloadBase {
    trigger: 'on_drift_detected';
    specId: string;
    driftScore: number;
    driftSummary: string;
}
export interface HookEventPayloadCommit extends HookEventPayloadBase {
    trigger: 'on_commit';
    commitHash: string;
    commitMessage: string;
    branch: string;
}
export type HookEventPayload = HookEventPayloadSpecCreated | HookEventPayloadStatusChange | HookEventPayloadDriftDetected | HookEventPayloadCommit;
export interface AgentHookConfig {
    hooks: HookDefinition[];
    lastUpdated: string;
}
export interface AgentHookLogData {
    entries: HookExecutionLog[];
    lastUpdated: string;
}
export type ManageHooksOperation = 'create' | 'list' | 'delete' | 'enable' | 'disable' | 'install_template' | 'dry_run' | 'list_logs';
export interface ManageHooksInput {
    projectId: string;
    operation: ManageHooksOperation;
    /** Hook definition for 'create' */
    hook?: Partial<HookDefinition>;
    /** Hook ID for 'delete', 'enable', 'disable', 'dry_run' */
    hookId?: string;
    /** Template name for 'install_template' */
    templateName?: string;
    /** For dry_run: the event payload to simulate */
    dryRunPayload?: HookEventPayload;
}
export interface HookTemplate {
    name: string;
    description: string;
    /** Hooks that make up this template */
    hooks: Omit<HookDefinition, 'id' | 'createdAt' | 'updatedAt'>[];
}
export type GitHookType = 'pre-commit' | 'post-commit' | 'pre-push';
export interface GitHookScript {
    hookType: GitHookType;
    /** Shell script content */
    content: string;
    installPath: string;
}
export interface GenerateGitHooksInput {
    projectId: string;
    projectPath: string;
    hookTypes: GitHookType[];
}
export type HookTemplateName = 'notification-macos' | 'notification-linux' | 'notification-windows' | 'notification-desktop' | 'instructions-loaded-debug' | 'permission-auto-approve-readonly';
export type NotificationMatcher = 'permission_prompt' | 'idle_prompt' | 'auth_success' | 'elicitation_dialog' | '';
export interface HookTemplateOptions {
    template: HookTemplateName;
    notificationMatcher?: NotificationMatcher;
}
export interface ClaudeCodeHookEntry {
    matcher: string;
    hooks: {
        type: 'command';
        command: string;
    }[];
}
export interface GeneratedHookConfig {
    hooks: Record<string, ClaudeCodeHookEntry[]>;
    mergeInstructions: string;
    description: string;
}
/** Event fired when Claude Code enters or exits Plan Mode */
export interface PlanModeEvent {
    /** The Claude Code tool name (e.g. "Task", "exit_plan_mode") */
    toolName: string;
    /** Task description extracted from tool input, if available */
    taskDescription: string | null;
}
/** A relevant spec summary for plan context injection */
export interface PlanContextSpec {
    /** Spec ID (e.g. "SPEC-042") */
    id: string;
    /** Spec title */
    title: string;
    /** Current status */
    status: string;
    /** Why this spec is relevant (for semantic matches) */
    relevanceReason?: string;
}
/** The full plan context written to .planu/plan-context.md */
export interface PlanContext {
    /** Specs currently in implementing or approved state */
    activeSpecs: PlanContextSpec[];
    /** Related specs matched by keyword against task description */
    relatedSpecs: PlanContextSpec[];
    /** Recent decisions from log_decision records */
    recentDecisions: string[];
    /** ISO timestamp when context was generated */
    generatedAt: string;
}
/** Result of enabling plan mode integration */
export interface PlanModeIntegrationResult {
    action: 'enable-plan-mode-integration';
    preHookPath: string;
    postHookPath: string;
    settingsPath: string;
    message: string;
}
/** Shell scripts generated for Claude Code Plan Mode hooks */
export interface PlanModeHookScripts {
    preScript: string;
    postScript: string;
}
/** Raw spec shape as read from specs.json on disk */
export interface RawSpecRecord {
    id?: unknown;
    title?: unknown;
    status?: unknown;
}
/** Raw decision shape as read from decisions.json on disk */
export interface RawDecisionRecord {
    title?: unknown;
    summary?: unknown;
    rationale?: unknown;
    createdAt?: unknown;
}
/** Shape of the decisions.json file */
export interface DecisionsFileData {
    decisions?: RawDecisionRecord[];
}
//# sourceMappingURL=hooks.d.ts.map