@openez-graph/cli 1.3.0 → 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)) {
@@ -11910,6 +11910,13 @@ function createFtsOps(native, stmts, deps) {
11910
11910
  },
11911
11911
  // ── Reset ──
11912
11912
  resetIndexArtifacts() {
11913
+ native.exec("DROP TRIGGER IF EXISTS chunks_fts_insert");
11914
+ native.exec("DROP TRIGGER IF EXISTS chunks_fts_delete");
11915
+ native.exec("DROP TRIGGER IF EXISTS chunks_fts_update");
11916
+ native.exec("DROP TABLE IF EXISTS chunks_fts");
11917
+ native.exec(
11918
+ "CREATE VIRTUAL TABLE chunks_fts USING fts5(chunk_id UNINDEXED, path, heading, language, search_text, tokenize = 'unicode61')"
11919
+ );
11913
11920
  native.exec("DELETE FROM graph_edges");
11914
11921
  native.exec("DELETE FROM graph_nodes");
11915
11922
  native.exec("DELETE FROM chunks");
@@ -12114,20 +12121,36 @@ function initializeWorkspaceSchema(sqlite) {
12114
12121
  INNER JOIN documents d ON d.id = c.document_id;
12115
12122
  `);
12116
12123
  } else {
12117
- sqlite.exec(`
12118
- INSERT INTO chunks_fts (chunk_id, path, heading, language, search_text)
12119
- SELECT c.id, d.path, coalesce(c.heading, ''),
12120
- coalesce(d.language, ''),
12121
- ${composeFtsSearchTextSql("c.metadata", "c.content")}
12122
- FROM chunks c
12123
- INNER JOIN documents d ON d.id = c.document_id
12124
- LEFT JOIN chunks_fts f ON f.chunk_id = c.id
12125
- WHERE f.chunk_id IS NULL;
12126
- `);
12127
- sqlite.exec(`
12128
- DELETE FROM chunks_fts
12129
- WHERE chunk_id NOT IN (SELECT id FROM chunks);
12130
- `);
12124
+ const chunkCount = sqlite.prepare("SELECT count(*) as c FROM chunks").get().c;
12125
+ const ftsCount = sqlite.prepare("SELECT count(*) as c FROM chunks_fts").get().c;
12126
+ let ftsInSync = chunkCount === ftsCount;
12127
+ if (ftsInSync) {
12128
+ const ftsShape = sqlite.prepare(
12129
+ `
12130
+ SELECT count(DISTINCT f.chunk_id) AS distinct_count,
12131
+ count(*) - count(c.id) AS orphan_count
12132
+ FROM chunks_fts f
12133
+ LEFT JOIN chunks c ON c.id = f.chunk_id
12134
+ `
12135
+ ).get();
12136
+ ftsInSync = ftsShape.distinct_count === chunkCount && ftsShape.orphan_count === 0;
12137
+ }
12138
+ if (!ftsInSync) {
12139
+ sqlite.exec(`
12140
+ INSERT INTO chunks_fts (chunk_id, path, heading, language, search_text)
12141
+ SELECT c.id, d.path, coalesce(c.heading, ''),
12142
+ coalesce(d.language, ''),
12143
+ ${composeFtsSearchTextSql("c.metadata", "c.content")}
12144
+ FROM chunks c
12145
+ INNER JOIN documents d ON d.id = c.document_id
12146
+ LEFT JOIN chunks_fts f ON f.chunk_id = c.id
12147
+ WHERE f.chunk_id IS NULL;
12148
+ `);
12149
+ sqlite.exec(`
12150
+ DELETE FROM chunks_fts
12151
+ WHERE chunk_id NOT IN (SELECT id FROM chunks);
12152
+ `);
12153
+ }
12131
12154
  }
12132
12155
  const hasTypeLabelIdx = sqlite.prepare(
12133
12156
  "SELECT count(*) as c FROM sqlite_master WHERE type='index' AND name='idx_graph_nodes_type_label'"
@@ -13205,10 +13228,134 @@ function createDocumentOps(native, stmts, streamNow) {
13205
13228
  const row = stmts.docById.get(id);
13206
13229
  return row ? mapDocumentRow(row) : null;
13207
13230
  },
13208
- async getDocumentByPath(path26) {
13209
- const row = stmts.docByPath.get(path26);
13231
+ async getDocumentByPath(path27) {
13232
+ const row = stmts.docByPath.get(path27);
13210
13233
  return row ? mapDocumentRow(row) : null;
13211
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
+ },
13212
13359
  async insertDocument(input) {
13213
13360
  const id = input.id ?? import_node_crypto3.default.randomUUID();
13214
13361
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -13357,11 +13504,13 @@ function createDocumentOps(native, stmts, streamNow) {
13357
13504
  ...chunkOps
13358
13505
  };
13359
13506
  }
13360
- var import_node_crypto3;
13507
+ var import_node_crypto3, import_node_fs5, import_node_path6;
13361
13508
  var init_document_repository = __esm({
13362
13509
  "../../packages/db/src/sqlite/document-repository.ts"() {
13363
13510
  "use strict";
13364
13511
  import_node_crypto3 = __toESM(require("crypto"), 1);
13512
+ import_node_fs5 = __toESM(require("fs"), 1);
13513
+ import_node_path6 = __toESM(require("path"), 1);
13365
13514
  init_chunk_repository();
13366
13515
  }
13367
13516
  });
@@ -13961,6 +14110,16 @@ function createWorkspaceRepository(rootPath) {
13961
14110
  insertDoc: native.prepare(
13962
14111
  "INSERT INTO documents (id, path, absolute_path, kind, language, content_hash, size_bytes, mtime_ms, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
13963
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
+ ),
13964
14123
  chunksByDoc: native.prepare("SELECT * FROM chunks WHERE document_id = ? ORDER BY chunk_index"),
13965
14124
  insertChunk: native.prepare(
13966
14125
  "INSERT INTO chunks (id, document_id, chunk_index, heading, content, token_count, content_hash, metadata, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
@@ -14156,14 +14315,14 @@ var init_repository = __esm({
14156
14315
 
14157
14316
  // ../../packages/db/src/sqlite/local-workspace.ts
14158
14317
  function getLocalWorkspaceDir(rootPath) {
14159
- 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);
14160
14319
  }
14161
14320
  function getLocalWorkspaceConfigPath(rootPath) {
14162
- return import_node_path6.default.join(getLocalWorkspaceDir(rootPath), WORKSPACE_CONFIG_FILENAME);
14321
+ return import_node_path7.default.join(getLocalWorkspaceDir(rootPath), WORKSPACE_CONFIG_FILENAME);
14163
14322
  }
14164
14323
  async function writeLocalWorkspaceConfig(workspace) {
14165
14324
  const configPath = getLocalWorkspaceConfigPath(workspace.rootPath);
14166
- 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 });
14167
14326
  await import_promises4.default.writeFile(
14168
14327
  configPath,
14169
14328
  JSON.stringify(
@@ -14181,7 +14340,7 @@ async function writeLocalWorkspaceConfig(workspace) {
14181
14340
  await ensureGitignoreEntry(workspace.rootPath, OPENEZ_DIRNAME);
14182
14341
  }
14183
14342
  async function ensureGitignoreEntry(rootPath, entry) {
14184
- const gitignorePath = import_node_path6.default.join(rootPath, GITIGNORE);
14343
+ const gitignorePath = import_node_path7.default.join(rootPath, GITIGNORE);
14185
14344
  let content = "";
14186
14345
  try {
14187
14346
  content = await import_promises4.default.readFile(gitignorePath, "utf8");
@@ -14212,33 +14371,33 @@ async function readLocalWorkspaceConfig(rootPath) {
14212
14371
  }
14213
14372
  }
14214
14373
  async function findLocalWorkspaceConfig(startPath) {
14215
- let currentPath = import_node_path6.default.resolve(startPath);
14374
+ let currentPath = import_node_path7.default.resolve(startPath);
14216
14375
  try {
14217
14376
  const stat4 = await import_promises4.default.stat(currentPath);
14218
14377
  if (!stat4.isDirectory()) {
14219
- currentPath = import_node_path6.default.dirname(currentPath);
14378
+ currentPath = import_node_path7.default.dirname(currentPath);
14220
14379
  }
14221
14380
  } catch {
14222
- currentPath = import_node_path6.default.dirname(currentPath);
14381
+ currentPath = import_node_path7.default.dirname(currentPath);
14223
14382
  }
14224
14383
  while (true) {
14225
14384
  const config2 = await readLocalWorkspaceConfig(currentPath);
14226
14385
  if (config2) {
14227
14386
  return config2;
14228
14387
  }
14229
- const parentPath = import_node_path6.default.dirname(currentPath);
14388
+ const parentPath = import_node_path7.default.dirname(currentPath);
14230
14389
  if (parentPath === currentPath) {
14231
14390
  return null;
14232
14391
  }
14233
14392
  currentPath = parentPath;
14234
14393
  }
14235
14394
  }
14236
- 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;
14237
14396
  var init_local_workspace = __esm({
14238
14397
  "../../packages/db/src/sqlite/local-workspace.ts"() {
14239
14398
  "use strict";
14240
14399
  import_promises4 = __toESM(require("fs/promises"), 1);
14241
- import_node_path6 = __toESM(require("path"), 1);
14400
+ import_node_path7 = __toESM(require("path"), 1);
14242
14401
  OPENEZ_DIRNAME = ".openez";
14243
14402
  WORKSPACE_CONFIG_FILENAME = "workspace.json";
14244
14403
  GITIGNORE = ".gitignore";
@@ -14426,8 +14585,8 @@ var require_package = __commonJS({
14426
14585
  var require_main = __commonJS({
14427
14586
  "../../node_modules/.pnpm/dotenv@16.6.1/node_modules/dotenv/lib/main.js"(exports2, module4) {
14428
14587
  "use strict";
14429
- var fs23 = require("fs");
14430
- var path26 = require("path");
14588
+ var fs24 = require("fs");
14589
+ var path27 = require("path");
14431
14590
  var os10 = require("os");
14432
14591
  var crypto13 = require("crypto");
14433
14592
  var packageJson = require_package();
@@ -14535,7 +14694,7 @@ var require_main = __commonJS({
14535
14694
  if (options && options.path && options.path.length > 0) {
14536
14695
  if (Array.isArray(options.path)) {
14537
14696
  for (const filepath of options.path) {
14538
- if (fs23.existsSync(filepath)) {
14697
+ if (fs24.existsSync(filepath)) {
14539
14698
  possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
14540
14699
  }
14541
14700
  }
@@ -14543,15 +14702,15 @@ var require_main = __commonJS({
14543
14702
  possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
14544
14703
  }
14545
14704
  } else {
14546
- possibleVaultPath = path26.resolve(process.cwd(), ".env.vault");
14705
+ possibleVaultPath = path27.resolve(process.cwd(), ".env.vault");
14547
14706
  }
14548
- if (fs23.existsSync(possibleVaultPath)) {
14707
+ if (fs24.existsSync(possibleVaultPath)) {
14549
14708
  return possibleVaultPath;
14550
14709
  }
14551
14710
  return null;
14552
14711
  }
14553
14712
  function _resolveHome(envPath) {
14554
- return envPath[0] === "~" ? path26.join(os10.homedir(), envPath.slice(1)) : envPath;
14713
+ return envPath[0] === "~" ? path27.join(os10.homedir(), envPath.slice(1)) : envPath;
14555
14714
  }
14556
14715
  function _configVault(options) {
14557
14716
  const debug = Boolean(options && options.debug);
@@ -14568,7 +14727,7 @@ var require_main = __commonJS({
14568
14727
  return { parsed };
14569
14728
  }
14570
14729
  function configDotenv(options) {
14571
- const dotenvPath = path26.resolve(process.cwd(), ".env");
14730
+ const dotenvPath = path27.resolve(process.cwd(), ".env");
14572
14731
  let encoding = "utf8";
14573
14732
  const debug = Boolean(options && options.debug);
14574
14733
  const quiet = options && "quiet" in options ? options.quiet : true;
@@ -14592,13 +14751,13 @@ var require_main = __commonJS({
14592
14751
  }
14593
14752
  let lastError;
14594
14753
  const parsedAll = {};
14595
- for (const path27 of optionPaths) {
14754
+ for (const path28 of optionPaths) {
14596
14755
  try {
14597
- const parsed = DotenvModule.parse(fs23.readFileSync(path27, { encoding }));
14756
+ const parsed = DotenvModule.parse(fs24.readFileSync(path28, { encoding }));
14598
14757
  DotenvModule.populate(parsedAll, parsed, options);
14599
14758
  } catch (e) {
14600
14759
  if (debug) {
14601
- _debug(`Failed to load ${path27} ${e.message}`);
14760
+ _debug(`Failed to load ${path28} ${e.message}`);
14602
14761
  }
14603
14762
  lastError = e;
14604
14763
  }
@@ -14613,7 +14772,7 @@ var require_main = __commonJS({
14613
14772
  const shortPaths = [];
14614
14773
  for (const filePath of optionPaths) {
14615
14774
  try {
14616
- const relative3 = path26.relative(process.cwd(), filePath);
14775
+ const relative3 = path27.relative(process.cwd(), filePath);
14617
14776
  shortPaths.push(relative3);
14618
14777
  } catch (e) {
14619
14778
  if (debug) {
@@ -15130,8 +15289,8 @@ var init_parseUtil = __esm({
15130
15289
  init_errors2();
15131
15290
  init_en();
15132
15291
  makeIssue = (params) => {
15133
- const { data, path: path26, errorMaps, issueData } = params;
15134
- const fullPath = [...path26, ...issueData.path || []];
15292
+ const { data, path: path27, errorMaps, issueData } = params;
15293
+ const fullPath = [...path27, ...issueData.path || []];
15135
15294
  const fullIssue = {
15136
15295
  ...issueData,
15137
15296
  path: fullPath
@@ -15442,11 +15601,11 @@ var init_types = __esm({
15442
15601
  init_parseUtil();
15443
15602
  init_util();
15444
15603
  ParseInputLazyPath = class {
15445
- constructor(parent, value, path26, key) {
15604
+ constructor(parent, value, path27, key) {
15446
15605
  this._cachedPath = [];
15447
15606
  this.parent = parent;
15448
15607
  this.data = value;
15449
- this._path = path26;
15608
+ this._path = path27;
15450
15609
  this._key = key;
15451
15610
  }
15452
15611
  get path() {
@@ -18833,18 +18992,18 @@ var init_zod = __esm({
18833
18992
  function loadDotenvFromWorkspaceRoot() {
18834
18993
  let currentDir;
18835
18994
  try {
18836
- 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));
18837
18996
  } catch {
18838
18997
  currentDir = typeof __dirname !== "undefined" ? __dirname : process.cwd();
18839
18998
  }
18840
18999
  let searchDir = currentDir;
18841
19000
  while (true) {
18842
- const candidate = import_node_path7.default.join(searchDir, ".env");
18843
- 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)) {
18844
19003
  import_dotenv.default.config({ path: candidate });
18845
19004
  return;
18846
19005
  }
18847
- const parentDir = import_node_path7.default.dirname(searchDir);
19006
+ const parentDir = import_node_path8.default.dirname(searchDir);
18848
19007
  if (parentDir === searchDir) {
18849
19008
  break;
18850
19009
  }
@@ -18855,12 +19014,12 @@ function loadDotenvFromWorkspaceRoot() {
18855
19014
  function loadEnv() {
18856
19015
  return envSchema.parse(process.env);
18857
19016
  }
18858
- 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;
18859
19018
  var init_env = __esm({
18860
19019
  "../../packages/config/src/env.ts"() {
18861
19020
  "use strict";
18862
- import_node_fs5 = __toESM(require("fs"), 1);
18863
- import_node_path7 = __toESM(require("path"), 1);
19021
+ import_node_fs6 = __toESM(require("fs"), 1);
19022
+ import_node_path8 = __toESM(require("path"), 1);
18864
19023
  import_node_url = require("url");
18865
19024
  import_dotenv = __toESM(require_main(), 1);
18866
19025
  init_zod();
@@ -18905,15 +19064,15 @@ var init_types2 = __esm({
18905
19064
 
18906
19065
  // ../../packages/config/src/load-brain-config.ts
18907
19066
  function findConfigFile(startDir) {
18908
- let current = import_node_path8.default.resolve(startDir);
19067
+ let current = import_node_path9.default.resolve(startDir);
18909
19068
  while (true) {
18910
19069
  for (const fileName of CONFIG_FILE_CANDIDATES) {
18911
- const candidate = import_node_path8.default.join(current, fileName);
18912
- 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)) {
18913
19072
  return candidate;
18914
19073
  }
18915
19074
  }
18916
- const parent = import_node_path8.default.dirname(current);
19075
+ const parent = import_node_path9.default.dirname(current);
18917
19076
  if (parent === current) {
18918
19077
  return null;
18919
19078
  }
@@ -18921,10 +19080,10 @@ function findConfigFile(startDir) {
18921
19080
  }
18922
19081
  }
18923
19082
  function resolveWorkspace(configFile, workspace) {
18924
- const configDir = import_node_path8.default.dirname(configFile);
19083
+ const configDir = import_node_path9.default.dirname(configFile);
18925
19084
  return {
18926
19085
  ...workspace,
18927
- root: import_node_path8.default.resolve(configDir, workspace.root)
19086
+ root: import_node_path9.default.resolve(configDir, workspace.root)
18928
19087
  };
18929
19088
  }
18930
19089
  async function loadBrainConfig(startDir = process.cwd()) {
@@ -18964,13 +19123,13 @@ async function getBrainSettings(startDir = process.cwd()) {
18964
19123
  retrieval: config2.retrieval ?? defaults2.retrieval
18965
19124
  };
18966
19125
  }
18967
- 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;
18968
19127
  var init_load_brain_config = __esm({
18969
19128
  "../../packages/config/src/load-brain-config.ts"() {
18970
19129
  "use strict";
18971
19130
  import_promises6 = __toESM(require("fs/promises"), 1);
18972
- import_node_path8 = __toESM(require("path"), 1);
18973
- import_node_fs6 = require("fs");
19131
+ import_node_path9 = __toESM(require("path"), 1);
19132
+ import_node_fs7 = require("fs");
18974
19133
  init_types2();
18975
19134
  CONFIG_FILE_CANDIDATES = ["brain.config.mjs", "brain.config.js", "brain.config.ts"];
18976
19135
  }
@@ -20770,18 +20929,18 @@ var init_resource = __esm({
20770
20929
  function encodeURIPath(str2) {
20771
20930
  return str2.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
20772
20931
  }
20773
- var EMPTY, createPathTagFunction, path8;
20932
+ var EMPTY, createPathTagFunction, path9;
20774
20933
  var init_path = __esm({
20775
20934
  "../../node_modules/.pnpm/openai@5.23.2_zod@3.25.76/node_modules/openai/internal/utils/path.mjs"() {
20776
20935
  "use strict";
20777
20936
  init_error();
20778
20937
  EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
20779
- createPathTagFunction = (pathEncoder = encodeURIPath) => function path26(statics, ...params) {
20938
+ createPathTagFunction = (pathEncoder = encodeURIPath) => function path27(statics, ...params) {
20780
20939
  if (statics.length === 1)
20781
20940
  return statics[0];
20782
20941
  let postPath = false;
20783
20942
  const invalidSegments = [];
20784
- const path27 = statics.reduce((previousValue, currentValue, index2) => {
20943
+ const path28 = statics.reduce((previousValue, currentValue, index2) => {
20785
20944
  if (/[?#]/.test(currentValue)) {
20786
20945
  postPath = true;
20787
20946
  }
@@ -20798,7 +20957,7 @@ var init_path = __esm({
20798
20957
  }
20799
20958
  return previousValue + currentValue + (index2 === params.length ? "" : encoded);
20800
20959
  }, "");
20801
- const pathOnly = path27.split(/[?#]/, 1)[0];
20960
+ const pathOnly = path28.split(/[?#]/, 1)[0];
20802
20961
  const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
20803
20962
  let match2;
20804
20963
  while ((match2 = invalidSegmentPattern.exec(pathOnly)) !== null) {
@@ -20819,12 +20978,12 @@ var init_path = __esm({
20819
20978
  }, "");
20820
20979
  throw new OpenAIError(`Path parameters result in path with invalid segments:
20821
20980
  ${invalidSegments.map((e) => e.error).join("\n")}
20822
- ${path27}
20981
+ ${path28}
20823
20982
  ${underline}`);
20824
20983
  }
20825
- return path27;
20984
+ return path28;
20826
20985
  };
20827
- path8 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
20986
+ path9 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
20828
20987
  }
20829
20988
  });
20830
20989
 
@@ -20852,7 +21011,7 @@ var init_messages = __esm({
20852
21011
  * ```
20853
21012
  */
20854
21013
  list(completionID, query = {}, options) {
20855
- 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 });
20856
21015
  }
20857
21016
  };
20858
21017
  }
@@ -22259,7 +22418,7 @@ var init_completions = __esm({
22259
22418
  * ```
22260
22419
  */
22261
22420
  retrieve(completionID, options) {
22262
- return this._client.get(path8`/chat/completions/${completionID}`, options);
22421
+ return this._client.get(path9`/chat/completions/${completionID}`, options);
22263
22422
  }
22264
22423
  /**
22265
22424
  * Modify a stored chat completion. Only Chat Completions that have been created
@@ -22275,7 +22434,7 @@ var init_completions = __esm({
22275
22434
  * ```
22276
22435
  */
22277
22436
  update(completionID, body, options) {
22278
- return this._client.post(path8`/chat/completions/${completionID}`, { body, ...options });
22437
+ return this._client.post(path9`/chat/completions/${completionID}`, { body, ...options });
22279
22438
  }
22280
22439
  /**
22281
22440
  * List stored Chat Completions. Only Chat Completions that have been stored with
@@ -22303,7 +22462,7 @@ var init_completions = __esm({
22303
22462
  * ```
22304
22463
  */
22305
22464
  delete(completionID, options) {
22306
- return this._client.delete(path8`/chat/completions/${completionID}`, options);
22465
+ return this._client.delete(path9`/chat/completions/${completionID}`, options);
22307
22466
  }
22308
22467
  parse(body, options) {
22309
22468
  validateInputTools(body.tools);
@@ -22561,7 +22720,7 @@ var init_batches = __esm({
22561
22720
  * Retrieves a batch.
22562
22721
  */
22563
22722
  retrieve(batchID, options) {
22564
- return this._client.get(path8`/batches/${batchID}`, options);
22723
+ return this._client.get(path9`/batches/${batchID}`, options);
22565
22724
  }
22566
22725
  /**
22567
22726
  * List your organization's batches.
@@ -22575,7 +22734,7 @@ var init_batches = __esm({
22575
22734
  * (if any) available in the output file.
22576
22735
  */
22577
22736
  cancel(batchID, options) {
22578
- return this._client.post(path8`/batches/${batchID}/cancel`, options);
22737
+ return this._client.post(path9`/batches/${batchID}/cancel`, options);
22579
22738
  }
22580
22739
  };
22581
22740
  }
@@ -22619,7 +22778,7 @@ var init_assistants = __esm({
22619
22778
  * ```
22620
22779
  */
22621
22780
  retrieve(assistantID, options) {
22622
- return this._client.get(path8`/assistants/${assistantID}`, {
22781
+ return this._client.get(path9`/assistants/${assistantID}`, {
22623
22782
  ...options,
22624
22783
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
22625
22784
  });
@@ -22635,7 +22794,7 @@ var init_assistants = __esm({
22635
22794
  * ```
22636
22795
  */
22637
22796
  update(assistantID, body, options) {
22638
- return this._client.post(path8`/assistants/${assistantID}`, {
22797
+ return this._client.post(path9`/assistants/${assistantID}`, {
22639
22798
  body,
22640
22799
  ...options,
22641
22800
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -22669,7 +22828,7 @@ var init_assistants = __esm({
22669
22828
  * ```
22670
22829
  */
22671
22830
  delete(assistantID, options) {
22672
- return this._client.delete(path8`/assistants/${assistantID}`, {
22831
+ return this._client.delete(path9`/assistants/${assistantID}`, {
22673
22832
  ...options,
22674
22833
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
22675
22834
  });
@@ -22784,7 +22943,7 @@ var init_messages2 = __esm({
22784
22943
  * @deprecated The Assistants API is deprecated in favor of the Responses API
22785
22944
  */
22786
22945
  create(threadID, body, options) {
22787
- return this._client.post(path8`/threads/${threadID}/messages`, {
22946
+ return this._client.post(path9`/threads/${threadID}/messages`, {
22788
22947
  body,
22789
22948
  ...options,
22790
22949
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -22797,7 +22956,7 @@ var init_messages2 = __esm({
22797
22956
  */
22798
22957
  retrieve(messageID, params, options) {
22799
22958
  const { thread_id } = params;
22800
- return this._client.get(path8`/threads/${thread_id}/messages/${messageID}`, {
22959
+ return this._client.get(path9`/threads/${thread_id}/messages/${messageID}`, {
22801
22960
  ...options,
22802
22961
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
22803
22962
  });
@@ -22809,7 +22968,7 @@ var init_messages2 = __esm({
22809
22968
  */
22810
22969
  update(messageID, params, options) {
22811
22970
  const { thread_id, ...body } = params;
22812
- return this._client.post(path8`/threads/${thread_id}/messages/${messageID}`, {
22971
+ return this._client.post(path9`/threads/${thread_id}/messages/${messageID}`, {
22813
22972
  body,
22814
22973
  ...options,
22815
22974
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -22821,7 +22980,7 @@ var init_messages2 = __esm({
22821
22980
  * @deprecated The Assistants API is deprecated in favor of the Responses API
22822
22981
  */
22823
22982
  list(threadID, query = {}, options) {
22824
- return this._client.getAPIList(path8`/threads/${threadID}/messages`, CursorPage, {
22983
+ return this._client.getAPIList(path9`/threads/${threadID}/messages`, CursorPage, {
22825
22984
  query,
22826
22985
  ...options,
22827
22986
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -22834,7 +22993,7 @@ var init_messages2 = __esm({
22834
22993
  */
22835
22994
  delete(messageID, params, options) {
22836
22995
  const { thread_id } = params;
22837
- return this._client.delete(path8`/threads/${thread_id}/messages/${messageID}`, {
22996
+ return this._client.delete(path9`/threads/${thread_id}/messages/${messageID}`, {
22838
22997
  ...options,
22839
22998
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
22840
22999
  });
@@ -22860,7 +23019,7 @@ var init_steps = __esm({
22860
23019
  */
22861
23020
  retrieve(stepID, params, options) {
22862
23021
  const { thread_id, run_id, ...query } = params;
22863
- 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}`, {
22864
23023
  query,
22865
23024
  ...options,
22866
23025
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -22873,7 +23032,7 @@ var init_steps = __esm({
22873
23032
  */
22874
23033
  list(runID, params, options) {
22875
23034
  const { thread_id, ...query } = params;
22876
- 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, {
22877
23036
  query,
22878
23037
  ...options,
22879
23038
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -23484,7 +23643,7 @@ var init_runs = __esm({
23484
23643
  }
23485
23644
  create(threadID, params, options) {
23486
23645
  const { include, ...body } = params;
23487
- return this._client.post(path8`/threads/${threadID}/runs`, {
23646
+ return this._client.post(path9`/threads/${threadID}/runs`, {
23488
23647
  query: { include },
23489
23648
  body,
23490
23649
  ...options,
@@ -23499,7 +23658,7 @@ var init_runs = __esm({
23499
23658
  */
23500
23659
  retrieve(runID, params, options) {
23501
23660
  const { thread_id } = params;
23502
- return this._client.get(path8`/threads/${thread_id}/runs/${runID}`, {
23661
+ return this._client.get(path9`/threads/${thread_id}/runs/${runID}`, {
23503
23662
  ...options,
23504
23663
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
23505
23664
  });
@@ -23511,7 +23670,7 @@ var init_runs = __esm({
23511
23670
  */
23512
23671
  update(runID, params, options) {
23513
23672
  const { thread_id, ...body } = params;
23514
- return this._client.post(path8`/threads/${thread_id}/runs/${runID}`, {
23673
+ return this._client.post(path9`/threads/${thread_id}/runs/${runID}`, {
23515
23674
  body,
23516
23675
  ...options,
23517
23676
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -23523,7 +23682,7 @@ var init_runs = __esm({
23523
23682
  * @deprecated The Assistants API is deprecated in favor of the Responses API
23524
23683
  */
23525
23684
  list(threadID, query = {}, options) {
23526
- return this._client.getAPIList(path8`/threads/${threadID}/runs`, CursorPage, {
23685
+ return this._client.getAPIList(path9`/threads/${threadID}/runs`, CursorPage, {
23527
23686
  query,
23528
23687
  ...options,
23529
23688
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -23536,7 +23695,7 @@ var init_runs = __esm({
23536
23695
  */
23537
23696
  cancel(runID, params, options) {
23538
23697
  const { thread_id } = params;
23539
- return this._client.post(path8`/threads/${thread_id}/runs/${runID}/cancel`, {
23698
+ return this._client.post(path9`/threads/${thread_id}/runs/${runID}/cancel`, {
23540
23699
  ...options,
23541
23700
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
23542
23701
  });
@@ -23614,7 +23773,7 @@ var init_runs = __esm({
23614
23773
  }
23615
23774
  submitToolOutputs(runID, params, options) {
23616
23775
  const { thread_id, ...body } = params;
23617
- 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`, {
23618
23777
  body,
23619
23778
  ...options,
23620
23779
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
@@ -23680,7 +23839,7 @@ var init_threads = __esm({
23680
23839
  * @deprecated The Assistants API is deprecated in favor of the Responses API
23681
23840
  */
23682
23841
  retrieve(threadID, options) {
23683
- return this._client.get(path8`/threads/${threadID}`, {
23842
+ return this._client.get(path9`/threads/${threadID}`, {
23684
23843
  ...options,
23685
23844
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
23686
23845
  });
@@ -23691,7 +23850,7 @@ var init_threads = __esm({
23691
23850
  * @deprecated The Assistants API is deprecated in favor of the Responses API
23692
23851
  */
23693
23852
  update(threadID, body, options) {
23694
- return this._client.post(path8`/threads/${threadID}`, {
23853
+ return this._client.post(path9`/threads/${threadID}`, {
23695
23854
  body,
23696
23855
  ...options,
23697
23856
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -23703,7 +23862,7 @@ var init_threads = __esm({
23703
23862
  * @deprecated The Assistants API is deprecated in favor of the Responses API
23704
23863
  */
23705
23864
  delete(threadID, options) {
23706
- return this._client.delete(path8`/threads/${threadID}`, {
23865
+ return this._client.delete(path9`/threads/${threadID}`, {
23707
23866
  ...options,
23708
23867
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
23709
23868
  });
@@ -23791,7 +23950,7 @@ var init_content = __esm({
23791
23950
  */
23792
23951
  retrieve(fileID, params, options) {
23793
23952
  const { container_id } = params;
23794
- return this._client.get(path8`/containers/${container_id}/files/${fileID}/content`, {
23953
+ return this._client.get(path9`/containers/${container_id}/files/${fileID}/content`, {
23795
23954
  ...options,
23796
23955
  headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
23797
23956
  __binaryResponse: true
@@ -23825,20 +23984,20 @@ var init_files = __esm({
23825
23984
  * a JSON request with a file ID.
23826
23985
  */
23827
23986
  create(containerID, body, options) {
23828
- 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));
23829
23988
  }
23830
23989
  /**
23831
23990
  * Retrieve Container File
23832
23991
  */
23833
23992
  retrieve(fileID, params, options) {
23834
23993
  const { container_id } = params;
23835
- return this._client.get(path8`/containers/${container_id}/files/${fileID}`, options);
23994
+ return this._client.get(path9`/containers/${container_id}/files/${fileID}`, options);
23836
23995
  }
23837
23996
  /**
23838
23997
  * List Container files
23839
23998
  */
23840
23999
  list(containerID, query = {}, options) {
23841
- return this._client.getAPIList(path8`/containers/${containerID}/files`, CursorPage, {
24000
+ return this._client.getAPIList(path9`/containers/${containerID}/files`, CursorPage, {
23842
24001
  query,
23843
24002
  ...options
23844
24003
  });
@@ -23848,7 +24007,7 @@ var init_files = __esm({
23848
24007
  */
23849
24008
  delete(fileID, params, options) {
23850
24009
  const { container_id } = params;
23851
- return this._client.delete(path8`/containers/${container_id}/files/${fileID}`, {
24010
+ return this._client.delete(path9`/containers/${container_id}/files/${fileID}`, {
23852
24011
  ...options,
23853
24012
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
23854
24013
  });
@@ -23884,7 +24043,7 @@ var init_containers = __esm({
23884
24043
  * Retrieve Container
23885
24044
  */
23886
24045
  retrieve(containerID, options) {
23887
- return this._client.get(path8`/containers/${containerID}`, options);
24046
+ return this._client.get(path9`/containers/${containerID}`, options);
23888
24047
  }
23889
24048
  /**
23890
24049
  * List Containers
@@ -23896,7 +24055,7 @@ var init_containers = __esm({
23896
24055
  * Delete Container
23897
24056
  */
23898
24057
  delete(containerID, options) {
23899
- return this._client.delete(path8`/containers/${containerID}`, {
24058
+ return this._client.delete(path9`/containers/${containerID}`, {
23900
24059
  ...options,
23901
24060
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
23902
24061
  });
@@ -23920,7 +24079,7 @@ var init_items = __esm({
23920
24079
  */
23921
24080
  create(conversationID, params, options) {
23922
24081
  const { include, ...body } = params;
23923
- return this._client.post(path8`/conversations/${conversationID}/items`, {
24082
+ return this._client.post(path9`/conversations/${conversationID}/items`, {
23924
24083
  query: { include },
23925
24084
  body,
23926
24085
  ...options
@@ -23931,20 +24090,20 @@ var init_items = __esm({
23931
24090
  */
23932
24091
  retrieve(itemID, params, options) {
23933
24092
  const { conversation_id, ...query } = params;
23934
- 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 });
23935
24094
  }
23936
24095
  /**
23937
24096
  * List all items for a conversation with the given ID.
23938
24097
  */
23939
24098
  list(conversationID, query = {}, options) {
23940
- return this._client.getAPIList(path8`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options });
24099
+ return this._client.getAPIList(path9`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options });
23941
24100
  }
23942
24101
  /**
23943
24102
  * Delete an item from a conversation with the given IDs.
23944
24103
  */
23945
24104
  delete(itemID, params, options) {
23946
24105
  const { conversation_id } = params;
23947
- return this._client.delete(path8`/conversations/${conversation_id}/items/${itemID}`, options);
24106
+ return this._client.delete(path9`/conversations/${conversation_id}/items/${itemID}`, options);
23948
24107
  }
23949
24108
  };
23950
24109
  }
@@ -23974,19 +24133,19 @@ var init_conversations = __esm({
23974
24133
  * Get a conversation
23975
24134
  */
23976
24135
  retrieve(conversationID, options) {
23977
- return this._client.get(path8`/conversations/${conversationID}`, options);
24136
+ return this._client.get(path9`/conversations/${conversationID}`, options);
23978
24137
  }
23979
24138
  /**
23980
24139
  * Update a conversation
23981
24140
  */
23982
24141
  update(conversationID, body, options) {
23983
- return this._client.post(path8`/conversations/${conversationID}`, { body, ...options });
24142
+ return this._client.post(path9`/conversations/${conversationID}`, { body, ...options });
23984
24143
  }
23985
24144
  /**
23986
24145
  * Delete a conversation. Items in the conversation will not be deleted.
23987
24146
  */
23988
24147
  delete(conversationID, options) {
23989
- return this._client.delete(path8`/conversations/${conversationID}`, options);
24148
+ return this._client.delete(path9`/conversations/${conversationID}`, options);
23990
24149
  }
23991
24150
  };
23992
24151
  Conversations.Items = Items;
@@ -24058,14 +24217,14 @@ var init_output_items = __esm({
24058
24217
  */
24059
24218
  retrieve(outputItemID, params, options) {
24060
24219
  const { eval_id, run_id } = params;
24061
- 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);
24062
24221
  }
24063
24222
  /**
24064
24223
  * Get a list of output items for an evaluation run.
24065
24224
  */
24066
24225
  list(runID, params, options) {
24067
24226
  const { eval_id, ...query } = params;
24068
- 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 });
24069
24228
  }
24070
24229
  };
24071
24230
  }
@@ -24092,20 +24251,20 @@ var init_runs2 = __esm({
24092
24251
  * schema specified in the config of the evaluation.
24093
24252
  */
24094
24253
  create(evalID, body, options) {
24095
- return this._client.post(path8`/evals/${evalID}/runs`, { body, ...options });
24254
+ return this._client.post(path9`/evals/${evalID}/runs`, { body, ...options });
24096
24255
  }
24097
24256
  /**
24098
24257
  * Get an evaluation run by ID.
24099
24258
  */
24100
24259
  retrieve(runID, params, options) {
24101
24260
  const { eval_id } = params;
24102
- return this._client.get(path8`/evals/${eval_id}/runs/${runID}`, options);
24261
+ return this._client.get(path9`/evals/${eval_id}/runs/${runID}`, options);
24103
24262
  }
24104
24263
  /**
24105
24264
  * Get a list of runs for an evaluation.
24106
24265
  */
24107
24266
  list(evalID, query = {}, options) {
24108
- return this._client.getAPIList(path8`/evals/${evalID}/runs`, CursorPage, {
24267
+ return this._client.getAPIList(path9`/evals/${evalID}/runs`, CursorPage, {
24109
24268
  query,
24110
24269
  ...options
24111
24270
  });
@@ -24115,14 +24274,14 @@ var init_runs2 = __esm({
24115
24274
  */
24116
24275
  delete(runID, params, options) {
24117
24276
  const { eval_id } = params;
24118
- return this._client.delete(path8`/evals/${eval_id}/runs/${runID}`, options);
24277
+ return this._client.delete(path9`/evals/${eval_id}/runs/${runID}`, options);
24119
24278
  }
24120
24279
  /**
24121
24280
  * Cancel an ongoing evaluation run.
24122
24281
  */
24123
24282
  cancel(runID, params, options) {
24124
24283
  const { eval_id } = params;
24125
- return this._client.post(path8`/evals/${eval_id}/runs/${runID}`, options);
24284
+ return this._client.post(path9`/evals/${eval_id}/runs/${runID}`, options);
24126
24285
  }
24127
24286
  };
24128
24287
  Runs2.OutputItems = OutputItems;
@@ -24159,13 +24318,13 @@ var init_evals = __esm({
24159
24318
  * Get an evaluation by ID.
24160
24319
  */
24161
24320
  retrieve(evalID, options) {
24162
- return this._client.get(path8`/evals/${evalID}`, options);
24321
+ return this._client.get(path9`/evals/${evalID}`, options);
24163
24322
  }
24164
24323
  /**
24165
24324
  * Update certain properties of an evaluation.
24166
24325
  */
24167
24326
  update(evalID, body, options) {
24168
- return this._client.post(path8`/evals/${evalID}`, { body, ...options });
24327
+ return this._client.post(path9`/evals/${evalID}`, { body, ...options });
24169
24328
  }
24170
24329
  /**
24171
24330
  * List evaluations for a project.
@@ -24177,7 +24336,7 @@ var init_evals = __esm({
24177
24336
  * Delete an evaluation.
24178
24337
  */
24179
24338
  delete(evalID, options) {
24180
- return this._client.delete(path8`/evals/${evalID}`, options);
24339
+ return this._client.delete(path9`/evals/${evalID}`, options);
24181
24340
  }
24182
24341
  };
24183
24342
  Evals.Runs = Runs2;
@@ -24227,7 +24386,7 @@ var init_files2 = __esm({
24227
24386
  * Returns information about a specific file.
24228
24387
  */
24229
24388
  retrieve(fileID, options) {
24230
- return this._client.get(path8`/files/${fileID}`, options);
24389
+ return this._client.get(path9`/files/${fileID}`, options);
24231
24390
  }
24232
24391
  /**
24233
24392
  * Returns a list of files.
@@ -24239,13 +24398,13 @@ var init_files2 = __esm({
24239
24398
  * Delete a file.
24240
24399
  */
24241
24400
  delete(fileID, options) {
24242
- return this._client.delete(path8`/files/${fileID}`, options);
24401
+ return this._client.delete(path9`/files/${fileID}`, options);
24243
24402
  }
24244
24403
  /**
24245
24404
  * Returns the contents of the specified file.
24246
24405
  */
24247
24406
  content(fileID, options) {
24248
- return this._client.get(path8`/files/${fileID}/content`, {
24407
+ return this._client.get(path9`/files/${fileID}/content`, {
24249
24408
  ...options,
24250
24409
  headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
24251
24410
  __binaryResponse: true
@@ -24380,7 +24539,7 @@ var init_permissions = __esm({
24380
24539
  * ```
24381
24540
  */
24382
24541
  create(fineTunedModelCheckpoint, body, options) {
24383
- 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 });
24384
24543
  }
24385
24544
  /**
24386
24545
  * **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
@@ -24397,7 +24556,7 @@ var init_permissions = __esm({
24397
24556
  * ```
24398
24557
  */
24399
24558
  retrieve(fineTunedModelCheckpoint, query = {}, options) {
24400
- return this._client.get(path8`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, {
24559
+ return this._client.get(path9`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, {
24401
24560
  query,
24402
24561
  ...options
24403
24562
  });
@@ -24422,7 +24581,7 @@ var init_permissions = __esm({
24422
24581
  */
24423
24582
  delete(permissionID, params, options) {
24424
24583
  const { fine_tuned_model_checkpoint } = params;
24425
- 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);
24426
24585
  }
24427
24586
  };
24428
24587
  }
@@ -24469,7 +24628,7 @@ var init_checkpoints2 = __esm({
24469
24628
  * ```
24470
24629
  */
24471
24630
  list(fineTuningJobID, query = {}, options) {
24472
- 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 });
24473
24632
  }
24474
24633
  };
24475
24634
  }
@@ -24523,7 +24682,7 @@ var init_jobs = __esm({
24523
24682
  * ```
24524
24683
  */
24525
24684
  retrieve(fineTuningJobID, options) {
24526
- return this._client.get(path8`/fine_tuning/jobs/${fineTuningJobID}`, options);
24685
+ return this._client.get(path9`/fine_tuning/jobs/${fineTuningJobID}`, options);
24527
24686
  }
24528
24687
  /**
24529
24688
  * List your organization's fine-tuning jobs
@@ -24550,7 +24709,7 @@ var init_jobs = __esm({
24550
24709
  * ```
24551
24710
  */
24552
24711
  cancel(fineTuningJobID, options) {
24553
- return this._client.post(path8`/fine_tuning/jobs/${fineTuningJobID}/cancel`, options);
24712
+ return this._client.post(path9`/fine_tuning/jobs/${fineTuningJobID}/cancel`, options);
24554
24713
  }
24555
24714
  /**
24556
24715
  * Get status updates for a fine-tuning job.
@@ -24566,7 +24725,7 @@ var init_jobs = __esm({
24566
24725
  * ```
24567
24726
  */
24568
24727
  listEvents(fineTuningJobID, query = {}, options) {
24569
- 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 });
24570
24729
  }
24571
24730
  /**
24572
24731
  * Pause a fine-tune job.
@@ -24579,7 +24738,7 @@ var init_jobs = __esm({
24579
24738
  * ```
24580
24739
  */
24581
24740
  pause(fineTuningJobID, options) {
24582
- return this._client.post(path8`/fine_tuning/jobs/${fineTuningJobID}/pause`, options);
24741
+ return this._client.post(path9`/fine_tuning/jobs/${fineTuningJobID}/pause`, options);
24583
24742
  }
24584
24743
  /**
24585
24744
  * Resume a fine-tune job.
@@ -24592,7 +24751,7 @@ var init_jobs = __esm({
24592
24751
  * ```
24593
24752
  */
24594
24753
  resume(fineTuningJobID, options) {
24595
- return this._client.post(path8`/fine_tuning/jobs/${fineTuningJobID}/resume`, options);
24754
+ return this._client.post(path9`/fine_tuning/jobs/${fineTuningJobID}/resume`, options);
24596
24755
  }
24597
24756
  };
24598
24757
  Jobs.Checkpoints = Checkpoints2;
@@ -24703,7 +24862,7 @@ var init_models = __esm({
24703
24862
  * the owner and permissioning.
24704
24863
  */
24705
24864
  retrieve(model, options) {
24706
- return this._client.get(path8`/models/${model}`, options);
24865
+ return this._client.get(path9`/models/${model}`, options);
24707
24866
  }
24708
24867
  /**
24709
24868
  * Lists the currently available models, and provides basic information about each
@@ -24717,7 +24876,7 @@ var init_models = __esm({
24717
24876
  * delete a model.
24718
24877
  */
24719
24878
  delete(model, options) {
24720
- return this._client.delete(path8`/models/${model}`, options);
24879
+ return this._client.delete(path9`/models/${model}`, options);
24721
24880
  }
24722
24881
  };
24723
24882
  }
@@ -25191,7 +25350,7 @@ var init_input_items = __esm({
25191
25350
  * ```
25192
25351
  */
25193
25352
  list(responseID, query = {}, options) {
25194
- 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 });
25195
25354
  }
25196
25355
  };
25197
25356
  }
@@ -25223,7 +25382,7 @@ var init_responses = __esm({
25223
25382
  });
25224
25383
  }
25225
25384
  retrieve(responseID, query = {}, options) {
25226
- return this._client.get(path8`/responses/${responseID}`, {
25385
+ return this._client.get(path9`/responses/${responseID}`, {
25227
25386
  query,
25228
25387
  ...options,
25229
25388
  stream: query?.stream ?? false
@@ -25245,7 +25404,7 @@ var init_responses = __esm({
25245
25404
  * ```
25246
25405
  */
25247
25406
  delete(responseID, options) {
25248
- return this._client.delete(path8`/responses/${responseID}`, {
25407
+ return this._client.delete(path9`/responses/${responseID}`, {
25249
25408
  ...options,
25250
25409
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
25251
25410
  });
@@ -25272,7 +25431,7 @@ var init_responses = __esm({
25272
25431
  * ```
25273
25432
  */
25274
25433
  cancel(responseID, options) {
25275
- return this._client.post(path8`/responses/${responseID}/cancel`, options);
25434
+ return this._client.post(path9`/responses/${responseID}/cancel`, options);
25276
25435
  }
25277
25436
  };
25278
25437
  Responses.InputItems = InputItems;
@@ -25302,7 +25461,7 @@ var init_parts = __esm({
25302
25461
  * [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete).
25303
25462
  */
25304
25463
  create(uploadID, body, options) {
25305
- 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));
25306
25465
  }
25307
25466
  };
25308
25467
  }
@@ -25350,7 +25509,7 @@ var init_uploads3 = __esm({
25350
25509
  * Cancels the Upload. No Parts may be added after an Upload is cancelled.
25351
25510
  */
25352
25511
  cancel(uploadID, options) {
25353
- return this._client.post(path8`/uploads/${uploadID}/cancel`, options);
25512
+ return this._client.post(path9`/uploads/${uploadID}/cancel`, options);
25354
25513
  }
25355
25514
  /**
25356
25515
  * Completes the
@@ -25368,7 +25527,7 @@ var init_uploads3 = __esm({
25368
25527
  * an Upload is completed.
25369
25528
  */
25370
25529
  complete(uploadID, body, options) {
25371
- return this._client.post(path8`/uploads/${uploadID}/complete`, { body, ...options });
25530
+ return this._client.post(path9`/uploads/${uploadID}/complete`, { body, ...options });
25372
25531
  }
25373
25532
  };
25374
25533
  Uploads.Parts = Parts;
@@ -25416,7 +25575,7 @@ var init_file_batches = __esm({
25416
25575
  * Create a vector store file batch.
25417
25576
  */
25418
25577
  create(vectorStoreID, body, options) {
25419
- return this._client.post(path8`/vector_stores/${vectorStoreID}/file_batches`, {
25578
+ return this._client.post(path9`/vector_stores/${vectorStoreID}/file_batches`, {
25420
25579
  body,
25421
25580
  ...options,
25422
25581
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -25427,7 +25586,7 @@ var init_file_batches = __esm({
25427
25586
  */
25428
25587
  retrieve(batchID, params, options) {
25429
25588
  const { vector_store_id } = params;
25430
- 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}`, {
25431
25590
  ...options,
25432
25591
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25433
25592
  });
@@ -25438,7 +25597,7 @@ var init_file_batches = __esm({
25438
25597
  */
25439
25598
  cancel(batchID, params, options) {
25440
25599
  const { vector_store_id } = params;
25441
- 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`, {
25442
25601
  ...options,
25443
25602
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25444
25603
  });
@@ -25455,7 +25614,7 @@ var init_file_batches = __esm({
25455
25614
  */
25456
25615
  listFiles(batchID, params, options) {
25457
25616
  const { vector_store_id, ...query } = params;
25458
- 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]) });
25459
25618
  }
25460
25619
  /**
25461
25620
  * Wait for the given file batch to be processed.
@@ -25546,7 +25705,7 @@ var init_files3 = __esm({
25546
25705
  * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object).
25547
25706
  */
25548
25707
  create(vectorStoreID, body, options) {
25549
- return this._client.post(path8`/vector_stores/${vectorStoreID}/files`, {
25708
+ return this._client.post(path9`/vector_stores/${vectorStoreID}/files`, {
25550
25709
  body,
25551
25710
  ...options,
25552
25711
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -25557,7 +25716,7 @@ var init_files3 = __esm({
25557
25716
  */
25558
25717
  retrieve(fileID, params, options) {
25559
25718
  const { vector_store_id } = params;
25560
- 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}`, {
25561
25720
  ...options,
25562
25721
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25563
25722
  });
@@ -25567,7 +25726,7 @@ var init_files3 = __esm({
25567
25726
  */
25568
25727
  update(fileID, params, options) {
25569
25728
  const { vector_store_id, ...body } = params;
25570
- 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}`, {
25571
25730
  body,
25572
25731
  ...options,
25573
25732
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -25577,7 +25736,7 @@ var init_files3 = __esm({
25577
25736
  * Returns a list of vector store files.
25578
25737
  */
25579
25738
  list(vectorStoreID, query = {}, options) {
25580
- return this._client.getAPIList(path8`/vector_stores/${vectorStoreID}/files`, CursorPage, {
25739
+ return this._client.getAPIList(path9`/vector_stores/${vectorStoreID}/files`, CursorPage, {
25581
25740
  query,
25582
25741
  ...options,
25583
25742
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -25591,7 +25750,7 @@ var init_files3 = __esm({
25591
25750
  */
25592
25751
  delete(fileID, params, options) {
25593
25752
  const { vector_store_id } = params;
25594
- 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}`, {
25595
25754
  ...options,
25596
25755
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25597
25756
  });
@@ -25666,7 +25825,7 @@ var init_files3 = __esm({
25666
25825
  */
25667
25826
  content(fileID, params, options) {
25668
25827
  const { vector_store_id } = params;
25669
- 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]) });
25670
25829
  }
25671
25830
  };
25672
25831
  }
@@ -25705,7 +25864,7 @@ var init_vector_stores = __esm({
25705
25864
  * Retrieves a vector store.
25706
25865
  */
25707
25866
  retrieve(vectorStoreID, options) {
25708
- return this._client.get(path8`/vector_stores/${vectorStoreID}`, {
25867
+ return this._client.get(path9`/vector_stores/${vectorStoreID}`, {
25709
25868
  ...options,
25710
25869
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25711
25870
  });
@@ -25714,7 +25873,7 @@ var init_vector_stores = __esm({
25714
25873
  * Modifies a vector store.
25715
25874
  */
25716
25875
  update(vectorStoreID, body, options) {
25717
- return this._client.post(path8`/vector_stores/${vectorStoreID}`, {
25876
+ return this._client.post(path9`/vector_stores/${vectorStoreID}`, {
25718
25877
  body,
25719
25878
  ...options,
25720
25879
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -25734,7 +25893,7 @@ var init_vector_stores = __esm({
25734
25893
  * Delete a vector store.
25735
25894
  */
25736
25895
  delete(vectorStoreID, options) {
25737
- return this._client.delete(path8`/vector_stores/${vectorStoreID}`, {
25896
+ return this._client.delete(path9`/vector_stores/${vectorStoreID}`, {
25738
25897
  ...options,
25739
25898
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
25740
25899
  });
@@ -25744,7 +25903,7 @@ var init_vector_stores = __esm({
25744
25903
  * filter.
25745
25904
  */
25746
25905
  search(vectorStoreID, body, options) {
25747
- return this._client.getAPIList(path8`/vector_stores/${vectorStoreID}/search`, Page, {
25906
+ return this._client.getAPIList(path9`/vector_stores/${vectorStoreID}/search`, Page, {
25748
25907
  body,
25749
25908
  method: "post",
25750
25909
  ...options,
@@ -26050,9 +26209,9 @@ var init_client = __esm({
26050
26209
  this.apiKey = token;
26051
26210
  return true;
26052
26211
  }
26053
- buildURL(path26, query, defaultBaseURL) {
26212
+ buildURL(path27, query, defaultBaseURL) {
26054
26213
  const baseURL = !__classPrivateFieldGet(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
26055
- 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));
26056
26215
  const defaultQuery = this.defaultQuery();
26057
26216
  if (!isEmptyObj(defaultQuery)) {
26058
26217
  query = { ...defaultQuery, ...query };
@@ -26076,24 +26235,24 @@ var init_client = __esm({
26076
26235
  */
26077
26236
  async prepareRequest(request, { url, options }) {
26078
26237
  }
26079
- get(path26, opts) {
26080
- return this.methodRequest("get", path26, opts);
26238
+ get(path27, opts) {
26239
+ return this.methodRequest("get", path27, opts);
26081
26240
  }
26082
- post(path26, opts) {
26083
- return this.methodRequest("post", path26, opts);
26241
+ post(path27, opts) {
26242
+ return this.methodRequest("post", path27, opts);
26084
26243
  }
26085
- patch(path26, opts) {
26086
- return this.methodRequest("patch", path26, opts);
26244
+ patch(path27, opts) {
26245
+ return this.methodRequest("patch", path27, opts);
26087
26246
  }
26088
- put(path26, opts) {
26089
- return this.methodRequest("put", path26, opts);
26247
+ put(path27, opts) {
26248
+ return this.methodRequest("put", path27, opts);
26090
26249
  }
26091
- delete(path26, opts) {
26092
- return this.methodRequest("delete", path26, opts);
26250
+ delete(path27, opts) {
26251
+ return this.methodRequest("delete", path27, opts);
26093
26252
  }
26094
- methodRequest(method, path26, opts) {
26253
+ methodRequest(method, path27, opts) {
26095
26254
  return this.request(Promise.resolve(opts).then((opts2) => {
26096
- return { method, path: path26, ...opts2 };
26255
+ return { method, path: path27, ...opts2 };
26097
26256
  }));
26098
26257
  }
26099
26258
  request(options, remainingRetries = null) {
@@ -26197,8 +26356,8 @@ var init_client = __esm({
26197
26356
  }));
26198
26357
  return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
26199
26358
  }
26200
- getAPIList(path26, Page2, opts) {
26201
- return this.requestAPIList(Page2, { method: "get", path: path26, ...opts });
26359
+ getAPIList(path27, Page2, opts) {
26360
+ return this.requestAPIList(Page2, { method: "get", path: path27, ...opts });
26202
26361
  }
26203
26362
  requestAPIList(Page2, options) {
26204
26363
  const request = this.makeRequest(options, null, void 0);
@@ -26276,8 +26435,8 @@ var init_client = __esm({
26276
26435
  }
26277
26436
  async buildRequest(inputOptions, { retryCount = 0 } = {}) {
26278
26437
  const options = { ...inputOptions };
26279
- const { method, path: path26, query, defaultBaseURL } = options;
26280
- const url = this.buildURL(path26, query, defaultBaseURL);
26438
+ const { method, path: path27, query, defaultBaseURL } = options;
26439
+ const url = this.buildURL(path27, query, defaultBaseURL);
26281
26440
  if ("timeout" in options)
26282
26441
  validatePositiveInteger("timeout", options.timeout);
26283
26442
  options.timeout = options.timeout ?? this.timeout;
@@ -27402,12 +27561,12 @@ var init_browser = __esm({
27402
27561
  });
27403
27562
 
27404
27563
  // ../../node_modules/.pnpm/ollama@0.5.18/node_modules/ollama/dist/index.mjs
27405
- var import_node_fs7, import_node_path9, Ollama2, index;
27564
+ var import_node_fs8, import_node_path10, Ollama2, index;
27406
27565
  var init_dist = __esm({
27407
27566
  "../../node_modules/.pnpm/ollama@0.5.18/node_modules/ollama/dist/index.mjs"() {
27408
27567
  "use strict";
27409
- import_node_fs7 = __toESM(require("fs"), 1);
27410
- import_node_path9 = require("path");
27568
+ import_node_fs8 = __toESM(require("fs"), 1);
27569
+ import_node_path10 = require("path");
27411
27570
  init_browser();
27412
27571
  init_fetch();
27413
27572
  Ollama2 = class extends Ollama$1 {
@@ -27416,8 +27575,8 @@ var init_dist = __esm({
27416
27575
  return Buffer.from(image).toString("base64");
27417
27576
  }
27418
27577
  try {
27419
- if (import_node_fs7.default.existsSync(image)) {
27420
- 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));
27421
27580
  return Buffer.from(fileBuffer).toString("base64");
27422
27581
  }
27423
27582
  } catch {
@@ -27430,16 +27589,16 @@ var init_dist = __esm({
27430
27589
  * @private @internal
27431
27590
  * @returns {Promise<boolean>} - Whether the file exists or not
27432
27591
  */
27433
- async fileExists(path26) {
27592
+ async fileExists(path27) {
27434
27593
  try {
27435
- await import_node_fs7.promises.access(path26);
27594
+ await import_node_fs8.promises.access(path27);
27436
27595
  return true;
27437
27596
  } catch {
27438
27597
  return false;
27439
27598
  }
27440
27599
  }
27441
27600
  async create(request) {
27442
- 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))) {
27443
27602
  throw Error("Creating with a local path is not currently supported from ollama-js");
27444
27603
  }
27445
27604
  if (request.stream) {
@@ -32049,16 +32208,16 @@ function headerDelayMs(response) {
32049
32208
  }
32050
32209
  return void 0;
32051
32210
  }
32052
- 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")) {
32053
32212
  const spec = getLocalEmbeddingSpec(model);
32054
32213
  if (!spec) throw new Error("Unknown local embedding model '" + model + "'");
32055
- return import_node_path10.default.join(cacheRoot, "astanguyen", model, spec.revision);
32214
+ return import_node_path11.default.join(cacheRoot, "astanguyen", model, spec.revision);
32056
32215
  }
32057
32216
  function hashBytes(bytes) {
32058
32217
  return import_node_crypto9.default.createHash("sha256").update(bytes).digest("hex");
32059
32218
  }
32060
32219
  async function downloadFile(url, target, expectedHash) {
32061
- 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 });
32062
32221
  try {
32063
32222
  const existing = await (0, import_promises7.readFile)(target);
32064
32223
  if (hashBytes(existing) === expectedHash) return;
@@ -32080,7 +32239,7 @@ async function downloadFile(url, target, expectedHash) {
32080
32239
  }
32081
32240
  const bytes = new Uint8Array(await response.arrayBuffer());
32082
32241
  if (hashBytes(bytes) !== expectedHash) {
32083
- 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), {
32084
32243
  cause: PERMANENT
32085
32244
  });
32086
32245
  }
@@ -32108,7 +32267,7 @@ async function ensureLocalEmbeddingCache(model = LOCAL_EMBEDDING_MODEL, cacheRoo
32108
32267
  for (const [file, checksum] of Object.entries(spec.files)) {
32109
32268
  await downloadFile(
32110
32269
  "https://huggingface.co/" + spec.repo + "/resolve/" + spec.revision + "/" + file,
32111
- import_node_path10.default.join(cacheDir, file),
32270
+ import_node_path11.default.join(cacheDir, file),
32112
32271
  checksum
32113
32272
  );
32114
32273
  }
@@ -32171,13 +32330,13 @@ async function getLocalEmbeddingModel(model = LOCAL_EMBEDDING_MODEL) {
32171
32330
  providerCache.set(cacheDir, provider);
32172
32331
  return provider;
32173
32332
  }
32174
- 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;
32175
32334
  var init_local_embedding = __esm({
32176
32335
  "../../packages/core/src/local-embedding.ts"() {
32177
32336
  "use strict";
32178
32337
  import_node_crypto9 = __toESM(require("crypto"), 1);
32179
32338
  import_node_os3 = __toESM(require("os"), 1);
32180
- import_node_path10 = __toESM(require("path"), 1);
32339
+ import_node_path11 = __toESM(require("path"), 1);
32181
32340
  import_promises7 = require("fs/promises");
32182
32341
  LOCAL_EMBEDDING_MODEL = "jina-code-static-256";
32183
32342
  LOCAL_EMBEDDING_REVISION = "b4459b817b536239ebbf8e29ff487fea4b16f3f7";
@@ -32217,8 +32376,8 @@ var init_local_embedding = __esm({
32217
32376
  try {
32218
32377
  const dir = this.cacheDir ?? await ensureLocalEmbeddingCache();
32219
32378
  const [tokenizerJson, matrix] = await Promise.all([
32220
- (0, import_promises7.readFile)(import_node_path10.default.join(dir, "tokenizer.json"), "utf8"),
32221
- 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"))
32222
32381
  ]);
32223
32382
  if (matrix.length % MODEL_DIMENSIONS !== 0) {
32224
32383
  throw new Error("Local embedding matrix has invalid dimensions");
@@ -32696,8 +32855,8 @@ function parseEmbedding(value) {
32696
32855
  return [];
32697
32856
  }
32698
32857
  }
32699
- function isCodeFile(path26) {
32700
- 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);
32701
32860
  }
32702
32861
  async function rankStoredEmbeddings(rootPath, provider, queryEmbedding, limit2) {
32703
32862
  if (queryEmbedding.length === 0) return [];
@@ -32719,13 +32878,13 @@ async function rankStoredEmbeddings(rootPath, provider, queryEmbedding, limit2)
32719
32878
  );
32720
32879
  const seenPaths = /* @__PURE__ */ new Set();
32721
32880
  return results.map((row) => {
32722
- const path26 = String(row.path);
32881
+ const path27 = String(row.path);
32723
32882
  const baseScore = cosineSimilarity(queryEmbedding, parseEmbedding(row.embedding));
32724
32883
  return {
32725
32884
  id: String(row.id),
32726
- path: path26,
32885
+ path: path27,
32727
32886
  content: String(row.content),
32728
- score: isCodeFile(path26) ? baseScore + CODE_FILE_BOOST : baseScore,
32887
+ score: isCodeFile(path27) ? baseScore + CODE_FILE_BOOST : baseScore,
32729
32888
  heading: row.heading ? String(row.heading) : null,
32730
32889
  metadata: safeParseJson2(String(row.metadata ?? "{}"), {})
32731
32890
  };
@@ -33027,7 +33186,7 @@ function codeSearchText(text2) {
33027
33186
  return Array.from(unique2).join(" ");
33028
33187
  }
33029
33188
  function inferDocumentKind(filePath) {
33030
- const extension = import_node_path11.default.extname(filePath).toLowerCase();
33189
+ const extension = import_node_path12.default.extname(filePath).toLowerCase();
33031
33190
  if (markdownExtensions.has(extension)) {
33032
33191
  return { kind: "markdown", language: "markdown", extension };
33033
33192
  }
@@ -33894,11 +34053,11 @@ function makeFallbackChunks(content, lines, counter = exactTokenCounter) {
33894
34053
  callExpressions: []
33895
34054
  };
33896
34055
  }
33897
- 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;
33898
34057
  var init_languages = __esm({
33899
34058
  "../../packages/indexer/src/languages.ts"() {
33900
34059
  "use strict";
33901
- import_node_path11 = __toESM(require("path"), 1);
34060
+ import_node_path12 = __toESM(require("path"), 1);
33902
34061
  init_src3();
33903
34062
  init_hash();
33904
34063
  codeExtensions = /* @__PURE__ */ new Map([
@@ -34792,16 +34951,16 @@ function resolveWebTreeSitterWasm() {
34792
34951
  resolvePackageFile("web-tree-sitter", "web-tree-sitter.wasm")
34793
34952
  ];
34794
34953
  for (const candidate of candidates) {
34795
- if (candidate && import_node_fs8.default.existsSync(candidate)) return candidate;
34954
+ if (candidate && import_node_fs9.default.existsSync(candidate)) return candidate;
34796
34955
  }
34797
34956
  return null;
34798
34957
  }
34799
34958
  function resolveGrammarWasm(language) {
34800
34959
  const fileName = `tree-sitter-${language}.wasm`;
34801
34960
  const grammarPath = resolvePackageFile(`tree-sitter-${language}`, fileName);
34802
- if (grammarPath && import_node_fs8.default.existsSync(grammarPath)) return grammarPath;
34961
+ if (grammarPath && import_node_fs9.default.existsSync(grammarPath)) return grammarPath;
34803
34962
  const wasmsPath = resolvePackageFile("tree-sitter-wasms", `out/${fileName}`);
34804
- if (wasmsPath && import_node_fs8.default.existsSync(wasmsPath)) return wasmsPath;
34963
+ if (wasmsPath && import_node_fs9.default.existsSync(wasmsPath)) return wasmsPath;
34805
34964
  return null;
34806
34965
  }
34807
34966
  async function ensureInit() {
@@ -34810,9 +34969,9 @@ async function ensureInit() {
34810
34969
  const wasmPath = resolveWebTreeSitterWasm();
34811
34970
  const moduleOptions = {};
34812
34971
  if (wasmPath) {
34813
- const wasmDir = import_node_path12.default.dirname(wasmPath);
34814
- const wasmBase = import_node_path12.default.basename(wasmPath);
34815
- 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);
34816
34975
  }
34817
34976
  await import_web_tree_sitter.Parser.init(moduleOptions);
34818
34977
  })();
@@ -34857,13 +35016,13 @@ async function parseContent(language, content) {
34857
35016
  parser.delete();
34858
35017
  }
34859
35018
  }
34860
- 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;
34861
35020
  var init_loader = __esm({
34862
35021
  "../../packages/indexer/src/tree-sitter/loader.ts"() {
34863
35022
  "use strict";
34864
- import_node_fs8 = __toESM(require("fs"), 1);
35023
+ import_node_fs9 = __toESM(require("fs"), 1);
34865
35024
  import_node_module2 = __toESM(require("module"), 1);
34866
- import_node_path12 = __toESM(require("path"), 1);
35025
+ import_node_path13 = __toESM(require("path"), 1);
34867
35026
  import_web_tree_sitter = require("web-tree-sitter");
34868
35027
  import_meta3 = {};
34869
35028
  _require2 = typeof __non_webpack_require__ === "function" ? __non_webpack_require__ : import_node_module2.default.createRequire(getRequireUrl2());
@@ -35813,7 +35972,7 @@ var require_path = __commonJS({
35813
35972
  Object.defineProperty(exports2, "__esModule", { value: true });
35814
35973
  exports2.convertPosixPathToPattern = exports2.convertWindowsPathToPattern = exports2.convertPathToPattern = exports2.escapePosixPath = exports2.escapeWindowsPath = exports2.escape = exports2.removeLeadingDotSegment = exports2.makeAbsolute = exports2.unixify = void 0;
35815
35974
  var os10 = require("os");
35816
- var path26 = require("path");
35975
+ var path27 = require("path");
35817
35976
  var IS_WINDOWS_PLATFORM = os10.platform() === "win32";
35818
35977
  var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
35819
35978
  var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
@@ -35825,7 +35984,7 @@ var require_path = __commonJS({
35825
35984
  }
35826
35985
  exports2.unixify = unixify;
35827
35986
  function makeAbsolute(cwd, filepath) {
35828
- return path26.resolve(cwd, filepath);
35987
+ return path27.resolve(cwd, filepath);
35829
35988
  }
35830
35989
  exports2.makeAbsolute = makeAbsolute;
35831
35990
  function removeLeadingDotSegment(entry) {
@@ -37124,7 +37283,7 @@ var require_braces = __commonJS({
37124
37283
  var require_constants4 = __commonJS({
37125
37284
  "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/constants.js"(exports2, module4) {
37126
37285
  "use strict";
37127
- var path26 = require("path");
37286
+ var path27 = require("path");
37128
37287
  var WIN_SLASH = "\\\\/";
37129
37288
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
37130
37289
  var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
@@ -37298,7 +37457,7 @@ var require_constants4 = __commonJS({
37298
37457
  /* | */
37299
37458
  CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
37300
37459
  /* \uFEFF */
37301
- SEP: path26.sep,
37460
+ SEP: path27.sep,
37302
37461
  /**
37303
37462
  * Create EXTGLOB_CHARS
37304
37463
  */
@@ -37325,7 +37484,7 @@ var require_constants4 = __commonJS({
37325
37484
  var require_utils2 = __commonJS({
37326
37485
  "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/utils.js"(exports2) {
37327
37486
  "use strict";
37328
- var path26 = require("path");
37487
+ var path27 = require("path");
37329
37488
  var win32 = process.platform === "win32";
37330
37489
  var {
37331
37490
  REGEX_BACKSLASH,
@@ -37354,7 +37513,7 @@ var require_utils2 = __commonJS({
37354
37513
  if (options && typeof options.windows === "boolean") {
37355
37514
  return options.windows;
37356
37515
  }
37357
- return win32 === true || path26.sep === "\\";
37516
+ return win32 === true || path27.sep === "\\";
37358
37517
  };
37359
37518
  exports2.escapeLast = (input, char, lastIdx) => {
37360
37519
  const idx = input.lastIndexOf(char, lastIdx);
@@ -38718,7 +38877,7 @@ var require_parse2 = __commonJS({
38718
38877
  var require_picomatch = __commonJS({
38719
38878
  "../../node_modules/.pnpm/picomatch@2.3.2/node_modules/picomatch/lib/picomatch.js"(exports2, module4) {
38720
38879
  "use strict";
38721
- var path26 = require("path");
38880
+ var path27 = require("path");
38722
38881
  var scan = require_scan();
38723
38882
  var parse4 = require_parse2();
38724
38883
  var utils = require_utils2();
@@ -38803,7 +38962,7 @@ var require_picomatch = __commonJS({
38803
38962
  };
38804
38963
  picomatch2.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
38805
38964
  const regex2 = glob instanceof RegExp ? glob : picomatch2.makeRe(glob, options);
38806
- return regex2.test(path26.basename(input));
38965
+ return regex2.test(path27.basename(input));
38807
38966
  };
38808
38967
  picomatch2.isMatch = (str2, patterns, options) => picomatch2(patterns, options)(str2);
38809
38968
  picomatch2.parse = (pattern, options) => {
@@ -39030,7 +39189,7 @@ var require_pattern = __commonJS({
39030
39189
  "use strict";
39031
39190
  Object.defineProperty(exports2, "__esModule", { value: true });
39032
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;
39033
- var path26 = require("path");
39192
+ var path27 = require("path");
39034
39193
  var globParent = require_glob_parent();
39035
39194
  var micromatch = require_micromatch();
39036
39195
  var GLOBSTAR = "**";
@@ -39125,7 +39284,7 @@ var require_pattern = __commonJS({
39125
39284
  }
39126
39285
  exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
39127
39286
  function isAffectDepthOfReadingPattern(pattern) {
39128
- const basename3 = path26.basename(pattern);
39287
+ const basename3 = path27.basename(pattern);
39129
39288
  return endsWithSlashGlobStar(pattern) || isStaticPattern(basename3);
39130
39289
  }
39131
39290
  exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
@@ -39183,7 +39342,7 @@ var require_pattern = __commonJS({
39183
39342
  }
39184
39343
  exports2.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
39185
39344
  function isAbsolute2(pattern) {
39186
- return path26.isAbsolute(pattern);
39345
+ return path27.isAbsolute(pattern);
39187
39346
  }
39188
39347
  exports2.isAbsolute = isAbsolute2;
39189
39348
  }
@@ -39358,10 +39517,10 @@ var require_utils3 = __commonJS({
39358
39517
  exports2.array = array2;
39359
39518
  var errno = require_errno();
39360
39519
  exports2.errno = errno;
39361
- var fs23 = require_fs();
39362
- exports2.fs = fs23;
39363
- var path26 = require_path();
39364
- exports2.path = path26;
39520
+ var fs24 = require_fs();
39521
+ exports2.fs = fs24;
39522
+ var path27 = require_path();
39523
+ exports2.path = path27;
39365
39524
  var pattern = require_pattern();
39366
39525
  exports2.pattern = pattern;
39367
39526
  var stream = require_stream();
@@ -39473,8 +39632,8 @@ var require_async = __commonJS({
39473
39632
  "use strict";
39474
39633
  Object.defineProperty(exports2, "__esModule", { value: true });
39475
39634
  exports2.read = void 0;
39476
- function read(path26, settings2, callback) {
39477
- settings2.fs.lstat(path26, (lstatError, lstat3) => {
39635
+ function read(path27, settings2, callback) {
39636
+ settings2.fs.lstat(path27, (lstatError, lstat3) => {
39478
39637
  if (lstatError !== null) {
39479
39638
  callFailureCallback(callback, lstatError);
39480
39639
  return;
@@ -39483,7 +39642,7 @@ var require_async = __commonJS({
39483
39642
  callSuccessCallback(callback, lstat3);
39484
39643
  return;
39485
39644
  }
39486
- settings2.fs.stat(path26, (statError, stat4) => {
39645
+ settings2.fs.stat(path27, (statError, stat4) => {
39487
39646
  if (statError !== null) {
39488
39647
  if (settings2.throwErrorOnBrokenSymbolicLink) {
39489
39648
  callFailureCallback(callback, statError);
@@ -39515,13 +39674,13 @@ var require_sync = __commonJS({
39515
39674
  "use strict";
39516
39675
  Object.defineProperty(exports2, "__esModule", { value: true });
39517
39676
  exports2.read = void 0;
39518
- function read(path26, settings2) {
39519
- const lstat3 = settings2.fs.lstatSync(path26);
39677
+ function read(path27, settings2) {
39678
+ const lstat3 = settings2.fs.lstatSync(path27);
39520
39679
  if (!lstat3.isSymbolicLink() || !settings2.followSymbolicLink) {
39521
39680
  return lstat3;
39522
39681
  }
39523
39682
  try {
39524
- const stat4 = settings2.fs.statSync(path26);
39683
+ const stat4 = settings2.fs.statSync(path27);
39525
39684
  if (settings2.markSymbolicLink) {
39526
39685
  stat4.isSymbolicLink = () => true;
39527
39686
  }
@@ -39543,12 +39702,12 @@ var require_fs2 = __commonJS({
39543
39702
  "use strict";
39544
39703
  Object.defineProperty(exports2, "__esModule", { value: true });
39545
39704
  exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
39546
- var fs23 = require("fs");
39705
+ var fs24 = require("fs");
39547
39706
  exports2.FILE_SYSTEM_ADAPTER = {
39548
- lstat: fs23.lstat,
39549
- stat: fs23.stat,
39550
- lstatSync: fs23.lstatSync,
39551
- statSync: fs23.statSync
39707
+ lstat: fs24.lstat,
39708
+ stat: fs24.stat,
39709
+ lstatSync: fs24.lstatSync,
39710
+ statSync: fs24.statSync
39552
39711
  };
39553
39712
  function createFileSystemAdapter(fsMethods) {
39554
39713
  if (fsMethods === void 0) {
@@ -39565,12 +39724,12 @@ var require_settings = __commonJS({
39565
39724
  "../../node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js"(exports2) {
39566
39725
  "use strict";
39567
39726
  Object.defineProperty(exports2, "__esModule", { value: true });
39568
- var fs23 = require_fs2();
39727
+ var fs24 = require_fs2();
39569
39728
  var Settings = class {
39570
39729
  constructor(_options = {}) {
39571
39730
  this._options = _options;
39572
39731
  this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
39573
- this.fs = fs23.createFileSystemAdapter(this._options.fs);
39732
+ this.fs = fs24.createFileSystemAdapter(this._options.fs);
39574
39733
  this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
39575
39734
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
39576
39735
  }
@@ -39592,17 +39751,17 @@ var require_out = __commonJS({
39592
39751
  var sync = require_sync();
39593
39752
  var settings_1 = require_settings();
39594
39753
  exports2.Settings = settings_1.default;
39595
- function stat4(path26, optionsOrSettingsOrCallback, callback) {
39754
+ function stat4(path27, optionsOrSettingsOrCallback, callback) {
39596
39755
  if (typeof optionsOrSettingsOrCallback === "function") {
39597
- async.read(path26, getSettings(), optionsOrSettingsOrCallback);
39756
+ async.read(path27, getSettings(), optionsOrSettingsOrCallback);
39598
39757
  return;
39599
39758
  }
39600
- async.read(path26, getSettings(optionsOrSettingsOrCallback), callback);
39759
+ async.read(path27, getSettings(optionsOrSettingsOrCallback), callback);
39601
39760
  }
39602
39761
  exports2.stat = stat4;
39603
- function statSync2(path26, optionsOrSettings) {
39762
+ function statSync2(path27, optionsOrSettings) {
39604
39763
  const settings2 = getSettings(optionsOrSettings);
39605
- return sync.read(path26, settings2);
39764
+ return sync.read(path27, settings2);
39606
39765
  }
39607
39766
  exports2.statSync = statSync2;
39608
39767
  function getSettings(settingsOrOptions = {}) {
@@ -39727,8 +39886,8 @@ var require_utils4 = __commonJS({
39727
39886
  "use strict";
39728
39887
  Object.defineProperty(exports2, "__esModule", { value: true });
39729
39888
  exports2.fs = void 0;
39730
- var fs23 = require_fs3();
39731
- exports2.fs = fs23;
39889
+ var fs24 = require_fs3();
39890
+ exports2.fs = fs24;
39732
39891
  }
39733
39892
  });
39734
39893
 
@@ -39820,16 +39979,16 @@ var require_async2 = __commonJS({
39820
39979
  return;
39821
39980
  }
39822
39981
  const tasks = names.map((name) => {
39823
- const path26 = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
39982
+ const path27 = common.joinPathSegments(directory, name, settings2.pathSegmentSeparator);
39824
39983
  return (done) => {
39825
- fsStat.stat(path26, settings2.fsStatSettings, (error2, stats) => {
39984
+ fsStat.stat(path27, settings2.fsStatSettings, (error2, stats) => {
39826
39985
  if (error2 !== null) {
39827
39986
  done(error2);
39828
39987
  return;
39829
39988
  }
39830
39989
  const entry = {
39831
39990
  name,
39832
- path: path26,
39991
+ path: path27,
39833
39992
  dirent: utils.fs.createDirentFromStats(name, stats)
39834
39993
  };
39835
39994
  if (settings2.stats) {
@@ -39923,14 +40082,14 @@ var require_fs4 = __commonJS({
39923
40082
  "use strict";
39924
40083
  Object.defineProperty(exports2, "__esModule", { value: true });
39925
40084
  exports2.createFileSystemAdapter = exports2.FILE_SYSTEM_ADAPTER = void 0;
39926
- var fs23 = require("fs");
40085
+ var fs24 = require("fs");
39927
40086
  exports2.FILE_SYSTEM_ADAPTER = {
39928
- lstat: fs23.lstat,
39929
- stat: fs23.stat,
39930
- lstatSync: fs23.lstatSync,
39931
- statSync: fs23.statSync,
39932
- readdir: fs23.readdir,
39933
- 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
39934
40093
  };
39935
40094
  function createFileSystemAdapter(fsMethods) {
39936
40095
  if (fsMethods === void 0) {
@@ -39947,15 +40106,15 @@ var require_settings2 = __commonJS({
39947
40106
  "../../node_modules/.pnpm/@nodelib+fs.scandir@2.1.5/node_modules/@nodelib/fs.scandir/out/settings.js"(exports2) {
39948
40107
  "use strict";
39949
40108
  Object.defineProperty(exports2, "__esModule", { value: true });
39950
- var path26 = require("path");
40109
+ var path27 = require("path");
39951
40110
  var fsStat = require_out();
39952
- var fs23 = require_fs4();
40111
+ var fs24 = require_fs4();
39953
40112
  var Settings = class {
39954
40113
  constructor(_options = {}) {
39955
40114
  this._options = _options;
39956
40115
  this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
39957
- this.fs = fs23.createFileSystemAdapter(this._options.fs);
39958
- 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);
39959
40118
  this.stats = this._getValue(this._options.stats, false);
39960
40119
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
39961
40120
  this.fsStatSettings = new fsStat.Settings({
@@ -39982,17 +40141,17 @@ var require_out2 = __commonJS({
39982
40141
  var sync = require_sync2();
39983
40142
  var settings_1 = require_settings2();
39984
40143
  exports2.Settings = settings_1.default;
39985
- function scandir(path26, optionsOrSettingsOrCallback, callback) {
40144
+ function scandir(path27, optionsOrSettingsOrCallback, callback) {
39986
40145
  if (typeof optionsOrSettingsOrCallback === "function") {
39987
- async.read(path26, getSettings(), optionsOrSettingsOrCallback);
40146
+ async.read(path27, getSettings(), optionsOrSettingsOrCallback);
39988
40147
  return;
39989
40148
  }
39990
- async.read(path26, getSettings(optionsOrSettingsOrCallback), callback);
40149
+ async.read(path27, getSettings(optionsOrSettingsOrCallback), callback);
39991
40150
  }
39992
40151
  exports2.scandir = scandir;
39993
- function scandirSync(path26, optionsOrSettings) {
40152
+ function scandirSync(path27, optionsOrSettings) {
39994
40153
  const settings2 = getSettings(optionsOrSettings);
39995
- return sync.read(path26, settings2);
40154
+ return sync.read(path27, settings2);
39996
40155
  }
39997
40156
  exports2.scandirSync = scandirSync;
39998
40157
  function getSettings(settingsOrOptions = {}) {
@@ -40639,7 +40798,7 @@ var require_settings3 = __commonJS({
40639
40798
  "../../node_modules/.pnpm/@nodelib+fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.js"(exports2) {
40640
40799
  "use strict";
40641
40800
  Object.defineProperty(exports2, "__esModule", { value: true });
40642
- var path26 = require("path");
40801
+ var path27 = require("path");
40643
40802
  var fsScandir = require_out2();
40644
40803
  var Settings = class {
40645
40804
  constructor(_options = {}) {
@@ -40649,7 +40808,7 @@ var require_settings3 = __commonJS({
40649
40808
  this.deepFilter = this._getValue(this._options.deepFilter, null);
40650
40809
  this.entryFilter = this._getValue(this._options.entryFilter, null);
40651
40810
  this.errorFilter = this._getValue(this._options.errorFilter, null);
40652
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path26.sep);
40811
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path27.sep);
40653
40812
  this.fsScandirSettings = new fsScandir.Settings({
40654
40813
  followSymbolicLinks: this._options.followSymbolicLinks,
40655
40814
  fs: this._options.fs,
@@ -40711,7 +40870,7 @@ var require_reader2 = __commonJS({
40711
40870
  "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/readers/reader.js"(exports2) {
40712
40871
  "use strict";
40713
40872
  Object.defineProperty(exports2, "__esModule", { value: true });
40714
- var path26 = require("path");
40873
+ var path27 = require("path");
40715
40874
  var fsStat = require_out();
40716
40875
  var utils = require_utils3();
40717
40876
  var Reader = class {
@@ -40724,7 +40883,7 @@ var require_reader2 = __commonJS({
40724
40883
  });
40725
40884
  }
40726
40885
  _getFullEntryPath(filepath) {
40727
- return path26.resolve(this._settings.cwd, filepath);
40886
+ return path27.resolve(this._settings.cwd, filepath);
40728
40887
  }
40729
40888
  _makeEntry(stats, pattern) {
40730
40889
  const entry = {
@@ -41140,7 +41299,7 @@ var require_provider = __commonJS({
41140
41299
  "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/provider.js"(exports2) {
41141
41300
  "use strict";
41142
41301
  Object.defineProperty(exports2, "__esModule", { value: true });
41143
- var path26 = require("path");
41302
+ var path27 = require("path");
41144
41303
  var deep_1 = require_deep();
41145
41304
  var entry_1 = require_entry();
41146
41305
  var error_1 = require_error2();
@@ -41154,7 +41313,7 @@ var require_provider = __commonJS({
41154
41313
  this.entryTransformer = new entry_2.default(this._settings);
41155
41314
  }
41156
41315
  _getRootDirectory(task) {
41157
- return path26.resolve(this._settings.cwd, task.base);
41316
+ return path27.resolve(this._settings.cwd, task.base);
41158
41317
  }
41159
41318
  _getReaderOptions(task) {
41160
41319
  const basePath = task.base === "." ? "" : task.base;
@@ -41335,16 +41494,16 @@ var require_settings4 = __commonJS({
41335
41494
  "use strict";
41336
41495
  Object.defineProperty(exports2, "__esModule", { value: true });
41337
41496
  exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
41338
- var fs23 = require("fs");
41497
+ var fs24 = require("fs");
41339
41498
  var os10 = require("os");
41340
41499
  var CPU_COUNT = Math.max(os10.cpus().length, 1);
41341
41500
  exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
41342
- lstat: fs23.lstat,
41343
- lstatSync: fs23.lstatSync,
41344
- stat: fs23.stat,
41345
- statSync: fs23.statSync,
41346
- readdir: fs23.readdir,
41347
- 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
41348
41507
  };
41349
41508
  var Settings = class {
41350
41509
  constructor(_options = {}) {
@@ -41745,8 +41904,8 @@ var require_utils5 = __commonJS({
41745
41904
  }
41746
41905
  return output;
41747
41906
  };
41748
- exports2.basename = (path26, { windows } = {}) => {
41749
- const segs = path26.split(windows ? /[\\/]/ : "/");
41907
+ exports2.basename = (path27, { windows } = {}) => {
41908
+ const segs = path27.split(windows ? /[\\/]/ : "/");
41750
41909
  const last = segs[segs.length - 1];
41751
41910
  if (last === "") {
41752
41911
  return segs[segs.length - 2];
@@ -43259,10 +43418,10 @@ var require_picomatch4 = __commonJS({
43259
43418
 
43260
43419
  // ../../packages/indexer/src/scanner.ts
43261
43420
  function loadGitignore(rootPath) {
43262
- const gitignorePath = import_node_path13.default.join(rootPath, ".gitignore");
43263
- 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 [];
43264
43423
  try {
43265
- const content = (0, import_node_fs9.readFileSync)(gitignorePath, "utf8");
43424
+ const content = (0, import_node_fs10.readFileSync)(gitignorePath, "utf8");
43266
43425
  if (!content) return [];
43267
43426
  return content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#")).flatMap((pattern) => {
43268
43427
  const hasSlash = pattern.replace(/\/$/, "").includes("/");
@@ -43277,7 +43436,7 @@ function loadGitignore(rootPath) {
43277
43436
  }
43278
43437
  }
43279
43438
  async function scanWorkspaceFiles(input) {
43280
- const rootPath = import_node_path13.default.resolve(input.rootPath);
43439
+ const rootPath = import_node_path14.default.resolve(input.rootPath);
43281
43440
  const gitignorePatterns = loadGitignore(rootPath);
43282
43441
  const ignorePatterns = [
43283
43442
  ...DEFAULT_EXCLUDE_PATTERNS,
@@ -43327,7 +43486,7 @@ async function scanWorkspaceFiles(input) {
43327
43486
  const stat4 = await import_promises8.default.stat(absolutePath);
43328
43487
  return {
43329
43488
  absolutePath,
43330
- relativePath: import_node_path13.default.relative(rootPath, absolutePath),
43489
+ relativePath: import_node_path14.default.relative(rootPath, absolutePath),
43331
43490
  sizeBytes: stat4.size,
43332
43491
  mtimeMs: Math.trunc(stat4.mtimeMs)
43333
43492
  };
@@ -43335,14 +43494,14 @@ async function scanWorkspaceFiles(input) {
43335
43494
  );
43336
43495
  return results.sort((left, right) => left.relativePath.localeCompare(right.relativePath));
43337
43496
  }
43338
- 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;
43339
43498
  var init_scanner = __esm({
43340
43499
  "../../packages/indexer/src/scanner.ts"() {
43341
43500
  "use strict";
43342
43501
  import_fast_glob = __toESM(require_out4(), 1);
43343
43502
  import_promises8 = __toESM(require("fs/promises"), 1);
43344
- import_node_path13 = __toESM(require("path"), 1);
43345
- import_node_fs9 = require("fs");
43503
+ import_node_path14 = __toESM(require("path"), 1);
43504
+ import_node_fs10 = require("fs");
43346
43505
  import_picomatch = __toESM(require_picomatch4(), 1);
43347
43506
  init_languages();
43348
43507
  DEFAULT_INCLUDE_PATTERNS = [
@@ -43394,7 +43553,7 @@ function indexLeaseExpiry() {
43394
43553
  function resolveNativeParser() {
43395
43554
  if (_nativeParser !== void 0) return _nativeParser;
43396
43555
  try {
43397
- 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");
43398
43557
  _nativeParser = require(nativePath);
43399
43558
  } catch {
43400
43559
  try {
@@ -43412,29 +43571,29 @@ function parserVersionFor(parserName) {
43412
43571
  return PARSER_VERSION_OXC;
43413
43572
  }
43414
43573
  function normalizeRelativePath(filePath) {
43415
- return filePath.split(import_node_path14.default.sep).join("/");
43574
+ return filePath.split(import_node_path15.default.sep).join("/");
43416
43575
  }
43417
43576
  function createWorkspaceFileResolver(workspaceRoot, files) {
43418
43577
  const knownRelativePaths = new Set(files.map((file) => normalizeRelativePath(file.relativePath)));
43419
43578
  const absoluteToRelative = new Map(
43420
43579
  files.map((file) => [
43421
- import_node_path14.default.resolve(file.absolutePath),
43580
+ import_node_path15.default.resolve(file.absolutePath),
43422
43581
  normalizeRelativePath(file.relativePath)
43423
43582
  ])
43424
43583
  );
43425
43584
  function toWorkspaceRelative(candidateAbsolutePath) {
43426
- const resolvedAbsolute = import_node_path14.default.resolve(candidateAbsolutePath);
43585
+ const resolvedAbsolute = import_node_path15.default.resolve(candidateAbsolutePath);
43427
43586
  const mapped = absoluteToRelative.get(resolvedAbsolute);
43428
43587
  if (mapped) return mapped;
43429
43588
  const relativeToWorkspace = normalizeRelativePath(
43430
- import_node_path14.default.relative(workspaceRoot, resolvedAbsolute)
43589
+ import_node_path15.default.relative(workspaceRoot, resolvedAbsolute)
43431
43590
  );
43432
43591
  if (relativeToWorkspace.startsWith("../")) return null;
43433
43592
  return knownRelativePaths.has(relativeToWorkspace) ? relativeToWorkspace : null;
43434
43593
  }
43435
43594
  function resolveRelativeImport(importerRelativePath, importPath) {
43436
- const importerDirectory = import_node_path14.default.dirname(import_node_path14.default.resolve(workspaceRoot, importerRelativePath));
43437
- 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);
43438
43597
  const directMatch = toWorkspaceRelative(baseCandidate);
43439
43598
  if (directMatch) return directMatch;
43440
43599
  for (const extension of RESOLVABLE_SOURCE_EXTENSIONS) {
@@ -43442,7 +43601,7 @@ function createWorkspaceFileResolver(workspaceRoot, files) {
43442
43601
  if (withExtension) return withExtension;
43443
43602
  }
43444
43603
  for (const extension of RESOLVABLE_SOURCE_EXTENSIONS) {
43445
- const asIndexFile = toWorkspaceRelative(import_node_path14.default.join(baseCandidate, `index${extension}`));
43604
+ const asIndexFile = toWorkspaceRelative(import_node_path15.default.join(baseCandidate, `index${extension}`));
43446
43605
  if (asIndexFile) return asIndexFile;
43447
43606
  }
43448
43607
  return null;
@@ -43460,11 +43619,11 @@ function createWorkspaceFileResolver(workspaceRoot, files) {
43460
43619
  if (!dotMatch) return null;
43461
43620
  const level = dotMatch[1].length;
43462
43621
  const remainder = dotMatch[2].replace(/^\./, "");
43463
- let baseDirectory = normalizeRelativePath(import_node_path14.default.dirname(importerRelativePath));
43622
+ let baseDirectory = normalizeRelativePath(import_node_path15.default.dirname(importerRelativePath));
43464
43623
  for (let index2 = 1; index2 < level; index2++) {
43465
- baseDirectory = normalizeRelativePath(import_node_path14.default.dirname(baseDirectory));
43624
+ baseDirectory = normalizeRelativePath(import_node_path15.default.dirname(baseDirectory));
43466
43625
  }
43467
- 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;
43468
43627
  return resolvePythonModulePath(modulePath);
43469
43628
  }
43470
43629
  function resolvePythonImport(importerRelativePath, importPath) {
@@ -43667,7 +43826,7 @@ async function indexWorkspace(input) {
43667
43826
  workspace = w;
43668
43827
  } else if (input.rootPath) {
43669
43828
  workspace = await activeRegistry.ensureWorkspace({
43670
- rootPath: import_node_path14.default.resolve(input.rootPath)
43829
+ rootPath: import_node_path15.default.resolve(input.rootPath)
43671
43830
  });
43672
43831
  } else {
43673
43832
  throw new Error("Either workspaceId or rootPath is required");
@@ -43709,7 +43868,7 @@ async function indexWorkspace(input) {
43709
43868
  const settings2 = await getBrainSettings(workspace.rootPath);
43710
43869
  const config2 = await loadBrainConfig(workspace.rootPath);
43711
43870
  const configuredWorkspace = config2.workspaces?.find(
43712
- (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)
43713
43872
  );
43714
43873
  const includeGlobs = workspace.includeGlobs || configuredWorkspace?.include.join("\n") || "";
43715
43874
  const excludeGlobs = workspace.excludeGlobs || configuredWorkspace?.exclude.join("\n") || "";
@@ -43740,13 +43899,13 @@ async function indexWorkspace(input) {
43740
43899
  await assertIndexingLease();
43741
43900
  const existingDocuments = await repo.listDocuments();
43742
43901
  const existingDocumentsByPath = new Map(
43743
- existingDocuments.map((document) => [document.path, document])
43902
+ existingDocuments.map((document) => [normalizeRelativePath(document.path), document])
43744
43903
  );
43745
43904
  if (runMode === "incremental") {
43746
- const scannedPaths = new Set(files.map((file) => file.relativePath));
43905
+ const scannedPaths = new Set(files.map((file) => normalizeRelativePath(file.relativePath)));
43747
43906
  let deletedAny = false;
43748
43907
  for (const document of existingDocuments) {
43749
- if (!scannedPaths.has(document.path)) {
43908
+ if (!scannedPaths.has(normalizeRelativePath(document.path))) {
43750
43909
  await resetDocumentArtifacts(repo, document.id);
43751
43910
  await repo.deleteDocument(document.id);
43752
43911
  deletedAny = true;
@@ -43779,7 +43938,9 @@ async function indexWorkspace(input) {
43779
43938
  const parseTasks = [];
43780
43939
  const filesToRead = [];
43781
43940
  for (const file of files) {
43782
- const existingDocument = existingDocumentsByPath.get(file.relativePath);
43941
+ const existingDocument = existingDocumentsByPath.get(
43942
+ normalizeRelativePath(file.relativePath)
43943
+ );
43783
43944
  const statUnchanged = runMode === "incremental" && !forceRechunk && existingDocument && existingDocument.mtimeMs === file.mtimeMs && existingDocument.sizeBytes === file.sizeBytes;
43784
43945
  if (!statUnchanged) {
43785
43946
  filesToRead.push(file);
@@ -43811,7 +43972,9 @@ async function indexWorkspace(input) {
43811
43972
  for (const file of filesToRead) {
43812
43973
  const content = fileContents.get(file.relativePath);
43813
43974
  const contentHash = hashContent(content);
43814
- const existingDocument = existingDocumentsByPath.get(file.relativePath);
43975
+ const existingDocument = existingDocumentsByPath.get(
43976
+ normalizeRelativePath(file.relativePath)
43977
+ );
43815
43978
  const unchanged = runMode === "incremental" && !forceRechunk && existingDocument && existingDocument.contentHash === contentHash;
43816
43979
  if (unchanged) {
43817
43980
  await repo.updateDocument(existingDocument.id, {
@@ -43866,7 +44029,9 @@ async function indexWorkspace(input) {
43866
44029
  for (const file of parseTasks) {
43867
44030
  const indexed = parseResults.get(file.id);
43868
44031
  const contentHash = hashContent(file.content);
43869
- const existingDocument = existingDocumentsByPath.get(file.relativePath);
44032
+ const existingDocument = existingDocumentsByPath.get(
44033
+ normalizeRelativePath(file.relativePath)
44034
+ );
43870
44035
  if (existingDocument) {
43871
44036
  await resetChangedFileArtifacts(repo, existingDocument.id, file.relativePath);
43872
44037
  await repo.updateDocument(existingDocument.id, {
@@ -43877,10 +44042,10 @@ async function indexWorkspace(input) {
43877
44042
  sizeBytes: file.sizeBytes,
43878
44043
  mtimeMs: file.mtimeMs
43879
44044
  });
43880
- docIdMap.set(file.relativePath, existingDocument.id);
44045
+ docIdMap.set(normalizeRelativePath(file.relativePath), existingDocument.id);
43881
44046
  } else {
43882
44047
  newDocs.push({
43883
- path: file.relativePath,
44048
+ path: normalizeRelativePath(file.relativePath),
43884
44049
  absolutePath: file.absolutePath,
43885
44050
  kind: indexed.kind,
43886
44051
  language: indexed.language,
@@ -43902,7 +44067,7 @@ async function indexWorkspace(input) {
43902
44067
  const chunkFileMap = [];
43903
44068
  for (const file of parseTasks) {
43904
44069
  const indexed = parseResults.get(file.id);
43905
- const documentId = docIdMap.get(file.relativePath);
44070
+ const documentId = docIdMap.get(normalizeRelativePath(file.relativePath));
43906
44071
  for (let ci = 0; ci < indexed.chunks.length; ci++) {
43907
44072
  const chunk = indexed.chunks[ci];
43908
44073
  allChunkInputs.push({
@@ -43953,7 +44118,7 @@ async function indexWorkspace(input) {
43953
44118
  for (let fi = 0; fi < parseTasks.length; fi++) {
43954
44119
  const file = parseTasks[fi];
43955
44120
  const indexed = parseResults.get(file.id);
43956
- const documentId = docIdMap.get(file.relativePath);
44121
+ const documentId = docIdMap.get(normalizeRelativePath(file.relativePath));
43957
44122
  const contentHash = hashContent(file.content);
43958
44123
  repo.insertParsedDocument({
43959
44124
  documentId,
@@ -44094,7 +44259,7 @@ async function buildGraphGeneration(_workspaceId, rootPath, _generation, buildEp
44094
44259
  const published2 = repo.replaceGraphArtifacts({ buildEpoch, nodes: [], edges: [] });
44095
44260
  return { nodeCount: 0, edgeCount: 0, published: published2 };
44096
44261
  }
44097
- const fs23 = await import("fs/promises");
44262
+ const fs24 = await import("fs/promises");
44098
44263
  const NATIVE_LANGS = /* @__PURE__ */ new Set(["python", "go", "rust"]);
44099
44264
  const nativeDocs = [];
44100
44265
  const registryDocs = [];
@@ -44123,7 +44288,7 @@ async function buildGraphGeneration(_workspaceId, rootPath, _generation, buildEp
44123
44288
  continue;
44124
44289
  }
44125
44290
  try {
44126
- const content = await fs23.readFile(doc.absolutePath, "utf8");
44291
+ const content = await fs24.readFile(doc.absolutePath, "utf8");
44127
44292
  const parsed = await parseDocument({
44128
44293
  relativePath: doc.path,
44129
44294
  absolutePath: doc.absolutePath,
@@ -44179,7 +44344,7 @@ async function buildGraphGeneration(_workspaceId, rootPath, _generation, buildEp
44179
44344
  const batchDocPaths = [];
44180
44345
  for (const doc of nativeToParse) {
44181
44346
  try {
44182
- const content = await fs23.readFile(doc.absolutePath, "utf8");
44347
+ const content = await fs24.readFile(doc.absolutePath, "utf8");
44183
44348
  const lang = doc.language ?? inferDocumentKind(doc.path).language ?? "text";
44184
44349
  batchItems.push({ language: lang, content });
44185
44350
  batchDocPaths.push(doc.path);
@@ -44226,7 +44391,7 @@ async function buildGraphGeneration(_workspaceId, rootPath, _generation, buildEp
44226
44391
  for (const doc of nativeToParse) {
44227
44392
  if (parsedFiles.has(doc.path)) continue;
44228
44393
  try {
44229
- const content = await fs23.readFile(doc.absolutePath, "utf8");
44394
+ const content = await fs24.readFile(doc.absolutePath, "utf8");
44230
44395
  const parsed = await parseDocument({
44231
44396
  relativePath: doc.path,
44232
44397
  absolutePath: doc.absolutePath,
@@ -44396,13 +44561,13 @@ async function buildGraphGeneration(_workspaceId, rootPath, _generation, buildEp
44396
44561
  );
44397
44562
  return { nodeCount: allNodeInputs.length, edgeCount: uniqueEdges.length, published };
44398
44563
  }
44399
- 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;
44400
44565
  var init_index_workspace = __esm({
44401
44566
  "../../packages/indexer/src/index-workspace.ts"() {
44402
44567
  "use strict";
44403
44568
  import_node_crypto11 = __toESM(require("crypto"), 1);
44404
44569
  import_promises9 = __toESM(require("fs/promises"), 1);
44405
- import_node_path14 = __toESM(require("path"), 1);
44570
+ import_node_path15 = __toESM(require("path"), 1);
44406
44571
  init_src2();
44407
44572
  init_src3();
44408
44573
  init_src();
@@ -44556,7 +44721,7 @@ async function resolveWorkspace2(input) {
44556
44721
  return workspace;
44557
44722
  }
44558
44723
  if (input.rootPath) {
44559
- return registry2.ensureWorkspace({ rootPath: import_node_path15.default.resolve(input.rootPath) });
44724
+ return registry2.ensureWorkspace({ rootPath: import_node_path16.default.resolve(input.rootPath) });
44560
44725
  }
44561
44726
  throw new Error("Either workspaceId or rootPath is required");
44562
44727
  }
@@ -44606,11 +44771,11 @@ async function embedWorkspace(input) {
44606
44771
  embeddingFailures: result.failedBatches
44607
44772
  };
44608
44773
  }
44609
- var import_node_path15;
44774
+ var import_node_path16;
44610
44775
  var init_embed_workspace = __esm({
44611
44776
  "../../packages/indexer/src/embed-workspace.ts"() {
44612
44777
  "use strict";
44613
- import_node_path15 = __toESM(require("path"), 1);
44778
+ import_node_path16 = __toESM(require("path"), 1);
44614
44779
  init_src3();
44615
44780
  init_src();
44616
44781
  init_hash();
@@ -44982,10 +45147,10 @@ function assignProp(target, prop, value) {
44982
45147
  configurable: true
44983
45148
  });
44984
45149
  }
44985
- function getElementAtPath(obj, path26) {
44986
- if (!path26)
45150
+ function getElementAtPath(obj, path27) {
45151
+ if (!path27)
44987
45152
  return obj;
44988
- return path26.reduce((acc, key) => acc?.[key], obj);
45153
+ return path27.reduce((acc, key) => acc?.[key], obj);
44989
45154
  }
44990
45155
  function promiseAllObject(promisesObj) {
44991
45156
  const keys = Object.keys(promisesObj);
@@ -45234,11 +45399,11 @@ function aborted(x, startIndex = 0) {
45234
45399
  }
45235
45400
  return false;
45236
45401
  }
45237
- function prefixIssues(path26, issues) {
45402
+ function prefixIssues(path27, issues) {
45238
45403
  return issues.map((iss) => {
45239
45404
  var _a3;
45240
45405
  (_a3 = iss).path ?? (_a3.path = []);
45241
- iss.path.unshift(path26);
45406
+ iss.path.unshift(path27);
45242
45407
  return iss;
45243
45408
  });
45244
45409
  }
@@ -54984,8 +55149,8 @@ var require_utils6 = __commonJS({
54984
55149
  }
54985
55150
  return ind;
54986
55151
  }
54987
- function removeDotSegments(path26) {
54988
- let input = path26;
55152
+ function removeDotSegments(path27) {
55153
+ let input = path27;
54989
55154
  const output = [];
54990
55155
  let nextSlash = -1;
54991
55156
  let len2 = 0;
@@ -55237,8 +55402,8 @@ var require_schemes = __commonJS({
55237
55402
  wsComponent.secure = void 0;
55238
55403
  }
55239
55404
  if (wsComponent.resourceName) {
55240
- const [path26, query] = wsComponent.resourceName.split("?");
55241
- wsComponent.path = path26 && path26 !== "/" ? path26 : void 0;
55405
+ const [path27, query] = wsComponent.resourceName.split("?");
55406
+ wsComponent.path = path27 && path27 !== "/" ? path27 : void 0;
55242
55407
  wsComponent.query = query;
55243
55408
  wsComponent.resourceName = void 0;
55244
55409
  }
@@ -58637,12 +58802,12 @@ var require_dist = __commonJS({
58637
58802
  throw new Error(`Unknown format "${name}"`);
58638
58803
  return f;
58639
58804
  };
58640
- function addFormats(ajv, list, fs23, exportName) {
58805
+ function addFormats(ajv, list, fs24, exportName) {
58641
58806
  var _a3;
58642
58807
  var _b;
58643
58808
  (_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
58644
58809
  for (const f of list)
58645
- ajv.addFormat(f, fs23[f]);
58810
+ ajv.addFormat(f, fs24[f]);
58646
58811
  }
58647
58812
  module4.exports = exports2 = formatsPlugin;
58648
58813
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -59504,7 +59669,7 @@ function dedupeById(items) {
59504
59669
  });
59505
59670
  }
59506
59671
  function createWorkspaceResolver(options) {
59507
- 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;
59508
59673
  async function resolveWorkspaceById(workspaceId) {
59509
59674
  const registry2 = createRegistryRepository();
59510
59675
  const workspace = await registry2.getWorkspace(workspaceId);
@@ -59515,10 +59680,10 @@ function createWorkspaceResolver(options) {
59515
59680
  }
59516
59681
  async function resolveWorkspaceByPath(searchPath) {
59517
59682
  const registry2 = createRegistryRepository();
59518
- const workspace = await registry2.getWorkspaceByPath(import_node_path16.default.resolve(searchPath));
59683
+ const workspace = await registry2.getWorkspaceByPath(import_node_path17.default.resolve(searchPath));
59519
59684
  if (!workspace) {
59520
59685
  throw new Error(
59521
- `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.`
59522
59687
  );
59523
59688
  }
59524
59689
  return workspace;
@@ -59533,7 +59698,7 @@ function createWorkspaceResolver(options) {
59533
59698
  return workspace;
59534
59699
  }
59535
59700
  }
59536
- const byPath = await registry2.getWorkspaceByPath(import_node_path16.default.resolve(searchRoot));
59701
+ const byPath = await registry2.getWorkspaceByPath(import_node_path17.default.resolve(searchRoot));
59537
59702
  if (byPath) {
59538
59703
  return byPath;
59539
59704
  }
@@ -59847,6 +60012,21 @@ function createMcpServer(options) {
59847
60012
  required: []
59848
60013
  }
59849
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
+ },
59850
60030
  {
59851
60031
  name: "remove_workspace",
59852
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.",
@@ -60082,7 +60262,7 @@ ${result.answerContext}`
60082
60262
  }
60083
60263
  const report = await removeWorkspace({
60084
60264
  id: input.workspaceId,
60085
- 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
60086
60266
  });
60087
60267
  if (!report) {
60088
60268
  return jsonResponse({
@@ -60094,6 +60274,27 @@ ${result.answerContext}`
60094
60274
  stopWatcherForWorkspace(report.workspaceId);
60095
60275
  return jsonResponse(report);
60096
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
+ }
60097
60298
  default:
60098
60299
  throw new Error(`Unknown tool: ${request.params.name}`);
60099
60300
  }
@@ -60108,8 +60309,8 @@ async function createAndStartMcpServer(options) {
60108
60309
  await server.connect(transport);
60109
60310
  }
60110
60311
  async function autoIndexAndSync(searchRoot) {
60111
- const resolvedRoot = import_node_path16.default.resolve(searchRoot);
60112
- 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()) {
60113
60314
  return;
60114
60315
  }
60115
60316
  const registry2 = createRegistryRepository();
@@ -60168,12 +60369,12 @@ function stopWatcherForWorkspace(workspaceId) {
60168
60369
  activeWatcher = null;
60169
60370
  }
60170
60371
  }
60171
- 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;
60172
60373
  var init_mcp_core = __esm({
60173
60374
  "../mcp/src/mcp-core.ts"() {
60174
60375
  "use strict";
60175
- import_node_fs10 = __toESM(require("fs"), 1);
60176
- import_node_path16 = __toESM(require("path"), 1);
60376
+ import_node_fs11 = __toESM(require("fs"), 1);
60377
+ import_node_path17 = __toESM(require("path"), 1);
60177
60378
  init_esm2();
60178
60379
  init_server2();
60179
60380
  init_stdio2();
@@ -60236,6 +60437,10 @@ var init_mcp_core = __esm({
60236
60437
  path: external_exports.string().optional(),
60237
60438
  mode: external_exports.enum(["incremental", "full"]).optional()
60238
60439
  });
60440
+ codeOutlineSchema = external_exports.object({
60441
+ workspaceId: external_exports.string().optional(),
60442
+ path: external_exports.string().trim().min(1)
60443
+ });
60239
60444
  removeWorkspaceSchema = external_exports.object({
60240
60445
  workspaceId: external_exports.string().optional(),
60241
60446
  path: external_exports.string().optional(),
@@ -60267,7 +60472,7 @@ __export(mcp_bridge_exports, {
60267
60472
  startMcpServer: () => startMcpServer
60268
60473
  });
60269
60474
  async function startMcpServer(defaultPath, version4) {
60270
- await createAndStartMcpServer({ defaultPath, version: version4, build: "dcb4ee5-dirty" });
60475
+ await createAndStartMcpServer({ defaultPath, version: version4, build: "16a46af-dirty" });
60271
60476
  }
60272
60477
  var init_mcp_bridge = __esm({
60273
60478
  "src/mcp-bridge.ts"() {
@@ -61620,14 +61825,14 @@ var init_mime = __esm({
61620
61825
  });
61621
61826
 
61622
61827
  // ../../node_modules/.pnpm/@hono+node-server@2.0.12_hono@4.12.33/node_modules/@hono/node-server/dist/serve-static.mjs
61623
- 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;
61624
61829
  var init_serve_static = __esm({
61625
61830
  "../../node_modules/.pnpm/@hono+node-server@2.0.12_hono@4.12.33/node_modules/@hono/node-server/dist/serve-static.mjs"() {
61626
61831
  "use strict";
61627
61832
  init_stream();
61628
61833
  init_mime();
61629
- import_node_fs11 = require("fs");
61630
- import_node_path17 = require("path");
61834
+ import_node_fs12 = require("fs");
61835
+ import_node_path18 = require("path");
61631
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;
61632
61837
  ENCODINGS = {
61633
61838
  br: ".br",
@@ -61635,10 +61840,10 @@ var init_serve_static = __esm({
61635
61840
  gzip: ".gz"
61636
61841
  };
61637
61842
  ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS);
61638
- getStats = (path26) => {
61843
+ getStats = (path27) => {
61639
61844
  let stats;
61640
61845
  try {
61641
- stats = (0, import_node_fs11.statSync)(path26);
61846
+ stats = (0, import_node_fs12.statSync)(path27);
61642
61847
  } catch {
61643
61848
  }
61644
61849
  return stats;
@@ -61695,7 +61900,7 @@ var init_serve_static = __esm({
61695
61900
  serveStatic = (options = { root: "" }) => {
61696
61901
  const root = options.root || "";
61697
61902
  const optionPath = options.path;
61698
- 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?`);
61699
61904
  return async (c, next) => {
61700
61905
  if (c.finalized) return next();
61701
61906
  let filename;
@@ -61707,29 +61912,29 @@ var init_serve_static = __esm({
61707
61912
  await options.onNotFound?.(c.req.path, c);
61708
61913
  return next();
61709
61914
  }
61710
- let path26 = (0, import_node_path17.join)(root, !optionPath && options.rewriteRequestPath ? options.rewriteRequestPath(filename, c) : filename);
61711
- 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);
61712
61917
  if (stats && stats.isDirectory()) {
61713
61918
  const indexFile = options.index ?? "index.html";
61714
- path26 = (0, import_node_path17.join)(path26, indexFile);
61715
- stats = getStats(path26);
61919
+ path27 = (0, import_node_path18.join)(path27, indexFile);
61920
+ stats = getStats(path27);
61716
61921
  }
61717
61922
  if (!stats) {
61718
- await options.onNotFound?.(path26, c);
61923
+ await options.onNotFound?.(path27, c);
61719
61924
  return next();
61720
61925
  }
61721
- const mimeType = getMimeType(path26);
61926
+ const mimeType = getMimeType(path27);
61722
61927
  c.header("Content-Type", mimeType || "application/octet-stream");
61723
61928
  if (options.precompressed && (!mimeType || mimeType === "application/octet-stream" || COMPRESSIBLE_CONTENT_TYPE_REGEX.test(mimeType))) {
61724
61929
  const acceptEncodingSet = new Set(c.req.header("Accept-Encoding")?.split(",").map((encoding) => encoding.trim()));
61725
61930
  for (const encoding of ENCODINGS_ORDERED_KEYS) {
61726
61931
  if (!acceptEncodingSet.has(encoding)) continue;
61727
- const precompressedStats = getStats(path26 + ENCODINGS[encoding]);
61932
+ const precompressedStats = getStats(path27 + ENCODINGS[encoding]);
61728
61933
  if (precompressedStats) {
61729
61934
  c.header("Content-Encoding", encoding);
61730
61935
  c.header("Vary", "Accept-Encoding", { append: true });
61731
61936
  stats = precompressedStats;
61732
- path26 = path26 + ENCODINGS[encoding];
61937
+ path27 = path27 + ENCODINGS[encoding];
61733
61938
  break;
61734
61939
  }
61735
61940
  }
@@ -61744,7 +61949,7 @@ var init_serve_static = __esm({
61744
61949
  result = c.body(null);
61745
61950
  } else if (!range) {
61746
61951
  c.header("Content-Length", size.toString());
61747
- result = c.body(createStreamBody((0, import_node_fs11.createReadStream)(path26)), 200);
61952
+ result = c.body(createStreamBody((0, import_node_fs12.createReadStream)(path27)), 200);
61748
61953
  } else {
61749
61954
  c.header("Accept-Ranges", "bytes");
61750
61955
  const resolvedRange = resolveByteRange(parseByteRange(range) ?? {
@@ -61757,7 +61962,7 @@ var init_serve_static = __esm({
61757
61962
  } else {
61758
61963
  const { start, end } = resolvedRange;
61759
61964
  const chunkSize = end - start + 1;
61760
- const stream = (0, import_node_fs11.createReadStream)(path26, {
61965
+ const stream = (0, import_node_fs12.createReadStream)(path27, {
61761
61966
  start,
61762
61967
  end
61763
61968
  });
@@ -61766,7 +61971,7 @@ var init_serve_static = __esm({
61766
61971
  result = c.body(createStreamBody(stream), 206);
61767
61972
  }
61768
61973
  }
61769
- await options.onFound?.(path26, c);
61974
+ await options.onFound?.(path27, c);
61770
61975
  return result;
61771
61976
  };
61772
61977
  };
@@ -61962,26 +62167,26 @@ var splitPath, splitRoutingPath, extractGroupsFromPath, replaceGroupMarks, patte
61962
62167
  var init_url = __esm({
61963
62168
  "../../node_modules/.pnpm/hono@4.12.33/node_modules/hono/dist/utils/url.js"() {
61964
62169
  "use strict";
61965
- splitPath = (path26) => {
61966
- const paths = path26.split("/");
62170
+ splitPath = (path27) => {
62171
+ const paths = path27.split("/");
61967
62172
  if (paths[0] === "") {
61968
62173
  paths.shift();
61969
62174
  }
61970
62175
  return paths;
61971
62176
  };
61972
62177
  splitRoutingPath = (routePath) => {
61973
- const { groups, path: path26 } = extractGroupsFromPath(routePath);
61974
- const paths = splitPath(path26);
62178
+ const { groups, path: path27 } = extractGroupsFromPath(routePath);
62179
+ const paths = splitPath(path27);
61975
62180
  return replaceGroupMarks(paths, groups);
61976
62181
  };
61977
- extractGroupsFromPath = (path26) => {
62182
+ extractGroupsFromPath = (path27) => {
61978
62183
  const groups = [];
61979
- path26 = path26.replace(/\{[^}]+\}/g, (match2, index2) => {
62184
+ path27 = path27.replace(/\{[^}]+\}/g, (match2, index2) => {
61980
62185
  const mark = `@${index2}`;
61981
62186
  groups.push([mark, match2]);
61982
62187
  return mark;
61983
62188
  });
61984
- return { groups, path: path26 };
62189
+ return { groups, path: path27 };
61985
62190
  };
61986
62191
  replaceGroupMarks = (paths, groups) => {
61987
62192
  for (let i = groups.length - 1; i >= 0; i--) {
@@ -62038,8 +62243,8 @@ var init_url = __esm({
62038
62243
  const queryIndex = url.indexOf("?", i);
62039
62244
  const hashIndex = url.indexOf("#", i);
62040
62245
  const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
62041
- const path26 = url.slice(start, end);
62042
- 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);
62043
62248
  } else if (charCode === 63 || charCode === 35) {
62044
62249
  break;
62045
62250
  }
@@ -62056,11 +62261,11 @@ var init_url = __esm({
62056
62261
  }
62057
62262
  return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
62058
62263
  };
62059
- checkOptionalParameter = (path26) => {
62060
- if (path26.charCodeAt(path26.length - 1) !== 63 || !path26.includes(":")) {
62264
+ checkOptionalParameter = (path27) => {
62265
+ if (path27.charCodeAt(path27.length - 1) !== 63 || !path27.includes(":")) {
62061
62266
  return null;
62062
62267
  }
62063
- const segments = path26.split("/");
62268
+ const segments = path27.split("/");
62064
62269
  const results = [];
62065
62270
  let basePath = "";
62066
62271
  segments.forEach((segment) => {
@@ -62211,9 +62416,9 @@ var init_request = __esm({
62211
62416
  */
62212
62417
  path;
62213
62418
  bodyCache = {};
62214
- constructor(request, path26 = "/", matchResult = [[]]) {
62419
+ constructor(request, path27 = "/", matchResult = [[]]) {
62215
62420
  this.raw = request;
62216
- this.path = path26;
62421
+ this.path = path27;
62217
62422
  this.#matchResult = matchResult;
62218
62423
  this.#validatedData = {};
62219
62424
  }
@@ -63002,8 +63207,8 @@ var init_hono_base = __esm({
63002
63207
  return this;
63003
63208
  };
63004
63209
  });
63005
- this.on = (method, path26, ...handlers) => {
63006
- for (const p of [path26].flat()) {
63210
+ this.on = (method, path27, ...handlers) => {
63211
+ for (const p of [path27].flat()) {
63007
63212
  this.#path = p;
63008
63213
  for (const m of [method].flat()) {
63009
63214
  handlers.map((handler) => {
@@ -63060,8 +63265,8 @@ var init_hono_base = __esm({
63060
63265
  * app.route("/api", app2) // GET /api/user
63061
63266
  * ```
63062
63267
  */
63063
- route(path26, app2) {
63064
- const subApp = this.basePath(path26);
63268
+ route(path27, app2) {
63269
+ const subApp = this.basePath(path27);
63065
63270
  app2.routes.map((r) => {
63066
63271
  let handler;
63067
63272
  if (app2.errorHandler === errorHandler) {
@@ -63087,9 +63292,9 @@ var init_hono_base = __esm({
63087
63292
  * const api = new Hono().basePath('/api')
63088
63293
  * ```
63089
63294
  */
63090
- basePath(path26) {
63295
+ basePath(path27) {
63091
63296
  const subApp = this.#clone();
63092
- subApp._basePath = mergePath(this._basePath, path26);
63297
+ subApp._basePath = mergePath(this._basePath, path27);
63093
63298
  return subApp;
63094
63299
  }
63095
63300
  /**
@@ -63163,7 +63368,7 @@ var init_hono_base = __esm({
63163
63368
  * })
63164
63369
  * ```
63165
63370
  */
63166
- mount(path26, applicationHandler, options) {
63371
+ mount(path27, applicationHandler, options) {
63167
63372
  let replaceRequest;
63168
63373
  let optionHandler;
63169
63374
  if (options) {
@@ -63190,7 +63395,7 @@ var init_hono_base = __esm({
63190
63395
  return [c.env, executionContext];
63191
63396
  };
63192
63397
  replaceRequest ||= (() => {
63193
- const mergedPath = mergePath(this._basePath, path26);
63398
+ const mergedPath = mergePath(this._basePath, path27);
63194
63399
  const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
63195
63400
  return (request) => {
63196
63401
  const url = new URL(request.url);
@@ -63205,19 +63410,19 @@ var init_hono_base = __esm({
63205
63410
  }
63206
63411
  await next();
63207
63412
  };
63208
- this.#addRoute(METHOD_NAME_ALL, mergePath(path26, "*"), handler);
63413
+ this.#addRoute(METHOD_NAME_ALL, mergePath(path27, "*"), handler);
63209
63414
  return this;
63210
63415
  }
63211
- #addRoute(method, path26, handler, baseRoutePath) {
63416
+ #addRoute(method, path27, handler, baseRoutePath) {
63212
63417
  method = method.toUpperCase();
63213
- path26 = mergePath(this._basePath, path26);
63418
+ path27 = mergePath(this._basePath, path27);
63214
63419
  const r = {
63215
63420
  basePath: baseRoutePath !== void 0 ? mergePath(this._basePath, baseRoutePath) : this._basePath,
63216
- path: path26,
63421
+ path: path27,
63217
63422
  method,
63218
63423
  handler
63219
63424
  };
63220
- this.router.add(method, path26, [handler, r]);
63425
+ this.router.add(method, path27, [handler, r]);
63221
63426
  this.routes.push(r);
63222
63427
  }
63223
63428
  #handleError(err, c) {
@@ -63230,10 +63435,10 @@ var init_hono_base = __esm({
63230
63435
  if (method === "HEAD") {
63231
63436
  return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, "GET")))();
63232
63437
  }
63233
- const path26 = this.getPath(request, { env });
63234
- const matchResult = this.router.match(method, path26);
63438
+ const path27 = this.getPath(request, { env });
63439
+ const matchResult = this.router.match(method, path27);
63235
63440
  const c = new Context(request, {
63236
- path: path26,
63441
+ path: path27,
63237
63442
  matchResult,
63238
63443
  env,
63239
63444
  executionCtx,
@@ -63334,15 +63539,15 @@ var init_hono_base = __esm({
63334
63539
  });
63335
63540
 
63336
63541
  // ../../node_modules/.pnpm/hono@4.12.33/node_modules/hono/dist/router/reg-exp-router/matcher.js
63337
- function match(method, path26) {
63542
+ function match(method, path27) {
63338
63543
  const matchers = this.buildAllMatchers();
63339
- const match2 = ((method2, path27) => {
63544
+ const match2 = ((method2, path28) => {
63340
63545
  const matcher = matchers[method2] || matchers[METHOD_NAME_ALL];
63341
- const staticMatch = matcher[2][path27];
63546
+ const staticMatch = matcher[2][path28];
63342
63547
  if (staticMatch) {
63343
63548
  return staticMatch;
63344
63549
  }
63345
- const match3 = path27.match(matcher[0]);
63550
+ const match3 = path28.match(matcher[0]);
63346
63551
  if (!match3) {
63347
63552
  return [[], emptyParam];
63348
63553
  }
@@ -63350,7 +63555,7 @@ function match(method, path26) {
63350
63555
  return [matcher[1][index2], match3];
63351
63556
  });
63352
63557
  this.match = match2;
63353
- return match2(method, path26);
63558
+ return match2(method, path27);
63354
63559
  }
63355
63560
  var emptyParam;
63356
63561
  var init_matcher = __esm({
@@ -63484,12 +63689,12 @@ var init_trie = __esm({
63484
63689
  Trie = class {
63485
63690
  #context = { varIndex: 0 };
63486
63691
  #root = new Node2();
63487
- insert(path26, index2, pathErrorCheckOnly) {
63692
+ insert(path27, index2, pathErrorCheckOnly) {
63488
63693
  const paramAssoc = [];
63489
63694
  const groups = [];
63490
63695
  for (let i = 0; ; ) {
63491
63696
  let replaced = false;
63492
- path26 = path26.replace(/\{[^}]+\}/g, (m) => {
63697
+ path27 = path27.replace(/\{[^}]+\}/g, (m) => {
63493
63698
  const mark = `@\\${i}`;
63494
63699
  groups[i] = [mark, m];
63495
63700
  i++;
@@ -63500,7 +63705,7 @@ var init_trie = __esm({
63500
63705
  break;
63501
63706
  }
63502
63707
  }
63503
- const tokens = path26.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
63708
+ const tokens = path27.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
63504
63709
  for (let i = groups.length - 1; i >= 0; i--) {
63505
63710
  const [mark] = groups[i];
63506
63711
  for (let j = tokens.length - 1; j >= 0; j--) {
@@ -63539,9 +63744,9 @@ var init_trie = __esm({
63539
63744
  });
63540
63745
 
63541
63746
  // ../../node_modules/.pnpm/hono@4.12.33/node_modules/hono/dist/router/reg-exp-router/router.js
63542
- function buildWildcardRegExp(path26) {
63543
- return wildcardRegExpCache[path26] ??= new RegExp(
63544
- path26 === "*" ? "" : `^${path26.replace(
63747
+ function buildWildcardRegExp(path27) {
63748
+ return wildcardRegExpCache[path27] ??= new RegExp(
63749
+ path27 === "*" ? "" : `^${path27.replace(
63545
63750
  /\/\*$|([.\\+*[^\]$()])/g,
63546
63751
  (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)"
63547
63752
  )}$`
@@ -63563,17 +63768,17 @@ function buildMatcherFromPreprocessedRoutes(routes) {
63563
63768
  );
63564
63769
  const staticMap = /* @__PURE__ */ Object.create(null);
63565
63770
  for (let i = 0, j = -1, len2 = routesWithStaticPathFlag.length; i < len2; i++) {
63566
- const [pathErrorCheckOnly, path26, handlers] = routesWithStaticPathFlag[i];
63771
+ const [pathErrorCheckOnly, path27, handlers] = routesWithStaticPathFlag[i];
63567
63772
  if (pathErrorCheckOnly) {
63568
- staticMap[path26] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
63773
+ staticMap[path27] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
63569
63774
  } else {
63570
63775
  j++;
63571
63776
  }
63572
63777
  let paramAssoc;
63573
63778
  try {
63574
- paramAssoc = trie.insert(path26, j, pathErrorCheckOnly);
63779
+ paramAssoc = trie.insert(path27, j, pathErrorCheckOnly);
63575
63780
  } catch (e) {
63576
- throw e === PATH_ERROR ? new UnsupportedPathError(path26) : e;
63781
+ throw e === PATH_ERROR ? new UnsupportedPathError(path27) : e;
63577
63782
  }
63578
63783
  if (pathErrorCheckOnly) {
63579
63784
  continue;
@@ -63607,12 +63812,12 @@ function buildMatcherFromPreprocessedRoutes(routes) {
63607
63812
  }
63608
63813
  return [regexp, handlerMap, staticMap];
63609
63814
  }
63610
- function findMiddleware(middleware, path26) {
63815
+ function findMiddleware(middleware, path27) {
63611
63816
  if (!middleware) {
63612
63817
  return void 0;
63613
63818
  }
63614
63819
  for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) {
63615
- if (buildWildcardRegExp(k).test(path26)) {
63820
+ if (buildWildcardRegExp(k).test(path27)) {
63616
63821
  return [...middleware[k]];
63617
63822
  }
63618
63823
  }
@@ -63637,7 +63842,7 @@ var init_router2 = __esm({
63637
63842
  this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
63638
63843
  this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
63639
63844
  }
63640
- add(method, path26, handler) {
63845
+ add(method, path27, handler) {
63641
63846
  const middleware = this.#middleware;
63642
63847
  const routes = this.#routes;
63643
63848
  if (!middleware || !routes) {
@@ -63652,18 +63857,18 @@ var init_router2 = __esm({
63652
63857
  });
63653
63858
  });
63654
63859
  }
63655
- if (path26 === "/*") {
63656
- path26 = "*";
63860
+ if (path27 === "/*") {
63861
+ path27 = "*";
63657
63862
  }
63658
- const paramCount = (path26.match(/\/:/g) || []).length;
63659
- if (/\*$/.test(path26)) {
63660
- const re = buildWildcardRegExp(path26);
63863
+ const paramCount = (path27.match(/\/:/g) || []).length;
63864
+ if (/\*$/.test(path27)) {
63865
+ const re = buildWildcardRegExp(path27);
63661
63866
  if (method === METHOD_NAME_ALL) {
63662
63867
  Object.keys(middleware).forEach((m) => {
63663
- 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) || [];
63664
63869
  });
63665
63870
  } else {
63666
- 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) || [];
63667
63872
  }
63668
63873
  Object.keys(middleware).forEach((m) => {
63669
63874
  if (method === METHOD_NAME_ALL || method === m) {
@@ -63681,15 +63886,15 @@ var init_router2 = __esm({
63681
63886
  });
63682
63887
  return;
63683
63888
  }
63684
- const paths = checkOptionalParameter(path26) || [path26];
63889
+ const paths = checkOptionalParameter(path27) || [path27];
63685
63890
  for (let i = 0, len2 = paths.length; i < len2; i++) {
63686
- const path27 = paths[i];
63891
+ const path28 = paths[i];
63687
63892
  Object.keys(routes).forEach((m) => {
63688
63893
  if (method === METHOD_NAME_ALL || method === m) {
63689
- routes[m][path27] ||= [
63690
- ...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) || []
63691
63896
  ];
63692
- routes[m][path27].push([handler, paramCount - len2 + i + 1]);
63897
+ routes[m][path28].push([handler, paramCount - len2 + i + 1]);
63693
63898
  }
63694
63899
  });
63695
63900
  }
@@ -63708,13 +63913,13 @@ var init_router2 = __esm({
63708
63913
  const routes = [];
63709
63914
  let hasOwnRoute = method === METHOD_NAME_ALL;
63710
63915
  [this.#middleware, this.#routes].forEach((r) => {
63711
- 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]]) : [];
63712
63917
  if (ownRoute.length !== 0) {
63713
63918
  hasOwnRoute ||= true;
63714
63919
  routes.push(...ownRoute);
63715
63920
  } else if (method !== METHOD_NAME_ALL) {
63716
63921
  routes.push(
63717
- ...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]])
63718
63923
  );
63719
63924
  }
63720
63925
  });
@@ -63760,13 +63965,13 @@ var init_router3 = __esm({
63760
63965
  constructor(init) {
63761
63966
  this.#routers = init.routers;
63762
63967
  }
63763
- add(method, path26, handler) {
63968
+ add(method, path27, handler) {
63764
63969
  if (!this.#routes) {
63765
63970
  throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
63766
63971
  }
63767
- this.#routes.push([method, path26, handler]);
63972
+ this.#routes.push([method, path27, handler]);
63768
63973
  }
63769
- match(method, path26) {
63974
+ match(method, path27) {
63770
63975
  if (!this.#routes) {
63771
63976
  throw new Error("Fatal error");
63772
63977
  }
@@ -63781,7 +63986,7 @@ var init_router3 = __esm({
63781
63986
  for (let i2 = 0, len22 = routes.length; i2 < len22; i2++) {
63782
63987
  router.add(...routes[i2]);
63783
63988
  }
63784
- res = router.match(method, path26);
63989
+ res = router.match(method, path27);
63785
63990
  } catch (e) {
63786
63991
  if (e instanceof UnsupportedPathError) {
63787
63992
  continue;
@@ -63847,10 +64052,10 @@ var init_node2 = __esm({
63847
64052
  }
63848
64053
  this.#patterns = [];
63849
64054
  }
63850
- insert(method, path26, handler) {
64055
+ insert(method, path27, handler) {
63851
64056
  this.#order = ++this.#order;
63852
64057
  let curNode = this;
63853
- const parts = splitRoutingPath(path26);
64058
+ const parts = splitRoutingPath(path27);
63854
64059
  const possibleKeys = [];
63855
64060
  for (let i = 0, len2 = parts.length; i < len2; i++) {
63856
64061
  const p = parts[i];
@@ -63899,12 +64104,12 @@ var init_node2 = __esm({
63899
64104
  }
63900
64105
  }
63901
64106
  }
63902
- search(method, path26) {
64107
+ search(method, path27) {
63903
64108
  const handlerSets = [];
63904
64109
  this.#params = emptyParams;
63905
64110
  const curNode = this;
63906
64111
  let curNodes = [curNode];
63907
- const parts = splitPath(path26);
64112
+ const parts = splitPath(path27);
63908
64113
  const curNodesQueue = [];
63909
64114
  const len2 = parts.length;
63910
64115
  let partOffsets = null;
@@ -63946,13 +64151,13 @@ var init_node2 = __esm({
63946
64151
  if (matcher instanceof RegExp) {
63947
64152
  if (partOffsets === null) {
63948
64153
  partOffsets = new Array(len2);
63949
- let offset = path26[0] === "/" ? 1 : 0;
64154
+ let offset = path27[0] === "/" ? 1 : 0;
63950
64155
  for (let p = 0; p < len2; p++) {
63951
64156
  partOffsets[p] = offset;
63952
64157
  offset += parts[p].length + 1;
63953
64158
  }
63954
64159
  }
63955
- const restPathString = path26.substring(partOffsets[i]);
64160
+ const restPathString = path27.substring(partOffsets[i]);
63956
64161
  const m = matcher.exec(restPathString);
63957
64162
  if (m) {
63958
64163
  params[name] = m[0];
@@ -64022,18 +64227,18 @@ var init_router4 = __esm({
64022
64227
  constructor() {
64023
64228
  this.#node = new Node3();
64024
64229
  }
64025
- add(method, path26, handler) {
64026
- const results = checkOptionalParameter(path26);
64230
+ add(method, path27, handler) {
64231
+ const results = checkOptionalParameter(path27);
64027
64232
  if (results) {
64028
64233
  for (let i = 0, len2 = results.length; i < len2; i++) {
64029
64234
  this.#node.insert(method, results[i], handler);
64030
64235
  }
64031
64236
  return;
64032
64237
  }
64033
- this.#node.insert(method, path26, handler);
64238
+ this.#node.insert(method, path27, handler);
64034
64239
  }
64035
- match(method, path26) {
64036
- return this.#node.search(method, path26);
64240
+ match(method, path27) {
64241
+ return this.#node.search(method, path27);
64037
64242
  }
64038
64243
  };
64039
64244
  }
@@ -64195,9 +64400,9 @@ function slugify(value) {
64195
64400
  return slug2 || "workspace";
64196
64401
  }
64197
64402
  function ensureDirForFile(filePath) {
64198
- const directory = import_node_path18.default.dirname(filePath);
64199
- if (!import_node_fs12.default.existsSync(directory)) {
64200
- 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 });
64201
64406
  }
64202
64407
  }
64203
64408
  function openSqlite(dbPath) {
@@ -64217,7 +64422,7 @@ function resolveRegistryDbPath2() {
64217
64422
  if (!homeDir) {
64218
64423
  throw new Error("Cannot resolve home directory for registry DB path");
64219
64424
  }
64220
- return import_node_path18.default.join(homeDir, ".openez", "registry.sqlite");
64425
+ return import_node_path19.default.join(homeDir, ".openez", "registry.sqlite");
64221
64426
  }
64222
64427
  function initializeRegistrySchema2(db) {
64223
64428
  db.exec(getRegistryDdl());
@@ -64251,7 +64456,7 @@ function closeWorkspaceDb2(rootPath) {
64251
64456
  }
64252
64457
  }
64253
64458
  function resolveWorkspaceDbPath(rootPath) {
64254
- return import_node_path18.default.join(rootPath, ".openez", "index.sqlite");
64459
+ return import_node_path19.default.join(rootPath, ".openez", "index.sqlite");
64255
64460
  }
64256
64461
  function initializeWorkspaceSchema2(db) {
64257
64462
  db.exec(getFullWorkspaceDdl());
@@ -64275,7 +64480,7 @@ function migrateQueryLogColumns2(db) {
64275
64480
  }
64276
64481
  function getWorkspaceDb2(rootPath) {
64277
64482
  const normalized = normalizeRootPath2(rootPath);
64278
- if (normalized === "/" || normalized === "" || !import_node_fs12.default.existsSync(normalized)) {
64483
+ if (normalized === "/" || normalized === "" || !import_node_fs13.default.existsSync(normalized)) {
64279
64484
  throw new Error(`Workspace root path does not exist: "${rootPath}"`);
64280
64485
  }
64281
64486
  const cached2 = workspaceDbs.get(normalized);
@@ -64332,7 +64537,7 @@ function ensureRegistryWorkspace(input) {
64332
64537
  return existing;
64333
64538
  }
64334
64539
  const all = listRegistryWorkspaces();
64335
- 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();
64336
64541
  const baseId = slugify(baseName);
64337
64542
  const takenIds = new Set(all.map((workspace) => workspace.id));
64338
64543
  const takenNames = new Set(all.map((workspace) => workspace.name));
@@ -64605,13 +64810,13 @@ function getWorkspaceGraphOptimized(rootPath, maxNodes, maxEdges) {
64605
64810
  }))
64606
64811
  };
64607
64812
  }
64608
- 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;
64609
64814
  var init_sqlite2 = __esm({
64610
64815
  "../web/src/server/sqlite.ts"() {
64611
64816
  "use strict";
64612
- import_node_fs12 = __toESM(require("fs"), 1);
64817
+ import_node_fs13 = __toESM(require("fs"), 1);
64613
64818
  import_node_os4 = __toESM(require("os"), 1);
64614
- import_node_path18 = __toESM(require("path"), 1);
64819
+ import_node_path19 = __toESM(require("path"), 1);
64615
64820
  import_node_module3 = require("module");
64616
64821
  init_src();
64617
64822
  import_meta4 = {};
@@ -64645,7 +64850,7 @@ var init_sqlite2 = __esm({
64645
64850
  function getDirname() {
64646
64851
  try {
64647
64852
  if (typeof import_meta5 !== "undefined" && import_meta5.url) {
64648
- 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);
64649
64854
  }
64650
64855
  } catch {
64651
64856
  }
@@ -64679,7 +64884,7 @@ function mapWorkspace2(ws) {
64679
64884
  function resolveActiveWorkspace() {
64680
64885
  const all = listRegistryWorkspaces();
64681
64886
  if (all.length === 0) return null;
64682
- 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));
64683
64888
  return valid ?? all[0];
64684
64889
  }
64685
64890
  function resolveMetricsWorkspace(c) {
@@ -64690,7 +64895,7 @@ function resolveMetricsWorkspace(c) {
64690
64895
  }
64691
64896
  return all.find((w) => {
64692
64897
  try {
64693
- 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);
64694
64899
  } catch {
64695
64900
  return false;
64696
64901
  }
@@ -64698,31 +64903,31 @@ function resolveMetricsWorkspace(c) {
64698
64903
  }
64699
64904
  function findChangelogPath() {
64700
64905
  const candidates = [
64701
- import_node_path19.default.resolve(serverDir, "CHANGELOG.md"),
64702
- import_node_path19.default.resolve(serverDir, "..", "..", "..", "..", "CHANGELOG.md"),
64703
- import_node_path19.default.resolve(serverDir, "..", "..", "..", "CHANGELOG.md"),
64704
- import_node_path19.default.resolve(serverDir, "..", "CHANGELOG.md"),
64705
- 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")
64706
64911
  ];
64707
64912
  for (const candidate of candidates) {
64708
- if ((0, import_node_fs13.existsSync)(candidate)) return candidate;
64913
+ if ((0, import_node_fs14.existsSync)(candidate)) return candidate;
64709
64914
  }
64710
64915
  let dir = process.cwd();
64711
64916
  for (let i = 0; i < 6; i++) {
64712
- const candidate = import_node_path19.default.join(dir, "CHANGELOG.md");
64713
- if ((0, import_node_fs13.existsSync)(candidate)) return candidate;
64714
- 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);
64715
64920
  if (parent === dir) break;
64716
64921
  dir = parent;
64717
64922
  }
64718
64923
  return null;
64719
64924
  }
64720
64925
  function resolveWebDist() {
64721
- const sourceDist = import_node_path19.default.resolve(serverDir, "..", "dist");
64722
- 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;
64723
64928
  if (process.env.OPENEZ_CLI_BUNDLE === "true" && process.argv[1]) {
64724
- const cliDist = import_node_path19.default.resolve(import_node_path19.default.dirname((0, import_node_fs13.realpathSync)(process.argv[1])), "web");
64725
- 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;
64726
64931
  }
64727
64932
  return null;
64728
64933
  }
@@ -64731,22 +64936,22 @@ function createWebServer() {
64731
64936
  if (webDist) {
64732
64937
  app.use("/*", serveStatic({ root: webDist, rewriteRequestPath: (p) => p }));
64733
64938
  app.get("*", (c) => {
64734
- const indexPath = import_node_path19.default.join(webDist, "index.html");
64735
- 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");
64736
64941
  return c.html(index2);
64737
64942
  });
64738
64943
  }
64739
64944
  return app;
64740
64945
  }
64741
- 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;
64742
64947
  var init_server3 = __esm({
64743
64948
  "../web/src/server/index.ts"() {
64744
64949
  "use strict";
64745
64950
  init_serve_static();
64746
64951
  init_dist3();
64747
64952
  init_cors();
64748
- import_node_fs13 = require("fs");
64749
- import_node_path19 = __toESM(require("path"), 1);
64953
+ import_node_fs14 = require("fs");
64954
+ import_node_path20 = __toESM(require("path"), 1);
64750
64955
  init_sqlite2();
64751
64956
  init_src3();
64752
64957
  init_src();
@@ -64789,7 +64994,7 @@ var init_server3 = __esm({
64789
64994
  const all = listRegistryWorkspaces();
64790
64995
  const target = all.find((ws) => {
64791
64996
  try {
64792
- 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);
64793
64998
  } catch {
64794
64999
  return false;
64795
65000
  }
@@ -64867,7 +65072,7 @@ var init_server3 = __esm({
64867
65072
  const rootPath = body.rootPath;
64868
65073
  if (!rootPath) return c.json({ valid: false, error: "Path is required" });
64869
65074
  try {
64870
- const stats = await import_node_fs13.promises.stat(rootPath);
65075
+ const stats = await import_node_fs14.promises.stat(rootPath);
64871
65076
  if (!stats.isDirectory()) return c.json({ valid: false, error: "Path is not a directory" });
64872
65077
  return c.json({ valid: true });
64873
65078
  } catch {
@@ -64933,7 +65138,7 @@ var init_server3 = __esm({
64933
65138
  const rootPath = body.rootPath;
64934
65139
  if (!rootPath) return c.json({ success: false, error: "rootPath is required" });
64935
65140
  try {
64936
- const stats = await import_node_fs13.promises.stat(rootPath);
65141
+ const stats = await import_node_fs14.promises.stat(rootPath);
64937
65142
  if (!stats.isDirectory()) return c.json({ success: false, error: "Path is not a directory" });
64938
65143
  } catch {
64939
65144
  return c.json({
@@ -64942,8 +65147,8 @@ var init_server3 = __esm({
64942
65147
  });
64943
65148
  }
64944
65149
  const ws = ensureRegistryWorkspace({
64945
- name: body.name?.trim() || import_node_path19.default.basename(rootPath),
64946
- 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),
64947
65152
  includeGlobs: (body.includeGlobs ?? DEFAULT_INCLUDE_GLOBS).join("\n"),
64948
65153
  excludeGlobs: (body.excludeGlobs ?? DEFAULT_EXCLUDE_GLOBS).join("\n")
64949
65154
  });
@@ -65335,7 +65540,7 @@ var init_server3 = __esm({
65335
65540
  try {
65336
65541
  const filePath = findChangelogPath();
65337
65542
  if (!filePath) return c.json({ content: "" }, 404);
65338
- const content = (0, import_node_fs13.readFileSync)(filePath, "utf-8");
65543
+ const content = (0, import_node_fs14.readFileSync)(filePath, "utf-8");
65339
65544
  return c.json({ content });
65340
65545
  } catch {
65341
65546
  return c.json({ content: "" }, 500);
@@ -65373,38 +65578,38 @@ function getThisDir() {
65373
65578
  }
65374
65579
  function resolveCliInvocation() {
65375
65580
  const thisDir = getThisDir();
65376
- if (import_node_path20.default.basename(thisDir) === "dist") {
65377
- const repoRoot2 = import_node_path20.default.resolve(thisDir, "..");
65378
- 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");
65379
65584
  return {
65380
65585
  command: process.execPath,
65381
65586
  args: [cliPath2, "serve", "--mcp"],
65382
65587
  repoRoot: repoRoot2
65383
65588
  };
65384
65589
  }
65385
- const repoRoot = import_node_path20.default.resolve(thisDir, "../../..");
65386
- const builtCliPath = import_node_path20.default.resolve(thisDir, "../dist/cli.cjs");
65387
- 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)) {
65388
65593
  return {
65389
65594
  command: process.execPath,
65390
65595
  args: [builtCliPath, "serve", "--mcp"],
65391
65596
  repoRoot
65392
65597
  };
65393
65598
  }
65394
- const tsxPath = import_node_path20.default.join(repoRoot, "node_modules", ".bin", "tsx");
65395
- 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");
65396
65601
  return {
65397
65602
  command: tsxPath,
65398
65603
  args: [cliPath, "serve", "--mcp"],
65399
65604
  repoRoot
65400
65605
  };
65401
65606
  }
65402
- var import_node_fs14, import_node_path20, import_meta6;
65607
+ var import_node_fs15, import_node_path21, import_meta6;
65403
65608
  var init_resolve_cli = __esm({
65404
65609
  "src/resolve-cli.ts"() {
65405
65610
  "use strict";
65406
- import_node_fs14 = __toESM(require("fs"), 1);
65407
- import_node_path20 = __toESM(require("path"), 1);
65611
+ import_node_fs15 = __toESM(require("fs"), 1);
65612
+ import_node_path21 = __toESM(require("path"), 1);
65408
65613
  import_meta6 = {};
65409
65614
  }
65410
65615
  });
@@ -65413,55 +65618,55 @@ var init_resolve_cli = __esm({
65413
65618
  function readInstructionFile(instructionsPath) {
65414
65619
  let fd;
65415
65620
  try {
65416
- fd = import_node_fs15.default.openSync(instructionsPath, import_node_fs15.default.constants.O_RDONLY | (import_node_fs15.default.constants.O_NOFOLLOW ?? 0));
65417
- 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");
65418
65623
  } catch (error2) {
65419
65624
  if (error2.code === "ENOENT") return "";
65420
65625
  throw error2;
65421
65626
  } finally {
65422
- if (fd !== void 0) import_node_fs15.default.closeSync(fd);
65627
+ if (fd !== void 0) import_node_fs16.default.closeSync(fd);
65423
65628
  }
65424
65629
  }
65425
65630
  function writeInstructionFileAtomic(instructionsPath, content) {
65426
65631
  const tempPath = `${instructionsPath}.openez-${process.pid}-${Date.now()}.tmp`;
65427
65632
  let mode = 420;
65428
65633
  try {
65429
- mode = import_node_fs15.default.statSync(instructionsPath).mode & 511;
65634
+ mode = import_node_fs16.default.statSync(instructionsPath).mode & 511;
65430
65635
  } catch (error2) {
65431
65636
  if (error2.code !== "ENOENT") throw error2;
65432
65637
  }
65433
65638
  let fd;
65434
65639
  try {
65435
- fd = import_node_fs15.default.openSync(
65640
+ fd = import_node_fs16.default.openSync(
65436
65641
  tempPath,
65437
- 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,
65438
65643
  mode
65439
65644
  );
65440
- import_node_fs15.default.writeFileSync(fd, content, "utf-8");
65441
- import_node_fs15.default.fsyncSync(fd);
65442
- 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);
65443
65648
  fd = void 0;
65444
65649
  try {
65445
- if (import_node_fs15.default.lstatSync(instructionsPath).isSymbolicLink()) {
65650
+ if (import_node_fs16.default.lstatSync(instructionsPath).isSymbolicLink()) {
65446
65651
  throw new Error("Refusing to manage symlinked instruction file: " + instructionsPath);
65447
65652
  }
65448
65653
  } catch (error2) {
65449
65654
  if (error2.code !== "ENOENT") throw error2;
65450
65655
  }
65451
- import_node_fs15.default.renameSync(tempPath, instructionsPath);
65656
+ import_node_fs16.default.renameSync(tempPath, instructionsPath);
65452
65657
  } catch (error2) {
65453
- if (fd !== void 0) import_node_fs15.default.closeSync(fd);
65658
+ if (fd !== void 0) import_node_fs16.default.closeSync(fd);
65454
65659
  try {
65455
- import_node_fs15.default.unlinkSync(tempPath);
65660
+ import_node_fs16.default.unlinkSync(tempPath);
65456
65661
  } catch {
65457
65662
  }
65458
65663
  throw error2;
65459
65664
  }
65460
65665
  }
65461
65666
  function installAgentInstructions(rootPath, fileName) {
65462
- const instructionsPath = import_node_path21.default.join(rootPath, fileName);
65667
+ const instructionsPath = import_node_path22.default.join(rootPath, fileName);
65463
65668
  try {
65464
- const stats = import_node_fs15.default.lstatSync(instructionsPath);
65669
+ const stats = import_node_fs16.default.lstatSync(instructionsPath);
65465
65670
  if (stats.isSymbolicLink()) {
65466
65671
  throw new Error("Refusing to manage symlinked instruction file: " + instructionsPath);
65467
65672
  }
@@ -65487,12 +65692,12 @@ function installAgentInstructions(rootPath, fileName) {
65487
65692
  if (next !== existing) writeInstructionFileAtomic(instructionsPath, next);
65488
65693
  return instructionsPath;
65489
65694
  }
65490
- 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;
65491
65696
  var init_setup_instructions = __esm({
65492
65697
  "src/setup-instructions.ts"() {
65493
65698
  "use strict";
65494
- import_node_fs15 = __toESM(require("fs"), 1);
65495
- import_node_path21 = __toESM(require("path"), 1);
65699
+ import_node_fs16 = __toESM(require("fs"), 1);
65700
+ import_node_path22 = __toESM(require("path"), 1);
65496
65701
  START_MARKER = "<!-- openez:start -->";
65497
65702
  END_MARKER = "<!-- openez:end -->";
65498
65703
  MANAGED_BLOCK = `${START_MARKER}
@@ -65500,6 +65705,7 @@ var init_setup_instructions = __esm({
65500
65705
  ## OpenEZ workflow
65501
65706
 
65502
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.
65503
65709
  - Use \`code_query\` before filesystem search and \`code_context\` for symbol or file follow-up.
65504
65710
  - Use \`graph_neighbors\` for relationship lookups between symbols, files, and edges.
65505
65711
  - Call \`memory_write\` after an architectural decision or non-obvious constraint is confirmed.
@@ -66417,28 +66623,28 @@ __export(setup_codex_exports, {
66417
66623
  setupCodex: () => setupCodex
66418
66624
  });
66419
66625
  function getCodexConfigPath() {
66420
- 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");
66421
66627
  }
66422
66628
  async function setupCodex(rootPath) {
66423
- const resolvedPath = import_node_path22.default.resolve(rootPath);
66424
- if (!import_node_fs16.default.existsSync(resolvedPath)) {
66629
+ const resolvedPath = import_node_path23.default.resolve(rootPath);
66630
+ if (!import_node_fs17.default.existsSync(resolvedPath)) {
66425
66631
  console.error(`Error: path does not exist: ${resolvedPath}`);
66426
66632
  process.exit(1);
66427
66633
  }
66428
- if (!import_node_fs16.default.statSync(resolvedPath).isDirectory()) {
66634
+ if (!import_node_fs17.default.statSync(resolvedPath).isDirectory()) {
66429
66635
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66430
66636
  process.exit(1);
66431
66637
  }
66432
66638
  const { command, args, repoRoot } = resolveCliInvocation();
66433
66639
  const label = "openez";
66434
66640
  const configPath = getCodexConfigPath();
66435
- const configDir = import_node_path22.default.dirname(configPath);
66436
- if (!import_node_fs16.default.existsSync(configDir)) {
66437
- 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 });
66438
66644
  }
66439
66645
  let config2 = {};
66440
- if (import_node_fs16.default.existsSync(configPath)) {
66441
- 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");
66442
66648
  try {
66443
66649
  config2 = parse3(raw2);
66444
66650
  } catch {
@@ -66456,8 +66662,8 @@ async function setupCodex(rootPath) {
66456
66662
  };
66457
66663
  mcpServers[label] = entry;
66458
66664
  const output = stringify2(config2);
66459
- import_node_fs16.default.writeFileSync(configPath, output, "utf-8");
66460
- 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);
66461
66667
  const instructionsPath = installAgentInstructions(resolvedPath, "AGENTS.md");
66462
66668
  console.log(`Codex MCP server configured: '${label}'`);
66463
66669
  console.log(" Mode: shared multi-workspace MCP");
@@ -66467,13 +66673,13 @@ async function setupCodex(rootPath) {
66467
66673
  console.log("");
66468
66674
  console.log("Restart Codex or open a new session for the changes to take effect.");
66469
66675
  }
66470
- var import_node_fs16, import_node_os5, import_node_path22;
66676
+ var import_node_fs17, import_node_os5, import_node_path23;
66471
66677
  var init_setup_codex = __esm({
66472
66678
  "src/setup-codex.ts"() {
66473
66679
  "use strict";
66474
- import_node_fs16 = __toESM(require("fs"), 1);
66680
+ import_node_fs17 = __toESM(require("fs"), 1);
66475
66681
  import_node_os5 = __toESM(require("os"), 1);
66476
- import_node_path22 = __toESM(require("path"), 1);
66682
+ import_node_path23 = __toESM(require("path"), 1);
66477
66683
  init_resolve_cli();
66478
66684
  init_setup_instructions();
66479
66685
  init_dist4();
@@ -66486,28 +66692,28 @@ __export(setup_claude_exports, {
66486
66692
  setupClaude: () => setupClaude
66487
66693
  });
66488
66694
  function getClaudeConfigPath() {
66489
- 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");
66490
66696
  }
66491
66697
  async function setupClaude(rootPath) {
66492
- const resolvedPath = import_node_path23.default.resolve(rootPath);
66493
- if (!import_node_fs17.default.existsSync(resolvedPath)) {
66698
+ const resolvedPath = import_node_path24.default.resolve(rootPath);
66699
+ if (!import_node_fs18.default.existsSync(resolvedPath)) {
66494
66700
  console.error(`Error: path does not exist: ${resolvedPath}`);
66495
66701
  process.exit(1);
66496
66702
  }
66497
- if (!import_node_fs17.default.statSync(resolvedPath).isDirectory()) {
66703
+ if (!import_node_fs18.default.statSync(resolvedPath).isDirectory()) {
66498
66704
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66499
66705
  process.exit(1);
66500
66706
  }
66501
66707
  const { command, args, repoRoot } = resolveCliInvocation();
66502
66708
  const label = "openez";
66503
66709
  const configPath = getClaudeConfigPath();
66504
- const configDir = import_node_path23.default.dirname(configPath);
66505
- if (!import_node_fs17.default.existsSync(configDir)) {
66506
- 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 });
66507
66713
  }
66508
66714
  let config2 = {};
66509
- if (import_node_fs17.default.existsSync(configPath)) {
66510
- 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");
66511
66717
  try {
66512
66718
  config2 = JSON.parse(raw2);
66513
66719
  } catch {
@@ -66523,8 +66729,8 @@ async function setupClaude(rootPath) {
66523
66729
  args,
66524
66730
  startupTimeoutSec: 120
66525
66731
  };
66526
- import_node_fs17.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66527
- 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);
66528
66734
  const instructionsPath = installAgentInstructions(resolvedPath, "CLAUDE.md");
66529
66735
  console.log(`Claude Code MCP server configured: '${label}'`);
66530
66736
  console.log(" Mode: shared multi-workspace MCP");
@@ -66534,13 +66740,13 @@ async function setupClaude(rootPath) {
66534
66740
  console.log("");
66535
66741
  console.log("Restart Claude Code or open a new session for the changes to take effect.");
66536
66742
  }
66537
- var import_node_fs17, import_node_os6, import_node_path23;
66743
+ var import_node_fs18, import_node_os6, import_node_path24;
66538
66744
  var init_setup_claude = __esm({
66539
66745
  "src/setup-claude.ts"() {
66540
66746
  "use strict";
66541
- import_node_fs17 = __toESM(require("fs"), 1);
66747
+ import_node_fs18 = __toESM(require("fs"), 1);
66542
66748
  import_node_os6 = __toESM(require("os"), 1);
66543
- import_node_path23 = __toESM(require("path"), 1);
66749
+ import_node_path24 = __toESM(require("path"), 1);
66544
66750
  init_resolve_cli();
66545
66751
  init_setup_instructions();
66546
66752
  }
@@ -66552,28 +66758,28 @@ __export(setup_opencode_exports, {
66552
66758
  setupOpenCode: () => setupOpenCode
66553
66759
  });
66554
66760
  function getOpenCodeConfigPath() {
66555
- 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");
66556
66762
  }
66557
66763
  async function setupOpenCode(rootPath) {
66558
- const resolvedPath = import_node_path24.default.resolve(rootPath);
66559
- if (!import_node_fs18.default.existsSync(resolvedPath)) {
66764
+ const resolvedPath = import_node_path25.default.resolve(rootPath);
66765
+ if (!import_node_fs19.default.existsSync(resolvedPath)) {
66560
66766
  console.error(`Error: path does not exist: ${resolvedPath}`);
66561
66767
  process.exit(1);
66562
66768
  }
66563
- if (!import_node_fs18.default.statSync(resolvedPath).isDirectory()) {
66769
+ if (!import_node_fs19.default.statSync(resolvedPath).isDirectory()) {
66564
66770
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66565
66771
  process.exit(1);
66566
66772
  }
66567
66773
  const { command, args, repoRoot } = resolveCliInvocation();
66568
66774
  const label = "openez";
66569
66775
  const configPath = getOpenCodeConfigPath();
66570
- const configDir = import_node_path24.default.dirname(configPath);
66571
- if (!import_node_fs18.default.existsSync(configDir)) {
66572
- 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 });
66573
66779
  }
66574
66780
  let config2 = {};
66575
- if (import_node_fs18.default.existsSync(configPath)) {
66576
- 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");
66577
66783
  try {
66578
66784
  config2 = JSON.parse(raw2);
66579
66785
  } catch {
@@ -66589,8 +66795,8 @@ async function setupOpenCode(rootPath) {
66589
66795
  command: [command, ...args],
66590
66796
  enabled: true
66591
66797
  };
66592
- import_node_fs18.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66593
- 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);
66594
66800
  const instructionsPath = installAgentInstructions(resolvedPath, "AGENTS.md");
66595
66801
  console.log(`OpenCode MCP server configured: '${label}'`);
66596
66802
  console.log(" Mode: shared multi-workspace MCP");
@@ -66600,13 +66806,13 @@ async function setupOpenCode(rootPath) {
66600
66806
  console.log("");
66601
66807
  console.log("Restart OpenCode or open a new session for the changes to take effect.");
66602
66808
  }
66603
- var import_node_fs18, import_node_os7, import_node_path24;
66809
+ var import_node_fs19, import_node_os7, import_node_path25;
66604
66810
  var init_setup_opencode = __esm({
66605
66811
  "src/setup-opencode.ts"() {
66606
66812
  "use strict";
66607
- import_node_fs18 = __toESM(require("fs"), 1);
66813
+ import_node_fs19 = __toESM(require("fs"), 1);
66608
66814
  import_node_os7 = __toESM(require("os"), 1);
66609
- import_node_path24 = __toESM(require("path"), 1);
66815
+ import_node_path25 = __toESM(require("path"), 1);
66610
66816
  init_resolve_cli();
66611
66817
  init_setup_instructions();
66612
66818
  }
@@ -66618,28 +66824,28 @@ __export(setup_windsurf_exports, {
66618
66824
  setupWindsurf: () => setupWindsurf
66619
66825
  });
66620
66826
  function getWindsurfConfigPath() {
66621
- 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");
66622
66828
  }
66623
66829
  async function setupWindsurf(rootPath) {
66624
- const resolvedPath = import_node_path25.default.resolve(rootPath);
66625
- if (!import_node_fs19.default.existsSync(resolvedPath)) {
66830
+ const resolvedPath = import_node_path26.default.resolve(rootPath);
66831
+ if (!import_node_fs20.default.existsSync(resolvedPath)) {
66626
66832
  console.error(`Error: path does not exist: ${resolvedPath}`);
66627
66833
  process.exit(1);
66628
66834
  }
66629
- if (!import_node_fs19.default.statSync(resolvedPath).isDirectory()) {
66835
+ if (!import_node_fs20.default.statSync(resolvedPath).isDirectory()) {
66630
66836
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66631
66837
  process.exit(1);
66632
66838
  }
66633
66839
  const { command, args, repoRoot } = resolveCliInvocation();
66634
66840
  const label = "openez";
66635
66841
  const configPath = getWindsurfConfigPath();
66636
- const configDir = import_node_path25.default.dirname(configPath);
66637
- if (!import_node_fs19.default.existsSync(configDir)) {
66638
- 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 });
66639
66845
  }
66640
66846
  let config2 = {};
66641
- if (import_node_fs19.default.existsSync(configPath)) {
66642
- 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");
66643
66849
  try {
66644
66850
  config2 = JSON.parse(raw2);
66645
66851
  } catch {
@@ -66654,8 +66860,8 @@ async function setupWindsurf(rootPath) {
66654
66860
  command,
66655
66861
  args
66656
66862
  };
66657
- import_node_fs19.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66658
- 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);
66659
66865
  const instructionsPath = installAgentInstructions(resolvedPath, "AGENTS.md");
66660
66866
  console.log(`Windsurf MCP server configured: '${label}'`);
66661
66867
  console.log(" Mode: shared multi-workspace MCP");
@@ -66665,13 +66871,13 @@ async function setupWindsurf(rootPath) {
66665
66871
  console.log("");
66666
66872
  console.log("Restart Windsurf or open a new session for the changes to take effect.");
66667
66873
  }
66668
- var import_node_fs19, import_node_os8, import_node_path25;
66874
+ var import_node_fs20, import_node_os8, import_node_path26;
66669
66875
  var init_setup_windsurf = __esm({
66670
66876
  "src/setup-windsurf.ts"() {
66671
66877
  "use strict";
66672
- import_node_fs19 = __toESM(require("fs"), 1);
66878
+ import_node_fs20 = __toESM(require("fs"), 1);
66673
66879
  import_node_os8 = __toESM(require("os"), 1);
66674
- import_node_path25 = __toESM(require("path"), 1);
66880
+ import_node_path26 = __toESM(require("path"), 1);
66675
66881
  init_resolve_cli();
66676
66882
  init_setup_instructions();
66677
66883
  }
@@ -66683,28 +66889,28 @@ __export(setup_devin_exports, {
66683
66889
  setupDevin: () => setupDevin
66684
66890
  });
66685
66891
  function getDevinConfigPath() {
66686
- 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");
66687
66893
  }
66688
66894
  async function setupDevin(rootPath) {
66689
- const resolvedPath = import_node_path26.default.resolve(rootPath);
66690
- if (!import_node_fs20.default.existsSync(resolvedPath)) {
66895
+ const resolvedPath = import_node_path27.default.resolve(rootPath);
66896
+ if (!import_node_fs21.default.existsSync(resolvedPath)) {
66691
66897
  console.error(`Error: path does not exist: ${resolvedPath}`);
66692
66898
  process.exit(1);
66693
66899
  }
66694
- if (!import_node_fs20.default.statSync(resolvedPath).isDirectory()) {
66900
+ if (!import_node_fs21.default.statSync(resolvedPath).isDirectory()) {
66695
66901
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66696
66902
  process.exit(1);
66697
66903
  }
66698
66904
  const { command, args, repoRoot } = resolveCliInvocation();
66699
66905
  const label = "openez";
66700
66906
  const configPath = getDevinConfigPath();
66701
- const configDir = import_node_path26.default.dirname(configPath);
66702
- if (!import_node_fs20.default.existsSync(configDir)) {
66703
- 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 });
66704
66910
  }
66705
66911
  let config2 = {};
66706
- if (import_node_fs20.default.existsSync(configPath)) {
66707
- 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");
66708
66914
  try {
66709
66915
  config2 = JSON.parse(raw2);
66710
66916
  } catch {
@@ -66719,8 +66925,8 @@ async function setupDevin(rootPath) {
66719
66925
  command,
66720
66926
  args
66721
66927
  };
66722
- import_node_fs20.default.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n", "utf-8");
66723
- 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);
66724
66930
  const instructionsPath = installAgentInstructions(resolvedPath, "AGENTS.md");
66725
66931
  console.log(`Devin CLI MCP server configured: '${label}'`);
66726
66932
  console.log(" Mode: shared multi-workspace MCP");
@@ -66730,21 +66936,21 @@ async function setupDevin(rootPath) {
66730
66936
  console.log("");
66731
66937
  console.log("Restart Devin CLI or open a new session for the changes to take effect.");
66732
66938
  }
66733
- var import_node_fs20, import_node_os9, import_node_path26;
66939
+ var import_node_fs21, import_node_os9, import_node_path27;
66734
66940
  var init_setup_devin = __esm({
66735
66941
  "src/setup-devin.ts"() {
66736
66942
  "use strict";
66737
- import_node_fs20 = __toESM(require("fs"), 1);
66943
+ import_node_fs21 = __toESM(require("fs"), 1);
66738
66944
  import_node_os9 = __toESM(require("os"), 1);
66739
- import_node_path26 = __toESM(require("path"), 1);
66945
+ import_node_path27 = __toESM(require("path"), 1);
66740
66946
  init_resolve_cli();
66741
66947
  init_setup_instructions();
66742
66948
  }
66743
66949
  });
66744
66950
 
66745
66951
  // src/cli.ts
66746
- var import_node_fs21 = __toESM(require("fs"), 1);
66747
- 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);
66748
66954
  var import_node_readline = __toESM(require("readline"), 1);
66749
66955
  init_esm2();
66750
66956
 
@@ -66771,25 +66977,25 @@ init_src4();
66771
66977
  init_src3();
66772
66978
  var cliDir;
66773
66979
  try {
66774
- 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]));
66775
66981
  } catch {
66776
66982
  cliDir = process.cwd();
66777
66983
  }
66778
66984
  var pkg;
66779
66985
  try {
66780
- 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"));
66781
66987
  } catch {
66782
66988
  pkg = { version: "0.0.0-compiled" };
66783
66989
  }
66784
66990
  var program2 = new Command();
66785
66991
  program2.name("openez").description("OpenEZ Graph - Local-first knowledge retrieval system").version(pkg.version);
66786
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) => {
66787
- const resolvedPath = import_node_path27.default.resolve(targetPath);
66788
- if (!import_node_fs21.default.existsSync(resolvedPath)) {
66993
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66994
+ if (!import_node_fs22.default.existsSync(resolvedPath)) {
66789
66995
  console.error(`Error: path does not exist: ${resolvedPath}`);
66790
66996
  process.exit(1);
66791
66997
  }
66792
- if (!import_node_fs21.default.statSync(resolvedPath).isDirectory()) {
66998
+ if (!import_node_fs22.default.statSync(resolvedPath).isDirectory()) {
66793
66999
  console.error(`Error: path is not a directory: ${resolvedPath}`);
66794
67000
  process.exit(1);
66795
67001
  }
@@ -66819,7 +67025,7 @@ program2.command("init").description("Initialize a workspace at the given path a
66819
67025
  }
66820
67026
  });
66821
67027
  program2.command("index").description("Index files in a workspace").argument("[path]", "path to the workspace directory", process.cwd()).action(async (targetPath) => {
66822
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67028
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66823
67029
  let workspace = await readLocalWorkspaceConfig(resolvedPath);
66824
67030
  if (!workspace) {
66825
67031
  const registry2 = createRegistryRepository();
@@ -66840,7 +67046,7 @@ program2.command("index").description("Index files in a workspace").argument("[p
66840
67046
  console.log(JSON.stringify(summary, null, 2));
66841
67047
  });
66842
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) => {
66843
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67049
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66844
67050
  let workspace = await readLocalWorkspaceConfig(resolvedPath);
66845
67051
  if (!workspace) {
66846
67052
  const registry2 = createRegistryRepository();
@@ -66867,7 +67073,7 @@ program2.command("embed").description("Create embeddings for indexed workspace c
66867
67073
  console.log(JSON.stringify(summary, null, 2));
66868
67074
  });
66869
67075
  program2.command("reindex").description("Full rebuild of a workspace index").argument("[path]", "path to the workspace directory", process.cwd()).action(async (targetPath) => {
66870
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67076
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66871
67077
  const registry2 = createRegistryRepository();
66872
67078
  let workspace = await registry2.getWorkspaceByPath(resolvedPath);
66873
67079
  if (!workspace) {
@@ -66883,7 +67089,7 @@ program2.command("reindex").description("Full rebuild of a workspace index").arg
66883
67089
  console.log(JSON.stringify(summary, null, 2));
66884
67090
  });
66885
67091
  program2.command("watch").description("Watch files and re-index on changes").argument("[path]", "path to the workspace directory", process.cwd()).action(async (targetPath) => {
66886
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67092
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66887
67093
  const registry2 = createRegistryRepository();
66888
67094
  let workspace = await registry2.getWorkspaceByPath(resolvedPath);
66889
67095
  if (!workspace) {
@@ -66948,7 +67154,7 @@ program2.command("watch").description("Watch files and re-index on changes").arg
66948
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) => {
66949
67155
  if (options.mcp) {
66950
67156
  const { startMcpServer: startMcpServer2 } = await Promise.resolve().then(() => (init_mcp_bridge(), mcp_bridge_exports));
66951
- 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);
66952
67158
  } else if (options.web) {
66953
67159
  const port = options.port ? Number(options.port) : Number(process.env.API_PORT ?? 11368);
66954
67160
  process.env.API_PORT = String(port);
@@ -66972,7 +67178,7 @@ program2.command("serve").description("Start the web dashboard or MCP server").o
66972
67178
  }
66973
67179
  });
66974
67180
  program2.command("status").description("Show workspace status").argument("[path]", "path to the workspace directory", process.cwd()).action(async (targetPath) => {
66975
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67181
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
66976
67182
  const registry2 = createRegistryRepository();
66977
67183
  const workspace = await registry2.getWorkspaceByPath(resolvedPath);
66978
67184
  if (!workspace) {
@@ -67030,7 +67236,7 @@ function confirmDestructive(prompt) {
67030
67236
  }
67031
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) => {
67032
67238
  const registry2 = createRegistryRepository();
67033
- const resolvedPath = import_node_path27.default.resolve(targetPath);
67239
+ const resolvedPath = import_node_path28.default.resolve(targetPath);
67034
67240
  const workspace = options.id ? await registry2.getWorkspace(options.id) : await registry2.getWorkspaceByPath(resolvedPath);
67035
67241
  if (!workspace) {
67036
67242
  console.error(`Error: no registered workspace found for ${options.id ?? resolvedPath}`);