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[];
}
//# sourceMappingURL=hooks.d.ts.map