import type { CodexClientSurface, CodexConversationKind, CodexTaskCompletedEvent, CodexTaskStatus } from './types.js'; export declare const CODEX_NOTIFIER_PLUGIN_ID = "codex-watch"; export declare const MAX_CODEX_NOTIFIER_EVENT_BYTES: number; /** 飞书消息幂等键基于完整事件 ID,避免只截断长 ID 前缀造成碰撞。 */ export declare function codexNotifierMessageUuid(eventId: string): string; export type CodexNotifierEventValidationCode = 'invalid_plugin' | 'payload_too_large' | 'invalid_json' | 'invalid_event'; /** 插件事件边界的可分类校验错误,供 HTTP 层映射 4xx 响应。 */ export declare class CodexNotifierEventValidationError extends Error { readonly code: CodexNotifierEventValidationCode; constructor(code: CodexNotifierEventValidationCode, message: string, options?: ErrorOptions); } /** * 校验 Codex 完成事件。严格拒绝额外字段、非普通对象和超大输入,避免跨进程边界 * 成为原型污染或无界内存入口。 */ export declare function parseCodexNotifierEvent(input: unknown, maxBytes?: number): CodexTaskCompletedEvent; /** 兼容一个迁移周期的旧插件入口;内建链路直接调用 parseCodexNotifierEvent。 */ export declare function parseCodexNotifierPluginEvent(pluginId: string, input: unknown, maxBytes?: number): CodexTaskCompletedEvent; /** 事件 ID 只依赖 Codex 原生任务身份,Hook 重试不会生成第二条通知。 */ export declare function codexNotifierEventId(input: { source: CodexTaskCompletedEvent['source']; threadId: string; nativeTurnId: string; status: CodexTaskCompletedEvent['status']; }): string; /** 把 Codex Stop Hook 的稳定字段转换成内建完成事件。 */ export declare function createCodexNotifierEvent(payload: Record, options?: { clientSurface?: CodexClientSurface; conversationKind?: CodexConversationKind; title?: string; finalPreview?: string; completedAt?: string; }): CodexTaskCompletedEvent; /** 从 Hook 或 Codex App IPC 的终态构造同一种可靠完成事件。 */ export declare function createCodexNotifierCompletionEvent(input: { threadId: string; nativeTurnId: string; status: CodexTaskStatus; cwd: string; clientSurface?: CodexClientSurface; conversationKind?: CodexConversationKind; title?: string; finalPreview?: string; completedAt?: string; }): CodexTaskCompletedEvent; //# sourceMappingURL=event.d.ts.map