@sourcegraph/cody-web 0.23.1 → 0.24.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,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 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";
21
+ import { aS as Observable, bZ as unsubscribe, b_ as AsyncSerialScheduler, b$ as MulticastSubject, bF as firstValueFrom$1, bH as skipPendingOperation, c0 as authStatus, c1 as debounceTime, c2 as switchMapReplayOperation, c3 as interval, c4 as map$1, c5 as filter$3, c6 as startWith$1, c7 as switchMap$1, c8 as promiseFactoryToObservable, bg as isError$3, c9 as distinctUntilChanged$1, ca as logDebug$1, cb as graphqlClient, cc as isAbortError, cd as logError$2, ce as semver, cf as pendingOperation, cg as pick, bq as ModelTag, ch as getModelInfo, bQ as CHAT_INPUT_TOKEN_BUDGET, ci as CHAT_OUTPUT_TOKEN_BUDGET, cj as EXTENDED_CHAT_INPUT_TOKEN_BUDGET, ck as EXTENDED_USER_CONTEXT_TOKEN_BUDGET, cl as createSubscriber, cm as fromVSCodeEvent, aZ as isEqual, cn as cenv, b5 as isDotCom, co as currentAuthStatus, cp as isFileURI, w as wrapInActiveSpan, cq as INCLUDE_EVERYTHING_CONTEXT_FILTERS, cr as EXCLUDE_EVERYTHING_CONTEXT_FILTERS, cs as onAbort, ct as addCodyClientIdentificationHeaders, cu as addTraceparent, cv as addAuthHeaders, cw as fetch$3, cx as verifyResponseCode, cy as combineLatest$1, cz as take$2, cA as clientCapabilities, cB as shareReplay$1, cC as tap$2, cD as featureFlagProvider, ba as FeatureFlag, cE as getEnterpriseContextWindow, cF as ANSWER_TOKENS, cG as storeLastValue, cH as resolvedConfig, cI as userProductSubscription, bB as firstResultFromOperation, cJ as isEnterpriseUser, bc as isCodyProUser, p as ps, cK as currentResolvedConfig, bV as PromptString, bd as CodyIDE, cL as isCustomModel, cM as recordErrorToSpan, cN as addClientInfoParams, cO 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, cP as truncatePromptString, cQ as isS2, cR as GIT_OPENCTX_PROVIDER_URI, bf as cryptoJsExports, cS as openCtx, aF as URI, 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 isExternalProviderAuthError, dw as isNetworkLikeError, dx as resolveAuth, dy as getAuthErrorMessage, dz as isWorkspaceInstance, dA as SUPPORTED_URI_SCHEMAS, dB as _baseIsEqual, dC as keys_1, dD as _baseGet, dE as _castPath, dF as isLength_1, dG as _toKey, dH as _isKey, dI as toNumber_1, dJ as _baseFindIndex, dK as require$$1$4, dL as NetworkError, dM as isRateLimitError, dN as isAuthError, d as dedent$1, dO as convertGitCloneURLToCodebaseName, bj as isDefined, dP as pluck, dQ as TokenCounterUtils, dR as toRangeData, dS as DefaultChatCommands, dT as pathFunctionsForURI, dU as uriParseNameAndExtension, dV as uriDirname, dW as uriExtname, dX as uriBasename, dY as DefaultEditCommands, dZ as subscriptionDisposable, d_ as NoOpTelemetryRecorderProvider, d$ as TimestampTelemetryProcessor_1, e0 as updateGlobalTelemetryInstances, e1 as TelemetryRecorderProvider, e2 as telemetryRecorderProvider, e3 as createGitDiff, e4 as catchError$1, e5 as omit$1, e6 as displayPathWithoutWorkspaceFolderPrefix, e7 as getEditorInsertSpaces, e8 as escapeRegExp$1, e9 as isNetworkError, bx as isCodyProModel, ea as http, be as CodyTaskState, aT as createExtensionAPI, aU as createMessageAPIForWebview, eb as getAugmentedNamespace, ec as main$1, ed as firstNonPendingAuthStatus, ee as TESTING_TELEMETRY_EXPORTER, ef as dist, eg as checkIfEnterpriseUser, eh as currentAuthStatusAuthed, ei as waitUntilComplete, bA as isMacOS, bv as CustomCommandType, bW as setDisplayPathEnvInfo, ej as isWindows, ek as currentAuthStatusOrNotReadyYet, el as currentUserProductSubscription, bD as ACCOUNT_USAGE_URL, aV as debounce$1, as as displayPath, em as structuredPatch, en as isDotComAuthed, eo as dedupeWith$1, ep as AbortError, eq as TimeoutError, er as createDisposables, es as getClientInfoQueryParams, et as tracer, eu as getClientIdentificationHeaders, ev as logResponseHeadersToSpan, ew as getActiveTraceAndSpanId, ex as TracedError, ey as isNodeResponse, b9 as SpanStatusCode, bh as RateLimitError$2, ez as createTwoFilesPatch, eA as getEditorTabSize$1, eB as isFreeUser, eC as _baseGetTag, eD as truncateTextNearestLine, eE as MAX_BYTES_PER_FILE, eF as debounce_1, bU as isErrorLike, eG as TokenCounter, eH as mentionProvidersMetadata, eI as expandToLineRange, av as displayPathBasename, at as displayLineRange, aP as parseMentionQuery, eJ as openCtxProviderMetadata, eK as editorStateFromPromptString, eL as getTokenCounterUtils, eM as inputTextWithoutContextChipsFromPromptEditorState, bp as isAbortErrorOrSocketHangUp, eN as PromptMode, eO as skip$1, b8 as context$1, eP as extractContextFromTraceparent, bK as inputTextWithMappedContextChipsFromPromptEditorState, eQ as isContextWindowLimitError, b3 as forceHydration, bo as reformatBotMessageForChat, b4 as hydrateAfterPostMessage, eR as addMessageListenersForExtensionAPI, eS as createMessageAPIForExtension, bw as View, eT as CODY_BLOG_URL_o1_WAITLIST, eU as CODY_PASSTHROUGH_VSCODE_OPEN_COMMAND_ID, bu as pluralize, eV as assertFileURI, eW as setOpenCtx, eX as createCodeSearchProvider, eY as CODE_SEARCH_PROVIDER_URI, eZ as psDedent, e_ as languageFromFilename, e$ as ProgrammingLanguage, f0 as truncatePromptStringStart, f1 as MAX_CURRENT_FILE_TOKENS, f2 as posixFilePaths, f3 as SURROUNDING_LINES, f4 as ACCOUNT_UPGRADE_URL, a_ as scanForMentionTriggerInUserTextInput, ax as LARGE_FILE_WARNING_LABEL, f5 as GENERAL_HELP_LABEL, f6 as diffLines, f7 as CODY_SUPPORT_URL, f8 as CODY_DOC_URL, bi as CODY_FEEDBACK_URL, f9 as DISCORD_URL, bz as getRelativeChatPeriod, fa as globalAgentRef, fb as VSCODE_CHANGELOG_URL, fc as SG_CHANGELOG_URL, fd as ACCOUNT_LIMITS_INFO_URL, fe as assertUnreachable, ff as promise, fg as setLogger, fh as setClientCapabilities, fi as setResolvedConfigurationObservable, fj as CODY_OLLAMA_DOCS_URL, bS as browser$3 } from "./browser-DRpAM7mB.mjs";
22
22
  import { execSync, exec } from "./child_process-C6OZyNb4.mjs";
23
- import { a as util$4, i as inherits_browserExports } from "./util-CBKiMezg.mjs";
23
+ import { r as requireUtil, i as inherits_browserExports, a as utilExports } from "./util-DeyYSaNB.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");
@@ -698,6 +698,35 @@ function filter$2(test) {
698
698
  });
699
699
  };
700
700
  }
701
+ function merge$2(...observables) {
702
+ if (observables.length === 0) {
703
+ return Observable.from([]);
704
+ }
705
+ return new Observable((observer) => {
706
+ let completed = 0;
707
+ const subscriptions = observables.map((input) => {
708
+ return input.subscribe({
709
+ error(error) {
710
+ observer.error(error);
711
+ unsubscribeAll();
712
+ },
713
+ next(value) {
714
+ observer.next(value);
715
+ },
716
+ complete() {
717
+ if (++completed === observables.length) {
718
+ observer.complete();
719
+ unsubscribeAll();
720
+ }
721
+ }
722
+ });
723
+ });
724
+ const unsubscribeAll = () => {
725
+ subscriptions.forEach((subscription) => unsubscribe(subscription));
726
+ };
727
+ return unsubscribeAll;
728
+ });
729
+ }
701
730
  var define_process_default$p = { env: {} };
702
731
  let _editorWindowIsFocused;
703
732
  function setEditorWindowIsFocused(editorWindowIsFocused2) {
@@ -723,11 +752,15 @@ const _ClientConfigSingleton = class _ClientConfigSingleton {
723
752
  commands: true,
724
753
  attribution: false
725
754
  });
755
+ __publicField2(this, "forceUpdateSubject", new MulticastSubject());
726
756
  /**
727
757
  * An observable that immediately emits the last-cached value (or fetches it if needed) and then
728
758
  * emits changes.
729
759
  */
730
- __publicField2(this, "changes", authStatus.pipe(
760
+ __publicField2(this, "changes", merge$2(
761
+ authStatus,
762
+ this.forceUpdateSubject
763
+ ).pipe(
731
764
  debounceTime(0),
732
765
  // wait a tick for graphqlClient's auth to be updated
733
766
  switchMapReplayOperation(
@@ -750,6 +783,17 @@ const _ClientConfigSingleton = class _ClientConfigSingleton {
750
783
  distinctUntilChanged$1()
751
784
  ));
752
785
  }
786
+ /**
787
+ * Forces an immediate update of the client configuration by triggering a new fetch.
788
+ * This method is called when temporary settings are edited from the client to ensure
789
+ * the configuration is immediately synchronized with the latest changes.
790
+ *
791
+ * @returns A promise that resolves to the updated CodyClientConfig or undefined
792
+ */
793
+ async forceUpdate() {
794
+ this.forceUpdateSubject.next(true);
795
+ return firstValueFrom$1(this.changes.pipe(skipPendingOperation()));
796
+ }
753
797
  // Static method to get the singleton instance
754
798
  static getInstance() {
755
799
  if (!_ClientConfigSingleton.instance) {
@@ -798,23 +842,33 @@ const _ClientConfigSingleton = class _ClientConfigSingleton {
798
842
  }).then((clientConfig) => {
799
843
  signal2 == null ? void 0 : signal2.throwIfAborted();
800
844
  logDebug$1("ClientConfigSingleton", "refreshed", JSON.stringify(clientConfig));
801
- return graphqlClient.viewerSettings(signal2).then((viewerSettings) => {
802
- if (isError$3(viewerSettings)) {
803
- return { ...clientConfig, notices: [] };
804
- }
805
- return {
845
+ return Promise.all([
846
+ graphqlClient.viewerSettings(signal2),
847
+ graphqlClient.temporarySettings(signal2)
848
+ ]).then(([viewerSettings, temporarySettings]) => {
849
+ const config = {
806
850
  ...clientConfig,
807
- // Make sure that notice object will have all important field (notices come from
808
- // instance global JSONC configuration so they can have any arbitrary field values.
809
- notices: Array.from(
851
+ intentDetection: "enabled",
852
+ notices: [],
853
+ temporarySettings: {}
854
+ };
855
+ if (!isError$3(viewerSettings)) {
856
+ config.intentDetection = ["disabled", "enabled", "opt-in"].includes(
857
+ viewerSettings["omnibox.intentDetection"]
858
+ ) ? viewerSettings["omnibox.intentDetection"] : "enabled";
859
+ config.notices = Array.from(
810
860
  viewerSettings["cody.notices"] ?? [],
811
861
  (notice, index2) => ({
812
862
  key: (notice == null ? void 0 : notice.key) ?? index2.toString(),
813
863
  title: (notice == null ? void 0 : notice.title) ?? "",
814
864
  message: (notice == null ? void 0 : notice.message) ?? ""
815
865
  })
816
- )
817
- };
866
+ );
867
+ }
868
+ if (!isError$3(temporarySettings)) {
869
+ config.temporarySettings = temporarySettings;
870
+ }
871
+ return config;
818
872
  });
819
873
  }).catch((e) => {
820
874
  if (!isAbortError(e)) {
@@ -835,9 +889,11 @@ const _ClientConfigSingleton = class _ClientConfigSingleton {
835
889
  attributionEnabled: features2.attribution,
836
890
  smartContextWindowEnabled: smartContextWindow,
837
891
  // Things that did not exist before logically default to disabled.
892
+ intentDetection: "disabled",
838
893
  modelsAPIEnabled: false,
839
894
  userShouldUseEnterprise: false,
840
- notices: []
895
+ notices: [],
896
+ temporarySettings: {}
841
897
  };
842
898
  }
843
899
  // Fetches the config features from the server and handles errors, using the old/legacy GraphQL API.
@@ -7957,14 +8013,18 @@ class RestClient {
7957
8013
  }
7958
8014
  // Make an authenticated HTTP request to the Sourcegraph instance.
7959
8015
  // "name" is a developer-friendly term to label the request's trace span.
7960
- getRequest(name2, urlSuffix, signal2) {
8016
+ async getRequest(name2, urlSuffix, signal2) {
7961
8017
  const headers = new Headers(this.customHeaders);
7962
8018
  const endpoint = new URL(this.auth.serverEndpoint);
7963
8019
  endpoint.pathname = urlSuffix;
7964
8020
  const url = endpoint.href;
7965
8021
  addCodyClientIdentificationHeaders(headers);
7966
- addAuthHeaders(this.auth, headers, endpoint);
7967
8022
  addTraceparent(headers);
8023
+ try {
8024
+ await addAuthHeaders(this.auth, headers, endpoint);
8025
+ } catch (error) {
8026
+ return error;
8027
+ }
7968
8028
  return wrapInActiveSpan(
7969
8029
  `rest-api.${name2}`,
7970
8030
  () => fetch$3(url, {
@@ -11406,8 +11466,15 @@ class SourcegraphBrowserCompletionsClient extends SourcegraphCompletionsClient {
11406
11466
  ...requestParams.customHeaders
11407
11467
  });
11408
11468
  addCodyClientIdentificationHeaders(headersInstance);
11409
- addAuthHeaders(config.auth, headersInstance, url);
11410
11469
  headersInstance.set("Content-Type", "application/json; charset=utf-8");
11470
+ try {
11471
+ await addAuthHeaders(config.auth, headersInstance, url);
11472
+ } catch (error) {
11473
+ cb.onError(error.message);
11474
+ abort2.abort();
11475
+ console.error(error);
11476
+ return;
11477
+ }
11411
11478
  const parameters = new URLSearchParams(globalThis.location.search);
11412
11479
  const trace = parameters.get("trace");
11413
11480
  if (trace) {
@@ -11485,11 +11552,11 @@ class SourcegraphBrowserCompletionsClient extends SourcegraphCompletionsClient {
11485
11552
  ...requestParams.customHeaders
11486
11553
  });
11487
11554
  addCodyClientIdentificationHeaders(headersInstance);
11488
- addAuthHeaders(auth, headersInstance, url);
11489
11555
  if (new URLSearchParams(globalThis.location.search).get("trace")) {
11490
11556
  headersInstance.set("X-Sourcegraph-Should-Trace", "true");
11491
11557
  }
11492
11558
  try {
11559
+ await addAuthHeaders(auth, headersInstance, url);
11493
11560
  const response = await fetch(url.toString(), {
11494
11561
  method: "POST",
11495
11562
  headers: headersInstance,
@@ -19054,6 +19121,7 @@ const dependencies = {
19054
19121
  "@radix-ui/react-popover": "^1.0.7",
19055
19122
  "@radix-ui/react-progress": "^1.1.0",
19056
19123
  "@radix-ui/react-slot": "^1.0.2",
19124
+ "@radix-ui/react-switch": "^1.1.2",
19057
19125
  "@radix-ui/react-tabs": "^1.1.0",
19058
19126
  "@radix-ui/react-tooltip": "^1.0.7",
19059
19127
  "@sentry/browser": "^7.107.0",
@@ -24776,7 +24844,7 @@ function requireBuffer_list() {
24776
24844
  return (hint === "string" ? String : Number)(input);
24777
24845
  }
24778
24846
  var _require = requireBuffer(), Buffer2 = _require.Buffer;
24779
- var _require2 = util$4, inspect = _require2.inspect;
24847
+ var _require2 = requireUtil(), inspect = _require2.inspect;
24780
24848
  var custom = inspect && inspect.custom || "inspect";
24781
24849
  function copyBuffer(src, target, offset2) {
24782
24850
  Buffer2.prototype.copy.call(src, target, offset2);
@@ -26368,7 +26436,7 @@ function require_stream_readable() {
26368
26436
  function _isUint8Array(obj) {
26369
26437
  return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
26370
26438
  }
26371
- var debugUtil = util$4;
26439
+ var debugUtil = requireUtil();
26372
26440
  var debug2;
26373
26441
  if (debugUtil && debugUtil.debuglog) {
26374
26442
  debug2 = debugUtil.debuglog("stream");
@@ -28945,7 +29013,6 @@ async function validateCredentials(config, signal2, clientConfig) {
28945
29013
  pendingValidation: false,
28946
29014
  error: {
28947
29015
  type: "auth-config-error",
28948
- title: "Auth config error",
28949
29016
  message: ((_a3 = config.auth.error) == null ? void 0 : _a3.message) ?? config.auth.error
28950
29017
  }
28951
29018
  };
@@ -28966,18 +29033,29 @@ async function validateCredentials(config, signal2, clientConfig) {
28966
29033
  try {
28967
29034
  const userInfo = await client.getCurrentUserInfo(signal2);
28968
29035
  signal2 == null ? void 0 : signal2.throwIfAborted();
28969
- if (isError$3(userInfo) && isNetworkLikeError(userInfo)) {
28970
- logDebug(
28971
- "auth",
28972
- `Failed to authenticate to ${config.auth.serverEndpoint} due to likely network error`,
28973
- userInfo.message
28974
- );
28975
- return {
28976
- authenticated: false,
28977
- error: { type: "network-error" },
28978
- endpoint: config.auth.serverEndpoint,
28979
- pendingValidation: false
28980
- };
29036
+ if (isError$3(userInfo)) {
29037
+ if (isExternalProviderAuthError(userInfo)) {
29038
+ logDebug("auth", userInfo.message);
29039
+ return {
29040
+ authenticated: false,
29041
+ error: { type: "external-auth-provider-error", message: userInfo.message },
29042
+ endpoint: config.auth.serverEndpoint,
29043
+ pendingValidation: false
29044
+ };
29045
+ }
29046
+ if (isNetworkLikeError(userInfo)) {
29047
+ logDebug(
29048
+ "auth",
29049
+ `Failed to authenticate to ${config.auth.serverEndpoint} due to likely network error`,
29050
+ userInfo.message
29051
+ );
29052
+ return {
29053
+ authenticated: false,
29054
+ error: { type: "network-error" },
29055
+ endpoint: config.auth.serverEndpoint,
29056
+ pendingValidation: false
29057
+ };
29058
+ }
28981
29059
  }
28982
29060
  if (!userInfo || isError$3(userInfo)) {
28983
29061
  logDebug(
@@ -39568,7 +39646,7 @@ class UpstreamHealthProvider {
39568
39646
  addCodyClientIdentificationHeaders(sharedHeaders);
39569
39647
  const url = new URL("/healthz", auth.serverEndpoint);
39570
39648
  const upstreamHeaders = new Headers(sharedHeaders);
39571
- addAuthHeaders(auth, upstreamHeaders, url);
39649
+ await addAuthHeaders(auth, upstreamHeaders, url);
39572
39650
  const upstreamResult = await wrapInActiveSpan("upstream-latency.upstream", (span2) => {
39573
39651
  span2.setAttribute("sampled", true);
39574
39652
  return measureLatencyToUri(upstreamHeaders, url.toString());
@@ -40047,84 +40125,93 @@ function getLinesContext(params) {
40047
40125
  nextNonEmptyLine
40048
40126
  };
40049
40127
  }
40128
+ const completionsOutputChannelLogger = new Logger("Completions");
40050
40129
  const autocompleteOutputChannelLogger = new Logger("Autocomplete");
40051
- const autocompleteLifecycleOutputChannelLogger = {
40052
- startCompletion(params, endpoint) {
40053
- const outputChannelId = v4();
40054
- const start2 = Date.now();
40055
- const shouldLogFullPrompt = workspace.getConfiguration().get("cody.autocomplete.logFullPrompt", false);
40056
- let hasFinished = false;
40057
- let lastCompletion = "";
40058
- function onError(err2, rawError) {
40059
- if (hasFinished) {
40060
- return;
40061
- }
40062
- hasFinished = true;
40063
- const duration = Date.now() - start2;
40064
- autocompleteOutputChannelLogger.logError(
40065
- "onError",
40066
- `duration:"${duration}ms" endpoint:"${endpoint}" outputChannelId:"${outputChannelId}"`,
40067
- JSON.stringify({
40068
- outputChannelId,
40069
- duration: Date.now() - start2,
40070
- err: err2
40071
- }),
40072
- { verbose: { params } }
40073
- );
40074
- }
40075
- function onComplete({ completion, stopReason }) {
40076
- if (hasFinished) {
40077
- return;
40130
+ function createCompletionLogger(logger2) {
40131
+ return {
40132
+ startCompletion(params, endpoint) {
40133
+ const outputChannelId = v4();
40134
+ const start2 = Date.now();
40135
+ const shouldLogFullPrompt = workspace.getConfiguration().get("cody.autocomplete.logFullPrompt", false);
40136
+ let hasFinished = false;
40137
+ let lastCompletion = "";
40138
+ function onError(err2, rawError) {
40139
+ if (hasFinished) {
40140
+ return;
40141
+ }
40142
+ hasFinished = true;
40143
+ const duration = Date.now() - start2;
40144
+ logger2.logError(
40145
+ "onError",
40146
+ `duration:"${duration}ms" endpoint:"${endpoint}" outputChannelId:"${outputChannelId}"`,
40147
+ JSON.stringify({
40148
+ outputChannelId,
40149
+ duration: Date.now() - start2,
40150
+ err: err2
40151
+ }),
40152
+ { verbose: { params } }
40153
+ );
40078
40154
  }
40079
- hasFinished = true;
40080
- const duration = Date.now() - start2;
40081
- autocompleteOutputChannelLogger.logDebug(
40082
- "onComplete",
40083
- `duration:"${duration}ms" stopReason:"${stopReason}" outputChannelId:"${outputChannelId}"`,
40084
- { verbose: { completion } }
40085
- );
40086
- }
40087
- function onEvents(events2) {
40088
- for (const event2 of events2) {
40089
- switch (event2.type) {
40090
- case "completion":
40091
- lastCompletion = event2.completion;
40092
- break;
40093
- case "error":
40094
- onError(event2.error);
40095
- break;
40096
- case "done":
40097
- onComplete({ completion: lastCompletion });
40098
- break;
40155
+ function onComplete({ completion, stopReason }) {
40156
+ if (hasFinished) {
40157
+ return;
40099
40158
  }
40159
+ hasFinished = true;
40160
+ const duration = Date.now() - start2;
40161
+ logger2.logDebug(
40162
+ "onComplete",
40163
+ `duration:"${duration}ms" stopReason:"${stopReason}" outputChannelId:"${outputChannelId}"`,
40164
+ { verbose: { completion } }
40165
+ );
40100
40166
  }
40101
- }
40102
- return {
40103
- onFetch(httpClientLabel, body2) {
40104
- const bodyToLog = { ...body2 };
40105
- const { stopSequences = [] } = params;
40106
- if (!shouldLogFullPrompt) {
40107
- if ("messages" in body2) {
40108
- bodyToLog.messages = body2.messages.map((message) => {
40109
- return message.text ? shortenPromptForOutputChannel(message.text, stopSequences) : message;
40110
- });
40111
- }
40112
- if ("prompt" in body2) {
40113
- bodyToLog.prompt = shortenPromptForOutputChannel(body2.prompt, stopSequences);
40167
+ function onEvents(events2) {
40168
+ for (const event2 of events2) {
40169
+ switch (event2.type) {
40170
+ case "completion":
40171
+ lastCompletion = event2.completion;
40172
+ break;
40173
+ case "error":
40174
+ onError(event2.error);
40175
+ break;
40176
+ case "done":
40177
+ onComplete({ completion: lastCompletion });
40178
+ break;
40114
40179
  }
40115
40180
  }
40116
- autocompleteOutputChannelLogger.logDebug(
40117
- `${httpClientLabel}:fetch`,
40118
- `endpoint: "${endpoint}" outputChannelId: "${outputChannelId}"`,
40119
- { verbose: bodyToLog }
40120
- );
40121
- },
40122
- onError,
40123
- onComplete,
40124
- onEvents
40125
- };
40126
- }
40127
- };
40181
+ }
40182
+ return {
40183
+ onFetch(httpClientLabel, body2) {
40184
+ const bodyToLog = { ...body2 };
40185
+ const { stopSequences = [] } = params;
40186
+ if (!shouldLogFullPrompt) {
40187
+ if ("messages" in body2) {
40188
+ bodyToLog.messages = body2.messages.map((message) => {
40189
+ return message.text ? shortenPromptForOutputChannel(message.text, stopSequences) : message;
40190
+ });
40191
+ }
40192
+ if ("prompt" in body2) {
40193
+ bodyToLog.prompt = shortenPromptForOutputChannel(body2.prompt, stopSequences);
40194
+ }
40195
+ }
40196
+ logger2.logDebug(
40197
+ `${httpClientLabel}:fetch`,
40198
+ `endpoint: "${endpoint}" outputChannelId: "${outputChannelId}"`,
40199
+ { verbose: bodyToLog }
40200
+ );
40201
+ },
40202
+ onError,
40203
+ onComplete,
40204
+ onEvents
40205
+ };
40206
+ }
40207
+ };
40208
+ }
40209
+ const completionsLifecycleOutputChannelLogger = createCompletionLogger(
40210
+ completionsOutputChannelLogger
40211
+ );
40212
+ const autocompleteLifecycleOutputChannelLogger = createCompletionLogger(
40213
+ autocompleteOutputChannelLogger
40214
+ );
40128
40215
  const MAX_SEGMENT_LENGTH = 200;
40129
40216
  function shortenPromptForOutputChannel(prompt, stopSequences) {
40130
40217
  const stopSequencesWithoutNewLines = stopSequences.filter((seq) => !isNewlineSequence(seq));
@@ -46032,7 +46119,7 @@ function requireLib() {
46032
46119
  const MurmurHash3 = requireImurmurhash();
46033
46120
  const { onExit } = requireCjs();
46034
46121
  const path2 = pathBrowserify;
46035
- const { promisify: promisify2 } = util$4;
46122
+ const { promisify: promisify2 } = requireUtil();
46036
46123
  const activeFiles = {};
46037
46124
  const threadId = function getId() {
46038
46125
  try {
@@ -49246,7 +49333,7 @@ class CommandsProvider {
49246
49333
  if (!isFileURI(uri)) {
49247
49334
  throw new Error("history only supported on local file paths");
49248
49335
  }
49249
- const { getContextFileFromGitLog } = await import("./git-log-BSwwZCWt.mjs");
49336
+ const { getContextFileFromGitLog } = await import("./git-log--I-rJJIH.mjs");
49250
49337
  return getContextFileFromGitLog(uri, options);
49251
49338
  }
49252
49339
  dispose() {
@@ -153466,11 +153553,15 @@ class DefaultCodeCompletionsClient {
153466
153553
  });
153467
153554
  headers.set("Content-Type", "application/json; charset=utf-8");
153468
153555
  addCodyClientIdentificationHeaders(headers);
153469
- addAuthHeaders(auth, headers, url);
153470
153556
  if (tracingFlagEnabled) {
153471
153557
  headers.set("X-Sourcegraph-Should-Trace", "1");
153472
153558
  addTraceparent(headers);
153473
153559
  }
153560
+ try {
153561
+ await addAuthHeaders(auth, headers, url);
153562
+ } catch (error) {
153563
+ throw recordErrorToSpan(span2, error);
153564
+ }
153474
153565
  const isNode = typeof define_process_default$2 !== "undefined";
153475
153566
  const enableStreaming = !!isNode;
153476
153567
  span2.setAttribute("enableStreaming", enableStreaming);
@@ -155468,11 +155559,24 @@ function convertToSpaceIndentation(document2, addedLines) {
155468
155559
  }));
155469
155560
  }
155470
155561
  const tabSize = getEditorTabSize$1(document2.uri, workspace, window$1);
155471
- const tabAsSpace = UNICODE_SPACE$1.repeat(tabSize);
155472
- return addedLines.map((line) => ({
155473
- ...line,
155474
- lineText: line.lineText.replace(/^(\t+)/, (match2) => tabAsSpace.repeat(match2.length))
155475
- }));
155562
+ return addedLines.map((line) => {
155563
+ const newLineText = line.lineText.replace(
155564
+ /^(\t+)/,
155565
+ (match2) => UNICODE_SPACE$1.repeat(match2.length * tabSize)
155566
+ );
155567
+ const newRanges = line.ranges.map(([start2, end]) => {
155568
+ const tabsBeforeStart = (line.lineText.slice(0, start2).match(/\t/g) || []).length;
155569
+ const tabsBeforeEnd = (line.lineText.slice(0, end).match(/\t/g) || []).length;
155570
+ const adjustedStart = start2 + tabsBeforeStart * (tabSize - 1);
155571
+ const adjustedEnd = end + tabsBeforeEnd * (tabSize - 1);
155572
+ return [adjustedStart, adjustedEnd];
155573
+ });
155574
+ return {
155575
+ ...line,
155576
+ lineText: newLineText,
155577
+ ranges: newRanges
155578
+ };
155579
+ });
155476
155580
  }
155477
155581
  function padTrailingWhitespaceBlock(addedLines) {
155478
155582
  let maxLineWidth = 0;
@@ -157061,7 +157165,7 @@ async function getContextFromRelativePath(path2) {
157061
157165
  }
157062
157166
  }
157063
157167
  var define_process_default$1 = { env: {} };
157064
- const execAsync = util$4.promisify(exec);
157168
+ const execAsync = utilExports.promisify(exec);
157065
157169
  const HOME_DIR = define_process_default$1.env.HOME || define_process_default$1.env.USERPROFILE || "";
157066
157170
  const OUTPUT_WRAPPER = `
157067
157171
  Terminal output from the \`{command}\` command enclosed between <OUTPUT0412> tags:
@@ -162806,7 +162910,7 @@ async function doSendTraceData(spanData) {
162806
162910
  }
162807
162911
  const traceUrl = new URL("/-/debug/otlp/v1/traces", auth.serverEndpoint);
162808
162912
  const headers = new Headers({ "Content-Type": "application/json" });
162809
- addAuthHeaders(auth, headers, traceUrl);
162913
+ await addAuthHeaders(auth, headers, traceUrl);
162810
162914
  const response = await fetch$3(traceUrl, {
162811
162915
  method: "POST",
162812
162916
  headers,
@@ -163926,10 +164030,10 @@ class ChatController {
163926
164030
  inputText: PromptString.unsafe_fromUserQuery(message.text),
163927
164031
  mentions: message.contextItems ?? [],
163928
164032
  editorState: message.editorState,
163929
- signal: this.startNewSubmitOrEditOperation(),
164033
+ signal: await this.startNewSubmitOrEditOperation(),
163930
164034
  source: "chat",
163931
- intent: message.intent,
163932
- intentScores: message.intentScores,
164035
+ preDetectedIntent: message.preDetectedIntent,
164036
+ preDetectedIntentScores: message.preDetectedIntentScores,
163933
164037
  manuallySelectedIntent: message.manuallySelectedIntent,
163934
164038
  traceparent: message.traceparent
163935
164039
  });
@@ -163942,8 +164046,8 @@ class ChatController {
163942
164046
  index: message.index ?? void 0,
163943
164047
  contextFiles: message.contextItems ?? [],
163944
164048
  editorState: message.editorState,
163945
- intent: message.intent,
163946
- intentScores: message.intentScores,
164049
+ preDetectedIntent: message.preDetectedIntent,
164050
+ preDetectedIntentScores: message.preDetectedIntentScores,
163947
164051
  manuallySelectedIntent: message.manuallySelectedIntent
163948
164052
  });
163949
164053
  break;
@@ -164244,8 +164348,8 @@ class ChatController {
164244
164348
  signal: signal2,
164245
164349
  source,
164246
164350
  command,
164247
- intent: detectedIntent,
164248
- intentScores: detectedIntentScores,
164351
+ preDetectedIntent,
164352
+ preDetectedIntentScores,
164249
164353
  manuallySelectedIntent,
164250
164354
  traceparent
164251
164355
  }) {
@@ -164267,8 +164371,8 @@ class ChatController {
164267
164371
  this.chatBuilder.addHumanMessage({
164268
164372
  text: inputText,
164269
164373
  editorState,
164270
- intent: detectedIntent,
164271
- manuallySelectedIntent: manuallySelectedIntent ? detectedIntent : void 0,
164374
+ intent: manuallySelectedIntent || preDetectedIntent,
164375
+ manuallySelectedIntent,
164272
164376
  agent: selectedAgent
164273
164377
  });
164274
164378
  this.postViewTranscript({ speaker: "assistant" });
@@ -164283,8 +164387,8 @@ class ChatController {
164283
164387
  signal: signal2,
164284
164388
  source,
164285
164389
  command,
164286
- intent: detectedIntent,
164287
- intentScores: detectedIntentScores,
164390
+ preDetectedIntent,
164391
+ preDetectedIntentScores,
164288
164392
  manuallySelectedIntent,
164289
164393
  selectedAgent
164290
164394
  },
@@ -164336,8 +164440,8 @@ class ChatController {
164336
164440
  signal: signal2,
164337
164441
  source,
164338
164442
  command,
164339
- intent: preDetectedIntent,
164340
- intentScores: preDetectedIntentScores,
164443
+ preDetectedIntent,
164444
+ preDetectedIntentScores,
164341
164445
  manuallySelectedIntent,
164342
164446
  selectedAgent
164343
164447
  }, span2) {
@@ -164511,15 +164615,19 @@ class ChatController {
164511
164615
  startNewSubmitOrEditOperation() {
164512
164616
  var _a3;
164513
164617
  (_a3 = this.submitOrEditOperation) == null ? void 0 : _a3.abort();
164514
- this.submitOrEditOperation = new AbortController();
164515
- return this.submitOrEditOperation.signal;
164618
+ return new Promise((resolve2) => {
164619
+ setTimeout(() => {
164620
+ this.submitOrEditOperation = new AbortController();
164621
+ resolve2(this.submitOrEditOperation.signal);
164622
+ }, 500);
164623
+ });
164516
164624
  }
164517
164625
  cancelSubmitOrEditOperation() {
164518
164626
  if (this.submitOrEditOperation) {
164519
164627
  this.submitOrEditOperation.abort();
164520
164628
  this.submitOrEditOperation = void 0;
164521
164629
  }
164522
- void this.saveSession();
164630
+ return this.saveSession();
164523
164631
  }
164524
164632
  async reevaluateSearchWithSelectedFilters({
164525
164633
  index: index2,
@@ -164529,6 +164637,7 @@ class ChatController {
164529
164637
  if (index2 === void 0 || !Array.isArray(selectedFilters)) {
164530
164638
  return;
164531
164639
  }
164640
+ await this.handleAbort();
164532
164641
  const humanMessage = this.chatBuilder.getMessages().at(index2);
164533
164642
  const assistantMessage = this.chatBuilder.getMessages().at(index2 + 1);
164534
164643
  if ((humanMessage == null ? void 0 : humanMessage.speaker) !== "human" || humanMessage.intent !== "search" || (assistantMessage == null ? void 0 : assistantMessage.speaker) !== "assistant" || !((_a3 = assistantMessage == null ? void 0 : assistantMessage.search) == null ? void 0 : _a3.query)) {
@@ -164601,11 +164710,11 @@ class ChatController {
164601
164710
  index: index2,
164602
164711
  contextFiles,
164603
164712
  editorState,
164604
- intent,
164605
- intentScores,
164713
+ preDetectedIntent,
164714
+ preDetectedIntentScores,
164606
164715
  manuallySelectedIntent
164607
164716
  }) {
164608
- const abortSignal = this.startNewSubmitOrEditOperation();
164717
+ const abortSignal = await this.startNewSubmitOrEditOperation();
164609
164718
  telemetryRecorder.recordEvent("cody.editChatButton", "clicked", {
164610
164719
  billingMetadata: {
164611
164720
  product: "cody",
@@ -164625,16 +164734,19 @@ class ChatController {
164625
164734
  editorState,
164626
164735
  signal: abortSignal,
164627
164736
  source: "chat",
164628
- intent,
164629
- intentScores,
164737
+ preDetectedIntent,
164738
+ preDetectedIntentScores,
164630
164739
  manuallySelectedIntent
164631
164740
  });
164632
- } catch {
164741
+ } catch (error) {
164742
+ if (isAbortErrorOrSocketHangUp(error)) {
164743
+ return;
164744
+ }
164633
164745
  this.postError(new Error("Failed to edit prompt"), "transcript");
164634
164746
  }
164635
164747
  }
164636
- handleAbort() {
164637
- this.cancelSubmitOrEditOperation();
164748
+ async handleAbort() {
164749
+ await this.cancelSubmitOrEditOperation();
164638
164750
  this.postViewTranscript();
164639
164751
  telemetryRecorder.recordEvent("cody.sidebar.abortButton", "clicked", {
164640
164752
  billingMetadata: {
@@ -165023,6 +165135,16 @@ class ChatController {
165023
165135
  this.chatBuilder.setSelectedAgent((_a3 = settings.agent) == null ? void 0 : _a3.name);
165024
165136
  await toolboxManager.updateSettings(settings);
165025
165137
  });
165138
+ },
165139
+ editTemporarySettings: (settingsToEdit) => {
165140
+ return promiseFactoryToObservable(async () => {
165141
+ const dataOrError = await graphqlClient.editTemporarySettings(settingsToEdit);
165142
+ if (!isError$3(dataOrError)) {
165143
+ await ClientConfigSingleton.getInstance().forceUpdate();
165144
+ return true;
165145
+ }
165146
+ return false;
165147
+ });
165026
165148
  }
165027
165149
  }
165028
165150
  )
@@ -165406,7 +165528,7 @@ class ChatsController {
165406
165528
  if (submitType === "new-chat") {
165407
165529
  await provider.clearAndRestartSession();
165408
165530
  }
165409
- const abortSignal = provider.startNewSubmitOrEditOperation();
165531
+ const abortSignal = await provider.startNewSubmitOrEditOperation();
165410
165532
  const editorState = editorStateFromPromptString(text);
165411
165533
  await provider.handleUserMessage({
165412
165534
  requestID: v4(),
@@ -166559,7 +166681,7 @@ function parseMentionURI(uri) {
166559
166681
  }
166560
166682
  }
166561
166683
  async function execFileAsync(program2, args2, { cwd }) {
166562
- const { promisify: promisify2 } = await import("./util-CBKiMezg.mjs").then((n) => n.u);
166684
+ const { promisify: promisify2 } = await import("./util-DeyYSaNB.mjs").then((n) => n.u);
166563
166685
  const { execFile } = await import("./child_process-C6OZyNb4.mjs");
166564
166686
  return promisify2(execFile)(program2, args2, { cwd });
166565
166687
  }
@@ -170862,7 +170984,7 @@ async function configureExternalServices(context2, platform2) {
170862
170984
  if (sentryService) disposables.push(sentryService);
170863
170985
  const openTelemetryService = (_b2 = platform2.createOpenTelemetryService) == null ? void 0 : _b2.call(platform2);
170864
170986
  if (openTelemetryService) disposables.push(openTelemetryService);
170865
- const completionsClient = platform2.createCompletionsClient(autocompleteLifecycleOutputChannelLogger);
170987
+ const completionsClient = platform2.createCompletionsClient(completionsLifecycleOutputChannelLogger);
170866
170988
  const symfRunner = (_c2 = platform2.createSymfRunner) == null ? void 0 : _c2.call(platform2, context2);
170867
170989
  if (symfRunner) disposables.push(symfRunner);
170868
170990
  const chatClient = new ChatClient(completionsClient);
@@ -176258,7 +176380,7 @@ async function registerDebugCommands(context2, disposables) {
176258
176380
  }
176259
176381
  async function tryRegisterTutorial(context2, disposables) {
176260
176382
  if (!isRunningInsideAgent()) {
176261
- const { registerInteractiveTutorial } = await import("./index-CAyz-Vhx.mjs");
176383
+ const { registerInteractiveTutorial } = await import("./index-BGjmPMun.mjs");
176262
176384
  registerInteractiveTutorial(context2).then((disposable) => disposables.push(...disposable));
176263
176385
  }
176264
176386
  }