@openez-graph/cli 1.3.1 → 1.4.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.
package/dist/cli.cjs CHANGED
@@ -123,7 +123,7 @@ var init_esm = __esm({
123
123
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
124
124
  const statMethod = opts.lstat ? import_promises.lstat : import_promises.stat;
125
125
  if (wantBigintFsStats) {
126
- this._stat = (path26) => statMethod(path26, { bigint: true });
126
+ this._stat = (path27) => statMethod(path27, { bigint: true });
127
127
  } else {
128
128
  this._stat = statMethod;
129
129
  }
@@ -148,8 +148,8 @@ var init_esm = __esm({
148
148
  const par = this.parent;
149
149
  const fil = par && par.files;
150
150
  if (fil && fil.length > 0) {
151
- const { path: path26, depth } = par;
152
- const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path26));
151
+ const { path: path27, depth } = par;
152
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path27));
153
153
  const awaited = await Promise.all(slice);
154
154
  for (const entry of awaited) {
155
155
  if (!entry)
@@ -189,20 +189,20 @@ var init_esm = __esm({
189
189
  this.reading = false;
190
190
  }
191
191
  }
192
- async _exploreDir(path26, depth) {
192
+ async _exploreDir(path27, depth) {
193
193
  let files;
194
194
  try {
195
- files = await (0, import_promises.readdir)(path26, this._rdOptions);
195
+ files = await (0, import_promises.readdir)(path27, this._rdOptions);
196
196
  } catch (error2) {
197
197
  this._onError(error2);
198
198
  }
199
- return { files, depth, path: path26 };
199
+ return { files, depth, path: path27 };
200
200
  }
201
- async _formatEntry(dirent, path26) {
201
+ async _formatEntry(dirent, path27) {
202
202
  let entry;
203
203
  const basename3 = this._isDirent ? dirent.name : dirent;
204
204
  try {
205
- const fullPath = (0, import_node_path.resolve)((0, import_node_path.join)(path26, basename3));
205
+ const fullPath = (0, import_node_path.resolve)((0, import_node_path.join)(path27, basename3));
206
206
  entry = { path: (0, import_node_path.relative)(this._root, fullPath), fullPath, basename: basename3 };
207
207
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
208
208
  } catch (err) {
@@ -259,16 +259,16 @@ var init_esm = __esm({
259
259
  });
260
260
 
261
261
  // ../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/handler.js
262
- function createFsWatchInstance(path26, options, listener, errHandler, emitRaw) {
262
+ function createFsWatchInstance(path27, options, listener, errHandler, emitRaw) {
263
263
  const handleEvent = (rawEvent, evPath) => {
264
- listener(path26);
265
- emitRaw(rawEvent, evPath, { watchedPath: path26 });
266
- if (evPath && path26 !== evPath) {
267
- fsWatchBroadcast(sysPath.resolve(path26, evPath), KEY_LISTENERS, sysPath.join(path26, evPath));
264
+ listener(path27);
265
+ emitRaw(rawEvent, evPath, { watchedPath: path27 });
266
+ if (evPath && path27 !== evPath) {
267
+ fsWatchBroadcast(sysPath.resolve(path27, evPath), KEY_LISTENERS, sysPath.join(path27, evPath));
268
268
  }
269
269
  };
270
270
  try {
271
- return (0, import_fs.watch)(path26, {
271
+ return (0, import_fs.watch)(path27, {
272
272
  persistent: options.persistent
273
273
  }, handleEvent);
274
274
  } catch (error2) {
@@ -617,12 +617,12 @@ var init_handler = __esm({
617
617
  listener(val1, val2, val3);
618
618
  });
619
619
  };
620
- setFsWatchListener = (path26, fullPath, options, handlers) => {
620
+ setFsWatchListener = (path27, fullPath, options, handlers) => {
621
621
  const { listener, errHandler, rawEmitter } = handlers;
622
622
  let cont = FsWatchInstances.get(fullPath);
623
623
  let watcher;
624
624
  if (!options.persistent) {
625
- watcher = createFsWatchInstance(path26, options, listener, errHandler, rawEmitter);
625
+ watcher = createFsWatchInstance(path27, options, listener, errHandler, rawEmitter);
626
626
  if (!watcher)
627
627
  return;
628
628
  return watcher.close.bind(watcher);
@@ -633,7 +633,7 @@ var init_handler = __esm({
633
633
  addAndConvert(cont, KEY_RAW, rawEmitter);
634
634
  } else {
635
635
  watcher = createFsWatchInstance(
636
- path26,
636
+ path27,
637
637
  options,
638
638
  fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
639
639
  errHandler,
@@ -648,7 +648,7 @@ var init_handler = __esm({
648
648
  cont.watcherUnusable = true;
649
649
  if (isWindows && error2.code === "EPERM") {
650
650
  try {
651
- const fd = await (0, import_promises2.open)(path26, "r");
651
+ const fd = await (0, import_promises2.open)(path27, "r");
652
652
  await fd.close();
653
653
  broadcastErr(error2);
654
654
  } catch (err) {
@@ -679,7 +679,7 @@ var init_handler = __esm({
679
679
  };
680
680
  };
681
681
  FsWatchFileInstances = /* @__PURE__ */ new Map();
682
- setFsWatchFileListener = (path26, fullPath, options, handlers) => {
682
+ setFsWatchFileListener = (path27, fullPath, options, handlers) => {
683
683
  const { listener, rawEmitter } = handlers;
684
684
  let cont = FsWatchFileInstances.get(fullPath);
685
685
  const copts = cont && cont.options;
@@ -701,7 +701,7 @@ var init_handler = __esm({
701
701
  });
702
702
  const currmtime = curr.mtimeMs;
703
703
  if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
704
- foreach(cont.listeners, (listener2) => listener2(path26, curr));
704
+ foreach(cont.listeners, (listener2) => listener2(path27, curr));
705
705
  }
706
706
  })
707
707
  };
@@ -729,13 +729,13 @@ var init_handler = __esm({
729
729
  * @param listener on fs change
730
730
  * @returns closer for the watcher instance
731
731
  */
732
- _watchWithNodeFs(path26, listener) {
732
+ _watchWithNodeFs(path27, listener) {
733
733
  const opts = this.fsw.options;
734
- const directory = sysPath.dirname(path26);
735
- const basename3 = sysPath.basename(path26);
734
+ const directory = sysPath.dirname(path27);
735
+ const basename3 = sysPath.basename(path27);
736
736
  const parent = this.fsw._getWatchedDir(directory);
737
737
  parent.add(basename3);
738
- const absolutePath = sysPath.resolve(path26);
738
+ const absolutePath = sysPath.resolve(path27);
739
739
  const options = {
740
740
  persistent: opts.persistent
741
741
  };
@@ -745,12 +745,12 @@ var init_handler = __esm({
745
745
  if (opts.usePolling) {
746
746
  const enableBin = opts.interval !== opts.binaryInterval;
747
747
  options.interval = enableBin && isBinaryPath(basename3) ? opts.binaryInterval : opts.interval;
748
- closer = setFsWatchFileListener(path26, absolutePath, options, {
748
+ closer = setFsWatchFileListener(path27, absolutePath, options, {
749
749
  listener,
750
750
  rawEmitter: this.fsw._emitRaw
751
751
  });
752
752
  } else {
753
- closer = setFsWatchListener(path26, absolutePath, options, {
753
+ closer = setFsWatchListener(path27, absolutePath, options, {
754
754
  listener,
755
755
  errHandler: this._boundHandleError,
756
756
  rawEmitter: this.fsw._emitRaw
@@ -772,7 +772,7 @@ var init_handler = __esm({
772
772
  let prevStats = stats;
773
773
  if (parent.has(basename3))
774
774
  return;
775
- const listener = async (path26, newStats) => {
775
+ const listener = async (path27, newStats) => {
776
776
  if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
777
777
  return;
778
778
  if (!newStats || newStats.mtimeMs === 0) {
@@ -786,11 +786,11 @@ var init_handler = __esm({
786
786
  this.fsw._emit(EV.CHANGE, file, newStats2);
787
787
  }
788
788
  if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
789
- this.fsw._closeFile(path26);
789
+ this.fsw._closeFile(path27);
790
790
  prevStats = newStats2;
791
791
  const closer2 = this._watchWithNodeFs(file, listener);
792
792
  if (closer2)
793
- this.fsw._addPathCloser(path26, closer2);
793
+ this.fsw._addPathCloser(path27, closer2);
794
794
  } else {
795
795
  prevStats = newStats2;
796
796
  }
@@ -822,7 +822,7 @@ var init_handler = __esm({
822
822
  * @param item basename of this item
823
823
  * @returns true if no more processing is needed for this entry.
824
824
  */
825
- async _handleSymlink(entry, directory, path26, item) {
825
+ async _handleSymlink(entry, directory, path27, item) {
826
826
  if (this.fsw.closed) {
827
827
  return;
828
828
  }
@@ -832,7 +832,7 @@ var init_handler = __esm({
832
832
  this.fsw._incrReadyCount();
833
833
  let linkPath;
834
834
  try {
835
- linkPath = await (0, import_promises2.realpath)(path26);
835
+ linkPath = await (0, import_promises2.realpath)(path27);
836
836
  } catch (e) {
837
837
  this.fsw._emitReady();
838
838
  return true;
@@ -842,12 +842,12 @@ var init_handler = __esm({
842
842
  if (dir.has(item)) {
843
843
  if (this.fsw._symlinkPaths.get(full) !== linkPath) {
844
844
  this.fsw._symlinkPaths.set(full, linkPath);
845
- this.fsw._emit(EV.CHANGE, path26, entry.stats);
845
+ this.fsw._emit(EV.CHANGE, path27, entry.stats);
846
846
  }
847
847
  } else {
848
848
  dir.add(item);
849
849
  this.fsw._symlinkPaths.set(full, linkPath);
850
- this.fsw._emit(EV.ADD, path26, entry.stats);
850
+ this.fsw._emit(EV.ADD, path27, entry.stats);
851
851
  }
852
852
  this.fsw._emitReady();
853
853
  return true;
@@ -876,9 +876,9 @@ var init_handler = __esm({
876
876
  return;
877
877
  }
878
878
  const item = entry.path;
879
- let path26 = sysPath.join(directory, item);
879
+ let path27 = sysPath.join(directory, item);
880
880
  current.add(item);
881
- if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path26, item)) {
881
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path27, item)) {
882
882
  return;
883
883
  }
884
884
  if (this.fsw.closed) {
@@ -887,8 +887,8 @@ var init_handler = __esm({
887
887
  }
888
888
  if (item === target || !target && !previous.has(item)) {
889
889
  this.fsw._incrReadyCount();
890
- path26 = sysPath.join(dir, sysPath.relative(dir, path26));
891
- this._addToNodeFs(path26, initialAdd, wh, depth + 1);
890
+ path27 = sysPath.join(dir, sysPath.relative(dir, path27));
891
+ this._addToNodeFs(path27, initialAdd, wh, depth + 1);
892
892
  }
893
893
  }).on(EV.ERROR, this._boundHandleError);
894
894
  return new Promise((resolve4, reject) => {
@@ -957,13 +957,13 @@ var init_handler = __esm({
957
957
  * @param depth Child path actually targeted for watch
958
958
  * @param target Child path actually targeted for watch
959
959
  */
960
- async _addToNodeFs(path26, initialAdd, priorWh, depth, target) {
960
+ async _addToNodeFs(path27, initialAdd, priorWh, depth, target) {
961
961
  const ready = this.fsw._emitReady;
962
- if (this.fsw._isIgnored(path26) || this.fsw.closed) {
962
+ if (this.fsw._isIgnored(path27) || this.fsw.closed) {
963
963
  ready();
964
964
  return false;
965
965
  }
966
- const wh = this.fsw._getWatchHelpers(path26);
966
+ const wh = this.fsw._getWatchHelpers(path27);
967
967
  if (priorWh) {
968
968
  wh.filterPath = (entry) => priorWh.filterPath(entry);
969
969
  wh.filterDir = (entry) => priorWh.filterDir(entry);
@@ -979,8 +979,8 @@ var init_handler = __esm({
979
979
  const follow = this.fsw.options.followSymlinks;
980
980
  let closer;
981
981
  if (stats.isDirectory()) {
982
- const absPath = sysPath.resolve(path26);
983
- const targetPath = follow ? await (0, import_promises2.realpath)(path26) : path26;
982
+ const absPath = sysPath.resolve(path27);
983
+ const targetPath = follow ? await (0, import_promises2.realpath)(path27) : path27;
984
984
  if (this.fsw.closed)
985
985
  return;
986
986
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -990,29 +990,29 @@ var init_handler = __esm({
990
990
  this.fsw._symlinkPaths.set(absPath, targetPath);
991
991
  }
992
992
  } else if (stats.isSymbolicLink()) {
993
- const targetPath = follow ? await (0, import_promises2.realpath)(path26) : path26;
993
+ const targetPath = follow ? await (0, import_promises2.realpath)(path27) : path27;
994
994
  if (this.fsw.closed)
995
995
  return;
996
996
  const parent = sysPath.dirname(wh.watchPath);
997
997
  this.fsw._getWatchedDir(parent).add(wh.watchPath);
998
998
  this.fsw._emit(EV.ADD, wh.watchPath, stats);
999
- closer = await this._handleDir(parent, stats, initialAdd, depth, path26, wh, targetPath);
999
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path27, wh, targetPath);
1000
1000
  if (this.fsw.closed)
1001
1001
  return;
1002
1002
  if (targetPath !== void 0) {
1003
- this.fsw._symlinkPaths.set(sysPath.resolve(path26), targetPath);
1003
+ this.fsw._symlinkPaths.set(sysPath.resolve(path27), targetPath);
1004
1004
  }
1005
1005
  } else {
1006
1006
  closer = this._handleFile(wh.watchPath, stats, initialAdd);
1007
1007
  }
1008
1008
  ready();
1009
1009
  if (closer)
1010
- this.fsw._addPathCloser(path26, closer);
1010
+ this.fsw._addPathCloser(path27, closer);
1011
1011
  return false;
1012
1012
  } catch (error2) {
1013
1013
  if (this.fsw._handleError(error2)) {
1014
1014
  ready();
1015
- return path26;
1015
+ return path27;
1016
1016
  }
1017
1017
  }
1018
1018
  }
@@ -1047,26 +1047,26 @@ function createPattern(matcher) {
1047
1047
  }
1048
1048
  return () => false;
1049
1049
  }
1050
- function normalizePath(path26) {
1051
- if (typeof path26 !== "string")
1050
+ function normalizePath(path27) {
1051
+ if (typeof path27 !== "string")
1052
1052
  throw new Error("string expected");
1053
- path26 = sysPath2.normalize(path26);
1054
- path26 = path26.replace(/\\/g, "/");
1053
+ path27 = sysPath2.normalize(path27);
1054
+ path27 = path27.replace(/\\/g, "/");
1055
1055
  let prepend = false;
1056
- if (path26.startsWith("//"))
1056
+ if (path27.startsWith("//"))
1057
1057
  prepend = true;
1058
1058
  const DOUBLE_SLASH_RE2 = /\/\//;
1059
- while (path26.match(DOUBLE_SLASH_RE2))
1060
- path26 = path26.replace(DOUBLE_SLASH_RE2, "/");
1059
+ while (path27.match(DOUBLE_SLASH_RE2))
1060
+ path27 = path27.replace(DOUBLE_SLASH_RE2, "/");
1061
1061
  if (prepend)
1062
- path26 = "/" + path26;
1063
- return path26;
1062
+ path27 = "/" + path27;
1063
+ return path27;
1064
1064
  }
1065
1065
  function matchPatterns(patterns, testString, stats) {
1066
- const path26 = normalizePath(testString);
1066
+ const path27 = normalizePath(testString);
1067
1067
  for (let index2 = 0; index2 < patterns.length; index2++) {
1068
1068
  const pattern = patterns[index2];
1069
- if (pattern(path26, stats)) {
1069
+ if (pattern(path27, stats)) {
1070
1070
  return true;
1071
1071
  }
1072
1072
  }
@@ -1131,19 +1131,19 @@ var init_esm2 = __esm({
1131
1131
  }
1132
1132
  return str2;
1133
1133
  };
1134
- normalizePathToUnix = (path26) => toUnix(sysPath2.normalize(toUnix(path26)));
1135
- normalizeIgnored = (cwd = "") => (path26) => {
1136
- if (typeof path26 === "string") {
1137
- return normalizePathToUnix(sysPath2.isAbsolute(path26) ? path26 : sysPath2.join(cwd, path26));
1134
+ normalizePathToUnix = (path27) => toUnix(sysPath2.normalize(toUnix(path27)));
1135
+ normalizeIgnored = (cwd = "") => (path27) => {
1136
+ if (typeof path27 === "string") {
1137
+ return normalizePathToUnix(sysPath2.isAbsolute(path27) ? path27 : sysPath2.join(cwd, path27));
1138
1138
  } else {
1139
- return path26;
1139
+ return path27;
1140
1140
  }
1141
1141
  };
1142
- getAbsolutePath = (path26, cwd) => {
1143
- if (sysPath2.isAbsolute(path26)) {
1144
- return path26;
1142
+ getAbsolutePath = (path27, cwd) => {
1143
+ if (sysPath2.isAbsolute(path27)) {
1144
+ return path27;
1145
1145
  }
1146
- return sysPath2.join(cwd, path26);
1146
+ return sysPath2.join(cwd, path27);
1147
1147
  };
1148
1148
  EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
1149
1149
  DirEntry = class {
@@ -1198,10 +1198,10 @@ var init_esm2 = __esm({
1198
1198
  STAT_METHOD_F = "stat";
1199
1199
  STAT_METHOD_L = "lstat";
1200
1200
  WatchHelper = class {
1201
- constructor(path26, follow, fsw) {
1201
+ constructor(path27, follow, fsw) {
1202
1202
  this.fsw = fsw;
1203
- const watchPath = path26;
1204
- this.path = path26 = path26.replace(REPLACER_RE, "");
1203
+ const watchPath = path27;
1204
+ this.path = path27 = path27.replace(REPLACER_RE, "");
1205
1205
  this.watchPath = watchPath;
1206
1206
  this.fullWatchPath = sysPath2.resolve(watchPath);
1207
1207
  this.dirParts = [];
@@ -1323,20 +1323,20 @@ var init_esm2 = __esm({
1323
1323
  this._closePromise = void 0;
1324
1324
  let paths = unifyPaths(paths_);
1325
1325
  if (cwd) {
1326
- paths = paths.map((path26) => {
1327
- const absPath = getAbsolutePath(path26, cwd);
1326
+ paths = paths.map((path27) => {
1327
+ const absPath = getAbsolutePath(path27, cwd);
1328
1328
  return absPath;
1329
1329
  });
1330
1330
  }
1331
- paths.forEach((path26) => {
1332
- this._removeIgnoredPath(path26);
1331
+ paths.forEach((path27) => {
1332
+ this._removeIgnoredPath(path27);
1333
1333
  });
1334
1334
  this._userIgnored = void 0;
1335
1335
  if (!this._readyCount)
1336
1336
  this._readyCount = 0;
1337
1337
  this._readyCount += paths.length;
1338
- Promise.all(paths.map(async (path26) => {
1339
- const res = await this._nodeFsHandler._addToNodeFs(path26, !_internal, void 0, 0, _origAdd);
1338
+ Promise.all(paths.map(async (path27) => {
1339
+ const res = await this._nodeFsHandler._addToNodeFs(path27, !_internal, void 0, 0, _origAdd);
1340
1340
  if (res)
1341
1341
  this._emitReady();
1342
1342
  return res;
@@ -1358,17 +1358,17 @@ var init_esm2 = __esm({
1358
1358
  return this;
1359
1359
  const paths = unifyPaths(paths_);
1360
1360
  const { cwd } = this.options;
1361
- paths.forEach((path26) => {
1362
- if (!sysPath2.isAbsolute(path26) && !this._closers.has(path26)) {
1361
+ paths.forEach((path27) => {
1362
+ if (!sysPath2.isAbsolute(path27) && !this._closers.has(path27)) {
1363
1363
  if (cwd)
1364
- path26 = sysPath2.join(cwd, path26);
1365
- path26 = sysPath2.resolve(path26);
1364
+ path27 = sysPath2.join(cwd, path27);
1365
+ path27 = sysPath2.resolve(path27);
1366
1366
  }
1367
- this._closePath(path26);
1368
- this._addIgnoredPath(path26);
1369
- if (this._watched.has(path26)) {
1367
+ this._closePath(path27);
1368
+ this._addIgnoredPath(path27);
1369
+ if (this._watched.has(path27)) {
1370
1370
  this._addIgnoredPath({
1371
- path: path26,
1371
+ path: path27,
1372
1372
  recursive: true
1373
1373
  });
1374
1374
  }
@@ -1432,38 +1432,38 @@ var init_esm2 = __esm({
1432
1432
  * @param stats arguments to be passed with event
1433
1433
  * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
1434
1434
  */
1435
- async _emit(event, path26, stats) {
1435
+ async _emit(event, path27, stats) {
1436
1436
  if (this.closed)
1437
1437
  return;
1438
1438
  const opts = this.options;
1439
1439
  if (isWindows)
1440
- path26 = sysPath2.normalize(path26);
1440
+ path27 = sysPath2.normalize(path27);
1441
1441
  if (opts.cwd)
1442
- path26 = sysPath2.relative(opts.cwd, path26);
1443
- const args = [path26];
1442
+ path27 = sysPath2.relative(opts.cwd, path27);
1443
+ const args = [path27];
1444
1444
  if (stats != null)
1445
1445
  args.push(stats);
1446
1446
  const awf = opts.awaitWriteFinish;
1447
1447
  let pw;
1448
- if (awf && (pw = this._pendingWrites.get(path26))) {
1448
+ if (awf && (pw = this._pendingWrites.get(path27))) {
1449
1449
  pw.lastChange = /* @__PURE__ */ new Date();
1450
1450
  return this;
1451
1451
  }
1452
1452
  if (opts.atomic) {
1453
1453
  if (event === EVENTS.UNLINK) {
1454
- this._pendingUnlinks.set(path26, [event, ...args]);
1454
+ this._pendingUnlinks.set(path27, [event, ...args]);
1455
1455
  setTimeout(() => {
1456
- this._pendingUnlinks.forEach((entry, path27) => {
1456
+ this._pendingUnlinks.forEach((entry, path28) => {
1457
1457
  this.emit(...entry);
1458
1458
  this.emit(EVENTS.ALL, ...entry);
1459
- this._pendingUnlinks.delete(path27);
1459
+ this._pendingUnlinks.delete(path28);
1460
1460
  });
1461
1461
  }, typeof opts.atomic === "number" ? opts.atomic : 100);
1462
1462
  return this;
1463
1463
  }
1464
- if (event === EVENTS.ADD && this._pendingUnlinks.has(path26)) {
1464
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path27)) {
1465
1465
  event = EVENTS.CHANGE;
1466
- this._pendingUnlinks.delete(path26);
1466
+ this._pendingUnlinks.delete(path27);
1467
1467
  }
1468
1468
  }
1469
1469
  if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
@@ -1481,16 +1481,16 @@ var init_esm2 = __esm({
1481
1481
  this.emitWithAll(event, args);
1482
1482
  }
1483
1483
  };
1484
- this._awaitWriteFinish(path26, awf.stabilityThreshold, event, awfEmit);
1484
+ this._awaitWriteFinish(path27, awf.stabilityThreshold, event, awfEmit);
1485
1485
  return this;
1486
1486
  }
1487
1487
  if (event === EVENTS.CHANGE) {
1488
- const isThrottled = !this._throttle(EVENTS.CHANGE, path26, 50);
1488
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path27, 50);
1489
1489
  if (isThrottled)
1490
1490
  return this;
1491
1491
  }
1492
1492
  if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
1493
- const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path26) : path26;
1493
+ const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path27) : path27;
1494
1494
  let stats2;
1495
1495
  try {
1496
1496
  stats2 = await (0, import_promises3.stat)(fullPath);
@@ -1521,23 +1521,23 @@ var init_esm2 = __esm({
1521
1521
  * @param timeout duration of time to suppress duplicate actions
1522
1522
  * @returns tracking object or false if action should be suppressed
1523
1523
  */
1524
- _throttle(actionType, path26, timeout) {
1524
+ _throttle(actionType, path27, timeout) {
1525
1525
  if (!this._throttled.has(actionType)) {
1526
1526
  this._throttled.set(actionType, /* @__PURE__ */ new Map());
1527
1527
  }
1528
1528
  const action = this._throttled.get(actionType);
1529
1529
  if (!action)
1530
1530
  throw new Error("invalid throttle");
1531
- const actionPath = action.get(path26);
1531
+ const actionPath = action.get(path27);
1532
1532
  if (actionPath) {
1533
1533
  actionPath.count++;
1534
1534
  return false;
1535
1535
  }
1536
1536
  let timeoutObject;
1537
1537
  const clear = () => {
1538
- const item = action.get(path26);
1538
+ const item = action.get(path27);
1539
1539
  const count = item ? item.count : 0;
1540
- action.delete(path26);
1540
+ action.delete(path27);
1541
1541
  clearTimeout(timeoutObject);
1542
1542
  if (item)
1543
1543
  clearTimeout(item.timeoutObject);
@@ -1545,7 +1545,7 @@ var init_esm2 = __esm({
1545
1545
  };
1546
1546
  timeoutObject = setTimeout(clear, timeout);
1547
1547
  const thr = { timeoutObject, clear, count: 0 };
1548
- action.set(path26, thr);
1548
+ action.set(path27, thr);
1549
1549
  return thr;
1550
1550
  }
1551
1551
  _incrReadyCount() {
@@ -1559,44 +1559,44 @@ var init_esm2 = __esm({
1559
1559
  * @param event
1560
1560
  * @param awfEmit Callback to be called when ready for event to be emitted.
1561
1561
  */
1562
- _awaitWriteFinish(path26, threshold, event, awfEmit) {
1562
+ _awaitWriteFinish(path27, threshold, event, awfEmit) {
1563
1563
  const awf = this.options.awaitWriteFinish;
1564
1564
  if (typeof awf !== "object")
1565
1565
  return;
1566
1566
  const pollInterval = awf.pollInterval;
1567
1567
  let timeoutHandler;
1568
- let fullPath = path26;
1569
- if (this.options.cwd && !sysPath2.isAbsolute(path26)) {
1570
- fullPath = sysPath2.join(this.options.cwd, path26);
1568
+ let fullPath = path27;
1569
+ if (this.options.cwd && !sysPath2.isAbsolute(path27)) {
1570
+ fullPath = sysPath2.join(this.options.cwd, path27);
1571
1571
  }
1572
1572
  const now = /* @__PURE__ */ new Date();
1573
1573
  const writes = this._pendingWrites;
1574
1574
  function awaitWriteFinishFn(prevStat) {
1575
1575
  (0, import_fs2.stat)(fullPath, (err, curStat) => {
1576
- if (err || !writes.has(path26)) {
1576
+ if (err || !writes.has(path27)) {
1577
1577
  if (err && err.code !== "ENOENT")
1578
1578
  awfEmit(err);
1579
1579
  return;
1580
1580
  }
1581
1581
  const now2 = Number(/* @__PURE__ */ new Date());
1582
1582
  if (prevStat && curStat.size !== prevStat.size) {
1583
- writes.get(path26).lastChange = now2;
1583
+ writes.get(path27).lastChange = now2;
1584
1584
  }
1585
- const pw = writes.get(path26);
1585
+ const pw = writes.get(path27);
1586
1586
  const df = now2 - pw.lastChange;
1587
1587
  if (df >= threshold) {
1588
- writes.delete(path26);
1588
+ writes.delete(path27);
1589
1589
  awfEmit(void 0, curStat);
1590
1590
  } else {
1591
1591
  timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
1592
1592
  }
1593
1593
  });
1594
1594
  }
1595
- if (!writes.has(path26)) {
1596
- writes.set(path26, {
1595
+ if (!writes.has(path27)) {
1596
+ writes.set(path27, {
1597
1597
  lastChange: now,
1598
1598
  cancelWait: () => {
1599
- writes.delete(path26);
1599
+ writes.delete(path27);
1600
1600
  clearTimeout(timeoutHandler);
1601
1601
  return event;
1602
1602
  }
@@ -1607,8 +1607,8 @@ var init_esm2 = __esm({
1607
1607
  /**
1608
1608
  * Determines whether user has asked to ignore this path.
1609
1609
  */
1610
- _isIgnored(path26, stats) {
1611
- if (this.options.atomic && DOT_RE.test(path26))
1610
+ _isIgnored(path27, stats) {
1611
+ if (this.options.atomic && DOT_RE.test(path27))
1612
1612
  return true;
1613
1613
  if (!this._userIgnored) {
1614
1614
  const { cwd } = this.options;
@@ -1618,17 +1618,17 @@ var init_esm2 = __esm({
1618
1618
  const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
1619
1619
  this._userIgnored = anymatch(list, void 0);
1620
1620
  }
1621
- return this._userIgnored(path26, stats);
1621
+ return this._userIgnored(path27, stats);
1622
1622
  }
1623
- _isntIgnored(path26, stat4) {
1624
- return !this._isIgnored(path26, stat4);
1623
+ _isntIgnored(path27, stat4) {
1624
+ return !this._isIgnored(path27, stat4);
1625
1625
  }
1626
1626
  /**
1627
1627
  * Provides a set of common helpers and properties relating to symlink handling.
1628
1628
  * @param path file or directory pattern being watched
1629
1629
  */
1630
- _getWatchHelpers(path26) {
1631
- return new WatchHelper(path26, this.options.followSymlinks, this);
1630
+ _getWatchHelpers(path27) {
1631
+ return new WatchHelper(path27, this.options.followSymlinks, this);
1632
1632
  }
1633
1633
  // Directory helpers
1634
1634
  // -----------------
@@ -1660,63 +1660,63 @@ var init_esm2 = __esm({
1660
1660
  * @param item base path of item/directory
1661
1661
  */
1662
1662
  _remove(directory, item, isDirectory) {
1663
- const path26 = sysPath2.join(directory, item);
1664
- const fullPath = sysPath2.resolve(path26);
1665
- isDirectory = isDirectory != null ? isDirectory : this._watched.has(path26) || this._watched.has(fullPath);
1666
- if (!this._throttle("remove", path26, 100))
1663
+ const path27 = sysPath2.join(directory, item);
1664
+ const fullPath = sysPath2.resolve(path27);
1665
+ isDirectory = isDirectory != null ? isDirectory : this._watched.has(path27) || this._watched.has(fullPath);
1666
+ if (!this._throttle("remove", path27, 100))
1667
1667
  return;
1668
1668
  if (!isDirectory && this._watched.size === 1) {
1669
1669
  this.add(directory, item, true);
1670
1670
  }
1671
- const wp = this._getWatchedDir(path26);
1671
+ const wp = this._getWatchedDir(path27);
1672
1672
  const nestedDirectoryChildren = wp.getChildren();
1673
- nestedDirectoryChildren.forEach((nested) => this._remove(path26, nested));
1673
+ nestedDirectoryChildren.forEach((nested) => this._remove(path27, nested));
1674
1674
  const parent = this._getWatchedDir(directory);
1675
1675
  const wasTracked = parent.has(item);
1676
1676
  parent.remove(item);
1677
1677
  if (this._symlinkPaths.has(fullPath)) {
1678
1678
  this._symlinkPaths.delete(fullPath);
1679
1679
  }
1680
- let relPath = path26;
1680
+ let relPath = path27;
1681
1681
  if (this.options.cwd)
1682
- relPath = sysPath2.relative(this.options.cwd, path26);
1682
+ relPath = sysPath2.relative(this.options.cwd, path27);
1683
1683
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
1684
1684
  const event = this._pendingWrites.get(relPath).cancelWait();
1685
1685
  if (event === EVENTS.ADD)
1686
1686
  return;
1687
1687
  }
1688
- this._watched.delete(path26);
1688
+ this._watched.delete(path27);
1689
1689
  this._watched.delete(fullPath);
1690
1690
  const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
1691
- if (wasTracked && !this._isIgnored(path26))
1692
- this._emit(eventName, path26);
1693
- this._closePath(path26);
1691
+ if (wasTracked && !this._isIgnored(path27))
1692
+ this._emit(eventName, path27);
1693
+ this._closePath(path27);
1694
1694
  }
1695
1695
  /**
1696
1696
  * Closes all watchers for a path
1697
1697
  */
1698
- _closePath(path26) {
1699
- this._closeFile(path26);
1700
- const dir = sysPath2.dirname(path26);
1701
- this._getWatchedDir(dir).remove(sysPath2.basename(path26));
1698
+ _closePath(path27) {
1699
+ this._closeFile(path27);
1700
+ const dir = sysPath2.dirname(path27);
1701
+ this._getWatchedDir(dir).remove(sysPath2.basename(path27));
1702
1702
  }
1703
1703
  /**
1704
1704
  * Closes only file-specific watchers
1705
1705
  */
1706
- _closeFile(path26) {
1707
- const closers = this._closers.get(path26);
1706
+ _closeFile(path27) {
1707
+ const closers = this._closers.get(path27);
1708
1708
  if (!closers)
1709
1709
  return;
1710
1710
  closers.forEach((closer) => closer());
1711
- this._closers.delete(path26);
1711
+ this._closers.delete(path27);
1712
1712
  }
1713
- _addPathCloser(path26, closer) {
1713
+ _addPathCloser(path27, closer) {
1714
1714
  if (!closer)
1715
1715
  return;
1716
- let list = this._closers.get(path26);
1716
+ let list = this._closers.get(path27);
1717
1717
  if (!list) {
1718
1718
  list = [];
1719
- this._closers.set(path26, list);
1719
+ this._closers.set(path27, list);
1720
1720
  }
1721
1721
  list.push(closer);
1722
1722
  }
@@ -2911,8 +2911,8 @@ var require_command = __commonJS({
2911
2911
  "use strict";
2912
2912
  var EventEmitter2 = require("events").EventEmitter;
2913
2913
  var childProcess = require("child_process");
2914
- var path26 = require("path");
2915
- var fs23 = require("fs");
2914
+ var path27 = require("path");
2915
+ var fs24 = require("fs");
2916
2916
  var process3 = require("process");
2917
2917
  var { Argument: Argument2, humanReadableArgName } = require_argument();
2918
2918
  var { CommanderError: CommanderError2 } = require_error();
@@ -3906,7 +3906,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3906
3906
  * @param {string} subcommandName
3907
3907
  */
3908
3908
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
3909
- if (fs23.existsSync(executableFile)) return;
3909
+ if (fs24.existsSync(executableFile)) return;
3910
3910
  const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
3911
3911
  const executableMissing = `'${executableFile}' does not exist
3912
3912
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -3924,11 +3924,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
3924
3924
  let launchWithNode = false;
3925
3925
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
3926
3926
  function findFile(baseDir, baseName) {
3927
- const localBin = path26.resolve(baseDir, baseName);
3928
- if (fs23.existsSync(localBin)) return localBin;
3929
- if (sourceExt.includes(path26.extname(baseName))) return void 0;
3927
+ const localBin = path27.resolve(baseDir, baseName);
3928
+ if (fs24.existsSync(localBin)) return localBin;
3929
+ if (sourceExt.includes(path27.extname(baseName))) return void 0;
3930
3930
  const foundExt = sourceExt.find(
3931
- (ext) => fs23.existsSync(`${localBin}${ext}`)
3931
+ (ext) => fs24.existsSync(`${localBin}${ext}`)
3932
3932
  );
3933
3933
  if (foundExt) return `${localBin}${foundExt}`;
3934
3934
  return void 0;
@@ -3940,21 +3940,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
3940
3940
  if (this._scriptPath) {
3941
3941
  let resolvedScriptPath;
3942
3942
  try {
3943
- resolvedScriptPath = fs23.realpathSync(this._scriptPath);
3943
+ resolvedScriptPath = fs24.realpathSync(this._scriptPath);
3944
3944
  } catch {
3945
3945
  resolvedScriptPath = this._scriptPath;
3946
3946
  }
3947
- executableDir = path26.resolve(
3948
- path26.dirname(resolvedScriptPath),
3947
+ executableDir = path27.resolve(
3948
+ path27.dirname(resolvedScriptPath),
3949
3949
  executableDir
3950
3950
  );
3951
3951
  }
3952
3952
  if (executableDir) {
3953
3953
  let localFile = findFile(executableDir, executableFile);
3954
3954
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
3955
- const legacyName = path26.basename(
3955
+ const legacyName = path27.basename(
3956
3956
  this._scriptPath,
3957
- path26.extname(this._scriptPath)
3957
+ path27.extname(this._scriptPath)
3958
3958
  );
3959
3959
  if (legacyName !== this._name) {
3960
3960
  localFile = findFile(
@@ -3965,7 +3965,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3965
3965
  }
3966
3966
  executableFile = localFile || executableFile;
3967
3967
  }
3968
- launchWithNode = sourceExt.includes(path26.extname(executableFile));
3968
+ launchWithNode = sourceExt.includes(path27.extname(executableFile));
3969
3969
  let proc;
3970
3970
  if (process3.platform !== "win32") {
3971
3971
  if (launchWithNode) {
@@ -4880,7 +4880,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
4880
4880
  * @return {Command}
4881
4881
  */
4882
4882
  nameFromFilename(filename) {
4883
- this._name = path26.basename(filename, path26.extname(filename));
4883
+ this._name = path27.basename(filename, path27.extname(filename));
4884
4884
  return this;
4885
4885
  }
4886
4886
  /**
@@ -4894,9 +4894,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
4894
4894
  * @param {string} [path]
4895
4895
  * @return {(string|null|Command)}
4896
4896
  */
4897
- executableDir(path27) {
4898
- if (path27 === void 0) return this._executableDir;
4899
- this._executableDir = path27;
4897
+ executableDir(path28) {
4898
+ if (path28 === void 0) return this._executableDir;
4899
+ this._executableDir = path28;
4900
4900
  return this;
4901
4901
  }
4902
4902
  /**
@@ -6467,7 +6467,7 @@ var init_sql = __esm({
6467
6467
  function mapResultRow(columns, row, joinsNotNullableMap) {
6468
6468
  const nullifyMap = {};
6469
6469
  const result = columns.reduce(
6470
- (result2, { path: path26, field }, columnIndex) => {
6470
+ (result2, { path: path27, field }, columnIndex) => {
6471
6471
  let decoder;
6472
6472
  if (is(field, Column)) {
6473
6473
  decoder = field;
@@ -6479,8 +6479,8 @@ function mapResultRow(columns, row, joinsNotNullableMap) {
6479
6479
  decoder = field.sql.decoder;
6480
6480
  }
6481
6481
  let node = result2;
6482
- for (const [pathChunkIndex, pathChunk] of path26.entries()) {
6483
- if (pathChunkIndex < path26.length - 1) {
6482
+ for (const [pathChunkIndex, pathChunk] of path27.entries()) {
6483
+ if (pathChunkIndex < path27.length - 1) {
6484
6484
  if (!(pathChunk in node)) {
6485
6485
  node[pathChunk] = {};
6486
6486
  }
@@ -6488,8 +6488,8 @@ function mapResultRow(columns, row, joinsNotNullableMap) {
6488
6488
  } else {
6489
6489
  const rawValue = row[columnIndex];
6490
6490
  const value = node[pathChunk] = rawValue === null ? null : decoder.mapFromDriverValue(rawValue);
6491
- if (joinsNotNullableMap && is(field, Column) && path26.length === 2) {
6492
- const objectName = path26[0];
6491
+ if (joinsNotNullableMap && is(field, Column) && path27.length === 2) {
6492
+ const objectName = path27[0];
6493
6493
  if (!(objectName in nullifyMap)) {
6494
6494
  nullifyMap[objectName] = value === null ? getTableName(field.table) : false;
6495
6495
  } else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== getTableName(field.table)) {
@@ -13228,10 +13228,134 @@ function createDocumentOps(native, stmts, streamNow) {
13228
13228
  const row = stmts.docById.get(id);
13229
13229
  return row ? mapDocumentRow(row) : null;
13230
13230
  },
13231
- async getDocumentByPath(path26) {
13232
- const row = stmts.docByPath.get(path26);
13231
+ async getDocumentByPath(path27) {
13232
+ const row = stmts.docByPath.get(path27);
13233
13233
  return row ? mapDocumentRow(row) : null;
13234
13234
  },
13235
+ async getFileOutline(filePath) {
13236
+ const normalizedSlashes = filePath.replace(/\\/g, "/");
13237
+ const normalized = normalizedSlashes.replace(/^\.?\//, "");
13238
+ let docRow = stmts.docByPathOrAbs.get(normalized, filePath);
13239
+ if (!docRow && import_node_path6.default.isAbsolute(filePath)) {
13240
+ try {
13241
+ const resolved = await import_node_fs5.default.promises.realpath(filePath);
13242
+ if (resolved !== filePath) {
13243
+ docRow = stmts.docByPathOrAbs.get(resolved.replace(/^\.?\//, ""), resolved);
13244
+ }
13245
+ } catch {
13246
+ }
13247
+ }
13248
+ if (!docRow && normalizedSlashes !== filePath) {
13249
+ docRow = stmts.docByPathOrAbs.get(normalizedSlashes, normalizedSlashes);
13250
+ }
13251
+ if (!docRow && !filePath.startsWith("/") && !filePath.match(/^[a-zA-Z]:[/\\]/)) {
13252
+ const escapedSuffix = normalized.replace(/[%_\\]/g, "\\$&");
13253
+ const candidates = stmts.docBySuffix.all(escapedSuffix, escapedSuffix);
13254
+ const validCandidates = candidates.filter((c) => {
13255
+ const docPath = String(c.path).replace(/\\/g, "/");
13256
+ return docPath === normalized || docPath.endsWith("/" + normalized);
13257
+ });
13258
+ if (validCandidates.length === 1) {
13259
+ docRow = validCandidates[0];
13260
+ }
13261
+ }
13262
+ if (!docRow) return null;
13263
+ const doc = mapDocumentRow(docRow);
13264
+ const symbols = [];
13265
+ const chunkRows = stmts.chunksByDocOutline.all(doc.id);
13266
+ const chunkMetaMap = /* @__PURE__ */ new Map();
13267
+ for (const c of chunkRows) {
13268
+ try {
13269
+ const meta = JSON.parse(c.metadata || "{}");
13270
+ const sName = meta.symbolName || c.heading;
13271
+ if (sName && meta.startLine) {
13272
+ chunkMetaMap.set(String(sName), {
13273
+ startLine: Number(meta.startLine),
13274
+ endLine: Number(meta.endLine || meta.startLine)
13275
+ });
13276
+ }
13277
+ } catch {
13278
+ }
13279
+ }
13280
+ const parsedRow = stmts.parsedDocSymbols.get(doc.id);
13281
+ if (parsedRow?.symbols) {
13282
+ try {
13283
+ const rawSymbols = JSON.parse(parsedRow.symbols);
13284
+ if (Array.isArray(rawSymbols)) {
13285
+ for (const s of rawSymbols) {
13286
+ const name = String(s.name || "");
13287
+ let startLine = Number(s.startLine || 0);
13288
+ let endLine = Number(s.endLine || 0);
13289
+ if (startLine <= 0) {
13290
+ const fromChunk = chunkMetaMap.get(name) || chunkMetaMap.get(name.split(".").pop() || "") || chunkMetaMap.get(name.split("::").pop() || "");
13291
+ if (fromChunk) {
13292
+ startLine = fromChunk.startLine;
13293
+ endLine = fromChunk.endLine;
13294
+ } else {
13295
+ startLine = 1;
13296
+ endLine = 1;
13297
+ }
13298
+ } else if (endLine <= 0) {
13299
+ endLine = startLine;
13300
+ }
13301
+ symbols.push({
13302
+ name,
13303
+ kind: String(s.symbolType || s.kind || s.type || "symbol"),
13304
+ startLine,
13305
+ endLine,
13306
+ exported: Boolean(s.exported),
13307
+ parentSymbol: s.parentSymbol ? String(s.parentSymbol) : void 0
13308
+ });
13309
+ }
13310
+ }
13311
+ } catch {
13312
+ }
13313
+ }
13314
+ if (symbols.length === 0) {
13315
+ for (const c of chunkRows) {
13316
+ let meta = {};
13317
+ try {
13318
+ meta = JSON.parse(c.metadata || "{}");
13319
+ } catch {
13320
+ }
13321
+ const name = c.heading || (meta.symbolName ? String(meta.symbolName) : `Chunk ${c.chunk_index + 1}`);
13322
+ const kind = meta.symbolType ? String(meta.symbolType) : c.heading ? "section" : "chunk";
13323
+ const startLine = Number(meta.startLine || 1);
13324
+ const endLine = Number(meta.endLine || startLine);
13325
+ symbols.push({
13326
+ name,
13327
+ kind,
13328
+ startLine,
13329
+ endLine,
13330
+ exported: Boolean(meta.exported)
13331
+ });
13332
+ }
13333
+ }
13334
+ symbols.sort((a, b) => a.startLine - b.startLine);
13335
+ const lines = [
13336
+ `\u{1F4C4} ${doc.path} (${doc.language || doc.kind}, ${String(doc.sizeBytes)} bytes)`
13337
+ ];
13338
+ for (let i = 0; i < symbols.length; i++) {
13339
+ const s = symbols[i];
13340
+ const isLast = i === symbols.length - 1;
13341
+ const prefix = isLast ? " \u2514\u2500\u2500 " : " \u251C\u2500\u2500 ";
13342
+ const kindIcon = s.kind === "function" || s.kind === "method" ? "\u{1F539}" : s.kind === "class" || s.kind === "struct" || s.kind === "interface" ? "\u{1F4E6}" : s.kind === "section" ? "\u{1F4D1}" : "\u{1F538}";
13343
+ const exportedBadge = s.exported ? " (exported)" : "";
13344
+ const parentPrefix = s.parentSymbol ? `${s.parentSymbol}::` : "";
13345
+ lines.push(
13346
+ `${prefix}${kindIcon} ${s.kind} ${parentPrefix}${s.name} [L${s.startLine}-L${s.endLine}]${exportedBadge}`
13347
+ );
13348
+ }
13349
+ return {
13350
+ path: doc.path,
13351
+ absolutePath: doc.absolutePath,
13352
+ language: doc.language,
13353
+ kind: doc.kind,
13354
+ sizeBytes: doc.sizeBytes,
13355
+ symbols,
13356
+ outlineText: lines.join("\n")
13357
+ };
13358
+ },
13235
13359
  async insertDocument(input) {
13236
13360
  const id = input.id ?? import_node_crypto3.default.randomUUID();
13237
13361
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -13380,11 +13504,13 @@ function createDocumentOps(native, stmts, streamNow) {
13380
13504
  ...chunkOps
13381
13505
  };
13382
13506
  }
13383
- var import_node_crypto3;
13507
+ var import_node_crypto3, import_node_fs5, import_node_path6;
13384
13508
  var init_document_repository = __esm({
13385
13509
  "../../packages/db/src/sqlite/document-repository.ts"() {
13386
13510
  "use strict";
13387
13511
  import_node_crypto3 = __toESM(require("crypto"), 1);
13512
+ import_node_fs5 = __toESM(require("fs"), 1);
13513
+ import_node_path6 = __toESM(require("path"), 1);
13388
13514
  init_chunk_repository();
13389
13515
  }
13390
13516
  });
@@ -13984,6 +14110,16 @@ function createWorkspaceRepository(rootPath) {
13984
14110
  insertDoc: native.prepare(
13985
14111
  "INSERT INTO documents (id, path, absolute_path, kind, language, content_hash, size_bytes, mtime_ms, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
13986
14112
  ),
14113
+ docByPathOrAbs: native.prepare(
14114
+ "SELECT * FROM documents WHERE path = ? OR absolute_path = ? LIMIT 1"
14115
+ ),
14116
+ docBySuffix: native.prepare(
14117
+ "SELECT * FROM documents WHERE (path LIKE '%/' || ? ESCAPE '\\' OR path LIKE '%\\' || ? ESCAPE '\\') ORDER BY length(path) ASC"
14118
+ ),
14119
+ parsedDocSymbols: native.prepare("SELECT symbols FROM parsed_documents WHERE document_id = ?"),
14120
+ chunksByDocOutline: native.prepare(
14121
+ "SELECT chunk_index, heading, metadata FROM chunks WHERE document_id = ? ORDER BY chunk_index ASC"
14122
+ ),
13987
14123
  chunksByDoc: native.prepare("SELECT * FROM chunks WHERE document_id = ? ORDER BY chunk_index"),
13988
14124
  insertChunk: native.prepare(
13989
14125
  "INSERT INTO chunks (id, document_id, chunk_index, heading, content, token_count, content_hash, metadata, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
@@ -14179,14 +14315,14 @@ var init_repository = __esm({
14179
14315
 
14180
14316
  // ../../packages/db/src/sqlite/local-workspace.ts
14181
14317
  function getLocalWorkspaceDir(rootPath) {
14182
- return import_node_path6.default.join(import_node_path6.default.resolve(rootPath), OPENEZ_DIRNAME);
14318
+ return import_node_path7.default.join(import_node_path7.default.resolve(rootPath), OPENEZ_DIRNAME);
14183
14319
  }
14184
14320
  function getLocalWorkspaceConfigPath(rootPath) {
14185
- return import_node_path6.default.join(getLocalWorkspaceDir(rootPath), WORKSPACE_CONFIG_FILENAME);
14321
+ return import_node_path7.default.join(getLocalWorkspaceDir(rootPath), WORKSPACE_CONFIG_FILENAME);
14186
14322
  }
14187
14323
  async function writeLocalWorkspaceConfig(workspace) {
14188
14324
  const configPath = getLocalWorkspaceConfigPath(workspace.rootPath);
14189
- await import_promises4.default.mkdir(import_node_path6.default.dirname(configPath), { recursive: true });
14325
+ await import_promises4.default.mkdir(import_node_path7.default.dirname(configPath), { recursive: true });
14190
14326
  await import_promises4.default.writeFile(
14191
14327
  configPath,
14192
14328
  JSON.stringify(
@@ -14204,7 +14340,7 @@ async function writeLocalWorkspaceConfig(workspace) {
14204
14340
  await ensureGitignoreEntry(workspace.rootPath, OPENEZ_DIRNAME);
14205
14341
  }
14206
14342
  async function ensureGitignoreEntry(rootPath, entry) {
14207
- const gitignorePath = import_node_path6.default.join(rootPath, GITIGNORE);
14343
+ const gitignorePath = import_node_path7.default.join(rootPath, GITIGNORE);
14208
14344
  let content = "";
14209
14345
  try {
14210
14346
  content = await import_promises4.default.readFile(gitignorePath, "utf8");
@@ -14235,33 +14371,33 @@ async function readLocalWorkspaceConfig(rootPath) {
14235
14371
  }
14236
14372
  }
14237
14373
  async function findLocalWorkspaceConfig(startPath) {
14238
- let currentPath = import_node_path6.default.resolve(startPath);
14374
+ let currentPath = import_node_path7.default.resolve(startPath);
14239
14375
  try {
14240
14376
  const stat4 = await import_promises4.default.stat(currentPath);
14241
14377
  if (!stat4.isDirectory()) {
14242
- currentPath = import_node_path6.default.dirname(currentPath);
14378
+ currentPath = import_node_path7.default.dirname(currentPath);
14243
14379
  }
14244
14380
  } catch {
14245
- currentPath = import_node_path6.default.dirname(currentPath);
14381
+ currentPath = import_node_path7.default.dirname(currentPath);
14246
14382
  }
14247
14383
  while (true) {
14248
14384
  const config2 = await readLocalWorkspaceConfig(currentPath);
14249
14385
  if (config2) {
14250
14386
  return config2;
14251
14387
  }
14252
- const parentPath = import_node_path6.default.dirname(currentPath);
14388
+ const parentPath = import_node_path7.default.dirname(currentPath);
14253
14389
  if (parentPath === currentPath) {
14254
14390
  return null;
14255
14391
  }
14256
14392
  currentPath = parentPath;
14257
14393
  }
14258
14394
  }
14259
- var import_promises4, import_node_path6, OPENEZ_DIRNAME, WORKSPACE_CONFIG_FILENAME, GITIGNORE;
14395
+ var import_promises4, import_node_path7, OPENEZ_DIRNAME, WORKSPACE_CONFIG_FILENAME, GITIGNORE;
14260
14396
  var init_local_workspace = __esm({
14261
14397
  "../../packages/db/src/sqlite/local-workspace.ts"() {
14262
14398
  "use strict";
14263
14399
  import_promises4 = __toESM(require("fs/promises"), 1);
14264
- import_node_path6 = __toESM(require("path"), 1);
14400
+ import_node_path7 = __toESM(require("path"), 1);
14265
14401
  OPENEZ_DIRNAME = ".openez";
14266
14402
  WORKSPACE_CONFIG_FILENAME = "workspace.json";
14267
14403
  GITIGNORE = ".gitignore";
@@ -14449,8 +14585,8 @@ var require_package = __commonJS({
14449
14585
  var require_main = __commonJS({
14450
14586
  "../../node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js"(exports2, module4) {
14451
14587
  "use strict";
14452
- var fs23 = require("fs");
14453
- var path26 = require("path");
14588
+ var fs24 = require("fs");
14589
+ var path27 = require("path");
14454
14590
  var os10 = require("os");
14455
14591
  var crypto13 = require("crypto");
14456
14592
  var packageJson = require_package();
@@ -14558,7 +14694,7 @@ var require_main = __commonJS({
14558
14694
  if (options && options.path && options.path.length > 0) {
14559
14695
  if (Array.isArray(options.path)) {
14560
14696
  for (const filepath of options.path) {
14561
- if (fs23.existsSync(filepath)) {
14697
+ if (fs24.existsSync(filepath)) {
14562
14698
  possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
14563
14699
  }
14564
14700
  }
@@ -14566,15 +14702,15 @@ var require_main = __commonJS({
14566
14702
  possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
14567
14703
  }
14568
14704
  } else {
14569
- possibleVaultPath = path26.resolve(process.cwd(), ".env.vault");
14705
+ possibleVaultPath = path27.resolve(process.cwd(), ".env.vault");
14570
14706
  }
14571
- if (fs23.existsSync(possibleVaultPath)) {
14707
+ if (fs24.existsSync(possibleVaultPath)) {
14572
14708
  return possibleVaultPath;
14573
14709
  }
14574
14710
  return null;
14575
14711
  }
14576
14712
  function _resolveHome(envPath) {
14577
- return envPath[0] === "~" ? path26.join(os10.homedir(), envPath.slice(1)) : envPath;
14713
+ return envPath[0] === "~" ? path27.join(os10.homedir(), envPath.slice(1)) : envPath;
14578
14714
  }
14579
14715
  function _configVault(options) {
14580
14716
  const debug = Boolean(options && options.debug);
@@ -14591,7 +14727,7 @@ var require_main = __commonJS({
14591
14727
  return { parsed };
14592
14728
  }
14593
14729
  function configDotenv(options) {
14594
- const dotenvPath = path26.resolve(process.cwd(), ".env");
14730
+ const dotenvPath = path27.resolve(process.cwd(), ".env");
14595
14731
  let encoding = "utf8";
14596
14732
  const debug = Boolean(options && options.debug);
14597
14733
  const quiet = options && "quiet" in options ? options.quiet : true;
@@ -14615,13 +14751,13 @@ var require_main = __commonJS({
14615
14751
  }
14616
14752
  let lastError;
14617
14753
  const parsedAll = {};
14618
- for (const path27 of optionPaths) {
14754
+ for (const path28 of optionPaths) {
14619
14755
  try {
14620
- const parsed = DotenvModule.parse(fs23.readFileSync(path27, { encoding }));
14756
+ const parsed = DotenvModule.parse(fs24.readFileSync(path28, { encoding }));
14621
14757
  DotenvModule.populate(parsedAll, parsed, options);
14622
14758
  } catch (e) {
14623
14759
  if (debug) {
14624
- _debug(`Failed to load ${path27} ${e.message}`);
14760
+ _debug(`Failed to load ${path28} ${e.message}`);
14625
14761
  }
14626
14762
  lastError = e;
14627
14763
  }
@@ -14636,7 +14772,7 @@ var require_main = __commonJS({
14636
14772
  const shortPaths = [];
14637
14773
  for (const filePath of optionPaths) {
14638
14774
  try {
14639
- const relative3 = path26.relative(process.cwd(), filePath);
14775
+ const relative3 = path27.relative(process.cwd(), filePath);
14640
14776
  shortPaths.push(relative3);
14641
14777
  } catch (e) {
14642
14778
  if (debug) {
@@ -15153,8 +15289,8 @@ var init_parseUtil = __esm({
15153
15289
  init_errors2();
15154
15290
  init_en();
15155
15291
  makeIssue = (params) => {
15156
- const { data, path: path26, errorMaps, issueData } = params;
15157
- const fullPath = [...path26, ...issueData.path || []];
15292
+ const { data, path: path27, errorMaps, issueData } = params;
15293
+ const fullPath = [...path27, ...issueData.path || []];
15158
15294
  const fullIssue = {
15159
15295
  ...issueData,
15160
15296
  path: fullPath
@@ -15465,11 +15601,11 @@ var init_types = __esm({
15465
15601
  init_parseUtil();
15466
15602
  init_util();
15467
15603
  ParseInputLazyPath = class {
15468
- constructor(parent, value, path26, key) {
15604
+ constructor(parent, value, path27, key) {
15469
15605
  this._cachedPath = [];
15470
15606
  this.parent = parent;
15471
15607
  this.data = value;
15472
- this._path = path26;
15608
+ this._path = path27;
15473
15609
  this._key = key;
15474
15610
  }
15475
15611
  get path() {
@@ -18856,18 +18992,18 @@ var init_zod = __esm({
18856
18992
  function loadDotenvFromWorkspaceRoot() {
18857
18993
  let currentDir;
18858
18994
  try {
18859
- currentDir = import_node_path7.default.dirname((0, import_node_url.fileURLToPath)(import_meta2.url));
18995
+ currentDir = import_node_path8.default.dirname((0, import_node_url.fileURLToPath)(import_meta2.url));
18860
18996
  } catch {
18861
18997
  currentDir = typeof __dirname !== "undefined" ? __dirname : process.cwd();
18862
18998
  }
18863
18999
  let searchDir = currentDir;
18864
19000
  while (true) {
18865
- const candidate = import_node_path7.default.join(searchDir, ".env");
18866
- if (import_node_fs5.default.existsSync(candidate)) {
19001
+ const candidate = import_node_path8.default.join(searchDir, ".env");
19002
+ if (import_node_fs6.default.existsSync(candidate)) {
18867
19003
  import_dotenv.default.config({ path: candidate });
18868
19004
  return;
18869
19005
  }
18870
- const parentDir = import_node_path7.default.dirname(searchDir);
19006
+ const parentDir = import_node_path8.default.dirname(searchDir);
18871
19007
  if (parentDir === searchDir) {
18872
19008
  break;
18873
19009
  }
@@ -18878,12 +19014,12 @@ function loadDotenvFromWorkspaceRoot() {
18878
19014
  function loadEnv() {
18879
19015
  return envSchema.parse(process.env);
18880
19016
  }
18881
- var import_node_fs5, import_node_path7, import_node_url, import_dotenv, import_meta2, envSchema;
19017
+ var import_node_fs6, import_node_path8, import_node_url, import_dotenv, import_meta2, envSchema;
18882
19018
  var init_env = __esm({
18883
19019
  "../../packages/config/src/env.ts"() {
18884
19020
  "use strict";
18885
- import_node_fs5 = __toESM(require("fs"), 1);
18886
- import_node_path7 = __toESM(require("path"), 1);
19021
+ import_node_fs6 = __toESM(require("fs"), 1);
19022
+ import_node_path8 = __toESM(require("path"), 1);
18887
19023
  import_node_url = require("url");
18888
19024
  import_dotenv = __toESM(require_main(), 1);
18889
19025
  init_zod();
@@ -18928,15 +19064,15 @@ var init_types2 = __esm({
18928
19064
 
18929
19065
  // ../../packages/config/src/load-brain-config.ts
18930
19066
  function findConfigFile(startDir) {
18931
- let current = import_node_path8.default.resolve(startDir);
19067
+ let current = import_node_path9.default.resolve(startDir);
18932
19068
  while (true) {
18933
19069
  for (const fileName of CONFIG_FILE_CANDIDATES) {
18934
- const candidate = import_node_path8.default.join(current, fileName);
18935
- if ((0, import_node_fs6.existsSync)(candidate)) {
19070
+ const candidate = import_node_path9.default.join(current, fileName);
19071
+ if ((0, import_node_fs7.existsSync)(candidate)) {
18936
19072
  return candidate;
18937
19073
  }
18938
19074
  }
18939
- const parent = import_node_path8.default.dirname(current);
19075
+ const parent = import_node_path9.default.dirname(current);
18940
19076
  if (parent === current) {
18941
19077
  return null;
18942
19078
  }
@@ -18944,10 +19080,10 @@ function findConfigFile(startDir) {
18944
19080
  }
18945
19081
  }
18946
19082
  function resolveWorkspace(configFile, workspace) {
18947
- const configDir = import_node_path8.default.dirname(configFile);
19083
+ const configDir = import_node_path9.default.dirname(configFile);
18948
19084
  return {
18949
19085
  ...workspace,
18950
- root: import_node_path8.default.resolve(configDir, workspace.root)
19086
+ root: import_node_path9.default.resolve(configDir, workspace.root)
18951
19087
  };
18952
19088
  }
18953
19089
  async function loadBrainConfig(startDir = process.cwd()) {
@@ -18987,13 +19123,13 @@ async function getBrainSettings(startDir = process.cwd()) {
18987
19123
  retrieval: config2.retrieval ?? defaults2.retrieval
18988
19124
  };
18989
19125
  }
18990
- var import_promises6, import_node_path8, import_node_fs6, CONFIG_FILE_CANDIDATES;
19126
+ var import_promises6, import_node_path9, import_node_fs7, CONFIG_FILE_CANDIDATES;
18991
19127
  var init_load_brain_config = __esm({
18992
19128
  "../../packages/config/src/load-brain-config.ts"() {
18993
19129
  "use strict";
18994
19130
  import_promises6 = __toESM(require("fs/promises"), 1);
18995
- import_node_path8 = __toESM(require("path"), 1);
18996
- import_node_fs6 = require("fs");
19131
+ import_node_path9 = __toESM(require("path"), 1);
19132
+ import_node_fs7 = require("fs");
18997
19133
  init_types2();
18998
19134
  CONFIG_FILE_CANDIDATES = ["brain.config.mjs", "brain.config.js", "brain.config.ts"];
18999
19135
  }
@@ -20793,18 +20929,18 @@ var init_resource = __esm({
20793
20929
  function encodeURIPath(str2) {
20794
20930
  return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
20795
20931
  }
20796
- var EMPTY, createPathTagFunction, path8;
20932
+ var EMPTY, createPathTagFunction, path9;
20797
20933
  var init_path = __esm({
20798
20934
  "../../node_modules/.pnpm/openai@5.23.2_zod@3.25.76/node_modules/openai/internal/utils/path.mjs"() {
20799
20935
  "use strict";
20800
20936
  init_error();
20801
20937
  EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
20802
- createPathTagFunction = (pathEncoder = encodeURIPath) => function path26(statics, ...params) {
20938
+ createPathTagFunction = (pathEncoder = encodeURIPath) => function path27(statics, ...params) {
20803
20939
  if (statics.length === 1)
20804
20940
  return statics[0];
20805
20941
  let postPath = false;
20806
20942
  const invalidSegments = [];
20807
- const path27 = statics.reduce((previousValue, currentValue, index2) => {
20943
+ const path28 = statics.reduce((previousValue, currentValue, index2) => {
20808
20944
  if (/[?#]/.test(currentValue)) {
20809
20945
  postPath = true;
20810
20946
  }
@@ -20821,7 +20957,7 @@ var init_path = __esm({
20821
20957
  }
20822
20958
  return previousValue + currentValue + (index2 === params.length ? "" : encoded);
20823
20959
  }, "");
20824
- const pathOnly = path27.split(/[?#]/, 1)[0];
20960
+ const pathOnly = path28.split(/[?#]/, 1)[0];
20825
20961
  const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
20826
20962
  let match2;
20827
20963
  while ((match2 = invalidSegmentPattern.exec(pathOnly)) !== null) {
@@ -20842,12 +20978,12 @@ var init_path = __esm({
20842
20978
  }, "");
20843
20979
  throw new OpenAIError(`Path parameters result in path with invalid segments:
20844
20980
  ${invalidSegments.map((e) => e.error).join("\n")}
20845
- ${path27}
20981
+ ${path28}
20846
20982
  ${underline}`);
20847
20983
  }
20848
- return path27;
20984
+ return path28;
20849
20985
  };
20850
- path8 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
20986
+ path9 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
20851
20987
  }
20852
20988
  });
20853
20989
 
@@ -20875,7 +21011,7 @@ var init_messages = __esm({
20875
21011
  * ```
20876
21012
  */
20877
21013
  list(completionID, query = {}, options) {
20878
- return this._client.getAPIList(path8`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options });
21014
+ return this._client.getAPIList(path9`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options });
20879
21015
  }
20880
21016
  };
20881
21017
  }
@@ -22282,7 +22418,7 @@ var init_completions = __esm({
22282
22418
  * ```
22283
22419
  */
22284
22420
  retrieve(completionID, options) {
22285
- return this._client.get(path8`/chat/completions/${completionID}`, options);
22421
+ return this._client.get(path9`/chat/completions/${completionID}`, options);
22286
22422
  }
22287
22423
  /**
22288
22424
  * Modify a stored chat completion. Only Chat Completions that have been created
@@ -22298,7 +22434,7 @@ var init_completions = __esm({
22298
22434
  * ```
22299
22435
  */
22300
22436
  update(completionID, body, options) {
22301
- return this._client.post(path8`/chat/completions/${completionID}`, { body, ...options });
22437
+ return this._client.post(path9`/chat/completions/${completionID}`, { body, ...options });
22302
22438
  }
22303
22439
  /**
22304
22440
  * List stored Chat Completions. Only Chat Completions that have been stored with
@@ -22326,7 +22462,7 @@ var init_completions = __esm({
22326
22462
  * ```
22327
22463
  */
22328
22464
  delete(completionID, options) {
22329
- return this._client.delete(path8`/chat/completions/${completionID}`, options);
22465
+ return this._client.delete(path9`/chat/completions/${completionID}`, options);
22330
22466
  }
22331
22467
  parse(body, options) {
22332
22468
  validateInputTools(body.tools);
@@ -22584,7 +22720,7 @@ var init_batches = __esm({
22584
22720
  * Retrieves a batch.
22585
22721
  */
22586
22722
  retrieve(batchID, options) {
22587
- return this._client.get(path8`/batches/${batchID}`, options);
22723
+ return this._client.get(path9`/batches/${batchID}`, options);
22588
22724
  }
22589
22725
  /**
22590
22726
  * List your organization's batches.
@@ -22598,7 +22734,7 @@ var init_batches = __esm({
22598
22734
  * (if any) available in the output file.
22599
22735
  */
22600
22736
  cancel(batchID, options) {
22601
- return this._client.post(path8`/batches/${batchID}/cancel`, options);
22737
+ return this._client.post(path9`/batches/${batchID}/cancel`, options);
22602
22738
  }
22603
22739
  };
22604
22740
  }
@@ -22642,7 +22778,7 @@ var init_assistants = __esm({
22642
22778
  * ```
22643
22779
  */
22644
22780
  retrieve(assistantID, options) {
22645
- return this._client.get(path8`/assistants/${assistantID}`, {
22781
+ return this._client.get(path9`/assistants/${assistantID}`, {
22646
22782
  ...options,
22647
22783
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
22648
22784
  });
@@ -22658,7 +22794,7 @@ var init_assistants = __esm({
22658
22794
  * ```
22659
22795
  */
22660
22796
  update(assistantID, body, options) {
22661
- return this._client.post(path8`/assistants/${assistantID}`, {
22797
+ return this._client.post(path9`/assistants/${assistantID}`, {
22662
22798
  body,
22663
22799
  ...options,
22664
22800
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -22692,7 +22828,7 @@ var init_assistants = __esm({
22692
22828
  * ```
22693
22829
  */
22694
22830
  delete(assistantID, options) {
22695
- return this._client.delete(path8`/assistants/${assistantID}`, {
22831
+ return this._client.delete(path9`/assistants/${assistantID}`, {
22696
22832
  ...options,
22697
22833
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
22698
22834
  });
@@ -22807,7 +22943,7 @@ var init_messages2 = __esm({
22807
22943
  * @deprecated The Assistants API is deprecated in favor of the Responses API
22808
22944
  */
22809
22945
  create(threadID, body, options) {
22810
- return this._client.post(path8`/threads/${threadID}/messages`, {
22946
+ return this._client.post(path9`/threads/${threadID}/messages`, {
22811
22947
  body,
22812
22948
  ...options,
22813
22949
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -22820,7 +22956,7 @@ var init_messages2 = __esm({
22820
22956
  */
22821
22957
  retrieve(messageID, params, options) {
22822
22958
  const { thread_id } = params;
22823
- return this._client.get(path8`/threads/${thread_id}/messages/${messageID}`, {
22959
+ return this._client.get(path9`/threads/${thread_id}/messages/${messageID}`, {
22824
22960
  ...options,
22825
22961
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
22826
22962
  });
@@ -22832,7 +22968,7 @@ var init_messages2 = __esm({
22832
22968
  */
22833
22969
  update(messageID, params, options) {
22834
22970
  const { thread_id, ...body } = params;
22835
- return this._client.post(path8`/threads/${thread_id}/messages/${messageID}`, {
22971
+ return this._client.post(path9`/threads/${thread_id}/messages/${messageID}`, {
22836
22972
  body,
22837
22973
  ...options,
22838
22974
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -22844,7 +22980,7 @@ var init_messages2 = __esm({
22844
22980
  * @deprecated The Assistants API is deprecated in favor of the Responses API
22845
22981
  */
22846
22982
  list(threadID, query = {}, options) {
22847
- return this._client.getAPIList(path8`/threads/${threadID}/messages`, CursorPage, {
22983
+ return this._client.getAPIList(path9`/threads/${threadID}/messages`, CursorPage, {
22848
22984
  query,
22849
22985
  ...options,
22850
22986
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -22857,7 +22993,7 @@ var init_messages2 = __esm({
22857
22993
  */
22858
22994
  delete(messageID, params, options) {
22859
22995
  const { thread_id } = params;
22860
- return this._client.delete(path8`/threads/${thread_id}/messages/${messageID}`, {
22996
+ return this._client.delete(path9`/threads/${thread_id}/messages/${messageID}`, {
22861
22997
  ...options,
22862
22998
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
22863
22999
  });
@@ -22883,7 +23019,7 @@ var init_steps = __esm({
22883
23019
  */
22884
23020
  retrieve(stepID, params, options) {
22885
23021
  const { thread_id, run_id, ...query } = params;
22886
- return this._client.get(path8`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, {
23022
+ return this._client.get(path9`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, {
22887
23023
  query,
22888
23024
  ...options,
22889
23025
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -22896,7 +23032,7 @@ var init_steps = __esm({
22896
23032
  */
22897
23033
  list(runID, params, options) {
22898
23034
  const { thread_id, ...query } = params;
22899
- return this._client.getAPIList(path8`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, {
23035
+ return this._client.getAPIList(path9`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, {
22900
23036
  query,
22901
23037
  ...options,
22902
23038
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -23507,7 +23643,7 @@ var init_runs = __esm({
23507
23643
  }
23508
23644
  create(threadID, params, options) {
23509
23645
  const { include, ...body } = params;
23510
- return this._client.post(path8`/threads/${threadID}/runs`, {
23646
+ return this._client.post(path9`/threads/${threadID}/runs`, {
23511
23647
  query: { include },
23512
23648
  body,
23513
23649
  ...options,
@@ -23522,7 +23658,7 @@ var init_runs = __esm({
23522
23658
  */
23523
23659
  retrieve(runID, params, options) {
23524
23660
  const { thread_id } = params;
23525
- return this._client.get(path8`/threads/${thread_id}/runs/${runID}`, {
23661
+ return this._client.get(path9`/threads/${thread_id}/runs/${runID}`, {
23526
23662
  ...options,
23527
23663
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
23528
23664
  });
@@ -23534,7 +23670,7 @@ var init_runs = __esm({
23534
23670
  */
23535
23671
  update(runID, params, options) {
23536
23672
  const { thread_id, ...body } = params;
23537
- return this._client.post(path8`/threads/${thread_id}/runs/${runID}`, {
23673
+ return this._client.post(path9`/threads/${thread_id}/runs/${runID}`, {
23538
23674
  body,
23539
23675
  ...options,
23540
23676
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -23546,7 +23682,7 @@ var init_runs = __esm({
23546
23682
  * @deprecated The Assistants API is deprecated in favor of the Responses API
23547
23683
  */
23548
23684
  list(threadID, query = {}, options) {
23549
- return this._client.getAPIList(path8`/threads/${threadID}/runs`, CursorPage, {
23685
+ return this._client.getAPIList(path9`/threads/${threadID}/runs`, CursorPage, {
23550
23686
  query,
23551
23687
  ...options,
23552
23688
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -23559,7 +23695,7 @@ var init_runs = __esm({
23559
23695
  */
23560
23696
  cancel(runID, params, options) {
23561
23697
  const { thread_id } = params;
23562
- return this._client.post(path8`/threads/${thread_id}/runs/${runID}/cancel`, {
23698
+ return this._client.post(path9`/threads/${thread_id}/runs/${runID}/cancel`, {
23563
23699
  ...options,
23564
23700
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
23565
23701
  });
@@ -23637,7 +23773,7 @@ var init_runs = __esm({
23637
23773
  }
23638
23774
  submitToolOutputs(runID, params, options) {
23639
23775
  const { thread_id, ...body } = params;
23640
- return this._client.post(path8`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, {
23776
+ return this._client.post(path9`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, {
23641
23777
  body,
23642
23778
  ...options,
23643
23779
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
@@ -23703,7 +23839,7 @@ var init_threads = __esm({
23703
23839
  * @deprecated The Assistants API is deprecated in favor of the Responses API
23704
23840
  */
23705
23841
  retrieve(threadID, options) {
23706
- return this._client.get(path8`/threads/${threadID}`, {
23842
+ return this._client.get(path9`/threads/${threadID}`, {
23707
23843
  ...options,
23708
23844
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
23709
23845
  });
@@ -23714,7 +23850,7 @@ var init_threads = __esm({
23714
23850
  * @deprecated The Assistants API is deprecated in favor of the Responses API
23715
23851
  */
23716
23852
  update(threadID, body, options) {
23717
- return this._client.post(path8`/threads/${threadID}`, {
23853
+ return this._client.post(path9`/threads/${threadID}`, {
23718
23854
  body,
23719
23855
  ...options,
23720
23856
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -23726,7 +23862,7 @@ var init_threads = __esm({
23726
23862
  * @deprecated The Assistants API is deprecated in favor of the Responses API
23727
23863
  */
23728
23864
  delete(threadID, options) {
23729
- return this._client.delete(path8`/threads/${threadID}`, {
23865
+ return this._client.delete(path9`/threads/${threadID}`, {
23730
23866
  ...options,
23731
23867
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
23732
23868
  });
@@ -23814,7 +23950,7 @@ var init_content = __esm({
23814
23950
  */
23815
23951
  retrieve(fileID, params, options) {
23816
23952
  const { container_id } = params;
23817
- return this._client.get(path8`/containers/${container_id}/files/${fileID}/content`, {
23953
+ return this._client.get(path9`/containers/${container_id}/files/${fileID}/content`, {
23818
23954
  ...options,
23819
23955
  headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
23820
23956
  __binaryResponse: true
@@ -23848,20 +23984,20 @@ var init_files = __esm({
23848
23984
  * a JSON request with a file ID.
23849
23985
  */
23850
23986
  create(containerID, body, options) {
23851
- return this._client.post(path8`/containers/${containerID}/files`, multipartFormRequestOptions({ body, ...options }, this._client));
23987
+ return this._client.post(path9`/containers/${containerID}/files`, multipartFormRequestOptions({ body, ...options }, this._client));
23852
23988
  }
23853
23989
  /**
23854
23990
  * Retrieve Container File
23855
23991
  */
23856
23992
  retrieve(fileID, params, options) {
23857
23993
  const { container_id } = params;
23858
- return this._client.get(path8`/containers/${container_id}/files/${fileID}`, options);
23994
+ return this._client.get(path9`/containers/${container_id}/files/${fileID}`, options);
23859
23995
  }
23860
23996
  /**
23861
23997
  * List Container files
23862
23998
  */
23863
23999
  list(containerID, query = {}, options) {
23864
- return this._client.getAPIList(path8`/containers/${containerID}/files`, CursorPage, {
24000
+ return this._client.getAPIList(path9`/containers/${containerID}/files`, CursorPage, {
23865
24001
  query,
23866
24002
  ...options
23867
24003
  });
@@ -23871,7 +24007,7 @@ var init_files = __esm({
23871
24007
  */
23872
24008
  delete(fileID, params, options) {
23873
24009
  const { container_id } = params;
23874
- return this._client.delete(path8`/containers/${container_id}/files/${fileID}`, {
24010
+ return this._client.delete(path9`/containers/${container_id}/files/${fileID}`, {
23875
24011
  ...options,
23876
24012
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
23877
24013
  });
@@ -23907,7 +24043,7 @@ var init_containers = __esm({
23907
24043
  * Retrieve Container
23908
24044
  */
23909
24045
  retrieve(containerID, options) {
23910
- return this._client.get(path8`/containers/${containerID}`, options);
24046
+ return this._client.get(path9`/containers/${containerID}`, options);
23911
24047
  }
23912
24048
  /**
23913
24049
  * List Containers
@@ -23919,7 +24055,7 @@ var init_containers = __esm({
23919
24055
  * Delete Container
23920
24056
  */
23921
24057
  delete(containerID, options) {
23922
- return this._client.delete(path8`/containers/${containerID}`, {
24058
+ return this._client.delete(path9`/containers/${containerID}`, {
23923
24059
  ...options,
23924
24060
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
23925
24061
  });
@@ -23943,7 +24079,7 @@ var init_items = __esm({
23943
24079
  */
23944
24080
  create(conversationID, params, options) {
23945
24081
  const { include, ...body } = params;
23946
- return this._client.post(path8`/conversations/${conversationID}/items`, {
24082
+ return this._client.post(path9`/conversations/${conversationID}/items`, {
23947
24083
  query: { include },
23948
24084
  body,
23949
24085
  ...options
@@ -23954,20 +24090,20 @@ var init_items = __esm({
23954
24090
  */
23955
24091
  retrieve(itemID, params, options) {
23956
24092
  const { conversation_id, ...query } = params;
23957
- return this._client.get(path8`/conversations/${conversation_id}/items/${itemID}`, { query, ...options });
24093
+ return this._client.get(path9`/conversations/${conversation_id}/items/${itemID}`, { query, ...options });
23958
24094
  }
23959
24095
  /**
23960
24096
  * List all items for a conversation with the given ID.
23961
24097
  */
23962
24098
  list(conversationID, query = {}, options) {
23963
- return this._client.getAPIList(path8`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options });
24099
+ return this._client.getAPIList(path9`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options });
23964
24100
  }
23965
24101
  /**
23966
24102
  * Delete an item from a conversation with the given IDs.
23967
24103
  */
23968
24104
  delete(itemID, params, options) {
23969
24105
  const { conversation_id } = params;
23970
- return this._client.delete(path8`/conversations/${conversation_id}/items/${itemID}`, options);
24106
+ return this._client.delete(path9`/conversations/${conversation_id}/items/${itemID}`, options);
23971
24107
  }
23972
24108
  };
23973
24109
  }
@@ -23997,19 +24133,19 @@ var init_conversations = __esm({
23997
24133
  * Get a conversation
23998
24134
  */
23999
24135
  retrieve(conversationID, options) {
24000
- return this._client.get(path8`/conversations/${conversationID}`, options);
24136
+ return this._client.get(path9`/conversations/${conversationID}`, options);
24001
24137
  }
24002
24138
  /**
24003
24139
  * Update a conversation
24004
24140
  */
24005
24141
  update(conversationID, body, options) {
24006
- return this._client.post(path8`/conversations/${conversationID}`, { body, ...options });
24142
+ return this._client.post(path9`/conversations/${conversationID}`, { body, ...options });
24007
24143
  }
24008
24144
  /**
24009
24145
  * Delete a conversation. Items in the conversation will not be deleted.
24010
24146
  */
24011
24147
  delete(conversationID, options) {
24012
- return this._client.delete(path8`/conversations/${conversationID}`, options);
24148
+ return this._client.delete(path9`/conversations/${conversationID}`, options);
24013
24149
  }
24014
24150
  };
24015
24151
  Conversations.Items = Items;
@@ -24081,14 +24217,14 @@ var init_output_items = __esm({
24081
24217
  */
24082
24218
  retrieve(outputItemID, params, options) {
24083
24219
  const { eval_id, run_id } = params;
24084
- return this._client.get(path8`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, options);
24220
+ return this._client.get(path9`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, options);
24085
24221
  }
24086
24222
  /**
24087
24223
  * Get a list of output items for an evaluation run.
24088
24224
  */
24089
24225
  list(runID, params, options) {
24090
24226
  const { eval_id, ...query } = params;
24091
- return this._client.getAPIList(path8`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query, ...options });
24227
+ return this._client.getAPIList(path9`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query, ...options });
24092
24228
  }
24093
24229
  };
24094
24230
  }
@@ -24115,20 +24251,20 @@ var init_runs2 = __esm({
24115
24251
  * schema specified in the config of the evaluation.
24116
24252
  */
24117
24253
  create(evalID, body, options) {
24118
- return this._client.post(path8`/evals/${evalID}/runs`, { body, ...options });
24254
+ return this._client.post(path9`/evals/${evalID}/runs`, { body, ...options });
24119
24255
  }
24120
24256
  /**
24121
24257
  * Get an evaluation run by ID.
24122
24258
  */
24123
24259
  retrieve(runID, params, options) {
24124
24260
  const { eval_id } = params;
24125
- return this._client.get(path8`/evals/${eval_id}/runs/${runID}`, options);
24261
+ return this._client.get(path9`/evals/${eval_id}/runs/${runID}`, options);
24126
24262
  }
24127
24263
  /**
24128
24264
  * Get a list of runs for an evaluation.
24129
24265
  */
24130
24266
  list(evalID, query = {}, options) {
24131
- return this._client.getAPIList(path8`/evals/${evalID}/runs`, CursorPage, {
24267
+ return this._client.getAPIList(path9`/evals/${evalID}/runs`, CursorPage, {
24132
24268
  query,
24133
24269
  ...options
24134
24270
  });
@@ -24138,14 +24274,14 @@ var init_runs2 = __esm({
24138
24274
  */
24139
24275
  delete(runID, params, options) {
24140
24276
  const { eval_id } = params;
24141
- return this._client.delete(path8`/evals/${eval_id}/runs/${runID}`, options);
24277
+ return this._client.delete(path9`/evals/${eval_id}/runs/${runID}`, options);
24142
24278
  }
24143
24279
  /**
24144
24280
  * Cancel an ongoing evaluation run.
24145
24281
  */
24146
24282
  cancel(runID, params, options) {
24147
24283
  const { eval_id } = params;
24148
- return this._client.post(path8`/evals/${eval_id}/runs/${runID}`, options);
24284
+ return this._client.post(path9`/evals/${eval_id}/runs/${runID}`, options);
24149
24285
  }
24150
24286
  };
24151
24287
  Runs2.OutputItems = OutputItems;
@@ -24182,13 +24318,13 @@ var init_evals = __esm({
24182
24318
  * Get an evaluation by ID.
24183
24319
  */
24184
24320
  retrieve(evalID, options) {
24185
- return this._client.get(path8`/evals/${evalID}`, options);
24321
+ return this._client.get(path9`/evals/${evalID}`, options);
24186
24322
  }
24187
24323
  /**
24188
24324
  * Update certain properties of an evaluation.
24189
24325
  */
24190
24326
  update(evalID, body, options) {
24191
- return this._client.post(path8`/evals/${evalID}`, { body, ...options });
24327
+ return this._client.post(path9`/evals/${evalID}`, { body, ...options });
24192
24328
  }
24193
24329
  /**
24194
24330
  * List evaluations for a project.
@@ -24200,7 +24336,7 @@ var init_evals = __esm({
24200
24336
  * Delete an evaluation.
24201
24337
  */
24202
24338
  delete(evalID, options) {
24203
- return this._client.delete(path8`/evals/${evalID}`, options);
24339
+ return this._client.delete(path9`/evals/${evalID}`, options);
24204
24340
  }
24205
24341
  };
24206
24342
  Evals.Runs = Runs2;
@@ -24250,7 +24386,7 @@ var init_files2 = __esm({
24250
24386
  * Returns information about a specific file.
24251
24387
  */
24252
24388
  retrieve(fileID, options) {
24253
- return this._client.get(path8`/files/${fileID}`, options);
24389
+ return this._client.get(path9`/files/${fileID}`, options);
24254
24390
  }
24255
24391
  /**
24256
24392
  * Returns a list of files.
@@ -24262,13 +24398,13 @@ var init_files2 = __esm({
24262
24398
  * Delete a file.
24263
24399
  */
24264
24400
  delete(fileID, options) {
24265
- return this._client.delete(path8`/files/${fileID}`, options);
24401
+ return this._client.delete(path9`/files/${fileID}`, options);
24266
24402
  }
24267
24403
  /**
24268
24404
  * Returns the contents of the specified file.
24269
24405
  */
24270
24406
  content(fileID, options) {
24271
- return this._client.get(path8`/files/${fileID}/content`, {
24407
+ return this._client.get(path9`/files/${fileID}/content`, {
24272
24408
  ...options,
24273
24409
  headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
24274
24410
  __binaryResponse: true
@@ -24403,7 +24539,7 @@ var init_permissions = __esm({
24403
24539
  * ```
24404
24540
  */
24405
24541
  create(fineTunedModelCheckpoint, body, options) {
24406
- return this._client.getAPIList(path8`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page, { body, method: "post", ...options });
24542
+ return this._client.getAPIList(path9`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page, { body, method: "post", ...options });
24407
24543
  }
24408
24544
  /**
24409
24545
  * **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
@@ -24420,7 +24556,7 @@ var init_permissions = __esm({
24420
24556
  * ```
24421
24557
  */
24422
24558
  retrieve(fineTunedModelCheckpoint, query = {}, options) {
24423
- return this._client.get(path8`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, {
24559
+ return this._client.get(path9`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, {
24424
24560
  query,
24425
24561
  ...options
24426
24562
  });
@@ -24445,7 +24581,7 @@ var init_permissions = __esm({
24445
24581
  */
24446
24582
  delete(permissionID, params, options) {
24447
24583
  const { fine_tuned_model_checkpoint } = params;
24448
- return this._client.delete(path8`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, options);
24584
+ return this._client.delete(path9`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, options);
24449
24585
  }
24450
24586
  };
24451
24587
  }
@@ -24492,7 +24628,7 @@ var init_checkpoints2 = __esm({
24492
24628
  * ```
24493
24629
  */
24494
24630
  list(fineTuningJobID, query = {}, options) {
24495
- return this._client.getAPIList(path8`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options });
24631
+ return this._client.getAPIList(path9`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options });
24496
24632
  }
24497
24633
  };
24498
24634
  }
@@ -24546,7 +24682,7 @@ var init_jobs = __esm({
24546
24682
  * ```
24547
24683
  */
24548
24684
  retrieve(fineTuningJobID, options) {
24549
- return this._client.get(path8`/fine_tuning/jobs/${fineTuningJobID}`, options);
24685
+ return this._client.get(path9`/fine_tuning/jobs/${fineTuningJobID}`, options);
24550
24686
  }
24551
24687
  /**
24552
24688
  * List your organization's fine-tuning jobs
@@ -24573,7 +24709,7 @@ var init_jobs = __esm({
24573
24709
  * ```
24574
24710
  */
24575
24711
  cancel(fineTuningJobID, options) {
24576
- return this._client.post(path8`/fine_tuning/jobs/${fineTuningJobID}/cancel`, options);
24712
+ return this._client.post(path9`/fine_tuning/jobs/${fineTuningJobID}/cancel`, options);
24577
24713
  }
24578
24714
  /**
24579
24715
  * Get status updates for a fine-tuning job.
@@ -24589,7 +24725,7 @@ var init_jobs = __esm({
24589
24725
  * ```
24590
24726
  */
24591
24727
  listEvents(fineTuningJobID, query = {}, options) {
24592
- return this._client.getAPIList(path8`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query, ...options });
24728
+ return this._client.getAPIList(path9`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query, ...options });
24593
24729
  }
24594
24730
  /**
24595
24731
  * Pause a fine-tune job.
@@ -24602,7 +24738,7 @@ var init_jobs = __esm({
24602
24738
  * ```
24603
24739
  */
24604
24740
  pause(fineTuningJobID, options) {
24605
- return this._client.post(path8`/fine_tuning/jobs/${fineTuningJobID}/pause`, options);
24741
+ return this._client.post(path9`/fine_tuning/jobs/${fineTuningJobID}/pause`, options);
24606
24742
  }
24607
24743
  /**
24608
24744
  * Resume a fine-tune job.
@@ -24615,7 +24751,7 @@ var init_jobs = __esm({
24615
24751
  * ```
24616
24752
  */
24617
24753
  resume(fineTuningJobID, options) {
24618
- return this._client.post(path8`/fine_tuning/jobs/${fineTuningJobID}/resume`, options);
24754
+ return this._client.post(path9`/fine_tuning/jobs/${fineTuningJobID}/resume`, options);
24619
24755
  }
24620
24756
  };
24621
24757
  Jobs.Checkpoints = Checkpoints2;
@@ -24726,7 +24862,7 @@ var init_models = __esm({
24726
24862
  * the owner and permissioning.
24727
24863
  */
24728
24864
  retrieve(model, options) {
24729
- return this._client.get(path8`/models/${model}`, options);
24865
+ return this._client.get(path9`/models/${model}`, options);
24730
24866
  }
24731
24867
  /**
24732
24868
  * Lists the currently available models, and provides basic information about each
@@ -24740,7 +24876,7 @@ var init_models = __esm({
24740
24876
  * delete a model.
24741
24877
  */
24742
24878
  delete(model, options) {
24743
- return this._client.delete(path8`/models/${model}`, options);
24879
+ return this._client.delete(path9`/models/${model}`, options);
24744
24880
  }
24745
24881
  };
24746
24882
  }
@@ -25214,7 +25350,7 @@ var init_input_items = __esm({
25214
25350
  * ```
25215
25351
  */
25216
25352
  list(responseID, query = {}, options) {
25217
- return this._client.getAPIList(path8`/responses/${responseID}/input_items`, CursorPage, { query, ...options });
25353
+ return this._client.getAPIList(path9`/responses/${responseID}/input_items`, CursorPage, { query, ...options });
25218
25354
  }
25219
25355
  };
25220
25356
  }
@@ -25246,7 +25382,7 @@ var init_responses = __esm({
25246
25382
  });
25247
25383
  }
25248
25384
  retrieve(responseID, query = {}, options) {
25249
- return this._client.get(path8`/responses/${responseID}`, {
25385
+ return this._client.get(path9`/responses/${responseID}`, {
25250
25386
  query,
25251
25387
  ...options,
25252
25388
  stream: query?.stream ?? false
@@ -25268,7 +25404,7 @@ var init_responses = __esm({
25268
25404
  * ```
25269
25405
  */
25270
25406
  delete(responseID, options) {
25271
- return this._client.delete(path8`/responses/${responseID}`, {
25407
+ return this._client.delete(path9`/responses/${responseID}`, {
25272
25408
  ...options,
25273
25409
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
25274
25410
  });
@@ -25295,7 +25431,7 @@ var init_responses = __esm({
25295
25431
  * ```
25296
25432
  */
25297
25433
  cancel(responseID, options) {
25298
- return this._client.post(path8`/responses/${responseID}/cancel`, options);
25434
+ return this._client.post(path9`/responses/${responseID}/cancel`, options);
25299
25435
  }
25300
25436
  };
25301
25437
  Responses.InputItems = InputItems;
@@ -25325,7 +25461,7 @@ var init_parts = __esm({
25325
25461
  * [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete).
25326
25462
  */
25327
25463
  create(uploadID, body, options) {
25328
- return this._client.post(path8`/uploads/${uploadID}/parts`, multipartFormRequestOptions({ body, ...options }, this._client));
25464
+ return this._client.post(path9`/uploads/${uploadID}/parts`, multipartFormRequestOptions({ body, ...options }, this._client));
25329
25465
  }
25330
25466
  };
25331
25467
  }
@@ -25373,7 +25509,7 @@ var init_uploads3 = __esm({
25373
25509
  * Cancels the Upload. No Parts may be added after an Upload is cancelled.
25374
25510
  */
25375
25511
  cancel(uploadID, options) {
25376
- return this._client.post(path8`/uploads/${uploadID}/cancel`, options);
25512
+ return this._client.post(path9`/uploads/${uploadID}/cancel`, options);
25377
25513
  }
25378
25514
  /**
25379
25515
  * Completes the
@@ -25391,7 +25527,7 @@ var init_uploads3 = __esm({
25391
25527
  * an Upload is completed.
25392
25528
  */
25393
25529
  complete(uploadID, body, options) {
25394
- return this._client.post(path8`/uploads/${uploadID}/complete`, { body, ...options });
25530
+ return this._client.post(path9`/uploads/${uploadID}/complete`, { body, ...options });
25395
25531
  }
25396
25532
  };
25397
25533
  Uploads.Parts = Parts;
@@ -25439,7 +25575,7 @@ var init_file_batches = __esm({
25439
25575
  * Create a vector store file batch.
25440
25576
  */
25441
25577
  create(vectorStoreID, body, options) {
25442
- return this._client.post(path8`/vector_stores/${vectorStoreID}/file_batches`, {
25578
+ return this._client.post(path9`/vector_stores/${vectorStoreID}/file_batches`, {
25443
25579
  body,
25444
25580
  ...options,
25445
25581
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -25450,7 +25586,7 @@ var init_file_batches = __esm({
25450
25586
  */
25451
25587
  retrieve(batchID, params, options) {
25452
25588
  const { vector_store_id } = params;
25453
- return this._client.get(path8`/vector_stores/${vector_store_id}/file_batches/${batchID}`, {
25589
+ return this._client.get(path9`/vector_stores/${vector_store_id}/file_batches/${batchID}`, {
25454
25590
  ...options,
25455
25591
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25456
25592
  });
@@ -25461,7 +25597,7 @@ var init_file_batches = __esm({
25461
25597
  */
25462
25598
  cancel(batchID, params, options) {
25463
25599
  const { vector_store_id } = params;
25464
- return this._client.post(path8`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, {
25600
+ return this._client.post(path9`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, {
25465
25601
  ...options,
25466
25602
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25467
25603
  });
@@ -25478,7 +25614,7 @@ var init_file_batches = __esm({
25478
25614
  */
25479
25615
  listFiles(batchID, params, options) {
25480
25616
  const { vector_store_id, ...query } = params;
25481
- return this._client.getAPIList(path8`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, { query, ...options, headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]) });
25617
+ return this._client.getAPIList(path9`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, { query, ...options, headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]) });
25482
25618
  }
25483
25619
  /**
25484
25620
  * Wait for the given file batch to be processed.
@@ -25569,7 +25705,7 @@ var init_files3 = __esm({
25569
25705
  * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object).
25570
25706
  */
25571
25707
  create(vectorStoreID, body, options) {
25572
- return this._client.post(path8`/vector_stores/${vectorStoreID}/files`, {
25708
+ return this._client.post(path9`/vector_stores/${vectorStoreID}/files`, {
25573
25709
  body,
25574
25710
  ...options,
25575
25711
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -25580,7 +25716,7 @@ var init_files3 = __esm({
25580
25716
  */
25581
25717
  retrieve(fileID, params, options) {
25582
25718
  const { vector_store_id } = params;
25583
- return this._client.get(path8`/vector_stores/${vector_store_id}/files/${fileID}`, {
25719
+ return this._client.get(path9`/vector_stores/${vector_store_id}/files/${fileID}`, {
25584
25720
  ...options,
25585
25721
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25586
25722
  });
@@ -25590,7 +25726,7 @@ var init_files3 = __esm({
25590
25726
  */
25591
25727
  update(fileID, params, options) {
25592
25728
  const { vector_store_id, ...body } = params;
25593
- return this._client.post(path8`/vector_stores/${vector_store_id}/files/${fileID}`, {
25729
+ return this._client.post(path9`/vector_stores/${vector_store_id}/files/${fileID}`, {
25594
25730
  body,
25595
25731
  ...options,
25596
25732
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -25600,7 +25736,7 @@ var init_files3 = __esm({
25600
25736
  * Returns a list of vector store files.
25601
25737
  */
25602
25738
  list(vectorStoreID, query = {}, options) {
25603
- return this._client.getAPIList(path8`/vector_stores/${vectorStoreID}/files`, CursorPage, {
25739
+ return this._client.getAPIList(path9`/vector_stores/${vectorStoreID}/files`, CursorPage, {
25604
25740
  query,
25605
25741
  ...options,
25606
25742
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -25614,7 +25750,7 @@ var init_files3 = __esm({
25614
25750
  */
25615
25751
  delete(fileID, params, options) {
25616
25752
  const { vector_store_id } = params;
25617
- return this._client.delete(path8`/vector_stores/${vector_store_id}/files/${fileID}`, {
25753
+ return this._client.delete(path9`/vector_stores/${vector_store_id}/files/${fileID}`, {
25618
25754
  ...options,
25619
25755
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25620
25756
  });
@@ -25689,7 +25825,7 @@ var init_files3 = __esm({
25689
25825
  */
25690
25826
  content(fileID, params, options) {
25691
25827
  const { vector_store_id } = params;
25692
- return this._client.getAPIList(path8`/vector_stores/${vector_store_id}/files/${fileID}/content`, Page, { ...options, headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]) });
25828
+ return this._client.getAPIList(path9`/vector_stores/${vector_store_id}/files/${fileID}/content`, Page, { ...options, headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]) });
25693
25829
  }
25694
25830
  };
25695
25831
  }
@@ -25728,7 +25864,7 @@ var init_vector_stores = __esm({
25728
25864
  * Retrieves a vector store.
25729
25865
  */
25730
25866
  retrieve(vectorStoreID, options) {
25731
- return this._client.get(path8`/vector_stores/${vectorStoreID}`, {
25867
+ return this._client.get(path9`/vector_stores/${vectorStoreID}`, {
25732
25868
  ...options,
25733
25869
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25734
25870
  });
@@ -25737,7 +25873,7 @@ var init_vector_stores = __esm({
25737
25873
  * Modifies a vector store.
25738
25874
  */
25739
25875
  update(vectorStoreID, body, options) {
25740
- return this._client.post(path8`/vector_stores/${vectorStoreID}`, {
25876
+ return this._client.post(path9`/vector_stores/${vectorStoreID}`, {
25741
25877
  body,
25742
25878
  ...options,
25743
25879
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -25757,7 +25893,7 @@ var init_vector_stores = __esm({
25757
25893
  * Delete a vector store.
25758
25894
  */
25759
25895
  delete(vectorStoreID, options) {
25760
- return this._client.delete(path8`/vector_stores/${vectorStoreID}`, {
25896
+ return this._client.delete(path9`/vector_stores/${vectorStoreID}`, {
25761
25897
  ...options,
25762
25898
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25763
25899
  });
@@ -25767,7 +25903,7 @@ var init_vector_stores = __esm({
25767
25903
  * filter.
25768
25904
  */
25769
25905
  search(vectorStoreID, body, options) {
25770
- return this._client.getAPIList(path8`/vector_stores/${vectorStoreID}/search`, Page, {
25906
+ return this._client.getAPIList(path9`/vector_stores/${vectorStoreID}/search`, Page, {
25771
25907
  body,
25772
25908
  method: "post",
25773
25909
  ...options,
@@ -26073,9 +26209,9 @@ var init_client = __esm({
26073
26209
  this.apiKey = token;
26074
26210
  return true;
26075
26211
  }
26076
- buildURL(path26, query, defaultBaseURL) {
26212
+ buildURL(path27, query, defaultBaseURL) {
26077
26213
  const baseURL = !__classPrivateFieldGet(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
26078
- const url = isAbsoluteURL(path26) ? new URL(path26) : new URL(baseURL + (baseURL.endsWith("/") && path26.startsWith("/") ? path26.slice(1) : path26));
26214
+ const url = isAbsoluteURL(path27) ? new URL(path27) : new URL(baseURL + (baseURL.endsWith("/") && path27.startsWith("/") ? path27.slice(1) : path27));
26079
26215
  const defaultQuery = this.defaultQuery();
26080
26216
  if (!isEmptyObj(defaultQuery)) {
26081
26217
  query = { ...defaultQuery, ...query };
@@ -26099,24 +26235,24 @@ var init_client = __esm({
26099
26235
  */
26100
26236
  async prepareRequest(request, { url, options }) {
26101
26237
  }
26102
- get(path26, opts) {
26103
- return this.methodRequest("get", path26, opts);
26238
+ get(path27, opts) {
26239
+ return this.methodRequest("get", path27, opts);
26104
26240
  }
26105
- post(path26, opts) {
26106
- return this.methodRequest("post", path26, opts);
26241
+ post(path27, opts) {
26242
+ return this.methodRequest("post", path27, opts);
26107
26243
  }
26108
- patch(path26, opts) {
26109
- return this.methodRequest("patch", path26, opts);
26244
+ patch(path27, opts) {
26245
+ return this.methodRequest("patch", path27, opts);
26110
26246
  }
26111
- put(path26, opts) {
26112
- return this.methodRequest("put", path26, opts);
26247
+ put(path27, opts) {
26248
+ return this.methodRequest("put", path27, opts);
26113
26249
  }
26114
- delete(path26, opts) {
26115
- return this.methodRequest("delete", path26, opts);
26250
+ delete(path27, opts) {
26251
+ return this.methodRequest("delete", path27, opts);
26116
26252
  }
26117
- methodRequest(method, path26, opts) {
26253
+ methodRequest(method, path27, opts) {
26118
26254
  return this.request(Promise.resolve(opts).then((opts2) => {
26119
- return { method, path: path26, ...opts2 };
26255
+ return { method, path: path27, ...opts2 };
26120
26256
  }));
26121
26257
  }
26122
26258
  request(options, remainingRetries = null) {
@@ -26220,8 +26356,8 @@ var init_client = __esm({
26220
26356
  }));
26221
26357
  return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
26222
26358
  }
26223
- getAPIList(path26, Page2, opts) {
26224
- return this.requestAPIList(Page2, { method: "get", path: path26, ...opts });
26359
+ getAPIList(path27, Page2, opts) {
26360
+ return this.requestAPIList(Page2, { method: "get", path: path27, ...opts });
26225
26361
  }
26226
26362
  requestAPIList(Page2, options) {
26227
26363
  const request = this.makeRequest(options, null, void 0);
@@ -26299,8 +26435,8 @@ var init_client = __esm({
26299
26435
  }
26300
26436
  async buildRequest(inputOptions, { retryCount = 0 } = {}) {
26301
26437
  const options = { ...inputOptions };
26302
- const { method, path: path26, query, defaultBaseURL } = options;
26303
- const url = this.buildURL(path26, query, defaultBaseURL);
26438
+ const { method, path: path27, query, defaultBaseURL } = options;
26439
+ const url = this.buildURL(path27, query, defaultBaseURL);
26304
26440
  if ("timeout" in options)
26305
26441
  validatePositiveInteger("timeout", options.timeout);
26306
26442
  options.timeout = options.timeout ?? this.timeout;
@@ -27425,12 +27561,12 @@ var init_browser = __esm({
27425
27561
  });
27426
27562
 
27427
27563
  // ../../node_modules/.pnpm/ollama@0.5.18/node_modules/ollama/dist/index.mjs
27428
- var import_node_fs7, import_node_path9, Ollama2, index;
27564
+ var import_node_fs8, import_node_path10, Ollama2, index;
27429
27565
  var init_dist = __esm({
27430
27566
  "../../node_modules/.pnpm/ollama@0.5.18/node_modules/ollama/dist/index.mjs"() {
27431
27567
  "use strict";
27432
- import_node_fs7 = __toESM(require("fs"), 1);
27433
- import_node_path9 = require("path");
27568
+ import_node_fs8 = __toESM(require("fs"), 1);
27569
+ import_node_path10 = require("path");
27434
27570
  init_browser();
27435
27571
  init_fetch();
27436
27572
  Ollama2 = class extends Ollama$1 {
@@ -27439,8 +27575,8 @@ var init_dist = __esm({
27439
27575
  return Buffer.from(image).toString("base64");
27440
27576
  }
27441
27577
  try {
27442
- if (import_node_fs7.default.existsSync(image)) {
27443
- const fileBuffer = await import_node_fs7.promises.readFile((0, import_node_path9.resolve)(image));
27578
+ if (import_node_fs8.default.existsSync(image)) {
27579
+ const fileBuffer = await import_node_fs8.promises.readFile((0, import_node_path10.resolve)(image));
27444
27580
  return Buffer.from(fileBuffer).toString("base64");
27445
27581
  }
27446
27582
  } catch {
@@ -27453,16 +27589,16 @@ var init_dist = __esm({
27453
27589
  * @private @internal
27454
27590
  * @returns {Promise<boolean>} - Whether the file exists or not
27455
27591
  */
27456
- async fileExists(path26) {
27592
+ async fileExists(path27) {
27457
27593
  try {
27458
- await import_node_fs7.promises.access(path26);
27594
+ await import_node_fs8.promises.access(path27);
27459
27595
  return true;
27460
27596
  } catch {
27461
27597
  return false;
27462
27598
  }
27463
27599
  }
27464
27600
  async create(request) {
27465
- if (request.from && await this.fileExists((0, import_node_path9.resolve)(request.from))) {
27601
+ if (request.from && await this.fileExists((0, import_node_path10.resolve)(request.from))) {
27466
27602
  throw Error("Creating with a local path is not currently supported from ollama-js");
27467
27603
  }
27468
27604
  if (request.stream) {
@@ -32072,16 +32208,16 @@ function headerDelayMs(response) {
32072
32208
  }
32073
32209
  return void 0;
32074
32210
  }
32075
- function getLocalEmbeddingCacheDir(model = LOCAL_EMBEDDING_MODEL, cacheRoot = import_node_path10.default.join(import_node_os3.default.homedir(), ".openez", "models")) {
32211
+ function getLocalEmbeddingCacheDir(model = LOCAL_EMBEDDING_MODEL, cacheRoot = import_node_path11.default.join(import_node_os3.default.homedir(), ".openez", "models")) {
32076
32212
  const spec = getLocalEmbeddingSpec(model);
32077
32213
  if (!spec) throw new Error("Unknown local embedding model '" + model + "'");
32078
- return import_node_path10.default.join(cacheRoot, "astanguyen", model, spec.revision);
32214
+ return import_node_path11.default.join(cacheRoot, "astanguyen", model, spec.revision);
32079
32215
  }
32080
32216
  function hashBytes(bytes) {
32081
32217
  return import_node_crypto9.default.createHash("sha256").update(bytes).digest("hex");
32082
32218
  }
32083
32219
  async function downloadFile(url, target, expectedHash) {
32084
- await (0, import_promises7.mkdir)(import_node_path10.default.dirname(target), { recursive: true });
32220
+ await (0, import_promises7.mkdir)(import_node_path11.default.dirname(target), { recursive: true });
32085
32221
  try {
32086
32222
  const existing = await (0, import_promises7.readFile)(target);
32087
32223
  if (hashBytes(existing) === expectedHash) return;
@@ -32103,7 +32239,7 @@ async function downloadFile(url, target, expectedHash) {
32103
32239
  }
32104
32240
  const bytes = new Uint8Array(await response.arrayBuffer());
32105
32241
  if (hashBytes(bytes) !== expectedHash) {
32106
- throw new Error("Model checksum mismatch for " + import_node_path10.default.basename(target), {
32242
+ throw new Error("Model checksum mismatch for " + import_node_path11.default.basename(target), {
32107
32243
  cause: PERMANENT
32108
32244
  });
32109
32245
  }
@@ -32131,7 +32267,7 @@ async function ensureLocalEmbeddingCache(model = LOCAL_EMBEDDING_MODEL, cacheRoo
32131
32267
  for (const [file, checksum] of Object.entries(spec.files)) {
32132
32268
  await downloadFile(
32133
32269
  "https://huggingface.co/" + spec.repo + "/resolve/" + spec.revision + "/" + file,
32134
- import_node_path10.default.join(cacheDir, file),
32270
+ import_node_path11.default.join(cacheDir, file),
32135
32271
  checksum
32136
32272
  );
32137
32273
  }
@@ -32194,13 +32330,13 @@ async function getLocalEmbeddingModel(model = LOCAL_EMBEDDING_MODEL) {
32194
32330
  providerCache.set(cacheDir, provider);
32195
32331
  return provider;
32196
32332
  }
32197
- var import_node_crypto9, import_node_os3, import_node_path10, import_promises7, LOCAL_EMBEDDING_MODEL, LOCAL_EMBEDDING_REVISION, MODEL_REPO, MODEL_DIMENSIONS, FILES, LOCAL_EMBEDDING_MODELS, cacheLoads, providerCache, PERMANENT, LocalEmbeddingProvider;
32333
+ var import_node_crypto9, import_node_os3, import_node_path11, import_promises7, LOCAL_EMBEDDING_MODEL, LOCAL_EMBEDDING_REVISION, MODEL_REPO, MODEL_DIMENSIONS, FILES, LOCAL_EMBEDDING_MODELS, cacheLoads, providerCache, PERMANENT, LocalEmbeddingProvider;
32198
32334
  var init_local_embedding = __esm({
32199
32335
  "../../packages/core/src/local-embedding.ts"() {
32200
32336
  "use strict";
32201
32337
  import_node_crypto9 = __toESM(require("crypto"), 1);
32202
32338
  import_node_os3 = __toESM(require("os"), 1);
32203
- import_node_path10 = __toESM(require("path"), 1);
32339
+ import_node_path11 = __toESM(require("path"), 1);
32204
32340
  import_promises7 = require("fs/promises");
32205
32341
  LOCAL_EMBEDDING_MODEL = "jina-code-static-256";
32206
32342
  LOCAL_EMBEDDING_REVISION = "b4459b817b536239ebbf8e29ff487fea4b16f3f7";
@@ -32240,8 +32376,8 @@ var init_local_embedding = __esm({
32240
32376
  try {
32241
32377
  const dir = this.cacheDir ?? await ensureLocalEmbeddingCache();
32242
32378
  const [tokenizerJson, matrix] = await Promise.all([
32243
- (0, import_promises7.readFile)(import_node_path10.default.join(dir, "tokenizer.json"), "utf8"),
32244
- loadEmbeddingMatrix(import_node_path10.default.join(dir, "model.safetensors"))
32379
+ (0, import_promises7.readFile)(import_node_path11.default.join(dir, "tokenizer.json"), "utf8"),
32380
+ loadEmbeddingMatrix(import_node_path11.default.join(dir, "model.safetensors"))
32245
32381
  ]);
32246
32382
  if (matrix.length % MODEL_DIMENSIONS !== 0) {
32247
32383
  throw new Error("Local embedding matrix has invalid dimensions");
@@ -32719,8 +32855,8 @@ function parseEmbedding(value) {
32719
32855
  return [];
32720
32856
  }
32721
32857
  }
32722
- function isCodeFile(path26) {
32723
- return /\.(ts|tsx|js|jsx|mjs|cjs|mts|cts|py|go|rs)$/.test(path26);
32858
+ function isCodeFile(path27) {
32859
+ return /\.(ts|tsx|js|jsx|mjs|cjs|mts|cts|py|go|rs)$/.test(path27);
32724
32860
  }
32725
32861
  async function rankStoredEmbeddings(rootPath, provider, queryEmbedding, limit2) {
32726
32862
  if (queryEmbedding.length === 0) return [];
@@ -32742,13 +32878,13 @@ async function rankStoredEmbeddings(rootPath, provider, queryEmbedding, limit2)
32742
32878
  );
32743
32879
  const seenPaths = /* @__PURE__ */ new Set();
32744
32880
  return results.map((row) => {
32745
- const path26 = String(row.path);
32881
+ const path27 = String(row.path);
32746
32882
  const baseScore = cosineSimilarity(queryEmbedding, parseEmbedding(row.embedding));
32747
32883
  return {
32748
32884
  id: String(row.id),
32749
- path: path26,
32885
+ path: path27,
32750
32886
  content: String(row.content),
32751
- score: isCodeFile(path26) ? baseScore + CODE_FILE_BOOST : baseScore,
32887
+ score: isCodeFile(path27) ? baseScore + CODE_FILE_BOOST : baseScore,
32752
32888
  heading: row.heading ? String(row.heading) : null,
32753
32889
  metadata: safeParseJson2(String(row.metadata ?? "{}"), {})
32754
32890
  };
@@ -33050,7 +33186,7 @@ function codeSearchText(text2) {
33050
33186
  return Array.from(unique2).join(" ");
33051
33187
  }
33052
33188
  function inferDocumentKind(filePath) {
33053
- const extension = import_node_path11.default.extname(filePath).toLowerCase();
33189
+ const extension = import_node_path12.default.extname(filePath).toLowerCase();
33054
33190
  if (markdownExtensions.has(extension)) {
33055
33191
  return { kind: "markdown", language: "markdown", extension };
33056
33192
  }
@@ -33917,11 +34053,11 @@ function makeFallbackChunks(content, lines, counter = exactTokenCounter) {
33917
34053
  callExpressions: []
33918
34054
  };
33919
34055
  }
33920
- var import_node_path11, codeExtensions, configExtensions, styleExtensions, templateExtensions, scriptExtensions, markdownExtensions, PYTHON_CALL_IGNORES, GO_CALL_IGNORES, RUST_CALL_IGNORES;
34056
+ var import_node_path12, codeExtensions, configExtensions, styleExtensions, templateExtensions, scriptExtensions, markdownExtensions, PYTHON_CALL_IGNORES, GO_CALL_IGNORES, RUST_CALL_IGNORES;
33921
34057
  var init_languages = __esm({
33922
34058
  "../../packages/indexer/src/languages.ts"() {
33923
34059
  "use strict";
33924
- import_node_path11 = __toESM(require("path"), 1);
34060
+ import_node_path12 = __toESM(require("path"), 1);
33925
34061
  init_src3();
33926
34062
  init_hash();
33927
34063
  codeExtensions = /* @__PURE__ */ new Map([
@@ -34815,16 +34951,16 @@ function resolveWebTreeSitterWasm() {
34815
34951
  resolvePackageFile("web-tree-sitter", "web-tree-sitter.wasm")
34816
34952
  ];
34817
34953
  for (const candidate of candidates) {
34818
- if (candidate && import_node_fs8.default.existsSync(candidate)) return candidate;
34954
+ if (candidate && import_node_fs9.default.existsSync(candidate)) return candidate;
34819
34955
  }
34820
34956
  return null;
34821
34957
  }
34822
34958
  function resolveGrammarWasm(language) {
34823
34959
  const fileName = `tree-sitter-${language}.wasm`;
34824
34960
  const grammarPath = resolvePackageFile(`tree-sitter-${language}`, fileName);
34825
- if (grammarPath && import_node_fs8.default.existsSync(grammarPath)) return grammarPath;
34961
+ if (grammarPath && import_node_fs9.default.existsSync(grammarPath)) return grammarPath;
34826
34962
  const wasmsPath = resolvePackageFile("tree-sitter-wasms", `out/${fileName}`);
34827
- if (wasmsPath && import_node_fs8.default.existsSync(wasmsPath)) return wasmsPath;
34963
+ if (wasmsPath && import_node_fs9.default.existsSync(wasmsPath)) return wasmsPath;
34828
34964
  return null;
34829
34965
  }
34830
34966
  async function ensureInit() {
@@ -34833,9 +34969,9 @@ async function ensureInit() {
34833
34969
  const wasmPath = resolveWebTreeSitterWasm();
34834
34970
  const moduleOptions = {};
34835
34971
  if (wasmPath) {
34836
- const wasmDir = import_node_path12.default.dirname(wasmPath);
34837
- const wasmBase = import_node_path12.default.basename(wasmPath);
34838
- moduleOptions.locateFile = (file) => file === wasmBase || file === "tree-sitter.wasm" ? wasmPath : import_node_path12.default.join(wasmDir, file);
34972
+ const wasmDir = import_node_path13.default.dirname(wasmPath);
34973
+ const wasmBase = import_node_path13.default.basename(wasmPath);
34974
+ moduleOptions.locateFile = (file) => file === wasmBase || file === "tree-sitter.wasm" ? wasmPath : import_node_path13.default.join(wasmDir, file);
34839
34975
  }
34840
34976
  await import_web_tree_sitter.Parser.init(moduleOptions);
34841
34977
  })();
@@ -34880,13 +35016,13 @@ async function parseContent(language, content) {
34880
35016
  parser.delete();
34881
35017
  }
34882
35018
  }
34883
- var import_node_fs8, import_node_module2, import_node_path12, import_web_tree_sitter, import_meta3, _require2, initPromise, languageCache, languageLoadPromises;
35019
+ var import_node_fs9, import_node_module2, import_node_path13, import_web_tree_sitter, import_meta3, _require2, initPromise, languageCache, languageLoadPromises;
34884
35020
  var init_loader = __esm({
34885
35021
  "../../packages/indexer/src/tree-sitter/loader.ts"() {
34886
35022
  "use strict";
34887
- import_node_fs8 = __toESM(require("fs"), 1);
35023
+ import_node_fs9 = __toESM(require("fs"), 1);
34888
35024
  import_node_module2 = __toESM(require("module"), 1);
34889
- import_node_path12 = __toESM(require("path"), 1);
35025
+ import_node_path13 = __toESM(require("path"), 1);
34890
35026
  import_web_tree_sitter = require("web-tree-sitter");
34891
35027
  import_meta3 = {};
34892
35028
  _require2 = typeof __non_webpack_require__ === "function" ? __non_webpack_require__ : import_node_module2.default.createRequire(getRequireUrl2());
@@ -35836,7 +35972,7 @@ var require_path = __commonJS({
35836
35972
  Object.defineProperty(exports2, "__esModule", { value: true });
35837
35973
  exports2.convertPosixPathToPattern = exports2.convertWindowsPathToPattern = exports2.convertPathToPattern = exports2.escapePosixPath = exports2.escapeWindowsPath = exports2.escape = exports2.removeLeadingDotSegment = exports2.makeAbsolute = exports2.unixify = void 0;
35838
35974
  var os10 = require("os");
35839
- var path26 = require("path");
35975
+ var path27 = require("path");
35840
35976
  var IS_WINDOWS_PLATFORM = os10.platform() === "win32";
35841
35977
  var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
35842
35978
  var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
@@ -35848,7 +35984,7 @@ var require_path = __commonJS({
35848
35984
  }
35849
35985
  exports2.unixify = unixify;
35850
35986
  function makeAbsolute(cwd, filepath) {
35851
- return path26.resolve(cwd, filepath);
35987
+ return path27.resolve(cwd, filepath);
35852
35988
  }
35853
35989
  exports2.makeAbsolute = makeAbsolute;
35854
35990
  function removeLeadingDotSegment(entry) {
@@ -37147,7 +37283,7 @@ var require_braces = __commonJS({
37147
37283
  var require_constants4 = __commonJS({
37148
37284
  "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports2, module4) {
37149
37285
  "use strict";
37150
- var path26 = require("path");
37286
+ var path27 = require("path");
37151
37287
  var WIN_SLASH = "\\\\/";
37152
37288
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
37153
37289
  var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
@@ -37321,7 +37457,7 @@ var require_constants4 = __commonJS({
37321
37457
  /* | */
37322
37458
  CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
37323
37459
  /* \uFEFF */
37324
- SEP: path26.sep,
37460
+ SEP: path27.sep,
37325
37461
  /**
37326
37462
  * Create EXTGLOB_CHARS
37327
37463
  */
@@ -37348,7 +37484,7 @@ var require_constants4 = __commonJS({
37348
37484
  var require_utils2 = __commonJS({
37349
37485
  "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports2) {
37350
37486
  "use strict";
37351
- var path26 = require("path");
37487
+ var path27 = require("path");
37352
37488
  var win32 = process.platform === "win32";
37353
37489
  var {
37354
37490
  REGEX_BACKSLASH,
@@ -37377,7 +37513,7 @@ var require_utils2 = __commonJS({
37377
37513
  if (options && typeof options.windows === "boolean") {
37378
37514
  return options.windows;
37379
37515
  }
37380
- return win32 === true || path26.sep === "\\";
37516
+ return win32 === true || path27.sep === "\\";
37381
37517
  };
37382
37518
  exports2.escapeLast = (input, char, lastIdx) => {
37383
37519
  const idx = input.lastIndexOf(char, lastIdx);
@@ -38741,7 +38877,7 @@ var require_parse2 = __commonJS({
38741
38877
  var require_picomatch = __commonJS({
38742
38878
  "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports2, module4) {
38743
38879
  "use strict";
38744
- var path26 = require("path");
38880
+ var path27 = require("path");
38745
38881
  var scan = require_scan();
38746
38882
  var parse4 = require_parse2();
38747
38883
  var utils = require_utils2();
@@ -38826,7 +38962,7 @@ var require_picomatch = __commonJS({
38826
38962
  };
38827
38963
  picomatch2.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
38828
38964
  const regex2 = glob instanceof RegExp ? glob : picomatch2.makeRe(glob, options);
38829
- return regex2.test(path26.basename(input));
38965
+ return regex2.test(path27.basename(input));
38830
38966
  };
38831
38967
  picomatch2.isMatch = (str2, patterns, options) => picomatch2(patterns, options)(str2);
38832
38968
  picomatch2.parse = (pattern, options) => {
@@ -39053,7 +39189,7 @@ var require_pattern = __commonJS({
39053
39189
  "use strict";
39054
39190
  Object.defineProperty(exports2, "__esModule", { value: true });
39055
39191
  exports2.isAbsolute = exports2.partitionAbsoluteAndRelative = exports2.removeDuplicateSlashes = exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
39056
- var path26 = require("path");
39192
+ var path27 = require("path");
39057
39193
  var globParent = require_glob_parent();
39058
39194
  var micromatch = require_micromatch();
39059
39195
  var GLOBSTAR = "**";
@@ -39148,7 +39284,7 @@ var require_pattern = __commonJS({
39148
39284
  }
39149
39285
  exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
39150
39286
  function isAffectDepthOfReadingPattern(pattern) {
39151
- const basename3 = path26.basename(pattern);
39287
+ const basename3 = path27.basename(pattern);
39152
39288
  return endsWithSlashGlobStar(pattern) || isStaticPattern(basename3);
39153
39289
  }
39154
39290
  exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
@@ -39206,7 +39342,7 @@ var require_pattern = __commonJS({
39206
39342
  }
39207
39343
  exports2.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
39208
39344
  function isAbsolute2(pattern) {
39209
- return path26.isAbsolute(pattern);
39345
+ return path27.isAbsolute(pattern);
39210
39346
  }
39211
39347
  exports2.isAbsolute = isAbsolute2;
39212
39348
  }
@@ -39381,10 +39517,10 @@ var require_utils3 = __commonJS({
39381
39517
  exports2.array = array2;
39382
39518
  var errno = require_errno();
39383
39519
  exports2.errno = errno;
39384
- var fs23 = require_fs();
39385
- exports2.fs = fs23;
39386
- var path26 = require_path();
39387
- exports2.path = path26;
39520
+ var fs24 = require_fs();
39521
+ exports2.fs = fs24;
39522
+ var path27 = require_path();
39523
+ exports2.path = path27;
39388
39524
  var pattern = require_pattern();
39389
39525
  exports2.pattern = pattern;
39390
39526
  var stream = require_stream();
@@ -39496,8 +39632,8 @@ var require_async = __commonJS({
39496
39632
  "use strict";
39497
39633
  Object.defineProperty(exports2, "__esModule", { value: true });
39498
39634
  exports2.read = void 0;
39499
- function read(path26, settings2, callback) {
39500
- settings2.fs.lstat(path26, (lstatError, lstat3) => {
39635
+ function read(path27, settings2, callback) {
39636
+ settings2.fs.lstat(path27, (lstatError, lstat3) => {
39501
39637
  if (lstatError !== null) {
39502
39638
  callFailureCallback(callback, lstatError);
39503
39639
  return;
@@ -39506,7 +39642,7 @@ var require_async = __commonJS({
39506
39642
  callSuccessCallback(callback, lstat3);
39507
39643
  return;
39508
39644
  }
39509
- settings2.fs.stat(path26, (statError, stat4) => {
39645
+ settings2.fs.stat(path27, (statError, stat4) => {
39510
39646
  if (statError !== null) {
39511
39647
  if (settings2.throwErrorOnBrokenSymbolicLink) {
39512
39648
  callFailureCallback(callback, statError);
@@ -39538,13 +39674,13 @@ var require_sync = __commonJS({
39538
39674
  "use strict";
39539
39675
  Object.defineProperty(exports2, "__esModule", { value: true });
39540
39676
  exports2.read = void 0;
39541
- function read(path26, settings2) {
39542
- const lstat3 = settings2.fs.lstatSync(path26);
39677
+ function read(path27, settings2) {
39678
+ const lstat3 = settings2.fs.lstatSync(path27);
39543
39679
  if (!lstat3.isSymbolicLink() || !settings2.followSymbolicLink) {
39544
39680
  return lstat3;
39545
39681
  }
39546
39682
  try {
39547
- const stat4 = settings2.fs.statSync(path26);
39683
+ const stat4 = settings2.fs.statSync(path27);
39548
39684
  if (settings2.markSymbolicLink) {
39549
39685
  stat4.isSymbolicLink = () => true;
39550
39686
  }
@@ -39566,12 +39702,12 @@ var require_fs2 = __commonJS({
39566
39702
  "use strict";
39567
39703
  Object.defineProperty(exports2, "__esModule", { value: true });
39568
39704
  exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
39569
- var fs23 = require("fs");
39705
+ var fs24 = require("fs");
39570
39706
  exports2.FILE_SYSTEM_ADAPTER = {
39571
- lstat: fs23.lstat,
39572
- stat: fs23.stat,
39573
- lstatSync: fs23.lstatSync,
39574
- statSync: fs23.statSync
39707
+ lstat: fs24.lstat,
39708
+ stat: fs24.stat,
39709
+ lstatSync: fs24.lstatSync,
39710
+ statSync: fs24.statSync
39575
39711
  };
39576
39712
  function createFileSystemAdapter(fsMethods) {
39577
39713
  if (fsMethods === void 0) {
@@ -39588,12 +39724,12 @@ var require_settings = __commonJS({
39588
39724
  "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
39589
39725
  "use strict";
39590
39726
  Object.defineProperty(exports2, "__esModule", { value: true });
39591
- var fs23 = require_fs2();
39727
+ var fs24 = require_fs2();
39592
39728
  var Settings = class {
39593
39729
  constructor(_options = {}) {
39594
39730
  this._options = _options;
39595
39731
  this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
39596
- this.fs = fs23.createFileSystemAdapter(this._options.fs);
39732
+ this.fs = fs24.createFileSystemAdapter(this._options.fs);
39597
39733
  this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
39598
39734
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
39599
39735
  }
@@ -39615,17 +39751,17 @@ var require_out = __commonJS({
39615
39751
  var sync = require_sync();
39616
39752
  var settings_1 = require_settings();
39617
39753
  exports2.Settings = settings_1.default;
39618
- function stat4(path26, optionsOrSettingsOrCallback, callback) {
39754
+ function stat4(path27, optionsOrSettingsOrCallback, callback) {
39619
39755
  if (typeof optionsOrSettingsOrCallback === "function") {
39620
- async.read(path26, getSettings(), optionsOrSettingsOrCallback);
39756
+ async.read(path27, getSettings(), optionsOrSettingsOrCallback);
39621
39757
  return;
39622
39758
  }
39623
- async.read(path26, getSettings(optionsOrSettingsOrCallback), callback);
39759
+ async.read(path27, getSettings(optionsOrSettingsOrCallback), callback);
39624
39760
  }
39625
39761
  exports2.stat = stat4;
39626
- function statSync2(path26, optionsOrSettings) {
39762
+ function statSync2(path27, optionsOrSettings) {
39627
39763
  const settings2 = getSettings(optionsOrSettings);
39628
- return sync.read(path26, settings2);
39764
+ return sync.read(path27, settings2);
39629
39765
  }
39630
39766
  exports2.statSync = statSync2;
39631
39767
  function getSettings(settingsOrOptions = {}) {
@@ -39750,8 +39886,8 @@ var require_utils4 = __commonJS({
39750
39886
  "use strict";
39751
39887
  Object.defineProperty(exports2, "__esModule", { value: true });
39752
39888
  exports2.fs = void 0;
39753
- var fs23 = require_fs3();
39754
- exports2.fs = fs23;
39889
+ var fs24 = require_fs3();
39890
+ exports2.fs = fs24;
39755
39891
  }
39756
39892
  });
39757
39893
 
@@ -39843,16 +39979,16 @@ var require_async2 = __commonJS({
39843
39979
  return;
39844
39980
  }
39845
39981
  const tasks = names.map((name) => {
39846
- const path26 = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
39982
+ const path27 = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
39847
39983
  return (done) => {
39848
- fsStat.stat(path26, settings2.fsStatSettings, (error2, stats) => {
39984
+ fsStat.stat(path27, settings2.fsStatSettings, (error2, stats) => {
39849
39985
  if (error2 !== null) {
39850
39986
  done(error2);
39851
39987
  return;
39852
39988
  }
39853
39989
  const entry = {
39854
39990
  name,
39855
- path: path26,
39991
+ path: path27,
39856
39992
  dirent: utils.fs.createDirentFromStats(name, stats)
39857
39993
  };
39858
39994
  if (settings2.stats) {
@@ -39946,14 +40082,14 @@ var require_fs4 = __commonJS({
39946
40082
  "use strict";
39947
40083
  Object.defineProperty(exports2, "__esModule", { value: true });
39948
40084
  exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
39949
- var fs23 = require("fs");
40085
+ var fs24 = require("fs");
39950
40086
  exports2.FILE_SYSTEM_ADAPTER = {
39951
- lstat: fs23.lstat,
39952
- stat: fs23.stat,
39953
- lstatSync: fs23.lstatSync,
39954
- statSync: fs23.statSync,
39955
- readdir: fs23.readdir,
39956
- readdirSync: fs23.readdirSync
40087
+ lstat: fs24.lstat,
40088
+ stat: fs24.stat,
40089
+ lstatSync: fs24.lstatSync,
40090
+ statSync: fs24.statSync,
40091
+ readdir: fs24.readdir,
40092
+ readdirSync: fs24.readdirSync
39957
40093
  };
39958
40094
  function createFileSystemAdapter(fsMethods) {
39959
40095
  if (fsMethods === void 0) {
@@ -39970,15 +40106,15 @@ var require_settings2 = __commonJS({
39970
40106
  "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
39971
40107
  "use strict";
39972
40108
  Object.defineProperty(exports2, "__esModule", { value: true });
39973
- var path26 = require("path");
40109
+ var path27 = require("path");
39974
40110
  var fsStat = require_out();
39975
- var fs23 = require_fs4();
40111
+ var fs24 = require_fs4();
39976
40112
  var Settings = class {
39977
40113
  constructor(_options = {}) {
39978
40114
  this._options = _options;
39979
40115
  this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
39980
- this.fs = fs23.createFileSystemAdapter(this._options.fs);
39981
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path26.sep);
40116
+ this.fs = fs24.createFileSystemAdapter(this._options.fs);
40117
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path27.sep);
39982
40118
  this.stats = this._getValue(this._options.stats, false);
39983
40119
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
39984
40120
  this.fsStatSettings = new fsStat.Settings({
@@ -40005,17 +40141,17 @@ var require_out2 = __commonJS({
40005
40141
  var sync = require_sync2();
40006
40142
  var settings_1 = require_settings2();
40007
40143
  exports2.Settings = settings_1.default;
40008
- function scandir(path26, optionsOrSettingsOrCallback, callback) {
40144
+ function scandir(path27, optionsOrSettingsOrCallback, callback) {
40009
40145
  if (typeof optionsOrSettingsOrCallback === "function") {
40010
- async.read(path26, getSettings(), optionsOrSettingsOrCallback);
40146
+ async.read(path27, getSettings(), optionsOrSettingsOrCallback);
40011
40147
  return;
40012
40148
  }
40013
- async.read(path26, getSettings(optionsOrSettingsOrCallback), callback);
40149
+ async.read(path27, getSettings(optionsOrSettingsOrCallback), callback);
40014
40150
  }
40015
40151
  exports2.scandir = scandir;
40016
- function scandirSync(path26, optionsOrSettings) {
40152
+ function scandirSync(path27, optionsOrSettings) {
40017
40153
  const settings2 = getSettings(optionsOrSettings);
40018
- return sync.read(path26, settings2);
40154
+ return sync.read(path27, settings2);
40019
40155
  }
40020
40156
  exports2.scandirSync = scandirSync;
40021
40157
  function getSettings(settingsOrOptions = {}) {
@@ -40662,7 +40798,7 @@ var require_settings3 = __commonJS({
40662
40798
  "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
40663
40799
  "use strict";
40664
40800
  Object.defineProperty(exports2, "__esModule", { value: true });
40665
- var path26 = require("path");
40801
+ var path27 = require("path");
40666
40802
  var fsScandir = require_out2();
40667
40803
  var Settings = class {
40668
40804
  constructor(_options = {}) {
@@ -40672,7 +40808,7 @@ var require_settings3 = __commonJS({
40672
40808
  this.deepFilter = this._getValue(this._options.deepFilter, null);
40673
40809
  this.entryFilter = this._getValue(this._options.entryFilter, null);
40674
40810
  this.errorFilter = this._getValue(this._options.errorFilter, null);
40675
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path26.sep);
40811
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path27.sep);
40676
40812
  this.fsScandirSettings = new fsScandir.Settings({
40677
40813
  followSymbolicLinks: this._options.followSymbolicLinks,
40678
40814
  fs: this._options.fs,
@@ -40734,7 +40870,7 @@ var require_reader2 = __commonJS({
40734
40870
  "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js"(exports2) {
40735
40871
  "use strict";
40736
40872
  Object.defineProperty(exports2, "__esModule", { value: true });
40737
- var path26 = require("path");
40873
+ var path27 = require("path");
40738
40874
  var fsStat = require_out();
40739
40875
  var utils = require_utils3();
40740
40876
  var Reader = class {
@@ -40747,7 +40883,7 @@ var require_reader2 = __commonJS({
40747
40883
  });
40748
40884
  }
40749
40885
  _getFullEntryPath(filepath) {
40750
- return path26.resolve(this._settings.cwd, filepath);
40886
+ return path27.resolve(this._settings.cwd, filepath);
40751
40887
  }
40752
40888
  _makeEntry(stats, pattern) {
40753
40889
  const entry = {
@@ -41163,7 +41299,7 @@ var require_provider = __commonJS({
41163
41299
  "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js"(exports2) {
41164
41300
  "use strict";
41165
41301
  Object.defineProperty(exports2, "__esModule", { value: true });
41166
- var path26 = require("path");
41302
+ var path27 = require("path");
41167
41303
  var deep_1 = require_deep();
41168
41304
  var entry_1 = require_entry();
41169
41305
  var error_1 = require_error2();
@@ -41177,7 +41313,7 @@ var require_provider = __commonJS({
41177
41313
  this.entryTransformer = new entry_2.default(this._settings);
41178
41314
  }
41179
41315
  _getRootDirectory(task) {
41180
- return path26.resolve(this._settings.cwd, task.base);
41316
+ return path27.resolve(this._settings.cwd, task.base);
41181
41317
  }
41182
41318
  _getReaderOptions(task) {
41183
41319
  const basePath = task.base === "." ? "" : task.base;
@@ -41358,16 +41494,16 @@ var require_settings4 = __commonJS({
41358
41494
  "use strict";
41359
41495
  Object.defineProperty(exports2, "__esModule", { value: true });
41360
41496
  exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
41361
- var fs23 = require("fs");
41497
+ var fs24 = require("fs");
41362
41498
  var os10 = require("os");
41363
41499
  var CPU_COUNT = Math.max(os10.cpus().length, 1);
41364
41500
  exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
41365
- lstat: fs23.lstat,
41366
- lstatSync: fs23.lstatSync,
41367
- stat: fs23.stat,
41368
- statSync: fs23.statSync,
41369
- readdir: fs23.readdir,
41370
- readdirSync: fs23.readdirSync
41501
+ lstat: fs24.lstat,
41502
+ lstatSync: fs24.lstatSync,
41503
+ stat: fs24.stat,
41504
+ statSync: fs24.statSync,
41505
+ readdir: fs24.readdir,
41506
+ readdirSync: fs24.readdirSync
41371
41507
  };
41372
41508
  var Settings = class {
41373
41509
  constructor(_options = {}) {
@@ -41768,8 +41904,8 @@ var require_utils5 = __commonJS({
41768
41904
  }
41769
41905
  return output;
41770
41906
  };
41771
- exports2.basename = (path26, { windows } = {}) => {
41772
- const segs = path26.split(windows ? /[\\/]/ : "/");
41907
+ exports2.basename = (path27, { windows } = {}) => {
41908
+ const segs = path27.split(windows ? /[\\/]/ : "/");
41773
41909
  const last = segs[segs.length - 1];
41774
41910
  if (last === "") {
41775
41911
  return segs[segs.length - 2];
@@ -43282,10 +43418,10 @@ var require_picomatch4 = __commonJS({
43282
43418
 
43283
43419
  // ../../packages/indexer/src/scanner.ts
43284
43420
  function loadGitignore(rootPath) {
43285
- const gitignorePath = import_node_path13.default.join(rootPath, ".gitignore");
43286
- if (!(0, import_node_fs9.existsSync)(gitignorePath)) return [];
43421
+ const gitignorePath = import_node_path14.default.join(rootPath, ".gitignore");
43422
+ if (!(0, import_node_fs10.existsSync)(gitignorePath)) return [];
43287
43423
  try {
43288
- const content = (0, import_node_fs9.readFileSync)(gitignorePath, "utf8");
43424
+ const content = (0, import_node_fs10.readFileSync)(gitignorePath, "utf8");
43289
43425
  if (!content) return [];
43290
43426
  return content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#")).flatMap((pattern) => {
43291
43427
  const hasSlash = pattern.replace(/\/$/, "").includes("/");
@@ -43300,7 +43436,7 @@ function loadGitignore(rootPath) {
43300
43436
  }
43301
43437
  }
43302
43438
  async function scanWorkspaceFiles(input) {
43303
- const rootPath = import_node_path13.default.resolve(input.rootPath);
43439
+ const rootPath = import_node_path14.default.resolve(input.rootPath);
43304
43440
  const gitignorePatterns = loadGitignore(rootPath);
43305
43441
  const ignorePatterns = [
43306
43442
  ...DEFAULT_EXCLUDE_PATTERNS,
@@ -43350,7 +43486,7 @@ async function scanWorkspaceFiles(input) {
43350
43486
  const stat4 = await import_promises8.default.stat(absolutePath);
43351
43487
  return {
43352
43488
  absolutePath,
43353
- relativePath: import_node_path13.default.relative(rootPath, absolutePath),
43489
+ relativePath: import_node_path14.default.relative(rootPath, absolutePath),
43354
43490
  sizeBytes: stat4.size,
43355
43491
  mtimeMs: Math.trunc(stat4.mtimeMs)
43356
43492
  };
@@ -43358,14 +43494,14 @@ async function scanWorkspaceFiles(input) {
43358
43494
  );
43359
43495
  return results.sort((left, right) => left.relativePath.localeCompare(right.relativePath));
43360
43496
  }
43361
- var import_fast_glob, import_promises8, import_node_path13, import_node_fs9, import_picomatch, DEFAULT_INCLUDE_PATTERNS, ALLOWED_EXTENSIONS, DEFAULT_EXCLUDE_PATTERNS;
43497
+ var import_fast_glob, import_promises8, import_node_path14, import_node_fs10, import_picomatch, DEFAULT_INCLUDE_PATTERNS, ALLOWED_EXTENSIONS, DEFAULT_EXCLUDE_PATTERNS;
43362
43498
  var init_scanner = __esm({
43363
43499
  "../../packages/indexer/src/scanner.ts"() {
43364
43500
  "use strict";
43365
43501
  import_fast_glob = __toESM(require_out4(), 1);
43366
43502
  import_promises8 = __toESM(require("fs/promises"), 1);
43367
- import_node_path13 = __toESM(require("path"), 1);
43368
- import_node_fs9 = require("fs");
43503
+ import_node_path14 = __toESM(require("path"), 1);
43504
+ import_node_fs10 = require("fs");
43369
43505
  import_picomatch = __toESM(require_picomatch4(), 1);
43370
43506
  init_languages();
43371
43507
  DEFAULT_INCLUDE_PATTERNS = [
@@ -43417,7 +43553,7 @@ function indexLeaseExpiry() {
43417
43553
  function resolveNativeParser() {
43418
43554
  if (_nativeParser !== void 0) return _nativeParser;
43419
43555
  try {
43420
- const nativePath = import_node_path14.default.join(__dirname, "native", "index.linux-x64-gnu.node");
43556
+ const nativePath = import_node_path15.default.join(__dirname, "native", "index.linux-x64-gnu.node");
43421
43557
  _nativeParser = require(nativePath);
43422
43558
  } catch {
43423
43559
  try {
@@ -43435,29 +43571,29 @@ function parserVersionFor(parserName) {
43435
43571
  return PARSER_VERSION_OXC;
43436
43572
  }
43437
43573
  function normalizeRelativePath(filePath) {
43438
- return filePath.split(import_node_path14.default.sep).join("/");
43574
+ return filePath.split(import_node_path15.default.sep).join("/");
43439
43575
  }
43440
43576
  function createWorkspaceFileResolver(workspaceRoot, files) {
43441
43577
  const knownRelativePaths = new Set(files.map((file) => normalizeRelativePath(file.relativePath)));
43442
43578
  const absoluteToRelative = new Map(
43443
43579
  files.map((file) => [
43444
- import_node_path14.default.resolve(file.absolutePath),
43580
+ import_node_path15.default.resolve(file.absolutePath),
43445
43581
  normalizeRelativePath(file.relativePath)
43446
43582
  ])
43447
43583
  );
43448
43584
  function toWorkspaceRelative(candidateAbsolutePath) {
43449
- const resolvedAbsolute = import_node_path14.default.resolve(candidateAbsolutePath);
43585
+ const resolvedAbsolute = import_node_path15.default.resolve(candidateAbsolutePath);
43450
43586
  const mapped = absoluteToRelative.get(resolvedAbsolute);
43451
43587
  if (mapped) return mapped;
43452
43588
  const relativeToWorkspace = normalizeRelativePath(
43453
- import_node_path14.default.relative(workspaceRoot, resolvedAbsolute)
43589
+ import_node_path15.default.relative(workspaceRoot, resolvedAbsolute)
43454
43590
  );
43455
43591
  if (relativeToWorkspace.startsWith("../")) return null;
43456
43592
  return knownRelativePaths.has(relativeToWorkspace) ? relativeToWorkspace : null;
43457
43593
  }
43458
43594
  function resolveRelativeImport(importerRelativePath, importPath) {
43459
- const importerDirectory = import_node_path14.default.dirname(import_node_path14.default.resolve(workspaceRoot, importerRelativePath));
43460
- const baseCandidate = import_node_path14.default.resolve(importerDirectory, importPath);
43595
+ const importerDirectory = import_node_path15.default.dirname(import_node_path15.default.resolve(workspaceRoot, importerRelativePath));
43596
+ const baseCandidate = import_node_path15.default.resolve(importerDirectory, importPath);
43461
43597
  const directMatch = toWorkspaceRelative(baseCandidate);
43462
43598
  if (directMatch) return directMatch;
43463
43599
  for (const extension of RESOLVABLE_SOURCE_EXTENSIONS) {
@@ -43465,7 +43601,7 @@ function createWorkspaceFileResolver(workspaceRoot, files) {
43465
43601
  if (withExtension) return withExtension;
43466
43602
  }
43467
43603
  for (const extension of RESOLVABLE_SOURCE_EXTENSIONS) {
43468
- const asIndexFile = toWorkspaceRelative(import_node_path14.default.join(baseCandidate, `index${extension}`));
43604
+ const asIndexFile = toWorkspaceRelative(import_node_path15.default.join(baseCandidate, `index${extension}`));
43469
43605
  if (asIndexFile) return asIndexFile;
43470
43606
  }
43471
43607
  return null;
@@ -43483,11 +43619,11 @@ function createWorkspaceFileResolver(workspaceRoot, files) {
43483
43619
  if (!dotMatch) return null;
43484
43620
  const level = dotMatch[1].length;
43485
43621
  const remainder = dotMatch[2].replace(/^\./, "");
43486
- let baseDirectory = normalizeRelativePath(import_node_path14.default.dirname(importerRelativePath));
43622
+ let baseDirectory = normalizeRelativePath(import_node_path15.default.dirname(importerRelativePath));
43487
43623
  for (let index2 = 1; index2 < level; index2++) {
43488
- baseDirectory = normalizeRelativePath(import_node_path14.default.dirname(baseDirectory));
43624
+ baseDirectory = normalizeRelativePath(import_node_path15.default.dirname(baseDirectory));
43489
43625
  }
43490
- const modulePath = remainder ? normalizeRelativePath(import_node_path14.default.join(baseDirectory, remainder.replace(/\./g, "/"))) : baseDirectory;
43626
+ const modulePath = remainder ? normalizeRelativePath(import_node_path15.default.join(baseDirectory, remainder.replace(/\./g, "/"))) : baseDirectory;
43491
43627
  return resolvePythonModulePath(modulePath);
43492
43628
  }
43493
43629
  function resolvePythonImport(importerRelativePath, importPath) {
@@ -43690,7 +43826,7 @@ async function indexWorkspace(input) {
43690
43826
  workspace = w;
43691
43827
  } else if (input.rootPath) {
43692
43828
  workspace = await activeRegistry.ensureWorkspace({
43693
- rootPath: import_node_path14.default.resolve(input.rootPath)
43829
+ rootPath: import_node_path15.default.resolve(input.rootPath)
43694
43830
  });
43695
43831
  } else {
43696
43832
  throw new Error("Either workspaceId or rootPath is required");
@@ -43732,7 +43868,7 @@ async function indexWorkspace(input) {
43732
43868
  const settings2 = await getBrainSettings(workspace.rootPath);
43733
43869
  const config2 = await loadBrainConfig(workspace.rootPath);
43734
43870
  const configuredWorkspace = config2.workspaces?.find(
43735
- (candidate) => candidate.id === workspace.id || import_node_path14.default.resolve(candidate.root) === import_node_path14.default.resolve(workspace.rootPath)
43871
+ (candidate) => candidate.id === workspace.id || import_node_path15.default.resolve(candidate.root) === import_node_path15.default.resolve(workspace.rootPath)
43736
43872
  );
43737
43873
  const includeGlobs = workspace.includeGlobs || configuredWorkspace?.include.join("\n") || "";
43738
43874
  const excludeGlobs = workspace.excludeGlobs || configuredWorkspace?.exclude.join("\n") || "";
@@ -43763,13 +43899,13 @@ async function indexWorkspace(input) {
43763
43899
  await assertIndexingLease();
43764
43900
  const existingDocuments = await repo.listDocuments();
43765
43901
  const existingDocumentsByPath = new Map(
43766
- existingDocuments.map((document) => [document.path, document])
43902
+ existingDocuments.map((document) => [normalizeRelativePath(document.path), document])
43767
43903
  );
43768
43904
  if (runMode === "incremental") {
43769
- const scannedPaths = new Set(files.map((file) => file.relativePath));
43905
+ const scannedPaths = new Set(files.map((file) => normalizeRelativePath(file.relativePath)));
43770
43906
  let deletedAny = false;
43771
43907
  for (const document of existingDocuments) {
43772
- if (!scannedPaths.has(document.path)) {
43908
+ if (!scannedPaths.has(normalizeRelativePath(document.path))) {
43773
43909
  await resetDocumentArtifacts(repo, document.id);
43774
43910
  await repo.deleteDocument(document.id);
43775
43911
  deletedAny = true;
@@ -43802,7 +43938,9 @@ async function indexWorkspace(input) {
43802
43938
  const parseTasks = [];
43803
43939
  const filesToRead = [];
43804
43940
  for (const file of files) {
43805
- const existingDocument = existingDocumentsByPath.get(file.relativePath);
43941
+ const existingDocument = existingDocumentsByPath.get(
43942
+ normalizeRelativePath(file.relativePath)
43943
+ );
43806
43944
  const statUnchanged = runMode === "incremental" && !forceRechunk && existingDocument && existingDocument.mtimeMs === file.mtimeMs && existingDocument.sizeBytes === file.sizeBytes;
43807
43945
  if (!statUnchanged) {
43808
43946
  filesToRead.push(file);
@@ -43834,7 +43972,9 @@ async function indexWorkspace(input) {
43834
43972
  for (const file of filesToRead) {
43835
43973
  const content = fileContents.get(file.relativePath);
43836
43974
  const contentHash = hashContent(content);
43837
- const existingDocument = existingDocumentsByPath.get(file.relativePath);
43975
+ const existingDocument = existingDocumentsByPath.get(
43976
+ normalizeRelativePath(file.relativePath)
43977
+ );
43838
43978
  const unchanged = runMode === "incremental" && !forceRechunk && existingDocument && existingDocument.contentHash === contentHash;
43839
43979
  if (unchanged) {
43840
43980
  await repo.updateDocument(existingDocument.id, {
@@ -43889,7 +44029,9 @@ async function indexWorkspace(input) {
43889
44029
  for (const file of parseTasks) {
43890
44030
  const indexed = parseResults.get(file.id);
43891
44031
  const contentHash = hashContent(file.content);
43892
- const existingDocument = existingDocumentsByPath.get(file.relativePath);
44032
+ const existingDocument = existingDocumentsByPath.get(
44033
+ normalizeRelativePath(file.relativePath)
44034
+ );
43893
44035
  if (existingDocument) {
43894
44036
  await resetChangedFileArtifacts(repo, existingDocument.id, file.relativePath);
43895
44037
  await repo.updateDocument(existingDocument.id, {
@@ -43900,10 +44042,10 @@ async function indexWorkspace(input) {
43900
44042
  sizeBytes: file.sizeBytes,
43901
44043
  mtimeMs: file.mtimeMs
43902
44044
  });
43903
- docIdMap.set(file.relativePath, existingDocument.id);
44045
+ docIdMap.set(normalizeRelativePath(file.relativePath), existingDocument.id);
43904
44046
  } else {
43905
44047
  newDocs.push({
43906
- path: file.relativePath,
44048
+ path: normalizeRelativePath(file.relativePath),
43907
44049
  absolutePath: file.absolutePath,
43908
44050
  kind: indexed.kind,
43909
44051
  language: indexed.language,
@@ -43925,7 +44067,7 @@ async function indexWorkspace(input) {
43925
44067
  const chunkFileMap = [];
43926
44068
  for (const file of parseTasks) {
43927
44069
  const indexed = parseResults.get(file.id);
43928
- const documentId = docIdMap.get(file.relativePath);
44070
+ const documentId = docIdMap.get(normalizeRelativePath(file.relativePath));
43929
44071
  for (let ci = 0; ci < indexed.chunks.length; ci++) {
43930
44072
  const chunk = indexed.chunks[ci];
43931
44073
  allChunkInputs.push({
@@ -43976,7 +44118,7 @@ async function indexWorkspace(input) {
43976
44118
  for (let fi = 0; fi < parseTasks.length; fi++) {
43977
44119
  const file = parseTasks[fi];
43978
44120
  const indexed = parseResults.get(file.id);
43979
- const documentId = docIdMap.get(file.relativePath);
44121
+ const documentId = docIdMap.get(normalizeRelativePath(file.relativePath));
43980
44122
  const contentHash = hashContent(file.content);
43981
44123
  repo.insertParsedDocument({
43982
44124
  documentId,
@@ -44117,7 +44259,7 @@ async function buildGraphGeneration(_workspaceId, rootPath, _generation, buildEp
44117
44259
  const published2 = repo.replaceGraphArtifacts({ buildEpoch, nodes: [], edges: [] });
44118
44260
  return { nodeCount: 0, edgeCount: 0, published: published2 };
44119
44261
  }
44120
- const fs23 = await import("fs/promises");
44262
+ const fs24 = await import("fs/promises");
44121
44263
  const NATIVE_LANGS = /* @__PURE__ */ new Set(["python", "go", "rust"]);
44122
44264
  const nativeDocs = [];
44123
44265
  const registryDocs = [];
@@ -44146,7 +44288,7 @@ async function buildGraphGeneration(_workspaceId, rootPath, _generation, buildEp
44146
44288
  continue;
44147
44289
  }
44148
44290
  try {
44149
- const content = await fs23.readFile(doc.absolutePath, "utf8");
44291
+ const content = await fs24.readFile(doc.absolutePath, "utf8");
44150
44292
  const parsed = await parseDocument({
44151
44293
  relativePath: doc.path,
44152
44294
  absolutePath: doc.absolutePath,
@@ -44202,7 +44344,7 @@ async function buildGraphGeneration(_workspaceId, rootPath, _generation, buildEp
44202
44344
  const batchDocPaths = [];
44203
44345
  for (const doc of nativeToParse) {
44204
44346
  try {
44205
- const content = await fs23.readFile(doc.absolutePath, "utf8");
44347
+ const content = await fs24.readFile(doc.absolutePath, "utf8");
44206
44348
  const lang = doc.language ?? inferDocumentKind(doc.path).language ?? "text";
44207
44349
  batchItems.push({ language: lang, content });
44208
44350
  batchDocPaths.push(doc.path);
@@ -44249,7 +44391,7 @@ async function buildGraphGeneration(_workspaceId, rootPath, _generation, buildEp
44249
44391
  for (const doc of nativeToParse) {
44250
44392
  if (parsedFiles.has(doc.path)) continue;
44251
44393
  try {
44252
- const content = await fs23.readFile(doc.absolutePath, "utf8");
44394
+ const content = await fs24.readFile(doc.absolutePath, "utf8");
44253
44395
  const parsed = await parseDocument({
44254
44396
  relativePath: doc.path,
44255
44397
  absolutePath: doc.absolutePath,
@@ -44419,13 +44561,13 @@ async function buildGraphGeneration(_workspaceId, rootPath, _generation, buildEp
44419
44561
  );
44420
44562
  return { nodeCount: allNodeInputs.length, edgeCount: uniqueEdges.length, published };
44421
44563
  }
44422
- var import_node_crypto11, import_promises9, import_node_path14, RESOLVABLE_SOURCE_EXTENSIONS, PARSER_VERSION_OXC, PARSER_VERSION_NATIVE, PARSER_VERSION_FALLBACK, INDEX_LEASE_DURATION_MS, INDEX_HEARTBEAT_INTERVAL_MS, _nativeParser, _ftsBuildingWorkspaces;
44564
+ var import_node_crypto11, import_promises9, import_node_path15, RESOLVABLE_SOURCE_EXTENSIONS, PARSER_VERSION_OXC, PARSER_VERSION_NATIVE, PARSER_VERSION_FALLBACK, INDEX_LEASE_DURATION_MS, INDEX_HEARTBEAT_INTERVAL_MS, _nativeParser, _ftsBuildingWorkspaces;
44423
44565
  var init_index_workspace = __esm({
44424
44566
  "../../packages/indexer/src/index-workspace.ts"() {
44425
44567
  "use strict";
44426
44568
  import_node_crypto11 = __toESM(require("crypto"), 1);
44427
44569
  import_promises9 = __toESM(require("fs/promises"), 1);
44428
- import_node_path14 = __toESM(require("path"), 1);
44570
+ import_node_path15 = __toESM(require("path"), 1);
44429
44571
  init_src2();
44430
44572
  init_src3();
44431
44573
  init_src();
@@ -44579,7 +44721,7 @@ async function resolveWorkspace2(input) {
44579
44721
  return workspace;
44580
44722
  }
44581
44723
  if (input.rootPath) {
44582
- return registry2.ensureWorkspace({ rootPath: import_node_path15.default.resolve(input.rootPath) });
44724
+ return registry2.ensureWorkspace({ rootPath: import_node_path16.default.resolve(input.rootPath) });
44583
44725
  }
44584
44726
  throw new Error("Either workspaceId or rootPath is required");
44585
44727
  }
@@ -44629,11 +44771,11 @@ async function embedWorkspace(input) {
44629
44771
  embeddingFailures: result.failedBatches
44630
44772
  };
44631
44773
  }
44632
- var import_node_path15;
44774
+ var import_node_path16;
44633
44775
  var init_embed_workspace = __esm({
44634
44776
  "../../packages/indexer/src/embed-workspace.ts"() {
44635
44777
  "use strict";
44636
- import_node_path15 = __toESM(require("path"), 1);
44778
+ import_node_path16 = __toESM(require("path"), 1);
44637
44779
  init_src3();
44638
44780
  init_src();
44639
44781
  init_hash();
@@ -45005,10 +45147,10 @@ function assignProp(target, prop, value) {
45005
45147
  configurable: true
45006
45148
  });
45007
45149
  }
45008
- function getElementAtPath(obj, path26) {
45009
- if (!path26)
45150
+ function getElementAtPath(obj, path27) {
45151
+ if (!path27)
45010
45152
  return obj;
45011
- return path26.reduce((acc, key) => acc?.[key], obj);
45153
+ return path27.reduce((acc, key) => acc?.[key], obj);
45012
45154
  }
45013
45155
  function promiseAllObject(promisesObj) {
45014
45156
  const keys = Object.keys(promisesObj);
@@ -45257,11 +45399,11 @@ function aborted(x, startIndex = 0) {
45257
45399
  }
45258
45400
  return false;
45259
45401
  }
45260
- function prefixIssues(path26, issues) {
45402
+ function prefixIssues(path27, issues) {
45261
45403
  return issues.map((iss) => {
45262
45404
  var _a3;
45263
45405
  (_a3 = iss).path ?? (_a3.path = []);
45264
- iss.path.unshift(path26);
45406
+ iss.path.unshift(path27);
45265
45407
  return iss;
45266
45408
  });
45267
45409
  }
@@ -55007,8 +55149,8 @@ var require_utils6 = __commonJS({
55007
55149
  }
55008
55150
  return ind;
55009
55151
  }
55010
- function removeDotSegments(path26) {
55011
- let input = path26;
55152
+ function removeDotSegments(path27) {
55153
+ let input = path27;
55012
55154
  const output = [];
55013
55155
  let nextSlash = -1;
55014
55156
  let len2 = 0;
@@ -55260,8 +55402,8 @@ var require_schemes = __commonJS({
55260
55402
  wsComponent.secure = void 0;
55261
55403
  }
55262
55404
  if (wsComponent.resourceName) {
55263
- const [path26, query] = wsComponent.resourceName.split("?");
55264
- wsComponent.path = path26 && path26 !== "/" ? path26 : void 0;
55405
+ const [path27, query] = wsComponent.resourceName.split("?");
55406
+ wsComponent.path = path27 && path27 !== "/" ? path27 : void 0;
55265
55407
  wsComponent.query = query;
55266
55408
  wsComponent.resourceName = void 0;
55267
55409
  }
@@ -58660,12 +58802,12 @@ var require_dist = __commonJS({
58660
58802
  throw new Error(`Unknown format "${name}"`);
58661
58803
  return f;
58662
58804
  };
58663
- function addFormats(ajv, list, fs23, exportName) {
58805
+ function addFormats(ajv, list, fs24, exportName) {
58664
58806
  var _a3;
58665
58807
  var _b;
58666
58808
  (_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
58667
58809
  for (const f of list)
58668
- ajv.addFormat(f, fs23[f]);
58810
+ ajv.addFormat(f, fs24[f]);
58669
58811
  }
58670
58812
  module4.exports = exports2 = formatsPlugin;
58671
58813
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -59527,7 +59669,7 @@ function dedupeById(items) {
59527
59669
  });
59528
59670
  }
59529
59671
  function createWorkspaceResolver(options) {
59530
- const defaultPath = options?.defaultPath ? import_node_path16.default.resolve(options.defaultPath) : void 0;
59672
+ const defaultPath = options?.defaultPath ? import_node_path17.default.resolve(options.defaultPath) : void 0;
59531
59673
  async function resolveWorkspaceById(workspaceId) {
59532
59674
  const registry2 = createRegistryRepository();
59533
59675
  const workspace = await registry2.getWorkspace(workspaceId);
@@ -59538,10 +59680,10 @@ function createWorkspaceResolver(options) {
59538
59680
  }
59539
59681
  async function resolveWorkspaceByPath(searchPath) {
59540
59682
  const registry2 = createRegistryRepository();
59541
- const workspace = await registry2.getWorkspaceByPath(import_node_path16.default.resolve(searchPath));
59683
+ const workspace = await registry2.getWorkspaceByPath(import_node_path17.default.resolve(searchPath));
59542
59684
  if (!workspace) {
59543
59685
  throw new Error(
59544
- `No workspace registered at ${import_node_path16.default.resolve(searchPath)}. Run 'openez init <path>' or pass a registered workspaceId.`
59686
+ `No workspace registered at ${import_node_path17.default.resolve(searchPath)}. Run 'openez init <path>' or pass a registered workspaceId.`
59545
59687
  );
59546
59688
  }
59547
59689
  return workspace;
@@ -59556,7 +59698,7 @@ function createWorkspaceResolver(options) {
59556
59698
  return workspace;
59557
59699
  }
59558
59700
  }
59559
- const byPath = await registry2.getWorkspaceByPath(import_node_path16.default.resolve(searchRoot));
59701
+ const byPath = await registry2.getWorkspaceByPath(import_node_path17.default.resolve(searchRoot));
59560
59702
  if (byPath) {
59561
59703
  return byPath;
59562
59704
  }
@@ -59870,6 +60012,21 @@ function createMcpServer(options) {
59870
60012
  required: []
59871
60013
  }
59872
60014
  },
60015
+ {
60016
+ name: "code_outline",
60017
+ description: "Inspect the AST structure, functions, classes, and exported symbols of a file with line numbers (50 tokens vs 3,000 for reading the whole file).",
60018
+ inputSchema: {
60019
+ type: "object",
60020
+ properties: {
60021
+ workspaceId: { type: "string", description: "ID of a registered workspace" },
60022
+ path: {
60023
+ type: "string",
60024
+ description: "Relative or absolute path to the file inside the workspace"
60025
+ }
60026
+ },
60027
+ required: ["path"]
60028
+ }
60029
+ },
59873
60030
  {
59874
60031
  name: "remove_workspace",
59875
60032
  description: "Remove a workspace from the registry and delete its .openez data directory. Destructive and irreversible: call only with confirm: true after explicit user approval.",
@@ -60105,7 +60262,7 @@ ${result.answerContext}`
60105
60262
  }
60106
60263
  const report = await removeWorkspace({
60107
60264
  id: input.workspaceId,
60108
- rootPath: input.path ? import_node_path16.default.resolve(input.path) : void 0
60265
+ rootPath: input.path ? import_node_path17.default.resolve(input.path) : void 0
60109
60266
  });
60110
60267
  if (!report) {
60111
60268
  return jsonResponse({
@@ -60117,6 +60274,27 @@ ${result.answerContext}`
60117
60274
  stopWatcherForWorkspace(report.workspaceId);
60118
60275
  return jsonResponse(report);
60119
60276
  }
60277
+ case "code_outline": {
60278
+ const input = codeOutlineSchema.parse(request.params.arguments ?? {});
60279
+ const targetPath = input.path;
60280
+ const workspaces2 = await resolver.resolveReadWorkspaces({
60281
+ workspaceId: input.workspaceId
60282
+ });
60283
+ const workspace = workspaces2[0];
60284
+ if (!workspace) {
60285
+ return jsonResponse({ error: "No registered workspace found." });
60286
+ }
60287
+ await catchUpWorkspaceIndex(workspace.id);
60288
+ const repo = createWorkspaceRepository(workspace.rootPath);
60289
+ const outline = await repo.getFileOutline(targetPath);
60290
+ if (!outline) {
60291
+ return jsonResponse({
60292
+ error: `File not found in index: '${targetPath}'. Ensure the file exists and is indexed.`,
60293
+ path: targetPath
60294
+ });
60295
+ }
60296
+ return jsonResponse(outline);
60297
+ }
60120
60298
  default:
60121
60299
  throw new Error(`Unknown tool: ${request.params.name}`);
60122
60300
  }
@@ -60131,8 +60309,8 @@ async function createAndStartMcpServer(options) {
60131
60309
  await server.connect(transport);
60132
60310
  }
60133
60311
  async function autoIndexAndSync(searchRoot) {
60134
- const resolvedRoot = import_node_path16.default.resolve(searchRoot);
60135
- if (!import_node_fs10.default.existsSync(resolvedRoot) || !import_node_fs10.default.statSync(resolvedRoot).isDirectory()) {
60312
+ const resolvedRoot = import_node_path17.default.resolve(searchRoot);
60313
+ if (!import_node_fs11.default.existsSync(resolvedRoot) || !import_node_fs11.default.statSync(resolvedRoot).isDirectory()) {
60136
60314
  return;
60137
60315
  }
60138
60316
  const registry2 = createRegistryRepository();
@@ -60191,12 +60369,12 @@ function stopWatcherForWorkspace(workspaceId) {
60191
60369
  activeWatcher = null;
60192
60370
  }
60193
60371
  }
60194
- var import_node_fs10, import_node_path16, MIN_RESPONSE_TOKENS, codeQuerySchema, codeContextSchema, graphNeighborsSchema, memoryWriteSchema, memoryRecallSchema, indexWorkspaceSchema, removeWorkspaceSchema, MCP_CATCHUP_INTERVAL_MS, catchupState, activeWatcher, WATCH_DEBOUNCE_MS, WATCH_ENABLED, WATCH_IGNORE_PATTERNS;
60372
+ var import_node_fs11, import_node_path17, MIN_RESPONSE_TOKENS, codeQuerySchema, codeContextSchema, graphNeighborsSchema, memoryWriteSchema, memoryRecallSchema, indexWorkspaceSchema, codeOutlineSchema, removeWorkspaceSchema, MCP_CATCHUP_INTERVAL_MS, catchupState, activeWatcher, WATCH_DEBOUNCE_MS, WATCH_ENABLED, WATCH_IGNORE_PATTERNS;
60195
60373
  var init_mcp_core = __esm({
60196
60374
  "../mcp/src/mcp-core.ts"() {
60197
60375
  "use strict";
60198
- import_node_fs10 = __toESM(require("fs"), 1);
60199
- import_node_path16 = __toESM(require("path"), 1);
60376
+ import_node_fs11 = __toESM(require("fs"), 1);
60377
+ import_node_path17 = __toESM(require("path"), 1);
60200
60378
  init_esm2();
60201
60379
  init_server2();
60202
60380
  init_stdio2();
@@ -60259,6 +60437,10 @@ var init_mcp_core = __esm({
60259
60437
  path: external_exports.string().optional(),
60260
60438
  mode: external_exports.enum(["incremental", "full"]).optional()
60261
60439
  });
60440
+ codeOutlineSchema = external_exports.object({
60441
+ workspaceId: external_exports.string().optional(),
60442
+ path: external_exports.string().trim().min(1)
60443
+ });
60262
60444
  removeWorkspaceSchema = external_exports.object({
60263
60445
  workspaceId: external_exports.string().optional(),
60264
60446
  path: external_exports.string().optional(),
@@ -60290,7 +60472,7 @@ __export(mcp_bridge_exports, {
60290
60472
  startMcpServer: () => startMcpServer
60291
60473
  });
60292
60474
  async function startMcpServer(defaultPath, version4) {
60293
- await createAndStartMcpServer({ defaultPath, version: version4, build: "5060798-dirty" });
60475
+ await createAndStartMcpServer({ defaultPath, version: version4, build: "16a46af-dirty" });
60294
60476
  }
60295
60477
  var init_mcp_bridge = __esm({
60296
60478
  "src/mcp-bridge.ts"() {
@@ -61643,14 +61825,14 @@ var init_mime = __esm({
61643
61825
  });
61644
61826
 
61645
61827
  // ../../node_modules/.pnpm/@hono+node-server@2.0.12_hono@4.12.33/node_modules/@hono/node-server/dist/serve-static.mjs
61646
- var import_node_fs11, import_node_path17, COMPRESSIBLE_CONTENT_TYPE_REGEX, ENCODINGS, ENCODINGS_ORDERED_KEYS, getStats, BYTE_RANGE_PATTERN, parseByteRange, resolveByteRange, tryDecode, tryDecodeURI, serveStatic;
61828
+ var import_node_fs12, import_node_path18, COMPRESSIBLE_CONTENT_TYPE_REGEX, ENCODINGS, ENCODINGS_ORDERED_KEYS, getStats, BYTE_RANGE_PATTERN, parseByteRange, resolveByteRange, tryDecode, tryDecodeURI, serveStatic;
61647
61829
  var init_serve_static = __esm({
61648
61830
  "../../node_modules/.pnpm/@hono+node-server@2.0.12_hono@4.12.33/node_modules/@hono/node-server/dist/serve-static.mjs"() {
61649
61831
  "use strict";
61650
61832
  init_stream();
61651
61833
  init_mime();
61652
- import_node_fs11 = require("fs");
61653
- import_node_path17 = require("path");
61834
+ import_node_fs12 = require("fs");
61835
+ import_node_path18 = require("path");
61654
61836
  COMPRESSIBLE_CONTENT_TYPE_REGEX = /^\s*(?:text\/[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|wasm|x-httpd-php|x-javascript|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml))(?:[;\s]|$)/i;
61655
61837
  ENCODINGS = {
61656
61838
  br: ".br",
@@ -61658,10 +61840,10 @@ var init_serve_static = __esm({
61658
61840
  gzip: ".gz"
61659
61841
  };
61660
61842
  ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS);
61661
- getStats = (path26) => {
61843
+ getStats = (path27) => {
61662
61844
  let stats;
61663
61845
  try {
61664
- stats = (0, import_node_fs11.statSync)(path26);
61846
+ stats = (0, import_node_fs12.statSync)(path27);
61665
61847
  } catch {
61666
61848
  }
61667
61849
  return stats;
@@ -61718,7 +61900,7 @@ var init_serve_static = __esm({
61718
61900
  serveStatic = (options = { root: "" }) => {
61719
61901
  const root = options.root || "";
61720
61902
  const optionPath = options.path;
61721
- if (root !== "" && !(0, import_node_fs11.existsSync)(root)) console.error(`serveStatic: root path '${root}' is not found, are you sure it's correct?`);
61903
+ if (root !== "" && !(0, import_node_fs12.existsSync)(root)) console.error(`serveStatic: root path '${root}' is not found, are you sure it's correct?`);
61722
61904
  return async (c, next) => {
61723
61905
  if (c.finalized) return next();
61724
61906
  let filename;
@@ -61730,29 +61912,29 @@ var init_serve_static = __esm({
61730
61912
  await options.onNotFound?.(c.req.path, c);
61731
61913
  return next();
61732
61914
  }
61733
- let path26 = (0, import_node_path17.join)(root, !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename, c) : filename);
61734
- let stats = getStats(path26);
61915
+ let path27 = (0, import_node_path18.join)(root, !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename, c) : filename);
61916
+ let stats = getStats(path27);
61735
61917
  if (stats && stats.isDirectory()) {
61736
61918
  const indexFile = options.index ?? "index.html";
61737
- path26 = (0, import_node_path17.join)(path26, indexFile);
61738
- stats = getStats(path26);
61919
+ path27 = (0, import_node_path18.join)(path27, indexFile);
61920
+ stats = getStats(path27);
61739
61921
  }
61740
61922
  if (!stats) {
61741
- await options.onNotFound?.(path26, c);
61923
+ await options.onNotFound?.(path27, c);
61742
61924
  return next();
61743
61925
  }
61744
- const mimeType = getMimeType(path26);
61926
+ const mimeType = getMimeType(path27);
61745
61927
  c.header("Content-Type", mimeType || "application/octet-stream");
61746
61928
  if (options.precompressed && (!mimeType || mimeType === "application/octet-stream" || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) {
61747
61929
  const acceptEncodingSet = new Set(c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()));
61748
61930
  for (const encoding of ENCODINGS_ORDERED_KEYS) {
61749
61931
  if (!acceptEncodingSet.has(encoding)) continue;
61750
- const precompressedStats = getStats(path26 + ENCODINGS[encoding]);
61932
+ const precompressedStats = getStats(path27 + ENCODINGS[encoding]);
61751
61933
  if (precompressedStats) {
61752
61934
  c.header("Content-Encoding", encoding);
61753
61935
  c.header("Vary", "Accept-Encoding", { append: true });
61754
61936
  stats = precompressedStats;
61755
- path26 = path26 + ENCODINGS[encoding];
61937
+ path27 = path27 + ENCODINGS[encoding];
61756
61938
  break;
61757
61939
  }
61758
61940
  }
@@ -61767,7 +61949,7 @@ var init_serve_static = __esm({
61767
61949
  result = c.body(null);
61768
61950
  } else if (!range) {
61769
61951
  c.header("Content-Length", size.toString());
61770
- result = c.body(createStreamBody((0, import_node_fs11.createReadStream)(path26)), 200);
61952
+ result = c.body(createStreamBody((0, import_node_fs12.createReadStream)(path27)), 200);
61771
61953
  } else {
61772
61954
  c.header("Accept-Ranges", "bytes");
61773
61955
  const resolvedRange = resolveByteRange(parseByteRange(range) ?? {
@@ -61780,7 +61962,7 @@ var init_serve_static = __esm({
61780
61962
  } else {
61781
61963
  const { start, end } = resolvedRange;
61782
61964
  const chunkSize = end - start + 1;
61783
- const stream = (0, import_node_fs11.createReadStream)(path26, {
61965
+ const stream = (0, import_node_fs12.createReadStream)(path27, {
61784
61966
  start,
61785
61967
  end
61786
61968
  });
@@ -61789,7 +61971,7 @@ var init_serve_static = __esm({
61789
61971
  result = c.body(createStreamBody(stream), 206);
61790
61972
  }
61791
61973
  }
61792
- await options.onFound?.(path26, c);
61974
+ await options.onFound?.(path27, c);
61793
61975
  return result;
61794
61976
  };
61795
61977
  };
@@ -61985,26 +62167,26 @@ var splitPath, splitRoutingPath, extractGroupsFromPath, replaceGroupMarks, patte
61985
62167
  var init_url = __esm({
61986
62168
  "../../node_modules/.pnpm/hono@4.12.33/node_modules/hono/dist/utils/url.js"() {
61987
62169
  "use strict";
61988
- splitPath = (path26) => {
61989
- const paths = path26.split("/");
62170
+ splitPath = (path27) => {
62171
+ const paths = path27.split("/");
61990
62172
  if (paths[0] === "") {
61991
62173
  paths.shift();
61992
62174
  }
61993
62175
  return paths;
61994
62176
  };
61995
62177
  splitRoutingPath = (routePath) => {
61996
- const { groups, path: path26 } = extractGroupsFromPath(routePath);
61997
- const paths = splitPath(path26);
62178
+ const { groups, path: path27 } = extractGroupsFromPath(routePath);
62179
+ const paths = splitPath(path27);
61998
62180
  return replaceGroupMarks(paths, groups);
61999
62181
  };
62000
- extractGroupsFromPath = (path26) => {
62182
+ extractGroupsFromPath = (path27) => {
62001
62183
  const groups = [];
62002
- path26 = path26.replace(/\{[^}]+\}/g, (match2, index2) => {
62184
+ path27 = path27.replace(/\{[^}]+\}/g, (match2, index2) => {
62003
62185
  const mark = `@${index2}`;
62004
62186
  groups.push([mark, match2]);
62005
62187
  return mark;
62006
62188
  });
62007
- return { groups, path: path26 };
62189
+ return { groups, path: path27 };
62008
62190
  };
62009
62191
  replaceGroupMarks = (paths, groups) => {
62010
62192
  for (let i = groups.length - 1; i >= 0; i--) {
@@ -62061,8 +62243,8 @@ var init_url = __esm({
62061
62243
  const queryIndex = url.indexOf("?", i);
62062
62244
  const hashIndex = url.indexOf("#", i);
62063
62245
  const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
62064
- const path26 = url.slice(start, end);
62065
- return tryDecodeURI2(path26.includes("%25") ? path26.replace(/%25/g, "%2525") : path26);
62246
+ const path27 = url.slice(start, end);
62247
+ return tryDecodeURI2(path27.includes("%25") ? path27.replace(/%25/g, "%2525") : path27);
62066
62248
  } else if (charCode === 63 || charCode === 35) {
62067
62249
  break;
62068
62250
  }
@@ -62079,11 +62261,11 @@ var init_url = __esm({
62079
62261
  }
62080
62262
  return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
62081
62263
  };
62082
- checkOptionalParameter = (path26) => {
62083
- if (path26.charCodeAt(path26.length - 1) !== 63 || !path26.includes(":")) {
62264
+ checkOptionalParameter = (path27) => {
62265
+ if (path27.charCodeAt(path27.length - 1) !== 63 || !path27.includes(":")) {
62084
62266
  return null;
62085
62267
  }
62086
- const segments = path26.split("/");
62268
+ const segments = path27.split("/");
62087
62269
  const results = [];
62088
62270
  let basePath = "";
62089
62271
  segments.forEach((segment) => {
@@ -62234,9 +62416,9 @@ var init_request = __esm({
62234
62416
  */
62235
62417
  path;
62236
62418
  bodyCache = {};
62237
- constructor(request, path26 = "/", matchResult = [[]]) {
62419
+ constructor(request, path27 = "/", matchResult = [[]]) {
62238
62420
  this.raw = request;
62239
- this.path = path26;
62421
+ this.path = path27;
62240
62422
  this.#matchResult = matchResult;
62241
62423
  this.#validatedData = {};
62242
62424
  }
@@ -63025,8 +63207,8 @@ var init_hono_base = __esm({
63025
63207
  return this;
63026
63208
  };
63027
63209
  });
63028
- this.on = (method, path26, ...handlers) => {
63029
- for (const p of [path26].flat()) {
63210
+ this.on = (method, path27, ...handlers) => {
63211
+ for (const p of [path27].flat()) {
63030
63212
  this.#path = p;
63031
63213
  for (const m of [method].flat()) {
63032
63214
  handlers.map((handler) => {
@@ -63083,8 +63265,8 @@ var init_hono_base = __esm({
63083
63265
  * app.route("/api", app2) // GET /api/user
63084
63266
  * ```
63085
63267
  */
63086
- route(path26, app2) {
63087
- const subApp = this.basePath(path26);
63268
+ route(path27, app2) {
63269
+ const subApp = this.basePath(path27);
63088
63270
  app2.routes.map((r) => {
63089
63271
  let handler;
63090
63272
  if (app2.errorHandler === errorHandler) {
@@ -63110,9 +63292,9 @@ var init_hono_base = __esm({
63110
63292
  * const api = new Hono().basePath('/api')
63111
63293
  * ```
63112
63294
  */
63113
- basePath(path26) {
63295
+ basePath(path27) {
63114
63296
  const subApp = this.#clone();
63115
- subApp._basePath = mergePath(this._basePath, path26);
63297
+ subApp._basePath = mergePath(this._basePath, path27);
63116
63298
  return subApp;
63117
63299
  }
63118
63300
  /**
@@ -63186,7 +63368,7 @@ var init_hono_base = __esm({
63186
63368
  * })
63187
63369
  * ```
63188
63370
  */
63189
- mount(path26, applicationHandler, options) {
63371
+ mount(path27, applicationHandler, options) {
63190
63372
  let replaceRequest;
63191
63373
  let optionHandler;
63192
63374
  if (options) {
@@ -63213,7 +63395,7 @@ var init_hono_base = __esm({
63213
63395
  return [c.env, executionContext];
63214
63396
  };
63215
63397
  replaceRequest ||= (() => {
63216
- const mergedPath = mergePath(this._basePath, path26);
63398
+ const mergedPath = mergePath(this._basePath, path27);
63217
63399
  const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
63218
63400
  return (request) => {
63219
63401
  const url = new URL(request.url);
@@ -63228,19 +63410,19 @@ var init_hono_base = __esm({
63228
63410
  }
63229
63411
  await next();
63230
63412
  };
63231
- this.#addRoute(METHOD_NAME_ALL, mergePath(path26, "*"), handler);
63413
+ this.#addRoute(METHOD_NAME_ALL, mergePath(path27, "*"), handler);
63232
63414
  return this;
63233
63415
  }
63234
- #addRoute(method, path26, handler, baseRoutePath) {
63416
+ #addRoute(method, path27, handler, baseRoutePath) {
63235
63417
  method = method.toUpperCase();
63236
- path26 = mergePath(this._basePath, path26);
63418
+ path27 = mergePath(this._basePath, path27);
63237
63419
  const r = {
63238
63420
  basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath,
63239
- path: path26,
63421
+ path: path27,
63240
63422
  method,
63241
63423
  handler
63242
63424
  };
63243
- this.router.add(method, path26, [handler, r]);
63425
+ this.router.add(method, path27, [handler, r]);
63244
63426
  this.routes.push(r);
63245
63427
  }
63246
63428
  #handleError(err, c) {
@@ -63253,10 +63435,10 @@ var init_hono_base = __esm({
63253
63435
  if (method === "HEAD") {
63254
63436
  return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, "GET")))();
63255
63437
  }
63256
- const path26 = this.getPath(request, { env });
63257
- const matchResult = this.router.match(method, path26);
63438
+ const path27 = this.getPath(request, { env });
63439
+ const matchResult = this.router.match(method, path27);
63258
63440
  const c = new Context(request, {
63259
- path: path26,
63441
+ path: path27,
63260
63442
  matchResult,
63261
63443
  env,
63262
63444
  executionCtx,
@@ -63357,15 +63539,15 @@ var init_hono_base = __esm({
63357
63539
  });
63358
63540
 
63359
63541
  // ../../node_modules/.pnpm/hono@4.12.33/node_modules/hono/dist/router/reg-exp-router/matcher.js
63360
- function match(method, path26) {
63542
+ function match(method, path27) {
63361
63543
  const matchers = this.buildAllMatchers();
63362
- const match2 = ((method2, path27) => {
63544
+ const match2 = ((method2, path28) => {
63363
63545
  const matcher = matchers[method2] || matchers[METHOD_NAME_ALL];
63364
- const staticMatch = matcher[2][path27];
63546
+ const staticMatch = matcher[2][path28];
63365
63547
  if (staticMatch) {
63366
63548
  return staticMatch;
63367
63549
  }
63368
- const match3 = path27.match(matcher[0]);
63550
+ const match3 = path28.match(matcher[0]);
63369
63551
  if (!match3) {
63370
63552
  return [[], emptyParam];
63371
63553
  }
@@ -63373,7 +63555,7 @@ function match(method, path26) {
63373
63555
  return [matcher[1][index2], match3];
63374
63556
  });
63375
63557
  this.match = match2;
63376
- return match2(method, path26);
63558
+ return match2(method, path27);
63377
63559
  }
63378
63560
  var emptyParam;
63379
63561
  var init_matcher = __esm({
@@ -63507,12 +63689,12 @@ var init_trie = __esm({
63507
63689
  Trie = class {
63508
63690
  #context = { varIndex: 0 };
63509
63691
  #root = new Node2();
63510
- insert(path26, index2, pathErrorCheckOnly) {
63692
+ insert(path27, index2, pathErrorCheckOnly) {
63511
63693
  const paramAssoc = [];
63512
63694
  const groups = [];
63513
63695
  for (let i = 0; ; ) {
63514
63696
  let replaced = false;
63515
- path26 = path26.replace(/\{[^}]+\}/g, (m) => {
63697
+ path27 = path27.replace(/\{[^}]+\}/g, (m) => {
63516
63698
  const mark = `@\\${i}`;
63517
63699
  groups[i] = [mark, m];
63518
63700
  i++;
@@ -63523,7 +63705,7 @@ var init_trie = __esm({
63523
63705
  break;
63524
63706
  }
63525
63707
  }
63526
- const tokens = path26.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
63708
+ const tokens = path27.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
63527
63709
  for (let i = groups.length - 1; i >= 0; i--) {
63528
63710
  const [mark] = groups[i];
63529
63711
  for (let j = tokens.length - 1; j >= 0; j--) {
@@ -63562,9 +63744,9 @@ var init_trie = __esm({
63562
63744
  });
63563
63745
 
63564
63746
  // ../../node_modules/.pnpm/hono@4.12.33/node_modules/hono/dist/router/reg-exp-router/router.js
63565
- function buildWildcardRegExp(path26) {
63566
- return wildcardRegExpCache[path26] ??= new RegExp(
63567
- path26 === "*" ? "" : `^${path26.replace(
63747
+ function buildWildcardRegExp(path27) {
63748
+ return wildcardRegExpCache[path27] ??= new RegExp(
63749
+ path27 === "*" ? "" : `^${path27.replace(
63568
63750
  /\/\*$|([.\\+*[^\]$()])/g,
63569
63751
  (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)"
63570
63752
  )}$`
@@ -63586,17 +63768,17 @@ function buildMatcherFromPreprocessedRoutes(routes) {
63586
63768
  );
63587
63769
  const staticMap = /* @__PURE__ */ Object.create(null);
63588
63770
  for (let i = 0, j = -1, len2 = routesWithStaticPathFlag.length; i < len2; i++) {
63589
- const [pathErrorCheckOnly, path26, handlers] = routesWithStaticPathFlag[i];
63771
+ const [pathErrorCheckOnly, path27, handlers] = routesWithStaticPathFlag[i];
63590
63772
  if (pathErrorCheckOnly) {
63591
- staticMap[path26] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
63773
+ staticMap[path27] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
63592
63774
  } else {
63593
63775
  j++;
63594
63776
  }
63595
63777
  let paramAssoc;
63596
63778
  try {
63597
- paramAssoc = trie.insert(path26, j, pathErrorCheckOnly);
63779
+ paramAssoc = trie.insert(path27, j, pathErrorCheckOnly);
63598
63780
  } catch (e) {
63599
- throw e === PATH_ERROR ? new UnsupportedPathError(path26) : e;
63781
+ throw e === PATH_ERROR ? new UnsupportedPathError(path27) : e;
63600
63782
  }
63601
63783
  if (pathErrorCheckOnly) {
63602
63784
  continue;
@@ -63630,12 +63812,12 @@ function buildMatcherFromPreprocessedRoutes(routes) {
63630
63812
  }
63631
63813
  return [regexp, handlerMap, staticMap];
63632
63814
  }
63633
- function findMiddleware(middleware, path26) {
63815
+ function findMiddleware(middleware, path27) {
63634
63816
  if (!middleware) {
63635
63817
  return void 0;
63636
63818
  }
63637
63819
  for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) {
63638
- if (buildWildcardRegExp(k).test(path26)) {
63820
+ if (buildWildcardRegExp(k).test(path27)) {
63639
63821
  return [...middleware[k]];
63640
63822
  }
63641
63823
  }
@@ -63660,7 +63842,7 @@ var init_router2 = __esm({
63660
63842
  this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
63661
63843
  this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
63662
63844
  }
63663
- add(method, path26, handler) {
63845
+ add(method, path27, handler) {
63664
63846
  const middleware = this.#middleware;
63665
63847
  const routes = this.#routes;
63666
63848
  if (!middleware || !routes) {
@@ -63675,18 +63857,18 @@ var init_router2 = __esm({
63675
63857
  });
63676
63858
  });
63677
63859
  }
63678
- if (path26 === "/*") {
63679
- path26 = "*";
63860
+ if (path27 === "/*") {
63861
+ path27 = "*";
63680
63862
  }
63681
- const paramCount = (path26.match(/\/:/g) || []).length;
63682
- if (/\*$/.test(path26)) {
63683
- const re = buildWildcardRegExp(path26);
63863
+ const paramCount = (path27.match(/\/:/g) || []).length;
63864
+ if (/\*$/.test(path27)) {
63865
+ const re = buildWildcardRegExp(path27);
63684
63866
  if (method === METHOD_NAME_ALL) {
63685
63867
  Object.keys(middleware).forEach((m) => {
63686
- middleware[m][path26] ||= findMiddleware(middleware[m], path26) || findMiddleware(middleware[METHOD_NAME_ALL], path26) || [];
63868
+ middleware[m][path27] ||= findMiddleware(middleware[m], path27) || findMiddleware(middleware[METHOD_NAME_ALL], path27) || [];
63687
63869
  });
63688
63870
  } else {
63689
- middleware[method][path26] ||= findMiddleware(middleware[method], path26) || findMiddleware(middleware[METHOD_NAME_ALL], path26) || [];
63871
+ middleware[method][path27] ||= findMiddleware(middleware[method], path27) || findMiddleware(middleware[METHOD_NAME_ALL], path27) || [];
63690
63872
  }
63691
63873
  Object.keys(middleware).forEach((m) => {
63692
63874
  if (method === METHOD_NAME_ALL || method === m) {
@@ -63704,15 +63886,15 @@ var init_router2 = __esm({
63704
63886
  });
63705
63887
  return;
63706
63888
  }
63707
- const paths = checkOptionalParameter(path26) || [path26];
63889
+ const paths = checkOptionalParameter(path27) || [path27];
63708
63890
  for (let i = 0, len2 = paths.length; i < len2; i++) {
63709
- const path27 = paths[i];
63891
+ const path28 = paths[i];
63710
63892
  Object.keys(routes).forEach((m) => {
63711
63893
  if (method === METHOD_NAME_ALL || method === m) {
63712
- routes[m][path27] ||= [
63713
- ...findMiddleware(middleware[m], path27) || findMiddleware(middleware[METHOD_NAME_ALL], path27) || []
63894
+ routes[m][path28] ||= [
63895
+ ...findMiddleware(middleware[m], path28) || findMiddleware(middleware[METHOD_NAME_ALL], path28) || []
63714
63896
  ];
63715
- routes[m][path27].push([handler, paramCount - len2 + i + 1]);
63897
+ routes[m][path28].push([handler, paramCount - len2 + i + 1]);
63716
63898
  }
63717
63899
  });
63718
63900
  }
@@ -63731,13 +63913,13 @@ var init_router2 = __esm({
63731
63913
  const routes = [];
63732
63914
  let hasOwnRoute = method === METHOD_NAME_ALL;
63733
63915
  [this.#middleware, this.#routes].forEach((r) => {
63734
- const ownRoute = r[method] ? Object.keys(r[method]).map((path26) => [path26, r[method][path26]]) : [];
63916
+ const ownRoute = r[method] ? Object.keys(r[method]).map((path27) => [path27, r[method][path27]]) : [];
63735
63917
  if (ownRoute.length !== 0) {
63736
63918
  hasOwnRoute ||= true;
63737
63919
  routes.push(...ownRoute);
63738
63920
  } else if (method !== METHOD_NAME_ALL) {
63739
63921
  routes.push(
63740
- ...Object.keys(r[METHOD_NAME_ALL]).map((path26) => [path26, r[METHOD_NAME_ALL][path26]])
63922
+ ...Object.keys(r[METHOD_NAME_ALL]).map((path27) => [path27, r[METHOD_NAME_ALL][path27]])
63741
63923
  );
63742
63924
  }
63743
63925
  });
@@ -63783,13 +63965,13 @@ var init_router3 = __esm({
63783
63965
  constructor(init) {
63784
63966
  this.#routers = init.routers;
63785
63967
  }
63786
- add(method, path26, handler) {
63968
+ add(method, path27, handler) {
63787
63969
  if (!this.#routes) {
63788
63970
  throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
63789
63971
  }
63790
- this.#routes.push([method, path26, handler]);
63972
+ this.#routes.push([method, path27, handler]);
63791
63973
  }
63792
- match(method, path26) {
63974
+ match(method, path27) {
63793
63975
  if (!this.#routes) {
63794
63976
  throw new Error("Fatal error");
63795
63977
  }
@@ -63804,7 +63986,7 @@ var init_router3 = __esm({
63804
63986
  for (let i2 = 0, len22 = routes.length; i2 < len22; i2++) {
63805
63987
  router.add(...routes[i2]);
63806
63988
  }
63807
- res = router.match(method, path26);
63989
+ res = router.match(method, path27);
63808
63990
  } catch (e) {
63809
63991
  if (e instanceof UnsupportedPathError) {
63810
63992
  continue;
@@ -63870,10 +64052,10 @@ var init_node2 = __esm({
63870
64052
  }
63871
64053
  this.#patterns = [];
63872
64054
  }
63873
- insert(method, path26, handler) {
64055
+ insert(method, path27, handler) {
63874
64056
  this.#order = ++this.#order;
63875
64057
  let curNode = this;
63876
- const parts = splitRoutingPath(path26);
64058
+ const parts = splitRoutingPath(path27);
63877
64059
  const possibleKeys = [];
63878
64060
  for (let i = 0, len2 = parts.length; i < len2; i++) {
63879
64061
  const p = parts[i];
@@ -63922,12 +64104,12 @@ var init_node2 = __esm({
63922
64104
  }
63923
64105
  }
63924
64106
  }
63925
- search(method, path26) {
64107
+ search(method, path27) {
63926
64108
  const handlerSets = [];
63927
64109
  this.#params = emptyParams;
63928
64110
  const curNode = this;
63929
64111
  let curNodes = [curNode];
63930
- const parts = splitPath(path26);
64112
+ const parts = splitPath(path27);
63931
64113
  const curNodesQueue = [];
63932
64114
  const len2 = parts.length;
63933
64115
  let partOffsets = null;
@@ -63969,13 +64151,13 @@ var init_node2 = __esm({
63969
64151
  if (matcher instanceof RegExp) {
63970
64152
  if (partOffsets === null) {
63971
64153
  partOffsets = new Array(len2);
63972
- let offset = path26[0] === "/" ? 1 : 0;
64154
+ let offset = path27[0] === "/" ? 1 : 0;
63973
64155
  for (let p = 0; p < len2; p++) {
63974
64156
  partOffsets[p] = offset;
63975
64157
  offset += parts[p].length + 1;
63976
64158
  }
63977
64159
  }
63978
- const restPathString = path26.substring(partOffsets[i]);
64160
+ const restPathString = path27.substring(partOffsets[i]);
63979
64161
  const m = matcher.exec(restPathString);
63980
64162
  if (m) {
63981
64163
  params[name] = m[0];
@@ -64045,18 +64227,18 @@ var init_router4 = __esm({
64045
64227
  constructor() {
64046
64228
  this.#node = new Node3();
64047
64229
  }
64048
- add(method, path26, handler) {
64049
- const results = checkOptionalParameter(path26);
64230
+ add(method, path27, handler) {
64231
+ const results = checkOptionalParameter(path27);
64050
64232
  if (results) {
64051
64233
  for (let i = 0, len2 = results.length; i < len2; i++) {
64052
64234
  this.#node.insert(method, results[i], handler);
64053
64235
  }
64054
64236
  return;
64055
64237
  }
64056
- this.#node.insert(method, path26, handler);
64238
+ this.#node.insert(method, path27, handler);
64057
64239
  }
64058
- match(method, path26) {
64059
- return this.#node.search(method, path26);
64240
+ match(method, path27) {
64241
+ return this.#node.search(method, path27);
64060
64242
  }
64061
64243
  };
64062
64244
  }
@@ -64218,9 +64400,9 @@ function slugify(value) {
64218
64400
  return slug2 || "workspace";
64219
64401
  }
64220
64402
  function ensureDirForFile(filePath) {
64221
- const directory = import_node_path18.default.dirname(filePath);
64222
- if (!import_node_fs12.default.existsSync(directory)) {
64223
- import_node_fs12.default.mkdirSync(directory, { recursive: true, mode: 493 });
64403
+ const directory = import_node_path19.default.dirname(filePath);
64404
+ if (!import_node_fs13.default.existsSync(directory)) {
64405
+ import_node_fs13.default.mkdirSync(directory, { recursive: true, mode: 493 });
64224
64406
  }
64225
64407
  }
64226
64408
  function openSqlite(dbPath) {
@@ -64240,7 +64422,7 @@ function resolveRegistryDbPath2() {
64240
64422
  if (!homeDir) {
64241
64423
  throw new Error("Cannot resolve home directory for registry DB path");
64242
64424
  }
64243
- return import_node_path18.default.join(homeDir, ".openez", "registry.sqlite");
64425
+ return import_node_path19.default.join(homeDir, ".openez", "registry.sqlite");
64244
64426
  }
64245
64427
  function initializeRegistrySchema2(db) {
64246
64428
  db.exec(getRegistryDdl());
@@ -64274,7 +64456,7 @@ function closeWorkspaceDb2(rootPath) {
64274
64456
  }
64275
64457
  }
64276
64458
  function resolveWorkspaceDbPath(rootPath) {
64277
- return import_node_path18.default.join(rootPath, ".openez", "index.sqlite");
64459
+ return import_node_path19.default.join(rootPath, ".openez", "index.sqlite");
64278
64460
  }
64279
64461
  function initializeWorkspaceSchema2(db) {
64280
64462
  db.exec(getFullWorkspaceDdl());
@@ -64298,7 +64480,7 @@ function migrateQueryLogColumns2(db) {
64298
64480
  }
64299
64481
  function getWorkspaceDb2(rootPath) {
64300
64482
  const normalized = normalizeRootPath2(rootPath);
64301
- if (normalized === "/" || normalized === "" || !import_node_fs12.default.existsSync(normalized)) {
64483
+ if (normalized === "/" || normalized === "" || !import_node_fs13.default.existsSync(normalized)) {
64302
64484
  throw new Error(`Workspace root path does not exist: "${rootPath}"`);
64303
64485
  }
64304
64486
  const cached2 = workspaceDbs.get(normalized);
@@ -64355,7 +64537,7 @@ function ensureRegistryWorkspace(input) {
64355
64537
  return existing;
64356
64538
  }
64357
64539
  const all = listRegistryWorkspaces();
64358
- const baseName = (input.name?.trim() || import_node_path18.default.basename(normalizeRootPath2(input.rootPath)) || "workspace").trim();
64540
+ const baseName = (input.name?.trim() || import_node_path19.default.basename(normalizeRootPath2(input.rootPath)) || "workspace").trim();
64359
64541
  const baseId = slugify(baseName);
64360
64542
  const takenIds = new Set(all.map((workspace) => workspace.id));
64361
64543
  const takenNames = new Set(all.map((workspace) => workspace.name));
@@ -64628,13 +64810,13 @@ function getWorkspaceGraphOptimized(rootPath, maxNodes, maxEdges) {
64628
64810
  }))
64629
64811
  };
64630
64812
  }
64631
- var import_node_fs12, import_node_os4, import_node_path18, import_node_module3, import_meta4, require2, BunDatabase, Database2, registryDb2, workspaceDbs, CURATED_TYPE_ORDER, typeOrderCase;
64813
+ var import_node_fs13, import_node_os4, import_node_path19, import_node_module3, import_meta4, require2, BunDatabase, Database2, registryDb2, workspaceDbs, CURATED_TYPE_ORDER, typeOrderCase;
64632
64814
  var init_sqlite2 = __esm({
64633
64815
  "../web/src/server/sqlite.ts"() {
64634
64816
  "use strict";
64635
- import_node_fs12 = __toESM(require("fs"), 1);
64817
+ import_node_fs13 = __toESM(require("fs"), 1);
64636
64818
  import_node_os4 = __toESM(require("os"), 1);
64637
- import_node_path18 = __toESM(require("path"), 1);
64819
+ import_node_path19 = __toESM(require("path"), 1);
64638
64820
  import_node_module3 = require("module");
64639
64821
  init_src();
64640
64822
  import_meta4 = {};
@@ -64668,7 +64850,7 @@ var init_sqlite2 = __esm({
64668
64850
  function getDirname() {
64669
64851
  try {
64670
64852
  if (typeof import_meta5 !== "undefined" && import_meta5.url) {
64671
- return import_node_path19.default.dirname(new URL(import_meta5.url).pathname);
64853
+ return import_node_path20.default.dirname(new URL(import_meta5.url).pathname);
64672
64854
  }
64673
64855
  } catch {
64674
64856
  }
@@ -64702,7 +64884,7 @@ function mapWorkspace2(ws) {
64702
64884
  function resolveActiveWorkspace() {
64703
64885
  const all = listRegistryWorkspaces();
64704
64886
  if (all.length === 0) return null;
64705
- const valid = all.find((w) => (0, import_node_fs13.existsSync)(w.rootPath));
64887
+ const valid = all.find((w) => (0, import_node_fs14.existsSync)(w.rootPath));
64706
64888
  return valid ?? all[0];
64707
64889
  }
64708
64890
  function resolveMetricsWorkspace(c) {
@@ -64713,7 +64895,7 @@ function resolveMetricsWorkspace(c) {
64713
64895
  }
64714
64896
  return all.find((w) => {
64715
64897
  try {
64716
- return w.rootPath && w.rootPath !== "/" && (0, import_node_fs13.existsSync)(w.rootPath);
64898
+ return w.rootPath && w.rootPath !== "/" && (0, import_node_fs14.existsSync)(w.rootPath);
64717
64899
  } catch {
64718
64900
  return false;
64719
64901
  }
@@ -64721,31 +64903,31 @@ function resolveMetricsWorkspace(c) {
64721
64903
  }
64722
64904
  function findChangelogPath() {
64723
64905
  const candidates = [
64724
- import_node_path19.default.resolve(serverDir, "CHANGELOG.md"),
64725
- import_node_path19.default.resolve(serverDir, "..", "..", "..", "..", "CHANGELOG.md"),
64726
- import_node_path19.default.resolve(serverDir, "..", "..", "..", "CHANGELOG.md"),
64727
- import_node_path19.default.resolve(serverDir, "..", "CHANGELOG.md"),
64728
- import_node_path19.default.resolve(process.cwd(), "CHANGELOG.md")
64906
+ import_node_path20.default.resolve(serverDir, "CHANGELOG.md"),
64907
+ import_node_path20.default.resolve(serverDir, "..", "..", "..", "..", "CHANGELOG.md"),
64908
+ import_node_path20.default.resolve(serverDir, "..", "..", "..", "CHANGELOG.md"),
64909
+ import_node_path20.default.resolve(serverDir, "..", "CHANGELOG.md"),
64910
+ import_node_path20.default.resolve(process.cwd(), "CHANGELOG.md")
64729
64911
  ];
64730
64912
  for (const candidate of candidates) {
64731
- if ((0, import_node_fs13.existsSync)(candidate)) return candidate;
64913
+ if ((0, import_node_fs14.existsSync)(candidate)) return candidate;
64732
64914
  }
64733
64915
  let dir = process.cwd();
64734
64916
  for (let i = 0; i < 6; i++) {
64735
- const candidate = import_node_path19.default.join(dir, "CHANGELOG.md");
64736
- if ((0, import_node_fs13.existsSync)(candidate)) return candidate;
64737
- const parent = import_node_path19.default.dirname(dir);
64917
+ const candidate = import_node_path20.default.join(dir, "CHANGELOG.md");
64918
+ if ((0, import_node_fs14.existsSync)(candidate)) return candidate;
64919
+ const parent = import_node_path20.default.dirname(dir);
64738
64920
  if (parent === dir) break;
64739
64921
  dir = parent;
64740
64922
  }
64741
64923
  return null;
64742
64924
  }
64743
64925
  function resolveWebDist() {
64744
- const sourceDist = import_node_path19.default.resolve(serverDir, "..", "dist");
64745
- if ((0, import_node_fs13.existsSync)(import_node_path19.default.join(sourceDist, "index.html"))) return sourceDist;
64926
+ const sourceDist = import_node_path20.default.resolve(serverDir, "..", "dist");
64927
+ if ((0, import_node_fs14.existsSync)(import_node_path20.default.join(sourceDist, "index.html"))) return sourceDist;
64746
64928
  if (process.env.OPENEZ_CLI_BUNDLE === "true" && process.argv[1]) {
64747
- const cliDist = import_node_path19.default.resolve(import_node_path19.default.dirname((0, import_node_fs13.realpathSync)(process.argv[1])), "web");
64748
- if ((0, import_node_fs13.existsSync)(import_node_path19.default.join(cliDist, "index.html"))) return cliDist;
64929
+ const cliDist = import_node_path20.default.resolve(import_node_path20.default.dirname((0, import_node_fs14.realpathSync)(process.argv[1])), "web");
64930
+ if ((0, import_node_fs14.existsSync)(import_node_path20.default.join(cliDist, "index.html"))) return cliDist;
64749
64931
  }
64750
64932
  return null;
64751
64933
  }
@@ -64754,22 +64936,22 @@ function createWebServer() {
64754
64936
  if (webDist) {
64755
64937
  app.use("/*", serveStatic({ root: webDist, rewriteRequestPath: (p) => p }));
64756
64938
  app.get("*", (c) => {
64757
- const indexPath = import_node_path19.default.join(webDist, "index.html");
64758
- const index2 = (0, import_node_fs13.readFileSync)(indexPath, "utf-8");
64939
+ const indexPath = import_node_path20.default.join(webDist, "index.html");
64940
+ const index2 = (0, import_node_fs14.readFileSync)(indexPath, "utf-8");
64759
64941
  return c.html(index2);
64760
64942
  });
64761
64943
  }
64762
64944
  return app;
64763
64945
  }
64764
- var import_node_fs13, import_node_path19, import_meta5, serverDir, app, DEFAULT_INCLUDE_GLOBS, DEFAULT_EXCLUDE_GLOBS, activeIndexRuns;
64946
+ var import_node_fs14, import_node_path20, import_meta5, serverDir, app, DEFAULT_INCLUDE_GLOBS, DEFAULT_EXCLUDE_GLOBS, activeIndexRuns;
64765
64947
  var init_server3 = __esm({
64766
64948
  "../web/src/server/index.ts"() {
64767
64949
  "use strict";
64768
64950
  init_serve_static();
64769
64951
  init_dist3();
64770
64952
  init_cors();
64771
- import_node_fs13 = require("fs");
64772
- import_node_path19 = __toESM(require("path"), 1);
64953
+ import_node_fs14 = require("fs");
64954
+ import_node_path20 = __toESM(require("path"), 1);
64773
64955
  init_sqlite2();
64774
64956
  init_src3();
64775
64957
  init_src();
@@ -64812,7 +64994,7 @@ var init_server3 = __esm({
64812
64994
  const all = listRegistryWorkspaces();
64813
64995
  const target = all.find((ws) => {
64814
64996
  try {
64815
- return ws.rootPath && ws.rootPath !== "/" && (0, import_node_fs13.existsSync)(ws.rootPath);
64997
+ return ws.rootPath && ws.rootPath !== "/" && (0, import_node_fs14.existsSync)(ws.rootPath);
64816
64998
  } catch {
64817
64999
  return false;
64818
65000
  }
@@ -64890,7 +65072,7 @@ var init_server3 = __esm({
64890
65072
  const rootPath = body.rootPath;
64891
65073
  if (!rootPath) return c.json({ valid: false, error: "Path is required" });
64892
65074
  try {
64893
- const stats = await import_node_fs13.promises.stat(rootPath);
65075
+ const stats = await import_node_fs14.promises.stat(rootPath);
64894
65076
  if (!stats.isDirectory()) return c.json({ valid: false, error: "Path is not a directory" });
64895
65077
  return c.json({ valid: true });
64896
65078
  } catch {
@@ -64956,7 +65138,7 @@ var init_server3 = __esm({
64956
65138
  const rootPath = body.rootPath;
64957
65139
  if (!rootPath) return c.json({ success: false, error: "rootPath is required" });
64958
65140
  try {
64959
- const stats = await import_node_fs13.promises.stat(rootPath);
65141
+ const stats = await import_node_fs14.promises.stat(rootPath);
64960
65142
  if (!stats.isDirectory()) return c.json({ success: false, error: "Path is not a directory" });
64961
65143
  } catch {
64962
65144
  return c.json({
@@ -64965,8 +65147,8 @@ var init_server3 = __esm({
64965
65147
  });
64966
65148
  }
64967
65149
  const ws = ensureRegistryWorkspace({
64968
- name: body.name?.trim() || import_node_path19.default.basename(rootPath),
64969
- rootPath: import_node_path19.default.resolve(rootPath),
65150
+ name: body.name?.trim() || import_node_path20.default.basename(rootPath),
65151
+ rootPath: import_node_path20.default.resolve(rootPath),
64970
65152
  includeGlobs: (body.includeGlobs ?? DEFAULT_INCLUDE_GLOBS).join("\n"),
64971
65153
  excludeGlobs: (body.excludeGlobs ?? DEFAULT_EXCLUDE_GLOBS).join("\n")
64972
65154
  });
@@ -65358,7 +65540,7 @@ var init_server3 = __esm({
65358
65540
  try {
65359
65541
  const filePath = findChangelogPath();
65360
65542
  if (!filePath) return c.json({ content: "" }, 404);
65361
- const content = (0, import_node_fs13.readFileSync)(filePath, "utf-8");
65543
+ const content = (0, import_node_fs14.readFileSync)(filePath, "utf-8");
65362
65544
  return c.json({ content });
65363
65545
  } catch {
65364
65546
  return c.json({ content: "" }, 500);
@@ -65396,38 +65578,38 @@ function getThisDir() {
65396
65578
  }
65397
65579
  function resolveCliInvocation() {
65398
65580
  const thisDir = getThisDir();
65399
- if (import_node_path20.default.basename(thisDir) === "dist") {
65400
- const repoRoot2 = import_node_path20.default.resolve(thisDir, "..");
65401
- const cliPath2 = import_node_path20.default.join(thisDir, "cli.cjs");
65581
+ if (import_node_path21.default.basename(thisDir) === "dist") {
65582
+ const repoRoot2 = import_node_path21.default.resolve(thisDir, "..");
65583
+ const cliPath2 = import_node_path21.default.join(thisDir, "cli.cjs");
65402
65584
  return {
65403
65585
  command: process.execPath,
65404
65586
  args: [cliPath2, "serve", "--mcp"],
65405
65587
  repoRoot: repoRoot2
65406
65588
  };
65407
65589
  }
65408
- const repoRoot = import_node_path20.default.resolve(thisDir, "../../..");
65409
- const builtCliPath = import_node_path20.default.resolve(thisDir, "../dist/cli.cjs");
65410
- if (import_node_fs14.default.existsSync(builtCliPath)) {
65590
+ const repoRoot = import_node_path21.default.resolve(thisDir, "../../..");
65591
+ const builtCliPath = import_node_path21.default.resolve(thisDir, "../dist/cli.cjs");
65592
+ if (import_node_fs15.default.existsSync(builtCliPath)) {
65411
65593
  return {
65412
65594
  command: process.execPath,
65413
65595
  args: [builtCliPath, "serve", "--mcp"],
65414
65596
  repoRoot
65415
65597
  };
65416
65598
  }
65417
- const tsxPath = import_node_path20.default.join(repoRoot, "node_modules", ".bin", "tsx");
65418
- const cliPath = import_node_path20.default.resolve(thisDir, "./cli.ts");
65599
+ const tsxPath = import_node_path21.default.join(repoRoot, "node_modules", ".bin", "tsx");
65600
+ const cliPath = import_node_path21.default.resolve(thisDir, "./cli.ts");
65419
65601
  return {
65420
65602
  command: tsxPath,
65421
65603
  args: [cliPath, "serve", "--mcp"],
65422
65604
  repoRoot
65423
65605
  };
65424
65606
  }
65425
- var import_node_fs14, import_node_path20, import_meta6;
65607
+ var import_node_fs15, import_node_path21, import_meta6;
65426
65608
  var init_resolve_cli = __esm({
65427
65609
  "src/resolve-cli.ts"() {
65428
65610
  "use strict";
65429
- import_node_fs14 = __toESM(require("fs"), 1);
65430
- import_node_path20 = __toESM(require("path"), 1);
65611
+ import_node_fs15 = __toESM(require("fs"), 1);
65612
+ import_node_path21 = __toESM(require("path"), 1);
65431
65613
  import_meta6 = {};
65432
65614
  }
65433
65615
  });
@@ -65436,55 +65618,55 @@ var init_resolve_cli = __esm({
65436
65618
  function readInstructionFile(instructionsPath) {
65437
65619
  let fd;
65438
65620
  try {
65439
- fd = import_node_fs15.default.openSync(instructionsPath, import_node_fs15.default.constants.O_RDONLY | (import_node_fs15.default.constants.O_NOFOLLOW ?? 0));
65440
- return import_node_fs15.default.readFileSync(fd, "utf-8");
65621
+ fd = import_node_fs16.default.openSync(instructionsPath, import_node_fs16.default.constants.O_RDONLY | (import_node_fs16.default.constants.O_NOFOLLOW ?? 0));
65622
+ return import_node_fs16.default.readFileSync(fd, "utf-8");
65441
65623
  } catch (error2) {
65442
65624
  if (error2.code === "ENOENT") return "";
65443
65625
  throw error2;
65444
65626
  } finally {
65445
- if (fd !== void 0) import_node_fs15.default.closeSync(fd);
65627
+ if (fd !== void 0) import_node_fs16.default.closeSync(fd);
65446
65628
  }
65447
65629
  }
65448
65630
  function writeInstructionFileAtomic(instructionsPath, content) {
65449
65631
  const tempPath = `${instructionsPath}.openez-${process.pid}-${Date.now()}.tmp`;
65450
65632
  let mode = 420;
65451
65633
  try {
65452
- mode = import_node_fs15.default.statSync(instructionsPath).mode & 511;
65634
+ mode = import_node_fs16.default.statSync(instructionsPath).mode & 511;
65453
65635
  } catch (error2) {
65454
65636
  if (error2.code !== "ENOENT") throw error2;
65455
65637
  }
65456
65638
  let fd;
65457
65639
  try {
65458
- fd = import_node_fs15.default.openSync(
65640
+ fd = import_node_fs16.default.openSync(
65459
65641
  tempPath,
65460
- import_node_fs15.default.constants.O_WRONLY | import_node_fs15.default.constants.O_CREAT | import_node_fs15.default.constants.O_EXCL,
65642
+ import_node_fs16.default.constants.O_WRONLY | import_node_fs16.default.constants.O_CREAT | import_node_fs16.default.constants.O_EXCL,
65461
65643
  mode
65462
65644
  );
65463
- import_node_fs15.default.writeFileSync(fd, content, "utf-8");
65464
- import_node_fs15.default.fsyncSync(fd);
65465
- import_node_fs15.default.closeSync(fd);
65645
+ import_node_fs16.default.writeFileSync(fd, content, "utf-8");
65646
+ import_node_fs16.default.fsyncSync(fd);
65647
+ import_node_fs16.default.closeSync(fd);
65466
65648
  fd = void 0;
65467
65649
  try {
65468
- if (import_node_fs15.default.lstatSync(instructionsPath).isSymbolicLink()) {
65650
+ if (import_node_fs16.default.lstatSync(instructionsPath).isSymbolicLink()) {
65469
65651
  throw new Error("Refusing to manage symlinked instruction file: " + instructionsPath);
65470
65652
  }
65471
65653
  } catch (error2) {
65472
65654
  if (error2.code !== "ENOENT") throw error2;
65473
65655
  }
65474
- import_node_fs15.default.renameSync(tempPath, instructionsPath);
65656
+ import_node_fs16.default.renameSync(tempPath, instructionsPath);
65475
65657
  } catch (error2) {
65476
- if (fd !== void 0) import_node_fs15.default.closeSync(fd);
65658
+ if (fd !== void 0) import_node_fs16.default.closeSync(fd);
65477
65659
  try {
65478
- import_node_fs15.default.unlinkSync(tempPath);
65660
+ import_node_fs16.default.unlinkSync(tempPath);
65479
65661
  } catch {
65480
65662
  }
65481
65663
  throw error2;
65482
65664
  }
65483
65665
  }
65484
65666
  function installAgentInstructions(rootPath, fileName) {
65485
- const instructionsPath = import_node_path21.default.join(rootPath, fileName);
65667
+ const instructionsPath = import_node_path22.default.join(rootPath, fileName);
65486
65668
  try {
65487
- const stats = import_node_fs15.default.lstatSync(instructionsPath);
65669
+ const stats = import_node_fs16.default.lstatSync(instructionsPath);
65488
65670
  if (stats.isSymbolicLink()) {
65489
65671
  throw new Error("Refusing to manage symlinked instruction file: " + instructionsPath);
65490
65672
  }
@@ -65510,12 +65692,12 @@ function installAgentInstructions(rootPath, fileName) {
65510
65692
  if (next !== existing) writeInstructionFileAtomic(instructionsPath, next);
65511
65693
  return instructionsPath;
65512
65694
  }
65513
- var import_node_fs15, import_node_path21, START_MARKER, END_MARKER, MANAGED_BLOCK;
65695
+ var import_node_fs16, import_node_path22, START_MARKER, END_MARKER, MANAGED_BLOCK;
65514
65696
  var init_setup_instructions = __esm({
65515
65697
  "src/setup-instructions.ts"() {
65516
65698
  "use strict";
65517
- import_node_fs15 = __toESM(require("fs"), 1);
65518
- import_node_path21 = __toESM(require("path"), 1);
65699
+ import_node_fs16 = __toESM(require("fs"), 1);
65700
+ import_node_path22 = __toESM(require("path"), 1);
65519
65701
  START_MARKER = "<!-- openez:start -->";
65520
65702
  END_MARKER = "<!-- openez:end -->";
65521
65703
  MANAGED_BLOCK = `${START_MARKER}
@@ -65523,6 +65705,7 @@ var init_setup_instructions = __esm({
65523
65705
  ## OpenEZ workflow
65524
65706
 
65525
65707
  - Before code work in a new session, call \`memory_recall\` with 1\u20133 keywords from the current task.
65708
+ - Use \`code_outline\` for a cheap AST-level outline of a single file (functions, classes, exports with line numbers) before reading the full file.
65526
65709
  - Use \`code_query\` before filesystem search and \`code_context\` for symbol or file follow-up.
65527
65710
  - Use \`graph_neighbors\` for relationship lookups between symbols, files, and edges.
65528
65711
  - Call \`memory_write\` after an architectural decision or non-obvious constraint is confirmed.
@@ -66440,28 +66623,28 @@ __export(setup_codex_exports, {
66440
66623
  setupCodex: () => setupCodex
66441
66624
  });
66442
66625
  function getCodexConfigPath() {
66443
- return import_node_path22.default.join(import_node_os5.default.homedir(), ".codex", "config.toml");
66626
+ return import_node_path23.default.join(import_node_os5.default.homedir(), ".codex", "config.toml");
66444
66627
  }
66445
66628
  async function setupCodex(rootPath) {
66446
- const resolvedPath = import_node_path22.default.resolve(rootPath);
66447
- if (!import_node_fs16.default.existsSync(resolvedPath)) {
66629
+ const resolvedPath = import_node_path23.default.resolve(rootPath);
66630
+ if (!import_node_fs17.default.existsSync(resolvedPath)) {
66448
66631
  console.error(`Error: path does not exist: ${resolvedPath}`);
66449
66632
  process.exit(1);
66450
66633
  }
66451
- if (!import_node_fs16.default.statSync(resolvedPath).isDirectory()) {
66634
+ if (!import_node_fs17.default.statSync(resolvedPath).isDirectory()) {
66452
66635
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66453
66636
  process.exit(1);
66454
66637
  }
66455
66638
  const { command, args, repoRoot } = resolveCliInvocation();
66456
66639
  const label = "openez";
66457
66640
  const configPath = getCodexConfigPath();
66458
- const configDir = import_node_path22.default.dirname(configPath);
66459
- if (!import_node_fs16.default.existsSync(configDir)) {
66460
- import_node_fs16.default.mkdirSync(configDir, { recursive: true, mode: 493 });
66641
+ const configDir = import_node_path23.default.dirname(configPath);
66642
+ if (!import_node_fs17.default.existsSync(configDir)) {
66643
+ import_node_fs17.default.mkdirSync(configDir, { recursive: true, mode: 493 });
66461
66644
  }
66462
66645
  let config2 = {};
66463
- if (import_node_fs16.default.existsSync(configPath)) {
66464
- const raw2 = import_node_fs16.default.readFileSync(configPath, "utf-8");
66646
+ if (import_node_fs17.default.existsSync(configPath)) {
66647
+ const raw2 = import_node_fs17.default.readFileSync(configPath, "utf-8");
66465
66648
  try {
66466
66649
  config2 = parse3(raw2);
66467
66650
  } catch {
@@ -66479,8 +66662,8 @@ async function setupCodex(rootPath) {
66479
66662
  };
66480
66663
  mcpServers[label] = entry;
66481
66664
  const output = stringify2(config2);
66482
- import_node_fs16.default.writeFileSync(configPath, output, "utf-8");
66483
- import_node_fs16.default.chmodSync(configPath, 420);
66665
+ import_node_fs17.default.writeFileSync(configPath, output, "utf-8");
66666
+ import_node_fs17.default.chmodSync(configPath, 420);
66484
66667
  const instructionsPath = installAgentInstructions(resolvedPath, "AGENTS.md");
66485
66668
  console.log(`Codex MCP server configured: '${label}'`);
66486
66669
  console.log(" Mode: shared multi-workspace MCP");
@@ -66490,13 +66673,13 @@ async function setupCodex(rootPath) {
66490
66673
  console.log("");
66491
66674
  console.log("Restart Codex or open a new session for the changes to take effect.");
66492
66675
  }
66493
- var import_node_fs16, import_node_os5, import_node_path22;
66676
+ var import_node_fs17, import_node_os5, import_node_path23;
66494
66677
  var init_setup_codex = __esm({
66495
66678
  "src/setup-codex.ts"() {
66496
66679
  "use strict";
66497
- import_node_fs16 = __toESM(require("fs"), 1);
66680
+ import_node_fs17 = __toESM(require("fs"), 1);
66498
66681
  import_node_os5 = __toESM(require("os"), 1);
66499
- import_node_path22 = __toESM(require("path"), 1);
66682
+ import_node_path23 = __toESM(require("path"), 1);
66500
66683
  init_resolve_cli();
66501
66684
  init_setup_instructions();
66502
66685
  init_dist4();
@@ -66509,28 +66692,28 @@ __export(setup_claude_exports, {
66509
66692
  setupClaude: () => setupClaude
66510
66693
  });
66511
66694
  function getClaudeConfigPath() {
66512
- return import_node_path23.default.join(import_node_os6.default.homedir(), ".claude", "settings.json");
66695
+ return import_node_path24.default.join(import_node_os6.default.homedir(), ".claude", "settings.json");
66513
66696
  }
66514
66697
  async function setupClaude(rootPath) {
66515
- const resolvedPath = import_node_path23.default.resolve(rootPath);
66516
- if (!import_node_fs17.default.existsSync(resolvedPath)) {
66698
+ const resolvedPath = import_node_path24.default.resolve(rootPath);
66699
+ if (!import_node_fs18.default.existsSync(resolvedPath)) {
66517
66700
  console.error(`Error: path does not exist: ${resolvedPath}`);
66518
66701
  process.exit(1);
66519
66702
  }
66520
- if (!import_node_fs17.default.statSync(resolvedPath).isDirectory()) {
66703
+ if (!import_node_fs18.default.statSync(resolvedPath).isDirectory()) {
66521
66704
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66522
66705
  process.exit(1);
66523
66706
  }
66524
66707
  const { command, args, repoRoot } = resolveCliInvocation();
66525
66708
  const label = "openez";
66526
66709
  const configPath = getClaudeConfigPath();
66527
- const configDir = import_node_path23.default.dirname(configPath);
66528
- if (!import_node_fs17.default.existsSync(configDir)) {
66529
- import_node_fs17.default.mkdirSync(configDir, { recursive: true, mode: 493 });
66710
+ const configDir = import_node_path24.default.dirname(configPath);
66711
+ if (!import_node_fs18.default.existsSync(configDir)) {
66712
+ import_node_fs18.default.mkdirSync(configDir, { recursive: true, mode: 493 });
66530
66713
  }
66531
66714
  let config2 = {};
66532
- if (import_node_fs17.default.existsSync(configPath)) {
66533
- const raw2 = import_node_fs17.default.readFileSync(configPath, "utf-8");
66715
+ if (import_node_fs18.default.existsSync(configPath)) {
66716
+ const raw2 = import_node_fs18.default.readFileSync(configPath, "utf-8");
66534
66717
  try {
66535
66718
  config2 = JSON.parse(raw2);
66536
66719
  } catch {
@@ -66546,8 +66729,8 @@ async function setupClaude(rootPath) {
66546
66729
  args,
66547
66730
  startupTimeoutSec: 120
66548
66731
  };
66549
- import_node_fs17.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66550
- import_node_fs17.default.chmodSync(configPath, 420);
66732
+ import_node_fs18.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66733
+ import_node_fs18.default.chmodSync(configPath, 420);
66551
66734
  const instructionsPath = installAgentInstructions(resolvedPath, "CLAUDE.md");
66552
66735
  console.log(`Claude Code MCP server configured: '${label}'`);
66553
66736
  console.log(" Mode: shared multi-workspace MCP");
@@ -66557,13 +66740,13 @@ async function setupClaude(rootPath) {
66557
66740
  console.log("");
66558
66741
  console.log("Restart Claude Code or open a new session for the changes to take effect.");
66559
66742
  }
66560
- var import_node_fs17, import_node_os6, import_node_path23;
66743
+ var import_node_fs18, import_node_os6, import_node_path24;
66561
66744
  var init_setup_claude = __esm({
66562
66745
  "src/setup-claude.ts"() {
66563
66746
  "use strict";
66564
- import_node_fs17 = __toESM(require("fs"), 1);
66747
+ import_node_fs18 = __toESM(require("fs"), 1);
66565
66748
  import_node_os6 = __toESM(require("os"), 1);
66566
- import_node_path23 = __toESM(require("path"), 1);
66749
+ import_node_path24 = __toESM(require("path"), 1);
66567
66750
  init_resolve_cli();
66568
66751
  init_setup_instructions();
66569
66752
  }
@@ -66575,28 +66758,28 @@ __export(setup_opencode_exports, {
66575
66758
  setupOpenCode: () => setupOpenCode
66576
66759
  });
66577
66760
  function getOpenCodeConfigPath() {
66578
- return import_node_path24.default.join(import_node_os7.default.homedir(), ".config", "opencode", "opencode.json");
66761
+ return import_node_path25.default.join(import_node_os7.default.homedir(), ".config", "opencode", "opencode.json");
66579
66762
  }
66580
66763
  async function setupOpenCode(rootPath) {
66581
- const resolvedPath = import_node_path24.default.resolve(rootPath);
66582
- if (!import_node_fs18.default.existsSync(resolvedPath)) {
66764
+ const resolvedPath = import_node_path25.default.resolve(rootPath);
66765
+ if (!import_node_fs19.default.existsSync(resolvedPath)) {
66583
66766
  console.error(`Error: path does not exist: ${resolvedPath}`);
66584
66767
  process.exit(1);
66585
66768
  }
66586
- if (!import_node_fs18.default.statSync(resolvedPath).isDirectory()) {
66769
+ if (!import_node_fs19.default.statSync(resolvedPath).isDirectory()) {
66587
66770
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66588
66771
  process.exit(1);
66589
66772
  }
66590
66773
  const { command, args, repoRoot } = resolveCliInvocation();
66591
66774
  const label = "openez";
66592
66775
  const configPath = getOpenCodeConfigPath();
66593
- const configDir = import_node_path24.default.dirname(configPath);
66594
- if (!import_node_fs18.default.existsSync(configDir)) {
66595
- import_node_fs18.default.mkdirSync(configDir, { recursive: true, mode: 493 });
66776
+ const configDir = import_node_path25.default.dirname(configPath);
66777
+ if (!import_node_fs19.default.existsSync(configDir)) {
66778
+ import_node_fs19.default.mkdirSync(configDir, { recursive: true, mode: 493 });
66596
66779
  }
66597
66780
  let config2 = {};
66598
- if (import_node_fs18.default.existsSync(configPath)) {
66599
- const raw2 = import_node_fs18.default.readFileSync(configPath, "utf-8");
66781
+ if (import_node_fs19.default.existsSync(configPath)) {
66782
+ const raw2 = import_node_fs19.default.readFileSync(configPath, "utf-8");
66600
66783
  try {
66601
66784
  config2 = JSON.parse(raw2);
66602
66785
  } catch {
@@ -66612,8 +66795,8 @@ async function setupOpenCode(rootPath) {
66612
66795
  command: [command, ...args],
66613
66796
  enabled: true
66614
66797
  };
66615
- import_node_fs18.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66616
- import_node_fs18.default.chmodSync(configPath, 420);
66798
+ import_node_fs19.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66799
+ import_node_fs19.default.chmodSync(configPath, 420);
66617
66800
  const instructionsPath = installAgentInstructions(resolvedPath, "AGENTS.md");
66618
66801
  console.log(`OpenCode MCP server configured: '${label}'`);
66619
66802
  console.log(" Mode: shared multi-workspace MCP");
@@ -66623,13 +66806,13 @@ async function setupOpenCode(rootPath) {
66623
66806
  console.log("");
66624
66807
  console.log("Restart OpenCode or open a new session for the changes to take effect.");
66625
66808
  }
66626
- var import_node_fs18, import_node_os7, import_node_path24;
66809
+ var import_node_fs19, import_node_os7, import_node_path25;
66627
66810
  var init_setup_opencode = __esm({
66628
66811
  "src/setup-opencode.ts"() {
66629
66812
  "use strict";
66630
- import_node_fs18 = __toESM(require("fs"), 1);
66813
+ import_node_fs19 = __toESM(require("fs"), 1);
66631
66814
  import_node_os7 = __toESM(require("os"), 1);
66632
- import_node_path24 = __toESM(require("path"), 1);
66815
+ import_node_path25 = __toESM(require("path"), 1);
66633
66816
  init_resolve_cli();
66634
66817
  init_setup_instructions();
66635
66818
  }
@@ -66641,28 +66824,28 @@ __export(setup_windsurf_exports, {
66641
66824
  setupWindsurf: () => setupWindsurf
66642
66825
  });
66643
66826
  function getWindsurfConfigPath() {
66644
- return import_node_path25.default.join(import_node_os8.default.homedir(), ".codeium", "windsurf", "mcp_config.json");
66827
+ return import_node_path26.default.join(import_node_os8.default.homedir(), ".codeium", "windsurf", "mcp_config.json");
66645
66828
  }
66646
66829
  async function setupWindsurf(rootPath) {
66647
- const resolvedPath = import_node_path25.default.resolve(rootPath);
66648
- if (!import_node_fs19.default.existsSync(resolvedPath)) {
66830
+ const resolvedPath = import_node_path26.default.resolve(rootPath);
66831
+ if (!import_node_fs20.default.existsSync(resolvedPath)) {
66649
66832
  console.error(`Error: path does not exist: ${resolvedPath}`);
66650
66833
  process.exit(1);
66651
66834
  }
66652
- if (!import_node_fs19.default.statSync(resolvedPath).isDirectory()) {
66835
+ if (!import_node_fs20.default.statSync(resolvedPath).isDirectory()) {
66653
66836
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66654
66837
  process.exit(1);
66655
66838
  }
66656
66839
  const { command, args, repoRoot } = resolveCliInvocation();
66657
66840
  const label = "openez";
66658
66841
  const configPath = getWindsurfConfigPath();
66659
- const configDir = import_node_path25.default.dirname(configPath);
66660
- if (!import_node_fs19.default.existsSync(configDir)) {
66661
- import_node_fs19.default.mkdirSync(configDir, { recursive: true, mode: 493 });
66842
+ const configDir = import_node_path26.default.dirname(configPath);
66843
+ if (!import_node_fs20.default.existsSync(configDir)) {
66844
+ import_node_fs20.default.mkdirSync(configDir, { recursive: true, mode: 493 });
66662
66845
  }
66663
66846
  let config2 = {};
66664
- if (import_node_fs19.default.existsSync(configPath)) {
66665
- const raw2 = import_node_fs19.default.readFileSync(configPath, "utf-8");
66847
+ if (import_node_fs20.default.existsSync(configPath)) {
66848
+ const raw2 = import_node_fs20.default.readFileSync(configPath, "utf-8");
66666
66849
  try {
66667
66850
  config2 = JSON.parse(raw2);
66668
66851
  } catch {
@@ -66677,8 +66860,8 @@ async function setupWindsurf(rootPath) {
66677
66860
  command,
66678
66861
  args
66679
66862
  };
66680
- import_node_fs19.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66681
- import_node_fs19.default.chmodSync(configPath, 420);
66863
+ import_node_fs20.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66864
+ import_node_fs20.default.chmodSync(configPath, 420);
66682
66865
  const instructionsPath = installAgentInstructions(resolvedPath, "AGENTS.md");
66683
66866
  console.log(`Windsurf MCP server configured: '${label}'`);
66684
66867
  console.log(" Mode: shared multi-workspace MCP");
@@ -66688,13 +66871,13 @@ async function setupWindsurf(rootPath) {
66688
66871
  console.log("");
66689
66872
  console.log("Restart Windsurf or open a new session for the changes to take effect.");
66690
66873
  }
66691
- var import_node_fs19, import_node_os8, import_node_path25;
66874
+ var import_node_fs20, import_node_os8, import_node_path26;
66692
66875
  var init_setup_windsurf = __esm({
66693
66876
  "src/setup-windsurf.ts"() {
66694
66877
  "use strict";
66695
- import_node_fs19 = __toESM(require("fs"), 1);
66878
+ import_node_fs20 = __toESM(require("fs"), 1);
66696
66879
  import_node_os8 = __toESM(require("os"), 1);
66697
- import_node_path25 = __toESM(require("path"), 1);
66880
+ import_node_path26 = __toESM(require("path"), 1);
66698
66881
  init_resolve_cli();
66699
66882
  init_setup_instructions();
66700
66883
  }
@@ -66706,28 +66889,28 @@ __export(setup_devin_exports, {
66706
66889
  setupDevin: () => setupDevin
66707
66890
  });
66708
66891
  function getDevinConfigPath() {
66709
- return import_node_path26.default.join(import_node_os9.default.homedir(), ".config", "devin", "config.json");
66892
+ return import_node_path27.default.join(import_node_os9.default.homedir(), ".config", "devin", "config.json");
66710
66893
  }
66711
66894
  async function setupDevin(rootPath) {
66712
- const resolvedPath = import_node_path26.default.resolve(rootPath);
66713
- if (!import_node_fs20.default.existsSync(resolvedPath)) {
66895
+ const resolvedPath = import_node_path27.default.resolve(rootPath);
66896
+ if (!import_node_fs21.default.existsSync(resolvedPath)) {
66714
66897
  console.error(`Error: path does not exist: ${resolvedPath}`);
66715
66898
  process.exit(1);
66716
66899
  }
66717
- if (!import_node_fs20.default.statSync(resolvedPath).isDirectory()) {
66900
+ if (!import_node_fs21.default.statSync(resolvedPath).isDirectory()) {
66718
66901
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66719
66902
  process.exit(1);
66720
66903
  }
66721
66904
  const { command, args, repoRoot } = resolveCliInvocation();
66722
66905
  const label = "openez";
66723
66906
  const configPath = getDevinConfigPath();
66724
- const configDir = import_node_path26.default.dirname(configPath);
66725
- if (!import_node_fs20.default.existsSync(configDir)) {
66726
- import_node_fs20.default.mkdirSync(configDir, { recursive: true, mode: 493 });
66907
+ const configDir = import_node_path27.default.dirname(configPath);
66908
+ if (!import_node_fs21.default.existsSync(configDir)) {
66909
+ import_node_fs21.default.mkdirSync(configDir, { recursive: true, mode: 493 });
66727
66910
  }
66728
66911
  let config2 = {};
66729
- if (import_node_fs20.default.existsSync(configPath)) {
66730
- const raw2 = import_node_fs20.default.readFileSync(configPath, "utf-8");
66912
+ if (import_node_fs21.default.existsSync(configPath)) {
66913
+ const raw2 = import_node_fs21.default.readFileSync(configPath, "utf-8");
66731
66914
  try {
66732
66915
  config2 = JSON.parse(raw2);
66733
66916
  } catch {
@@ -66742,8 +66925,8 @@ async function setupDevin(rootPath) {
66742
66925
  command,
66743
66926
  args
66744
66927
  };
66745
- import_node_fs20.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66746
- import_node_fs20.default.chmodSync(configPath, 420);
66928
+ import_node_fs21.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66929
+ import_node_fs21.default.chmodSync(configPath, 420);
66747
66930
  const instructionsPath = installAgentInstructions(resolvedPath, "AGENTS.md");
66748
66931
  console.log(`Devin CLI MCP server configured: '${label}'`);
66749
66932
  console.log(" Mode: shared multi-workspace MCP");
@@ -66753,21 +66936,21 @@ async function setupDevin(rootPath) {
66753
66936
  console.log("");
66754
66937
  console.log("Restart Devin CLI or open a new session for the changes to take effect.");
66755
66938
  }
66756
- var import_node_fs20, import_node_os9, import_node_path26;
66939
+ var import_node_fs21, import_node_os9, import_node_path27;
66757
66940
  var init_setup_devin = __esm({
66758
66941
  "src/setup-devin.ts"() {
66759
66942
  "use strict";
66760
- import_node_fs20 = __toESM(require("fs"), 1);
66943
+ import_node_fs21 = __toESM(require("fs"), 1);
66761
66944
  import_node_os9 = __toESM(require("os"), 1);
66762
- import_node_path26 = __toESM(require("path"), 1);
66945
+ import_node_path27 = __toESM(require("path"), 1);
66763
66946
  init_resolve_cli();
66764
66947
  init_setup_instructions();
66765
66948
  }
66766
66949
  });
66767
66950
 
66768
66951
  // src/cli.ts
66769
- var import_node_fs21 = __toESM(require("fs"), 1);
66770
- var import_node_path27 = __toESM(require("path"), 1);
66952
+ var import_node_fs22 = __toESM(require("fs"), 1);
66953
+ var import_node_path28 = __toESM(require("path"), 1);
66771
66954
  var import_node_readline = __toESM(require("readline"), 1);
66772
66955
  init_esm2();
66773
66956
 
@@ -66794,25 +66977,25 @@ init_src4();
66794
66977
  init_src3();
66795
66978
  var cliDir;
66796
66979
  try {
66797
- cliDir = import_node_path27.default.dirname(import_node_fs21.default.realpathSync(process.argv[1]));
66980
+ cliDir = import_node_path28.default.dirname(import_node_fs22.default.realpathSync(process.argv[1]));
66798
66981
  } catch {
66799
66982
  cliDir = process.cwd();
66800
66983
  }
66801
66984
  var pkg;
66802
66985
  try {
66803
- pkg = JSON.parse(import_node_fs21.default.readFileSync(import_node_path27.default.resolve(cliDir, "../package.json"), "utf-8"));
66986
+ pkg = JSON.parse(import_node_fs22.default.readFileSync(import_node_path28.default.resolve(cliDir, "../package.json"), "utf-8"));
66804
66987
  } catch {
66805
66988
  pkg = { version: "0.0.0-compiled" };
66806
66989
  }
66807
66990
  var program2 = new Command();
66808
66991
  program2.name("openez").description("OpenEZ Graph - Local-first knowledge retrieval system").version(pkg.version);
66809
66992
  program2.command("init").description("Initialize a workspace at the given path and run initial index").argument("[path]", "path to the project directory", process.cwd()).option("--no-index", "skip initial indexing").action(async (targetPath, options) => {
66810
- const resolvedPath = import_node_path27.default.resolve(targetPath);
66811
- if (!import_node_fs21.default.existsSync(resolvedPath)) {
66993
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66994
+ if (!import_node_fs22.default.existsSync(resolvedPath)) {
66812
66995
  console.error(`Error: path does not exist: ${resolvedPath}`);
66813
66996
  process.exit(1);
66814
66997
  }
66815
- if (!import_node_fs21.default.statSync(resolvedPath).isDirectory()) {
66998
+ if (!import_node_fs22.default.statSync(resolvedPath).isDirectory()) {
66816
66999
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66817
67000
  process.exit(1);
66818
67001
  }
@@ -66842,7 +67025,7 @@ program2.command("init").description("Initialize a workspace at the given path a
66842
67025
  }
66843
67026
  });
66844
67027
  program2.command("index").description("Index files in a workspace").argument("[path]", "path to the workspace directory", process.cwd()).action(async (targetPath) => {
66845
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67028
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66846
67029
  let workspace = await readLocalWorkspaceConfig(resolvedPath);
66847
67030
  if (!workspace) {
66848
67031
  const registry2 = createRegistryRepository();
@@ -66863,7 +67046,7 @@ program2.command("index").description("Index files in a workspace").argument("[p
66863
67046
  console.log(JSON.stringify(summary, null, 2));
66864
67047
  });
66865
67048
  program2.command("embed").description("Create embeddings for indexed workspace chunks").argument("[path]", "path to the workspace directory", process.cwd()).option("--force", "delete and rebuild vectors for the active provider/model").action(async (targetPath, options) => {
66866
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67049
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66867
67050
  let workspace = await readLocalWorkspaceConfig(resolvedPath);
66868
67051
  if (!workspace) {
66869
67052
  const registry2 = createRegistryRepository();
@@ -66890,7 +67073,7 @@ program2.command("embed").description("Create embeddings for indexed workspace c
66890
67073
  console.log(JSON.stringify(summary, null, 2));
66891
67074
  });
66892
67075
  program2.command("reindex").description("Full rebuild of a workspace index").argument("[path]", "path to the workspace directory", process.cwd()).action(async (targetPath) => {
66893
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67076
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66894
67077
  const registry2 = createRegistryRepository();
66895
67078
  let workspace = await registry2.getWorkspaceByPath(resolvedPath);
66896
67079
  if (!workspace) {
@@ -66906,7 +67089,7 @@ program2.command("reindex").description("Full rebuild of a workspace index").arg
66906
67089
  console.log(JSON.stringify(summary, null, 2));
66907
67090
  });
66908
67091
  program2.command("watch").description("Watch files and re-index on changes").argument("[path]", "path to the workspace directory", process.cwd()).action(async (targetPath) => {
66909
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67092
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66910
67093
  const registry2 = createRegistryRepository();
66911
67094
  let workspace = await registry2.getWorkspaceByPath(resolvedPath);
66912
67095
  if (!workspace) {
@@ -66971,7 +67154,7 @@ program2.command("watch").description("Watch files and re-index on changes").arg
66971
67154
  program2.command("serve").description("Start the web dashboard or MCP server").option("--mcp", "run as MCP server instead of web").option("--web", "start the web dashboard API server").option("-p, --path <path>", "workspace path").option("--port <port>", "API server port (default: 11368)").action(async (options) => {
66972
67155
  if (options.mcp) {
66973
67156
  const { startMcpServer: startMcpServer2 } = await Promise.resolve().then(() => (init_mcp_bridge(), mcp_bridge_exports));
66974
- await startMcpServer2(options.path ? import_node_path27.default.resolve(options.path) : void 0, pkg.version);
67157
+ await startMcpServer2(options.path ? import_node_path28.default.resolve(options.path) : void 0, pkg.version);
66975
67158
  } else if (options.web) {
66976
67159
  const port = options.port ? Number(options.port) : Number(process.env.API_PORT ?? 11368);
66977
67160
  process.env.API_PORT = String(port);
@@ -66995,7 +67178,7 @@ program2.command("serve").description("Start the web dashboard or MCP server").o
66995
67178
  }
66996
67179
  });
66997
67180
  program2.command("status").description("Show workspace status").argument("[path]", "path to the workspace directory", process.cwd()).action(async (targetPath) => {
66998
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67181
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66999
67182
  const registry2 = createRegistryRepository();
67000
67183
  const workspace = await registry2.getWorkspaceByPath(resolvedPath);
67001
67184
  if (!workspace) {
@@ -67053,7 +67236,7 @@ function confirmDestructive(prompt) {
67053
67236
  }
67054
67237
  program2.command("remove").alias("rm").description("Remove a workspace from the registry and delete its .openez data directory").argument("[path]", "path to the workspace directory", process.cwd()).option("--id <workspaceId>", "workspace id (takes precedence over path)").option("-y, --yes", "skip confirmation prompt").action(async (targetPath, options) => {
67055
67238
  const registry2 = createRegistryRepository();
67056
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67239
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
67057
67240
  const workspace = options.id ? await registry2.getWorkspace(options.id) : await registry2.getWorkspaceByPath(resolvedPath);
67058
67241
  if (!workspace) {
67059
67242
  console.error(`Error: no registered workspace found for ${options.id ?? resolvedPath}`);