@graph-ir/core 0.2.0

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 (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -0
  3. package/dist/generation/id-generator.d.ts +81 -0
  4. package/dist/generation/id-generator.d.ts.map +1 -0
  5. package/dist/generation/id-generator.js +193 -0
  6. package/dist/generation/id-generator.js.map +1 -0
  7. package/dist/generation/index.d.ts +7 -0
  8. package/dist/generation/index.d.ts.map +1 -0
  9. package/dist/generation/index.js +7 -0
  10. package/dist/generation/index.js.map +1 -0
  11. package/dist/index.d.ts +12 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +26 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/output/ci.d.ts +36 -0
  16. package/dist/output/ci.d.ts.map +1 -0
  17. package/dist/output/ci.js +145 -0
  18. package/dist/output/ci.js.map +1 -0
  19. package/dist/output/index.d.ts +20 -0
  20. package/dist/output/index.d.ts.map +1 -0
  21. package/dist/output/index.js +40 -0
  22. package/dist/output/index.js.map +1 -0
  23. package/dist/output/json.d.ts +24 -0
  24. package/dist/output/json.d.ts.map +1 -0
  25. package/dist/output/json.js +49 -0
  26. package/dist/output/json.js.map +1 -0
  27. package/dist/output/pretty.d.ts +44 -0
  28. package/dist/output/pretty.d.ts.map +1 -0
  29. package/dist/output/pretty.js +227 -0
  30. package/dist/output/pretty.js.map +1 -0
  31. package/dist/output/types.d.ts +63 -0
  32. package/dist/output/types.d.ts.map +1 -0
  33. package/dist/output/types.js +5 -0
  34. package/dist/output/types.js.map +1 -0
  35. package/dist/schemas/graph-ir.schema.json +360 -0
  36. package/dist/skills/diff.d.ts +73 -0
  37. package/dist/skills/diff.d.ts.map +1 -0
  38. package/dist/skills/diff.js +315 -0
  39. package/dist/skills/diff.js.map +1 -0
  40. package/dist/skills/migrate.d.ts +40 -0
  41. package/dist/skills/migrate.d.ts.map +1 -0
  42. package/dist/skills/migrate.js +288 -0
  43. package/dist/skills/migrate.js.map +1 -0
  44. package/dist/skills/visualize.d.ts +30 -0
  45. package/dist/skills/visualize.d.ts.map +1 -0
  46. package/dist/skills/visualize.js +254 -0
  47. package/dist/skills/visualize.js.map +1 -0
  48. package/dist/symbols/index.d.ts +12 -0
  49. package/dist/symbols/index.d.ts.map +1 -0
  50. package/dist/symbols/index.js +12 -0
  51. package/dist/symbols/index.js.map +1 -0
  52. package/dist/symbols/notation-registry.d.ts +61 -0
  53. package/dist/symbols/notation-registry.d.ts.map +1 -0
  54. package/dist/symbols/notation-registry.js +114 -0
  55. package/dist/symbols/notation-registry.js.map +1 -0
  56. package/dist/symbols/symbol-registry.d.ts +58 -0
  57. package/dist/symbols/symbol-registry.d.ts.map +1 -0
  58. package/dist/symbols/symbol-registry.js +88 -0
  59. package/dist/symbols/symbol-registry.js.map +1 -0
  60. package/dist/symbols/types.d.ts +166 -0
  61. package/dist/symbols/types.d.ts.map +1 -0
  62. package/dist/symbols/types.js +13 -0
  63. package/dist/symbols/types.js.map +1 -0
  64. package/dist/testing/diff.d.ts +46 -0
  65. package/dist/testing/diff.d.ts.map +1 -0
  66. package/dist/testing/diff.js +400 -0
  67. package/dist/testing/diff.js.map +1 -0
  68. package/dist/testing/index.d.ts +10 -0
  69. package/dist/testing/index.d.ts.map +1 -0
  70. package/dist/testing/index.js +10 -0
  71. package/dist/testing/index.js.map +1 -0
  72. package/dist/testing/snapshot.d.ts +95 -0
  73. package/dist/testing/snapshot.d.ts.map +1 -0
  74. package/dist/testing/snapshot.js +172 -0
  75. package/dist/testing/snapshot.js.map +1 -0
  76. package/dist/types.d.ts +240 -0
  77. package/dist/types.d.ts.map +1 -0
  78. package/dist/types.js +7 -0
  79. package/dist/types.js.map +1 -0
  80. package/dist/validation/index.d.ts +9 -0
  81. package/dist/validation/index.d.ts.map +1 -0
  82. package/dist/validation/index.js +8 -0
  83. package/dist/validation/index.js.map +1 -0
  84. package/dist/validation/ir-validator.d.ts +51 -0
  85. package/dist/validation/ir-validator.d.ts.map +1 -0
  86. package/dist/validation/ir-validator.js +349 -0
  87. package/dist/validation/ir-validator.js.map +1 -0
  88. package/dist/validation/validator.d.ts +13 -0
  89. package/dist/validation/validator.d.ts.map +1 -0
  90. package/dist/validation/validator.js +19 -0
  91. package/dist/validation/validator.js.map +1 -0
  92. package/package.json +73 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Graph-IR Tools contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @graph-ir/core
2
+
3
+ Canonical Graph-IR types, JSON Schema validation, ID generation, output
4
+ formatters, and testing utilities.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ npm install @graph-ir/core
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```typescript
15
+ import { validateIR, PrettyFormatter } from '@graph-ir/core';
16
+
17
+ const result = validateIR(graphIR, { strict: true });
18
+ console.log(new PrettyFormatter().format(result));
19
+ ```
20
+
21
+ The Graph-IR document schema and the npm package have independent versions.
22
+ This package release is `0.2.0`; its current Graph-IR schema is `1.0.0`.
23
+
24
+ ## License
25
+
26
+ MIT
@@ -0,0 +1,81 @@
1
+ /**
2
+ * ID Generator utilities for Graph-IR
3
+ *
4
+ * Provides consistent ID generation from labels and ensures uniqueness.
5
+ */
6
+ /**
7
+ * Check if a word is a common stop word
8
+ */
9
+ export declare function isStopWord(word: string): boolean;
10
+ /**
11
+ * Convert a label to a kebab-case ID
12
+ *
13
+ * @example
14
+ * toId('Hello World') // 'hello-world'
15
+ * toId('UserService') // 'user-service'
16
+ * toId('HTTPRequest') // 'http-request'
17
+ */
18
+ export declare function toId(label: string): string;
19
+ /**
20
+ * Convert an ID back to a human-readable label (title case)
21
+ *
22
+ * @example
23
+ * toLabel('hello-world') // 'Hello World'
24
+ * toLabel('user_service') // 'User Service'
25
+ */
26
+ export declare function toLabel(id: string): string;
27
+ /**
28
+ * ID Generator with uniqueness tracking
29
+ *
30
+ * Ensures generated IDs are unique within a context by adding
31
+ * numeric suffixes when needed.
32
+ */
33
+ export declare class IdGenerator {
34
+ /** Set of all generated/reserved IDs */
35
+ private usedIds;
36
+ /** Counter for each base ID (for suffixing duplicates) */
37
+ private idCounts;
38
+ /** Counter for sequential ID generation */
39
+ private sequentialCounters;
40
+ /**
41
+ * Generate a unique ID from a label
42
+ *
43
+ * @example
44
+ * const gen = new IdGenerator();
45
+ * gen.generate('User Service'); // 'user-service'
46
+ * gen.generate('User Service'); // 'user-service-2'
47
+ */
48
+ generate(label: string): string;
49
+ /**
50
+ * Generate a unique ID with a prefix
51
+ *
52
+ * @example
53
+ * gen.generateWithPrefix('node', 'User'); // 'node-user'
54
+ */
55
+ generateWithPrefix(prefix: string, label: string): string;
56
+ /**
57
+ * Generate a sequential ID with a prefix
58
+ *
59
+ * @example
60
+ * gen.generateSequential('edge'); // 'edge-1'
61
+ * gen.generateSequential('edge'); // 'edge-2'
62
+ */
63
+ generateSequential(prefix: string): string;
64
+ /**
65
+ * Check if an ID has been used
66
+ */
67
+ has(id: string): boolean;
68
+ /**
69
+ * Reserve an ID (mark as used without generating)
70
+ */
71
+ reserve(id: string): void;
72
+ /**
73
+ * Reset all state
74
+ */
75
+ reset(): void;
76
+ /**
77
+ * Make a base ID unique by adding a suffix if needed
78
+ */
79
+ private makeUnique;
80
+ }
81
+ //# sourceMappingURL=id-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id-generator.d.ts","sourceRoot":"","sources":["../../src/generation/id-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0CH;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAkB1C;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAM1C;AAED;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,wCAAwC;IACxC,OAAO,CAAC,OAAO,CAAqB;IAEpC,0DAA0D;IAC1D,OAAO,CAAC,QAAQ,CAA6B;IAE7C,2CAA2C;IAC3C,OAAO,CAAC,kBAAkB,CAA6B;IAEvD;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK/B;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAKzD;;;;;;OAMG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAS1C;;OAEG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAoBzB;;OAEG;IACH,KAAK,IAAI,IAAI;IAMb;;OAEG;IACH,OAAO,CAAC,UAAU;CAcnB"}
@@ -0,0 +1,193 @@
1
+ /**
2
+ * ID Generator utilities for Graph-IR
3
+ *
4
+ * Provides consistent ID generation from labels and ensures uniqueness.
5
+ */
6
+ /** Common stop words that are often omitted from IDs */
7
+ const STOP_WORDS = new Set([
8
+ 'a',
9
+ 'an',
10
+ 'the',
11
+ 'of',
12
+ 'to',
13
+ 'in',
14
+ 'for',
15
+ 'on',
16
+ 'with',
17
+ 'at',
18
+ 'by',
19
+ 'from',
20
+ 'as',
21
+ 'is',
22
+ 'was',
23
+ 'are',
24
+ 'were',
25
+ 'been',
26
+ 'be',
27
+ 'have',
28
+ 'has',
29
+ 'had',
30
+ 'do',
31
+ 'does',
32
+ 'did',
33
+ 'and',
34
+ 'or',
35
+ 'but',
36
+ 'if',
37
+ 'then',
38
+ 'else',
39
+ 'when',
40
+ 'up',
41
+ 'down',
42
+ 'out',
43
+ 'into',
44
+ ]);
45
+ /**
46
+ * Check if a word is a common stop word
47
+ */
48
+ export function isStopWord(word) {
49
+ return STOP_WORDS.has(word.toLowerCase());
50
+ }
51
+ /**
52
+ * Convert a label to a kebab-case ID
53
+ *
54
+ * @example
55
+ * toId('Hello World') // 'hello-world'
56
+ * toId('UserService') // 'user-service'
57
+ * toId('HTTPRequest') // 'http-request'
58
+ */
59
+ export function toId(label) {
60
+ if (!label)
61
+ return '';
62
+ return (label
63
+ // Insert hyphen before uppercase letters that follow lowercase
64
+ .replace(/([a-z])([A-Z])/g, '$1-$2')
65
+ // Insert hyphen before uppercase letters in consecutive caps (e.g., XMLParser -> XML-Parser)
66
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
67
+ // Convert to lowercase
68
+ .toLowerCase()
69
+ // Replace non-alphanumeric characters with hyphens
70
+ .replace(/[^a-z0-9]+/g, '-')
71
+ // Collapse multiple hyphens
72
+ .replace(/-+/g, '-')
73
+ // Trim leading/trailing hyphens
74
+ .replace(/^-|-$/g, ''));
75
+ }
76
+ /**
77
+ * Convert an ID back to a human-readable label (title case)
78
+ *
79
+ * @example
80
+ * toLabel('hello-world') // 'Hello World'
81
+ * toLabel('user_service') // 'User Service'
82
+ */
83
+ export function toLabel(id) {
84
+ if (!id)
85
+ return '';
86
+ return id
87
+ .replace(/[-_]+/g, ' ')
88
+ .replace(/\b\w/g, (char) => char.toUpperCase());
89
+ }
90
+ /**
91
+ * ID Generator with uniqueness tracking
92
+ *
93
+ * Ensures generated IDs are unique within a context by adding
94
+ * numeric suffixes when needed.
95
+ */
96
+ export class IdGenerator {
97
+ /** Set of all generated/reserved IDs */
98
+ usedIds = new Set();
99
+ /** Counter for each base ID (for suffixing duplicates) */
100
+ idCounts = new Map();
101
+ /** Counter for sequential ID generation */
102
+ sequentialCounters = new Map();
103
+ /**
104
+ * Generate a unique ID from a label
105
+ *
106
+ * @example
107
+ * const gen = new IdGenerator();
108
+ * gen.generate('User Service'); // 'user-service'
109
+ * gen.generate('User Service'); // 'user-service-2'
110
+ */
111
+ generate(label) {
112
+ const baseId = toId(label);
113
+ return this.makeUnique(baseId);
114
+ }
115
+ /**
116
+ * Generate a unique ID with a prefix
117
+ *
118
+ * @example
119
+ * gen.generateWithPrefix('node', 'User'); // 'node-user'
120
+ */
121
+ generateWithPrefix(prefix, label) {
122
+ const baseId = `${prefix}-${toId(label)}`;
123
+ return this.makeUnique(baseId);
124
+ }
125
+ /**
126
+ * Generate a sequential ID with a prefix
127
+ *
128
+ * @example
129
+ * gen.generateSequential('edge'); // 'edge-1'
130
+ * gen.generateSequential('edge'); // 'edge-2'
131
+ */
132
+ generateSequential(prefix) {
133
+ const count = (this.sequentialCounters.get(prefix) ?? 0) + 1;
134
+ this.sequentialCounters.set(prefix, count);
135
+ const id = `${prefix}-${count}`;
136
+ this.usedIds.add(id);
137
+ return id;
138
+ }
139
+ /**
140
+ * Check if an ID has been used
141
+ */
142
+ has(id) {
143
+ return this.usedIds.has(id);
144
+ }
145
+ /**
146
+ * Reserve an ID (mark as used without generating)
147
+ */
148
+ reserve(id) {
149
+ this.usedIds.add(id);
150
+ // Update count if this matches a pattern we're tracking
151
+ const match = id.match(/^(.+)-(\d+)$/);
152
+ if (match) {
153
+ const [, base, numStr] = match;
154
+ const num = parseInt(numStr, 10);
155
+ const currentCount = this.idCounts.get(base) ?? 1;
156
+ if (num >= currentCount) {
157
+ this.idCounts.set(base, num);
158
+ }
159
+ }
160
+ else {
161
+ // Reserve the base ID
162
+ const currentCount = this.idCounts.get(id) ?? 0;
163
+ if (currentCount === 0) {
164
+ this.idCounts.set(id, 1);
165
+ }
166
+ }
167
+ }
168
+ /**
169
+ * Reset all state
170
+ */
171
+ reset() {
172
+ this.usedIds.clear();
173
+ this.idCounts.clear();
174
+ this.sequentialCounters.clear();
175
+ }
176
+ /**
177
+ * Make a base ID unique by adding a suffix if needed
178
+ */
179
+ makeUnique(baseId) {
180
+ const count = this.idCounts.get(baseId) ?? 0;
181
+ this.idCounts.set(baseId, count + 1);
182
+ let id;
183
+ if (count === 0) {
184
+ id = baseId;
185
+ }
186
+ else {
187
+ id = `${baseId}-${count + 1}`;
188
+ }
189
+ this.usedIds.add(id);
190
+ return id;
191
+ }
192
+ }
193
+ //# sourceMappingURL=id-generator.js.map
@@ -0,0 +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;IAC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ements.
5
+ */
6
+ export { toId, toLabel, isStopWord, IdGenerator } from './id-generator.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generation/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Generation module for Graph-IR
3
+ *
4
+ * Utilities for generating IDs and other graph elements.
5
+ */
6
+ export { toId, toLabel, isStopWord, IdGenerator } from './id-generator.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generation/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @graph-ir/core
3
+ *
4
+ * Core utilities for Graph-IR validation, generation, and transformation.
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';
7
+ export { validateIR, validateIRFromString, IRValidator } from './validation/index.js';
8
+ export { toId, toLabel, isStopWord, IdGenerator } from './generation/index.js';
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
+ export { type Snapshot, type SnapshotMatchResult, type Change, type DiffResult, SnapshotManager, wrapSnapshot, unwrapSnapshot, diff, diffGraphIR, formatDiff, } from './testing/index.js';
11
+ 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
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,OAAO,EACP,SAAS,EACT,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,WAAW,GACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGtF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAG/E,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAEpB,eAAe,EACf,aAAa,EAEb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,aAAa,EACb,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,GAAG,EACH,KAAK,GACN,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,MAAM,EACX,KAAK,UAAU,EAEf,eAAe,EAEf,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,WAAW,EACX,UAAU,GACX,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,aAAa,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 ADDED
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @graph-ir/core
3
+ *
4
+ * Core utilities for Graph-IR validation, generation, and transformation.
5
+ */
6
+ // Validation
7
+ export { validateIR, validateIRFromString, IRValidator } from './validation/index.js';
8
+ // Generation
9
+ export { toId, toLabel, isStopWord, IdGenerator } from './generation/index.js';
10
+ // Output
11
+ export {
12
+ // Formatters
13
+ PrettyFormatter, JsonFormatter,
14
+ // Functions
15
+ formatResult, createFormatter, formatError, formatWarning, formatSummary, formatGitHubAnnotations, formatGitHubSummary, box, table, } from './output/index.js';
16
+ // Testing
17
+ export {
18
+ // Classes
19
+ SnapshotManager,
20
+ // Functions
21
+ wrapSnapshot, unwrapSnapshot, diff, diffGraphIR, formatDiff, } from './testing/index.js';
22
+ // Symbols and Notations
23
+ export {
24
+ // Registries
25
+ SymbolRegistry, NotationRegistry, } from './symbols/index.js';
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * CI Formatter for GitHub Actions Annotations
3
+ *
4
+ * Formats validation results as GitHub Actions workflow commands.
5
+ */
6
+ import type { ValidationResult, ValidationError } from '../types.js';
7
+ import type { GitHubAnnotation, CIFormatOptions } from './types.js';
8
+ /**
9
+ * Convert a ValidationError to a GitHub annotation
10
+ */
11
+ export declare function errorToAnnotation(error: ValidationError, options?: CIFormatOptions): GitHubAnnotation;
12
+ /**
13
+ * Convert all validation errors/warnings to GitHub annotations
14
+ */
15
+ export declare function validationToAnnotations(result: ValidationResult, options?: CIFormatOptions): GitHubAnnotation[];
16
+ /**
17
+ * Format a single GitHub annotation as a workflow command
18
+ */
19
+ export declare function formatGitHubAnnotation(annotation: GitHubAnnotation): string;
20
+ /**
21
+ * Format validation result as GitHub Actions annotations
22
+ */
23
+ export declare function formatGitHubAnnotations(result: ValidationResult, options?: CIFormatOptions): string;
24
+ /**
25
+ * Format as GitHub Actions group with annotations
26
+ */
27
+ export declare function formatGitHubGroup(result: ValidationResult, groupName: string, options?: CIFormatOptions): string;
28
+ /**
29
+ * Set output variable for GitHub Actions
30
+ */
31
+ export declare function formatGitHubOutput(name: string, value: string): string;
32
+ /**
33
+ * Format validation result summary as GitHub Actions output
34
+ */
35
+ export declare function formatGitHubSummary(result: ValidationResult): string;
36
+ //# sourceMappingURL=ci.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci.d.ts","sourceRoot":"","sources":["../../src/output/ci.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,eAAe,EACtB,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CAYlB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,EAAE,CAYpB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM,CAwB3E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,eAAoB,GAC5B,MAAM,CAGR;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,eAAoB,GAC5B,MAAM,CAyBR;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAOtE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CA6CpE"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * CI Formatter for GitHub Actions Annotations
3
+ *
4
+ * Formats validation results as GitHub Actions workflow commands.
5
+ */
6
+ /**
7
+ * Convert a ValidationError to a GitHub annotation
8
+ */
9
+ export function errorToAnnotation(error, options = {}) {
10
+ // Try to extract line number from path
11
+ const lineMatch = error.path.match(/\[(\d+)\]/);
12
+ const line = lineMatch ? parseInt(lineMatch[1], 10) + 1 : undefined;
13
+ return {
14
+ file: options.filePath,
15
+ line,
16
+ title: error.code,
17
+ message: error.message + (error.suggestion ? ` ${error.suggestion}` : ''),
18
+ level: error.severity === 'error' ? 'error' : 'warning',
19
+ };
20
+ }
21
+ /**
22
+ * Convert all validation errors/warnings to GitHub annotations
23
+ */
24
+ export function validationToAnnotations(result, options = {}) {
25
+ const annotations = [];
26
+ for (const error of result.errors) {
27
+ annotations.push(errorToAnnotation(error, options));
28
+ }
29
+ for (const warning of result.warnings) {
30
+ annotations.push(errorToAnnotation(warning, options));
31
+ }
32
+ return annotations;
33
+ }
34
+ /**
35
+ * Format a single GitHub annotation as a workflow command
36
+ */
37
+ export function formatGitHubAnnotation(annotation) {
38
+ const properties = [];
39
+ if (annotation.file) {
40
+ properties.push(`file=${annotation.file}`);
41
+ }
42
+ if (annotation.line !== undefined) {
43
+ properties.push(`line=${annotation.line}`);
44
+ }
45
+ if (annotation.endLine !== undefined) {
46
+ properties.push(`endLine=${annotation.endLine}`);
47
+ }
48
+ if (annotation.col !== undefined) {
49
+ properties.push(`col=${annotation.col}`);
50
+ }
51
+ if (annotation.endColumn !== undefined) {
52
+ properties.push(`endColumn=${annotation.endColumn}`);
53
+ }
54
+ if (annotation.title) {
55
+ properties.push(`title=${annotation.title}`);
56
+ }
57
+ const propsStr = properties.length > 0 ? ` ${properties.join(',')}` : '';
58
+ return `::${annotation.level}${propsStr}::${annotation.message}`;
59
+ }
60
+ /**
61
+ * Format validation result as GitHub Actions annotations
62
+ */
63
+ export function formatGitHubAnnotations(result, options = {}) {
64
+ const annotations = validationToAnnotations(result, options);
65
+ return annotations.map(formatGitHubAnnotation).join('\n');
66
+ }
67
+ /**
68
+ * Format as GitHub Actions group with annotations
69
+ */
70
+ export function formatGitHubGroup(result, groupName, options = {}) {
71
+ const lines = [];
72
+ lines.push(`::group::${groupName}`);
73
+ // Summary
74
+ if (result.valid) {
75
+ lines.push('Validation passed');
76
+ }
77
+ else {
78
+ lines.push(`Validation failed with ${result.errors.length} error(s)`);
79
+ }
80
+ if (result.stats) {
81
+ lines.push(`Checked ${result.stats.nodes} nodes, ${result.stats.edges} edges`);
82
+ }
83
+ lines.push('::endgroup::');
84
+ // Annotations (outside group for visibility)
85
+ const annotations = formatGitHubAnnotations(result, options);
86
+ if (annotations) {
87
+ lines.push(annotations);
88
+ }
89
+ return lines.join('\n');
90
+ }
91
+ /**
92
+ * Set output variable for GitHub Actions
93
+ */
94
+ export function formatGitHubOutput(name, value) {
95
+ // Handle multiline values
96
+ if (value.includes('\n')) {
97
+ const delimiter = `EOF_${Date.now()}`;
98
+ return `${name}<<${delimiter}\n${value}\n${delimiter}`;
99
+ }
100
+ return `${name}=${value}`;
101
+ }
102
+ /**
103
+ * Format validation result summary as GitHub Actions output
104
+ */
105
+ export function formatGitHubSummary(result) {
106
+ const lines = [];
107
+ // Markdown summary
108
+ if (result.valid) {
109
+ lines.push('## ✅ Validation Passed');
110
+ }
111
+ else {
112
+ lines.push('## ❌ Validation Failed');
113
+ }
114
+ lines.push('');
115
+ if (result.stats) {
116
+ lines.push(`- **Nodes:** ${result.stats.nodes}`);
117
+ lines.push(`- **Edges:** ${result.stats.edges}`);
118
+ }
119
+ lines.push(`- **Errors:** ${result.errors.length}`);
120
+ lines.push(`- **Warnings:** ${result.warnings.length}`);
121
+ if (result.errors.length > 0) {
122
+ lines.push('');
123
+ lines.push('### Errors');
124
+ lines.push('');
125
+ for (const error of result.errors.slice(0, 10)) {
126
+ lines.push(`- \`${error.code}\` at \`${error.path}\`: ${error.message}`);
127
+ }
128
+ if (result.errors.length > 10) {
129
+ lines.push(`- ... and ${result.errors.length - 10} more`);
130
+ }
131
+ }
132
+ if (result.warnings.length > 0) {
133
+ lines.push('');
134
+ lines.push('### Warnings');
135
+ lines.push('');
136
+ for (const warning of result.warnings.slice(0, 5)) {
137
+ lines.push(`- \`${warning.code}\` at \`${warning.path}\`: ${warning.message}`);
138
+ }
139
+ if (result.warnings.length > 5) {
140
+ lines.push(`- ... and ${result.warnings.length - 5} more`);
141
+ }
142
+ }
143
+ return lines.join('\n');
144
+ }
145
+ //# sourceMappingURL=ci.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci.js","sourceRoot":"","sources":["../../src/output/ci.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAsB,EACtB,UAA2B,EAAE;IAE7B,uCAAuC;IACvC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEpE,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,QAAQ;QACtB,IAAI;QACJ,KAAK,EAAE,KAAK,CAAC,IAAI;QACjB,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,KAAK,EAAE,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;KACxD,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAwB,EACxB,UAA2B,EAAE;IAE7B,MAAM,WAAW,GAAuB,EAAE,CAAC;IAE3C,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClC,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,CAAC;I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ation results in various output formats.
5
+ */
6
+ export type { OutputFormat, Formatter, GitHubAnnotation, PrettyFormatOptions, JsonFormatOptions, CIFormatOptions, } from './types.js';
7
+ export { PrettyFormatter, formatError, formatWarning, formatSummary, box, table, } from './pretty.js';
8
+ export { JsonFormatter, formatCompactJson, formatPrettyJson, } from './json.js';
9
+ export { errorToAnnotation, validationToAnnotations, formatGitHubAnnotation, formatGitHubAnnotations, formatGitHubGroup, formatGitHubOutput, formatGitHubSummary, } from './ci.js';
10
+ import type { ValidationResult } from '../types.js';
11
+ import type { OutputFormat, Formatter, PrettyFormatOptions, JsonFormatOptions, CIFormatOptions } from './types.js';
12
+ /**
13
+ * Create a formatter for the specified output format
14
+ */
15
+ export declare function createFormatter(format: OutputFormat, options?: PrettyFormatOptions | JsonFormatOptions | CIFormatOptions): Formatter;
16
+ /**
17
+ * Format validation result using the specified format
18
+ */
19
+ export declare function formatResult(result: ValidationResult, format?: OutputFormat, options?: PrettyFormatOptions | JsonFormatOptions | CIFormatOptions): string;
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/output/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,eAAe,EACf,WAAW,EACX,aAAa,EACb,aAAa,EACb,GAAG,EACH,KAAK,GACN,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKnH;;GAEG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,mBAAmB,GAAG,iBAAiB,GAAG,eAAe,GAClE,SAAS,CAeX;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,gBAAgB,EACxB,MAAM,GAAE,YAAuB,EAC/B,OAAO,CAAC,EAAE,mBAAmB,GAAG,iBAAiB,GAAG,eAAe,GAClE,MAAM,CAGR"}