layermap 0.1.12 → 0.1.14

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.
@@ -3452,7 +3452,7 @@ var require_main = __commonJS({
3452
3452
  exports.createMessageConnection = createMessageConnection2;
3453
3453
  var ril_1 = __importDefault(require_ril());
3454
3454
  ril_1.default.install();
3455
- var path6 = __importStar(__require("path"));
3455
+ var path7 = __importStar(__require("path"));
3456
3456
  var os = __importStar(__require("os"));
3457
3457
  var fs2 = __importStar(__require("fs"));
3458
3458
  var crypto_1 = __require("crypto");
@@ -3604,7 +3604,7 @@ var require_main = __commonJS({
3604
3604
  throw new Error(`Unable to generate a random pipe name with ${randomLength} characters.`);
3605
3605
  }
3606
3606
  const randomSuffix = (0, crypto_1.randomBytes)(Math.floor(randomLength / 2)).toString("hex");
3607
- return path6.join(tmpDir, `lsp-${randomSuffix}.sock`);
3607
+ return path7.join(tmpDir, `lsp-${randomSuffix}.sock`);
3608
3608
  }
3609
3609
  function createClientPipeTransport(pipeName, encoding = "utf-8") {
3610
3610
  let connectResolve;
@@ -3690,6 +3690,22 @@ var require_main = __commonJS({
3690
3690
  }
3691
3691
  });
3692
3692
 
3693
+ // src/platform.ts
3694
+ import { spawnSync } from "node:child_process";
3695
+ import path from "node:path";
3696
+ function stopProcessTree(pid, signal, platform = process.platform) {
3697
+ if (platform !== "win32") {
3698
+ process.kill(-pid, signal);
3699
+ return;
3700
+ }
3701
+ const taskkill = path.win32.join(
3702
+ process.env.SystemRoot ?? "C:\\Windows",
3703
+ "System32",
3704
+ "taskkill.exe"
3705
+ );
3706
+ spawnSync(taskkill, ["/PID", String(pid), "/T", "/F"], { stdio: "ignore", windowsHide: true });
3707
+ }
3708
+
3693
3709
  // src/project-map-compiler.ts
3694
3710
  import { channel } from "node:diagnostics_channel";
3695
3711
 
@@ -12992,116 +13008,116 @@ function getFileUrlVolumeSeparatorEnd(url2, start) {
12992
13008
  }
12993
13009
  return -1;
12994
13010
  }
12995
- function getRootLength(path6) {
12996
- const rootLength = getEncodedRootLength(path6);
13011
+ function getRootLength(path7) {
13012
+ const rootLength = getEncodedRootLength(path7);
12997
13013
  return rootLength < 0 ? ~rootLength : rootLength;
12998
13014
  }
12999
- function getEncodedRootLength(path6) {
13000
- if (!path6)
13015
+ function getEncodedRootLength(path7) {
13016
+ if (!path7)
13001
13017
  return 0;
13002
- const ch0 = path6.charCodeAt(0);
13018
+ const ch0 = path7.charCodeAt(0);
13003
13019
  if (ch0 === CharacterCodesSlash || ch0 === CharacterCodesBackslash) {
13004
- if (path6.charCodeAt(1) !== ch0)
13020
+ if (path7.charCodeAt(1) !== ch0)
13005
13021
  return 1;
13006
- const p1 = path6.indexOf(ch0 === CharacterCodesSlash ? directorySeparator : altDirectorySeparator, 2);
13022
+ const p1 = path7.indexOf(ch0 === CharacterCodesSlash ? directorySeparator : altDirectorySeparator, 2);
13007
13023
  if (p1 < 0)
13008
- return path6.length;
13024
+ return path7.length;
13009
13025
  return p1 + 1;
13010
13026
  }
13011
- if (isVolumeCharacter(ch0) && path6.charCodeAt(1) === CharacterCodesColon) {
13012
- const ch2 = path6.charCodeAt(2);
13027
+ if (isVolumeCharacter(ch0) && path7.charCodeAt(1) === CharacterCodesColon) {
13028
+ const ch2 = path7.charCodeAt(2);
13013
13029
  if (ch2 === CharacterCodesSlash || ch2 === CharacterCodesBackslash)
13014
13030
  return 3;
13015
- if (path6.length === 2)
13031
+ if (path7.length === 2)
13016
13032
  return 2;
13017
13033
  }
13018
- const schemeEnd = path6.indexOf(urlSchemeSeparator);
13034
+ const schemeEnd = path7.indexOf(urlSchemeSeparator);
13019
13035
  if (schemeEnd !== -1) {
13020
13036
  const authorityStart = schemeEnd + urlSchemeSeparator.length;
13021
- const authorityEnd = path6.indexOf(directorySeparator, authorityStart);
13037
+ const authorityEnd = path7.indexOf(directorySeparator, authorityStart);
13022
13038
  if (authorityEnd !== -1) {
13023
- const scheme = path6.slice(0, schemeEnd);
13024
- const authority = path6.slice(authorityStart, authorityEnd);
13025
- if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path6.charCodeAt(authorityEnd + 1))) {
13026
- const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path6, authorityEnd + 2);
13039
+ const scheme = path7.slice(0, schemeEnd);
13040
+ const authority = path7.slice(authorityStart, authorityEnd);
13041
+ if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path7.charCodeAt(authorityEnd + 1))) {
13042
+ const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path7, authorityEnd + 2);
13027
13043
  if (volumeSeparatorEnd !== -1) {
13028
- if (path6.charCodeAt(volumeSeparatorEnd) === CharacterCodesSlash) {
13044
+ if (path7.charCodeAt(volumeSeparatorEnd) === CharacterCodesSlash) {
13029
13045
  return ~(volumeSeparatorEnd + 1);
13030
13046
  }
13031
- if (volumeSeparatorEnd === path6.length) {
13047
+ if (volumeSeparatorEnd === path7.length) {
13032
13048
  return ~volumeSeparatorEnd;
13033
13049
  }
13034
13050
  }
13035
13051
  }
13036
13052
  return ~(authorityEnd + 1);
13037
13053
  }
13038
- return ~path6.length;
13054
+ return ~path7.length;
13039
13055
  }
13040
13056
  return 0;
13041
13057
  }
13042
- function hasTrailingDirectorySeparator(path6) {
13043
- return path6.length > 0 && isAnyDirectorySeparator(path6.charCodeAt(path6.length - 1));
13058
+ function hasTrailingDirectorySeparator(path7) {
13059
+ return path7.length > 0 && isAnyDirectorySeparator(path7.charCodeAt(path7.length - 1));
13044
13060
  }
13045
- function removeTrailingDirectorySeparator(path6) {
13046
- if (hasTrailingDirectorySeparator(path6)) {
13047
- return path6.substr(0, path6.length - 1);
13061
+ function removeTrailingDirectorySeparator(path7) {
13062
+ if (hasTrailingDirectorySeparator(path7)) {
13063
+ return path7.substr(0, path7.length - 1);
13048
13064
  }
13049
- return path6;
13065
+ return path7;
13050
13066
  }
13051
- function ensureTrailingDirectorySeparator(path6) {
13052
- if (!hasTrailingDirectorySeparator(path6)) {
13053
- return path6 + directorySeparator;
13067
+ function ensureTrailingDirectorySeparator(path7) {
13068
+ if (!hasTrailingDirectorySeparator(path7)) {
13069
+ return path7 + directorySeparator;
13054
13070
  }
13055
- return path6;
13071
+ return path7;
13056
13072
  }
13057
- function normalizeSlashes(path6) {
13058
- return path6.includes("\\") ? path6.replace(backslashRegExp, directorySeparator) : path6;
13073
+ function normalizeSlashes(path7) {
13074
+ return path7.includes("\\") ? path7.replace(backslashRegExp, directorySeparator) : path7;
13059
13075
  }
13060
- function combinePaths(path6, ...paths) {
13061
- if (path6)
13062
- path6 = normalizeSlashes(path6);
13076
+ function combinePaths(path7, ...paths) {
13077
+ if (path7)
13078
+ path7 = normalizeSlashes(path7);
13063
13079
  for (let relativePath of paths) {
13064
13080
  if (!relativePath)
13065
13081
  continue;
13066
13082
  relativePath = normalizeSlashes(relativePath);
13067
- if (!path6 || getRootLength(relativePath) !== 0) {
13068
- path6 = relativePath;
13083
+ if (!path7 || getRootLength(relativePath) !== 0) {
13084
+ path7 = relativePath;
13069
13085
  } else {
13070
- path6 = ensureTrailingDirectorySeparator(path6) + relativePath;
13086
+ path7 = ensureTrailingDirectorySeparator(path7) + relativePath;
13071
13087
  }
13072
13088
  }
13073
- return path6;
13089
+ return path7;
13074
13090
  }
13075
- function simpleNormalizePath(path6) {
13076
- if (!relativePathSegmentRegExp.test(path6)) {
13077
- return path6;
13091
+ function simpleNormalizePath(path7) {
13092
+ if (!relativePathSegmentRegExp.test(path7)) {
13093
+ return path7;
13078
13094
  }
13079
- let simplified = path6.replace(/\/\.\//g, "/");
13095
+ let simplified = path7.replace(/\/\.\//g, "/");
13080
13096
  if (simplified.startsWith("./")) {
13081
13097
  simplified = simplified.slice(2);
13082
13098
  }
13083
- if (simplified !== path6) {
13084
- path6 = simplified;
13085
- if (!relativePathSegmentRegExp.test(path6)) {
13086
- return path6;
13099
+ if (simplified !== path7) {
13100
+ path7 = simplified;
13101
+ if (!relativePathSegmentRegExp.test(path7)) {
13102
+ return path7;
13087
13103
  }
13088
13104
  }
13089
13105
  return void 0;
13090
13106
  }
13091
- function getNormalizedAbsolutePath(path6, currentDirectory) {
13092
- let rootLength = getRootLength(path6);
13107
+ function getNormalizedAbsolutePath(path7, currentDirectory) {
13108
+ let rootLength = getRootLength(path7);
13093
13109
  if (rootLength === 0 && currentDirectory) {
13094
- path6 = combinePaths(currentDirectory, path6);
13095
- rootLength = getRootLength(path6);
13110
+ path7 = combinePaths(currentDirectory, path7);
13111
+ rootLength = getRootLength(path7);
13096
13112
  } else {
13097
- path6 = normalizeSlashes(path6);
13113
+ path7 = normalizeSlashes(path7);
13098
13114
  }
13099
- const simpleNormalized = simpleNormalizePath(path6);
13115
+ const simpleNormalized = simpleNormalizePath(path7);
13100
13116
  if (simpleNormalized !== void 0) {
13101
13117
  return simpleNormalized.length > rootLength ? removeTrailingDirectorySeparator(simpleNormalized) : simpleNormalized;
13102
13118
  }
13103
- const length = path6.length;
13104
- const root = path6.substring(0, rootLength);
13119
+ const length = path7.length;
13120
+ const root = path7.substring(0, rootLength);
13105
13121
  let normalized;
13106
13122
  let index = rootLength;
13107
13123
  let segmentStart = index;
@@ -13109,23 +13125,23 @@ function getNormalizedAbsolutePath(path6, currentDirectory) {
13109
13125
  let seenNonDotDotSegment = rootLength !== 0;
13110
13126
  while (index < length) {
13111
13127
  segmentStart = index;
13112
- let ch = path6.charCodeAt(index);
13128
+ let ch = path7.charCodeAt(index);
13113
13129
  while (ch === CharacterCodesSlash && index + 1 < length) {
13114
13130
  index++;
13115
- ch = path6.charCodeAt(index);
13131
+ ch = path7.charCodeAt(index);
13116
13132
  }
13117
13133
  if (index > segmentStart) {
13118
- normalized ??= path6.substring(0, segmentStart - 1);
13134
+ normalized ??= path7.substring(0, segmentStart - 1);
13119
13135
  segmentStart = index;
13120
13136
  }
13121
- let segmentEnd = path6.indexOf(directorySeparator, index + 1);
13137
+ let segmentEnd = path7.indexOf(directorySeparator, index + 1);
13122
13138
  if (segmentEnd === -1) {
13123
13139
  segmentEnd = length;
13124
13140
  }
13125
13141
  const segmentLength = segmentEnd - segmentStart;
13126
- if (segmentLength === 1 && path6.charCodeAt(index) === CharacterCodesDot) {
13127
- normalized ??= path6.substring(0, normalizedUpTo);
13128
- } else if (segmentLength === 2 && path6.charCodeAt(index) === CharacterCodesDot && path6.charCodeAt(index + 1) === CharacterCodesDot) {
13142
+ if (segmentLength === 1 && path7.charCodeAt(index) === CharacterCodesDot) {
13143
+ normalized ??= path7.substring(0, normalizedUpTo);
13144
+ } else if (segmentLength === 2 && path7.charCodeAt(index) === CharacterCodesDot && path7.charCodeAt(index + 1) === CharacterCodesDot) {
13129
13145
  if (!seenNonDotDotSegment) {
13130
13146
  if (normalized !== void 0) {
13131
13147
  normalized += normalized.length === rootLength ? ".." : "/..";
@@ -13134,9 +13150,9 @@ function getNormalizedAbsolutePath(path6, currentDirectory) {
13134
13150
  }
13135
13151
  } else if (normalized === void 0) {
13136
13152
  if (normalizedUpTo - 2 >= 0) {
13137
- normalized = path6.substring(0, Math.max(rootLength, path6.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
13153
+ normalized = path7.substring(0, Math.max(rootLength, path7.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
13138
13154
  } else {
13139
- normalized = path6.substring(0, normalizedUpTo);
13155
+ normalized = path7.substring(0, normalizedUpTo);
13140
13156
  }
13141
13157
  } else {
13142
13158
  const lastSlash = normalized.lastIndexOf(directorySeparator);
@@ -13154,26 +13170,26 @@ function getNormalizedAbsolutePath(path6, currentDirectory) {
13154
13170
  normalized += directorySeparator;
13155
13171
  }
13156
13172
  seenNonDotDotSegment = true;
13157
- normalized += path6.substring(segmentStart, segmentEnd);
13173
+ normalized += path7.substring(segmentStart, segmentEnd);
13158
13174
  } else {
13159
13175
  seenNonDotDotSegment = true;
13160
13176
  normalizedUpTo = segmentEnd;
13161
13177
  }
13162
13178
  index = segmentEnd + 1;
13163
13179
  }
13164
- return normalized ?? (length > rootLength ? removeTrailingDirectorySeparator(path6) : path6);
13180
+ return normalized ?? (length > rootLength ? removeTrailingDirectorySeparator(path7) : path7);
13165
13181
  }
13166
- function normalizePath(path6) {
13167
- path6 = normalizeSlashes(path6);
13168
- let normalized = simpleNormalizePath(path6);
13182
+ function normalizePath(path7) {
13183
+ path7 = normalizeSlashes(path7);
13184
+ let normalized = simpleNormalizePath(path7);
13169
13185
  if (normalized !== void 0) {
13170
13186
  return normalized;
13171
13187
  }
13172
- normalized = getNormalizedAbsolutePath(path6, "");
13173
- return normalized && hasTrailingDirectorySeparator(path6) ? ensureTrailingDirectorySeparator(normalized) : normalized;
13188
+ normalized = getNormalizedAbsolutePath(path7, "");
13189
+ return normalized && hasTrailingDirectorySeparator(path7) ? ensureTrailingDirectorySeparator(normalized) : normalized;
13174
13190
  }
13175
- function isRootedDiskPath(path6) {
13176
- return getEncodedRootLength(path6) > 0;
13191
+ function isRootedDiskPath(path7) {
13192
+ return getEncodedRootLength(path7) > 0;
13177
13193
  }
13178
13194
  function toPath(fileName, basePath, getCanonicalFileName) {
13179
13195
  const nonCanonicalizedPath = isRootedDiskPath(fileName) ? normalizePath(fileName) : getNormalizedAbsolutePath(fileName, basePath);
@@ -13189,14 +13205,14 @@ function toLowerCase(s) {
13189
13205
  return s.toLowerCase();
13190
13206
  }
13191
13207
  var bundledScheme = "bundled:///";
13192
- function isBundled(path6) {
13193
- return path6.startsWith(bundledScheme);
13208
+ function isBundled(path7) {
13209
+ return path7.startsWith(bundledScheme);
13194
13210
  }
13195
- function splitVolumePath(path6) {
13196
- if (path6.length >= 2 && isVolumeCharacter(path6.charCodeAt(0)) && path6.charCodeAt(1) === CharacterCodesColon) {
13197
- return [path6.substring(0, 2).toLowerCase(), path6.substring(2), true];
13211
+ function splitVolumePath(path7) {
13212
+ if (path7.length >= 2 && isVolumeCharacter(path7.charCodeAt(0)) && path7.charCodeAt(1) === CharacterCodesColon) {
13213
+ return [path7.substring(0, 2).toLowerCase(), path7.substring(2), true];
13198
13214
  }
13199
- return ["", path6, false];
13215
+ return ["", path7, false];
13200
13216
  }
13201
13217
  function documentURIToFileName(uri) {
13202
13218
  if (isBundled(uri)) {
@@ -13212,32 +13228,32 @@ function documentURIToFileName(uri) {
13212
13228
  if (parsed.host !== "") {
13213
13229
  return "//" + parsed.host + parsed.pathname;
13214
13230
  }
13215
- const path7 = decodeURIComponent(parsed.pathname);
13216
- if (path7.length >= 3 && path7.charCodeAt(0) === CharacterCodesSlash) {
13217
- const [volume, rest, ok] = splitVolumePath(path7.substring(1));
13231
+ const path8 = decodeURIComponent(parsed.pathname);
13232
+ if (path8.length >= 3 && path8.charCodeAt(0) === CharacterCodesSlash) {
13233
+ const [volume, rest, ok] = splitVolumePath(path8.substring(1));
13218
13234
  if (ok) {
13219
13235
  return volume + rest;
13220
13236
  }
13221
13237
  }
13222
- return path7;
13238
+ return path8;
13223
13239
  }
13224
13240
  const colonIndex = uri.indexOf(":");
13225
13241
  if (colonIndex === -1) {
13226
13242
  throw new Error("invalid URI: " + uri);
13227
13243
  }
13228
13244
  const scheme = uri.substring(0, colonIndex);
13229
- let path6 = uri.substring(colonIndex + 1);
13245
+ let path7 = uri.substring(colonIndex + 1);
13230
13246
  let authority = "ts-nul-authority";
13231
- if (path6.startsWith("//")) {
13232
- const rest = path6.substring(2);
13247
+ if (path7.startsWith("//")) {
13248
+ const rest = path7.substring(2);
13233
13249
  const slashIndex = rest.indexOf("/");
13234
13250
  if (slashIndex === -1) {
13235
13251
  throw new Error("invalid URI: " + uri);
13236
13252
  }
13237
13253
  authority = rest.substring(0, slashIndex);
13238
- path6 = rest.substring(slashIndex + 1);
13254
+ path7 = rest.substring(slashIndex + 1);
13239
13255
  }
13240
- return "^/" + scheme + "/" + authority + "/" + path6;
13256
+ return "^/" + scheme + "/" + authority + "/" + path7;
13241
13257
  }
13242
13258
 
13243
13259
  // node_modules/.pnpm/typescript@7.0.2/node_modules/typescript/dist/api/proto.js
@@ -13274,8 +13290,8 @@ var SourceFileCache = class {
13274
13290
  * A given (snapshot, project) pair always parses a file the same way, so there is
13275
13291
  * at most one matching entry per ref.
13276
13292
  */
13277
- getRetained(path6, snapshotId, projectId) {
13278
- const entries = this.cache.get(path6);
13293
+ getRetained(path7, snapshotId, projectId) {
13294
+ const entries = this.cache.get(path7);
13279
13295
  if (!entries)
13280
13296
  return void 0;
13281
13297
  const key2 = refKey(snapshotId, projectId);
@@ -13286,21 +13302,21 @@ var SourceFileCache = class {
13286
13302
  * Store a source file in the cache and retain it for the given (snapshot, project) pair.
13287
13303
  * Returns the cached file — which may be an existing entry if the hash matches.
13288
13304
  */
13289
- set(path6, file2, parseOptionsKey, contentHash, snapshotId, projectId) {
13290
- let entries = this.cache.get(path6);
13305
+ set(path7, file2, parseOptionsKey, contentHash, snapshotId, projectId) {
13306
+ let entries = this.cache.get(path7);
13291
13307
  if (!entries) {
13292
13308
  entries = [];
13293
- this.cache.set(path6, entries);
13309
+ this.cache.set(path7, entries);
13294
13310
  }
13295
13311
  const ref = refKey(snapshotId, projectId);
13296
13312
  const existing = entries.find((e) => e.parseOptionsKey === parseOptionsKey && e.contentHash === contentHash);
13297
13313
  if (existing) {
13298
13314
  existing.refs.add(ref);
13299
- this.trackPath(snapshotId, projectId, path6);
13315
+ this.trackPath(snapshotId, projectId, path7);
13300
13316
  return existing.file;
13301
13317
  }
13302
13318
  entries.push({ file: file2, contentHash, parseOptionsKey, refs: /* @__PURE__ */ new Set([ref]) });
13303
- this.trackPath(snapshotId, projectId, path6);
13319
+ this.trackPath(snapshotId, projectId, path7);
13304
13320
  return file2;
13305
13321
  }
13306
13322
  /**
@@ -13330,16 +13346,16 @@ var SourceFileCache = class {
13330
13346
  }
13331
13347
  const prevRef = refKey(previousSnapshotId, projectId);
13332
13348
  const newRef = refKey(newSnapshotId, projectId);
13333
- for (const path6 of paths) {
13334
- if (invalidPaths?.has(path6))
13349
+ for (const path7 of paths) {
13350
+ if (invalidPaths?.has(path7))
13335
13351
  continue;
13336
- const entries = this.cache.get(path6);
13352
+ const entries = this.cache.get(path7);
13337
13353
  if (!entries)
13338
13354
  continue;
13339
13355
  for (const entry of entries) {
13340
13356
  if (entry.refs.has(prevRef)) {
13341
13357
  entry.refs.add(newRef);
13342
- this.trackPath(newSnapshotId, projectId, path6);
13358
+ this.trackPath(newSnapshotId, projectId, path7);
13343
13359
  }
13344
13360
  }
13345
13361
  }
@@ -13356,8 +13372,8 @@ var SourceFileCache = class {
13356
13372
  return;
13357
13373
  for (const [projectId, paths] of projectMap) {
13358
13374
  const key2 = refKey(snapshotId, projectId);
13359
- for (const path6 of paths) {
13360
- const entries = this.cache.get(path6);
13375
+ for (const path7 of paths) {
13376
+ const entries = this.cache.get(path7);
13361
13377
  if (!entries)
13362
13378
  continue;
13363
13379
  for (let i = entries.length - 1; i >= 0; i--) {
@@ -13367,13 +13383,13 @@ var SourceFileCache = class {
13367
13383
  }
13368
13384
  }
13369
13385
  if (entries.length === 0) {
13370
- this.cache.delete(path6);
13386
+ this.cache.delete(path7);
13371
13387
  }
13372
13388
  }
13373
13389
  }
13374
13390
  this.snapshotProjectPaths.delete(snapshotId);
13375
13391
  }
13376
- trackPath(snapshotId, projectId, path6) {
13392
+ trackPath(snapshotId, projectId, path7) {
13377
13393
  let projectMap = this.snapshotProjectPaths.get(snapshotId);
13378
13394
  if (!projectMap) {
13379
13395
  projectMap = /* @__PURE__ */ new Map();
@@ -13384,7 +13400,7 @@ var SourceFileCache = class {
13384
13400
  paths = /* @__PURE__ */ new Set();
13385
13401
  projectMap.set(projectId, paths);
13386
13402
  }
13387
- paths.add(path6);
13403
+ paths.add(path7);
13388
13404
  }
13389
13405
  /**
13390
13406
  * Clear all entries from the cache.
@@ -13402,8 +13418,8 @@ var SourceFileCache = class {
13402
13418
  /**
13403
13419
  * Check if a path is in the cache.
13404
13420
  */
13405
- has(path6) {
13406
- return this.cache.has(path6);
13421
+ has(path7) {
13422
+ return this.cache.has(path7);
13407
13423
  }
13408
13424
  };
13409
13425
 
@@ -13416,12 +13432,12 @@ var fsCallbackNames = ["readFile", "fileExists", "directoryExists", "getAccessib
13416
13432
  // node_modules/.pnpm/typescript@7.0.2/node_modules/typescript/lib/getExePath.js
13417
13433
  import fs from "node:fs";
13418
13434
  import module from "node:module";
13419
- import path from "node:path";
13435
+ import path2 from "node:path";
13420
13436
  import { fileURLToPath } from "node:url";
13421
13437
  function getExePath() {
13422
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
13438
+ const __dirname = path2.dirname(fileURLToPath(import.meta.url));
13423
13439
  const normalizedDirname = __dirname.replace(/\\/g, "/");
13424
- const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"));
13440
+ const pkg = JSON.parse(fs.readFileSync(path2.join(__dirname, "..", "package.json"), "utf8"));
13425
13441
  const pkgName = pkg.name;
13426
13442
  const baseName = pkgName.startsWith("@") ? pkgName.split("/")[1] : pkgName;
13427
13443
  const expectedBinName = baseName === "typescript" ? "tsc" : "tsgo";
@@ -13433,27 +13449,27 @@ function getExePath() {
13433
13449
  let exeDir;
13434
13450
  const expectedPackage = baseName + "-" + process.platform + "-" + process.arch;
13435
13451
  if (normalizedDirname.endsWith("/_packages/" + baseName + "/lib")) {
13436
- exeDir = path.resolve(__dirname, "..", "..", "..", "built", "local");
13452
+ exeDir = path2.resolve(__dirname, "..", "..", "..", "built", "local");
13437
13453
  binName = "tsgo";
13438
13454
  } else if (normalizedDirname.endsWith("/built/npm/" + baseName + "/lib")) {
13439
- exeDir = path.resolve(__dirname, "..", "..", expectedPackage, "lib");
13455
+ exeDir = path2.resolve(__dirname, "..", "..", expectedPackage, "lib");
13440
13456
  } else {
13441
13457
  const platformPackageName = "@typescript/" + expectedPackage;
13442
13458
  try {
13443
13459
  if (typeof import.meta.resolve === "undefined") {
13444
13460
  const require2 = module.createRequire(import.meta.url);
13445
13461
  const packageJson = require2.resolve(platformPackageName + "/package.json");
13446
- exeDir = path.join(path.dirname(packageJson), "lib");
13462
+ exeDir = path2.join(path2.dirname(packageJson), "lib");
13447
13463
  } else {
13448
13464
  const packageJson = import.meta.resolve(platformPackageName + "/package.json");
13449
13465
  const packageJsonPath = fileURLToPath(packageJson);
13450
- exeDir = path.join(path.dirname(packageJsonPath), "lib");
13466
+ exeDir = path2.join(path2.dirname(packageJsonPath), "lib");
13451
13467
  }
13452
13468
  } catch (e) {
13453
13469
  throw new Error("Unable to resolve " + platformPackageName + ". Either your platform is unsupported, or you are missing the package on disk.");
13454
13470
  }
13455
13471
  }
13456
- let exe = path.join(exeDir, binName);
13472
+ let exe = path2.join(exeDir, binName);
13457
13473
  if (process.platform === "win32") {
13458
13474
  exe += ".exe";
13459
13475
  if (exe.length >= 248) {
@@ -14186,8 +14202,8 @@ var Program = class {
14186
14202
  }
14187
14203
  async getSourceFile(file2) {
14188
14204
  const fileName = resolveFileName(file2);
14189
- const path6 = this.toPath(fileName);
14190
- const retained = this.sourceFileCache.getRetained(path6, this.snapshotId, this.project.id);
14205
+ const path7 = this.toPath(fileName);
14206
+ const retained = this.sourceFileCache.getRetained(path7, this.snapshotId, this.project.id);
14191
14207
  if (retained) {
14192
14208
  return retained;
14193
14209
  }
@@ -14203,7 +14219,7 @@ var Program = class {
14203
14219
  const contentHash = readSourceFileHash(view);
14204
14220
  const parseOptionsKey = readParseOptionsKey(view);
14205
14221
  const sourceFile = new RemoteSourceFile(binaryData, this.decoder, this.client.getTimingCollector());
14206
- return this.sourceFileCache.set(path6, sourceFile, parseOptionsKey, contentHash, this.snapshotId, this.project.id);
14222
+ return this.sourceFileCache.set(path7, sourceFile, parseOptionsKey, contentHash, this.snapshotId, this.project.id);
14207
14223
  }
14208
14224
  async getSourceFileNames() {
14209
14225
  const data = await this.client.apiRequest("getSourceFileNames", {
@@ -14226,19 +14242,19 @@ var Program = class {
14226
14242
  * the file name to path conversion. Metadata is fetched lazily per file and cached on
14227
14243
  * this `Program` instance.
14228
14244
  */
14229
- getSourceFileMetadataByPath(path6) {
14230
- let metadata = this.sourceFileMetadataCache.get(path6);
14245
+ getSourceFileMetadataByPath(path7) {
14246
+ let metadata = this.sourceFileMetadataCache.get(path7);
14231
14247
  if (metadata === void 0) {
14232
- metadata = this.fetchSourceFileMetadata(path6);
14233
- this.sourceFileMetadataCache.set(path6, metadata);
14248
+ metadata = this.fetchSourceFileMetadata(path7);
14249
+ this.sourceFileMetadataCache.set(path7, metadata);
14234
14250
  }
14235
14251
  return metadata;
14236
14252
  }
14237
- async fetchSourceFileMetadata(path6) {
14253
+ async fetchSourceFileMetadata(path7) {
14238
14254
  const data = await this.client.apiRequest("getSourceFileMetadata", {
14239
14255
  snapshot: this.snapshotId,
14240
14256
  project: this.project.id,
14241
- file: path6
14257
+ file: path7
14242
14258
  });
14243
14259
  return data ?? void 0;
14244
14260
  }
@@ -15463,25 +15479,26 @@ async function withMapCompiler(options, operation) {
15463
15479
  }
15464
15480
 
15465
15481
  // src/project-map-configuration.ts
15466
- import path4 from "node:path";
15482
+ import path5 from "node:path";
15467
15483
 
15468
15484
  // src/project-map-virtual-files.ts
15469
15485
  import { readdirSync, readFileSync } from "node:fs";
15470
- import path2 from "node:path";
15486
+ import path3 from "node:path";
15471
15487
  var MAP_WORKSPACE = "/layermap/";
15472
15488
  var mapVirtualPath = (relative) => `${MAP_WORKSPACE}${relative}`;
15473
15489
  var mapRelativePath = (absolute) => absolute.startsWith(MAP_WORKSPACE) ? absolute.slice(MAP_WORKSPACE.length) : void 0;
15490
+ var mapForwardSlashes = (file2) => file2.replaceAll("\\", "/");
15474
15491
  var MapVirtualFiles = class {
15475
15492
  constructor(input) {
15476
15493
  this.input = input;
15477
15494
  for (const [relative, text2] of Object.entries(input.files))
15478
15495
  this.files.set(mapVirtualPath(relative), text2);
15479
15496
  for (const relative of input.inventory) this.inventory.set(mapVirtualPath(relative), relative);
15480
- const libraryDirectory = path2.dirname(input.compilerPath);
15497
+ const libraryDirectory = path3.dirname(input.compilerPath);
15481
15498
  for (const name of readdirSync(libraryDirectory)) {
15482
15499
  if (!/^lib(?:\.[a-z0-9_-]+)*\.d\.ts$/u.test(name)) continue;
15483
- const text2 = readFileSync(path2.join(libraryDirectory, name), "utf8");
15484
- this.files.set(path2.join(libraryDirectory, name), text2);
15500
+ const text2 = readFileSync(path3.join(libraryDirectory, name), "utf8");
15501
+ this.files.set(mapForwardSlashes(path3.join(libraryDirectory, name)), text2);
15485
15502
  }
15486
15503
  for (const file2 of /* @__PURE__ */ new Set([...this.files.keys(), ...this.inventory.keys()]))
15487
15504
  this.addPath(file2);
@@ -15503,6 +15520,7 @@ var MapVirtualFiles = class {
15503
15520
  this.addPath(mapVirtualPath(`${relative}/package.json`));
15504
15521
  }
15505
15522
  canonical(file2) {
15523
+ file2 = mapForwardSlashes(file2);
15506
15524
  for (const [alias, target] of this.aliases)
15507
15525
  if (file2 === alias || file2.startsWith(`${alias}/`)) return target + file2.slice(alias.length);
15508
15526
  return file2;
@@ -15556,7 +15574,7 @@ var MapVirtualFiles = class {
15556
15574
  };
15557
15575
 
15558
15576
  // src/project-map-workspace-membership.ts
15559
- import path3 from "node:path";
15577
+ import path4 from "node:path";
15560
15578
  function pnpmPackages(text2) {
15561
15579
  const lines = text2.replace(/^\uFEFF/u, "").split(/\r?\n/u).filter((line) => line.trim() && !line.trimStart().startsWith("#"));
15562
15580
  if (!/^packages:\s*(?:#.*)?$/u.test(lines[0] ?? "")) return void 0;
@@ -15591,7 +15609,7 @@ function mapWorkspaceMembership(files) {
15591
15609
  }
15592
15610
  }
15593
15611
  const valid = Array.isArray(patterns) && patterns.every(
15594
- (entry) => typeof entry === "string" && entry.length > 0 && !path3.posix.isAbsolute(entry.replace(/^!/u, "")) && !entry.split("/").some((segment) => segment === "..")
15612
+ (entry) => typeof entry === "string" && entry.length > 0 && !path4.posix.isAbsolute(entry.replace(/^!/u, "")) && !entry.split("/").some((segment) => segment === "..")
15595
15613
  );
15596
15614
  const accepted = valid ? patterns : [];
15597
15615
  const code = valid ? void 0 : pnpm !== void 0 ? "WORKSPACE_CONFIGURATION_UNSUPPORTED" : "WORKSPACE_MEMBERSHIP_NOT_ADMITTED";
@@ -15599,9 +15617,9 @@ function mapWorkspaceMembership(files) {
15599
15617
  configurationFiles,
15600
15618
  code,
15601
15619
  contains: (directory) => accepted.some(
15602
- (pattern) => !pattern.startsWith("!") && path3.posix.matchesGlob(directory, pattern)
15620
+ (pattern) => !pattern.startsWith("!") && path4.posix.matchesGlob(directory, pattern)
15603
15621
  ) && !accepted.some(
15604
- (pattern) => pattern.startsWith("!") && path3.posix.matchesGlob(directory, pattern.slice(1))
15622
+ (pattern) => pattern.startsWith("!") && path4.posix.matchesGlob(directory, pattern.slice(1))
15605
15623
  )
15606
15624
  };
15607
15625
  }
@@ -15646,7 +15664,7 @@ async function discoverMapConfiguration(api, files) {
15646
15664
  issues.add(membership.code);
15647
15665
  continue;
15648
15666
  }
15649
- if (!membership.contains(path4.posix.dirname(definition.path)) && definition.path !== "package.json")
15667
+ if (!membership.contains(path5.posix.dirname(definition.path)) && definition.path !== "package.json")
15650
15668
  continue;
15651
15669
  const targets = manifests.get(name);
15652
15670
  if (targets?.length !== 1) {
@@ -15655,13 +15673,13 @@ async function discoverMapConfiguration(api, files) {
15655
15673
  }
15656
15674
  const target = targets[0];
15657
15675
  if (!target) continue;
15658
- if (!membership.contains(path4.posix.dirname(target.path))) {
15676
+ if (!membership.contains(path5.posix.dirname(target.path))) {
15659
15677
  issues.add("WORKSPACE_DEPENDENCY_TARGET_NOT_AVAILABLE");
15660
15678
  continue;
15661
15679
  }
15662
15680
  links.push({
15663
- from: path4.posix.join(path4.posix.dirname(definition.path), "node_modules", name),
15664
- to: path4.posix.dirname(target.path)
15681
+ from: path5.posix.join(path5.posix.dirname(definition.path), "node_modules", name),
15682
+ to: path5.posix.dirname(target.path)
15665
15683
  });
15666
15684
  }
15667
15685
  }
@@ -15679,10 +15697,10 @@ async function discoverMapConfiguration(api, files) {
15679
15697
  continue;
15680
15698
  const relative = mapRelativePath(source);
15681
15699
  if (!relative || !files.input.inventory.includes(relative)) continue;
15682
- const stem = path4.posix.join(outDir, source.slice(rootDir.length + 1)).replace(/\.[cm]?tsx?$/u, "");
15700
+ const stem = path5.posix.join(outDir, source.slice(rootDir.length + 1)).replace(/\.[cm]?tsx?$/u, "");
15683
15701
  const extensions = source.endsWith(".mts") ? [".mjs", ".d.mts"] : source.endsWith(".cts") ? [".cjs", ".d.cts"] : [source.endsWith(".tsx") && parsed.options.jsx === 1 ? ".jsx" : ".js", ".d.ts"];
15684
15702
  for (const extension of extensions) {
15685
- const location = extension.startsWith(".d.") && typeof declarationDir === "string" ? path4.posix.join(declarationDir, source.slice(rootDir.length + 1)).replace(/\.[cm]?tsx?$/u, "") : stem;
15703
+ const location = extension.startsWith(".d.") && typeof declarationDir === "string" ? path5.posix.join(declarationDir, source.slice(rootDir.length + 1)).replace(/\.[cm]?tsx?$/u, "") : stem;
15686
15704
  const output = mapRelativePath(location + extension);
15687
15705
  if (!output) continue;
15688
15706
  const into = outputs.get(output);
@@ -15698,7 +15716,7 @@ async function discoverMapConfiguration(api, files) {
15698
15716
  if (!manifest) continue;
15699
15717
  const visit = (value) => {
15700
15718
  if (typeof value === "string" && value.startsWith("./")) {
15701
- const output = path4.posix.join(path4.posix.dirname(manifest.path), value);
15719
+ const output = path5.posix.join(path5.posix.dirname(manifest.path), value);
15702
15720
  const candidates = outputs.get(output) ?? [];
15703
15721
  const sources = new Set(candidates.map((candidate2) => candidate2.source));
15704
15722
  const candidate = candidates[0];
@@ -15772,8 +15790,8 @@ function applyMapWorkspaceContents(files, workspace) {
15772
15790
  );
15773
15791
  const rewrite = (entry) => {
15774
15792
  if (typeof entry === "string" && entry.startsWith("./")) {
15775
- const source = replacements.get(path4.posix.join(path4.posix.dirname(manifest), entry));
15776
- return source ? `./${path4.posix.relative(path4.posix.dirname(manifest), source)}` : entry;
15793
+ const source = replacements.get(path5.posix.join(path5.posix.dirname(manifest), entry));
15794
+ return source ? `./${path5.posix.relative(path5.posix.dirname(manifest), source)}` : entry;
15777
15795
  }
15778
15796
  if (Array.isArray(entry)) return entry.map(rewrite);
15779
15797
  if (entry && typeof entry === "object")
@@ -16168,8 +16186,8 @@ var pathText = (node) => {
16168
16186
  };
16169
16187
  var isFunction = (node) => node.kind === SyntaxKind.ArrowFunction || node.kind === SyntaxKind.FunctionExpression;
16170
16188
  var isDeclaration = (node) => node.kind === SyntaxKind.FunctionDeclaration || node.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.SourceFile;
16171
- function joinRoute(prefix, path6) {
16172
- const joined = !prefix ? path6 : !path6 ? prefix : `${prefix.replace(/\/+$/u, "")}/${path6.replace(/^\/+/u, "")}`;
16189
+ function joinRoute(prefix, path7) {
16190
+ const joined = !prefix ? path7 : !path7 ? prefix : `${prefix.replace(/\/+$/u, "")}/${path7.replace(/^\/+/u, "")}`;
16173
16191
  return joined.startsWith("/") || joined.startsWith("$") ? joined : `/${joined}`;
16174
16192
  }
16175
16193
  var httpMethod = (name) => HTTP_METHODS.has(name.toUpperCase()) ? name.toUpperCase() : void 0;
@@ -16187,25 +16205,25 @@ function registeredRoute(node, kind) {
16187
16205
  function routeOf(call, index) {
16188
16206
  const callee = call.expression;
16189
16207
  const name = isPropertyAccessExpression(callee) ? callee.name.text : void 0;
16190
- let path6;
16208
+ let path7;
16191
16209
  let receiver = isPropertyAccessExpression(callee) ? callee.expression : void 0;
16192
16210
  const at = call.arguments.findIndex((argument) => pathText(argument) !== void 0);
16193
16211
  if (at >= 0) {
16194
16212
  if (index <= at) return void 0;
16195
- path6 = pathText(call.arguments[at]);
16213
+ path7 = pathText(call.arguments[at]);
16196
16214
  } else if (name && httpMethod(name) && receiver && isCallExpression(receiver) && isPropertyAccessExpression(receiver.expression) && receiver.arguments.length === 1) {
16197
- path6 = pathText(receiver.arguments[0]);
16215
+ path7 = pathText(receiver.arguments[0]);
16198
16216
  receiver = receiver.expression.expression;
16199
16217
  }
16200
- if (path6 === void 0) return void 0;
16218
+ if (path7 === void 0) return void 0;
16201
16219
  let method;
16202
- const space = path6.indexOf(" ");
16203
- if (space > 0) [method, path6] = [path6.slice(0, space), path6.slice(space).trimStart()];
16220
+ const space = path7.indexOf(" ");
16221
+ if (space > 0) [method, path7] = [path7.slice(0, space), path7.slice(space).trimStart()];
16204
16222
  method ??= name ? httpMethod(name) : void 0;
16205
- if (path6 === "/" && !method) return void 0;
16206
- const full = joinRoute(receiver ? routerPrefix(receiver, 0) : "", path6);
16223
+ if (path7 === "/" && !method) return void 0;
16224
+ const full = joinRoute(receiver ? routerPrefix(receiver, 0) : "", path7);
16207
16225
  const label = method ? `${method} ${full}` : full;
16208
- return label.length <= 256 ? { label, ...method ? { method } : {} } : { label: path6 };
16226
+ return label.length <= 256 ? { label, ...method ? { method } : {} } : { label: path7 };
16209
16227
  }
16210
16228
  function routerPrefix(expression, depth) {
16211
16229
  if (depth > 8) return "";
@@ -16213,8 +16231,8 @@ function routerPrefix(expression, depth) {
16213
16231
  const callee = expression.expression;
16214
16232
  if (!isPropertyAccessExpression(callee)) return "";
16215
16233
  const base = routerPrefix(callee.expression, depth + 1);
16216
- const path6 = expression.arguments.length === 1 ? pathText(expression.arguments[0]) : void 0;
16217
- return path6 === void 0 || path6.includes(" ") ? base : joinRoute(base, path6);
16234
+ const path7 = expression.arguments.length === 1 ? pathText(expression.arguments[0]) : void 0;
16235
+ return path7 === void 0 || path7.includes(" ") ? base : joinRoute(base, path7);
16218
16236
  }
16219
16237
  if (isIdentifier(expression)) {
16220
16238
  const declaration = constDeclaration(expression);
@@ -16256,8 +16274,8 @@ function decoratorRoute(decorator, argument) {
16256
16274
  break;
16257
16275
  }
16258
16276
  }
16259
- const path6 = argument ?? (call && text(call.arguments[0])) ?? "";
16260
- const route = `${method} ${joinRoute(prefix, path6)}`;
16277
+ const path7 = argument ?? (call && text(call.arguments[0])) ?? "";
16278
+ const route = `${method} ${joinRoute(prefix, path7)}`;
16261
16279
  return route.length <= 256 ? route : void 0;
16262
16280
  }
16263
16281
 
@@ -17098,10 +17116,10 @@ function mergeDefs(...defs) {
17098
17116
  function cloneDef(schema) {
17099
17117
  return mergeDefs(schema._zod.def);
17100
17118
  }
17101
- function getElementAtPath(obj, path6) {
17102
- if (!path6)
17119
+ function getElementAtPath(obj, path7) {
17120
+ if (!path7)
17103
17121
  return obj;
17104
- return path6.reduce((acc, key2) => acc?.[key2], obj);
17122
+ return path7.reduce((acc, key2) => acc?.[key2], obj);
17105
17123
  }
17106
17124
  function promiseAllObject(promisesObj) {
17107
17125
  const keys = Object.keys(promisesObj);
@@ -17510,11 +17528,11 @@ function explicitlyAborted(x, startIndex = 0) {
17510
17528
  }
17511
17529
  return false;
17512
17530
  }
17513
- function prefixIssues(path6, issues) {
17531
+ function prefixIssues(path7, issues) {
17514
17532
  return issues.map((iss) => {
17515
17533
  var _a3;
17516
17534
  (_a3 = iss).path ?? (_a3.path = []);
17517
- iss.path.unshift(path6);
17535
+ iss.path.unshift(path7);
17518
17536
  return iss;
17519
17537
  });
17520
17538
  }
@@ -17661,16 +17679,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
17661
17679
  }
17662
17680
  function formatError(error51, mapper = (issue2) => issue2.message) {
17663
17681
  const fieldErrors = { _errors: [] };
17664
- const processError = (error52, path6 = []) => {
17682
+ const processError = (error52, path7 = []) => {
17665
17683
  for (const issue2 of error52.issues) {
17666
17684
  if (issue2.code === "invalid_union" && issue2.errors.length) {
17667
- issue2.errors.map((issues) => processError({ issues }, [...path6, ...issue2.path]));
17685
+ issue2.errors.map((issues) => processError({ issues }, [...path7, ...issue2.path]));
17668
17686
  } else if (issue2.code === "invalid_key") {
17669
- processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
17687
+ processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
17670
17688
  } else if (issue2.code === "invalid_element") {
17671
- processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
17689
+ processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
17672
17690
  } else {
17673
- const fullpath = [...path6, ...issue2.path];
17691
+ const fullpath = [...path7, ...issue2.path];
17674
17692
  if (fullpath.length === 0) {
17675
17693
  fieldErrors._errors.push(mapper(issue2));
17676
17694
  } else {
@@ -17697,17 +17715,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
17697
17715
  }
17698
17716
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
17699
17717
  const result = { errors: [] };
17700
- const processError = (error52, path6 = []) => {
17718
+ const processError = (error52, path7 = []) => {
17701
17719
  var _a3, _b;
17702
17720
  for (const issue2 of error52.issues) {
17703
17721
  if (issue2.code === "invalid_union" && issue2.errors.length) {
17704
- issue2.errors.map((issues) => processError({ issues }, [...path6, ...issue2.path]));
17722
+ issue2.errors.map((issues) => processError({ issues }, [...path7, ...issue2.path]));
17705
17723
  } else if (issue2.code === "invalid_key") {
17706
- processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
17724
+ processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
17707
17725
  } else if (issue2.code === "invalid_element") {
17708
- processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
17726
+ processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
17709
17727
  } else {
17710
- const fullpath = [...path6, ...issue2.path];
17728
+ const fullpath = [...path7, ...issue2.path];
17711
17729
  if (fullpath.length === 0) {
17712
17730
  result.errors.push(mapper(issue2));
17713
17731
  continue;
@@ -17739,8 +17757,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
17739
17757
  }
17740
17758
  function toDotPath(_path) {
17741
17759
  const segs = [];
17742
- const path6 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
17743
- for (const seg of path6) {
17760
+ const path7 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
17761
+ for (const seg of path7) {
17744
17762
  if (typeof seg === "number")
17745
17763
  segs.push(`[${seg}]`);
17746
17764
  else if (typeof seg === "symbol")
@@ -30432,13 +30450,13 @@ function resolveRef(ref, ctx) {
30432
30450
  if (!ref.startsWith("#")) {
30433
30451
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
30434
30452
  }
30435
- const path6 = ref.slice(1).split("/").filter(Boolean);
30436
- if (path6.length === 0) {
30453
+ const path7 = ref.slice(1).split("/").filter(Boolean);
30454
+ if (path7.length === 0) {
30437
30455
  return ctx.rootSchema;
30438
30456
  }
30439
30457
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
30440
- if (path6[0] === defsKey) {
30441
- const key2 = path6[1];
30458
+ if (path7[0] === defsKey) {
30459
+ const key2 = path7[1];
30442
30460
  if (!key2 || !ctx.defs[key2]) {
30443
30461
  throw new Error(`Reference not found: ${ref}`);
30444
30462
  }
@@ -31167,8 +31185,8 @@ async function extractProjectMap(project, input, trace) {
31167
31185
  identities.set(key(node), value);
31168
31186
  return value;
31169
31187
  };
31170
- const gap = (code, path6) => {
31171
- output.gaps.push({ code, ...path6 ? { path: path6 } : {} });
31188
+ const gap = (code, path7) => {
31189
+ output.gaps.push({ code, ...path7 ? { path: path7 } : {} });
31172
31190
  };
31173
31191
  const addObject = (node, file2, kind, name) => {
31174
31192
  const location = anchor(node, file2);
@@ -31196,18 +31214,18 @@ async function extractProjectMap(project, input, trace) {
31196
31214
  return object2;
31197
31215
  };
31198
31216
  trace.phase = "SOURCE_FILES";
31199
- for await (const { file: file2, path: path6, syntaxErrors, exports } of mapSourceFiles(project, input, trace)) {
31217
+ for await (const { file: file2, path: path7, syntaxErrors, exports } of mapSourceFiles(project, input, trace)) {
31200
31218
  if (!file2) {
31201
- gap("SOURCE_NOT_PARSED", path6);
31219
+ gap("SOURCE_NOT_PARSED", path7);
31202
31220
  continue;
31203
31221
  }
31204
31222
  if (syntaxErrors) {
31205
- gap("SYNTAX_ERROR", path6);
31223
+ gap("SYNTAX_ERROR", path7);
31206
31224
  continue;
31207
31225
  }
31208
- output.parsedFiles.push(path6);
31209
- const fileObject = addObject(file2, file2, "FILE", path6);
31210
- if (!owned.has(path6)) continue;
31226
+ output.parsedFiles.push(path7);
31227
+ const fileObject = addObject(file2, file2, "FILE", path7);
31228
+ if (!owned.has(path7)) continue;
31211
31229
  exportedSymbols.set(file2.fileName, exports);
31212
31230
  const state = moduleStateNames(file2);
31213
31231
  trace.phase = "TRAVERSAL";
@@ -31234,7 +31252,7 @@ async function extractProjectMap(project, input, trace) {
31234
31252
  executionDeclaration?.kind ?? kind,
31235
31253
  executionDeclaration?.name ?? mapNodeLabel(name)
31236
31254
  );
31237
- if (owned.has(path6))
31255
+ if (owned.has(path7))
31238
31256
  collect.relation({
31239
31257
  from: owner.id,
31240
31258
  to: object2.id,
@@ -31243,11 +31261,11 @@ async function extractProjectMap(project, input, trace) {
31243
31261
  target: object2.name,
31244
31262
  basis: "SYNTAX_DECLARED"
31245
31263
  });
31246
- if (owned.has(path6) && name) declarations.push({ object: object2, name, node, file: file2 });
31264
+ if (owned.has(path7) && name) declarations.push({ object: object2, name, node, file: file2 });
31247
31265
  if (object2.kind === "VARIABLE" && !object2.execution && item.owner.kind === "FILE")
31248
31266
  moduleVariables.add(object2.id);
31249
31267
  owner = object2;
31250
- if (kind === "INTERFACE" && owned.has(path6)) {
31268
+ if (kind === "INTERFACE" && owned.has(path7)) {
31251
31269
  const note = {
31252
31270
  entityRef: object2.id,
31253
31271
  kind: "CONTRACT_DECLARATION",
@@ -31264,7 +31282,7 @@ async function extractProjectMap(project, input, trace) {
31264
31282
  reference = {
31265
31283
  node,
31266
31284
  lookup: moduleSpecifier,
31267
- kind: /(?:^|[/.])(?:test|spec|tests)(?:[/.]|$)/u.test(path6) ? "TEST_IMPORTS" : "IMPORTS",
31285
+ kind: /(?:^|[/.])(?:test|spec|tests)(?:[/.]|$)/u.test(path7) ? "TEST_IMPORTS" : "IMPORTS",
31268
31286
  target: moduleSpecifier.text
31269
31287
  };
31270
31288
  } else if (isCallExpression(node) || isNewExpression(node)) {
@@ -31363,7 +31381,7 @@ async function extractProjectMap(project, input, trace) {
31363
31381
  }
31364
31382
  if (isObjectLiteralExpression(node) || (isClassDeclaration(node) || node.kind === SyntaxKind.ClassExpression || isInterfaceDeclaration(node)) && node.heritageClauses?.length)
31365
31383
  contracts.push(node);
31366
- if (reference && owned.has(path6)) {
31384
+ if (reference && owned.has(path7)) {
31367
31385
  pending.push({
31368
31386
  ...reference,
31369
31387
  owner: ["CALLS", "WRITES"].includes(reference.kind) ? item.execution.id : owner.id,
@@ -31431,8 +31449,8 @@ async function extractProjectMap(project, input, trace) {
31431
31449
  const kind = mapDeclarationKind(node, true);
31432
31450
  const executionDeclaration = mapExecutionDeclaration(node);
31433
31451
  const file2 = node.getSourceFile();
31434
- const path6 = mapRelativePath(file2.fileName);
31435
- if (!executionDeclaration && (!name || !kind) || !path6 || !Object.hasOwn(input.files, path6))
31452
+ const path7 = mapRelativePath(file2.fileName);
31453
+ if (!executionDeclaration && (!name || !kind) || !path7 || !Object.hasOwn(input.files, path7))
31436
31454
  return void 0;
31437
31455
  const object2 = addObject(
31438
31456
  node,
@@ -31444,7 +31462,7 @@ async function extractProjectMap(project, input, trace) {
31444
31462
  while (parent && !declared.has(key(parent)) && !(mapDeclarationKind(parent) && mapDeclarationName(parent)) && !mapExecutionDeclaration(parent))
31445
31463
  parent = parent.parent;
31446
31464
  const owner = parent ? materialize(parent) : void 0;
31447
- if (owner && owned.has(path6))
31465
+ if (owner && owned.has(path7))
31448
31466
  collect.relation({
31449
31467
  from: owner.id,
31450
31468
  to: object2.id,
@@ -31625,7 +31643,7 @@ async function extractProjectMap(project, input, trace) {
31625
31643
  }
31626
31644
 
31627
31645
  // src/core.ts
31628
- import path5 from "node:path";
31646
+ import path6 from "node:path";
31629
31647
  var ProjectEvidencePathError = class extends Error {
31630
31648
  constructor(code) {
31631
31649
  super(code);
@@ -31635,14 +31653,14 @@ var ProjectEvidencePathError = class extends Error {
31635
31653
  code;
31636
31654
  };
31637
31655
  var normalizeProjectEvidencePath = (value, allowRoot = false) => {
31638
- if (value.includes("\0") || path5.isAbsolute(value) || value.includes("\\")) {
31656
+ if (value.includes("\0") || path6.isAbsolute(value) || value.includes("\\")) {
31639
31657
  throw new ProjectEvidencePathError("PROJECT_PATH_INVALID");
31640
31658
  }
31641
31659
  if (value === ".") {
31642
31660
  if (allowRoot) return "";
31643
31661
  throw new ProjectEvidencePathError("PROJECT_PATH_INVALID");
31644
31662
  }
31645
- const normalized = path5.posix.normalize(value);
31663
+ const normalized = path6.posix.normalize(value);
31646
31664
  if (normalized.length === 0 || normalized !== value || normalized === ".." || normalized.startsWith("../") || value.split("/").some((segment) => segment.length === 0 || segment === "." || segment === "..")) {
31647
31665
  throw new ProjectEvidencePathError("PROJECT_PATH_INVALID");
31648
31666
  }
@@ -31765,7 +31783,7 @@ function mapWorkerFailure(error51, trace, workerUrl) {
31765
31783
  }
31766
31784
 
31767
31785
  // src/project-map-query-selection.ts
31768
- var mapQueryPathMatches = (path6, prefix) => prefix === "." || path6 === prefix || path6.startsWith(`${prefix}/`);
31786
+ var mapQueryPathMatches = (path7, prefix) => prefix === "." || path7 === prefix || path7.startsWith(`${prefix}/`);
31769
31787
 
31770
31788
  // src/project-map-reference-extract.ts
31771
31789
  function referenceKind(node) {
@@ -31881,7 +31899,7 @@ var MapWorkerTimingCollector = class {
31881
31899
  };
31882
31900
 
31883
31901
  // src/project-map-worker.ts
31884
- var stopOwnedGroup = () => process.kill(-process.pid, "SIGKILL");
31902
+ var stopOwnedGroup = () => stopProcessTree(process.pid, "SIGKILL");
31885
31903
  process.once("disconnect", stopOwnedGroup);
31886
31904
  process.once("SIGTERM", stopOwnedGroup);
31887
31905
  process.once("beforeExit", () => process.off("disconnect", stopOwnedGroup));