summaryrefslogtreecommitdiff
path: root/src/subcommand.zig
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-07 11:35:49 -0600
committert <t@tjp.lol>2026-06-07 11:35:49 -0600
commitb14859b9726185ab873356390068e887b7f486d3 (patch)
tree6530d8ee62e7639b50c99a67d23f89e25ef572dc /src/subcommand.zig
parentd36a51358efbc48de3d5b732727455efc60acae1 (diff)
R2: redesign session store with wire-format identity
Replace the single-session SessionManager seam with a directory-backed catalog. session_manager.zig -> file_system_jsonl_store.zig; the old machinery becomes internal SessionFile, and a new FileSystemJSONLStore implements the redesigned SessionStore vtable (create/list/resolve/latest/ load/appendMessages) minting Session/SessionInfo handles. Session logs now record wire-format provider identity ({api_style, base_url, model, reasoning}) instead of a single provider string or CLI aliases; no api_key material is ever stored. Disk* content types renamed Stored*; the rich audit-oriented write record is PersistentMessage (in-memory Message + WireIdentity + provenance). Agent.init now takes a Session; persist_provider/persist_model display strings deleted (banner stays alias-based, resume picks default model). Message.metadata round-trips. Dangling-prompt recovery dropped. CLI migrated to the catalog store for run/resume/list. Clean break, no version bump (old logs wiped).
Diffstat (limited to 'src/subcommand.zig')
-rw-r--r--src/subcommand.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/subcommand.zig b/src/subcommand.zig
index c50429e..3ccd2c6 100644
--- a/src/subcommand.zig
+++ b/src/subcommand.zig
@@ -272,8 +272,12 @@ fn runSessionsSubcommand(
const session_dir = try session_paths.sessionDirForCwd(allocator, environ_map, cwd);
defer allocator.free(session_dir);
- const infos = try panto.session_manager.listSessions(allocator, io, session_dir, null);
- defer panto.session_manager.freeSessionInfos(allocator, infos);
+ var store_impl = try panto.session_manager.FileSystemJSONLStore.init(allocator, io, session_dir, cwd);
+ defer store_impl.deinit();
+ const store = store_impl.store();
+
+ const infos = try store.list();
+ defer store.freeSessionInfos(infos);
var stdout_buffer: [4096]u8 = undefined;
var stdout_file = std.Io.File.stdout().writer(io, &stdout_buffer);