@sourcegraph/cody-web 0.26.0 → 0.27.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.
@@ -771,7 +771,9 @@ const _ClientConfigSingleton = class _ClientConfigSingleton {
771
771
  // linear.app/sourcegraph/issue/CODY-3745/codys-background-periodic-network-access-causes-2fa.
772
772
  filter$2((_value) => editorWindowIsFocused()),
773
773
  startWith$1(void 0),
774
- switchMap$1(() => promiseFactoryToObservable((signal2) => this.fetchConfig(signal2)))
774
+ switchMap$1(
775
+ () => promiseFactoryToObservable((signal2) => this.fetchConfig(authStatus2, signal2))
776
+ )
775
777
  ) : Observable.of(void 0)
776
778
  ),
777
779
  map$1((value) => isError$3(value) ? void 0 : value),
@@ -809,7 +811,7 @@ const _ClientConfigSingleton = class _ClientConfigSingleton {
809
811
  async getConfig(signal2) {
810
812
  return await firstValueFrom$1(this.changes.pipe(skipPendingOperation()), signal2);
811
813
  }
812
- async fetchConfig(signal2) {
814
+ async fetchConfig(authStatus2, signal2) {
813
815
  logDebug$1("ClientConfigSingleton", "refreshing configuration");
814
816
  try {
815
817
  const siteVersion2 = await graphqlClient.getSiteVersion(signal2);
@@ -829,7 +831,8 @@ const _ClientConfigSingleton = class _ClientConfigSingleton {
829
831
  } else {
830
832
  const insiderBuild = siteVersion2.length > 12 || siteVersion2.includes("dev");
831
833
  supportsClientConfig = insiderBuild || !semver.lt(siteVersion2, "5.5.0");
832
- omniBoxEnabled = insiderBuild || semver.gte(siteVersion2, "6.0.0");
834
+ const isDotCom2 = !authStatus2.authenticated || authStatus2.endpoint.startsWith("https://sourcegraph.com");
835
+ omniBoxEnabled = !isDotCom2 && (insiderBuild || semver.gte(siteVersion2, "6.0.0"));
833
836
  }
834
837
  signal2 == null ? void 0 : signal2.throwIfAborted();
835
838
  const clientConfig = await (supportsClientConfig ? this.fetchConfigEndpoint(signal2) : this.fetchClientConfigLegacy(signal2));
@@ -8218,7 +8221,12 @@ function syncModels({
8218
8221
  enableToolCody
8219
8222
  ).pipe(
8220
8223
  switchMap$1(
8221
- ([hasEarlyAccess, hasAgenticChatFlag, defaultToHaiku]) => {
8224
+ ([
8225
+ hasEarlyAccess,
8226
+ hasAgenticChatFlag,
8227
+ defaultToHaiku,
8228
+ isToolCodyEnabled
8229
+ ]) => {
8222
8230
  const isOnWaitlist = config.clientState.waitlist_o1;
8223
8231
  if (isDotComUser && (hasEarlyAccess || isOnWaitlist)) {
8224
8232
  data2.primaryModels = data2.primaryModels.map(
@@ -8236,34 +8244,37 @@ function syncModels({
8236
8244
  }
8237
8245
  );
8238
8246
  }
8247
+ const clientModels = [];
8248
+ const isAgenticChatEnabled = hasAgenticChatFlag || isDotComUser && !isCodyFreeUser;
8239
8249
  const haikuModel = data2.primaryModels.find(
8240
8250
  (m) => m.id.includes("5-haiku")
8241
8251
  );
8242
8252
  const sonnetModel = data2.primaryModels.find(
8243
8253
  (m) => m.id.includes("5-sonnet")
8244
8254
  );
8245
- const isAgenticChatEnabled = hasAgenticChatFlag || isDotComUser && !isCodyFreeUser;
8246
- if (isAgenticChatEnabled && sonnetModel && haikuModel && // Ensure the deep-cody model is only added once.
8247
- !data2.primaryModels.some(
8255
+ const hasDeepCody = data2.primaryModels.some(
8248
8256
  (m) => m.id.includes("deep-cody")
8249
- )) {
8250
- const DEEPCODY_MODEL = getExperimentalClientModelByFeatureFlag(
8251
- FeatureFlag.DeepCody
8252
- );
8253
- const clientModels = [DEEPCODY_MODEL];
8254
- if (enableToolCody) {
8255
- clientModels.push(TOOL_CODY_MODEL);
8256
- }
8257
- data2.primaryModels.push(
8258
- ...maybeAdjustContextWindows(clientModels).map(
8259
- createModelFromServerModel
8257
+ );
8258
+ if (!hasDeepCody && isAgenticChatEnabled && sonnetModel && haikuModel) {
8259
+ clientModels.push(
8260
+ getExperimentalClientModelByFeatureFlag(
8261
+ FeatureFlag.DeepCody
8260
8262
  )
8261
8263
  );
8262
8264
  }
8263
- if (isDotComUser && isCodyFreeUser && defaultToHaiku) {
8264
- if (haikuModel) {
8265
- data2.preferences.defaults.chat = haikuModel.id;
8266
- }
8265
+ const hasToolCody = data2.primaryModels.some(
8266
+ (m) => m.id.includes("tool-cody")
8267
+ );
8268
+ if (!hasToolCody && isToolCodyEnabled) {
8269
+ clientModels.push(TOOL_CODY_MODEL);
8270
+ }
8271
+ data2.primaryModels.push(
8272
+ ...maybeAdjustContextWindows(clientModels).map(
8273
+ createModelFromServerModel
8274
+ )
8275
+ );
8276
+ if (isDotComUser && isCodyFreeUser && defaultToHaiku && haikuModel) {
8277
+ data2.preferences.defaults.chat = haikuModel.id;
8267
8278
  }
8268
8279
  return Observable.of(data2);
8269
8280
  }
@@ -22931,7 +22942,7 @@ async function tokenCallbackHandler(uri) {
22931
22942
  closeAuthProgressIndicator();
22932
22943
  const params = new URLSearchParams(uri.query);
22933
22944
  const token = params.get("code") || params.get("token");
22934
- const endpoint = params.get("endpoint") ?? currentAuthStatus().endpoint;
22945
+ const endpoint = currentAuthStatus().endpoint;
22935
22946
  const instanceHost = params.get("instance");
22936
22947
  const instanceUrl = instanceHost ? new URL(instanceHost).origin : void 0;
22937
22948
  if (instanceUrl && isWorkspaceInstance(instanceUrl)) {
@@ -170364,7 +170375,7 @@ async function registerDebugCommands(context2, disposables) {
170364
170375
  }
170365
170376
  async function tryRegisterTutorial(context2, disposables) {
170366
170377
  if (!isRunningInsideAgent()) {
170367
- const { registerInteractiveTutorial } = await import("./index-DfULJkoK.mjs");
170378
+ const { registerInteractiveTutorial } = await import("./index-DefCFjGJ.mjs");
170368
170379
  registerInteractiveTutorial(context2).then((disposable) => disposables.push(...disposable));
170369
170380
  }
170370
170381
  }
@@ -1,2 +1,2 @@
1
- import "./agent.worker-VM-asDOF.mjs";
1
+ import "./agent.worker-D1gbjZNA.mjs";
2
2
  import "./vscode-shim-C0OSx8EN.mjs";
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { U as Uri, P as Position, R as Range, a as window, D as DiagnosticSeverity, b as workspace, c as commands, t as telemetryRecorder, d as ps, e as dedent, T as ThemeColor, l as languages, f as CodeLens, g as Disposable } from "./vscode-shim-C0OSx8EN.mjs";
5
- import { u as updateRangeMultipleChanges, e as executeEdit, T as TERMINAL_EDIT_STATES, s as setTutorialUri, l as logSidebarClick } from "./agent.worker-VM-asDOF.mjs";
5
+ import { u as updateRangeMultipleChanges, e as executeEdit, T as TERMINAL_EDIT_STATES, s as setTutorialUri, l as logSidebarClick } from "./agent.worker-D1gbjZNA.mjs";
6
6
  const EMOJI_SVG_TEMPLATE = `<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
7
7
  <text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="24px">{emoji}</text>
8
8
  </svg>`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sourcegraph/cody-web",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Cody standalone web app",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -35,9 +35,9 @@
35
35
  "vite-bundle-analyzer": "^0.10.5",
36
36
  "vite-plugin-svgr": "^4.2.0",
37
37
  "vscode-uri": "^3.0.8",
38
- "@sourcegraph/cody-shared": "0.0.10",
39
38
  "@sourcegraph/cody": "5.5.15",
40
39
  "@sourcegraph/prompt-editor": "0.0.1",
40
+ "@sourcegraph/cody-shared": "0.0.10",
41
41
  "cody-ai": "1.62.0"
42
42
  },
43
43
  "scripts": {