@sourcegraph/cody-web 0.35.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/LICENSE +201 -0
- package/dist/{agent.worker-BLjjG8ds.mjs → agent.worker-DKy-Dvsz.mjs} +2180 -1320
- package/dist/agent.worker.js +2 -2
- package/dist/{git-log-C0C2_x8P.mjs → git-log-DigEy5-z.mjs} +1 -1
- package/dist/index-D8dVdFLY.mjs +1055 -0
- package/dist/index.js +115 -369
- package/dist/lib/components/CodyWebChat.d.ts.map +1 -1
- package/dist/{lite-b2NFi2v9.mjs → lite-DPjR5uH7.mjs} +1 -1
- package/dist/style.css +15 -21
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/util-BR3OBpy6.mjs +1811 -0
- package/dist/{vscode-shim-H_ThTWLs.mjs → vscode-shim-CqAb7AbA.mjs} +4971 -4054
- package/package.json +17 -15
- package/dist/util-C44wiTt8.mjs +0 -2033
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 {
|
|
7
|
-
import {
|
|
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
|
|
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 =
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
10750
|
+
if (Zf(c2)) return bg2(a2, c2, b2);
|
|
10751
10751
|
}
|
|
10752
10752
|
return b2;
|
|
10753
10753
|
}
|
|
@@ -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
|
*
|
|
@@ -13849,7 +13805,7 @@ function getItemsHeading$1(parentItem, mentionQuery) {
|
|
|
13849
13805
|
}
|
|
13850
13806
|
const COMMAND_ROW_CLASS_NAME = "!tw-p-3 !tw-text-md !tw-leading-[1.2] !tw-h-[30px] !tw-rounded-none";
|
|
13851
13807
|
const COMMAND_ROW_TEXT_CLASS_NAME = "!tw-text-muted-foreground";
|
|
13852
|
-
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]";
|
|
13853
13809
|
const ChatMentionContext = createContext({
|
|
13854
13810
|
resolutionMode: "local"
|
|
13855
13811
|
});
|
|
@@ -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
|
-
|
|
41615
|
-
|
|
41616
|
-
|
|
41617
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -41660,7 +41608,7 @@ memo$2(
|
|
|
41660
41608
|
setFormState((prev) => ({
|
|
41661
41609
|
...prev,
|
|
41662
41610
|
isSubmitting: false,
|
|
41663
|
-
showAuthError:
|
|
41611
|
+
showAuthError: !(authStatus == null ? void 0 : authStatus.authenticated) && isAuthError(authStatus == null ? void 0 : authStatus.error)
|
|
41664
41612
|
}));
|
|
41665
41613
|
}, 8e3);
|
|
41666
41614
|
}
|
|
@@ -41689,9 +41637,7 @@ memo$2(
|
|
|
41689
41637
|
disabled: !allowEndpointChange
|
|
41690
41638
|
}
|
|
41691
41639
|
),
|
|
41692
|
-
/* @__PURE__ */ jsx(FormMessage, {
|
|
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,
|
|
@@ -41721,8 +41667,7 @@ memo$2(
|
|
|
41721
41667
|
className: "tw-w-full tw-my-2 !tw-p-4",
|
|
41722
41668
|
value: formState.formData.accessToken,
|
|
41723
41669
|
onChange: handleInputChange,
|
|
41724
|
-
autoComplete: "current-password"
|
|
41725
|
-
required: true
|
|
41670
|
+
autoComplete: "current-password"
|
|
41726
41671
|
}
|
|
41727
41672
|
),
|
|
41728
41673
|
/* @__PURE__ */ jsx(
|
|
@@ -41731,8 +41676,7 @@ memo$2(
|
|
|
41731
41676
|
match: () => !isSourcegraphToken(formState.formData.accessToken),
|
|
41732
41677
|
children: "Invalid access token."
|
|
41733
41678
|
}
|
|
41734
|
-
)
|
|
41735
|
-
/* @__PURE__ */ jsx(FormMessage, { match: "valueMissing", children: "Access token is required." })
|
|
41679
|
+
)
|
|
41736
41680
|
] })
|
|
41737
41681
|
]
|
|
41738
41682
|
}
|
|
@@ -41742,8 +41686,7 @@ memo$2(
|
|
|
41742
41686
|
{
|
|
41743
41687
|
type: "submit",
|
|
41744
41688
|
className: "tw-m-4 tw-w-full !tw-p-4",
|
|
41745
|
-
disabled: formState.isSubmitting || !!formState.validationError ||
|
|
41746
|
-
title: formState.showAccessTokenField ? "Continue in your browser" : "Sign in",
|
|
41689
|
+
disabled: formState.isSubmitting || !!formState.validationError || !formState.formData.endpoint,
|
|
41747
41690
|
autoFocus: true,
|
|
41748
41691
|
children: formState.isSubmitting ? "Signing In..." : "Sign In"
|
|
41749
41692
|
}
|
|
@@ -71413,7 +71356,7 @@ function useConfig() {
|
|
|
71413
71356
|
return config;
|
|
71414
71357
|
}
|
|
71415
71358
|
function useUserAccountInfo() {
|
|
71416
|
-
const { authStatus, clientCapabilities, siteHasCodyEnabled
|
|
71359
|
+
const { authStatus, clientCapabilities, siteHasCodyEnabled } = useConfig();
|
|
71417
71360
|
if (!authStatus.authenticated) {
|
|
71418
71361
|
throw new Error(
|
|
71419
71362
|
"useUserAccountInfo must be used within a ConfigProvider with authenticated user"
|
|
@@ -71423,10 +71366,9 @@ function useUserAccountInfo() {
|
|
|
71423
71366
|
() => ({
|
|
71424
71367
|
user: authStatus,
|
|
71425
71368
|
IDE: clientCapabilities.agentIDE,
|
|
71426
|
-
siteHasCodyEnabled
|
|
71427
|
-
currentUserCodySubscription
|
|
71369
|
+
siteHasCodyEnabled
|
|
71428
71370
|
}),
|
|
71429
|
-
[authStatus, clientCapabilities, siteHasCodyEnabled
|
|
71371
|
+
[authStatus, clientCapabilities, siteHasCodyEnabled]
|
|
71430
71372
|
);
|
|
71431
71373
|
}
|
|
71432
71374
|
const ALLOWED_URI_REGEXP = /^((https?|file|vscode):\/\/[^\s#$./?].\S*$|(command:_?cody.*))/i;
|
|
@@ -81288,48 +81230,6 @@ const styles$e = {
|
|
|
81288
81230
|
focused: focused$1,
|
|
81289
81231
|
editorContentEditable: editorContentEditable$1
|
|
81290
81232
|
};
|
|
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
81233
|
const CodyLogoBW = ({ size: size2, ...props }) => /* @__PURE__ */ jsxs(
|
|
81334
81234
|
"svg",
|
|
81335
81235
|
{
|
|
@@ -81941,10 +81841,6 @@ const ModelSelectField = ({
|
|
|
81941
81841
|
(model) => {
|
|
81942
81842
|
if (selectedModel.id !== model.id) {
|
|
81943
81843
|
telemetryRecorder.recordEvent("cody.modelSelector", "select", {
|
|
81944
|
-
metadata: {
|
|
81945
|
-
modelIsCodyProOnly: isCodyProModel(model) ? 1 : 0,
|
|
81946
|
-
isCodyProUser: 0
|
|
81947
|
-
},
|
|
81948
81844
|
privateMetadata: {
|
|
81949
81845
|
modelId: model.id,
|
|
81950
81846
|
modelProvider: model.provider,
|
|
@@ -82134,12 +82030,6 @@ function getTooltip(model, availability) {
|
|
|
82134
82030
|
if (model.id.includes(DeepCodyAgentID)) {
|
|
82135
82031
|
return "Agentic chat reflects on your request and uses tools to dynamically retrieve relevant context, improving accuracy and response quality.";
|
|
82136
82032
|
}
|
|
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
82033
|
if (model.disabled) {
|
|
82144
82034
|
return "This model is currently unavailable due to rate limiting. Please try a faster model.";
|
|
82145
82035
|
}
|
|
@@ -82155,8 +82045,6 @@ const getBadgeText = (model) => {
|
|
|
82155
82045
|
const tagToText = {
|
|
82156
82046
|
[ModelTag.Internal]: "Internal",
|
|
82157
82047
|
[ModelTag.Experimental]: "Experimental",
|
|
82158
|
-
[ModelTag.Waitlist]: "Join Waitlist",
|
|
82159
|
-
[ModelTag.OnWaitlist]: "On Waitlist",
|
|
82160
82048
|
[ModelTag.EarlyAccess]: "Early Access",
|
|
82161
82049
|
[ModelTag.Recommended]: "Recommended",
|
|
82162
82050
|
[ModelTag.Deprecated]: "Deprecated",
|
|
@@ -82455,7 +82343,7 @@ const PromptList = (props) => {
|
|
|
82455
82343
|
promptFilters
|
|
82456
82344
|
} = props;
|
|
82457
82345
|
const { clientCapabilities, authStatus } = useConfig();
|
|
82458
|
-
const endpointURL = new URL(authStatus.endpoint);
|
|
82346
|
+
const endpointURL = authStatus.endpoint ? new URL(authStatus.endpoint) : void 0;
|
|
82459
82347
|
const telemetryRecorder = useTelemetryRecorder();
|
|
82460
82348
|
const [lastUsedActions = {}] = useLocalStorage("last-used-actions-v2", {});
|
|
82461
82349
|
const telemetryPublicMetadata = {
|
|
@@ -82588,7 +82476,7 @@ const PromptList = (props) => {
|
|
|
82588
82476
|
/* @__PURE__ */ jsx(
|
|
82589
82477
|
"a",
|
|
82590
82478
|
{
|
|
82591
|
-
href: new URL("/prompts/new", endpointURL).toString(),
|
|
82479
|
+
href: endpointURL ? new URL("/prompts/new", endpointURL).toString() : "#",
|
|
82592
82480
|
target: "_blank",
|
|
82593
82481
|
rel: "noreferrer",
|
|
82594
82482
|
children: "Add a prompt"
|
|
@@ -82610,7 +82498,7 @@ const PromptList = (props) => {
|
|
|
82610
82498
|
/* @__PURE__ */ jsx(CommandSeparator, { alwaysRender: true }),
|
|
82611
82499
|
/* @__PURE__ */ jsxs(CommandLoading, { className: "tw-px-4", children: [
|
|
82612
82500
|
"Prompt Library is not yet available on ",
|
|
82613
|
-
endpointURL.hostname,
|
|
82501
|
+
endpointURL == null ? void 0 : endpointURL.hostname,
|
|
82614
82502
|
". Ask your site admin to upgrade to Sourcegraph 5.6 or later."
|
|
82615
82503
|
] })
|
|
82616
82504
|
] }),
|
|
@@ -83167,11 +83055,11 @@ const INTENT_MAPPING = {
|
|
|
83167
83055
|
insert: "Insert"
|
|
83168
83056
|
/* Insert */
|
|
83169
83057
|
};
|
|
83170
|
-
const ModeSelectorField = ({ className, _intent = "chat", manuallySelectIntent }) => {
|
|
83058
|
+
const ModeSelectorField = ({ className, _intent = "chat", manuallySelectIntent, userInfo }) => {
|
|
83171
83059
|
const {
|
|
83172
83060
|
clientCapabilities: { edit }
|
|
83173
83061
|
} = useConfig();
|
|
83174
|
-
const agenticChatEnabled = useFeatureFlag(FeatureFlag.NextAgenticChatInternal);
|
|
83062
|
+
const agenticChatEnabled = useFeatureFlag(FeatureFlag.NextAgenticChatInternal) && userInfo.IDE !== CodyIDE.Web;
|
|
83175
83063
|
const intentOptions = useMemo$1(() => {
|
|
83176
83064
|
const isEditEnabled = edit !== "none";
|
|
83177
83065
|
return [
|
|
@@ -83324,7 +83212,8 @@ const Toolbar = ({
|
|
|
83324
83212
|
intent,
|
|
83325
83213
|
extensionAPI,
|
|
83326
83214
|
onMediaUpload,
|
|
83327
|
-
setLastManuallySelectedIntent
|
|
83215
|
+
setLastManuallySelectedIntent,
|
|
83216
|
+
userInfo
|
|
83328
83217
|
}) => {
|
|
83329
83218
|
const onMaybeGapClick = useCallback(
|
|
83330
83219
|
(event) => {
|
|
@@ -83399,7 +83288,8 @@ const Toolbar = ({
|
|
|
83399
83288
|
{
|
|
83400
83289
|
className,
|
|
83401
83290
|
_intent: intent,
|
|
83402
|
-
manuallySelectIntent: setLastManuallySelectedIntent
|
|
83291
|
+
manuallySelectIntent: setLastManuallySelectedIntent,
|
|
83292
|
+
userInfo
|
|
83403
83293
|
}
|
|
83404
83294
|
),
|
|
83405
83295
|
(models == null ? void 0 : models.length) >= 2 && /* @__PURE__ */ jsx(
|
|
@@ -83495,7 +83385,8 @@ const HumanMessageEditor = ({
|
|
|
83495
83385
|
__storybook__focus,
|
|
83496
83386
|
onEditorFocusChange: parentOnEditorFocusChange,
|
|
83497
83387
|
selectedIntent,
|
|
83498
|
-
manuallySelectIntent
|
|
83388
|
+
manuallySelectIntent,
|
|
83389
|
+
userInfo
|
|
83499
83390
|
}) => {
|
|
83500
83391
|
var _a2, _b, _c;
|
|
83501
83392
|
const telemetryRecorder = useTelemetryRecorder();
|
|
@@ -83785,7 +83676,8 @@ const HumanMessageEditor = ({
|
|
|
83785
83676
|
intent: selectedIntent,
|
|
83786
83677
|
extensionAPI,
|
|
83787
83678
|
onMediaUpload,
|
|
83788
|
-
setLastManuallySelectedIntent: manuallySelectIntent
|
|
83679
|
+
setLastManuallySelectedIntent: manuallySelectIntent,
|
|
83680
|
+
userInfo
|
|
83789
83681
|
}
|
|
83790
83682
|
)
|
|
83791
83683
|
]
|
|
@@ -83823,7 +83715,8 @@ const HumanMessageCellContent = memo$2((props) => {
|
|
|
83823
83715
|
__storybook__focus,
|
|
83824
83716
|
onEditorFocusChange,
|
|
83825
83717
|
manuallySelectIntent,
|
|
83826
|
-
intent
|
|
83718
|
+
intent,
|
|
83719
|
+
userInfo
|
|
83827
83720
|
} = props;
|
|
83828
83721
|
return /* @__PURE__ */ jsx(
|
|
83829
83722
|
BaseMessageCell,
|
|
@@ -83848,7 +83741,8 @@ const HumanMessageCellContent = memo$2((props) => {
|
|
|
83848
83741
|
__storybook__focus,
|
|
83849
83742
|
onEditorFocusChange,
|
|
83850
83743
|
selectedIntent: intent,
|
|
83851
|
-
manuallySelectIntent
|
|
83744
|
+
manuallySelectIntent,
|
|
83745
|
+
userInfo
|
|
83852
83746
|
}
|
|
83853
83747
|
),
|
|
83854
83748
|
className,
|
|
@@ -86506,7 +86400,8 @@ const TranscriptInteraction = memo$2((props) => {
|
|
|
86506
86400
|
insertButtonOnSubmit,
|
|
86507
86401
|
copyButtonOnSubmit,
|
|
86508
86402
|
smartApply,
|
|
86509
|
-
editorRef: parentEditorRef
|
|
86403
|
+
editorRef: parentEditorRef,
|
|
86404
|
+
userInfo
|
|
86510
86405
|
} = props;
|
|
86511
86406
|
const { activeChatContext, setActiveChatContext } = props;
|
|
86512
86407
|
const humanEditorRef = useRef$1(null);
|
|
@@ -86759,7 +86654,8 @@ const TranscriptInteraction = memo$2((props) => {
|
|
|
86759
86654
|
editorRef: humanEditorRef,
|
|
86760
86655
|
className: "tw-transition",
|
|
86761
86656
|
intent: selectedIntent,
|
|
86762
|
-
manuallySelectIntent: setSelectedIntent
|
|
86657
|
+
manuallySelectIntent: setSelectedIntent,
|
|
86658
|
+
userInfo
|
|
86763
86659
|
},
|
|
86764
86660
|
humanMessage.index
|
|
86765
86661
|
),
|
|
@@ -87100,17 +86996,10 @@ const StorageWarningBanner = ({ extensionAPI, vscodeAPI }) => {
|
|
|
87100
86996
|
);
|
|
87101
86997
|
};
|
|
87102
86998
|
const storageKey = "DismissedWelcomeNotices";
|
|
87103
|
-
const
|
|
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 }) => {
|
|
86999
|
+
const Notices = ({ instanceNotices }) => {
|
|
87111
87000
|
const telemetryRecorder = useTelemetryRecorder();
|
|
87112
87001
|
const [dismissedNotices, setDismissedNotices] = useLocalStorage(storageKey, "");
|
|
87113
|
-
const [
|
|
87002
|
+
const [_2, setSessionDismissedNotices] = useState$1([]);
|
|
87114
87003
|
const dismissNotice = useCallback(
|
|
87115
87004
|
(noticeId, type = "permanent") => {
|
|
87116
87005
|
if (type === "permanent") {
|
|
@@ -87124,21 +87013,6 @@ const Notices = ({ user, instanceNotices }) => {
|
|
|
87124
87013
|
},
|
|
87125
87014
|
[telemetryRecorder, setDismissedNotices]
|
|
87126
87015
|
);
|
|
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
87016
|
const notices = useMemo$1(
|
|
87143
87017
|
() => [
|
|
87144
87018
|
...instanceNotices.map((notice) => ({
|
|
@@ -87152,169 +87026,21 @@ const Notices = ({ user, instanceNotices }) => {
|
|
|
87152
87026
|
onDismiss: () => dismissNotice(notice.key)
|
|
87153
87027
|
}
|
|
87154
87028
|
)
|
|
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
|
-
}
|
|
87029
|
+
}))
|
|
87220
87030
|
],
|
|
87221
|
-
[
|
|
87031
|
+
[dismissNotice, instanceNotices]
|
|
87222
87032
|
);
|
|
87223
87033
|
const activeNotice = useMemo$1(
|
|
87224
87034
|
() => notices.find((notice) => {
|
|
87225
|
-
if (notice.id === "DogfoodS2" || notice.id === "CodyDeprecation") {
|
|
87226
|
-
return notice.isVisible && !sessionDismissedNotices.includes(notice.id);
|
|
87227
|
-
}
|
|
87228
87035
|
return notice.isVisible && !(dismissedNotices == null ? void 0 : dismissedNotices.includes(notice.id));
|
|
87229
87036
|
}),
|
|
87230
|
-
[dismissedNotices,
|
|
87037
|
+
[dismissedNotices, notices]
|
|
87231
87038
|
);
|
|
87232
87039
|
if (!activeNotice) {
|
|
87233
87040
|
return null;
|
|
87234
87041
|
}
|
|
87235
87042
|
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
87043
|
};
|
|
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
87044
|
const MarkdownNotice = (props) => {
|
|
87319
87045
|
const { title: title2, content: content2, onDismiss } = props;
|
|
87320
87046
|
const message2 = content2.length > 240 ? `${content2.slice(0, 240)}...` : content2;
|
|
@@ -87739,7 +87465,7 @@ const StateDebugOverlayInner = ({
|
|
|
87739
87465
|
{ id: "resolvedConfig", value: resolvedConfig },
|
|
87740
87466
|
{
|
|
87741
87467
|
id: "authStatus",
|
|
87742
|
-
title: `authStatus ${authStatus ? `(${new URL(authStatus.endpoint).hostname})` : "(undefined)"}`,
|
|
87468
|
+
title: `authStatus ${(authStatus == null ? void 0 : authStatus.endpoint) ? `(${new URL(authStatus.endpoint).hostname})` : "(undefined)"}`,
|
|
87743
87469
|
value: authStatus
|
|
87744
87470
|
},
|
|
87745
87471
|
{ id: "modelsData", value: modelsData },
|
|
@@ -88993,26 +88719,22 @@ const UserMenu = ({
|
|
|
88993
88719
|
accessToken: ""
|
|
88994
88720
|
});
|
|
88995
88721
|
const [validationError, setValidationError] = useState$1("");
|
|
88996
|
-
const
|
|
88997
|
-
|
|
88998
|
-
(
|
|
88999
|
-
|
|
89000
|
-
|
|
89001
|
-
|
|
89002
|
-
|
|
89003
|
-
|
|
89004
|
-
setValidationError("This instance does not have access to Cody");
|
|
89005
|
-
} else {
|
|
89006
|
-
setValidationError("");
|
|
89007
|
-
}
|
|
89008
|
-
} catch {
|
|
88722
|
+
const handleInputChange = useCallback((e2) => {
|
|
88723
|
+
const { name: name2, value } = e2.target;
|
|
88724
|
+
if (name2 === "endpoint") {
|
|
88725
|
+
try {
|
|
88726
|
+
const urlObj = new URL(value);
|
|
88727
|
+
if (isDotCom({ endpoint: urlObj.href }) || isWorkspaceInstance({ endpoint: urlObj.href })) {
|
|
88728
|
+
setValidationError("This instance does not have access to Cody");
|
|
88729
|
+
} else {
|
|
89009
88730
|
setValidationError("");
|
|
89010
88731
|
}
|
|
88732
|
+
} catch {
|
|
88733
|
+
setValidationError("");
|
|
89011
88734
|
}
|
|
89012
|
-
|
|
89013
|
-
}
|
|
89014
|
-
|
|
89015
|
-
);
|
|
88735
|
+
}
|
|
88736
|
+
setAddFormData((prev) => ({ ...prev, [name2]: value }));
|
|
88737
|
+
}, []);
|
|
89016
88738
|
const onAddAndSwitchAccountSubmit = useCallback(
|
|
89017
88739
|
(e2) => {
|
|
89018
88740
|
e2 == null ? void 0 : e2.preventDefault();
|
|
@@ -89853,7 +89575,7 @@ const CodyPanel = ({
|
|
|
89853
89575
|
orientation: "vertical",
|
|
89854
89576
|
className: styles$l.outerContainer,
|
|
89855
89577
|
children: [
|
|
89856
|
-
/* @__PURE__ */ jsx(Notices, {
|
|
89578
|
+
/* @__PURE__ */ jsx(Notices, { instanceNotices }),
|
|
89857
89579
|
config.webviewType !== "editor" && /* @__PURE__ */ jsx(
|
|
89858
89580
|
TabsBar,
|
|
89859
89581
|
{
|
|
@@ -89873,7 +89595,7 @@ const CodyPanel = ({
|
|
|
89873
89595
|
}
|
|
89874
89596
|
),
|
|
89875
89597
|
/* @__PURE__ */ jsxs(TabContainer, { value: view, ref: tabContainerRef, "data-scrollable": true, children: [
|
|
89876
|
-
view === View.Chat && /* @__PURE__ */ jsx(
|
|
89598
|
+
view === View.Chat && chatModels && chatModels.length > 0 && /* @__PURE__ */ jsx(
|
|
89877
89599
|
Chat,
|
|
89878
89600
|
{
|
|
89879
89601
|
chatEnabled,
|
|
@@ -89881,7 +89603,7 @@ const CodyPanel = ({
|
|
|
89881
89603
|
messageInProgress,
|
|
89882
89604
|
transcript,
|
|
89883
89605
|
tokenUsage,
|
|
89884
|
-
models: chatModels
|
|
89606
|
+
models: chatModels,
|
|
89885
89607
|
vscodeAPI,
|
|
89886
89608
|
guardrails,
|
|
89887
89609
|
showIDESnippetActions,
|
|
@@ -90447,29 +90169,53 @@ const CodyWebPanel = (props) => {
|
|
|
90447
90169
|
icon: "search"
|
|
90448
90170
|
});
|
|
90449
90171
|
} else {
|
|
90450
|
-
|
|
90451
|
-
|
|
90452
|
-
|
|
90453
|
-
|
|
90454
|
-
|
|
90455
|
-
|
|
90456
|
-
|
|
90172
|
+
const fileUrl = `/${repository.name}/-/blob/${fileURL}`;
|
|
90173
|
+
const basename2 = fileURL.split("/").pop() || fileURL;
|
|
90174
|
+
const fileContextItem = {
|
|
90175
|
+
type: "openctx",
|
|
90176
|
+
provider: "openctx",
|
|
90177
|
+
title: basename2,
|
|
90178
|
+
description: fileURL,
|
|
90179
|
+
uri: URI.parse(fileUrl),
|
|
90180
|
+
providerUri: REMOTE_FILE_PROVIDER_URI,
|
|
90457
90181
|
source: ContextItemSource.Initial,
|
|
90182
|
+
mention: {
|
|
90183
|
+
uri: fileUrl,
|
|
90184
|
+
data: {
|
|
90185
|
+
repoName: repository.name,
|
|
90186
|
+
rev: "HEAD",
|
|
90187
|
+
filePath: fileURL
|
|
90188
|
+
},
|
|
90189
|
+
description: fileURL
|
|
90190
|
+
},
|
|
90458
90191
|
icon: "file"
|
|
90459
|
-
}
|
|
90192
|
+
};
|
|
90193
|
+
initialContext.push(fileContextItem);
|
|
90460
90194
|
if (initialContextData == null ? void 0 : initialContextData.fileRange) {
|
|
90195
|
+
const rangeUrl = `${fileUrl}?L${initialContextData.fileRange.startLine + 1}:1-${initialContextData.fileRange.endLine + 1}:1`;
|
|
90461
90196
|
initialContext.push({
|
|
90462
|
-
type: "
|
|
90463
|
-
|
|
90464
|
-
title:
|
|
90197
|
+
type: "openctx",
|
|
90198
|
+
provider: "openctx",
|
|
90199
|
+
title: `${basename2} (lines ${initialContextData.fileRange.startLine + 1}-${initialContextData.fileRange.endLine + 1})`,
|
|
90200
|
+
description: `${fileURL}:${initialContextData.fileRange.startLine + 1}-${initialContextData.fileRange.endLine + 1}`,
|
|
90201
|
+
uri: URI.parse(rangeUrl),
|
|
90202
|
+
providerUri: REMOTE_FILE_PROVIDER_URI,
|
|
90465
90203
|
range: {
|
|
90466
90204
|
start: { line: initialContextData.fileRange.startLine, character: 0 },
|
|
90467
90205
|
end: { line: initialContextData.fileRange.endLine + 1, character: 0 }
|
|
90468
90206
|
},
|
|
90469
|
-
repoName: repository.name,
|
|
90470
|
-
remoteRepositoryName: repository.name,
|
|
90471
|
-
uri: URI.file(`${repository.name}/${fileURL}`),
|
|
90472
90207
|
source: ContextItemSource.Initial,
|
|
90208
|
+
mention: {
|
|
90209
|
+
uri: rangeUrl,
|
|
90210
|
+
data: {
|
|
90211
|
+
repoName: repository.name,
|
|
90212
|
+
rev: "HEAD",
|
|
90213
|
+
filePath: fileURL,
|
|
90214
|
+
startLine: initialContextData.fileRange.startLine,
|
|
90215
|
+
endLine: initialContextData.fileRange.endLine
|
|
90216
|
+
},
|
|
90217
|
+
description: `${fileURL}:${initialContextData.fileRange.startLine + 1}-${initialContextData.fileRange.endLine + 1}`
|
|
90218
|
+
},
|
|
90473
90219
|
icon: "list-selection"
|
|
90474
90220
|
});
|
|
90475
90221
|
}
|
|
@@ -90711,6 +90457,6 @@ export {
|
|
|
90711
90457
|
ChatSkeleton,
|
|
90712
90458
|
CodyPromptTemplate,
|
|
90713
90459
|
CodyWebChat,
|
|
90714
|
-
|
|
90715
|
-
|
|
90460
|
+
bh as deserialize,
|
|
90461
|
+
bg as serialize
|
|
90716
90462
|
};
|