@principal-ai/principal-view-cli 0.1.21 → 0.1.22

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.
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAshCpC,wBAAgB,qBAAqB,IAAI,OAAO,CAsH/C"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4iCpC,wBAAgB,qBAAqB,IAAI,OAAO,CAsH/C"}
@@ -724,6 +724,28 @@ function validateCanvas(canvas, filePath, library) {
724
724
  suggestion: `Valid values: ${VALID_SIDES.join(', ')}`,
725
725
  });
726
726
  }
727
+ // Validate pv extension is present with edgeType
728
+ if (!e.pv || typeof e.pv !== 'object') {
729
+ issues.push({
730
+ type: 'error',
731
+ message: `Edge "${edgeLabel}" must have a "pv" extension with edgeType`,
732
+ path: `${edgePath}.pv`,
733
+ suggestion: 'Add: "pv": { "edgeType": "your-edge-type" }',
734
+ });
735
+ }
736
+ else {
737
+ const edgePv = e.pv;
738
+ if (typeof edgePv.edgeType !== 'string' || !edgePv.edgeType) {
739
+ issues.push({
740
+ type: 'error',
741
+ message: `Edge "${edgeLabel}" must have a "pv.edgeType" field`,
742
+ path: `${edgePath}.pv.edgeType`,
743
+ suggestion: allDefinedEdgeTypes.length > 0
744
+ ? `Available types: ${allDefinedEdgeTypes.join(', ')}`
745
+ : 'Define edge types in canvas pv.edgeTypes or library.yaml edgeComponents',
746
+ });
747
+ }
748
+ }
727
749
  // Validate edge pv extension fields
728
750
  if (e.pv && typeof e.pv === 'object') {
729
751
  const edgePv = e.pv;
package/dist/index.cjs CHANGED
@@ -14176,6 +14176,24 @@ function validateCanvas(canvas, filePath, library) {
14176
14176
  suggestion: `Valid values: ${VALID_SIDES.join(", ")}`
14177
14177
  });
14178
14178
  }
14179
+ if (!e.pv || typeof e.pv !== "object") {
14180
+ issues.push({
14181
+ type: "error",
14182
+ message: `Edge "${edgeLabel}" must have a "pv" extension with edgeType`,
14183
+ path: `${edgePath}.pv`,
14184
+ suggestion: 'Add: "pv": { "edgeType": "your-edge-type" }'
14185
+ });
14186
+ } else {
14187
+ const edgePv = e.pv;
14188
+ if (typeof edgePv.edgeType !== "string" || !edgePv.edgeType) {
14189
+ issues.push({
14190
+ type: "error",
14191
+ message: `Edge "${edgeLabel}" must have a "pv.edgeType" field`,
14192
+ path: `${edgePath}.pv.edgeType`,
14193
+ suggestion: allDefinedEdgeTypes.length > 0 ? `Available types: ${allDefinedEdgeTypes.join(", ")}` : "Define edge types in canvas pv.edgeTypes or library.yaml edgeComponents"
14194
+ });
14195
+ }
14196
+ }
14179
14197
  if (e.pv && typeof e.pv === "object") {
14180
14198
  const edgePv = e.pv;
14181
14199
  checkUnknownFields(edgePv, ALLOWED_CANVAS_FIELDS.edgePv, `${edgePath}.pv`, issues);