import type { ChatMemoryManager } from '@origintrail-official/dkg-node-ui'; import type { OpenClawAttachmentRef } from './openclaw.js'; export type ChatTurnPersistenceState = 'stored' | 'failed' | 'pending'; export type ChatTurnToolCall = { name: string; args: Record; result: unknown; }; export type DurableChatTurnPayload = { sessionId: string; turnId: string; userMessage: string; assistantReply: string; persistenceState: ChatTurnPersistenceState; failureReason?: string; toolCalls?: ChatTurnToolCall[]; attachmentRefs?: OpenClawAttachmentRef[]; }; export type DurableChatTurnOutcome = { kind: 'created' | 'duplicate' | 'transitioned'; sessionId: string; turnId: string; }; /** Required storage contract for the daemon's durable-turn state machine. */ export type DurableChatTurnStore = Pick; /** * One daemon-wide owner for durable local-agent turn idempotency. * * The promise chain serializes the complete read/transition/write sequence for * one `(sessionId, turnId)` while allowing unrelated turns to persist in * parallel. Every queued reporter re-reads durable state after its predecessor * settles, so duplicate suppression and upward state transitions are atomic at * the route layer shared by Hermes, Prime Agent, and future local agents. */ export declare function persistDurableChatTurn(args: { memoryManager: DurableChatTurnStore; payload: DurableChatTurnPayload; afterStored?: () => Promise; }): Promise; //# sourceMappingURL=chat-turn-persistence.d.ts.map