@sourcegraph/cody-web 0.38.0 → 0.40.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.
@@ -18,8 +18,8 @@ var __privateWrapper = (obj, member, setter2, getter) => ({
18
18
  }
19
19
  });
20
20
  var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn, _a2, _b, _c, _d, _e, _constructing, _f, _g, _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_fn2, moveToTail_fn, _h, _i, _j, _k, _l;
21
- import { dt as Observable, dX as unsubscribe, dY as AsyncSerialScheduler, de as authStatus, cB as pick, cF as distinctUntilChanged$1, c$ as switchMapReplayOperation, c_ as pendingOperation, co as promiseFactoryToObservable, dw as map$1, a as isError$3, cZ as retry$1, a8 as logError$1, d1 as firstResultFromOperation, aD as graphqlClient, ag as isDotCom, dZ as semver, cP as debounceTime, d_ as interval, cX as filter$3, cJ as startWith$1, cN as switchMap$1, ci as firstValueFrom$1, d0 as skipPendingOperation, a7 as logDebug, i as isAbortError, d$ as expand, dK as LRUCache$1, e0 as TRANSIENT_REFETCH_INTERVAL_HINT, aR as createSubscriber, cw as fromVSCodeEvent, dv as isEqual, dc as cenv, dS as lodashExports, aG as EXCLUDE_EVERYTHING_CONTEXT_FILTERS, J as isFileURI, w as wrapInActiveSpan, aF as INCLUDE_EVERYTHING_CONTEXT_FILTERS, bn as onAbort, bN as CHAT_INPUT_TOKEN_BUDGET, bP as CHAT_OUTPUT_TOKEN_BUDGET, M as ModelTag, bS as EXTENDED_CHAT_INPUT_TOKEN_BUDGET, bR as EXTENDED_USER_CONTEXT_TOKEN_BUDGET, ae as addCodyClientIdentificationHeaders, bw as addTraceparent, bM as addAuthHeaders, bI as fetch$2, e1 as verifyResponseCode, ct as combineLatest$1, cK as take$2, d7 as clientCapabilities, cC as shareReplay$1, cG as tap$2, a3 as featureFlagProvider, a2 as FeatureFlag, bs as telemetryRecorder, dh as currentAuthStatusOrNotReadyYet, dj as mockAuthStatus, cO as storeLastValue, d4 as resolvedConfig, bD as AUTH_STATUS_FIXTURE_AUTHED_DOTCOM, bF as ps, e2 as logInfo, a5 as GuardrailsMode, d5 as currentResolvedConfig, bE as PromptString, bT as CodyIDE, T as displayPath, bQ as CORPUS_CONTEXT_ALLOCATION, bz as recordErrorToSpan, aa as addClientInfoParams, bm as dependentAbortController, aY as FILE_CONTEXT_MENTION_PROVIDER, aZ as SYMBOL_CONTEXT_MENTION_PROVIDER, b0 as REMOTE_REPOSITORY_PROVIDER_URI, b1 as REMOTE_FILE_PROVIDER_URI, b2 as REMOTE_DIRECTORY_PROVIDER_URI, b3 as WEB_PROVIDER_URI, C as ContextItemSource, bd as isS2, b4 as GIT_OPENCTX_PROVIDER_URI, b5 as CODE_SEARCH_PROVIDER_URI, dJ as cryptoJsExports, b7 as currentOpenCtxController, c as URI, e3 as MulticastSubject, e4 as AsyncSerialScheduler_1, dn as getDefaultExportFromCjs, e5 as workspace, p as path$1, e6 as vscode, e7 as Range, e8 as commands$1, e9 as window$1, ea as Selection, U as Uri, eb as AgentEventEmitter, ec as MarkdownString, ed as Disposable, ee as TextEditorRevealType, ef as ThemeIcon, eg as StatusBarAlignment, eh as readFile, ei as env, ej as UIKind, ek as languages$1, dm as commonjsGlobal, an as InvalidAccessTokenError, el as _baseAssignValue, em as eq_1, en as isArrayLike_1, eo as isObjectLike_1, ep as _copyObject, eq as keysIn_1, er as _cloneBufferExports, es as _cloneTypedArray, et as _copyArray, eu as _initCloneObject, ev as isArguments_1, ew as isArray_1, ex as isBufferExports, ey as isFunction_1, ez as isObject_1, eA as isPlainObject_1, eB as isTypedArray_1, eC as _Stack, eD as identity_1, eE as _overRest, eF as _setToString, eG as _isIndex, dx as isSourcegraphToken, dR as v4, eH as CONFIG_KEY, bU as CodyAutoSuggestionMode, eI as ConfigurationTarget, eJ as appendFileSync, eK as pathBrowserify, eL as stat, eM as extensions, eN as version$2, d9 as setExtensionVersion, eO as normalizeServerEndpointURL, ax as isInvalidAccessTokenError, eP as isOAuthProviderError, af as DOTCOM_URL, ay as isNeedsAuthChallengeError, cq as EMPTY$1, cf as disposableSubscription, eQ as externalAuthRefresh, dd as setAuthStatusObservable, av as isAvailabilityError, aj as AuthConfigError, be as isWorkspaceInstance, aC as SourcegraphGraphQLAPIClient, eR as isExternalAuthProviderError, aA as isNetworkLikeError, ao as NeedsAuthChallengeError, al as AvailabilityError, df as currentAuthStatus, eS as resolveAuth, eT as QuickPickItemKind, eU as revokeOAuthTokens, bL as getAuthHeaders, eV as toLightweightChatTranscript, S as SUPPORTED_URI_SCHEMAS, eW as RelativePattern, eX as _baseIsEqual, eY as keys_1, eZ as _baseGet, e_ as _castPath, e$ as isLength_1, f0 as _toKey, f1 as _isKey, f2 as toNumber_1, f3 as _baseFindIndex, f4 as require$$0$2, ap as NetworkError, aB as isRateLimitError, au as isAuthError, f5 as FileType, f6 as dedent$1, f7 as FoldingRange, f8 as CancellationTokenSource, f9 as SymbolKind, aQ as convertGitCloneURLToCodebaseName, b as isDefined, cA as pluck, t as toRangeData, fa as Position, D as DefaultChatCommands, A as pathFunctionsForURI, R as uriParseNameAndExtension, O as uriDirname, fb as Utils$1, Q as uriExtname, K as uriBasename, h as DefaultEditCommands, ce as subscriptionDisposable, bt as updateGlobalTelemetryInstances, aN as TelemetryRecorderProvider, br as telemetryRecorderProvider, bf as createGitDiff, fc as AgentWorkspaceEdit, fd as TextDocumentChangeReason, fe as omit$1, bo as getEditorInsertSpaces, ff as escapeRegExp$1, ar as TimeoutError, az as isNetworkError, Z as displayPathWithoutWorkspaceFolderPrefix, fg as http, fh as open, cW as defer$2, cs as merge$2, cT as abortableOperation, bl as ruleSearchPaths, bi as isRuleFilename, bk as parseRuleFile, q as languageFromFilename, m as displayLineRange, bj as ruleTitle, fi as debounce_1, k as isErrorLike, d as isWindows, b6 as GLOBAL_SEARCH_PROVIDER_URI, aW as mentionProvidersMetadata, fj as ThemeColor, fk as QuickInputButtons, aV as scanForMentionTriggerInUserTextInput, aU as parseMentionQuery, L as LARGE_FILE_WARNING_LABEL, G as GENERAL_HELP_LABEL, dI as CodyTaskState, fl as CodeLens, fm as defaultWebviewPanel, cd as createExtensionAPI, bb as createMessageAPIForWebview, y as isMatlabFile, fn as EndOfLine, fo as ViewColumn, fp as Location, fq as onDidChangeActiveTextEditor, fr as tabGroups, fs as workspaceTextDocuments, ft as visibleTextEditors, fu as onDidChangeVisibleTextEditors, fv as fs, fw as onDidCloseTextDocument, fx as setCreateWebviewPanel, fy as getAugmentedNamespace, fz as extensionConfiguration, fA as existsSync, fB as rmSync, fC as mkdirSync, fD as main$1, fE as setAgent, fF as setWorkspaceDocuments, fG as setLastOpenedWorkspaceFolder, fH as onDidRegisterNewCodeActionProvider, fI as onDidUnregisterNewCodeActionProvider, fJ as onDidRegisterNewCodeLensProvider, fK as onDidUnregisterNewCodeLensProvider, fL as setClientInfo, di as firstNonPendingAuthStatus, fM as workspaceFolders$1, fN as setWorkspaceFolders, fO as onDidChangeWorkspaceFolders, fP as onDidChangeWindowState, fQ as onDidOpenTextDocument, fR as onDidSaveTextDocument, fS as onDidRenameFiles, fT as packageJson, fU as progressBars, fV as CodeActionTriggerKind, fW as CodeAction, fX as UriString, fY as DiagnosticSeverity, fZ as diagnostics, f_ as isIntegrationTesting, f$ as TESTING_TELEMETRY_EXPORTER, g0 as ProgressLocation, g1 as dist, g2 as completionProvider, g3 as InlineCompletionTriggerKind, dg as currentAuthStatusAuthed, ck as waitUntilComplete, g4 as setExtensionConfiguration, g5 as onDidChangeConfiguration, g6 as onDidChangeTextDocument, g7 as onDidChangeTextEditorSelection, g8 as statSync, g9 as copySync, E as isMacOS, g as CustomCommandType, _ as setDisplayPathEnvInfo, dU as ACCOUNT_USAGE_URL, ga as getOIDCConfiguration$1, gb as getOAuthClientId, gc as OAuthCredential, du as debounce$1, gd as structuredPatch, j as dedupeWith$1, ai as AbortError, cz as createDisposables, aE as isNodeResponse, ab as getClientInfoQueryParams, bu as tracer, bv as getActiveTraceAndSpanId, ac as getClientIdentificationHeaders, aI as setJSONAcceptContentTypeHeaders, bx as logResponseHeadersToSpan, aJ as isCustomAuthChallengeResponse, as as TracedError, dA as SpanStatusCode, aq as RateLimitError$1, ge as capitalize, gf as InlineCompletionItem, gg as createTwoFilesPatch, gh as vsCodeMocks, dD as whitespace, dB as svg, dE as find$1, dF as stringify$1, dG as stringify$2, dH as ccount, dC as html$3, bp as getEditorTabSize$1, gi as metrics, gj as _, c6 as deserializeContextItem, c2 as editorStateFromPromptString, gk as _baseGetTag, at as isAbortErrorOrSocketHangUp, b_ as inputTextWithoutContextChipsFromPromptEditorState, dL as DeepCodyAgentID, gl as exec, s as spawn, dk as UIToolStatus, W as displayPathBasename, o as expandToLineRange, a$ as openctxController, aX as openCtxProviderMetadata, e as CODY_PASSTHROUGH_VSCODE_OPEN_COMMAND_ID, cU as catchError$1, dP as diffWithLineNum, dl as UITerminalOutputType, gm as getPlatform$1, aH as PromptMode, cL as skip$1, dz as context, bA as extractContextFromTraceparent, aw as isContextWindowLimitError, c5 as serializeContextItem, a0 as forceHydration, r as reformatBotMessageForChat, a1 as hydrateAfterPostMessage, ba as addMessageListenersForExtensionAPI, bc as createMessageAPIForExtension, dM as View, dT as ChatHistoryType, cr as NEVER$1, gn as CodeActionKind, l as pluralize, H as assertFileURI, b8 as RULES_PROVIDER_URI, go as createCodeSearchProvider, u as languageFromFilenameAndContent, P as ProgrammingLanguage, bG as psDedent, gp as formatRuleForPrompt, z as posixFilePaths, gq as DecorationRangeBehavior, gr as diffLines, gs as CODY_SUPPORT_URL, gt as CODY_DOC_URL, gu as DISCORD_URL, bJ as globalAgentRef, gv as VSCODE_CHANGELOG_URL, gw as SG_CHANGELOG_URL, gx as ACCOUNT_LIMITS_INFO_URL, aP as assertUnreachable, aT as promise, gy as ExtensionMode, a9 as setLogger, d8 as setClientCapabilities, d2 as setResolvedConfigurationObservable, ad as setClientNameVersion, a_ as setOpenCtxControllerObservable, dW as browser$4 } from "./vscode-shim-CdmSM8Q0.mjs";
22
- import { r as requireUtil, i as inherits_browserExports, a as utilExports } from "./util-Ci-ROool.mjs";
21
+ import { dt as Observable, dX as unsubscribe, dY as AsyncSerialScheduler, de as authStatus, cB as pick, cF as distinctUntilChanged$1, c$ as switchMapReplayOperation, c_ as pendingOperation, co as promiseFactoryToObservable, dw as map$1, a as isError$3, cZ as retry$1, a8 as logError$1, d1 as firstResultFromOperation, aD as graphqlClient, ag as isDotCom, dZ as semver, cP as debounceTime, d_ as interval, cX as filter$3, cJ as startWith$1, cN as switchMap$1, ci as firstValueFrom$1, d0 as skipPendingOperation, a7 as logDebug, i as isAbortError, d$ as expand, dK as LRUCache$1, e0 as TRANSIENT_REFETCH_INTERVAL_HINT, aR as createSubscriber, cw as fromVSCodeEvent, dv as isEqual, dc as cenv, dS as lodashExports, aG as EXCLUDE_EVERYTHING_CONTEXT_FILTERS, J as isFileURI, w as wrapInActiveSpan, aF as INCLUDE_EVERYTHING_CONTEXT_FILTERS, bn as onAbort, bN as CHAT_INPUT_TOKEN_BUDGET, bP as CHAT_OUTPUT_TOKEN_BUDGET, M as ModelTag, bS as EXTENDED_CHAT_INPUT_TOKEN_BUDGET, bR as EXTENDED_USER_CONTEXT_TOKEN_BUDGET, ae as addCodyClientIdentificationHeaders, bw as addTraceparent, bM as addAuthHeaders, bI as fetch$2, e1 as verifyResponseCode, ct as combineLatest$1, cK as take$2, d7 as clientCapabilities, cC as shareReplay$1, cG as tap$2, a3 as featureFlagProvider, a2 as FeatureFlag, bs as telemetryRecorder, dh as currentAuthStatusOrNotReadyYet, dj as mockAuthStatus, cO as storeLastValue, d4 as resolvedConfig, bD as AUTH_STATUS_FIXTURE_AUTHED_DOTCOM, bF as ps, e2 as logInfo, a5 as GuardrailsMode, d5 as currentResolvedConfig, bE as PromptString, bT as CodyIDE, T as displayPath, bQ as CORPUS_CONTEXT_ALLOCATION, bz as recordErrorToSpan, aa as addClientInfoParams, bm as dependentAbortController, aY as FILE_CONTEXT_MENTION_PROVIDER, aZ as SYMBOL_CONTEXT_MENTION_PROVIDER, b0 as REMOTE_REPOSITORY_PROVIDER_URI, b1 as REMOTE_FILE_PROVIDER_URI, b2 as REMOTE_DIRECTORY_PROVIDER_URI, b3 as WEB_PROVIDER_URI, C as ContextItemSource, bd as isS2, b4 as GIT_OPENCTX_PROVIDER_URI, b5 as CODE_SEARCH_PROVIDER_URI, dJ as cryptoJsExports, b7 as currentOpenCtxController, c as URI, e3 as MulticastSubject, e4 as AsyncSerialScheduler_1, dn as getDefaultExportFromCjs, e5 as workspace, p as path$1, e6 as vscode, e7 as Range, e8 as commands$1, e9 as window$1, ea as Selection, U as Uri, eb as AgentEventEmitter, ec as MarkdownString, ed as Disposable, ee as TextEditorRevealType, ef as ThemeIcon, eg as StatusBarAlignment, eh as readFile, ei as env, ej as UIKind, ek as languages$1, dm as commonjsGlobal, an as InvalidAccessTokenError, el as _baseAssignValue, em as eq_1, en as isArrayLike_1, eo as isObjectLike_1, ep as _copyObject, eq as keysIn_1, er as _cloneBufferExports, es as _cloneTypedArray, et as _copyArray, eu as _initCloneObject, ev as isArguments_1, ew as isArray_1, ex as isBufferExports, ey as isFunction_1, ez as isObject_1, eA as isPlainObject_1, eB as isTypedArray_1, eC as _Stack, eD as identity_1, eE as _overRest, eF as _setToString, eG as _isIndex, dx as isSourcegraphToken, dR as v4, eH as CONFIG_KEY, bU as CodyAutoSuggestionMode, eI as ConfigurationTarget, eJ as appendFileSync, eK as pathBrowserify, eL as stat, eM as extensions, eN as version$2, d9 as setExtensionVersion, eO as normalizeServerEndpointURL, ax as isInvalidAccessTokenError, eP as isOAuthProviderError, af as DOTCOM_URL, ay as isNeedsAuthChallengeError, cq as EMPTY$1, cf as disposableSubscription, eQ as externalAuthRefresh, dd as setAuthStatusObservable, av as isAvailabilityError, aj as AuthConfigError, be as isWorkspaceInstance, aC as SourcegraphGraphQLAPIClient, eR as isExternalAuthProviderError, aA as isNetworkLikeError, ao as NeedsAuthChallengeError, al as AvailabilityError, df as currentAuthStatus, eS as resolveAuth, eT as QuickPickItemKind, eU as revokeOAuthTokens, bL as getAuthHeaders, eV as toLightweightChatTranscript, S as SUPPORTED_URI_SCHEMAS, eW as RelativePattern, eX as _baseIsEqual, eY as keys_1, eZ as _baseGet, e_ as _castPath, e$ as isLength_1, f0 as _toKey, f1 as _isKey, f2 as toNumber_1, f3 as _baseFindIndex, f4 as require$$0$2, ap as NetworkError, aB as isRateLimitError, au as isAuthError, f5 as FileType, f6 as dedent$1, f7 as FoldingRange, f8 as CancellationTokenSource, f9 as SymbolKind, aQ as convertGitCloneURLToCodebaseName, b as isDefined, cA as pluck, t as toRangeData, fa as Position, D as DefaultChatCommands, A as pathFunctionsForURI, R as uriParseNameAndExtension, O as uriDirname, fb as Utils$1, Q as uriExtname, K as uriBasename, h as DefaultEditCommands, ce as subscriptionDisposable, bt as updateGlobalTelemetryInstances, aN as TelemetryRecorderProvider, br as telemetryRecorderProvider, bf as createGitDiff, fc as AgentWorkspaceEdit, fd as TextDocumentChangeReason, fe as omit$1, bo as getEditorInsertSpaces, ff as escapeRegExp$1, ar as TimeoutError, az as isNetworkError, Z as displayPathWithoutWorkspaceFolderPrefix, fg as http, fh as open, cW as defer$2, cs as merge$2, cT as abortableOperation, bl as ruleSearchPaths, bi as isRuleFilename, bk as parseRuleFile, q as languageFromFilename, m as displayLineRange, bj as ruleTitle, fi as debounce_1, k as isErrorLike, d as isWindows, b6 as GLOBAL_SEARCH_PROVIDER_URI, aW as mentionProvidersMetadata, fj as ThemeColor, fk as QuickInputButtons, aV as scanForMentionTriggerInUserTextInput, aU as parseMentionQuery, L as LARGE_FILE_WARNING_LABEL, G as GENERAL_HELP_LABEL, dI as CodyTaskState, fl as CodeLens, fm as defaultWebviewPanel, cd as createExtensionAPI, bb as createMessageAPIForWebview, y as isMatlabFile, fn as EndOfLine, fo as ViewColumn, fp as Location, fq as onDidChangeActiveTextEditor, fr as tabGroups, fs as workspaceTextDocuments, ft as visibleTextEditors, fu as onDidChangeVisibleTextEditors, fv as fs, fw as onDidCloseTextDocument, fx as setCreateWebviewPanel, fy as getAugmentedNamespace, fz as extensionConfiguration, fA as existsSync, fB as rmSync, fC as mkdirSync, fD as main$1, fE as setAgent, fF as setWorkspaceDocuments, fG as setLastOpenedWorkspaceFolder, fH as onDidRegisterNewCodeActionProvider, fI as onDidUnregisterNewCodeActionProvider, fJ as onDidRegisterNewCodeLensProvider, fK as onDidUnregisterNewCodeLensProvider, fL as setClientInfo, di as firstNonPendingAuthStatus, fM as workspaceFolders$1, fN as setWorkspaceFolders, fO as onDidChangeWorkspaceFolders, fP as onDidChangeWindowState, fQ as onDidOpenTextDocument, fR as onDidSaveTextDocument, fS as onDidRenameFiles, fT as packageJson, fU as progressBars, fV as CodeActionTriggerKind, fW as CodeAction, fX as UriString, fY as DiagnosticSeverity, fZ as diagnostics, f_ as isIntegrationTesting, f$ as TESTING_TELEMETRY_EXPORTER, g0 as ProgressLocation, g1 as dist, g2 as completionProvider, g3 as InlineCompletionTriggerKind, dg as currentAuthStatusAuthed, ck as waitUntilComplete, g4 as setExtensionConfiguration, g5 as onDidChangeConfiguration, g6 as onDidChangeTextDocument, g7 as onDidChangeTextEditorSelection, g8 as statSync, g9 as copySync, E as isMacOS, g as CustomCommandType, _ as setDisplayPathEnvInfo, dU as ACCOUNT_USAGE_URL, ga as getOIDCConfiguration$1, gb as getOAuthClientId, gc as OAuthCredential, gd as refreshOAuthToken, du as debounce$1, ge as structuredPatch, j as dedupeWith$1, ai as AbortError, cz as createDisposables, aE as isNodeResponse, ab as getClientInfoQueryParams, bu as tracer, bv as getActiveTraceAndSpanId, ac as getClientIdentificationHeaders, aI as setJSONAcceptContentTypeHeaders, bx as logResponseHeadersToSpan, aJ as isCustomAuthChallengeResponse, as as TracedError, dA as SpanStatusCode, aq as RateLimitError$1, gf as capitalize, gg as InlineCompletionItem, gh as createTwoFilesPatch, gi as vsCodeMocks, dD as whitespace, dB as svg, dE as find$1, dF as stringify$1, dG as stringify$2, dH as ccount, dC as html$3, bp as getEditorTabSize$1, gj as metrics, gk as _, c6 as deserializeContextItem, c2 as editorStateFromPromptString, gl as _baseGetTag, at as isAbortErrorOrSocketHangUp, b_ as inputTextWithoutContextChipsFromPromptEditorState, dL as DeepCodyAgentID, gm as exec, s as spawn, dk as UIToolStatus, W as displayPathBasename, o as expandToLineRange, a$ as openctxController, aX as openCtxProviderMetadata, e as CODY_PASSTHROUGH_VSCODE_OPEN_COMMAND_ID, cU as catchError$1, dP as diffWithLineNum, dl as UITerminalOutputType, gn as getPlatform$1, aH as PromptMode, cL as skip$1, dz as context, bA as extractContextFromTraceparent, aw as isContextWindowLimitError, c5 as serializeContextItem, a0 as forceHydration, r as reformatBotMessageForChat, a1 as hydrateAfterPostMessage, ba as addMessageListenersForExtensionAPI, bc as createMessageAPIForExtension, dM as View, dT as ChatHistoryType, cr as NEVER$1, go as CodeActionKind, l as pluralize, H as assertFileURI, b8 as RULES_PROVIDER_URI, gp as createCodeSearchProvider, u as languageFromFilenameAndContent, P as ProgrammingLanguage, bG as psDedent, gq as formatRuleForPrompt, z as posixFilePaths, gr as DecorationRangeBehavior, gs as diffLines, gt as CODY_SUPPORT_URL, gu as CODY_DOC_URL, gv as DISCORD_URL, bJ as globalAgentRef, gw as VSCODE_CHANGELOG_URL, gx as SG_CHANGELOG_URL, gy as ACCOUNT_LIMITS_INFO_URL, aP as assertUnreachable, aT as promise, gz as ExtensionMode, a9 as setLogger, d8 as setClientCapabilities, d2 as setResolvedConfigurationObservable, ad as setClientNameVersion, a_ as setOpenCtxControllerObservable, dW as browser$4 } from "./vscode-shim-BM22pmQn.mjs";
22
+ import { r as requireUtil, i as inherits_browserExports, a as utilExports } from "./util-DSBgjmTR.mjs";
23
23
  var NOTHING = Symbol.for("immer-nothing");
24
24
  var DRAFTABLE = Symbol.for("immer-draftable");
25
25
  var DRAFT_STATE = Symbol.for("immer-state");
@@ -9935,7 +9935,7 @@ async function getTokenCounterUtils() {
9935
9935
  const browser2 = detect();
9936
9936
  if (browser2 && browser2.name === "safari") {
9937
9937
  _tokenCounterUtilsPromise = import("./cl100k_base-B4kyDDRQ.mjs").then(async (tokenizer2) => {
9938
- const tiktoken = await import("./lite-BPYOwOSx.mjs");
9938
+ const tiktoken = await import("./lite-DCeO0vlV.mjs");
9939
9939
  return createTokenCounterUtils(new tiktoken.Tiktoken(tokenizer2.default));
9940
9940
  });
9941
9941
  } else {
@@ -25568,6 +25568,9 @@ class VSCodeSecretStorage {
25568
25568
  async getRefreshToken(endpoint) {
25569
25569
  return this.get(endpoint + CODY_REFRESH_TOKEN_SECRET);
25570
25570
  }
25571
+ async deleteRefreshToken(endpoint) {
25572
+ await this.secretStorage.delete(endpoint + CODY_REFRESH_TOKEN_SECRET);
25573
+ }
25571
25574
  async storeTokenExpiresAt(endpoint, expiresAt) {
25572
25575
  await this.store(endpoint + CODY_TOKEN_EXPIRES_AT, expiresAt.toString());
25573
25576
  }
@@ -25575,6 +25578,9 @@ class VSCodeSecretStorage {
25575
25578
  const expiresAtStr = await this.get(endpoint + CODY_TOKEN_EXPIRES_AT);
25576
25579
  return expiresAtStr ? Number.parseInt(expiresAtStr, 10) : void 0;
25577
25580
  }
25581
+ async deleteTokenExpiresAt(endpoint) {
25582
+ await this.secretStorage.delete(endpoint + CODY_TOKEN_EXPIRES_AT);
25583
+ }
25578
25584
  async delete(key2) {
25579
25585
  await this.secretStorage.delete(key2);
25580
25586
  }
@@ -48347,7 +48353,7 @@ class CommandsProvider {
48347
48353
  if (!isFileURI(uri)) {
48348
48354
  throw new Error("history only supported on local file paths");
48349
48355
  }
48350
- const { getContextFileFromGitLog } = await import("./git-log-DjCz8t7A.mjs");
48356
+ const { getContextFileFromGitLog } = await import("./git-log-BOf0Q_uO.mjs");
48351
48357
  return getContextFileFromGitLog(uri, options);
48352
48358
  }
48353
48359
  dispose() {
@@ -48778,7 +48784,7 @@ function registerAuthDebugCommands(disposables) {
48778
48784
  if (!selection) return;
48779
48785
  const endpoint = authStatus2.endpoint;
48780
48786
  if (selection.value === null) {
48781
- await secretStorage.delete(endpoint + "cody.token.expires-at");
48787
+ await secretStorage.deleteTokenExpiresAt(endpoint);
48782
48788
  void window$1.showInformationMessage("Token expiry removed");
48783
48789
  } else {
48784
48790
  await secretStorage.storeTokenExpiresAt(endpoint, selection.value);
@@ -48829,6 +48835,59 @@ function registerAuthDebugCommands(disposables) {
48829
48835
  "Invalid refresh token set - auth will fail on next request"
48830
48836
  );
48831
48837
  }),
48838
+ // Clear access token only (to force reliance on refresh token)
48839
+ commands$1.registerCommand("cody.debug.auth.clearAccessToken", async () => {
48840
+ const authStatus2 = currentAuthStatus();
48841
+ if (!authStatus2.authenticated) {
48842
+ void window$1.showErrorMessage("Not authenticated");
48843
+ return;
48844
+ }
48845
+ const endpoint = authStatus2.endpoint;
48846
+ await secretStorage.deleteToken(endpoint);
48847
+ void window$1.showInformationMessage(
48848
+ "Access token cleared - next request will require refresh"
48849
+ );
48850
+ }),
48851
+ // Clear refresh token only (to reproduce missing refresh token bug)
48852
+ commands$1.registerCommand("cody.debug.auth.clearRefreshToken", async () => {
48853
+ const authStatus2 = currentAuthStatus();
48854
+ if (!authStatus2.authenticated) {
48855
+ void window$1.showErrorMessage("Not authenticated");
48856
+ return;
48857
+ }
48858
+ const endpoint = authStatus2.endpoint;
48859
+ await secretStorage.deleteRefreshToken(endpoint);
48860
+ void window$1.showInformationMessage(
48861
+ "Refresh token cleared - will use existing access token until it expires"
48862
+ );
48863
+ }),
48864
+ // Simulate storage failure during refresh (reproduces rotating token bug)
48865
+ commands$1.registerCommand("cody.debug.auth.simulateRefreshStorageFailure", async () => {
48866
+ const authStatus2 = currentAuthStatus();
48867
+ if (!authStatus2.authenticated) {
48868
+ void window$1.showErrorMessage("Not authenticated");
48869
+ return;
48870
+ }
48871
+ const endpoint = authStatus2.endpoint;
48872
+ const refreshToken = await secretStorage.getRefreshToken(endpoint);
48873
+ if (!refreshToken) {
48874
+ void window$1.showErrorMessage("No refresh token found");
48875
+ return;
48876
+ }
48877
+ const result = await refreshOAuthToken(endpoint, refreshToken);
48878
+ if (!(result == null ? void 0 : result.accessToken)) {
48879
+ void window$1.showErrorMessage("Refresh failed - token may already be invalid");
48880
+ return;
48881
+ }
48882
+ await secretStorage.storeToken(endpoint, result.accessToken, "oauth");
48883
+ if (result.expiresIn) {
48884
+ const expiresAt = Date.now() + result.expiresIn * 1e3;
48885
+ await secretStorage.storeTokenExpiresAt(endpoint, expiresAt);
48886
+ }
48887
+ void window$1.showInformationMessage(
48888
+ "Simulated storage failure: new access token stored, but refresh token NOT updated. Old refresh token is now revoked on server. Next refresh will fail!"
48889
+ );
48890
+ }),
48832
48891
  // Clear all auth data
48833
48892
  commands$1.registerCommand("cody.debug.auth.clearAll", async () => {
48834
48893
  const confirmation = await window$1.showWarningMessage(
@@ -48862,7 +48921,7 @@ function registerAuthDebugCommands(disposables) {
48862
48921
  if (authStatus2.authenticated && authStatus2.endpoint === endpoint) {
48863
48922
  tokenInfo = "In memory (HeaderCredential)";
48864
48923
  try {
48865
- const config = await import("./index-CQZWUrDD.mjs").then(
48924
+ const config = await import("./index-CDrWlDvL.mjs").then(
48866
48925
  (m) => m.currentResolvedConfig()
48867
48926
  );
48868
48927
  const currentConfig = await config;
@@ -181603,9 +181662,26 @@ const _MCPConnectionManager = class _MCPConnectionManager {
181603
181662
  createMCPClient(name2, version2, config) {
181604
181663
  const client = new Client({ name: name2, version: version2 });
181605
181664
  if (config.transportType === "sse") {
181665
+ const hasHeaders = !!config.headers && Object.keys(config.headers).length > 0;
181666
+ const credentials = config.withCredentials ? "include" : "same-origin";
181667
+ const needsCustomFetch = hasHeaders || config.withCredentials;
181668
+ const eventSourceInit = needsCustomFetch ? {
181669
+ fetch: (input, init2) => fetch(input, {
181670
+ ...init2,
181671
+ ...hasHeaders ? { headers: { ...init2 == null ? void 0 : init2.headers, ...config.headers } } : {},
181672
+ credentials: (init2 == null ? void 0 : init2.credentials) ?? credentials
181673
+ })
181674
+ } : void 0;
181675
+ const requestInit = needsCustomFetch ? {
181676
+ ...hasHeaders ? { headers: config.headers } : {},
181677
+ credentials
181678
+ } : void 0;
181606
181679
  return {
181607
181680
  client,
181608
- transport: new SSEClientTransport(new URL(config.url))
181681
+ transport: new SSEClientTransport(new URL(config.url), {
181682
+ eventSourceInit,
181683
+ requestInit
181684
+ })
181609
181685
  };
181610
181686
  }
181611
181687
  return {
@@ -191232,8 +191308,8 @@ function parseMentionURI(uri) {
191232
191308
  }
191233
191309
  }
191234
191310
  async function execFileAsync(program2, args2, { cwd }) {
191235
- const { promisify } = await import("./util-Ci-ROool.mjs").then((n) => n.u);
191236
- const { execFile } = await import("./vscode-shim-CdmSM8Q0.mjs").then((n) => n.gz);
191311
+ const { promisify } = await import("./util-DSBgjmTR.mjs").then((n) => n.u);
191312
+ const { execFile } = await import("./vscode-shim-BM22pmQn.mjs").then((n) => n.gA);
191237
191313
  return promisify(execFile)(program2, args2, { cwd });
191238
191314
  }
191239
191315
  var __create = Object.create;
@@ -1,2 +1,2 @@
1
- import "./agent.worker-Bm74MuX8.mjs";
2
- import "./vscode-shim-CdmSM8Q0.mjs";
1
+ import "./agent.worker-Di-hO351.mjs";
2
+ import "./vscode-shim-BM22pmQn.mjs";
@@ -1,4 +1,4 @@
1
- import { w as wrapInActiveSpan, p as path, U as Uri, C as ContextItemSource, s as spawn } from "./vscode-shim-CdmSM8Q0.mjs";
1
+ import { w as wrapInActiveSpan, p as path, U as Uri, C as ContextItemSource, s as spawn } from "./vscode-shim-BM22pmQn.mjs";
2
2
  async function getContextFileFromGitLog(file, options) {
3
3
  return wrapInActiveSpan("commands.context.git-log", async (span) => {
4
4
  const cwd = path.dirname(file.fsPath);
@@ -1,7 +1,7 @@
1
- import { O as Ollama$1, c as contextFiltersProvider, C as CompletionStopReason, M as ModelUsage, e as enableMapSet } from "./agent.worker-Bm74MuX8.mjs";
2
- import { A, B, k, R, au, D, E, F, an, w, x, a9, aw, N, y, v, P, G, U, z, L, Q, S, ab, W, Y, T, _, a5, ad, a6, a, d, a7, aq, a3, ao, aA, q, a1, n, am, ap, $, av, l, f, g, a0, o, X, ar, as, h, i, a8, a4, ac, m, aa, H, u, at, r, p, ae, al, aj, af, ah, ak, ai, ag, s, az, ay, ax, a2, V, t, j, Z, K, J, I } from "./agent.worker-Bm74MuX8.mjs";
3
- import { i as isAbortError, a as isError, b as isDefined, M as ModelTag, c as URI, d as isWindows } from "./vscode-shim-CdmSM8Q0.mjs";
4
- import { bB, bD, bC, bV, ai as ai2, aj as aj2, ak as ak2, al as al2, bN, bP, db, b5, e, c3, bQ, bU, bT, C, g as g2, af as af2, ah as ah2, D as D2, h as h2, cq, aG, bS, bR, am as am2, bO, aY, F as F2, a2 as a22, G as G2, b4, b6, aK, a6 as a62, a5 as a52, I as I2, aF, an as an2, L as L2, aL, cr, cv, N as N2, ao as ao2, ap as ap2, aM, P as P2, aH, bE, b2, b1, b0, b8, aq as aq2, S as S2, aZ, aC, c4, aN, ar as ar2, as as as2, dl, dk, b3, cT, bM, aa as aa2, ae as ae2, ba, bw, cl, H as H2, aP, de, cU, dc, d7, ct, cQ, cR, cb, ca, bZ, aQ, cz, cd, bf, a4 as a42, bc, bb, aR, df, dg, dh, b7, d5, cP, j as j2, B as B2, cW, bm, bh, c6, m as m2, T as T2, W as W2, Y as Y2, V as V2, Z as Z2, n as n2, cf, cy, cF, c2, c1, o as o2, x as x2, bA, a3 as a32, bI, cX, b$, cE, di, d1, ci, $ as $2, a0 as a02, cp, cw, bv, bL, ac as ac2, ab as ab2, bq, bo, bp, c9, by, bJ, aD, a1 as a12, b_, at as at2, au as au2, av as av2, aw as aw2, aJ, ag as ag2, k as k2, J as J2, ax as ax2, E as E2, y as y2, ay as ay2, az as az2, aA as aA2, aE, aB, bi, bd, c7, c8, bH, be, q as q2, u as u2, cS, a7 as a72, a8 as a82, bx, v as v2, cu, aW, cs, cM, dj, da, d6, aS, aO, cg, ch, bn, aX, a$, aU, bk, A as A2, c_, cB, cA, l as l2, z as z2, cI, aT, co, cn, b9, bF, bG, cm, bz, r as r2, d4, cZ, bl, bj, aV, bg, c5, bY, bX, dd, d8, ad as ad2, _ as _2, d9, aI, a9 as a92, a_, d2, d3, cC, cL, d0, cJ, cO, ce, cN, c$, cK, cD, cG, cH, bs, br, cc, cY, c0, cj, bK, t as t2, bW, bu, bt, K as K2, O, Q as Q2, X as X2, R as R2, cx, ck, f as f2, cV, w as w2 } from "./vscode-shim-CdmSM8Q0.mjs";
1
+ import { O as Ollama$1, c as contextFiltersProvider, C as CompletionStopReason, M as ModelUsage, e as enableMapSet } from "./agent.worker-Di-hO351.mjs";
2
+ import { A, B, k, R, au, D, E, F, an, w, x, a9, aw, N, y, v, P, G, U, z, L, Q, S, ab, W, Y, T, _, a5, ad, a6, a, d, a7, aq, a3, ao, aA, q, a1, n, am, ap, $, av, l, f, g, a0, o, X, ar, as, h, i, a8, a4, ac, m, aa, H, u, at, r, p, ae, al, aj, af, ah, ak, ai, ag, s, az, ay, ax, a2, V, t, j, Z, K, J, I } from "./agent.worker-Di-hO351.mjs";
3
+ import { i as isAbortError, a as isError, b as isDefined, M as ModelTag, c as URI, d as isWindows } from "./vscode-shim-BM22pmQn.mjs";
4
+ import { bB, bD, bC, bV, ai as ai2, aj as aj2, ak as ak2, al as al2, bN, bP, db, b5, e, c3, bQ, bU, bT, C, g as g2, af as af2, ah as ah2, D as D2, h as h2, cq, aG, bS, bR, am as am2, bO, aY, F as F2, a2 as a22, G as G2, b4, b6, aK, a6 as a62, a5 as a52, I as I2, aF, an as an2, L as L2, aL, cr, cv, N as N2, ao as ao2, ap as ap2, aM, P as P2, aH, bE, b2, b1, b0, b8, aq as aq2, S as S2, aZ, aC, c4, aN, ar as ar2, as as as2, dl, dk, b3, cT, bM, aa as aa2, ae as ae2, ba, bw, cl, H as H2, aP, de, cU, dc, d7, ct, cQ, cR, cb, ca, bZ, aQ, cz, cd, bf, a4 as a42, bc, bb, aR, df, dg, dh, b7, d5, cP, j as j2, B as B2, cW, bm, bh, c6, m as m2, T as T2, W as W2, Y as Y2, V as V2, Z as Z2, n as n2, cf, cy, cF, c2, c1, o as o2, x as x2, bA, a3 as a32, bI, cX, b$, cE, di, d1, ci, $ as $2, a0 as a02, cp, cw, bv, bL, ac as ac2, ab as ab2, bq, bo, bp, c9, by, bJ, aD, a1 as a12, b_, at as at2, au as au2, av as av2, aw as aw2, aJ, ag as ag2, k as k2, J as J2, ax as ax2, E as E2, y as y2, ay as ay2, az as az2, aA as aA2, aE, aB, bi, bd, c7, c8, bH, be, q as q2, u as u2, cS, a7 as a72, a8 as a82, bx, v as v2, cu, aW, cs, cM, dj, da, d6, aS, aO, cg, ch, bn, aX, a$, aU, bk, A as A2, c_, cB, cA, l as l2, z as z2, cI, aT, co, cn, b9, bF, bG, cm, bz, r as r2, d4, cZ, bl, bj, aV, bg, c5, bY, bX, dd, d8, ad as ad2, _ as _2, d9, aI, a9 as a92, a_, d2, d3, cC, cL, d0, cJ, cO, ce, cN, c$, cK, cD, cG, cH, bs, br, cc, cY, c0, cj, bK, t as t2, bW, bu, bt, K as K2, O, Q as Q2, X as X2, R as R2, cx, ck, f as f2, cV, w as w2 } from "./vscode-shim-BM22pmQn.mjs";
5
5
  function createOllamaClient(ollamaOptions, logger, logDebug) {
6
6
  async function* complete(params, abortController) {
7
7
  const url = new URL(ollamaOptions.url).href;