Add design containers with deduplicated blobs and JSON compatibility (#327)

* Add fast design containers with lossless deduplicated payloads

* Keep display caching opt-in to avoid default save overhead
This commit is contained in:
selune authored and GitHub committed 2026-10-12 19:15:41 -04:00
1 parent 8e0c3d2794
commit 006a23a767
30 files changed
+1921 -71

No files matched your search

+6 -3
View File
@@ -224,8 +224,11 @@ pub fn tool_definitions() -> Vec<Value> {
tool(
"save",
"Save the design",
"Save the design as a .solidcraft file (to `path`, or to the file it came from).",
obj(json!({"path": string("Path to save to (default: the current file)")}), &[]),
"Save the design to `path` or its current file. The default is a design container; a .json path selects plain JSON. Set format to container or json to override the path.",
obj(
json!({"path": string("Path to save to (default: the current file)"), "format": {"type": "string", "enum": ["container", "json"], "description": "Design encoding (default: JSON for .json, container otherwise)"}}),
&[],
),
false,
false,
),
@@ -378,7 +381,7 @@ fn dispatch(b: &mut dyn Backend, name: &str, a: &Map<String, Value>) -> Result<V
"redo" => exec(b, "edit.redo", json!({})),
"new_design" => exec(b, "file.new", pick(a, &["name"])),
"open" => exec(b, "doc.open", pick(a, &["path"])),
"save" => exec(b, "file.save", pick(a, &["path"])),
"save" => exec(b, "file.save", pick(a, &["path", "format"])),
other => Err(format!("unknown tool `{other}`")),
}
}