@graph-ir/core 0.2.0 → 0.2.2

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.
Files changed (45) hide show
  1. package/README.md +14 -2
  2. package/dist/canonical-types-2.d.ts +207 -0
  3. package/dist/canonical-types-2.d.ts.map +1 -0
  4. package/dist/canonical-types-2.js +3 -0
  5. package/dist/canonical-types-2.js.map +1 -0
  6. package/dist/canonical-types.d.ts +332 -0
  7. package/dist/canonical-types.d.ts.map +1 -0
  8. package/dist/canonical-types.js +3 -0
  9. package/dist/canonical-types.js.map +1 -0
  10. package/dist/generation/id-generator.d.ts.map +1 -1
  11. package/dist/generation/id-generator.js +16 -10
  12. package/dist/generation/id-generator.js.map +1 -1
  13. package/dist/index.d.ts +2 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/output/types.d.ts.map +1 -1
  18. package/dist/schemas/graph-ir-2.0.schema.json +416 -0
  19. package/dist/schemas/graph-ir.schema.json +1684 -228
  20. package/dist/skills/diff.d.ts +4 -0
  21. package/dist/skills/diff.d.ts.map +1 -1
  22. package/dist/skills/diff.js +93 -11
  23. package/dist/skills/diff.js.map +1 -1
  24. package/dist/skills/migrate.d.ts +48 -19
  25. package/dist/skills/migrate.d.ts.map +1 -1
  26. package/dist/skills/migrate.js +482 -239
  27. package/dist/skills/migrate.js.map +1 -1
  28. package/dist/skills/visualize.d.ts.map +1 -1
  29. package/dist/skills/visualize.js +33 -5
  30. package/dist/skills/visualize.js.map +1 -1
  31. package/dist/testing/diff.d.ts +1 -1
  32. package/dist/testing/diff.d.ts.map +1 -1
  33. package/dist/testing/diff.js +52 -19
  34. package/dist/testing/diff.js.map +1 -1
  35. package/dist/types.d.ts +13 -214
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/types.js +3 -2
  38. package/dist/types.js.map +1 -1
  39. package/dist/validation/ir-validator.d.ts +35 -44
  40. package/dist/validation/ir-validator.d.ts.map +1 -1
  41. package/dist/validation/ir-validator.js +735 -288
  42. package/dist/validation/ir-validator.js.map +1 -1
  43. package/dist/validation/validator.d.ts.map +1 -1
  44. package/package.json +9 -4
  45. package/specification.json +13 -0
@@ -1 +1 @@
1
- {"version":3,"file":"id-generator.js","sourceRoot":"","sources":["../../src/generation/id-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wDAAwD;AACxD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,GAAG;IACH,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;IACN,IAAI;IACJ,MAAM;IACN,KAAK;IACL,KAAK;IACL,IAAI;IACJ,MAAM;IACN,KAAK;IACL,KAAK;IACL,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,MAAM;IACN,MAAM;IACN,MAAM;IACN,IAAI;IACJ,MAAM;IACN,KAAK;IACL,MAAM;CACP,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,IAAI,CAAC,KAAa;IAChC,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IAEtB,OAAO,CACL,KAAK;QACH,+DAA+D;SAC9D,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC;QACpC,6FAA6F;SAC5F,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC;QAC1C,uBAAuB;SACtB,WAAW,EAAE;QACd,mDAAmD;SAClD,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;QAC5B,4BAA4B;SAC3B,OAAO,C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AAK,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACK,UAAU,CAAC,MAAc;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;QAErC,IAAI,EAAU,CAAC;QACf,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;YAChB,EAAE,GAAG,MAAM,CAAC;QACd,CAAC;aAAM,CAAC;YACN,EAAE,GAAG,GAAG,MAAM,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QAChC,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
1
+ {"version":3,"file":"id-generator.js","sourceRoot":"","sources":["../../src/generation/id-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wDAAwD;AACxD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,GAAG;IACH,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;IACN,IAAI;IACJ,MAAM;IACN,KAAK;IACL,KAAK;IACL,IAAI;IACJ,MAAM;IACN,KAAK;IACL,KAAK;IACL,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,MAAM;IACN,MAAM;IACN,MAAM;IACN,IAAI;IACJ,MAAM;IACN,KAAK;IACL,MAAM;CACP,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;A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AAE,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -3,10 +3,11 @@
3
3
  *
4
4
  * Core utilities for Graph-IR validation, generation, and transformation.
5
5
  */
6
- export type { GraphIR, GraphNode, GraphEdge, Port, PortSide, Dimensions, Position, EdgeStyle, LayoutOptions, SpacingOptions, NodeLayoutOptions, SourceInfo, SourceRange, Comment, GraphMetadata, ValidationResult, ValidationError, ValidationOptions, ErrorCode, WarningCode, } from './types.js';
6
+ export type * from './types.js';
7
7
  export { validateIR, validateIRFromString, IRValidator } from './validation/index.js';
8
8
  export { toId, toLabel, isStopWord, IdGenerator } from './generation/index.js';
9
9
  export { type OutputFormat, type Formatter, type GitHubAnnotation, type PrettyFormatOptions, type JsonFormatOptions, type CIFormatOptions, PrettyFormatter, JsonFormatter, formatResult, createFormatter, formatError, formatWarning, formatSummary, formatGitHubAnnotations, formatGitHubSummary, box, table, } from './output/index.js';
10
10
  export { type Snapshot, type SnapshotMatchResult, type Change, type DiffResult, SnapshotManager, wrapSnapshot, unwrapSnapshot, diff, diffGraphIR, formatDiff, } from './testing/index.js';
11
+ export { migrateIR, migrateGraphIR2To3, formatMigrationResult, type MigrationOptions, type MigrationResult, type MigrationChange, type MigrationLoss, type GraphIR2To3MigrationOptions, type GraphIR2To3MigrationResult, type GraphIR2To3MigrationChange, type GraphIR2To3MigrationLoss, type MigrationDiagnostic, } from './skills/migrate.js';
11
12
  export { type ShapeDefinition, type ShapeParameter, type PortAnchor, type SymbolDefinition, type SymbolVariant, type SymbolPort, type SymbolDefaults, type NotationDefinition, type NotationEdgeStyle, type ConnectionRule, type ConnectionConstraints, type NotationValidation, type NotationValidationResult, type NotationError, type NotationErrorCode, type ConnectionValidationResult, SymbolRegistry, NotationRegistry, } from './symbols/index.js';
12
13
  //# sourceMappingURL=index.d.ts.map
@@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Aa,EAClB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAE/B,cAAc,EACd,gBAAgB,GACjB,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ export {
19
19
  SnapshotManager,
20
20
  // Functions
21
21
  wrapSnapshot, unwrapSnapshot, diff, diffGraphIR, formatDiff, } from './testing/index.js';
22
+ export { migrateIR, migrateGraphIR2To3, formatMigrationResult, } from './skills/migrate.js';
22
23
  // Symbols and Notations
23
24
  export {
24
25
  // Registries
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0BH,aAAa;AACb,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEtF,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE/E,SAAS;AACT,OAAO;AAQL,aAAa;AACb,eAAe,EACf,aAAa;AACb,YAAY;AACZ,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAa,EACb,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,GAAG,EACH,KAAK,GACN,MAAM,mBAAmB,CAAC;AAE3B,UAAU;AACV,OAAO;AAML,UAAU;AACV,eAAe;AACf,YAAY;AACZ,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,WAAW,EACX,UAAU,GACX,MAAM,oBAAoB,CAAC;AAE5B,wBAAwB;AACxB,OAAO;AAkBL,aAAa;AACb,cAAc,EACd,gBAAgB,GACjB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,aAAa;AACb,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEtF,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAE/E,SAAS;AACT,OAAO;AAQL,aAAa;AACb,eAAe,EACf,aAAa;AACb,YAAY;AACZ,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAa,EACb,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,GAAG,EACH,KAAK,GACN,MAAM,mBAAmB,CAAC;AAE3B,UAAU;AACV,OAAO;AAML,UAAU;AACV,eAAe;AACf,YAAY;AACZ,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,WAAW,EACX,UAAU,GACX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,qBAAqB,GAUtB,MAAM,qBAAqB,CAAC;AAE7B,wBAAwB;AACxB,OAAO;AAkBL,aAAa;AACb,cAAc,EACd,gBAAgB,GACjB,MAAM,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/output/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,aAAa,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,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CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+CAA+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uCAAuC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,416 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://graph-ir.dev/schemas/2.0/graph-ir.schema.json",
4
+ "title": "GraphIR authored graph",
5
+ "description": "Canonical authored GraphIR schema 2.0.0",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["version", "id", "nodes", "edges"],
9
+ "properties": {
10
+ "version": { "const": "2.0.0" },
11
+ "id": { "$ref": "#/$defs/Identifier" },
12
+ "name": { "type": "string" },
13
+ "nodes": { "type": "array", "items": { "$ref": "#/$defs/GraphNode" } },
14
+ "edges": { "type": "array", "items": { "$ref": "#/$defs/GraphEdge" } },
15
+ "constraints": {
16
+ "type": "array",
17
+ "items": { "$ref": "#/$defs/SpatialConstraint" }
18
+ },
19
+ "metadata": { "$ref": "#/$defs/GraphMetadata" },
20
+ "layoutOptions": { "$ref": "#/$defs/LayoutOptions" }
21
+ },
22
+ "$defs": {
23
+ "Identifier": { "type": "string", "minLength": 1 },
24
+ "Position": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "required": ["x", "y"],
28
+ "properties": { "x": { "type": "number" }, "y": { "type": "number" } }
29
+ },
30
+ "Dimensions": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": ["width", "height"],
34
+ "properties": {
35
+ "width": { "type": "number", "minimum": 0 },
36
+ "height": { "type": "number", "minimum": 0 }
37
+ }
38
+ },
39
+ "PlacementSide": {
40
+ "type": "string",
41
+ "enum": ["above", "below", "left", "right", "center"]
42
+ },
43
+ "NodeLabelPlacement": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "required": ["side"],
47
+ "properties": {
48
+ "side": { "$ref": "#/$defs/PlacementSide" },
49
+ "offset": { "type": "number", "minimum": 0, "default": 0 }
50
+ },
51
+ "allOf": [
52
+ {
53
+ "if": { "properties": { "side": { "const": "center" } }, "required": ["side"] },
54
+ "then": { "properties": { "offset": { "const": 0 } } }
55
+ }
56
+ ]
57
+ },
58
+ "EdgeLabelPlacement": {
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "required": ["side"],
62
+ "properties": {
63
+ "side": { "$ref": "#/$defs/PlacementSide" },
64
+ "at": { "type": "number", "minimum": 0, "maximum": 1, "default": 0.5 },
65
+ "offset": { "type": "number", "minimum": 0, "default": 0 }
66
+ },
67
+ "allOf": [
68
+ {
69
+ "if": { "properties": { "side": { "const": "center" } }, "required": ["side"] },
70
+ "then": { "properties": { "offset": { "const": 0 } } }
71
+ }
72
+ ]
73
+ },
74
+ "Port": {
75
+ "type": "object",
76
+ "additionalProperties": false,
77
+ "required": ["id", "side"],
78
+ "properties": {
79
+ "id": { "$ref": "#/$defs/Identifier" },
80
+ "side": { "type": "string", "enum": ["NORTH", "SOUTH", "EAST", "WEST"] },
81
+ "label": { "type": "string" },
82
+ "position": { "type": "number", "minimum": 0, "maximum": 1 },
83
+ "properties": { "type": "object", "additionalProperties": true }
84
+ }
85
+ },
86
+ "Padding": {
87
+ "type": "object",
88
+ "additionalProperties": false,
89
+ "properties": {
90
+ "top": { "type": "number", "minimum": 0, "default": 0 },
91
+ "right": { "type": "number", "minimum": 0, "default": 0 },
92
+ "bottom": { "type": "number", "minimum": 0, "default": 0 },
93
+ "left": { "type": "number", "minimum": 0, "default": 0 }
94
+ }
95
+ },
96
+ "SpacingOptions": {
97
+ "type": "object",
98
+ "additionalProperties": false,
99
+ "properties": {
100
+ "nodeNode": { "type": "number", "minimum": 0 },
101
+ "nodeEdge": { "type": "number", "minimum": 0 },
102
+ "edgeEdge": { "type": "number", "minimum": 0 },
103
+ "layerSpacing": { "type": "number", "minimum": 0 }
104
+ }
105
+ },
106
+ "LayoutOptions": {
107
+ "type": "object",
108
+ "additionalProperties": false,
109
+ "properties": {
110
+ "algorithm": { "type": "string", "enum": ["layered", "force", "radial", "tree", "fixed"] },
111
+ "direction": { "type": "string", "enum": ["DOWN", "UP", "LEFT", "RIGHT"] },
112
+ "spacing": { "$ref": "#/$defs/SpacingOptions" },
113
+ "edgeRouting": { "type": "string", "enum": ["orthogonal", "polyline", "spline"] },
114
+ "hierarchyHandling": { "type": "string", "enum": ["INCLUDE_CHILDREN", "SEPARATE_CHILDREN"] }
115
+ }
116
+ },
117
+ "NodeLayoutOptions": {
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "properties": {
121
+ "portConstraints": { "type": "string", "enum": ["FREE", "FIXED_SIDE", "FIXED_ORDER", "FIXED_POS"] },
122
+ "portAlignment": { "type": "string", "enum": ["BEGIN", "CENTER", "END", "JUSTIFIED"] },
123
+ "sizeConstraints": {
124
+ "type": "array",
125
+ "items": { "type": "string", "enum": ["MINIMUM_SIZE", "NODE_LABELS", "PORTS"] },
126
+ "uniqueItems": true
127
+ },
128
+ "minimumSize": { "$ref": "#/$defs/Dimensions" },
129
+ "padding": { "$ref": "#/$defs/Padding" }
130
+ }
131
+ },
132
+ "GraphNode": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "required": ["id", "type"],
136
+ "properties": {
137
+ "id": { "$ref": "#/$defs/Identifier" },
138
+ "type": { "$ref": "#/$defs/Identifier" },
139
+ "label": { "type": "string" },
140
+ "description": { "type": "string" },
141
+ "symbol": { "type": "string" },
142
+ "variant": { "type": "string" },
143
+ "properties": { "type": "object", "additionalProperties": true },
144
+ "children": { "type": "array", "items": { "$ref": "#/$defs/GraphNode" } },
145
+ "parent": { "$ref": "#/$defs/Identifier" },
146
+ "ports": { "type": "array", "items": { "$ref": "#/$defs/Port" } },
147
+ "dimensions": { "$ref": "#/$defs/Dimensions" },
148
+ "position": { "$ref": "#/$defs/Position" },
149
+ "pinned": { "type": "boolean" },
150
+ "labelPlacement": { "$ref": "#/$defs/NodeLabelPlacement" },
151
+ "layoutOptions": { "$ref": "#/$defs/NodeLayoutOptions" },
152
+ "sourceInfo": { "$ref": "#/$defs/SourceInfo" }
153
+ },
154
+ "allOf": [
155
+ {
156
+ "if": { "properties": { "pinned": { "const": true } }, "required": ["pinned"] },
157
+ "then": { "required": ["position"] }
158
+ }
159
+ ]
160
+ },
161
+ "EdgeStyle": {
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "properties": {
165
+ "lineStyle": { "type": "string", "enum": ["solid", "dashed", "dotted"] },
166
+ "targetArrow": { "type": "string", "enum": ["arrow", "diamond", "circle", "none"] },
167
+ "sourceArrow": { "type": "string", "enum": ["arrow", "diamond", "circle", "none"] },
168
+ "routing": { "type": "string", "enum": ["orthogonal", "polyline", "spline"] }
169
+ }
170
+ },
171
+ "RouteAnchor": {
172
+ "oneOf": [
173
+ {
174
+ "type": "object",
175
+ "additionalProperties": false,
176
+ "required": ["kind"],
177
+ "properties": { "kind": { "const": "source" } }
178
+ },
179
+ {
180
+ "type": "object",
181
+ "additionalProperties": false,
182
+ "required": ["kind"],
183
+ "properties": { "kind": { "const": "target" } }
184
+ },
185
+ {
186
+ "type": "object",
187
+ "additionalProperties": false,
188
+ "required": ["kind", "nodeId"],
189
+ "properties": { "kind": { "const": "node" }, "nodeId": { "$ref": "#/$defs/Identifier" } }
190
+ },
191
+ {
192
+ "type": "object",
193
+ "additionalProperties": false,
194
+ "required": ["kind", "nodeId", "portId"],
195
+ "properties": {
196
+ "kind": { "const": "port" },
197
+ "nodeId": { "$ref": "#/$defs/Identifier" },
198
+ "portId": { "$ref": "#/$defs/Identifier" }
199
+ }
200
+ }
201
+ ]
202
+ },
203
+ "WaypointPlacement": {
204
+ "oneOf": [
205
+ {
206
+ "type": "object",
207
+ "additionalProperties": false,
208
+ "required": ["kind", "position"],
209
+ "properties": {
210
+ "kind": { "const": "absolute" },
211
+ "position": { "$ref": "#/$defs/Position" }
212
+ }
213
+ },
214
+ {
215
+ "type": "object",
216
+ "additionalProperties": false,
217
+ "required": ["kind", "anchor", "offset"],
218
+ "properties": {
219
+ "kind": { "const": "relative" },
220
+ "anchor": { "$ref": "#/$defs/RouteAnchor" },
221
+ "offset": { "$ref": "#/$defs/Position" }
222
+ }
223
+ }
224
+ ]
225
+ },
226
+ "RouteWaypoint": {
227
+ "type": "object",
228
+ "additionalProperties": false,
229
+ "required": ["id", "placement"],
230
+ "properties": {
231
+ "id": { "$ref": "#/$defs/Identifier" },
232
+ "placement": { "$ref": "#/$defs/WaypointPlacement" }
233
+ }
234
+ },
235
+ "RouteIntent": {
236
+ "type": "object",
237
+ "additionalProperties": false,
238
+ "required": ["waypoints"],
239
+ "properties": {
240
+ "waypoints": {
241
+ "type": "array",
242
+ "minItems": 1,
243
+ "items": { "$ref": "#/$defs/RouteWaypoint" }
244
+ }
245
+ }
246
+ },
247
+ "GraphEdge": {
248
+ "type": "object",
249
+ "additionalProperties": false,
250
+ "required": ["id", "source", "target"],
251
+ "properties": {
252
+ "id": { "$ref": "#/$defs/Identifier" },
253
+ "source": { "$ref": "#/$defs/Identifier" },
254
+ "target": { "$ref": "#/$defs/Identifier" },
255
+ "sourcePort": { "$ref": "#/$defs/Identifier" },
256
+ "targetPort": { "$ref": "#/$defs/Identifier" },
257
+ "type": { "type": "string" },
258
+ "label": { "type": "string" },
259
+ "description": { "type": "string" },
260
+ "labelPlacement": { "$ref": "#/$defs/EdgeLabelPlacement" },
261
+ "routeIntent": { "$ref": "#/$defs/RouteIntent" },
262
+ "properties": { "type": "object", "additionalProperties": true },
263
+ "style": { "$ref": "#/$defs/EdgeStyle" },
264
+ "sourceInfo": { "$ref": "#/$defs/SourceInfo" }
265
+ }
266
+ },
267
+ "ConstraintNodeReference": {
268
+ "type": "object",
269
+ "additionalProperties": false,
270
+ "required": ["kind", "nodeId"],
271
+ "properties": {
272
+ "kind": { "const": "node" },
273
+ "nodeId": { "$ref": "#/$defs/Identifier" }
274
+ }
275
+ },
276
+ "BoundaryScope": {
277
+ "oneOf": [
278
+ {
279
+ "type": "object",
280
+ "additionalProperties": false,
281
+ "required": ["kind"],
282
+ "properties": { "kind": { "const": "graph" } }
283
+ },
284
+ {
285
+ "type": "object",
286
+ "additionalProperties": false,
287
+ "required": ["kind", "nodeId"],
288
+ "properties": { "kind": { "const": "node" }, "nodeId": { "$ref": "#/$defs/Identifier" } }
289
+ }
290
+ ]
291
+ },
292
+ "ConstraintBaseProperties": {
293
+ "type": "object",
294
+ "properties": {
295
+ "id": { "$ref": "#/$defs/Identifier" },
296
+ "strength": { "type": "string", "enum": ["required", "preferred"], "default": "required" },
297
+ "sourceInfo": { "$ref": "#/$defs/SourceInfo" }
298
+ }
299
+ },
300
+ "RelativeConstraint": {
301
+ "type": "object",
302
+ "additionalProperties": false,
303
+ "required": ["id", "kind", "subject", "relation", "target"],
304
+ "properties": {
305
+ "id": { "$ref": "#/$defs/Identifier" },
306
+ "kind": { "const": "relative" },
307
+ "strength": { "type": "string", "enum": ["required", "preferred"], "default": "required" },
308
+ "sourceInfo": { "$ref": "#/$defs/SourceInfo" },
309
+ "subject": { "$ref": "#/$defs/ConstraintNodeReference" },
310
+ "relation": { "type": "string", "enum": ["above", "below", "left-of", "right-of"] },
311
+ "target": { "$ref": "#/$defs/ConstraintNodeReference" },
312
+ "gap": { "type": "number", "minimum": 0, "default": 0 },
313
+ "alignment": { "type": "string", "enum": ["start", "center", "end"], "default": "center" }
314
+ }
315
+ },
316
+ "BoundaryConstraint": {
317
+ "type": "object",
318
+ "additionalProperties": false,
319
+ "required": ["id", "kind", "subject", "side", "scope"],
320
+ "properties": {
321
+ "id": { "$ref": "#/$defs/Identifier" },
322
+ "kind": { "const": "boundary" },
323
+ "strength": { "type": "string", "enum": ["required", "preferred"], "default": "required" },
324
+ "sourceInfo": { "$ref": "#/$defs/SourceInfo" },
325
+ "subject": { "$ref": "#/$defs/ConstraintNodeReference" },
326
+ "side": { "type": "string", "enum": ["top", "bottom", "left", "right"] },
327
+ "scope": { "$ref": "#/$defs/BoundaryScope" },
328
+ "inset": { "type": "number", "minimum": 0, "default": 0 }
329
+ }
330
+ },
331
+ "ArrangementConstraint": {
332
+ "type": "object",
333
+ "additionalProperties": false,
334
+ "required": ["id", "kind", "subjects", "axis"],
335
+ "properties": {
336
+ "id": { "$ref": "#/$defs/Identifier" },
337
+ "kind": { "const": "arrangement" },
338
+ "strength": { "type": "string", "enum": ["required", "preferred"], "default": "required" },
339
+ "sourceInfo": { "$ref": "#/$defs/SourceInfo" },
340
+ "subjects": {
341
+ "type": "array",
342
+ "minItems": 2,
343
+ "uniqueItems": true,
344
+ "items": { "$ref": "#/$defs/ConstraintNodeReference" }
345
+ },
346
+ "axis": { "type": "string", "enum": ["row", "column"] },
347
+ "direction": { "type": "string", "enum": ["forward", "reverse"], "default": "forward" },
348
+ "gap": { "type": "number", "minimum": 0, "default": 0 },
349
+ "alignment": { "type": "string", "enum": ["start", "center", "end"], "default": "center" }
350
+ }
351
+ },
352
+ "SpatialConstraint": {
353
+ "oneOf": [
354
+ { "$ref": "#/$defs/RelativeConstraint" },
355
+ { "$ref": "#/$defs/BoundaryConstraint" },
356
+ { "$ref": "#/$defs/ArrangementConstraint" }
357
+ ]
358
+ },
359
+ "SourcePosition": {
360
+ "type": "object",
361
+ "additionalProperties": false,
362
+ "required": ["line", "column"],
363
+ "properties": {
364
+ "line": { "type": "integer", "minimum": 0 },
365
+ "column": { "type": "integer", "minimum": 0 }
366
+ }
367
+ },
368
+ "SourceRange": {
369
+ "type": "object",
370
+ "additionalProperties": false,
371
+ "required": ["start", "end"],
372
+ "properties": {
373
+ "start": { "type": "integer", "minimum": 0 },
374
+ "end": { "type": "integer", "minimum": 0 },
375
+ "startPosition": { "$ref": "#/$defs/SourcePosition" },
376
+ "endPosition": { "$ref": "#/$defs/SourcePosition" }
377
+ }
378
+ },
379
+ "Comment": {
380
+ "type": "object",
381
+ "additionalProperties": false,
382
+ "required": ["text", "style"],
383
+ "properties": {
384
+ "text": { "type": "string" },
385
+ "style": { "type": "string", "enum": ["line", "block"] },
386
+ "range": { "$ref": "#/$defs/SourceRange" }
387
+ }
388
+ },
389
+ "SourceInfo": {
390
+ "type": "object",
391
+ "additionalProperties": false,
392
+ "required": ["range"],
393
+ "properties": {
394
+ "range": { "$ref": "#/$defs/SourceRange" },
395
+ "leadingComments": { "type": "array", "items": { "$ref": "#/$defs/Comment" } },
396
+ "trailingComment": { "$ref": "#/$defs/Comment" },
397
+ "leadingWhitespace": { "type": "string" },
398
+ "modified": { "type": "boolean" },
399
+ "originalText": { "type": "string" }
400
+ }
401
+ },
402
+ "GraphMetadata": {
403
+ "type": "object",
404
+ "additionalProperties": false,
405
+ "properties": {
406
+ "author": { "type": "string" },
407
+ "created": { "type": "string", "format": "date-time" },
408
+ "modified": { "type": "string", "format": "date-time" },
409
+ "description": { "type": "string" },
410
+ "tags": { "type": "array", "items": { "type": "string" } },
411
+ "notation": { "type": "string" },
412
+ "custom": { "type": "object", "additionalProperties": true }
413
+ }
414
+ }
415
+ }
416
+ }