import { type HooksConfig } from "../config/config.js";
import type { TaskNotifyPolicy } from "../tasks/task-registry.types.js";
import type { HookMessageChannel } from "./hooks.js";
export type HookMappingResolved = {
    id: string;
    enabled: boolean;
    matchPath?: string;
    matchSource?: string;
    action: "wake" | "agent" | "workflow";
    wakeMode?: "now" | "next-heartbeat";
    name?: string;
    agentId?: string;
    sessionKey?: string;
    messageTemplate?: string;
    textTemplate?: string;
    workflowDefinitionId?: string;
    deliver?: boolean;
    allowUnsafeExternalContent?: boolean;
    channel?: HookMessageChannel;
    to?: string;
    model?: string;
    thinking?: string;
    timeoutSeconds?: number;
    notifyPolicy?: TaskNotifyPolicy;
    transform?: HookMappingTransformResolved;
};
export type HookMappingTransformResolved = {
    modulePath: string;
    exportName?: string;
};
export type HookMappingContext = {
    payload: Record<string, unknown>;
    headers: Record<string, string>;
    url: URL;
    path: string;
};
export type HookAction = {
    kind: "wake";
    text: string;
    mode: "now" | "next-heartbeat";
} | {
    kind: "agent";
    triggerId?: string;
    message: string;
    name?: string;
    agentId?: string;
    wakeMode: "now" | "next-heartbeat";
    sessionKey?: string;
    deliver?: boolean;
    allowUnsafeExternalContent?: boolean;
    channel?: HookMessageChannel;
    to?: string;
    model?: string;
    thinking?: string;
    timeoutSeconds?: number;
    notifyPolicy?: TaskNotifyPolicy;
} | {
    kind: "workflow";
    triggerId?: string;
    workflowDefinitionId: string;
    name?: string;
    agentId?: string;
    sessionKey?: string;
    notifyPolicy?: TaskNotifyPolicy;
};
export type HookMappingResult = {
    ok: true;
    action: HookAction;
} | {
    ok: true;
    action: null;
    skipped: true;
} | {
    ok: false;
    error: string;
};
export declare function resolveHookMappings(hooks?: HooksConfig, opts?: {
    configDir?: string;
}): HookMappingResolved[];
export declare function applyHookMappings(mappings: HookMappingResolved[], ctx: HookMappingContext): Promise<HookMappingResult | null>;
