@hey-api/codegen-core 0.0.0-next-20260625120857 → 0.0.0-next-20260627003139

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -130,7 +130,7 @@ type SymbolEventMap = {
130
130
  symbol: Symbol;
131
131
  }) => void;
132
132
  };
133
- interface ISymbolChild {
133
+ type ISymbolChild = {
134
134
  /**
135
135
  * Kind of symbol (class, type, alias, etc.).
136
136
  *
@@ -149,7 +149,7 @@ interface ISymbolChild {
149
149
  * @default false
150
150
  */
151
151
  overridable?: boolean;
152
- }
152
+ };
153
153
  type ISymbolIn = {
154
154
  /**
155
155
  * Child symbol bindings scoped under this symbol.
@@ -208,6 +208,12 @@ type ISymbolIn = {
208
208
  * @example "UserModel"
209
209
  */
210
210
  name: string;
211
+ /**
212
+ * Provenance tag indicating which pipeline phase created this symbol.
213
+ *
214
+ * @default undefined
215
+ */
216
+ origin?: SymbolOrigin;
211
217
  /**
212
218
  * When true, this symbol intentionally overrides another declaration with
213
219
  * the same name in the same scope.
@@ -223,7 +229,13 @@ type ISymbolIn = {
223
229
  */
224
230
  priority?: number;
225
231
  };
226
- interface ISymbolRegistry {
232
+ type ISymbolRegistry = {
233
+ /**
234
+ * Returns a serializable snapshot of all symbols in the registry.
235
+ *
236
+ * @returns Array of symbol entries.
237
+ */
238
+ dump(): ReadonlyArray<RegistryDumpEntry>;
227
239
  /**
228
240
  * Get a symbol.
229
241
  *
@@ -273,7 +285,29 @@ interface ISymbolRegistry {
273
285
  * @returns Array of all registered symbols, in insert order.
274
286
  */
275
287
  registered(): IterableIterator<Symbol>;
276
- }
288
+ };
289
+ type SymbolOrigin = 'planner:export' | 'planner:import';
290
+ type SymbolDump = {
291
+ canonicalId?: number;
292
+ exported: boolean;
293
+ external?: string;
294
+ finalName?: string;
295
+ id: number;
296
+ importIds: string;
297
+ importKind: BindingKind;
298
+ isCanonical: boolean;
299
+ isRenamed: boolean;
300
+ kind: SymbolKind;
301
+ logicalFilePath?: string;
302
+ meta?: ISymbolMeta;
303
+ name: string;
304
+ origin?: SymbolOrigin;
305
+ override: boolean;
306
+ priority: number;
307
+ };
308
+ type RegistryDumpEntry = SymbolDump & {
309
+ status: 'registered' | 'stub';
310
+ };
277
311
  //#endregion
278
312
  //#region src/symbols/symbol.d.ts
279
313
  declare class Symbol<Node extends INode = INode> {
@@ -366,6 +400,12 @@ declare class Symbol<Node extends INode = INode> {
366
400
  * Node that defines this symbol.
367
401
  */
368
402
  private _node?;
403
+ /**
404
+ * Provenance tag indicating which pipeline phase created this symbol.
405
+ *
406
+ * @default undefined
407
+ */
408
+ private _origin?;
369
409
  /**
370
410
  * Indicates whether this symbol overrides another declaration.
371
411
  *
@@ -454,6 +494,10 @@ declare class Symbol<Node extends INode = INode> {
454
494
  * Read‑only accessor for the defining node.
455
495
  */
456
496
  get node(): Node | undefined;
497
+ /**
498
+ * Provenance tag indicating which pipeline phase created this symbol.
499
+ */
500
+ get origin(): SymbolOrigin | undefined;
457
501
  /**
458
502
  * Indicates whether this symbol is marked as an override.
459
503
  */
@@ -540,6 +584,7 @@ declare class Symbol<Node extends INode = INode> {
540
584
  * @param override Override marker value.
541
585
  */
542
586
  setOverride(override: boolean): void;
587
+ toDump(): SymbolDump;
543
588
  /**
544
589
  * Returns a debug‑friendly string representation identifying the symbol.
545
590
  */
@@ -562,6 +607,7 @@ declare class Symbol<Node extends INode = INode> {
562
607
  * @param args Arguments forwarded to each listener.
563
608
  */
564
609
  private emit;
610
+ private flattenMetaArrayValues;
565
611
  }
566
612
  //#endregion
567
613
  //#region src/planner/scope.d.ts
@@ -1159,6 +1205,7 @@ declare class SymbolRegistry implements ISymbolRegistry {
1159
1205
  private _stubs;
1160
1206
  private _stubCache;
1161
1207
  private _values;
1208
+ dump(): ReadonlyArray<RegistryDumpEntry>;
1162
1209
  get(identifier: ISymbolIdentifier): Symbol | undefined;
1163
1210
  isRegistered(identifier: ISymbolIdentifier): boolean;
1164
1211
  get nextId(): SymbolId;
@@ -1379,5 +1426,5 @@ declare class Version<TVersion extends string = string> {
1379
1426
  toString(): TVersion;
1380
1427
  }
1381
1428
  //#endregion
1382
- export { type IAnalysisContext as AnalysisContext, type BindingKind, type ExportMember, type ExportModule, type Extensions, File, type IFileIn as FileIn, type FromRef, type FromRefs, type IProject, type ImportMember, type ImportModule, type Language, Logger, type ModuleEntryNames, type NameConflictResolver, type NameConflictResolvers, type INode as Node, type NodeName, type NodeNameSanitizer, type NodeRelationship, type NodeScope, type IOutput as Output, Project, type IProjectMeta as ProjectMeta, type Ref, type Refs, type RenderContext, type Renderer, type StructureInsert, type StructureItem, type StructureLocation, StructureModel, StructureNode, type StructureShell, type StructureShellResult, Symbol, type ISymbolChild as SymbolChild, type ISymbolIdentifier as SymbolIdentifier, type ISymbolIn as SymbolIn, type SymbolKind, type ISymbolMeta as SymbolMeta, type ISymbolRegistry as SymbolRegistry, Version, defaultExtensions, defaultModuleEntryNames, defaultNameConflictResolvers, detectInteractiveSession, fromRef, fromRefs, isNode, isNodeRef, isRef, isSymbol, isSymbolRef, loadConfigFile, log, mergeConfigs, nodeBrand, pythonNameConflictResolver, ref, refs, simpleNameConflictResolver, symbolBrand, underscoreNameConflictResolver };
1429
+ export { type IAnalysisContext as AnalysisContext, type BindingKind, type ExportMember, type ExportModule, type Extensions, File, type IFileIn as FileIn, type FromRef, type FromRefs, type IProject, type ImportMember, type ImportModule, type Language, Logger, type ModuleEntryNames, type NameConflictResolver, type NameConflictResolvers, type INode as Node, type NodeName, type NodeNameSanitizer, type NodeRelationship, type NodeScope, type IOutput as Output, Project, type IProjectMeta as ProjectMeta, type Ref, type Refs, type RegistryDumpEntry, type RenderContext, type Renderer, type StructureInsert, type StructureItem, type StructureLocation, StructureModel, StructureNode, type StructureShell, type StructureShellResult, Symbol, type ISymbolChild as SymbolChild, type SymbolDump, type ISymbolIdentifier as SymbolIdentifier, type ISymbolIn as SymbolIn, type SymbolKind, type ISymbolMeta as SymbolMeta, type SymbolOrigin, type ISymbolRegistry as SymbolRegistry, Version, defaultExtensions, defaultModuleEntryNames, defaultNameConflictResolvers, detectInteractiveSession, fromRef, fromRefs, isNode, isNodeRef, isRef, isSymbol, isSymbolRef, loadConfigFile, log, mergeConfigs, nodeBrand, pythonNameConflictResolver, ref, refs, simpleNameConflictResolver, symbolBrand, underscoreNameConflictResolver };
1383
1430
  //# sourceMappingURL=index.d.mts.map
@@ -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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;EhCFM;EgCId,WAAA;EhCJgC;EgCMhC,OAAA;cAGE,IAAA,UACA,MAAA,GAAS,aAAA,EACT,OAAA;IACE,OAAA;EAAA;EAAA,IAQA,MAAA;EhCPM;;;;;;;;EgCmBV,KAAA,CAAM,IAAA,WAAe,aAAA;EhCnBN;;;;;EgC+Bf,OAAA,IAAW,aAAA;EhC9BY;AAAA;AAWzB;;;;EgCoCG,SAAA,cAAuB,MAAA,WAAiB,SAAA,CAAU,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"}
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;EEWnB,OAAA,CAAQ,GAAA,EAAK,gBAAA;EFXwC;EEarD,KAAA;EFbmE;EEenE,QAAA;EFfoE;EEiBpE,IAAA,GAAO,IAAA;EFJO;EEMd,QAAA,EAAU,CAAA;EFLE;EEOZ,IAAA,EAAM,YAA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ner {
954
954
  external: symbol.external,
955
955
  importKind: symbol.importKind,
956
956
  kind: symbol.kind,
957
- name: symbol.finalName
957
+ name: symbol.finalName,
958
+ origin: "planner:export"
958
959
  });
959
960
  exp.setFile(target);
960
961
  sourceFile.set(exp.id, file);
@@ -1034,7 +1035,8 @@ var Planner = class Planner {
1034
1035
  external: dep.external,
1035
1036
  importKind: dep.importKind,
1036
1037
  kind: dep.kind,
1037
- name: dep.finalName
1038
+ name: dep.finalName,
1039
+ origin: "planner:import"
1038
1040
  });
1039
1041
  imp.setFile(file);
1040
1042
  this.assignTopLevelName({
@@ -1268,6 +1270,12 @@ var Symbol = class {
1268
1270
  */
1269
1271
  _node;
1270
1272
  /**
1273
+ * Provenance tag indicating which pipeline phase created this symbol.
1274
+ *
1275
+ * @default undefined
1276
+ */
1277
+ _origin;
1278
+ /**
1271
1279
  * Indicates whether this symbol overrides another declaration.
1272
1280
  *
1273
1281
  * @default false
@@ -1295,6 +1303,7 @@ var Symbol = class {
1295
1303
  this._kind = input.kind ?? "var";
1296
1304
  this._meta = input.meta;
1297
1305
  this._name = input.name;
1306
+ this._origin = input.origin;
1298
1307
  this._override = input.override ?? false;
1299
1308
  this._priority = input.priority ?? 0;
1300
1309
  }
@@ -1406,6 +1415,12 @@ var Symbol = class {
1406
1415
  return this.canonical._node;
1407
1416
  }
1408
1417
  /**
1418
+ * Provenance tag indicating which pipeline phase created this symbol.
1419
+ */
1420
+ get origin() {
1421
+ return this.canonical._origin;
1422
+ }
1423
+ /**
1409
1424
  * Indicates whether this symbol is marked as an override.
1410
1425
  */
1411
1426
  get override() {
@@ -1554,6 +1569,26 @@ var Symbol = class {
1554
1569
  this.assertCanonical();
1555
1570
  this._override = override;
1556
1571
  }
1572
+ toDump() {
1573
+ return {
1574
+ canonicalId: this.isCanonical ? void 0 : this.canonical.id,
1575
+ exported: this.exported,
1576
+ external: this.external,
1577
+ finalName: this.canonical._finalName,
1578
+ id: this.canonical.id,
1579
+ importIds: this.imports.map((imp) => imp.id).join(", "),
1580
+ importKind: this.importKind,
1581
+ isCanonical: this.isCanonical,
1582
+ isRenamed: this.isRenamed,
1583
+ kind: this.kind,
1584
+ logicalFilePath: this.file?.logicalFilePath,
1585
+ meta: this.meta ? this.flattenMetaArrayValues(this.meta) : void 0,
1586
+ name: this.name,
1587
+ origin: this.origin,
1588
+ override: this.override,
1589
+ priority: this.priority
1590
+ };
1591
+ }
1557
1592
  /**
1558
1593
  * Returns a debug‑friendly string representation identifying the symbol.
1559
1594
  */
@@ -1596,6 +1631,13 @@ var Symbol = class {
1596
1631
  if (!listeners) return;
1597
1632
  for (const listener of listeners) listener(...args);
1598
1633
  }
1634
+ flattenMetaArrayValues(obj) {
1635
+ const result = {};
1636
+ for (const [key, value] of Object.entries(obj)) if (Array.isArray(value)) result[key] = value.join("/");
1637
+ else if (value && typeof value === "object") result[key] = this.flattenMetaArrayValues(value);
1638
+ else result[key] = value;
1639
+ return result;
1640
+ }
1599
1641
  };
1600
1642
  //#endregion
1601
1643
  //#region src/symbols/registry.ts
@@ -1611,6 +1653,12 @@ var SymbolRegistry = class {
1611
1653
  _stubs = /* @__PURE__ */ new Set();
1612
1654
  _stubCache = /* @__PURE__ */ new Map();
1613
1655
  _values = /* @__PURE__ */ new Map();
1656
+ dump() {
1657
+ return Array.from(this._values, ([id, symbol]) => ({
1658
+ ...symbol.toDump(),
1659
+ status: this._registered.has(id) ? "registered" : "stub"
1660
+ }));
1661
+ }
1614
1662
  get(identifier) {
1615
1663
  return typeof identifier === "number" ? this._values.get(identifier) : this.query(identifier)[0];
1616
1664
  }
@@ -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\n// TODO: move to @hey-api/utils\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== 'object' || value === null) return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\n// TODO: move to @hey-api/utils\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 function 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 function 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 function fromRef<T extends Ref<unknown> | undefined>(ref: T): FromRef<T> {\n return ref?.['~ref'] as FromRef<T>;\n}\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 function 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 function isRef<T>(value: unknown): value is Ref<T> {\n return typeof value === 'object' && value !== null && '~ref' in value;\n}\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).canonical;\n if (dep.external && !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 const sorted = [...this.project.nodes.all()].sort((a, b) => {\n const pa = a.symbol?.priority ?? 0;\n const pb = b.symbol?.priority ?? 0;\n return pb - pa;\n });\n\n this.analyzer.analyze(sorted, (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).canonical;\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).canonical;\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 * Naming priority. Higher value wins the canonical name when\n * multiple symbols in the same file compete for the same identifier.\n *\n * @default 0\n */\n private _priority: number;\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 this._priority = input.priority ?? 0;\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 * Naming priority. Higher value wins the canonical name when\n * multiple symbols in the same file compete for the same identifier.\n */\n get priority(): number {\n return this.canonical._priority;\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;;;;;;;;ACG3B,SAAgB,2BAAoC;CAClD,OAAO,QACL,QAAQ,MAAM,SACd,QAAQ,OAAO,SACf,CAAC,QAAQ,IAAI,MACb,CAAC,QAAQ,IAAI,kBACb,CAAC,QAAQ,IAAI,cACf;AACF;;;ACVA,SAAS,cAAc,OAAkD;CACvE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,QAAQ,OAAO,eAAe,K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,QAAQ,KAAK;EAC9D,MAAM,MAAM,KAAK,IAAI,KAAK,UAAU,QAAQ,EAAE,UAAU,MAAM;EAC9D,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,KAAK;GAC5B,MAAM,IAAI,KAAK,UAAU,MAAM;GAC/B,MAAM,OAAO,EAAE,UAAU,MAAM;GAC/B,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\n// TODO: move to @hey-api/utils\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== 'object' || value === null) return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\n// TODO: move to @hey-api/utils\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 function 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 function 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 function fromRef<T extends Ref<unknown> | undefined>(ref: T): FromRef<T> {\n return ref?.['~ref'] as FromRef<T>;\n}\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 function 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 function isRef<T>(value: unknown): value is Ref<T> {\n return typeof value === 'object' && value !== null && '~ref' in value;\n}\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).canonical;\n if (dep.external && !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 const sorted = [...this.project.nodes.all()].sort((a, b) => {\n const pa = a.symbol?.priority ?? 0;\n const pb = b.symbol?.priority ?? 0;\n return pb - pa;\n });\n\n this.analyzer.analyze(sorted, (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).canonical;\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 origin: 'planner:export',\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).canonical;\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 origin: 'planner:import',\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 {\n BindingKind,\n ISymbolChild,\n ISymbolIn,\n SymbolDump,\n SymbolEventMap,\n SymbolKind,\n SymbolOrigin,\n} 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 * Provenance tag indicating which pipeline phase created this symbol.\n *\n * @default undefined\n */\n private _origin?: SymbolOrigin;\n /**\n * Indicates whether this symbol overrides another declaration.\n *\n * @default false\n */\n private _override: boolean;\n /**\n * Naming priority. Higher value wins the canonical name when\n * multiple symbols in the same file compete for the same identifier.\n *\n * @default 0\n */\n private _priority: number;\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._origin = input.origin;\n this._override = input.override ?? false;\n this._priority = input.priority ?? 0;\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 * Provenance tag indicating which pipeline phase created this symbol.\n */\n get origin(): SymbolOrigin | undefined {\n return this.canonical._origin;\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 * Naming priority. Higher value wins the canonical name when\n * multiple symbols in the same file compete for the same identifier.\n */\n get priority(): number {\n return this.canonical._priority;\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 toDump(): SymbolDump {\n return {\n canonicalId: this.isCanonical ? undefined : this.canonical.id,\n exported: this.exported,\n external: this.external,\n finalName: this.canonical._finalName,\n id: this.canonical.id,\n importIds: this.imports.map((imp) => imp.id).join(', '),\n importKind: this.importKind,\n isCanonical: this.isCanonical,\n isRenamed: this.isRenamed,\n kind: this.kind,\n logicalFilePath: this.file?.logicalFilePath,\n meta: this.meta ? this.flattenMetaArrayValues(this.meta) : undefined,\n name: this.name,\n origin: this.origin,\n override: this.override,\n priority: this.priority,\n };\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 private flattenMetaArrayValues(obj: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj)) {\n if (Array.isArray(value)) {\n result[key] = value.join('/');\n } else if (value && typeof value === 'object') {\n result[key] = this.flattenMetaArrayValues(value as Record<string, unknown>);\n } else {\n result[key] = value;\n }\n }\n return result;\n }\n}\n","import type { ISymbolMeta } from '../extensions';\nimport { Symbol } from './symbol';\nimport type { ISymbolIdentifier, ISymbolIn, ISymbolRegistry, RegistryDumpEntry } 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 dump(): ReadonlyArray<RegistryDumpEntry> {\n return Array.from(\n this._values,\n ([id, symbol]): RegistryDumpEntry => ({\n ...symbol.toDump(),\n status: this._registered.has(id) ? 'registered' : 'stub',\n }),\n );\n }\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;;;;;;;;ACG3B,SAAgB,2BAAoC;CAClD,OAAO,QACL,QAAQ,MAAM,SACd,QAAQ,OAAO,SACf,CAAC,QAAQ,IAAI,MACb,CAAC,QAAQ,IAAI,kBACb,CAAC,QAAQ,IAAI,cACf;AACF;;;ACVA,SAAS,cAAc,OAAkD;CACvE,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,QAAQ,OAAO,eAAe,KAAK;CACzC,OAAO,UAAU,OAAO,aAAa,UAAU;AACjD;AAGA,SAAgB,aACd,SACA,SACG;CACH,MAAM,IAAK,WAAW,CAAC;CACvB,MAAM,IAAK,WAAW,CAAC;CAEvB,MAAM,SAAoB,EAAE,GAAG,EAAE;CAEjC,KAAK,MAAM,OAAO,OAAO,KAAK,CAAC,GAAG;EAChC,MAAM,SAAS,EAAE;EACjB,MAAM,SAAS,EAAE;EAEjB,IAAI,cAAc,MAAM,KAAK,cAAc,MAAM,GAC/C,OAAO,OAAO,aAAa,QAAQ,MAAM;OAEzC,OAAO,OAAO;CAElB;CAEA,OAAO;AACT;;;ACzBA,eAAsB,eAAoC,EACxD,YACA,QACA,MACA,cAUC;CACD,MAAM,WAAW,OAAO,UAAU,KAAK;CACvC,MAAM,EAAE,QAAQ,YAAY,YAAY,qBAAqB,MAAM,WAA0B;EAC3F;EACA;CACF,CAAC;CACD,SAAS,QAAQ;CAEjB,MAAM,cAAc,sBAAsB,QAAQ,aAAa,CAAC,UAAU;CAI1E,OAAO;EAAE,YAAY;EA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IAAa,UAAb,MAAa,QAA0C;CACrD;CACA;CAEA,YAAY,SAAmB;EAC7B,KAAK,MAAM;EACX,KAAK,YAAY,QAAQ,MAAM,GAAG,CAAC,CAAC,KAAK,YAAY;GACnD,MAAM,MAAM,OAAO,SAAS,SAAS,EAAE;GACvC,IAAI,OAAO,MAAM,GAAG,GAClB,MAAM,IAAI,MAAM,4BAA4B,QAAQ,QAAQ,QAAQ,EAAE;GAExE,OAAO;EACT,CAAC;CACH;CAEA,SAAiB,OAAmC;EAClD,MAAM,IAAI,iBAAiB,UAAU,QAAQ,IAAI,QAAQ,KAAK;EAC9D,MAAM,MAAM,KAAK,IAAI,KAAK,UAAU,QAAQ,EAAE,UAAU,MAAM;EAC9D,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,KAAK;GAC5B,MAAM,IAAI,KAAK,UAAU,MAAM;GAC/B,MAAM,OAAO,EAAE,UAAU,MAAM;GAC/B,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hey-api/codegen-core",
3
- "version": "0.0.0-next-20260625120857",
3
+ "version": "0.0.0-next-20260627003139",
4
4
  "description": "🧱 TypeScript framework for generating files.",
5
5
  "keywords": [
6
6
  "codegen",