@sourcegraph/cody-web 0.36.0 → 0.37.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.
package/dist/index.js CHANGED
@@ -3,8 +3,8 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  var _a;
5
5
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
6
- import { g as getDefaultExportFromCjs, F as FILE_CONTEXT_MENTION_PROVIDER, S as SYMBOL_CONTEXT_MENTION_PROVIDER, R as REMOTE_REPOSITORY_PROVIDER_URI, a as REMOTE_FILE_PROVIDER_URI, b as REMOTE_DIRECTORY_PROVIDER_URI, W as WEB_PROVIDER_URI, d as RULES_PROVIDER_URI, e as displayPath, f as displayLineRange, h as displayPathDirname, i as displayPathBasename, I as IGNORED_FILE_WARNING_LABEL, L as LARGE_FILE_WARNING_LABEL, o as object, l as literal, j as string$2, k as displayPathWithLines, m as URI, n as is$3, q as serializeContextItem, r as CONTEXT_ITEM_MENTION_NODE_TYPE, t as contextItemMentionNodeDisplayText, T as TEMPLATE_INPUT_NODE_TYPE, u as parseMentionQuery, N as NO_SYMBOL_MATCHES_HELP_LABEL, v as FILE_RANGE_TOOLTIP_LABEL, O as Observable, x as createExtensionAPI, y as createMessageAPIForWebview, z as debounce$1, C as ContextItemSource, A as memoizeLastValue, B as toSerializedPromptEditorValue$1, D as isEqual, E as scanForMentionTriggerInUserTextInput, G as getMentionOperations, H as combineLatest, J as map$3, K as forceHydration, M as hydrateAfterPostMessage, P as isDotCom, Q as isWorkspaceInstance, V as isAuthError, X as isAvailabilityError, Y as isSourcegraphToken, Z as trace, _ as context$1, $ as SpanStatusCode, c as commonjsGlobal, a0 as svg, a1 as html$2, a2 as whitespace, a3 as find, a4 as stringify, a5 as stringify$1, a6 as ccount, a7 as CodyIDE, a8 as CodyTaskState, a9 as cryptoJsExports, aa as GuardrailsCheckStatus, ab as LRUCache, ac as isError, ad as RateLimitError, ae as FeatureFlag, af as reformatBotMessageForChat, ag as isAbortErrorOrSocketHangUp, ah as ModelTag, ai as DeepCodyAgentID, aj as serializedPromptEditorStateFromChatMessage, ak as contextItemsFromPromptEditorValue, al as filterContextItemsFromPromptEditorValue, am as View, an as isMacOS, ao as ToolCodyModelName, ap as CustomCommandType, aq as textContentFromSerializedLexicalNode, ar as firstValueFrom, as as skipPendingOperation, at as FAST_CHAT_INPUT_TOKEN_BUDGET, au as webviewOpenURIForContextItem, av as pluralize, aw as UIToolStatus, ax as getFileDiff, ay as diffWithLineNum, az as UITerminalOutputType, aA as isCodeSearchContextItem, aB as v4, aC as lodashExports, aD as deserializeContextItem, aE as firstResultFromOperation, aF as ChatHistoryType, aG as ACCOUNT_USAGE_URL, aH as CODY_DOC_QUICKSTART_URL, aI as isDefined, aJ as browser, aK as CodyAutoSuggestionMode, aL as setDisplayPathEnvInfo, aM as isErrorLike, aN as PromptString, aO as createGuardrailsImpl, U as Uri } from "./vscode-shim-Csgwpsv8.mjs";
7
- import { aQ, aP } from "./vscode-shim-Csgwpsv8.mjs";
6
+ import { dn as getDefaultExportFromCjs, 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, b8 as RULES_PROVIDER_URI, T as displayPath, m as displayLineRange, Y as displayPathDirname, W as displayPathBasename, I as IGNORED_FILE_WARNING_LABEL, L as LARGE_FILE_WARNING_LABEL, dp as object, dq as literal, dr as string$2, V as displayPathWithLines, c as URI, ds as is$3, c5 as serializeContextItem, c3 as CONTEXT_ITEM_MENTION_NODE_TYPE, cb as contextItemMentionNodeDisplayText, c4 as TEMPLATE_INPUT_NODE_TYPE, aU as parseMentionQuery, N as NO_SYMBOL_MATCHES_HELP_LABEL, F as FILE_RANGE_TOOLTIP_LABEL, dt as Observable, cd as createExtensionAPI, bb as createMessageAPIForWebview, du as debounce$1, C as ContextItemSource, cu as memoizeLastValue, bW as toSerializedPromptEditorValue$1, dv as isEqual, aV as scanForMentionTriggerInUserTextInput, c9 as getMentionOperations, ct as combineLatest, dw as map$3, a0 as forceHydration, a1 as hydrateAfterPostMessage, ag as isDotCom, be as isWorkspaceInstance, au as isAuthError, av as isAvailabilityError, dx as isSourcegraphToken, dy as trace, dz as context$1, dA as SpanStatusCode, dm as commonjsGlobal, dB as svg, dC as html$2, dD as whitespace, dE as find, dF as stringify, dG as stringify$1, dH as ccount, bT as CodyIDE, dI as CodyTaskState, dJ as cryptoJsExports, a6 as GuardrailsCheckStatus, dK as LRUCache, a as isError, aq as RateLimitError, a2 as FeatureFlag, r as reformatBotMessageForChat, at as isAbortErrorOrSocketHangUp, M as ModelTag, dL as DeepCodyAgentID, bY as serializedPromptEditorStateFromChatMessage, bZ as contextItemsFromPromptEditorValue, b$ as filterContextItemsFromPromptEditorValue, dM as View, E as isMacOS, dN as ToolCodyModelName, g as CustomCommandType, c0 as textContentFromSerializedLexicalNode, ci as firstValueFrom, d0 as skipPendingOperation, bO as FAST_CHAT_INPUT_TOKEN_BUDGET, f as webviewOpenURIForContextItem, l as pluralize, dk as UIToolStatus, dO as getFileDiff, dP as diffWithLineNum, dl as UITerminalOutputType, dQ as isCodeSearchContextItem, dR as v4, dS as lodashExports, c6 as deserializeContextItem, d1 as firstResultFromOperation, dT as ChatHistoryType, dU as ACCOUNT_USAGE_URL, dV as CODY_DOC_QUICKSTART_URL, b as isDefined, dW as browser, bU as CodyAutoSuggestionMode, _ as setDisplayPathEnvInfo, k as isErrorLike, bE as PromptString, a4 as createGuardrailsImpl, U as Uri } from "./vscode-shim-CqAb7AbA.mjs";
7
+ import { bh, bg } from "./vscode-shim-CqAb7AbA.mjs";
8
8
  import * as React$2 from "react";
9
9
  import React__default, { createContext, useContext, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, useEffect as useEffect$2, forwardRef, useState as useState$1, useCallback, useRef as useRef$1, Suspense, createElement, memo as memo$2, useImperativeHandle, Children, isValidElement, cloneElement, Fragment as Fragment$2, useReducer, useId as useId$2, useInsertionEffect as useInsertionEffect$1, Component } from "react";
10
10
  var classnames = { exports: {} };
@@ -6726,7 +6726,7 @@ function ag(a2, b2, c2) {
6726
6726
  G$2(H$1, b2);
6727
6727
  G$2(Wf, c2);
6728
6728
  }
6729
- function bg(a2, b2, c2) {
6729
+ function bg2(a2, b2, c2) {
6730
6730
  var d2 = a2.stateNode;
6731
6731
  b2 = b2.childContextTypes;
6732
6732
  if ("function" !== typeof d2.getChildContext) return c2;
@@ -6744,7 +6744,7 @@ function cg(a2) {
6744
6744
  function dg(a2, b2, c2) {
6745
6745
  var d2 = a2.stateNode;
6746
6746
  if (!d2) throw Error(p$3(169));
6747
- c2 ? (a2 = bg(a2, b2, Xf), d2.__reactInternalMemoizedMergedChildContext = a2, E$3(Wf), E$3(H$1), G$2(H$1, a2)) : E$3(Wf);
6747
+ c2 ? (a2 = bg2(a2, b2, Xf), d2.__reactInternalMemoizedMergedChildContext = a2, E$3(Wf), E$3(H$1), G$2(H$1, a2)) : E$3(Wf);
6748
6748
  G$2(Wf, c2);
6749
6749
  }
6750
6750
  var eg = null, fg = false, gg = false;
@@ -6968,7 +6968,7 @@ var $g = false;
6968
6968
  function ah(a2) {
6969
6969
  a2.updateQueue = { baseState: a2.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null };
6970
6970
  }
6971
- function bh(a2, b2) {
6971
+ function bh2(a2, b2) {
6972
6972
  a2 = a2.updateQueue;
6973
6973
  b2.updateQueue === a2 && (b2.updateQueue = { baseState: a2.baseState, firstBaseUpdate: a2.firstBaseUpdate, lastBaseUpdate: a2.lastBaseUpdate, shared: a2.shared, effects: a2.effects });
6974
6974
  }
@@ -8141,7 +8141,7 @@ function ij(a2, b2, c2, d2, e2) {
8141
8141
  h2 !== d2 || r2 !== k2 || Wf.current || $g ? ("function" === typeof m2 && (kh(b2, c2, m2, d2), k2 = b2.memoizedState), (h2 = $g || oh(b2, c2, h2, d2, r2, k2, l2)) ? (q2 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b2.flags |= 4194308)) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4194308), b2.memoizedProps = d2, b2.memoizedState = k2), g2.props = d2, g2.state = k2, g2.context = l2, d2 = h2) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4194308), d2 = false);
8142
8142
  } else {
8143
8143
  g2 = b2.stateNode;
8144
- bh(a2, b2);
8144
+ bh2(a2, b2);
8145
8145
  h2 = b2.memoizedProps;
8146
8146
  l2 = b2.type === b2.elementType ? h2 : Lg(b2.type, h2);
8147
8147
  g2.props = l2;
@@ -10447,7 +10447,7 @@ Wk = function(a2, b2, c2) {
10447
10447
  d2 = b2.pendingProps;
10448
10448
  f2 = b2.memoizedState;
10449
10449
  e2 = f2.element;
10450
- bh(a2, b2);
10450
+ bh2(a2, b2);
10451
10451
  gh(b2, d2, null, c2);
10452
10452
  var g2 = b2.memoizedState;
10453
10453
  d2 = g2.element;
@@ -10747,7 +10747,7 @@ function el(a2) {
10747
10747
  }
10748
10748
  if (1 === a2.tag) {
10749
10749
  var c2 = a2.type;
10750
- if (Zf(c2)) return bg(a2, c2, b2);
10750
+ if (Zf(c2)) return bg2(a2, c2, b2);
10751
10751
  }
10752
10752
  return b2;
10753
10753
  }
@@ -13805,7 +13805,7 @@ function getItemsHeading$1(parentItem, mentionQuery) {
13805
13805
  }
13806
13806
  const COMMAND_ROW_CLASS_NAME = "!tw-p-3 !tw-text-md !tw-leading-[1.2] !tw-h-[30px] !tw-rounded-none";
13807
13807
  const COMMAND_ROW_TEXT_CLASS_NAME = "!tw-text-muted-foreground";
13808
- const COMMAND_GROUP_CLASS_NAME = "!tw-p-0 !tw-border-b-0 [&_[cmdk-group-heading]]:!tw-p-3 [&_[cmdk-group-heading]]:!tw-text-md [&_[cmdk-group-heading]]:!tw-leading-[1.2] [&_[cmdk-group-heading]]:!tw-h-[30px]";
13808
+ const COMMAND_GROUP_CLASS_NAME = "!tw-p-0 !tw-border-b-0 [&_[cmdk-group-heading]]:!tw-p-3 [&_[cmdk-group-heading]]:!tw-text-md [&_[cmdk-group-heading]]:!tw-leading-[1.2] [&_[cmdk-group-heading]]:!tw-min-h-[30px]";
13809
13809
  const ChatMentionContext = createContext({
13810
13810
  resolutionMode: "local"
13811
13811
  });
@@ -41608,7 +41608,7 @@ memo$2(
41608
41608
  setFormState((prev) => ({
41609
41609
  ...prev,
41610
41610
  isSubmitting: false,
41611
- showAuthError: !!(authStatus == null ? void 0 : authStatus.authenticated) || isAuthError(authStatus == null ? void 0 : authStatus.error)
41611
+ showAuthError: !(authStatus == null ? void 0 : authStatus.authenticated) && isAuthError(authStatus == null ? void 0 : authStatus.error)
41612
41612
  }));
41613
41613
  }, 8e3);
41614
41614
  }
@@ -41667,8 +41667,7 @@ memo$2(
41667
41667
  className: "tw-w-full tw-my-2 !tw-p-4",
41668
41668
  value: formState.formData.accessToken,
41669
41669
  onChange: handleInputChange,
41670
- autoComplete: "current-password",
41671
- required: true
41670
+ autoComplete: "current-password"
41672
41671
  }
41673
41672
  ),
41674
41673
  /* @__PURE__ */ jsx(
@@ -41677,8 +41676,7 @@ memo$2(
41677
41676
  match: () => !isSourcegraphToken(formState.formData.accessToken),
41678
41677
  children: "Invalid access token."
41679
41678
  }
41680
- ),
41681
- /* @__PURE__ */ jsx(FormMessage, { match: "valueMissing", children: "Access token is required." })
41679
+ )
41682
41680
  ] })
41683
41681
  ]
41684
41682
  }
@@ -41688,8 +41686,7 @@ memo$2(
41688
41686
  {
41689
41687
  type: "submit",
41690
41688
  className: "tw-m-4 tw-w-full !tw-p-4",
41691
- disabled: formState.isSubmitting || !!formState.validationError || formState.showAccessTokenField && !formState.formData.accessToken,
41692
- title: formState.showAccessTokenField ? "Continue in your browser" : "Sign in",
41689
+ disabled: formState.isSubmitting || !!formState.validationError || !formState.formData.endpoint,
41693
41690
  autoFocus: true,
41694
41691
  children: formState.isSubmitting ? "Signing In..." : "Sign In"
41695
41692
  }
@@ -89598,7 +89595,7 @@ const CodyPanel = ({
89598
89595
  }
89599
89596
  ),
89600
89597
  /* @__PURE__ */ jsxs(TabContainer, { value: view, ref: tabContainerRef, "data-scrollable": true, children: [
89601
- view === View.Chat && /* @__PURE__ */ jsx(
89598
+ view === View.Chat && chatModels && chatModels.length > 0 && /* @__PURE__ */ jsx(
89602
89599
  Chat,
89603
89600
  {
89604
89601
  chatEnabled,
@@ -89606,7 +89603,7 @@ const CodyPanel = ({
89606
89603
  messageInProgress,
89607
89604
  transcript,
89608
89605
  tokenUsage,
89609
- models: chatModels || [],
89606
+ models: chatModels,
89610
89607
  vscodeAPI,
89611
89608
  guardrails,
89612
89609
  showIDESnippetActions,
@@ -90460,6 +90457,6 @@ export {
90460
90457
  ChatSkeleton,
90461
90458
  CodyPromptTemplate,
90462
90459
  CodyWebChat,
90463
- aQ as deserialize,
90464
- aP as serialize
90460
+ bh as deserialize,
90461
+ bg as serialize
90465
90462
  };
@@ -1,7 +1,7 @@
1
1
  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
- import { b as base64Js } from "./agent.worker-CF9GgIzt.mjs";
4
+ import { b as base64Js } from "./agent.worker-DKy-Dvsz.mjs";
5
5
  var __defProp2 = Object.defineProperty;
6
6
  var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
7
  var __publicField2 = (obj, key, value) => {
package/dist/style.css CHANGED
@@ -2378,6 +2378,9 @@ imported in Sourcegraph shell.
2378
2378
  .tw-mb-5 {
2379
2379
  margin-bottom: 10px;
2380
2380
  }
2381
+ .tw-mb-6 {
2382
+ margin-bottom: 12px;
2383
+ }
2381
2384
  .tw-mb-8 {
2382
2385
  margin-bottom: 16px;
2383
2386
  }
@@ -2506,6 +2509,9 @@ imported in Sourcegraph shell.
2506
2509
  .tw-h-12 {
2507
2510
  height: 24px;
2508
2511
  }
2512
+ .tw-h-16 {
2513
+ height: 32px;
2514
+ }
2509
2515
  .tw-h-2 {
2510
2516
  height: 4px;
2511
2517
  }
@@ -2620,6 +2626,9 @@ imported in Sourcegraph shell.
2620
2626
  .tw-w-14 {
2621
2627
  width: 28px;
2622
2628
  }
2629
+ .tw-w-16 {
2630
+ width: 32px;
2631
+ }
2623
2632
  .tw-w-2 {
2624
2633
  width: 4px;
2625
2634
  }
@@ -3727,6 +3736,10 @@ imported in Sourcegraph shell.
3727
3736
  .tw-text-sm {
3728
3737
  font-size: calc(calc(12/13)*var(--vscode-font-size));
3729
3738
  }
3739
+ .tw-text-xl {
3740
+ font-size: 1.25rem;
3741
+ line-height: 1.75rem;
3742
+ }
3730
3743
  .tw-text-xs {
3731
3744
  font-size: calc(calc(11/13)*var(--vscode-font-size));
3732
3745
  }
@@ -4910,8 +4923,8 @@ imported in Sourcegraph shell.
4910
4923
  .\[\&_\>_\*\]\:tw-flex-shrink-0 > * {
4911
4924
  flex-shrink: 0;
4912
4925
  }
4913
- .\[\&_\[cmdk-group-heading\]\]\:\!tw-h-\[30px\] [cmdk-group-heading] {
4914
- height: 30px !important;
4926
+ .\[\&_\[cmdk-group-heading\]\]\:\!tw-min-h-\[30px\] [cmdk-group-heading] {
4927
+ min-height: 30px !important;
4915
4928
  }
4916
4929
  .\[\&_\[cmdk-group-heading\]\]\:\!tw-p-3 [cmdk-group-heading] {
4917
4930
  padding: 6px !important;