@sourcegraph/cody-web 0.23.0 → 0.23.1

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,9 +18,9 @@ var __privateWrapper = (obj, member, setter2, getter) => ({
18
18
  }
19
19
  });
20
20
  var _a2, _b, _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, _c, _d, _e, _f, _g, _h, _constructing2, _i, _j, _max2, _maxSize2, _dispose2, _disposeAfter2, _fetchMethod2, _size2, _calculatedSize2, _keyMap2, _keyList2, _valList2, _next2, _prev2, _head2, _tail2, _free2, _disposed2, _sizes2, _starts2, _ttls2, _hasDispose2, _hasFetchMethod2, _hasDisposeAfter2, _LRUCache_instances2, initializeTTLTracking_fn2, _updateItemAge2, _statusTTL2, _setItemTTL2, _isStale2, initializeSizeTracking_fn2, _removeItemSize2, _addItemSize2, _requireSize2, indexes_fn2, rindexes_fn2, isValidIndex_fn2, evict_fn2, backgroundFetch_fn2, isBackgroundFetch_fn2, connect_fn2, moveToTail_fn2, _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
21
- import { aS as Observable, bZ as unsubscribe, b_ as AsyncSerialScheduler, b$ as authStatus, c0 as debounceTime, c1 as switchMapReplayOperation, c2 as interval, c3 as map$1, c4 as filter$3, c5 as startWith$1, c6 as switchMap$1, c7 as promiseFactoryToObservable, bg as isError$3, c8 as distinctUntilChanged$1, bG as firstValueFrom$1, bH as skipPendingOperation, c9 as logDebug$1, ca as graphqlClient, cb as isAbortError, cc as logError$2, cd as semver, ce as pendingOperation, cf as pick, bq as ModelTag, cg as getModelInfo, bQ as CHAT_INPUT_TOKEN_BUDGET, ch as CHAT_OUTPUT_TOKEN_BUDGET, ci as EXTENDED_CHAT_INPUT_TOKEN_BUDGET, cj as EXTENDED_USER_CONTEXT_TOKEN_BUDGET, ck as createSubscriber, cl as fromVSCodeEvent, aZ as isEqual, cm as cenv, b5 as isDotCom, cn as currentAuthStatus, co as isFileURI, w as wrapInActiveSpan, cp as INCLUDE_EVERYTHING_CONTEXT_FILTERS, cq as EXCLUDE_EVERYTHING_CONTEXT_FILTERS, cr as onAbort, cs as addCodyClientIdentificationHeaders, ct as addAuthHeaders, cu as addTraceparent, cv as fetch$3, cw as verifyResponseCode, cx as combineLatest$1, cy as take$2, cz as clientCapabilities, cA as shareReplay$1, cB as tap$2, cC as featureFlagProvider, ba as FeatureFlag, cD as getEnterpriseContextWindow, cE as ANSWER_TOKENS, cF as storeLastValue, cG as resolvedConfig, cH as userProductSubscription, bB as firstResultFromOperation, cI as isEnterpriseUser, bc as isCodyProUser, p as ps, cJ as currentResolvedConfig, bV as PromptString, bd as CodyIDE, cK as isCustomModel, cL as recordErrorToSpan, cM as addClientInfoParams, cN as dependentAbortController, am as FILE_CONTEXT_MENTION_PROVIDER, an as SYMBOL_CONTEXT_MENTION_PROVIDER, ao as REMOTE_REPOSITORY_PROVIDER_URI, ap as REMOTE_FILE_PROVIDER_URI, aq as REMOTE_DIRECTORY_PROVIDER_URI, ar as WEB_PROVIDER_URI, t as telemetryRecorder, C as ContextItemSource, bl as lodashExports, cO as truncatePromptString, cP as isS2, cQ as GIT_OPENCTX_PROVIDER_URI, bf as cryptoJsExports, cR as openCtx, aF as URI, cS as MulticastSubject, cT as AsyncSerialScheduler_1, g as getDefaultExportFromCjs, cU as Utils$1, cV as toString_1, cW as upperFirst_1, cX as _, cY as extensionForLanguage, cZ as setClientNameVersion, c_ as base64Js, c as commonjsGlobal, c$ as _baseAssignValue, d0 as eq_1, d1 as isArrayLike_1, d2 as isObjectLike_1, d3 as _copyObject, d4 as keysIn_1, d5 as _cloneBufferExports, d6 as _cloneTypedArray, d7 as _copyArray, d8 as _initCloneObject, d9 as isArguments_1, da as isArray_1, db as isBufferExports, dc as isFunction_1, dd as isObject_1, de as isPlainObject_1, df as isTypedArray_1, dg as _Stack, dh as identity_1, di as _overRest, dj as _setToString, dk as _isIndex, b6 as isSourcegraphToken, bT as CodyAutoSuggestionMode, dl as setExtensionVersion, dm as withLatestFrom, dn as NEVER, dp as abortableOperation, dq as disposableSubscription, dr as setAuthStatusObservable, ds as DOTCOM_URL, dt as normalizeServerEndpointURL, du as SourcegraphGraphQLAPIClient, dv as isNetworkLikeError, dw as resolveAuth, dx as getAuthErrorMessage, dy as SUPPORTED_URI_SCHEMAS, dz as _baseIsEqual, dA as keys_1, dB as _baseGet, dC as _castPath, dD as isLength_1, dE as _toKey, dF as _isKey, dG as toNumber_1, dH as _baseFindIndex, dI as require$$1$4, dJ as NetworkError, dK as isRateLimitError, dL as isAuthError, d as dedent$1, dM as convertGitCloneURLToCodebaseName, bj as isDefined, dN as pluck, dO as TokenCounterUtils, dP as toRangeData, dQ as DefaultChatCommands, dR as pathFunctionsForURI, dS as uriParseNameAndExtension, dT as uriDirname, dU as uriExtname, dV as uriBasename, dW as DefaultEditCommands, dX as subscriptionDisposable, dY as NoOpTelemetryRecorderProvider, dZ as TimestampTelemetryProcessor_1, d_ as updateGlobalTelemetryInstances, d$ as TelemetryRecorderProvider, e0 as telemetryRecorderProvider, e1 as createGitDiff, e2 as catchError$1, e3 as omit$1, e4 as displayPathWithoutWorkspaceFolderPrefix, e5 as getEditorInsertSpaces, e6 as escapeRegExp$1, e7 as isNetworkError, bx as isCodyProModel, e8 as http, be as CodyTaskState, aT as createExtensionAPI, aU as createMessageAPIForWebview, e9 as getAugmentedNamespace, ea as main$1, eb as firstNonPendingAuthStatus, ec as TESTING_TELEMETRY_EXPORTER, ed as dist, ee as checkIfEnterpriseUser, ef as currentAuthStatusAuthed, eg as waitUntilComplete, bA as isMacOS, bv as CustomCommandType, bW as setDisplayPathEnvInfo, eh as isWindows, ei as currentAuthStatusOrNotReadyYet, ej as currentUserProductSubscription, bD as ACCOUNT_USAGE_URL, aV as debounce$1, as as displayPath, ek as structuredPatch, el as isDotComAuthed, em as dedupeWith$1, en as AbortError, eo as TimeoutError, ep as createDisposables, eq as getClientInfoQueryParams, er as tracer, es as getClientIdentificationHeaders, et as logResponseHeadersToSpan, eu as getActiveTraceAndSpanId, ev as TracedError, ew as isNodeResponse, b9 as SpanStatusCode, bh as RateLimitError$2, ex as createTwoFilesPatch, ey as getEditorTabSize$1, ez as isFreeUser, eA as _baseGetTag, eB as truncateTextNearestLine, eC as MAX_BYTES_PER_FILE, eD as debounce_1, bU as isErrorLike, eE as TokenCounter, eF as mentionProvidersMetadata, eG as expandToLineRange, av as displayPathBasename, at as displayLineRange, aP as parseMentionQuery, eH as openCtxProviderMetadata, eI as editorStateFromPromptString, eJ as getTokenCounterUtils, eK as inputTextWithoutContextChipsFromPromptEditorState, bp as isAbortErrorOrSocketHangUp, eL as PromptMode, eM as skip$1, b8 as context$1, eN as extractContextFromTraceparent, bK as inputTextWithMappedContextChipsFromPromptEditorState, eO as isContextWindowLimitError, b3 as forceHydration, bo as reformatBotMessageForChat, b4 as hydrateAfterPostMessage, eP as addMessageListenersForExtensionAPI, eQ as createMessageAPIForExtension, bw as View, eR as CODY_BLOG_URL_o1_WAITLIST, eS as CODY_PASSTHROUGH_VSCODE_OPEN_COMMAND_ID, bu as pluralize, eT as assertFileURI, eU as setOpenCtx, eV as createCodeSearchProvider, eW as CODE_SEARCH_PROVIDER_URI, eX as psDedent, eY as languageFromFilename, eZ as ProgrammingLanguage, e_ as truncatePromptStringStart, e$ as MAX_CURRENT_FILE_TOKENS, f0 as posixFilePaths, f1 as SURROUNDING_LINES, f2 as ACCOUNT_UPGRADE_URL, a_ as scanForMentionTriggerInUserTextInput, ax as LARGE_FILE_WARNING_LABEL, f3 as GENERAL_HELP_LABEL, f4 as diffLines, f5 as CODY_SUPPORT_URL, f6 as CODY_DOC_URL, bi as CODY_FEEDBACK_URL, f7 as DISCORD_URL, bz as getRelativeChatPeriod, f8 as globalAgentRef, f9 as VSCODE_CHANGELOG_URL, fa as SG_CHANGELOG_URL, fb as ACCOUNT_LIMITS_INFO_URL, fc as assertUnreachable, fd as promise, fe as setLogger, ff as setClientCapabilities, fg as setResolvedConfigurationObservable, fh as CODY_OLLAMA_DOCS_URL, bS as browser$3 } from "./browser-mfOl2gpJ.mjs";
21
+ import { aS as Observable, bZ as unsubscribe, b_ as AsyncSerialScheduler, b$ as authStatus, c0 as debounceTime, c1 as switchMapReplayOperation, c2 as interval, c3 as map$1, c4 as filter$3, c5 as startWith$1, c6 as switchMap$1, c7 as promiseFactoryToObservable, bg as isError$3, c8 as distinctUntilChanged$1, bG as firstValueFrom$1, bH as skipPendingOperation, c9 as logDebug$1, ca as graphqlClient, cb as isAbortError, cc as logError$2, cd as semver, ce as pendingOperation, cf as pick, bq as ModelTag, cg as getModelInfo, bQ as CHAT_INPUT_TOKEN_BUDGET, ch as CHAT_OUTPUT_TOKEN_BUDGET, ci as EXTENDED_CHAT_INPUT_TOKEN_BUDGET, cj as EXTENDED_USER_CONTEXT_TOKEN_BUDGET, ck as createSubscriber, cl as fromVSCodeEvent, aZ as isEqual, cm as cenv, b5 as isDotCom, cn as currentAuthStatus, co as isFileURI, w as wrapInActiveSpan, cp as INCLUDE_EVERYTHING_CONTEXT_FILTERS, cq as EXCLUDE_EVERYTHING_CONTEXT_FILTERS, cr as onAbort, cs as addCodyClientIdentificationHeaders, ct as addAuthHeaders, cu as addTraceparent, cv as fetch$3, cw as verifyResponseCode, cx as combineLatest$1, cy as take$2, cz as clientCapabilities, cA as shareReplay$1, cB as tap$2, cC as featureFlagProvider, ba as FeatureFlag, cD as getEnterpriseContextWindow, cE as ANSWER_TOKENS, cF as storeLastValue, cG as resolvedConfig, cH as userProductSubscription, bB as firstResultFromOperation, cI as isEnterpriseUser, bc as isCodyProUser, p as ps, cJ as currentResolvedConfig, bV as PromptString, bd as CodyIDE, cK as isCustomModel, cL as recordErrorToSpan, cM as addClientInfoParams, cN as dependentAbortController, am as FILE_CONTEXT_MENTION_PROVIDER, an as SYMBOL_CONTEXT_MENTION_PROVIDER, ao as REMOTE_REPOSITORY_PROVIDER_URI, ap as REMOTE_FILE_PROVIDER_URI, aq as REMOTE_DIRECTORY_PROVIDER_URI, ar as WEB_PROVIDER_URI, t as telemetryRecorder, C as ContextItemSource, bl as lodashExports, cO as truncatePromptString, cP as isS2, cQ as GIT_OPENCTX_PROVIDER_URI, bf as cryptoJsExports, cR as openCtx, aF as URI, cS as MulticastSubject, cT as AsyncSerialScheduler_1, g as getDefaultExportFromCjs, cU as Utils$1, cV as toString_1, cW as upperFirst_1, cX as _, cY as extensionForLanguage, cZ as setClientNameVersion, c_ as base64Js, c as commonjsGlobal, c$ as _baseAssignValue, d0 as eq_1, d1 as isArrayLike_1, d2 as isObjectLike_1, d3 as _copyObject, d4 as keysIn_1, d5 as _cloneBufferExports, d6 as _cloneTypedArray, d7 as _copyArray, d8 as _initCloneObject, d9 as isArguments_1, da as isArray_1, db as isBufferExports, dc as isFunction_1, dd as isObject_1, de as isPlainObject_1, df as isTypedArray_1, dg as _Stack, dh as identity_1, di as _overRest, dj as _setToString, dk as _isIndex, b6 as isSourcegraphToken, bT as CodyAutoSuggestionMode, dl as setExtensionVersion, dm as withLatestFrom, dn as NEVER, dp as abortableOperation, dq as disposableSubscription, dr as setAuthStatusObservable, ds as DOTCOM_URL, dt as normalizeServerEndpointURL, du as SourcegraphGraphQLAPIClient, dv as isNetworkLikeError, dw as resolveAuth, dx as getAuthErrorMessage, dy as isWorkspaceInstance, dz as SUPPORTED_URI_SCHEMAS, dA as _baseIsEqual, dB as keys_1, dC as _baseGet, dD as _castPath, dE as isLength_1, dF as _toKey, dG as _isKey, dH as toNumber_1, dI as _baseFindIndex, dJ as require$$1$4, dK as NetworkError, dL as isRateLimitError, dM as isAuthError, d as dedent$1, dN as convertGitCloneURLToCodebaseName, bj as isDefined, dO as pluck, dP as TokenCounterUtils, dQ as toRangeData, dR as DefaultChatCommands, dS as pathFunctionsForURI, dT as uriParseNameAndExtension, dU as uriDirname, dV as uriExtname, dW as uriBasename, dX as DefaultEditCommands, dY as subscriptionDisposable, dZ as NoOpTelemetryRecorderProvider, d_ as TimestampTelemetryProcessor_1, d$ as updateGlobalTelemetryInstances, e0 as TelemetryRecorderProvider, e1 as telemetryRecorderProvider, e2 as createGitDiff, e3 as catchError$1, e4 as omit$1, e5 as displayPathWithoutWorkspaceFolderPrefix, e6 as getEditorInsertSpaces, e7 as escapeRegExp$1, e8 as isNetworkError, bx as isCodyProModel, e9 as http, be as CodyTaskState, aT as createExtensionAPI, aU as createMessageAPIForWebview, ea as getAugmentedNamespace, eb as main$1, ec as firstNonPendingAuthStatus, ed as TESTING_TELEMETRY_EXPORTER, ee as dist, ef as checkIfEnterpriseUser, eg as currentAuthStatusAuthed, eh as waitUntilComplete, bA as isMacOS, bv as CustomCommandType, bW as setDisplayPathEnvInfo, ei as isWindows, ej as currentAuthStatusOrNotReadyYet, ek as currentUserProductSubscription, bD as ACCOUNT_USAGE_URL, aV as debounce$1, as as displayPath, el as structuredPatch, em as isDotComAuthed, en as dedupeWith$1, eo as AbortError, ep as TimeoutError, eq as createDisposables, er as getClientInfoQueryParams, es as tracer, et as getClientIdentificationHeaders, eu as logResponseHeadersToSpan, ev as getActiveTraceAndSpanId, ew as TracedError, ex as isNodeResponse, b9 as SpanStatusCode, bh as RateLimitError$2, ey as createTwoFilesPatch, ez as getEditorTabSize$1, eA as isFreeUser, eB as _baseGetTag, eC as truncateTextNearestLine, eD as MAX_BYTES_PER_FILE, eE as debounce_1, bU as isErrorLike, eF as TokenCounter, eG as mentionProvidersMetadata, eH as expandToLineRange, av as displayPathBasename, at as displayLineRange, aP as parseMentionQuery, eI as openCtxProviderMetadata, eJ as editorStateFromPromptString, eK as getTokenCounterUtils, eL as inputTextWithoutContextChipsFromPromptEditorState, bp as isAbortErrorOrSocketHangUp, eM as PromptMode, eN as skip$1, b8 as context$1, eO as extractContextFromTraceparent, bK as inputTextWithMappedContextChipsFromPromptEditorState, eP as isContextWindowLimitError, b3 as forceHydration, bo as reformatBotMessageForChat, b4 as hydrateAfterPostMessage, eQ as addMessageListenersForExtensionAPI, eR as createMessageAPIForExtension, bw as View, eS as CODY_BLOG_URL_o1_WAITLIST, eT as CODY_PASSTHROUGH_VSCODE_OPEN_COMMAND_ID, bu as pluralize, eU as assertFileURI, eV as setOpenCtx, eW as createCodeSearchProvider, eX as CODE_SEARCH_PROVIDER_URI, eY as psDedent, eZ as languageFromFilename, e_ as ProgrammingLanguage, e$ as truncatePromptStringStart, f0 as MAX_CURRENT_FILE_TOKENS, f1 as posixFilePaths, f2 as SURROUNDING_LINES, f3 as ACCOUNT_UPGRADE_URL, a_ as scanForMentionTriggerInUserTextInput, ax as LARGE_FILE_WARNING_LABEL, f4 as GENERAL_HELP_LABEL, f5 as diffLines, f6 as CODY_SUPPORT_URL, f7 as CODY_DOC_URL, bi as CODY_FEEDBACK_URL, f8 as DISCORD_URL, bz as getRelativeChatPeriod, f9 as globalAgentRef, fa as VSCODE_CHANGELOG_URL, fb as SG_CHANGELOG_URL, fc as ACCOUNT_LIMITS_INFO_URL, fd as assertUnreachable, fe as promise, ff as setLogger, fg as setClientCapabilities, fh as setResolvedConfigurationObservable, fi as CODY_OLLAMA_DOCS_URL, bS as browser$3 } from "./browser-C8ruBrnx.mjs";
22
22
  import { execSync, exec } from "./child_process-C6OZyNb4.mjs";
23
- import { r as requireUtil, i as inherits_browserExports, a as utilExports } from "./util-B6KeX3WC.mjs";
23
+ import { a as util$4, i as inherits_browserExports } from "./util-CBKiMezg.mjs";
24
24
  var NOTHING = Symbol.for("immer-nothing");
25
25
  var DRAFTABLE = Symbol.for("immer-draftable");
26
26
  var DRAFT_STATE = Symbol.for("immer-state");
@@ -11687,19 +11687,20 @@ const events$2 = [
11687
11687
  metadata: pickDefined({
11688
11688
  userSpecifiedIntent: params.userSpecifiedIntent ? map2.intent(params.userSpecifiedIntent) : void 0,
11689
11689
  detectedIntent: params.detectedIntent ? map2.intent(params.detectedIntent) : void 0,
11690
+ // Each intent is mapped to a `detectedIntentScores.{intent}` field inside the metadata
11691
+ ...(_a3 = params.detectedIntentScores) == null ? void 0 : _a3.reduce(
11692
+ (scores, intentScore) => {
11693
+ scores["detectedIntentScores." + intentScore.intent] = intentScore.score;
11694
+ return scores;
11695
+ },
11696
+ {}
11697
+ ),
11690
11698
  // TODO: Remove this field when the transition from commands to prompts is complete
11691
11699
  isCommand: params.command ? 1 : 0,
11692
11700
  ...metadata2,
11693
11701
  recordsPrivateMetadataTranscript: recordTranscript ? 1 : 0
11694
11702
  }),
11695
11703
  privateMetadata: {
11696
- detectedIntentScores: ((_a3 = params.detectedIntentScores) == null ? void 0 : _a3.length) ? params.detectedIntentScores.reduce(
11697
- (scores, value) => {
11698
- scores[value.intent] = value.score;
11699
- return scores;
11700
- },
11701
- {}
11702
- ) : void 0,
11703
11704
  detectedIntent: params.detectedIntent,
11704
11705
  // TODO: Remove this field when the transition from commands to prompts is complete
11705
11706
  command: params.command,
@@ -11725,6 +11726,8 @@ const events$2 = [
11725
11726
  },
11726
11727
  {
11727
11728
  intent: {
11729
+ // This mapping must remain stable to avoid breaking the telemetry data.
11730
+ // Do not remove intents without putting in a placeholder.
11728
11731
  [fallbackValue]: 0,
11729
11732
  auto: 1,
11730
11733
  chat: 2,
@@ -11734,13 +11737,6 @@ const events$2 = [
11734
11737
  }
11735
11738
  }
11736
11739
  )
11737
- // //TODO
11738
- // event(
11739
- // 'cody.chat-question/response',
11740
- // ({ feature, action }) =>
11741
- // () => {},
11742
- // {}
11743
- // ),
11744
11740
  ];
11745
11741
  function publicContextSummary(globalPrefix, context2) {
11746
11742
  const global2 = lodashExports.cloneDeep(defaultSharedItemCount);
@@ -24780,7 +24776,7 @@ function requireBuffer_list() {
24780
24776
  return (hint === "string" ? String : Number)(input);
24781
24777
  }
24782
24778
  var _require = requireBuffer(), Buffer2 = _require.Buffer;
24783
- var _require2 = requireUtil(), inspect = _require2.inspect;
24779
+ var _require2 = util$4, inspect = _require2.inspect;
24784
24780
  var custom = inspect && inspect.custom || "inspect";
24785
24781
  function copyBuffer(src, target, offset2) {
24786
24782
  Buffer2.prototype.copy.call(src, target, offset2);
@@ -26372,7 +26368,7 @@ function require_stream_readable() {
26372
26368
  function _isUint8Array(obj) {
26373
26369
  return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
26374
26370
  }
26375
- var debugUtil = requireUtil();
26371
+ var debugUtil = util$4;
26376
26372
  var debug2;
26377
26373
  if (debugUtil && debugUtil.debuglog) {
26378
26374
  debug2 = debugUtil.debuglog("stream");
@@ -28639,6 +28635,21 @@ function closeAuthProgressIndicator() {
28639
28635
  runningAuthProgressIndicator == null ? void 0 : runningAuthProgressIndicator();
28640
28636
  runningAuthProgressIndicator = null;
28641
28637
  }
28638
+ async function showEnterpriseInstanceUrlFlow(endpoint) {
28639
+ const { configuration: configuration2 } = await currentResolvedConfig();
28640
+ const auth = await resolveAuth(endpoint, configuration2, secretStorage);
28641
+ const authStatus2 = await authProvider.validateAndStoreCredentials(auth, "store-if-valid");
28642
+ if (!(authStatus2 == null ? void 0 : authStatus2.authenticated)) {
28643
+ const instanceUrl = await showInstanceURLInputBox(endpoint);
28644
+ if (!instanceUrl) {
28645
+ return;
28646
+ }
28647
+ authProvider.setAuthPendingToEndpoint(instanceUrl);
28648
+ redirectToEndpointLogin(instanceUrl);
28649
+ } else {
28650
+ await showAuthResultMessage(endpoint, authStatus2);
28651
+ }
28652
+ }
28642
28653
  async function showSignInMenu(type, uri) {
28643
28654
  const authStatus2 = currentAuthStatus();
28644
28655
  const mode = authStatus2.authenticated ? "switch" : "signin";
@@ -28718,12 +28729,12 @@ async function showAuthMenu(type) {
28718
28729
  ];
28719
28730
  return window$1.showQuickPick(optionItems, AuthMenuOptions[type]);
28720
28731
  }
28721
- async function showInstanceURLInputBox(title) {
28732
+ async function showInstanceURLInputBox(url) {
28722
28733
  const result = await window$1.showInputBox({
28723
- title,
28734
+ title: "Connect to a Sourcegraph instance",
28724
28735
  prompt: "Enter the URL of the Sourcegraph instance. For example, https://sourcegraph.example.com.",
28725
28736
  placeHolder: "https://sourcegraph.example.com",
28726
- value: "https://",
28737
+ value: url ?? "https://",
28727
28738
  password: false,
28728
28739
  ignoreFocusOut: true,
28729
28740
  // valide input to ensure the user is not entering a token as URL
@@ -28850,6 +28861,12 @@ async function tokenCallbackHandler(uri) {
28850
28861
  const params = new URLSearchParams(uri.query);
28851
28862
  const token = params.get("code") || params.get("token");
28852
28863
  const endpoint = currentAuthStatus().endpoint;
28864
+ const instanceHost = params.get("instance");
28865
+ const instanceUrl = instanceHost ? new URL(instanceHost).origin : void 0;
28866
+ if (instanceUrl && isWorkspaceInstance(instanceUrl)) {
28867
+ await showEnterpriseInstanceUrlFlow(instanceUrl);
28868
+ return;
28869
+ }
28853
28870
  if (!token || !endpoint) {
28854
28871
  return;
28855
28872
  }
@@ -46015,7 +46032,7 @@ function requireLib() {
46015
46032
  const MurmurHash3 = requireImurmurhash();
46016
46033
  const { onExit } = requireCjs();
46017
46034
  const path2 = pathBrowserify;
46018
- const { promisify: promisify2 } = requireUtil();
46035
+ const { promisify: promisify2 } = util$4;
46019
46036
  const activeFiles = {};
46020
46037
  const threadId = function getId() {
46021
46038
  try {
@@ -49229,7 +49246,7 @@ class CommandsProvider {
49229
49246
  if (!isFileURI(uri)) {
49230
49247
  throw new Error("history only supported on local file paths");
49231
49248
  }
49232
- const { getContextFileFromGitLog } = await import("./git-log-CQBLbIm5.mjs");
49249
+ const { getContextFileFromGitLog } = await import("./git-log-BSwwZCWt.mjs");
49233
49250
  return getContextFileFromGitLog(uri, options);
49234
49251
  }
49235
49252
  dispose() {
@@ -157044,7 +157061,7 @@ async function getContextFromRelativePath(path2) {
157044
157061
  }
157045
157062
  }
157046
157063
  var define_process_default$1 = { env: {} };
157047
- const execAsync = utilExports.promisify(exec);
157064
+ const execAsync = util$4.promisify(exec);
157048
157065
  const HOME_DIR = define_process_default$1.env.HOME || define_process_default$1.env.USERPROFILE || "";
157049
157066
  const OUTPUT_WRAPPER = `
157050
157067
  Terminal output from the \`{command}\` command enclosed between <OUTPUT0412> tags:
@@ -164362,7 +164379,7 @@ class ChatController {
164362
164379
  chatClient: this.chatClient
164363
164380
  });
164364
164381
  recorder2.setIntentInfo({
164365
- userSpecifiedIntent: manuallySelectedIntent ? manuallySelectedIntent : this.featureCodyExperimentalOneBox ? "auto" : "chat",
164382
+ userSpecifiedIntent: manuallySelectedIntent ?? this.featureCodyExperimentalOneBox ? "auto" : "chat",
164366
164383
  detectedIntent,
164367
164384
  detectedIntentScores
164368
164385
  });
@@ -166542,7 +166559,7 @@ function parseMentionURI(uri) {
166542
166559
  }
166543
166560
  }
166544
166561
  async function execFileAsync(program2, args2, { cwd }) {
166545
- const { promisify: promisify2 } = await import("./util-B6KeX3WC.mjs").then((n) => n.u);
166562
+ const { promisify: promisify2 } = await import("./util-CBKiMezg.mjs").then((n) => n.u);
166546
166563
  const { execFile } = await import("./child_process-C6OZyNb4.mjs");
166547
166564
  return promisify2(execFile)(program2, args2, { cwd });
166548
166565
  }
@@ -176241,7 +176258,7 @@ async function registerDebugCommands(context2, disposables) {
176241
176258
  }
176242
176259
  async function tryRegisterTutorial(context2, disposables) {
176243
176260
  if (!isRunningInsideAgent()) {
176244
- const { registerInteractiveTutorial } = await import("./index-Bs5wfOm2.mjs");
176261
+ const { registerInteractiveTutorial } = await import("./index-CAyz-Vhx.mjs");
176245
176262
  registerInteractiveTutorial(context2).then((disposable) => disposables.push(...disposable));
176246
176263
  }
176247
176264
  }
@@ -1,2 +1,2 @@
1
- import "./agent.worker-BUEGtXBz.mjs";
2
- import "./browser-mfOl2gpJ.mjs";
1
+ import "./agent.worker-C1v6q8V7.mjs";
2
+ import "./browser-C8ruBrnx.mjs";