@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.js
CHANGED
|
@@ -4549,16 +4549,19 @@ function validateNodeData(node, errors, warnings) {
|
|
|
4549
4549
|
return;
|
|
4550
4550
|
}
|
|
4551
4551
|
switch (node.type) {
|
|
4552
|
-
case "prompt":
|
|
4553
|
-
|
|
4552
|
+
case "prompt": {
|
|
4553
|
+
const d = node.data;
|
|
4554
|
+
const inline = (v) => typeof v === "string" && v.trim() !== "";
|
|
4555
|
+
if (!("source" in node.data) && !inline(d.rawPrompt) && !inline(d.content)) {
|
|
4554
4556
|
errors.push({
|
|
4555
4557
|
nodeId: node.id,
|
|
4556
4558
|
field: "source",
|
|
4557
|
-
message: "Prompt node
|
|
4559
|
+
message: "Prompt node has no source: attach a .prmd file (source) or enter inline prompt text (rawPrompt)",
|
|
4558
4560
|
code: "MISSING_PROMPT_SOURCE"
|
|
4559
4561
|
});
|
|
4560
4562
|
}
|
|
4561
4563
|
break;
|
|
4564
|
+
}
|
|
4562
4565
|
case "condition":
|
|
4563
4566
|
if (!("conditions" in node.data) || !Array.isArray(node.data.conditions)) {
|
|
4564
4567
|
errors.push({
|