export declare const HOOK_EVENTS: readonly ["topic.new", "thread.reply", "outbound.send", "outbound.reply", "schedule.fired", "session.start", "session.exit", "session.idle", "session.requires_attention"];
export type HookEvent = typeof HOOK_EVENTS[number];
export type HookFilter = {
    chatId?: string | string[];
    senderOpenId?: string | string[];
    sender_open_id?: string | string[];
};
export type HookConfig = {
    event: HookEvent;
    command: string;
    timeoutMs?: number;
    filter?: HookFilter;
    redact?: {
        fullContentEvents?: HookEvent[];
    };
};
export type HookPayload = Record<string, unknown> & {
    event: HookEvent;
    chatId?: string;
    senderOpenId?: string;
    sender_open_id?: string;
};
export type ParsedHookCommand = {
    file: string;
    args: string[];
};
export type HookRunResult = {
    ok: boolean;
    code?: number | null;
    signal?: NodeJS.Signals | null;
    timedOut?: boolean;
    error?: string;
};
export declare function loadHookConfigs(opts?: {
    dataDir?: string;
    env?: Pick<NodeJS.ProcessEnv, 'BOTMUX_HOOKS_JSON' | 'BOTMUX_HOOKS_FILE'>;
}): HookConfig[];
export declare function prepareHookPayload(hook: HookConfig, rawPayload: HookPayload): HookPayload;
export declare function parseHookCommand(command: string): ParsedHookCommand;
export declare function filterMatches(filter: HookFilter | undefined, payload: HookPayload): boolean;
export declare function emitHookEvent(event: HookEvent, body?: Record<string, unknown>): void;
/**
 * Daemon-side emit: always run hooks in-process, never forward. The
 * /api/hooks/emit handler MUST use this instead of emitHookEvent — re-entering
 * the CLI gate there means a daemon that accidentally carries session-scoped
 * env (e.g. `botmux restart` issued from inside a botmux session: pm2
 * startOrRestart injects the caller's environment into the restarted daemon)
 * would POST every event back to itself in an infinite loop — one core pegged
 * and hundreds of self-connections on the IPC port, with nothing in the logs.
 */
export declare function emitHookEventLocal(event: HookEvent, body?: Record<string, unknown>): void;
export declare function runHookCommandForTest(hook: HookConfig, payload: HookPayload): Promise<HookRunResult>;
//# sourceMappingURL=hook-runner.d.ts.map