@sourcegraph/cody-web 0.35.0 → 0.36.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 isCodyProModel, ao as isMacOS, ap as ToolCodyModelName, aq as CustomCommandType, ar as textContentFromSerializedLexicalNode, as as firstValueFrom, at as skipPendingOperation, au as FAST_CHAT_INPUT_TOKEN_BUDGET, av as webviewOpenURIForContextItem, aw as pluralize, ax as UIToolStatus, ay as getFileDiff, az as diffWithLineNum, aA as UITerminalOutputType, aB as isCodeSearchContextItem, aC as v4, aD as lodashExports, aE as deserializeContextItem, aF as firstResultFromOperation, aG as ChatHistoryType, aH as S2_URL, aI as ACCOUNT_USAGE_URL, aJ as CODY_DOC_QUICKSTART_URL, aK as isPlgEsAccessDisabled, aL as isDefined, aM as browser, aN as CodyAutoSuggestionMode, aO as setDisplayPathEnvInfo, aP as isErrorLike, aQ as PromptString, aR as createGuardrailsImpl, U as Uri } from "./vscode-shim-H_ThTWLs.mjs";
7
- import { aT, aS } from "./vscode-shim-H_ThTWLs.mjs";
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";
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: {} };
@@ -11868,25 +11868,6 @@ const Building2 = createLucideIcon("Building2", [
11868
11868
  ["path", { d: "M10 14h4", key: "kelpxr" }],
11869
11869
  ["path", { d: "M10 18h4", key: "1ulq68" }]
11870
11870
  ]);
11871
- /**
11872
- * @license lucide-react v0.378.0 - ISC
11873
- *
11874
- * This source code is licensed under the ISC license.
11875
- * See the LICENSE file in the root directory of this source tree.
11876
- */
11877
- const Building = createLucideIcon("Building", [
11878
- ["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
11879
- ["path", { d: "M9 22v-4h6v4", key: "r93iot" }],
11880
- ["path", { d: "M8 6h.01", key: "1dz90k" }],
11881
- ["path", { d: "M16 6h.01", key: "1x0f13" }],
11882
- ["path", { d: "M12 6h.01", key: "1vi96p" }],
11883
- ["path", { d: "M12 10h.01", key: "1nrarc" }],
11884
- ["path", { d: "M12 14h.01", key: "1etili" }],
11885
- ["path", { d: "M16 10h.01", key: "1m94wz" }],
11886
- ["path", { d: "M16 14h.01", key: "1gbofw" }],
11887
- ["path", { d: "M8 10h.01", key: "19clt8" }],
11888
- ["path", { d: "M8 14h.01", key: "6423bh" }]
11889
- ]);
11890
11871
  /**
11891
11872
  * @license lucide-react v0.378.0 - ISC
11892
11873
  *
@@ -12059,16 +12040,6 @@ const ExternalLink = createLucideIcon("ExternalLink", [
12059
12040
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
12060
12041
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
12061
12042
  ]);
12062
- /**
12063
- * @license lucide-react v0.378.0 - ISC
12064
- *
12065
- * This source code is licensed under the ISC license.
12066
- * See the LICENSE file in the root directory of this source tree.
12067
- */
12068
- const Eye = createLucideIcon("Eye", [
12069
- ["path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z", key: "rwhkz3" }],
12070
- ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
12071
- ]);
12072
12043
  /**
12073
12044
  * @license lucide-react v0.378.0 - ISC
12074
12045
  *
@@ -12200,21 +12171,6 @@ const Hammer = createLucideIcon("Hammer", [
12200
12171
  }
12201
12172
  ]
12202
12173
  ]);
12203
- /**
12204
- * @license lucide-react v0.378.0 - ISC
12205
- *
12206
- * This source code is licensed under the ISC license.
12207
- * See the LICENSE file in the root directory of this source tree.
12208
- */
12209
- const Heart = createLucideIcon("Heart", [
12210
- [
12211
- "path",
12212
- {
12213
- d: "M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",
12214
- key: "c3ymky"
12215
- }
12216
- ]
12217
- ]);
12218
12174
  /**
12219
12175
  * @license lucide-react v0.378.0 - ISC
12220
12176
  *
@@ -40858,7 +40814,6 @@ const styles$l = {
40858
40814
  error: error$1,
40859
40815
  closeBtn
40860
40816
  };
40861
- const SourcegraphIcon = "data:image/svg+xml,%3csvg%20viewBox='0%200%2052%2052'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M30.8%2051.8c-2.8.5-5.5-1.3-6-4.1L17.2%206.2c-.5-2.8%201.3-5.5%204.1-6s5.5%201.3%206%204.1l7.6%2041.5c.5%202.8-1.4%205.5-4.1%206z'%20fill='%23FF5543'/%3e%3cpath%20d='M10.9%2044.7C9.1%2045%207.3%2044.4%206%2043c-1.8-2.2-1.6-5.4.6-7.2L38.7%208.5c2.2-1.8%205.4-1.6%207.2.6%201.8%202.2%201.6%205.4-.6%207.2l-32%2027.3c-.7.6-1.6%201-2.4%201.1z'%20fill='%23A112FF'/%3e%3cpath%20d='M46.8%2038.1c-.9.2-1.8.1-2.6-.2L4.4%2023.8c-2.7-1-4.1-3.9-3.1-6.6%201-2.7%203.9-4.1%206.6-3.1l39.7%2014.1c2.7%201%204.1%203.9%203.1%206.6-.6%201.8-2.2%203-3.9%203.3z'%20fill='%2300CBEC'/%3e%3c/svg%3e";
40862
40817
  const roundedIconStyles = "tw-flex tw-items-center tw-justify-center !tw-rounded-full !tw-p-2 tw-border";
40863
40818
  const buttonVariants$1 = cva(
40864
40819
  "tw-inline-flex tw-items-center tw-justify-center tw-rounded-md focus-visible:tw-border-ring focus-visible:tw-outline-none disabled:tw-pointer-events-none disabled:tw-opacity-50 tw-gap-3 tw-transition tw-duration-75 tw-cursor-pointer",
@@ -41591,14 +41546,7 @@ function getTraceparentFromSpanContext(spanContext) {
41591
41546
  return `00-${spanContext.traceId}-${spanContext.spanId}-${spanContext.traceFlags.toString(16).padStart(2, "0")}`;
41592
41547
  }
41593
41548
  memo$2(
41594
- ({
41595
- className,
41596
- authStatus,
41597
- vscodeAPI,
41598
- telemetryRecorder,
41599
- allowEndpointChange,
41600
- isPlgEsAccessDisabled: isPlgEsAccessDisabled2
41601
- }) => {
41549
+ ({ className, authStatus, vscodeAPI, telemetryRecorder, allowEndpointChange }) => {
41602
41550
  const [formState, setFormState] = useState$1({
41603
41551
  showAccessTokenField: false,
41604
41552
  isSubmitting: false,
@@ -41609,21 +41557,21 @@ memo$2(
41609
41557
  accessToken: ""
41610
41558
  }
41611
41559
  });
41612
- const validateEndpointUrl = useCallback(
41613
- (url) => {
41614
- if (!url) return null;
41615
- try {
41616
- const urlObj = new URL(url);
41617
- if (isPlgEsAccessDisabled2 && (isDotCom({ endpoint: urlObj.href }) || isWorkspaceInstance({ endpoint: urlObj.href }))) {
41618
- return "This instance does not have access to Cody";
41619
- }
41620
- return null;
41621
- } catch {
41622
- return "Invalid URL format";
41560
+ const validateEndpointUrl = useCallback((url) => {
41561
+ if (!url) return "URL is required";
41562
+ try {
41563
+ const urlObj = new URL(url);
41564
+ if (urlObj.protocol !== "https:" && urlObj.hostname !== "localhost") {
41565
+ return "URL must use HTTPS protocol";
41623
41566
  }
41624
- },
41625
- [isPlgEsAccessDisabled2]
41626
- );
41567
+ if (isDotCom({ endpoint: urlObj.href }) || isWorkspaceInstance({ endpoint: urlObj.href })) {
41568
+ return "This instance does not have access to Cody";
41569
+ }
41570
+ return null;
41571
+ } catch {
41572
+ return "Invalid URL format";
41573
+ }
41574
+ }, []);
41627
41575
  const handleInputChange = useCallback(
41628
41576
  (e2) => {
41629
41577
  const { name: name2, value } = e2.target;
@@ -41689,9 +41637,7 @@ memo$2(
41689
41637
  disabled: !allowEndpointChange
41690
41638
  }
41691
41639
  ),
41692
- /* @__PURE__ */ jsx(FormMessage, { match: "typeMismatch", children: "Invalid URL." }),
41693
- /* @__PURE__ */ jsx(FormMessage, { match: "valueMissing", children: "URL is required." }),
41694
- formState.validationError && /* @__PURE__ */ jsx("div", { className: "tw-text-red-500 tw-text-sm tw-mt-1 tw-font-medium", children: formState.validationError })
41640
+ formState.validationError && /* @__PURE__ */ jsx(FormMessage, { children: formState.validationError })
41695
41641
  ] }),
41696
41642
  /* @__PURE__ */ jsxs(
41697
41643
  FormField,
@@ -71413,7 +71359,7 @@ function useConfig() {
71413
71359
  return config;
71414
71360
  }
71415
71361
  function useUserAccountInfo() {
71416
- const { authStatus, clientCapabilities, siteHasCodyEnabled, currentUserCodySubscription } = useConfig();
71362
+ const { authStatus, clientCapabilities, siteHasCodyEnabled } = useConfig();
71417
71363
  if (!authStatus.authenticated) {
71418
71364
  throw new Error(
71419
71365
  "useUserAccountInfo must be used within a ConfigProvider with authenticated user"
@@ -71423,10 +71369,9 @@ function useUserAccountInfo() {
71423
71369
  () => ({
71424
71370
  user: authStatus,
71425
71371
  IDE: clientCapabilities.agentIDE,
71426
- siteHasCodyEnabled,
71427
- currentUserCodySubscription
71372
+ siteHasCodyEnabled
71428
71373
  }),
71429
- [authStatus, clientCapabilities, siteHasCodyEnabled, currentUserCodySubscription]
71374
+ [authStatus, clientCapabilities, siteHasCodyEnabled]
71430
71375
  );
71431
71376
  }
71432
71377
  const ALLOWED_URI_REGEXP = /^((https?|file|vscode):\/\/[^\s#$./?].\S*$|(command:_?cody.*))/i;
@@ -81288,48 +81233,6 @@ const styles$e = {
81288
81233
  focused: focused$1,
81289
81234
  editorContentEditable: editorContentEditable$1
81290
81235
  };
81291
- const CodyLogo = ({ size: size2, ...props }) => /* @__PURE__ */ jsxs(
81292
- "svg",
81293
- {
81294
- width: size2,
81295
- height: size2,
81296
- viewBox: "0 0 25 25",
81297
- fill: "none",
81298
- xmlns: "http://www.w3.org/2000/svg",
81299
- role: "img",
81300
- "aria-label": "Cody logo",
81301
- ...props,
81302
- children: [
81303
- /* @__PURE__ */ jsx(
81304
- "path",
81305
- {
81306
- fillRule: "evenodd",
81307
- clipRule: "evenodd",
81308
- d: "M17.799 -1.0423e-07C19.1159 -4.66655e-08 20.1835 1.06758 20.1835 2.38451L20.1835 6.62365C20.1835 7.94058 19.1159 9.00816 17.799 9.00816C16.482 9.00816 15.4144 7.94058 15.4144 6.62365L15.4144 2.38451C15.4144 1.06758 16.482 -1.61795e-07 17.799 -1.0423e-07Z",
81309
- fill: "#FF5543"
81310
- }
81311
- ),
81312
- /* @__PURE__ */ jsx(
81313
- "path",
81314
- {
81315
- fillRule: "evenodd",
81316
- clipRule: "evenodd",
81317
- d: "M2.6969 5.56396C2.6969 4.24703 3.76448 3.17944 5.08141 3.17944H9.32055C10.6375 3.17944 11.7051 4.24703 11.7051 5.56396C11.7051 6.88089 10.6375 7.94847 9.32055 7.94847H5.08141C3.76448 7.94847 2.6969 6.88089 2.6969 5.56396Z",
81318
- fill: "#A112FF"
81319
- }
81320
- ),
81321
- /* @__PURE__ */ jsx(
81322
- "path",
81323
- {
81324
- fillRule: "evenodd",
81325
- clipRule: "evenodd",
81326
- d: "M23.4979 12.5055C24.3466 13.3117 24.381 14.6533 23.5748 15.502L22.8246 16.2917C16.9538 22.4715 7.05634 22.3175 1.38065 15.9582C0.601182 15.0848 0.677291 13.745 1.55064 12.9655C2.424 12.186 3.76387 12.2621 4.54334 13.1355C8.5685 17.6455 15.5877 17.7546 19.7512 13.372L20.5014 12.5823C21.3077 11.7336 22.6493 11.6992 23.4979 12.5055Z",
81327
- fill: "#00CBEC"
81328
- }
81329
- )
81330
- ]
81331
- }
81332
- );
81333
81236
  const CodyLogoBW = ({ size: size2, ...props }) => /* @__PURE__ */ jsxs(
81334
81237
  "svg",
81335
81238
  {
@@ -81941,10 +81844,6 @@ const ModelSelectField = ({
81941
81844
  (model) => {
81942
81845
  if (selectedModel.id !== model.id) {
81943
81846
  telemetryRecorder.recordEvent("cody.modelSelector", "select", {
81944
- metadata: {
81945
- modelIsCodyProOnly: isCodyProModel(model) ? 1 : 0,
81946
- isCodyProUser: 0
81947
- },
81948
81847
  privateMetadata: {
81949
81848
  modelId: model.id,
81950
81849
  modelProvider: model.provider,
@@ -82134,12 +82033,6 @@ function getTooltip(model, availability) {
82134
82033
  if (model.id.includes(DeepCodyAgentID)) {
82135
82034
  return "Agentic chat reflects on your request and uses tools to dynamically retrieve relevant context, improving accuracy and response quality.";
82136
82035
  }
82137
- if (model.tags.includes(ModelTag.Waitlist)) {
82138
- return "Request access to this new model";
82139
- }
82140
- if (model.tags.includes(ModelTag.OnWaitlist)) {
82141
- return "Request received, we will reach out with next steps";
82142
- }
82143
82036
  if (model.disabled) {
82144
82037
  return "This model is currently unavailable due to rate limiting. Please try a faster model.";
82145
82038
  }
@@ -82155,8 +82048,6 @@ const getBadgeText = (model) => {
82155
82048
  const tagToText = {
82156
82049
  [ModelTag.Internal]: "Internal",
82157
82050
  [ModelTag.Experimental]: "Experimental",
82158
- [ModelTag.Waitlist]: "Join Waitlist",
82159
- [ModelTag.OnWaitlist]: "On Waitlist",
82160
82051
  [ModelTag.EarlyAccess]: "Early Access",
82161
82052
  [ModelTag.Recommended]: "Recommended",
82162
82053
  [ModelTag.Deprecated]: "Deprecated",
@@ -82455,7 +82346,7 @@ const PromptList = (props) => {
82455
82346
  promptFilters
82456
82347
  } = props;
82457
82348
  const { clientCapabilities, authStatus } = useConfig();
82458
- const endpointURL = new URL(authStatus.endpoint);
82349
+ const endpointURL = authStatus.endpoint ? new URL(authStatus.endpoint) : void 0;
82459
82350
  const telemetryRecorder = useTelemetryRecorder();
82460
82351
  const [lastUsedActions = {}] = useLocalStorage("last-used-actions-v2", {});
82461
82352
  const telemetryPublicMetadata = {
@@ -82588,7 +82479,7 @@ const PromptList = (props) => {
82588
82479
  /* @__PURE__ */ jsx(
82589
82480
  "a",
82590
82481
  {
82591
- href: new URL("/prompts/new", endpointURL).toString(),
82482
+ href: endpointURL ? new URL("/prompts/new", endpointURL).toString() : "#",
82592
82483
  target: "_blank",
82593
82484
  rel: "noreferrer",
82594
82485
  children: "Add a prompt"
@@ -82610,7 +82501,7 @@ const PromptList = (props) => {
82610
82501
  /* @__PURE__ */ jsx(CommandSeparator, { alwaysRender: true }),
82611
82502
  /* @__PURE__ */ jsxs(CommandLoading, { className: "tw-px-4", children: [
82612
82503
  "Prompt Library is not yet available on ",
82613
- endpointURL.hostname,
82504
+ endpointURL == null ? void 0 : endpointURL.hostname,
82614
82505
  ". Ask your site admin to upgrade to Sourcegraph 5.6 or later."
82615
82506
  ] })
82616
82507
  ] }),
@@ -83167,11 +83058,11 @@ const INTENT_MAPPING = {
83167
83058
  insert: "Insert"
83168
83059
  /* Insert */
83169
83060
  };
83170
- const ModeSelectorField = ({ className, _intent = "chat", manuallySelectIntent }) => {
83061
+ const ModeSelectorField = ({ className, _intent = "chat", manuallySelectIntent, userInfo }) => {
83171
83062
  const {
83172
83063
  clientCapabilities: { edit }
83173
83064
  } = useConfig();
83174
- const agenticChatEnabled = useFeatureFlag(FeatureFlag.NextAgenticChatInternal);
83065
+ const agenticChatEnabled = useFeatureFlag(FeatureFlag.NextAgenticChatInternal) && userInfo.IDE !== CodyIDE.Web;
83175
83066
  const intentOptions = useMemo$1(() => {
83176
83067
  const isEditEnabled = edit !== "none";
83177
83068
  return [
@@ -83324,7 +83215,8 @@ const Toolbar = ({
83324
83215
  intent,
83325
83216
  extensionAPI,
83326
83217
  onMediaUpload,
83327
- setLastManuallySelectedIntent
83218
+ setLastManuallySelectedIntent,
83219
+ userInfo
83328
83220
  }) => {
83329
83221
  const onMaybeGapClick = useCallback(
83330
83222
  (event) => {
@@ -83399,7 +83291,8 @@ const Toolbar = ({
83399
83291
  {
83400
83292
  className,
83401
83293
  _intent: intent,
83402
- manuallySelectIntent: setLastManuallySelectedIntent
83294
+ manuallySelectIntent: setLastManuallySelectedIntent,
83295
+ userInfo
83403
83296
  }
83404
83297
  ),
83405
83298
  (models == null ? void 0 : models.length) >= 2 && /* @__PURE__ */ jsx(
@@ -83495,7 +83388,8 @@ const HumanMessageEditor = ({
83495
83388
  __storybook__focus,
83496
83389
  onEditorFocusChange: parentOnEditorFocusChange,
83497
83390
  selectedIntent,
83498
- manuallySelectIntent
83391
+ manuallySelectIntent,
83392
+ userInfo
83499
83393
  }) => {
83500
83394
  var _a2, _b, _c;
83501
83395
  const telemetryRecorder = useTelemetryRecorder();
@@ -83785,7 +83679,8 @@ const HumanMessageEditor = ({
83785
83679
  intent: selectedIntent,
83786
83680
  extensionAPI,
83787
83681
  onMediaUpload,
83788
- setLastManuallySelectedIntent: manuallySelectIntent
83682
+ setLastManuallySelectedIntent: manuallySelectIntent,
83683
+ userInfo
83789
83684
  }
83790
83685
  )
83791
83686
  ]
@@ -83823,7 +83718,8 @@ const HumanMessageCellContent = memo$2((props) => {
83823
83718
  __storybook__focus,
83824
83719
  onEditorFocusChange,
83825
83720
  manuallySelectIntent,
83826
- intent
83721
+ intent,
83722
+ userInfo
83827
83723
  } = props;
83828
83724
  return /* @__PURE__ */ jsx(
83829
83725
  BaseMessageCell,
@@ -83848,7 +83744,8 @@ const HumanMessageCellContent = memo$2((props) => {
83848
83744
  __storybook__focus,
83849
83745
  onEditorFocusChange,
83850
83746
  selectedIntent: intent,
83851
- manuallySelectIntent
83747
+ manuallySelectIntent,
83748
+ userInfo
83852
83749
  }
83853
83750
  ),
83854
83751
  className,
@@ -86506,7 +86403,8 @@ const TranscriptInteraction = memo$2((props) => {
86506
86403
  insertButtonOnSubmit,
86507
86404
  copyButtonOnSubmit,
86508
86405
  smartApply,
86509
- editorRef: parentEditorRef
86406
+ editorRef: parentEditorRef,
86407
+ userInfo
86510
86408
  } = props;
86511
86409
  const { activeChatContext, setActiveChatContext } = props;
86512
86410
  const humanEditorRef = useRef$1(null);
@@ -86759,7 +86657,8 @@ const TranscriptInteraction = memo$2((props) => {
86759
86657
  editorRef: humanEditorRef,
86760
86658
  className: "tw-transition",
86761
86659
  intent: selectedIntent,
86762
- manuallySelectIntent: setSelectedIntent
86660
+ manuallySelectIntent: setSelectedIntent,
86661
+ userInfo
86763
86662
  },
86764
86663
  humanMessage.index
86765
86664
  ),
@@ -87100,17 +86999,10 @@ const StorageWarningBanner = ({ extensionAPI, vscodeAPI }) => {
87100
86999
  );
87101
87000
  };
87102
87001
  const storageKey = "DismissedWelcomeNotices";
87103
- const CODY_DEPRECATION_MESSAGES = {
87104
- ENTERPRISE_STARTER_WITH_CODY: "Cody in Enterprise Starter is being sunset. You can continue using Cody until July 23rd. Your code indexing and code search capabilities will not be affected. We encourage you to try Amp, Sourcegraph's new agentic coding tool.",
87105
- ENTERPRISE_STARTER_WITHOUT_CODY: "Cody in Enterprise Starter is being sunset. Because you signed up after 6/25, your account doesn't have Cody, we encourage you to try Amp, Sourcegraph's new agentic coding tool.",
87106
- PRO_USER: "Cody Pro is being sunset. You can continue using Cody until July 23rd, and your subscription will not renew. We encourage you to try Amp, Sourcegraph's new agentic coding tool.",
87107
- FREE_USER_WITH_CODY: "Cody Free is being sunset. You can continue using Cody until July 23rd. We encourage you to try Amp, Sourcegraph's new agentic coding tool.",
87108
- FREE_USER_WITHOUT_CODY: "Cody Free is being sunset. Because you signed up after 6/25, your account doesn't have Cody. We encourage you to try Amp, Sourcegraph's new agentic coding tool."
87109
- };
87110
- const Notices = ({ user, instanceNotices }) => {
87002
+ const Notices = ({ instanceNotices }) => {
87111
87003
  const telemetryRecorder = useTelemetryRecorder();
87112
87004
  const [dismissedNotices, setDismissedNotices] = useLocalStorage(storageKey, "");
87113
- const [sessionDismissedNotices, setSessionDismissedNotices] = useState$1([]);
87005
+ const [_2, setSessionDismissedNotices] = useState$1([]);
87114
87006
  const dismissNotice = useCallback(
87115
87007
  (noticeId, type = "permanent") => {
87116
87008
  if (type === "permanent") {
@@ -87124,21 +87016,6 @@ const Notices = ({ user, instanceNotices }) => {
87124
87016
  },
87125
87017
  [telemetryRecorder, setDismissedNotices]
87126
87018
  );
87127
- const getCodyDeprecationMessage = useCallback(() => {
87128
- var _a2;
87129
- if (isWorkspaceInstance(user.user.endpoint)) {
87130
- const hasCodyEnabled = user.siteHasCodyEnabled === true;
87131
- if (hasCodyEnabled) {
87132
- return CODY_DEPRECATION_MESSAGES.ENTERPRISE_STARTER_WITH_CODY;
87133
- }
87134
- return CODY_DEPRECATION_MESSAGES.ENTERPRISE_STARTER_WITHOUT_CODY;
87135
- }
87136
- const hasSubscription = user.currentUserCodySubscription !== null && user.currentUserCodySubscription !== void 0;
87137
- if (hasSubscription && ((_a2 = user.currentUserCodySubscription) == null ? void 0 : _a2.status) !== "CANCELED") {
87138
- return CODY_DEPRECATION_MESSAGES.FREE_USER_WITH_CODY;
87139
- }
87140
- return CODY_DEPRECATION_MESSAGES.FREE_USER_WITHOUT_CODY;
87141
- }, [user]);
87142
87019
  const notices = useMemo$1(
87143
87020
  () => [
87144
87021
  ...instanceNotices.map((notice) => ({
@@ -87152,169 +87029,21 @@ const Notices = ({ user, instanceNotices }) => {
87152
87029
  onDismiss: () => dismissNotice(notice.key)
87153
87030
  }
87154
87031
  )
87155
- })),
87156
- /**
87157
- * Cody Deprecation Notice
87158
- */
87159
- {
87160
- id: "CodyDeprecation",
87161
- isVisible: isWorkspaceInstance(user.user.endpoint),
87162
- content: /* @__PURE__ */ jsx(
87163
- NoticeContent,
87164
- {
87165
- id: "CodyDeprecation",
87166
- variant: "default",
87167
- title: "Important Notice",
87168
- message: getCodyDeprecationMessage(),
87169
- onDismiss: () => dismissNotice("CodyDeprecation", "sessional"),
87170
- actions: [
87171
- {
87172
- label: "Try Amp",
87173
- variant: "default",
87174
- href: "https://ampcode.com"
87175
- },
87176
- {
87177
- label: "Learn more",
87178
- variant: "ghost",
87179
- href: "https://sourcegraph.com/blog/changes-to-cody-free-pro-and-enterprise-starter-plans"
87180
- }
87181
- ]
87182
- }
87183
- )
87184
- },
87185
- /**
87186
- * For Sourcegraph team members who are using Sourcegraph.com to remind them that we want to be dogfooding S2.
87187
- */
87188
- {
87189
- id: "DogfoodS2",
87190
- isVisible: false,
87191
- content: /* @__PURE__ */ jsx(
87192
- NoticeContent,
87193
- {
87194
- id: "DogfoodS2",
87195
- variant: "warning",
87196
- title: "",
87197
- message: "Sourcegraph team members should use S2 not dotcom (except when testing dotcom-specific behavior) so that we dogfood our enterprise customer experience.",
87198
- onDismiss: () => dismissNotice("DogfoodS2", "sessional"),
87199
- actions: [
87200
- {
87201
- label: "Switch to S2",
87202
- onClick: () => getVSCodeAPI().postMessage({
87203
- command: "auth",
87204
- authKind: "switch",
87205
- endpoint: S2_URL.href
87206
- }),
87207
- variant: "default",
87208
- icon: /* @__PURE__ */ jsx(ArrowLeftRight, { size: 14 }),
87209
- iconPosition: "end"
87210
- },
87211
- {
87212
- label: "Dismiss",
87213
- onClick: () => dismissNotice("DogfoodS2", "sessional"),
87214
- variant: "secondary"
87215
- }
87216
- ]
87217
- }
87218
- )
87219
- }
87032
+ }))
87220
87033
  ],
87221
- [user, dismissNotice, instanceNotices, getCodyDeprecationMessage]
87034
+ [dismissNotice, instanceNotices]
87222
87035
  );
87223
87036
  const activeNotice = useMemo$1(
87224
87037
  () => notices.find((notice) => {
87225
- if (notice.id === "DogfoodS2" || notice.id === "CodyDeprecation") {
87226
- return notice.isVisible && !sessionDismissedNotices.includes(notice.id);
87227
- }
87228
87038
  return notice.isVisible && !(dismissedNotices == null ? void 0 : dismissedNotices.includes(notice.id));
87229
87039
  }),
87230
- [dismissedNotices, sessionDismissedNotices, notices]
87040
+ [dismissedNotices, notices]
87231
87041
  );
87232
87042
  if (!activeNotice) {
87233
87043
  return null;
87234
87044
  }
87235
87045
  return /* @__PURE__ */ jsx("div", { className: "tw-flex tw-flex-col tw-mx-2 tw-my-2 tw-p-2 tw-gap-2", children: activeNotice.content });
87236
87046
  };
87237
- const NoticeContent = ({
87238
- variant,
87239
- title: title2,
87240
- message: message2,
87241
- actions: actions2,
87242
- id: id2,
87243
- info,
87244
- footer: footer2,
87245
- onDismiss
87246
- }) => {
87247
- const telemetryRecorder = useTelemetryRecorder();
87248
- const bgColor = {
87249
- default: "tw-bg-accent tw-bg-opacity-50 tw-text-accent-foreground",
87250
- warning: "tw-bg-red-700 tw-text-white"
87251
- }[variant];
87252
- const header2 = {
87253
- DeepCodyDotCom: /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(CodyLogo, { size: 16 }) }),
87254
- DeepCodyEnterprise: /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(CodyLogo, { size: 16 }) }),
87255
- DogfoodS2: /* @__PURE__ */ jsxs(Fragment$1, { children: [
87256
- /* @__PURE__ */ jsx(Eye, {}),
87257
- /* @__PURE__ */ jsx(Heart, {}),
87258
- /* @__PURE__ */ jsx(Building, {})
87259
- ] }),
87260
- TeamsUpgrade: /* @__PURE__ */ jsxs(Fragment$1, { children: [
87261
- /* @__PURE__ */ jsx(CodyLogo, { size: 16 }),
87262
- /* @__PURE__ */ jsx(ArrowRight, { size: 16 }),
87263
- /* @__PURE__ */ jsx("img", { src: SourcegraphIcon, alt: "Sourcegraph Logo", className: "tw-h-[16px]" })
87264
- ] }),
87265
- CodyDeprecation: null
87266
- }[id2];
87267
- return /* @__PURE__ */ jsxs(
87268
- "aside",
87269
- {
87270
- className: `tw-w-full tw-relative tw-rounded-md tw-flex tw-flex-col tw-gap-2 tw-p-4 ${bgColor}`,
87271
- children: [
87272
- /* @__PURE__ */ jsx("div", { className: "tw-flex tw-gap-3 tw-mb-2", children: header2 }),
87273
- title2 && /* @__PURE__ */ jsx("h1", { className: "tw-text-lg tw-font-semibold", children: title2 }),
87274
- info && /* @__PURE__ */ jsxs("p", { className: "tw-mb-2", children: [
87275
- "ⓘ ",
87276
- info
87277
- ] }),
87278
- /* @__PURE__ */ jsx("p", { children: message2 }),
87279
- /* @__PURE__ */ jsx("div", { className: "tw-mt-3 tw-flex tw-gap-3", children: actions2.map((action, _index) => /* @__PURE__ */ jsxs(
87280
- Button,
87281
- {
87282
- variant: action.variant,
87283
- size: "sm",
87284
- onClick: () => {
87285
- var _a2;
87286
- (_a2 = action.onClick) == null ? void 0 : _a2.call(action);
87287
- telemetryRecorder.recordEvent("cody.notice.cta", "clicked", {
87288
- privateMetadata: {
87289
- noticeId: id2,
87290
- title: action.label
87291
- }
87292
- });
87293
- },
87294
- className: "tw-flex tw-gap-1",
87295
- children: [
87296
- action.iconPosition === "start" && action.icon,
87297
- action.href ? /* @__PURE__ */ jsx(
87298
- "a",
87299
- {
87300
- href: action.href,
87301
- target: "_blank",
87302
- rel: "noreferrer",
87303
- className: "tw-text-inherit hover:!tw-text-inherit",
87304
- children: action.label
87305
- }
87306
- ) : /* @__PURE__ */ jsx("span", { children: action.label }),
87307
- action.iconPosition === "end" && action.icon
87308
- ]
87309
- },
87310
- action.label + "-button"
87311
- )) }),
87312
- footer2 && /* @__PURE__ */ jsx("p", { className: "tw-mt-2", children: footer2 }),
87313
- /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: onDismiss, className: "tw-absolute tw-top-2 tw-right-2", children: /* @__PURE__ */ jsx(X$2, { size: "14" }) })
87314
- ]
87315
- }
87316
- );
87317
- };
87318
87047
  const MarkdownNotice = (props) => {
87319
87048
  const { title: title2, content: content2, onDismiss } = props;
87320
87049
  const message2 = content2.length > 240 ? `${content2.slice(0, 240)}...` : content2;
@@ -87739,7 +87468,7 @@ const StateDebugOverlayInner = ({
87739
87468
  { id: "resolvedConfig", value: resolvedConfig },
87740
87469
  {
87741
87470
  id: "authStatus",
87742
- title: `authStatus ${authStatus ? `(${new URL(authStatus.endpoint).hostname})` : "(undefined)"}`,
87471
+ title: `authStatus ${(authStatus == null ? void 0 : authStatus.endpoint) ? `(${new URL(authStatus.endpoint).hostname})` : "(undefined)"}`,
87743
87472
  value: authStatus
87744
87473
  },
87745
87474
  { id: "modelsData", value: modelsData },
@@ -88993,26 +88722,22 @@ const UserMenu = ({
88993
88722
  accessToken: ""
88994
88723
  });
88995
88724
  const [validationError, setValidationError] = useState$1("");
88996
- const plgEsAccessDisabled = isPlgEsAccessDisabled();
88997
- const handleInputChange = useCallback(
88998
- (e2) => {
88999
- const { name: name2, value } = e2.target;
89000
- if (name2 === "endpoint" && plgEsAccessDisabled) {
89001
- try {
89002
- const urlObj = new URL(value);
89003
- if (isDotCom({ endpoint: urlObj.href }) || isWorkspaceInstance({ endpoint: urlObj.href })) {
89004
- setValidationError("This instance does not have access to Cody");
89005
- } else {
89006
- setValidationError("");
89007
- }
89008
- } catch {
88725
+ const handleInputChange = useCallback((e2) => {
88726
+ const { name: name2, value } = e2.target;
88727
+ if (name2 === "endpoint") {
88728
+ try {
88729
+ const urlObj = new URL(value);
88730
+ if (isDotCom({ endpoint: urlObj.href }) || isWorkspaceInstance({ endpoint: urlObj.href })) {
88731
+ setValidationError("This instance does not have access to Cody");
88732
+ } else {
89009
88733
  setValidationError("");
89010
88734
  }
88735
+ } catch {
88736
+ setValidationError("");
89011
88737
  }
89012
- setAddFormData((prev) => ({ ...prev, [name2]: value }));
89013
- },
89014
- [plgEsAccessDisabled]
89015
- );
88738
+ }
88739
+ setAddFormData((prev) => ({ ...prev, [name2]: value }));
88740
+ }, []);
89016
88741
  const onAddAndSwitchAccountSubmit = useCallback(
89017
88742
  (e2) => {
89018
88743
  e2 == null ? void 0 : e2.preventDefault();
@@ -89853,7 +89578,7 @@ const CodyPanel = ({
89853
89578
  orientation: "vertical",
89854
89579
  className: styles$l.outerContainer,
89855
89580
  children: [
89856
- /* @__PURE__ */ jsx(Notices, { user, instanceNotices }),
89581
+ /* @__PURE__ */ jsx(Notices, { instanceNotices }),
89857
89582
  config.webviewType !== "editor" && /* @__PURE__ */ jsx(
89858
89583
  TabsBar,
89859
89584
  {
@@ -90447,29 +90172,53 @@ const CodyWebPanel = (props) => {
90447
90172
  icon: "search"
90448
90173
  });
90449
90174
  } else {
90450
- initialContext.push({
90451
- type: "file",
90452
- isIgnored: false,
90453
- title: "Current File",
90454
- repoName: repository.name,
90455
- remoteRepositoryName: repository.name,
90456
- uri: URI.file(`${repository.name}/${fileURL}`),
90175
+ const fileUrl = `/${repository.name}/-/blob/${fileURL}`;
90176
+ const basename2 = fileURL.split("/").pop() || fileURL;
90177
+ const fileContextItem = {
90178
+ type: "openctx",
90179
+ provider: "openctx",
90180
+ title: basename2,
90181
+ description: fileURL,
90182
+ uri: URI.parse(fileUrl),
90183
+ providerUri: REMOTE_FILE_PROVIDER_URI,
90457
90184
  source: ContextItemSource.Initial,
90185
+ mention: {
90186
+ uri: fileUrl,
90187
+ data: {
90188
+ repoName: repository.name,
90189
+ rev: "HEAD",
90190
+ filePath: fileURL
90191
+ },
90192
+ description: fileURL
90193
+ },
90458
90194
  icon: "file"
90459
- });
90195
+ };
90196
+ initialContext.push(fileContextItem);
90460
90197
  if (initialContextData == null ? void 0 : initialContextData.fileRange) {
90198
+ const rangeUrl = `${fileUrl}?L${initialContextData.fileRange.startLine + 1}:1-${initialContextData.fileRange.endLine + 1}:1`;
90461
90199
  initialContext.push({
90462
- type: "file",
90463
- isIgnored: false,
90464
- title: "Current Selection",
90200
+ type: "openctx",
90201
+ provider: "openctx",
90202
+ title: `${basename2} (lines ${initialContextData.fileRange.startLine + 1}-${initialContextData.fileRange.endLine + 1})`,
90203
+ description: `${fileURL}:${initialContextData.fileRange.startLine + 1}-${initialContextData.fileRange.endLine + 1}`,
90204
+ uri: URI.parse(rangeUrl),
90205
+ providerUri: REMOTE_FILE_PROVIDER_URI,
90465
90206
  range: {
90466
90207
  start: { line: initialContextData.fileRange.startLine, character: 0 },
90467
90208
  end: { line: initialContextData.fileRange.endLine + 1, character: 0 }
90468
90209
  },
90469
- repoName: repository.name,
90470
- remoteRepositoryName: repository.name,
90471
- uri: URI.file(`${repository.name}/${fileURL}`),
90472
90210
  source: ContextItemSource.Initial,
90211
+ mention: {
90212
+ uri: rangeUrl,
90213
+ data: {
90214
+ repoName: repository.name,
90215
+ rev: "HEAD",
90216
+ filePath: fileURL,
90217
+ startLine: initialContextData.fileRange.startLine,
90218
+ endLine: initialContextData.fileRange.endLine
90219
+ },
90220
+ description: `${fileURL}:${initialContextData.fileRange.startLine + 1}-${initialContextData.fileRange.endLine + 1}`
90221
+ },
90473
90222
  icon: "list-selection"
90474
90223
  });
90475
90224
  }
@@ -90711,6 +90460,6 @@ export {
90711
90460
  ChatSkeleton,
90712
90461
  CodyPromptTemplate,
90713
90462
  CodyWebChat,
90714
- aT as deserialize,
90715
- aS as serialize
90463
+ aQ as deserialize,
90464
+ aP as serialize
90716
90465
  };