/**
 * Work Lifecycle Hook Types
 *
 * Defines the configuration shape for hooks that fire on work lifecycle events.
 * Hooks are user-configurable actions that run when specific work events occur
 * (e.g., run a shell command when work starts, call a webhook when a PR is created).
 */
import type { RuntimeEventName } from '../../events/events.js';
/**
 * Work lifecycle event names that can trigger hooks.
 * Subset of RuntimeEventName limited to work-relevant events.
 */
export type HookableEvent = Extract<RuntimeEventName, 'work:started' | 'work:status_changed' | 'work:pr_created' | 'work:completed' | 'agent:spawned' | 'agent:stopped'>;
/** All hookable event names for validation. */
export declare const HOOKABLE_EVENTS: HookableEvent[];
/**
 * Action types that a hook can execute.
 *
 * - shell: Run a shell command (with event data as env vars)
 * - webhook: POST event data to a URL
 * - log: Write a message to stdout (useful for notifications/debugging)
 */
export type HookActionType = 'shell' | 'webhook' | 'log';
/**
 * Persisted hook configuration stored in the database.
 */
export interface WorkHookConfig {
    /** Unique hook ID (auto-generated UUID) */
    id: string;
    /** Human-readable hook name */
    name: string;
    /** Event that triggers this hook */
    event: HookableEvent;
    /** Type of action to execute */
    actionType: HookActionType;
    /** Action payload — shell command, webhook URL, or log message template */
    actionValue: string;
    /** Whether the hook is active */
    enabled: boolean;
    /** Optional description */
    description: string | null;
    /** When the hook was created */
    createdAt: string;
}
/**
 * Row shape from the database (snake_case columns).
 */
export interface WorkHookRow {
    id: string;
    name: string;
    event: string;
    action_type: string;
    action_value: string;
    enabled: number;
    description: string | null;
    created_at: string;
}
/**
 * Result of executing a single hook.
 */
export interface HookExecutionResult {
    hookId: string;
    hookName: string;
    success: boolean;
    error?: string;
    /** Duration in ms */
    durationMs: number;
}
