| 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | |
| 6 | "reasonix/internal/store" |
| 7 | ) |
| 8 | |
| 9 | // sessionTrashArtifacts lists every file and directory a session owns, with |
| 10 | // the name each keeps inside the trash entry, so moving a session aside and |
| 11 | // restoring it round-trip the whole set. |
| 12 | func sessionTrashArtifacts(sessionPath, key string) []sessionTrashArtifact { |
| 13 | stem := strings.TrimSuffix(key, ".jsonl") |
| 14 | return []sessionTrashArtifact{ |
| 15 | {src: sessionPath, name: key}, |
| 16 | {src: store.SessionMeta(sessionPath), name: key + ".meta"}, |
| 17 | {src: store.SessionGoalState(sessionPath), name: stem + ".goal-state.json"}, |
| 18 | {src: store.SessionEventLog(sessionPath), name: stem + ".events.jsonl"}, |
| 19 | {src: store.SessionEventLogDamaged(sessionPath), name: stem + ".events.jsonl.damaged"}, |
| 20 | {src: store.SessionEventLogRotating(sessionPath), name: stem + ".events.jsonl.rotating"}, |
| 21 | {src: store.SessionTurnEventLog(sessionPath), name: stem + ".turns.jsonl"}, |
| 22 | {src: store.SessionTurnEventLogDamaged(sessionPath), name: stem + ".turns.jsonl.damaged"}, |
| 23 | {src: store.SessionEventIndex(sessionPath), name: stem + ".event-index.json"}, |
| 24 | {src: store.SessionDisplayIndex(sessionPath), name: stem + ".display-index.json"}, |
| 25 | {src: store.SessionTranscriptProjection(sessionPath), name: stem + ".transcript-projection.json"}, |
| 26 | {src: store.SessionConflictLog(sessionPath), name: stem + ".conflicts.jsonl"}, |
| 27 | {src: store.SessionRecoveryState(sessionPath), name: stem + ".recovery.json"}, |
| 28 | {src: store.SessionContext(sessionPath), name: stem + ".context.json"}, |
| 29 | {src: store.SessionPinnedContext(sessionPath), name: stem + ".pinned-context.json"}, |
| 30 | {src: sessionTelemetryPath(sessionPath), name: key + ".telemetry.json"}, |
| 31 | {src: store.SessionCheckpointDir(sessionPath), name: stem + ".ckpt"}, |
| 32 | {src: store.SessionJobsDir(sessionPath), name: stem + ".jobs"}, |
| 33 | {src: store.SessionInboxDir(sessionPath), name: stem + ".inbox"}, |
| 34 | } |
| 35 | } |
| 36 |