types.ts 801 B

123456789101112131415161718192021222324252627
  1. /**
  2. * Checkpoint types for session rollback functionality.
  3. */
  4. export interface Checkpoint {
  5. /** Unique identifier for the checkpoint */
  6. id: string;
  7. /** User-defined name for the checkpoint */
  8. name: string;
  9. /** Optional description of why checkpoint was created */
  10. description?: string;
  11. /** Session ID this checkpoint belongs to */
  12. sessionID: string;
  13. /** Message ID of the last user message at checkpoint time (the anchor) */
  14. anchorMessageID: string;
  15. /** Workspace directory */
  16. directory: string;
  17. /** Timestamp when checkpoint was created */
  18. createdAt: number;
  19. }
  20. export interface CheckpointStore {
  21. /** Map of checkpoint ID to checkpoint */
  22. checkpoints: Record<string, Checkpoint>;
  23. /** Index: sessionID -> checkpoint IDs */
  24. bySession: Record<string, string[]>;
  25. }