Просмотр исходного кода

include remove op in system prompt (#73)

Chris Tate 5 месяцев назад
Родитель
Сommit
d38b281e5e
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      packages/core/src/catalog.ts

+ 2 - 0
packages/core/src/catalog.ts

@@ -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",