@principal-ai/principal-view-cli 0.4.2 → 0.4.4
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/commands/formats.d.ts.map +1 -1
- package/dist/commands/formats.js +8 -1
- package/dist/index.cjs +42 -1
- package/dist/index.cjs.map +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../src/commands/formats.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../src/commands/formats.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8fpC,wBAAgB,oBAAoB,IAAI,OAAO,CA6B9C"}
|
package/dist/commands/formats.js
CHANGED
|
@@ -186,7 +186,14 @@ ${chalk.cyan('3. Template syntax (Handlebars):')}
|
|
|
186
186
|
- eq, ne, lt, gt, lte, gte, and, or, not
|
|
187
187
|
- Example: {{#if (gt count 10)}}Many{{/if}}
|
|
188
188
|
|
|
189
|
-
${chalk.cyan('4. Template
|
|
189
|
+
${chalk.cyan('4. Template requirements:')}
|
|
190
|
+
${chalk.bold('IMPORTANT:')} The ${chalk.yellow('"events"')} field is ${chalk.bold('REQUIRED')} in all templates
|
|
191
|
+
- Must be a non-empty object mapping event names to templates
|
|
192
|
+
- All event names must exist in the canvas
|
|
193
|
+
- Use to customize how each event type is displayed
|
|
194
|
+
- Example: { "event.name": "Template with {{variables}}" }
|
|
195
|
+
|
|
196
|
+
${chalk.cyan('5. Template style:')}
|
|
190
197
|
- Clear, concise summary line
|
|
191
198
|
- 3-5 detail steps showing workflow
|
|
192
199
|
- Use emojis for visual scanning (✅ ❌ 📋)
|
package/dist/index.cjs
CHANGED
|
@@ -241935,6 +241935,40 @@ var NarrativeValidator = class {
|
|
|
241935
241935
|
const violations = [];
|
|
241936
241936
|
const validFields = ["introduction", "events", "logs", "flow", "summary", "span", "children"];
|
|
241937
241937
|
const templateKeys = Object.keys(template);
|
|
241938
|
+
if (!template.events) {
|
|
241939
|
+
violations.push({
|
|
241940
|
+
ruleId: "narrative-template-structure",
|
|
241941
|
+
severity: "error",
|
|
241942
|
+
file,
|
|
241943
|
+
path: `scenarios[${scenarioIdx}].template`,
|
|
241944
|
+
message: 'Template is missing required "events" field',
|
|
241945
|
+
impact: "Template must specify how to render each event type",
|
|
241946
|
+
suggestion: 'Add "events: { eventName: template }" to map event names to templates',
|
|
241947
|
+
fixable: false
|
|
241948
|
+
});
|
|
241949
|
+
} else if (typeof template.events !== "object" || Array.isArray(template.events)) {
|
|
241950
|
+
violations.push({
|
|
241951
|
+
ruleId: "narrative-template-structure",
|
|
241952
|
+
severity: "error",
|
|
241953
|
+
file,
|
|
241954
|
+
path: `scenarios[${scenarioIdx}].template.events`,
|
|
241955
|
+
message: 'Template "events" field must be an object',
|
|
241956
|
+
impact: "Events will not render correctly",
|
|
241957
|
+
suggestion: 'Use object format: { "event.name": "template string" }',
|
|
241958
|
+
fixable: false
|
|
241959
|
+
});
|
|
241960
|
+
} else if (Object.keys(template.events).length === 0) {
|
|
241961
|
+
violations.push({
|
|
241962
|
+
ruleId: "narrative-template-structure",
|
|
241963
|
+
severity: "error",
|
|
241964
|
+
file,
|
|
241965
|
+
path: `scenarios[${scenarioIdx}].template.events`,
|
|
241966
|
+
message: 'Template "events" field must not be empty',
|
|
241967
|
+
impact: "No events will be rendered in this scenario",
|
|
241968
|
+
suggestion: 'Add at least one event template: { "event.name": "template string" }',
|
|
241969
|
+
fixable: false
|
|
241970
|
+
});
|
|
241971
|
+
}
|
|
241938
241972
|
for (const key of templateKeys) {
|
|
241939
241973
|
if (!validFields.includes(key)) {
|
|
241940
241974
|
if (key === "steps") {
|
|
@@ -247777,7 +247811,14 @@ ${source_default.cyan("3. Template syntax (Handlebars):")}
|
|
|
247777
247811
|
- eq, ne, lt, gt, lte, gte, and, or, not
|
|
247778
247812
|
- Example: {{#if (gt count 10)}}Many{{/if}}
|
|
247779
247813
|
|
|
247780
|
-
${source_default.cyan("4. Template
|
|
247814
|
+
${source_default.cyan("4. Template requirements:")}
|
|
247815
|
+
${source_default.bold("IMPORTANT:")} The ${source_default.yellow('"events"')} field is ${source_default.bold("REQUIRED")} in all templates
|
|
247816
|
+
- Must be a non-empty object mapping event names to templates
|
|
247817
|
+
- All event names must exist in the canvas
|
|
247818
|
+
- Use to customize how each event type is displayed
|
|
247819
|
+
- Example: { "event.name": "Template with {{variables}}" }
|
|
247820
|
+
|
|
247821
|
+
${source_default.cyan("5. Template style:")}
|
|
247781
247822
|
- Clear, concise summary line
|
|
247782
247823
|
- 3-5 detail steps showing workflow
|
|
247783
247824
|
- Use emojis for visual scanning (\u2705 \u274C \u{1F4CB})
|