@hey-api/codegen-core 0.0.0-next-20260603165749 → 0.0.0-next-20260607231541

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/README.md CHANGED
@@ -104,6 +104,18 @@ Partners behind the future of API tooling. [Become a sponsor](https://github.com
104
104
  fastapi.tiangolo.com
105
105
  </a>
106
106
  </td>
107
+ <td align="center" width="172px">
108
+ <a href="https://kutt.to/yZVkdV" target="_blank">
109
+ <picture height="40px">
110
+ <source media="(prefers-color-scheme: dark)" srcset="https://heyapi.dev/assets/brands/unblocked/logo-light.svg">
111
+ <img alt="Unblocked logo" height="40px" src="https://heyapi.dev/assets/brands/unblocked/logo-dark.svg">
112
+ </picture>
113
+ </a>
114
+ <br/>
115
+ <a href="https://kutt.to/yZVkdV" style="text-decoration:none;" target="_blank">
116
+ getunblocked.com
117
+ </a>
118
+ </td>
107
119
  </tr>
108
120
  </tbody>
109
121
  </table>
package/dist/index.d.mts CHANGED
@@ -90,6 +90,7 @@ interface INode<T = unknown, L extends Language = Language> {
90
90
  /** The display name of this node. */
91
91
  readonly name: Ref<NodeName> & {
92
92
  set(value: NodeName): void;
93
+ readonly symbol: Symbol | undefined;
93
94
  toString(): string;
94
95
  };
95
96
  /** Optional function to sanitize the node name. */
@@ -116,6 +117,19 @@ interface INode<T = unknown, L extends Language = Language> {
116
117
  type BindingKind = 'default' | 'named' | 'namespace';
117
118
  type ISymbolIdentifier = number | ISymbolMeta;
118
119
  type SymbolKind = 'class' | 'enum' | 'function' | 'interface' | 'namespace' | 'type' | 'var';
120
+ type SymbolEventMap = {
121
+ file: (args: {
122
+ file: File;
123
+ symbol: Symbol;
124
+ }) => void;
125
+ finalName: (args: {
126
+ finalName: string;
127
+ symbol: Symbol;
128
+ }) => void;
129
+ import: (args: {
130
+ symbol: Symbol;
131
+ }) => void;
132
+ };
119
133
  interface ISymbolChild {
120
134
  /**
121
135
  * Kind of symbol (class, type, alias, etc.).
@@ -311,12 +325,24 @@ declare class Symbol<Node extends INode = INode> {
311
325
  * @default 'named'
312
326
  */
313
327
  private _importKind;
328
+ /**
329
+ * Per-file imported instances of this symbol.
330
+ *
331
+ * @default []
332
+ */
333
+ private _imports;
314
334
  /**
315
335
  * Kind of symbol (class, type, alias, etc.).
316
336
  *
317
337
  * @default 'var'
318
338
  */
319
339
  private _kind;
340
+ /**
341
+ * Registered event listeners keyed by event name.
342
+ *
343
+ * @default {}
344
+ */
345
+ private _listeners;
320
346
  /**
321
347
  * Arbitrary user metadata.
322
348
  *
@@ -386,10 +412,18 @@ declare class Symbol<Node extends INode = INode> {
386
412
  * How this symbol should be imported (named/default/namespace).
387
413
  */
388
414
  get importKind(): BindingKind;
415
+ /**
416
+ * Read-only accessor for the per-file imported instances of this symbol.
417
+ */
418
+ get imports(): ReadonlyArray<Symbol>;
389
419
  /**
390
420
  * Indicates whether this is a canonical symbol (not a stub).
391
421
  */
392
422
  get isCanonical(): boolean;
423
+ /**
424
+ * Indicates whether this symbol was renamed during conflict resolution.
425
+ */
426
+ get isRenamed(): boolean;
393
427
  /**
394
428
  * The symbol's kind (class, type, alias, variable, etc.).
395
429
  */
@@ -410,25 +444,39 @@ declare class Symbol<Node extends INode = INode> {
410
444
  * Indicates whether this symbol is marked as an override.
411
445
  */
412
446
  get override(): boolean;
447
+ /**
448
+ * Registers a per-file imported instance of this symbol.
449
+ *
450
+ * @param symbol The imported instance to register.
451
+ */
452
+ addImport(symbol: Symbol): void;
453
+ /**
454
+ * Registers a listener for the given symbol lifecycle event.
455
+ *
456
+ * @param event The event to subscribe to.
457
+ * @param listener Callback invoked when the event is emitted.
458
+ * @returns `this` for chaining.
459
+ */
460
+ on<K extends keyof SymbolEventMap>(event: K, listener: SymbolEventMap[K]): this;
413
461
  /**
414
462
  * Marks this symbol as a stub and assigns its canonical symbol.
415
463
  *
416
464
  * After calling this, all semantic queries (name, kind, file,
417
465
  * meta, etc.) should reflect the canonical symbol's values.
418
466
  *
419
- * @param symbol The canonical symbol this stub should resolve to.
467
+ * @param symbol The canonical symbol this stub should resolve to.
420
468
  */
421
469
  setCanonical(symbol: Symbol): void;
422
470
  /**
423
471
  * Assigns the child symbol bindings associated with this symbol.
424
472
  *
425
- * @param children Child bindings to associate with the symbol.
473
+ * @param children Child bindings to associate with the symbol.
426
474
  */
427
475
  setChildren(children: Array<ISymbolChild>): void;
428
476
  /**
429
477
  * Marks the symbol as exported from its file.
430
478
  *
431
- * @param exported Whether the symbol is exported.
479
+ * @param exported Whether the symbol is exported.
432
480
  */
433
481
  setExported(exported: boolean): void;
434
482
  /**
@@ -446,19 +494,19 @@ declare class Symbol<Node extends INode = INode> {
446
494
  /**
447
495
  * Sets how this symbol should be imported.
448
496
  *
449
- * @param kind The import strategy (named/default/namespace).
497
+ * @param kind The import strategy (named/default/namespace).
450
498
  */
451
499
  setImportKind(kind: BindingKind): void;
452
500
  /**
453
501
  * Sets the symbol's kind (class, type, alias, variable, etc.).
454
502
  *
455
- * @param kind The new symbol kind.
503
+ * @param kind The new symbol kind.
456
504
  */
457
505
  setKind(kind: SymbolKind): void;
458
506
  /**
459
507
  * Updates the intended user‑facing name for this symbol.
460
508
  *
461
- * @param name The new name.
509
+ * @param name The new name.
462
510
  */
463
511
  setName(name: string): void;
464
512
  /**
@@ -470,7 +518,7 @@ declare class Symbol<Node extends INode = INode> {
470
518
  /**
471
519
  * Marks whether this symbol should be treated as an override.
472
520
  *
473
- * @param override Override marker value.
521
+ * @param override Override marker value.
474
522
  */
475
523
  setOverride(override: boolean): void;
476
524
  /**
@@ -488,6 +536,13 @@ declare class Symbol<Node extends INode = INode> {
488
536
  * @throws {Error} If the symbol is a stub and is being mutated.
489
537
  */
490
538
  private assertCanonical;
539
+ /**
540
+ * Invokes all registered listeners for the given event.
541
+ *
542
+ * @param event The event to emit.
543
+ * @param args Arguments forwarded to each listener.
544
+ */
545
+ private emit;
491
546
  }
492
547
  //#endregion
493
548
  //#region src/planner/scope.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/refs/types.ts","../src/extensions.ts","../src/nodes/node.ts","../src/symbols/types.ts","../src/symbols/symbol.ts","../src/planner/scope.ts","../src/planner/types.ts","../src/languages/types.ts","../src/files/types.ts","../src/nodes/types.ts","../src/output.ts","../src/renderer.ts","../src/project/types.ts","../src/files/file.ts","../src/bindings.ts","../src/brands.ts","../src/config/interactive.ts","../src/logger.ts","../src/config/load.ts","../src/config/merge.ts","../src/guards.ts","../src/languages/extensions.ts","../src/languages/modules.ts","../src/languages/resolvers.ts","../src/log.ts","../src/planner/resolvers.ts","../src/files/registry.ts","../src/nodes/registry.ts","../src/symbols/registry.ts","../src/project/project.ts","../src/refs/refs.ts","../src/structure/types.ts","../src/structure/node.ts","../src/structure/model.ts","../src/version.ts"],"mappings":";;;;;;;;AAUA;;;;;;KAAY,GAAA,MAAS,CAAA;EAAA,CAAa,MAAA;AAAA,IAAqB,CAAA;EAAM,MAAA,EAAQ,CAAA;AAAA;;;;;AAAC;AAatE;;;;;;KAAY,IAAA,oBACE,CAAA,GAAI,GAAA,CAAI,CAAA,CAAE,CAAA;;;;;;;;AAAC;KAWb,OAAA,MAAa,CAAA;EAAY,MAAA;AAAA,IAAoB,CAAA,GAAI,CAAC;;;;;;;;;AAAA;AAY9D;KAAY,QAAA,oBACE,CAAA,GAAI,CAAA,CAAE,CAAA,UAAW,GAAA,YAAe,CAAA,GAAI,CAAA,CAAE,CAAA;;;;;;AAtCpD;;UCFiB,YAAA,SAAqB,OAAA,CAAQ,MAAA,CAAO,QAAA;;;;;;UAOpC,WAAA;EAAA,CACd,GAAW;AAAA;;;KCPF,QAAA,MAAc,CAAA,GAAI,GAAA,CAAI,CAAA;AAAA,KAEtB,QAAA,GAAW,QAAQ,CAAC,MAAA;AAAA,KAEpB,iBAAA,IAAqB,IAAY;AAAA,KAEjC,gBAAA;AAAA,KAEA,SAAA;AAAA,UAEK,KAAA,wBAA6B,QAAA,GAAW,QAAA;EFTpC;EEWn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GAAW,OAAA;EAIrB,GAAA,CAAI,KAAA,EAAO,QAAA,GAAW,OAAA;EAItB,QAAA,IAAY,QAAA;AAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/refs/types.ts","../src/extensions.ts","../src/nodes/node.ts","../src/symbols/types.ts","../src/symbols/symbol.ts","../src/planner/scope.ts","../src/planner/types.ts","../src/languages/types.ts","../src/files/types.ts","../src/nodes/types.ts","../src/output.ts","../src/renderer.ts","../src/project/types.ts","../src/files/file.ts","../src/bindings.ts","../src/brands.ts","../src/config/interactive.ts","../src/logger.ts","../src/config/load.ts","../src/config/merge.ts","../src/guards.ts","../src/languages/extensions.ts","../src/languages/modules.ts","../src/languages/resolvers.ts","../src/log.ts","../src/planner/resolvers.ts","../src/files/registry.ts","../src/nodes/registry.ts","../src/symbols/registry.ts","../src/project/project.ts","../src/refs/refs.ts","../src/structure/types.ts","../src/structure/node.ts","../src/structure/model.ts","../src/version.ts"],"mappings":";;;;;;;;AAUA;;;;;;KAAY,GAAA,MAAS,CAAA;EAAA,CAAa,MAAA;AAAA,IAAqB,CAAA;EAAM,MAAA,EAAQ,CAAA;AAAA;;;;;AAAC;AAatE;;;;;;KAAY,IAAA,oBACE,CAAA,GAAI,GAAA,CAAI,CAAA,CAAE,CAAA;;;;;;;;AAAC;KAWb,OAAA,MAAa,CAAA;EAAY,MAAA;AAAA,IAAoB,CAAA,GAAI,CAAC;;;;;;;;;AAAA;AAY9D;KAAY,QAAA,oBACE,CAAA,GAAI,CAAA,CAAE,CAAA,UAAW,GAAA,YAAe,CAAA,GAAI,CAAA,CAAE,CAAA;;;;;;AAtCpD;;UCFiB,YAAA,SAAqB,OAAA,CAAQ,MAAA,CAAO,QAAA;;;;;;UAOpC,WAAA;EAAA,CACd,GAAW;AAAA;;;KCPF,QAAA,MAAc,CAAA,GAAI,GAAA,CAAI,CAAA;AAAA,KAEtB,QAAA,GAAW,QAAQ,CAAC,MAAA;AAAA,KAEpB,iBAAA,IAAqB,IA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AAU,aAAA;IAAkB,IAAA,EAAM,CAAA;EAAA;EhCpC1B;;;;AAAW;EgCiD3D,IAAA,IAAQ,SAAA,CAAU,aAAA;AAAA;;;cCjFR,cAAA;;UAEH,MAAA;EjCKK;EAAA,QiCHL,YAAA;EjCGW;;;EAAA,IiCEf,KAAA,IAAS,aAAA,CAAc,aAAA;EjCFyC;;;EiCWpE,MAAA,CAAO,IAAA,EAAM,eAAA;EjCXwC;;;;AAAe;AAatE;;;EiCyCE,IAAA,CAAK,IAAA,kBAAsB,aAAA;EjCxCP;;;;;EiCyDnB,IAAA,IAAQ,SAAA,CAAU,aAAA;AAAA;;;cCjFR,OAAA;EAAA,iBACM,SAAA;EAAA,SACR,GAAA,EAAK,QAAA;cAEF,OAAA,EAAS,QAAA;EAAA,QAWb,QAAA;EAWR,EAAA,CAAG,KAAA,EAAO,QAAA,GAAW,OAAA;EAIrB,EAAA,CAAG,KAAA,EAAO,QAAA,GAAW,OAAA;EAIrB,GAAA,CAAI,KAAA,EAAO,QAAA,GAAW,OAAA;EAItB,EAAA,CAAG,KAAA,EAAO,QAAA,GAAW,OAAA;EAIrB,GAAA,CAAI,KAAA,EAAO,QAAA,GAAW,OAAA;EAItB,QAAA,IAAY,QAAA;AAAA"}
package/dist/index.mjs CHANGED
@@ -283,7 +283,8 @@ var File = class {
283
283
  * Returns a debug‑friendly string representation identifying the file.
284
284
  */
285
285
  toString() {
286
- return `[File ${this._logicalFilePath}#${this.id}]`;
286
+ const finalPath = this._finalPath ? ` ${this._finalPath}` : "";
287
+ return `${`${this._finalPath ? "✓" : "~"} `}File#${this.id} ${this._logicalFilePath}${finalPath}`;
287
288
  }
288
289
  };
289
290
  //#endregion
@@ -792,7 +793,8 @@ var Analyzer = class {
792
793
  //#endregion
793
794
  //#region src/planner/planner.ts
794
795
  const isTypeOnlyKind = (kind) => kind === "type" || kind === "interface";
795
- var Planner = class {
796
+ var Planner = class Planner {
797
+ static MAX_ALLOCATION_ROUNDS = 100;
796
798
  analyzer;
797
799
  cacheResolvedNames = /* @__PURE__ */ new Set();
798
800
  project;
@@ -805,8 +807,11 @@ var Planner = class {
805
807
  */
806
808
  plan() {
807
809
  this.cacheResolvedNames.clear();
808
- this.allocateFiles();
809
- this.assignLocalNames();
810
+ let rounds = 0;
811
+ while (this.allocateFiles()) {
812
+ this.assignLocalNames();
813
+ if (++rounds > Planner.MAX_ALLOCATION_ROUNDS) throw new Error(`File allocation failed to converge after ${Planner.MAX_ALLOCATION_ROUNDS} rounds`);
814
+ }
810
815
  this.resolveFilePaths();
811
816
  this.planExports();
812
817
  this.planImports();
@@ -816,21 +821,25 @@ var Planner = class {
816
821
  * and external dependency.
817
822
  */
818
823
  allocateFiles() {
824
+ let allocated = 0;
819
825
  this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => {
820
826
  const symbol = node.symbol;
821
827
  if (!symbol) return;
822
- const file = this.project.files.register({
823
- external: false,
824
- language: node.language,
825
- logicalFilePath: symbol.getFilePath?.(symbol) || this.project.defaultFileName
826
- });
827
- file.addNode(node);
828
- symbol.setFile(file);
829
- for (const logicalFilePath of symbol.getExportFromFilePath?.(symbol) ?? []) this.project.files.register({
830
- external: false,
831
- language: file.language,
832
- logicalFilePath
833
- });
828
+ if (!symbol.file) {
829
+ const file = this.project.files.register({
830
+ external: false,
831
+ language: node.language,
832
+ logicalFilePath: symbol.getFilePath?.(symbol) || this.project.defaultFileName
833
+ });
834
+ file.addNode(node);
835
+ symbol.setFile(file);
836
+ allocated++;
837
+ for (const logicalFilePath of symbol.getExportFromFilePath?.(symbol) ?? []) this.project.files.register({
838
+ external: false,
839
+ language: file.language,
840
+ logicalFilePath
841
+ });
842
+ }
834
843
  ctx.walkScopes((dependency) => {
835
844
  const dep = fromRef(dependency);
836
845
  if (dep.external && dep.isCanonical && !dep.file) {
@@ -840,9 +849,11 @@ var Planner = class {
840
849
  logicalFilePath: dep.external
841
850
  });
842
851
  dep.setFile(file);
852
+ allocated++;
843
853
  }
844
854
  });
845
855
  });
856
+ return allocated;
846
857
  }
847
858
  /**
848
859
  * Assigns final names to all symbols.
@@ -864,7 +875,7 @@ var Planner = class {
864
875
  if (!file) return;
865
876
  ctx.walkScopes((dependency) => {
866
877
  const dep = fromRef(dependency);
867
- if (dep.file) return;
878
+ if (dep.file || dep.external) return;
868
879
  this.assignLocalName({
869
880
  ctx,
870
881
  file,
@@ -1027,6 +1038,7 @@ var Planner = class {
1027
1038
  symbol: imp
1028
1039
  };
1029
1040
  fileMap.set(key, entry);
1041
+ dep.addImport(imp);
1030
1042
  }
1031
1043
  entry.kinds.add(dep.kind);
1032
1044
  dependency["~ref"] = entry.symbol;
@@ -1212,12 +1224,24 @@ var Symbol = class {
1212
1224
  */
1213
1225
  _importKind;
1214
1226
  /**
1227
+ * Per-file imported instances of this symbol.
1228
+ *
1229
+ * @default []
1230
+ */
1231
+ _imports = [];
1232
+ /**
1215
1233
  * Kind of symbol (class, type, alias, etc.).
1216
1234
  *
1217
1235
  * @default 'var'
1218
1236
  */
1219
1237
  _kind;
1220
1238
  /**
1239
+ * Registered event listeners keyed by event name.
1240
+ *
1241
+ * @default {}
1242
+ */
1243
+ _listeners = {};
1244
+ /**
1221
1245
  * Arbitrary user metadata.
1222
1246
  *
1223
1247
  * @default undefined
@@ -1322,12 +1346,24 @@ var Symbol = class {
1322
1346
  return this.canonical._importKind;
1323
1347
  }
1324
1348
  /**
1349
+ * Read-only accessor for the per-file imported instances of this symbol.
1350
+ */
1351
+ get imports() {
1352
+ return this.canonical._imports;
1353
+ }
1354
+ /**
1325
1355
  * Indicates whether this is a canonical symbol (not a stub).
1326
1356
  */
1327
1357
  get isCanonical() {
1328
1358
  return !this._canonical || this._canonical === this;
1329
1359
  }
1330
1360
  /**
1361
+ * Indicates whether this symbol was renamed during conflict resolution.
1362
+ */
1363
+ get isRenamed() {
1364
+ return Boolean(this.canonical._finalName) && this.canonical._finalName !== this.canonical._name;
1365
+ }
1366
+ /**
1331
1367
  * The symbol's kind (class, type, alias, variable, etc.).
1332
1368
  */
1333
1369
  get kind() {
@@ -1358,12 +1394,33 @@ var Symbol = class {
1358
1394
  return this.canonical._override;
1359
1395
  }
1360
1396
  /**
1397
+ * Registers a per-file imported instance of this symbol.
1398
+ *
1399
+ * @param symbol The imported instance to register.
1400
+ */
1401
+ addImport(symbol) {
1402
+ this.assertCanonical();
1403
+ this._imports.push(symbol);
1404
+ this.emit("import", { symbol });
1405
+ }
1406
+ /**
1407
+ * Registers a listener for the given symbol lifecycle event.
1408
+ *
1409
+ * @param event The event to subscribe to.
1410
+ * @param listener Callback invoked when the event is emitted.
1411
+ * @returns `this` for chaining.
1412
+ */
1413
+ on(event, listener) {
1414
+ (this.canonical._listeners[event] ??= []).push(listener);
1415
+ return this;
1416
+ }
1417
+ /**
1361
1418
  * Marks this symbol as a stub and assigns its canonical symbol.
1362
1419
  *
1363
1420
  * After calling this, all semantic queries (name, kind, file,
1364
1421
  * meta, etc.) should reflect the canonical symbol's values.
1365
1422
  *
1366
- * @param symbol The canonical symbol this stub should resolve to.
1423
+ * @param symbol The canonical symbol this stub should resolve to.
1367
1424
  */
1368
1425
  setCanonical(symbol) {
1369
1426
  this._canonical = symbol;
@@ -1371,7 +1428,7 @@ var Symbol = class {
1371
1428
  /**
1372
1429
  * Assigns the child symbol bindings associated with this symbol.
1373
1430
  *
1374
- * @param children Child bindings to associate with the symbol.
1431
+ * @param children Child bindings to associate with the symbol.
1375
1432
  */
1376
1433
  setChildren(children) {
1377
1434
  this.assertCanonical();
@@ -1380,7 +1437,7 @@ var Symbol = class {
1380
1437
  /**
1381
1438
  * Marks the symbol as exported from its file.
1382
1439
  *
1383
- * @param exported Whether the symbol is exported.
1440
+ * @param exported Whether the symbol is exported.
1384
1441
  */
1385
1442
  setExported(exported) {
1386
1443
  this.assertCanonical();
@@ -1399,6 +1456,10 @@ var Symbol = class {
1399
1456
  throw new Error(message);
1400
1457
  }
1401
1458
  this._file = file;
1459
+ this.emit("file", {
1460
+ file,
1461
+ symbol: this
1462
+ });
1402
1463
  }
1403
1464
  /**
1404
1465
  * Assigns the conflict‑resolved final local name for this symbol.
@@ -1413,11 +1474,15 @@ var Symbol = class {
1413
1474
  throw new Error(message);
1414
1475
  }
1415
1476
  this._finalName = name;
1477
+ this.emit("finalName", {
1478
+ finalName: name,
1479
+ symbol: this
1480
+ });
1416
1481
  }
1417
1482
  /**
1418
1483
  * Sets how this symbol should be imported.
1419
1484
  *
1420
- * @param kind The import strategy (named/default/namespace).
1485
+ * @param kind The import strategy (named/default/namespace).
1421
1486
  */
1422
1487
  setImportKind(kind) {
1423
1488
  this.assertCanonical();
@@ -1426,7 +1491,7 @@ var Symbol = class {
1426
1491
  /**
1427
1492
  * Sets the symbol's kind (class, type, alias, variable, etc.).
1428
1493
  *
1429
- * @param kind The new symbol kind.
1494
+ * @param kind The new symbol kind.
1430
1495
  */
1431
1496
  setKind(kind) {
1432
1497
  this.assertCanonical();
@@ -1435,7 +1500,7 @@ var Symbol = class {
1435
1500
  /**
1436
1501
  * Updates the intended user‑facing name for this symbol.
1437
1502
  *
1438
- * @param name The new name.
1503
+ * @param name The new name.
1439
1504
  */
1440
1505
  setName(name) {
1441
1506
  this.assertCanonical();
@@ -1458,7 +1523,7 @@ var Symbol = class {
1458
1523
  /**
1459
1524
  * Marks whether this symbol should be treated as an override.
1460
1525
  *
1461
- * @param override Override marker value.
1526
+ * @param override Override marker value.
1462
1527
  */
1463
1528
  setOverride(override) {
1464
1529
  this.assertCanonical();
@@ -1468,9 +1533,15 @@ var Symbol = class {
1468
1533
  * Returns a debug‑friendly string representation identifying the symbol.
1469
1534
  */
1470
1535
  toString() {
1471
- const canonical = this.canonical;
1472
- if (canonical._finalName) return `[Symbol ${canonical._name} → ${canonical._finalName}#${canonical.id}]`;
1473
- return `[Symbol ${canonical._name}#${canonical.id}] ${JSON.stringify(canonical._meta ?? {})}`;
1536
+ const c = this.canonical;
1537
+ const status = `${this._finalName ? "✓" : "~"} `;
1538
+ let renamed = "";
1539
+ let file = "";
1540
+ if (c._finalName) {
1541
+ renamed = c._finalName !== c._name ? ` → "${c._finalName}"` : "";
1542
+ file = c._file ? ` ${c._file.logicalFilePath}` : "";
1543
+ }
1544
+ return `${status}Symbol#${c.id} "${c._name}"${renamed}${file}`;
1474
1545
  }
1475
1546
  /**
1476
1547
  * Ensures this symbol is canonical before allowing mutation.
@@ -1489,6 +1560,17 @@ var Symbol = class {
1489
1560
  throw new Error(message);
1490
1561
  }
1491
1562
  }
1563
+ /**
1564
+ * Invokes all registered listeners for the given event.
1565
+ *
1566
+ * @param event The event to emit.
1567
+ * @param args Arguments forwarded to each listener.
1568
+ */
1569
+ emit(event, ...args) {
1570
+ const listeners = this._listeners[event];
1571
+ if (!listeners) return;
1572
+ for (const listener of listeners) listener(...args);
1573
+ }
1492
1574
  };
1493
1575
  //#endregion
1494
1576
  //#region src/symbols/registry.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/brands.ts","../src/config/interactive.ts","../src/config/merge.ts","../src/config/load.ts","../src/log.ts","../src/files/file.ts","../src/guards.ts","../src/languages/extensions.ts","../src/languages/modules.ts","../src/planner/resolvers.ts","../src/languages/resolvers.ts","../src/logger.ts","../src/files/registry.ts","../src/refs/refs.ts","../src/nodes/registry.ts","../src/project/namespace.ts","../src/planner/scope.ts","../src/planner/analyzer.ts","../src/planner/planner.ts","../src/symbols/symbol.ts","../src/symbols/registry.ts","../src/project/project.ts","../src/structure/node.ts","../src/structure/model.ts","../src/version.ts"],"sourcesContent":["export const fileBrand = 'heyapi.file';\nexport const nodeBrand = 'heyapi.node';\nexport const symbolBrand = 'heyapi.symbol';\n","/**\n * Detect if the current session is interactive based on TTY status and environment variables.\n * This is used as a fallback when the user doesn't explicitly set the interactive option.\n * @internal\n */\nexport function detectInteractiveSession(): boolean {\n return Boolean(\n process.stdin.isTTY &&\n process.stdout.isTTY &&\n !process.env.CI &&\n !process.env.NO_INTERACTIVE &&\n !process.env.NO_INTERACTION,\n );\n}\n","import type { AnyObject } from '@hey-api/types';\n\nfunction isPlainObject(value: unknown): value is AnyObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport function mergeConfigs<T extends AnyObject>(\n configA: T | undefined,\n configB: T | undefined,\n): T {\n const a = (configA || {}) as AnyObject;\n const b = (configB || {}) as AnyObject;\n\n const result: AnyObject = { ...a };\n\n for (const key of Object.keys(b)) {\n const valueA = a[key];\n const valueB = b[key];\n\n if (isPlainObject(valueA) && isPlainObject(valueB)) {\n result[key] = mergeConfigs(valueA, valueB);\n } else {\n result[key] = valueB;\n }\n }\n\n return result as T;\n}\n","import type { AnyObject, MaybeArray } from '@hey-api/types';\nimport { loadConfig } from 'c12';\n\nimport type { Logger } from '../logger';\nimport { mergeConfigs } from './merge';\n\nexport async function loadConfigFile<T extends AnyObject>({\n configFile,\n logger,\n name,\n userConfig,\n}: {\n configFile: string | undefined;\n logger: Logger;\n name: string;\n userConfig: T;\n}): Promise<{\n configFile: string | undefined;\n configs: ReadonlyArray<T>;\n foundConfig: boolean;\n}> {\n const eventC12 = logger.timeEvent('c12');\n const { config: fileConfig, configFile: loadedConfigFile } = await loadConfig<MaybeArray<T>>({\n configFile,\n name,\n });\n eventC12.timeEnd();\n\n const fileConfigs = fileConfig instanceof Array ? fileConfig : [fileConfig];\n const mergedConfigs = fileConfigs.map((config) => mergeConfigs<T>(config, userConfig));\n const foundConfig = fileConfigs.some((config) => Object.keys(config).length);\n\n return { configFile: loadedConfigFile, configs: mergedConfigs, foundConfig };\n}\n","import type { MaybeArray, MaybeFunc } from '@hey-api/types';\nimport colors from 'ansi-colors';\n// @ts-expect-error\nimport colorSupport from 'color-support';\n\ncolors.enabled = colorSupport().hasBasic;\n\nconst DEBUG_NAMESPACE = 'heyapi';\n\nconst NO_WARNINGS = /^(1|true|yes|on)$/i.test(process.env.HEYAPI_DISABLE_WARNINGS ?? '');\n\nconst DebugGroups = {\n analyzer: colors.greenBright,\n dsl: colors.cyanBright,\n file: colors.yellowBright,\n registry: colors.blueBright,\n symbol: colors.magentaBright,\n} as const;\n\nconst WarnGroups = {\n deprecated: colors.magentaBright,\n} as const;\n\nlet cachedDebugGroups: Set<string> | undefined;\nfunction getDebugGroups(): Set<string> {\n if (cachedDebugGroups) return cachedDebugGroups;\n\n const value = process.env.DEBUG;\n cachedDebugGroups = new Set(value ? value.split(',').map((x) => x.trim().toLowerCase()) : []);\n\n return cachedDebugGroups;\n}\n\n/**\n * Tracks which deprecations have been shown to avoid spam.\n */\nconst shownDeprecations = new Set<string>();\n\nfunction debug(message: string, group: keyof typeof DebugGroups) {\n const groups = getDebugGroups();\n if (\n !(\n groups.has('*') ||\n groups.has(`${DEBUG_NAMESPACE}:*`) ||\n groups.has(`${DEBUG_NAMESPACE}:${group}`) ||\n groups.has(group)\n )\n ) {\n return;\n }\n\n const color = DebugGroups[group] ?? colors.whiteBright;\n const prefix = color(`${DEBUG_NAMESPACE}:${group}`);\n\n console.debug(`${prefix} ${message}`);\n}\n\nfunction warn(message: string, group?: keyof typeof WarnGroups) {\n if (NO_WARNINGS) return;\n\n const color = group ? WarnGroups[group] : colors.yellowBright;\n\n console.warn(color(`${message}`));\n}\n\nfunction warnDeprecated({\n context,\n field,\n replacement,\n}: {\n context?: string;\n field: string;\n replacement?: MaybeFunc<(field: string) => MaybeArray<string>>;\n}) {\n const key = context\n ? `${context}:${field}:${JSON.stringify(replacement)}`\n : `${field}:${JSON.stringify(replacement)}`;\n\n if (shownDeprecations.has(key)) return;\n shownDeprecations.add(key);\n\n let message = `\\`${field}\\` is deprecated.`;\n\n if (replacement) {\n const reps = typeof replacement === 'function' ? replacement(field) : replacement;\n const repArray = reps instanceof Array ? reps : [reps];\n const repString = repArray.map((r) => `\\`${r}\\``).join(' or ');\n message += ` Use ${repString} instead.`;\n }\n\n const prefix = context ? `[${context}] ` : '';\n warn(`${prefix}${message}`, 'deprecated');\n}\n\nexport const log = {\n debug,\n warn,\n warnDeprecated,\n};\n","import path from 'node:path';\n\nimport type { ExportModule, ImportModule } from '../bindings';\nimport { fileBrand } from '../brands';\nimport type { Language } from '../languages/types';\nimport { log } from '../log';\nimport type { INode } from '../nodes/node';\nimport type { NameScopes } from '../planner/scope';\nimport type { IProject } from '../project/types';\nimport type { Renderer } from '../renderer';\nimport type { IFileIn } from './types';\n\nexport class File<Node extends INode = INode> {\n /**\n * Exports from this file.\n */\n private _exports: Array<ExportModule> = [];\n /**\n * File extension (e.g., `.ts`).\n */\n private _extension?: string;\n /**\n * Actual emitted file path, including extension and directories.\n */\n private _finalPath?: string;\n /**\n * Imports to this file.\n */\n private _imports: Array<ImportModule> = [];\n /**\n * Language of the file.\n */\n private _language?: Language;\n /**\n * Logical, extension-free path used for planning and routing.\n */\n private _logicalFilePath: string;\n /**\n * Base name of the file (without extension).\n */\n private _name?: string;\n /**\n * Syntax nodes contained in this file.\n */\n private _nodes: Array<Node> = [];\n /**\n * Renderer assigned to this file.\n */\n private _renderer?: Renderer;\n\n /** Brand used for identifying files. */\n readonly '~brand' = fileBrand;\n /** All names defined in this file, including local scopes. */\n allNames: NameScopes = new Map();\n /** Whether this file is external to the project. */\n external: boolean;\n /** Unique identifier for the file. */\n readonly id: number;\n /** The project this file belongs to. */\n readonly project: IProject;\n /** Names declared at the top level of the file. */\n topLevelNames: NameScopes = new Map();\n\n constructor(input: IFileIn, id: number, project: IProject) {\n this.external = input.external ?? false;\n this.id = id;\n if (input.language !== undefined) this._language = input.language;\n this._logicalFilePath = input.logicalFilePath.split(path.sep).join('/');\n if (input.name !== undefined) this._name = input.name;\n this.project = project;\n }\n\n /**\n * Exports from this file.\n */\n get exports(): ReadonlyArray<ExportModule> {\n return [...this._exports];\n }\n\n /**\n * Read-only accessor for the file extension.\n */\n get extension(): string | undefined {\n if (this.external) return;\n if (this._extension) return this._extension;\n const language = this.language;\n const extension = language ? this.project.extensions[language] : undefined;\n if (extension && extension[0]) return extension[0];\n return;\n }\n\n /**\n * Read-only accessor for the final emitted path.\n *\n * If undefined, the file has not yet been assigned a final path\n * or is external to the project and should not be emitted.\n */\n get finalPath(): string | undefined {\n if (this._finalPath) return this._finalPath;\n const dirs = this._logicalFilePath ? this._logicalFilePath.split('/').slice(0, -1) : [];\n return [...dirs, `${this.name}${this.extension ?? ''}`].join('/');\n }\n\n /**\n * Imports to this file.\n */\n get imports(): ReadonlyArray<ImportModule> {\n return [...this._imports];\n }\n\n /**\n * Language of the file; inferred from nodes or fallback if not set explicitly.\n */\n get language(): Language | undefined {\n if (this._language) return this._language;\n if (this._nodes[0]) return this._nodes[0].language;\n return;\n }\n\n /**\n * Logical, extension-free path used for planning and routing.\n */\n get logicalFilePath(): string {\n return this._logicalFilePath;\n }\n\n /**\n * Base name of the file (without extension).\n *\n * If no name was set explicitly, it is inferred from the logical file path.\n */\n get name(): string {\n if (this._name) return this._name;\n const name = this._logicalFilePath.split('/').pop();\n if (name) return name;\n const message = `File ${this.toString()} has no name`;\n log.debug(message, 'file');\n throw new Error(message);\n }\n\n /**\n * Syntax nodes contained in this file.\n */\n get nodes(): ReadonlyArray<Node> {\n return [...this._nodes];\n }\n\n /**\n * Renderer assigned to this file.\n */\n get renderer(): Renderer | undefined {\n return this._renderer;\n }\n\n /**\n * Add an export group to the file.\n */\n addExport(group: ExportModule): void {\n this._exports.push(group);\n }\n\n /**\n * Add an import group to the file.\n */\n addImport(group: ImportModule): void {\n this._imports.push(group);\n }\n\n /**\n * Add a syntax node to the file.\n */\n addNode(node: Node): void {\n this._nodes.push(node);\n node.file = this;\n }\n\n /**\n * Sets the file extension.\n */\n setExtension(extension: string): void {\n this._extension = extension;\n }\n\n /**\n * Sets the final emitted path of the file.\n */\n setFinalPath(path: string): void {\n this._finalPath = path;\n }\n\n /**\n * Sets the language of the file.\n */\n setLanguage(lang: Language): void {\n this._language = lang;\n }\n\n /**\n * Sets the name of the file.\n */\n setName(name: string): void {\n this._name = name;\n }\n\n /**\n * Sets the renderer assigned to this file.\n */\n setRenderer(renderer: Renderer): void {\n this._renderer = renderer;\n }\n\n /**\n * Returns a debug‑friendly string representation identifying the file.\n */\n toString(): string {\n return `[File ${this._logicalFilePath}#${this.id}]`;\n }\n}\n","import { nodeBrand, symbolBrand } from './brands';\nimport type { INode } from './nodes/node';\nimport type { Ref } from './refs/types';\nimport type { Symbol } from './symbols/symbol';\n\nexport function isBrand(value: unknown, brand: string): value is INode {\n if (!value || typeof value !== 'object') return false;\n return (value as any)['~brand'] === brand;\n}\n\nexport function isNode(value: unknown): value is INode {\n if (!value || typeof value !== 'object') return false;\n return isBrand(value, nodeBrand);\n}\n\nexport function isNodeRef(value: Ref<unknown>): value is Ref<INode> {\n return isBrand(value['~ref'], nodeBrand);\n}\n\nexport function isSymbol(value: unknown): value is Symbol {\n return isBrand(value, symbolBrand);\n}\n\nexport function isSymbolRef(value: Ref<unknown>): value is Ref<Symbol> {\n return isBrand(value['~ref'], symbolBrand);\n}\n","import type { Extensions } from './types';\n\nexport const defaultExtensions: Extensions = {\n c: ['.c'],\n 'c#': ['.cs'],\n 'c++': ['.cpp', '.hpp'],\n css: ['.css'],\n dart: ['.dart'],\n go: ['.go'],\n haskell: ['.hs'],\n html: ['.html'],\n java: ['.java'],\n javascript: ['.js', '.jsx'],\n json: ['.json'],\n kotlin: ['.kt'],\n lua: ['.lua'],\n markdown: ['.md'],\n matlab: ['.m'],\n perl: ['.pl'],\n php: ['.php'],\n python: ['.py'],\n r: ['.r'],\n ruby: ['.rb'],\n rust: ['.rs'],\n scala: ['.scala'],\n shell: ['.sh'],\n sql: ['.sql'],\n swift: ['.swift'],\n typescript: ['.ts', '.tsx'],\n yaml: ['.yaml', '.yml'],\n};\n","import type { ModuleEntryNames } from './types';\n\nexport const defaultModuleEntryNames: ModuleEntryNames = {\n javascript: 'index',\n python: '__init__',\n typescript: 'index',\n};\n","import type { NameConflictResolver } from './types';\n\nexport const pythonNameConflictResolver: NameConflictResolver = ({ attempt, baseName }) =>\n attempt === 1 ? `${baseName}_` : `${baseName}_${attempt}`;\n\nexport const simpleNameConflictResolver: NameConflictResolver = ({ attempt, baseName }) =>\n `${baseName}${attempt + 1}`;\n\nexport const underscoreNameConflictResolver: NameConflictResolver = ({ attempt, baseName }) =>\n `${baseName}_${attempt + 1}`;\n","import { pythonNameConflictResolver, underscoreNameConflictResolver } from '../planner/resolvers';\nimport type { NameConflictResolvers } from './types';\n\nexport const defaultNameConflictResolvers: NameConflictResolvers = {\n php: underscoreNameConflictResolver,\n python: pythonNameConflictResolver,\n ruby: underscoreNameConflictResolver,\n};\n","import colors from 'ansi-colors';\n\ninterface LoggerEvent {\n end?: PerformanceMark;\n events: Array<LoggerEvent>;\n id: string; // unique internal key\n name: string;\n start: PerformanceMark;\n}\n\ninterface Severity {\n color: colors.StyleFunction;\n type: 'duration' | 'percentage';\n}\n\ninterface StoredEventResult {\n position: ReadonlyArray<number>;\n}\n\nlet loggerCounter = 0;\nconst nameToId = (name: string) => `${name}-${loggerCounter++}`;\nconst idEnd = (id: string) => `${id}-end`;\nconst idLength = (id: string) => `${id}-length`;\nconst idStart = (id: string) => `${id}-start`;\n\nconst getSeverity = (duration: number, percentage: number): Severity | undefined => {\n if (duration > 200) {\n return {\n color: colors.red,\n type: 'duration',\n };\n }\n if (percentage > 30) {\n return {\n color: colors.red,\n type: 'percentage',\n };\n }\n if (duration > 50) {\n return {\n color: colors.yellow,\n type: 'duration',\n };\n }\n if (percentage > 10) {\n return {\n color: colors.yellow,\n type: 'percentage',\n };\n }\n return;\n};\n\nexport class Logger {\n private events: Array<LoggerEvent> = [];\n\n private end(result: StoredEventResult): void {\n let event: LoggerEvent | undefined;\n let events = this.events;\n for (const index of result.position) {\n event = events[index];\n if (event?.events) {\n events = event.events;\n }\n }\n if (event && !event.end) {\n event.end = performance.mark(idEnd(event.id));\n }\n }\n\n /**\n * Recursively end all unended events in the event tree.\n * This ensures all events have end marks before measuring.\n */\n private endAllEvents(events: Array<LoggerEvent>): void {\n for (const event of events) {\n if (!event.end) {\n event.end = performance.mark(idEnd(event.id));\n }\n if (event.events.length) {\n this.endAllEvents(event.events);\n }\n }\n }\n\n report(print: boolean = true): PerformanceMeasure | undefined {\n const firstEvent = this.events[0];\n if (!firstEvent) return;\n\n // Ensure all events are ended before reporting\n this.endAllEvents(this.events);\n\n const lastEvent = this.events[this.events.length - 1]!;\n const name = 'root';\n const id = nameToId(name);\n\n try {\n const measure = performance.measure(\n idLength(id),\n idStart(firstEvent.id),\n idEnd(lastEvent.id),\n );\n if (print) {\n this.reportEvent({\n end: lastEvent.end,\n events: this.events,\n id,\n indent: 0,\n measure,\n name,\n start: firstEvent!.start,\n });\n }\n return measure;\n } catch {\n // If measuring fails (e.g., marks don't exist), silently skip reporting\n // to avoid crashing the application\n return;\n }\n }\n\n private reportEvent({\n indent,\n ...parent\n }: LoggerEvent & {\n indent: number;\n measure: PerformanceMeasure;\n }): void {\n const color = !indent ? colors.cyan : colors.gray;\n const lastIndex = parent.events.length - 1;\n\n parent.events.forEach((event, index) => {\n try {\n const measure = performance.measure(idLength(event.id), idStart(event.id), idEnd(event.id));\n const duration = Math.ceil(measure.duration * 100) / 100;\n const percentage =\n Math.ceil((measure.duration / parent.measure.duration) * 100 * 100) / 100;\n const severity = indent ? getSeverity(duration, percentage) : undefined;\n\n let durationLabel = `${duration.toFixed(2).padStart(8)}ms`;\n if (severity?.type === 'duration') {\n durationLabel = severity.color(durationLabel);\n }\n\n const branch = index === lastIndex ? '└─ ' : '├─ ';\n const prefix = !indent ? '' : '│ '.repeat(indent - 1) + branch;\n const maxLength = 38 - prefix.length;\n\n const percentageBranch = !indent ? '' : '↳ ';\n const percentagePrefix = indent ? ' '.repeat(indent - 1) + percentageBranch : '';\n let percentageLabel = `${percentagePrefix}${percentage.toFixed(2)}%`;\n if (severity?.type === 'percentage') {\n percentageLabel = severity.color(percentageLabel);\n }\n const jobPrefix = colors.gray('[root] ');\n console.log(\n `${jobPrefix}${colors.gray(prefix)}${color(\n `${event.name.padEnd(maxLength)} ${durationLabel} (${percentageLabel})`,\n )}`,\n );\n this.reportEvent({ ...event, indent: indent + 1, measure });\n } catch {\n // If measuring fails (e.g., marks don't exist), silently skip this event\n // to avoid crashing the application\n }\n });\n }\n\n private start(id: string): PerformanceMark {\n return performance.mark(idStart(id));\n }\n\n private storeEvent({\n result,\n ...event\n }: Pick<LoggerEvent, 'events' | 'id' | 'name' | 'start'> & {\n result: StoredEventResult;\n }): void {\n const lastEventIndex = event.events.length - 1;\n const lastEvent = event.events[lastEventIndex];\n if (lastEvent && !lastEvent.end) {\n result.position = [...result.position, lastEventIndex];\n this.storeEvent({ ...event, events: lastEvent.events, result });\n return;\n }\n const length = event.events.push({ ...event, events: [] });\n result.position = [...result.position, length - 1];\n }\n\n timeEvent(name: string) {\n const id = nameToId(name);\n const start = this.start(id);\n const event: LoggerEvent = {\n events: this.events,\n id,\n name,\n start,\n };\n const result: StoredEventResult = {\n position: [],\n };\n this.storeEvent({ ...event, result });\n return {\n mark: start,\n timeEnd: () => this.end(result),\n };\n }\n}\n","import path from 'node:path';\n\nimport type { IProject } from '../project/types';\nimport { File } from './file';\nimport type { FileKeyArgs, IFileIn, IFileRegistry } from './types';\n\ntype FileId = number;\ntype FileKey = string;\n\nexport class FileRegistry implements IFileRegistry {\n private _id: FileId = 0;\n private _values: Map<FileKey, File> = new Map();\n private readonly project: IProject;\n\n constructor(project: IProject) {\n this.project = project;\n }\n\n get(args: FileKeyArgs): File | undefined {\n return this._values.get(this.createFileKey(args));\n }\n\n isRegistered(args: FileKeyArgs): boolean {\n return this._values.has(this.createFileKey(args));\n }\n\n get nextId(): FileId {\n return this._id++;\n }\n\n register(file: IFileIn): File {\n const key = this.createFileKey(file);\n\n let result = this._values.get(key);\n if (result) {\n if (file.name) {\n result.setName(file.name);\n }\n } else {\n result = new File(file, this.nextId, this.project);\n }\n\n this._values.set(key, result);\n\n return result;\n }\n\n *registered(): IterableIterator<File> {\n for (const file of this._values.values()) {\n yield file;\n }\n }\n\n private createFileKey(args: FileKeyArgs): string {\n const logicalPath = args.logicalFilePath.split(path.sep).join('/');\n return `${args.external ? 'ext:' : ''}${logicalPath}${args.language ? `:${args.language}` : ''}`;\n }\n}\n","import type { FromRef, FromRefs, Ref, Refs } from './types';\n\n/**\n * Wraps a single value in a Ref object.\n *\n * If the value is already a Ref, returns it as-is (idempotent).\n *\n * @example\n * ```ts\n * const r = ref(123); // { '~ref': 123 }\n * console.log(r['~ref']); // 123\n *\n * const r2 = ref(r); // { '~ref': 123 } (not double-wrapped)\n * ```\n */\nexport const ref = <T>(value: T): Ref<T> => {\n if (isRef(value)) {\n return value as Ref<T>;\n }\n return { '~ref': value } as Ref<T>;\n};\n\n/**\n * Converts a plain object to an object of Refs (deep, per property).\n *\n * @example\n * ```ts\n * const obj = { a: 1, b: \"x\" };\n * const refs = refs(obj); // { a: { '~ref': 1 }, b: { '~ref': \"x\" } }\n * ```\n */\nexport const refs = <T extends Record<string, unknown>>(obj: T): Refs<T> => {\n const result = {} as Refs<T>;\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n result[key] = ref(obj[key]);\n }\n }\n return result;\n};\n\n/**\n * Unwraps a single Ref object to its value.\n *\n * @example\n * ```ts\n * const r = { '~ref': 42 };\n * const n = fromRef(r); // 42\n * console.log(n); // 42\n * ```\n */\nexport const fromRef = <T extends Ref<unknown> | undefined>(ref: T): FromRef<T> =>\n ref?.['~ref'] as FromRef<T>;\n\n/**\n * Converts an object of Refs back to a plain object (unwraps all refs).\n *\n * @example\n * ```ts\n * const refs = { a: { '~ref': 1 }, b: { '~ref': \"x\" } };\n * const plain = fromRefs(refs); // { a: 1, b: \"x\" }\n * ```\n */\nexport const fromRefs = <T extends Refs<Record<string, unknown>>>(obj: T): FromRefs<T> => {\n const result = {} as FromRefs<T>;\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n result[key] = fromRef(obj[key]!) as (typeof result)[typeof key];\n }\n }\n return result;\n};\n\n/**\n * Checks whether a value is a Ref object.\n *\n * @param value Value to check\n * @returns True if the value is a Ref object.\n */\nexport const isRef = <T>(value: unknown): value is Ref<T> =>\n typeof value === 'object' && value !== null && '~ref' in value;\n","import { fromRef, ref } from '../refs/refs';\nimport type { Ref } from '../refs/types';\nimport type { INode } from './node';\nimport type { INodeRegistry } from './types';\n\nexport class NodeRegistry implements INodeRegistry {\n private list: Array<Ref<INode | null>> = [];\n\n add(node: INode | null): number {\n const index = this.list.push(ref(node));\n return index - 1;\n }\n\n *all(): Iterable<INode> {\n for (const r of this.list) {\n const node = fromRef(r);\n if (node) yield node;\n }\n }\n\n remove(index: number): void {\n this.list[index] = ref(null);\n }\n\n update(index: number, node: INode | null): void {\n this.list[index] = ref(node);\n }\n}\n","import type { Language } from '../languages/types';\nimport type { SymbolKind } from '../symbols/types';\n\nconst typescriptMergeKindRank: Record<SymbolKind, number> = {\n class: 3,\n enum: 4,\n function: 5,\n interface: 1,\n namespace: 0,\n type: 2,\n var: 6,\n};\n\n/**\n * Returns true if two declarations of given kinds\n * are allowed to share the same identifier in TypeScript.\n */\nfunction canTypeScriptDeclarationsShareIdentifier(a: SymbolKind, b: SymbolKind): boolean {\n // sort based on TypeScript merge precedence so `a` is always the weaker merge candidate\n // ensures that asymmetric merges like `type + var` are correctly handled\n if (typescriptMergeKindRank[a] > typescriptMergeKindRank[b]) {\n [a, b] = [b, a];\n }\n\n switch (a) {\n case 'interface':\n return b === 'class' || b === 'interface';\n case 'namespace':\n return b === 'class' || b === 'enum' || b === 'function' || b === 'namespace';\n case 'type':\n // type can only merge with value-only declarations\n return b === 'function' || b === 'var';\n default:\n return false;\n }\n}\n\nexport function canDeclarationsShareIdentifier(\n language: Language | undefined,\n a: SymbolKind,\n b: SymbolKind,\n): boolean {\n if (language === 'typescript') {\n return canTypeScriptDeclarationsShareIdentifier(a, b);\n }\n\n return false;\n}\n","import type { Ref } from '../refs/types';\nimport type { Symbol } from '../symbols/symbol';\nimport type { SymbolKind } from '../symbols/types';\n\nexport type NameScopes = Map<string, Set<SymbolKind>>;\n\nexport type Scope = {\n /** Soft conflicts, inherited names from children symbols. */\n childNames: NameScopes;\n /** Child scopes. */\n children: Array<Scope>;\n /** Hard conflicts, declared names in this scope. */\n localNames: NameScopes;\n /** Parent scope, if any. */\n parent?: Scope;\n /** Symbols registered in this scope. */\n symbols: Array<Ref<Symbol>>;\n};\n\nexport type AssignOptions = {\n /** The primary scope in which to assign a symbol's final name. */\n scope: Scope;\n /** Additional scopes to update as side effects when assigning a symbol's final name. */\n scopesToUpdate: ReadonlyArray<Scope>;\n};\n\nexport function createScope(\n args: Pick<Partial<Scope>, 'childNames' | 'localNames' | 'parent'> = {},\n): Scope {\n return {\n childNames: args.childNames || new Map(),\n children: [],\n localNames: args.localNames || new Map(),\n parent: args.parent,\n symbols: [],\n };\n}\n\nexport function registerName(scope: Scope, name: string, kind: SymbolKind): void {\n const kinds = scope.localNames.get(name) ?? new Set();\n kinds.add(kind);\n scope.localNames.set(name, kinds);\n}\n\nexport function registerChildName(scope: Scope, name: string, kind: SymbolKind): void {\n const kinds = scope.childNames.get(name) ?? new Set();\n kinds.add(kind);\n scope.childNames.set(name, kinds);\n}\n","import type { IProjectMeta } from '../extensions';\nimport { isNodeRef, isSymbolRef } from '../guards';\nimport type { INode, NodeRelationship } from '../nodes/node';\nimport { fromRef, isRef, ref } from '../refs/refs';\nimport type { Ref } from '../refs/types';\nimport type { Symbol } from '../symbols/symbol';\nimport type { NameScopes, Scope } from './scope';\nimport { createScope, registerChildName } from './scope';\nimport type { IAnalysisContext, Input } from './types';\n\nexport class AnalysisContext implements IAnalysisContext {\n /** Arbitrary project metadata. */\n private meta: IProjectMeta;\n /**\n * Stack of parent nodes during analysis.\n *\n * The top of the stack is the current semantic container.\n */\n private parentStack: Array<INode> = [];\n\n scope: Scope;\n scopes: Scope = createScope();\n symbol?: Symbol;\n\n constructor(node: INode, meta: IProjectMeta) {\n this.parentStack.push(node);\n this.meta = meta;\n this.scope = this.scopes;\n this.symbol = node.symbol;\n }\n\n /**\n * Get the current semantic parent (top of stack).\n */\n get currentParent(): INode | undefined {\n return this.parentStack[this.parentStack.length - 1];\n }\n\n /**\n * Register a child node under the current parent.\n */\n addChild(child: INode, relationship: NodeRelationship = 'container'): void {\n const parent = this.currentParent;\n if (!parent) return;\n\n if (!parent.structuralChildren) {\n parent.structuralChildren = new Map();\n }\n parent.structuralChildren.set(child, relationship);\n\n if (!child.structuralParents) {\n child.structuralParents = new Map();\n }\n child.structuralParents.set(parent, relationship);\n }\n\n addDependency(symbol: Ref<Symbol>): void {\n if (this.symbol !== fromRef(symbol)) {\n this.scope.symbols.push(symbol);\n }\n }\n\n analyze(input: Input): void {\n const value = isRef(input) ? input : ref(input);\n if (isSymbolRef(value)) {\n const symbol = fromRef(value);\n // avoid adding self as child\n if (symbol.node && this.currentParent !== symbol.node) {\n this.addChild(symbol.node, 'reference');\n }\n this.addDependency(value);\n } else if (isNodeRef(value)) {\n const node = fromRef(value);\n this.addChild(node, 'container');\n this.pushParent(node);\n node.meta = this.meta[node.language] ?? {};\n node.analyze(this);\n this.popParent();\n }\n }\n\n injectChildren(input: Input): void {\n const value = isRef(input) ? input : ref(input);\n const symbol = isSymbolRef(value) ? fromRef(value) : undefined;\n if (!symbol) return;\n\n for (const child of symbol.children) {\n if (!child.overridable) {\n registerChildName(this.scope, child.name, child.kind);\n }\n }\n }\n\n localNames(scope: Scope): NameScopes {\n const names: NameScopes = new Map();\n for (const [name, kinds] of scope.localNames) {\n names.set(name, new Set(kinds));\n }\n if (scope.parent) {\n const parentNames = this.localNames(scope.parent);\n for (const [name, kinds] of parentNames) {\n if (!names.has(name)) {\n names.set(name, kinds);\n } else {\n const existingKinds = names.get(name)!;\n for (const kind of kinds) {\n existingKinds.add(kind);\n }\n }\n }\n }\n return names;\n }\n\n /**\n * Pop the current semantic parent.\n * Call this when exiting a container node.\n */\n popParent(): void {\n this.parentStack.pop();\n }\n\n popScope(): void {\n this.scope = this.scope.parent ?? this.scope;\n }\n\n /**\n * Push a node as the current semantic parent.\n */\n pushParent(node: INode): void {\n this.parentStack.push(node);\n }\n\n pushScope(): void {\n const scope = createScope({ parent: this.scope });\n this.scope.children.push(scope);\n this.scope = scope;\n }\n\n walkScopes(\n callback: (symbol: Ref<Symbol>, scope: Scope) => void,\n scope: Scope = this.scopes,\n ): void {\n this.scope = scope;\n for (const symbol of scope.symbols) {\n callback(symbol, scope);\n }\n for (const child of scope.children) {\n scope = child;\n this.walkScopes(callback, scope);\n }\n this.scope = this.scopes;\n }\n}\n\nexport class Analyzer {\n private readonly meta: IProjectMeta;\n private nodeCache = new WeakMap<INode, AnalysisContext>();\n\n constructor(meta: IProjectMeta) {\n this.meta = meta;\n }\n\n analyzeNode(node: INode): AnalysisContext {\n const cached = this.nodeCache.get(node);\n if (cached) return cached;\n\n node.root = true;\n node.meta = this.meta[node.language] ?? {};\n const ctx = new AnalysisContext(node, this.meta);\n node.analyze(ctx);\n\n this.nodeCache.set(node, ctx);\n return ctx;\n }\n\n analyze(nodes: Iterable<INode>, callback?: (ctx: AnalysisContext, node: INode) => void): void {\n for (const node of nodes) {\n const ctx = this.analyzeNode(node);\n callback?.(ctx, node);\n }\n }\n}\n","import path from 'node:path';\n\nimport type { ExportModule, ImportModule } from '../bindings';\nimport type { File } from '../files/file';\nimport type { INode } from '../nodes/node';\nimport { canDeclarationsShareIdentifier } from '../project/namespace';\nimport type { IProject } from '../project/types';\nimport { fromRef } from '../refs/refs';\nimport type { RenderContext } from '../renderer';\nimport type { Symbol } from '../symbols/symbol';\nimport type { SymbolKind } from '../symbols/types';\nimport type { AnalysisContext } from './analyzer';\nimport { Analyzer } from './analyzer';\nimport type { AssignOptions, Scope } from './scope';\nimport { createScope, registerName } from './scope';\n\nconst isTypeOnlyKind = (kind: SymbolKind) => kind === 'type' || kind === 'interface';\n\nexport class Planner {\n private readonly analyzer: Analyzer;\n private readonly cacheResolvedNames = new Set<number>();\n private readonly project: IProject;\n\n constructor(project: IProject) {\n this.analyzer = new Analyzer(project.meta);\n this.project = project;\n }\n\n /**\n * Executes the planning phase for the project.\n */\n plan() {\n this.cacheResolvedNames.clear();\n this.allocateFiles();\n this.assignLocalNames();\n this.resolveFilePaths();\n this.planExports();\n this.planImports();\n }\n\n /**\n * Creates and assigns a file to every node, re-export,\n * and external dependency.\n */\n private allocateFiles(): void {\n this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => {\n const symbol = node.symbol;\n if (!symbol) return;\n\n const file = this.project.files.register({\n external: false,\n language: node.language,\n logicalFilePath: symbol.getFilePath?.(symbol) || this.project.defaultFileName,\n });\n file.addNode(node);\n symbol.setFile(file);\n for (const logicalFilePath of symbol.getExportFromFilePath?.(symbol) ?? []) {\n this.project.files.register({\n external: false,\n language: file.language,\n logicalFilePath,\n });\n }\n ctx.walkScopes((dependency) => {\n const dep = fromRef(dependency);\n if (dep.external && dep.isCanonical && !dep.file) {\n const file = this.project.files.register({\n external: true,\n language: dep.node?.language,\n logicalFilePath: dep.external,\n });\n dep.setFile(file);\n }\n });\n });\n }\n\n /**\n * Assigns final names to all symbols.\n *\n * First assigns top-level (file-scoped) symbol names, then local symbols.\n */\n private assignLocalNames(): void {\n this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => {\n const symbol = node.symbol;\n if (!symbol) return;\n this.assignTopLevelName({ ctx, node, symbol });\n });\n\n this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => {\n const file = node.file;\n if (!file) return;\n ctx.walkScopes((dependency) => {\n const dep = fromRef(dependency);\n // top-level or external symbol\n if (dep.file) return;\n // TODO: pass node\n this.assignLocalName({\n ctx,\n file,\n scopesToUpdate: [createScope({ localNames: file.allNames })],\n symbol: dep,\n });\n });\n });\n }\n\n /**\n * Resolves and sets final file paths for all non-external files. Attaches renderers.\n *\n * Uses the project's fileName function if provided, otherwise uses the file's current name.\n *\n * Resolves final paths relative to the project's root directory.\n */\n private resolveFilePaths(): void {\n for (const file of this.project.files.registered()) {\n if (file.external) {\n file.setFinalPath(file.logicalFilePath);\n continue;\n }\n const finalName = this.project.fileName?.(file.name) || file.name;\n file.setName(finalName);\n const finalPath = file.finalPath;\n if (finalPath) {\n file.setFinalPath(path.resolve(this.project.root, finalPath));\n }\n const ctx: RenderContext = { file, project: this.project };\n const renderer = this.project.renderers.find((r) => r.supports(ctx));\n if (renderer) file.setRenderer(renderer);\n }\n }\n\n /**\n * Plans exports by analyzing all exported symbols.\n *\n * Registers re-export targets as files and creates new exported symbols for them.\n *\n * Assigns names to re-exported symbols and collects re-export metadata,\n * distinguishing type-only exports based on symbol kinds.\n */\n private planExports(): void {\n const seenByFile = new Map<File, Map<string, { kinds: Set<SymbolKind>; symbol: Symbol }>>();\n const sourceFile = new Map<number, File>();\n\n this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => {\n if (!node.exported) return;\n\n const symbol = node.symbol;\n if (!symbol) return;\n\n const file = node.file;\n if (!file) return;\n\n for (const logicalFilePath of symbol.getExportFromFilePath?.(symbol) ?? []) {\n const target = this.project.files.register({\n external: false,\n language: node.language,\n logicalFilePath,\n });\n if (target.id === file.id) continue;\n\n let fileMap = seenByFile.get(target);\n if (!fileMap) {\n fileMap = new Map();\n seenByFile.set(target, fileMap);\n }\n\n const exp = this.project.symbols.register({\n exported: true,\n external: symbol.external,\n importKind: symbol.importKind,\n kind: symbol.kind,\n name: symbol.finalName,\n });\n exp.setFile(target);\n sourceFile.set(exp.id, file);\n // TODO: pass node\n this.assignTopLevelName({ ctx, symbol: exp });\n\n let entry = fileMap.get(exp.finalName);\n if (!entry) {\n entry = { kinds: new Set(), symbol: exp };\n fileMap.set(exp.finalName, entry);\n }\n entry.kinds.add(exp.kind);\n }\n });\n\n for (const [file, fileMap] of seenByFile) {\n const exports = new Map<File, ExportModule>();\n for (const [, entry] of fileMap) {\n const source = sourceFile.get(entry.symbol.id)!;\n let exp = exports.get(source);\n if (!exp) {\n exp = {\n canExportAll: true,\n exports: [],\n from: source,\n isTypeOnly: true,\n };\n }\n const isTypeOnly = [...entry.kinds].every((kind) => isTypeOnlyKind(kind));\n const exportedName = entry.symbol.finalName;\n exp.exports.push({\n exportedName,\n isTypeOnly,\n kind: entry.symbol.importKind,\n sourceName: entry.symbol.name,\n });\n if (entry.symbol.name !== entry.symbol.finalName) {\n exp.canExportAll = false;\n }\n if (!isTypeOnly) {\n exp.isTypeOnly = false;\n }\n exports.set(source, exp);\n }\n for (const [, exp] of exports) {\n file.addExport(exp);\n }\n }\n }\n\n /**\n * Plans imports by analyzing symbol dependencies across files.\n *\n * For external dependencies, assigns top-level names.\n *\n * Creates or reuses import symbols for dependencies from other files,\n * assigning names and updating import metadata including type-only flags.\n */\n private planImports(): void {\n const seenByFile = new Map<\n File,\n Map<\n string,\n {\n dep: Symbol;\n kinds: Set<SymbolKind>;\n symbol: Symbol;\n }\n >\n >();\n\n this.analyzer.analyze(this.project.nodes.all(), (ctx) => {\n const symbol = ctx.symbol;\n if (!symbol) return;\n\n const file = symbol.file;\n if (!file) return;\n\n let fileMap = seenByFile.get(file);\n if (!fileMap) {\n fileMap = new Map();\n seenByFile.set(file, fileMap);\n }\n\n ctx.walkScopes((dependency) => {\n const dep = fromRef(dependency);\n if (!dep.file || dep.file.id === file.id) return;\n\n if (dep.external) {\n // TODO: pass node\n this.assignTopLevelName({ ctx, symbol: dep });\n }\n\n const fromFileId = dep.file.id;\n const importedName = dep.finalName;\n const kind = dep.importKind;\n const key = `${fromFileId}|${importedName}|${kind}`;\n\n let entry = fileMap.get(key);\n if (!entry) {\n const imp = this.project.symbols.register({\n exported: dep.exported,\n external: dep.external,\n importKind: dep.importKind,\n kind: dep.kind,\n name: dep.finalName,\n });\n imp.setFile(file);\n // TODO: pass node\n this.assignTopLevelName({\n ctx,\n scope: createScope({ localNames: imp.file!.allNames }),\n symbol: imp,\n });\n entry = {\n dep,\n kinds: new Set(),\n symbol: imp,\n };\n fileMap.set(key, entry);\n }\n entry.kinds.add(dep.kind);\n\n dependency['~ref'] = entry.symbol;\n });\n });\n\n for (const [file, fileMap] of seenByFile) {\n const imports = new Map<File, ImportModule>();\n for (const [, entry] of fileMap) {\n const source = entry.dep.file!;\n let imp = imports.get(source);\n if (!imp) {\n imp = {\n from: source,\n imports: [],\n isTypeOnly: true,\n kind: 'named',\n };\n }\n const isTypeOnly = [...entry.kinds].every((kind) => isTypeOnlyKind(kind));\n if (entry.symbol.importKind === 'namespace') {\n imp.imports = [];\n imp.kind = 'namespace';\n imp.localName = entry.symbol.finalName;\n } else if (entry.symbol.importKind === 'default') {\n imp.kind = 'default';\n imp.localName = entry.symbol.finalName;\n } else {\n imp.imports.push({\n isTypeOnly,\n localName: entry.symbol.finalName,\n sourceName: entry.dep.finalName,\n });\n }\n if (!isTypeOnly) {\n imp.isTypeOnly = false;\n }\n imports.set(source, imp);\n }\n for (const [, imp] of imports) {\n file.addImport(imp);\n }\n }\n }\n\n /**\n * Assigns the final name to a top-level (file-scoped) symbol.\n *\n * Uses the symbol's file top-level names as the default scope,\n * and updates all relevant name scopes including the file's allNames and local scopes.\n *\n * Supports optional overrides for the naming scope and scopes to update.\n */\n private assignTopLevelName(\n args: Partial<AssignOptions> & {\n ctx: AnalysisContext;\n debug?: boolean;\n node?: INode;\n symbol: Symbol;\n },\n ): void {\n if (!args.symbol.file) return;\n this.assignSymbolName({\n ...args,\n file: args.symbol.file,\n scope: args?.scope ?? createScope({ localNames: args.symbol.file.topLevelNames }),\n scopesToUpdate: [\n createScope({ localNames: args.symbol.file.allNames }),\n args.ctx.scopes,\n ...(args?.scopesToUpdate ?? []),\n ],\n });\n }\n\n /**\n * Assigns the final name to a non-top-level (local) symbol.\n *\n * Uses the provided scope or derives it from the current analysis context's local names.\n *\n * Updates all provided name scopes accordingly.\n */\n private assignLocalName(\n args: Pick<Partial<AssignOptions>, 'scope'> &\n Pick<AssignOptions, 'scopesToUpdate'> & {\n ctx: AnalysisContext;\n debug?: boolean;\n /** The file the symbol belongs to. */\n file: File;\n node?: INode;\n symbol: Symbol;\n },\n ): void {\n this.assignSymbolName({\n ...args,\n scope: args.scope ?? args.ctx.scope,\n });\n }\n\n /**\n * Assigns the final name to a symbol within the provided name scope.\n *\n * Resolves name conflicts until a unique name is found.\n *\n * Updates all specified name scopes with the assigned final name.\n */\n private assignSymbolName(\n args: AssignOptions & {\n ctx: AnalysisContext;\n debug?: boolean;\n /** The file the symbol belongs to. */\n file: File;\n node?: INode;\n symbol: Symbol;\n },\n ): void {\n const { file, node, scope, scopesToUpdate, symbol } = args;\n if (this.cacheResolvedNames.has(symbol.id)) return;\n\n const baseName = symbol.name;\n let finalName =\n node?.nameSanitizer?.(baseName) ?? symbol.node?.nameSanitizer?.(baseName) ?? baseName;\n let attempt = 1;\n\n while (true) {\n const language = node?.language || symbol.node?.language || file.language;\n\n const ok = this.nameIsAvailable({\n kind: symbol.kind,\n language,\n name: finalName,\n override: symbol.override,\n scope,\n });\n if (ok) break;\n\n const resolver =\n (language ? this.project.nameConflictResolvers[language] : undefined) ??\n this.project.defaultNameConflictResolver;\n const resolvedName = resolver({ attempt, baseName });\n if (!resolvedName) {\n throw new Error(`Unresolvable name conflict: ${symbol.toString()}`);\n }\n\n finalName =\n node?.nameSanitizer?.(resolvedName) ??\n symbol.node?.nameSanitizer?.(resolvedName) ??\n resolvedName;\n attempt = attempt + 1;\n }\n\n symbol.setFinalName(finalName);\n this.cacheResolvedNames.add(symbol.id);\n const updateScopes = [scope, ...scopesToUpdate];\n for (const scope of updateScopes) {\n registerName(scope, symbol.finalName, symbol.kind);\n }\n }\n\n /**\n * Checks whether `name` can be used for a new symbol of `kind` in `scope`.\n *\n * Walks up the scope chain and verifies that every existing declaration with\n * that name is compatible (i.e., can share the same identifier) with `kind`.\n * This avoids copying the entire accumulated name map on every call.\n */\n private nameIsAvailable({\n kind,\n language,\n name,\n override,\n scope,\n }: {\n kind: SymbolKind;\n language: string | undefined;\n name: string;\n override?: boolean;\n scope: Scope;\n }): boolean {\n function conflicts(kinds: Set<SymbolKind> | undefined): boolean {\n if (!kinds) return false;\n for (const existingKind of kinds) {\n if (!canDeclarationsShareIdentifier(language, kind, existingKind)) {\n return true;\n }\n }\n return false;\n }\n\n let current: Scope | undefined = scope;\n while (current) {\n if (!override && conflicts(current.childNames.get(name))) {\n return false;\n }\n if (conflicts(current.localNames.get(name))) return false;\n current = current.parent;\n }\n return true;\n }\n}\n","import { symbolBrand } from '../brands';\nimport type { ISymbolMeta } from '../extensions';\nimport type { File } from '../files/file';\nimport { log } from '../log';\nimport type { INode } from '../nodes/node';\nimport type { BindingKind, ISymbolChild, ISymbolIn, SymbolKind } from './types';\n\nexport class Symbol<Node extends INode = INode> {\n /**\n * Canonical symbol this stub resolves to, if any.\n *\n * Stubs created during DSL construction may later be associated\n * with a fully registered symbol. Once set, all property lookups\n * should defer to the canonical symbol.\n */\n private _canonical?: Symbol;\n /**\n * Child symbol bindings scoped under this symbol.\n *\n * @default []\n */\n private _children: Array<ISymbolChild>;\n /**\n * True if this symbol is exported from its defining file.\n *\n * @default false\n */\n private _exported: boolean;\n /**\n * External module name if this symbol is imported from a module not managed\n * by the project (e.g., \"zod\", \"lodash\").\n *\n * @default undefined\n */\n private _external?: string;\n /**\n * The file this symbol is ultimately emitted into.\n *\n * Only top-level symbols have an assigned file.\n */\n private _file?: File;\n /**\n * The alias-resolved, conflict-free emitted name.\n */\n private _finalName?: string;\n /**\n * Custom strategy to determine from which file path(s) this symbol is re-exported.\n *\n * @returns The file path(s) that re-export this symbol, or undefined if none.\n */\n private _getExportFromFilePath?: (symbol: Symbol) => ReadonlyArray<string> | undefined;\n /**\n * Custom strategy to determine file output path.\n *\n * @returns The file path to output the symbol to, or undefined to fallback to default behavior.\n */\n private _getFilePath?: (symbol: Symbol) => string | undefined;\n /**\n * How this symbol should be imported (namespace/default/named).\n *\n * @default 'named'\n */\n private _importKind: BindingKind;\n /**\n * Kind of symbol (class, type, alias, etc.).\n *\n * @default 'var'\n */\n private _kind: SymbolKind;\n /**\n * Arbitrary user metadata.\n *\n * @default undefined\n */\n private _meta?: ISymbolMeta;\n /**\n * Intended user-facing name before conflict resolution.\n *\n * @example \"UserModel\"\n */\n private _name: string;\n /**\n * Node that defines this symbol.\n */\n private _node?: Node;\n /**\n * Indicates whether this symbol overrides another declaration.\n *\n * @default false\n */\n private _override: boolean;\n\n /** Brand used for identifying symbols. */\n readonly '~brand' = symbolBrand;\n /** Globally unique, stable symbol ID. */\n readonly id: number;\n\n constructor(input: ISymbolIn, id: number) {\n this._children = input.children ?? [];\n this._exported = input.exported ?? false;\n this._external = input.external;\n this._getExportFromFilePath = input.getExportFromFilePath;\n this._getFilePath = input.getFilePath;\n this.id = id;\n this._importKind = input.importKind ?? 'named';\n this._kind = input.kind ?? 'var';\n this._meta = input.meta;\n this._name = input.name;\n this._override = input.override ?? false;\n }\n\n /**\n * Returns the canonical symbol for this instance.\n *\n * If this symbol was created as a stub, this getter returns\n * the fully registered canonical symbol. Otherwise, it returns\n * the symbol itself.\n */\n get canonical(): Symbol {\n return this._canonical ?? this;\n }\n\n /**\n * Read-only accessor for child symbol bindings.\n */\n get children(): ReadonlyArray<ISymbolChild> {\n return this.canonical._children;\n }\n\n /**\n * Indicates whether this symbol is exported from its defining file.\n */\n get exported(): boolean {\n return this.canonical._exported;\n }\n\n /**\n * External module from which this symbol originates, if any.\n */\n get external(): string | undefined {\n return this.canonical._external;\n }\n\n /**\n * Read‑only accessor for the assigned output file.\n *\n * Only top-level symbols have an assigned file.\n */\n get file(): File | undefined {\n return this.canonical._file;\n }\n\n /**\n * Read‑only accessor for the resolved final emitted name.\n */\n get finalName(): string {\n if (!this.canonical._finalName) {\n const message = `Symbol finalName has not been resolved yet for ${this.canonical.toString()}`;\n log.debug(message, 'symbol');\n throw new Error(message);\n }\n return this.canonical._finalName;\n }\n\n /**\n * Custom re-export file path resolver, if provided.\n */\n get getExportFromFilePath(): ((symbol: Symbol) => ReadonlyArray<string> | undefined) | undefined {\n return this.canonical._getExportFromFilePath;\n }\n\n /**\n * Custom file path resolver, if provided.\n */\n get getFilePath(): ((symbol: Symbol) => string | undefined) | undefined {\n return this.canonical._getFilePath;\n }\n\n /**\n * How this symbol should be imported (named/default/namespace).\n */\n get importKind(): BindingKind {\n return this.canonical._importKind;\n }\n\n /**\n * Indicates whether this is a canonical symbol (not a stub).\n */\n get isCanonical(): boolean {\n return !this._canonical || this._canonical === this;\n }\n\n /**\n * The symbol's kind (class, type, alias, variable, etc.).\n */\n get kind(): SymbolKind {\n return this.canonical._kind;\n }\n\n /**\n * Arbitrary user‑provided metadata associated with this symbol.\n */\n get meta(): ISymbolMeta | undefined {\n return this.canonical._meta;\n }\n\n /**\n * User-intended name before aliasing or conflict resolution.\n */\n get name(): string {\n return this.canonical._name;\n }\n\n /**\n * Read‑only accessor for the defining node.\n */\n get node(): Node | undefined {\n return this.canonical._node as Node | undefined;\n }\n\n /**\n * Indicates whether this symbol is marked as an override.\n */\n get override(): boolean {\n return this.canonical._override;\n }\n\n /**\n * Marks this symbol as a stub and assigns its canonical symbol.\n *\n * After calling this, all semantic queries (name, kind, file,\n * meta, etc.) should reflect the canonical symbol's values.\n *\n * @param symbol — The canonical symbol this stub should resolve to.\n */\n setCanonical(symbol: Symbol): void {\n this._canonical = symbol;\n }\n\n /**\n * Assigns the child symbol bindings associated with this symbol.\n *\n * @param children — Child bindings to associate with the symbol.\n */\n setChildren(children: Array<ISymbolChild>): void {\n this.assertCanonical();\n this._children = children;\n }\n\n /**\n * Marks the symbol as exported from its file.\n *\n * @param exported — Whether the symbol is exported.\n */\n setExported(exported: boolean): void {\n this.assertCanonical();\n this._exported = exported;\n }\n\n /**\n * Assigns the output file this symbol will be emitted into.\n *\n * This may only be set once.\n */\n setFile(file: File): void {\n this.assertCanonical();\n if (this._file && this._file !== file) {\n const message = `Symbol ${this.canonical.toString()} is already assigned to a different file.`;\n log.debug(message, 'symbol');\n throw new Error(message);\n }\n this._file = file;\n }\n\n /**\n * Assigns the conflict‑resolved final local name for this symbol.\n *\n * This may only be set once.\n */\n setFinalName(name: string): void {\n this.assertCanonical();\n if (this._finalName && this._finalName !== name) {\n const message = `Symbol finalName has already been resolved for ${this.canonical.toString()}.`;\n log.debug(message, 'symbol');\n throw new Error(message);\n }\n this._finalName = name;\n }\n\n /**\n * Sets how this symbol should be imported.\n *\n * @param kind — The import strategy (named/default/namespace).\n */\n setImportKind(kind: BindingKind): void {\n this.assertCanonical();\n this._importKind = kind;\n }\n\n /**\n * Sets the symbol's kind (class, type, alias, variable, etc.).\n *\n * @param kind — The new symbol kind.\n */\n setKind(kind: SymbolKind): void {\n this.assertCanonical();\n this._kind = kind;\n }\n\n /**\n * Updates the intended user‑facing name for this symbol.\n *\n * @param name — The new name.\n */\n setName(name: string): void {\n this.assertCanonical();\n this._name = name;\n }\n\n /**\n * Binds the node that defines this symbol.\n *\n * This may only be set once.\n */\n setNode(node: Node): void {\n this.assertCanonical();\n if (this._node && this._node !== node) {\n const message = `Symbol ${this.canonical.toString()} is already bound to a different node.`;\n log.debug(message, 'symbol');\n // TODO: symbol <> node relationship needs to be refactor to 1:many\n // disabled in the meantime or it would throw\n // throw new Error(message);\n }\n this._node = node;\n node.symbol = this;\n }\n\n /**\n * Marks whether this symbol should be treated as an override.\n *\n * @param override — Override marker value.\n */\n setOverride(override: boolean): void {\n this.assertCanonical();\n this._override = override;\n }\n\n /**\n * Returns a debug‑friendly string representation identifying the symbol.\n */\n toString(): string {\n const canonical = this.canonical;\n if (canonical._finalName) {\n return `[Symbol ${canonical._name} → ${canonical._finalName}#${canonical.id}]`;\n }\n return `[Symbol ${canonical._name}#${canonical.id}] ${JSON.stringify(canonical._meta ?? {})}`;\n }\n\n /**\n * Ensures this symbol is canonical before allowing mutation.\n *\n * A symbol that has been marked as a stub (i.e., its `_canonical` points\n * to a different symbol) may not be mutated. This guard throws an error\n * if any setter attempts to modify a stub, preventing accidental writes\n * to non‑canonical instances.\n *\n * @throws {Error} If the symbol is a stub and is being mutated.\n */\n private assertCanonical(): void {\n if (this._canonical && this._canonical !== this) {\n const message = `Illegal mutation of stub symbol ${this.toString()} → canonical: ${this._canonical.toString()}`;\n log.debug(message, 'symbol');\n throw new Error(message);\n }\n }\n}\n","import type { ISymbolMeta } from '../extensions';\nimport { Symbol } from './symbol';\nimport type { ISymbolIdentifier, ISymbolIn, ISymbolRegistry } from './types';\n\ntype IndexEntry = readonly [key: string, value: unknown, serialized: string];\ntype IndexKeySpace = ReadonlyArray<IndexEntry>;\ntype QueryCacheKey = string;\ntype SymbolId = number;\n\nexport class SymbolRegistry implements ISymbolRegistry {\n /** Forward index: cache key → index key space it was registered with. */\n private _cacheDependencies: Map<QueryCacheKey, IndexKeySpace> = new Map();\n /** Reverse index: serialized index entry → set of cache keys that depend on it. */\n private _dependencyToCache: Map<string, Set<QueryCacheKey>> = new Map();\n private _id: SymbolId = 0;\n private _indices: Map<IndexEntry[0], Map<IndexEntry[1], Set<SymbolId>>> = new Map();\n private _queryCache: Map<QueryCacheKey, ReadonlyArray<Symbol>> = new Map();\n private _registered: Set<SymbolId> = new Set();\n private _stubs: Set<SymbolId> = new Set();\n private _stubCache: Map<QueryCacheKey, SymbolId> = new Map();\n private _values: Map<SymbolId, Symbol> = new Map();\n\n get(identifier: ISymbolIdentifier): Symbol | undefined {\n return typeof identifier === 'number'\n ? this._values.get(identifier)\n : this.query(identifier)[0];\n }\n\n isRegistered(identifier: ISymbolIdentifier): boolean {\n const symbol = this.get(identifier);\n return symbol ? this._registered.has(symbol.id) : false;\n }\n\n get nextId(): SymbolId {\n return this._id++;\n }\n\n query(filter: ISymbolMeta): ReadonlyArray<Symbol> {\n const indexKeySpace = this.buildIndexKeySpace(filter);\n const cacheKey = this.cacheKeyFromKeySpace(indexKeySpace);\n return this.queryByKeySpace(indexKeySpace, cacheKey);\n }\n\n reference(meta: ISymbolMeta): Symbol {\n const indexKeySpace = this.buildIndexKeySpace(meta);\n const cacheKey = this.cacheKeyFromKeySpace(indexKeySpace);\n const [registered] = this.queryByKeySpace(indexKeySpace, cacheKey);\n if (registered) return registered;\n\n const cachedId = this._stubCache.get(cacheKey);\n if (cachedId !== undefined) return this._values.get(cachedId)!;\n\n const stub = new Symbol({ meta, name: '' }, this.nextId);\n\n this._values.set(stub.id, stub);\n this._stubs.add(stub.id);\n this._stubCache.set(cacheKey, stub.id);\n return stub;\n }\n\n register(symbol: ISymbolIn): Symbol {\n const result = new Symbol(symbol, this.nextId);\n\n this._values.set(result.id, result);\n this._registered.add(result.id);\n\n if (result.meta) {\n const indexKeySpace = this.buildIndexKeySpace(result.meta);\n this.indexSymbol(result.id, indexKeySpace);\n this.invalidateCache(indexKeySpace);\n this.replaceStubs(result, indexKeySpace);\n }\n\n return result;\n }\n\n *registered(): IterableIterator<Symbol> {\n for (const id of this._registered.values()) {\n yield this._values.get(id)!;\n }\n }\n\n private buildIndexKeySpace(\n meta: ISymbolMeta,\n prefix = '',\n entries: Array<IndexEntry> = [],\n ): IndexKeySpace {\n for (const [key, value] of Object.entries(meta)) {\n const path = prefix ? `${prefix}.${key}` : key;\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n this.buildIndexKeySpace(value as ISymbolMeta, path, entries);\n } else {\n entries.push([path, value, `${path}:${JSON.stringify(value)}`]);\n }\n }\n return entries;\n }\n\n /**\n * Derives a stable, order-insensitive cache key from a pre-built key space.\n * Avoids rebuilding the key space when it's already available.\n */\n private cacheKeyFromKeySpace(indexKeySpace: IndexKeySpace): QueryCacheKey {\n return indexKeySpace\n .map((indexEntry) => indexEntry[2])\n .sort() // ensure order-insensitivity\n .join('|');\n }\n\n private indexSymbol(symbolId: SymbolId, indexKeySpace: IndexKeySpace): void {\n for (const [key, value] of indexKeySpace) {\n if (!this._indices.has(key)) this._indices.set(key, new Map());\n const values = this._indices.get(key)!;\n const set = values.get(value) ?? new Set();\n set.add(symbolId);\n values.set(value, set);\n }\n }\n\n private invalidateCache(indexKeySpace: IndexKeySpace): void {\n for (const indexEntry of indexKeySpace) {\n const serialized = indexEntry[2];\n const cacheKeys = this._dependencyToCache.get(serialized);\n if (!cacheKeys) continue;\n for (const cacheKey of cacheKeys) {\n this._queryCache.delete(cacheKey);\n // Clean up stale reverse-index references so _dependencyToCache doesn't\n // accumulate orphaned entries for evicted cache keys.\n const deps = this._cacheDependencies.get(cacheKey);\n if (deps) {\n for (const dep of deps) {\n if (dep[2] !== serialized) {\n this._dependencyToCache.get(dep[2])?.delete(cacheKey);\n }\n }\n this._cacheDependencies.delete(cacheKey);\n }\n }\n this._dependencyToCache.delete(serialized);\n }\n }\n\n private isSubset(sub: IndexKeySpace, sup: IndexKeySpace): boolean {\n const supMap = new Map(sup.map((e) => [e[0], e[1]] as const));\n for (const [key, value] of sub) {\n if (!supMap.has(key) || supMap.get(key) !== value) {\n return false;\n }\n }\n return true;\n }\n\n private queryByKeySpace(\n indexKeySpace: IndexKeySpace,\n cacheKey: QueryCacheKey,\n ): ReadonlyArray<Symbol> {\n const cached = this._queryCache.get(cacheKey);\n if (cached) {\n return cached;\n }\n const sets: Array<Set<SymbolId>> = [];\n let missed = false;\n\n // Build index sets and register cache dependencies inline within a single pass.\n for (const indexEntry of indexKeySpace) {\n const serialized = indexEntry[2];\n let cacheKeys: Set<string>;\n\n if (this._dependencyToCache.has(serialized)) {\n cacheKeys = this._dependencyToCache.get(serialized)!;\n } else {\n cacheKeys = new Set();\n this._dependencyToCache.set(serialized, cacheKeys);\n }\n\n cacheKeys.add(cacheKey);\n\n if (!missed) {\n const values = this._indices.get(indexEntry[0]);\n if (!values) {\n missed = true;\n continue;\n }\n const set = values.get(indexEntry[1]);\n if (!set) {\n missed = true;\n continue;\n }\n sets.push(set);\n }\n }\n\n this._cacheDependencies.set(cacheKey, indexKeySpace);\n\n if (missed || !sets.length) {\n this._queryCache.set(cacheKey, []);\n return [];\n }\n\n // We want to do a Set intersection, but large inputs may contain a few very\n // large sets. The profiling showed that Set operations became a huge bottleneck\n // on such inputs.\n //\n // To avoid iterating over large sets multiple times, we sort the sets by size\n // and use the smallest set as the base to minimize iterations and deletions.\n sets.sort((a, b) => a.size - b.size);\n const result = new Set(sets[0]);\n for (let i = 1; i < sets.length; i++) {\n const set = sets[i]!;\n for (const symbolId of result) {\n if (!set.has(symbolId)) result.delete(symbolId);\n }\n }\n\n const symbols = Array.from(result, (symbolId) => this._values.get(symbolId)!);\n this._queryCache.set(cacheKey, symbols);\n return symbols;\n }\n\n private replaceStubs(symbol: Symbol, indexKeySpace: IndexKeySpace): void {\n for (const stubId of this._stubs.values()) {\n const stub = this._values.get(stubId);\n if (stub?.meta) {\n const stubKeySpace = this.buildIndexKeySpace(stub.meta);\n if (this.isSubset(stubKeySpace, indexKeySpace)) {\n const cacheKey = this.cacheKeyFromKeySpace(stubKeySpace);\n this._stubCache.delete(cacheKey);\n this._stubs.delete(stubId);\n stub.setCanonical(symbol);\n }\n }\n }\n }\n}\n","import path from 'node:path';\n\nimport type { IProjectMeta } from '../extensions';\nimport { FileRegistry } from '../files/registry';\nimport { defaultExtensions } from '../languages/extensions';\nimport { defaultModuleEntryNames } from '../languages/modules';\nimport { defaultNameConflictResolvers } from '../languages/resolvers';\nimport type { Extensions, ModuleEntryNames, NameConflictResolvers } from '../languages/types';\nimport { NodeRegistry } from '../nodes/registry';\nimport type { IOutput } from '../output';\nimport { Planner } from '../planner/planner';\nimport { simpleNameConflictResolver } from '../planner/resolvers';\nimport type { NameConflictResolver } from '../planner/types';\nimport type { Renderer } from '../renderer';\nimport { SymbolRegistry } from '../symbols/registry';\nimport type { IProject } from './types';\n\nexport class Project implements IProject {\n private _isPlanned = false;\n\n readonly files: FileRegistry;\n readonly meta: IProjectMeta;\n readonly nodes = new NodeRegistry();\n readonly symbols = new SymbolRegistry();\n\n readonly defaultFileName: string;\n readonly defaultNameConflictResolver: NameConflictResolver;\n readonly extensions: Extensions;\n readonly fileName?: (name: string) => string;\n readonly moduleEntryNames: ModuleEntryNames;\n readonly nameConflictResolvers: NameConflictResolvers;\n readonly renderers: ReadonlyArray<Renderer>;\n readonly root: string;\n\n constructor(\n args: Pick<\n Partial<IProject>,\n | 'defaultFileName'\n | 'defaultNameConflictResolver'\n | 'extensions'\n | 'fileName'\n | 'moduleEntryNames'\n | 'nameConflictResolvers'\n | 'renderers'\n > &\n Pick<IProject, 'root'> & { meta?: IProjectMeta },\n ) {\n this.meta = args.meta ?? {};\n const fileName = args.fileName;\n this.defaultFileName = args.defaultFileName ?? 'main';\n this.defaultNameConflictResolver =\n args.defaultNameConflictResolver ?? simpleNameConflictResolver;\n this.extensions = {\n ...defaultExtensions,\n ...args.extensions,\n };\n this.fileName = typeof fileName === 'string' ? () => fileName : fileName;\n this.files = new FileRegistry(this);\n this.moduleEntryNames = {\n ...defaultModuleEntryNames,\n ...args.moduleEntryNames,\n };\n this.nameConflictResolvers = {\n ...defaultNameConflictResolvers,\n ...args.nameConflictResolvers,\n };\n this.renderers = args.renderers ?? [];\n this.root = path.resolve(args.root).replace(/[/\\\\]+$/, '');\n }\n\n plan(): void {\n if (this._isPlanned) return;\n new Planner(this).plan();\n this._isPlanned = true;\n }\n\n render(): ReadonlyArray<IOutput> {\n if (!this._isPlanned) this.plan();\n const files: Array<IOutput> = [];\n for (const file of this.files.registered()) {\n if (!file.external && file.finalPath && file.renderer) {\n const content = file.renderer.render({ file, project: this });\n files.push({ content, path: file.finalPath });\n }\n }\n return files;\n }\n}\n","import type { StructureItem, StructureShell } from './types';\n\nexport class StructureNode {\n /** Nested nodes within this node. */\n children: Map<string, StructureNode> = new Map();\n /** Items contained in this node. */\n items: Array<StructureItem> = [];\n /** The name of this node (e.g., \"Users\", \"Accounts\"). */\n name: string;\n /** Parent node in the hierarchy. Undefined if this is the root node. */\n parent?: StructureNode;\n /** Shell claimed for this node. */\n shell?: StructureShell;\n /** Source of the claimed shell. */\n shellSource?: symbol;\n /** True if this is a virtual root. */\n virtual: boolean;\n\n constructor(\n name: string,\n parent?: StructureNode,\n options?: {\n virtual?: boolean;\n },\n ) {\n this.name = name;\n this.parent = parent;\n this.virtual = options?.virtual ?? false;\n }\n\n get isRoot(): boolean {\n return !this.parent;\n }\n\n /**\n * Gets or creates a child node.\n *\n * If the child doesn't exist, it's created automatically.\n *\n * @param name - The name of the child node\n * @returns The child node instance\n */\n child(name: string): StructureNode {\n if (!this.children.has(name)) {\n this.children.set(name, new StructureNode(name, this));\n }\n return this.children.get(name)!;\n }\n\n /**\n * Gets the full path of this node in the hierarchy.\n *\n * @returns An array of node names from the root to this node\n */\n getPath(): ReadonlyArray<string> {\n const path: Array<string> = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let cursor: StructureNode | undefined = this;\n while (cursor) {\n path.unshift(cursor.name);\n cursor = cursor.parent;\n }\n return path;\n }\n\n /**\n * Yields items from a specific source with typed data.\n *\n * @param source - The source symbol to filter by\n * @returns Generator of items from that source\n */\n *itemsFrom<T = unknown>(source: symbol): Generator<StructureItem & { data: T }> {\n for (const item of this.items) {\n if (item.source === source) {\n yield item as StructureItem & { data: T };\n }\n }\n }\n\n /**\n * Walk all nodes in the structure (depth-first, post-order).\n *\n * @returns Generator of all structure nodes\n */\n *walk(): Generator<StructureNode> {\n for (const node of this.children.values()) {\n yield* node.walk();\n }\n yield this;\n }\n}\n","import { StructureNode } from './node';\nimport type { StructureInsert } from './types';\n\nexport class StructureModel {\n /** Root nodes mapped by their names. */\n private _roots: Map<string, StructureNode> = new Map();\n /** Node for data without a specific root. */\n private _virtualRoot?: StructureNode;\n\n /**\n * Get all root nodes.\n */\n get roots(): ReadonlyArray<StructureNode> {\n const roots = Array.from(this._roots.values());\n if (this._virtualRoot) roots.unshift(this._virtualRoot);\n return roots;\n }\n\n /**\n * Insert data into the structure.\n */\n insert(args: StructureInsert): void {\n const { data, locations, source } = args;\n for (const location of locations) {\n const { path, shell } = location;\n const fullPath = path.filter((s): s is string => Boolean(s));\n const segments = fullPath.slice(0, -1);\n const name = fullPath[fullPath.length - 1];\n\n if (!name) {\n throw new Error('Cannot insert data without path.');\n }\n\n let cursor: StructureNode | null = null;\n\n for (const segment of segments) {\n if (!cursor) {\n cursor = this.root(segment);\n } else {\n cursor = cursor.child(segment);\n }\n\n if (shell && !cursor.shell) {\n cursor.shell = shell;\n cursor.shellSource = source;\n }\n }\n\n if (!cursor) {\n cursor = this.root(null);\n }\n\n cursor.items.push({ data, location: fullPath, source });\n }\n }\n\n /**\n * Gets or creates a root by name.\n *\n * If the root doesn't exist, it's created automatically.\n *\n * @param name - The name of the root\n * @returns The root instance\n */\n root(name: string | null): StructureNode {\n if (!name) {\n return (this._virtualRoot ??= new StructureNode('', undefined, {\n virtual: true,\n }));\n }\n if (!this._roots.has(name)) {\n this._roots.set(name, new StructureNode(name));\n }\n return this._roots.get(name)!;\n }\n\n /**\n * Walk all nodes in the structure (depth-first, post-order).\n *\n * @returns Generator of all structure nodes\n */\n *walk(): Generator<StructureNode> {\n if (this._virtualRoot) {\n yield* this._virtualRoot.walk();\n }\n for (const root of this._roots.values()) {\n yield* root.walk();\n }\n }\n}\n","export class Version<TVersion extends string = string> {\n private readonly _segments: ReadonlyArray<number>;\n readonly raw: TVersion;\n\n constructor(version: TVersion) {\n this.raw = version;\n this._segments = version.split('.').map((segment) => {\n const num = Number.parseInt(segment, 10);\n if (Number.isNaN(num)) {\n throw new Error(`Invalid version segment \"${segment}\" in \"${version}\"`);\n }\n return num;\n });\n }\n\n private _compare(other: TVersion | Version): number {\n const b = other instanceof Version ? other : new Version(other);\n const len = Math.max(this._segments.length, b._segments.length);\n for (let i = 0; i < len; i++) {\n const a = this._segments[i] ?? 0;\n const bSeg = b._segments[i] ?? 0;\n if (a !== bSeg) return a - bSeg;\n }\n return 0;\n }\n\n eq(other: TVersion | Version): boolean {\n return this._compare(other) === 0;\n }\n\n gt(other: TVersion | Version): boolean {\n return this._compare(other) > 0;\n }\n\n gte(other: TVersion | Version): boolean {\n return this._compare(other) >= 0;\n }\n\n lt(other: TVersion | Version): boolean {\n return this._compare(other) < 0;\n }\n\n lte(other: TVersion | Version): boolean {\n return this._compare(other) <= 0;\n }\n\n toString(): TVersion {\n return this.raw;\n }\n}\n"],"mappings":";;;;;AAAA,MAAa,YAAY;AACzB,MAAa,YAAY;AACzB,MAAa,cAAc;;;;;;;;AC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,IAAI,MAAM,MAAM,OAAO,IAAI;EAC7B;EACA,OAAO;CACT;CAEA,GAAG,OAAoC;EACrC,OAAO,KAAK,SAAS,KAAK,MAAM;CAClC;CAEA,GAAG,OAAoC;EACrC,OAAO,KAAK,SAAS,KAAK,IAAI;CAChC;CAEA,IAAI,OAAoC;EACtC,OAAO,KAAK,SAAS,KAAK,KAAK;CACjC;CAEA,GAAG,OAAoC;EACrC,OAAO,KAAK,SAAS,KAAK,IAAI;CAChC;CAEA,IAAI,OAAoC;EACtC,OAAO,KAAK,SAAS,KAAK,KAAK;CACjC;CAEA,WAAqB;EACnB,OAAO,KAAK;CACd;AACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/brands.ts","../src/config/interactive.ts","../src/config/merge.ts","../src/config/load.ts","../src/log.ts","../src/files/file.ts","../src/guards.ts","../src/languages/extensions.ts","../src/languages/modules.ts","../src/planner/resolvers.ts","../src/languages/resolvers.ts","../src/logger.ts","../src/files/registry.ts","../src/refs/refs.ts","../src/nodes/registry.ts","../src/project/namespace.ts","../src/planner/scope.ts","../src/planner/analyzer.ts","../src/planner/planner.ts","../src/symbols/symbol.ts","../src/symbols/registry.ts","../src/project/project.ts","../src/structure/node.ts","../src/structure/model.ts","../src/version.ts"],"sourcesContent":["export const fileBrand = 'heyapi.file';\nexport const nodeBrand = 'heyapi.node';\nexport const symbolBrand = 'heyapi.symbol';\n","/**\n * Detect if the current session is interactive based on TTY status and environment variables.\n * This is used as a fallback when the user doesn't explicitly set the interactive option.\n * @internal\n */\nexport function detectInteractiveSession(): boolean {\n return Boolean(\n process.stdin.isTTY &&\n process.stdout.isTTY &&\n !process.env.CI &&\n !process.env.NO_INTERACTIVE &&\n !process.env.NO_INTERACTION,\n );\n}\n","import type { AnyObject } from '@hey-api/types';\n\nfunction isPlainObject(value: unknown): value is AnyObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport function mergeConfigs<T extends AnyObject>(\n configA: T | undefined,\n configB: T | undefined,\n): T {\n const a = (configA || {}) as AnyObject;\n const b = (configB || {}) as AnyObject;\n\n const result: AnyObject = { ...a };\n\n for (const key of Object.keys(b)) {\n const valueA = a[key];\n const valueB = b[key];\n\n if (isPlainObject(valueA) && isPlainObject(valueB)) {\n result[key] = mergeConfigs(valueA, valueB);\n } else {\n result[key] = valueB;\n }\n }\n\n return result as T;\n}\n","import type { AnyObject, MaybeArray } from '@hey-api/types';\nimport { loadConfig } from 'c12';\n\nimport type { Logger } from '../logger';\nimport { mergeConfigs } from './merge';\n\nexport async function loadConfigFile<T extends AnyObject>({\n configFile,\n logger,\n name,\n userConfig,\n}: {\n configFile: string | undefined;\n logger: Logger;\n name: string;\n userConfig: T;\n}): Promise<{\n configFile: string | undefined;\n configs: ReadonlyArray<T>;\n foundConfig: boolean;\n}> {\n const eventC12 = logger.timeEvent('c12');\n const { config: fileConfig, configFile: loadedConfigFile } = await loadConfig<MaybeArray<T>>({\n configFile,\n name,\n });\n eventC12.timeEnd();\n\n const fileConfigs = fileConfig instanceof Array ? fileConfig : [fileConfig];\n const mergedConfigs = fileConfigs.map((config) => mergeConfigs<T>(config, userConfig));\n const foundConfig = fileConfigs.some((config) => Object.keys(config).length);\n\n return { configFile: loadedConfigFile, configs: mergedConfigs, foundConfig };\n}\n","import type { MaybeArray, MaybeFunc } from '@hey-api/types';\nimport colors from 'ansi-colors';\n// @ts-expect-error\nimport colorSupport from 'color-support';\n\ncolors.enabled = colorSupport().hasBasic;\n\nconst DEBUG_NAMESPACE = 'heyapi';\n\nconst NO_WARNINGS = /^(1|true|yes|on)$/i.test(process.env.HEYAPI_DISABLE_WARNINGS ?? '');\n\nconst DebugGroups = {\n analyzer: colors.greenBright,\n dsl: colors.cyanBright,\n file: colors.yellowBright,\n registry: colors.blueBright,\n symbol: colors.magentaBright,\n} as const;\n\nconst WarnGroups = {\n deprecated: colors.magentaBright,\n} as const;\n\nlet cachedDebugGroups: Set<string> | undefined;\nfunction getDebugGroups(): Set<string> {\n if (cachedDebugGroups) return cachedDebugGroups;\n\n const value = process.env.DEBUG;\n cachedDebugGroups = new Set(value ? value.split(',').map((x) => x.trim().toLowerCase()) : []);\n\n return cachedDebugGroups;\n}\n\n/**\n * Tracks which deprecations have been shown to avoid spam.\n */\nconst shownDeprecations = new Set<string>();\n\nfunction debug(message: string, group: keyof typeof DebugGroups) {\n const groups = getDebugGroups();\n if (\n !(\n groups.has('*') ||\n groups.has(`${DEBUG_NAMESPACE}:*`) ||\n groups.has(`${DEBUG_NAMESPACE}:${group}`) ||\n groups.has(group)\n )\n ) {\n return;\n }\n\n const color = DebugGroups[group] ?? colors.whiteBright;\n const prefix = color(`${DEBUG_NAMESPACE}:${group}`);\n\n console.debug(`${prefix} ${message}`);\n}\n\nfunction warn(message: string, group?: keyof typeof WarnGroups) {\n if (NO_WARNINGS) return;\n\n const color = group ? WarnGroups[group] : colors.yellowBright;\n\n console.warn(color(`${message}`));\n}\n\nfunction warnDeprecated({\n context,\n field,\n replacement,\n}: {\n context?: string;\n field: string;\n replacement?: MaybeFunc<(field: string) => MaybeArray<string>>;\n}) {\n const key = context\n ? `${context}:${field}:${JSON.stringify(replacement)}`\n : `${field}:${JSON.stringify(replacement)}`;\n\n if (shownDeprecations.has(key)) return;\n shownDeprecations.add(key);\n\n let message = `\\`${field}\\` is deprecated.`;\n\n if (replacement) {\n const reps = typeof replacement === 'function' ? replacement(field) : replacement;\n const repArray = reps instanceof Array ? reps : [reps];\n const repString = repArray.map((r) => `\\`${r}\\``).join(' or ');\n message += ` Use ${repString} instead.`;\n }\n\n const prefix = context ? `[${context}] ` : '';\n warn(`${prefix}${message}`, 'deprecated');\n}\n\nexport const log = {\n debug,\n warn,\n warnDeprecated,\n};\n","import path from 'node:path';\n\nimport type { ExportModule, ImportModule } from '../bindings';\nimport { fileBrand } from '../brands';\nimport type { Language } from '../languages/types';\nimport { log } from '../log';\nimport type { INode } from '../nodes/node';\nimport type { NameScopes } from '../planner/scope';\nimport type { IProject } from '../project/types';\nimport type { Renderer } from '../renderer';\nimport type { IFileIn } from './types';\n\nexport class File<Node extends INode = INode> {\n /**\n * Exports from this file.\n */\n private _exports: Array<ExportModule> = [];\n /**\n * File extension (e.g., `.ts`).\n */\n private _extension?: string;\n /**\n * Actual emitted file path, including extension and directories.\n */\n private _finalPath?: string;\n /**\n * Imports to this file.\n */\n private _imports: Array<ImportModule> = [];\n /**\n * Language of the file.\n */\n private _language?: Language;\n /**\n * Logical, extension-free path used for planning and routing.\n */\n private _logicalFilePath: string;\n /**\n * Base name of the file (without extension).\n */\n private _name?: string;\n /**\n * Syntax nodes contained in this file.\n */\n private _nodes: Array<Node> = [];\n /**\n * Renderer assigned to this file.\n */\n private _renderer?: Renderer;\n\n /** Brand used for identifying files. */\n readonly '~brand' = fileBrand;\n /** All names defined in this file, including local scopes. */\n allNames: NameScopes = new Map();\n /** Whether this file is external to the project. */\n external: boolean;\n /** Unique identifier for the file. */\n readonly id: number;\n /** The project this file belongs to. */\n readonly project: IProject;\n /** Names declared at the top level of the file. */\n topLevelNames: NameScopes = new Map();\n\n constructor(input: IFileIn, id: number, project: IProject) {\n this.external = input.external ?? false;\n this.id = id;\n if (input.language !== undefined) this._language = input.language;\n this._logicalFilePath = input.logicalFilePath.split(path.sep).join('/');\n if (input.name !== undefined) this._name = input.name;\n this.project = project;\n }\n\n /**\n * Exports from this file.\n */\n get exports(): ReadonlyArray<ExportModule> {\n return [...this._exports];\n }\n\n /**\n * Read-only accessor for the file extension.\n */\n get extension(): string | undefined {\n if (this.external) return;\n if (this._extension) return this._extension;\n const language = this.language;\n const extension = language ? this.project.extensions[language] : undefined;\n if (extension && extension[0]) return extension[0];\n return;\n }\n\n /**\n * Read-only accessor for the final emitted path.\n *\n * If undefined, the file has not yet been assigned a final path\n * or is external to the project and should not be emitted.\n */\n get finalPath(): string | undefined {\n if (this._finalPath) return this._finalPath;\n const dirs = this._logicalFilePath ? this._logicalFilePath.split('/').slice(0, -1) : [];\n return [...dirs, `${this.name}${this.extension ?? ''}`].join('/');\n }\n\n /**\n * Imports to this file.\n */\n get imports(): ReadonlyArray<ImportModule> {\n return [...this._imports];\n }\n\n /**\n * Language of the file; inferred from nodes or fallback if not set explicitly.\n */\n get language(): Language | undefined {\n if (this._language) return this._language;\n if (this._nodes[0]) return this._nodes[0].language;\n return;\n }\n\n /**\n * Logical, extension-free path used for planning and routing.\n */\n get logicalFilePath(): string {\n return this._logicalFilePath;\n }\n\n /**\n * Base name of the file (without extension).\n *\n * If no name was set explicitly, it is inferred from the logical file path.\n */\n get name(): string {\n if (this._name) return this._name;\n const name = this._logicalFilePath.split('/').pop();\n if (name) return name;\n const message = `File ${this.toString()} has no name`;\n log.debug(message, 'file');\n throw new Error(message);\n }\n\n /**\n * Syntax nodes contained in this file.\n */\n get nodes(): ReadonlyArray<Node> {\n return [...this._nodes];\n }\n\n /**\n * Renderer assigned to this file.\n */\n get renderer(): Renderer | undefined {\n return this._renderer;\n }\n\n /**\n * Add an export group to the file.\n */\n addExport(group: ExportModule): void {\n this._exports.push(group);\n }\n\n /**\n * Add an import group to the file.\n */\n addImport(group: ImportModule): void {\n this._imports.push(group);\n }\n\n /**\n * Add a syntax node to the file.\n */\n addNode(node: Node): void {\n this._nodes.push(node);\n node.file = this;\n }\n\n /**\n * Sets the file extension.\n */\n setExtension(extension: string): void {\n this._extension = extension;\n }\n\n /**\n * Sets the final emitted path of the file.\n */\n setFinalPath(path: string): void {\n this._finalPath = path;\n }\n\n /**\n * Sets the language of the file.\n */\n setLanguage(lang: Language): void {\n this._language = lang;\n }\n\n /**\n * Sets the name of the file.\n */\n setName(name: string): void {\n this._name = name;\n }\n\n /**\n * Sets the renderer assigned to this file.\n */\n setRenderer(renderer: Renderer): void {\n this._renderer = renderer;\n }\n\n /**\n * Returns a debug‑friendly string representation identifying the file.\n */\n toString(): string {\n const finalPath = this._finalPath ? ` → ${this._finalPath}` : '';\n const status = `${this._finalPath ? '✓' : '~'} `;\n return `${status}File#${this.id} ${this._logicalFilePath}${finalPath}`;\n }\n}\n","import { nodeBrand, symbolBrand } from './brands';\nimport type { INode } from './nodes/node';\nimport type { Ref } from './refs/types';\nimport type { Symbol } from './symbols/symbol';\n\nexport function isBrand(value: unknown, brand: string): value is INode {\n if (!value || typeof value !== 'object') return false;\n return (value as any)['~brand'] === brand;\n}\n\nexport function isNode(value: unknown): value is INode {\n if (!value || typeof value !== 'object') return false;\n return isBrand(value, nodeBrand);\n}\n\nexport function isNodeRef(value: Ref<unknown>): value is Ref<INode> {\n return isBrand(value['~ref'], nodeBrand);\n}\n\nexport function isSymbol(value: unknown): value is Symbol {\n return isBrand(value, symbolBrand);\n}\n\nexport function isSymbolRef(value: Ref<unknown>): value is Ref<Symbol> {\n return isBrand(value['~ref'], symbolBrand);\n}\n","import type { Extensions } from './types';\n\nexport const defaultExtensions: Extensions = {\n c: ['.c'],\n 'c#': ['.cs'],\n 'c++': ['.cpp', '.hpp'],\n css: ['.css'],\n dart: ['.dart'],\n go: ['.go'],\n haskell: ['.hs'],\n html: ['.html'],\n java: ['.java'],\n javascript: ['.js', '.jsx'],\n json: ['.json'],\n kotlin: ['.kt'],\n lua: ['.lua'],\n markdown: ['.md'],\n matlab: ['.m'],\n perl: ['.pl'],\n php: ['.php'],\n python: ['.py'],\n r: ['.r'],\n ruby: ['.rb'],\n rust: ['.rs'],\n scala: ['.scala'],\n shell: ['.sh'],\n sql: ['.sql'],\n swift: ['.swift'],\n typescript: ['.ts', '.tsx'],\n yaml: ['.yaml', '.yml'],\n};\n","import type { ModuleEntryNames } from './types';\n\nexport const defaultModuleEntryNames: ModuleEntryNames = {\n javascript: 'index',\n python: '__init__',\n typescript: 'index',\n};\n","import type { NameConflictResolver } from './types';\n\nexport const pythonNameConflictResolver: NameConflictResolver = ({ attempt, baseName }) =>\n attempt === 1 ? `${baseName}_` : `${baseName}_${attempt}`;\n\nexport const simpleNameConflictResolver: NameConflictResolver = ({ attempt, baseName }) =>\n `${baseName}${attempt + 1}`;\n\nexport const underscoreNameConflictResolver: NameConflictResolver = ({ attempt, baseName }) =>\n `${baseName}_${attempt + 1}`;\n","import { pythonNameConflictResolver, underscoreNameConflictResolver } from '../planner/resolvers';\nimport type { NameConflictResolvers } from './types';\n\nexport const defaultNameConflictResolvers: NameConflictResolvers = {\n php: underscoreNameConflictResolver,\n python: pythonNameConflictResolver,\n ruby: underscoreNameConflictResolver,\n};\n","import colors from 'ansi-colors';\n\ninterface LoggerEvent {\n end?: PerformanceMark;\n events: Array<LoggerEvent>;\n id: string; // unique internal key\n name: string;\n start: PerformanceMark;\n}\n\ninterface Severity {\n color: colors.StyleFunction;\n type: 'duration' | 'percentage';\n}\n\ninterface StoredEventResult {\n position: ReadonlyArray<number>;\n}\n\nlet loggerCounter = 0;\nconst nameToId = (name: string) => `${name}-${loggerCounter++}`;\nconst idEnd = (id: string) => `${id}-end`;\nconst idLength = (id: string) => `${id}-length`;\nconst idStart = (id: string) => `${id}-start`;\n\nconst getSeverity = (duration: number, percentage: number): Severity | undefined => {\n if (duration > 200) {\n return {\n color: colors.red,\n type: 'duration',\n };\n }\n if (percentage > 30) {\n return {\n color: colors.red,\n type: 'percentage',\n };\n }\n if (duration > 50) {\n return {\n color: colors.yellow,\n type: 'duration',\n };\n }\n if (percentage > 10) {\n return {\n color: colors.yellow,\n type: 'percentage',\n };\n }\n return;\n};\n\nexport class Logger {\n private events: Array<LoggerEvent> = [];\n\n private end(result: StoredEventResult): void {\n let event: LoggerEvent | undefined;\n let events = this.events;\n for (const index of result.position) {\n event = events[index];\n if (event?.events) {\n events = event.events;\n }\n }\n if (event && !event.end) {\n event.end = performance.mark(idEnd(event.id));\n }\n }\n\n /**\n * Recursively end all unended events in the event tree.\n * This ensures all events have end marks before measuring.\n */\n private endAllEvents(events: Array<LoggerEvent>): void {\n for (const event of events) {\n if (!event.end) {\n event.end = performance.mark(idEnd(event.id));\n }\n if (event.events.length) {\n this.endAllEvents(event.events);\n }\n }\n }\n\n report(print: boolean = true): PerformanceMeasure | undefined {\n const firstEvent = this.events[0];\n if (!firstEvent) return;\n\n // Ensure all events are ended before reporting\n this.endAllEvents(this.events);\n\n const lastEvent = this.events[this.events.length - 1]!;\n const name = 'root';\n const id = nameToId(name);\n\n try {\n const measure = performance.measure(\n idLength(id),\n idStart(firstEvent.id),\n idEnd(lastEvent.id),\n );\n if (print) {\n this.reportEvent({\n end: lastEvent.end,\n events: this.events,\n id,\n indent: 0,\n measure,\n name,\n start: firstEvent!.start,\n });\n }\n return measure;\n } catch {\n // If measuring fails (e.g., marks don't exist), silently skip reporting\n // to avoid crashing the application\n return;\n }\n }\n\n private reportEvent({\n indent,\n ...parent\n }: LoggerEvent & {\n indent: number;\n measure: PerformanceMeasure;\n }): void {\n const color = !indent ? colors.cyan : colors.gray;\n const lastIndex = parent.events.length - 1;\n\n parent.events.forEach((event, index) => {\n try {\n const measure = performance.measure(idLength(event.id), idStart(event.id), idEnd(event.id));\n const duration = Math.ceil(measure.duration * 100) / 100;\n const percentage =\n Math.ceil((measure.duration / parent.measure.duration) * 100 * 100) / 100;\n const severity = indent ? getSeverity(duration, percentage) : undefined;\n\n let durationLabel = `${duration.toFixed(2).padStart(8)}ms`;\n if (severity?.type === 'duration') {\n durationLabel = severity.color(durationLabel);\n }\n\n const branch = index === lastIndex ? '└─ ' : '├─ ';\n const prefix = !indent ? '' : '│ '.repeat(indent - 1) + branch;\n const maxLength = 38 - prefix.length;\n\n const percentageBranch = !indent ? '' : '↳ ';\n const percentagePrefix = indent ? ' '.repeat(indent - 1) + percentageBranch : '';\n let percentageLabel = `${percentagePrefix}${percentage.toFixed(2)}%`;\n if (severity?.type === 'percentage') {\n percentageLabel = severity.color(percentageLabel);\n }\n const jobPrefix = colors.gray('[root] ');\n console.log(\n `${jobPrefix}${colors.gray(prefix)}${color(\n `${event.name.padEnd(maxLength)} ${durationLabel} (${percentageLabel})`,\n )}`,\n );\n this.reportEvent({ ...event, indent: indent + 1, measure });\n } catch {\n // If measuring fails (e.g., marks don't exist), silently skip this event\n // to avoid crashing the application\n }\n });\n }\n\n private start(id: string): PerformanceMark {\n return performance.mark(idStart(id));\n }\n\n private storeEvent({\n result,\n ...event\n }: Pick<LoggerEvent, 'events' | 'id' | 'name' | 'start'> & {\n result: StoredEventResult;\n }): void {\n const lastEventIndex = event.events.length - 1;\n const lastEvent = event.events[lastEventIndex];\n if (lastEvent && !lastEvent.end) {\n result.position = [...result.position, lastEventIndex];\n this.storeEvent({ ...event, events: lastEvent.events, result });\n return;\n }\n const length = event.events.push({ ...event, events: [] });\n result.position = [...result.position, length - 1];\n }\n\n timeEvent(name: string) {\n const id = nameToId(name);\n const start = this.start(id);\n const event: LoggerEvent = {\n events: this.events,\n id,\n name,\n start,\n };\n const result: StoredEventResult = {\n position: [],\n };\n this.storeEvent({ ...event, result });\n return {\n mark: start,\n timeEnd: () => this.end(result),\n };\n }\n}\n","import path from 'node:path';\n\nimport type { IProject } from '../project/types';\nimport { File } from './file';\nimport type { FileKeyArgs, IFileIn, IFileRegistry } from './types';\n\ntype FileId = number;\ntype FileKey = string;\n\nexport class FileRegistry implements IFileRegistry {\n private _id: FileId = 0;\n private _values: Map<FileKey, File> = new Map();\n private readonly project: IProject;\n\n constructor(project: IProject) {\n this.project = project;\n }\n\n get(args: FileKeyArgs): File | undefined {\n return this._values.get(this.createFileKey(args));\n }\n\n isRegistered(args: FileKeyArgs): boolean {\n return this._values.has(this.createFileKey(args));\n }\n\n get nextId(): FileId {\n return this._id++;\n }\n\n register(file: IFileIn): File {\n const key = this.createFileKey(file);\n\n let result = this._values.get(key);\n if (result) {\n if (file.name) {\n result.setName(file.name);\n }\n } else {\n result = new File(file, this.nextId, this.project);\n }\n\n this._values.set(key, result);\n\n return result;\n }\n\n *registered(): IterableIterator<File> {\n for (const file of this._values.values()) {\n yield file;\n }\n }\n\n private createFileKey(args: FileKeyArgs): string {\n const logicalPath = args.logicalFilePath.split(path.sep).join('/');\n return `${args.external ? 'ext:' : ''}${logicalPath}${args.language ? `:${args.language}` : ''}`;\n }\n}\n","import type { FromRef, FromRefs, Ref, Refs } from './types';\n\n/**\n * Wraps a single value in a Ref object.\n *\n * If the value is already a Ref, returns it as-is (idempotent).\n *\n * @example\n * ```ts\n * const r = ref(123); // { '~ref': 123 }\n * console.log(r['~ref']); // 123\n *\n * const r2 = ref(r); // { '~ref': 123 } (not double-wrapped)\n * ```\n */\nexport const ref = <T>(value: T): Ref<T> => {\n if (isRef(value)) {\n return value as Ref<T>;\n }\n return { '~ref': value } as Ref<T>;\n};\n\n/**\n * Converts a plain object to an object of Refs (deep, per property).\n *\n * @example\n * ```ts\n * const obj = { a: 1, b: \"x\" };\n * const refs = refs(obj); // { a: { '~ref': 1 }, b: { '~ref': \"x\" } }\n * ```\n */\nexport const refs = <T extends Record<string, unknown>>(obj: T): Refs<T> => {\n const result = {} as Refs<T>;\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n result[key] = ref(obj[key]);\n }\n }\n return result;\n};\n\n/**\n * Unwraps a single Ref object to its value.\n *\n * @example\n * ```ts\n * const r = { '~ref': 42 };\n * const n = fromRef(r); // 42\n * console.log(n); // 42\n * ```\n */\nexport const fromRef = <T extends Ref<unknown> | undefined>(ref: T): FromRef<T> =>\n ref?.['~ref'] as FromRef<T>;\n\n/**\n * Converts an object of Refs back to a plain object (unwraps all refs).\n *\n * @example\n * ```ts\n * const refs = { a: { '~ref': 1 }, b: { '~ref': \"x\" } };\n * const plain = fromRefs(refs); // { a: 1, b: \"x\" }\n * ```\n */\nexport const fromRefs = <T extends Refs<Record<string, unknown>>>(obj: T): FromRefs<T> => {\n const result = {} as FromRefs<T>;\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n result[key] = fromRef(obj[key]!) as (typeof result)[typeof key];\n }\n }\n return result;\n};\n\n/**\n * Checks whether a value is a Ref object.\n *\n * @param value Value to check\n * @returns True if the value is a Ref object.\n */\nexport const isRef = <T>(value: unknown): value is Ref<T> =>\n typeof value === 'object' && value !== null && '~ref' in value;\n","import { fromRef, ref } from '../refs/refs';\nimport type { Ref } from '../refs/types';\nimport type { INode } from './node';\nimport type { INodeRegistry } from './types';\n\nexport class NodeRegistry implements INodeRegistry {\n private list: Array<Ref<INode | null>> = [];\n\n add(node: INode | null): number {\n const index = this.list.push(ref(node));\n return index - 1;\n }\n\n *all(): Iterable<INode> {\n for (const r of this.list) {\n const node = fromRef(r);\n if (node) yield node;\n }\n }\n\n remove(index: number): void {\n this.list[index] = ref(null);\n }\n\n update(index: number, node: INode | null): void {\n this.list[index] = ref(node);\n }\n}\n","import type { Language } from '../languages/types';\nimport type { SymbolKind } from '../symbols/types';\n\nconst typescriptMergeKindRank: Record<SymbolKind, number> = {\n class: 3,\n enum: 4,\n function: 5,\n interface: 1,\n namespace: 0,\n type: 2,\n var: 6,\n};\n\n/**\n * Returns true if two declarations of given kinds\n * are allowed to share the same identifier in TypeScript.\n */\nfunction canTypeScriptDeclarationsShareIdentifier(a: SymbolKind, b: SymbolKind): boolean {\n // sort based on TypeScript merge precedence so `a` is always the weaker merge candidate\n // ensures that asymmetric merges like `type + var` are correctly handled\n if (typescriptMergeKindRank[a] > typescriptMergeKindRank[b]) {\n [a, b] = [b, a];\n }\n\n switch (a) {\n case 'interface':\n return b === 'class' || b === 'interface';\n case 'namespace':\n return b === 'class' || b === 'enum' || b === 'function' || b === 'namespace';\n case 'type':\n // type can only merge with value-only declarations\n return b === 'function' || b === 'var';\n default:\n return false;\n }\n}\n\nexport function canDeclarationsShareIdentifier(\n language: Language | undefined,\n a: SymbolKind,\n b: SymbolKind,\n): boolean {\n if (language === 'typescript') {\n return canTypeScriptDeclarationsShareIdentifier(a, b);\n }\n\n return false;\n}\n","import type { Ref } from '../refs/types';\nimport type { Symbol } from '../symbols/symbol';\nimport type { SymbolKind } from '../symbols/types';\n\nexport type NameScopes = Map<string, Set<SymbolKind>>;\n\nexport type Scope = {\n /** Soft conflicts, inherited names from children symbols. */\n childNames: NameScopes;\n /** Child scopes. */\n children: Array<Scope>;\n /** Hard conflicts, declared names in this scope. */\n localNames: NameScopes;\n /** Parent scope, if any. */\n parent?: Scope;\n /** Symbols registered in this scope. */\n symbols: Array<Ref<Symbol>>;\n};\n\nexport type AssignOptions = {\n /** The primary scope in which to assign a symbol's final name. */\n scope: Scope;\n /** Additional scopes to update as side effects when assigning a symbol's final name. */\n scopesToUpdate: ReadonlyArray<Scope>;\n};\n\nexport function createScope(\n args: Pick<Partial<Scope>, 'childNames' | 'localNames' | 'parent'> = {},\n): Scope {\n return {\n childNames: args.childNames || new Map(),\n children: [],\n localNames: args.localNames || new Map(),\n parent: args.parent,\n symbols: [],\n };\n}\n\nexport function registerName(scope: Scope, name: string, kind: SymbolKind): void {\n const kinds = scope.localNames.get(name) ?? new Set();\n kinds.add(kind);\n scope.localNames.set(name, kinds);\n}\n\nexport function registerChildName(scope: Scope, name: string, kind: SymbolKind): void {\n const kinds = scope.childNames.get(name) ?? new Set();\n kinds.add(kind);\n scope.childNames.set(name, kinds);\n}\n","import type { IProjectMeta } from '../extensions';\nimport { isNodeRef, isSymbolRef } from '../guards';\nimport type { INode, NodeRelationship } from '../nodes/node';\nimport { fromRef, isRef, ref } from '../refs/refs';\nimport type { Ref } from '../refs/types';\nimport type { Symbol } from '../symbols/symbol';\nimport type { NameScopes, Scope } from './scope';\nimport { createScope, registerChildName } from './scope';\nimport type { IAnalysisContext, Input } from './types';\n\nexport class AnalysisContext implements IAnalysisContext {\n /** Arbitrary project metadata. */\n private meta: IProjectMeta;\n /**\n * Stack of parent nodes during analysis.\n *\n * The top of the stack is the current semantic container.\n */\n private parentStack: Array<INode> = [];\n\n scope: Scope;\n scopes: Scope = createScope();\n symbol?: Symbol;\n\n constructor(node: INode, meta: IProjectMeta) {\n this.parentStack.push(node);\n this.meta = meta;\n this.scope = this.scopes;\n this.symbol = node.symbol;\n }\n\n /**\n * Get the current semantic parent (top of stack).\n */\n get currentParent(): INode | undefined {\n return this.parentStack[this.parentStack.length - 1];\n }\n\n /**\n * Register a child node under the current parent.\n */\n addChild(child: INode, relationship: NodeRelationship = 'container'): void {\n const parent = this.currentParent;\n if (!parent) return;\n\n if (!parent.structuralChildren) {\n parent.structuralChildren = new Map();\n }\n parent.structuralChildren.set(child, relationship);\n\n if (!child.structuralParents) {\n child.structuralParents = new Map();\n }\n child.structuralParents.set(parent, relationship);\n }\n\n addDependency(symbol: Ref<Symbol>): void {\n if (this.symbol !== fromRef(symbol)) {\n this.scope.symbols.push(symbol);\n }\n }\n\n analyze(input: Input): void {\n const value = isRef(input) ? input : ref(input);\n if (isSymbolRef(value)) {\n const symbol = fromRef(value);\n // avoid adding self as child\n if (symbol.node && this.currentParent !== symbol.node) {\n this.addChild(symbol.node, 'reference');\n }\n this.addDependency(value);\n } else if (isNodeRef(value)) {\n const node = fromRef(value);\n this.addChild(node, 'container');\n this.pushParent(node);\n node.meta = this.meta[node.language] ?? {};\n node.analyze(this);\n this.popParent();\n }\n }\n\n injectChildren(input: Input): void {\n const value = isRef(input) ? input : ref(input);\n const symbol = isSymbolRef(value) ? fromRef(value) : undefined;\n if (!symbol) return;\n\n for (const child of symbol.children) {\n if (!child.overridable) {\n registerChildName(this.scope, child.name, child.kind);\n }\n }\n }\n\n localNames(scope: Scope): NameScopes {\n const names: NameScopes = new Map();\n for (const [name, kinds] of scope.localNames) {\n names.set(name, new Set(kinds));\n }\n if (scope.parent) {\n const parentNames = this.localNames(scope.parent);\n for (const [name, kinds] of parentNames) {\n if (!names.has(name)) {\n names.set(name, kinds);\n } else {\n const existingKinds = names.get(name)!;\n for (const kind of kinds) {\n existingKinds.add(kind);\n }\n }\n }\n }\n return names;\n }\n\n /**\n * Pop the current semantic parent.\n * Call this when exiting a container node.\n */\n popParent(): void {\n this.parentStack.pop();\n }\n\n popScope(): void {\n this.scope = this.scope.parent ?? this.scope;\n }\n\n /**\n * Push a node as the current semantic parent.\n */\n pushParent(node: INode): void {\n this.parentStack.push(node);\n }\n\n pushScope(): void {\n const scope = createScope({ parent: this.scope });\n this.scope.children.push(scope);\n this.scope = scope;\n }\n\n walkScopes(\n callback: (symbol: Ref<Symbol>, scope: Scope) => void,\n scope: Scope = this.scopes,\n ): void {\n this.scope = scope;\n for (const symbol of scope.symbols) {\n callback(symbol, scope);\n }\n for (const child of scope.children) {\n scope = child;\n this.walkScopes(callback, scope);\n }\n this.scope = this.scopes;\n }\n}\n\nexport class Analyzer {\n private readonly meta: IProjectMeta;\n private nodeCache = new WeakMap<INode, AnalysisContext>();\n\n constructor(meta: IProjectMeta) {\n this.meta = meta;\n }\n\n analyzeNode(node: INode): AnalysisContext {\n const cached = this.nodeCache.get(node);\n if (cached) return cached;\n\n node.root = true;\n node.meta = this.meta[node.language] ?? {};\n const ctx = new AnalysisContext(node, this.meta);\n node.analyze(ctx);\n\n this.nodeCache.set(node, ctx);\n return ctx;\n }\n\n analyze(nodes: Iterable<INode>, callback?: (ctx: AnalysisContext, node: INode) => void): void {\n for (const node of nodes) {\n const ctx = this.analyzeNode(node);\n callback?.(ctx, node);\n }\n }\n}\n","import path from 'node:path';\n\nimport type { ExportModule, ImportModule } from '../bindings';\nimport type { File } from '../files/file';\nimport type { INode } from '../nodes/node';\nimport { canDeclarationsShareIdentifier } from '../project/namespace';\nimport type { IProject } from '../project/types';\nimport { fromRef } from '../refs/refs';\nimport type { RenderContext } from '../renderer';\nimport type { Symbol } from '../symbols/symbol';\nimport type { SymbolKind } from '../symbols/types';\nimport type { AnalysisContext } from './analyzer';\nimport { Analyzer } from './analyzer';\nimport type { AssignOptions, Scope } from './scope';\nimport { createScope, registerName } from './scope';\n\nconst isTypeOnlyKind = (kind: SymbolKind) => kind === 'type' || kind === 'interface';\n\nexport class Planner {\n private static readonly MAX_ALLOCATION_ROUNDS = 100;\n\n private readonly analyzer: Analyzer;\n private readonly cacheResolvedNames = new Set<number>();\n private readonly project: IProject;\n\n constructor(project: IProject) {\n this.analyzer = new Analyzer(project.meta);\n this.project = project;\n }\n\n /**\n * Executes the planning phase for the project.\n */\n plan() {\n this.cacheResolvedNames.clear();\n\n let rounds = 0;\n while (this.allocateFiles()) {\n this.assignLocalNames();\n if (++rounds > Planner.MAX_ALLOCATION_ROUNDS) {\n throw new Error(\n `File allocation failed to converge after ${Planner.MAX_ALLOCATION_ROUNDS} rounds`,\n );\n }\n }\n\n this.resolveFilePaths();\n this.planExports();\n this.planImports();\n }\n\n /**\n * Creates and assigns a file to every node, re-export,\n * and external dependency.\n */\n private allocateFiles(): number {\n let allocated = 0;\n this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => {\n const symbol = node.symbol;\n if (!symbol) return;\n\n if (!symbol.file) {\n const file = this.project.files.register({\n external: false,\n language: node.language,\n logicalFilePath: symbol.getFilePath?.(symbol) || this.project.defaultFileName,\n });\n file.addNode(node);\n symbol.setFile(file);\n allocated++;\n for (const logicalFilePath of symbol.getExportFromFilePath?.(symbol) ?? []) {\n this.project.files.register({\n external: false,\n language: file.language,\n logicalFilePath,\n });\n }\n }\n\n ctx.walkScopes((dependency) => {\n const dep = fromRef(dependency);\n if (dep.external && dep.isCanonical && !dep.file) {\n const file = this.project.files.register({\n external: true,\n language: dep.node?.language,\n logicalFilePath: dep.external,\n });\n dep.setFile(file);\n allocated++;\n }\n });\n });\n return allocated;\n }\n\n /**\n * Assigns final names to all symbols.\n *\n * First assigns top-level (file-scoped) symbol names, then local symbols.\n */\n private assignLocalNames(): void {\n this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => {\n const symbol = node.symbol;\n if (!symbol) return;\n this.assignTopLevelName({ ctx, node, symbol });\n });\n\n this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => {\n const file = node.file;\n if (!file) return;\n ctx.walkScopes((dependency) => {\n const dep = fromRef(dependency);\n // top-level or external symbol\n if (dep.file || dep.external) return;\n // TODO: pass node\n this.assignLocalName({\n ctx,\n file,\n scopesToUpdate: [createScope({ localNames: file.allNames })],\n symbol: dep,\n });\n });\n });\n }\n\n /**\n * Resolves and sets final file paths for all non-external files. Attaches renderers.\n *\n * Uses the project's fileName function if provided, otherwise uses the file's current name.\n *\n * Resolves final paths relative to the project's root directory.\n */\n private resolveFilePaths(): void {\n for (const file of this.project.files.registered()) {\n if (file.external) {\n file.setFinalPath(file.logicalFilePath);\n continue;\n }\n const finalName = this.project.fileName?.(file.name) || file.name;\n file.setName(finalName);\n const finalPath = file.finalPath;\n if (finalPath) {\n file.setFinalPath(path.resolve(this.project.root, finalPath));\n }\n const ctx: RenderContext = { file, project: this.project };\n const renderer = this.project.renderers.find((r) => r.supports(ctx));\n if (renderer) file.setRenderer(renderer);\n }\n }\n\n /**\n * Plans exports by analyzing all exported symbols.\n *\n * Registers re-export targets as files and creates new exported symbols for them.\n *\n * Assigns names to re-exported symbols and collects re-export metadata,\n * distinguishing type-only exports based on symbol kinds.\n */\n private planExports(): void {\n const seenByFile = new Map<File, Map<string, { kinds: Set<SymbolKind>; symbol: Symbol }>>();\n const sourceFile = new Map<number, File>();\n\n this.analyzer.analyze(this.project.nodes.all(), (ctx, node) => {\n if (!node.exported) return;\n\n const symbol = node.symbol;\n if (!symbol) return;\n\n const file = node.file;\n if (!file) return;\n\n for (const logicalFilePath of symbol.getExportFromFilePath?.(symbol) ?? []) {\n const target = this.project.files.register({\n external: false,\n language: node.language,\n logicalFilePath,\n });\n if (target.id === file.id) continue;\n\n let fileMap = seenByFile.get(target);\n if (!fileMap) {\n fileMap = new Map();\n seenByFile.set(target, fileMap);\n }\n\n const exp = this.project.symbols.register({\n exported: true,\n external: symbol.external,\n importKind: symbol.importKind,\n kind: symbol.kind,\n name: symbol.finalName,\n });\n exp.setFile(target);\n sourceFile.set(exp.id, file);\n // TODO: pass node\n this.assignTopLevelName({ ctx, symbol: exp });\n\n let entry = fileMap.get(exp.finalName);\n if (!entry) {\n entry = { kinds: new Set(), symbol: exp };\n fileMap.set(exp.finalName, entry);\n }\n entry.kinds.add(exp.kind);\n }\n });\n\n for (const [file, fileMap] of seenByFile) {\n const exports = new Map<File, ExportModule>();\n for (const [, entry] of fileMap) {\n const source = sourceFile.get(entry.symbol.id)!;\n let exp = exports.get(source);\n if (!exp) {\n exp = {\n canExportAll: true,\n exports: [],\n from: source,\n isTypeOnly: true,\n };\n }\n const isTypeOnly = [...entry.kinds].every((kind) => isTypeOnlyKind(kind));\n const exportedName = entry.symbol.finalName;\n exp.exports.push({\n exportedName,\n isTypeOnly,\n kind: entry.symbol.importKind,\n sourceName: entry.symbol.name,\n });\n if (entry.symbol.name !== entry.symbol.finalName) {\n exp.canExportAll = false;\n }\n if (!isTypeOnly) {\n exp.isTypeOnly = false;\n }\n exports.set(source, exp);\n }\n for (const [, exp] of exports) {\n file.addExport(exp);\n }\n }\n }\n\n /**\n * Plans imports by analyzing symbol dependencies across files.\n *\n * For external dependencies, assigns top-level names.\n *\n * Creates or reuses import symbols for dependencies from other files,\n * assigning names and updating import metadata including type-only flags.\n */\n private planImports(): void {\n const seenByFile = new Map<\n File,\n Map<\n string,\n {\n dep: Symbol;\n kinds: Set<SymbolKind>;\n symbol: Symbol;\n }\n >\n >();\n\n this.analyzer.analyze(this.project.nodes.all(), (ctx) => {\n const symbol = ctx.symbol;\n if (!symbol) return;\n\n const file = symbol.file;\n if (!file) return;\n\n let fileMap = seenByFile.get(file);\n if (!fileMap) {\n fileMap = new Map();\n seenByFile.set(file, fileMap);\n }\n\n ctx.walkScopes((dependency) => {\n const dep = fromRef(dependency);\n if (!dep.file || dep.file.id === file.id) return;\n\n if (dep.external) {\n // TODO: pass node\n this.assignTopLevelName({ ctx, symbol: dep });\n }\n\n const fromFileId = dep.file.id;\n const importedName = dep.finalName;\n const kind = dep.importKind;\n const key = `${fromFileId}|${importedName}|${kind}`;\n\n let entry = fileMap.get(key);\n if (!entry) {\n const imp = this.project.symbols.register({\n exported: dep.exported,\n external: dep.external,\n importKind: dep.importKind,\n kind: dep.kind,\n name: dep.finalName,\n });\n imp.setFile(file);\n // TODO: pass node\n this.assignTopLevelName({\n ctx,\n scope: createScope({ localNames: imp.file!.allNames }),\n symbol: imp,\n });\n entry = {\n dep,\n kinds: new Set(),\n symbol: imp,\n };\n fileMap.set(key, entry);\n dep.addImport(imp);\n }\n entry.kinds.add(dep.kind);\n\n dependency['~ref'] = entry.symbol;\n });\n });\n\n for (const [file, fileMap] of seenByFile) {\n const imports = new Map<File, ImportModule>();\n for (const [, entry] of fileMap) {\n const source = entry.dep.file!;\n let imp = imports.get(source);\n if (!imp) {\n imp = {\n from: source,\n imports: [],\n isTypeOnly: true,\n kind: 'named',\n };\n }\n const isTypeOnly = [...entry.kinds].every((kind) => isTypeOnlyKind(kind));\n if (entry.symbol.importKind === 'namespace') {\n imp.imports = [];\n imp.kind = 'namespace';\n imp.localName = entry.symbol.finalName;\n } else if (entry.symbol.importKind === 'default') {\n imp.kind = 'default';\n imp.localName = entry.symbol.finalName;\n } else {\n imp.imports.push({\n isTypeOnly,\n localName: entry.symbol.finalName,\n sourceName: entry.dep.finalName,\n });\n }\n if (!isTypeOnly) {\n imp.isTypeOnly = false;\n }\n imports.set(source, imp);\n }\n for (const [, imp] of imports) {\n file.addImport(imp);\n }\n }\n }\n\n /**\n * Assigns the final name to a top-level (file-scoped) symbol.\n *\n * Uses the symbol's file top-level names as the default scope,\n * and updates all relevant name scopes including the file's allNames and local scopes.\n *\n * Supports optional overrides for the naming scope and scopes to update.\n */\n private assignTopLevelName(\n args: Partial<AssignOptions> & {\n ctx: AnalysisContext;\n debug?: boolean;\n node?: INode;\n symbol: Symbol;\n },\n ): void {\n if (!args.symbol.file) return;\n this.assignSymbolName({\n ...args,\n file: args.symbol.file,\n scope: args?.scope ?? createScope({ localNames: args.symbol.file.topLevelNames }),\n scopesToUpdate: [\n createScope({ localNames: args.symbol.file.allNames }),\n args.ctx.scopes,\n ...(args?.scopesToUpdate ?? []),\n ],\n });\n }\n\n /**\n * Assigns the final name to a non-top-level (local) symbol.\n *\n * Uses the provided scope or derives it from the current analysis context's local names.\n *\n * Updates all provided name scopes accordingly.\n */\n private assignLocalName(\n args: Pick<Partial<AssignOptions>, 'scope'> &\n Pick<AssignOptions, 'scopesToUpdate'> & {\n ctx: AnalysisContext;\n debug?: boolean;\n /** The file the symbol belongs to. */\n file: File;\n node?: INode;\n symbol: Symbol;\n },\n ): void {\n this.assignSymbolName({\n ...args,\n scope: args.scope ?? args.ctx.scope,\n });\n }\n\n /**\n * Assigns the final name to a symbol within the provided name scope.\n *\n * Resolves name conflicts until a unique name is found.\n *\n * Updates all specified name scopes with the assigned final name.\n */\n private assignSymbolName(\n args: AssignOptions & {\n ctx: AnalysisContext;\n debug?: boolean;\n /** The file the symbol belongs to. */\n file: File;\n node?: INode;\n symbol: Symbol;\n },\n ): void {\n const { file, node, scope, scopesToUpdate, symbol } = args;\n if (this.cacheResolvedNames.has(symbol.id)) return;\n\n const baseName = symbol.name;\n let finalName =\n node?.nameSanitizer?.(baseName) ?? symbol.node?.nameSanitizer?.(baseName) ?? baseName;\n let attempt = 1;\n\n while (true) {\n const language = node?.language || symbol.node?.language || file.language;\n\n const ok = this.nameIsAvailable({\n kind: symbol.kind,\n language,\n name: finalName,\n override: symbol.override,\n scope,\n });\n if (ok) break;\n\n const resolver =\n (language ? this.project.nameConflictResolvers[language] : undefined) ??\n this.project.defaultNameConflictResolver;\n const resolvedName = resolver({ attempt, baseName });\n if (!resolvedName) {\n throw new Error(`Unresolvable name conflict: ${symbol.toString()}`);\n }\n\n finalName =\n node?.nameSanitizer?.(resolvedName) ??\n symbol.node?.nameSanitizer?.(resolvedName) ??\n resolvedName;\n attempt = attempt + 1;\n }\n\n symbol.setFinalName(finalName);\n this.cacheResolvedNames.add(symbol.id);\n const updateScopes = [scope, ...scopesToUpdate];\n for (const scope of updateScopes) {\n registerName(scope, symbol.finalName, symbol.kind);\n }\n }\n\n /**\n * Checks whether `name` can be used for a new symbol of `kind` in `scope`.\n *\n * Walks up the scope chain and verifies that every existing declaration with\n * that name is compatible (i.e., can share the same identifier) with `kind`.\n * This avoids copying the entire accumulated name map on every call.\n */\n private nameIsAvailable({\n kind,\n language,\n name,\n override,\n scope,\n }: {\n kind: SymbolKind;\n language: string | undefined;\n name: string;\n override?: boolean;\n scope: Scope;\n }): boolean {\n function conflicts(kinds: Set<SymbolKind> | undefined): boolean {\n if (!kinds) return false;\n for (const existingKind of kinds) {\n if (!canDeclarationsShareIdentifier(language, kind, existingKind)) {\n return true;\n }\n }\n return false;\n }\n\n let current: Scope | undefined = scope;\n while (current) {\n if (!override && conflicts(current.childNames.get(name))) {\n return false;\n }\n if (conflicts(current.localNames.get(name))) return false;\n current = current.parent;\n }\n return true;\n }\n}\n","import { symbolBrand } from '../brands';\nimport type { ISymbolMeta } from '../extensions';\nimport type { File } from '../files/file';\nimport { log } from '../log';\nimport type { INode } from '../nodes/node';\nimport type { BindingKind, ISymbolChild, ISymbolIn, SymbolEventMap, SymbolKind } from './types';\n\nexport class Symbol<Node extends INode = INode> {\n /**\n * Canonical symbol this stub resolves to, if any.\n *\n * Stubs created during DSL construction may later be associated\n * with a fully registered symbol. Once set, all property lookups\n * should defer to the canonical symbol.\n */\n private _canonical?: Symbol;\n /**\n * Child symbol bindings scoped under this symbol.\n *\n * @default []\n */\n private _children: Array<ISymbolChild>;\n /**\n * True if this symbol is exported from its defining file.\n *\n * @default false\n */\n private _exported: boolean;\n /**\n * External module name if this symbol is imported from a module not managed\n * by the project (e.g., \"zod\", \"lodash\").\n *\n * @default undefined\n */\n private _external?: string;\n /**\n * The file this symbol is ultimately emitted into.\n *\n * Only top-level symbols have an assigned file.\n */\n private _file?: File;\n /**\n * The alias-resolved, conflict-free emitted name.\n */\n private _finalName?: string;\n /**\n * Custom strategy to determine from which file path(s) this symbol is re-exported.\n *\n * @returns The file path(s) that re-export this symbol, or undefined if none.\n */\n private _getExportFromFilePath?: (symbol: Symbol) => ReadonlyArray<string> | undefined;\n /**\n * Custom strategy to determine file output path.\n *\n * @returns The file path to output the symbol to, or undefined to fallback to default behavior.\n */\n private _getFilePath?: (symbol: Symbol) => string | undefined;\n /**\n * How this symbol should be imported (namespace/default/named).\n *\n * @default 'named'\n */\n private _importKind: BindingKind;\n /**\n * Per-file imported instances of this symbol.\n *\n * @default []\n */\n private _imports: Array<Symbol> = [];\n /**\n * Kind of symbol (class, type, alias, etc.).\n *\n * @default 'var'\n */\n private _kind: SymbolKind;\n /**\n * Registered event listeners keyed by event name.\n *\n * @default {}\n */\n private _listeners: {\n [K in keyof SymbolEventMap]?: Array<SymbolEventMap[K]>;\n } = {};\n /**\n * Arbitrary user metadata.\n *\n * @default undefined\n */\n private _meta?: ISymbolMeta;\n /**\n * Intended user-facing name before conflict resolution.\n *\n * @example \"UserModel\"\n */\n private _name: string;\n /**\n * Node that defines this symbol.\n */\n private _node?: Node;\n /**\n * Indicates whether this symbol overrides another declaration.\n *\n * @default false\n */\n private _override: boolean;\n\n /** Brand used for identifying symbols. */\n readonly '~brand' = symbolBrand;\n /** Globally unique, stable symbol ID. */\n readonly id: number;\n\n constructor(input: ISymbolIn, id: number) {\n this._children = input.children ?? [];\n this._exported = input.exported ?? false;\n this._external = input.external;\n this._getExportFromFilePath = input.getExportFromFilePath;\n this._getFilePath = input.getFilePath;\n this.id = id;\n this._importKind = input.importKind ?? 'named';\n this._kind = input.kind ?? 'var';\n this._meta = input.meta;\n this._name = input.name;\n this._override = input.override ?? false;\n }\n\n /**\n * Returns the canonical symbol for this instance.\n *\n * If this symbol was created as a stub, this getter returns\n * the fully registered canonical symbol. Otherwise, it returns\n * the symbol itself.\n */\n get canonical(): Symbol {\n return this._canonical ?? this;\n }\n\n /**\n * Read-only accessor for child symbol bindings.\n */\n get children(): ReadonlyArray<ISymbolChild> {\n return this.canonical._children;\n }\n\n /**\n * Indicates whether this symbol is exported from its defining file.\n */\n get exported(): boolean {\n return this.canonical._exported;\n }\n\n /**\n * External module from which this symbol originates, if any.\n */\n get external(): string | undefined {\n return this.canonical._external;\n }\n\n /**\n * Read‑only accessor for the assigned output file.\n *\n * Only top-level symbols have an assigned file.\n */\n get file(): File | undefined {\n return this.canonical._file;\n }\n\n /**\n * Read‑only accessor for the resolved final emitted name.\n */\n get finalName(): string {\n if (!this.canonical._finalName) {\n const message = `Symbol finalName has not been resolved yet for ${this.canonical.toString()}`;\n log.debug(message, 'symbol');\n throw new Error(message);\n }\n return this.canonical._finalName;\n }\n\n /**\n * Custom re-export file path resolver, if provided.\n */\n get getExportFromFilePath(): ((symbol: Symbol) => ReadonlyArray<string> | undefined) | undefined {\n return this.canonical._getExportFromFilePath;\n }\n\n /**\n * Custom file path resolver, if provided.\n */\n get getFilePath(): ((symbol: Symbol) => string | undefined) | undefined {\n return this.canonical._getFilePath;\n }\n\n /**\n * How this symbol should be imported (named/default/namespace).\n */\n get importKind(): BindingKind {\n return this.canonical._importKind;\n }\n\n /**\n * Read-only accessor for the per-file imported instances of this symbol.\n */\n get imports(): ReadonlyArray<Symbol> {\n return this.canonical._imports;\n }\n\n /**\n * Indicates whether this is a canonical symbol (not a stub).\n */\n get isCanonical(): boolean {\n return !this._canonical || this._canonical === this;\n }\n\n /**\n * Indicates whether this symbol was renamed during conflict resolution.\n */\n get isRenamed(): boolean {\n return Boolean(this.canonical._finalName) && this.canonical._finalName !== this.canonical._name;\n }\n\n /**\n * The symbol's kind (class, type, alias, variable, etc.).\n */\n get kind(): SymbolKind {\n return this.canonical._kind;\n }\n\n /**\n * Arbitrary user‑provided metadata associated with this symbol.\n */\n get meta(): ISymbolMeta | undefined {\n return this.canonical._meta;\n }\n\n /**\n * User-intended name before aliasing or conflict resolution.\n */\n get name(): string {\n return this.canonical._name;\n }\n\n /**\n * Read‑only accessor for the defining node.\n */\n get node(): Node | undefined {\n return this.canonical._node as Node | undefined;\n }\n\n /**\n * Indicates whether this symbol is marked as an override.\n */\n get override(): boolean {\n return this.canonical._override;\n }\n\n /**\n * Registers a per-file imported instance of this symbol.\n *\n * @param symbol The imported instance to register.\n */\n addImport(symbol: Symbol): void {\n this.assertCanonical();\n this._imports.push(symbol);\n this.emit('import', { symbol });\n }\n\n /**\n * Registers a listener for the given symbol lifecycle event.\n *\n * @param event The event to subscribe to.\n * @param listener Callback invoked when the event is emitted.\n * @returns `this` for chaining.\n */\n on<K extends keyof SymbolEventMap>(event: K, listener: SymbolEventMap[K]): this {\n (this.canonical._listeners[event] ??= [] as NonNullable<\n (typeof this.canonical._listeners)[K]\n >).push(listener);\n return this;\n }\n\n /**\n * Marks this symbol as a stub and assigns its canonical symbol.\n *\n * After calling this, all semantic queries (name, kind, file,\n * meta, etc.) should reflect the canonical symbol's values.\n *\n * @param symbol The canonical symbol this stub should resolve to.\n */\n setCanonical(symbol: Symbol): void {\n this._canonical = symbol;\n }\n\n /**\n * Assigns the child symbol bindings associated with this symbol.\n *\n * @param children Child bindings to associate with the symbol.\n */\n setChildren(children: Array<ISymbolChild>): void {\n this.assertCanonical();\n this._children = children;\n }\n\n /**\n * Marks the symbol as exported from its file.\n *\n * @param exported Whether the symbol is exported.\n */\n setExported(exported: boolean): void {\n this.assertCanonical();\n this._exported = exported;\n }\n\n /**\n * Assigns the output file this symbol will be emitted into.\n *\n * This may only be set once.\n */\n setFile(file: File): void {\n this.assertCanonical();\n if (this._file && this._file !== file) {\n const message = `Symbol ${this.canonical.toString()} is already assigned to a different file.`;\n log.debug(message, 'symbol');\n throw new Error(message);\n }\n this._file = file;\n this.emit('file', { file, symbol: this });\n }\n\n /**\n * Assigns the conflict‑resolved final local name for this symbol.\n *\n * This may only be set once.\n */\n setFinalName(name: string): void {\n this.assertCanonical();\n if (this._finalName && this._finalName !== name) {\n const message = `Symbol finalName has already been resolved for ${this.canonical.toString()}.`;\n log.debug(message, 'symbol');\n throw new Error(message);\n }\n this._finalName = name;\n this.emit('finalName', { finalName: name, symbol: this });\n }\n\n /**\n * Sets how this symbol should be imported.\n *\n * @param kind The import strategy (named/default/namespace).\n */\n setImportKind(kind: BindingKind): void {\n this.assertCanonical();\n this._importKind = kind;\n }\n\n /**\n * Sets the symbol's kind (class, type, alias, variable, etc.).\n *\n * @param kind The new symbol kind.\n */\n setKind(kind: SymbolKind): void {\n this.assertCanonical();\n this._kind = kind;\n }\n\n /**\n * Updates the intended user‑facing name for this symbol.\n *\n * @param name The new name.\n */\n setName(name: string): void {\n this.assertCanonical();\n this._name = name;\n }\n\n /**\n * Binds the node that defines this symbol.\n *\n * This may only be set once.\n */\n setNode(node: Node): void {\n this.assertCanonical();\n if (this._node && this._node !== node) {\n const message = `Symbol ${this.canonical.toString()} is already bound to a different node.`;\n log.debug(message, 'symbol');\n // TODO: symbol <> node relationship needs to be refactor to 1:many\n // disabled in the meantime or it would throw\n // throw new Error(message);\n }\n this._node = node;\n node.symbol = this;\n }\n\n /**\n * Marks whether this symbol should be treated as an override.\n *\n * @param override Override marker value.\n */\n setOverride(override: boolean): void {\n this.assertCanonical();\n this._override = override;\n }\n\n /**\n * Returns a debug‑friendly string representation identifying the symbol.\n */\n toString(): string {\n const c = this.canonical;\n const status = `${this._finalName ? '✓' : '~'} `;\n let renamed = '';\n let file = '';\n if (c._finalName) {\n renamed = c._finalName !== c._name ? ` → \"${c._finalName}\"` : '';\n file = c._file ? ` ${c._file.logicalFilePath}` : '';\n }\n return `${status}Symbol#${c.id} \"${c._name}\"${renamed}${file}`;\n }\n\n /**\n * Ensures this symbol is canonical before allowing mutation.\n *\n * A symbol that has been marked as a stub (i.e., its `_canonical` points\n * to a different symbol) may not be mutated. This guard throws an error\n * if any setter attempts to modify a stub, preventing accidental writes\n * to non‑canonical instances.\n *\n * @throws {Error} If the symbol is a stub and is being mutated.\n */\n private assertCanonical(): void {\n if (this._canonical && this._canonical !== this) {\n const message = `Illegal mutation of stub symbol ${this.toString()} → canonical: ${this._canonical.toString()}`;\n log.debug(message, 'symbol');\n throw new Error(message);\n }\n }\n\n /**\n * Invokes all registered listeners for the given event.\n *\n * @param event The event to emit.\n * @param args Arguments forwarded to each listener.\n */\n private emit<K extends keyof SymbolEventMap>(\n event: K,\n ...args: Parameters<SymbolEventMap[K]>\n ): void {\n const listeners = this._listeners[event];\n if (!listeners) return;\n for (const listener of listeners) {\n (listener as (...args: Parameters<SymbolEventMap[K]>) => void)(...args);\n }\n }\n}\n","import type { ISymbolMeta } from '../extensions';\nimport { Symbol } from './symbol';\nimport type { ISymbolIdentifier, ISymbolIn, ISymbolRegistry } from './types';\n\ntype IndexEntry = readonly [key: string, value: unknown, serialized: string];\ntype IndexKeySpace = ReadonlyArray<IndexEntry>;\ntype QueryCacheKey = string;\ntype SymbolId = number;\n\nexport class SymbolRegistry implements ISymbolRegistry {\n /** Forward index: cache key → index key space it was registered with. */\n private _cacheDependencies: Map<QueryCacheKey, IndexKeySpace> = new Map();\n /** Reverse index: serialized index entry → set of cache keys that depend on it. */\n private _dependencyToCache: Map<string, Set<QueryCacheKey>> = new Map();\n private _id: SymbolId = 0;\n private _indices: Map<IndexEntry[0], Map<IndexEntry[1], Set<SymbolId>>> = new Map();\n private _queryCache: Map<QueryCacheKey, ReadonlyArray<Symbol>> = new Map();\n private _registered: Set<SymbolId> = new Set();\n private _stubs: Set<SymbolId> = new Set();\n private _stubCache: Map<QueryCacheKey, SymbolId> = new Map();\n private _values: Map<SymbolId, Symbol> = new Map();\n\n get(identifier: ISymbolIdentifier): Symbol | undefined {\n return typeof identifier === 'number'\n ? this._values.get(identifier)\n : this.query(identifier)[0];\n }\n\n isRegistered(identifier: ISymbolIdentifier): boolean {\n const symbol = this.get(identifier);\n return symbol ? this._registered.has(symbol.id) : false;\n }\n\n get nextId(): SymbolId {\n return this._id++;\n }\n\n query(filter: ISymbolMeta): ReadonlyArray<Symbol> {\n const indexKeySpace = this.buildIndexKeySpace(filter);\n const cacheKey = this.cacheKeyFromKeySpace(indexKeySpace);\n return this.queryByKeySpace(indexKeySpace, cacheKey);\n }\n\n reference(meta: ISymbolMeta): Symbol {\n const indexKeySpace = this.buildIndexKeySpace(meta);\n const cacheKey = this.cacheKeyFromKeySpace(indexKeySpace);\n const [registered] = this.queryByKeySpace(indexKeySpace, cacheKey);\n if (registered) return registered;\n\n const cachedId = this._stubCache.get(cacheKey);\n if (cachedId !== undefined) return this._values.get(cachedId)!;\n\n const stub = new Symbol({ meta, name: '' }, this.nextId);\n\n this._values.set(stub.id, stub);\n this._stubs.add(stub.id);\n this._stubCache.set(cacheKey, stub.id);\n return stub;\n }\n\n register(symbol: ISymbolIn): Symbol {\n const result = new Symbol(symbol, this.nextId);\n\n this._values.set(result.id, result);\n this._registered.add(result.id);\n\n if (result.meta) {\n const indexKeySpace = this.buildIndexKeySpace(result.meta);\n this.indexSymbol(result.id, indexKeySpace);\n this.invalidateCache(indexKeySpace);\n this.replaceStubs(result, indexKeySpace);\n }\n\n return result;\n }\n\n *registered(): IterableIterator<Symbol> {\n for (const id of this._registered.values()) {\n yield this._values.get(id)!;\n }\n }\n\n private buildIndexKeySpace(\n meta: ISymbolMeta,\n prefix = '',\n entries: Array<IndexEntry> = [],\n ): IndexKeySpace {\n for (const [key, value] of Object.entries(meta)) {\n const path = prefix ? `${prefix}.${key}` : key;\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n this.buildIndexKeySpace(value as ISymbolMeta, path, entries);\n } else {\n entries.push([path, value, `${path}:${JSON.stringify(value)}`]);\n }\n }\n return entries;\n }\n\n /**\n * Derives a stable, order-insensitive cache key from a pre-built key space.\n * Avoids rebuilding the key space when it's already available.\n */\n private cacheKeyFromKeySpace(indexKeySpace: IndexKeySpace): QueryCacheKey {\n return indexKeySpace\n .map((indexEntry) => indexEntry[2])\n .sort() // ensure order-insensitivity\n .join('|');\n }\n\n private indexSymbol(symbolId: SymbolId, indexKeySpace: IndexKeySpace): void {\n for (const [key, value] of indexKeySpace) {\n if (!this._indices.has(key)) this._indices.set(key, new Map());\n const values = this._indices.get(key)!;\n const set = values.get(value) ?? new Set();\n set.add(symbolId);\n values.set(value, set);\n }\n }\n\n private invalidateCache(indexKeySpace: IndexKeySpace): void {\n for (const indexEntry of indexKeySpace) {\n const serialized = indexEntry[2];\n const cacheKeys = this._dependencyToCache.get(serialized);\n if (!cacheKeys) continue;\n for (const cacheKey of cacheKeys) {\n this._queryCache.delete(cacheKey);\n // Clean up stale reverse-index references so _dependencyToCache doesn't\n // accumulate orphaned entries for evicted cache keys.\n const deps = this._cacheDependencies.get(cacheKey);\n if (deps) {\n for (const dep of deps) {\n if (dep[2] !== serialized) {\n this._dependencyToCache.get(dep[2])?.delete(cacheKey);\n }\n }\n this._cacheDependencies.delete(cacheKey);\n }\n }\n this._dependencyToCache.delete(serialized);\n }\n }\n\n private isSubset(sub: IndexKeySpace, sup: IndexKeySpace): boolean {\n const supMap = new Map(sup.map((e) => [e[0], e[1]] as const));\n for (const [key, value] of sub) {\n if (!supMap.has(key) || supMap.get(key) !== value) {\n return false;\n }\n }\n return true;\n }\n\n private queryByKeySpace(\n indexKeySpace: IndexKeySpace,\n cacheKey: QueryCacheKey,\n ): ReadonlyArray<Symbol> {\n const cached = this._queryCache.get(cacheKey);\n if (cached) {\n return cached;\n }\n const sets: Array<Set<SymbolId>> = [];\n let missed = false;\n\n // Build index sets and register cache dependencies inline within a single pass.\n for (const indexEntry of indexKeySpace) {\n const serialized = indexEntry[2];\n let cacheKeys: Set<string>;\n\n if (this._dependencyToCache.has(serialized)) {\n cacheKeys = this._dependencyToCache.get(serialized)!;\n } else {\n cacheKeys = new Set();\n this._dependencyToCache.set(serialized, cacheKeys);\n }\n\n cacheKeys.add(cacheKey);\n\n if (!missed) {\n const values = this._indices.get(indexEntry[0]);\n if (!values) {\n missed = true;\n continue;\n }\n const set = values.get(indexEntry[1]);\n if (!set) {\n missed = true;\n continue;\n }\n sets.push(set);\n }\n }\n\n this._cacheDependencies.set(cacheKey, indexKeySpace);\n\n if (missed || !sets.length) {\n this._queryCache.set(cacheKey, []);\n return [];\n }\n\n // We want to do a Set intersection, but large inputs may contain a few very\n // large sets. The profiling showed that Set operations became a huge bottleneck\n // on such inputs.\n //\n // To avoid iterating over large sets multiple times, we sort the sets by size\n // and use the smallest set as the base to minimize iterations and deletions.\n sets.sort((a, b) => a.size - b.size);\n const result = new Set(sets[0]);\n for (let i = 1; i < sets.length; i++) {\n const set = sets[i]!;\n for (const symbolId of result) {\n if (!set.has(symbolId)) result.delete(symbolId);\n }\n }\n\n const symbols = Array.from(result, (symbolId) => this._values.get(symbolId)!);\n this._queryCache.set(cacheKey, symbols);\n return symbols;\n }\n\n private replaceStubs(symbol: Symbol, indexKeySpace: IndexKeySpace): void {\n for (const stubId of this._stubs.values()) {\n const stub = this._values.get(stubId);\n if (stub?.meta) {\n const stubKeySpace = this.buildIndexKeySpace(stub.meta);\n if (this.isSubset(stubKeySpace, indexKeySpace)) {\n const cacheKey = this.cacheKeyFromKeySpace(stubKeySpace);\n this._stubCache.delete(cacheKey);\n this._stubs.delete(stubId);\n stub.setCanonical(symbol);\n }\n }\n }\n }\n}\n","import path from 'node:path';\n\nimport type { IProjectMeta } from '../extensions';\nimport { FileRegistry } from '../files/registry';\nimport { defaultExtensions } from '../languages/extensions';\nimport { defaultModuleEntryNames } from '../languages/modules';\nimport { defaultNameConflictResolvers } from '../languages/resolvers';\nimport type { Extensions, ModuleEntryNames, NameConflictResolvers } from '../languages/types';\nimport { NodeRegistry } from '../nodes/registry';\nimport type { IOutput } from '../output';\nimport { Planner } from '../planner/planner';\nimport { simpleNameConflictResolver } from '../planner/resolvers';\nimport type { NameConflictResolver } from '../planner/types';\nimport type { Renderer } from '../renderer';\nimport { SymbolRegistry } from '../symbols/registry';\nimport type { IProject } from './types';\n\nexport class Project implements IProject {\n private _isPlanned = false;\n\n readonly files: FileRegistry;\n readonly meta: IProjectMeta;\n readonly nodes = new NodeRegistry();\n readonly symbols = new SymbolRegistry();\n\n readonly defaultFileName: string;\n readonly defaultNameConflictResolver: NameConflictResolver;\n readonly extensions: Extensions;\n readonly fileName?: (name: string) => string;\n readonly moduleEntryNames: ModuleEntryNames;\n readonly nameConflictResolvers: NameConflictResolvers;\n readonly renderers: ReadonlyArray<Renderer>;\n readonly root: string;\n\n constructor(\n args: Pick<\n Partial<IProject>,\n | 'defaultFileName'\n | 'defaultNameConflictResolver'\n | 'extensions'\n | 'fileName'\n | 'moduleEntryNames'\n | 'nameConflictResolvers'\n | 'renderers'\n > &\n Pick<IProject, 'root'> & { meta?: IProjectMeta },\n ) {\n this.meta = args.meta ?? {};\n const fileName = args.fileName;\n this.defaultFileName = args.defaultFileName ?? 'main';\n this.defaultNameConflictResolver =\n args.defaultNameConflictResolver ?? simpleNameConflictResolver;\n this.extensions = {\n ...defaultExtensions,\n ...args.extensions,\n };\n this.fileName = typeof fileName === 'string' ? () => fileName : fileName;\n this.files = new FileRegistry(this);\n this.moduleEntryNames = {\n ...defaultModuleEntryNames,\n ...args.moduleEntryNames,\n };\n this.nameConflictResolvers = {\n ...defaultNameConflictResolvers,\n ...args.nameConflictResolvers,\n };\n this.renderers = args.renderers ?? [];\n this.root = path.resolve(args.root).replace(/[/\\\\]+$/, '');\n }\n\n plan(): void {\n if (this._isPlanned) return;\n new Planner(this).plan();\n this._isPlanned = true;\n }\n\n render(): ReadonlyArray<IOutput> {\n if (!this._isPlanned) this.plan();\n const files: Array<IOutput> = [];\n for (const file of this.files.registered()) {\n if (!file.external && file.finalPath && file.renderer) {\n const content = file.renderer.render({ file, project: this });\n files.push({ content, path: file.finalPath });\n }\n }\n return files;\n }\n}\n","import type { StructureItem, StructureShell } from './types';\n\nexport class StructureNode {\n /** Nested nodes within this node. */\n children: Map<string, StructureNode> = new Map();\n /** Items contained in this node. */\n items: Array<StructureItem> = [];\n /** The name of this node (e.g., \"Users\", \"Accounts\"). */\n name: string;\n /** Parent node in the hierarchy. Undefined if this is the root node. */\n parent?: StructureNode;\n /** Shell claimed for this node. */\n shell?: StructureShell;\n /** Source of the claimed shell. */\n shellSource?: symbol;\n /** True if this is a virtual root. */\n virtual: boolean;\n\n constructor(\n name: string,\n parent?: StructureNode,\n options?: {\n virtual?: boolean;\n },\n ) {\n this.name = name;\n this.parent = parent;\n this.virtual = options?.virtual ?? false;\n }\n\n get isRoot(): boolean {\n return !this.parent;\n }\n\n /**\n * Gets or creates a child node.\n *\n * If the child doesn't exist, it's created automatically.\n *\n * @param name - The name of the child node\n * @returns The child node instance\n */\n child(name: string): StructureNode {\n if (!this.children.has(name)) {\n this.children.set(name, new StructureNode(name, this));\n }\n return this.children.get(name)!;\n }\n\n /**\n * Gets the full path of this node in the hierarchy.\n *\n * @returns An array of node names from the root to this node\n */\n getPath(): ReadonlyArray<string> {\n const path: Array<string> = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let cursor: StructureNode | undefined = this;\n while (cursor) {\n path.unshift(cursor.name);\n cursor = cursor.parent;\n }\n return path;\n }\n\n /**\n * Yields items from a specific source with typed data.\n *\n * @param source - The source symbol to filter by\n * @returns Generator of items from that source\n */\n *itemsFrom<T = unknown>(source: symbol): Generator<StructureItem & { data: T }> {\n for (const item of this.items) {\n if (item.source === source) {\n yield item as StructureItem & { data: T };\n }\n }\n }\n\n /**\n * Walk all nodes in the structure (depth-first, post-order).\n *\n * @returns Generator of all structure nodes\n */\n *walk(): Generator<StructureNode> {\n for (const node of this.children.values()) {\n yield* node.walk();\n }\n yield this;\n }\n}\n","import { StructureNode } from './node';\nimport type { StructureInsert } from './types';\n\nexport class StructureModel {\n /** Root nodes mapped by their names. */\n private _roots: Map<string, StructureNode> = new Map();\n /** Node for data without a specific root. */\n private _virtualRoot?: StructureNode;\n\n /**\n * Get all root nodes.\n */\n get roots(): ReadonlyArray<StructureNode> {\n const roots = Array.from(this._roots.values());\n if (this._virtualRoot) roots.unshift(this._virtualRoot);\n return roots;\n }\n\n /**\n * Insert data into the structure.\n */\n insert(args: StructureInsert): void {\n const { data, locations, source } = args;\n for (const location of locations) {\n const { path, shell } = location;\n const fullPath = path.filter((s): s is string => Boolean(s));\n const segments = fullPath.slice(0, -1);\n const name = fullPath[fullPath.length - 1];\n\n if (!name) {\n throw new Error('Cannot insert data without path.');\n }\n\n let cursor: StructureNode | null = null;\n\n for (const segment of segments) {\n if (!cursor) {\n cursor = this.root(segment);\n } else {\n cursor = cursor.child(segment);\n }\n\n if (shell && !cursor.shell) {\n cursor.shell = shell;\n cursor.shellSource = source;\n }\n }\n\n if (!cursor) {\n cursor = this.root(null);\n }\n\n cursor.items.push({ data, location: fullPath, source });\n }\n }\n\n /**\n * Gets or creates a root by name.\n *\n * If the root doesn't exist, it's created automatically.\n *\n * @param name - The name of the root\n * @returns The root instance\n */\n root(name: string | null): StructureNode {\n if (!name) {\n return (this._virtualRoot ??= new StructureNode('', undefined, {\n virtual: true,\n }));\n }\n if (!this._roots.has(name)) {\n this._roots.set(name, new StructureNode(name));\n }\n return this._roots.get(name)!;\n }\n\n /**\n * Walk all nodes in the structure (depth-first, post-order).\n *\n * @returns Generator of all structure nodes\n */\n *walk(): Generator<StructureNode> {\n if (this._virtualRoot) {\n yield* this._virtualRoot.walk();\n }\n for (const root of this._roots.values()) {\n yield* root.walk();\n }\n }\n}\n","export class Version<TVersion extends string = string> {\n private readonly _segments: ReadonlyArray<number>;\n readonly raw: TVersion;\n\n constructor(version: TVersion) {\n this.raw = version;\n this._segments = version.split('.').map((segment) => {\n const num = Number.parseInt(segment, 10);\n if (Number.isNaN(num)) {\n throw new Error(`Invalid version segment \"${segment}\" in \"${version}\"`);\n }\n return num;\n });\n }\n\n private _compare(other: TVersion | Version): number {\n const b = other instanceof Version ? other : new Version(other);\n const len = Math.max(this._segments.length, b._segments.length);\n for (let i = 0; i < len; i++) {\n const a = this._segments[i] ?? 0;\n const bSeg = b._segments[i] ?? 0;\n if (a !== bSeg) return a - bSeg;\n }\n return 0;\n }\n\n eq(other: TVersion | Version): boolean {\n return this._compare(other) === 0;\n }\n\n gt(other: TVersion | Version): boolean {\n return this._compare(other) > 0;\n }\n\n gte(other: TVersion | Version): boolean {\n return this._compare(other) >= 0;\n }\n\n lt(other: TVersion | Version): boolean {\n return this._compare(other) < 0;\n }\n\n lte(other: TVersion | Version): boolean {\n return this._compare(other) <= 0;\n }\n\n toString(): TVersion {\n return this.raw;\n }\n}\n"],"mappings":";;;;;AAAA,MAAa,YAAY;AACzB,MAAa,YAAY;AACzB,MAAa,cAAc;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;EAC7B;EACA,OAAO;CACT;CAEA,GAAG,OAAoC;EACrC,OAAO,KAAK,SAAS,KAAK,MAAM;CAClC;CAEA,GAAG,OAAoC;EACrC,OAAO,KAAK,SAAS,KAAK,IAAI;CAChC;CAEA,IAAI,OAAoC;EACtC,OAAO,KAAK,SAAS,KAAK,KAAK;CACjC;CAEA,GAAG,OAAoC;EACrC,OAAO,KAAK,SAAS,KAAK,IAAI;CAChC;CAEA,IAAI,OAAoC;EACtC,OAAO,KAAK,SAAS,KAAK,KAAK;CACjC;CAEA,WAAqB;EACnB,OAAO,KAAK;CACd;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hey-api/codegen-core",
3
- "version": "0.0.0-next-20260603165749",
3
+ "version": "0.0.0-next-20260607231541",
4
4
  "description": "🧱 TypeScript framework for generating files.",
5
5
  "keywords": [
6
6
  "codegen",