import type { TriggerAction, TriggerErrorCode } from './trigger-types.js'; export interface TriggerLogEntry { triggerId: string; connectorId?: string; requestId?: string; action: TriggerAction | 'failed'; status: 'ok' | 'error'; error?: string; errorCode?: TriggerErrorCode; request?: TriggerLogRequest; target?: TriggerLogTarget; response?: TriggerLogResponse; createdAt: string; } export interface TriggerLogRequest { method: string; path: string; query: Record; headers?: Record; remoteAddress?: string; bodyBytes?: number; payload?: unknown; payloadStored?: boolean; payloadOmittedReason?: 'disabled' | 'too_large' | 'not_available'; } export interface TriggerLogTarget { kind?: 'turn' | 'workflow'; mode?: 'dynamic' | 'fixed' | 'new-group'; botId?: string; chatId?: string; sessionId?: string; rootMessageId?: string; workflowId?: string; } export interface TriggerLogResponse { httpStatus: number; durationMs: number; sessionId?: string; workflowRunId?: string; chatId?: string; } export interface TriggerLogListOptions { limit?: number; offset?: number; connectorId?: string; status?: TriggerLogEntry['status']; errorCode?: TriggerErrorCode; method?: string; action?: TriggerLogEntry['action']; query?: string; since?: string | Date; } export interface TriggerLogPage { logs: TriggerLogEntry[]; total: number; limit: number; offset: number; hasMore: boolean; } export interface TriggerLogOverview { total: number; ok: number; error: number; successRate: number; avgDurationMs?: number; p95DurationMs?: number; lastTriggeredAt?: string; } export interface TriggerLogStats { connectorId?: string; total: number; ok: number; error: number; actions: Partial>; errorCodes: Partial>; lastTriggeredAt?: string; lastOkAt?: string; lastErrorAt?: string; lastError?: string; lastErrorCode?: TriggerErrorCode; } export interface TriggerLogPruneResult { before: number; after: number; deleted: number; } export type TriggerLogRetentionPolicy = Record; export declare function appendTriggerLog(entry: Omit & { createdAt?: string; }, dataDir?: string): TriggerLogEntry; export declare function queryTriggerLogs(opts?: TriggerLogListOptions, dataDir?: string): TriggerLogPage; export declare function listTriggerLogs(opts?: TriggerLogListOptions, dataDir?: string): TriggerLogEntry[]; export declare function summarizeTriggerLogOverview(opts?: TriggerLogListOptions, dataDir?: string): TriggerLogOverview; export declare function summarizeTriggerLogs(opts?: Pick, dataDir?: string): TriggerLogStats[]; export declare function pruneTriggerLogs(opts?: { retentionDays?: number; maxEntries?: number; now?: Date | string | number; }, dataDir?: string): TriggerLogPruneResult; export declare function pruneTriggerLogsByConnectorRetention(retentionDaysByConnector: TriggerLogRetentionPolicy, opts?: { defaultRetentionDays?: number; maxEntries?: number; now?: Date | string | number; }, dataDir?: string): TriggerLogPruneResult; //# sourceMappingURL=trigger-log-store.d.ts.map