@massa-ai/mcp-client 1.42.0 → 1.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/config-cli.js +462 -337
  2. package/dist/index.js +498 -384
  3. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -25549,6 +25549,7 @@ var init_massa_ai_config = __esm(() => {
25549
25549
  // ../../packages/shared/dist/config/config-loader.js
25550
25550
  var exports_config_loader = {};
25551
25551
  __export(exports_config_loader, {
25552
+ writeFileAtomically: () => writeFileAtomically,
25552
25553
  saveConfig: () => saveConfig,
25553
25554
  migrateDataDirOnce: () => migrateDataDirOnce,
25554
25555
  loadConfigSafe: () => loadConfigSafe,
@@ -25633,15 +25634,17 @@ function migrateDataDirOnce() {
25633
25634
  function __resetMigrationForTests() {
25634
25635
  migrationAttempted = false;
25635
25636
  }
25636
- function saveConfig(config2) {
25637
- if (!fs.existsSync(CONFIG_DIR)) {
25638
- fs.mkdirSync(CONFIG_DIR, { recursive: true });
25637
+ function writeFileAtomically(targetPath, content) {
25638
+ const dir = path3.dirname(targetPath);
25639
+ if (!fs.existsSync(dir)) {
25640
+ fs.mkdirSync(dir, { recursive: true });
25639
25641
  }
25640
25642
  const unique = `${process.pid}.${++tempFileCounter}.${crypto2.randomBytes(6).toString("hex")}`;
25641
- const tempFile = path3.join(CONFIG_DIR, `.config.json.${unique}.tmp`);
25643
+ const tempFile = path3.join(dir, `.${path3.basename(targetPath)}.${unique}.tmp`);
25642
25644
  try {
25643
- fs.writeFileSync(tempFile, JSON.stringify(config2, null, 2));
25644
- fs.renameSync(tempFile, CONFIG_FILE);
25645
+ fs.writeFileSync(tempFile, content, { mode: 384 });
25646
+ fs.chmodSync(tempFile, 384);
25647
+ fs.renameSync(tempFile, targetPath);
25645
25648
  } catch (error51) {
25646
25649
  try {
25647
25650
  fs.unlinkSync(tempFile);
@@ -25649,6 +25652,9 @@ function saveConfig(config2) {
25649
25652
  throw error51;
25650
25653
  }
25651
25654
  }
25655
+ function saveConfig(config2) {
25656
+ writeFileAtomically(CONFIG_FILE, JSON.stringify(config2, null, 2));
25657
+ }
25652
25658
  function initConfig() {
25653
25659
  if (!fs.existsSync(CONFIG_FILE)) {
25654
25660
  saveConfig(defaultMassaAiConfig);
@@ -27015,7 +27021,7 @@ function listProfiles(opts = {}) {
27015
27021
  installed,
27016
27022
  skipped: false,
27017
27023
  skipReason: null,
27018
- activeProfile: platform?.modelProfile?.profile ?? "balanced",
27024
+ activeProfile: platform?.modelProfile?.profile ?? opts.hostDefaults?.[host] ?? "balanced",
27019
27025
  bundleVersion: platform?.plugin?.version ?? null,
27020
27026
  availableProfiles
27021
27027
  };
@@ -27185,6 +27191,114 @@ function reportSucceeded(report) {
27185
27191
  return report.hosts.every((h) => h.status === "switched" || h.status === "skipped");
27186
27192
  }
27187
27193
 
27194
+ // ../../packages/shared/dist/profile-switch/variant-sync.js
27195
+ import fs6 from "fs";
27196
+ import path9 from "path";
27197
+ import crypto5 from "crypto";
27198
+ function writeFileIntoDirAtomically(destDir, destName, content) {
27199
+ const unique = `${process.pid}.${++tempFileCounter2}.${crypto5.randomBytes(6).toString("hex")}`;
27200
+ const tempFile = path9.join(destDir, `.${destName}.${unique}.tmp`);
27201
+ try {
27202
+ fs6.writeFileSync(tempFile, content);
27203
+ fs6.renameSync(tempFile, path9.join(destDir, destName));
27204
+ } catch (error51) {
27205
+ try {
27206
+ fs6.unlinkSync(tempFile);
27207
+ } catch {}
27208
+ throw error51;
27209
+ }
27210
+ }
27211
+ function isSafeDirName(name) {
27212
+ if (name === "." || name === "..")
27213
+ return false;
27214
+ if (name.includes("/") || name.includes("\\") || name.includes(path9.sep))
27215
+ return false;
27216
+ return path9.basename(name) === name;
27217
+ }
27218
+ function syncHost(host, sourceRoot, targetHome) {
27219
+ const layout = resolveHostLayout(host, { targetHome });
27220
+ if (layout.route === "skip") {
27221
+ return { host, status: "skipped", profiles: [], retained: [], files: 0, reason: layout.reason };
27222
+ }
27223
+ const srcDir = path9.join(sourceRoot, "apps", `${host}-plugin`, "agent-profiles");
27224
+ if (!fs6.existsSync(srcDir) || !fs6.statSync(srcDir).isDirectory()) {
27225
+ return { host, status: "skipped", profiles: [], retained: [], files: 0, reason: "no generated variants for this host" };
27226
+ }
27227
+ if (!fs6.existsSync(layout.variantsRoot)) {
27228
+ return {
27229
+ host,
27230
+ status: "skipped",
27231
+ profiles: [],
27232
+ retained: [],
27233
+ files: 0,
27234
+ reason: `variant tree not present at ${layout.variantsRoot} \u2014 run the plugin installer ` + "or an initial profile switch"
27235
+ };
27236
+ }
27237
+ const profiles = [];
27238
+ let files = 0;
27239
+ for (const entry of fs6.readdirSync(srcDir, { withFileTypes: true })) {
27240
+ if (!entry.isDirectory())
27241
+ continue;
27242
+ if (!isSafeDirName(entry.name))
27243
+ continue;
27244
+ const srcProfileDir = path9.join(srcDir, entry.name);
27245
+ const destProfileDir = path9.join(layout.variantsRoot, entry.name);
27246
+ fs6.mkdirSync(destProfileDir, { recursive: true });
27247
+ for (const fileEntry of fs6.readdirSync(srcProfileDir, { withFileTypes: true })) {
27248
+ if (!fileEntry.isFile())
27249
+ continue;
27250
+ const content = fs6.readFileSync(path9.join(srcProfileDir, fileEntry.name));
27251
+ writeFileIntoDirAtomically(destProfileDir, fileEntry.name, content);
27252
+ files++;
27253
+ }
27254
+ profiles.push(entry.name);
27255
+ }
27256
+ const retained = fs6.readdirSync(layout.variantsRoot, { withFileTypes: true }).filter((e) => e.isDirectory() && !profiles.includes(e.name)).map((e) => e.name).sort();
27257
+ return { host, status: "synced", profiles: profiles.sort(), retained, files };
27258
+ }
27259
+ function syncGeneratedVariants(opts) {
27260
+ const hosts = opts.hosts ?? HOSTS;
27261
+ if (!opts.sourceRoot) {
27262
+ return hosts.map((host) => ({
27263
+ host,
27264
+ status: "skipped",
27265
+ profiles: [],
27266
+ retained: [],
27267
+ files: 0,
27268
+ reason: "no source checkout \u2014 nothing to sync"
27269
+ }));
27270
+ }
27271
+ const sourceRoot = opts.sourceRoot;
27272
+ return hosts.map((host) => {
27273
+ try {
27274
+ return syncHost(host, sourceRoot, opts.targetHome);
27275
+ } catch (err) {
27276
+ return { host, status: "failed", profiles: [], retained: [], files: 0, error: err.message };
27277
+ }
27278
+ });
27279
+ }
27280
+ var tempFileCounter2 = 0;
27281
+ var init_variant_sync = __esm(() => {
27282
+ init_hosts();
27283
+ });
27284
+
27285
+ // ../../packages/shared/dist/profile-switch/repo-root.js
27286
+ import fs7 from "fs";
27287
+ import path10 from "path";
27288
+ function findRepoRootWithMarker(startDir, marker, maxLevels) {
27289
+ let dir = startDir;
27290
+ for (let i = 0;i <= maxLevels; i++) {
27291
+ if (fs7.existsSync(path10.join(dir, marker)))
27292
+ return dir;
27293
+ const parent = path10.dirname(dir);
27294
+ if (parent === dir)
27295
+ break;
27296
+ dir = parent;
27297
+ }
27298
+ return null;
27299
+ }
27300
+ var init_repo_root = () => {};
27301
+
27188
27302
  // ../../packages/shared/dist/index.js
27189
27303
  var init_dist = __esm(() => {
27190
27304
  init_env();
@@ -27193,6 +27307,8 @@ var init_dist = __esm(() => {
27193
27307
  init_state();
27194
27308
  init_lock();
27195
27309
  init_engine();
27310
+ init_variant_sync();
27311
+ init_repo_root();
27196
27312
  init_types2();
27197
27313
  init_interfaces();
27198
27314
  init_utils();
@@ -28714,7 +28830,7 @@ var import_brace_expansion, minimatch = (p, pattern, options = {}) => {
28714
28830
  }, qmarksTestNoExtDot = ([$0]) => {
28715
28831
  const len = $0.length;
28716
28832
  return (f) => f.length === len && f !== "." && f !== "..";
28717
- }, defaultPlatform, path9, sep, GLOBSTAR, qmark2 = "[^/]", star2, twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options), ext = (a, b = {}) => Object.assign({}, a, b), defaults = (def) => {
28833
+ }, defaultPlatform, path11, sep, GLOBSTAR, qmark2 = "[^/]", star2, twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options), ext = (a, b = {}) => Object.assign({}, a, b), defaults = (def) => {
28718
28834
  if (!def || typeof def !== "object" || !Object.keys(def).length) {
28719
28835
  return minimatch;
28720
28836
  }
@@ -28772,11 +28888,11 @@ var init_esm = __esm(() => {
28772
28888
  starRE = /^\*+$/;
28773
28889
  qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
28774
28890
  defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
28775
- path9 = {
28891
+ path11 = {
28776
28892
  win32: { sep: "\\" },
28777
28893
  posix: { sep: "/" }
28778
28894
  };
28779
- sep = defaultPlatform === "win32" ? path9.win32.sep : path9.posix.sep;
28895
+ sep = defaultPlatform === "win32" ? path11.win32.sep : path11.posix.sep;
28780
28896
  minimatch.sep = sep;
28781
28897
  GLOBSTAR = Symbol("globstar **");
28782
28898
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -30742,12 +30858,12 @@ var init_esm4 = __esm(() => {
30742
30858
  childrenCache() {
30743
30859
  return this.#children;
30744
30860
  }
30745
- resolve(path10) {
30746
- if (!path10) {
30861
+ resolve(path12) {
30862
+ if (!path12) {
30747
30863
  return this;
30748
30864
  }
30749
- const rootPath = this.getRootString(path10);
30750
- const dir = path10.substring(rootPath.length);
30865
+ const rootPath = this.getRootString(path12);
30866
+ const dir = path12.substring(rootPath.length);
30751
30867
  const dirParts = dir.split(this.splitSep);
30752
30868
  const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
30753
30869
  return result;
@@ -31275,8 +31391,8 @@ var init_esm4 = __esm(() => {
31275
31391
  newChild(name, type = UNKNOWN, opts = {}) {
31276
31392
  return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
31277
31393
  }
31278
- getRootString(path10) {
31279
- return win32.parse(path10).root;
31394
+ getRootString(path12) {
31395
+ return win32.parse(path12).root;
31280
31396
  }
31281
31397
  getRoot(rootPath) {
31282
31398
  rootPath = uncToDrive(rootPath.toUpperCase());
@@ -31301,8 +31417,8 @@ var init_esm4 = __esm(() => {
31301
31417
  constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
31302
31418
  super(name, type, root, roots, nocase, children, opts);
31303
31419
  }
31304
- getRootString(path10) {
31305
- return path10.startsWith("/") ? "/" : "";
31420
+ getRootString(path12) {
31421
+ return path12.startsWith("/") ? "/" : "";
31306
31422
  }
31307
31423
  getRoot(_rootPath) {
31308
31424
  return this.root;
@@ -31321,8 +31437,8 @@ var init_esm4 = __esm(() => {
31321
31437
  #children;
31322
31438
  nocase;
31323
31439
  #fs;
31324
- constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs6 = defaultFS } = {}) {
31325
- this.#fs = fsFromOption(fs6);
31440
+ constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs8 = defaultFS } = {}) {
31441
+ this.#fs = fsFromOption(fs8);
31326
31442
  if (cwd instanceof URL || cwd.startsWith("file://")) {
31327
31443
  cwd = fileURLToPath(cwd);
31328
31444
  }
@@ -31358,11 +31474,11 @@ var init_esm4 = __esm(() => {
31358
31474
  }
31359
31475
  this.cwd = prev;
31360
31476
  }
31361
- depth(path10 = this.cwd) {
31362
- if (typeof path10 === "string") {
31363
- path10 = this.cwd.resolve(path10);
31477
+ depth(path12 = this.cwd) {
31478
+ if (typeof path12 === "string") {
31479
+ path12 = this.cwd.resolve(path12);
31364
31480
  }
31365
- return path10.depth();
31481
+ return path12.depth();
31366
31482
  }
31367
31483
  childrenCache() {
31368
31484
  return this.#children;
@@ -31778,9 +31894,9 @@ var init_esm4 = __esm(() => {
31778
31894
  process4();
31779
31895
  return results;
31780
31896
  }
31781
- chdir(path10 = this.cwd) {
31897
+ chdir(path12 = this.cwd) {
31782
31898
  const oldCwd = this.cwd;
31783
- this.cwd = typeof path10 === "string" ? this.cwd.resolve(path10) : path10;
31899
+ this.cwd = typeof path12 === "string" ? this.cwd.resolve(path12) : path12;
31784
31900
  this.cwd[setAsCwd](oldCwd);
31785
31901
  }
31786
31902
  };
@@ -31797,8 +31913,8 @@ var init_esm4 = __esm(() => {
31797
31913
  parseRootPath(dir) {
31798
31914
  return win32.parse(dir).root.toUpperCase();
31799
31915
  }
31800
- newRoot(fs6) {
31801
- return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs6 });
31916
+ newRoot(fs8) {
31917
+ return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs8 });
31802
31918
  }
31803
31919
  isAbsolute(p) {
31804
31920
  return p.startsWith("/") || p.startsWith("\\") || /^[a-z]:(\/|\\)/i.test(p);
@@ -31814,8 +31930,8 @@ var init_esm4 = __esm(() => {
31814
31930
  parseRootPath(_dir) {
31815
31931
  return "/";
31816
31932
  }
31817
- newRoot(fs6) {
31818
- return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs6 });
31933
+ newRoot(fs8) {
31934
+ return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs: fs8 });
31819
31935
  }
31820
31936
  isAbsolute(p) {
31821
31937
  return p.startsWith("/");
@@ -32072,8 +32188,8 @@ class MatchRecord {
32072
32188
  this.store.set(target, current === undefined ? n : n & current);
32073
32189
  }
32074
32190
  entries() {
32075
- return [...this.store.entries()].map(([path10, n]) => [
32076
- path10,
32191
+ return [...this.store.entries()].map(([path12, n]) => [
32192
+ path12,
32077
32193
  !!(n & 2),
32078
32194
  !!(n & 1)
32079
32195
  ]);
@@ -32277,9 +32393,9 @@ class GlobUtil {
32277
32393
  signal;
32278
32394
  maxDepth;
32279
32395
  includeChildMatches;
32280
- constructor(patterns, path10, opts) {
32396
+ constructor(patterns, path12, opts) {
32281
32397
  this.patterns = patterns;
32282
- this.path = path10;
32398
+ this.path = path12;
32283
32399
  this.opts = opts;
32284
32400
  this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
32285
32401
  this.includeChildMatches = opts.includeChildMatches !== false;
@@ -32298,11 +32414,11 @@ class GlobUtil {
32298
32414
  });
32299
32415
  }
32300
32416
  }
32301
- #ignored(path10) {
32302
- return this.seen.has(path10) || !!this.#ignore?.ignored?.(path10);
32417
+ #ignored(path12) {
32418
+ return this.seen.has(path12) || !!this.#ignore?.ignored?.(path12);
32303
32419
  }
32304
- #childrenIgnored(path10) {
32305
- return !!this.#ignore?.childrenIgnored?.(path10);
32420
+ #childrenIgnored(path12) {
32421
+ return !!this.#ignore?.childrenIgnored?.(path12);
32306
32422
  }
32307
32423
  pause() {
32308
32424
  this.paused = true;
@@ -32519,8 +32635,8 @@ var init_walker = __esm(() => {
32519
32635
  init_processor();
32520
32636
  GlobWalker = class GlobWalker extends GlobUtil {
32521
32637
  matches = new Set;
32522
- constructor(patterns, path10, opts) {
32523
- super(patterns, path10, opts);
32638
+ constructor(patterns, path12, opts) {
32639
+ super(patterns, path12, opts);
32524
32640
  }
32525
32641
  matchEmit(e) {
32526
32642
  this.matches.add(e);
@@ -32557,8 +32673,8 @@ var init_walker = __esm(() => {
32557
32673
  };
32558
32674
  GlobStream = class GlobStream extends GlobUtil {
32559
32675
  results;
32560
- constructor(patterns, path10, opts) {
32561
- super(patterns, path10, opts);
32676
+ constructor(patterns, path12, opts) {
32677
+ super(patterns, path12, opts);
32562
32678
  this.results = new Minipass({
32563
32679
  signal: this.signal,
32564
32680
  objectMode: true
@@ -32986,20 +33102,20 @@ var require_ignore = __commonJS((exports, module) => {
32986
33102
  var throwError = (message, Ctor) => {
32987
33103
  throw new Ctor(message);
32988
33104
  };
32989
- var checkPath = (path10, originalPath, doThrow) => {
32990
- if (!isString(path10)) {
33105
+ var checkPath = (path12, originalPath, doThrow) => {
33106
+ if (!isString(path12)) {
32991
33107
  return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError);
32992
33108
  }
32993
- if (!path10) {
33109
+ if (!path12) {
32994
33110
  return doThrow(`path must not be empty`, TypeError);
32995
33111
  }
32996
- if (checkPath.isNotRelative(path10)) {
33112
+ if (checkPath.isNotRelative(path12)) {
32997
33113
  const r = "`path.relative()`d";
32998
33114
  return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError);
32999
33115
  }
33000
33116
  return true;
33001
33117
  };
33002
- var isNotRelative = (path10) => REGEX_TEST_INVALID_PATH.test(path10);
33118
+ var isNotRelative = (path12) => REGEX_TEST_INVALID_PATH.test(path12);
33003
33119
  checkPath.isNotRelative = isNotRelative;
33004
33120
  checkPath.convert = (p) => p;
33005
33121
 
@@ -33042,7 +33158,7 @@ var require_ignore = __commonJS((exports, module) => {
33042
33158
  addPattern(pattern) {
33043
33159
  return this.add(pattern);
33044
33160
  }
33045
- _testOne(path10, checkUnignored) {
33161
+ _testOne(path12, checkUnignored) {
33046
33162
  let ignored = false;
33047
33163
  let unignored = false;
33048
33164
  this._rules.forEach((rule) => {
@@ -33050,7 +33166,7 @@ var require_ignore = __commonJS((exports, module) => {
33050
33166
  if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
33051
33167
  return;
33052
33168
  }
33053
- const matched = rule.regex.test(path10);
33169
+ const matched = rule.regex.test(path12);
33054
33170
  if (matched) {
33055
33171
  ignored = !negative;
33056
33172
  unignored = negative;
@@ -33062,39 +33178,39 @@ var require_ignore = __commonJS((exports, module) => {
33062
33178
  };
33063
33179
  }
33064
33180
  _test(originalPath, cache, checkUnignored, slices) {
33065
- const path10 = originalPath && checkPath.convert(originalPath);
33066
- checkPath(path10, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
33067
- return this._t(path10, cache, checkUnignored, slices);
33181
+ const path12 = originalPath && checkPath.convert(originalPath);
33182
+ checkPath(path12, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
33183
+ return this._t(path12, cache, checkUnignored, slices);
33068
33184
  }
33069
- _t(path10, cache, checkUnignored, slices) {
33070
- if (path10 in cache) {
33071
- return cache[path10];
33185
+ _t(path12, cache, checkUnignored, slices) {
33186
+ if (path12 in cache) {
33187
+ return cache[path12];
33072
33188
  }
33073
33189
  if (!slices) {
33074
- slices = path10.split(SLASH);
33190
+ slices = path12.split(SLASH);
33075
33191
  }
33076
33192
  slices.pop();
33077
33193
  if (!slices.length) {
33078
- return cache[path10] = this._testOne(path10, checkUnignored);
33194
+ return cache[path12] = this._testOne(path12, checkUnignored);
33079
33195
  }
33080
33196
  const parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices);
33081
- return cache[path10] = parent.ignored ? parent : this._testOne(path10, checkUnignored);
33197
+ return cache[path12] = parent.ignored ? parent : this._testOne(path12, checkUnignored);
33082
33198
  }
33083
- ignores(path10) {
33084
- return this._test(path10, this._ignoreCache, false).ignored;
33199
+ ignores(path12) {
33200
+ return this._test(path12, this._ignoreCache, false).ignored;
33085
33201
  }
33086
33202
  createFilter() {
33087
- return (path10) => !this.ignores(path10);
33203
+ return (path12) => !this.ignores(path12);
33088
33204
  }
33089
33205
  filter(paths) {
33090
33206
  return makeArray(paths).filter(this.createFilter());
33091
33207
  }
33092
- test(path10) {
33093
- return this._test(path10, this._testCache, true);
33208
+ test(path12) {
33209
+ return this._test(path12, this._testCache, true);
33094
33210
  }
33095
33211
  }
33096
33212
  var factory = (options) => new Ignore2(options);
33097
- var isPathValid = (path10) => checkPath(path10 && checkPath.convert(path10), path10, RETURN_FALSE);
33213
+ var isPathValid = (path12) => checkPath(path12 && checkPath.convert(path12), path12, RETURN_FALSE);
33098
33214
  factory.isPathValid = isPathValid;
33099
33215
  factory.default = factory;
33100
33216
  module.exports = factory;
@@ -33102,7 +33218,7 @@ var require_ignore = __commonJS((exports, module) => {
33102
33218
  const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
33103
33219
  checkPath.convert = makePosix;
33104
33220
  const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
33105
- checkPath.isNotRelative = (path10) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path10) || isNotRelative(path10);
33221
+ checkPath.isNotRelative = (path12) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path12) || isNotRelative(path12);
33106
33222
  }
33107
33223
  });
33108
33224
 
@@ -33164,13 +33280,13 @@ function validatePolicy(policy, opts = {}) {
33164
33280
  }
33165
33281
  }
33166
33282
  }
33167
- function matchesGlob2(path10, pattern) {
33283
+ function matchesGlob2(path12, pattern) {
33168
33284
  let re = regexCache.get(pattern);
33169
33285
  if (!re) {
33170
33286
  re = globToRegex(pattern);
33171
33287
  regexCache.set(pattern, re);
33172
33288
  }
33173
- return re.test(path10);
33289
+ return re.test(path12);
33174
33290
  }
33175
33291
  var MAX_MATCH_WORK = 1e5, MAX_IGNORE_PATTERNS2 = 1024, DEFAULT_POLICY, applyPolicy = (filePath, policy) => {
33176
33292
  const normalized = filePath.trim();
@@ -33221,8 +33337,8 @@ var init_capture_policy = __esm(() => {
33221
33337
  });
33222
33338
 
33223
33339
  // ../../packages/core/dist/services/search/ignore-patterns.js
33224
- import fs6 from "fs/promises";
33225
- import path10 from "path";
33340
+ import fs8 from "fs/promises";
33341
+ import path12 from "path";
33226
33342
  function buildExtensionGlob(extensions) {
33227
33343
  return extensions.map((ext2) => `**/*${ext2}`);
33228
33344
  }
@@ -33245,8 +33361,8 @@ async function loadProjectIgnore(projectPath) {
33245
33361
  const ig = ignore();
33246
33362
  ig.add(DEFAULT_IGNORES);
33247
33363
  try {
33248
- const gitignorePath = path10.join(projectPath, ".gitignore");
33249
- const gitignoreContent = await fs6.readFile(gitignorePath, "utf8");
33364
+ const gitignorePath = path12.join(projectPath, ".gitignore");
33365
+ const gitignoreContent = await fs8.readFile(gitignorePath, "utf8");
33250
33366
  const rules = gitignoreContent.split(`
33251
33367
  `).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
33252
33368
  ig.add(rules);
@@ -34574,7 +34690,7 @@ var require_cert_signatures = __commonJS((exports, module) => {
34574
34690
 
34575
34691
  // ../../node_modules/pg/lib/crypto/sasl.js
34576
34692
  var require_sasl = __commonJS((exports, module) => {
34577
- var crypto5 = require_utils3();
34693
+ var crypto6 = require_utils3();
34578
34694
  var { signatureAlgorithmHashFromCertificate } = require_cert_signatures();
34579
34695
  function saslprep(password) {
34580
34696
  const nonAsciiSpace = /[\u00A0\u1680\u2000-\u200B\u202F\u205F\u3000]/g;
@@ -34593,7 +34709,7 @@ var require_sasl = __commonJS((exports, module) => {
34593
34709
  if (mechanism === "SCRAM-SHA-256-PLUS" && typeof stream2.getPeerCertificate !== "function") {
34594
34710
  throw new Error("SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate");
34595
34711
  }
34596
- const clientNonce = crypto5.randomBytes(18).toString("base64");
34712
+ const clientNonce = crypto6.randomBytes(18).toString("base64");
34597
34713
  const gs2Header = mechanism === "SCRAM-SHA-256-PLUS" ? "p=tls-server-end-point" : stream2 ? "y" : "n";
34598
34714
  return {
34599
34715
  mechanism,
@@ -34634,20 +34750,20 @@ var require_sasl = __commonJS((exports, module) => {
34634
34750
  let hashName = signatureAlgorithmHashFromCertificate(peerCert);
34635
34751
  if (hashName === "MD5" || hashName === "SHA-1")
34636
34752
  hashName = "SHA-256";
34637
- const certHash = await crypto5.hashByName(hashName, peerCert);
34753
+ const certHash = await crypto6.hashByName(hashName, peerCert);
34638
34754
  const bindingData = Buffer.concat([Buffer.from("p=tls-server-end-point,,"), Buffer.from(certHash)]);
34639
34755
  channelBinding = bindingData.toString("base64");
34640
34756
  }
34641
34757
  const clientFinalMessageWithoutProof = "c=" + channelBinding + ",r=" + sv.nonce;
34642
34758
  const authMessage = clientFirstMessageBare + "," + serverFirstMessage + "," + clientFinalMessageWithoutProof;
34643
34759
  const saltBytes = Buffer.from(sv.salt, "base64");
34644
- const saltedPassword = await crypto5.deriveKey(saslprep(password), saltBytes, sv.iteration);
34645
- const clientKey = await crypto5.hmacSha256(saltedPassword, "Client Key");
34646
- const storedKey = await crypto5.sha256(clientKey);
34647
- const clientSignature = await crypto5.hmacSha256(storedKey, authMessage);
34760
+ const saltedPassword = await crypto6.deriveKey(saslprep(password), saltBytes, sv.iteration);
34761
+ const clientKey = await crypto6.hmacSha256(saltedPassword, "Client Key");
34762
+ const storedKey = await crypto6.sha256(clientKey);
34763
+ const clientSignature = await crypto6.hmacSha256(storedKey, authMessage);
34648
34764
  const clientProof = xorBuffers(Buffer.from(clientKey), Buffer.from(clientSignature)).toString("base64");
34649
- const serverKey = await crypto5.hmacSha256(saltedPassword, "Server Key");
34650
- const serverSignatureBytes = await crypto5.hmacSha256(serverKey, authMessage);
34765
+ const serverKey = await crypto6.hmacSha256(saltedPassword, "Server Key");
34766
+ const serverSignatureBytes = await crypto6.hmacSha256(serverKey, authMessage);
34651
34767
  session.message = "SASLResponse";
34652
34768
  session.serverSignature = Buffer.from(serverSignatureBytes).toString("base64");
34653
34769
  session.response = clientFinalMessageWithoutProof + ",p=" + clientProof;
@@ -34842,15 +34958,15 @@ var require_pg_connection_string = __commonJS((exports, module) => {
34842
34958
  if (config3.sslnegotiation === "direct" && config3.ssl === undefined) {
34843
34959
  config3.ssl = true;
34844
34960
  }
34845
- const fs7 = config3.sslcert || config3.sslkey || config3.sslrootcert ? __require("fs") : null;
34961
+ const fs9 = config3.sslcert || config3.sslkey || config3.sslrootcert ? __require("fs") : null;
34846
34962
  if (config3.sslcert) {
34847
- config3.ssl.cert = fs7.readFileSync(config3.sslcert).toString();
34963
+ config3.ssl.cert = fs9.readFileSync(config3.sslcert).toString();
34848
34964
  }
34849
34965
  if (config3.sslkey) {
34850
- config3.ssl.key = fs7.readFileSync(config3.sslkey).toString();
34966
+ config3.ssl.key = fs9.readFileSync(config3.sslkey).toString();
34851
34967
  }
34852
34968
  if (config3.sslrootcert) {
34853
- config3.ssl.ca = fs7.readFileSync(config3.sslrootcert).toString();
34969
+ config3.ssl.ca = fs9.readFileSync(config3.sslrootcert).toString();
34854
34970
  }
34855
34971
  if (options.useLibpqCompat && config3.uselibpqcompat) {
34856
34972
  throw new Error("Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.");
@@ -36564,7 +36680,7 @@ var require_split2 = __commonJS((exports, module) => {
36564
36680
 
36565
36681
  // ../../node_modules/pgpass/lib/helper.js
36566
36682
  var require_helper = __commonJS((exports, module) => {
36567
- var path11 = __require("path");
36683
+ var path13 = __require("path");
36568
36684
  var Stream2 = __require("stream").Stream;
36569
36685
  var split = require_split2();
36570
36686
  var util3 = __require("util");
@@ -36604,7 +36720,7 @@ var require_helper = __commonJS((exports, module) => {
36604
36720
  };
36605
36721
  exports.getFileName = function(rawEnv) {
36606
36722
  var env = rawEnv || process.env;
36607
- var file2 = env.PGPASSFILE || (isWin ? path11.join(env.APPDATA || "./", "postgresql", "pgpass.conf") : path11.join(env.HOME || "./", ".pgpass"));
36723
+ var file2 = env.PGPASSFILE || (isWin ? path13.join(env.APPDATA || "./", "postgresql", "pgpass.conf") : path13.join(env.HOME || "./", ".pgpass"));
36608
36724
  return file2;
36609
36725
  };
36610
36726
  exports.usePgPass = function(stats, fname) {
@@ -36728,16 +36844,16 @@ var require_helper = __commonJS((exports, module) => {
36728
36844
 
36729
36845
  // ../../node_modules/pgpass/lib/index.js
36730
36846
  var require_lib = __commonJS((exports, module) => {
36731
- var path11 = __require("path");
36732
- var fs7 = __require("fs");
36847
+ var path13 = __require("path");
36848
+ var fs9 = __require("fs");
36733
36849
  var helper = require_helper();
36734
36850
  module.exports = function(connInfo, cb) {
36735
36851
  var file2 = helper.getFileName();
36736
- fs7.stat(file2, function(err, stat) {
36852
+ fs9.stat(file2, function(err, stat) {
36737
36853
  if (err || !helper.usePgPass(stat, file2)) {
36738
36854
  return cb(undefined);
36739
36855
  }
36740
- var st = fs7.createReadStream(file2);
36856
+ var st = fs9.createReadStream(file2);
36741
36857
  helper.getPassword(connInfo, st, cb);
36742
36858
  });
36743
36859
  };
@@ -36755,7 +36871,7 @@ var require_client = __commonJS((exports, module) => {
36755
36871
  var Query = require_query();
36756
36872
  var defaults2 = require_defaults2();
36757
36873
  var Connection = require_connection();
36758
- var crypto5 = require_utils3();
36874
+ var crypto6 = require_utils3();
36759
36875
  var activeQueryDeprecationNotice = nodeUtils.deprecate(() => {}, "Client.activeQuery is deprecated and will be removed in pg@9.0");
36760
36876
  var queryQueueDeprecationNotice = nodeUtils.deprecate(() => {}, "Client.queryQueue is deprecated and will be removed in pg@9.0.");
36761
36877
  var pgPassDeprecationNotice = nodeUtils.deprecate(() => {}, "pgpass support is deprecated and will be removed in pg@9.0. " + "You can provide an async function as the password property to the Client/Pool constructor that returns a password instead. Within this function you can call the pgpass module in your own code.");
@@ -36987,7 +37103,7 @@ var require_client = __commonJS((exports, module) => {
36987
37103
  _handleAuthMD5Password(msg) {
36988
37104
  this._getPassword(async () => {
36989
37105
  try {
36990
- const hashedPassword = await crypto5.postgresMd5PasswordHash(this.user, this.password, msg.salt);
37106
+ const hashedPassword = await crypto6.postgresMd5PasswordHash(this.user, this.password, msg.salt);
36991
37107
  this.connection.password(hashedPassword);
36992
37108
  } catch (e) {
36993
37109
  this.emit("error", e);
@@ -38436,8 +38552,8 @@ var init_alias_resolver = __esm(() => {
38436
38552
  });
38437
38553
 
38438
38554
  // ../../packages/core/dist/services/search/index-manager.js
38439
- import fs7 from "fs";
38440
- import path11 from "path";
38555
+ import fs9 from "fs";
38556
+ import path13 from "path";
38441
38557
 
38442
38558
  class IndexManager {
38443
38559
  metadataCache = new Map;
@@ -38530,9 +38646,9 @@ class IndexManager {
38530
38646
  const fileMetadata = {};
38531
38647
  let totalSize = 0;
38532
38648
  for (const filePath of indexedFiles) {
38533
- const fullPath = path11.join(projectPath, filePath);
38649
+ const fullPath = path13.join(projectPath, filePath);
38534
38650
  try {
38535
- const stat = await fs7.promises.stat(fullPath);
38651
+ const stat = await fs9.promises.stat(fullPath);
38536
38652
  fileMetadata[filePath] = {
38537
38653
  path: filePath,
38538
38654
  mtime: stat.mtimeMs,
@@ -38583,9 +38699,9 @@ class IndexManager {
38583
38699
  if (ig.ignores(match2)) {
38584
38700
  continue;
38585
38701
  }
38586
- const fullPath = path11.join(projectPath, match2);
38702
+ const fullPath = path13.join(projectPath, match2);
38587
38703
  try {
38588
- const stat = await fs7.promises.stat(fullPath);
38704
+ const stat = await fs9.promises.stat(fullPath);
38589
38705
  files.set(match2, {
38590
38706
  path: match2,
38591
38707
  mtime: stat.mtimeMs,
@@ -41838,23 +41954,23 @@ var require_auth_config = __commonJS((exports, module) => {
41838
41954
  writeAuthConfig: () => writeAuthConfig
41839
41955
  });
41840
41956
  module.exports = __toCommonJS2(auth_config_exports);
41841
- var fs8 = __toESM2(__require("fs"));
41842
- var path12 = __toESM2(__require("path"));
41957
+ var fs10 = __toESM2(__require("fs"));
41958
+ var path14 = __toESM2(__require("path"));
41843
41959
  var import_token_util = require_token_util();
41844
41960
  function getAuthConfigPath() {
41845
41961
  const dataDir = (0, import_token_util.getVercelDataDir)();
41846
41962
  if (!dataDir) {
41847
41963
  throw new Error(`Unable to find Vercel CLI data directory. Your platform: ${process.platform}. Supported: darwin, linux, win32.`);
41848
41964
  }
41849
- return path12.join(dataDir, "auth.json");
41965
+ return path14.join(dataDir, "auth.json");
41850
41966
  }
41851
41967
  function readAuthConfig() {
41852
41968
  try {
41853
41969
  const authPath = getAuthConfigPath();
41854
- if (!fs8.existsSync(authPath)) {
41970
+ if (!fs10.existsSync(authPath)) {
41855
41971
  return null;
41856
41972
  }
41857
- const content = fs8.readFileSync(authPath, "utf8");
41973
+ const content = fs10.readFileSync(authPath, "utf8");
41858
41974
  if (!content) {
41859
41975
  return null;
41860
41976
  }
@@ -41865,11 +41981,11 @@ var require_auth_config = __commonJS((exports, module) => {
41865
41981
  }
41866
41982
  function writeAuthConfig(config3) {
41867
41983
  const authPath = getAuthConfigPath();
41868
- const authDir = path12.dirname(authPath);
41869
- if (!fs8.existsSync(authDir)) {
41870
- fs8.mkdirSync(authDir, { mode: 504, recursive: true });
41984
+ const authDir = path14.dirname(authPath);
41985
+ if (!fs10.existsSync(authDir)) {
41986
+ fs10.mkdirSync(authDir, { mode: 504, recursive: true });
41871
41987
  }
41872
- fs8.writeFileSync(authPath, JSON.stringify(config3, null, 2), { mode: 384 });
41988
+ fs10.writeFileSync(authPath, JSON.stringify(config3, null, 2), { mode: 384 });
41873
41989
  }
41874
41990
  function isValidAccessToken(authConfig, expirationBufferMs = 0) {
41875
41991
  if (!authConfig.token)
@@ -42044,8 +42160,8 @@ var require_token_util = __commonJS((exports, module) => {
42044
42160
  saveToken: () => saveToken
42045
42161
  });
42046
42162
  module.exports = __toCommonJS2(token_util_exports);
42047
- var path12 = __toESM2(__require("path"));
42048
- var fs8 = __toESM2(__require("fs"));
42163
+ var path14 = __toESM2(__require("path"));
42164
+ var fs10 = __toESM2(__require("fs"));
42049
42165
  var import_token_error = require_token_error();
42050
42166
  var import_token_io = require_token_io();
42051
42167
  var import_auth_config = require_auth_config();
@@ -42057,7 +42173,7 @@ var require_token_util = __commonJS((exports, module) => {
42057
42173
  if (!dataDir) {
42058
42174
  return null;
42059
42175
  }
42060
- return path12.join(dataDir, vercelFolder);
42176
+ return path14.join(dataDir, vercelFolder);
42061
42177
  }
42062
42178
  async function getVercelToken2(options) {
42063
42179
  const authConfig = (0, import_auth_config.readAuthConfig)();
@@ -42125,11 +42241,11 @@ var require_token_util = __commonJS((exports, module) => {
42125
42241
  if (!dir) {
42126
42242
  throw new import_token_error.VercelOidcTokenError("Unable to find project root directory. Have you linked your project with `vc link?`");
42127
42243
  }
42128
- const prjPath = path12.join(dir, ".vercel", "project.json");
42129
- if (!fs8.existsSync(prjPath)) {
42244
+ const prjPath = path14.join(dir, ".vercel", "project.json");
42245
+ if (!fs10.existsSync(prjPath)) {
42130
42246
  throw new import_token_error.VercelOidcTokenError("project.json not found, have you linked your project with `vc link?`");
42131
42247
  }
42132
- const prj = JSON.parse(fs8.readFileSync(prjPath, "utf8"));
42248
+ const prj = JSON.parse(fs10.readFileSync(prjPath, "utf8"));
42133
42249
  if (typeof prj.projectId !== "string" && typeof prj.orgId !== "string") {
42134
42250
  throw new TypeError("Expected a string-valued projectId property. Try running `vc link` to re-link your project.");
42135
42251
  }
@@ -42140,11 +42256,11 @@ var require_token_util = __commonJS((exports, module) => {
42140
42256
  if (!dir) {
42141
42257
  throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
42142
42258
  }
42143
- const tokenPath = path12.join(dir, "com.vercel.token", `${projectId}.json`);
42259
+ const tokenPath = path14.join(dir, "com.vercel.token", `${projectId}.json`);
42144
42260
  const tokenJson = JSON.stringify(token);
42145
- fs8.mkdirSync(path12.dirname(tokenPath), { mode: 504, recursive: true });
42146
- fs8.writeFileSync(tokenPath, tokenJson);
42147
- fs8.chmodSync(tokenPath, 432);
42261
+ fs10.mkdirSync(path14.dirname(tokenPath), { mode: 504, recursive: true });
42262
+ fs10.writeFileSync(tokenPath, tokenJson);
42263
+ fs10.chmodSync(tokenPath, 432);
42148
42264
  return;
42149
42265
  }
42150
42266
  function loadToken(projectId) {
@@ -42152,11 +42268,11 @@ var require_token_util = __commonJS((exports, module) => {
42152
42268
  if (!dir) {
42153
42269
  throw new import_token_error.VercelOidcTokenError("Unable to find user data directory. Please reach out to Vercel support.");
42154
42270
  }
42155
- const tokenPath = path12.join(dir, "com.vercel.token", `${projectId}.json`);
42156
- if (!fs8.existsSync(tokenPath)) {
42271
+ const tokenPath = path14.join(dir, "com.vercel.token", `${projectId}.json`);
42272
+ if (!fs10.existsSync(tokenPath)) {
42157
42273
  return null;
42158
42274
  }
42159
- const token = JSON.parse(fs8.readFileSync(tokenPath, "utf8"));
42275
+ const token = JSON.parse(fs10.readFileSync(tokenPath, "utf8"));
42160
42276
  assertVercelOidcTokenResponse(token);
42161
42277
  return token;
42162
42278
  }
@@ -52998,37 +53114,37 @@ function createOpenAI(options = {}) {
52998
53114
  }, `ai-sdk/openai/${VERSION4}`);
52999
53115
  const createChatModel = (modelId) => new OpenAIChatLanguageModel(modelId, {
53000
53116
  provider: `${providerName}.chat`,
53001
- url: ({ path: path12 }) => `${baseURL}${path12}`,
53117
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
53002
53118
  headers: getHeaders,
53003
53119
  fetch: options.fetch
53004
53120
  });
53005
53121
  const createCompletionModel = (modelId) => new OpenAICompletionLanguageModel(modelId, {
53006
53122
  provider: `${providerName}.completion`,
53007
- url: ({ path: path12 }) => `${baseURL}${path12}`,
53123
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
53008
53124
  headers: getHeaders,
53009
53125
  fetch: options.fetch
53010
53126
  });
53011
53127
  const createEmbeddingModel = (modelId) => new OpenAIEmbeddingModel(modelId, {
53012
53128
  provider: `${providerName}.embedding`,
53013
- url: ({ path: path12 }) => `${baseURL}${path12}`,
53129
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
53014
53130
  headers: getHeaders,
53015
53131
  fetch: options.fetch
53016
53132
  });
53017
53133
  const createImageModel = (modelId) => new OpenAIImageModel(modelId, {
53018
53134
  provider: `${providerName}.image`,
53019
- url: ({ path: path12 }) => `${baseURL}${path12}`,
53135
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
53020
53136
  headers: getHeaders,
53021
53137
  fetch: options.fetch
53022
53138
  });
53023
53139
  const createTranscriptionModel = (modelId) => new OpenAITranscriptionModel(modelId, {
53024
53140
  provider: `${providerName}.transcription`,
53025
- url: ({ path: path12 }) => `${baseURL}${path12}`,
53141
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
53026
53142
  headers: getHeaders,
53027
53143
  fetch: options.fetch
53028
53144
  });
53029
53145
  const createSpeechModel = (modelId) => new OpenAISpeechModel(modelId, {
53030
53146
  provider: `${providerName}.speech`,
53031
- url: ({ path: path12 }) => `${baseURL}${path12}`,
53147
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
53032
53148
  headers: getHeaders,
53033
53149
  fetch: options.fetch
53034
53150
  });
@@ -53041,7 +53157,7 @@ function createOpenAI(options = {}) {
53041
53157
  const createResponsesModel = (modelId) => {
53042
53158
  return new OpenAIResponsesLanguageModel(modelId, {
53043
53159
  provider: `${providerName}.responses`,
53044
- url: ({ path: path12 }) => `${baseURL}${path12}`,
53160
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
53045
53161
  headers: getHeaders,
53046
53162
  fetch: options.fetch,
53047
53163
  fileIdPrefixes: ["file-"]
@@ -69586,26 +69702,26 @@ var require_process = __commonJS((exports, module) => {
69586
69702
 
69587
69703
  // ../../node_modules/detect-libc/lib/filesystem.js
69588
69704
  var require_filesystem = __commonJS((exports, module) => {
69589
- var fs8 = __require("fs");
69705
+ var fs10 = __require("fs");
69590
69706
  var LDD_PATH = "/usr/bin/ldd";
69591
69707
  var SELF_PATH = "/proc/self/exe";
69592
69708
  var MAX_LENGTH = 2048;
69593
- var readFileSync2 = (path12) => {
69594
- const fd = fs8.openSync(path12, "r");
69709
+ var readFileSync2 = (path14) => {
69710
+ const fd = fs10.openSync(path14, "r");
69595
69711
  const buffer = Buffer.alloc(MAX_LENGTH);
69596
- const bytesRead = fs8.readSync(fd, buffer, 0, MAX_LENGTH, 0);
69597
- fs8.close(fd, () => {});
69712
+ const bytesRead = fs10.readSync(fd, buffer, 0, MAX_LENGTH, 0);
69713
+ fs10.close(fd, () => {});
69598
69714
  return buffer.subarray(0, bytesRead);
69599
69715
  };
69600
- var readFile = (path12) => new Promise((resolve4, reject) => {
69601
- fs8.open(path12, "r", (err, fd) => {
69716
+ var readFile = (path14) => new Promise((resolve4, reject) => {
69717
+ fs10.open(path14, "r", (err, fd) => {
69602
69718
  if (err) {
69603
69719
  reject(err);
69604
69720
  } else {
69605
69721
  const buffer = Buffer.alloc(MAX_LENGTH);
69606
- fs8.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
69722
+ fs10.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
69607
69723
  resolve4(buffer.subarray(0, bytesRead));
69608
- fs8.close(fd, () => {});
69724
+ fs10.close(fd, () => {});
69609
69725
  });
69610
69726
  }
69611
69727
  });
@@ -69710,11 +69826,11 @@ var require_detect_libc = __commonJS((exports, module) => {
69710
69826
  }
69711
69827
  return null;
69712
69828
  };
69713
- var familyFromInterpreterPath = (path12) => {
69714
- if (path12) {
69715
- if (path12.includes("/ld-musl-")) {
69829
+ var familyFromInterpreterPath = (path14) => {
69830
+ if (path14) {
69831
+ if (path14.includes("/ld-musl-")) {
69716
69832
  return MUSL;
69717
- } else if (path12.includes("/ld-linux-")) {
69833
+ } else if (path14.includes("/ld-linux-")) {
69718
69834
  return GLIBC;
69719
69835
  }
69720
69836
  }
@@ -69759,8 +69875,8 @@ var require_detect_libc = __commonJS((exports, module) => {
69759
69875
  cachedFamilyInterpreter = null;
69760
69876
  try {
69761
69877
  const selfContent = await readFile(SELF_PATH);
69762
- const path12 = interpreterPath(selfContent);
69763
- cachedFamilyInterpreter = familyFromInterpreterPath(path12);
69878
+ const path14 = interpreterPath(selfContent);
69879
+ cachedFamilyInterpreter = familyFromInterpreterPath(path14);
69764
69880
  } catch (e) {}
69765
69881
  return cachedFamilyInterpreter;
69766
69882
  };
@@ -69771,8 +69887,8 @@ var require_detect_libc = __commonJS((exports, module) => {
69771
69887
  cachedFamilyInterpreter = null;
69772
69888
  try {
69773
69889
  const selfContent = readFileSync2(SELF_PATH);
69774
- const path12 = interpreterPath(selfContent);
69775
- cachedFamilyInterpreter = familyFromInterpreterPath(path12);
69890
+ const path14 = interpreterPath(selfContent);
69891
+ cachedFamilyInterpreter = familyFromInterpreterPath(path14);
69776
69892
  } catch (e) {}
69777
69893
  return cachedFamilyInterpreter;
69778
69894
  };
@@ -71434,18 +71550,18 @@ var require_sharp = __commonJS((exports, module) => {
71434
71550
  `@img/sharp-${runtimePlatform}/sharp.node`,
71435
71551
  "@img/sharp-wasm32/sharp.node"
71436
71552
  ];
71437
- var path12;
71553
+ var path14;
71438
71554
  var sharp;
71439
71555
  var errors4 = [];
71440
- for (path12 of paths) {
71556
+ for (path14 of paths) {
71441
71557
  try {
71442
- sharp = __require(path12);
71558
+ sharp = __require(path14);
71443
71559
  break;
71444
71560
  } catch (err) {
71445
71561
  errors4.push(err);
71446
71562
  }
71447
71563
  }
71448
- if (sharp && path12.startsWith("@img/sharp-linux-x64") && !sharp._isUsingX64V2()) {
71564
+ if (sharp && path14.startsWith("@img/sharp-linux-x64") && !sharp._isUsingX64V2()) {
71449
71565
  const err = new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");
71450
71566
  err.code = "Unsupported CPU";
71451
71567
  errors4.push(err);
@@ -74307,15 +74423,15 @@ var require_color = __commonJS((exports, module) => {
74307
74423
  };
74308
74424
  }
74309
74425
  function wrapConversion(toModel, graph) {
74310
- const path12 = [graph[toModel].parent, toModel];
74426
+ const path14 = [graph[toModel].parent, toModel];
74311
74427
  let fn = conversions_default[graph[toModel].parent][toModel];
74312
74428
  let cur = graph[toModel].parent;
74313
74429
  while (graph[cur].parent) {
74314
- path12.unshift(graph[cur].parent);
74430
+ path14.unshift(graph[cur].parent);
74315
74431
  fn = link(conversions_default[graph[cur].parent][cur], fn);
74316
74432
  cur = graph[cur].parent;
74317
74433
  }
74318
- fn.conversion = path12;
74434
+ fn.conversion = path14;
74319
74435
  return fn;
74320
74436
  }
74321
74437
  function route(fromModel) {
@@ -74920,7 +75036,7 @@ var require_output = __commonJS((exports, module) => {
74920
75036
  Copyright 2013 Lovell Fuller and others.
74921
75037
  SPDX-License-Identifier: Apache-2.0
74922
75038
  */
74923
- var path12 = __require("path");
75039
+ var path14 = __require("path");
74924
75040
  var is = require_is();
74925
75041
  var sharp = require_sharp();
74926
75042
  var formats = new Map([
@@ -74951,9 +75067,9 @@ var require_output = __commonJS((exports, module) => {
74951
75067
  let err;
74952
75068
  if (!is.string(fileOut)) {
74953
75069
  err = new Error("Missing output file path");
74954
- } else if (is.string(this.options.input.file) && path12.resolve(this.options.input.file) === path12.resolve(fileOut)) {
75070
+ } else if (is.string(this.options.input.file) && path14.resolve(this.options.input.file) === path14.resolve(fileOut)) {
74955
75071
  err = new Error("Cannot use same file for input and output");
74956
- } else if (jp2Regex.test(path12.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
75072
+ } else if (jp2Regex.test(path14.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
74957
75073
  err = errJp2Save();
74958
75074
  }
74959
75075
  if (err) {
@@ -82200,11 +82316,11 @@ var init_transformers_node = __esm(() => {
82200
82316
  throw new Error(`The number of external data chunks (${num_chunks}) exceeds the maximum allowed value (${_utils_hub_js__WEBPACK_IMPORTED_MODULE_5__.MAX_EXTERNAL_DATA_CHUNKS}).`);
82201
82317
  }
82202
82318
  for (let i = 0;i < num_chunks; ++i) {
82203
- const path12 = `${baseName}_data${i === 0 ? "" : "_" + i}`;
82204
- const fullPath = `${options.subfolder ?? ""}/${path12}`;
82319
+ const path14 = `${baseName}_data${i === 0 ? "" : "_" + i}`;
82320
+ const fullPath = `${options.subfolder ?? ""}/${path14}`;
82205
82321
  externalDataPromises.push(new Promise(async (resolve4, reject) => {
82206
82322
  const data = await (0, _utils_hub_js__WEBPACK_IMPORTED_MODULE_5__.getModelFile)(pretrained_model_name_or_path, fullPath, true, options, return_path);
82207
- resolve4(data instanceof Uint8Array ? { path: path12, data } : path12);
82323
+ resolve4(data instanceof Uint8Array ? { path: path14, data } : path14);
82208
82324
  }));
82209
82325
  }
82210
82326
  } else if (session_options.externalData !== undefined) {
@@ -95268,7 +95384,7 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
95268
95384
  const blob = new Blob([wav], { type: "audio/wav" });
95269
95385
  return blob;
95270
95386
  }
95271
- async save(path12) {
95387
+ async save(path14) {
95272
95388
  let fn;
95273
95389
  if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_BROWSER_ENV) {
95274
95390
  if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_WEBWORKER_ENV) {
@@ -95276,14 +95392,14 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
95276
95392
  }
95277
95393
  fn = _core_js__WEBPACK_IMPORTED_MODULE_2__.saveBlob;
95278
95394
  } else if (_env_js__WEBPACK_IMPORTED_MODULE_3__.apis.IS_FS_AVAILABLE) {
95279
- fn = async (path13, blob) => {
95395
+ fn = async (path15, blob) => {
95280
95396
  let buffer = await blob.arrayBuffer();
95281
- node_fs__WEBPACK_IMPORTED_MODULE_5__["default"].writeFileSync(path13, Buffer.from(buffer));
95397
+ node_fs__WEBPACK_IMPORTED_MODULE_5__["default"].writeFileSync(path15, Buffer.from(buffer));
95282
95398
  };
95283
95399
  } else {
95284
95400
  throw new Error("Unable to save because filesystem is disabled in this environment.");
95285
95401
  }
95286
- await fn(path12, this.toBlob());
95402
+ await fn(path14, this.toBlob());
95287
95403
  }
95288
95404
  }
95289
95405
  },
@@ -95379,11 +95495,11 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
95379
95495
  function calculateReflectOffset(i, w) {
95380
95496
  return Math.abs((i + w) % (2 * w) - w);
95381
95497
  }
95382
- function saveBlob(path12, blob) {
95498
+ function saveBlob(path14, blob) {
95383
95499
  const dataURL = URL.createObjectURL(blob);
95384
95500
  const downloadLink = document.createElement("a");
95385
95501
  downloadLink.href = dataURL;
95386
- downloadLink.download = path12;
95502
+ downloadLink.download = path14;
95387
95503
  downloadLink.click();
95388
95504
  downloadLink.remove();
95389
95505
  URL.revokeObjectURL(dataURL);
@@ -95984,8 +96100,8 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
95984
96100
  }
95985
96101
 
95986
96102
  class FileCache {
95987
- constructor(path12) {
95988
- this.path = path12;
96103
+ constructor(path14) {
96104
+ this.path = path14;
95989
96105
  }
95990
96106
  async match(request) {
95991
96107
  let filePath = node_path__WEBPACK_IMPORTED_MODULE_1__["default"].join(this.path, request);
@@ -96741,20 +96857,20 @@ ${fake_token_around_image}` + `${global_img_token}` + image_token.repeat(image_s
96741
96857
  }
96742
96858
  return this;
96743
96859
  }
96744
- async save(path12) {
96860
+ async save(path14) {
96745
96861
  if (IS_BROWSER_OR_WEBWORKER) {
96746
96862
  if (_env_js__WEBPACK_IMPORTED_MODULE_2__.apis.IS_WEBWORKER_ENV) {
96747
96863
  throw new Error("Unable to save an image from a Web Worker.");
96748
96864
  }
96749
- const extension = path12.split(".").pop().toLowerCase();
96865
+ const extension = path14.split(".").pop().toLowerCase();
96750
96866
  const mime = CONTENT_TYPE_MAP.get(extension) ?? "image/png";
96751
96867
  const blob = await this.toBlob(mime);
96752
- (0, _core_js__WEBPACK_IMPORTED_MODULE_0__.saveBlob)(path12, blob);
96868
+ (0, _core_js__WEBPACK_IMPORTED_MODULE_0__.saveBlob)(path14, blob);
96753
96869
  } else if (!_env_js__WEBPACK_IMPORTED_MODULE_2__.apis.IS_FS_AVAILABLE) {
96754
96870
  throw new Error("Unable to save the image because filesystem is disabled in this environment.");
96755
96871
  } else {
96756
96872
  const img = this.toSharp();
96757
- return await img.toFile(path12);
96873
+ return await img.toFile(path14);
96758
96874
  }
96759
96875
  }
96760
96876
  toSharp() {
@@ -106285,10 +106401,10 @@ Note that ${s.bold("include")} statements only accept relation fields.`, a;
106285
106401
  super(t, "P2023", r);
106286
106402
  }
106287
106403
  };
106288
- var fs8 = new WeakMap;
106404
+ var fs10 = new WeakMap;
106289
106405
  function Ep(e) {
106290
- let t = fs8.get(e);
106291
- return t || (t = Object.entries(e), fs8.set(e, t)), t;
106406
+ let t = fs10.get(e);
106407
+ return t || (t = Object.entries(e), fs10.set(e, t)), t;
106292
106408
  }
106293
106409
  function hs(e, t, r) {
106294
106410
  switch (t.type) {
@@ -110256,7 +110372,7 @@ var require_prisma = __commonJS((exports) => {
110256
110372
  Prisma.JsonNull = JsonNull2;
110257
110373
  Prisma.AnyNull = AnyNull2;
110258
110374
  Prisma.NullTypes = NullTypes2;
110259
- var path12 = __require("path");
110375
+ var path14 = __require("path");
110260
110376
  exports.Prisma.TransactionIsolationLevel = makeStrictEnum2({
110261
110377
  ReadUncommitted: "ReadUncommitted",
110262
110378
  ReadCommitted: "ReadCommitted",
@@ -115800,9 +115916,7 @@ var init_postgres_vector_store = __esm(() => {
115800
115916
  floatsToBit(v) {
115801
115917
  return v.map((x) => x >= 0 ? "1" : "0").join("");
115802
115918
  }
115803
- async ensureInitialized() {
115804
- if (this.pool && this.initialized)
115805
- return this.pool;
115919
+ async createPool() {
115806
115920
  const pg2 = await Promise.resolve().then(() => (init_esm6(), exports_esm));
115807
115921
  const PgPool = pg2.default?.Pool ?? pg2.Pool;
115808
115922
  const poolConfig = {
@@ -115811,7 +115925,12 @@ var init_postgres_vector_store = __esm(() => {
115811
115925
  idleTimeoutMillis: 30000,
115812
115926
  connectionTimeoutMillis: 5000
115813
115927
  };
115814
- const pool = new PgPool(poolConfig);
115928
+ return new PgPool(poolConfig);
115929
+ }
115930
+ async ensureInitialized() {
115931
+ if (this.pool && this.initialized)
115932
+ return this.pool;
115933
+ const pool = this.pool ?? await this.createPool();
115815
115934
  this.pool = pool;
115816
115935
  const client = await pool.connect();
115817
115936
  try {
@@ -116202,28 +116321,23 @@ var init_postgres_vector_store = __esm(() => {
116202
116321
  async getPool() {
116203
116322
  if (this.pool)
116204
116323
  return this.pool;
116205
- const pg2 = await Promise.resolve().then(() => (init_esm6(), exports_esm));
116206
- const PgPool = pg2.default?.Pool ?? pg2.Pool;
116207
- const poolConfig = {
116208
- connectionString: this.config.connectionString,
116209
- max: this.config.poolSize,
116210
- idleTimeoutMillis: 30000,
116211
- connectionTimeoutMillis: 5000
116212
- };
116213
- this.pool = new PgPool(poolConfig);
116324
+ this.pool = await this.createPool();
116214
116325
  return this.pool;
116215
116326
  }
116216
116327
  async listAllProjectsAcrossDimensions() {
116217
116328
  const pool = await this.getPool();
116218
116329
  const { rows: tables } = await pool.query(`
116219
- SELECT tablename FROM pg_tables
116220
- WHERE tablename = 'vector_documents'
116221
- OR tablename ~ '^vector_documents_[0-9]+d$'
116330
+ SELECT schemaname, tablename FROM pg_tables
116331
+ WHERE schemaname = current_schema()
116332
+ AND (tablename = 'vector_documents' OR tablename ~ '^vector_documents_[0-9]+d$')
116222
116333
  ORDER BY tablename
116223
116334
  `);
116224
116335
  if (tables.length === 0)
116225
116336
  return [];
116226
- const unionParts = tables.map((t) => `SELECT project_id, COUNT(*)::int AS doc_count, MAX(updated_at) AS last_updated, SUM(LENGTH(content))::bigint AS total_size FROM ${t.tablename} WHERE id NOT LIKE '_metadata:%' GROUP BY project_id`).join(" UNION ALL ");
116337
+ const unionParts = tables.map((t) => {
116338
+ const qualified = `"${t.schemaname}"."${t.tablename}"`;
116339
+ return `SELECT project_id, COUNT(*)::int AS doc_count, MAX(updated_at) AS last_updated, SUM(LENGTH(content))::bigint AS total_size FROM ${qualified} WHERE id NOT LIKE '_metadata:%' GROUP BY project_id`;
116340
+ }).join(" UNION ALL ");
116227
116341
  const { rows } = await pool.query(`
116228
116342
  SELECT project_id,
116229
116343
  SUM(doc_count)::int AS doc_count,
@@ -116332,7 +116446,7 @@ var init_vector_store_factory = __esm(() => {
116332
116446
  });
116333
116447
 
116334
116448
  // ../../packages/core/dist/services/search/search-cache-pg.js
116335
- import crypto5 from "crypto";
116449
+ import crypto6 from "crypto";
116336
116450
 
116337
116451
  class SearchCachePg {
116338
116452
  pool = null;
@@ -116389,7 +116503,7 @@ class SearchCachePg {
116389
116503
  projectId,
116390
116504
  options: this.normalizeOptions(options)
116391
116505
  });
116392
- return crypto5.createHash("sha256").update(payload).digest("hex");
116506
+ return crypto6.createHash("sha256").update(payload).digest("hex");
116393
116507
  }
116394
116508
  normalizeOptions(options) {
116395
116509
  const searchAffectingParams = [
@@ -123125,10 +123239,10 @@ var init_chunker_code = __esm(() => {
123125
123239
  });
123126
123240
 
123127
123241
  // ../../packages/core/dist/services/search/smart-chunker.js
123128
- import path12 from "path";
123242
+ import path14 from "path";
123129
123243
  function smartChunk(content, filePath, config3 = {}) {
123130
123244
  const cfg = { ...DEFAULT_CONFIG, ...config3 };
123131
- const ext2 = path12.extname(filePath).toLowerCase();
123245
+ const ext2 = path14.extname(filePath).toLowerCase();
123132
123246
  const relativePath = filePath;
123133
123247
  const fileImports = isCodeFile(ext2) ? extractFileImports(content, ext2) : undefined;
123134
123248
  let chunks;
@@ -123435,8 +123549,8 @@ var init_managed_run_repository_pg = __esm(() => {
123435
123549
  });
123436
123550
 
123437
123551
  // ../../packages/core/dist/services/search/project-indexer.js
123438
- import fs8 from "fs/promises";
123439
- import path13 from "path";
123552
+ import fs10 from "fs/promises";
123553
+ import path15 from "path";
123440
123554
  import { randomUUID as randomUUID3 } from "crypto";
123441
123555
  async function runWithIndexLock(lockMap, projectId, work) {
123442
123556
  const prevLock = lockMap.get(projectId);
@@ -123479,7 +123593,7 @@ async function indexProjectInternal(deps, projectPath, projectId, options = {})
123479
123593
  dot: false
123480
123594
  });
123481
123595
  const filteredFiles = files.filter((file2) => {
123482
- const relativePath = path13.relative(projectPath, file2);
123596
+ const relativePath = path15.relative(projectPath, file2);
123483
123597
  const shouldIgnore = ig.ignores(relativePath);
123484
123598
  if (shouldIgnore) {
123485
123599
  logger.debug("Ignoring file per .gitignore during indexing", {
@@ -123519,7 +123633,7 @@ async function indexProjectInternal(deps, projectPath, projectId, options = {})
123519
123633
  });
123520
123634
  }
123521
123635
  }
123522
- const indexedFilesList = filteredFiles.map((f) => path13.relative(projectPath, f));
123636
+ const indexedFilesList = filteredFiles.map((f) => path15.relative(projectPath, f));
123523
123637
  await deps.indexManager.updateIndexMetadata(projectId, projectPath, indexedFilesList);
123524
123638
  logger.info("Project indexing completed", {
123525
123639
  projectId,
@@ -123644,7 +123758,7 @@ async function ensureFreshIndex(deps, projectId, projectPath, options = {}) {
123644
123758
  let errors4 = 0;
123645
123759
  for (const relativeFilePath of filesToReindex) {
123646
123760
  try {
123647
- const fullPath = path13.join(projectPath, relativeFilePath);
123761
+ const fullPath = path15.join(projectPath, relativeFilePath);
123648
123762
  const result = await deps.indexFile(fullPath, projectId, projectPath, centralityMap);
123649
123763
  filesIndexed++;
123650
123764
  chunksIndexed += result.chunks;
@@ -123695,8 +123809,8 @@ async function checkSearchAdmission(deps, projectId, projectPath) {
123695
123809
  }
123696
123810
  async function indexFile(deps, filePath, projectId, projectRoot, centralityMap) {
123697
123811
  projectId = await getProjectIdentityAliasResolver().resolve(projectId);
123698
- const content = await fs8.readFile(filePath, "utf-8");
123699
- const relativePath = path13.relative(projectRoot, filePath);
123812
+ const content = await fs10.readFile(filePath, "utf-8");
123813
+ const relativePath = path15.relative(projectRoot, filePath);
123700
123814
  const maxFileSize = config2.get("security").maxFileSize || 1024 * 1024;
123701
123815
  if (content.length > maxFileSize) {
123702
123816
  logger.warn("File too large, skipping", {
@@ -123716,7 +123830,7 @@ async function indexFile(deps, filePath, projectId, projectRoot, centralityMap)
123716
123830
  chunkIndex: i,
123717
123831
  totalChunks: chunks.length,
123718
123832
  type: chunk.type,
123719
- language: path13.extname(filePath).slice(1),
123833
+ language: path15.extname(filePath).slice(1),
123720
123834
  lineStart: chunk.lineStart,
123721
123835
  lineEnd: chunk.lineEnd,
123722
123836
  label: chunk.label,
@@ -124561,8 +124675,8 @@ function stripNul(content) {
124561
124675
  }
124562
124676
 
124563
124677
  // ../../packages/core/dist/services/etl/stages/discover.js
124564
- import fs9 from "fs/promises";
124565
- import path14 from "path";
124678
+ import fs11 from "fs/promises";
124679
+ import path16 from "path";
124566
124680
  import { createHash as createHash5 } from "crypto";
124567
124681
 
124568
124682
  class DiscoverStage {
@@ -124588,7 +124702,7 @@ class DiscoverStage {
124588
124702
  dot: false,
124589
124703
  absolute: false
124590
124704
  });
124591
- relPaths = found.map((p) => path14.isAbsolute(p) ? path14.relative(ctx.projectPath, p) : p).filter((p) => !ig.ignores(p) && applyPolicy(p, policy) !== "Drop");
124705
+ relPaths = found.map((p) => path16.isAbsolute(p) ? path16.relative(ctx.projectPath, p) : p).filter((p) => !ig.ignores(p) && applyPolicy(p, policy) !== "Drop");
124592
124706
  }
124593
124707
  if (ctx.resumeCursor?.path) {
124594
124708
  const cursorPath = ctx.resumeCursor.path;
@@ -124647,10 +124761,10 @@ class DiscoverStage {
124647
124761
  return discovered;
124648
124762
  }
124649
124763
  async processFile(ctx, relativePath, forceReindex) {
124650
- const absolutePath = path14.join(ctx.projectPath, relativePath);
124764
+ const absolutePath = path16.join(ctx.projectPath, relativePath);
124651
124765
  try {
124652
- const stat = await fs9.stat(absolutePath);
124653
- const content = stripNul(await fs9.readFile(absolutePath, "utf-8"));
124766
+ const stat = await fs11.stat(absolutePath);
124767
+ const content = stripNul(await fs11.readFile(absolutePath, "utf-8"));
124654
124768
  const contentHash = createHash5("sha256").update(content).digest("hex");
124655
124769
  let needsReparse = forceReindex;
124656
124770
  if (!forceReindex) {
@@ -124693,8 +124807,8 @@ class DiscoverStage {
124693
124807
  ig.add(pattern);
124694
124808
  }
124695
124809
  try {
124696
- const gitignorePath = path14.join(projectPath, ".gitignore");
124697
- const gitignoreContent = await fs9.readFile(gitignorePath, "utf8");
124810
+ const gitignorePath = path16.join(projectPath, ".gitignore");
124811
+ const gitignoreContent = await fs11.readFile(gitignorePath, "utf8");
124698
124812
  const rules = gitignoreContent.split(`
124699
124813
  `).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
124700
124814
  ig.add(rules);
@@ -126049,8 +126163,8 @@ function rustUseLeaves(node, source, prefix = []) {
126049
126163
  }
126050
126164
  if (node.type === "use_wildcard")
126051
126165
  return [{ path: [...prefix, "*"], glob: true }];
126052
- const path15 = rustPathSegments(node, source);
126053
- return path15.length ? [{ path: [...prefix, ...path15] }] : [];
126166
+ const path17 = rustPathSegments(node, source);
126167
+ return path17.length ? [{ path: [...prefix, ...path17] }] : [];
126054
126168
  }
126055
126169
  function functionalCaptures(captures, source, family) {
126056
126170
  if (family !== "clojure")
@@ -127022,8 +127136,8 @@ var init_structural_runtime = __esm(() => {
127022
127136
  });
127023
127137
 
127024
127138
  // ../../packages/core/dist/services/etl/stages/parse.js
127025
- import path15 from "path";
127026
- import fs10 from "fs/promises";
127139
+ import path17 from "path";
127140
+ import fs12 from "fs/promises";
127027
127141
  function resolveChunkerMaxChars() {
127028
127142
  const global2 = Number(process.env.EMBEDDING_MAX_CHARS);
127029
127143
  if (Number.isFinite(global2) && global2 > 0)
@@ -127051,8 +127165,8 @@ class ParseStage {
127051
127165
  const results = new Map;
127052
127166
  let processed = 0;
127053
127167
  const phases = [
127054
- files.filter((file2) => path15.extname(file2.relativePath).toLowerCase() !== ".h"),
127055
- files.filter((file2) => path15.extname(file2.relativePath).toLowerCase() === ".h")
127168
+ files.filter((file2) => path17.extname(file2.relativePath).toLowerCase() !== ".h"),
127169
+ files.filter((file2) => path17.extname(file2.relativePath).toLowerCase() === ".h")
127056
127170
  ];
127057
127171
  const batches = phases.flatMap((phase) => Array.from({ length: Math.ceil(phase.length / BATCH_SIZE) }, (_, index) => phase.slice(index * BATCH_SIZE, (index + 1) * BATCH_SIZE)));
127058
127172
  for (const batch of batches) {
@@ -127090,19 +127204,19 @@ class ParseStage {
127090
127204
  return files.map((file2) => results.get(file2.relativePath));
127091
127205
  }
127092
127206
  recordHeaderImporterEvidence(ctx, files, parsedFiles) {
127093
- const knownHeaders = new Set(files.filter((file2) => path15.extname(file2.relativePath).toLowerCase() === ".h").map((file2) => path15.posix.normalize(file2.relativePath)));
127207
+ const knownHeaders = new Set(files.filter((file2) => path17.extname(file2.relativePath).toLowerCase() === ".h").map((file2) => path17.posix.normalize(file2.relativePath)));
127094
127208
  const mutable = {
127095
127209
  ...ctx.structuralHeaderEvidenceByFile
127096
127210
  };
127097
127211
  for (const parsed of parsedFiles) {
127098
- const extension = path15.extname(parsed.file.relativePath).toLowerCase();
127212
+ const extension = path17.extname(parsed.file.relativePath).toLowerCase();
127099
127213
  const key = extension === ".c" ? "cImporters" : [".cpp", ".hpp"].includes(extension) ? "cppImporters" : undefined;
127100
127214
  if (!key)
127101
127215
  continue;
127102
127216
  for (const imported of parsed.rawImports) {
127103
127217
  if (!["c_include", "cpp_include"].includes(imported.form) || imported.specifier.startsWith("<"))
127104
127218
  continue;
127105
- const header = path15.posix.normalize(path15.posix.join(path15.posix.dirname(parsed.file.relativePath), imported.specifier));
127219
+ const header = path17.posix.normalize(path17.posix.join(path17.posix.dirname(parsed.file.relativePath), imported.specifier));
127106
127220
  if (!knownHeaders.has(header))
127107
127221
  continue;
127108
127222
  const existing = mutable[header] ?? {};
@@ -127113,9 +127227,9 @@ class ParseStage {
127113
127227
  }
127114
127228
  async parseFile(ctx, file2) {
127115
127229
  if (!file2.needsReparse) {
127116
- const extension = path15.extname(file2.relativePath).toLowerCase();
127230
+ const extension = path17.extname(file2.relativePath).toLowerCase();
127117
127231
  if ([".c", ".cpp", ".hpp"].includes(extension)) {
127118
- const content = file2.snapshotContent ?? await fs10.readFile(file2.absolutePath, "utf8");
127232
+ const content = file2.snapshotContent ?? await fs12.readFile(file2.absolutePath, "utf8");
127119
127233
  const outcome = await this.runtime.parse({ extension, source: Buffer.from(content) });
127120
127234
  if (outcome.status === "failed")
127121
127235
  throw new StructuralEtlParseError(file2.relativePath, outcome.failureKind, `Structural evidence parse failed (${outcome.failureKind})`, outcome.diagnosticCount, outcome.diagnostics.slice(0, 10));
@@ -127127,8 +127241,8 @@ class ParseStage {
127127
127241
  return { file: file2, chunks: [], symbols: [], rawImports: [], rawEdges: [] };
127128
127242
  }
127129
127243
  try {
127130
- const content = file2.snapshotContent ?? await fs10.readFile(file2.absolutePath, "utf-8");
127131
- const ext2 = path15.extname(file2.relativePath).toLowerCase();
127244
+ const content = file2.snapshotContent ?? await fs12.readFile(file2.absolutePath, "utf-8");
127245
+ const ext2 = path17.extname(file2.relativePath).toLowerCase();
127132
127246
  const chunkerMaxChars = resolveChunkerMaxChars();
127133
127247
  const chunks = smartChunk(content, file2.relativePath, chunkerMaxChars ? { maxChunkChars: chunkerMaxChars } : {});
127134
127248
  let symbols;
@@ -127682,7 +127796,7 @@ var init_resolver = __esm(() => {
127682
127796
  });
127683
127797
 
127684
127798
  // ../../packages/core/dist/services/structural/resolvers/typescript.js
127685
- import path16 from "path";
127799
+ import path18 from "path";
127686
127800
  function candidates(identities) {
127687
127801
  return Object.freeze(identities.map((identity) => Object.freeze({
127688
127802
  fqn: identity.fqn,
@@ -127777,7 +127891,7 @@ function probe(base, known, dialect = "typescript") {
127777
127891
  const bases = /\.[cm]?jsx?$/u.test(base) ? [base.replace(/\.[cm]?jsx?$/u, ".ts"), base.replace(/\.[cm]?jsx?$/u, ".tsx"), base] : [base];
127778
127892
  for (const candidateBase of bases)
127779
127893
  for (const suffix of DIALECT_PROBES[dialect] ?? [""]) {
127780
- const value = path16.posix.normalize(`${candidateBase}${suffix}`);
127894
+ const value = path18.posix.normalize(`${candidateBase}${suffix}`);
127781
127895
  if (!value.startsWith("../") && value !== ".." && known.has(value))
127782
127896
  return value;
127783
127897
  }
@@ -127786,7 +127900,7 @@ function probe(base, known, dialect = "typescript") {
127786
127900
  function resolveStructuralSpecifier(specifier, fromFile, build, dialect = "typescript") {
127787
127901
  const known = new Set(build.knownFiles.map(normalizeStructuralFile));
127788
127902
  if (specifier.startsWith("./") || specifier.startsWith("../")) {
127789
- return probe(path16.posix.join(path16.posix.dirname(fromFile), specifier), known, dialect);
127903
+ return probe(path18.posix.join(path18.posix.dirname(fromFile), specifier), known, dialect);
127790
127904
  }
127791
127905
  const aliases = build.pathAliasesByFile?.[normalizeStructuralFile(fromFile)] ?? build.pathAliases ?? [];
127792
127906
  for (const alias of aliases) {
@@ -128050,7 +128164,7 @@ var init_scripting2 = __esm(() => {
128050
128164
  });
128051
128165
 
128052
128166
  // ../../packages/core/dist/services/structural/resolvers/systems.js
128053
- import path17 from "path";
128167
+ import path19 from "path";
128054
128168
  var DIALECTS, SYSTEMS_LANGUAGE_RESOLVER;
128055
128169
  var init_systems2 = __esm(() => {
128056
128170
  init_typescript2();
@@ -128069,7 +128183,7 @@ var init_systems2 = __esm(() => {
128069
128183
  const bindings = item.bindings.map((binding) => binding.imported === "*" && binding.local === "*" && unresolvedTarget && !unresolvedTarget.qualifier ? { ...binding, imported: unresolvedTarget.name, local: unresolvedTarget.name } : binding);
128070
128184
  if (item.specifier === "crate" || item.specifier.startsWith("crate/")) {
128071
128185
  const crateRoot = file2.file.startsWith("src/") ? "src" : "";
128072
- return { ...item, bindings, specifier: `./${path17.posix.relative(path17.posix.dirname(file2.file), path17.posix.join(crateRoot, item.specifier.replace(/^crate\/?/u, "")))}` };
128186
+ return { ...item, bindings, specifier: `./${path19.posix.relative(path19.posix.dirname(file2.file), path19.posix.join(crateRoot, item.specifier.replace(/^crate\/?/u, "")))}` };
128073
128187
  }
128074
128188
  if (item.specifier === "self" || item.specifier.startsWith("self/"))
128075
128189
  return { ...item, bindings, specifier: `./${item.specifier.replace(/^self\/?/u, "")}` };
@@ -128167,8 +128281,8 @@ var init_data_document2 = __esm(() => {
128167
128281
  });
128168
128282
 
128169
128283
  // ../../packages/core/dist/services/etl/stages/resolve.js
128170
- import path18 from "path";
128171
- import fs11 from "fs";
128284
+ import path20 from "path";
128285
+ import fs13 from "fs";
128172
128286
 
128173
128287
  class ResolveStage {
128174
128288
  symbolRepository;
@@ -128192,7 +128306,7 @@ class ResolveStage {
128192
128306
  const structuralDocuments = files.flatMap((file2) => {
128193
128307
  if (!file2.structure)
128194
128308
  return [];
128195
- const language = resolveStructuralLanguage(path18.extname(file2.file.relativePath));
128309
+ const language = resolveStructuralLanguage(path20.extname(file2.file.relativePath));
128196
128310
  if (language.status !== "supported")
128197
128311
  throw new Error(`structural_manifest_missing:${file2.file.relativePath}`);
128198
128312
  return [{
@@ -128204,13 +128318,13 @@ class ResolveStage {
128204
128318
  }];
128205
128319
  });
128206
128320
  const currentStructuralFiles = new Set(structuralDocuments.map((document2) => document2.file));
128207
- const skippedStructuralFiles = new Set(files.filter((item) => !item.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path18.extname(item.file.relativePath).toLowerCase())).map((item) => item.file.relativePath));
128321
+ const skippedStructuralFiles = new Set(files.filter((item) => !item.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path20.extname(item.file.relativePath).toLowerCase())).map((item) => item.file.relativePath));
128208
128322
  const pathAliasesByFile = Object.fromEntries([...knownRelPaths].map((file2) => [
128209
128323
  file2,
128210
128324
  this.structuralAliasesFor(file2, rootAliases, monorepoPackages)
128211
128325
  ]));
128212
128326
  const buildMetadata = { knownFiles: [...knownRelPaths], pathAliasesByFile };
128213
- const seedRows = repositoryDefinitions.filter((definition) => STRUCTURAL_SEED_EXTENSIONS.has(path18.extname(definition.file_path).toLowerCase())).filter((definition) => knownRelPaths.has(definition.file_path) && skippedStructuralFiles.has(definition.file_path)).filter((definition) => !currentStructuralFiles.has(definition.file_path));
128327
+ const seedRows = repositoryDefinitions.filter((definition) => STRUCTURAL_SEED_EXTENSIONS.has(path20.extname(definition.file_path).toLowerCase())).filter((definition) => knownRelPaths.has(definition.file_path) && skippedStructuralFiles.has(definition.file_path)).filter((definition) => !currentStructuralFiles.has(definition.file_path));
128214
128328
  const seedIds = new Set;
128215
128329
  for (const definition of seedRows) {
128216
128330
  if (seedIds.has(definition.id))
@@ -128303,7 +128417,7 @@ class ResolveStage {
128303
128417
  if (parsed.file !== definition.file_path) {
128304
128418
  throw new Error(`structural_repository_seed_file_mismatch:${definition.id}`);
128305
128419
  }
128306
- const language = resolveStructuralLanguage(path18.extname(definition.file_path));
128420
+ const language = resolveStructuralLanguage(path20.extname(definition.file_path));
128307
128421
  if (language.status !== "supported")
128308
128422
  throw new Error(`structural_repository_seed_language:${definition.id}`);
128309
128423
  let identity;
@@ -128355,7 +128469,7 @@ class ResolveStage {
128355
128469
  });
128356
128470
  }
128357
128471
  resolveFile(parsed, projectPath, knownRelPaths, rootAliases, monorepoPackages, symbolIndex, knownFqns) {
128358
- const fromDir = path18.dirname(path18.join(projectPath, parsed.file.relativePath));
128472
+ const fromDir = path20.dirname(path20.join(projectPath, parsed.file.relativePath));
128359
128473
  const packageAliases = this.getPackageAliases(parsed.file.relativePath, monorepoPackages);
128360
128474
  const allAliases = [...packageAliases, ...rootAliases];
128361
128475
  const resolvedImports = parsed.rawImports.map((raw2) => {
@@ -128426,7 +128540,7 @@ class ResolveStage {
128426
128540
  index.set(def.name, `${def.file_path}#${def.name}`);
128427
128541
  }
128428
128542
  } catch (err) {
128429
- const skippedStructural = files.some((file2) => !file2.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path18.extname(file2.file.relativePath).toLowerCase()));
128543
+ const skippedStructural = files.some((file2) => !file2.file.needsReparse && STRUCTURAL_SEED_EXTENSIONS.has(path20.extname(file2.file.relativePath).toLowerCase()));
128430
128544
  if (skippedStructural)
128431
128545
  throw new Error("structural_repository_seed_failed", { cause: err });
128432
128546
  logger.warn("buildSymbolIndex: repo seed failed, in-batch only", {
@@ -128450,7 +128564,7 @@ class ResolveStage {
128450
128564
  }
128451
128565
  resolveSpecifier(specifier, fromDir, projectPath, knownRelPaths, aliases) {
128452
128566
  if (specifier.startsWith("./") || specifier.startsWith("../")) {
128453
- const resolved = this.probeExtensions(path18.resolve(fromDir, specifier), projectPath, knownRelPaths);
128567
+ const resolved = this.probeExtensions(path20.resolve(fromDir, specifier), projectPath, knownRelPaths);
128454
128568
  return { resolvedPath: resolved, external: false };
128455
128569
  }
128456
128570
  for (const alias of aliases) {
@@ -128458,8 +128572,8 @@ class ResolveStage {
128458
128572
  const suffix = specifier.slice(alias.prefix.length);
128459
128573
  for (const target of alias.targets) {
128460
128574
  const cleanTarget = target.replace(/\/\*$/, "");
128461
- const basePath = alias.packagePath ? path18.join(projectPath, alias.packagePath) : projectPath;
128462
- const absPath = path18.join(basePath, cleanTarget + suffix);
128575
+ const basePath = alias.packagePath ? path20.join(projectPath, alias.packagePath) : projectPath;
128576
+ const absPath = path20.join(basePath, cleanTarget + suffix);
128463
128577
  const resolved = this.probeExtensions(absPath, projectPath, knownRelPaths);
128464
128578
  if (resolved)
128465
128579
  return { resolvedPath: resolved, external: false };
@@ -128475,7 +128589,7 @@ class ResolveStage {
128475
128589
  ...TS_EXTENSIONS.map((ext2) => absPath.replace(/\.[^.]+$/, ext2))
128476
128590
  ];
128477
128591
  for (const candidate2 of candidates2) {
128478
- const rel = path18.relative(projectPath, candidate2).replace(/\\/g, "/");
128592
+ const rel = path20.relative(projectPath, candidate2).replace(/\\/g, "/");
128479
128593
  if (knownRelPaths.has(rel))
128480
128594
  return rel;
128481
128595
  }
@@ -128483,9 +128597,9 @@ class ResolveStage {
128483
128597
  }
128484
128598
  loadTsConfigPaths(projectPath, packageBase) {
128485
128599
  const aliases = [];
128486
- const tsconfigPath = path18.join(projectPath, "tsconfig.json");
128600
+ const tsconfigPath = path20.join(projectPath, "tsconfig.json");
128487
128601
  try {
128488
- const raw2 = fs11.readFileSync(tsconfigPath, "utf-8");
128602
+ const raw2 = fs13.readFileSync(tsconfigPath, "utf-8");
128489
128603
  const stripped = raw2.replace(/\/\/[^\n]*/g, "").replace(/\/\*[\s\S]*?\*\//g, "");
128490
128604
  const tsconfig = JSON.parse(stripped);
128491
128605
  const paths = tsconfig?.compilerOptions?.paths ?? {};
@@ -128514,7 +128628,7 @@ class ResolveStage {
128514
128628
  }
128515
128629
  }
128516
128630
  for (const packageRelPath of packagePaths) {
128517
- const absPackagePath = path18.join(projectPath, packageRelPath);
128631
+ const absPackagePath = path20.join(projectPath, packageRelPath);
128518
128632
  const aliases = this.loadTsConfigPaths(absPackagePath, packageRelPath);
128519
128633
  if (aliases.length > 0) {
128520
128634
  packages.push({
@@ -128544,7 +128658,7 @@ class ResolveStage {
128544
128658
  structuralAliasesFor(filePath, rootAliases, packages) {
128545
128659
  return [...this.getPackageAliases(filePath, packages), ...rootAliases].map((alias) => ({
128546
128660
  pattern: alias.prefix + (alias.targets.some((target) => target.includes("*")) ? "/*" : ""),
128547
- targets: alias.targets.map((target) => alias.packagePath ? path18.posix.join(alias.packagePath, target) : target)
128661
+ targets: alias.targets.map((target) => alias.packagePath ? path20.posix.join(alias.packagePath, target) : target)
128548
128662
  }));
128549
128663
  }
128550
128664
  }
@@ -128608,7 +128722,7 @@ var init_with_deadlock_retry = __esm(() => {
128608
128722
  });
128609
128723
 
128610
128724
  // ../../packages/core/dist/services/etl/stages/load.js
128611
- import path19 from "path";
128725
+ import path21 from "path";
128612
128726
  function formatDuration(ms) {
128613
128727
  const totalSec = Math.max(0, Math.round(ms / 1000));
128614
128728
  if (totalSec < 60)
@@ -128885,7 +128999,7 @@ class LoadStage {
128885
128999
  const filePath = file2.file.relativePath;
128886
129000
  const batch = buildSymbolPersistenceBatch(ctx.projectId, file2);
128887
129001
  if (ctx.graphGenerationLease) {
128888
- const manifest = getLanguageManifestEntry(path19.extname(filePath));
129002
+ const manifest = getLanguageManifestEntry(path21.extname(filePath));
128889
129003
  const diagnostics2 = (file2.structuralDiagnostics ?? []).slice(0, 10).map((diagnostic2) => ({
128890
129004
  code: diagnostic2.code,
128891
129005
  severity: diagnostic2.severity,
@@ -129342,9 +129456,9 @@ var init_graph_generation_coordinator = __esm(() => {
129342
129456
  // ../../packages/core/dist/services/etl/pipeline.js
129343
129457
  import { createHash as createHash7 } from "crypto";
129344
129458
  import { setTimeout as delay2 } from "timers/promises";
129345
- import path20 from "path";
129459
+ import path22 from "path";
129346
129460
  function buildHeaderLanguageEvidence(files) {
129347
- const headers = new Set(files.filter((file2) => path20.posix.extname(file2.relativePath).toLowerCase() === ".h").map((file2) => path20.posix.normalize(file2.relativePath)));
129461
+ const headers = new Set(files.filter((file2) => path22.posix.extname(file2.relativePath).toLowerCase() === ".h").map((file2) => path22.posix.normalize(file2.relativePath)));
129348
129462
  const mutable = new Map;
129349
129463
  const entry2 = (header) => {
129350
129464
  let value = mutable.get(header);
@@ -129355,7 +129469,7 @@ function buildHeaderLanguageEvidence(files) {
129355
129469
  return value;
129356
129470
  };
129357
129471
  for (const file2 of files) {
129358
- if (path20.posix.basename(file2.relativePath) !== "compile_commands.json" || file2.snapshotContent === undefined)
129472
+ if (path22.posix.basename(file2.relativePath) !== "compile_commands.json" || file2.snapshotContent === undefined)
129359
129473
  continue;
129360
129474
  let commands;
129361
129475
  try {
@@ -129371,11 +129485,11 @@ function buildHeaderLanguageEvidence(files) {
129371
129485
  const record3 = command;
129372
129486
  if (typeof record3.file !== "string")
129373
129487
  continue;
129374
- const projectRoot = path20.resolve(file2.absolutePath, ...file2.relativePath.split("/").map(() => ".."));
129375
- const commandDirectory = typeof record3.directory === "string" ? path20.resolve(projectRoot, record3.directory) : projectRoot;
129376
- const absoluteInput = path20.resolve(commandDirectory, record3.file);
129377
- const relative2 = path20.relative(projectRoot, absoluteInput);
129378
- const header = path20.posix.normalize(relative2.replaceAll(path20.sep, "/"));
129488
+ const projectRoot = path22.resolve(file2.absolutePath, ...file2.relativePath.split("/").map(() => ".."));
129489
+ const commandDirectory = typeof record3.directory === "string" ? path22.resolve(projectRoot, record3.directory) : projectRoot;
129490
+ const absoluteInput = path22.resolve(commandDirectory, record3.file);
129491
+ const relative2 = path22.relative(projectRoot, absoluteInput);
129492
+ const header = path22.posix.normalize(relative2.replaceAll(path22.sep, "/"));
129379
129493
  if (!headers.has(header))
129380
129494
  continue;
129381
129495
  const invocation = typeof record3.command === "string" ? record3.command : Array.isArray(record3.arguments) ? record3.arguments.join(" ") : "";
@@ -129906,9 +130020,9 @@ var init_acquire_indexing_lease = __esm(() => {
129906
130020
 
129907
130021
  // ../../packages/core/dist/services/project-identity/project-root-identity.js
129908
130022
  import { realpath as realpath2 } from "fs/promises";
129909
- import path21 from "path";
130023
+ import path23 from "path";
129910
130024
  async function canonicalizeProjectRoot(projectPath, canonicalize = realpath2) {
129911
- return canonicalize(path21.resolve(projectPath));
130025
+ return canonicalize(path23.resolve(projectPath));
129912
130026
  }
129913
130027
  async function assertProjectRootReuse(options) {
129914
130028
  if (!options.storedProjectPath || options.forceReindex)
@@ -129916,9 +130030,9 @@ async function assertProjectRootReuse(options) {
129916
130030
  const canonicalize = options.canonicalize ?? realpath2;
129917
130031
  let storedCanonical;
129918
130032
  try {
129919
- storedCanonical = await canonicalize(path21.resolve(options.storedProjectPath));
130033
+ storedCanonical = await canonicalize(path23.resolve(options.storedProjectPath));
129920
130034
  } catch {
129921
- storedCanonical = path21.resolve(options.storedProjectPath);
130035
+ storedCanonical = path23.resolve(options.storedProjectPath);
129922
130036
  }
129923
130037
  if (storedCanonical !== options.canonicalProjectPath) {
129924
130038
  throw new Error(`Project ID "${options.projectId}" already indexes canonical root ` + `"${storedCanonical}", not "${options.canonicalProjectPath}"; ` + "use forceReindex only after verifying ownership of the existing project");
@@ -130661,16 +130775,16 @@ function detectRoutes(httpEdges, defs, opts = {}) {
130661
130775
  const seen = new Set;
130662
130776
  const out = [];
130663
130777
  for (const e of httpEdges) {
130664
- const path22 = e.route;
130665
- if (!path22)
130778
+ const path24 = e.route;
130779
+ if (!path24)
130666
130780
  continue;
130667
130781
  const method = (e.method ?? "ANY").toUpperCase();
130668
- const key = method + " " + path22;
130782
+ const key = method + " " + path24;
130669
130783
  if (seen.has(key))
130670
130784
  continue;
130671
130785
  seen.add(key);
130672
130786
  out.push({
130673
- path: path22,
130787
+ path: path24,
130674
130788
  method: e.method,
130675
130789
  file: e.fromFile,
130676
130790
  handler: e.targetFqn ?? e.symbolName
@@ -130681,12 +130795,12 @@ function detectRoutes(httpEdges, defs, opts = {}) {
130681
130795
  continue;
130682
130796
  const parsed = parseRouteName(d.name);
130683
130797
  const method = parsed?.method ?? "ANY";
130684
- const path22 = parsed?.path ?? d.name;
130685
- const key = method + " " + path22;
130798
+ const path24 = parsed?.path ?? d.name;
130799
+ const key = method + " " + path24;
130686
130800
  if (seen.has(key))
130687
130801
  continue;
130688
130802
  seen.add(key);
130689
- out.push({ path: path22, method: parsed?.method, file: d.filePath, handler: d.name });
130803
+ out.push({ path: path24, method: parsed?.method, file: d.filePath, handler: d.name });
130690
130804
  }
130691
130805
  for (const d of defs) {
130692
130806
  const parsed = parseRouteName(d.name);
@@ -130907,8 +131021,8 @@ __export(exports_symbol_graph_service, {
130907
131021
  symbolGraphService: () => symbolGraphService,
130908
131022
  SymbolGraphService: () => SymbolGraphService
130909
131023
  });
130910
- import path22 from "path";
130911
- import fs12 from "fs/promises";
131024
+ import path24 from "path";
131025
+ import fs14 from "fs/promises";
130912
131026
 
130913
131027
  class SymbolGraphService {
130914
131028
  identityLookup;
@@ -131236,7 +131350,7 @@ class SymbolGraphService {
131236
131350
  async readSnippet(relativePath, lineStart, lineEnd, projectId) {
131237
131351
  try {
131238
131352
  const absolutePath = await this.resolveToAbsolute(relativePath, projectId);
131239
- const content = await fs12.readFile(absolutePath, "utf-8");
131353
+ const content = await fs14.readFile(absolutePath, "utf-8");
131240
131354
  const lines = content.split(`
131241
131355
  `);
131242
131356
  return lines.slice(Math.max(0, lineStart - 1), Math.min(lines.length, lineEnd)).join(`
@@ -131248,7 +131362,7 @@ class SymbolGraphService {
131248
131362
  async readContext(relativePath, lineNumber, contextLines, projectId) {
131249
131363
  try {
131250
131364
  const absolutePath = await this.resolveToAbsolute(relativePath, projectId);
131251
- const content = await fs12.readFile(absolutePath, "utf-8");
131365
+ const content = await fs14.readFile(absolutePath, "utf-8");
131252
131366
  const lines = content.split(`
131253
131367
  `);
131254
131368
  const start = Math.max(0, lineNumber - contextLines - 1);
@@ -131261,7 +131375,7 @@ class SymbolGraphService {
131261
131375
  }
131262
131376
  async resolveToAbsolute(relativePath, projectId) {
131263
131377
  const root = await this.getProjectRoot(projectId);
131264
- return root ? path22.resolve(root, relativePath) : relativePath;
131378
+ return root ? path24.resolve(root, relativePath) : relativePath;
131265
131379
  }
131266
131380
  async getProjectRoot(projectId) {
131267
131381
  const cached2 = this.projectRootCache.get(projectId);
@@ -131404,7 +131518,7 @@ var init_workspace_manager = __esm(() => {
131404
131518
  });
131405
131519
 
131406
131520
  // ../../packages/core/dist/tools/index_project.js
131407
- import path23 from "path";
131521
+ import path25 from "path";
131408
131522
 
131409
131523
  class IndexProjectTool {
131410
131524
  name = "index_project";
@@ -131452,7 +131566,7 @@ class IndexProjectTool {
131452
131566
  try {
131453
131567
  await assertParserReadyForIndexing();
131454
131568
  const canonicalProjectPath = await canonicalizeProjectRoot(projectPath);
131455
- const finalProjectId = projectId || path23.basename(canonicalProjectPath) || "default";
131569
+ const finalProjectId = projectId || path25.basename(canonicalProjectPath) || "default";
131456
131570
  const existing = await workspaceManager.getWorkspace(finalProjectId);
131457
131571
  await assertProjectRootReuse({
131458
131572
  projectId: finalProjectId,
@@ -132005,17 +132119,17 @@ function applyReplacer(root, replacer) {
132005
132119
  return transformChildren(root, replacer, []);
132006
132120
  return transformChildren(normalizeValue(replacedRoot), replacer, []);
132007
132121
  }
132008
- function transformChildren(value, replacer, path24) {
132122
+ function transformChildren(value, replacer, path26) {
132009
132123
  if (isJsonObject(value))
132010
- return transformObject(value, replacer, path24);
132124
+ return transformObject(value, replacer, path26);
132011
132125
  if (isJsonArray(value))
132012
- return transformArray(value, replacer, path24);
132126
+ return transformArray(value, replacer, path26);
132013
132127
  return value;
132014
132128
  }
132015
- function transformObject(obj, replacer, path24) {
132129
+ function transformObject(obj, replacer, path26) {
132016
132130
  const result = {};
132017
132131
  for (const [key, value] of Object.entries(obj)) {
132018
- const childPath = [...path24, key];
132132
+ const childPath = [...path26, key];
132019
132133
  const replacedValue = replacer(key, value, childPath);
132020
132134
  if (replacedValue === undefined)
132021
132135
  continue;
@@ -132023,11 +132137,11 @@ function transformObject(obj, replacer, path24) {
132023
132137
  }
132024
132138
  return result;
132025
132139
  }
132026
- function transformArray(arr, replacer, path24) {
132140
+ function transformArray(arr, replacer, path26) {
132027
132141
  const result = [];
132028
132142
  for (let i = 0;i < arr.length; i++) {
132029
132143
  const value = arr[i];
132030
- const childPath = [...path24, i];
132144
+ const childPath = [...path26, i];
132031
132145
  const replacedValue = replacer(String(i), value, childPath);
132032
132146
  if (replacedValue === undefined)
132033
132147
  continue;
@@ -137097,9 +137211,9 @@ var init_session_pin_store = __esm(() => {
137097
137211
  });
137098
137212
 
137099
137213
  // ../../packages/core/dist/services/hooks/attribution-resolver.js
137100
- import fs13 from "fs";
137214
+ import fs15 from "fs";
137101
137215
  import os6 from "os";
137102
- import path24 from "path";
137216
+ import path26 from "path";
137103
137217
 
137104
137218
  class PgWorkspaceRootProvider {
137105
137219
  cache = null;
@@ -137149,7 +137263,7 @@ class AttributionResolver {
137149
137263
  this.pins = options.pins ?? new SessionPinStore;
137150
137264
  this.canonicalize = options.canonicalize ?? defaultCanonicalize;
137151
137265
  this.homedir = options.homedir ?? os6.homedir;
137152
- this.fsRoot = options.fsRoot ?? (() => path24.parse(path24.sep).root);
137266
+ this.fsRoot = options.fsRoot ?? (() => path26.parse(path26.sep).root);
137153
137267
  }
137154
137268
  async resolve(input) {
137155
137269
  const caller = input.callerProjectId;
@@ -137200,7 +137314,7 @@ class AttributionResolver {
137200
137314
  }
137201
137315
  let bestPath = null;
137202
137316
  for (const candidate2 of byPath.keys()) {
137203
- if (canonicalCwd === candidate2 || canonicalCwd.startsWith(candidate2.endsWith(path24.sep) ? candidate2 : candidate2 + path24.sep)) {
137317
+ if (canonicalCwd === candidate2 || canonicalCwd.startsWith(candidate2.endsWith(path26.sep) ? candidate2 : candidate2 + path26.sep)) {
137204
137318
  if (bestPath === null || candidate2.length > bestPath.length) {
137205
137319
  bestPath = candidate2;
137206
137320
  }
@@ -137223,7 +137337,7 @@ class AttributionResolver {
137223
137337
  return projectPath2;
137224
137338
  const fsRoot = this.fsRoot();
137225
137339
  let normalized = projectPath2;
137226
- while (normalized.length > fsRoot.length && normalized.endsWith(path24.sep)) {
137340
+ while (normalized.length > fsRoot.length && normalized.endsWith(path26.sep)) {
137227
137341
  normalized = normalized.slice(0, -1);
137228
137342
  }
137229
137343
  return normalized;
@@ -137231,10 +137345,10 @@ class AttributionResolver {
137231
137345
  }
137232
137346
  function defaultCanonicalize(cwd) {
137233
137347
  try {
137234
- return fs13.realpathSync(cwd);
137348
+ return fs15.realpathSync(cwd);
137235
137349
  } catch {
137236
137350
  try {
137237
- return path24.resolve(cwd);
137351
+ return path26.resolve(cwd);
137238
137352
  } catch {
137239
137353
  return;
137240
137354
  }
@@ -137982,31 +138096,31 @@ class TracePathService {
137982
138096
  const chains = [];
137983
138097
  const seen = new Set;
137984
138098
  let walks = 0;
137985
- const walk = (fqn, path25) => {
138099
+ const walk = (fqn, path27) => {
137986
138100
  if (chains.length >= CHAIN_CAP)
137987
138101
  return;
137988
138102
  if (walks >= MAX_WALKS)
137989
138103
  return;
137990
138104
  walks++;
137991
- const key = path25.join("\u2192");
138105
+ const key = path27.join("\u2192");
137992
138106
  if (seen.has(key))
137993
138107
  return;
137994
138108
  seen.add(key);
137995
138109
  const next = adj.get(fqn);
137996
138110
  if (!next || next.length === 0 || !whoHasChild.has(fqn)) {
137997
- if (path25.length > 1)
137998
- chains.push(path25.map((n) => this.fqnToName(n)).join(" \u2192 "));
138111
+ if (path27.length > 1)
138112
+ chains.push(path27.map((n) => this.fqnToName(n)).join(" \u2192 "));
137999
138113
  return;
138000
138114
  }
138001
138115
  for (const child of next) {
138002
138116
  if (chains.length >= CHAIN_CAP || walks >= MAX_WALKS)
138003
138117
  return;
138004
- if (path25.includes(child)) {
138005
- const cycled = [...path25, `${this.fqnToName(child)}\u21BA`];
138118
+ if (path27.includes(child)) {
138119
+ const cycled = [...path27, `${this.fqnToName(child)}\u21BA`];
138006
138120
  chains.push(cycled.map((n) => n).join(" \u2192 "));
138007
138121
  continue;
138008
138122
  }
138009
- walk(child, [...path25, child]);
138123
+ walk(child, [...path27, child]);
138010
138124
  }
138011
138125
  };
138012
138126
  for (const seed of seeds) {
@@ -138839,7 +138953,7 @@ var init_get_architecture = __esm(() => {
138839
138953
  });
138840
138954
 
138841
138955
  // ../../packages/core/dist/services/file-read/file-content-cache.js
138842
- import fs14 from "fs/promises";
138956
+ import fs16 from "fs/promises";
138843
138957
 
138844
138958
  class FileContentCache {
138845
138959
  extractMetadata;
@@ -138872,7 +138986,7 @@ class FileContentCache {
138872
138986
  metadata: cached2.metadata
138873
138987
  };
138874
138988
  }
138875
- const content = await fs14.readFile(filePath, "utf-8");
138989
+ const content = await fs16.readFile(filePath, "utf-8");
138876
138990
  const metadata = await this.extractMetadata(content, filePath, options);
138877
138991
  evictOldest(this.fileCache, this.FILE_CACHE_MAX_ENTRIES - 1);
138878
138992
  this.fileCache.set(cacheKey, {
@@ -138889,7 +139003,7 @@ var init_file_content_cache = __esm(() => {
138889
139003
  });
138890
139004
 
138891
139005
  // ../../packages/core/dist/services/file-read/file-metadata.js
138892
- import path25 from "path";
139006
+ import path27 from "path";
138893
139007
 
138894
139008
  class FileMetadataExtractor {
138895
139009
  symbolGraph;
@@ -138925,7 +139039,7 @@ class FileMetadataExtractor {
138925
139039
  return metadata;
138926
139040
  }
138927
139041
  detectLanguage(filePath) {
138928
- const ext2 = path25.extname(filePath).toLowerCase();
139042
+ const ext2 = path27.extname(filePath).toLowerCase();
138929
139043
  const languageMap2 = {
138930
139044
  ".ts": "TypeScript",
138931
139045
  ".tsx": "TypeScript",
@@ -139047,7 +139161,7 @@ var init_line_range = __esm(() => {
139047
139161
  });
139048
139162
 
139049
139163
  // ../../packages/core/dist/services/file-read/path-containment.js
139050
- import path26 from "path";
139164
+ import path28 from "path";
139051
139165
 
139052
139166
  class PathContainment {
139053
139167
  projectRoots;
@@ -139055,14 +139169,14 @@ class PathContainment {
139055
139169
  this.projectRoots = projectRoots;
139056
139170
  }
139057
139171
  async resolveFilePath(filePath, projectId) {
139058
- if (path26.isAbsolute(filePath)) {
139059
- return path26.resolve(filePath);
139172
+ if (path28.isAbsolute(filePath)) {
139173
+ return path28.resolve(filePath);
139060
139174
  }
139061
139175
  if (projectId) {
139062
139176
  const root = await this.projectRoots.getProjectRoot(projectId);
139063
139177
  if (root) {
139064
139178
  const cleaned = sanitizeFilePath(filePath);
139065
- return path26.resolve(root, cleaned);
139179
+ return path28.resolve(root, cleaned);
139066
139180
  }
139067
139181
  return null;
139068
139182
  }
@@ -139073,17 +139187,17 @@ class PathContainment {
139073
139187
  if (projectId) {
139074
139188
  const root = await this.projectRoots.getProjectRoot(projectId);
139075
139189
  if (root)
139076
- roots.push(path26.resolve(root));
139190
+ roots.push(path28.resolve(root));
139077
139191
  }
139078
- roots.push(path26.resolve(process.cwd()));
139192
+ roots.push(path28.resolve(process.cwd()));
139079
139193
  const envRoots = (process.env.MASSA_AI_READ_FILE_ROOTS ?? "").split(":").map((s) => s.trim()).filter((s) => s.length > 0);
139080
139194
  for (const extra of envRoots) {
139081
- roots.push(path26.resolve(extra));
139195
+ roots.push(path28.resolve(extra));
139082
139196
  }
139083
- const target = path26.resolve(absoluteFilePath);
139197
+ const target = path28.resolve(absoluteFilePath);
139084
139198
  for (const root of roots) {
139085
- const rel = path26.relative(root, target);
139086
- if (rel !== "" && !rel.startsWith("..") && !path26.isAbsolute(rel)) {
139199
+ const rel = path28.relative(root, target);
139200
+ if (rel !== "" && !rel.startsWith("..") && !path28.isAbsolute(rel)) {
139087
139201
  return { allowed: true };
139088
139202
  }
139089
139203
  if (rel === "")
@@ -142297,9 +142411,9 @@ var init_l1_memory_cache = __esm(() => {
142297
142411
  });
142298
142412
 
142299
142413
  // ../../packages/core/dist/services/health/local-health-checker.js
142300
- import fs15 from "fs/promises";
142414
+ import fs17 from "fs/promises";
142301
142415
  import { existsSync as existsSync3 } from "fs";
142302
- import path27 from "path";
142416
+ import path29 from "path";
142303
142417
 
142304
142418
  class LocalHealthChecker {
142305
142419
  ollamaBaseUrl = process.env.OLLAMA_BASE_URL || "http://localhost:11434";
@@ -142333,10 +142447,10 @@ class LocalHealthChecker {
142333
142447
  const start = Date.now();
142334
142448
  try {
142335
142449
  if (!existsSync3(this.dataDir))
142336
- await fs15.mkdir(this.dataDir, { recursive: true });
142337
- const probe2 = path27.join(this.dataDir, ".health-check-test");
142338
- await fs15.writeFile(probe2, "ok");
142339
- await fs15.unlink(probe2);
142450
+ await fs17.mkdir(this.dataDir, { recursive: true });
142451
+ const probe2 = path29.join(this.dataDir, ".health-check-test");
142452
+ await fs17.writeFile(probe2, "ok");
142453
+ await fs17.unlink(probe2);
142340
142454
  return { available: true, latency: Date.now() - start, details: { path: this.dataDir, writable: true } };
142341
142455
  } catch (error51) {
142342
142456
  return { available: false, latency: Date.now() - start, error: `Data directory error: ${error51.message}` };
@@ -144289,9 +144403,9 @@ var init_scheduler2 = __esm(() => {
144289
144403
  });
144290
144404
 
144291
144405
  // ../../packages/core/dist/services/pricing/models-dev-client.js
144292
- import fs16 from "fs/promises";
144406
+ import fs18 from "fs/promises";
144293
144407
  import { existsSync as existsSync4 } from "fs";
144294
- import path28 from "path";
144408
+ import path30 from "path";
144295
144409
  function getModelsDevClient() {
144296
144410
  if (!clientInstance) {
144297
144411
  clientInstance = new ModelsDevClient;
@@ -144311,7 +144425,7 @@ var init_models_dev_client = __esm(() => {
144311
144425
  memoryCacheTimestamp = 0;
144312
144426
  getLocalCachePath() {
144313
144427
  const dataDir = config2.get("dataDir");
144314
- return path28.join(dataDir, ModelsDevClient.LOCAL_CACHE_FILE);
144428
+ return path30.join(dataDir, ModelsDevClient.LOCAL_CACHE_FILE);
144315
144429
  }
144316
144430
  async loadLocalCache() {
144317
144431
  const cachePath = this.getLocalCachePath();
@@ -144319,7 +144433,7 @@ var init_models_dev_client = __esm(() => {
144319
144433
  if (!existsSync4(cachePath)) {
144320
144434
  return null;
144321
144435
  }
144322
- const content = await fs16.readFile(cachePath, "utf-8");
144436
+ const content = await fs18.readFile(cachePath, "utf-8");
144323
144437
  const data = JSON.parse(content);
144324
144438
  const age = Date.now() - data.timestamp;
144325
144439
  if (age > ModelsDevClient.LOCAL_CACHE_TTL) {
@@ -144346,14 +144460,14 @@ var init_models_dev_client = __esm(() => {
144346
144460
  async saveLocalCache(models) {
144347
144461
  const cachePath = this.getLocalCachePath();
144348
144462
  try {
144349
- const dir = path28.dirname(cachePath);
144350
- await fs16.mkdir(dir, { recursive: true });
144463
+ const dir = path30.dirname(cachePath);
144464
+ await fs18.mkdir(dir, { recursive: true });
144351
144465
  const data = {
144352
144466
  timestamp: Date.now(),
144353
144467
  version: "1.0.0",
144354
144468
  models: Object.fromEntries(models)
144355
144469
  };
144356
- await fs16.writeFile(cachePath, JSON.stringify(data), "utf-8");
144470
+ await fs18.writeFile(cachePath, JSON.stringify(data), "utf-8");
144357
144471
  logger.debug("Saved pricing to local cache", {
144358
144472
  models: models.size,
144359
144473
  path: cachePath
@@ -144682,7 +144796,7 @@ var init_models_dev_client = __esm(() => {
144682
144796
  const cachePath = this.getLocalCachePath();
144683
144797
  try {
144684
144798
  if (existsSync4(cachePath)) {
144685
- await fs16.unlink(cachePath);
144799
+ await fs18.unlink(cachePath);
144686
144800
  logger.debug("Local pricing cache file deleted");
144687
144801
  }
144688
144802
  } catch (error51) {
@@ -150237,33 +150351,33 @@ var require_URL = __commonJS((exports, module) => {
150237
150351
  else
150238
150352
  return basepath.substring(0, lastslash + 1) + refpath;
150239
150353
  }
150240
- function remove_dot_segments(path29) {
150241
- if (!path29)
150242
- return path29;
150354
+ function remove_dot_segments(path31) {
150355
+ if (!path31)
150356
+ return path31;
150243
150357
  var output = "";
150244
- while (path29.length > 0) {
150245
- if (path29 === "." || path29 === "..") {
150246
- path29 = "";
150358
+ while (path31.length > 0) {
150359
+ if (path31 === "." || path31 === "..") {
150360
+ path31 = "";
150247
150361
  break;
150248
150362
  }
150249
- var twochars = path29.substring(0, 2);
150250
- var threechars = path29.substring(0, 3);
150251
- var fourchars = path29.substring(0, 4);
150363
+ var twochars = path31.substring(0, 2);
150364
+ var threechars = path31.substring(0, 3);
150365
+ var fourchars = path31.substring(0, 4);
150252
150366
  if (threechars === "../") {
150253
- path29 = path29.substring(3);
150367
+ path31 = path31.substring(3);
150254
150368
  } else if (twochars === "./") {
150255
- path29 = path29.substring(2);
150369
+ path31 = path31.substring(2);
150256
150370
  } else if (threechars === "/./") {
150257
- path29 = "/" + path29.substring(3);
150258
- } else if (twochars === "/." && path29.length === 2) {
150259
- path29 = "/";
150260
- } else if (fourchars === "/../" || threechars === "/.." && path29.length === 3) {
150261
- path29 = "/" + path29.substring(4);
150371
+ path31 = "/" + path31.substring(3);
150372
+ } else if (twochars === "/." && path31.length === 2) {
150373
+ path31 = "/";
150374
+ } else if (fourchars === "/../" || threechars === "/.." && path31.length === 3) {
150375
+ path31 = "/" + path31.substring(4);
150262
150376
  output = output.replace(/\/?[^\/]*$/, "");
150263
150377
  } else {
150264
- var segment = path29.match(/(\/?([^\/]*))/)[0];
150378
+ var segment = path31.match(/(\/?([^\/]*))/)[0];
150265
150379
  output += segment;
150266
- path29 = path29.substring(segment.length);
150380
+ path31 = path31.substring(segment.length);
150267
150381
  }
150268
150382
  }
150269
150383
  return output;
@@ -162333,21 +162447,21 @@ function jsonToKeyPathChunks(value, label = "$") {
162333
162447
  walk(value, label, out);
162334
162448
  return out;
162335
162449
  }
162336
- function walk(val, path29, out) {
162450
+ function walk(val, path31, out) {
162337
162451
  if (val === null || val === undefined)
162338
162452
  return;
162339
162453
  if (Array.isArray(val)) {
162340
162454
  if (val.length === 0) {
162341
- out.push({ path: path29, content: `**${path29}** = _[]_` });
162455
+ out.push({ path: path31, content: `**${path31}** = _[]_` });
162342
162456
  return;
162343
162457
  }
162344
162458
  if (val.every((v) => v !== null && typeof v === "object")) {
162345
- val.forEach((v, i) => walk(v, `${path29}[${i}]`, out));
162459
+ val.forEach((v, i) => walk(v, `${path31}[${i}]`, out));
162346
162460
  return;
162347
162461
  }
162348
162462
  const items = val.map((v) => `- \`${String(v)}\``).join(`
162349
162463
  `);
162350
- out.push({ path: path29, content: `**${path29}**
162464
+ out.push({ path: path31, content: `**${path31}**
162351
162465
 
162352
162466
  ${items}` });
162353
162467
  return;
@@ -162355,16 +162469,16 @@ ${items}` });
162355
162469
  if (typeof val === "object") {
162356
162470
  const entries = Object.entries(val);
162357
162471
  if (entries.length === 0) {
162358
- out.push({ path: path29, content: `**${path29}** = _{}_` });
162472
+ out.push({ path: path31, content: `**${path31}** = _{}_` });
162359
162473
  return;
162360
162474
  }
162361
162475
  for (const [k, v] of entries) {
162362
162476
  const safeKey = /^[A-Za-z_$][\w$]*$/.test(k) ? k : JSON.stringify(k);
162363
- walk(v, `${path29}.${safeKey}`, out);
162477
+ walk(v, `${path31}.${safeKey}`, out);
162364
162478
  }
162365
162479
  return;
162366
162480
  }
162367
- out.push({ path: path29, content: `**${path29}** = \`${String(val)}\`` });
162481
+ out.push({ path: path31, content: `**${path31}** = \`${String(val)}\`` });
162368
162482
  }
162369
162483
  var gfm, STRIP_SELECTORS, tdCache = null;
162370
162484
  var init_html_to_md = __esm(() => {
@@ -163127,8 +163241,8 @@ var init_hook_service = __esm(() => {
163127
163241
 
163128
163242
  // ../../packages/core/dist/services/bootstrap/bootstrap-service.js
163129
163243
  import { randomUUID as randomUUID9 } from "crypto";
163130
- import fs17 from "fs";
163131
- import path29 from "path";
163244
+ import fs19 from "fs";
163245
+ import path31 from "path";
163132
163246
  import { spawn as spawn2 } from "child_process";
163133
163247
  function readBootstrapConfig() {
163134
163248
  try {
@@ -163288,9 +163402,9 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
163288
163402
  }
163289
163403
  try {
163290
163404
  for (const name26 of README_CANDIDATES) {
163291
- const p = path29.join(projectRoot, name26);
163292
- if (fs17.existsSync(p) && fs17.statSync(p).isFile()) {
163293
- const buf = fs17.readFileSync(p);
163405
+ const p = path31.join(projectRoot, name26);
163406
+ if (fs19.existsSync(p) && fs19.statSync(p).isFile()) {
163407
+ const buf = fs19.readFileSync(p);
163294
163408
  signals.readme = buf.slice(0, MAX_README_BYTES).toString("utf8");
163295
163409
  break;
163296
163410
  }
@@ -163299,14 +163413,14 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
163299
163413
  logger.debug("bootstrap scan: README read failed", { error: e.message });
163300
163414
  }
163301
163415
  try {
163302
- const docsDir = path29.join(projectRoot, "docs");
163303
- if (fs17.existsSync(docsDir) && fs17.statSync(docsDir).isDirectory()) {
163416
+ const docsDir = path31.join(projectRoot, "docs");
163417
+ if (fs19.existsSync(docsDir) && fs19.statSync(docsDir).isDirectory()) {
163304
163418
  const entries = walkMarkdown(docsDir).slice(0, MAX_DOCS);
163305
163419
  for (const rel of entries) {
163306
163420
  try {
163307
- const buf = fs17.readFileSync(rel);
163421
+ const buf = fs19.readFileSync(rel);
163308
163422
  signals.docs.push({
163309
- path: path29.relative(projectRoot, rel),
163423
+ path: path31.relative(projectRoot, rel),
163310
163424
  snippet: buf.slice(0, MAX_DOC_BYTES).toString("utf8")
163311
163425
  });
163312
163426
  } catch {}
@@ -163317,10 +163431,10 @@ async function scanSignals(_projectId, projectRoot, caps, symbolGraph, gitRunner
163317
163431
  }
163318
163432
  try {
163319
163433
  for (const name26 of MANIFEST_FILES) {
163320
- const p = path29.join(projectRoot, name26);
163321
- if (!fs17.existsSync(p) || !fs17.statSync(p).isFile())
163434
+ const p = path31.join(projectRoot, name26);
163435
+ if (!fs19.existsSync(p) || !fs19.statSync(p).isFile())
163322
163436
  continue;
163323
- const raw2 = fs17.readFileSync(p).slice(0, MAX_MANIFEST_BYTES).toString("utf8");
163437
+ const raw2 = fs19.readFileSync(p).slice(0, MAX_MANIFEST_BYTES).toString("utf8");
163324
163438
  const kind = name26;
163325
163439
  if (name26 === "package.json") {
163326
163440
  try {
@@ -163360,12 +163474,12 @@ function walkMarkdown(dir) {
163360
163474
  const cur = stack.pop();
163361
163475
  let entries;
163362
163476
  try {
163363
- entries = fs17.readdirSync(cur, { withFileTypes: true });
163477
+ entries = fs19.readdirSync(cur, { withFileTypes: true });
163364
163478
  } catch {
163365
163479
  continue;
163366
163480
  }
163367
163481
  for (const e of entries) {
163368
- const full = path29.join(cur, e.name);
163482
+ const full = path31.join(cur, e.name);
163369
163483
  if (e.isDirectory()) {
163370
163484
  if (e.name === "node_modules" || e.name.startsWith("."))
163371
163485
  continue;
@@ -166777,7 +166891,7 @@ class StdioServerTransport {
166777
166891
  }
166778
166892
 
166779
166893
  // src/index.ts
166780
- import fs20 from "fs/promises";
166894
+ import fs22 from "fs/promises";
166781
166895
 
166782
166896
  // src/api-client.ts
166783
166897
  init_config();
@@ -166887,8 +167001,8 @@ init_dist();
166887
167001
  init_dist();
166888
167002
  init_dist15();
166889
167003
  init_dist();
166890
- import fs18 from "fs/promises";
166891
- import path30 from "path";
167004
+ import fs20 from "fs/promises";
167005
+ import path32 from "path";
166892
167006
  var _indexProjectTool = null;
166893
167007
  function indexProjectTool() {
166894
167008
  if (!_indexProjectTool)
@@ -167171,8 +167285,8 @@ class EmbeddedApiClient {
167171
167285
  } else {
167172
167286
  end = start + 20;
167173
167287
  }
167174
- const absolutePath = path30.join(workspace.project_path, file2);
167175
- const content = await fs18.readFile(absolutePath, "utf-8");
167288
+ const absolutePath = path32.join(workspace.project_path, file2);
167289
+ const content = await fs20.readFile(absolutePath, "utf-8");
167176
167290
  const lines = content.split(/\r?\n/);
167177
167291
  const slice = lines.slice(start - 1, Math.min(lines.length, end));
167178
167292
  const formatted = slice.map((text3, idx) => ({ lineNumber: start + idx, content: text3 }));
@@ -167409,22 +167523,22 @@ class EmbeddedApiClient {
167409
167523
  async uploadAndIndex(params) {
167410
167524
  const rawBase = params.projectId || params.projectPath.replace(/\\/g, "/").split("/").filter(Boolean).pop() || "default";
167411
167525
  const finalProjectId = rawBase.replace(/[^a-zA-Z0-9_.-]/g, "_").slice(0, 128);
167412
- const uploadRoot = process.env.MASSA_AI_UPLOAD_DIR || path30.join(getGlobalDataDir(), "uploads");
167413
- const stagingDir = path30.resolve(uploadRoot, finalProjectId);
167414
- await fs18.rm(stagingDir, { recursive: true, force: true });
167415
- await fs18.mkdir(stagingDir, { recursive: true });
167526
+ const uploadRoot = process.env.MASSA_AI_UPLOAD_DIR || path32.join(getGlobalDataDir(), "uploads");
167527
+ const stagingDir = path32.resolve(uploadRoot, finalProjectId);
167528
+ await fs20.rm(stagingDir, { recursive: true, force: true });
167529
+ await fs20.mkdir(stagingDir, { recursive: true });
167416
167530
  const WRITE_BATCH = 20;
167417
167531
  for (let i = 0;i < params.files.length; i += WRITE_BATCH) {
167418
167532
  await Promise.all(params.files.slice(i, i + WRITE_BATCH).map(async (file2) => {
167419
- if (path30.isAbsolute(file2.relativePath) || file2.relativePath.includes("..")) {
167533
+ if (path32.isAbsolute(file2.relativePath) || file2.relativePath.includes("..")) {
167420
167534
  throw new Error(`Invalid file path: ${file2.relativePath}`);
167421
167535
  }
167422
- const dest = path30.resolve(stagingDir, file2.relativePath.replace(/\//g, path30.sep));
167423
- if (!dest.startsWith(stagingDir + path30.sep)) {
167536
+ const dest = path32.resolve(stagingDir, file2.relativePath.replace(/\//g, path32.sep));
167537
+ if (!dest.startsWith(stagingDir + path32.sep)) {
167424
167538
  throw new Error(`Path escapes staging directory: ${file2.relativePath}`);
167425
167539
  }
167426
- await fs18.mkdir(path30.dirname(dest), { recursive: true });
167427
- await fs18.writeFile(dest, file2.content, "utf-8");
167540
+ await fs20.mkdir(path32.dirname(dest), { recursive: true });
167541
+ await fs20.writeFile(dest, file2.content, "utf-8");
167428
167542
  }));
167429
167543
  }
167430
167544
  return await indexProjectTool().handle({
@@ -167768,8 +167882,8 @@ class EmbeddedApiClient {
167768
167882
 
167769
167883
  // src/file-collector.ts
167770
167884
  init_config();
167771
- import fs19 from "fs/promises";
167772
- import path31 from "path";
167885
+ import fs21 from "fs/promises";
167886
+ import path33 from "path";
167773
167887
  var SKIP_DIRS = new Set([
167774
167888
  "node_modules",
167775
167889
  ".git",
@@ -167810,7 +167924,7 @@ async function walk2(root2, dir, files, state, allowed) {
167810
167924
  return;
167811
167925
  let entries;
167812
167926
  try {
167813
- entries = await fs19.readdir(dir, { withFileTypes: true });
167927
+ entries = await fs21.readdir(dir, { withFileTypes: true });
167814
167928
  } catch {
167815
167929
  return;
167816
167930
  }
@@ -167819,22 +167933,22 @@ async function walk2(root2, dir, files, state, allowed) {
167819
167933
  break;
167820
167934
  if (entry2.isDirectory()) {
167821
167935
  if (!SKIP_DIRS.has(entry2.name) && !entry2.name.startsWith(".")) {
167822
- await walk2(root2, path31.join(dir, entry2.name), files, state, allowed);
167936
+ await walk2(root2, path33.join(dir, entry2.name), files, state, allowed);
167823
167937
  }
167824
167938
  } else if (entry2.isFile()) {
167825
- const ext2 = path31.extname(entry2.name).toLowerCase();
167939
+ const ext2 = path33.extname(entry2.name).toLowerCase();
167826
167940
  if (!allowed.has(ext2))
167827
167941
  continue;
167828
- const fullPath = path31.join(dir, entry2.name);
167942
+ const fullPath = path33.join(dir, entry2.name);
167829
167943
  try {
167830
- const stat = await fs19.stat(fullPath);
167944
+ const stat = await fs21.stat(fullPath);
167831
167945
  if (stat.size > MAX_FILE_BYTES)
167832
167946
  continue;
167833
167947
  if (state.totalBytes + stat.size > MAX_TOTAL_BYTES)
167834
167948
  continue;
167835
- const content = await fs19.readFile(fullPath, "utf-8");
167949
+ const content = await fs21.readFile(fullPath, "utf-8");
167836
167950
  state.totalBytes += stat.size;
167837
- const relativePath = path31.relative(root2, fullPath).split(path31.sep).join("/");
167951
+ const relativePath = path33.relative(root2, fullPath).split(path33.sep).join("/");
167838
167952
  files.push({ relativePath, content });
167839
167953
  } catch {}
167840
167954
  }
@@ -169735,7 +169849,7 @@ class McpProxyServer {
169735
169849
  return textContent(JSON.stringify({ success: false, error: "projectPath is required" }));
169736
169850
  }
169737
169851
  try {
169738
- if (!(await fs20.stat(projectPath2)).isDirectory()) {
169852
+ if (!(await fs22.stat(projectPath2)).isDirectory()) {
169739
169853
  return textContent(JSON.stringify({ success: false, error: `${projectPath2} is not a directory` }));
169740
169854
  }
169741
169855
  } catch {