@prompd/core 0.5.0-beta.18 → 0.5.0-beta.19
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/dist/index.cjs +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4576,16 +4576,19 @@ function validateNodeData(node, errors, warnings) {
|
|
|
4576
4576
|
return;
|
|
4577
4577
|
}
|
|
4578
4578
|
switch (node.type) {
|
|
4579
|
-
case "prompt":
|
|
4580
|
-
|
|
4579
|
+
case "prompt": {
|
|
4580
|
+
const d = node.data;
|
|
4581
|
+
const inline = (v) => typeof v === "string" && v.trim() !== "";
|
|
4582
|
+
if (!("source" in node.data) && !inline(d.rawPrompt) && !inline(d.content)) {
|
|
4581
4583
|
errors.push({
|
|
4582
4584
|
nodeId: node.id,
|
|
4583
4585
|
field: "source",
|
|
4584
|
-
message: "Prompt node
|
|
4586
|
+
message: "Prompt node has no source: attach a .prmd file (source) or enter inline prompt text (rawPrompt)",
|
|
4585
4587
|
code: "MISSING_PROMPT_SOURCE"
|
|
4586
4588
|
});
|
|
4587
4589
|
}
|
|
4588
4590
|
break;
|
|
4591
|
+
}
|
|
4589
4592
|
case "condition":
|
|
4590
4593
|
if (!("conditions" in node.data) || !Array.isArray(node.data.conditions)) {
|
|
4591
4594
|
errors.push({
|