@sourcegraph/cody-web 0.24.0 → 0.26.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/{agent.worker-DzDDpFJt.mjs → agent.worker-VM-asDOF.mjs} +1954 -7982
- package/dist/agent.worker.js +2 -2
- package/dist/{git-log--I-rJJIH.mjs → git-log-DgPaEJHG.mjs} +1 -3
- package/dist/{index-BGjmPMun.mjs → index-DfULJkoK.mjs} +2 -2
- package/dist/index.js +464 -602
- package/dist/lib/components/CodyPromptTemplate.d.ts.map +1 -1
- package/dist/style.css +66 -149
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{util-DeyYSaNB.mjs → util-BS4yM3h5.mjs} +1 -1
- package/dist/{browser-DRpAM7mB.mjs → vscode-shim-C0OSx8EN.mjs} +10156 -3905
- package/package.json +2 -2
- package/dist/child_process-C6OZyNb4.mjs +0 -18
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { i as getDefaultExportFromCjs, L as Ls, k as ke$1, j as ks, F as Fi$1, _ as _s, m as ds, n as bs, o as ii$1, q as qe$1, y as ys, x as xi$1, K as K$2, J as J$2, r as R$3, u as ws, B as B$2, v as g$5, z as h$4, A as _i, S as Ss, E as Br, G as ln, H as bi$1, I as vn, M as xn, N as Nn, O as mn, Q as li$1, V as n$1, W as ns, X as M$4, Y as Ds, Z as le$2, $ as c$3, a0 as oe$2, a1 as z$1, a2 as yi$1, a3 as W$2, a4 as Ue$1, a5 as I$2, a6 as Se$2, a7 as O$2, a8 as F$1, a9 as Ni$1, aa as ee$1, ab as we$2, ac as b$2, ad as T$3, ae as s$2, af as o$4, ag as w$3, ah as i$2, ai as k$3, aj as D$5, ak as p$8, al as m$8, am as S$4, an as v$4, ao as P$2, ap as E$6, aq as Wi$1, ar as L$3, as as d$2, at as a$3, au as l$2, av as f$2, aw as u$6, ax as r$5, ay as t$2, az as FILE_CONTEXT_MENTION_PROVIDER, aA as SYMBOL_CONTEXT_MENTION_PROVIDER, aB as REMOTE_REPOSITORY_PROVIDER_URI, aC as REMOTE_FILE_PROVIDER_URI, aD as REMOTE_DIRECTORY_PROVIDER_URI, aE as WEB_PROVIDER_URI, aF as displayPath, aG as displayLineRange, aH as displayPathDirname, aI as displayPathBasename, aJ as IGNORED_FILE_WARNING_LABEL, aK as LARGE_FILE_WARNING_LABEL, aL as Ei$1, aM as xe$2, aN as V$2, aO as Es, aP as U$2, aQ as e, aR as Ns, C as ContextItemSource, aS as URI, aT as gs, aU as serializeContextItem, aV as CONTEXT_ITEM_MENTION_NODE_TYPE, aW as contextItemMentionNodeDisplayText, aX as an, aY as qr, aZ as _$2, a_ as TEMPLATE_INPUT_NODE_TYPE, a$ as N$2, b0 as parseMentionQuery, b1 as NO_SYMBOL_MATCHES_HELP_LABEL, b2 as FILE_RANGE_TOOLTIP_LABEL, b3 as Observable, b4 as createExtensionAPI, b5 as createMessageAPIForWebview, b6 as debounce, b7 as memoizeLastValue, b8 as toSerializedPromptEditorValue$1, b9 as ri$1, ba as isEqual, bb as scanForMentionTriggerInUserTextInput, bc as fs, bd as Ts, be as ps, bf as getMentionOperations, bg as forceHydration, bh as hydrateAfterPostMessage, bi as isDotCom, bj as isSourcegraphToken, bk as trace, bl as context$1, bm as SpanStatusCode, bn as FeatureFlag, bo as webviewOpenURIForContextItem, bp as isCodyProUser, h as commonjsGlobal, bq as CodyIDE, br as CodyTaskState, bs as cryptoJsExports, bt as isError, bu as RateLimitError, bv as CODY_FEEDBACK_URL, bw as isDefined, bx as upperFirst, by as lodashExports, bz as createContextItem, bA as isCodeSearchContextItem, bB as reformatBotMessageForChat, bC as isAbortErrorOrSocketHangUp, bD as ModelTag, bE as serializedPromptEditorStateFromChatMessage, bF as contextItemsFromPromptEditorValue, bG as filterContextItemsFromPromptEditorValue, bH as pluralize$1, bI as CustomCommandType, bJ as View, bK as isCodyProModel, bL as isWaitlistModel, bM as getRelativeChatPeriod, bN as isMacOS, bO as firstResultFromOperation, bP as CODY_PRO_SUBSCRIPTION_URL, bQ as ACCOUNT_USAGE_URL, bR as ENTERPRISE_PRICING_URL, bS as firstValueFrom, bT as textContentFromSerializedLexicalNode, bU as skipPendingOperation, bV as FAST_CHAT_INPUT_TOKEN_BUDGET, bW as inputTextWithMappedContextChipsFromPromptEditorState, bX as serializedPromptEditorStateFromText, bY as deserializeContextItem, bZ as SG_WORKSPACES_URL, b_ as DOTCOM_WORKSPACE_LEARN_MORE_URL, b$ as truncateTextStart, c0 as CHAT_INPUT_TOKEN_BUDGET, c1 as S2_URL, c2 as browser, c3 as CodyAutoSuggestionMode, c4 as isErrorLike, c5 as PromptString, c6 as setDisplayPathEnvInfo, U as Uri } from "./vscode-shim-C0OSx8EN.mjs";
|
|
6
|
+
import { c8, c7 } from "./vscode-shim-C0OSx8EN.mjs";
|
|
7
7
|
import * as React$2 from "react";
|
|
8
8
|
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$1, useImperativeHandle, Children, isValidElement, cloneElement, Fragment as Fragment$2, useReducer } from "react";
|
|
9
9
|
var classnames = { exports: {} };
|
|
@@ -8766,6 +8766,8 @@ function getDescription(item2, query) {
|
|
|
8766
8766
|
return "";
|
|
8767
8767
|
case "openctx":
|
|
8768
8768
|
return ((_a = item2.mention) == null ? void 0 : _a.description) || defaultDescription;
|
|
8769
|
+
case "open-link":
|
|
8770
|
+
return "";
|
|
8769
8771
|
default:
|
|
8770
8772
|
return defaultDescription;
|
|
8771
8773
|
}
|
|
@@ -8778,11 +8780,12 @@ function getMentionItemTitleAndDisplayName(item2) {
|
|
|
8778
8780
|
const displayName = isRepo ? ((_b = (_a = title2 == null ? void 0 : title2.split("/")) == null ? void 0 : _a.slice(1)) == null ? void 0 : _b.join("/")) || title2 : title2;
|
|
8779
8781
|
return { title: title2, displayName };
|
|
8780
8782
|
}
|
|
8781
|
-
const MentionMenuContextItemContent = ({ query, item: item2 }) => {
|
|
8783
|
+
const MentionMenuContextItemContent = ({ query, item: item2, badge: badge2 }) => {
|
|
8782
8784
|
const isOpenCtx = item2.type === "openctx";
|
|
8783
8785
|
const isFileType = item2.type === "file";
|
|
8784
8786
|
const isSymbol = item2.type === "symbol";
|
|
8785
8787
|
const isClassSymbol = isSymbol && item2.kind === "class";
|
|
8788
|
+
const isLink = item2.type === "open-link";
|
|
8786
8789
|
const icon2 = item2.icon || (isSymbol ? isClassSymbol ? "symbol-structure" : "symbol-method" : null);
|
|
8787
8790
|
const { title: title2, displayName } = getMentionItemTitleAndDisplayName(item2);
|
|
8788
8791
|
const description2 = getDescription(item2, query);
|
|
@@ -8800,7 +8803,9 @@ const MentionMenuContextItemContent = ({ query, item: item2 }) => {
|
|
|
8800
8803
|
/* @__PURE__ */ jsxs("div", { className: styles$G.row, children: [
|
|
8801
8804
|
icon2 && /* @__PURE__ */ jsx("i", { className: `codicon codicon-${icon2}`, title: isSymbol ? item2.kind : "" }),
|
|
8802
8805
|
/* @__PURE__ */ jsx("span", { className: clsx$1(styles$G.title, warning2 && styles$G.titleWithWarning), title: title2, children: displayName }),
|
|
8803
|
-
description2 && /* @__PURE__ */ jsx("span", { className: styles$G.description, title: description2, children: description2 })
|
|
8806
|
+
description2 && /* @__PURE__ */ jsx("span", { className: styles$G.description, title: description2, children: description2 }),
|
|
8807
|
+
badge2,
|
|
8808
|
+
isLink && /* @__PURE__ */ jsx(ExternalLink, { size: 16, strokeWidth: 1.25, style: { opacity: "0.5" } })
|
|
8804
8809
|
] }),
|
|
8805
8810
|
warning2 && /* @__PURE__ */ jsx("span", { className: styles$G.warning, children: warning2 })
|
|
8806
8811
|
] });
|
|
@@ -9881,6 +9886,7 @@ const MentionMenu = ({
|
|
|
9881
9886
|
const effectiveValueRow = valueRow ?? firstRow;
|
|
9882
9887
|
const heading2 = getItemsHeading$1(params.parentItem, mentionQuery);
|
|
9883
9888
|
const {
|
|
9889
|
+
badgeComponents: { Badge: Badge2 },
|
|
9884
9890
|
commandComponents: {
|
|
9885
9891
|
Command: Command2,
|
|
9886
9892
|
CommandEmpty: CommandEmpty2,
|
|
@@ -9916,21 +9922,31 @@ const MentionMenu = ({
|
|
|
9916
9922
|
"data-testid": "mention-menu",
|
|
9917
9923
|
children: /* @__PURE__ */ jsxs(CommandList2, { className: "!tw-max-h-[unset]", children: [
|
|
9918
9924
|
providers.length > 0 && /* @__PURE__ */ jsx(CommandGroup2, { className: COMMAND_GROUP_CLASS_NAME, children: providers }),
|
|
9919
|
-
(heading2 || data.items && data.items.length > 0) && /* @__PURE__ */ jsx(CommandGroup2, { heading: heading2, className: COMMAND_GROUP_CLASS_NAME, children: (_b = data.items) == null ? void 0 : _b.map((item2) =>
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9925
|
+
(heading2 || data.items && data.items.length > 0) && /* @__PURE__ */ jsx(CommandGroup2, { heading: heading2, className: COMMAND_GROUP_CLASS_NAME, children: (_b = data.items) == null ? void 0 : _b.map((item2) => {
|
|
9926
|
+
const badge2 = item2.badge ? /* @__PURE__ */ jsx(Badge2, { children: item2.badge }) : void 0;
|
|
9927
|
+
return /* @__PURE__ */ jsx(
|
|
9928
|
+
CommandItem2,
|
|
9929
|
+
{
|
|
9930
|
+
value: commandRowValue$1(item2),
|
|
9931
|
+
disabled: item2.isIgnored,
|
|
9932
|
+
onSelect: onCommandSelect,
|
|
9933
|
+
className: clsx$1(
|
|
9934
|
+
styles$C.item,
|
|
9935
|
+
styles$C.contextItem,
|
|
9936
|
+
COMMAND_ROW_CLASS_NAME
|
|
9937
|
+
),
|
|
9938
|
+
children: /* @__PURE__ */ jsx(
|
|
9939
|
+
MentionMenuContextItemContent,
|
|
9940
|
+
{
|
|
9941
|
+
query: mentionQuery,
|
|
9942
|
+
item: item2,
|
|
9943
|
+
badge: badge2
|
|
9944
|
+
}
|
|
9945
|
+
)
|
|
9946
|
+
},
|
|
9947
|
+
commandRowValue$1(item2)
|
|
9948
|
+
);
|
|
9949
|
+
}) }),
|
|
9934
9950
|
((_c = params.parentItem) == null ? void 0 : _c.id) === REMOTE_DIRECTORY_PROVIDER_URI && !!((_d = data.items) == null ? void 0 : _d.length) && /* @__PURE__ */ jsx(
|
|
9935
9951
|
CommandLoading2,
|
|
9936
9952
|
{
|
|
@@ -10211,147 +10227,147 @@ function createMentionMenuOption(item2) {
|
|
|
10211
10227
|
function scanForMentionTriggerInLexicalInput(text2) {
|
|
10212
10228
|
return scanForMentionTriggerInUserTextInput({ textBeforeCursor: text2, includeWhitespace: true });
|
|
10213
10229
|
}
|
|
10214
|
-
const MentionsPlugin = memo$1(
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
(
|
|
10221
|
-
if (editor2) {
|
|
10222
|
-
editor2.update(() => {
|
|
10223
|
-
var _a;
|
|
10224
|
-
const node2 = (_a = Fi$1()) == null ? void 0 : _a.getNodes().at(-1);
|
|
10225
|
-
if (!node2 || !ii$1(node2)) {
|
|
10226
|
-
return;
|
|
10227
|
-
}
|
|
10228
|
-
const currentText = node2.getTextContent();
|
|
10229
|
-
const [newText, index2] = getNewQuery(currentText);
|
|
10230
|
-
if (currentText === newText) {
|
|
10231
|
-
return;
|
|
10232
|
-
}
|
|
10233
|
-
node2.setTextContent(newText);
|
|
10234
|
-
if (index2 !== void 0) {
|
|
10235
|
-
node2.select(index2, index2);
|
|
10236
|
-
} else {
|
|
10237
|
-
const offset2 = sharedPrefixLength(currentText, newText);
|
|
10238
|
-
node2.select(offset2, offset2);
|
|
10239
|
-
}
|
|
10240
|
-
});
|
|
10241
|
-
}
|
|
10242
|
-
},
|
|
10243
|
-
[editor2]
|
|
10244
|
-
);
|
|
10245
|
-
useEffect$2(() => {
|
|
10246
|
-
const unregister = editor2.registerMutationListener(ContextItemMentionNode, (node2) => {
|
|
10247
|
-
var _a;
|
|
10248
|
-
const items = (_a = toSerializedPromptEditorValue$1(editor2)) == null ? void 0 : _a.contextItems;
|
|
10249
|
-
if (!(items == null ? void 0 : items.length)) {
|
|
10250
|
-
setTokenAdded(0);
|
|
10251
|
-
return;
|
|
10252
|
-
}
|
|
10253
|
-
setTokenAdded((items == null ? void 0 : items.reduce((acc, item2) => acc + (item2.size ? item2.size : 0), 0)) ?? 0);
|
|
10254
|
-
});
|
|
10255
|
-
return unregister;
|
|
10256
|
-
}, [editor2]);
|
|
10257
|
-
const onSelectOption = useCallback(
|
|
10258
|
-
(selectedOption, nodeToReplace, closeMenu) => {
|
|
10230
|
+
const MentionsPlugin = memo$1(({ contextWindowSizeInTokens, openExternalLink }) => {
|
|
10231
|
+
const [editor2] = u$5();
|
|
10232
|
+
const [tokenAdded, setTokenAdded] = useState$1(0);
|
|
10233
|
+
const { params, updateQuery, updateMentionMenuParams } = useMentionMenuParams();
|
|
10234
|
+
const setEditorQuery = useCallback(
|
|
10235
|
+
(getNewQuery) => {
|
|
10236
|
+
if (editor2) {
|
|
10259
10237
|
editor2.update(() => {
|
|
10260
|
-
|
|
10261
|
-
|
|
10238
|
+
var _a;
|
|
10239
|
+
const node2 = (_a = Fi$1()) == null ? void 0 : _a.getNodes().at(-1);
|
|
10240
|
+
if (!node2 || !ii$1(node2)) {
|
|
10241
|
+
return;
|
|
10242
|
+
}
|
|
10243
|
+
const currentText = node2.getTextContent();
|
|
10244
|
+
const [newText, index2] = getNewQuery(currentText);
|
|
10245
|
+
if (currentText === newText) {
|
|
10262
10246
|
return;
|
|
10263
10247
|
}
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
const textNode = $createContextItemTextNode(selectedItem);
|
|
10268
|
-
nodeToReplace.replace(textNode);
|
|
10269
|
-
textNode.insertBefore(ri$1("@"));
|
|
10270
|
-
const colonNode = ri$1(":");
|
|
10271
|
-
textNode.insertAfter(colonNode);
|
|
10272
|
-
colonNode.select();
|
|
10248
|
+
node2.setTextContent(newText);
|
|
10249
|
+
if (index2 !== void 0) {
|
|
10250
|
+
node2.select(index2, index2);
|
|
10273
10251
|
} else {
|
|
10274
|
-
const
|
|
10275
|
-
|
|
10276
|
-
const spaceNode = ri$1(" ");
|
|
10277
|
-
mentionNode.insertAfter(spaceNode);
|
|
10278
|
-
spaceNode.select();
|
|
10252
|
+
const offset2 = sharedPrefixLength(currentText, newText);
|
|
10253
|
+
node2.select(offset2, offset2);
|
|
10279
10254
|
}
|
|
10280
|
-
closeMenu();
|
|
10281
10255
|
});
|
|
10282
|
-
}
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10256
|
+
}
|
|
10257
|
+
},
|
|
10258
|
+
[editor2]
|
|
10259
|
+
);
|
|
10260
|
+
useEffect$2(() => {
|
|
10261
|
+
const unregister = editor2.registerMutationListener(ContextItemMentionNode, (node2) => {
|
|
10262
|
+
var _a;
|
|
10263
|
+
const items = (_a = toSerializedPromptEditorValue$1(editor2)) == null ? void 0 : _a.contextItems;
|
|
10264
|
+
if (!(items == null ? void 0 : items.length)) {
|
|
10265
|
+
setTokenAdded(0);
|
|
10266
|
+
return;
|
|
10267
|
+
}
|
|
10268
|
+
setTokenAdded((items == null ? void 0 : items.reduce((acc, item2) => acc + (item2.size ? item2.size : 0), 0)) ?? 0);
|
|
10269
|
+
});
|
|
10270
|
+
return unregister;
|
|
10271
|
+
}, [editor2]);
|
|
10272
|
+
const onSelectOption = useCallback(
|
|
10273
|
+
(selectedOption, nodeToReplace, closeMenu) => {
|
|
10274
|
+
editor2.update(() => {
|
|
10275
|
+
const currentInputText = nodeToReplace == null ? void 0 : nodeToReplace.__text;
|
|
10276
|
+
if (!currentInputText) {
|
|
10277
|
+
return;
|
|
10278
|
+
}
|
|
10279
|
+
const selectedItem = selectedOption.item;
|
|
10280
|
+
const isLargeFile = selectedItem.isTooLarge;
|
|
10281
|
+
if (isLargeFile && !selectedItem.range) {
|
|
10282
|
+
const textNode = $createContextItemTextNode(selectedItem);
|
|
10283
|
+
nodeToReplace.replace(textNode);
|
|
10284
|
+
textNode.insertBefore(ri$1("@"));
|
|
10285
|
+
const colonNode = ri$1(":");
|
|
10286
|
+
textNode.insertAfter(colonNode);
|
|
10287
|
+
colonNode.select();
|
|
10288
|
+
} else if (selectedItem.type === "open-link") {
|
|
10289
|
+
nodeToReplace.remove();
|
|
10290
|
+
openExternalLink(selectedItem.uri.toString());
|
|
10291
|
+
} else {
|
|
10292
|
+
const mentionNode = $createContextItemMentionNode(selectedItem);
|
|
10293
|
+
nodeToReplace.replace(mentionNode);
|
|
10294
|
+
const spaceNode = ri$1(" ");
|
|
10295
|
+
mentionNode.insertAfter(spaceNode);
|
|
10296
|
+
spaceNode.select();
|
|
10297
|
+
}
|
|
10298
|
+
closeMenu();
|
|
10299
|
+
});
|
|
10300
|
+
},
|
|
10301
|
+
[editor2, openExternalLink]
|
|
10302
|
+
);
|
|
10303
|
+
const anchorElementRef2 = useRef$1();
|
|
10304
|
+
useEffect$2(() => {
|
|
10305
|
+
return editor2.registerCommand(
|
|
10306
|
+
V$2,
|
|
10307
|
+
(event) => {
|
|
10308
|
+
var _a, _b, _c;
|
|
10309
|
+
const isInEditorOrMenu = Boolean(
|
|
10310
|
+
event.relatedTarget instanceof Node && (((_a = editor2.getRootElement()) == null ? void 0 : _a.contains(event.relatedTarget)) || ((_b = anchorElementRef2.current) == null ? void 0 : _b.contains(event.relatedTarget)))
|
|
10311
|
+
);
|
|
10312
|
+
if (isInEditorOrMenu) {
|
|
10313
|
+
(_c = editor2.getRootElement()) == null ? void 0 : _c.focus();
|
|
10302
10314
|
return true;
|
|
10303
|
-
},
|
|
10304
|
-
Es
|
|
10305
|
-
);
|
|
10306
|
-
}, [editor2]);
|
|
10307
|
-
const interactionID = useRef$1(0);
|
|
10308
|
-
const onClose = useCallback(() => {
|
|
10309
|
-
updateMentionMenuParams({ parentItem: null, interactionID: null });
|
|
10310
|
-
}, [updateMentionMenuParams]);
|
|
10311
|
-
const onOpen = useCallback(() => {
|
|
10312
|
-
updateMentionMenuParams({ interactionID: interactionID.current++ });
|
|
10313
|
-
}, [updateMentionMenuParams]);
|
|
10314
|
-
return /* @__PURE__ */ jsx(
|
|
10315
|
-
L,
|
|
10316
|
-
{
|
|
10317
|
-
onQueryChange: updateQuery,
|
|
10318
|
-
onSelectOption,
|
|
10319
|
-
onClose,
|
|
10320
|
-
onOpen,
|
|
10321
|
-
triggerFn: scanForMentionTriggerInLexicalInput,
|
|
10322
|
-
options: DUMMY_OPTIONS,
|
|
10323
|
-
commandPriority: Es,
|
|
10324
|
-
menuRenderFn: (anchorElementRef, itemProps) => {
|
|
10325
|
-
const remainingTokenBudget = contextWindowSizeInTokens === void 0 ? Number.MAX_SAFE_INTEGER : contextWindowSizeInTokens - tokenAdded;
|
|
10326
|
-
const data = useMentionMenuData(params, {
|
|
10327
|
-
remainingTokenBudget,
|
|
10328
|
-
limit: SUGGESTION_LIST_LENGTH_LIMIT$1
|
|
10329
|
-
});
|
|
10330
|
-
const { selectOptionAndCleanUp } = itemProps;
|
|
10331
|
-
anchorElementRef2.current = anchorElementRef.current ?? void 0;
|
|
10332
|
-
return anchorElementRef.current && reactDomExports.createPortal(
|
|
10333
|
-
// Use an outer container that is always the same height, which is the
|
|
10334
|
-
// max height of the visible menu. This ensures that the menu does not
|
|
10335
|
-
// flip orientation as the user is typing if it suddenly has less
|
|
10336
|
-
// results. It also makes the positioning less glitchy.
|
|
10337
|
-
/* @__PURE__ */ jsx("div", { "data-at-mention-menu": "", className: clsx$1(styles$D.popoverDimensions), children: /* @__PURE__ */ jsx("div", { className: styles$D.popover, children: /* @__PURE__ */ jsx(
|
|
10338
|
-
MentionMenu,
|
|
10339
|
-
{
|
|
10340
|
-
params,
|
|
10341
|
-
updateMentionMenuParams,
|
|
10342
|
-
setEditorQuery,
|
|
10343
|
-
data,
|
|
10344
|
-
selectOptionAndCleanUp
|
|
10345
|
-
}
|
|
10346
|
-
) }) }),
|
|
10347
|
-
anchorElementRef.current
|
|
10348
|
-
);
|
|
10349
10315
|
}
|
|
10350
|
-
|
|
10316
|
+
editor2.dispatchCommand(
|
|
10317
|
+
b$2,
|
|
10318
|
+
new KeyboardEvent("keydown", { key: "Escape" })
|
|
10319
|
+
);
|
|
10320
|
+
return true;
|
|
10321
|
+
},
|
|
10322
|
+
Es
|
|
10351
10323
|
);
|
|
10352
|
-
},
|
|
10353
|
-
|
|
10354
|
-
)
|
|
10324
|
+
}, [editor2]);
|
|
10325
|
+
const interactionID = useRef$1(0);
|
|
10326
|
+
const onClose = useCallback(() => {
|
|
10327
|
+
updateMentionMenuParams({ parentItem: null, interactionID: null });
|
|
10328
|
+
}, [updateMentionMenuParams]);
|
|
10329
|
+
const onOpen = useCallback(() => {
|
|
10330
|
+
updateMentionMenuParams({ interactionID: interactionID.current++ });
|
|
10331
|
+
}, [updateMentionMenuParams]);
|
|
10332
|
+
return /* @__PURE__ */ jsx(
|
|
10333
|
+
L,
|
|
10334
|
+
{
|
|
10335
|
+
onQueryChange: updateQuery,
|
|
10336
|
+
onSelectOption,
|
|
10337
|
+
onClose,
|
|
10338
|
+
onOpen,
|
|
10339
|
+
triggerFn: scanForMentionTriggerInLexicalInput,
|
|
10340
|
+
options: DUMMY_OPTIONS,
|
|
10341
|
+
commandPriority: Es,
|
|
10342
|
+
menuRenderFn: (anchorElementRef, itemProps) => {
|
|
10343
|
+
const remainingTokenBudget = contextWindowSizeInTokens === void 0 ? Number.MAX_SAFE_INTEGER : contextWindowSizeInTokens - tokenAdded;
|
|
10344
|
+
const data = useMentionMenuData(params, {
|
|
10345
|
+
remainingTokenBudget,
|
|
10346
|
+
limit: SUGGESTION_LIST_LENGTH_LIMIT$1
|
|
10347
|
+
});
|
|
10348
|
+
const { selectOptionAndCleanUp } = itemProps;
|
|
10349
|
+
anchorElementRef2.current = anchorElementRef.current ?? void 0;
|
|
10350
|
+
return anchorElementRef.current && reactDomExports.createPortal(
|
|
10351
|
+
// Use an outer container that is always the same height, which is the
|
|
10352
|
+
// max height of the visible menu. This ensures that the menu does not
|
|
10353
|
+
// flip orientation as the user is typing if it suddenly has less
|
|
10354
|
+
// results. It also makes the positioning less glitchy.
|
|
10355
|
+
/* @__PURE__ */ jsx("div", { "data-at-mention-menu": "", className: clsx$1(styles$D.popoverDimensions), children: /* @__PURE__ */ jsx("div", { className: styles$D.popover, children: /* @__PURE__ */ jsx(
|
|
10356
|
+
MentionMenu,
|
|
10357
|
+
{
|
|
10358
|
+
params,
|
|
10359
|
+
updateMentionMenuParams,
|
|
10360
|
+
setEditorQuery,
|
|
10361
|
+
data,
|
|
10362
|
+
selectOptionAndCleanUp
|
|
10363
|
+
}
|
|
10364
|
+
) }) }),
|
|
10365
|
+
anchorElementRef.current
|
|
10366
|
+
);
|
|
10367
|
+
}
|
|
10368
|
+
}
|
|
10369
|
+
);
|
|
10370
|
+
}, isEqual);
|
|
10355
10371
|
function sharedPrefixLength(s1, s2) {
|
|
10356
10372
|
let i = 0;
|
|
10357
10373
|
while (i < s1.length && i < s2.length && s1[i] === s2[i]) {
|
|
@@ -10458,7 +10474,8 @@ const BaseEditor = ({
|
|
|
10458
10474
|
className,
|
|
10459
10475
|
contentEditableClassName,
|
|
10460
10476
|
"aria-label": ariaLabel,
|
|
10461
|
-
onEnterKey
|
|
10477
|
+
onEnterKey,
|
|
10478
|
+
openExternalLink
|
|
10462
10479
|
}) => {
|
|
10463
10480
|
const initialConfig = useMemo$1(
|
|
10464
10481
|
() => ({
|
|
@@ -10495,7 +10512,13 @@ const BaseEditor = ({
|
|
|
10495
10512
|
ignoreHistoryMergeTagChange: false
|
|
10496
10513
|
}
|
|
10497
10514
|
),
|
|
10498
|
-
/* @__PURE__ */ jsx(
|
|
10515
|
+
/* @__PURE__ */ jsx(
|
|
10516
|
+
MentionsPlugin,
|
|
10517
|
+
{
|
|
10518
|
+
contextWindowSizeInTokens,
|
|
10519
|
+
openExternalLink
|
|
10520
|
+
}
|
|
10521
|
+
),
|
|
10499
10522
|
onFocusChange && /* @__PURE__ */ jsx(OnFocusChangePlugin, { onFocusChange }),
|
|
10500
10523
|
editorRef && /* @__PURE__ */ jsx(o$2, { editorRef }),
|
|
10501
10524
|
/* @__PURE__ */ jsx(KeyboardEventPlugin, { onEnterKey }),
|
|
@@ -10657,7 +10680,8 @@ const PromptEditor$1 = ({
|
|
|
10657
10680
|
contextWindowSizeInTokens,
|
|
10658
10681
|
disabled: disabled2,
|
|
10659
10682
|
editorRef: ref,
|
|
10660
|
-
onEnterKey
|
|
10683
|
+
onEnterKey,
|
|
10684
|
+
openExternalLink
|
|
10661
10685
|
}) => {
|
|
10662
10686
|
const editorRef = useRef$1(null);
|
|
10663
10687
|
const hasSetInitialContext = useRef$1(false);
|
|
@@ -10886,7 +10910,8 @@ const PromptEditor$1 = ({
|
|
|
10886
10910
|
placeholder: placeholder2,
|
|
10887
10911
|
disabled: disabled2,
|
|
10888
10912
|
"aria-label": "Chat message",
|
|
10889
|
-
onEnterKey
|
|
10913
|
+
onEnterKey,
|
|
10914
|
+
openExternalLink
|
|
10890
10915
|
}
|
|
10891
10916
|
);
|
|
10892
10917
|
};
|
|
@@ -11774,13 +11799,13 @@ function replaceOuter($from, $to, slice2, depth) {
|
|
|
11774
11799
|
let inner = replaceOuter($from, $to, slice2, depth + 1);
|
|
11775
11800
|
return node2.copy(node2.content.replaceChild(index2, inner));
|
|
11776
11801
|
} else if (!slice2.content.size) {
|
|
11777
|
-
return close$
|
|
11802
|
+
return close$1(node2, replaceTwoWay($from, $to, depth));
|
|
11778
11803
|
} else if (!slice2.openStart && !slice2.openEnd && $from.depth == depth && $to.depth == depth) {
|
|
11779
11804
|
let parent = $from.parent, content2 = parent.content;
|
|
11780
|
-
return close$
|
|
11805
|
+
return close$1(parent, content2.cut(0, $from.parentOffset).append(slice2.content).append(content2.cut($to.parentOffset)));
|
|
11781
11806
|
} else {
|
|
11782
11807
|
let { start, end } = prepareSliceForReplace(slice2, $from);
|
|
11783
|
-
return close$
|
|
11808
|
+
return close$1(node2, replaceThreeWay($from, start, end, $to, depth));
|
|
11784
11809
|
}
|
|
11785
11810
|
}
|
|
11786
11811
|
function checkJoin(main, sub) {
|
|
@@ -11816,7 +11841,7 @@ function addRange($start, $end, depth, target) {
|
|
|
11816
11841
|
if ($end && $end.depth == depth && $end.textOffset)
|
|
11817
11842
|
addNode$1($end.nodeBefore, target);
|
|
11818
11843
|
}
|
|
11819
|
-
function close$
|
|
11844
|
+
function close$1(node2, content2) {
|
|
11820
11845
|
node2.type.checkContent(content2);
|
|
11821
11846
|
return node2.copy(content2);
|
|
11822
11847
|
}
|
|
@@ -11827,13 +11852,13 @@ function replaceThreeWay($from, $start, $end, $to, depth) {
|
|
|
11827
11852
|
addRange(null, $from, depth, content2);
|
|
11828
11853
|
if (openStart && openEnd && $start.index(depth) == $end.index(depth)) {
|
|
11829
11854
|
checkJoin(openStart, openEnd);
|
|
11830
|
-
addNode$1(close$
|
|
11855
|
+
addNode$1(close$1(openStart, replaceThreeWay($from, $start, $end, $to, depth + 1)), content2);
|
|
11831
11856
|
} else {
|
|
11832
11857
|
if (openStart)
|
|
11833
|
-
addNode$1(close$
|
|
11858
|
+
addNode$1(close$1(openStart, replaceTwoWay($from, $start, depth + 1)), content2);
|
|
11834
11859
|
addRange($start, $end, depth, content2);
|
|
11835
11860
|
if (openEnd)
|
|
11836
|
-
addNode$1(close$
|
|
11861
|
+
addNode$1(close$1(openEnd, replaceTwoWay($end, $to, depth + 1)), content2);
|
|
11837
11862
|
}
|
|
11838
11863
|
addRange($to, null, depth, content2);
|
|
11839
11864
|
return new Fragment(content2);
|
|
@@ -11843,7 +11868,7 @@ function replaceTwoWay($from, $to, depth) {
|
|
|
11843
11868
|
addRange(null, $from, depth, content2);
|
|
11844
11869
|
if ($from.depth > depth) {
|
|
11845
11870
|
let type = joinable$1($from, $to, depth + 1);
|
|
11846
|
-
addNode$1(close$
|
|
11871
|
+
addNode$1(close$1(type, replaceTwoWay($from, $to, depth + 1)), content2);
|
|
11847
11872
|
}
|
|
11848
11873
|
addRange($to, null, depth, content2);
|
|
11849
11874
|
return new Fragment(content2);
|
|
@@ -26972,6 +26997,13 @@ const promptInput = setup({
|
|
|
26972
26997
|
});
|
|
26973
26998
|
return;
|
|
26974
26999
|
}
|
|
27000
|
+
if (item2.type === "open-link") {
|
|
27001
|
+
enqueue({
|
|
27002
|
+
type: "updateEditorState",
|
|
27003
|
+
params: replaceAtMention(context2.editorState, schema.text(""))
|
|
27004
|
+
});
|
|
27005
|
+
return;
|
|
27006
|
+
}
|
|
26975
27007
|
enqueue({
|
|
26976
27008
|
type: "updateEditorState",
|
|
26977
27009
|
params: replaceAtMention(
|
|
@@ -34992,6 +35024,82 @@ const TooltipContent = React$2.forwardRef(({ portal, className, sideOffset = 4,
|
|
|
34992
35024
|
) });
|
|
34993
35025
|
});
|
|
34994
35026
|
TooltipContent.displayName = $a093c7e1ec25a057$export$7c6e2c02157bb7d2.displayName;
|
|
35027
|
+
function r$1(e2) {
|
|
35028
|
+
var t2, f2, n2 = "";
|
|
35029
|
+
if ("string" == typeof e2 || "number" == typeof e2) n2 += e2;
|
|
35030
|
+
else if ("object" == typeof e2) if (Array.isArray(e2)) for (t2 = 0; t2 < e2.length; t2++) e2[t2] && (f2 = r$1(e2[t2])) && (n2 && (n2 += " "), n2 += f2);
|
|
35031
|
+
else for (t2 in e2) e2[t2] && (n2 && (n2 += " "), n2 += t2);
|
|
35032
|
+
return n2;
|
|
35033
|
+
}
|
|
35034
|
+
function clsx() {
|
|
35035
|
+
for (var e2, t2, f2 = 0, n2 = ""; f2 < arguments.length; ) (e2 = arguments[f2++]) && (t2 = r$1(e2)) && (n2 && (n2 += " "), n2 += t2);
|
|
35036
|
+
return n2;
|
|
35037
|
+
}
|
|
35038
|
+
const falsyToString = (value) => typeof value === "boolean" ? "".concat(value) : value === 0 ? "0" : value;
|
|
35039
|
+
const cx = clsx;
|
|
35040
|
+
const cva = (base2, config) => {
|
|
35041
|
+
return (props) => {
|
|
35042
|
+
var ref;
|
|
35043
|
+
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base2, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
35044
|
+
const { variants: variants2, defaultVariants } = config;
|
|
35045
|
+
const getVariantClassNames = Object.keys(variants2).map((variant) => {
|
|
35046
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
35047
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
35048
|
+
if (variantProp === null) return null;
|
|
35049
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
35050
|
+
return variants2[variant][variantKey];
|
|
35051
|
+
});
|
|
35052
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
35053
|
+
let [key, value] = param;
|
|
35054
|
+
if (value === void 0) {
|
|
35055
|
+
return acc;
|
|
35056
|
+
}
|
|
35057
|
+
acc[key] = value;
|
|
35058
|
+
return acc;
|
|
35059
|
+
}, {});
|
|
35060
|
+
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1) => {
|
|
35061
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param1;
|
|
35062
|
+
return Object.entries(compoundVariantOptions).every((param) => {
|
|
35063
|
+
let [key, value] = param;
|
|
35064
|
+
return Array.isArray(value) ? value.includes({
|
|
35065
|
+
...defaultVariants,
|
|
35066
|
+
...propsWithoutUndefined
|
|
35067
|
+
}[key]) : {
|
|
35068
|
+
...defaultVariants,
|
|
35069
|
+
...propsWithoutUndefined
|
|
35070
|
+
}[key] === value;
|
|
35071
|
+
}) ? [
|
|
35072
|
+
...acc,
|
|
35073
|
+
cvClass,
|
|
35074
|
+
cvClassName
|
|
35075
|
+
] : acc;
|
|
35076
|
+
}, []);
|
|
35077
|
+
return cx(base2, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
35078
|
+
};
|
|
35079
|
+
};
|
|
35080
|
+
const badgeVariants = cva(
|
|
35081
|
+
"tw-inline-flex tw-items-center tw-rounded-[6px] tw-px-[5px] tw-py-0 tw-text-xs focus:tw-outline-none focus:tw-ring-2 focus:tw-ring-ring focus:tw-ring-offset-2",
|
|
35082
|
+
{
|
|
35083
|
+
variants: {
|
|
35084
|
+
variant: {
|
|
35085
|
+
secondary: "tw-bg-badge-background tw-text-badge-foreground",
|
|
35086
|
+
outline: "tw-border tw-border-muted-transparent tw-bg-[unset] tw-text-muted-foreground",
|
|
35087
|
+
ghost: "tw-bg-muted-transparent tw-text-muted-foreground",
|
|
35088
|
+
cody: "tw-bg-gradient-to-r tw-from-sourcegraph-blue tw-via-sourcegraph-purple tw-to-sourcegraph-orange tw-text-badge-foreground",
|
|
35089
|
+
warning: "tw-bg-yellow-900 tw-text-yellow-300",
|
|
35090
|
+
info: "tw-bg-blue-900 tw-text-blue-300",
|
|
35091
|
+
error: "tw-bg-pink-900 tw-text-pink-300",
|
|
35092
|
+
disabled: "tw-bg-gray-900 tw-text-gray-300"
|
|
35093
|
+
}
|
|
35094
|
+
},
|
|
35095
|
+
defaultVariants: {
|
|
35096
|
+
variant: "secondary"
|
|
35097
|
+
}
|
|
35098
|
+
}
|
|
35099
|
+
);
|
|
35100
|
+
function Badge({ className, variant, ...props }) {
|
|
35101
|
+
return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
35102
|
+
}
|
|
34995
35103
|
var U = 1, Y$1 = 0.9, H = 0.8, J = 0.17, p$1 = 0.1, u = 0.999, $ = 0.9999;
|
|
34996
35104
|
var k$1 = 0.99, m = /[\\\/_+.#"@\[\(\{&]/, B = /[\\\/_+.#"@\[\(\{&]/g, K = /[\s-]/, X$1 = /[\s-]/g;
|
|
34997
35105
|
function G$1(_2, C2, h2, P2, A2, f2, O2) {
|
|
@@ -36720,6 +36828,9 @@ const promptEditorConfig = {
|
|
|
36720
36828
|
});
|
|
36721
36829
|
}
|
|
36722
36830
|
},
|
|
36831
|
+
badgeComponents: {
|
|
36832
|
+
Badge
|
|
36833
|
+
},
|
|
36723
36834
|
tooltipComponents: {
|
|
36724
36835
|
Tooltip,
|
|
36725
36836
|
TooltipContent,
|
|
@@ -36774,59 +36885,6 @@ const styles$w = {
|
|
|
36774
36885
|
closeBtn
|
|
36775
36886
|
};
|
|
36776
36887
|
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";
|
|
36777
|
-
function r$1(e2) {
|
|
36778
|
-
var t2, f2, n2 = "";
|
|
36779
|
-
if ("string" == typeof e2 || "number" == typeof e2) n2 += e2;
|
|
36780
|
-
else if ("object" == typeof e2) if (Array.isArray(e2)) for (t2 = 0; t2 < e2.length; t2++) e2[t2] && (f2 = r$1(e2[t2])) && (n2 && (n2 += " "), n2 += f2);
|
|
36781
|
-
else for (t2 in e2) e2[t2] && (n2 && (n2 += " "), n2 += t2);
|
|
36782
|
-
return n2;
|
|
36783
|
-
}
|
|
36784
|
-
function clsx() {
|
|
36785
|
-
for (var e2, t2, f2 = 0, n2 = ""; f2 < arguments.length; ) (e2 = arguments[f2++]) && (t2 = r$1(e2)) && (n2 && (n2 += " "), n2 += t2);
|
|
36786
|
-
return n2;
|
|
36787
|
-
}
|
|
36788
|
-
const falsyToString = (value) => typeof value === "boolean" ? "".concat(value) : value === 0 ? "0" : value;
|
|
36789
|
-
const cx = clsx;
|
|
36790
|
-
const cva = (base2, config) => {
|
|
36791
|
-
return (props) => {
|
|
36792
|
-
var ref;
|
|
36793
|
-
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base2, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
36794
|
-
const { variants: variants2, defaultVariants } = config;
|
|
36795
|
-
const getVariantClassNames = Object.keys(variants2).map((variant) => {
|
|
36796
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
36797
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
36798
|
-
if (variantProp === null) return null;
|
|
36799
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
36800
|
-
return variants2[variant][variantKey];
|
|
36801
|
-
});
|
|
36802
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
36803
|
-
let [key, value] = param;
|
|
36804
|
-
if (value === void 0) {
|
|
36805
|
-
return acc;
|
|
36806
|
-
}
|
|
36807
|
-
acc[key] = value;
|
|
36808
|
-
return acc;
|
|
36809
|
-
}, {});
|
|
36810
|
-
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1) => {
|
|
36811
|
-
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param1;
|
|
36812
|
-
return Object.entries(compoundVariantOptions).every((param) => {
|
|
36813
|
-
let [key, value] = param;
|
|
36814
|
-
return Array.isArray(value) ? value.includes({
|
|
36815
|
-
...defaultVariants,
|
|
36816
|
-
...propsWithoutUndefined
|
|
36817
|
-
}[key]) : {
|
|
36818
|
-
...defaultVariants,
|
|
36819
|
-
...propsWithoutUndefined
|
|
36820
|
-
}[key] === value;
|
|
36821
|
-
}) ? [
|
|
36822
|
-
...acc,
|
|
36823
|
-
cvClass,
|
|
36824
|
-
cvClassName
|
|
36825
|
-
] : acc;
|
|
36826
|
-
}, []);
|
|
36827
|
-
return cx(base2, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
36828
|
-
};
|
|
36829
|
-
};
|
|
36830
36888
|
const roundedIconStyles = "tw-flex tw-items-center tw-justify-center !tw-rounded-full !tw-p-2 tw-border";
|
|
36831
36889
|
const buttonVariants$1 = cva(
|
|
36832
36890
|
"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",
|
|
@@ -37780,14 +37838,20 @@ class SpanManager {
|
|
|
37780
37838
|
this.activeContext = void 0;
|
|
37781
37839
|
}
|
|
37782
37840
|
}
|
|
37841
|
+
const ClientConfigContext = createContext(null);
|
|
37842
|
+
const ClientConfigProvider = ({ value, children: children2 }) => /* @__PURE__ */ jsx(ClientConfigContext.Provider, { value, children: children2 });
|
|
37843
|
+
function useClientConfig() {
|
|
37844
|
+
return useContext(ClientConfigContext);
|
|
37845
|
+
}
|
|
37783
37846
|
function useFeatureFlag(flag) {
|
|
37784
37847
|
const evaluatedFeatureFlag = useExtensionAPI().evaluatedFeatureFlag;
|
|
37785
37848
|
return useObservable(useMemo$1(() => evaluatedFeatureFlag(flag), [evaluatedFeatureFlag, flag])).value;
|
|
37786
37849
|
}
|
|
37787
|
-
const
|
|
37788
|
-
|
|
37850
|
+
const useOmniBox = () => {
|
|
37851
|
+
const config = useClientConfig();
|
|
37852
|
+
return !!(config == null ? void 0 : config.omniBoxEnabled) && !!(config == null ? void 0 : config.codeSearchEnabled);
|
|
37789
37853
|
};
|
|
37790
|
-
const
|
|
37854
|
+
const useOmniBoxDebug = () => {
|
|
37791
37855
|
return useFeatureFlag(FeatureFlag.CodyExperimentalOneBoxDebug);
|
|
37792
37856
|
};
|
|
37793
37857
|
const path$2 = "_path_1dh30_1";
|
|
@@ -37869,7 +37933,7 @@ included from Sourcegraph search`;
|
|
|
37869
37933
|
};
|
|
37870
37934
|
const iconTitle = source2 && hoverSourceLabels[source2] ? `Included ${hoverSourceLabels[source2]}` : void 0;
|
|
37871
37935
|
const telemetryRecorder = useTelemetryRecorder();
|
|
37872
|
-
const oneboxEnabled =
|
|
37936
|
+
const oneboxEnabled = useOmniBox();
|
|
37873
37937
|
const logClick = useCallback(() => {
|
|
37874
37938
|
if (!oneboxEnabled) {
|
|
37875
37939
|
return;
|
|
@@ -38759,7 +38823,7 @@ const Cell = forwardRef((props, ref) => {
|
|
|
38759
38823
|
"div",
|
|
38760
38824
|
{
|
|
38761
38825
|
ref,
|
|
38762
|
-
className: clsx$1("tw-flex tw-flex-col tw-gap-4", containerClassName),
|
|
38826
|
+
className: clsx$1("tw-flex tw-flex-col tw-gap-4 tw-pt-4", containerClassName),
|
|
38763
38827
|
role: "row",
|
|
38764
38828
|
"aria-current": ariaCurrent,
|
|
38765
38829
|
"aria-disabled": ariaDisabled,
|
|
@@ -38995,7 +39059,7 @@ function chatModelIconComponent(model) {
|
|
|
38995
39059
|
if (model.startsWith("openai") || model.includes("gpt")) {
|
|
38996
39060
|
return OpenAILogo;
|
|
38997
39061
|
}
|
|
38998
|
-
if (model.includes("anthropic")) {
|
|
39062
|
+
if (model.includes("anthropic") || model.includes("deep-cody")) {
|
|
38999
39063
|
return AnthropicLogo;
|
|
39000
39064
|
}
|
|
39001
39065
|
if (model.startsWith("google") || model.includes("gemini")) {
|
|
@@ -71853,7 +71917,7 @@ const ResultContainer = forwardRef(function ResultContainer2(props, reference) {
|
|
|
71853
71917
|
{
|
|
71854
71918
|
className: clsx$1(
|
|
71855
71919
|
styles$m.header,
|
|
71856
|
-
"tw-flex tw-items-center tw-gap-2 tw-py-2 tw-px-4 md:tw-py-3 md:tw-px-6 "
|
|
71920
|
+
"tw-flex tw-pt-4 tw-items-center tw-gap-2 tw-py-2 tw-px-4 md:tw-py-3 md:tw-px-6 "
|
|
71857
71921
|
),
|
|
71858
71922
|
"data-result-header": true,
|
|
71859
71923
|
children: [
|
|
@@ -72514,14 +72578,14 @@ const SearchFiltersModal = ({
|
|
|
72514
72578
|
] })
|
|
72515
72579
|
] });
|
|
72516
72580
|
};
|
|
72517
|
-
const filtersSidebar = "_filters-
|
|
72518
|
-
const root$5 = "
|
|
72519
|
-
const resultsContainer = "_results-
|
|
72520
|
-
const filtersSidebarHidden = "_filters-sidebar-
|
|
72521
|
-
const filtersSidebarToggle = "_filters-sidebar-
|
|
72522
|
-
const filtersModalTrigger = "_filters-modal-
|
|
72523
|
-
const searchResultsHeader = "_search-results-
|
|
72524
|
-
const searchResultsHeaderLabel = "_search-results-header-
|
|
72581
|
+
const filtersSidebar = "_filters-sidebar_1qmjt_2";
|
|
72582
|
+
const root$5 = "_root_1qmjt_12";
|
|
72583
|
+
const resultsContainer = "_results-container_1qmjt_18";
|
|
72584
|
+
const filtersSidebarHidden = "_filters-sidebar-hidden_1qmjt_21";
|
|
72585
|
+
const filtersSidebarToggle = "_filters-sidebar-toggle_1qmjt_28";
|
|
72586
|
+
const filtersModalTrigger = "_filters-modal-trigger_1qmjt_34";
|
|
72587
|
+
const searchResultsHeader = "_search-results-header_1qmjt_44";
|
|
72588
|
+
const searchResultsHeaderLabel = "_search-results-header-label_1qmjt_53";
|
|
72525
72589
|
const styles$i = {
|
|
72526
72590
|
filtersSidebar,
|
|
72527
72591
|
root: root$5,
|
|
@@ -72540,9 +72604,9 @@ const SearchResults = ({
|
|
|
72540
72604
|
feedbackButtonsOnSubmit,
|
|
72541
72605
|
enableContextSelection
|
|
72542
72606
|
}) => {
|
|
72543
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i2;
|
|
72607
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i2, _j, _k;
|
|
72544
72608
|
const telemetryRecorder = useTelemetryRecorder();
|
|
72545
|
-
const experimentalOneBoxDebug =
|
|
72609
|
+
const experimentalOneBoxDebug = useOmniBoxDebug();
|
|
72546
72610
|
const lastEditorRef = useContext(LastEditorContext);
|
|
72547
72611
|
const [selectedFollowUpResults, updateSelectedFollowUpResults] = useReducer(
|
|
72548
72612
|
selectedResultsReducer,
|
|
@@ -72562,6 +72626,13 @@ const SearchResults = ({
|
|
|
72562
72626
|
);
|
|
72563
72627
|
const initialResults = useMemo$1(() => totalResults == null ? void 0 : totalResults.slice(0, DEFAULT_RESULTS_LIMIT), [totalResults]);
|
|
72564
72628
|
const resultsToShow = (initialResults == null ? void 0 : initialResults.length) === (totalResults == null ? void 0 : totalResults.length) || showAll ? totalResults : initialResults;
|
|
72629
|
+
const boostedRepo = (_a = message2.search.query.match(/boost:repo\(([^)]+)\)/)) == null ? void 0 : _a[1];
|
|
72630
|
+
const firstNonBoostedRepoIndex = boostedRepo ? resultsToShow.findIndex(
|
|
72631
|
+
(result2) => result2.__typename === "FileMatch" && result2.repository.name !== boostedRepo
|
|
72632
|
+
) : void 0;
|
|
72633
|
+
const hasResults = (initialResults == null ? void 0 : initialResults.length) > 0 ? (initialResults == null ? void 0 : initialResults.length) > 0 : resultsToShow.length > 0;
|
|
72634
|
+
const showFiltersButton = hasResults && !!((_c = (_b = message2.search.response) == null ? void 0 : _b.results.dynamicFilters) == null ? void 0 : _c.length) || ((_d = message2.search.selectedFilters) == null ? void 0 : _d.length);
|
|
72635
|
+
const showAddContextCheckbox = hasResults && enableContextSelection;
|
|
72565
72636
|
useLayoutEffect$1(() => {
|
|
72566
72637
|
updateSelectedFollowUpResults({
|
|
72567
72638
|
type: "init",
|
|
@@ -72619,7 +72690,7 @@ const SearchResults = ({
|
|
|
72619
72690
|
return /* @__PURE__ */ jsx(
|
|
72620
72691
|
SearchFiltersModal,
|
|
72621
72692
|
{
|
|
72622
|
-
filters: ((
|
|
72693
|
+
filters: ((_e = message2.search.response) == null ? void 0 : _e.results.dynamicFilters) || [],
|
|
72623
72694
|
selectedFilters: message2.search.selectedFilters || [],
|
|
72624
72695
|
onSelectedFiltersUpdate,
|
|
72625
72696
|
close: () => {
|
|
@@ -72632,11 +72703,11 @@ const SearchResults = ({
|
|
|
72632
72703
|
);
|
|
72633
72704
|
}
|
|
72634
72705
|
return /* @__PURE__ */ jsx("div", { className: styles$i.root, children: /* @__PURE__ */ jsxs("div", { className: classNames(styles$i.container, "tw-flex"), children: [
|
|
72635
|
-
showFiltersSidebar && (!!((
|
|
72706
|
+
showFiltersSidebar && (!!((_g = (_f = message2.search.response) == null ? void 0 : _f.results.dynamicFilters) == null ? void 0 : _g.length) || !!((_h = message2.search.selectedFilters) == null ? void 0 : _h.length)) && /* @__PURE__ */ jsxs(
|
|
72636
72707
|
"div",
|
|
72637
72708
|
{
|
|
72638
72709
|
className: classNames(
|
|
72639
|
-
"tw-min-w-[250px] tw-w-[250px] tw-relative tw-mt-2 tw-p-4 tw-border-r tw-shadow",
|
|
72710
|
+
"tw-min-w-[250px] tw-w-[250px] tw-relative tw-mt-2 tw-p-4 tw-border-r tw-border-border tw-shadow",
|
|
72640
72711
|
styles$i.filtersSidebar
|
|
72641
72712
|
),
|
|
72642
72713
|
children: [
|
|
@@ -72655,7 +72726,7 @@ const SearchResults = ({
|
|
|
72655
72726
|
/* @__PURE__ */ jsx(
|
|
72656
72727
|
SearchFilters,
|
|
72657
72728
|
{
|
|
72658
|
-
filters: ((
|
|
72729
|
+
filters: ((_i2 = message2.search.response) == null ? void 0 : _i2.results.dynamicFilters) || [],
|
|
72659
72730
|
selectedFilters: message2.search.selectedFilters || [],
|
|
72660
72731
|
onSelectedFiltersUpdate
|
|
72661
72732
|
}
|
|
@@ -72669,12 +72740,12 @@ const SearchResults = ({
|
|
|
72669
72740
|
"div",
|
|
72670
72741
|
{
|
|
72671
72742
|
className: classNames(
|
|
72672
|
-
"tw-flex tw-items-center tw-gap-4 tw-justify-between tw-py-4 md:tw-px-4 tw-border-b",
|
|
72743
|
+
"tw-flex tw-items-center tw-gap-4 tw-justify-between tw-py-4 md:tw-px-4 tw-border-b tw-border-border",
|
|
72673
72744
|
styles$i.searchResultsHeader
|
|
72674
72745
|
),
|
|
72675
72746
|
children: [
|
|
72676
72747
|
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-gap-4 tw-items-center", children: [
|
|
72677
|
-
|
|
72748
|
+
showFiltersButton && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs(
|
|
72678
72749
|
Button,
|
|
72679
72750
|
{
|
|
72680
72751
|
onClick: () => {
|
|
@@ -72689,12 +72760,11 @@ const SearchResults = ({
|
|
|
72689
72760
|
}
|
|
72690
72761
|
);
|
|
72691
72762
|
setShowFiltersModal(true);
|
|
72692
|
-
setShowFiltersSidebar(true);
|
|
72693
72763
|
},
|
|
72694
72764
|
variant: "outline",
|
|
72695
72765
|
className: styles$i.filtersModalTrigger,
|
|
72696
72766
|
children: [
|
|
72697
|
-
((
|
|
72767
|
+
((_j = message2.search.selectedFilters) == null ? void 0 : _j.length) ? /* @__PURE__ */ jsx(FilterX, { className: "tw-size-6 md:tw-size-8" }) : /* @__PURE__ */ jsx(Filter, { className: "tw-size-6 md:tw-size-8" }),
|
|
72698
72768
|
/* @__PURE__ */ jsx("span", { className: styles$i.searchResultsHeaderLabel, children: "Filters" })
|
|
72699
72769
|
]
|
|
72700
72770
|
}
|
|
@@ -72706,27 +72776,14 @@ const SearchResults = ({
|
|
|
72706
72776
|
" code search results"
|
|
72707
72777
|
] })
|
|
72708
72778
|
] }),
|
|
72709
|
-
/* @__PURE__ */
|
|
72710
|
-
/* @__PURE__ */ jsx(
|
|
72711
|
-
|
|
72712
|
-
{
|
|
72713
|
-
htmlFor: "search-results.select-all",
|
|
72714
|
-
className: styles$i.searchResultsHeaderLabel,
|
|
72715
|
-
children: "Add to context"
|
|
72716
|
-
}
|
|
72717
|
-
),
|
|
72718
|
-
/* @__PURE__ */ jsx(
|
|
72719
|
-
"input",
|
|
72779
|
+
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-items-center tw-gap-6 tw-px-4 md:tw-px-2", children: [
|
|
72780
|
+
showFiltersButton && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs(
|
|
72781
|
+
Button,
|
|
72720
72782
|
{
|
|
72721
|
-
|
|
72722
|
-
id: "search-results.select-all",
|
|
72723
|
-
title: "Select all results",
|
|
72724
|
-
checked: selectedFollowUpResults.size === resultsToShow.length,
|
|
72725
|
-
onChange: (event) => {
|
|
72726
|
-
const checked = event.target.checked;
|
|
72783
|
+
onClick: () => {
|
|
72727
72784
|
telemetryRecorder.recordEvent(
|
|
72728
|
-
"onebox.
|
|
72729
|
-
|
|
72785
|
+
"onebox.filterModal",
|
|
72786
|
+
"opened",
|
|
72730
72787
|
{
|
|
72731
72788
|
billingMetadata: {
|
|
72732
72789
|
product: "cody",
|
|
@@ -72734,21 +72791,60 @@ const SearchResults = ({
|
|
|
72734
72791
|
}
|
|
72735
72792
|
}
|
|
72736
72793
|
);
|
|
72737
|
-
|
|
72738
|
-
|
|
72739
|
-
|
|
72740
|
-
|
|
72741
|
-
|
|
72742
|
-
}
|
|
72743
|
-
|
|
72744
|
-
|
|
72745
|
-
|
|
72746
|
-
|
|
72794
|
+
setShowFiltersSidebar(true);
|
|
72795
|
+
},
|
|
72796
|
+
variant: "outline",
|
|
72797
|
+
className: styles$i.filtersSidebarToggle,
|
|
72798
|
+
children: [
|
|
72799
|
+
((_k = message2.search.selectedFilters) == null ? void 0 : _k.length) ? /* @__PURE__ */ jsx(FilterX, { className: "tw-size-6 md:tw-size-8" }) : /* @__PURE__ */ jsx(Filter, { className: "tw-size-6 md:tw-size-8" }),
|
|
72800
|
+
/* @__PURE__ */ jsx("span", { className: styles$i.searchResultsHeaderLabel, children: "Filters" })
|
|
72801
|
+
]
|
|
72802
|
+
}
|
|
72803
|
+
) }),
|
|
72804
|
+
showAddContextCheckbox && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
72805
|
+
/* @__PURE__ */ jsx(
|
|
72806
|
+
Label,
|
|
72807
|
+
{
|
|
72808
|
+
htmlFor: "search-results.select-all",
|
|
72809
|
+
className: styles$i.searchResultsHeaderLabel,
|
|
72810
|
+
children: "Add to context"
|
|
72811
|
+
}
|
|
72812
|
+
),
|
|
72813
|
+
/* @__PURE__ */ jsx(
|
|
72814
|
+
"input",
|
|
72815
|
+
{
|
|
72816
|
+
type: "checkbox",
|
|
72817
|
+
id: "search-results.select-all",
|
|
72818
|
+
title: "Select all results",
|
|
72819
|
+
checked: selectedFollowUpResults.size === resultsToShow.length,
|
|
72820
|
+
onChange: (event) => {
|
|
72821
|
+
const checked = event.target.checked;
|
|
72822
|
+
telemetryRecorder.recordEvent(
|
|
72823
|
+
"onebox.results",
|
|
72824
|
+
checked ? "selectAll" : "deselectAll",
|
|
72825
|
+
{
|
|
72826
|
+
billingMetadata: {
|
|
72827
|
+
product: "cody",
|
|
72828
|
+
category: "billable"
|
|
72829
|
+
}
|
|
72830
|
+
}
|
|
72831
|
+
);
|
|
72832
|
+
if (checked) {
|
|
72833
|
+
updateSelectedFollowUpResults({
|
|
72834
|
+
type: "add",
|
|
72835
|
+
results: resultsToShow
|
|
72836
|
+
});
|
|
72837
|
+
} else {
|
|
72838
|
+
updateSelectedFollowUpResults({
|
|
72839
|
+
type: "init",
|
|
72840
|
+
results: []
|
|
72841
|
+
});
|
|
72842
|
+
}
|
|
72747
72843
|
}
|
|
72748
72844
|
}
|
|
72749
|
-
|
|
72750
|
-
)
|
|
72751
|
-
] })
|
|
72845
|
+
)
|
|
72846
|
+
] })
|
|
72847
|
+
] })
|
|
72752
72848
|
]
|
|
72753
72849
|
}
|
|
72754
72850
|
),
|
|
@@ -72761,17 +72857,20 @@ const SearchResults = ({
|
|
|
72761
72857
|
" ",
|
|
72762
72858
|
/* @__PURE__ */ jsx("code", { children: message2.search.queryWithSelectedFilters })
|
|
72763
72859
|
] }),
|
|
72764
|
-
resultsToShow.length ? /* @__PURE__ */ jsx("ul", { className: "tw-list-none tw-flex tw-flex-col", children: resultsToShow.map((result2, i) => /* @__PURE__ */
|
|
72860
|
+
resultsToShow.length ? /* @__PURE__ */ jsx("ul", { className: "tw-list-none tw-flex tw-flex-col", children: resultsToShow.map((result2, i) => /* @__PURE__ */ jsxs(
|
|
72765
72861
|
"li",
|
|
72766
72862
|
{
|
|
72767
|
-
children:
|
|
72768
|
-
|
|
72769
|
-
|
|
72770
|
-
|
|
72771
|
-
|
|
72772
|
-
|
|
72773
|
-
|
|
72774
|
-
|
|
72863
|
+
children: [
|
|
72864
|
+
i === firstNonBoostedRepoIndex && /* @__PURE__ */ jsx("h6", { className: "tw-border-b tw-border-border tw-text-muted-foreground tw-p-4 tw-pt-8", children: "Results from other repositories" }),
|
|
72865
|
+
/* @__PURE__ */ jsx(
|
|
72866
|
+
NLSResultSnippet,
|
|
72867
|
+
{
|
|
72868
|
+
result: result2,
|
|
72869
|
+
selectedForContext: selectedFollowUpResults.has(result2),
|
|
72870
|
+
onSelectForContext: enableContextSelection ? handleSelectForContext : void 0
|
|
72871
|
+
}
|
|
72872
|
+
)
|
|
72873
|
+
]
|
|
72775
72874
|
},
|
|
72776
72875
|
i
|
|
72777
72876
|
)) }) : /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-flex-col tw-gap-4 tw-justify-center tw-items-center tw-my-20 tw-text-muted-foreground", children: [
|
|
@@ -72903,13 +73002,13 @@ const AssistantMessageCell = memo$1(
|
|
|
72903
73002
|
const ModelIcon = chatModel ? chatModelIconComponent(chatModel.id) : null;
|
|
72904
73003
|
const isAborted = isAbortErrorOrSocketHangUp(message2.error);
|
|
72905
73004
|
const hasLongerResponseTime = (_a = chatModel == null ? void 0 : chatModel.tags) == null ? void 0 : _a.includes(ModelTag.StreamDisabled);
|
|
72906
|
-
const experimentalOneBoxEnabled =
|
|
73005
|
+
const experimentalOneBoxEnabled = useOmniBox();
|
|
72907
73006
|
const isSearchIntent = experimentalOneBoxEnabled && (humanMessage == null ? void 0 : humanMessage.intent) === "search";
|
|
72908
73007
|
return /* @__PURE__ */ jsx(
|
|
72909
73008
|
BaseMessageCell,
|
|
72910
73009
|
{
|
|
72911
73010
|
speakerIcon: ModelIcon && (!isSearchIntent || isLoading) ? /* @__PURE__ */ jsx(ModelIcon, { size: NON_HUMAN_CELL_AVATAR_SIZE }) : null,
|
|
72912
|
-
speakerTitle: isSearchIntent ? void 0 : /* @__PURE__ */ jsx("span", { "data-testid": "chat-model", children: chatModel ? chatModel.title ?? `Model ${chatModel.id} by ${chatModel.provider}` : "Model" }),
|
|
73011
|
+
speakerTitle: isSearchIntent ? void 0 : /* @__PURE__ */ jsx("span", { "data-testid": "chat-model", children: chatModel ? chatModel.id.includes("deep-cody") ? "Claude 3.5 Sonnet (New)" : chatModel.title ?? `Model ${chatModel.id} by ${chatModel.provider}` : "Model" }),
|
|
72913
73012
|
content: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
72914
73013
|
message2.error && !isAborted ? typeof message2.error === "string" ? /* @__PURE__ */ jsx(RequestErrorItem, { error: message2.error }) : /* @__PURE__ */ jsx(
|
|
72915
73014
|
ErrorItem,
|
|
@@ -73029,16 +73128,16 @@ function useChatModelByID(model, chatModels) {
|
|
|
73029
73128
|
tags: []
|
|
73030
73129
|
} : void 0);
|
|
73031
73130
|
}
|
|
73032
|
-
const contextItem = "_context-
|
|
73033
|
-
const contextItemMetadata = "_context-item-
|
|
73034
|
-
const contextItemEditButton = "_context-item-edit-
|
|
73035
|
-
const contextItemEditButtonIcon = "_context-item-edit-button-
|
|
73036
|
-
const contextSuggestedActions = "_context-suggested-
|
|
73037
|
-
const root$4 = "
|
|
73038
|
-
const linkContainer = "_link-
|
|
73039
|
-
const header$1 = "
|
|
73040
|
-
const contextItemLink = "_context-item-
|
|
73041
|
-
const codeBlock = "_code-
|
|
73131
|
+
const contextItem = "_context-item_g0048_1";
|
|
73132
|
+
const contextItemMetadata = "_context-item-metadata_g0048_6";
|
|
73133
|
+
const contextItemEditButton = "_context-item-edit-button_g0048_12";
|
|
73134
|
+
const contextItemEditButtonIcon = "_context-item-edit-button-icon_g0048_20";
|
|
73135
|
+
const contextSuggestedActions = "_context-suggested-actions_g0048_25";
|
|
73136
|
+
const root$4 = "_root_g0048_31";
|
|
73137
|
+
const linkContainer = "_link-container_g0048_37";
|
|
73138
|
+
const header$1 = "_header_g0048_43";
|
|
73139
|
+
const contextItemLink = "_context-item-link_g0048_49";
|
|
73140
|
+
const codeBlock = "_code-block_g0048_70";
|
|
73042
73141
|
const styles$g = {
|
|
73043
73142
|
contextItem,
|
|
73044
73143
|
contextItemMetadata,
|
|
@@ -73124,12 +73223,12 @@ const ContextCell = memo$1(
|
|
|
73124
73223
|
config: { internalDebugContext }
|
|
73125
73224
|
} = useConfig();
|
|
73126
73225
|
const telemetryRecorder = useTelemetryRecorder();
|
|
73127
|
-
const
|
|
73226
|
+
const isAgenticChat = (model == null ? void 0 : model.includes("deep-cody")) || agent2 === "deep-cody";
|
|
73128
73227
|
const headerText = {
|
|
73129
|
-
main: experimentalOneBoxEnabled && !intent ? "Reviewing query" :
|
|
73130
|
-
sub: experimentalOneBoxEnabled && !intent ? "Figuring out query intent..." : isContextLoading ?
|
|
73228
|
+
main: experimentalOneBoxEnabled && !intent ? "Reviewing query" : isAgenticChat ? "Agentic context" : isContextLoading ? "Fetching context" : "Context",
|
|
73229
|
+
sub: experimentalOneBoxEnabled && !intent ? "Figuring out query intent..." : isContextLoading ? isAgenticChat ? "Thinking…" : "Retrieving codebase files…" : contextItems === void 0 ? "none requested" : contextItems.length === 0 ? isAgenticChat ? "none" : "none fetched" : itemCountLabel
|
|
73131
73230
|
};
|
|
73132
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
73231
|
+
return /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-flex-col tw-justify-center tw-w-full tw-gap-2 tw-py-1 tw-px-4", children: [
|
|
73133
73232
|
/* @__PURE__ */ jsx(
|
|
73134
73233
|
Accordion,
|
|
73135
73234
|
{
|
|
@@ -73169,14 +73268,14 @@ const ContextCell = memo$1(
|
|
|
73169
73268
|
containerClassName: className,
|
|
73170
73269
|
contentClassName: "tw-flex tw-flex-col tw-gap-4 tw-max-w-full",
|
|
73171
73270
|
"data-testid": "context",
|
|
73172
|
-
children: isContextLoading && !
|
|
73271
|
+
children: isContextLoading && !isAgenticChat ? /* @__PURE__ */ jsx(LoadingDots, {}) : /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs(
|
|
73173
73272
|
AccordionContent,
|
|
73174
73273
|
{
|
|
73175
73274
|
className: "tw-ml-6 tw-flex tw-flex-col tw-gap-2",
|
|
73176
73275
|
overflow: false,
|
|
73177
73276
|
children: [
|
|
73178
73277
|
/* @__PURE__ */ jsxs("div", { className: styles$g.contextSuggestedActions, children: [
|
|
73179
|
-
contextItems && contextItems.length > 0 && !
|
|
73278
|
+
contextItems && contextItems.length > 0 && !isAgenticChat && /* @__PURE__ */ jsx(
|
|
73180
73279
|
Button,
|
|
73181
73280
|
{
|
|
73182
73281
|
size: "sm",
|
|
@@ -73189,7 +73288,7 @@ const ContextCell = memo$1(
|
|
|
73189
73288
|
children: editContextNode
|
|
73190
73289
|
}
|
|
73191
73290
|
),
|
|
73192
|
-
resubmitWithRepoContext && !
|
|
73291
|
+
resubmitWithRepoContext && !isAgenticChat && /* @__PURE__ */ jsx(
|
|
73193
73292
|
Button,
|
|
73194
73293
|
{
|
|
73195
73294
|
size: "sm",
|
|
@@ -73251,7 +73350,7 @@ const ContextCell = memo$1(
|
|
|
73251
73350
|
]
|
|
73252
73351
|
}
|
|
73253
73352
|
),
|
|
73254
|
-
!isContextLoading &&
|
|
73353
|
+
!isContextLoading && isAgenticChat && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
73255
73354
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
73256
73355
|
"span",
|
|
73257
73356
|
{
|
|
@@ -73273,7 +73372,7 @@ const ContextCell = memo$1(
|
|
|
73273
73372
|
) }),
|
|
73274
73373
|
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: "Fetches additional context to improve response quality when needed" })
|
|
73275
73374
|
] }) }),
|
|
73276
|
-
!isContextLoading && !
|
|
73375
|
+
!isContextLoading && !isAgenticChat && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
73277
73376
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
73278
73377
|
"span",
|
|
73279
73378
|
{
|
|
@@ -73451,29 +73550,6 @@ function useLocalStorage(key, defaultValue) {
|
|
|
73451
73550
|
);
|
|
73452
73551
|
return [value, persistValue];
|
|
73453
73552
|
}
|
|
73454
|
-
const badgeVariants = cva(
|
|
73455
|
-
"tw-inline-flex tw-items-center tw-rounded-[6px] tw-px-[5px] tw-py-0 tw-text-xs focus:tw-outline-none focus:tw-ring-2 focus:tw-ring-ring focus:tw-ring-offset-2",
|
|
73456
|
-
{
|
|
73457
|
-
variants: {
|
|
73458
|
-
variant: {
|
|
73459
|
-
secondary: "tw-bg-badge-background tw-text-badge-foreground",
|
|
73460
|
-
outline: "tw-border tw-border-muted-transparent tw-bg-[unset] tw-text-muted-foreground",
|
|
73461
|
-
ghost: "tw-bg-muted-transparent tw-text-muted-foreground",
|
|
73462
|
-
cody: "tw-bg-gradient-to-r tw-from-sourcegraph-blue tw-via-sourcegraph-purple tw-to-sourcegraph-orange tw-text-badge-foreground",
|
|
73463
|
-
warning: "tw-bg-yellow-900 tw-text-yellow-300",
|
|
73464
|
-
info: "tw-bg-blue-900 tw-text-blue-300",
|
|
73465
|
-
error: "tw-bg-pink-900 tw-text-pink-300",
|
|
73466
|
-
disabled: "tw-bg-gray-900 tw-text-gray-300"
|
|
73467
|
-
}
|
|
73468
|
-
},
|
|
73469
|
-
defaultVariants: {
|
|
73470
|
-
variant: "secondary"
|
|
73471
|
-
}
|
|
73472
|
-
}
|
|
73473
|
-
);
|
|
73474
|
-
function Badge({ className, variant, ...props }) {
|
|
73475
|
-
return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
73476
|
-
}
|
|
73477
73553
|
function commandRowValue(row2) {
|
|
73478
73554
|
return row2.actionType === "prompt" ? `prompt-${row2.id}` : `command-${row2.key}`;
|
|
73479
73555
|
}
|
|
@@ -74284,7 +74360,7 @@ const innerContainer = "_inner-container_oxlxy_47";
|
|
|
74284
74360
|
const loader = "_loader_oxlxy_51";
|
|
74285
74361
|
const loaderIndicator = "_loader-indicator_oxlxy_1";
|
|
74286
74362
|
const error = "_error_oxlxy_73";
|
|
74287
|
-
const close
|
|
74363
|
+
const close = "_close_oxlxy_83";
|
|
74288
74364
|
const styles$b = {
|
|
74289
74365
|
root: root$3,
|
|
74290
74366
|
iconsHeader,
|
|
@@ -74297,7 +74373,7 @@ const styles$b = {
|
|
|
74297
74373
|
loader,
|
|
74298
74374
|
loaderIndicator,
|
|
74299
74375
|
error,
|
|
74300
|
-
close
|
|
74376
|
+
close
|
|
74301
74377
|
};
|
|
74302
74378
|
const PromptMigrationWidget = (props) => {
|
|
74303
74379
|
const { dismissible, className } = props;
|
|
@@ -74541,6 +74617,19 @@ function useActionSelect() {
|
|
|
74541
74617
|
}
|
|
74542
74618
|
};
|
|
74543
74619
|
}
|
|
74620
|
+
const LinkOpenerContext = createContext(null);
|
|
74621
|
+
const LinkOpenerProvider = ({ vscodeAPI, children: children2 }) => {
|
|
74622
|
+
const value = {
|
|
74623
|
+
openExternalLink: (uri) => void vscodeAPI.postMessage({
|
|
74624
|
+
command: "openURI",
|
|
74625
|
+
uri: URI.parse(uri)
|
|
74626
|
+
})
|
|
74627
|
+
};
|
|
74628
|
+
return /* @__PURE__ */ jsx(LinkOpenerContext.Provider, { value, children: children2 });
|
|
74629
|
+
};
|
|
74630
|
+
function useLinkOpener() {
|
|
74631
|
+
return useContext(LinkOpenerContext);
|
|
74632
|
+
}
|
|
74544
74633
|
const container$2 = "_container_1eiqs_6";
|
|
74545
74634
|
const editor$1 = "_editor_1eiqs_17";
|
|
74546
74635
|
const toolbar$1 = "_toolbar_1eiqs_23";
|
|
@@ -74834,7 +74923,7 @@ const ModelSelectField = ({
|
|
|
74834
74923
|
disabled: readOnly,
|
|
74835
74924
|
__storybook__open,
|
|
74836
74925
|
tooltip: readOnly ? void 0 : "Select a model",
|
|
74837
|
-
"aria-label": "Select a model",
|
|
74926
|
+
"aria-label": "Select a model or an agent",
|
|
74838
74927
|
popoverContent: (close2) => /* @__PURE__ */ jsx(
|
|
74839
74928
|
Command,
|
|
74840
74929
|
{
|
|
@@ -74953,6 +75042,9 @@ function modelAvailability(userInfo, serverSentModelsEnabled, model) {
|
|
|
74953
75042
|
return "available";
|
|
74954
75043
|
}
|
|
74955
75044
|
function getTooltip(model, availability) {
|
|
75045
|
+
if (model.id.includes("deep-cody")) {
|
|
75046
|
+
return "Agentic chat reflects on your request and uses tools to dynamically retrieve relevant context, improving accuracy and response quality.";
|
|
75047
|
+
}
|
|
74956
75048
|
if (model.tags.includes(ModelTag.Waitlist)) {
|
|
74957
75049
|
return "Request access to this new model";
|
|
74958
75050
|
}
|
|
@@ -74987,7 +75079,7 @@ const ModelTitleWithIcon = ({ model, showIcon, modelAvailability: modelAvailabil
|
|
|
74987
75079
|
const modelBadge = getBadgeText(model, modelAvailability2);
|
|
74988
75080
|
const isDisabled = modelAvailability2 !== "available";
|
|
74989
75081
|
return /* @__PURE__ */ jsxs("span", { className: clsx$1(styles$8.modelTitleWithIcon, { [styles$8.disabled]: isDisabled }), children: [
|
|
74990
|
-
showIcon ? /* @__PURE__ */ jsx(ChatModelIcon, { model: model.provider, className: styles$8.modelIcon }) : null,
|
|
75082
|
+
showIcon ? model.id.includes("deep-cody") ? /* @__PURE__ */ jsx(Brain, { size: 16, className: styles$8.modelIcon }) : /* @__PURE__ */ jsx(ChatModelIcon, { model: model.provider, className: styles$8.modelIcon }) : null,
|
|
74991
75083
|
/* @__PURE__ */ jsx("span", { className: clsx$1("tw-flex-grow", styles$8.modelName), children: model.title }),
|
|
74992
75084
|
modelBadge && /* @__PURE__ */ jsx(
|
|
74993
75085
|
Badge,
|
|
@@ -75009,7 +75101,7 @@ const ChatModelIcon = ({
|
|
|
75009
75101
|
return ModelIcon ? /* @__PURE__ */ jsx(ModelIcon, { size: 16, className }) : null;
|
|
75010
75102
|
};
|
|
75011
75103
|
const ModelUIGroup = {
|
|
75012
|
-
Agents: "
|
|
75104
|
+
Agents: "Agent, extensive context fetching",
|
|
75013
75105
|
Power: "More powerful models",
|
|
75014
75106
|
Balanced: "Balanced for power and speed",
|
|
75015
75107
|
Speed: "Faster models",
|
|
@@ -76559,11 +76651,6 @@ const PromptSelectField = ({ onSelect, onCloseByEscape, className, __storybook__
|
|
|
76559
76651
|
}
|
|
76560
76652
|
);
|
|
76561
76653
|
};
|
|
76562
|
-
const ClientConfigContext = createContext(null);
|
|
76563
|
-
const ClientConfigProvider = ({ value, children: children2 }) => /* @__PURE__ */ jsx(ClientConfigContext.Provider, { value, children: children2 });
|
|
76564
|
-
function useClientConfig() {
|
|
76565
|
-
return useContext(ClientConfigContext);
|
|
76566
|
-
}
|
|
76567
76654
|
const AddContextButton = ({ onClick, className }) => /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
76568
76655
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
76569
76656
|
Button,
|
|
@@ -76742,7 +76829,7 @@ function useSize(element2) {
|
|
|
76742
76829
|
var SWITCH_NAME = "Switch";
|
|
76743
76830
|
var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
|
|
76744
76831
|
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
|
76745
|
-
var Switch$
|
|
76832
|
+
var Switch$1 = React$2.forwardRef(
|
|
76746
76833
|
(props, forwardedRef) => {
|
|
76747
76834
|
const {
|
|
76748
76835
|
__scopeSwitch,
|
|
@@ -76805,7 +76892,7 @@ var Switch$2 = React$2.forwardRef(
|
|
|
76805
76892
|
] });
|
|
76806
76893
|
}
|
|
76807
76894
|
);
|
|
76808
|
-
Switch$
|
|
76895
|
+
Switch$1.displayName = SWITCH_NAME;
|
|
76809
76896
|
var THUMB_NAME = "SwitchThumb";
|
|
76810
76897
|
var SwitchThumb = React$2.forwardRef(
|
|
76811
76898
|
(props, forwardedRef) => {
|
|
@@ -76862,13 +76949,13 @@ var BubbleInput = (props) => {
|
|
|
76862
76949
|
function getState(checked) {
|
|
76863
76950
|
return checked ? "checked" : "unchecked";
|
|
76864
76951
|
}
|
|
76865
|
-
var Root = Switch$
|
|
76952
|
+
var Root = Switch$1;
|
|
76866
76953
|
var Thumb = SwitchThumb;
|
|
76867
76954
|
const switchThumb = "_switch-thumb_1n9d7_1";
|
|
76868
76955
|
const styles$6 = {
|
|
76869
76956
|
switchThumb
|
|
76870
76957
|
};
|
|
76871
|
-
const Switch
|
|
76958
|
+
const Switch = React$2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
76872
76959
|
Root,
|
|
76873
76960
|
{
|
|
76874
76961
|
className: cn(
|
|
@@ -76890,7 +76977,7 @@ const Switch$1 = React$2.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
76890
76977
|
)
|
|
76891
76978
|
}
|
|
76892
76979
|
));
|
|
76893
|
-
Switch
|
|
76980
|
+
Switch.displayName = Root.displayName;
|
|
76894
76981
|
function getIntentOptions({
|
|
76895
76982
|
ide,
|
|
76896
76983
|
isDotComUser,
|
|
@@ -76961,7 +77048,7 @@ function getIntentOptions({
|
|
|
76961
77048
|
];
|
|
76962
77049
|
}
|
|
76963
77050
|
const SubmitButton = ({ onClick, state = "submittable", detectedIntent }) => {
|
|
76964
|
-
const experimentalOneBoxEnabled =
|
|
77051
|
+
const experimentalOneBoxEnabled = useOmniBox();
|
|
76965
77052
|
const {
|
|
76966
77053
|
clientCapabilities: { agentIDE },
|
|
76967
77054
|
isDotComUser
|
|
@@ -77087,7 +77174,7 @@ const SubmitButton = ({ onClick, state = "submittable", detectedIntent }) => {
|
|
|
77087
77174
|
},
|
|
77088
77175
|
className: "tw-flex tw-p-4 tw-gap-6 tw-items-center tw-cursor-pointer hover:tw-bg-button-secondary-background",
|
|
77089
77176
|
children: [
|
|
77090
|
-
/* @__PURE__ */ jsx(Switch
|
|
77177
|
+
/* @__PURE__ */ jsx(Switch, { checked: intentDetectionToggleOn }),
|
|
77091
77178
|
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-flex-col", children: [
|
|
77092
77179
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
77093
77180
|
/* @__PURE__ */ jsx("span", { className: "tw-font-medium tw-mr-4", children: "Intent Detection" }),
|
|
@@ -77546,7 +77633,8 @@ const HumanMessageEditor = ({
|
|
|
77546
77633
|
if ((_a2 = currentChatModel == null ? void 0 : currentChatModel.tags) == null ? void 0 : _a2.includes(ModelTag.StreamDisabled)) {
|
|
77547
77634
|
initialContext = initialContext.filter((item2) => item2.type !== "tree");
|
|
77548
77635
|
}
|
|
77549
|
-
|
|
77636
|
+
const filteredItems = initialContext.filter((item2) => item2.type !== "open-link");
|
|
77637
|
+
void editor2.setInitialContextMentions(filteredItems);
|
|
77550
77638
|
}
|
|
77551
77639
|
}
|
|
77552
77640
|
}, [defaultContext, isSent, isFirstMessage, currentChatModel]);
|
|
@@ -77561,6 +77649,11 @@ const HumanMessageEditor = ({
|
|
|
77561
77649
|
}, [__storybook__focus, focusEditor]);
|
|
77562
77650
|
const focused2 = Boolean(isEditorFocused || isFocusWithin || __storybook__focus);
|
|
77563
77651
|
const contextWindowSizeInTokens = ((_b = (_a = currentChatModel == null ? void 0 : currentChatModel.contextWindow) == null ? void 0 : _a.context) == null ? void 0 : _b.user) || ((_c = currentChatModel == null ? void 0 : currentChatModel.contextWindow) == null ? void 0 : _c.input) || FAST_CHAT_INPUT_TOKEN_BUDGET;
|
|
77652
|
+
const linkOpener = useLinkOpener();
|
|
77653
|
+
const openExternalLink = useCallback(
|
|
77654
|
+
(uri) => linkOpener == null ? void 0 : linkOpener.openExternalLink(uri),
|
|
77655
|
+
[linkOpener]
|
|
77656
|
+
);
|
|
77564
77657
|
const Editor = experimentalPromptEditorEnabled ? PromptEditor : PromptEditor$1;
|
|
77565
77658
|
return (
|
|
77566
77659
|
// biome-ignore lint/a11y/useKeyWithClickEvents: only relevant to click areas
|
|
@@ -77595,7 +77688,8 @@ const HumanMessageEditor = ({
|
|
|
77595
77688
|
disabled: disabled2,
|
|
77596
77689
|
contextWindowSizeInTokens,
|
|
77597
77690
|
editorClassName: styles$9.editor,
|
|
77598
|
-
contentEditableClassName: styles$9.editorContentEditable
|
|
77691
|
+
contentEditableClassName: styles$9.editorContentEditable,
|
|
77692
|
+
openExternalLink
|
|
77599
77693
|
}
|
|
77600
77694
|
),
|
|
77601
77695
|
!disabled2 && /* @__PURE__ */ jsx(
|
|
@@ -77619,228 +77713,6 @@ const HumanMessageEditor = ({
|
|
|
77619
77713
|
)
|
|
77620
77714
|
);
|
|
77621
77715
|
};
|
|
77622
|
-
const ToolboxButton = memo$1(({ settings, api: api2, isFirstMessage }) => {
|
|
77623
|
-
var _a, _b;
|
|
77624
|
-
const telemetryRecorder = useTelemetryRecorder();
|
|
77625
|
-
const [isLoading, setIsLoading] = useState$1(false);
|
|
77626
|
-
const onOpenChange = useCallback(
|
|
77627
|
-
(open) => {
|
|
77628
|
-
if (open) {
|
|
77629
|
-
telemetryRecorder.recordEvent("cody.toolboxSettings", "opened", {
|
|
77630
|
-
billingMetadata: { product: "cody", category: "billable" }
|
|
77631
|
-
});
|
|
77632
|
-
}
|
|
77633
|
-
},
|
|
77634
|
-
[telemetryRecorder.recordEvent]
|
|
77635
|
-
);
|
|
77636
|
-
const debouncedSubmit = useCallback(
|
|
77637
|
-
lodashExports.debounce((newSettings) => {
|
|
77638
|
-
var _a2, _b2;
|
|
77639
|
-
if (isLoading) {
|
|
77640
|
-
return;
|
|
77641
|
-
}
|
|
77642
|
-
setIsLoading(true);
|
|
77643
|
-
if (settings !== newSettings) {
|
|
77644
|
-
telemetryRecorder.recordEvent("cody.toolboxSettings", "updated", {
|
|
77645
|
-
billingMetadata: { product: "cody", category: "billable" },
|
|
77646
|
-
metadata: {
|
|
77647
|
-
agent: ((_a2 = newSettings.agent) == null ? void 0 : _a2.name) ? 1 : 0,
|
|
77648
|
-
shell: ((_b2 = newSettings.shell) == null ? void 0 : _b2.enabled) ? 1 : 0
|
|
77649
|
-
}
|
|
77650
|
-
});
|
|
77651
|
-
}
|
|
77652
|
-
const subscription = api2.updateToolboxSettings(newSettings).subscribe({
|
|
77653
|
-
next: () => {
|
|
77654
|
-
setIsLoading(false);
|
|
77655
|
-
close();
|
|
77656
|
-
},
|
|
77657
|
-
error: (error2) => {
|
|
77658
|
-
console.error("updateToolboxSettings:", error2);
|
|
77659
|
-
setIsLoading(false);
|
|
77660
|
-
},
|
|
77661
|
-
complete: () => {
|
|
77662
|
-
setIsLoading(false);
|
|
77663
|
-
}
|
|
77664
|
-
});
|
|
77665
|
-
return () => {
|
|
77666
|
-
subscription.unsubscribe();
|
|
77667
|
-
};
|
|
77668
|
-
}, 500),
|
|
77669
|
-
// 500ms delay between calls
|
|
77670
|
-
[]
|
|
77671
|
-
);
|
|
77672
|
-
function onSubmit(newSettings) {
|
|
77673
|
-
setIsLoading(true);
|
|
77674
|
-
debouncedSubmit(newSettings);
|
|
77675
|
-
}
|
|
77676
|
-
return /* @__PURE__ */ jsx("div", { className: "tw-flex tw-items-center", children: /* @__PURE__ */ jsx(
|
|
77677
|
-
ToolbarPopoverItem,
|
|
77678
|
-
{
|
|
77679
|
-
role: "combobox",
|
|
77680
|
-
iconEnd: "chevron",
|
|
77681
|
-
className: "tw-opacity-100",
|
|
77682
|
-
tooltip: "Chat Settings",
|
|
77683
|
-
"aria-label": "Chat Settings",
|
|
77684
|
-
popoverContent: (_close) => {
|
|
77685
|
-
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
77686
|
-
return /* @__PURE__ */ jsxs("div", { id: "accordion-collapse", "data-accordion": "collapse", className: "tw-w-full", children: [
|
|
77687
|
-
/* @__PURE__ */ jsx("h2", { id: "accordion-collapse-heading", children: /* @__PURE__ */ jsxs(
|
|
77688
|
-
"div",
|
|
77689
|
-
{
|
|
77690
|
-
className: "tw-flex tw-items-center tw-justify-between tw-w-full tw-py-3 tw-px-5 tw-font-medium tw-border tw-border-border tw-rounded-t-md tw-focus:ring-4 tw-focus:ring-gray-200 tw-gap-3 tw-bg-[color-mix(in_lch,currentColor_10%,transparent)]",
|
|
77691
|
-
title: "Agentic Chat Context",
|
|
77692
|
-
children: [
|
|
77693
|
-
/* @__PURE__ */ jsxs("span", { className: "tw-flex tw-gap-2 tw-items-center", children: [
|
|
77694
|
-
/* @__PURE__ */ jsx("span", { className: "tw-font-semibold tw-text-md", children: "Agentic chat" }),
|
|
77695
|
-
/* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "tw-text-xs", children: "Experimental" })
|
|
77696
|
-
] }),
|
|
77697
|
-
/* @__PURE__ */ jsx(
|
|
77698
|
-
Switch,
|
|
77699
|
-
{
|
|
77700
|
-
disabled: isLoading,
|
|
77701
|
-
checked: ((_a2 = settings.agent) == null ? void 0 : _a2.name) !== void 0,
|
|
77702
|
-
onChange: () => {
|
|
77703
|
-
var _a3;
|
|
77704
|
-
return onSubmit({
|
|
77705
|
-
...settings,
|
|
77706
|
-
agent: {
|
|
77707
|
-
name: ((_a3 = settings.agent) == null ? void 0 : _a3.name) ? void 0 : "deep-cody"
|
|
77708
|
-
// TODO: update name when finalized.
|
|
77709
|
-
}
|
|
77710
|
-
});
|
|
77711
|
-
}
|
|
77712
|
-
}
|
|
77713
|
-
)
|
|
77714
|
-
]
|
|
77715
|
-
}
|
|
77716
|
-
) }),
|
|
77717
|
-
/* @__PURE__ */ jsxs(
|
|
77718
|
-
"div",
|
|
77719
|
-
{
|
|
77720
|
-
id: "accordion-collapse-body",
|
|
77721
|
-
className: "tw-p-5 tw-flex tw-flex-col tw-gap-3 tw-my-2",
|
|
77722
|
-
children: [
|
|
77723
|
-
/* @__PURE__ */ jsx("div", { className: "tw-text-xs", children: /* @__PURE__ */ jsxs("span", { children: [
|
|
77724
|
-
"Agentic chat reflects on your request and uses tools to dynamically retrieve relevant context, improving accuracy and response quality.",
|
|
77725
|
-
" ",
|
|
77726
|
-
/* @__PURE__ */ jsx(
|
|
77727
|
-
"a",
|
|
77728
|
-
{
|
|
77729
|
-
target: "_blank",
|
|
77730
|
-
rel: "noreferrer",
|
|
77731
|
-
href: CODY_DOCS_CAPABILITIES_URL.href,
|
|
77732
|
-
children: "Read the docs"
|
|
77733
|
-
}
|
|
77734
|
-
),
|
|
77735
|
-
" ",
|
|
77736
|
-
"to learn more."
|
|
77737
|
-
] }) }),
|
|
77738
|
-
((_b2 = settings.agent) == null ? void 0 : _b2.name) && !((_c = settings.shell) == null ? void 0 : _c.error) && /* @__PURE__ */ jsx("div", { className: "tw-border-b tw-border-border tw-my-2" }),
|
|
77739
|
-
((_d = settings.agent) == null ? void 0 : _d.name) && !((_e = settings.shell) == null ? void 0 : _e.error) && /* @__PURE__ */ jsxs("div", { children: [
|
|
77740
|
-
/* @__PURE__ */ jsxs(
|
|
77741
|
-
"div",
|
|
77742
|
-
{
|
|
77743
|
-
className: "tw-flex tw-items-center tw-justify-between tw-w-full tw-font-medium tw-gap-3",
|
|
77744
|
-
"aria-label": "terminal",
|
|
77745
|
-
children: [
|
|
77746
|
-
/* @__PURE__ */ jsx("span", { className: "tw-flex tw-gap-2 tw-items-center", children: /* @__PURE__ */ jsx("span", { className: "tw-font-semibold tw-text-md", children: "Terminal access" }) }),
|
|
77747
|
-
/* @__PURE__ */ jsx(
|
|
77748
|
-
Switch,
|
|
77749
|
-
{
|
|
77750
|
-
checked: (_f = settings.shell) == null ? void 0 : _f.enabled,
|
|
77751
|
-
disabled: isLoading || !!((_g = settings.shell) == null ? void 0 : _g.error),
|
|
77752
|
-
onChange: () => {
|
|
77753
|
-
var _a3, _b3;
|
|
77754
|
-
return onSubmit({
|
|
77755
|
-
...settings,
|
|
77756
|
-
shell: {
|
|
77757
|
-
enabled: !!((_a3 = settings.agent) == null ? void 0 : _a3.name) && !((_b3 = settings.shell) == null ? void 0 : _b3.enabled)
|
|
77758
|
-
}
|
|
77759
|
-
});
|
|
77760
|
-
}
|
|
77761
|
-
}
|
|
77762
|
-
)
|
|
77763
|
-
]
|
|
77764
|
-
}
|
|
77765
|
-
),
|
|
77766
|
-
/* @__PURE__ */ jsxs("div", { className: "tw-text-xs tw-mt-2", children: [
|
|
77767
|
-
"Allows agents to execute commands like ",
|
|
77768
|
-
/* @__PURE__ */ jsx("code", { children: "ls" }),
|
|
77769
|
-
",",
|
|
77770
|
-
" ",
|
|
77771
|
-
/* @__PURE__ */ jsx("code", { children: "dir" }),
|
|
77772
|
-
", ",
|
|
77773
|
-
/* @__PURE__ */ jsx("code", { children: "git" }),
|
|
77774
|
-
", and other commands for context. The agent will ask permission each time it would like to run a command."
|
|
77775
|
-
] })
|
|
77776
|
-
] })
|
|
77777
|
-
]
|
|
77778
|
-
}
|
|
77779
|
-
)
|
|
77780
|
-
] });
|
|
77781
|
-
},
|
|
77782
|
-
popoverRootProps: { onOpenChange },
|
|
77783
|
-
popoverContentProps: {
|
|
77784
|
-
className: "tw-w-[250px] !tw-p-0 tw-mx-8",
|
|
77785
|
-
onCloseAutoFocus: (event) => {
|
|
77786
|
-
event.preventDefault();
|
|
77787
|
-
}
|
|
77788
|
-
},
|
|
77789
|
-
children: /* @__PURE__ */ jsxs(
|
|
77790
|
-
Button,
|
|
77791
|
-
{
|
|
77792
|
-
variant: "ghost",
|
|
77793
|
-
size: "none",
|
|
77794
|
-
className: `${((_a = settings.agent) == null ? void 0 : _a.name) ? "tw-text-foreground" : "tw-text-muted-foreground"} hover:!tw-bg-transparent`,
|
|
77795
|
-
children: [
|
|
77796
|
-
((_b = settings.agent) == null ? void 0 : _b.name) ? /* @__PURE__ */ jsx(
|
|
77797
|
-
Brain,
|
|
77798
|
-
{
|
|
77799
|
-
size: 16,
|
|
77800
|
-
strokeWidth: 2,
|
|
77801
|
-
className: "tw-w-8 tw-h-8 tw-text-green-600 tw-drop-shadow-md"
|
|
77802
|
-
}
|
|
77803
|
-
) : /* @__PURE__ */ jsx(
|
|
77804
|
-
Brain,
|
|
77805
|
-
{
|
|
77806
|
-
size: 16,
|
|
77807
|
-
strokeWidth: 2,
|
|
77808
|
-
className: "tw-w-8 tw-h-8 tw-text-muted-foreground"
|
|
77809
|
-
}
|
|
77810
|
-
),
|
|
77811
|
-
isFirstMessage && /* @__PURE__ */ jsx("span", { className: "tw-font-semibold", children: "agentic chat" })
|
|
77812
|
-
]
|
|
77813
|
-
}
|
|
77814
|
-
)
|
|
77815
|
-
}
|
|
77816
|
-
) });
|
|
77817
|
-
});
|
|
77818
|
-
const Switch = memo$1(({ checked = false, onChange, disabled: disabled2 = false }) => {
|
|
77819
|
-
return /* @__PURE__ */ jsx(
|
|
77820
|
-
"button",
|
|
77821
|
-
{
|
|
77822
|
-
onClick: (e2) => {
|
|
77823
|
-
e2.preventDefault();
|
|
77824
|
-
onChange == null ? void 0 : onChange(!checked);
|
|
77825
|
-
},
|
|
77826
|
-
className: `tw-relative tw-flex tw-items-center tw-justify-center tw-w-11 tw-h-6 tw-rounded-full tw-ease tw-transform focus:tw-outline-offset-1 focus:tw-outline-2 tw-ring-1 ${checked && !disabled2 ? "tw-bg-green-700 tw-ring-green-400" : "tw-bg-gray-300 tw-ring-gray-400 tw-shadow-sm"}`,
|
|
77827
|
-
type: "button",
|
|
77828
|
-
role: "switch",
|
|
77829
|
-
"aria-checked": checked,
|
|
77830
|
-
disabled: disabled2,
|
|
77831
|
-
children: /* @__PURE__ */ jsx(
|
|
77832
|
-
"div",
|
|
77833
|
-
{
|
|
77834
|
-
className: `
|
|
77835
|
-
tw-absolute tw-left-0 tw-w-5 tw-h-6 tw-rounded-full
|
|
77836
|
-
tw-transition-all tw-duration-300 tw-transform tw-shadow-md
|
|
77837
|
-
${checked ? "tw-translate-x-6 tw-bg-gray-200" : "tw-translate-x-0 tw-bg-gray-600"}
|
|
77838
|
-
`
|
|
77839
|
-
}
|
|
77840
|
-
)
|
|
77841
|
-
}
|
|
77842
|
-
);
|
|
77843
|
-
});
|
|
77844
77716
|
const HumanMessageCell = ({ message: message2, ...otherProps }) => {
|
|
77845
77717
|
const messageJSON = JSON.stringify(message2);
|
|
77846
77718
|
const initialEditorState = useMemo$1(
|
|
@@ -77871,10 +77743,6 @@ const HumanMessageCellContent = memo$1((props) => {
|
|
|
77871
77743
|
intent,
|
|
77872
77744
|
manuallySelectIntent
|
|
77873
77745
|
} = props;
|
|
77874
|
-
const api2 = useExtensionAPI();
|
|
77875
|
-
const { value: settings } = useObservable(
|
|
77876
|
-
useMemo$1(() => api2.toolboxSettings(), [api2.toolboxSettings])
|
|
77877
|
-
);
|
|
77878
77746
|
return /* @__PURE__ */ jsx(
|
|
77879
77747
|
BaseMessageCell,
|
|
77880
77748
|
{
|
|
@@ -77887,10 +77755,7 @@ const HumanMessageCellContent = memo$1((props) => {
|
|
|
77887
77755
|
}
|
|
77888
77756
|
),
|
|
77889
77757
|
speakerTitle: userInfo.user.displayName ?? userInfo.user.username,
|
|
77890
|
-
cellAction: /* @__PURE__ */
|
|
77891
|
-
settings && /* @__PURE__ */ jsx(ToolboxButton, { settings, api: api2, isFirstMessage }),
|
|
77892
|
-
isFirstMessage && /* @__PURE__ */ jsx(OpenInNewEditorAction, {})
|
|
77893
|
-
] }),
|
|
77758
|
+
cellAction: /* @__PURE__ */ jsx("div", { className: "tw-flex tw-gap-2 tw-items-center tw-justify-end", children: isFirstMessage && /* @__PURE__ */ jsx(OpenInNewEditorAction, {}) }),
|
|
77894
77759
|
content: /* @__PURE__ */ jsx(
|
|
77895
77760
|
HumanMessageEditor,
|
|
77896
77761
|
{
|
|
@@ -77958,8 +77823,8 @@ const AgenticContextCell = memo$1(({ className, isContextLoading, processes }) =
|
|
|
77958
77823
|
}, []);
|
|
77959
77824
|
const hasError = processes == null ? void 0 : processes.some((p2) => p2.error);
|
|
77960
77825
|
const status2 = !isContextLoading ? hasError ? "failed" : "completed" : ((_a = processes == null ? void 0 : processes.findLast((p2) => p2.type !== "tool" && p2.type !== "confirmation")) == null ? void 0 : _a.title) || "reviewing";
|
|
77961
|
-
const statusClassName = hasError ? "tw-text-yellow-
|
|
77962
|
-
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
77826
|
+
const statusClassName = hasError ? "tw-text-yellow-600" : "tw-text-muted-foreground";
|
|
77827
|
+
return /* @__PURE__ */ jsx("div", { className: "tw-flex tw-flex-col tw-justify-center tw-w-full tw-gap-2 tw-py-1 tw-px-4", children: /* @__PURE__ */ jsx(
|
|
77963
77828
|
Accordion,
|
|
77964
77829
|
{
|
|
77965
77830
|
type: "single",
|
|
@@ -77975,22 +77840,10 @@ const AgenticContextCell = memo$1(({ className, isContextLoading, processes }) =
|
|
|
77975
77840
|
{
|
|
77976
77841
|
onClick: () => triggerAccordion(),
|
|
77977
77842
|
title: "Agentic chat",
|
|
77978
|
-
className: "tw-flex tw-items-center tw-gap-4",
|
|
77843
|
+
className: "tw-flex tw-justify-center tw-items-center tw-gap-4",
|
|
77979
77844
|
disabled: !(processes == null ? void 0 : processes.some((p2) => p2.id)),
|
|
77980
77845
|
children: [
|
|
77981
|
-
isContextLoading ? /* @__PURE__ */ jsx(
|
|
77982
|
-
LoaderCircle,
|
|
77983
|
-
{
|
|
77984
|
-
size: NON_HUMAN_CELL_AVATAR_SIZE,
|
|
77985
|
-
className: "tw-animate-spin"
|
|
77986
|
-
}
|
|
77987
|
-
) : /* @__PURE__ */ jsx(
|
|
77988
|
-
Brain,
|
|
77989
|
-
{
|
|
77990
|
-
size: NON_HUMAN_CELL_AVATAR_SIZE,
|
|
77991
|
-
className: statusClassName
|
|
77992
|
-
}
|
|
77993
|
-
),
|
|
77846
|
+
isContextLoading ? /* @__PURE__ */ jsx(LoaderCircle, { size: 16, className: "tw-animate-spin" }) : /* @__PURE__ */ jsx(Brain, { size: 16, className: statusClassName }),
|
|
77994
77847
|
/* @__PURE__ */ jsxs("span", { className: "tw-flex tw-items-baseline", children: [
|
|
77995
77848
|
"Agentic chat",
|
|
77996
77849
|
/* @__PURE__ */ jsxs("span", { className: "tw-opacity-60 tw-text-sm tw-ml-2", children: [
|
|
@@ -78033,7 +77886,7 @@ const ProcessItem = ({ process, isContextLoading, headerIconClassName }) => {
|
|
|
78033
77886
|
return null;
|
|
78034
77887
|
}
|
|
78035
77888
|
return /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-items-center tw-gap-3 tw-p-1", children: [
|
|
78036
|
-
/* @__PURE__ */ jsx("div", { className: process.type === "tool" ? "tw-ml-[1rem] tw-font-sm" : "tw-ml-0", children: process.type !== "tool" ? /* @__PURE__ */ jsx(Brain, { strokeWidth: 1.25, size:
|
|
77889
|
+
/* @__PURE__ */ jsx("div", { className: process.type === "tool" ? "tw-ml-[1rem] tw-font-sm" : "tw-ml-0", children: process.type !== "tool" ? /* @__PURE__ */ jsx(Brain, { strokeWidth: 1.25, size: 12, className: headerIconClassName }) : process.state === "error" ? /* @__PURE__ */ jsx(CircleX, { strokeWidth: 1.5, size: 12, className: "tw-text-red-500" }) : process.state === "pending" && isContextLoading ? /* @__PURE__ */ jsx(LoaderCircle, { strokeWidth: 1.5, size: 12, className: "tw-animate-spin" }) : null }),
|
|
78037
77890
|
/* @__PURE__ */ jsx("div", { className: "tw-flex-grow tw-min-w-0", children: /* @__PURE__ */ jsxs("div", { className: "tw-truncate tw-max-w-full tw-text-sm", children: [
|
|
78038
77891
|
/* @__PURE__ */ jsx("span", { children: process.type !== "tool" ? process.title : process.title ?? process.id }),
|
|
78039
77892
|
process.content && /* @__PURE__ */ jsxs(
|
|
@@ -78137,11 +77990,11 @@ const SwitchIntent = ({ intent, manuallySelected, onSwitch }) => {
|
|
|
78137
77990
|
if (!["chat", "search"].includes(intent || "")) {
|
|
78138
77991
|
return null;
|
|
78139
77992
|
}
|
|
78140
|
-
return /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-justify-between tw-gap-6 tw-items-center tw-py-2 tw-px-4 md:tw-p-4 tw-text-sm tw-font-medium
|
|
77993
|
+
return /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-justify-between tw-gap-6 tw-items-center tw-py-2 tw-px-4 md:tw-p-4 tw-text-sm tw-font-medium", children: [
|
|
78141
77994
|
/* @__PURE__ */ jsxs("div", { className: "tw-flex tw-gap-4 tw-py-2 tw-text-muted-foreground", children: [
|
|
78142
|
-
manuallySelected ? /* @__PURE__ */ jsx(CircleUserRound, { className: "tw-size-8 tw-flex-shrink-0" }) : /* @__PURE__ */ jsx(
|
|
77995
|
+
manuallySelected ? /* @__PURE__ */ jsx(CircleUserRound, { className: "tw-size-8 tw-flex-shrink-0" }) : /* @__PURE__ */ jsx(Brain, { className: "tw-size-8 tw-flex-shrink-0" }),
|
|
78143
77996
|
/* @__PURE__ */ jsxs("span", { className: "tw-leading-tight", children: [
|
|
78144
|
-
manuallySelected ? "You" : "
|
|
77997
|
+
manuallySelected ? "You" : "Intent detection",
|
|
78145
77998
|
" selected a",
|
|
78146
77999
|
" ",
|
|
78147
78000
|
intent === "search" ? "code search" : "chat",
|
|
@@ -78217,7 +78070,7 @@ const Transcript = (props) => {
|
|
|
78217
78070
|
return /* @__PURE__ */ jsx(
|
|
78218
78071
|
"div",
|
|
78219
78072
|
{
|
|
78220
|
-
className: clsx$1(" tw-px-8 tw-pb-6 tw-
|
|
78073
|
+
className: clsx$1(" tw-px-8 tw-pb-6 tw-pt-2 tw-flex tw-flex-col", {
|
|
78221
78074
|
"tw-flex-grow": transcript.length > 0
|
|
78222
78075
|
}),
|
|
78223
78076
|
children: /* @__PURE__ */ jsx(LastEditorContext.Provider, { value: lastHumanEditorRef, children: interactions.map((interaction, i) => {
|
|
@@ -78396,7 +78249,7 @@ const TranscriptInteraction = memo$1((props) => {
|
|
|
78396
78249
|
[onUserAction]
|
|
78397
78250
|
);
|
|
78398
78251
|
const extensionAPI = useExtensionAPI();
|
|
78399
|
-
const experimentalOneBoxEnabled =
|
|
78252
|
+
const experimentalOneBoxEnabled = useOmniBox();
|
|
78400
78253
|
const prefetchIntent = useMemo$1(() => {
|
|
78401
78254
|
const handler = async (editorValue) => {
|
|
78402
78255
|
if (!experimentalOneBoxEnabled || !doIntentDetection) {
|
|
@@ -78942,7 +78795,7 @@ function QuickStart() {
|
|
|
78942
78795
|
"button",
|
|
78943
78796
|
{
|
|
78944
78797
|
type: "button",
|
|
78945
|
-
className: "tw-rounded-md tw-border tw-px-4 tw-py-2 tw-text-md hover:tw-bg-muted",
|
|
78798
|
+
className: "tw-rounded-md tw-border tw-px-4 tw-py-2 tw-text-md tw-border-border hover:tw-bg-muted",
|
|
78946
78799
|
onClick: (e2) => {
|
|
78947
78800
|
e2.stopPropagation();
|
|
78948
78801
|
setShowTipsOverlay(true);
|
|
@@ -79032,7 +78885,7 @@ function QuickStart() {
|
|
|
79032
78885
|
`overlay-example-${"input" in example2 ? example2.input : example2.title}`
|
|
79033
78886
|
);
|
|
79034
78887
|
}) }),
|
|
79035
|
-
/* @__PURE__ */ jsx("div", { className: "tw-mt-8 tw-border-t tw-pt-12", children: /* @__PURE__ */ jsx("div", { className: "tw-grid tw-gap-4", children: chatTips.map((tip) => /* @__PURE__ */ jsxs(
|
|
78888
|
+
/* @__PURE__ */ jsx("div", { className: "tw-mt-8 tw-border-t tw-border-border tw-pt-12", children: /* @__PURE__ */ jsx("div", { className: "tw-grid tw-gap-4", children: chatTips.map((tip) => /* @__PURE__ */ jsxs(
|
|
79036
78889
|
"div",
|
|
79037
78890
|
{
|
|
79038
78891
|
className: "tw-flex tw-items-center tw-gap-3",
|
|
@@ -79932,6 +79785,10 @@ function getAppWrappers({
|
|
|
79932
79785
|
{
|
|
79933
79786
|
component: ClientConfigProvider,
|
|
79934
79787
|
props: { value: clientConfig }
|
|
79788
|
+
},
|
|
79789
|
+
{
|
|
79790
|
+
component: LinkOpenerProvider,
|
|
79791
|
+
props: { vscodeAPI }
|
|
79935
79792
|
}
|
|
79936
79793
|
];
|
|
79937
79794
|
}
|
|
@@ -80567,6 +80424,10 @@ const CodyPromptTemplatePanel = (props) => {
|
|
|
80567
80424
|
remoteRepositoriesNames: []
|
|
80568
80425
|
};
|
|
80569
80426
|
}, []);
|
|
80427
|
+
const openExternalLink = (uri) => void vscodeAPI.postMessage({
|
|
80428
|
+
command: "openURI",
|
|
80429
|
+
uri: Uri.parse(uri)
|
|
80430
|
+
});
|
|
80570
80431
|
return /* @__PURE__ */ jsx("div", { className, "data-cody-web-chat": true, children: /* @__PURE__ */ jsx(ChatMentionContext.Provider, { value: CONTEXT_MENTIONS_SETTINGS, children: /* @__PURE__ */ jsx(ComposedWrappers, { wrappers, children: /* @__PURE__ */ jsx(
|
|
80571
80432
|
PromptEditor$1,
|
|
80572
80433
|
{
|
|
@@ -80577,7 +80438,8 @@ const CodyPromptTemplatePanel = (props) => {
|
|
|
80577
80438
|
disabled: disabled2,
|
|
80578
80439
|
contextWindowSizeInTokens: 4096,
|
|
80579
80440
|
editorClassName: styles.editor,
|
|
80580
|
-
contentEditableClassName: styles.editorContentEditable
|
|
80441
|
+
contentEditableClassName: styles.editorContentEditable,
|
|
80442
|
+
openExternalLink
|
|
80581
80443
|
}
|
|
80582
80444
|
) }) }) });
|
|
80583
80445
|
};
|
|
@@ -80585,6 +80447,6 @@ export {
|
|
|
80585
80447
|
ChatSkeleton,
|
|
80586
80448
|
CodyPromptTemplate,
|
|
80587
80449
|
CodyWebChat,
|
|
80588
|
-
|
|
80589
|
-
|
|
80450
|
+
c8 as deserialize,
|
|
80451
|
+
c7 as serialize
|
|
80590
80452
|
};
|