Compare commits

...
Author SHA1 Message Date
Chris Tate 651e52f529 include remove op in system prompt 2026-02-06 17:52:11 -06:00
+2
View File
@@ -502,6 +502,7 @@ export function generateSystemPrompt<
lines.push( lines.push(
'{"op":"add","path":"/elements/key","value":{"key":"...","type":"...","props":{...},"children":[...]}}', '{"op":"add","path":"/elements/key","value":{"key":"...","type":"...","props":{...},"children":[...]}}',
); );
lines.push('{"op":"remove","path":"/elements/key"}');
lines.push(""); lines.push("");
// Rules // Rules
@@ -509,6 +510,7 @@ export function generateSystemPrompt<
const baseRules = [ const baseRules = [
"First line sets /root to root element key", "First line sets /root to root element key",
"Add elements with /elements/{key}", "Add elements with /elements/{key}",
"Remove elements with op:remove - also update the parent's children array to exclude the removed key",
"Children array contains string keys, not objects", "Children array contains string keys, not objects",
"Parent first, then children", "Parent first, then children",
"Each element needs: key, type, props", "Each element needs: key, type, props",