export type TriggerSourceType = 'webhook' | 'ui' | 'workflow' | 'schedule';
export type TriggerTargetKind = 'turn' | 'workflow';
export type TriggerAction = 'queued' | 'delivered' | 'dry_run' | 'ignored';
export interface TriggerRequest {
    source: {
        type: TriggerSourceType;
        connectorId?: string;
        requestId?: string;
        receivedAt?: string;
    };
    target: {
        kind: TriggerTargetKind;
        botId?: string;
        chatId?: string;
        sessionId?: string;
        workflowId?: string;
    };
    envelope: {
        format: string;
        sourceName: string;
        trusted: false;
        headers?: Record<string, unknown>;
        payload?: unknown;
        rawText?: string;
    };
    instruction?: string;
    options?: {
        dryRun?: boolean;
        dedupKey?: string;
        status?: 'firing' | 'resolved' | string;
    };
}
export type TriggerErrorCode = 'bad_json' | 'bad_request' | 'bot_not_found' | 'bot_not_in_chat' | 'daemon_offline' | 'dry_run' | 'invalid_signature' | 'chat_not_allowed' | 'group_create_failed' | 'lifecycle_extract_failed' | 'rate_limited' | 'replay' | 'session_not_found' | 'target_required' | 'trigger_failed' | 'workflow_trigger_not_implemented';
export interface TriggerResponse {
    ok: boolean;
    triggerId?: string;
    action?: TriggerAction;
    target?: {
        kind: TriggerTargetKind;
        sessionId?: string;
        workflowRunId?: string;
        chatId?: string;
    };
    message?: string;
    errorCode?: TriggerErrorCode;
    error?: string;
    promptPreview?: string;
}
export declare function isRecord(v: unknown): v is Record<string, unknown>;
export declare function validateTriggerRequest(raw: unknown): {
    ok: true;
    request: TriggerRequest;
} | {
    ok: false;
    status: number;
    body: TriggerResponse;
};
//# sourceMappingURL=trigger-types.d.ts.map