Skip to content

CheckpointStore

This content is not available in your language yet.

快照存储接口(自建实现注入 createSession({ checkpoints: { store } }))。实现纪律:

  • put 须配对治理后落盘,返回的 meta.messageCount 为治理后消息数;
  • list 恒不携 messages,按 checkpointId 升序(= 时间序)返回;不存在的会话返回 [];
  • get 不存在返回 null;存储损坏恒结构化 throw(恒不静默回残缺快照);
  • delete 幂等(目标不存在不抛)。

delete(sessionId, checkpointId): Promise<void>;

删除快照(幂等)

string

string

Promise<void>


get(sessionId, checkpointId): Promise<ContextCheckpoint | null>;

读取快照(不存在 → null;损坏结构化 throw)

string

string

Promise<ContextCheckpoint | null>


list(sessionId): Promise<ContextCheckpointMeta[]>;

列举某会话全部快照的头部(恒无内容;checkpointId 升序)

string

Promise<ContextCheckpointMeta[]>


put(cp): Promise<ContextCheckpointMeta>;

写入快照(durable);返回头部 meta

CheckpointInput

Promise<ContextCheckpointMeta>