@json-render/core 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1062,12 +1062,17 @@ function generatePrompt(catalog, options) {
|
|
|
1062
1062
|
const {
|
|
1063
1063
|
system = "You are a UI generator that outputs JSON.",
|
|
1064
1064
|
customRules = [],
|
|
1065
|
-
mode = "
|
|
1065
|
+
mode: rawMode = "standalone"
|
|
1066
1066
|
} = options;
|
|
1067
|
+
const mode = rawMode === "chat" ? (console.warn(
|
|
1068
|
+
'[json-render] mode "chat" is deprecated, use "inline" instead'
|
|
1069
|
+
), "inline") : rawMode === "generate" ? (console.warn(
|
|
1070
|
+
'[json-render] mode "generate" is deprecated, use "standalone" instead'
|
|
1071
|
+
), "standalone") : rawMode;
|
|
1067
1072
|
const lines = [];
|
|
1068
1073
|
lines.push(system);
|
|
1069
1074
|
lines.push("");
|
|
1070
|
-
if (mode === "
|
|
1075
|
+
if (mode === "inline") {
|
|
1071
1076
|
lines.push("OUTPUT FORMAT (text + JSONL, RFC 6902 JSON Patch):");
|
|
1072
1077
|
lines.push(
|
|
1073
1078
|
"You respond conversationally. When generating UI, first write a brief explanation (1-3 sentences), then output JSONL patch lines wrapped in a ```spec code fence."
|
|
@@ -1459,7 +1464,7 @@ Note: state patches appear right after the elements that use them, so the UI fil
|
|
|
1459
1464
|
lines.push("");
|
|
1460
1465
|
}
|
|
1461
1466
|
lines.push("RULES:");
|
|
1462
|
-
const baseRules = mode === "
|
|
1467
|
+
const baseRules = mode === "inline" ? [
|
|
1463
1468
|
"When generating UI, wrap all JSONL patches in a ```spec code fence - one JSON object per line inside the fence",
|
|
1464
1469
|
"Write a brief conversational response before any JSONL output",
|
|
1465
1470
|
'First set root: {"op":"add","path":"/root","value":"<root-key>"}',
|