@sourcegraph/cody-web 0.31.1 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/{agent.worker-f0xW2blH.mjs → agent.worker-CDpvFRkI.mjs} +3746 -4877
  2. package/dist/agent.worker.js +2 -2
  3. package/dist/{git-log-lMMNBgcI.mjs → git-log-ltF6h_Tk.mjs} +1 -1
  4. package/dist/{index-CvHu3t7y.mjs → index-D6x43_Eb.mjs} +3 -3
  5. package/dist/index.js +1458 -1442
  6. package/dist/style.css +101 -81
  7. package/dist/{util-DVisVv7-.mjs → util-PivrZJhX.mjs} +1 -1
  8. package/dist/{vscode-shim-BMQfq1RF.mjs → vscode-shim-Coc7PRnS.mjs} +1903 -2052
  9. package/package.json +15 -17
  10. package/LICENSE +0 -201
  11. package/dist/demo/App.d.ts +0 -4
  12. package/dist/demo/App.d.ts.map +0 -1
  13. package/dist/demo/index.d.ts +0 -2
  14. package/dist/demo/index.d.ts.map +0 -1
  15. package/dist/lib/agent/agent.client.d.ts +0 -20
  16. package/dist/lib/agent/agent.client.d.ts.map +0 -1
  17. package/dist/lib/agent/agent.worker.d.ts +0 -2
  18. package/dist/lib/agent/agent.worker.d.ts.map +0 -1
  19. package/dist/lib/agent/index-db-storage.d.ts +0 -15
  20. package/dist/lib/agent/index-db-storage.d.ts.map +0 -1
  21. package/dist/lib/agent/shims/child_process.d.ts +0 -5
  22. package/dist/lib/agent/shims/child_process.d.ts.map +0 -1
  23. package/dist/lib/agent/shims/env-paths.d.ts +0 -2
  24. package/dist/lib/agent/shims/env-paths.d.ts.map +0 -1
  25. package/dist/lib/agent/shims/fs-extra.d.ts +0 -3
  26. package/dist/lib/agent/shims/fs-extra.d.ts.map +0 -1
  27. package/dist/lib/agent/shims/fs.d.ts +0 -9
  28. package/dist/lib/agent/shims/fs.d.ts.map +0 -1
  29. package/dist/lib/agent/shims/fs__promises.d.ts +0 -11
  30. package/dist/lib/agent/shims/fs__promises.d.ts.map +0 -1
  31. package/dist/lib/agent/shims/inline-completion-item-provider.d.ts +0 -3
  32. package/dist/lib/agent/shims/inline-completion-item-provider.d.ts.map +0 -1
  33. package/dist/lib/agent/shims/open.d.ts +0 -3
  34. package/dist/lib/agent/shims/open.d.ts.map +0 -1
  35. package/dist/lib/agent/shims/os.d.ts +0 -10
  36. package/dist/lib/agent/shims/os.d.ts.map +0 -1
  37. package/dist/lib/agent/shims/stream.d.ts +0 -9
  38. package/dist/lib/agent/shims/stream.d.ts.map +0 -1
  39. package/dist/lib/agent/shims/worker_threads.d.ts +0 -3
  40. package/dist/lib/agent/shims/worker_threads.d.ts.map +0 -1
  41. package/dist/lib/agent/shims/zlib.d.ts +0 -7
  42. package/dist/lib/agent/shims/zlib.d.ts.map +0 -1
  43. package/dist/lib/components/CodyPromptTemplate.d.ts +0 -28
  44. package/dist/lib/components/CodyPromptTemplate.d.ts.map +0 -1
  45. package/dist/lib/components/CodyWebChat.d.ts +0 -72
  46. package/dist/lib/components/CodyWebChat.d.ts.map +0 -1
  47. package/dist/lib/components/skeleton/ChatSkeleton.d.ts +0 -12
  48. package/dist/lib/components/skeleton/ChatSkeleton.d.ts.map +0 -1
  49. package/dist/lib/components/use-cody-agent.d.ts +0 -28
  50. package/dist/lib/components/use-cody-agent.d.ts.map +0 -1
  51. package/dist/lib/index.d.ts +0 -6
  52. package/dist/lib/index.d.ts.map +0 -1
  53. package/dist/lib/types.d.ts +0 -28
  54. package/dist/lib/types.d.ts.map +0 -1
  55. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -9,7 +9,15 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
11
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
- var _root2, _hasMagic, _uflag, _parts, _parent2, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn, _a2, _b, _c, _d, _e2, _f, _g, _h;
12
+ var __privateWrapper = (obj, member, setter, getter) => ({
13
+ set _(value) {
14
+ __privateSet(obj, member, value, setter);
15
+ },
16
+ get _() {
17
+ return __privateGet(obj, member, getter);
18
+ }
19
+ });
20
+ var _a2, _constructing, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn, _b, _root2, _hasMagic, _uflag, _parts, _parent2, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn, _c, _d, _e2, _f, _g, _h, _i2, _j;
13
21
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
14
22
  function getDefaultExportFromCjs(x3) {
15
23
  return x3 && x3.__esModule && Object.prototype.hasOwnProperty.call(x3, "default") ? x3["default"] : x3;
@@ -1883,16 +1891,16 @@ function stackSet$1(key, value) {
1883
1891
  }
1884
1892
  var _stackSet = stackSet$1;
1885
1893
  var ListCache = _ListCache, stackClear = _stackClear, stackDelete = _stackDelete, stackGet = _stackGet, stackHas = _stackHas, stackSet = _stackSet;
1886
- function Stack$2(entries) {
1894
+ function Stack$3(entries) {
1887
1895
  var data = this.__data__ = new ListCache(entries);
1888
1896
  this.size = data.size;
1889
1897
  }
1890
- Stack$2.prototype.clear = stackClear;
1891
- Stack$2.prototype["delete"] = stackDelete;
1892
- Stack$2.prototype.get = stackGet;
1893
- Stack$2.prototype.has = stackHas;
1894
- Stack$2.prototype.set = stackSet;
1895
- var _Stack = Stack$2;
1898
+ Stack$3.prototype.clear = stackClear;
1899
+ Stack$3.prototype["delete"] = stackDelete;
1900
+ Stack$3.prototype.get = stackGet;
1901
+ Stack$3.prototype.has = stackHas;
1902
+ Stack$3.prototype.set = stackSet;
1903
+ var _Stack = Stack$3;
1896
1904
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
1897
1905
  function setCacheAdd$1(value) {
1898
1906
  this.__data__.set(value, HASH_UNDEFINED);
@@ -2338,7 +2346,7 @@ if (DataView$1 && getTag$4(new DataView$1(new ArrayBuffer(1))) != dataViewTag$2
2338
2346
  };
2339
2347
  }
2340
2348
  var _getTag = getTag$4;
2341
- var Stack$1 = _Stack, equalArrays = _equalArrays, equalByTag = _equalByTag, equalObjects = _equalObjects, getTag$3 = _getTag, isArray$5 = isArray_1, isBuffer$1 = isBufferExports, isTypedArray = isTypedArray_1;
2349
+ var Stack$2 = _Stack, equalArrays = _equalArrays, equalByTag = _equalByTag, equalObjects = _equalObjects, getTag$3 = _getTag, isArray$5 = isArray_1, isBuffer$1 = isBufferExports, isTypedArray = isTypedArray_1;
2342
2350
  var COMPARE_PARTIAL_FLAG = 1;
2343
2351
  var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", objectTag$2 = "[object Object]";
2344
2352
  var objectProto$4 = Object.prototype;
@@ -2356,21 +2364,21 @@ function baseIsEqualDeep$1(object2, other, bitmask, customizer, equalFunc, stack
2356
2364
  objIsObj = false;
2357
2365
  }
2358
2366
  if (isSameTag && !objIsObj) {
2359
- stack || (stack = new Stack$1());
2367
+ stack || (stack = new Stack$2());
2360
2368
  return objIsArr || isTypedArray(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack);
2361
2369
  }
2362
2370
  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
2363
2371
  var objIsWrapped = objIsObj && hasOwnProperty$4.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$4.call(other, "__wrapped__");
2364
2372
  if (objIsWrapped || othIsWrapped) {
2365
2373
  var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
2366
- stack || (stack = new Stack$1());
2374
+ stack || (stack = new Stack$2());
2367
2375
  return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
2368
2376
  }
2369
2377
  }
2370
2378
  if (!isSameTag) {
2371
2379
  return false;
2372
2380
  }
2373
- stack || (stack = new Stack$1());
2381
+ stack || (stack = new Stack$2());
2374
2382
  return equalObjects(object2, other, bitmask, customizer, equalFunc, stack);
2375
2383
  }
2376
2384
  var _baseIsEqualDeep = baseIsEqualDeep$1;
@@ -2751,10 +2759,10 @@ function pick(...keys2) {
2751
2759
  )
2752
2760
  );
2753
2761
  }
2754
- let shareReplaySeq = 0;
2755
2762
  function shareReplay(config) {
2756
2763
  const shouldCountRefs = (config == null ? void 0 : config.shouldCountRefs) ?? true;
2757
- shareReplaySeq++;
2764
+ function logDebug2(msg, ...args) {
2765
+ }
2758
2766
  return (observable) => {
2759
2767
  const subject = new MulticastSubject();
2760
2768
  let subscription = null;
@@ -2764,7 +2772,10 @@ function shareReplay(config) {
2764
2772
  return new Observable((observer) => {
2765
2773
  refCount++;
2766
2774
  if (hasValue) {
2775
+ logDebug2("new subscriber, emitting buffered value", latestValue);
2767
2776
  observer.next(latestValue);
2777
+ } else {
2778
+ logDebug2();
2768
2779
  }
2769
2780
  if (!subscription) {
2770
2781
  subscription = observable.subscribe({
@@ -3884,8 +3895,6 @@ var formatters$1 = {
3884
3895
  }
3885
3896
  };
3886
3897
  var dayPeriodEnum = {
3887
- am: "am",
3888
- pm: "pm",
3889
3898
  midnight: "midnight",
3890
3899
  noon: "noon",
3891
3900
  morning: "morning",
@@ -5194,9 +5203,9 @@ function formatDistanceStrict(dirtyDate, dirtyBaseDate, options) {
5194
5203
  var minutes = milliseconds / MILLISECONDS_IN_MINUTE;
5195
5204
  var timezoneOffset = getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft);
5196
5205
  var dstNormalizedMinutes = (milliseconds - timezoneOffset) / MILLISECONDS_IN_MINUTE;
5197
- var defaultUnit = void 0;
5206
+ var defaultUnit = options === null || options === void 0 ? void 0 : options.unit;
5198
5207
  var unit;
5199
- {
5208
+ if (!defaultUnit) {
5200
5209
  if (minutes < 1) {
5201
5210
  unit = "second";
5202
5211
  } else if (minutes < 60) {
@@ -5210,6 +5219,8 @@ function formatDistanceStrict(dirtyDate, dirtyBaseDate, options) {
5210
5219
  } else {
5211
5220
  unit = "year";
5212
5221
  }
5222
+ } else {
5223
+ unit = String(defaultUnit);
5213
5224
  }
5214
5225
  if (unit === "second") {
5215
5226
  var seconds = roundingMethodFn(milliseconds / 1e3);
@@ -5433,7 +5444,7 @@ async function executeCommand(cmd) {
5433
5444
  throw new Error("Command execution is only supported in Node.js environments");
5434
5445
  }
5435
5446
  const { exec: exec2 } = await Promise.resolve().then(() => child_process);
5436
- const { promisify: promisify2 } = await import("./util-DVisVv7-.mjs").then((n2) => n2.u);
5447
+ const { promisify: promisify2 } = await import("./util-PivrZJhX.mjs").then((n2) => n2.u);
5437
5448
  const execAsync = promisify2(exec2);
5438
5449
  const command = cmd.commandLine.join(" ");
5439
5450
  const { stdout } = await execAsync(command, {
@@ -6092,25 +6103,15 @@ if (!g$1.fetch) {
6092
6103
  var fetchNpmBrowserify = self.fetch.bind(self);
6093
6104
  const isomorphicFetch = /* @__PURE__ */ getDefaultExportFromCjs(fetchNpmBrowserify);
6094
6105
  let _globalAgent;
6095
- let _eventEmitter;
6096
6106
  const globalAgentRef = {
6097
6107
  get agent() {
6098
6108
  return _globalAgent;
6099
6109
  },
6100
- get netEvents() {
6101
- return _eventEmitter;
6102
- },
6103
6110
  set agent(v2) {
6104
6111
  _globalAgent = v2;
6105
- },
6106
- set netEvents(v2) {
6107
- _eventEmitter = v2;
6108
- },
6109
- get isSet() {
6110
- return _globalAgent !== void 0;
6111
6112
  }
6112
6113
  };
6113
- var define_process_default$8 = { env: {} };
6114
+ var define_process_default$8 = {};
6114
6115
  let clientName = "";
6115
6116
  let clientVersion = "";
6116
6117
  let clientCompletionsStreamQueryParameterName;
@@ -6175,7 +6176,6 @@ function isSymbol$4(value) {
6175
6176
  }
6176
6177
  var isSymbol_1 = isSymbol$4;
6177
6178
  var Symbol$3 = _Symbol, arrayMap$1 = _arrayMap, isArray$4 = isArray_1, isSymbol$3 = isSymbol_1;
6178
- var INFINITY$1 = 1 / 0;
6179
6179
  var symbolProto$1 = Symbol$3 ? Symbol$3.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
6180
6180
  function baseToString$2(value) {
6181
6181
  if (typeof value == "string") {
@@ -6188,7 +6188,7 @@ function baseToString$2(value) {
6188
6188
  return symbolToString ? symbolToString.call(value) : "";
6189
6189
  }
6190
6190
  var result = value + "";
6191
- return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
6191
+ return result == "0" && 1 / value == -Infinity ? "-0" : result;
6192
6192
  }
6193
6193
  var _baseToString = baseToString$2;
6194
6194
  var baseToString$1 = _baseToString;
@@ -6490,7 +6490,7 @@ var baseIsSet = _baseIsSet, baseUnary = _baseUnary, nodeUtil = _nodeUtilExports;
6490
6490
  var nodeIsSet = nodeUtil && nodeUtil.isSet;
6491
6491
  var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
6492
6492
  var isSet_1 = isSet$1;
6493
- var Stack = _Stack, arrayEach = _arrayEach, assignValue = _assignValue, baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBufferExports, copyArray = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys = _getAllKeys, getAllKeysIn$1 = _getAllKeysIn, getTag = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray$3 = isArray_1, isBuffer = isBufferExports, isMap$1 = isMap_1, isObject$2 = isObject_1, isSet = isSet_1, keys = keys_1, keysIn = keysIn_1;
6493
+ var Stack$1 = _Stack, arrayEach = _arrayEach, assignValue = _assignValue, baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBufferExports, copyArray = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys = _getAllKeys, getAllKeysIn$1 = _getAllKeysIn, getTag = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray$3 = isArray_1, isBuffer = isBufferExports, isMap$1 = isMap_1, isObject$2 = isObject_1, isSet = isSet_1, keys = keys_1, keysIn = keysIn_1;
6494
6494
  var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$1 = 4;
6495
6495
  var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag$1 = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag$1 = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
6496
6496
  var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
@@ -6531,7 +6531,7 @@ function baseClone$1(value, bitmask, customizer, key, object2, stack) {
6531
6531
  result = initCloneByTag(value, tag, isDeep);
6532
6532
  }
6533
6533
  }
6534
- stack || (stack = new Stack());
6534
+ stack || (stack = new Stack$1());
6535
6535
  var stacked = stack.get(value);
6536
6536
  if (stacked) {
6537
6537
  return stacked;
@@ -6632,13 +6632,12 @@ function last$1(array2) {
6632
6632
  }
6633
6633
  var last_1 = last$1;
6634
6634
  var isSymbol$1 = isSymbol_1;
6635
- var INFINITY = 1 / 0;
6636
6635
  function toKey$2(value) {
6637
6636
  if (typeof value == "string" || isSymbol$1(value)) {
6638
6637
  return value;
6639
6638
  }
6640
6639
  var result = value + "";
6641
- return result == "0" && 1 / value == -INFINITY ? "-0" : result;
6640
+ return result == "0" && 1 / value == -Infinity ? "-0" : result;
6642
6641
  }
6643
6642
  var _toKey = toKey$2;
6644
6643
  var castPath$2 = _castPath, toKey$1 = _toKey;
@@ -6866,8 +6865,7 @@ var constants$1 = {
6866
6865
  FLAG_INCLUDE_PRERELEASE: 1,
6867
6866
  FLAG_LOOSE: 2
6868
6867
  };
6869
- var define_process_default$7 = { env: {} };
6870
- const debug$1 = typeof define_process_default$7 === "object" && define_process_default$7.env && false ? (...args) => console.error("SEMVER", ...args) : () => {
6868
+ const debug$1 = () => {
6871
6869
  };
6872
6870
  var debug_1 = debug$1;
6873
6871
  (function(module, exports) {
@@ -6876,7 +6874,6 @@ var debug_1 = debug$1;
6876
6874
  MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH2,
6877
6875
  MAX_LENGTH: MAX_LENGTH2
6878
6876
  } = constants$1;
6879
- const debug2 = debug_1;
6880
6877
  exports = module.exports = {};
6881
6878
  const re2 = exports.re = [];
6882
6879
  const safeRe = exports.safeRe = [];
@@ -6898,7 +6895,6 @@ var debug_1 = debug$1;
6898
6895
  const createToken = (name2, value, isGlobal) => {
6899
6896
  const safe = makeSafeRegex(value);
6900
6897
  const index = R3++;
6901
- debug2(name2, index, value);
6902
6898
  t3[name2] = index;
6903
6899
  src[index] = value;
6904
6900
  re2[index] = new RegExp(value, isGlobal ? "g" : void 0);
@@ -6998,7 +6994,6 @@ let SemVer$d = class SemVer {
6998
6994
  `version is longer than ${MAX_LENGTH$1} characters`
6999
6995
  );
7000
6996
  }
7001
- debug("SemVer", version2, options);
7002
6997
  this.options = options;
7003
6998
  this.loose = !!options.loose;
7004
6999
  this.includePrerelease = !!options.includePrerelease;
@@ -7046,7 +7041,7 @@ let SemVer$d = class SemVer {
7046
7041
  return this.version;
7047
7042
  }
7048
7043
  compare(other) {
7049
- debug("SemVer.compare", this.version, this.options, other);
7044
+ debug("SemVer.compare", this.version, this.options);
7050
7045
  if (!(other instanceof SemVer)) {
7051
7046
  if (typeof other === "string" && other === this.version) {
7052
7047
  return 0;
@@ -7079,7 +7074,6 @@ let SemVer$d = class SemVer {
7079
7074
  do {
7080
7075
  const a4 = this.prerelease[i3];
7081
7076
  const b3 = other.prerelease[i3];
7082
- debug("prerelease compare", i3, a4, b3);
7083
7077
  if (a4 === void 0 && b3 === void 0) {
7084
7078
  return 0;
7085
7079
  } else if (b3 === void 0) {
@@ -7101,7 +7095,6 @@ let SemVer$d = class SemVer {
7101
7095
  do {
7102
7096
  const a4 = this.build[i3];
7103
7097
  const b3 = other.build[i3];
7104
- debug("prerelease compare", i3, a4, b3);
7105
7098
  if (a4 === void 0 && b3 === void 0) {
7106
7099
  return 0;
7107
7100
  } else if (b3 === void 0) {
@@ -7813,7 +7806,7 @@ const LRU_LIST = Symbol("lruList");
7813
7806
  const CACHE = Symbol("cache");
7814
7807
  const UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
7815
7808
  const naiveLength = () => 1;
7816
- let LRUCache$1 = class LRUCache {
7809
+ let LRUCache$2 = class LRUCache {
7817
7810
  constructor(options) {
7818
7811
  if (typeof options === "number")
7819
7812
  options = { max: options };
@@ -8062,7 +8055,7 @@ const forEachStep = (self2, fn, node, thisp) => {
8062
8055
  if (hit)
8063
8056
  fn.call(thisp, hit.value, hit.key, self2);
8064
8057
  };
8065
- var lruCache = LRUCache$1;
8058
+ var lruCache = LRUCache$2;
8066
8059
  var range$1;
8067
8060
  var hasRequiredRange;
8068
8061
  function requireRange() {
@@ -8125,13 +8118,9 @@ function requireRange() {
8125
8118
  const loose = this.options.loose;
8126
8119
  const hr2 = loose ? re2[t3.HYPHENRANGELOOSE] : re2[t3.HYPHENRANGE];
8127
8120
  range2 = range2.replace(hr2, hyphenReplace(this.options.includePrerelease));
8128
- debug2("hyphen replace", range2);
8129
8121
  range2 = range2.replace(re2[t3.COMPARATORTRIM], comparatorTrimReplace);
8130
- debug2("comparator trim", range2);
8131
8122
  range2 = range2.replace(re2[t3.TILDETRIM], tildeTrimReplace);
8132
- debug2("tilde trim", range2);
8133
8123
  range2 = range2.replace(re2[t3.CARETTRIM], caretTrimReplace);
8134
- debug2("caret trim", range2);
8135
8124
  let rangeList = range2.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
8136
8125
  if (loose) {
8137
8126
  rangeList = rangeList.filter((comp) => {
@@ -8139,7 +8128,6 @@ function requireRange() {
8139
8128
  return !!comp.match(re2[t3.COMPARATORLOOSE]);
8140
8129
  });
8141
8130
  }
8142
- debug2("range list", rangeList);
8143
8131
  const rangeMap = /* @__PURE__ */ new Map();
8144
8132
  const comparators = rangeList.map((comp) => new Comparator2(comp, this.options));
8145
8133
  for (const comp of comparators) {
@@ -8219,15 +8207,10 @@ function requireRange() {
8219
8207
  return result;
8220
8208
  };
8221
8209
  const parseComparator = (comp, options) => {
8222
- debug2("comp", comp, options);
8223
8210
  comp = replaceCarets(comp, options);
8224
- debug2("caret", comp);
8225
8211
  comp = replaceTildes(comp, options);
8226
- debug2("tildes", comp);
8227
8212
  comp = replaceXRanges(comp, options);
8228
- debug2("xrange", comp);
8229
- comp = replaceStars(comp, options);
8230
- debug2("stars", comp);
8213
+ comp = replaceStars(comp);
8231
8214
  return comp;
8232
8215
  };
8233
8216
  const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
@@ -8237,7 +8220,6 @@ function requireRange() {
8237
8220
  const replaceTilde = (comp, options) => {
8238
8221
  const r2 = options.loose ? re2[t3.TILDELOOSE] : re2[t3.TILDE];
8239
8222
  return comp.replace(r2, (_2, M4, m4, p2, pr2) => {
8240
- debug2("tilde", comp, _2, M4, m4, p2, pr2);
8241
8223
  let ret;
8242
8224
  if (isX(M4)) {
8243
8225
  ret = "";
@@ -8246,12 +8228,10 @@ function requireRange() {
8246
8228
  } else if (isX(p2)) {
8247
8229
  ret = `>=${M4}.${m4}.0 <${M4}.${+m4 + 1}.0-0`;
8248
8230
  } else if (pr2) {
8249
- debug2("replaceTilde pr", pr2);
8250
8231
  ret = `>=${M4}.${m4}.${p2}-${pr2} <${M4}.${+m4 + 1}.0-0`;
8251
8232
  } else {
8252
8233
  ret = `>=${M4}.${m4}.${p2} <${M4}.${+m4 + 1}.0-0`;
8253
8234
  }
8254
- debug2("tilde return", ret);
8255
8235
  return ret;
8256
8236
  });
8257
8237
  };
@@ -8259,11 +8239,9 @@ function requireRange() {
8259
8239
  return comp.trim().split(/\s+/).map((c3) => replaceCaret(c3, options)).join(" ");
8260
8240
  };
8261
8241
  const replaceCaret = (comp, options) => {
8262
- debug2("caret", comp, options);
8263
8242
  const r2 = options.loose ? re2[t3.CARETLOOSE] : re2[t3.CARET];
8264
8243
  const z3 = options.includePrerelease ? "-0" : "";
8265
8244
  return comp.replace(r2, (_2, M4, m4, p2, pr2) => {
8266
- debug2("caret", comp, _2, M4, m4, p2, pr2);
8267
8245
  let ret;
8268
8246
  if (isX(M4)) {
8269
8247
  ret = "";
@@ -8276,7 +8254,6 @@ function requireRange() {
8276
8254
  ret = `>=${M4}.${m4}.0${z3} <${+M4 + 1}.0.0-0`;
8277
8255
  }
8278
8256
  } else if (pr2) {
8279
- debug2("replaceCaret pr", pr2);
8280
8257
  if (M4 === "0") {
8281
8258
  if (m4 === "0") {
8282
8259
  ret = `>=${M4}.${m4}.${p2}-${pr2} <${M4}.${m4}.${+p2 + 1}-0`;
@@ -8287,7 +8264,6 @@ function requireRange() {
8287
8264
  ret = `>=${M4}.${m4}.${p2}-${pr2} <${+M4 + 1}.0.0-0`;
8288
8265
  }
8289
8266
  } else {
8290
- debug2("no pr");
8291
8267
  if (M4 === "0") {
8292
8268
  if (m4 === "0") {
8293
8269
  ret = `>=${M4}.${m4}.${p2}${z3} <${M4}.${m4}.${+p2 + 1}-0`;
@@ -8298,19 +8274,16 @@ function requireRange() {
8298
8274
  ret = `>=${M4}.${m4}.${p2} <${+M4 + 1}.0.0-0`;
8299
8275
  }
8300
8276
  }
8301
- debug2("caret return", ret);
8302
8277
  return ret;
8303
8278
  });
8304
8279
  };
8305
8280
  const replaceXRanges = (comp, options) => {
8306
- debug2("replaceXRanges", comp, options);
8307
8281
  return comp.split(/\s+/).map((c3) => replaceXRange(c3, options)).join(" ");
8308
8282
  };
8309
8283
  const replaceXRange = (comp, options) => {
8310
8284
  comp = comp.trim();
8311
8285
  const r2 = options.loose ? re2[t3.XRANGELOOSE] : re2[t3.XRANGE];
8312
8286
  return comp.replace(r2, (ret, gtlt, M4, m4, p2, pr2) => {
8313
- debug2("xRange", comp, ret, gtlt, M4, m4, p2, pr2);
8314
8287
  const xM = isX(M4);
8315
8288
  const xm = xM || isX(m4);
8316
8289
  const xp = xm || isX(p2);
@@ -8357,16 +8330,13 @@ function requireRange() {
8357
8330
  } else if (xp) {
8358
8331
  ret = `>=${M4}.${m4}.0${pr2} <${M4}.${+m4 + 1}.0-0`;
8359
8332
  }
8360
- debug2("xRange return", ret);
8361
8333
  return ret;
8362
8334
  });
8363
8335
  };
8364
8336
  const replaceStars = (comp, options) => {
8365
- debug2("replaceStars", comp, options);
8366
8337
  return comp.trim().replace(re2[t3.STAR], "");
8367
8338
  };
8368
8339
  const replaceGTE0 = (comp, options) => {
8369
- debug2("replaceGTE0", comp, options);
8370
8340
  return comp.trim().replace(re2[options.includePrerelease ? t3.GTE0PRE : t3.GTE0], "");
8371
8341
  };
8372
8342
  const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
@@ -8441,7 +8411,6 @@ function requireComparator() {
8441
8411
  }
8442
8412
  }
8443
8413
  comp = comp.trim().split(/\s+/).join(" ");
8444
- debug2("comparator", comp, options);
8445
8414
  this.options = options;
8446
8415
  this.loose = !!options.loose;
8447
8416
  this.parse(comp);
@@ -8450,7 +8419,6 @@ function requireComparator() {
8450
8419
  } else {
8451
8420
  this.value = this.operator + this.semver.version;
8452
8421
  }
8453
- debug2("comp", this);
8454
8422
  }
8455
8423
  parse(comp) {
8456
8424
  const r2 = this.options.loose ? re2[t3.COMPARATORLOOSE] : re2[t3.COMPARATOR];
@@ -9175,36 +9143,36 @@ var DiagComponentLogger = (
9175
9143
  }
9176
9144
  DiagComponentLogger2.prototype.debug = function() {
9177
9145
  var args = [];
9178
- for (var _i2 = 0; _i2 < arguments.length; _i2++) {
9179
- args[_i2] = arguments[_i2];
9146
+ for (var _i3 = 0; _i3 < arguments.length; _i3++) {
9147
+ args[_i3] = arguments[_i3];
9180
9148
  }
9181
9149
  return logProxy("debug", this._namespace, args);
9182
9150
  };
9183
9151
  DiagComponentLogger2.prototype.error = function() {
9184
9152
  var args = [];
9185
- for (var _i2 = 0; _i2 < arguments.length; _i2++) {
9186
- args[_i2] = arguments[_i2];
9153
+ for (var _i3 = 0; _i3 < arguments.length; _i3++) {
9154
+ args[_i3] = arguments[_i3];
9187
9155
  }
9188
9156
  return logProxy("error", this._namespace, args);
9189
9157
  };
9190
9158
  DiagComponentLogger2.prototype.info = function() {
9191
9159
  var args = [];
9192
- for (var _i2 = 0; _i2 < arguments.length; _i2++) {
9193
- args[_i2] = arguments[_i2];
9160
+ for (var _i3 = 0; _i3 < arguments.length; _i3++) {
9161
+ args[_i3] = arguments[_i3];
9194
9162
  }
9195
9163
  return logProxy("info", this._namespace, args);
9196
9164
  };
9197
9165
  DiagComponentLogger2.prototype.warn = function() {
9198
9166
  var args = [];
9199
- for (var _i2 = 0; _i2 < arguments.length; _i2++) {
9200
- args[_i2] = arguments[_i2];
9167
+ for (var _i3 = 0; _i3 < arguments.length; _i3++) {
9168
+ args[_i3] = arguments[_i3];
9201
9169
  }
9202
9170
  return logProxy("warn", this._namespace, args);
9203
9171
  };
9204
9172
  DiagComponentLogger2.prototype.verbose = function() {
9205
9173
  var args = [];
9206
- for (var _i2 = 0; _i2 < arguments.length; _i2++) {
9207
- args[_i2] = arguments[_i2];
9174
+ for (var _i3 = 0; _i3 < arguments.length; _i3++) {
9175
+ args[_i3] = arguments[_i3];
9208
9176
  }
9209
9177
  return logProxy("verbose", this._namespace, args);
9210
9178
  };
@@ -9278,7 +9246,7 @@ var __spreadArray$2 = function(to, from, pack) {
9278
9246
  }
9279
9247
  return to.concat(ar2 || Array.prototype.slice.call(from));
9280
9248
  };
9281
- var API_NAME$4 = "diag";
9249
+ var API_NAME$3 = "diag";
9282
9250
  var DiagAPI = (
9283
9251
  /** @class */
9284
9252
  function() {
@@ -9286,8 +9254,8 @@ var DiagAPI = (
9286
9254
  function _logProxy(funcName) {
9287
9255
  return function() {
9288
9256
  var args = [];
9289
- for (var _i2 = 0; _i2 < arguments.length; _i2++) {
9290
- args[_i2] = arguments[_i2];
9257
+ for (var _i3 = 0; _i3 < arguments.length; _i3++) {
9258
+ args[_i3] = arguments[_i3];
9291
9259
  }
9292
9260
  var logger = getGlobal("diag");
9293
9261
  if (!logger)
@@ -9322,7 +9290,7 @@ var DiagAPI = (
9322
9290
  };
9323
9291
  self2.setLogger = setLogger2;
9324
9292
  self2.disable = function() {
9325
- unregisterGlobal(API_NAME$4, self2);
9293
+ unregisterGlobal(API_NAME$3, self2);
9326
9294
  };
9327
9295
  self2.createComponentLogger = function(options) {
9328
9296
  return new DiagComponentLogger(options);
@@ -9402,8 +9370,8 @@ var BaggageImpl = (
9402
9370
  BaggageImpl2.prototype.removeEntries = function() {
9403
9371
  var e_1, _a3;
9404
9372
  var keys2 = [];
9405
- for (var _i2 = 0; _i2 < arguments.length; _i2++) {
9406
- keys2[_i2] = arguments[_i2];
9373
+ for (var _i3 = 0; _i3 < arguments.length; _i3++) {
9374
+ keys2[_i3] = arguments[_i3];
9407
9375
  }
9408
9376
  var newBaggage = new BaggageImpl2(this._entries);
9409
9377
  try {
@@ -9428,15 +9396,28 @@ var BaggageImpl = (
9428
9396
  return BaggageImpl2;
9429
9397
  }()
9430
9398
  );
9431
- DiagAPI.instance();
9399
+ var baggageEntryMetadataSymbol = Symbol("BaggageEntryMetadata");
9400
+ var diag = DiagAPI.instance();
9432
9401
  function createBaggage(entries) {
9433
9402
  if (entries === void 0) {
9434
9403
  entries = {};
9435
9404
  }
9436
9405
  return new BaggageImpl(new Map(Object.entries(entries)));
9437
9406
  }
9438
- function createContextKey(description2) {
9439
- return Symbol.for(description2);
9407
+ function baggageEntryMetadataFromString(str2) {
9408
+ if (typeof str2 !== "string") {
9409
+ diag.error("Cannot create baggage metadata from unknown type: " + typeof str2);
9410
+ str2 = "";
9411
+ }
9412
+ return {
9413
+ __TYPE__: baggageEntryMetadataSymbol,
9414
+ toString: function() {
9415
+ return str2;
9416
+ }
9417
+ };
9418
+ }
9419
+ function createContextKey(description) {
9420
+ return Symbol.for(description);
9440
9421
  }
9441
9422
  var BaseContext = (
9442
9423
  /** @class */
@@ -9462,148 +9443,6 @@ var BaseContext = (
9462
9443
  }()
9463
9444
  );
9464
9445
  var ROOT_CONTEXT = new BaseContext();
9465
- var __extends = /* @__PURE__ */ function() {
9466
- var extendStatics = function(d4, b3) {
9467
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d5, b4) {
9468
- d5.__proto__ = b4;
9469
- } || function(d5, b4) {
9470
- for (var p2 in b4) if (Object.prototype.hasOwnProperty.call(b4, p2)) d5[p2] = b4[p2];
9471
- };
9472
- return extendStatics(d4, b3);
9473
- };
9474
- return function(d4, b3) {
9475
- if (typeof b3 !== "function" && b3 !== null)
9476
- throw new TypeError("Class extends value " + String(b3) + " is not a constructor or null");
9477
- extendStatics(d4, b3);
9478
- function __() {
9479
- this.constructor = d4;
9480
- }
9481
- d4.prototype = b3 === null ? Object.create(b3) : (__.prototype = b3.prototype, new __());
9482
- };
9483
- }();
9484
- var NoopMeter = (
9485
- /** @class */
9486
- function() {
9487
- function NoopMeter2() {
9488
- }
9489
- NoopMeter2.prototype.createHistogram = function(_name, _options2) {
9490
- return NOOP_HISTOGRAM_METRIC;
9491
- };
9492
- NoopMeter2.prototype.createCounter = function(_name, _options2) {
9493
- return NOOP_COUNTER_METRIC;
9494
- };
9495
- NoopMeter2.prototype.createUpDownCounter = function(_name, _options2) {
9496
- return NOOP_UP_DOWN_COUNTER_METRIC;
9497
- };
9498
- NoopMeter2.prototype.createObservableGauge = function(_name, _options2) {
9499
- return NOOP_OBSERVABLE_GAUGE_METRIC;
9500
- };
9501
- NoopMeter2.prototype.createObservableCounter = function(_name, _options2) {
9502
- return NOOP_OBSERVABLE_COUNTER_METRIC;
9503
- };
9504
- NoopMeter2.prototype.createObservableUpDownCounter = function(_name, _options2) {
9505
- return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
9506
- };
9507
- NoopMeter2.prototype.addBatchObservableCallback = function(_callback, _observables) {
9508
- };
9509
- NoopMeter2.prototype.removeBatchObservableCallback = function(_callback) {
9510
- };
9511
- return NoopMeter2;
9512
- }()
9513
- );
9514
- var NoopMetric = (
9515
- /** @class */
9516
- /* @__PURE__ */ function() {
9517
- function NoopMetric2() {
9518
- }
9519
- return NoopMetric2;
9520
- }()
9521
- );
9522
- var NoopCounterMetric = (
9523
- /** @class */
9524
- function(_super) {
9525
- __extends(NoopCounterMetric2, _super);
9526
- function NoopCounterMetric2() {
9527
- return _super !== null && _super.apply(this, arguments) || this;
9528
- }
9529
- NoopCounterMetric2.prototype.add = function(_value2, _attributes) {
9530
- };
9531
- return NoopCounterMetric2;
9532
- }(NoopMetric)
9533
- );
9534
- var NoopUpDownCounterMetric = (
9535
- /** @class */
9536
- function(_super) {
9537
- __extends(NoopUpDownCounterMetric2, _super);
9538
- function NoopUpDownCounterMetric2() {
9539
- return _super !== null && _super.apply(this, arguments) || this;
9540
- }
9541
- NoopUpDownCounterMetric2.prototype.add = function(_value2, _attributes) {
9542
- };
9543
- return NoopUpDownCounterMetric2;
9544
- }(NoopMetric)
9545
- );
9546
- var NoopHistogramMetric = (
9547
- /** @class */
9548
- function(_super) {
9549
- __extends(NoopHistogramMetric2, _super);
9550
- function NoopHistogramMetric2() {
9551
- return _super !== null && _super.apply(this, arguments) || this;
9552
- }
9553
- NoopHistogramMetric2.prototype.record = function(_value2, _attributes) {
9554
- };
9555
- return NoopHistogramMetric2;
9556
- }(NoopMetric)
9557
- );
9558
- var NoopObservableMetric = (
9559
- /** @class */
9560
- function() {
9561
- function NoopObservableMetric2() {
9562
- }
9563
- NoopObservableMetric2.prototype.addCallback = function(_callback) {
9564
- };
9565
- NoopObservableMetric2.prototype.removeCallback = function(_callback) {
9566
- };
9567
- return NoopObservableMetric2;
9568
- }()
9569
- );
9570
- var NoopObservableCounterMetric = (
9571
- /** @class */
9572
- function(_super) {
9573
- __extends(NoopObservableCounterMetric2, _super);
9574
- function NoopObservableCounterMetric2() {
9575
- return _super !== null && _super.apply(this, arguments) || this;
9576
- }
9577
- return NoopObservableCounterMetric2;
9578
- }(NoopObservableMetric)
9579
- );
9580
- var NoopObservableGaugeMetric = (
9581
- /** @class */
9582
- function(_super) {
9583
- __extends(NoopObservableGaugeMetric2, _super);
9584
- function NoopObservableGaugeMetric2() {
9585
- return _super !== null && _super.apply(this, arguments) || this;
9586
- }
9587
- return NoopObservableGaugeMetric2;
9588
- }(NoopObservableMetric)
9589
- );
9590
- var NoopObservableUpDownCounterMetric = (
9591
- /** @class */
9592
- function(_super) {
9593
- __extends(NoopObservableUpDownCounterMetric2, _super);
9594
- function NoopObservableUpDownCounterMetric2() {
9595
- return _super !== null && _super.apply(this, arguments) || this;
9596
- }
9597
- return NoopObservableUpDownCounterMetric2;
9598
- }(NoopObservableMetric)
9599
- );
9600
- var NOOP_METER = new NoopMeter();
9601
- var NOOP_COUNTER_METRIC = new NoopCounterMetric();
9602
- var NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();
9603
- var NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();
9604
- var NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();
9605
- var NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();
9606
- var NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();
9607
9446
  var defaultTextMapGetter = {
9608
9447
  get: function(carrier, key) {
9609
9448
  if (carrier == null) {
@@ -9662,8 +9501,8 @@ var NoopContextManager = (
9662
9501
  };
9663
9502
  NoopContextManager2.prototype.with = function(_context, fn, thisArg) {
9664
9503
  var args = [];
9665
- for (var _i2 = 3; _i2 < arguments.length; _i2++) {
9666
- args[_i2 - 3] = arguments[_i2];
9504
+ for (var _i3 = 3; _i3 < arguments.length; _i3++) {
9505
+ args[_i3 - 3] = arguments[_i3];
9667
9506
  }
9668
9507
  return fn.call.apply(fn, __spreadArray$1([thisArg], __read$1(args), false));
9669
9508
  };
@@ -9705,7 +9544,7 @@ var __spreadArray = function(to, from, pack) {
9705
9544
  }
9706
9545
  return to.concat(ar2 || Array.prototype.slice.call(from));
9707
9546
  };
9708
- var API_NAME$3 = "context";
9547
+ var API_NAME$2 = "context";
9709
9548
  var NOOP_CONTEXT_MANAGER = new NoopContextManager();
9710
9549
  var ContextAPI = (
9711
9550
  /** @class */
@@ -9719,7 +9558,7 @@ var ContextAPI = (
9719
9558
  return this._instance;
9720
9559
  };
9721
9560
  ContextAPI2.prototype.setGlobalContextManager = function(contextManager) {
9722
- return registerGlobal(API_NAME$3, contextManager, DiagAPI.instance());
9561
+ return registerGlobal(API_NAME$2, contextManager, DiagAPI.instance());
9723
9562
  };
9724
9563
  ContextAPI2.prototype.active = function() {
9725
9564
  return this._getContextManager().active();
@@ -9727,8 +9566,8 @@ var ContextAPI = (
9727
9566
  ContextAPI2.prototype.with = function(context2, fn, thisArg) {
9728
9567
  var _a3;
9729
9568
  var args = [];
9730
- for (var _i2 = 3; _i2 < arguments.length; _i2++) {
9731
- args[_i2 - 3] = arguments[_i2];
9569
+ for (var _i3 = 3; _i3 < arguments.length; _i3++) {
9570
+ args[_i3 - 3] = arguments[_i3];
9732
9571
  }
9733
9572
  return (_a3 = this._getContextManager()).with.apply(_a3, __spreadArray([context2, fn, thisArg], __read(args), false));
9734
9573
  };
@@ -9736,11 +9575,11 @@ var ContextAPI = (
9736
9575
  return this._getContextManager().bind(context2, target);
9737
9576
  };
9738
9577
  ContextAPI2.prototype._getContextManager = function() {
9739
- return getGlobal(API_NAME$3) || NOOP_CONTEXT_MANAGER;
9578
+ return getGlobal(API_NAME$2) || NOOP_CONTEXT_MANAGER;
9740
9579
  };
9741
9580
  ContextAPI2.prototype.disable = function() {
9742
9581
  this._getContextManager().disable();
9743
- unregisterGlobal(API_NAME$3, DiagAPI.instance());
9582
+ unregisterGlobal(API_NAME$2, DiagAPI.instance());
9744
9583
  };
9745
9584
  return ContextAPI2;
9746
9585
  }()
@@ -9949,47 +9788,6 @@ var SpanStatusCode;
9949
9788
  SpanStatusCode2[SpanStatusCode2["ERROR"] = 2] = "ERROR";
9950
9789
  })(SpanStatusCode || (SpanStatusCode = {}));
9951
9790
  var context$1 = ContextAPI.getInstance();
9952
- var diag = DiagAPI.instance();
9953
- var NoopMeterProvider = (
9954
- /** @class */
9955
- function() {
9956
- function NoopMeterProvider2() {
9957
- }
9958
- NoopMeterProvider2.prototype.getMeter = function(_name, _version, _options2) {
9959
- return NOOP_METER;
9960
- };
9961
- return NoopMeterProvider2;
9962
- }()
9963
- );
9964
- var NOOP_METER_PROVIDER = new NoopMeterProvider();
9965
- var API_NAME$2 = "metrics";
9966
- var MetricsAPI = (
9967
- /** @class */
9968
- function() {
9969
- function MetricsAPI2() {
9970
- }
9971
- MetricsAPI2.getInstance = function() {
9972
- if (!this._instance) {
9973
- this._instance = new MetricsAPI2();
9974
- }
9975
- return this._instance;
9976
- };
9977
- MetricsAPI2.prototype.setGlobalMeterProvider = function(provider) {
9978
- return registerGlobal(API_NAME$2, provider, DiagAPI.instance());
9979
- };
9980
- MetricsAPI2.prototype.getMeterProvider = function() {
9981
- return getGlobal(API_NAME$2) || NOOP_METER_PROVIDER;
9982
- };
9983
- MetricsAPI2.prototype.getMeter = function(name2, version2, options) {
9984
- return this.getMeterProvider().getMeter(name2, version2, options);
9985
- };
9986
- MetricsAPI2.prototype.disable = function() {
9987
- unregisterGlobal(API_NAME$2, DiagAPI.instance());
9988
- };
9989
- return MetricsAPI2;
9990
- }()
9991
- );
9992
- var metrics = MetricsAPI.getInstance();
9993
9791
  var NoopTextMapPropagator = (
9994
9792
  /** @class */
9995
9793
  function() {
@@ -10108,10 +9906,6 @@ var TraceAPI = (
10108
9906
  );
10109
9907
  var trace = TraceAPI.getInstance();
10110
9908
  const opentelemetry = {
10111
- context: context$1,
10112
- diag,
10113
- metrics,
10114
- propagation,
10115
9909
  trace
10116
9910
  };
10117
9911
  const INSTRUMENTATION_SCOPE_NAME = "cody";
@@ -11291,11 +11085,11 @@ class SourcegraphGraphQLAPIClient {
11291
11085
  })
11292
11086
  );
11293
11087
  }
11294
- async getFileContent(repository2, filePath, range2, signal) {
11088
+ async getFileContent(repository, filePath, range2, signal) {
11295
11089
  return this.fetchSourcegraphAPI(
11296
11090
  GET_REMOTE_FILE_QUERY,
11297
11091
  {
11298
- repositoryName: repository2,
11092
+ repositoryName: repository,
11299
11093
  filePath,
11300
11094
  startLine: range2 == null ? void 0 : range2.startLine,
11301
11095
  endLine: range2 == null ? void 0 : range2.endLine
@@ -11941,9 +11735,7 @@ class SourcegraphGraphQLAPIClient {
11941
11735
  signal == null ? void 0 : signal.throwIfAborted();
11942
11736
  const headers = new Headers((_a3 = config.configuration) == null ? void 0 : _a3.customHeaders);
11943
11737
  headers.set("Content-Type", "application/json; charset=utf-8");
11944
- if (config.clientState.anonymousUserID && false) {
11945
- headers.set("X-Sourcegraph-Actor-Anonymous-UID", config.clientState.anonymousUserID);
11946
- }
11738
+ if (config.clientState.anonymousUserID && false) ;
11947
11739
  const url = new URL(
11948
11740
  buildGraphQLUrl({
11949
11741
  request: query,
@@ -11981,9 +11773,7 @@ class SourcegraphGraphQLAPIClient {
11981
11773
  return resolvedConfig2;
11982
11774
  })();
11983
11775
  const headers = new Headers((_a3 = config.configuration) == null ? void 0 : _a3.customHeaders);
11984
- if (config.clientState.anonymousUserID && false) {
11985
- headers.set("X-Sourcegraph-Actor-Anonymous-UID", config.clientState.anonymousUserID);
11986
- }
11776
+ if (config.clientState.anonymousUserID && false) ;
11987
11777
  const url = new URL(urlPath, config.auth.serverEndpoint);
11988
11778
  addTraceparent(headers);
11989
11779
  addCodyClientIdentificationHeaders(headers);
@@ -12067,7 +11857,7 @@ function isCustomAuthChallengeResponse(response) {
12067
11857
  function hasOutdatedAPIErrorMessages(error2) {
12068
11858
  return error2.message.includes("Cannot query field") || error2.message.includes("Unexpected end of JSON input");
12069
11859
  }
12070
- var define_process_default$6 = { env: {} };
11860
+ var define_process_default$7 = { env: {} };
12071
11861
  var FeatureFlag = /* @__PURE__ */ ((FeatureFlag2) => {
12072
11862
  FeatureFlag2["TestFlagDoNotUse"] = "test-flag-do-not-use";
12073
11863
  FeatureFlag2["CodyAutocompleteTracing"] = "cody-autocomplete-tracing";
@@ -12092,6 +11882,7 @@ var FeatureFlag = /* @__PURE__ */ ((FeatureFlag2) => {
12092
11882
  FeatureFlag2["CodyAutocompleteContextExperimentControl"] = "cody-autocomplete-context-experiment-control";
12093
11883
  FeatureFlag2["CodySmartApplyExperimentEnabledFeatureFlag"] = "cody-smart-apply-experiment-enabled-flag";
12094
11884
  FeatureFlag2["CodySmartApplyExperimentVariant1"] = "cody-smart-apply-experiment-variant-1";
11885
+ FeatureFlag2["CodySmartApplyPrefetching"] = "cody-smart-apply-prefetching";
12095
11886
  FeatureFlag2["CodyAutoEditExperimentEnabledFeatureFlag"] = "cody-autoedit-experiment-enabled-flag";
12096
11887
  FeatureFlag2["CodyAutoEditImageRendering"] = "cody-autoedit-image-rendering";
12097
11888
  FeatureFlag2["CodyEditDefaultToGpt4oMini"] = "cody-edit-default-to-gpt-4o-mini";
@@ -12149,7 +11940,7 @@ class FeatureFlagProviderImpl {
12149
11940
  debounceTime(0),
12150
11941
  switchMap(
12151
11942
  ([authStatus2]) => promiseFactoryToObservable(
12152
- (signal) => define_process_default$6.env.DISABLE_FEATURE_FLAGS ? Promise.resolve({}) : graphqlClient.getEvaluatedFeatureFlags(signal)
11943
+ (signal) => define_process_default$7.env.DISABLE_FEATURE_FLAGS ? Promise.resolve({}) : graphqlClient.getEvaluatedFeatureFlags(signal)
12153
11944
  ).pipe(
12154
11945
  map$1((resultOrError) => {
12155
11946
  if (isError(resultOrError)) {
@@ -12199,7 +11990,7 @@ class FeatureFlagProviderImpl {
12199
11990
  ([authStatus2]) => concat(
12200
11991
  promiseFactoryToObservable(async (signal) => {
12201
11992
  var _a3;
12202
- if (define_process_default$6.env.DISABLE_FEATURE_FLAGS) {
11993
+ if (define_process_default$7.env.DISABLE_FEATURE_FLAGS) {
12203
11994
  return false;
12204
11995
  }
12205
11996
  const cachedValue = (_a3 = this.cache[authStatus2.endpoint]) == null ? void 0 : _a3[flagName.toString()];
@@ -12240,7 +12031,7 @@ const noopFeatureFlagProvider = {
12240
12031
  refresh: () => {
12241
12032
  }
12242
12033
  };
12243
- const featureFlagProvider = define_process_default$6.env.DISABLE_FEATURE_FLAGS ? noopFeatureFlagProvider : new FeatureFlagProviderImpl();
12034
+ const featureFlagProvider = define_process_default$7.env.DISABLE_FEATURE_FLAGS ? noopFeatureFlagProvider : new FeatureFlagProviderImpl();
12244
12035
  const userProductSubscription = authStatus.pipe(
12245
12036
  pick("authenticated", "endpoint", "pendingValidation"),
12246
12037
  distinctUntilChanged(),
@@ -12318,6 +12109,8 @@ var ModelTag = /* @__PURE__ */ ((ModelTag2) => {
12318
12109
  ModelTag2["Dev"] = "dev";
12319
12110
  ModelTag2["StreamDisabled"] = "stream-disabled";
12320
12111
  ModelTag2["Vision"] = "vision";
12112
+ ModelTag2["Reasoning"] = "reasoning";
12113
+ ModelTag2["Tools"] = "tools";
12321
12114
  return ModelTag2;
12322
12115
  })(ModelTag || {});
12323
12116
  const ANSWER_TOKENS = 1e3;
@@ -12417,9 +12210,6 @@ var CodyAutoSuggestionMode = /* @__PURE__ */ ((CodyAutoSuggestionMode2) => {
12417
12210
  return CodyAutoSuggestionMode2;
12418
12211
  })(CodyAutoSuggestionMode || {});
12419
12212
  function clientCapabilities() {
12420
- if (_mockValue) {
12421
- return _mockValue;
12422
- }
12423
12213
  if (!_value) {
12424
12214
  throw new Error(
12425
12215
  "clientCapabilities called before configuration was set with setClientCapabilitiesFromConfiguration"
@@ -12443,13 +12233,8 @@ let _extensionVersion;
12443
12233
  function setExtensionVersion(version2) {
12444
12234
  _extensionVersion = version2;
12445
12235
  }
12446
- let _mockValue;
12447
12236
  ({
12448
- agentIDE: CodyIDE.VSCode,
12449
- isVSCode: true,
12450
- isCodyWeb: false,
12451
- agentExtensionVersion: "1.2.3",
12452
- agentIDEVersion: "4.5.6"
12237
+ agentIDE: CodyIDE.VSCode
12453
12238
  });
12454
12239
  var lodash = { exports: {} };
12455
12240
  /**
@@ -12476,7 +12261,7 @@ lodash.exports;
12476
12261
  var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
12477
12262
  var HOT_COUNT2 = 800, HOT_SPAN2 = 16;
12478
12263
  var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
12479
- var INFINITY2 = 1 / 0, MAX_SAFE_INTEGER2 = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN2 = 0 / 0;
12264
+ var INFINITY = 1 / 0, MAX_SAFE_INTEGER2 = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN2 = 0 / 0;
12480
12265
  var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
12481
12266
  var wrapFlags = [
12482
12267
  ["ary", WRAP_ARY_FLAG],
@@ -14348,7 +14133,7 @@ lodash.exports;
14348
14133
  return symbolToString2 ? symbolToString2.call(value) : "";
14349
14134
  }
14350
14135
  var result2 = value + "";
14351
- return result2 == "0" && 1 / value == -INFINITY2 ? "-0" : result2;
14136
+ return result2 == "0" && 1 / value == -Infinity ? "-0" : result2;
14352
14137
  }
14353
14138
  function baseUniq(array2, iteratee2, comparator2) {
14354
14139
  var index = -1, includes2 = arrayIncludes, length = array2.length, isCommon = true, result2 = [], seen = result2;
@@ -14900,7 +14685,7 @@ lodash.exports;
14900
14685
  bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
14901
14686
  bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
14902
14687
  if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
14903
- bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
14688
+ bitmask &= -4;
14904
14689
  }
14905
14690
  var newData = [
14906
14691
  func2,
@@ -14934,7 +14719,7 @@ lodash.exports;
14934
14719
  return func2(number2);
14935
14720
  };
14936
14721
  }
14937
- var createSet = !(Set2 && 1 / setToArray2(new Set2([, -0]))[1] == INFINITY2) ? noop : function(values2) {
14722
+ var createSet = !(Set2 && 1 / setToArray2(new Set2([, -0]))[1] == INFINITY) ? noop : function(values2) {
14938
14723
  return new Set2(values2);
14939
14724
  };
14940
14725
  function createToPairs(keysFunc) {
@@ -14956,7 +14741,7 @@ lodash.exports;
14956
14741
  }
14957
14742
  var length = partials ? partials.length : 0;
14958
14743
  if (!length) {
14959
- bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
14744
+ bitmask &= -97;
14960
14745
  partials = holders = undefined$1;
14961
14746
  }
14962
14747
  ary2 = ary2 === undefined$1 ? ary2 : nativeMax2(toInteger2(ary2), 0);
@@ -14989,7 +14774,7 @@ lodash.exports;
14989
14774
  holders = newData[4];
14990
14775
  arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func2.length : nativeMax2(newData[9] - length, 0);
14991
14776
  if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
14992
- bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
14777
+ bitmask &= -25;
14993
14778
  }
14994
14779
  if (!bitmask || bitmask == WRAP_BIND_FLAG) {
14995
14780
  var result2 = createBind(func2, bitmask, thisArg);
@@ -15555,7 +15340,7 @@ lodash.exports;
15555
15340
  return value;
15556
15341
  }
15557
15342
  var result2 = value + "";
15558
- return result2 == "0" && 1 / value == -INFINITY2 ? "-0" : result2;
15343
+ return result2 == "0" && 1 / value == -Infinity ? "-0" : result2;
15559
15344
  }
15560
15345
  function toSource2(func2) {
15561
15346
  if (func2 != null) {
@@ -15706,7 +15491,7 @@ lodash.exports;
15706
15491
  }
15707
15492
  function flattenDeep(array2) {
15708
15493
  var length = array2 == null ? 0 : array2.length;
15709
- return length ? baseFlatten2(array2, INFINITY2) : [];
15494
+ return length ? baseFlatten2(array2, INFINITY) : [];
15710
15495
  }
15711
15496
  function flattenDepth(array2, depth) {
15712
15497
  var length = array2 == null ? 0 : array2.length;
@@ -16091,7 +15876,7 @@ lodash.exports;
16091
15876
  return baseFlatten2(map2(collection, iteratee2), 1);
16092
15877
  }
16093
15878
  function flatMapDeep(collection, iteratee2) {
16094
- return baseFlatten2(map2(collection, iteratee2), INFINITY2);
15879
+ return baseFlatten2(map2(collection, iteratee2), INFINITY);
16095
15880
  }
16096
15881
  function flatMapDepth(collection, iteratee2, depth) {
16097
15882
  depth = depth === undefined$1 ? 1 : toInteger2(depth);
@@ -16619,7 +16404,7 @@ lodash.exports;
16619
16404
  }
16620
16405
  var isRegExp = nodeIsRegExp ? baseUnary2(nodeIsRegExp) : baseIsRegExp;
16621
16406
  function isSafeInteger(value) {
16622
- return isInteger(value) && value >= -MAX_SAFE_INTEGER2 && value <= MAX_SAFE_INTEGER2;
16407
+ return isInteger(value) && value >= -9007199254740991 && value <= MAX_SAFE_INTEGER2;
16623
16408
  }
16624
16409
  var isSet2 = nodeIsSet2 ? baseUnary2(nodeIsSet2) : baseIsSet2;
16625
16410
  function isString(value) {
@@ -16660,7 +16445,7 @@ lodash.exports;
16660
16445
  return value === 0 ? value : 0;
16661
16446
  }
16662
16447
  value = toNumber2(value);
16663
- if (value === INFINITY2 || value === -INFINITY2) {
16448
+ if (value === INFINITY || value === -Infinity) {
16664
16449
  var sign = value < 0 ? -1 : 1;
16665
16450
  return sign * MAX_INTEGER;
16666
16451
  }
@@ -16695,7 +16480,7 @@ lodash.exports;
16695
16480
  return copyObject2(value, keysIn2(value));
16696
16481
  }
16697
16482
  function toSafeInteger(value) {
16698
- return value ? baseClamp(toInteger2(value), -MAX_SAFE_INTEGER2, MAX_SAFE_INTEGER2) : value === 0 ? value : 0;
16483
+ return value ? baseClamp(toInteger2(value), -9007199254740991, MAX_SAFE_INTEGER2) : value === 0 ? value : 0;
16699
16484
  }
16700
16485
  function toString2(value) {
16701
16486
  return value == null ? "" : baseToString2(value);
@@ -17934,7 +17719,1251 @@ lodash.exports;
17934
17719
  })(lodash, lodash.exports);
17935
17720
  var lodashExports = lodash.exports;
17936
17721
  const _$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports);
17937
- var define_process_default$5 = { env: {} };
17722
+ var define_process_default$6 = { env: {} };
17723
+ const perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
17724
+ const warned = /* @__PURE__ */ new Set();
17725
+ const PROCESS = typeof define_process_default$6 === "object" && !!define_process_default$6 ? define_process_default$6 : {};
17726
+ const emitWarning = (msg, type, code, fn) => {
17727
+ typeof PROCESS.emitWarning === "function" ? PROCESS.emitWarning(msg, type, code, fn) : console.error(`[${code}] ${type}: ${msg}`);
17728
+ };
17729
+ let AC = globalThis.AbortController;
17730
+ let AS = globalThis.AbortSignal;
17731
+ if (typeof AC === "undefined") {
17732
+ AS = class AbortSignal {
17733
+ constructor() {
17734
+ __publicField(this, "onabort");
17735
+ __publicField(this, "_onabort", []);
17736
+ __publicField(this, "reason");
17737
+ __publicField(this, "aborted", false);
17738
+ }
17739
+ addEventListener(_2, fn) {
17740
+ this._onabort.push(fn);
17741
+ }
17742
+ };
17743
+ AC = class AbortController {
17744
+ constructor() {
17745
+ __publicField(this, "signal", new AS());
17746
+ warnACPolyfill();
17747
+ }
17748
+ abort(reason) {
17749
+ var _a3, _b2;
17750
+ if (this.signal.aborted)
17751
+ return;
17752
+ this.signal.reason = reason;
17753
+ this.signal.aborted = true;
17754
+ for (const fn of this.signal._onabort) {
17755
+ fn(reason);
17756
+ }
17757
+ (_b2 = (_a3 = this.signal).onabort) == null ? void 0 : _b2.call(_a3, reason);
17758
+ }
17759
+ };
17760
+ let printACPolyfillWarning = ((_a2 = PROCESS.env) == null ? void 0 : _a2.LRU_CACHE_IGNORE_AC_WARNING) !== "1";
17761
+ const warnACPolyfill = () => {
17762
+ if (!printACPolyfillWarning)
17763
+ return;
17764
+ printACPolyfillWarning = false;
17765
+ emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);
17766
+ };
17767
+ }
17768
+ const shouldWarn = (code) => !warned.has(code);
17769
+ const isPosInt = (n2) => n2 && n2 === Math.floor(n2) && n2 > 0 && isFinite(n2);
17770
+ const getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;
17771
+ class ZeroArray extends Array {
17772
+ constructor(size) {
17773
+ super(size);
17774
+ this.fill(0);
17775
+ }
17776
+ }
17777
+ const _Stack2 = class _Stack2 {
17778
+ constructor(max, HeapCls) {
17779
+ __publicField(this, "heap");
17780
+ __publicField(this, "length");
17781
+ if (!__privateGet(_Stack2, _constructing)) {
17782
+ throw new TypeError("instantiate Stack using Stack.create(n)");
17783
+ }
17784
+ this.heap = new HeapCls(max);
17785
+ this.length = 0;
17786
+ }
17787
+ static create(max) {
17788
+ const HeapCls = getUintArray(max);
17789
+ if (!HeapCls)
17790
+ return [];
17791
+ __privateSet(_Stack2, _constructing, true);
17792
+ const s4 = new _Stack2(max, HeapCls);
17793
+ __privateSet(_Stack2, _constructing, false);
17794
+ return s4;
17795
+ }
17796
+ push(n2) {
17797
+ this.heap[this.length++] = n2;
17798
+ }
17799
+ pop() {
17800
+ return this.heap[--this.length];
17801
+ }
17802
+ };
17803
+ _constructing = new WeakMap();
17804
+ // private constructor
17805
+ __privateAdd(_Stack2, _constructing, false);
17806
+ let Stack = _Stack2;
17807
+ let LRUCache$1 = (_b = class {
17808
+ constructor(options) {
17809
+ __privateAdd(this, _LRUCache_instances);
17810
+ // properties coming in from the options of these, only max and maxSize
17811
+ // really *need* to be protected. The rest can be modified, as they just
17812
+ // set defaults for various methods.
17813
+ __privateAdd(this, _max);
17814
+ __privateAdd(this, _maxSize);
17815
+ __privateAdd(this, _dispose);
17816
+ __privateAdd(this, _disposeAfter);
17817
+ __privateAdd(this, _fetchMethod);
17818
+ /**
17819
+ * {@link LRUCache.OptionsBase.ttl}
17820
+ */
17821
+ __publicField(this, "ttl");
17822
+ /**
17823
+ * {@link LRUCache.OptionsBase.ttlResolution}
17824
+ */
17825
+ __publicField(this, "ttlResolution");
17826
+ /**
17827
+ * {@link LRUCache.OptionsBase.ttlAutopurge}
17828
+ */
17829
+ __publicField(this, "ttlAutopurge");
17830
+ /**
17831
+ * {@link LRUCache.OptionsBase.updateAgeOnGet}
17832
+ */
17833
+ __publicField(this, "updateAgeOnGet");
17834
+ /**
17835
+ * {@link LRUCache.OptionsBase.updateAgeOnHas}
17836
+ */
17837
+ __publicField(this, "updateAgeOnHas");
17838
+ /**
17839
+ * {@link LRUCache.OptionsBase.allowStale}
17840
+ */
17841
+ __publicField(this, "allowStale");
17842
+ /**
17843
+ * {@link LRUCache.OptionsBase.noDisposeOnSet}
17844
+ */
17845
+ __publicField(this, "noDisposeOnSet");
17846
+ /**
17847
+ * {@link LRUCache.OptionsBase.noUpdateTTL}
17848
+ */
17849
+ __publicField(this, "noUpdateTTL");
17850
+ /**
17851
+ * {@link LRUCache.OptionsBase.maxEntrySize}
17852
+ */
17853
+ __publicField(this, "maxEntrySize");
17854
+ /**
17855
+ * {@link LRUCache.OptionsBase.sizeCalculation}
17856
+ */
17857
+ __publicField(this, "sizeCalculation");
17858
+ /**
17859
+ * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
17860
+ */
17861
+ __publicField(this, "noDeleteOnFetchRejection");
17862
+ /**
17863
+ * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
17864
+ */
17865
+ __publicField(this, "noDeleteOnStaleGet");
17866
+ /**
17867
+ * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
17868
+ */
17869
+ __publicField(this, "allowStaleOnFetchAbort");
17870
+ /**
17871
+ * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
17872
+ */
17873
+ __publicField(this, "allowStaleOnFetchRejection");
17874
+ /**
17875
+ * {@link LRUCache.OptionsBase.ignoreFetchAbort}
17876
+ */
17877
+ __publicField(this, "ignoreFetchAbort");
17878
+ // computed properties
17879
+ __privateAdd(this, _size);
17880
+ __privateAdd(this, _calculatedSize);
17881
+ __privateAdd(this, _keyMap);
17882
+ __privateAdd(this, _keyList);
17883
+ __privateAdd(this, _valList);
17884
+ __privateAdd(this, _next);
17885
+ __privateAdd(this, _prev);
17886
+ __privateAdd(this, _head);
17887
+ __privateAdd(this, _tail);
17888
+ __privateAdd(this, _free);
17889
+ __privateAdd(this, _disposed);
17890
+ __privateAdd(this, _sizes);
17891
+ __privateAdd(this, _starts);
17892
+ __privateAdd(this, _ttls);
17893
+ __privateAdd(this, _hasDispose);
17894
+ __privateAdd(this, _hasFetchMethod);
17895
+ __privateAdd(this, _hasDisposeAfter);
17896
+ // conditionally set private methods related to TTL
17897
+ __privateAdd(this, _updateItemAge, () => {
17898
+ });
17899
+ __privateAdd(this, _statusTTL, () => {
17900
+ });
17901
+ __privateAdd(this, _setItemTTL, () => {
17902
+ });
17903
+ /* c8 ignore stop */
17904
+ __privateAdd(this, _isStale, () => false);
17905
+ __privateAdd(this, _removeItemSize, (_i3) => {
17906
+ });
17907
+ __privateAdd(this, _addItemSize, (_i3, _s2, _st) => {
17908
+ });
17909
+ __privateAdd(this, _requireSize, (_k, _v, size, sizeCalculation) => {
17910
+ if (size || sizeCalculation) {
17911
+ throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
17912
+ }
17913
+ return 0;
17914
+ });
17915
+ const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
17916
+ if (max !== 0 && !isPosInt(max)) {
17917
+ throw new TypeError("max option must be a nonnegative integer");
17918
+ }
17919
+ const UintArray = max ? getUintArray(max) : Array;
17920
+ if (!UintArray) {
17921
+ throw new Error("invalid max value: " + max);
17922
+ }
17923
+ __privateSet(this, _max, max);
17924
+ __privateSet(this, _maxSize, maxSize);
17925
+ this.maxEntrySize = maxEntrySize || __privateGet(this, _maxSize);
17926
+ this.sizeCalculation = sizeCalculation;
17927
+ if (this.sizeCalculation) {
17928
+ if (!__privateGet(this, _maxSize) && !this.maxEntrySize) {
17929
+ throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
17930
+ }
17931
+ if (typeof this.sizeCalculation !== "function") {
17932
+ throw new TypeError("sizeCalculation set to non-function");
17933
+ }
17934
+ }
17935
+ if (fetchMethod !== void 0 && typeof fetchMethod !== "function") {
17936
+ throw new TypeError("fetchMethod must be a function if specified");
17937
+ }
17938
+ __privateSet(this, _fetchMethod, fetchMethod);
17939
+ __privateSet(this, _hasFetchMethod, !!fetchMethod);
17940
+ __privateSet(this, _keyMap, /* @__PURE__ */ new Map());
17941
+ __privateSet(this, _keyList, new Array(max).fill(void 0));
17942
+ __privateSet(this, _valList, new Array(max).fill(void 0));
17943
+ __privateSet(this, _next, new UintArray(max));
17944
+ __privateSet(this, _prev, new UintArray(max));
17945
+ __privateSet(this, _head, 0);
17946
+ __privateSet(this, _tail, 0);
17947
+ __privateSet(this, _free, Stack.create(max));
17948
+ __privateSet(this, _size, 0);
17949
+ __privateSet(this, _calculatedSize, 0);
17950
+ if (typeof dispose === "function") {
17951
+ __privateSet(this, _dispose, dispose);
17952
+ }
17953
+ if (typeof disposeAfter === "function") {
17954
+ __privateSet(this, _disposeAfter, disposeAfter);
17955
+ __privateSet(this, _disposed, []);
17956
+ } else {
17957
+ __privateSet(this, _disposeAfter, void 0);
17958
+ __privateSet(this, _disposed, void 0);
17959
+ }
17960
+ __privateSet(this, _hasDispose, !!__privateGet(this, _dispose));
17961
+ __privateSet(this, _hasDisposeAfter, !!__privateGet(this, _disposeAfter));
17962
+ this.noDisposeOnSet = !!noDisposeOnSet;
17963
+ this.noUpdateTTL = !!noUpdateTTL;
17964
+ this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
17965
+ this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
17966
+ this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
17967
+ this.ignoreFetchAbort = !!ignoreFetchAbort;
17968
+ if (this.maxEntrySize !== 0) {
17969
+ if (__privateGet(this, _maxSize) !== 0) {
17970
+ if (!isPosInt(__privateGet(this, _maxSize))) {
17971
+ throw new TypeError("maxSize must be a positive integer if specified");
17972
+ }
17973
+ }
17974
+ if (!isPosInt(this.maxEntrySize)) {
17975
+ throw new TypeError("maxEntrySize must be a positive integer if specified");
17976
+ }
17977
+ __privateMethod(this, _LRUCache_instances, initializeSizeTracking_fn).call(this);
17978
+ }
17979
+ this.allowStale = !!allowStale;
17980
+ this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
17981
+ this.updateAgeOnGet = !!updateAgeOnGet;
17982
+ this.updateAgeOnHas = !!updateAgeOnHas;
17983
+ this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
17984
+ this.ttlAutopurge = !!ttlAutopurge;
17985
+ this.ttl = ttl || 0;
17986
+ if (this.ttl) {
17987
+ if (!isPosInt(this.ttl)) {
17988
+ throw new TypeError("ttl must be a positive integer if specified");
17989
+ }
17990
+ __privateMethod(this, _LRUCache_instances, initializeTTLTracking_fn).call(this);
17991
+ }
17992
+ if (__privateGet(this, _max) === 0 && this.ttl === 0 && __privateGet(this, _maxSize) === 0) {
17993
+ throw new TypeError("At least one of max, maxSize, or ttl is required");
17994
+ }
17995
+ if (!this.ttlAutopurge && !__privateGet(this, _max) && !__privateGet(this, _maxSize)) {
17996
+ const code = "LRU_CACHE_UNBOUNDED";
17997
+ if (shouldWarn(code)) {
17998
+ warned.add(code);
17999
+ const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";
18000
+ emitWarning(msg, "UnboundedCacheWarning", code, _b);
18001
+ }
18002
+ }
18003
+ }
18004
+ /**
18005
+ * Do not call this method unless you need to inspect the
18006
+ * inner workings of the cache. If anything returned by this
18007
+ * object is modified in any way, strange breakage may occur.
18008
+ *
18009
+ * These fields are private for a reason!
18010
+ *
18011
+ * @internal
18012
+ */
18013
+ static unsafeExposeInternals(c3) {
18014
+ return {
18015
+ // properties
18016
+ starts: __privateGet(c3, _starts),
18017
+ ttls: __privateGet(c3, _ttls),
18018
+ sizes: __privateGet(c3, _sizes),
18019
+ keyMap: __privateGet(c3, _keyMap),
18020
+ keyList: __privateGet(c3, _keyList),
18021
+ valList: __privateGet(c3, _valList),
18022
+ next: __privateGet(c3, _next),
18023
+ prev: __privateGet(c3, _prev),
18024
+ get head() {
18025
+ return __privateGet(c3, _head);
18026
+ },
18027
+ get tail() {
18028
+ return __privateGet(c3, _tail);
18029
+ },
18030
+ free: __privateGet(c3, _free),
18031
+ // methods
18032
+ isBackgroundFetch: (p2) => {
18033
+ var _a3;
18034
+ return __privateMethod(_a3 = c3, _LRUCache_instances, isBackgroundFetch_fn).call(_a3, p2);
18035
+ },
18036
+ backgroundFetch: (k3, index, options, context2) => {
18037
+ var _a3;
18038
+ return __privateMethod(_a3 = c3, _LRUCache_instances, backgroundFetch_fn).call(_a3, k3, index, options, context2);
18039
+ },
18040
+ moveToTail: (index) => {
18041
+ var _a3;
18042
+ return __privateMethod(_a3 = c3, _LRUCache_instances, moveToTail_fn).call(_a3, index);
18043
+ },
18044
+ indexes: (options) => {
18045
+ var _a3;
18046
+ return __privateMethod(_a3 = c3, _LRUCache_instances, indexes_fn).call(_a3, options);
18047
+ },
18048
+ rindexes: (options) => {
18049
+ var _a3;
18050
+ return __privateMethod(_a3 = c3, _LRUCache_instances, rindexes_fn).call(_a3, options);
18051
+ },
18052
+ isStale: (index) => {
18053
+ var _a3;
18054
+ return __privateGet(_a3 = c3, _isStale).call(_a3, index);
18055
+ }
18056
+ };
18057
+ }
18058
+ // Protected read-only members
18059
+ /**
18060
+ * {@link LRUCache.OptionsBase.max} (read-only)
18061
+ */
18062
+ get max() {
18063
+ return __privateGet(this, _max);
18064
+ }
18065
+ /**
18066
+ * {@link LRUCache.OptionsBase.maxSize} (read-only)
18067
+ */
18068
+ get maxSize() {
18069
+ return __privateGet(this, _maxSize);
18070
+ }
18071
+ /**
18072
+ * The total computed size of items in the cache (read-only)
18073
+ */
18074
+ get calculatedSize() {
18075
+ return __privateGet(this, _calculatedSize);
18076
+ }
18077
+ /**
18078
+ * The number of items stored in the cache (read-only)
18079
+ */
18080
+ get size() {
18081
+ return __privateGet(this, _size);
18082
+ }
18083
+ /**
18084
+ * {@link LRUCache.OptionsBase.fetchMethod} (read-only)
18085
+ */
18086
+ get fetchMethod() {
18087
+ return __privateGet(this, _fetchMethod);
18088
+ }
18089
+ /**
18090
+ * {@link LRUCache.OptionsBase.dispose} (read-only)
18091
+ */
18092
+ get dispose() {
18093
+ return __privateGet(this, _dispose);
18094
+ }
18095
+ /**
18096
+ * {@link LRUCache.OptionsBase.disposeAfter} (read-only)
18097
+ */
18098
+ get disposeAfter() {
18099
+ return __privateGet(this, _disposeAfter);
18100
+ }
18101
+ /**
18102
+ * Return the remaining TTL time for a given entry key
18103
+ */
18104
+ getRemainingTTL(key) {
18105
+ return __privateGet(this, _keyMap).has(key) ? Infinity : 0;
18106
+ }
18107
+ /**
18108
+ * Return a generator yielding `[key, value]` pairs,
18109
+ * in order from most recently used to least recently used.
18110
+ */
18111
+ *entries() {
18112
+ for (const i3 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
18113
+ if (__privateGet(this, _valList)[i3] !== void 0 && __privateGet(this, _keyList)[i3] !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i3])) {
18114
+ yield [__privateGet(this, _keyList)[i3], __privateGet(this, _valList)[i3]];
18115
+ }
18116
+ }
18117
+ }
18118
+ /**
18119
+ * Inverse order version of {@link LRUCache.entries}
18120
+ *
18121
+ * Return a generator yielding `[key, value]` pairs,
18122
+ * in order from least recently used to most recently used.
18123
+ */
18124
+ *rentries() {
18125
+ for (const i3 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {
18126
+ if (__privateGet(this, _valList)[i3] !== void 0 && __privateGet(this, _keyList)[i3] !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i3])) {
18127
+ yield [__privateGet(this, _keyList)[i3], __privateGet(this, _valList)[i3]];
18128
+ }
18129
+ }
18130
+ }
18131
+ /**
18132
+ * Return a generator yielding the keys in the cache,
18133
+ * in order from most recently used to least recently used.
18134
+ */
18135
+ *keys() {
18136
+ for (const i3 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
18137
+ const k3 = __privateGet(this, _keyList)[i3];
18138
+ if (k3 !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i3])) {
18139
+ yield k3;
18140
+ }
18141
+ }
18142
+ }
18143
+ /**
18144
+ * Inverse order version of {@link LRUCache.keys}
18145
+ *
18146
+ * Return a generator yielding the keys in the cache,
18147
+ * in order from least recently used to most recently used.
18148
+ */
18149
+ *rkeys() {
18150
+ for (const i3 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {
18151
+ const k3 = __privateGet(this, _keyList)[i3];
18152
+ if (k3 !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i3])) {
18153
+ yield k3;
18154
+ }
18155
+ }
18156
+ }
18157
+ /**
18158
+ * Return a generator yielding the values in the cache,
18159
+ * in order from most recently used to least recently used.
18160
+ */
18161
+ *values() {
18162
+ for (const i3 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
18163
+ const v2 = __privateGet(this, _valList)[i3];
18164
+ if (v2 !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i3])) {
18165
+ yield __privateGet(this, _valList)[i3];
18166
+ }
18167
+ }
18168
+ }
18169
+ /**
18170
+ * Inverse order version of {@link LRUCache.values}
18171
+ *
18172
+ * Return a generator yielding the values in the cache,
18173
+ * in order from least recently used to most recently used.
18174
+ */
18175
+ *rvalues() {
18176
+ for (const i3 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {
18177
+ const v2 = __privateGet(this, _valList)[i3];
18178
+ if (v2 !== void 0 && !__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, __privateGet(this, _valList)[i3])) {
18179
+ yield __privateGet(this, _valList)[i3];
18180
+ }
18181
+ }
18182
+ }
18183
+ /**
18184
+ * Iterating over the cache itself yields the same results as
18185
+ * {@link LRUCache.entries}
18186
+ */
18187
+ [Symbol.iterator]() {
18188
+ return this.entries();
18189
+ }
18190
+ /**
18191
+ * Find a value for which the supplied fn method returns a truthy value,
18192
+ * similar to Array.find(). fn is called as fn(value, key, cache).
18193
+ */
18194
+ find(fn, getOptions = {}) {
18195
+ for (const i3 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
18196
+ const v2 = __privateGet(this, _valList)[i3];
18197
+ const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2) ? v2.__staleWhileFetching : v2;
18198
+ if (value === void 0)
18199
+ continue;
18200
+ if (fn(value, __privateGet(this, _keyList)[i3], this)) {
18201
+ return this.get(__privateGet(this, _keyList)[i3], getOptions);
18202
+ }
18203
+ }
18204
+ }
18205
+ /**
18206
+ * Call the supplied function on each item in the cache, in order from
18207
+ * most recently used to least recently used. fn is called as
18208
+ * fn(value, key, cache). Does not update age or recenty of use.
18209
+ * Does not iterate over stale values.
18210
+ */
18211
+ forEach(fn, thisp = this) {
18212
+ for (const i3 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this)) {
18213
+ const v2 = __privateGet(this, _valList)[i3];
18214
+ const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2) ? v2.__staleWhileFetching : v2;
18215
+ if (value === void 0)
18216
+ continue;
18217
+ fn.call(thisp, value, __privateGet(this, _keyList)[i3], this);
18218
+ }
18219
+ }
18220
+ /**
18221
+ * The same as {@link LRUCache.forEach} but items are iterated over in
18222
+ * reverse order. (ie, less recently used items are iterated over first.)
18223
+ */
18224
+ rforEach(fn, thisp = this) {
18225
+ for (const i3 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this)) {
18226
+ const v2 = __privateGet(this, _valList)[i3];
18227
+ const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2) ? v2.__staleWhileFetching : v2;
18228
+ if (value === void 0)
18229
+ continue;
18230
+ fn.call(thisp, value, __privateGet(this, _keyList)[i3], this);
18231
+ }
18232
+ }
18233
+ /**
18234
+ * Delete any stale entries. Returns true if anything was removed,
18235
+ * false otherwise.
18236
+ */
18237
+ purgeStale() {
18238
+ let deleted = false;
18239
+ for (const i3 of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {
18240
+ if (__privateGet(this, _isStale).call(this, i3)) {
18241
+ this.delete(__privateGet(this, _keyList)[i3]);
18242
+ deleted = true;
18243
+ }
18244
+ }
18245
+ return deleted;
18246
+ }
18247
+ /**
18248
+ * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
18249
+ * passed to cache.load()
18250
+ */
18251
+ dump() {
18252
+ const arr = [];
18253
+ for (const i3 of __privateMethod(this, _LRUCache_instances, indexes_fn).call(this, { allowStale: true })) {
18254
+ const key = __privateGet(this, _keyList)[i3];
18255
+ const v2 = __privateGet(this, _valList)[i3];
18256
+ const value = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2) ? v2.__staleWhileFetching : v2;
18257
+ if (value === void 0 || key === void 0)
18258
+ continue;
18259
+ const entry = { value };
18260
+ if (__privateGet(this, _ttls) && __privateGet(this, _starts)) {
18261
+ entry.ttl = __privateGet(this, _ttls)[i3];
18262
+ const age = perf.now() - __privateGet(this, _starts)[i3];
18263
+ entry.start = Math.floor(Date.now() - age);
18264
+ }
18265
+ if (__privateGet(this, _sizes)) {
18266
+ entry.size = __privateGet(this, _sizes)[i3];
18267
+ }
18268
+ arr.unshift([key, entry]);
18269
+ }
18270
+ return arr;
18271
+ }
18272
+ /**
18273
+ * Reset the cache and load in the items in entries in the order listed.
18274
+ * Note that the shape of the resulting cache may be different if the
18275
+ * same options are not used in both caches.
18276
+ */
18277
+ load(arr) {
18278
+ this.clear();
18279
+ for (const [key, entry] of arr) {
18280
+ if (entry.start) {
18281
+ const age = Date.now() - entry.start;
18282
+ entry.start = perf.now() - age;
18283
+ }
18284
+ this.set(key, entry.value, entry);
18285
+ }
18286
+ }
18287
+ /**
18288
+ * Add a value to the cache.
18289
+ *
18290
+ * Note: if `undefined` is specified as a value, this is an alias for
18291
+ * {@link LRUCache#delete}
18292
+ */
18293
+ set(k3, v2, setOptions = {}) {
18294
+ var _a3, _b2, _c2;
18295
+ if (v2 === void 0) {
18296
+ this.delete(k3);
18297
+ return this;
18298
+ }
18299
+ const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;
18300
+ let { noUpdateTTL = this.noUpdateTTL } = setOptions;
18301
+ const size = __privateGet(this, _requireSize).call(this, k3, v2, setOptions.size || 0, sizeCalculation);
18302
+ if (this.maxEntrySize && size > this.maxEntrySize) {
18303
+ if (status) {
18304
+ status.set = "miss";
18305
+ status.maxEntrySizeExceeded = true;
18306
+ }
18307
+ this.delete(k3);
18308
+ return this;
18309
+ }
18310
+ let index = __privateGet(this, _size) === 0 ? void 0 : __privateGet(this, _keyMap).get(k3);
18311
+ if (index === void 0) {
18312
+ index = __privateGet(this, _size) === 0 ? __privateGet(this, _tail) : __privateGet(this, _free).length !== 0 ? __privateGet(this, _free).pop() : __privateGet(this, _size) === __privateGet(this, _max) ? __privateMethod(this, _LRUCache_instances, evict_fn).call(this, false) : __privateGet(this, _size);
18313
+ __privateGet(this, _keyList)[index] = k3;
18314
+ __privateGet(this, _valList)[index] = v2;
18315
+ __privateGet(this, _keyMap).set(k3, index);
18316
+ __privateGet(this, _next)[__privateGet(this, _tail)] = index;
18317
+ __privateGet(this, _prev)[index] = __privateGet(this, _tail);
18318
+ __privateSet(this, _tail, index);
18319
+ __privateWrapper(this, _size)._++;
18320
+ __privateGet(this, _addItemSize).call(this, index, size, status);
18321
+ if (status)
18322
+ status.set = "add";
18323
+ noUpdateTTL = false;
18324
+ } else {
18325
+ __privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);
18326
+ const oldVal = __privateGet(this, _valList)[index];
18327
+ if (v2 !== oldVal) {
18328
+ if (__privateGet(this, _hasFetchMethod) && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, oldVal)) {
18329
+ oldVal.__abortController.abort(new Error("replaced"));
18330
+ } else if (!noDisposeOnSet) {
18331
+ if (__privateGet(this, _hasDispose)) {
18332
+ (_a3 = __privateGet(this, _dispose)) == null ? void 0 : _a3.call(this, oldVal, k3, "set");
18333
+ }
18334
+ if (__privateGet(this, _hasDisposeAfter)) {
18335
+ (_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([oldVal, k3, "set"]);
18336
+ }
18337
+ }
18338
+ __privateGet(this, _removeItemSize).call(this, index);
18339
+ __privateGet(this, _addItemSize).call(this, index, size, status);
18340
+ __privateGet(this, _valList)[index] = v2;
18341
+ if (status) {
18342
+ status.set = "replace";
18343
+ const oldValue = oldVal && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, oldVal) ? oldVal.__staleWhileFetching : oldVal;
18344
+ if (oldValue !== void 0)
18345
+ status.oldValue = oldValue;
18346
+ }
18347
+ } else if (status) {
18348
+ status.set = "update";
18349
+ }
18350
+ }
18351
+ if (ttl !== 0 && !__privateGet(this, _ttls)) {
18352
+ __privateMethod(this, _LRUCache_instances, initializeTTLTracking_fn).call(this);
18353
+ }
18354
+ if (__privateGet(this, _ttls)) {
18355
+ if (!noUpdateTTL) {
18356
+ __privateGet(this, _setItemTTL).call(this, index, ttl, start);
18357
+ }
18358
+ if (status)
18359
+ __privateGet(this, _statusTTL).call(this, status, index);
18360
+ }
18361
+ if (!noDisposeOnSet && __privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {
18362
+ const dt = __privateGet(this, _disposed);
18363
+ let task;
18364
+ while (task = dt == null ? void 0 : dt.shift()) {
18365
+ (_c2 = __privateGet(this, _disposeAfter)) == null ? void 0 : _c2.call(this, ...task);
18366
+ }
18367
+ }
18368
+ return this;
18369
+ }
18370
+ /**
18371
+ * Evict the least recently used item, returning its value or
18372
+ * `undefined` if cache is empty.
18373
+ */
18374
+ pop() {
18375
+ var _a3;
18376
+ try {
18377
+ while (__privateGet(this, _size)) {
18378
+ const val = __privateGet(this, _valList)[__privateGet(this, _head)];
18379
+ __privateMethod(this, _LRUCache_instances, evict_fn).call(this, true);
18380
+ if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, val)) {
18381
+ if (val.__staleWhileFetching) {
18382
+ return val.__staleWhileFetching;
18383
+ }
18384
+ } else if (val !== void 0) {
18385
+ return val;
18386
+ }
18387
+ }
18388
+ } finally {
18389
+ if (__privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {
18390
+ const dt = __privateGet(this, _disposed);
18391
+ let task;
18392
+ while (task = dt == null ? void 0 : dt.shift()) {
18393
+ (_a3 = __privateGet(this, _disposeAfter)) == null ? void 0 : _a3.call(this, ...task);
18394
+ }
18395
+ }
18396
+ }
18397
+ }
18398
+ /**
18399
+ * Check if a key is in the cache, without updating the recency of use.
18400
+ * Will return false if the item is stale, even though it is technically
18401
+ * in the cache.
18402
+ *
18403
+ * Will not update item age unless
18404
+ * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
18405
+ */
18406
+ has(k3, hasOptions = {}) {
18407
+ const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
18408
+ const index = __privateGet(this, _keyMap).get(k3);
18409
+ if (index !== void 0) {
18410
+ const v2 = __privateGet(this, _valList)[index];
18411
+ if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2) && v2.__staleWhileFetching === void 0) {
18412
+ return false;
18413
+ }
18414
+ if (!__privateGet(this, _isStale).call(this, index)) {
18415
+ if (updateAgeOnHas) {
18416
+ __privateGet(this, _updateItemAge).call(this, index);
18417
+ }
18418
+ if (status) {
18419
+ status.has = "hit";
18420
+ __privateGet(this, _statusTTL).call(this, status, index);
18421
+ }
18422
+ return true;
18423
+ } else if (status) {
18424
+ status.has = "stale";
18425
+ __privateGet(this, _statusTTL).call(this, status, index);
18426
+ }
18427
+ } else if (status) {
18428
+ status.has = "miss";
18429
+ }
18430
+ return false;
18431
+ }
18432
+ /**
18433
+ * Like {@link LRUCache#get} but doesn't update recency or delete stale
18434
+ * items.
18435
+ *
18436
+ * Returns `undefined` if the item is stale, unless
18437
+ * {@link LRUCache.OptionsBase.allowStale} is set.
18438
+ */
18439
+ peek(k3, peekOptions = {}) {
18440
+ const { allowStale = this.allowStale } = peekOptions;
18441
+ const index = __privateGet(this, _keyMap).get(k3);
18442
+ if (index !== void 0 && (allowStale || !__privateGet(this, _isStale).call(this, index))) {
18443
+ const v2 = __privateGet(this, _valList)[index];
18444
+ return __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2) ? v2.__staleWhileFetching : v2;
18445
+ }
18446
+ }
18447
+ async fetch(k3, fetchOptions = {}) {
18448
+ const {
18449
+ // get options
18450
+ allowStale = this.allowStale,
18451
+ updateAgeOnGet = this.updateAgeOnGet,
18452
+ noDeleteOnStaleGet = this.noDeleteOnStaleGet,
18453
+ // set options
18454
+ ttl = this.ttl,
18455
+ noDisposeOnSet = this.noDisposeOnSet,
18456
+ size = 0,
18457
+ sizeCalculation = this.sizeCalculation,
18458
+ noUpdateTTL = this.noUpdateTTL,
18459
+ // fetch exclusive options
18460
+ noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
18461
+ allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
18462
+ ignoreFetchAbort = this.ignoreFetchAbort,
18463
+ allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
18464
+ context: context2,
18465
+ forceRefresh = false,
18466
+ status,
18467
+ signal
18468
+ } = fetchOptions;
18469
+ if (!__privateGet(this, _hasFetchMethod)) {
18470
+ if (status)
18471
+ status.fetch = "get";
18472
+ return this.get(k3, {
18473
+ allowStale,
18474
+ updateAgeOnGet,
18475
+ noDeleteOnStaleGet,
18476
+ status
18477
+ });
18478
+ }
18479
+ const options = {
18480
+ allowStale,
18481
+ updateAgeOnGet,
18482
+ noDeleteOnStaleGet,
18483
+ ttl,
18484
+ noDisposeOnSet,
18485
+ size,
18486
+ sizeCalculation,
18487
+ noUpdateTTL,
18488
+ noDeleteOnFetchRejection,
18489
+ allowStaleOnFetchRejection,
18490
+ allowStaleOnFetchAbort,
18491
+ ignoreFetchAbort,
18492
+ status,
18493
+ signal
18494
+ };
18495
+ let index = __privateGet(this, _keyMap).get(k3);
18496
+ if (index === void 0) {
18497
+ if (status)
18498
+ status.fetch = "miss";
18499
+ const p2 = __privateMethod(this, _LRUCache_instances, backgroundFetch_fn).call(this, k3, index, options, context2);
18500
+ return p2.__returned = p2;
18501
+ } else {
18502
+ const v2 = __privateGet(this, _valList)[index];
18503
+ if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2)) {
18504
+ const stale = allowStale && v2.__staleWhileFetching !== void 0;
18505
+ if (status) {
18506
+ status.fetch = "inflight";
18507
+ if (stale)
18508
+ status.returnedStale = true;
18509
+ }
18510
+ return stale ? v2.__staleWhileFetching : v2.__returned = v2;
18511
+ }
18512
+ const isStale2 = __privateGet(this, _isStale).call(this, index);
18513
+ if (!forceRefresh && !isStale2) {
18514
+ if (status)
18515
+ status.fetch = "hit";
18516
+ __privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);
18517
+ if (updateAgeOnGet) {
18518
+ __privateGet(this, _updateItemAge).call(this, index);
18519
+ }
18520
+ if (status)
18521
+ __privateGet(this, _statusTTL).call(this, status, index);
18522
+ return v2;
18523
+ }
18524
+ const p2 = __privateMethod(this, _LRUCache_instances, backgroundFetch_fn).call(this, k3, index, options, context2);
18525
+ const hasStale = p2.__staleWhileFetching !== void 0;
18526
+ const staleVal = hasStale && allowStale;
18527
+ if (status) {
18528
+ status.fetch = isStale2 ? "stale" : "refresh";
18529
+ if (staleVal && isStale2)
18530
+ status.returnedStale = true;
18531
+ }
18532
+ return staleVal ? p2.__staleWhileFetching : p2.__returned = p2;
18533
+ }
18534
+ }
18535
+ /**
18536
+ * Return a value from the cache. Will update the recency of the cache
18537
+ * entry found.
18538
+ *
18539
+ * If the key is not found, get() will return `undefined`.
18540
+ */
18541
+ get(k3, getOptions = {}) {
18542
+ const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;
18543
+ const index = __privateGet(this, _keyMap).get(k3);
18544
+ if (index !== void 0) {
18545
+ const value = __privateGet(this, _valList)[index];
18546
+ const fetching = __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, value);
18547
+ if (status)
18548
+ __privateGet(this, _statusTTL).call(this, status, index);
18549
+ if (__privateGet(this, _isStale).call(this, index)) {
18550
+ if (status)
18551
+ status.get = "stale";
18552
+ if (!fetching) {
18553
+ if (!noDeleteOnStaleGet) {
18554
+ this.delete(k3);
18555
+ }
18556
+ if (status && allowStale)
18557
+ status.returnedStale = true;
18558
+ return allowStale ? value : void 0;
18559
+ } else {
18560
+ if (status && allowStale && value.__staleWhileFetching !== void 0) {
18561
+ status.returnedStale = true;
18562
+ }
18563
+ return allowStale ? value.__staleWhileFetching : void 0;
18564
+ }
18565
+ } else {
18566
+ if (status)
18567
+ status.get = "hit";
18568
+ if (fetching) {
18569
+ return value.__staleWhileFetching;
18570
+ }
18571
+ __privateMethod(this, _LRUCache_instances, moveToTail_fn).call(this, index);
18572
+ if (updateAgeOnGet) {
18573
+ __privateGet(this, _updateItemAge).call(this, index);
18574
+ }
18575
+ return value;
18576
+ }
18577
+ } else if (status) {
18578
+ status.get = "miss";
18579
+ }
18580
+ }
18581
+ /**
18582
+ * Deletes a key out of the cache.
18583
+ * Returns true if the key was deleted, false otherwise.
18584
+ */
18585
+ delete(k3) {
18586
+ var _a3, _b2, _c2, _d2;
18587
+ let deleted = false;
18588
+ if (__privateGet(this, _size) !== 0) {
18589
+ const index = __privateGet(this, _keyMap).get(k3);
18590
+ if (index !== void 0) {
18591
+ deleted = true;
18592
+ if (__privateGet(this, _size) === 1) {
18593
+ this.clear();
18594
+ } else {
18595
+ __privateGet(this, _removeItemSize).call(this, index);
18596
+ const v2 = __privateGet(this, _valList)[index];
18597
+ if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2)) {
18598
+ v2.__abortController.abort(new Error("deleted"));
18599
+ } else if (__privateGet(this, _hasDispose) || __privateGet(this, _hasDisposeAfter)) {
18600
+ if (__privateGet(this, _hasDispose)) {
18601
+ (_a3 = __privateGet(this, _dispose)) == null ? void 0 : _a3.call(this, v2, k3, "delete");
18602
+ }
18603
+ if (__privateGet(this, _hasDisposeAfter)) {
18604
+ (_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([v2, k3, "delete"]);
18605
+ }
18606
+ }
18607
+ __privateGet(this, _keyMap).delete(k3);
18608
+ __privateGet(this, _keyList)[index] = void 0;
18609
+ __privateGet(this, _valList)[index] = void 0;
18610
+ if (index === __privateGet(this, _tail)) {
18611
+ __privateSet(this, _tail, __privateGet(this, _prev)[index]);
18612
+ } else if (index === __privateGet(this, _head)) {
18613
+ __privateSet(this, _head, __privateGet(this, _next)[index]);
18614
+ } else {
18615
+ __privateGet(this, _next)[__privateGet(this, _prev)[index]] = __privateGet(this, _next)[index];
18616
+ __privateGet(this, _prev)[__privateGet(this, _next)[index]] = __privateGet(this, _prev)[index];
18617
+ }
18618
+ __privateWrapper(this, _size)._--;
18619
+ __privateGet(this, _free).push(index);
18620
+ }
18621
+ }
18622
+ }
18623
+ if (__privateGet(this, _hasDisposeAfter) && ((_c2 = __privateGet(this, _disposed)) == null ? void 0 : _c2.length)) {
18624
+ const dt = __privateGet(this, _disposed);
18625
+ let task;
18626
+ while (task = dt == null ? void 0 : dt.shift()) {
18627
+ (_d2 = __privateGet(this, _disposeAfter)) == null ? void 0 : _d2.call(this, ...task);
18628
+ }
18629
+ }
18630
+ return deleted;
18631
+ }
18632
+ /**
18633
+ * Clear the cache entirely, throwing away all values.
18634
+ */
18635
+ clear() {
18636
+ var _a3, _b2, _c2;
18637
+ for (const index of __privateMethod(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {
18638
+ const v2 = __privateGet(this, _valList)[index];
18639
+ if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2)) {
18640
+ v2.__abortController.abort(new Error("deleted"));
18641
+ } else {
18642
+ const k3 = __privateGet(this, _keyList)[index];
18643
+ if (__privateGet(this, _hasDispose)) {
18644
+ (_a3 = __privateGet(this, _dispose)) == null ? void 0 : _a3.call(this, v2, k3, "delete");
18645
+ }
18646
+ if (__privateGet(this, _hasDisposeAfter)) {
18647
+ (_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([v2, k3, "delete"]);
18648
+ }
18649
+ }
18650
+ }
18651
+ __privateGet(this, _keyMap).clear();
18652
+ __privateGet(this, _valList).fill(void 0);
18653
+ __privateGet(this, _keyList).fill(void 0);
18654
+ if (__privateGet(this, _ttls) && __privateGet(this, _starts)) {
18655
+ __privateGet(this, _ttls).fill(0);
18656
+ __privateGet(this, _starts).fill(0);
18657
+ }
18658
+ if (__privateGet(this, _sizes)) {
18659
+ __privateGet(this, _sizes).fill(0);
18660
+ }
18661
+ __privateSet(this, _head, 0);
18662
+ __privateSet(this, _tail, 0);
18663
+ __privateGet(this, _free).length = 0;
18664
+ __privateSet(this, _calculatedSize, 0);
18665
+ __privateSet(this, _size, 0);
18666
+ if (__privateGet(this, _hasDisposeAfter) && __privateGet(this, _disposed)) {
18667
+ const dt = __privateGet(this, _disposed);
18668
+ let task;
18669
+ while (task = dt == null ? void 0 : dt.shift()) {
18670
+ (_c2 = __privateGet(this, _disposeAfter)) == null ? void 0 : _c2.call(this, ...task);
18671
+ }
18672
+ }
18673
+ }
18674
+ }, _max = new WeakMap(), _maxSize = new WeakMap(), _dispose = new WeakMap(), _disposeAfter = new WeakMap(), _fetchMethod = new WeakMap(), _size = new WeakMap(), _calculatedSize = new WeakMap(), _keyMap = new WeakMap(), _keyList = new WeakMap(), _valList = new WeakMap(), _next = new WeakMap(), _prev = new WeakMap(), _head = new WeakMap(), _tail = new WeakMap(), _free = new WeakMap(), _disposed = new WeakMap(), _sizes = new WeakMap(), _starts = new WeakMap(), _ttls = new WeakMap(), _hasDispose = new WeakMap(), _hasFetchMethod = new WeakMap(), _hasDisposeAfter = new WeakMap(), _LRUCache_instances = new WeakSet(), initializeTTLTracking_fn = function() {
18675
+ const ttls = new ZeroArray(__privateGet(this, _max));
18676
+ const starts = new ZeroArray(__privateGet(this, _max));
18677
+ __privateSet(this, _ttls, ttls);
18678
+ __privateSet(this, _starts, starts);
18679
+ __privateSet(this, _setItemTTL, (index, ttl, start = perf.now()) => {
18680
+ starts[index] = ttl !== 0 ? start : 0;
18681
+ ttls[index] = ttl;
18682
+ if (ttl !== 0 && this.ttlAutopurge) {
18683
+ const t3 = setTimeout(() => {
18684
+ if (__privateGet(this, _isStale).call(this, index)) {
18685
+ this.delete(__privateGet(this, _keyList)[index]);
18686
+ }
18687
+ }, ttl + 1);
18688
+ if (t3.unref) {
18689
+ t3.unref();
18690
+ }
18691
+ }
18692
+ });
18693
+ __privateSet(this, _updateItemAge, (index) => {
18694
+ starts[index] = ttls[index] !== 0 ? perf.now() : 0;
18695
+ });
18696
+ __privateSet(this, _statusTTL, (status, index) => {
18697
+ if (ttls[index]) {
18698
+ const ttl = ttls[index];
18699
+ const start = starts[index];
18700
+ status.ttl = ttl;
18701
+ status.start = start;
18702
+ status.now = cachedNow || getNow();
18703
+ const age = status.now - start;
18704
+ status.remainingTTL = ttl - age;
18705
+ }
18706
+ });
18707
+ let cachedNow = 0;
18708
+ const getNow = () => {
18709
+ const n2 = perf.now();
18710
+ if (this.ttlResolution > 0) {
18711
+ cachedNow = n2;
18712
+ const t3 = setTimeout(() => cachedNow = 0, this.ttlResolution);
18713
+ if (t3.unref) {
18714
+ t3.unref();
18715
+ }
18716
+ }
18717
+ return n2;
18718
+ };
18719
+ this.getRemainingTTL = (key) => {
18720
+ const index = __privateGet(this, _keyMap).get(key);
18721
+ if (index === void 0) {
18722
+ return 0;
18723
+ }
18724
+ const ttl = ttls[index];
18725
+ const start = starts[index];
18726
+ if (ttl === 0 || start === 0) {
18727
+ return Infinity;
18728
+ }
18729
+ const age = (cachedNow || getNow()) - start;
18730
+ return ttl - age;
18731
+ };
18732
+ __privateSet(this, _isStale, (index) => {
18733
+ return ttls[index] !== 0 && starts[index] !== 0 && (cachedNow || getNow()) - starts[index] > ttls[index];
18734
+ });
18735
+ }, _updateItemAge = new WeakMap(), _statusTTL = new WeakMap(), _setItemTTL = new WeakMap(), _isStale = new WeakMap(), initializeSizeTracking_fn = function() {
18736
+ const sizes = new ZeroArray(__privateGet(this, _max));
18737
+ __privateSet(this, _calculatedSize, 0);
18738
+ __privateSet(this, _sizes, sizes);
18739
+ __privateSet(this, _removeItemSize, (index) => {
18740
+ __privateSet(this, _calculatedSize, __privateGet(this, _calculatedSize) - sizes[index]);
18741
+ sizes[index] = 0;
18742
+ });
18743
+ __privateSet(this, _requireSize, (k3, v2, size, sizeCalculation) => {
18744
+ if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2)) {
18745
+ return 0;
18746
+ }
18747
+ if (!isPosInt(size)) {
18748
+ if (sizeCalculation) {
18749
+ if (typeof sizeCalculation !== "function") {
18750
+ throw new TypeError("sizeCalculation must be a function");
18751
+ }
18752
+ size = sizeCalculation(v2, k3);
18753
+ if (!isPosInt(size)) {
18754
+ throw new TypeError("sizeCalculation return invalid (expect positive integer)");
18755
+ }
18756
+ } else {
18757
+ throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
18758
+ }
18759
+ }
18760
+ return size;
18761
+ });
18762
+ __privateSet(this, _addItemSize, (index, size, status) => {
18763
+ sizes[index] = size;
18764
+ if (__privateGet(this, _maxSize)) {
18765
+ const maxSize = __privateGet(this, _maxSize) - sizes[index];
18766
+ while (__privateGet(this, _calculatedSize) > maxSize) {
18767
+ __privateMethod(this, _LRUCache_instances, evict_fn).call(this, true);
18768
+ }
18769
+ }
18770
+ __privateSet(this, _calculatedSize, __privateGet(this, _calculatedSize) + sizes[index]);
18771
+ if (status) {
18772
+ status.entrySize = size;
18773
+ status.totalCalculatedSize = __privateGet(this, _calculatedSize);
18774
+ }
18775
+ });
18776
+ }, _removeItemSize = new WeakMap(), _addItemSize = new WeakMap(), _requireSize = new WeakMap(), indexes_fn = function* ({ allowStale = this.allowStale } = {}) {
18777
+ if (__privateGet(this, _size)) {
18778
+ for (let i3 = __privateGet(this, _tail); true; ) {
18779
+ if (!__privateMethod(this, _LRUCache_instances, isValidIndex_fn).call(this, i3)) {
18780
+ break;
18781
+ }
18782
+ if (allowStale || !__privateGet(this, _isStale).call(this, i3)) {
18783
+ yield i3;
18784
+ }
18785
+ if (i3 === __privateGet(this, _head)) {
18786
+ break;
18787
+ } else {
18788
+ i3 = __privateGet(this, _prev)[i3];
18789
+ }
18790
+ }
18791
+ }
18792
+ }, rindexes_fn = function* ({ allowStale = this.allowStale } = {}) {
18793
+ if (__privateGet(this, _size)) {
18794
+ for (let i3 = __privateGet(this, _head); true; ) {
18795
+ if (!__privateMethod(this, _LRUCache_instances, isValidIndex_fn).call(this, i3)) {
18796
+ break;
18797
+ }
18798
+ if (allowStale || !__privateGet(this, _isStale).call(this, i3)) {
18799
+ yield i3;
18800
+ }
18801
+ if (i3 === __privateGet(this, _tail)) {
18802
+ break;
18803
+ } else {
18804
+ i3 = __privateGet(this, _next)[i3];
18805
+ }
18806
+ }
18807
+ }
18808
+ }, isValidIndex_fn = function(index) {
18809
+ return index !== void 0 && __privateGet(this, _keyMap).get(__privateGet(this, _keyList)[index]) === index;
18810
+ }, evict_fn = function(free) {
18811
+ var _a3, _b2;
18812
+ const head = __privateGet(this, _head);
18813
+ const k3 = __privateGet(this, _keyList)[head];
18814
+ const v2 = __privateGet(this, _valList)[head];
18815
+ if (__privateGet(this, _hasFetchMethod) && __privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2)) {
18816
+ v2.__abortController.abort(new Error("evicted"));
18817
+ } else if (__privateGet(this, _hasDispose) || __privateGet(this, _hasDisposeAfter)) {
18818
+ if (__privateGet(this, _hasDispose)) {
18819
+ (_a3 = __privateGet(this, _dispose)) == null ? void 0 : _a3.call(this, v2, k3, "evict");
18820
+ }
18821
+ if (__privateGet(this, _hasDisposeAfter)) {
18822
+ (_b2 = __privateGet(this, _disposed)) == null ? void 0 : _b2.push([v2, k3, "evict"]);
18823
+ }
18824
+ }
18825
+ __privateGet(this, _removeItemSize).call(this, head);
18826
+ if (free) {
18827
+ __privateGet(this, _keyList)[head] = void 0;
18828
+ __privateGet(this, _valList)[head] = void 0;
18829
+ __privateGet(this, _free).push(head);
18830
+ }
18831
+ if (__privateGet(this, _size) === 1) {
18832
+ __privateSet(this, _head, __privateSet(this, _tail, 0));
18833
+ __privateGet(this, _free).length = 0;
18834
+ } else {
18835
+ __privateSet(this, _head, __privateGet(this, _next)[head]);
18836
+ }
18837
+ __privateGet(this, _keyMap).delete(k3);
18838
+ __privateWrapper(this, _size)._--;
18839
+ return head;
18840
+ }, backgroundFetch_fn = function(k3, index, options, context2) {
18841
+ const v2 = index === void 0 ? void 0 : __privateGet(this, _valList)[index];
18842
+ if (__privateMethod(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v2)) {
18843
+ return v2;
18844
+ }
18845
+ const ac = new AC();
18846
+ const { signal } = options;
18847
+ signal == null ? void 0 : signal.addEventListener("abort", () => ac.abort(signal.reason), {
18848
+ signal: ac.signal
18849
+ });
18850
+ const fetchOpts = {
18851
+ signal: ac.signal,
18852
+ options,
18853
+ context: context2
18854
+ };
18855
+ const cb = (v22, updateCache = false) => {
18856
+ const { aborted } = ac.signal;
18857
+ const ignoreAbort = options.ignoreFetchAbort && v22 !== void 0;
18858
+ if (options.status) {
18859
+ if (aborted && !updateCache) {
18860
+ options.status.fetchAborted = true;
18861
+ options.status.fetchError = ac.signal.reason;
18862
+ if (ignoreAbort)
18863
+ options.status.fetchAbortIgnored = true;
18864
+ } else {
18865
+ options.status.fetchResolved = true;
18866
+ }
18867
+ }
18868
+ if (aborted && !ignoreAbort && !updateCache) {
18869
+ return fetchFail(ac.signal.reason);
18870
+ }
18871
+ const bf2 = p2;
18872
+ if (__privateGet(this, _valList)[index] === p2) {
18873
+ if (v22 === void 0) {
18874
+ if (bf2.__staleWhileFetching) {
18875
+ __privateGet(this, _valList)[index] = bf2.__staleWhileFetching;
18876
+ } else {
18877
+ this.delete(k3);
18878
+ }
18879
+ } else {
18880
+ if (options.status)
18881
+ options.status.fetchUpdated = true;
18882
+ this.set(k3, v22, fetchOpts.options);
18883
+ }
18884
+ }
18885
+ return v22;
18886
+ };
18887
+ const eb = (er2) => {
18888
+ if (options.status) {
18889
+ options.status.fetchRejected = true;
18890
+ options.status.fetchError = er2;
18891
+ }
18892
+ return fetchFail(er2);
18893
+ };
18894
+ const fetchFail = (er2) => {
18895
+ const { aborted } = ac.signal;
18896
+ const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
18897
+ const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
18898
+ const noDelete = allowStale || options.noDeleteOnFetchRejection;
18899
+ const bf2 = p2;
18900
+ if (__privateGet(this, _valList)[index] === p2) {
18901
+ const del2 = !noDelete || bf2.__staleWhileFetching === void 0;
18902
+ if (del2) {
18903
+ this.delete(k3);
18904
+ } else if (!allowStaleAborted) {
18905
+ __privateGet(this, _valList)[index] = bf2.__staleWhileFetching;
18906
+ }
18907
+ }
18908
+ if (allowStale) {
18909
+ if (options.status && bf2.__staleWhileFetching !== void 0) {
18910
+ options.status.returnedStale = true;
18911
+ }
18912
+ return bf2.__staleWhileFetching;
18913
+ } else if (bf2.__returned === bf2) {
18914
+ throw er2;
18915
+ }
18916
+ };
18917
+ const pcall = (res, rej) => {
18918
+ var _a3;
18919
+ const fmp = (_a3 = __privateGet(this, _fetchMethod)) == null ? void 0 : _a3.call(this, k3, v2, fetchOpts);
18920
+ if (fmp && fmp instanceof Promise) {
18921
+ fmp.then((v22) => res(v22 === void 0 ? void 0 : v22), rej);
18922
+ }
18923
+ ac.signal.addEventListener("abort", () => {
18924
+ if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
18925
+ res(void 0);
18926
+ if (options.allowStaleOnFetchAbort) {
18927
+ res = (v22) => cb(v22, true);
18928
+ }
18929
+ }
18930
+ });
18931
+ };
18932
+ if (options.status)
18933
+ options.status.fetchDispatched = true;
18934
+ const p2 = new Promise(pcall).then(cb, eb);
18935
+ const bf = Object.assign(p2, {
18936
+ __abortController: ac,
18937
+ __staleWhileFetching: v2,
18938
+ __returned: void 0
18939
+ });
18940
+ if (index === void 0) {
18941
+ this.set(k3, bf, { ...fetchOpts.options, status: void 0 });
18942
+ index = __privateGet(this, _keyMap).get(k3);
18943
+ } else {
18944
+ __privateGet(this, _valList)[index] = bf;
18945
+ }
18946
+ return bf;
18947
+ }, isBackgroundFetch_fn = function(p2) {
18948
+ if (!__privateGet(this, _hasFetchMethod))
18949
+ return false;
18950
+ const b3 = p2;
18951
+ return !!b3 && b3 instanceof Promise && b3.hasOwnProperty("__staleWhileFetching") && b3.__abortController instanceof AC;
18952
+ }, connect_fn = function(p2, n2) {
18953
+ __privateGet(this, _prev)[n2] = p2;
18954
+ __privateGet(this, _next)[p2] = n2;
18955
+ }, moveToTail_fn = function(index) {
18956
+ if (index !== __privateGet(this, _tail)) {
18957
+ if (index === __privateGet(this, _head)) {
18958
+ __privateSet(this, _head, __privateGet(this, _next)[index]);
18959
+ } else {
18960
+ __privateMethod(this, _LRUCache_instances, connect_fn).call(this, __privateGet(this, _prev)[index], __privateGet(this, _next)[index]);
18961
+ }
18962
+ __privateMethod(this, _LRUCache_instances, connect_fn).call(this, __privateGet(this, _tail), index);
18963
+ __privateSet(this, _tail, index);
18964
+ }
18965
+ }, _b);
18966
+ var define_process_default$5 = {};
17938
18967
  function isWindows() {
17939
18968
  if (typeof define_process_default$5 !== "undefined") {
17940
18969
  if (define_process_default$5.platform) {
@@ -24771,11 +25800,11 @@ function ruleSearchPaths(uri, root2) {
24771
25800
  return searchPaths;
24772
25801
  }
24773
25802
  function formatRuleForPrompt(rule) {
24774
- const { title, description: description2, instruction } = PromptString.fromRule(rule);
25803
+ const { title, description, instruction } = PromptString.fromRule(rule);
24775
25804
  return PromptString.join(
24776
25805
  [
24777
25806
  ps$1`Title: ${title}`,
24778
- description2 ? ps$1`Description: ${description2}` : void 0,
25807
+ description ? ps$1`Description: ${description}` : void 0,
24779
25808
  ps$1`Instruction: ${instruction}`
24780
25809
  ].filter(isDefined),
24781
25810
  ps$1`\n`
@@ -32571,7 +33600,7 @@ function de(t3, e3, n2) {
32571
33600
  const r2 = Ot[e3];
32572
33601
  if (null !== n2 && (t3 & r2) == (n2 & r2)) return t3;
32573
33602
  let i3 = t3 ^ r2;
32574
- return "subscript" === e3 ? i3 &= ~Ot.superscript : "superscript" === e3 && (i3 &= ~Ot.subscript), i3;
33603
+ return "subscript" === e3 ? i3 &= -65 : "superscript" === e3 && (i3 &= -33), i3;
32575
33604
  }
32576
33605
  function ge(t3, e3) {
32577
33606
  if (null != e3) return void (t3.__key = e3);
@@ -36392,7 +37421,7 @@ function deserializeParagraph(s4) {
36392
37421
  "g"
36393
37422
  )
36394
37423
  );
36395
- return parts.map((part) => {
37424
+ return parts.flatMap((part) => {
36396
37425
  if (part.startsWith(AT_MENTION_SERIALIZED_PREFIX)) {
36397
37426
  try {
36398
37427
  return deserializeContextMentionItem(part);
@@ -36415,7 +37444,7 @@ function deserializeParagraph(s4) {
36415
37444
  }
36416
37445
  }
36417
37446
  if (part.includes(" ")) {
36418
- return part.split(/(\t)/).filter(Boolean).map(
37447
+ return part.split(/(\t)/).filter(Boolean).flatMap(
36419
37448
  (subPart) => subPart === " " ? {
36420
37449
  type: "tab",
36421
37450
  detail: 2,
@@ -36433,7 +37462,7 @@ function deserializeParagraph(s4) {
36433
37462
  style: "",
36434
37463
  version: 1
36435
37464
  }
36436
- ).flat();
37465
+ );
36437
37466
  }
36438
37467
  return {
36439
37468
  type: "text",
@@ -36444,7 +37473,7 @@ function deserializeParagraph(s4) {
36444
37473
  style: "",
36445
37474
  version: 1
36446
37475
  };
36447
- }).flat().filter((node) => node.text !== "");
37476
+ }).filter((node) => node.text !== "");
36448
37477
  }
36449
37478
  function createContextItemMention(item, uri) {
36450
37479
  return {
@@ -37753,29 +38782,32 @@ function empty(value) {
37753
38782
  }
37754
38783
  class Schema2 {
37755
38784
  /**
37756
- * @constructor
37757
- * @param {Properties} property
37758
- * @param {Normal} normal
37759
- * @param {string} [space]
38785
+ * @param {SchemaType['property']} property
38786
+ * Property.
38787
+ * @param {SchemaType['normal']} normal
38788
+ * Normal.
38789
+ * @param {Space | undefined} [space]
38790
+ * Space.
38791
+ * @returns
38792
+ * Schema.
37760
38793
  */
37761
38794
  constructor(property, normal, space) {
37762
- this.property = property;
37763
38795
  this.normal = normal;
38796
+ this.property = property;
37764
38797
  if (space) {
37765
38798
  this.space = space;
37766
38799
  }
37767
38800
  }
37768
38801
  }
37769
- Schema2.prototype.property = {};
37770
38802
  Schema2.prototype.normal = {};
37771
- Schema2.prototype.space = null;
38803
+ Schema2.prototype.property = {};
38804
+ Schema2.prototype.space = void 0;
37772
38805
  function merge(definitions, space) {
37773
38806
  const property = {};
37774
38807
  const normal = {};
37775
- let index = -1;
37776
- while (++index < definitions.length) {
37777
- Object.assign(property, definitions[index].property);
37778
- Object.assign(normal, definitions[index].normal);
38808
+ for (const definition of definitions) {
38809
+ Object.assign(property, definition.property);
38810
+ Object.assign(normal, definition.normal);
37779
38811
  }
37780
38812
  return new Schema2(property, normal, space);
37781
38813
  }
@@ -37784,25 +38816,30 @@ function normalize(value) {
37784
38816
  }
37785
38817
  class Info {
37786
38818
  /**
37787
- * @constructor
37788
38819
  * @param {string} property
38820
+ * Property.
37789
38821
  * @param {string} attribute
38822
+ * Attribute.
38823
+ * @returns
38824
+ * Info.
37790
38825
  */
37791
38826
  constructor(property, attribute) {
37792
- this.property = property;
37793
38827
  this.attribute = attribute;
38828
+ this.property = property;
37794
38829
  }
37795
38830
  }
37796
- Info.prototype.space = null;
37797
- Info.prototype.boolean = false;
38831
+ Info.prototype.attribute = "";
37798
38832
  Info.prototype.booleanish = false;
37799
- Info.prototype.overloadedBoolean = false;
37800
- Info.prototype.number = false;
37801
- Info.prototype.commaSeparated = false;
37802
- Info.prototype.spaceSeparated = false;
38833
+ Info.prototype.boolean = false;
37803
38834
  Info.prototype.commaOrSpaceSeparated = false;
37804
- Info.prototype.mustUseProperty = false;
38835
+ Info.prototype.commaSeparated = false;
37805
38836
  Info.prototype.defined = false;
38837
+ Info.prototype.mustUseProperty = false;
38838
+ Info.prototype.number = false;
38839
+ Info.prototype.overloadedBoolean = false;
38840
+ Info.prototype.property = "";
38841
+ Info.prototype.spaceSeparated = false;
38842
+ Info.prototype.space = void 0;
37806
38843
  let powers = 0;
37807
38844
  const boolean$1 = increment();
37808
38845
  const booleanish = increment();
@@ -37824,14 +38861,23 @@ const types$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
37824
38861
  overloadedBoolean,
37825
38862
  spaceSeparated
37826
38863
  }, Symbol.toStringTag, { value: "Module" }));
37827
- const checks = Object.keys(types$1);
38864
+ const checks = (
38865
+ /** @type {ReadonlyArray<keyof typeof types>} */
38866
+ Object.keys(types$1)
38867
+ );
37828
38868
  class DefinedInfo extends Info {
37829
38869
  /**
37830
38870
  * @constructor
37831
38871
  * @param {string} property
38872
+ * Property.
37832
38873
  * @param {string} attribute
37833
- * @param {number|null} [mask]
37834
- * @param {string} [space]
38874
+ * Attribute.
38875
+ * @param {number | null | undefined} [mask]
38876
+ * Mask.
38877
+ * @param {Space | undefined} [space]
38878
+ * Space.
38879
+ * @returns
38880
+ * Info.
37835
38881
  */
37836
38882
  constructor(property, attribute, mask, space) {
37837
38883
  let index = -1;
@@ -37851,68 +38897,26 @@ function mark(values, key, value) {
37851
38897
  values[key] = value;
37852
38898
  }
37853
38899
  }
37854
- const own = {}.hasOwnProperty;
37855
38900
  function create(definition) {
37856
- const property = {};
37857
- const normal = {};
37858
- let prop;
37859
- for (prop in definition.properties) {
37860
- if (own.call(definition.properties, prop)) {
37861
- const value = definition.properties[prop];
37862
- const info = new DefinedInfo(
37863
- prop,
37864
- definition.transform(definition.attributes || {}, prop),
37865
- value,
37866
- definition.space
37867
- );
37868
- if (definition.mustUseProperty && definition.mustUseProperty.includes(prop)) {
37869
- info.mustUseProperty = true;
37870
- }
37871
- property[prop] = info;
37872
- normal[normalize(prop)] = prop;
37873
- normal[normalize(info.attribute)] = prop;
38901
+ const properties2 = {};
38902
+ const normals = {};
38903
+ for (const [property, value] of Object.entries(definition.properties)) {
38904
+ const info = new DefinedInfo(
38905
+ property,
38906
+ definition.transform(definition.attributes || {}, property),
38907
+ value,
38908
+ definition.space
38909
+ );
38910
+ if (definition.mustUseProperty && definition.mustUseProperty.includes(property)) {
38911
+ info.mustUseProperty = true;
37874
38912
  }
38913
+ properties2[property] = info;
38914
+ normals[normalize(property)] = property;
38915
+ normals[normalize(info.attribute)] = property;
37875
38916
  }
37876
- return new Schema2(property, normal, definition.space);
38917
+ return new Schema2(properties2, normals, definition.space);
37877
38918
  }
37878
- const xlink = create({
37879
- space: "xlink",
37880
- transform(_2, prop) {
37881
- return "xlink:" + prop.slice(5).toLowerCase();
37882
- },
37883
- properties: {
37884
- xLinkActuate: null,
37885
- xLinkArcRole: null,
37886
- xLinkHref: null,
37887
- xLinkRole: null,
37888
- xLinkShow: null,
37889
- xLinkTitle: null,
37890
- xLinkType: null
37891
- }
37892
- });
37893
- const xml = create({
37894
- space: "xml",
37895
- transform(_2, prop) {
37896
- return "xml:" + prop.slice(3).toLowerCase();
37897
- },
37898
- properties: { xmlLang: null, xmlBase: null, xmlSpace: null }
37899
- });
37900
- function caseSensitiveTransform(attributes, attribute) {
37901
- return attribute in attributes ? attributes[attribute] : attribute;
37902
- }
37903
- function caseInsensitiveTransform(attributes, property) {
37904
- return caseSensitiveTransform(attributes, property.toLowerCase());
37905
- }
37906
- const xmlns = create({
37907
- space: "xmlns",
37908
- attributes: { xmlnsxlink: "xmlns:xlink" },
37909
- transform: caseInsensitiveTransform,
37910
- properties: { xmlns: null, xmlnsXLink: null }
37911
- });
37912
38919
  const aria = create({
37913
- transform(_2, prop) {
37914
- return prop === "role" ? prop : "aria-" + prop.slice(4).toLowerCase();
37915
- },
37916
38920
  properties: {
37917
38921
  ariaActiveDescendant: null,
37918
38922
  ariaAtomic: booleanish,
@@ -37963,17 +38967,24 @@ const aria = create({
37963
38967
  ariaValueNow: number$1,
37964
38968
  ariaValueText: null,
37965
38969
  role: null
38970
+ },
38971
+ transform(_2, property) {
38972
+ return property === "role" ? property : "aria-" + property.slice(4).toLowerCase();
37966
38973
  }
37967
38974
  });
38975
+ function caseSensitiveTransform(attributes, attribute) {
38976
+ return attribute in attributes ? attributes[attribute] : attribute;
38977
+ }
38978
+ function caseInsensitiveTransform(attributes, property) {
38979
+ return caseSensitiveTransform(attributes, property.toLowerCase());
38980
+ }
37968
38981
  const html$1 = create({
37969
- space: "html",
37970
38982
  attributes: {
37971
38983
  acceptcharset: "accept-charset",
37972
38984
  classname: "class",
37973
38985
  htmlfor: "for",
37974
38986
  httpequiv: "http-equiv"
37975
38987
  },
37976
- transform: caseInsensitiveTransform,
37977
38988
  mustUseProperty: ["checked", "multiple", "muted", "selected"],
37978
38989
  properties: {
37979
38990
  // Standard Properties.
@@ -38325,10 +39336,11 @@ const html$1 = create({
38325
39336
  results: number$1,
38326
39337
  security: null,
38327
39338
  unselectable: null
38328
- }
39339
+ },
39340
+ space: "html",
39341
+ transform: caseInsensitiveTransform
38329
39342
  });
38330
39343
  const svg$1 = create({
38331
- space: "svg",
38332
39344
  attributes: {
38333
39345
  accentHeight: "accent-height",
38334
39346
  alignmentBaseline: "alignment-baseline",
@@ -38504,7 +39516,6 @@ const svg$1 = create({
38504
39516
  playbackOrder: "playbackorder",
38505
39517
  timelineBegin: "timelinebegin"
38506
39518
  },
38507
- transform: caseSensitiveTransform,
38508
39519
  properties: {
38509
39520
  about: commaOrSpaceSeparated,
38510
39521
  accentHeight: number$1,
@@ -38885,14 +39896,44 @@ const svg$1 = create({
38885
39896
  yChannelSelector: null,
38886
39897
  z: null,
38887
39898
  zoomAndPan: null
39899
+ },
39900
+ space: "svg",
39901
+ transform: caseSensitiveTransform
39902
+ });
39903
+ const xlink = create({
39904
+ properties: {
39905
+ xLinkActuate: null,
39906
+ xLinkArcRole: null,
39907
+ xLinkHref: null,
39908
+ xLinkRole: null,
39909
+ xLinkShow: null,
39910
+ xLinkTitle: null,
39911
+ xLinkType: null
39912
+ },
39913
+ space: "xlink",
39914
+ transform(_2, property) {
39915
+ return "xlink:" + property.slice(5).toLowerCase();
39916
+ }
39917
+ });
39918
+ const xmlns = create({
39919
+ attributes: { xmlnsxlink: "xmlns:xlink" },
39920
+ properties: { xmlnsXLink: null, xmlns: null },
39921
+ space: "xmlns",
39922
+ transform: caseInsensitiveTransform
39923
+ });
39924
+ const xml = create({
39925
+ properties: { xmlBase: null, xmlLang: null, xmlSpace: null },
39926
+ space: "xml",
39927
+ transform(_2, property) {
39928
+ return "xml:" + property.slice(3).toLowerCase();
38888
39929
  }
38889
39930
  });
38890
- const valid = /^data[-\w.:]+$/i;
38891
- const dash = /-[a-z]/g;
38892
39931
  const cap = /[A-Z]/g;
39932
+ const dash = /-[a-z]/g;
39933
+ const valid = /^data[-\w.:]+$/i;
38893
39934
  function find(schema2, value) {
38894
39935
  const normal = normalize(value);
38895
- let prop = value;
39936
+ let property = value;
38896
39937
  let Type = Info;
38897
39938
  if (normal in schema2.normal) {
38898
39939
  return schema2.property[schema2.normal[normal]];
@@ -38900,7 +39941,7 @@ function find(schema2, value) {
38900
39941
  if (normal.length > 4 && normal.slice(0, 4) === "data" && valid.test(value)) {
38901
39942
  if (value.charAt(4) === "-") {
38902
39943
  const rest = value.slice(5).replace(dash, camelcase);
38903
- prop = "data" + rest.charAt(0).toUpperCase() + rest.slice(1);
39944
+ property = "data" + rest.charAt(0).toUpperCase() + rest.slice(1);
38904
39945
  } else {
38905
39946
  const rest = value.slice(4);
38906
39947
  if (!dash.test(rest)) {
@@ -38913,7 +39954,7 @@ function find(schema2, value) {
38913
39954
  }
38914
39955
  Type = DefinedInfo;
38915
39956
  }
38916
- return new Type(prop, value);
39957
+ return new Type(property, value);
38917
39958
  }
38918
39959
  function kebab($0) {
38919
39960
  return "-" + $0.toLowerCase();
@@ -38921,8 +39962,8 @@ function kebab($0) {
38921
39962
  function camelcase($0) {
38922
39963
  return $0.charAt(1).toUpperCase();
38923
39964
  }
38924
- const html = merge([xml, xlink, xmlns, aria, html$1], "html");
38925
- const svg = merge([xml, xlink, xmlns, aria, svg$1], "svg");
39965
+ const html = merge([aria, html$1, xlink, xmlns, xml], "html");
39966
+ const svg = merge([aria, svg$1, xlink, xmlns, xml], "svg");
38926
39967
  function stringify(values) {
38927
39968
  return values.join(" ").trim();
38928
39969
  }
@@ -39058,7 +40099,7 @@ function getRelativeChatPeriod(date) {
39058
40099
  const amount = Math.floor(seconds / 2592e3);
39059
40100
  return `${amount} month${amount !== 1 ? "s" : ""} ago`;
39060
40101
  }
39061
- var main$1 = {};
40102
+ var main = {};
39062
40103
  var ril = {};
39063
40104
  var api = {};
39064
40105
  var messages = {};
@@ -42032,8 +43073,8 @@ ril.default = RIL;
42032
43073
  return (0, api_12.createMessageConnection)(reader, writer, logger, options);
42033
43074
  }
42034
43075
  exports.createMessageConnection = createMessageConnection;
42035
- })(main$1);
42036
- var browser$1 = main$1;
43076
+ })(main);
43077
+ var browser = main;
42037
43078
  function spawn() {
42038
43079
  throw new Error("not implemented");
42039
43080
  }
@@ -42478,7 +43519,7 @@ const native = {
42478
43519
  randomUUID
42479
43520
  };
42480
43521
  function v4(options, buf, offset) {
42481
- if (native.randomUUID && !buf && !options) {
43522
+ if (native.randomUUID && true && !options) {
42482
43523
  return native.randomUUID();
42483
43524
  }
42484
43525
  options = options || {};
@@ -43614,941 +44655,11 @@ var camelCase = createCompounder(function(result, word, index) {
43614
44655
  });
43615
44656
  var camelCase_1 = camelCase;
43616
44657
  const camelCase$1 = /* @__PURE__ */ getDefaultExportFromCjs(camelCase_1);
43617
- const $schema = "package.schema.json";
43618
44658
  const name = "cody-ai";
43619
- const displayName = "Cody: AI Code Assistant";
43620
- const version = "1.70.2";
44659
+ const version = "1.70.3";
43621
44660
  const publisher = "sourcegraph";
43622
- const license = "Apache-2.0";
43623
- const icon = "resources/sourcegraph.png";
43624
- const description = "Sourcegraph’s AI code assistant goes beyond individual dev productivity, helping enterprises achieve consistency and quality at scale with AI. & codebase context to help you write code faster. Cody brings you autocomplete, chat, and commands, so you can generate code, write unit tests, create docs, and explain complex code using AI. Choose from the best LLMs, including GPT-4o and Claude 3.5 Sonnet.";
43625
- const scripts = {
43626
- "build:root": "pnpm -C .. run -s build",
43627
- postinstall: "pnpm download-wasm && pnpm download-fonts && pnpm copy-win-ca-roots",
43628
- dev: "pnpm run -s dev:desktop",
43629
- "dev:insiders": "pnpm run -s dev:desktop:insiders",
43630
- "start:dev:desktop": "NODE_ENV=development code --extensionDevelopmentPath=$PWD --disable-extension=sourcegraph.cody-ai --disable-extension=github.copilot --inspect-extensions=9333 --new-window . --goto ./src/completions/inline-completion-item-provider.ts:16:5",
43631
- "dev:desktop": "pnpm run -s build:dev:desktop && pnpm run start:dev:desktop",
43632
- "dev:desktop:insiders": "pnpm run -s build:dev:desktop && NODE_ENV=development code-insiders --extensionDevelopmentPath=$PWD --disable-extension=sourcegraph.cody-ai --disable-extension=github.copilot --inspect-extensions=9333 --new-window . --goto ./src/completions/inline-completion-item-provider.ts:16:5",
43633
- "dev:web": "pnpm run -s build:dev:web && pnpm run -s _dev:vscode-test-web --browserType none",
43634
- "watch:dev:web": 'concurrently "pnpm run -s watch:build:dev:web" "pnpm run -s _dev:vscode-test-web --browserType none"',
43635
- "_dev:vscode-test-web": "vscode-test-web --extensionDevelopmentPath=. ${WORKSPACE-test/fixtures/workspace}",
43636
- build: "pnpm run -s check:build && tsc --build && pnpm run -s _build:esbuild:desktop && pnpm run -s _build:esbuild:web && pnpm run -s _build:webviews --mode production && pnpm run measure-bundle-size",
43637
- "check:build": "pnpm run -s check:typehacks && pnpm run -s check:manifest",
43638
- "check:typehacks": "ts-node-transpile-only ./scripts/enable-typehacks.ts && tsc -p tsconfig.typehacks.json",
43639
- "check:manifest": "ts-node-transpile-only ./scripts/validate-package-json.ts",
43640
- "_build:desktop": "pnpm run -s _build:esbuild:desktop && pnpm run -s _build:webviews --mode production",
43641
- "_build:web": "pnpm run -s _build:esbuild:web && pnpm run -s _build:webviews --mode production",
43642
- "build:dev:desktop": 'concurrently "pnpm run -s _build:esbuild:desktop" "pnpm run -s _build:webviews --mode development"',
43643
- "build:dev:web": 'concurrently "pnpm run -s _build:esbuild:web" "pnpm run -s _build:webviews --mode development"',
43644
- "build:prod:webviews": "pnpm run -s _build:webviews --mode production",
43645
- "watch:build:dev:web": 'concurrently "pnpm run -s _build:esbuild:web --watch" "pnpm run -s _build:webviews --mode development --watch"',
43646
- "watch:build:dev:desktop": 'concurrently "pnpm run -s _build:esbuild:desktop --watch" "pnpm run -s _build:webviews --mode development --watch"',
43647
- "_build:esbuild:desktop": "pnpm download-wasm && pnpm download-fonts && pnpm run -s _build:esbuild:uninstall && pnpm run -s _build:esbuild:node",
43648
- "_build:esbuild:node": "esbuild ./src/extension.node.ts --bundle --outfile=dist/extension.node.js --loader:.node=copy --external:vscode --external:typescript --alias:@sourcegraph/cody-shared=@sourcegraph/cody-shared/src/index --alias:@sourcegraph/cody-shared/src=@sourcegraph/cody-shared/src --alias:lexical=./build/lexical-package-fix --format=cjs --platform=node --sourcemap --target=es2022",
43649
- "_build:esbuild:web": `esbuild ./src/extension.web.ts --platform=browser --bundle --outfile=dist/extension.web.js --alias:@sourcegraph/cody-shared=@sourcegraph/cody-shared/src/index --alias:@sourcegraph/cody-shared/src=@sourcegraph/cody-shared/src --alias:path=path-browserify --external:typescript --alias:node:path=path-browserify --alias:node:os=os-browserify --alias:os=os-browserify --external:vscode --external:node:child_process --external:node:util --external:node:fs --external:node:fs/promises --external:node:process --define:process='{"env":{}}' --define:window=self --format=cjs --sourcemap`,
43650
- "_build:esbuild:uninstall": "node ./uninstall/esbuild.mjs",
43651
- "_build:webviews": "vite -c webviews/vite.config.mts build",
43652
- "_build:vsix_for_test": "vsce package --no-dependencies --out dist/cody.e2e.vsix",
43653
- release: "ts-node-transpile-only ./scripts/release.ts",
43654
- "download-wasm": "ts-node-transpile-only ./scripts/download-wasm-modules.ts",
43655
- "download-fonts": "ts-node-transpile-only ./scripts/download-fonts.ts",
43656
- "copy-win-ca-roots": "ts-node-transpile-only ./scripts/copy-win-ca-roots.ts",
43657
- "release:dry-run": "pnpm run download-wasm && pnpm run download-fonts && CODY_RELEASE_DRY_RUN=1 ts-node ./scripts/release.ts",
43658
- storybook: "storybook dev -p 6007 --no-open --no-version-updates",
43659
- "test:e2e": "playwright install && tsc --build && node dist/tsc/test/e2e/install-deps.js && pnpm run -s _build:vsix_for_test && pnpm run -s build:dev:desktop && pnpm run -s test:e2e:run",
43660
- "test:e2e:run": "playwright test",
43661
- "test:e2e2": "pnpm -s test:e2e2:deps && pnpm -s build:root && pnpm -s build:dev:desktop && pnpm -s test:e2e2:run",
43662
- "test:e2e2:run": "playwright test -c playwright.v2.config.ts",
43663
- "test:e2e2:deps": "playwright install chromium --with-deps",
43664
- "test:integration": "tsc --build ./test/integration && pnpm run -s build:dev:desktop && node --inspect -r ts-node/register dist/tsc/test/integration/main.js",
43665
- "test:unit": "vitest",
43666
- bench: "vitest bench",
43667
- "vscode:prepublish": "pnpm -s run build",
43668
- "vscode:uninstall": "node ./dist/post-uninstall.js",
43669
- "test:unit:tree-sitter-queries": "vitest ./src/tree-sitter/query-tests/*.test.ts",
43670
- "github-changelog": "ts-node-transpile-only ./scripts/github-changelog.ts",
43671
- "measure-bundle-size": "cross-env LOG_BUNDLE_SIZE=true ts-node-transpile-only ./scripts/measure-bundle-size.ts"
43672
- };
43673
- const categories = [
43674
- "AI",
43675
- "Chat",
43676
- "Programming Languages",
43677
- "Machine Learning",
43678
- "Snippets",
43679
- "Education"
43680
- ];
43681
- const keywords = [
43682
- "cody",
43683
- "codey",
43684
- "sourcegraph",
43685
- "chop",
43686
- "autocomplete",
43687
- "chat",
43688
- "chatbot",
43689
- "codegen",
43690
- "code completion",
43691
- "code analysis",
43692
- "code generation",
43693
- "documentation",
43694
- "refactor",
43695
- "test",
43696
- "generate",
43697
- "openai",
43698
- "anthropic",
43699
- "gemini",
43700
- "gpt-4",
43701
- "claude",
43702
- "intellisense",
43703
- "openai",
43704
- "ai",
43705
- "assistant",
43706
- "llm",
43707
- "bot",
43708
- "model",
43709
- "typescript",
43710
- "javascript",
43711
- "python",
43712
- "golang",
43713
- "rust",
43714
- "go",
43715
- "html",
43716
- "css",
43717
- "java",
43718
- "php",
43719
- "swift",
43720
- "kotlin",
43721
- "ollama"
43722
- ];
43723
- const repository = {
43724
- type: "git",
43725
- url: "https://github.com/sourcegraph/cody",
43726
- directory: "vscode"
43727
- };
43728
- const bugs = {
43729
- url: "https://github.com/sourcegraph/cody/issues"
43730
- };
43731
- const homepage = "https://sourcegraph.com/docs/cody";
43732
- const badges = [
43733
- {
43734
- url: "https://img.shields.io/discord/969688426372825169?color=5765F2",
43735
- href: "https://srcgr.ph/discord",
43736
- description: "Discord"
43737
- }
43738
- ];
43739
- const engines = {
43740
- vscode: "^1.79.0",
43741
- node: ">=20.0.0"
43742
- };
43743
- const main = "./dist/extension.node.js";
43744
- const browser = "./dist/extension.web.js";
43745
- const activationEvents = [
43746
- "onLanguage",
43747
- "onStartupFinished",
43748
- "onWebviewPanel:cody.editorPanel"
43749
- ];
43750
44661
  const contributes = {
43751
- walkthroughs: [
43752
- {
43753
- id: "welcome",
43754
- title: "Getting Started with Cody",
43755
- description: "Discover how Cody can help you write, understand and fix code faster",
43756
- steps: [
43757
- {
43758
- id: "autocomplete",
43759
- title: "Code Autocomplete",
43760
- description: "Start writing code and Cody will complete the line (or the entire function) for you. Hit tab to accept the suggestion.",
43761
- media: {
43762
- markdown: "walkthroughs/autocomplete.md"
43763
- }
43764
- },
43765
- {
43766
- id: "chat",
43767
- title: "Cody Chat",
43768
- description: "Answer questions about general programming topics, or specific to your codebase, with Cody chat.\n[Open Chat](command:cody.chat.newEditorPanel)",
43769
- media: {
43770
- markdown: "walkthroughs/chat.md"
43771
- }
43772
- },
43773
- {
43774
- id: "edit",
43775
- title: "Edit Code",
43776
- description: "Ask Cody to perform code edits with your instructions.",
43777
- media: {
43778
- markdown: "walkthroughs/edit.md"
43779
- }
43780
- },
43781
- {
43782
- id: "fix",
43783
- title: "Fix Code",
43784
- description: "Use Cody to fix or explain problems in your code.",
43785
- media: {
43786
- markdown: "walkthroughs/fix.md"
43787
- }
43788
- },
43789
- {
43790
- id: "commands",
43791
- title: "Cody Commands",
43792
- description: "Discover all the built-in Cody commands, and create your own custom commands.\n[Show Commands](command:cody.menu.commands)",
43793
- media: {
43794
- markdown: "walkthroughs/commands.md"
43795
- }
43796
- },
43797
- {
43798
- id: "keyboard",
43799
- title: "Keyboard Shortcuts",
43800
- description: "Easily customize the default keyboard shortcuts to suit your workflow.\n[Show Keyboard Shortcuts Editor](command:cody.sidebar.keyboardShortcuts)",
43801
- media: {
43802
- markdown: "walkthroughs/keyboard.md"
43803
- }
43804
- },
43805
- {
43806
- id: "ollama",
43807
- title: "Ollama (Experimental)",
43808
- description: "Learn how to use your local models with Cody.",
43809
- media: {
43810
- markdown: "walkthroughs/ollama.md"
43811
- }
43812
- }
43813
- ]
43814
- }
43815
- ],
43816
- colors: [
43817
- {
43818
- id: "cody.fixup.conflictBackground",
43819
- description: "The background of text Cody will edit where there is a specific conflict with your changes.",
43820
- defaults: {
43821
- light: "mergeEditor.conflictingLines.background",
43822
- dark: "mergeEditor.conflictingLines.background"
43823
- }
43824
- },
43825
- {
43826
- id: "cody.fixup.conflictBorder",
43827
- description: "The border of text Cody will edit, if there is a conflict with your changes.",
43828
- defaults: {
43829
- light: "mergeEditor.conflict.unhandledFocused.border",
43830
- dark: "mergeEditor.conflict.unhandledFocused.border"
43831
- }
43832
- },
43833
- {
43834
- id: "cody.fixup.conflictedBackground",
43835
- description: "The background of text Cody will edit, if there is a conflict with your changes.",
43836
- defaults: {
43837
- light: "#ffffff00",
43838
- dark: "#00000000"
43839
- }
43840
- },
43841
- {
43842
- id: "cody.fixup.conflictedBorder",
43843
- description: "The border of text Cody will edit, if there is a conflict with your changes.",
43844
- defaults: {
43845
- light: "mergeEditor.conflict.unhandledUnfocused.border",
43846
- dark: "mergeEditor.conflict.unhandledUnfocused.border"
43847
- }
43848
- },
43849
- {
43850
- id: "cody.fixup.incomingBackground",
43851
- description: "The background of text Cody will edit.",
43852
- defaults: {
43853
- light: "merge.incomingContentBackground",
43854
- dark: "merge.incomingContentBackground"
43855
- }
43856
- },
43857
- {
43858
- id: "cody.fixup.incomingBorder",
43859
- description: "The border around text Cody will edit.",
43860
- defaults: {
43861
- light: "#436EB1",
43862
- dark: "#436EB1"
43863
- }
43864
- }
43865
- ],
43866
- viewsContainers: {
43867
- activitybar: [
43868
- {
43869
- id: "cody",
43870
- title: "Cody",
43871
- icon: "resources/cody.svg"
43872
- }
43873
- ]
43874
- },
43875
- views: {
43876
- cody: [
43877
- {
43878
- type: "webview",
43879
- id: "cody.chat",
43880
- name: "Chat"
43881
- }
43882
- ]
43883
- },
43884
- commands: [
43885
- {
43886
- command: "cody.welcome",
43887
- title: "Getting Started Guide",
43888
- category: "Cody",
43889
- group: "Cody",
43890
- icon: "$(book)"
43891
- },
43892
- {
43893
- command: "cody.feedback",
43894
- title: "Feedback",
43895
- category: "Cody",
43896
- group: "Cody",
43897
- icon: "$(feedback)"
43898
- },
43899
- {
43900
- command: "cody.command.explain-output",
43901
- title: "Ask Cody to Explain",
43902
- category: "Cody Command",
43903
- icon: "$(cody-logo)",
43904
- enablement: "cody.activated && terminalTabsSingularSelection"
43905
- },
43906
- {
43907
- command: "cody.command.edit-code",
43908
- category: "Cody Command",
43909
- title: "Edit Code",
43910
- enablement: "cody.activated",
43911
- icon: "$(wand)"
43912
- },
43913
- {
43914
- command: "cody.command.explain-code",
43915
- category: "Cody Command",
43916
- title: "Explain Code",
43917
- icon: "$(output)",
43918
- enablement: "cody.activated"
43919
- },
43920
- {
43921
- command: "cody.command.unit-tests",
43922
- category: "Cody Command",
43923
- title: "Generate Unit Tests",
43924
- icon: "$(package)",
43925
- enablement: "cody.activated"
43926
- },
43927
- {
43928
- command: "cody.command.document-code",
43929
- category: "Cody Command",
43930
- title: "Document Code",
43931
- icon: "$(book)",
43932
- enablement: "cody.activated"
43933
- },
43934
- {
43935
- command: "cody.command.smell-code",
43936
- category: "Cody Command",
43937
- title: "Find Code Smells",
43938
- icon: "$(checklist)",
43939
- enablement: "cody.activated"
43940
- },
43941
- {
43942
- command: "cody.menu.custom-commands",
43943
- category: "Cody Menu",
43944
- title: "Custom Commands",
43945
- icon: "$(tools)",
43946
- enablement: "cody.activated && workspaceFolderCount > 0"
43947
- },
43948
- {
43949
- command: "cody.menu.commands-settings",
43950
- category: "Cody Settings",
43951
- title: "Custom Commands Settings",
43952
- icon: "$(gear)",
43953
- enablement: "cody.activated"
43954
- },
43955
- {
43956
- command: "cody.command.explain-history",
43957
- category: "Cody Command",
43958
- title: "Explain Code History",
43959
- enablement: "cody.activated && config.cody.experimental.noodle"
43960
- },
43961
- {
43962
- command: "cody.command.generate-commit",
43963
- category: "Cody Command",
43964
- group: "Commit",
43965
- title: "Generate Commit Message (Experimental)",
43966
- icon: "$(cody-logo)",
43967
- when: "cody.activated && config.git.enabled && !cody.isGeneratingCommit"
43968
- },
43969
- {
43970
- command: "cody.command.abort-commit",
43971
- category: "Cody Command",
43972
- group: "Commit",
43973
- title: "Stop Generating",
43974
- icon: "$(debug-stop)",
43975
- when: "cody.activated && cody.isGeneratingCommit"
43976
- },
43977
- {
43978
- command: "cody.auth.signout",
43979
- category: "Cody",
43980
- title: "Sign Out",
43981
- icon: "$(sign-out)",
43982
- enablement: "cody.activated"
43983
- },
43984
- {
43985
- command: "cody.auth.signin",
43986
- category: "Cody",
43987
- title: "Switch Account…"
43988
- },
43989
- {
43990
- command: "cody.auth.refresh",
43991
- category: "Cody",
43992
- title: "Refresh Settings (Debug)",
43993
- enablement: "config.cody.internal.unstable"
43994
- },
43995
- {
43996
- command: "cody.auth.requestEndpointSettings",
43997
- category: "Cody",
43998
- title: "Schedule export endpoint settings to Sourcegraph plugin"
43999
- },
44000
- {
44001
- command: "cody.settings.extension",
44002
- category: "Cody",
44003
- title: "Extension Settings",
44004
- group: "Cody",
44005
- icon: "$(gear)"
44006
- },
44007
- {
44008
- command: "cody.settings.extension.chat",
44009
- category: "Cody",
44010
- title: "Chat Settings",
44011
- group: "Cody",
44012
- icon: "$(gear)"
44013
- },
44014
- {
44015
- command: "cody.status-bar.interacted",
44016
- category: "Cody",
44017
- title: "Cody Settings",
44018
- group: "Cody",
44019
- icon: "$(settings-gear)",
44020
- enablement: "cody.activated"
44021
- },
44022
- {
44023
- command: "cody.show-page",
44024
- category: "Cody",
44025
- title: "Open Account Page",
44026
- group: "Cody",
44027
- enablement: "cody.activated"
44028
- },
44029
- {
44030
- command: "cody.menu.commands",
44031
- category: "Cody Menu",
44032
- title: "Cody Commands",
44033
- enablement: "cody.activated",
44034
- icon: "$(cody-logo)"
44035
- },
44036
- {
44037
- command: "cody.autocomplete.openTraceView",
44038
- category: "Cody",
44039
- title: "Open Autocomplete Trace View",
44040
- enablement: "cody.activated && config.cody.suggestions.mode === 'autocomplete'"
44041
- },
44042
- {
44043
- command: "cody.autocomplete.manual-trigger",
44044
- category: "Cody",
44045
- title: "Trigger Autocomplete at Cursor",
44046
- enablement: "cody.activated && config.cody.suggestions.mode === 'autocomplete' && !editorReadonly && !editorHasSelection && !inlineSuggestionsVisible"
44047
- },
44048
- {
44049
- command: "cody.chat.signIn",
44050
- category: "Cody",
44051
- group: "Cody",
44052
- title: "Sign In",
44053
- enablement: "!cody.activated"
44054
- },
44055
- {
44056
- command: "cody.chat.new",
44057
- category: "Cody",
44058
- title: "New Chat",
44059
- enablement: "cody.activated",
44060
- group: "Cody",
44061
- icon: "$(new-comment-icon)"
44062
- },
44063
- {
44064
- command: "cody.chat.newEditorPanel",
44065
- category: "Cody",
44066
- title: "New Chat in Editor",
44067
- enablement: "cody.activated",
44068
- group: "Cody",
44069
- icon: "$(new-comment-icon)"
44070
- },
44071
- {
44072
- command: "cody.chat.newPanel",
44073
- category: "Cody",
44074
- group: "Cody",
44075
- title: "New Chat in Sidebar",
44076
- enablement: "cody.activated",
44077
- icon: "$(new-comment-icon)"
44078
- },
44079
- {
44080
- command: "cody.chat.moveFromEditor",
44081
- category: "Cody",
44082
- title: "Move Chat from Editor to Main Cody Panel",
44083
- when: "cody.activated && view == cody.chat",
44084
- enablement: "cody.activated",
44085
- group: "Cody",
44086
- icon: "$(layout-sidebar-left)"
44087
- },
44088
- {
44089
- command: "cody.chat.view.popOut",
44090
- category: "Cody",
44091
- title: "Pop out",
44092
- enablement: "cody.activated",
44093
- group: "Cody",
44094
- icon: "$(link-external)"
44095
- },
44096
- {
44097
- command: "cody.chat.history.clear",
44098
- category: "Cody",
44099
- title: "Delete All Chats",
44100
- group: "Cody",
44101
- icon: "$(trash)",
44102
- enablement: "cody.activated"
44103
- },
44104
- {
44105
- command: "cody.chat.history.delete",
44106
- category: "Cody",
44107
- title: "Delete Chat",
44108
- group: "Cody",
44109
- icon: "$(trash)",
44110
- enablement: "cody.activated"
44111
- },
44112
- {
44113
- command: "cody.chat.history.export",
44114
- category: "Cody",
44115
- title: "Export Chats as JSON",
44116
- group: "Cody",
44117
- icon: "$(arrow-circle-down)",
44118
- enablement: "cody.activated"
44119
- },
44120
- {
44121
- command: "cody.chat.history.panel",
44122
- category: "Cody",
44123
- title: "Chat History",
44124
- group: "Cody",
44125
- icon: "$(list-unordered)",
44126
- enablement: "cody.activated"
44127
- },
44128
- {
44129
- command: "cody.search.index-update",
44130
- category: "Cody",
44131
- group: "Cody",
44132
- title: "Update search index for current workspace folder",
44133
- icon: "$(refresh)",
44134
- enablement: "cody.activated"
44135
- },
44136
- {
44137
- command: "cody.mention.selection",
44138
- category: "Cody",
44139
- group: "Chat",
44140
- title: "Add Selection to Cody Chat",
44141
- icon: "$(mention)",
44142
- enablement: "cody.activated && editorHasSelection"
44143
- },
44144
- {
44145
- command: "cody.mention.file",
44146
- category: "Cody",
44147
- group: "Chat",
44148
- title: "Add File to Cody Chat",
44149
- icon: "$(mention)",
44150
- enablement: "cody.activated && resourceSet"
44151
- },
44152
- {
44153
- command: "cody.debug.export.logs",
44154
- category: "Cody Debug",
44155
- group: "Debug",
44156
- title: "Export Logs…"
44157
- },
44158
- {
44159
- command: "cody.debug.outputChannel",
44160
- category: "Cody Debug",
44161
- group: "Debug",
44162
- title: "Open Output Channel"
44163
- },
44164
- {
44165
- command: "cody.debug.enable.all",
44166
- category: "Cody Debug",
44167
- group: "Debug",
44168
- title: "Enable Debug Mode",
44169
- enablement: "!config.cody.debug.verbose"
44170
- },
44171
- {
44172
- command: "cody.debug.reportIssue",
44173
- category: "Cody Debug",
44174
- group: "Debug",
44175
- title: "Report Issue"
44176
- },
44177
- {
44178
- command: "cody.copy.version",
44179
- category: "Cody Debug",
44180
- group: "Debug",
44181
- icon: "$(copy)",
44182
- title: "Copy Cody Extension Version"
44183
- },
44184
- {
44185
- command: "cody.debug.logCharacterCounters",
44186
- title: "[Internal] Log character logger counters",
44187
- category: "Cody Debug",
44188
- group: "Debug",
44189
- when: "cody.activated"
44190
- },
44191
- {
44192
- command: "cody.test.set-context-filters",
44193
- title: "[Internal] Set Context Filters Overwrite",
44194
- enablement: "cody.activated && cody.devOrTest"
44195
- },
44196
- {
44197
- command: "cody.command.insertCodeToCursor",
44198
- title: "Insert Code at Cursor",
44199
- enablement: "cody.activated"
44200
- },
44201
- {
44202
- command: "cody.command.insertCodeToNewFile",
44203
- title: "Save Code to New File...",
44204
- enablement: "cody.activated"
44205
- },
44206
- {
44207
- command: "cody.command.autoedit-manual-trigger",
44208
- title: "Autoedits Manual Trigger",
44209
- enablement: "cody.activated && config.cody.suggestions.mode == 'auto-edit (Experimental)'"
44210
- }
44211
- ],
44212
- keybindings: [
44213
- {
44214
- command: "cody.chat.signIn",
44215
- key: "alt+l",
44216
- when: "!cody.activated"
44217
- },
44218
- {
44219
- command: "cody.chat.signIn",
44220
- key: "alt+k",
44221
- when: "!cody.activated"
44222
- },
44223
- {
44224
- command: "cody.chat.toggle",
44225
- key: "alt+l",
44226
- when: "cody.activated"
44227
- },
44228
- {
44229
- command: "cody.mention.selection",
44230
- key: "alt+l",
44231
- when: "cody.activated && editorTextFocus && editorHasSelection"
44232
- },
44233
- {
44234
- command: "cody.chat.new",
44235
- key: "shift+alt+/",
44236
- when: "cody.activated && !editorTextFocus"
44237
- },
44238
- {
44239
- command: "cody.tutorial.chat",
44240
- key: "alt+l",
44241
- when: "cody.activated && cody.tutorialActive"
44242
- },
44243
- {
44244
- command: "cody.command.edit-code",
44245
- key: "alt+k",
44246
- when: "cody.activated && !editorReadonly"
44247
- },
44248
- {
44249
- command: "cody.command.execute-prompt",
44250
- key: "shift+alt+p",
44251
- when: "cody.activated"
44252
- },
44253
- {
44254
- command: "cody.tutorial.edit",
44255
- key: "alt+k",
44256
- when: "cody.activated && !editorReadonly && cody.tutorialActive"
44257
- },
44258
- {
44259
- command: "cody.command.document-code",
44260
- key: "alt+d",
44261
- when: "cody.activated && !editorReadonly"
44262
- },
44263
- {
44264
- command: "cody.menu.commands",
44265
- key: "alt+c",
44266
- mac: "alt+c",
44267
- when: "cody.activated"
44268
- },
44269
- {
44270
- command: "cody.menu.custom-commands",
44271
- key: "shift+alt+c",
44272
- when: "cody.activated"
44273
- },
44274
- {
44275
- command: "-github.copilot.generate",
44276
- key: "ctrl+enter"
44277
- },
44278
- {
44279
- command: "-extension.vim_tab",
44280
- key: "tab",
44281
- when: "editorTextFocus && vim.active && vim.mode == 'Normal' && !inDebugRepl"
44282
- },
44283
- {
44284
- command: "cody.autocomplete.manual-trigger",
44285
- key: "alt+\\",
44286
- when: "editorTextFocus && !editorHasSelection && config.cody.suggestions.mode === 'autocomplete' && !inlineSuggestionsVisible"
44287
- },
44288
- {
44289
- command: "cody.fixup.acceptNearest",
44290
- key: "alt+a",
44291
- when: "cody.activated && !editorReadonly && cody.hasActionableEdit"
44292
- },
44293
- {
44294
- command: "cody.fixup.retryNearest",
44295
- key: "alt+r",
44296
- when: "cody.activated && !editorReadonly && cody.hasActionableEdit"
44297
- },
44298
- {
44299
- command: "cody.show.lastUsedActions",
44300
- key: "alt+p",
44301
- when: "cody.activated && !editorReadonly"
44302
- },
44303
- {
44304
- command: "cody.fixup.undoNearest",
44305
- key: "alt+x",
44306
- when: "cody.activated && !editorReadonly && cody.hasActionableEdit"
44307
- },
44308
- {
44309
- command: "cody.fixup.cancelNearest",
44310
- key: "alt+z",
44311
- when: "cody.activated && !editorReadonly && cody.hasActionableEdit"
44312
- },
44313
- {
44314
- command: "cody.supercompletion.jumpTo",
44315
- args: [
44316
- "next"
44317
- ],
44318
- key: "shift+ctrl+down",
44319
- when: "cody.activated && !editorReadonly && cody.hasActionableSupercompletion"
44320
- },
44321
- {
44322
- command: "cody.supercompletion.jumpTo",
44323
- args: [
44324
- "previous"
44325
- ],
44326
- key: "shift+ctrl+up",
44327
- when: "cody.activated && !editorReadonly && cody.hasActionableSupercompletion"
44328
- },
44329
- {
44330
- command: "cody.supersuggest.accept",
44331
- key: "tab",
44332
- when: "editorTextFocus && cody.activated && cody.supersuggest.active"
44333
- },
44334
- {
44335
- command: "cody.supersuggest.dismiss",
44336
- key: "escape",
44337
- when: "editorTextFocus && cody.activated && cody.supersuggest.active"
44338
- },
44339
- {
44340
- command: "cody.supersuggest.testExample",
44341
- key: "ctrl+alt+enter",
44342
- when: "cody.activated && config.cody.suggestions.mode == 'auto-edit (Experimental)'"
44343
- }
44344
- ],
44345
- submenus: [
44346
- {
44347
- label: "Cody",
44348
- id: "cody.submenu"
44349
- }
44350
- ],
44351
- menus: {
44352
- commandPalette: [
44353
- {
44354
- command: "cody.command.edit-code",
44355
- when: "cody.activated && editorIsOpen"
44356
- },
44357
- {
44358
- command: "cody.command.explain-code",
44359
- when: "cody.activated && editorIsOpen"
44360
- },
44361
- {
44362
- command: "cody.command.smell-code",
44363
- when: "cody.activated && editorIsOpen"
44364
- },
44365
- {
44366
- command: "cody.command.unit-tests",
44367
- when: "cody.activated && editorIsOpen"
44368
- },
44369
- {
44370
- command: "cody.command.document-code",
44371
- when: "cody.activated && editorIsOpen"
44372
- },
44373
- {
44374
- command: "cody.command.explain-history",
44375
- when: "cody.activated && editorIsOpen && config.cody.experimental.noodle"
44376
- },
44377
- {
44378
- command: "cody.command.generate-commit",
44379
- when: "cody.activated && config.git.enabled && !cody.isGeneratingCommit"
44380
- },
44381
- {
44382
- command: "cody.command.abort-commit",
44383
- when: "cody.activated && cody.isGeneratingCommit"
44384
- },
44385
- {
44386
- command: "cody.chat.signIn",
44387
- when: "!cody.activated"
44388
- },
44389
- {
44390
- command: "cody.show-page",
44391
- when: "false"
44392
- },
44393
- {
44394
- command: "cody.test.set-context-filters",
44395
- when: "cody.activated && cody.devOrTest"
44396
- },
44397
- {
44398
- command: "cody.chat.view.popOut",
44399
- when: "false",
44400
- _comment: "Hidden because it is only a wrapper around the workspace pop out command and would place any editor tab (not just Cody chat) in a new window."
44401
- },
44402
- {
44403
- command: "cody.command.explain-output",
44404
- when: "false"
44405
- },
44406
- {
44407
- command: "cody.chat.newEditorPanel",
44408
- when: "cody.activated"
44409
- }
44410
- ],
44411
- "editor/context": [
44412
- {
44413
- submenu: "cody.submenu",
44414
- group: "0_cody"
44415
- }
44416
- ],
44417
- "cody.submenu": [
44418
- {
44419
- command: "cody.mention.selection",
44420
- group: "0_cody",
44421
- when: "cody.activated && editorHasSelection"
44422
- },
44423
- {
44424
- command: "cody.mention.file",
44425
- group: "0_cody",
44426
- when: "cody.activated && !editorHasSelection"
44427
- },
44428
- {
44429
- command: "cody.chat.newEditorPanel",
44430
- when: "cody.activated && !editorHasSelection",
44431
- group: "ask"
44432
- },
44433
- {
44434
- command: "cody.command.explain-code",
44435
- when: "cody.activated",
44436
- group: "command"
44437
- },
44438
- {
44439
- command: "cody.command.explain-history",
44440
- when: "cody.activated && editorTextFocus && config.cody.experimental.noodle",
44441
- group: "command"
44442
- },
44443
- {
44444
- command: "cody.command.edit-code",
44445
- when: "cody.activated",
44446
- group: "ask"
44447
- },
44448
- {
44449
- command: "cody.command.unit-tests",
44450
- when: "cody.activated",
44451
- group: "command"
44452
- },
44453
- {
44454
- command: "cody.command.document-code",
44455
- when: "cody.activated",
44456
- group: "command"
44457
- },
44458
- {
44459
- command: "cody.command.smell-code",
44460
- when: "cody.activated",
44461
- group: "command"
44462
- },
44463
- {
44464
- command: "cody.menu.custom-commands",
44465
- when: "cody.activated && cody.menu.custom-commands.enable",
44466
- group: "custom-commands"
44467
- },
44468
- {
44469
- command: "cody.chat.signIn",
44470
- when: "!cody.activated",
44471
- group: "other"
44472
- }
44473
- ],
44474
- "view/title": [
44475
- {
44476
- command: "cody.menu.commands",
44477
- when: "view == cody.chat && cody.activated",
44478
- group: "navigation@1"
44479
- }
44480
- ],
44481
- "editor/title": [
44482
- {
44483
- command: "cody.menu.commands",
44484
- when: "cody.activated && !editorReadonly && (resourceScheme == file || activeWebviewPanelId == cody.editorPanel)",
44485
- group: "navigation",
44486
- visibility: "visible"
44487
- },
44488
- {
44489
- command: "cody.chat.moveFromEditor",
44490
- when: "activeWebviewPanelId == cody.editorPanel && cody.activated",
44491
- group: "navigation@1",
44492
- visibility: "visible"
44493
- },
44494
- {
44495
- command: "cody.chat.newEditorPanel",
44496
- when: "activeWebviewPanelId == cody.editorPanel && cody.activated",
44497
- group: "navigation@2",
44498
- visibility: "visible"
44499
- },
44500
- {
44501
- command: "cody.chat.history.panel",
44502
- when: "activeWebviewPanelId == cody.editorPanel && cody.activated",
44503
- group: "navigation@3",
44504
- visibility: "visible"
44505
- },
44506
- {
44507
- command: "cody.chat.view.popOut",
44508
- when: "view == cody.chat && cody.activated && !isAuxiliaryEditorPart",
44509
- group: "navigation@4",
44510
- visibility: "visible"
44511
- },
44512
- {
44513
- command: "cody.settings.extension.chat",
44514
- when: "activeWebviewPanelId == cody.editorPanel && cody.activated",
44515
- group: "navigation@5",
44516
- visibility: "visible"
44517
- }
44518
- ],
44519
- "terminal/context": [
44520
- {
44521
- command: "cody.command.explain-output",
44522
- group: "0_cody",
44523
- when: "cody.activated"
44524
- }
44525
- ],
44526
- "scm/title": [
44527
- {
44528
- command: "cody.command.generate-commit",
44529
- when: "cody.activated && config.git.enabled && scmProvider == git && !cody.isGeneratingCommit",
44530
- group: "navigation@1"
44531
- },
44532
- {
44533
- command: "cody.command.abort-commit",
44534
- when: "cody.activated && scmProvider == git && cody.isGeneratingCommit",
44535
- group: "navigation@1"
44536
- }
44537
- ],
44538
- "webview/context": [
44539
- {
44540
- command: "cody.command.insertCodeToCursor",
44541
- when: "webviewSection == 'codeblock-actions'"
44542
- },
44543
- {
44544
- command: "cody.command.insertCodeToNewFile",
44545
- when: "webviewSection == 'codeblock-actions'"
44546
- }
44547
- ]
44548
- },
44549
44662
  configuration: {
44550
- type: "object",
44551
- title: "Cody",
44552
44663
  properties: {
44553
44664
  "cody.serverEndpoint": {
44554
44665
  order: 1,
@@ -44701,9 +44812,9 @@ const contributes = {
44701
44812
  ],
44702
44813
  enumDescriptions: [
44703
44814
  "Sends usage data and errors.",
44704
- "Disables all extension telemetry."
44815
+ "[Enterprise-only] Disables all extension telemetry."
44705
44816
  ],
44706
- markdownDescription: "Controls the telemetry about Cody usage and errors. See [Cody usage and privacy notice](https://about.sourcegraph.com/terms/cody-notice).",
44817
+ markdownDescription: "Controls the telemetry about Cody usage and errors for users connected to Enterprise instances. This setting only takes effect for Sourcegraph Enterprise users. For users connected to sourcegraph.com, this option is always enabled. See [Cody usage and privacy notice](https://about.sourcegraph.com/terms/cody-notice).",
44707
44818
  "default": "all"
44708
44819
  },
44709
44820
  "cody.autocomplete.advanced.provider": {
@@ -44982,280 +45093,12 @@ const contributes = {
44982
45093
  "default": []
44983
45094
  }
44984
45095
  }
44985
- },
44986
- icons: {
44987
- "cody-logo": {
44988
- description: "Cody logo",
44989
- "default": {
44990
- fontPath: "resources/cody-icons.woff",
44991
- fontCharacter: "\\0041"
44992
- }
44993
- },
44994
- "cody-logo-heavy": {
44995
- description: "Cody logo heavy",
44996
- "default": {
44997
- fontPath: "resources/cody-icons.woff",
44998
- fontCharacter: "\\0042"
44999
- }
45000
- },
45001
- "anthropic-logo": {
45002
- description: "Anthropic logo",
45003
- "default": {
45004
- fontPath: "resources/cody-icons.woff",
45005
- fontCharacter: "\\0043"
45006
- }
45007
- },
45008
- "openai-logo": {
45009
- description: "OpenAI logo",
45010
- "default": {
45011
- fontPath: "resources/cody-icons.woff",
45012
- fontCharacter: "\\0044"
45013
- }
45014
- },
45015
- "mistral-logo": {
45016
- description: "Mistral logo",
45017
- "default": {
45018
- fontPath: "resources/cody-icons.woff",
45019
- fontCharacter: "\\0045"
45020
- }
45021
- },
45022
- "ollama-logo": {
45023
- description: "Ollama logo",
45024
- "default": {
45025
- fontPath: "resources/cody-icons.woff",
45026
- fontCharacter: "\\0046"
45027
- }
45028
- },
45029
- "gemini-logo": {
45030
- description: "Gemini logo",
45031
- "default": {
45032
- fontPath: "resources/cody-icons.woff",
45033
- fontCharacter: "\\0047"
45034
- }
45035
- },
45036
- "new-comment-icon": {
45037
- description: "New comment icon",
45038
- "default": {
45039
- fontPath: "resources/cody-icons.woff",
45040
- fontCharacter: "\\0048"
45041
- }
45042
- },
45043
- "discord-logo": {
45044
- description: "Discord logo",
45045
- "default": {
45046
- fontPath: "resources/cody-icons.woff",
45047
- fontCharacter: "\\0049"
45048
- }
45049
- },
45050
- "cody-logo-heavy-slash": {
45051
- description: "Cody logo heavy slash",
45052
- "default": {
45053
- fontPath: "resources/cody-icons.woff",
45054
- fontCharacter: "\\004A"
45055
- }
45056
- }
45057
45096
  }
45058
45097
  };
45059
- const capabilities = {
45060
- untrustedWorkspaces: {
45061
- supported: "limited",
45062
- description: "Cody only uses providers (configured in `openctx.providers`) from trusted workspaces because providers may execute arbitrary code.",
45063
- restrictedConfigurations: [
45064
- "openctx.providers"
45065
- ]
45066
- }
45067
- };
45068
- const dependencies = {
45069
- "@anthropic-ai/sdk": "^0.33.1",
45070
- "@openctx/provider-linear-issues": "^0.0.9",
45071
- "@openctx/vscode-lib": "^0.0.26",
45072
- "@opentelemetry/api": "^1.7.0",
45073
- "@opentelemetry/core": "^1.18.1",
45074
- "@opentelemetry/exporter-trace-otlp-http": "^0.45.1",
45075
- "@opentelemetry/instrumentation": "^0.45.1",
45076
- "@opentelemetry/instrumentation-http": "^0.45.1",
45077
- "@opentelemetry/resources": "^1.18.1",
45078
- "@opentelemetry/sdk-trace-base": "^1.18.1",
45079
- "@opentelemetry/sdk-trace-node": "^1.18.1",
45080
- "@opentelemetry/semantic-conventions": "^1.18.1",
45081
- "@radix-ui/react-accordion": "^1.2.0",
45082
- "@radix-ui/react-collapsible": "^1.1.0",
45083
- "@radix-ui/react-dialog": "^1.0.5",
45084
- "@radix-ui/react-form": "^0.1.0",
45085
- "@radix-ui/react-label": "^2.1.1",
45086
- "@radix-ui/react-popover": "^1.0.7",
45087
- "@radix-ui/react-progress": "^1.1.0",
45088
- "@radix-ui/react-slot": "^1.0.2",
45089
- "@radix-ui/react-switch": "^1.1.2",
45090
- "@radix-ui/react-tabs": "^1.1.0",
45091
- "@radix-ui/react-tooltip": "^1.0.7",
45092
- "@sentry/browser": "^7.107.0",
45093
- "@sentry/core": "^7.107.0",
45094
- "@sentry/node": "^7.107.0",
45095
- "@sourcegraph/cody-noxide": "workspace:*",
45096
- "@sourcegraph/cody-shared": "workspace:*",
45097
- "@sourcegraph/prompt-editor": "workspace:*",
45098
- "@sourcegraph/tree-sitter-wasms": "^0.1.9",
45099
- "@types/he": "^1.2.3",
45100
- "@types/mdast": "^4.0.4",
45101
- "@types/react": "18.2.79",
45102
- "@types/react-dom": "18.2.25",
45103
- "@vscode/codicons": "^0.0.35",
45104
- "agent-base": "^7.1.1",
45105
- "async-mutex": "^0.4.0",
45106
- axios: "^1.3.6",
45107
- "canvaskit-wasm": "^0.39.1",
45108
- "class-variance-authority": "^0.7.0",
45109
- classnames: "^2.5.1",
45110
- clsx: "^2.1.1",
45111
- cmdk: "^1.0.0",
45112
- "crypto-js": "^4.2.0",
45113
- "detect-indent": "7.0.0",
45114
- diff: "^5.2.0",
45115
- "fast-myers-diff": "^3.2.0",
45116
- "fast-xml-parser": "^4.3.2",
45117
- fzf: "^0.5.2",
45118
- glob: "^7.2.3",
45119
- "graceful-fs": "^4.2.11",
45120
- he: "^1.2.0",
45121
- "highlight.js": "11.8.0",
45122
- hpagent: "^1.2.0",
45123
- ini: "^4.1.2",
45124
- "js-levenshtein": "^1.1.6",
45125
- lexical: "^0.17.0",
45126
- lodash: "^4.17.21",
45127
- "lru-cache": "^10.0.0",
45128
- "lucide-react": "^0.378.0",
45129
- "mac-ca": "^2.0.3",
45130
- marked: "^4.0.16",
45131
- mkdirp: "^3.0.1",
45132
- "os-browserify": "^0.3.0",
45133
- "postcss-scss": "^4.0.9",
45134
- "proxy-agent": "^6.4.0",
45135
- "react-intersection-observer": "^9.13.1",
45136
- "react-markdown": "^9.0.1",
45137
- "rehype-highlight": "^6.0.0",
45138
- "rehype-sanitize": "^6.0.0",
45139
- "remark-gfm": "^4.0.0",
45140
- "safe-stable-stringify": "^2.5.0",
45141
- semver: "^7.5.4",
45142
- shiki: "^1.26.1",
45143
- "signal-exit": "^4.1.0",
45144
- "socks-proxy-agent": "^8.0.1",
45145
- "tailwind-merge": "^2.3.0",
45146
- tailwindcss: "^3.4.3",
45147
- unified: "^11.0.5",
45148
- "unist-util-visit": "^5.0.0",
45149
- unzipper: "^0.10.14",
45150
- uuid: "^9.0.0",
45151
- valibot: "1.0.0-beta.9",
45152
- "vscode-languageserver-textdocument": "^1.0.8",
45153
- "vscode-uri": "^3.0.8",
45154
- "wink-nlp-utils": "^2.1.0"
45155
- };
45156
- const devDependencies = {
45157
- "7zip-min": "^1.4.5",
45158
- "@google-cloud/pubsub": "^3.7.3",
45159
- "@npmcli/promise-spawn": "^7.0.2",
45160
- "@playwright/test": "1.47.2",
45161
- "@pollyjs/adapter": "^6.0.6",
45162
- "@pollyjs/adapter-node-http": "^6.0.6",
45163
- "@pollyjs/core": "^6.0.6",
45164
- "@pollyjs/persister": "^6.0.6",
45165
- "@pollyjs/persister-fs": "^6.0.6",
45166
- "@pollyjs/utils": "^6.0.6",
45167
- "@storybook/preview-api": "^8.0.5",
45168
- "@types/7zip-min": "^1.3.3",
45169
- "@types/crypto-js": "^4.2.2",
45170
- "@types/dedent": "^0.7.0",
45171
- "@types/diff": "^5.2.1",
45172
- "@types/express": "^4.17.17",
45173
- "@types/fs-extra": "^11.0.4",
45174
- "@types/glob": "^8.0.0",
45175
- "@types/graceful-fs": "^4.1.9",
45176
- "@types/ini": "^4.1.0",
45177
- "@types/jest-image-snapshot": "^6.4.0",
45178
- "@types/js-levenshtein": "^1.1.1",
45179
- "@types/lodash": "^4.14.195",
45180
- "@types/marked": "^5.0.0",
45181
- "@types/mocha": "^10.0.6",
45182
- "@types/node-fetch": "^2.6.4",
45183
- "@types/npmcli__promise-spawn": "^6.0.3",
45184
- "@types/on-headers": "^1.0.3",
45185
- "@types/pako": "^2.0.3",
45186
- "@types/semver": "^7.5.0",
45187
- "@types/signal-exit": "^3.0.4",
45188
- "@types/unzipper": "^0.10.7",
45189
- "@types/uuid": "^9.0.2",
45190
- "@types/vscode": "^1.79.0",
45191
- "@vscode/test-electron": "^2.4.0",
45192
- "@vscode/test-web": "^0.0.47",
45193
- "@vscode/vsce": "^2.22.0",
45194
- ajv: "^8.14.0",
45195
- "ajv-formats": "^3.0.1",
45196
- "buildkite-test-collector": "^1.7.2",
45197
- concurrently: "^8.2.0",
45198
- "cross-env": "^7.0.3",
45199
- dedent: "^0.7.0",
45200
- dotenv: "^16.4.5",
45201
- esbuild: "^0.18.20",
45202
- express: "^4.18.2",
45203
- "fast-json-stable-stringify": "^2.1.0",
45204
- "franc-min": "^6.2.0",
45205
- "fs-extra": "^11.2.0",
45206
- fuzzysort: "^2.0.4",
45207
- "http-proxy-middleware": "^3.0.0",
45208
- immer: "^10.1.1",
45209
- "jest-image-snapshot": "^6.4.0",
45210
- keytar: "^7.9.0",
45211
- "kill-sync": "^1.0.3",
45212
- mocha: "^10.2.0",
45213
- nock: "^13.5.4",
45214
- "node-fetch": "^2.6.4",
45215
- "normalize-url": "5.3.1",
45216
- "on-headers": "^1.0.2",
45217
- ovsx: "^0.8.2",
45218
- pako: "^2.1.0",
45219
- "path-browserify": "^1.0.1",
45220
- playwright: "1.47.2",
45221
- postcss: "^8.4.38",
45222
- "postcss-nested": "^6.0.1",
45223
- "react-head": "^3.4.2",
45224
- "symlink-dir": "^6.0.2",
45225
- "type-fest": "^4.26.1",
45226
- "typescript-language-server": "^4.3.3",
45227
- ulidx: "^2.3.0",
45228
- "vite-plugin-svgr": "^4.2.0",
45229
- "vscode-jsonrpc": "^8.2.0",
45230
- "vscode-languageserver-protocol": "^3.17.5",
45231
- yaml: "^2.3.4",
45232
- zod: "^3.23.8"
45233
- };
45234
45098
  const packageJson = {
45235
- $schema,
45236
45099
  name,
45237
- "private": true,
45238
- displayName,
45239
- version,
45240
45100
  publisher,
45241
- license,
45242
- icon,
45243
- description,
45244
- scripts,
45245
- categories,
45246
- keywords,
45247
- repository,
45248
- bugs,
45249
- homepage,
45250
- badges,
45251
- engines,
45252
- main,
45253
- browser,
45254
- activationEvents,
45255
- contributes,
45256
- capabilities,
45257
- dependencies,
45258
- devDependencies
45101
+ contributes
45259
45102
  };
45260
45103
  const { properties } = packageJson.contributes.configuration;
45261
45104
  function defaultConfigurationValue(key) {
@@ -45321,7 +45164,7 @@ class AgentWorkspaceConfiguration {
45321
45164
  var _a3, _b2, _c2, _d2;
45322
45165
  const section = this.actualSection(userSection);
45323
45166
  const config = this.extensionConfig();
45324
- const capabilities2 = (_a3 = this.clientInfo()) == null ? void 0 : _a3.capabilities;
45167
+ const capabilities = (_a3 = this.clientInfo()) == null ? void 0 : _a3.capabilities;
45325
45168
  const baseConfig = {
45326
45169
  editor: {
45327
45170
  insertSpaces: true
@@ -45333,7 +45176,7 @@ class AgentWorkspaceConfiguration {
45333
45176
  advanced: {
45334
45177
  agent: {
45335
45178
  capabilities: {
45336
- storage: (capabilities2 == null ? void 0 : capabilities2.globalState) === "server-managed" || (capabilities2 == null ? void 0 : capabilities2.globalState) === "client-managed"
45179
+ storage: (capabilities == null ? void 0 : capabilities.globalState) === "server-managed" || (capabilities == null ? void 0 : capabilities.globalState) === "client-managed"
45337
45180
  },
45338
45181
  extension: {
45339
45182
  version: (_b2 = this.clientInfo()) == null ? void 0 : _b2.version
@@ -45346,7 +45189,7 @@ class AgentWorkspaceConfiguration {
45346
45189
  },
45347
45190
  running: true
45348
45191
  },
45349
- hasNativeWebview: (capabilities2 == null ? void 0 : capabilities2.webview) === "native"
45192
+ hasNativeWebview: (capabilities == null ? void 0 : capabilities.webview) === "native"
45350
45193
  },
45351
45194
  autocomplete: {
45352
45195
  advanced: {
@@ -46006,7 +45849,7 @@ const _AST = class _AST {
46006
45849
  __privateSet(this, _hasMagic, void 0);
46007
45850
  return [s4, unescape$1(this.toString()), false, false];
46008
45851
  }
46009
- let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
45852
+ let bodyDotAllowed = !repeated || allowDot || dot || false ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
46010
45853
  if (bodyDotAllowed === body) {
46011
45854
  bodyDotAllowed = "";
46012
45855
  }
@@ -47017,11 +46860,6 @@ const onDidSaveTextDocument = new AgentEventEmitter();
47017
46860
  let workspaceDocuments;
47018
46861
  function setWorkspaceDocuments(newWorkspaceDocuments) {
47019
46862
  workspaceDocuments = newWorkspaceDocuments;
47020
- if (newWorkspaceDocuments.workspaceRootUri) {
47021
- if (!workspaceFolders.map((wf) => wf.uri.toString()).includes(newWorkspaceDocuments.workspaceRootUri.toString())) {
47022
- setLastOpenedWorkspaceFolder(newWorkspaceDocuments.workspaceRootUri);
47023
- }
47024
- }
47025
46863
  }
47026
46864
  function setLastOpenedWorkspaceFolder(uri) {
47027
46865
  var _a3;
@@ -47164,19 +47002,16 @@ ${workspaceFolders.map((wf) => ` - ${wf.uri.toString()}
47164
47002
  )
47165
47003
  );
47166
47004
  },
47167
- workspaceFolders,
47168
- getWorkspaceFolder: () => {
47169
- var _a3;
47170
- if ((workspaceDocuments == null ? void 0 : workspaceDocuments.workspaceRootUri) === void 0) {
47171
- throw new Error(
47172
- "workspaceDocuments is undefined. To fix this problem, make sure that the agent has been initialized."
47173
- );
47005
+ get workspaceFolders() {
47006
+ return workspaceFolders.length === 0 ? void 0 : workspaceFolders;
47007
+ },
47008
+ getWorkspaceFolder: (uri) => {
47009
+ for (const folder of workspaceFolders) {
47010
+ if (uriHasPrefix(uri, folder.uri, isWindows())) {
47011
+ return folder;
47012
+ }
47174
47013
  }
47175
- return {
47176
- uri: workspaceDocuments.workspaceRootUri,
47177
- index: 0,
47178
- name: (_a3 = workspaceDocuments.workspaceRootUri) == null ? void 0 : _a3.path
47179
- };
47014
+ return void 0;
47180
47015
  },
47181
47016
  // TODO: used by `WorkspaceRepoMapper` and will be used by `git.onDidOpenRepository`
47182
47017
  // https://github.com/sourcegraph/cody/issues/4136
@@ -47193,13 +47028,27 @@ ${workspaceFolders.map((wf) => ` - ${wf.uri.toString()}
47193
47028
  // TODO: used by persistence tracker
47194
47029
  registerTextDocumentContentProvider: () => emptyDisposable,
47195
47030
  // TODO: used by fixup controller
47196
- asRelativePath: (pathOrUri) => {
47197
- var _a3, _b2;
47031
+ asRelativePath: (pathOrUri, includeWorkspaceFolder = workspaceFolders.length > 1) => {
47198
47032
  const uri = typeof pathOrUri === "string" ? Uri.file(pathOrUri) : pathOrUri instanceof Uri ? pathOrUri : void 0;
47199
47033
  if (uri === void 0) {
47200
47034
  return `${pathOrUri}`;
47201
47035
  }
47202
- const relativePath = ((_a3 = workspaceDocuments == null ? void 0 : workspaceDocuments.workspaceRootUri) == null ? void 0 : _a3.fsPath) ? path$1.relative(((_b2 = workspaceDocuments == null ? void 0 : workspaceDocuments.workspaceRootUri) == null ? void 0 : _b2.path) ?? "", uri.path) : uri.path;
47036
+ let relativePath = void 0;
47037
+ for (const folder of workspaceFolders) {
47038
+ if (uriHasPrefix(uri, folder.uri, isWindows())) {
47039
+ const pathFunctions2 = pathFunctionsForURI(folder.uri);
47040
+ const workspacePrefix = folder.uri.path.endsWith("/") ? folder.uri.path.slice(0, -1) : folder.uri.path;
47041
+ const workspaceDisplayPrefix = includeWorkspaceFolder ? pathFunctions2.basename(folder.uri.path) + pathFunctions2.separator : "";
47042
+ relativePath = fixPathSep(
47043
+ workspaceDisplayPrefix + uri.path.slice(workspacePrefix.length + 1),
47044
+ isWindows(),
47045
+ uri.scheme
47046
+ );
47047
+ }
47048
+ }
47049
+ if (!relativePath) {
47050
+ relativePath = pathOrUri.toString();
47051
+ }
47203
47052
  return relativePath;
47204
47053
  },
47205
47054
  // TODO: used for Cody Context Filters, WorkspaceRepoMapper and custom commands
@@ -47767,16 +47616,16 @@ const _commands = {
47767
47616
  return Promise.resolve(void 0);
47768
47617
  }
47769
47618
  };
47770
- (_a2 = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _a2.call(_commands, "workbench.action.reloadWindow", () => {
47619
+ (_c = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _c.call(_commands, "workbench.action.reloadWindow", () => {
47771
47620
  });
47772
- (_b = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _b.call(_commands, "setContext", (key, value) => {
47621
+ (_d = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _d.call(_commands, "setContext", (key, value) => {
47773
47622
  if (typeof key !== "string") {
47774
47623
  throw new TypeError(`setContext: first argument must be string. Got: ${key}`);
47775
47624
  }
47776
47625
  context.set(key, value);
47777
47626
  agent == null ? void 0 : agent.notify("window/didChangeContext", { key, value: value.toString() });
47778
47627
  });
47779
- (_c = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _c.call(_commands, "vscode.executeFoldingRangeProvider", async (uri) => {
47628
+ (_e2 = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _e2.call(_commands, "vscode.executeFoldingRangeProvider", async (uri) => {
47780
47629
  const promises = [];
47781
47630
  const document2 = await _workspace.openTextDocument(uri);
47782
47631
  const token = new CancellationTokenSource2().token;
@@ -47788,16 +47637,16 @@ const _commands = {
47788
47637
  }
47789
47638
  return promises;
47790
47639
  });
47791
- (_d = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _d.call(_commands, "vscode.executeDocumentSymbolProvider", (uri) => {
47640
+ (_f = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _f.call(_commands, "vscode.executeDocumentSymbolProvider", (uri) => {
47792
47641
  return Promise.resolve([]);
47793
47642
  });
47794
- (_e2 = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _e2.call(_commands, "vscode.executeWorkspaceSymbolProvider", (query) => {
47643
+ (_g = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _g.call(_commands, "vscode.executeWorkspaceSymbolProvider", (query) => {
47795
47644
  return Promise.resolve([]);
47796
47645
  });
47797
- (_f = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _f.call(_commands, "vscode.executeFormatDocumentProvider", (uri) => {
47646
+ (_h = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _h.call(_commands, "vscode.executeFormatDocumentProvider", (uri) => {
47798
47647
  return Promise.resolve([]);
47799
47648
  });
47800
- (_g = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _g.call(
47649
+ (_i2 = _commands == null ? void 0 : _commands.registerCommand) == null ? void 0 : _i2.call(
47801
47650
  _commands,
47802
47651
  "vscode.open",
47803
47652
  async (uri, options) => {
@@ -47816,7 +47665,7 @@ const _env = {
47816
47665
  uriScheme: "file",
47817
47666
  appName: void 0,
47818
47667
  shell: void 0,
47819
- appRoot: (_h = define_process_default.cwd) == null ? void 0 : _h.call(define_process_default),
47668
+ appRoot: (_j = define_process_default.cwd) == null ? void 0 : _j.call(define_process_default),
47820
47669
  uiKind: UIKind.Desktop,
47821
47670
  language: "en-US",
47822
47671
  clipboard: {
@@ -48016,6 +47865,7 @@ const vscode = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
48016
47865
  setClientInfo,
48017
47866
  setCreateWebviewPanel,
48018
47867
  setExtensionConfiguration,
47868
+ setLastOpenedWorkspaceFolder,
48019
47869
  setWorkspaceDocuments,
48020
47870
  setWorkspaceFolders,
48021
47871
  tabGroups,
@@ -48048,79 +47898,79 @@ export {
48048
47898
  Ss as S,
48049
47899
  ThemeColor as T,
48050
47900
  Uri as U,
48051
- n as V,
48052
- ns as W,
48053
- M3 as X,
48054
- Ds as Y,
47901
+ M3 as V,
47902
+ Ds as W,
47903
+ n as X,
47904
+ ns as Y,
48055
47905
  le as Z,
48056
47906
  _s as _,
48057
47907
  window$1 as a,
48058
47908
  CONTEXT_ITEM_MENTION_NODE_TYPE as a$,
48059
- oe as a0,
48060
- z2 as a1,
48061
- yi as a2,
48062
- W as a3,
48063
- Ue as a4,
48064
- I2 as a5,
48065
- Se as a6,
48066
- O2 as a7,
48067
- F as a8,
48068
- Ni as a9,
48069
- SYMBOL_CONTEXT_MENTION_PROVIDER as aA,
48070
- REMOTE_REPOSITORY_PROVIDER_URI as aB,
47909
+ t2 as a0,
47910
+ oe as a1,
47911
+ z2 as a2,
47912
+ yi as a3,
47913
+ W as a4,
47914
+ Ue as a5,
47915
+ I2 as a6,
47916
+ Se as a7,
47917
+ O2 as a8,
47918
+ F as a9,
47919
+ WEB_PROVIDER_URI as aA,
47920
+ REMOTE_DIRECTORY_PROVIDER_URI as aB,
48071
47921
  REMOTE_FILE_PROVIDER_URI as aC,
48072
- REMOTE_DIRECTORY_PROVIDER_URI as aD,
48073
- WEB_PROVIDER_URI as aE,
48074
- RULES_PROVIDER_URI as aF,
48075
- displayPath as aG,
48076
- displayLineRange as aH,
48077
- displayPathDirname as aI,
48078
- displayPathBasename as aJ,
47922
+ REMOTE_REPOSITORY_PROVIDER_URI as aD,
47923
+ SYMBOL_CONTEXT_MENTION_PROVIDER as aE,
47924
+ FILE_CONTEXT_MENTION_PROVIDER as aF,
47925
+ displayPathBasename as aG,
47926
+ displayPath as aH,
47927
+ displayLineRange as aI,
47928
+ displayPathDirname as aJ,
48079
47929
  IGNORED_FILE_WARNING_LABEL as aK,
48080
47930
  LARGE_FILE_WARNING_LABEL as aL,
48081
- Ei as aM,
48082
- xe as aN,
47931
+ xe as aM,
47932
+ Ei as aN,
48083
47933
  V as aO,
48084
47934
  Es as aP,
48085
47935
  U as aQ,
48086
47936
  e2 as aR,
48087
47937
  Ns as aS,
48088
- object as aT,
48089
- literal as aU,
48090
- string$1 as aV,
48091
- displayPathWithLines as aW,
48092
- URI as aX,
48093
- is$2 as aY,
47938
+ displayPathWithLines as aT,
47939
+ URI as aU,
47940
+ is$2 as aV,
47941
+ object as aW,
47942
+ literal as aX,
47943
+ string$1 as aY,
48094
47944
  gs as aZ,
48095
47945
  serializeContextItem as a_,
48096
- ee as aa,
48097
- we as ab,
48098
- b2 as ac,
48099
- T2 as ad,
48100
- s3 as ae,
48101
- o as af,
48102
- w2 as ag,
48103
- i2 as ah,
48104
- k2 as ai,
48105
- D2 as aj,
48106
- p as ak,
48107
- m3 as al,
48108
- S3 as am,
48109
- v as an,
48110
- P as ao,
48111
- E2 as ap,
48112
- Wi as aq,
48113
- L2 as ar,
48114
- d3 as as,
48115
- a3 as at,
48116
- l as au,
48117
- f as av,
48118
- u2 as aw,
48119
- r as ax,
48120
- t2 as ay,
48121
- FILE_CONTEXT_MENTION_PROVIDER as az,
47946
+ Ni as aa,
47947
+ ee as ab,
47948
+ we as ac,
47949
+ b2 as ad,
47950
+ T2 as ae,
47951
+ s3 as af,
47952
+ o as ag,
47953
+ w2 as ah,
47954
+ i2 as ai,
47955
+ k2 as aj,
47956
+ D2 as ak,
47957
+ p as al,
47958
+ m3 as am,
47959
+ S3 as an,
47960
+ v as ao,
47961
+ P as ap,
47962
+ E2 as aq,
47963
+ Wi as ar,
47964
+ L2 as as,
47965
+ d3 as at,
47966
+ a3 as au,
47967
+ l as av,
47968
+ f as aw,
47969
+ u2 as ax,
47970
+ r as ay,
47971
+ RULES_PROVIDER_URI as az,
48122
47972
  workspace as b,
48123
- firstResultFromOperation as b$,
47973
+ isMacOS as b$,
48124
47974
  contextItemMentionNodeDisplayText as b0,
48125
47975
  an as b1,
48126
47976
  qr as b2,
@@ -48128,9 +47978,9 @@ export {
48128
47978
  TEMPLATE_INPUT_NODE_TYPE as b4,
48129
47979
  N as b5,
48130
47980
  parseMentionQuery as b6,
48131
- NO_SYMBOL_MATCHES_HELP_LABEL as b7,
48132
- FILE_RANGE_TOOLTIP_LABEL as b8,
48133
- Observable as b9,
47981
+ FILE_RANGE_TOOLTIP_LABEL as b7,
47982
+ NO_SYMBOL_MATCHES_HELP_LABEL as b8,
47983
+ createExtensionAPI as b9,
48134
47984
  stringify$1 as bA,
48135
47985
  stringify as bB,
48136
47986
  ccount as bC,
@@ -48138,28 +47988,28 @@ export {
48138
47988
  CodyIDE as bE,
48139
47989
  CodyTaskState as bF,
48140
47990
  cryptoJsExports as bG,
48141
- isError as bH,
48142
- RateLimitError as bI,
48143
- upperFirst$2 as bJ,
48144
- lodashExports as bK,
48145
- createContextItem as bL,
48146
- isDefined as bM,
48147
- isCodeSearchContextItem as bN,
48148
- reformatBotMessageForChat as bO,
48149
- isAbortErrorOrSocketHangUp as bP,
48150
- ModelTag as bQ,
48151
- DeepCodyAgentID as bR,
48152
- serializedPromptEditorStateFromChatMessage as bS,
48153
- contextItemsFromPromptEditorValue as bT,
48154
- filterContextItemsFromPromptEditorValue as bU,
48155
- CustomCommandType as bV,
48156
- View as bW,
48157
- isCodyProModel as bX,
48158
- ToolCodyModelName as bY,
48159
- getRelativeChatPeriod as bZ,
48160
- isMacOS as b_,
48161
- createExtensionAPI as ba,
48162
- createMessageAPIForWebview as bb,
47991
+ LRUCache$1 as bH,
47992
+ isError as bI,
47993
+ RateLimitError as bJ,
47994
+ upperFirst$2 as bK,
47995
+ lodashExports as bL,
47996
+ createContextItem as bM,
47997
+ isDefined as bN,
47998
+ isCodeSearchContextItem as bO,
47999
+ reformatBotMessageForChat as bP,
48000
+ isAbortErrorOrSocketHangUp as bQ,
48001
+ ModelTag as bR,
48002
+ DeepCodyAgentID as bS,
48003
+ serializedPromptEditorStateFromChatMessage as bT,
48004
+ contextItemsFromPromptEditorValue as bU,
48005
+ filterContextItemsFromPromptEditorValue as bV,
48006
+ CustomCommandType as bW,
48007
+ View as bX,
48008
+ isCodyProModel as bY,
48009
+ ToolCodyModelName as bZ,
48010
+ getRelativeChatPeriod as b_,
48011
+ createMessageAPIForWebview as ba,
48012
+ Observable as bb,
48163
48013
  debounce$1 as bc,
48164
48014
  memoizeLastValue as bd,
48165
48015
  toSerializedPromptEditorValue as be,
@@ -48185,336 +48035,337 @@ export {
48185
48035
  whitespace as by,
48186
48036
  find as bz,
48187
48037
  commands as c,
48188
- tap as c$,
48189
- ENTERPRISE_STARTER_LEARN_MORE_URL as c0,
48190
- CODY_PRO_SUBSCRIPTION_URL as c1,
48191
- ACCOUNT_USAGE_URL as c2,
48192
- ENTERPRISE_STARTER_PRICING_URL as c3,
48193
- textContentFromSerializedLexicalNode as c4,
48194
- firstValueFrom as c5,
48195
- skipPendingOperation as c6,
48196
- FAST_CHAT_INPUT_TOKEN_BUDGET as c7,
48197
- webviewOpenURIForContextItem as c8,
48198
- pluralize as c9,
48199
- logError as cA,
48200
- semver$1 as cB,
48201
- pendingOperation as cC,
48202
- pick as cD,
48203
- getModelInfo as cE,
48204
- CHAT_INPUT_TOKEN_BUDGET as cF,
48038
+ shareReplay as c$,
48039
+ firstResultFromOperation as c0,
48040
+ ENTERPRISE_STARTER_LEARN_MORE_URL as c1,
48041
+ CODY_PRO_SUBSCRIPTION_URL as c2,
48042
+ ACCOUNT_USAGE_URL as c3,
48043
+ ENTERPRISE_STARTER_PRICING_URL as c4,
48044
+ textContentFromSerializedLexicalNode as c5,
48045
+ firstValueFrom as c6,
48046
+ skipPendingOperation as c7,
48047
+ FAST_CHAT_INPUT_TOKEN_BUDGET as c8,
48048
+ webviewOpenURIForContextItem as c9,
48049
+ startWith as cA,
48050
+ switchMap as cB,
48051
+ promiseFactoryToObservable as cC,
48052
+ retry as cD,
48053
+ pick as cE,
48054
+ getModelInfo as cF,
48205
48055
  CHAT_OUTPUT_TOKEN_BUDGET as cG,
48206
- EXTENDED_CHAT_INPUT_TOKEN_BUDGET as cH,
48207
- EXTENDED_USER_CONTEXT_TOKEN_BUDGET as cI,
48208
- TRANSIENT_REFETCH_INTERVAL_HINT as cJ,
48209
- createSubscriber as cK,
48210
- fromVSCodeEvent as cL,
48211
- cenv as cM,
48212
- EXCLUDE_EVERYTHING_CONTEXT_FILTERS as cN,
48213
- currentAuthStatus as cO,
48214
- isFileURI as cP,
48215
- INCLUDE_EVERYTHING_CONTEXT_FILTERS as cQ,
48216
- onAbort as cR,
48217
- addCodyClientIdentificationHeaders as cS,
48218
- addTraceparent as cT,
48219
- addAuthHeaders as cU,
48220
- fetch as cV,
48221
- verifyResponseCode as cW,
48222
- combineLatest as cX,
48223
- take as cY,
48224
- clientCapabilities as cZ,
48225
- shareReplay as c_,
48226
- serializedPromptEditorStateFromText as ca,
48056
+ CHAT_INPUT_TOKEN_BUDGET as cH,
48057
+ EXTENDED_CHAT_INPUT_TOKEN_BUDGET as cI,
48058
+ EXTENDED_USER_CONTEXT_TOKEN_BUDGET as cJ,
48059
+ TRANSIENT_REFETCH_INTERVAL_HINT as cK,
48060
+ createSubscriber as cL,
48061
+ fromVSCodeEvent as cM,
48062
+ cenv as cN,
48063
+ EXCLUDE_EVERYTHING_CONTEXT_FILTERS as cO,
48064
+ currentAuthStatus as cP,
48065
+ isFileURI as cQ,
48066
+ INCLUDE_EVERYTHING_CONTEXT_FILTERS as cR,
48067
+ onAbort as cS,
48068
+ addCodyClientIdentificationHeaders as cT,
48069
+ addTraceparent as cU,
48070
+ addAuthHeaders as cV,
48071
+ fetch as cW,
48072
+ verifyResponseCode as cX,
48073
+ combineLatest as cY,
48074
+ take as cZ,
48075
+ clientCapabilities as c_,
48076
+ pluralize as ca,
48227
48077
  deserializeContextItem as cb,
48228
- S2_URL as cc,
48229
- browser$1 as cd,
48230
- CodyAutoSuggestionMode as ce,
48231
- isErrorLike as cf,
48232
- PromptString as cg,
48233
- setDisplayPathEnvInfo as ch,
48234
- serialize as ci,
48235
- deserialize as cj,
48236
- unsubscribe as ck,
48078
+ serializedPromptEditorStateFromText as cc,
48079
+ S2_URL as cd,
48080
+ browser as ce,
48081
+ CodyAutoSuggestionMode as cf,
48082
+ isErrorLike as cg,
48083
+ PromptString as ch,
48084
+ setDisplayPathEnvInfo as ci,
48085
+ serialize as cj,
48086
+ deserialize as ck,
48237
48087
  AsyncSerialScheduler$1 as cl,
48238
- authStatus as cm,
48239
- debounceTime as cn,
48240
- switchMapReplayOperation as co,
48241
- interval as cp,
48088
+ unsubscribe as cm,
48089
+ authStatus as cn,
48090
+ debounceTime as co,
48091
+ switchMapReplayOperation as cp,
48242
48092
  map$1 as cq,
48243
- filter$1 as cr,
48244
- startWith as cs,
48245
- switchMap as ct,
48246
- promiseFactoryToObservable as cu,
48247
- retry as cv,
48248
- distinctUntilChanged as cw,
48249
- logDebug as cx,
48250
- graphqlClient as cy,
48251
- isAbortError as cz,
48093
+ distinctUntilChanged as cr,
48094
+ filter$1 as cs,
48095
+ pendingOperation as ct,
48096
+ logDebug as cu,
48097
+ graphqlClient as cv,
48098
+ isAbortError as cw,
48099
+ logError as cx,
48100
+ semver$1 as cy,
48101
+ interval as cz,
48252
48102
  ps$1 as d,
48253
- withLatestFrom as d$,
48254
- featureFlagProvider as d0,
48255
- getExperimentalClientModelByFeatureFlag as d1,
48256
- TOOL_CODY_MODEL as d2,
48257
- getEnterpriseContextWindow as d3,
48258
- ANSWER_TOKENS as d4,
48259
- storeLastValue as d5,
48260
- resolvedConfig as d6,
48261
- userProductSubscription as d7,
48262
- isEnterpriseUser as d8,
48263
- currentResolvedConfig as d9,
48103
+ setExtensionVersion as d$,
48104
+ tap as d0,
48105
+ featureFlagProvider as d1,
48106
+ getExperimentalClientModelByFeatureFlag as d2,
48107
+ TOOL_CODY_MODEL as d3,
48108
+ getEnterpriseContextWindow as d4,
48109
+ ANSWER_TOKENS as d5,
48110
+ storeLastValue as d6,
48111
+ resolvedConfig as d7,
48112
+ userProductSubscription as d8,
48113
+ isEnterpriseUser as d9,
48264
48114
  isObjectLike_1 as dA,
48265
- _copyObject as dB,
48266
- keysIn_1 as dC,
48267
- _cloneBufferExports as dD,
48268
- _cloneTypedArray as dE,
48269
- _copyArray as dF,
48270
- _initCloneObject as dG,
48271
- isArguments_1 as dH,
48272
- isArray_1 as dI,
48273
- isBufferExports as dJ,
48274
- isFunction_1 as dK,
48275
- isObject_1 as dL,
48276
- isPlainObject_1 as dM,
48277
- isTypedArray_1 as dN,
48278
- _Stack as dO,
48279
- identity_1 as dP,
48280
- _overRest as dQ,
48281
- _setToString as dR,
48282
- _isIndex as dS,
48283
- v4 as dT,
48284
- CONFIG_KEY as dU,
48285
- ConfigurationTarget as dV,
48286
- pathBrowserify as dW,
48287
- stat as dX,
48288
- extensions as dY,
48289
- version as dZ,
48290
- setExtensionVersion as d_,
48291
- CORPUS_CONTEXT_ALLOCATION as da,
48292
- isCustomModel as db,
48293
- recordErrorToSpan as dc,
48294
- addClientInfoParams as dd,
48295
- dependentAbortController as de,
48296
- isS2 as df,
48297
- GIT_OPENCTX_PROVIDER_URI as dg,
48115
+ isArrayLike_1 as dB,
48116
+ _copyObject as dC,
48117
+ keysIn_1 as dD,
48118
+ isBufferExports as dE,
48119
+ isTypedArray_1 as dF,
48120
+ isArray_1 as dG,
48121
+ _copyArray as dH,
48122
+ _cloneBufferExports as dI,
48123
+ _cloneTypedArray as dJ,
48124
+ isPlainObject_1 as dK,
48125
+ isArguments_1 as dL,
48126
+ isObject_1 as dM,
48127
+ isFunction_1 as dN,
48128
+ _initCloneObject as dO,
48129
+ _Stack as dP,
48130
+ _setToString as dQ,
48131
+ _overRest as dR,
48132
+ identity_1 as dS,
48133
+ _isIndex as dT,
48134
+ v4 as dU,
48135
+ CONFIG_KEY as dV,
48136
+ ConfigurationTarget as dW,
48137
+ pathBrowserify as dX,
48138
+ stat as dY,
48139
+ extensions as dZ,
48140
+ version as d_,
48141
+ currentResolvedConfig as da,
48142
+ CORPUS_CONTEXT_ALLOCATION as db,
48143
+ isCustomModel as dc,
48144
+ recordErrorToSpan as dd,
48145
+ addClientInfoParams as de,
48146
+ dependentAbortController as df,
48147
+ isS2 as dg,
48298
48148
  CODE_SEARCH_PROVIDER_URI as dh,
48299
- currentOpenCtxController as di,
48300
- MulticastSubject as dj,
48301
- AsyncSerialScheduler_1 as dk,
48302
- vscode as dl,
48303
- Selection as dm,
48149
+ GIT_OPENCTX_PROVIDER_URI as di,
48150
+ currentOpenCtxController as dj,
48151
+ MulticastSubject as dk,
48152
+ AsyncSerialScheduler_1 as dl,
48153
+ vscode as dm,
48304
48154
  AgentEventEmitter as dn,
48305
- MarkdownString as dp,
48306
- TextEditorRevealType as dq,
48307
- ThemeIcon as dr,
48308
- StatusBarAlignment as ds,
48309
- readFile as dt,
48310
- env as du,
48311
- UIKind as dv,
48312
- InvalidAccessTokenError as dw,
48313
- _baseAssignValue as dx,
48155
+ Selection as dp,
48156
+ MarkdownString as dq,
48157
+ TextEditorRevealType as dr,
48158
+ ThemeIcon as ds,
48159
+ StatusBarAlignment as dt,
48160
+ readFile as du,
48161
+ env as dv,
48162
+ UIKind as dw,
48163
+ InvalidAccessTokenError as dx,
48314
48164
  eq_1$1 as dy,
48315
- isArrayLike_1 as dz,
48165
+ _baseAssignValue as dz,
48316
48166
  dedent as e,
48317
- escapeRegExp$1 as e$,
48318
- NEVER as e0,
48319
- abortableOperation as e1,
48320
- isNeedsAuthChallengeError as e2,
48321
- EMPTY as e3,
48322
- disposableSubscription as e4,
48323
- setAuthStatusObservable as e5,
48324
- DOTCOM_URL as e6,
48167
+ getEditorInsertSpaces as e$,
48168
+ setAuthStatusObservable as e0,
48169
+ withLatestFrom as e1,
48170
+ abortableOperation as e2,
48171
+ disposableSubscription as e3,
48172
+ DOTCOM_URL as e4,
48173
+ NEVER as e5,
48174
+ normalizeServerEndpointURL as e6,
48325
48175
  isInvalidAccessTokenError as e7,
48326
- normalizeServerEndpointURL as e8,
48327
- isEnterpriseUserDotComError as e9,
48328
- FoldingRange as eA,
48329
- CancellationTokenSource2 as eB,
48330
- SymbolKind as eC,
48331
- convertGitCloneURLToCodebaseName as eD,
48332
- pluck as eE,
48333
- toRangeData as eF,
48334
- DefaultChatCommands as eG,
48335
- pathFunctionsForURI as eH,
48336
- uriParseNameAndExtension as eI,
48337
- uriDirname as eJ,
48338
- Utils as eK,
48339
- uriExtname as eL,
48340
- uriBasename as eM,
48341
- DefaultEditCommands as eN,
48342
- subscriptionDisposable as eO,
48343
- NoOpTelemetryRecorderProvider as eP,
48344
- TimestampTelemetryProcessor_1 as eQ,
48345
- updateGlobalTelemetryInstances as eR,
48346
- TelemetryRecorderProvider as eS,
48347
- telemetryRecorderProvider as eT,
48348
- createGitDiff as eU,
48349
- catchError as eV,
48350
- AgentWorkspaceEdit as eW,
48351
- TextDocumentChangeReason as eX,
48352
- omit$1 as eY,
48353
- displayPathWithoutWorkspaceFolderPrefix as eZ,
48354
- getEditorInsertSpaces as e_,
48355
- ProgressLocation as ea,
48356
- AuthConfigError as eb,
48357
- SourcegraphGraphQLAPIClient as ec,
48358
- isExternalProviderAuthError as ed,
48359
- isNetworkLikeError as ee,
48360
- NeedsAuthChallengeError as ef,
48361
- AvailabilityError as eg,
48362
- EnterpriseUserDotComError as eh,
48363
- resolveAuth as ei,
48364
- QuickPickItemKind as ej,
48365
- isWorkspaceInstance as ek,
48366
- getAuthHeaders as el,
48367
- SUPPORTED_URI_SCHEMAS as em,
48368
- _baseIsEqual as en,
48369
- keys_1 as eo,
48370
- _baseGet as ep,
48371
- _castPath as eq,
48372
- isLength_1 as er,
48176
+ isEnterpriseUserDotComError as e8,
48177
+ isNeedsAuthChallengeError as e9,
48178
+ FileType as eA,
48179
+ FoldingRange as eB,
48180
+ CancellationTokenSource2 as eC,
48181
+ SymbolKind as eD,
48182
+ convertGitCloneURLToCodebaseName as eE,
48183
+ pluck as eF,
48184
+ toRangeData as eG,
48185
+ DefaultChatCommands as eH,
48186
+ pathFunctionsForURI as eI,
48187
+ uriParseNameAndExtension as eJ,
48188
+ uriDirname as eK,
48189
+ Utils as eL,
48190
+ uriExtname as eM,
48191
+ uriBasename as eN,
48192
+ DefaultEditCommands as eO,
48193
+ subscriptionDisposable as eP,
48194
+ NoOpTelemetryRecorderProvider as eQ,
48195
+ TimestampTelemetryProcessor_1 as eR,
48196
+ updateGlobalTelemetryInstances as eS,
48197
+ TelemetryRecorderProvider as eT,
48198
+ telemetryRecorderProvider as eU,
48199
+ createGitDiff as eV,
48200
+ catchError as eW,
48201
+ AgentWorkspaceEdit as eX,
48202
+ TextDocumentChangeReason as eY,
48203
+ omit$1 as eZ,
48204
+ displayPathWithoutWorkspaceFolderPrefix as e_,
48205
+ EMPTY as ea,
48206
+ ProgressLocation as eb,
48207
+ AuthConfigError as ec,
48208
+ SourcegraphGraphQLAPIClient as ed,
48209
+ isExternalProviderAuthError as ee,
48210
+ isNetworkLikeError as ef,
48211
+ NeedsAuthChallengeError as eg,
48212
+ AvailabilityError as eh,
48213
+ EnterpriseUserDotComError as ei,
48214
+ resolveAuth as ej,
48215
+ getAuthHeaders as ek,
48216
+ isWorkspaceInstance as el,
48217
+ QuickPickItemKind as em,
48218
+ SUPPORTED_URI_SCHEMAS as en,
48219
+ _baseIsEqual as eo,
48220
+ keys_1 as ep,
48221
+ _baseGet as eq,
48222
+ _castPath as er,
48373
48223
  _toKey as es,
48374
- _isKey as et,
48375
- toNumber_1 as eu,
48376
- _baseFindIndex as ev,
48377
- require$$0 as ew,
48378
- NetworkError as ex,
48379
- isRateLimitError as ey,
48380
- FileType as ez,
48224
+ isLength_1 as et,
48225
+ _isKey as eu,
48226
+ toNumber_1 as ev,
48227
+ _baseFindIndex as ew,
48228
+ require$$0 as ex,
48229
+ NetworkError as ey,
48230
+ isRateLimitError as ez,
48381
48231
  CodeLens as f,
48382
- getClientInfoQueryParams as f$,
48383
- isNetworkError as f0,
48384
- http as f1,
48385
- open as f2,
48386
- defaultWebviewPanel as f3,
48387
- EndOfLine as f4,
48388
- ViewColumn as f5,
48389
- Location as f6,
48390
- onDidChangeActiveTextEditor as f7,
48391
- tabGroups as f8,
48392
- workspaceTextDocuments as f9,
48393
- UriString as fA,
48394
- diagnostics as fB,
48395
- isIntegrationTesting as fC,
48396
- TESTING_TELEMETRY_EXPORTER as fD,
48397
- dist as fE,
48398
- completionProvider as fF,
48399
- InlineCompletionTriggerKind as fG,
48400
- checkIfEnterpriseUser as fH,
48401
- currentAuthStatusAuthed as fI,
48402
- waitUntilComplete as fJ,
48403
- setExtensionConfiguration as fK,
48404
- onDidChangeConfiguration as fL,
48405
- onDidChangeTextDocument as fM,
48406
- onDidChangeTextEditorSelection as fN,
48407
- workspaceFolders as fO,
48408
- isTokenOrEndpointChange as fP,
48409
- QuickInputButtons as fQ,
48410
- RelativePattern as fR,
48411
- isWindows as fS,
48412
- currentAuthStatusOrNotReadyYet as fT,
48413
- currentUserProductSubscription as fU,
48414
- structuredPatch as fV,
48415
- isDotComAuthed as fW,
48416
- dedupeWith as fX,
48417
- AbortError as fY,
48418
- TimeoutError as fZ,
48419
- createDisposables as f_,
48420
- visibleTextEditors as fa,
48421
- onDidChangeVisibleTextEditors as fb,
48422
- fs2 as fc,
48423
- onDidCloseTextDocument as fd,
48424
- setCreateWebviewPanel as fe,
48425
- getAugmentedNamespace as ff,
48426
- extensionConfiguration as fg,
48427
- main$1 as fh,
48428
- setAgent as fi,
48232
+ TimeoutError as f$,
48233
+ escapeRegExp$1 as f0,
48234
+ isNetworkError as f1,
48235
+ http as f2,
48236
+ open as f3,
48237
+ defaultWebviewPanel as f4,
48238
+ EndOfLine as f5,
48239
+ ViewColumn as f6,
48240
+ Location as f7,
48241
+ onDidChangeActiveTextEditor as f8,
48242
+ tabGroups as f9,
48243
+ CodeActionTriggerKind as fA,
48244
+ CodeAction as fB,
48245
+ UriString as fC,
48246
+ diagnostics as fD,
48247
+ isIntegrationTesting as fE,
48248
+ TESTING_TELEMETRY_EXPORTER as fF,
48249
+ dist as fG,
48250
+ completionProvider as fH,
48251
+ InlineCompletionTriggerKind as fI,
48252
+ checkIfEnterpriseUser as fJ,
48253
+ currentAuthStatusAuthed as fK,
48254
+ waitUntilComplete as fL,
48255
+ setExtensionConfiguration as fM,
48256
+ isTokenOrEndpointChange as fN,
48257
+ onDidChangeConfiguration as fO,
48258
+ onDidChangeTextDocument as fP,
48259
+ onDidChangeTextEditorSelection as fQ,
48260
+ setAgent as fR,
48261
+ QuickInputButtons as fS,
48262
+ RelativePattern as fT,
48263
+ isWindows as fU,
48264
+ currentAuthStatusOrNotReadyYet as fV,
48265
+ currentUserProductSubscription as fW,
48266
+ structuredPatch as fX,
48267
+ isDotComAuthed as fY,
48268
+ dedupeWith as fZ,
48269
+ AbortError as f_,
48270
+ workspaceTextDocuments as fa,
48271
+ visibleTextEditors as fb,
48272
+ onDidChangeVisibleTextEditors as fc,
48273
+ fs2 as fd,
48274
+ onDidCloseTextDocument as fe,
48275
+ setCreateWebviewPanel as ff,
48276
+ getAugmentedNamespace as fg,
48277
+ extensionConfiguration as fh,
48278
+ main as fi,
48429
48279
  setWorkspaceDocuments as fj,
48430
- onDidRegisterNewCodeActionProvider as fk,
48431
- onDidUnregisterNewCodeActionProvider as fl,
48432
- onDidRegisterNewCodeLensProvider as fm,
48433
- onDidUnregisterNewCodeLensProvider as fn,
48434
- setClientInfo as fo,
48435
- AgentWorkspaceConfiguration as fp,
48436
- firstNonPendingAuthStatus as fq,
48437
- setWorkspaceFolders as fr,
48438
- onDidChangeWorkspaceFolders as fs,
48439
- onDidChangeWindowState as ft,
48440
- onDidOpenTextDocument as fu,
48441
- onDidSaveTextDocument as fv,
48442
- packageJson as fw,
48443
- progressBars as fx,
48444
- CodeActionTriggerKind as fy,
48445
- CodeAction as fz,
48280
+ setLastOpenedWorkspaceFolder as fk,
48281
+ onDidRegisterNewCodeActionProvider as fl,
48282
+ onDidUnregisterNewCodeActionProvider as fm,
48283
+ onDidRegisterNewCodeLensProvider as fn,
48284
+ onDidUnregisterNewCodeLensProvider as fo,
48285
+ setClientInfo as fp,
48286
+ AgentWorkspaceConfiguration as fq,
48287
+ firstNonPendingAuthStatus as fr,
48288
+ workspaceFolders as fs,
48289
+ setWorkspaceFolders as ft,
48290
+ onDidChangeWorkspaceFolders as fu,
48291
+ onDidChangeWindowState as fv,
48292
+ onDidOpenTextDocument as fw,
48293
+ onDidSaveTextDocument as fx,
48294
+ packageJson as fy,
48295
+ progressBars as fz,
48446
48296
  Disposable as g,
48447
- setClientCapabilities as g$,
48448
- tracer as g0,
48449
- getClientIdentificationHeaders as g1,
48450
- setJSONAcceptContentTypeHeaders as g2,
48451
- logResponseHeadersToSpan as g3,
48452
- getActiveTraceAndSpanId as g4,
48453
- isCustomAuthChallengeResponse as g5,
48454
- TracedError as g6,
48455
- isNodeResponse as g7,
48456
- capitalize$2 as g8,
48457
- createTwoFilesPatch as g9,
48458
- isRuleFilename as gA,
48459
- parseRuleFile as gB,
48460
- languageFromFilename as gC,
48461
- ruleTitle as gD,
48462
- createCodeSearchProvider as gE,
48463
- psDedent as gF,
48464
- DecorationRangeBehavior as gG,
48297
+ setLogger as g$,
48298
+ createDisposables as g0,
48299
+ getClientInfoQueryParams as g1,
48300
+ tracer as g2,
48301
+ getClientIdentificationHeaders as g3,
48302
+ setJSONAcceptContentTypeHeaders as g4,
48303
+ logResponseHeadersToSpan as g5,
48304
+ getActiveTraceAndSpanId as g6,
48305
+ isCustomAuthChallengeResponse as g7,
48306
+ TracedError as g8,
48307
+ isNodeResponse as g9,
48308
+ merge$1 as gA,
48309
+ ruleSearchPaths as gB,
48310
+ isRuleFilename as gC,
48311
+ parseRuleFile as gD,
48312
+ languageFromFilename as gE,
48313
+ ruleTitle as gF,
48314
+ createCodeSearchProvider as gG,
48465
48315
  ProgrammingLanguage as gH,
48466
48316
  MAX_CURRENT_FILE_TOKENS as gI,
48467
- formatRuleForPrompt as gJ,
48468
- posixFilePaths as gK,
48469
- SURROUNDING_LINES as gL,
48470
- ACCOUNT_UPGRADE_URL as gM,
48471
- GENERAL_HELP_LABEL as gN,
48472
- diffLines as gO,
48473
- CODY_SUPPORT_URL as gP,
48474
- CODY_DOC_URL as gQ,
48475
- CODY_FEEDBACK_URL as gR,
48476
- DISCORD_URL as gS,
48477
- globalAgentRef as gT,
48478
- VSCODE_CHANGELOG_URL as gU,
48479
- SG_CHANGELOG_URL as gV,
48480
- ACCOUNT_LIMITS_INFO_URL as gW,
48481
- assertUnreachable as gX,
48482
- promise as gY,
48483
- ExtensionMode as gZ,
48484
- setLogger as g_,
48485
- getEditorTabSize as ga,
48486
- InlineCompletionItem as gb,
48487
- isFreeUser as gc,
48488
- exec as gd,
48489
- _baseGetTag as ge,
48490
- MAX_BYTES_PER_FILE as gf,
48491
- debounce_1 as gg,
48492
- mentionProvidersMetadata as gh,
48493
- expandToLineRange as gi,
48494
- openctxController as gj,
48495
- openCtxProviderMetadata as gk,
48496
- editorStateFromPromptString as gl,
48497
- inputTextWithoutContextChipsFromPromptEditorState as gm,
48498
- ToolCodyModelRef as gn,
48499
- PromptMode as go,
48500
- skip as gp,
48501
- extractContextFromTraceparent as gq,
48502
- isContextWindowLimitError as gr,
48503
- addMessageListenersForExtensionAPI as gs,
48504
- createMessageAPIForExtension as gt,
48505
- CODY_PASSTHROUGH_VSCODE_OPEN_COMMAND_ID as gu,
48506
- CodeActionKind as gv,
48507
- assertFileURI as gw,
48508
- defer as gx,
48509
- merge$1 as gy,
48510
- ruleSearchPaths as gz,
48317
+ psDedent as gJ,
48318
+ formatRuleForPrompt as gK,
48319
+ posixFilePaths as gL,
48320
+ DecorationRangeBehavior as gM,
48321
+ SURROUNDING_LINES as gN,
48322
+ GENERAL_HELP_LABEL as gO,
48323
+ ACCOUNT_UPGRADE_URL as gP,
48324
+ diffLines as gQ,
48325
+ CODY_SUPPORT_URL as gR,
48326
+ CODY_DOC_URL as gS,
48327
+ CODY_FEEDBACK_URL as gT,
48328
+ DISCORD_URL as gU,
48329
+ VSCODE_CHANGELOG_URL as gV,
48330
+ SG_CHANGELOG_URL as gW,
48331
+ ACCOUNT_LIMITS_INFO_URL as gX,
48332
+ assertUnreachable as gY,
48333
+ promise as gZ,
48334
+ ExtensionMode as g_,
48335
+ capitalize$2 as ga,
48336
+ createTwoFilesPatch as gb,
48337
+ getEditorTabSize as gc,
48338
+ InlineCompletionItem as gd,
48339
+ isFreeUser as ge,
48340
+ exec as gf,
48341
+ _baseGetTag as gg,
48342
+ MAX_BYTES_PER_FILE as gh,
48343
+ debounce_1 as gi,
48344
+ mentionProvidersMetadata as gj,
48345
+ openctxController as gk,
48346
+ expandToLineRange as gl,
48347
+ openCtxProviderMetadata as gm,
48348
+ editorStateFromPromptString as gn,
48349
+ inputTextWithoutContextChipsFromPromptEditorState as go,
48350
+ ToolCodyModelRef as gp,
48351
+ PromptMode as gq,
48352
+ skip as gr,
48353
+ extractContextFromTraceparent as gs,
48354
+ isContextWindowLimitError as gt,
48355
+ addMessageListenersForExtensionAPI as gu,
48356
+ createMessageAPIForExtension as gv,
48357
+ CODY_PASSTHROUGH_VSCODE_OPEN_COMMAND_ID as gw,
48358
+ CodeActionKind as gx,
48359
+ assertFileURI as gy,
48360
+ defer as gz,
48511
48361
  commonjsGlobal as h,
48512
- setResolvedConfigurationObservable as h0,
48513
- _$1 as h1,
48514
- setClientNameVersion as h2,
48515
- setOpenCtxControllerObservable as h3,
48516
- CODY_OLLAMA_DOCS_URL as h4,
48517
- child_process as h5,
48362
+ setClientCapabilities as h0,
48363
+ setResolvedConfigurationObservable as h1,
48364
+ _$1 as h2,
48365
+ setClientNameVersion as h3,
48366
+ setOpenCtxControllerObservable as h4,
48367
+ CODY_OLLAMA_DOCS_URL as h5,
48368
+ child_process as h6,
48518
48369
  getDefaultExportFromCjs as i,
48519
48370
  ks as j,
48520
48371
  ke as k,