feat(view): explicit persist and nested-plan boundary

Add per-cell Persist backed by lib/writeback and /api/session/cell/persist. Reject nested foreign.session plans with a top-level diagnostic and tests.
This commit is contained in:
cflmy committed 2026-10-18 14:47:54 +08:00
1 parent 7dc5e56850
commit 115d1f6c0b
7 files changed
+123 -6

No files matched your search

+10
View File
@@ -170,6 +170,16 @@ where
}
}
pub fn api_persist_cell(root: &Path, body: &str) -> serde_json::Value {
let v = body_value(body);
let cell = v.get("cell").and_then(|x| x.as_str()).unwrap_or("");
let key = v.get("key").and_then(|x| x.as_str()).unwrap_or("");
if cell.is_empty() {
return err("missing cell".into());
}
with_session(root, body, "persisted", |s| s.persist_cell(cell, key))
}
pub fn api_interrupt(root: &Path, body: &str) -> serde_json::Value {
with_session(root, body, "interrupted", |s| s.interrupt())
}