@principal-ai/principal-view-cli 0.4.2 → 0.4.3

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 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") {