@sourcegraph/cody-web 0.7.4 → 0.7.7
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-CiIPD-tv.mjs → agent.worker-BZzA02C_.mjs} +1443 -1180
- package/dist/agent.worker.js +2 -2
- package/dist/{browser-BTzYzFoB.mjs → browser-hDxNMh5y.mjs} +17361 -17357
- package/dist/{git-log-CKjP84c8.mjs → git-log-PGCFF8k9.mjs} +2 -2
- package/dist/{index-D6VgQlqI.mjs → index-CoR5ltqq.mjs} +2 -2
- package/dist/index.js +249 -182
- package/dist/lib/components/CodyWebChat.d.ts.map +1 -1
- package/dist/{shell-CvNNoU2J.mjs → shell-CWTEC0Ll.mjs} +2 -2
- package/dist/style.css +44 -72
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
|
-
import { g as getDefaultExportFromCjs, L as Ls, k as ke$1, a as ks, F as Fi$1, _ as _s, b as ds, c as bs, i 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, e as ws, B as B$2, f as g$5, h as h$4, j as _i, S as Ss, l as Br, m as ln, n as bi$1, v as vn, o as xn, N as Nn, r as mn, s as li$1, u as n$1, z as ns, M as M$4, D as Ds, A as le$2, E as c$4, G as oe$1, H as z$1, I as yi$1, W as W$2, U as Ue$1, O as I$2, P as Se$2, Q as O$2, V as F$1, X as Ni$1, Y as ee$1, Z as we$2, $ as b$2, a0 as T$3, a1 as s$2, a2 as o$4, a3 as w$3, a4 as i$1, a5 as k$3, a6 as D$5, a7 as p$8, a8 as m$7, a9 as S$4, aa as v$4, ab as P$2, ac as E$6, ad as Wi$1, ae as L$3, af as d$2, ag as a$3, ah as l$2, ai as f$2, aj as u$6, ak as r$6, al as t$2, am as displayPathBasename, an as FILE_CONTEXT_MENTION_PROVIDER, ao as SYMBOL_CONTEXT_MENTION_PROVIDER, ap as REMOTE_REPOSITORY_PROVIDER_URI, aq as REMOTE_FILE_PROVIDER_URI, ar as REMOTE_DIRECTORY_PROVIDER_URI, as as
|
|
5
|
+
import { g as getDefaultExportFromCjs, L as Ls, k as ke$1, a as ks, F as Fi$1, _ as _s, b as ds, c as bs, i 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, e as ws, B as B$2, f as g$5, h as h$4, j as _i, S as Ss, l as Br, m as ln, n as bi$1, v as vn, o as xn, N as Nn, r as mn, s as li$1, u as n$1, z as ns, M as M$4, D as Ds, A as le$2, E as c$4, G as oe$1, H as z$1, I as yi$1, W as W$2, U as Ue$1, O as I$2, P as Se$2, Q as O$2, V as F$1, X as Ni$1, Y as ee$1, Z as we$2, $ as b$2, a0 as T$3, a1 as s$2, a2 as o$4, a3 as w$3, a4 as i$1, a5 as k$3, a6 as D$5, a7 as p$8, a8 as m$7, a9 as S$4, aa as v$4, ab as P$2, ac as E$6, ad as Wi$1, ae as L$3, af as d$2, ag as a$3, ah as l$2, ai as f$2, aj as u$6, ak as r$6, al as t$2, am as displayPathBasename, an as FILE_CONTEXT_MENTION_PROVIDER, ao as SYMBOL_CONTEXT_MENTION_PROVIDER, ap as REMOTE_REPOSITORY_PROVIDER_URI, aq as REMOTE_FILE_PROVIDER_URI, ar as REMOTE_DIRECTORY_PROVIDER_URI, as as WEB_PROVIDER_URI, at as displayPath, au as displayLineRange, av as displayPathDirname, aw as IGNORED_FILE_WARNING_LABEL, ax as LARGE_FILE_WARNING_LABEL, ay as Ei$1, az as xe$2, aA as V$2, aB as Es, aC as U$2, aD as e, aE as Ns, aF as an, aG as gs, aH as serializeContextItem, aI as CONTEXT_ITEM_MENTION_NODE_TYPE, aJ as contextItemMentionNodeDisplayText, C as ContextItemSource, aK as URI, aL as qr, aM as _$2, aN as TEMPLATE_INPUT_NODE_TYPE, aO as N$2, aP as parseMentionQuery, aQ as NO_SYMBOL_MATCHES_HELP_LABEL, aR as FILE_RANGE_TOOLTIP_LABEL, aS as createExtensionAPI, aT as createMessageAPIForWebview, aU as lodashExports, aV as memoizeLastValue, aW as toSerializedPromptEditorValue, aX as ri$1, aY as scanForMentionTriggerInUserTextInput, aZ as fs, a_ as Ts, a$ as ps, b0 as hydrateAfterPostMessage, b1 as isCodyProUser, b2 as CodyIDE, b3 as webviewOpenURIForContextItem, b4 as commonjsGlobal, b5 as CodyTaskState, b6 as cryptoJsExports, b7 as isError, b8 as RateLimitError, b9 as CODY_FEEDBACK_URL, ba as isDefined, bb as reformatBotMessageForChat, p as ps$1, bc as isAbortErrorOrSocketHangUp, bd as isEqual, be as serializedPromptEditorStateFromChatMessage, bf as contextItemsFromPromptEditorValue, bg as filterContextItemsFromPromptEditorValue, bh as pluralize, bi as isCodyProModel, bj as ModelTag, bk as CustomCommandType, bl as isMacOS, bm as textContentFromSerializedLexicalNode, bn as FAST_CHAT_INPUT_TOKEN_BUDGET, bo as deserializeContextItem, bp as View, bq as truncateTextStart, br as CHAT_INPUT_TOKEN_BUDGET, bs as ACCOUNT_USAGE_URL, bt as getRelativeChatPeriod, bu as browser, bv as isErrorLike, bw as setDisplayPathEnvInfo, bx as PromptString } from "./browser-hDxNMh5y.mjs";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import React__default, { createContext, useContext, useMemo, useLayoutEffect, useEffect, forwardRef, useState, useCallback, useRef, Suspense, createElement, memo, useImperativeHandle, Children, isValidElement, cloneElement, Fragment as Fragment$1, useReducer } from "react";
|
|
8
8
|
var classnames = { exports: {} };
|
|
@@ -8274,7 +8274,6 @@ const iconForProvider = {
|
|
|
8274
8274
|
[REMOTE_REPOSITORY_PROVIDER_URI]: FolderGit,
|
|
8275
8275
|
[REMOTE_FILE_PROVIDER_URI]: File,
|
|
8276
8276
|
[REMOTE_DIRECTORY_PROVIDER_URI]: FolderGit,
|
|
8277
|
-
[CURRENT_REPOSITORY_DIRECTORY_PROVIDER_URI]: FolderGit,
|
|
8278
8277
|
[WEB_PROVIDER_URI]: Link$1
|
|
8279
8278
|
};
|
|
8280
8279
|
const contextItemMentionNode = "_context-item-mention-node_1eamp_1";
|
|
@@ -8373,7 +8372,7 @@ const useIsFocused = () => {
|
|
|
8373
8372
|
}, [editor2]);
|
|
8374
8373
|
return hasFocus;
|
|
8375
8374
|
};
|
|
8376
|
-
const MentionComponent = ({ nodeKey, node: node2, tooltip
|
|
8375
|
+
const MentionComponent = ({ nodeKey, node: node2, tooltip, icon: Icon2, className, focusedClassName, iconClassName }) => {
|
|
8377
8376
|
const { tooltipComponents, onContextItemMentionNodeMetaClick } = getGlobalPromptEditorConfig();
|
|
8378
8377
|
const [editor2] = u$5();
|
|
8379
8378
|
const isEditorFocused = useIsFocused();
|
|
@@ -8515,7 +8514,7 @@ const MentionComponent = ({ nodeKey, node: node2, tooltip: tooltip2, icon: Icon2
|
|
|
8515
8514
|
unregister();
|
|
8516
8515
|
};
|
|
8517
8516
|
}, [editor2, onArrowLeftPress, onArrowRightPress, onClick, onDelete, onBlur, onSelectionChange]);
|
|
8518
|
-
const content2 = /* @__PURE__ */ jsxs("span", { ref: ref2, className: composedClassNames, title: tooltipComponents ? void 0 :
|
|
8517
|
+
const content2 = /* @__PURE__ */ jsxs("span", { ref: ref2, className: composedClassNames, title: tooltipComponents ? void 0 : tooltip, children: [
|
|
8519
8518
|
Icon2 && /* @__PURE__ */ jsx(Icon2, { size: 14, strokeWidth: 2, className: clsx$1(iconClassName, "tw-shrink-0") }),
|
|
8520
8519
|
/* @__PURE__ */ jsx("span", { children: text2 })
|
|
8521
8520
|
] });
|
|
@@ -8525,7 +8524,7 @@ const MentionComponent = ({ nodeKey, node: node2, tooltip: tooltip2, icon: Icon2
|
|
|
8525
8524
|
const { Tooltip: Tooltip2, TooltipContent: TooltipContent2, TooltipTrigger: TooltipTrigger2 } = tooltipComponents;
|
|
8526
8525
|
return /* @__PURE__ */ jsxs(Tooltip2, { children: [
|
|
8527
8526
|
/* @__PURE__ */ jsx(TooltipTrigger2, { asChild: true, children: content2 }),
|
|
8528
|
-
|
|
8527
|
+
tooltip && /* @__PURE__ */ jsx(TooltipContent2, { children: tooltip })
|
|
8529
8528
|
] });
|
|
8530
8529
|
};
|
|
8531
8530
|
const MENTION_CLASS_NAME = styles$k.contextItemMentionNode;
|
|
@@ -8709,16 +8708,16 @@ const TemplateInputComponent = ({ editor: editor2, nodeKey, node: node2, classNa
|
|
|
8709
8708
|
editor2.registerCommand(_$2, onKeyDown, Ns)
|
|
8710
8709
|
);
|
|
8711
8710
|
}, [editor2, onClick, onKeyDown]);
|
|
8712
|
-
const
|
|
8711
|
+
const tooltip = "replaces template placeholder on keypress";
|
|
8713
8712
|
const text2 = node2.templateInput.placeholder;
|
|
8714
|
-
const content2 = /* @__PURE__ */ jsx("span", { ref: ref2, className: composedClassNames, title: tooltipComponents ? void 0 :
|
|
8713
|
+
const content2 = /* @__PURE__ */ jsx("span", { ref: ref2, className: composedClassNames, title: tooltipComponents ? void 0 : tooltip, children: /* @__PURE__ */ jsx("span", { children: text2 }) });
|
|
8715
8714
|
if (!tooltipComponents) {
|
|
8716
8715
|
return content2;
|
|
8717
8716
|
}
|
|
8718
8717
|
const { Tooltip: Tooltip2, TooltipContent: TooltipContent2, TooltipTrigger: TooltipTrigger2 } = tooltipComponents;
|
|
8719
8718
|
return /* @__PURE__ */ jsxs(Tooltip2, { children: [
|
|
8720
8719
|
/* @__PURE__ */ jsx(TooltipTrigger2, { asChild: true, children: content2 }),
|
|
8721
|
-
/* @__PURE__ */ jsx(TooltipContent2, { children:
|
|
8720
|
+
/* @__PURE__ */ jsx(TooltipContent2, { children: tooltip })
|
|
8722
8721
|
] });
|
|
8723
8722
|
};
|
|
8724
8723
|
const templateInputNode = "_template-input-node_14yoh_1";
|
|
@@ -8961,8 +8960,8 @@ function L({ options: e2, onQueryChange: n2, onSelectOption: o2, onOpen: r2, onC
|
|
|
8961
8960
|
};
|
|
8962
8961
|
}, [v2, g2, n2, x2, I2, T2]), null === x2 || null === v2 ? null : jsx(R, { close: I2, resolution: x2, editor: v2, anchorElementRef: O2, options: e2, menuRenderFn: i2, shouldSplitNodeWithQuery: true, onSelectOption: o2, commandPriority: y2 });
|
|
8963
8962
|
}
|
|
8964
|
-
const popoverDimensions = "_popover-
|
|
8965
|
-
const popover = "
|
|
8963
|
+
const popoverDimensions = "_popover-dimensions_1uf3m_1";
|
|
8964
|
+
const popover = "_popover_1uf3m_1";
|
|
8966
8965
|
const styles$i = {
|
|
8967
8966
|
popoverDimensions,
|
|
8968
8967
|
popover
|
|
@@ -8977,13 +8976,15 @@ function contextItemID(item2) {
|
|
|
8977
8976
|
item2.range ? `${item2.range.start.line}:${item2.range.start.character}-${item2.range.end.line}:${item2.range.end.character}` : ""
|
|
8978
8977
|
]);
|
|
8979
8978
|
}
|
|
8980
|
-
const container$2 = "
|
|
8981
|
-
const item = "
|
|
8982
|
-
const contextItem$1 = "_context-
|
|
8979
|
+
const container$2 = "_container_fr158_1";
|
|
8980
|
+
const item = "_item_fr158_8";
|
|
8981
|
+
const contextItem$1 = "_context-item_fr158_9";
|
|
8982
|
+
const experimental = "_experimental_fr158_17";
|
|
8983
8983
|
const styles$h = {
|
|
8984
8984
|
container: container$2,
|
|
8985
8985
|
item,
|
|
8986
|
-
contextItem: contextItem$1
|
|
8986
|
+
contextItem: contextItem$1,
|
|
8987
|
+
experimental
|
|
8987
8988
|
};
|
|
8988
8989
|
const MentionMenu = ({
|
|
8989
8990
|
params,
|
|
@@ -9029,6 +9030,14 @@ const MentionMenu = ({
|
|
|
9029
9030
|
window.addEventListener("keydown", listener, { capture: true });
|
|
9030
9031
|
return () => window.removeEventListener("keydown", listener, { capture: true });
|
|
9031
9032
|
}, []);
|
|
9033
|
+
useEffect(() => {
|
|
9034
|
+
const listener = (e2) => {
|
|
9035
|
+
e2.preventDefault();
|
|
9036
|
+
e2.stopPropagation();
|
|
9037
|
+
};
|
|
9038
|
+
window.addEventListener("mousedown", listener, { capture: true });
|
|
9039
|
+
return () => window.removeEventListener("mousedown", listener, { capture: true });
|
|
9040
|
+
}, []);
|
|
9032
9041
|
const onProviderSelect = useCallback(
|
|
9033
9042
|
(value2) => {
|
|
9034
9043
|
const provider = data.providers.find((p2) => commandRowValue$1(p2) === value2);
|
|
@@ -9199,6 +9208,21 @@ function getItemsHeading(parentItem, mentionQuery) {
|
|
|
9199
9208
|
if (parentItem.id === SYMBOL_CONTEXT_MENTION_PROVIDER.id || parentItem.id === FILE_CONTEXT_MENTION_PROVIDER.id) {
|
|
9200
9209
|
return "";
|
|
9201
9210
|
}
|
|
9211
|
+
if (parentItem.id === REMOTE_DIRECTORY_PROVIDER_URI) {
|
|
9212
|
+
return /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-flex-gap-2 tw-items-center tw-justify-between", children: [
|
|
9213
|
+
/* @__PURE__ */ jsx("div", { children: mentionQuery.text.includes(":") ? "Directory - Select a directory" : "Directory - Select a repository" }),
|
|
9214
|
+
/* @__PURE__ */ jsx(
|
|
9215
|
+
"div",
|
|
9216
|
+
{
|
|
9217
|
+
className: clsx$1(
|
|
9218
|
+
"tw-text-xs tw-rounded tw-px-2 tw-text-foreground",
|
|
9219
|
+
styles$h.experimental
|
|
9220
|
+
),
|
|
9221
|
+
children: "Experimental"
|
|
9222
|
+
}
|
|
9223
|
+
)
|
|
9224
|
+
] });
|
|
9225
|
+
}
|
|
9202
9226
|
return parentItem.title ?? parentItem.id;
|
|
9203
9227
|
}
|
|
9204
9228
|
const COMMAND_ROW_CLASS_NAME = "!tw-p-3 !tw-text-md !tw-leading-[1.2] !tw-h-[30px] !tw-rounded-none";
|
|
@@ -9216,21 +9240,17 @@ function useClientState() {
|
|
|
9216
9240
|
const ChatMentionContext = createContext({
|
|
9217
9241
|
resolutionMode: "local"
|
|
9218
9242
|
});
|
|
9219
|
-
const context
|
|
9243
|
+
const context = createContext(void 0);
|
|
9220
9244
|
const ExtensionAPIProviderFromVSCodeAPI = ({ vscodeAPI, children: children2 }) => {
|
|
9221
|
-
const extensionAPI = useMemo(
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
prompts: proxyExtensionAPI(messageAPI, "prompts")
|
|
9227
|
-
};
|
|
9228
|
-
}, [vscodeAPI]);
|
|
9229
|
-
return /* @__PURE__ */ jsx(context$1.Provider, { value: extensionAPI, children: children2 });
|
|
9245
|
+
const extensionAPI = useMemo(
|
|
9246
|
+
() => createExtensionAPI(createMessageAPIForWebview(vscodeAPI)),
|
|
9247
|
+
[vscodeAPI]
|
|
9248
|
+
);
|
|
9249
|
+
return /* @__PURE__ */ jsx(context.Provider, { value: extensionAPI, children: children2 });
|
|
9230
9250
|
};
|
|
9231
|
-
context
|
|
9251
|
+
context.Provider;
|
|
9232
9252
|
function useExtensionAPI() {
|
|
9233
|
-
const extensionAPI = useContext(context
|
|
9253
|
+
const extensionAPI = useContext(context);
|
|
9234
9254
|
if (!extensionAPI) {
|
|
9235
9255
|
throw new Error(
|
|
9236
9256
|
"useExtensionAPI must be used within an ExtensionAPIProviderFromVSCodeAPI or ExtensionAPIProviderForTestsOnly component"
|
|
@@ -9293,8 +9313,7 @@ function useMentionMenuParams() {
|
|
|
9293
9313
|
const isRemoteLikeProviderActive = mentionSettings.resolutionMode === "remote" || [
|
|
9294
9314
|
REMOTE_FILE_PROVIDER_URI,
|
|
9295
9315
|
REMOTE_DIRECTORY_PROVIDER_URI,
|
|
9296
|
-
REMOTE_REPOSITORY_PROVIDER_URI
|
|
9297
|
-
CURRENT_REPOSITORY_DIRECTORY_PROVIDER_URI
|
|
9316
|
+
REMOTE_REPOSITORY_PROVIDER_URI
|
|
9298
9317
|
].includes(((_a = params.parentItem) == null ? void 0 : _a.id) || "");
|
|
9299
9318
|
const debounceTime = isRemoteLikeProviderActive ? 300 : 10;
|
|
9300
9319
|
const debouncedUpdateQuery = useMemo(
|
|
@@ -9374,7 +9393,7 @@ function useCallMentionMenuData({
|
|
|
9374
9393
|
const mentionQuery = useMemo(
|
|
9375
9394
|
() => ({
|
|
9376
9395
|
...parseMentionQuery(query ?? "", provider),
|
|
9377
|
-
|
|
9396
|
+
contextRemoteRepositoriesNames: mentionSettings.remoteRepositoriesNames
|
|
9378
9397
|
}),
|
|
9379
9398
|
[query, provider, mentionSettings]
|
|
9380
9399
|
);
|
|
@@ -12838,6 +12857,19 @@ const $a093c7e1ec25a057$var$PORTAL_NAME = "TooltipPortal";
|
|
|
12838
12857
|
const [$a093c7e1ec25a057$var$PortalProvider, $a093c7e1ec25a057$var$usePortalContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PORTAL_NAME, {
|
|
12839
12858
|
forceMount: void 0
|
|
12840
12859
|
});
|
|
12860
|
+
const $a093c7e1ec25a057$export$7b36b8f925ab7497 = (props) => {
|
|
12861
|
+
const { __scopeTooltip, forceMount, children: children2, container: container2 } = props;
|
|
12862
|
+
const context2 = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$PORTAL_NAME, __scopeTooltip);
|
|
12863
|
+
return /* @__PURE__ */ createElement($a093c7e1ec25a057$var$PortalProvider, {
|
|
12864
|
+
scope: __scopeTooltip,
|
|
12865
|
+
forceMount
|
|
12866
|
+
}, /* @__PURE__ */ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
12867
|
+
present: forceMount || context2.open
|
|
12868
|
+
}, /* @__PURE__ */ createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
12869
|
+
asChild: true,
|
|
12870
|
+
container: container2
|
|
12871
|
+
}, children2)));
|
|
12872
|
+
};
|
|
12841
12873
|
const $a093c7e1ec25a057$var$CONTENT_NAME = "TooltipContent";
|
|
12842
12874
|
const $a093c7e1ec25a057$export$e9003e2be37ec060 = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
12843
12875
|
const portalContext = $a093c7e1ec25a057$var$usePortalContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
|
|
@@ -13135,6 +13167,7 @@ function $a093c7e1ec25a057$var$getHullPresorted(points) {
|
|
|
13135
13167
|
const $a093c7e1ec25a057$export$2881499e37b75b9a = $a093c7e1ec25a057$export$f78649fb9ca566b8;
|
|
13136
13168
|
const $a093c7e1ec25a057$export$be92b6f5f03c0fe9 = $a093c7e1ec25a057$export$28c660c63b792dea;
|
|
13137
13169
|
const $a093c7e1ec25a057$export$41fb9f06171c75f4 = $a093c7e1ec25a057$export$8c610744efcf8a1d;
|
|
13170
|
+
const $a093c7e1ec25a057$export$602eac185826482c = $a093c7e1ec25a057$export$7b36b8f925ab7497;
|
|
13138
13171
|
const $a093c7e1ec25a057$export$7c6e2c02157bb7d2 = $a093c7e1ec25a057$export$e9003e2be37ec060;
|
|
13139
13172
|
const CLASS_PART_SEPARATOR = "-";
|
|
13140
13173
|
function createClassUtils(config) {
|
|
@@ -15623,19 +15656,22 @@ function cn(...inputs) {
|
|
|
15623
15656
|
const TooltipProvider = $a093c7e1ec25a057$export$2881499e37b75b9a;
|
|
15624
15657
|
const Tooltip = $a093c7e1ec25a057$export$be92b6f5f03c0fe9;
|
|
15625
15658
|
const TooltipTrigger = $a093c7e1ec25a057$export$41fb9f06171c75f4;
|
|
15626
|
-
const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref2) =>
|
|
15627
|
-
$a093c7e1ec25a057$export$
|
|
15628
|
-
{
|
|
15629
|
-
|
|
15630
|
-
|
|
15631
|
-
|
|
15632
|
-
|
|
15633
|
-
className
|
|
15634
|
-
|
|
15635
|
-
|
|
15636
|
-
|
|
15637
|
-
|
|
15638
|
-
|
|
15659
|
+
const TooltipContent = React.forwardRef(({ portal, className, sideOffset = 4, ...props }, ref2) => {
|
|
15660
|
+
const Portal = portal ? $a093c7e1ec25a057$export$602eac185826482c : React.Fragment;
|
|
15661
|
+
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
|
|
15662
|
+
$a093c7e1ec25a057$export$7c6e2c02157bb7d2,
|
|
15663
|
+
{
|
|
15664
|
+
ref: ref2,
|
|
15665
|
+
sideOffset,
|
|
15666
|
+
className: cn(
|
|
15667
|
+
"tw-z-50 tw-overflow-hidden tw-flex tw-items-center tw-rounded-md tw-border tw-border-border tw-leading-tight tw-bg-popover tw-px-3 tw-py-2 tw-text-sm tw-text-popover-foreground tw-max-w-72 tw-text-center tw-whitespace-pre-line tw-shadow-lg [&_kbd]:tw-ml-3 [&_kbd]:-tw-mr-1 [&_kbd]:tw-mt-[-4px] [&_kbd]:tw-mb-[-4px]",
|
|
15668
|
+
className
|
|
15669
|
+
),
|
|
15670
|
+
...props,
|
|
15671
|
+
children: props.children
|
|
15672
|
+
}
|
|
15673
|
+
) });
|
|
15674
|
+
});
|
|
15639
15675
|
TooltipContent.displayName = $a093c7e1ec25a057$export$7c6e2c02157bb7d2.displayName;
|
|
15640
15676
|
var U = 1, Y$1 = 0.9, H = 0.8, J = 0.17, p$1 = 0.1, u = 0.999, $ = 0.9999;
|
|
15641
15677
|
var k$1 = 0.99, m = /[\\\/_+.#"@\[\(\{&]/, B = /[\\\/_+.#"@\[\(\{&]/g, K = /[\s-]/, X$1 = /[\s-]/g;
|
|
@@ -17271,7 +17307,7 @@ const CommandSeparator = React.forwardRef(({ className, ...props }, ref2) => /*
|
|
|
17271
17307
|
}
|
|
17272
17308
|
));
|
|
17273
17309
|
CommandSeparator.displayName = He.Separator.displayName;
|
|
17274
|
-
const CommandItem = React.forwardRef(({ className, tooltip
|
|
17310
|
+
const CommandItem = React.forwardRef(({ className, tooltip, ...props }, ref2) => {
|
|
17275
17311
|
const item2 = /* @__PURE__ */ jsx(
|
|
17276
17312
|
He.Item,
|
|
17277
17313
|
{
|
|
@@ -17280,7 +17316,7 @@ const CommandItem = React.forwardRef(({ className, tooltip: tooltip2, ...props }
|
|
|
17280
17316
|
"tw-relative tw-flex tw-cursor-pointer tw-select-none tw-items-center tw-rounded-sm tw-py-3 tw-px-2 tw-text-md tw-outline-none aria-selected:tw-bg-accent aria-selected:tw-text-accent-foreground hover:tw-bg-accent hover:tw-text-accent-foreground data-[disabled=true]:tw-pointer-events-none data-[disabled=true]:tw-opacity-50",
|
|
17281
17317
|
className
|
|
17282
17318
|
),
|
|
17283
|
-
title:
|
|
17319
|
+
title: tooltip,
|
|
17284
17320
|
...props
|
|
17285
17321
|
}
|
|
17286
17322
|
);
|
|
@@ -29745,11 +29781,16 @@ function useConfig() {
|
|
|
29745
29781
|
}
|
|
29746
29782
|
function useUserAccountInfo() {
|
|
29747
29783
|
const value = useConfig();
|
|
29784
|
+
if (!value.authStatus.authenticated) {
|
|
29785
|
+
throw new Error(
|
|
29786
|
+
"useUserAccountInfo must be used within a ConfigProvider with authenticated user"
|
|
29787
|
+
);
|
|
29788
|
+
}
|
|
29748
29789
|
return {
|
|
29749
29790
|
isCodyProUser: isCodyProUser(value.authStatus),
|
|
29750
29791
|
// Receive this value from the extension backend to make it work
|
|
29751
29792
|
// with E2E tests where change the DOTCOM_URL via the env variable TESTING_DOTCOM_URL.
|
|
29752
|
-
isDotComUser: value.
|
|
29793
|
+
isDotComUser: value.isDotComUser,
|
|
29753
29794
|
user: value.authStatus,
|
|
29754
29795
|
ide: value.config.agentIDE ?? CodyIDE.VSCode
|
|
29755
29796
|
};
|
|
@@ -29889,23 +29930,6 @@ const GeminiLogo = ({
|
|
|
29889
29930
|
]
|
|
29890
29931
|
}
|
|
29891
29932
|
);
|
|
29892
|
-
const context = createContext({});
|
|
29893
|
-
const ChatModelContextProvider = context.Provider;
|
|
29894
|
-
function useChatModelContext() {
|
|
29895
|
-
return useContext(context);
|
|
29896
|
-
}
|
|
29897
|
-
function useChatModelByID(model) {
|
|
29898
|
-
const { chatModels } = useChatModelContext();
|
|
29899
|
-
return (chatModels == null ? void 0 : chatModels.find((m2) => m2.id === model)) ?? (model ? {
|
|
29900
|
-
id: model,
|
|
29901
|
-
title: model,
|
|
29902
|
-
provider: "unknown"
|
|
29903
|
-
} : void 0);
|
|
29904
|
-
}
|
|
29905
|
-
function useCurrentChatModel() {
|
|
29906
|
-
const { chatModels } = useChatModelContext();
|
|
29907
|
-
return chatModels == null ? void 0 : chatModels[0];
|
|
29908
|
-
}
|
|
29909
29933
|
const path$2 = "_path_kr5rq_1";
|
|
29910
29934
|
const excluded = "_excluded_kr5rq_7";
|
|
29911
29935
|
const styles$e = {
|
|
@@ -30060,7 +30084,7 @@ included via Enhanced Context (Remote Search)`,
|
|
|
30060
30084
|
const iconTitle = source2 && hoverSourceLabels[source2] ? `Included ${hoverSourceLabels[source2]}` : void 0;
|
|
30061
30085
|
return /* @__PURE__ */ jsxs("div", { className: clsx$1("tw-inline-flex tw-items-center tw-max-w-full", className), children: [
|
|
30062
30086
|
(isIgnored || isTooLarge) && /* @__PURE__ */ jsx("i", { className: "codicon codicon-warning", title: linkDetails.tooltip }),
|
|
30063
|
-
source2 === "unified" ? /* @__PURE__ */ jsxs(
|
|
30087
|
+
source2 === "unified" || uri.scheme === "http" || uri.scheme === "https" ? /* @__PURE__ */ jsxs(
|
|
30064
30088
|
"a",
|
|
30065
30089
|
{
|
|
30066
30090
|
className: linkClassName,
|
|
@@ -71208,8 +71232,8 @@ class GuardrailsStatusController {
|
|
|
71208
71232
|
if (repos.length === 1) {
|
|
71209
71233
|
return `${prefix} ${repos[0]}.`;
|
|
71210
71234
|
}
|
|
71211
|
-
const
|
|
71212
|
-
return limitHit ? `${
|
|
71235
|
+
const tooltip = `${prefix} ${repos.length} repositories: ${repos.join(", ")}`;
|
|
71236
|
+
return limitHit ? `${tooltip} or more...` : `${tooltip}.`;
|
|
71213
71237
|
}
|
|
71214
71238
|
}
|
|
71215
71239
|
function createButtons(preText, copyButtonOnSubmit, insertButtonOnSubmit) {
|
|
@@ -71790,13 +71814,14 @@ const FeedbackButtons = ({
|
|
|
71790
71814
|
] })
|
|
71791
71815
|
] });
|
|
71792
71816
|
};
|
|
71793
|
-
const BaseMessageCell = ({ speakerIcon, speakerTitle, content: content2, contentClassName, footer: footer2, className }) => /* @__PURE__ */ jsxs(
|
|
71817
|
+
const BaseMessageCell = ({ speakerIcon, speakerTitle, cellAction, content: content2, contentClassName, footer: footer2, className }) => /* @__PURE__ */ jsxs(
|
|
71794
71818
|
Cell,
|
|
71795
71819
|
{
|
|
71796
71820
|
header: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71797
71821
|
speakerIcon,
|
|
71798
71822
|
" ",
|
|
71799
|
-
/* @__PURE__ */ jsx("span", { className: "tw-mt-[-1px] tw-font-semibold", children: speakerTitle })
|
|
71823
|
+
/* @__PURE__ */ jsx("span", { className: "tw-mt-[-1px] tw-font-semibold", children: speakerTitle }),
|
|
71824
|
+
/* @__PURE__ */ jsx("div", { className: "tw-ml-auto", children: cellAction })
|
|
71800
71825
|
] }),
|
|
71801
71826
|
containerClassName: className,
|
|
71802
71827
|
contentClassName,
|
|
@@ -71873,7 +71898,7 @@ const ContextFocusActions = ({ humanMessage, className }) => {
|
|
|
71873
71898
|
"aria-label": "Try again with different context",
|
|
71874
71899
|
children: /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-flex-wrap tw-items-center tw-gap-x-4 tw-gap-y-2", children: [
|
|
71875
71900
|
/* @__PURE__ */ jsx("h3", { className: "tw-flex tw-items-center tw-gap-3", children: "Try again with different context" }),
|
|
71876
|
-
/* @__PURE__ */ jsx("ul", { className: "tw-whitespace-nowrap tw-flex tw-gap-2 tw-flex-wrap", children: actions2.map(({ label, tooltip
|
|
71901
|
+
/* @__PURE__ */ jsx("ul", { className: "tw-whitespace-nowrap tw-flex tw-gap-2 tw-flex-wrap", children: actions2.map(({ label, tooltip, onClick }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
71877
71902
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
71878
71903
|
Button3,
|
|
71879
71904
|
{
|
|
@@ -71885,7 +71910,7 @@ const ContextFocusActions = ({ humanMessage, className }) => {
|
|
|
71885
71910
|
},
|
|
71886
71911
|
label
|
|
71887
71912
|
) }),
|
|
71888
|
-
/* @__PURE__ */ jsx(TooltipContent, { children:
|
|
71913
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: tooltip })
|
|
71889
71914
|
] }) }, label)) })
|
|
71890
71915
|
] })
|
|
71891
71916
|
}
|
|
@@ -72008,6 +72033,15 @@ function makeHumanMessageInfo({ humanMessage, assistantMessage }, humanEditorRef
|
|
|
72008
72033
|
}
|
|
72009
72034
|
};
|
|
72010
72035
|
}
|
|
72036
|
+
function useChatModelByID(model) {
|
|
72037
|
+
const models = useExtensionAPI().models;
|
|
72038
|
+
const chatModels = useObservable(useMemo(() => models(), [models])).value;
|
|
72039
|
+
return (chatModels == null ? void 0 : chatModels.find((m2) => m2.id === model)) ?? (model ? {
|
|
72040
|
+
id: model,
|
|
72041
|
+
title: model,
|
|
72042
|
+
provider: "unknown"
|
|
72043
|
+
} : void 0);
|
|
72044
|
+
}
|
|
72011
72045
|
const contextItem = "_context-item_13e3r_1";
|
|
72012
72046
|
const contextItemMetadata = "_context-item-metadata_13e3r_6";
|
|
72013
72047
|
const contextItemLink = "_context-item-link_13e3r_12";
|
|
@@ -72555,7 +72589,7 @@ const ToolbarButton = forwardRef(
|
|
|
72555
72589
|
className,
|
|
72556
72590
|
variant,
|
|
72557
72591
|
asChild = false,
|
|
72558
|
-
tooltip
|
|
72592
|
+
tooltip,
|
|
72559
72593
|
iconStart: IconStart,
|
|
72560
72594
|
iconEnd: IconEnd,
|
|
72561
72595
|
children: children2,
|
|
@@ -72580,9 +72614,9 @@ const ToolbarButton = forwardRef(
|
|
|
72580
72614
|
]
|
|
72581
72615
|
}
|
|
72582
72616
|
);
|
|
72583
|
-
return
|
|
72617
|
+
return tooltip ? /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
72584
72618
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button2 }),
|
|
72585
|
-
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children:
|
|
72619
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: tooltip })
|
|
72586
72620
|
] }) : button2;
|
|
72587
72621
|
}
|
|
72588
72622
|
);
|
|
@@ -73524,20 +73558,24 @@ const PromptSelectFieldToolbarItem = ({ focusEditor, appendTextToEditor, classNa
|
|
|
73524
73558
|
return /* @__PURE__ */ jsx(PromptSelectField, { onSelect, onCloseByEscape: focusEditor, className });
|
|
73525
73559
|
};
|
|
73526
73560
|
const ModelSelectFieldToolbarItem = ({ userInfo, focusEditor, className }) => {
|
|
73527
|
-
const
|
|
73561
|
+
const config = useConfig();
|
|
73562
|
+
const api2 = useExtensionAPI();
|
|
73528
73563
|
const onModelSelect = useCallback(
|
|
73529
73564
|
(model) => {
|
|
73530
|
-
|
|
73565
|
+
api2.setChatModel(model.id).subscribe({
|
|
73566
|
+
error: (error2) => console.error("setChatModel:", error2)
|
|
73567
|
+
});
|
|
73531
73568
|
focusEditor == null ? void 0 : focusEditor();
|
|
73532
73569
|
},
|
|
73533
|
-
[
|
|
73570
|
+
[api2.setChatModel, focusEditor]
|
|
73534
73571
|
);
|
|
73535
|
-
|
|
73572
|
+
const { value: chatModels } = useObservable(useMemo(() => api2.models(), [api2.models]));
|
|
73573
|
+
return !!(chatModels == null ? void 0 : chatModels.length) && (userInfo.isDotComUser || config.configFeatures.serverSentModels) && /* @__PURE__ */ jsx(
|
|
73536
73574
|
ModelSelectField,
|
|
73537
73575
|
{
|
|
73538
73576
|
models: chatModels,
|
|
73539
73577
|
onModelSelect,
|
|
73540
|
-
serverSentModelsEnabled:
|
|
73578
|
+
serverSentModelsEnabled: config.configFeatures.serverSentModels,
|
|
73541
73579
|
userInfo,
|
|
73542
73580
|
onCloseByEscape: focusEditor,
|
|
73543
73581
|
className
|
|
@@ -73698,9 +73736,11 @@ const HumanMessageEditor = ({
|
|
|
73698
73736
|
if (isSent) {
|
|
73699
73737
|
return;
|
|
73700
73738
|
}
|
|
73701
|
-
|
|
73702
|
-
editorRef.current
|
|
73703
|
-
|
|
73739
|
+
requestAnimationFrame(() => {
|
|
73740
|
+
if (editorRef.current) {
|
|
73741
|
+
editorRef.current.appendText(appendTextToLastPromptEditor);
|
|
73742
|
+
}
|
|
73743
|
+
});
|
|
73704
73744
|
}
|
|
73705
73745
|
},
|
|
73706
73746
|
[isSent]
|
|
@@ -73783,6 +73823,11 @@ const HumanMessageEditor = ({
|
|
|
73783
73823
|
)
|
|
73784
73824
|
);
|
|
73785
73825
|
};
|
|
73826
|
+
function useCurrentChatModel() {
|
|
73827
|
+
var _a;
|
|
73828
|
+
const models = useExtensionAPI().models;
|
|
73829
|
+
return (_a = useObservable(useMemo(() => models(), [models])).value) == null ? void 0 : _a.at(0);
|
|
73830
|
+
}
|
|
73786
73831
|
const HumanMessageCell = memo(
|
|
73787
73832
|
({
|
|
73788
73833
|
message: message2,
|
|
@@ -73818,6 +73863,7 @@ const HumanMessageCell = memo(
|
|
|
73818
73863
|
}
|
|
73819
73864
|
),
|
|
73820
73865
|
speakerTitle: userInfo.user.displayName ?? userInfo.user.username,
|
|
73866
|
+
cellAction: isFirstMessage && /* @__PURE__ */ jsx(OpenInNewEditorAction, {}),
|
|
73821
73867
|
content: /* @__PURE__ */ jsx(
|
|
73822
73868
|
HumanMessageEditor,
|
|
73823
73869
|
{
|
|
@@ -73844,6 +73890,31 @@ const HumanMessageCell = memo(
|
|
|
73844
73890
|
},
|
|
73845
73891
|
isEqual
|
|
73846
73892
|
);
|
|
73893
|
+
const OpenInNewEditorAction = () => {
|
|
73894
|
+
const {
|
|
73895
|
+
config: { multipleWebviewsEnabled }
|
|
73896
|
+
} = useConfig();
|
|
73897
|
+
if (!multipleWebviewsEnabled) {
|
|
73898
|
+
return null;
|
|
73899
|
+
}
|
|
73900
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
73901
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
73902
|
+
"button",
|
|
73903
|
+
{
|
|
73904
|
+
type: "button",
|
|
73905
|
+
onClick: () => {
|
|
73906
|
+
getVSCodeAPI().postMessage({
|
|
73907
|
+
command: "command",
|
|
73908
|
+
id: "cody.chat.moveToEditor"
|
|
73909
|
+
});
|
|
73910
|
+
},
|
|
73911
|
+
className: "tw-flex tw-gap-3 tw-items-center tw-leading-none tw-opacity-80 hover:tw-opacity-100 tw-border-b-[1px] tw-border-transparent tw-transition tw-translate-y-[1px]",
|
|
73912
|
+
children: /* @__PURE__ */ jsx(Columns2, { size: 16, strokeWidth: 1.25, className: "tw-w-8 tw-h-8" })
|
|
73913
|
+
}
|
|
73914
|
+
) }),
|
|
73915
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: "Open in Editor" })
|
|
73916
|
+
] });
|
|
73917
|
+
};
|
|
73847
73918
|
const Transcript = (props) => {
|
|
73848
73919
|
const {
|
|
73849
73920
|
chatEnabled,
|
|
@@ -74405,6 +74476,12 @@ const Chat = ({
|
|
|
74405
74476
|
window.removeEventListener("focus", onFocus);
|
|
74406
74477
|
};
|
|
74407
74478
|
}, []);
|
|
74479
|
+
const handleScrollDownClick = useCallback(() => {
|
|
74480
|
+
if (transcript.length === 0) {
|
|
74481
|
+
return;
|
|
74482
|
+
}
|
|
74483
|
+
focusLastHumanMessageEditor();
|
|
74484
|
+
}, [transcript]);
|
|
74408
74485
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
74409
74486
|
!chatEnabled && /* @__PURE__ */ jsx("div", { className: styles$3.chatDisabled, children: "Cody chat is disabled by your Sourcegraph site administrator" }),
|
|
74410
74487
|
/* @__PURE__ */ jsx(
|
|
@@ -74425,7 +74502,7 @@ const Chat = ({
|
|
|
74425
74502
|
}
|
|
74426
74503
|
),
|
|
74427
74504
|
transcript.length === 0 && showWelcomeMessage && /* @__PURE__ */ jsx(WelcomeMessage, { IDE: userInfo.ide, setView }),
|
|
74428
|
-
scrollableParent && /* @__PURE__ */ jsx(ScrollDown, { scrollableParent, onClick:
|
|
74505
|
+
scrollableParent && /* @__PURE__ */ jsx(ScrollDown, { scrollableParent, onClick: handleScrollDownClick })
|
|
74429
74506
|
] });
|
|
74430
74507
|
};
|
|
74431
74508
|
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
@@ -75030,24 +75107,24 @@ const SettingsTab = () => {
|
|
|
75030
75107
|
"settings"
|
|
75031
75108
|
) });
|
|
75032
75109
|
};
|
|
75033
|
-
const tabsRoot = "_tabs-
|
|
75034
|
-
const tabsContainer = "_tabs-
|
|
75035
|
-
const tabs = "
|
|
75036
|
-
const subTabs = "_sub-
|
|
75037
|
-
const tabActionLabel = "_tab-action-
|
|
75038
|
-
const
|
|
75039
|
-
const dialogOverlay = "_dialog-
|
|
75040
|
-
const dialogContent = "_dialog-
|
|
75041
|
-
const dialogTitle = "_dialog-
|
|
75042
|
-
const dialogDescription = "_dialog-
|
|
75043
|
-
const dialogFooter = "_dialog-
|
|
75110
|
+
const tabsRoot = "_tabs-root_1e23y_10";
|
|
75111
|
+
const tabsContainer = "_tabs-container_1e23y_18";
|
|
75112
|
+
const tabs = "_tabs_1e23y_10";
|
|
75113
|
+
const subTabs = "_sub-tabs_1e23y_42";
|
|
75114
|
+
const tabActionLabel = "_tab-action-label_1e23y_53";
|
|
75115
|
+
const tabsRootCodyWeb = "_tabs-root--cody-web_1e23y_65";
|
|
75116
|
+
const dialogOverlay = "_dialog-overlay_1e23y_1";
|
|
75117
|
+
const dialogContent = "_dialog-content_1e23y_1";
|
|
75118
|
+
const dialogTitle = "_dialog-title_1e23y_1";
|
|
75119
|
+
const dialogDescription = "_dialog-description_1e23y_1";
|
|
75120
|
+
const dialogFooter = "_dialog-footer_1e23y_1";
|
|
75044
75121
|
const styles$2 = {
|
|
75045
75122
|
tabsRoot,
|
|
75046
75123
|
tabsContainer,
|
|
75047
75124
|
tabs,
|
|
75048
75125
|
subTabs,
|
|
75049
75126
|
tabActionLabel,
|
|
75050
|
-
|
|
75127
|
+
tabsRootCodyWeb,
|
|
75051
75128
|
dialogOverlay,
|
|
75052
75129
|
dialogContent,
|
|
75053
75130
|
dialogTitle,
|
|
@@ -75057,6 +75134,9 @@ const styles$2 = {
|
|
|
75057
75134
|
const TabsBar = ({ currentView, setView, IDE, onDownloadChatClick }) => {
|
|
75058
75135
|
var _a;
|
|
75059
75136
|
const tabItems = useTabs({ IDE, onDownloadChatClick });
|
|
75137
|
+
const {
|
|
75138
|
+
config: { webviewType, multipleWebviewsEnabled }
|
|
75139
|
+
} = useConfig();
|
|
75060
75140
|
const currentViewSubActions = ((_a = tabItems.find((tab2) => tab2.view === currentView)) == null ? void 0 : _a.subActions) ?? [];
|
|
75061
75141
|
const handleClick = useCallback(
|
|
75062
75142
|
(view, command, changesView) => {
|
|
@@ -75069,35 +75149,60 @@ const TabsBar = ({ currentView, setView, IDE, onDownloadChatClick }) => {
|
|
|
75069
75149
|
},
|
|
75070
75150
|
[setView]
|
|
75071
75151
|
);
|
|
75072
|
-
const handleSubActionClick = useCallback(
|
|
75073
|
-
|
|
75074
|
-
action.callback
|
|
75075
|
-
|
|
75076
|
-
|
|
75077
|
-
|
|
75078
|
-
|
|
75079
|
-
|
|
75080
|
-
|
|
75081
|
-
|
|
75082
|
-
}, []);
|
|
75083
|
-
return /* @__PURE__ */ jsx("div", { className: styles$2.tabsRoot, children: /* @__PURE__ */ jsxs(List, { "aria-label": "cody-webview", className: styles$2.tabsContainer, children: [
|
|
75084
|
-
/* @__PURE__ */ jsx("div", { className: styles$2.tabs, children: tabItems.map(({ Icon: Icon2, view, command, title: title2, changesView }) => /* @__PURE__ */ jsx(Trigger, { value: view, asChild: true, children: /* @__PURE__ */ jsx(
|
|
75085
|
-
TabButton,
|
|
75086
|
-
{
|
|
75087
|
-
Icon: Icon2,
|
|
75088
|
-
view,
|
|
75089
|
-
title: title2,
|
|
75090
|
-
isActive: currentView === view,
|
|
75091
|
-
onClick: () => handleClick(view, command, changesView),
|
|
75092
|
-
"data-testid": `tab-${view}`
|
|
75152
|
+
const handleSubActionClick = useCallback(
|
|
75153
|
+
(action) => {
|
|
75154
|
+
if (action.callback) {
|
|
75155
|
+
action.callback();
|
|
75156
|
+
} else {
|
|
75157
|
+
getVSCodeAPI().postMessage({
|
|
75158
|
+
command: "command",
|
|
75159
|
+
id: action.command,
|
|
75160
|
+
arg: action.arg
|
|
75161
|
+
});
|
|
75093
75162
|
}
|
|
75094
|
-
|
|
75163
|
+
},
|
|
75164
|
+
[]
|
|
75165
|
+
);
|
|
75166
|
+
return /* @__PURE__ */ jsx("div", { className: clsx$1(styles$2.tabsRoot, { [styles$2.tabsRootCodyWeb]: IDE === CodyIDE.Web }), children: /* @__PURE__ */ jsxs(List, { "aria-label": "cody-webview", className: styles$2.tabsContainer, children: [
|
|
75167
|
+
/* @__PURE__ */ jsxs("div", { className: styles$2.tabs, children: [
|
|
75168
|
+
tabItems.map(({ Icon: Icon2, view, command, title: title2, changesView }) => /* @__PURE__ */ jsx(Trigger, { value: view, asChild: true, children: /* @__PURE__ */ jsx(
|
|
75169
|
+
TabButton,
|
|
75170
|
+
{
|
|
75171
|
+
Icon: Icon2,
|
|
75172
|
+
view,
|
|
75173
|
+
title: title2,
|
|
75174
|
+
IDE,
|
|
75175
|
+
isActive: currentView === view,
|
|
75176
|
+
onClick: () => handleClick(view, command, changesView),
|
|
75177
|
+
"data-testid": `tab-${view}`
|
|
75178
|
+
}
|
|
75179
|
+
) }, view)),
|
|
75180
|
+
/* @__PURE__ */ jsx("div", { className: "tw-ml-auto", children: /* @__PURE__ */ jsx(
|
|
75181
|
+
TabButton,
|
|
75182
|
+
{
|
|
75183
|
+
prominent: true,
|
|
75184
|
+
Icon: MessageSquarePlus,
|
|
75185
|
+
title: "New Chat",
|
|
75186
|
+
IDE,
|
|
75187
|
+
alwaysShowTitle: true,
|
|
75188
|
+
tooltipExtra: /* @__PURE__ */ jsx(Fragment, { children: IDE === CodyIDE.VSCode && /* @__PURE__ */ jsx(Kbd, { macOS: "shift+opt+l", linuxAndWindows: "shift+alt+l" }) }),
|
|
75189
|
+
onClick: () => handleSubActionClick({
|
|
75190
|
+
command: getCreateNewChatCommand({
|
|
75191
|
+
IDE,
|
|
75192
|
+
webviewType,
|
|
75193
|
+
multipleWebviewsEnabled
|
|
75194
|
+
})
|
|
75195
|
+
})
|
|
75196
|
+
}
|
|
75197
|
+
) })
|
|
75198
|
+
] }),
|
|
75095
75199
|
/* @__PURE__ */ jsx("div", { className: styles$2.subTabs, children: currentViewSubActions.map((subAction) => /* @__PURE__ */ jsx(Fragment$1, { children: subAction.confirmation ? /* @__PURE__ */ jsx(
|
|
75096
75200
|
ActionButtonWithConfirmation,
|
|
75097
75201
|
{
|
|
75098
75202
|
title: subAction.title,
|
|
75099
75203
|
Icon: subAction.Icon,
|
|
75100
|
-
|
|
75204
|
+
IDE,
|
|
75205
|
+
alwaysShowTitle: true,
|
|
75101
75206
|
tooltipExtra: subAction.tooltipExtra,
|
|
75102
75207
|
dialogTitle: subAction.confirmation.title,
|
|
75103
75208
|
dialogDescription: subAction.confirmation.description,
|
|
@@ -75109,10 +75214,10 @@ const TabsBar = ({ currentView, setView, IDE, onDownloadChatClick }) => {
|
|
|
75109
75214
|
{
|
|
75110
75215
|
Icon: subAction.Icon,
|
|
75111
75216
|
title: subAction.title,
|
|
75112
|
-
|
|
75217
|
+
IDE,
|
|
75218
|
+
alwaysShowTitle: true,
|
|
75113
75219
|
tooltipExtra: subAction.tooltipExtra,
|
|
75114
|
-
onClick: () => handleSubActionClick(subAction)
|
|
75115
|
-
prominent: true
|
|
75220
|
+
onClick: () => handleSubActionClick(subAction)
|
|
75116
75221
|
}
|
|
75117
75222
|
) }, subAction.command)) })
|
|
75118
75223
|
] }) });
|
|
@@ -75121,6 +75226,7 @@ const ActionButtonWithConfirmation = (props) => {
|
|
|
75121
75226
|
const {
|
|
75122
75227
|
title: title2,
|
|
75123
75228
|
Icon: Icon2,
|
|
75229
|
+
IDE,
|
|
75124
75230
|
prominent,
|
|
75125
75231
|
alwaysShowTitle,
|
|
75126
75232
|
tooltipExtra,
|
|
@@ -75139,6 +75245,7 @@ const ActionButtonWithConfirmation = (props) => {
|
|
|
75139
75245
|
alwaysShowTitle,
|
|
75140
75246
|
tooltipExtra,
|
|
75141
75247
|
prominent,
|
|
75248
|
+
IDE,
|
|
75142
75249
|
onClick: () => setState(true)
|
|
75143
75250
|
}
|
|
75144
75251
|
),
|
|
@@ -75165,8 +75272,9 @@ const ActionButtonWithConfirmation = (props) => {
|
|
|
75165
75272
|
] })
|
|
75166
75273
|
] });
|
|
75167
75274
|
};
|
|
75168
|
-
const TabButton = forwardRef(
|
|
75169
|
-
|
|
75275
|
+
const TabButton = forwardRef((props, ref2) => {
|
|
75276
|
+
const {
|
|
75277
|
+
IDE,
|
|
75170
75278
|
Icon: Icon2,
|
|
75171
75279
|
isActive,
|
|
75172
75280
|
onClick,
|
|
@@ -75175,7 +75283,8 @@ const TabButton = forwardRef(
|
|
|
75175
75283
|
tooltipExtra,
|
|
75176
75284
|
prominent,
|
|
75177
75285
|
"data-testid": dataTestId
|
|
75178
|
-
}
|
|
75286
|
+
} = props;
|
|
75287
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
75179
75288
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
75180
75289
|
"button",
|
|
75181
75290
|
{
|
|
@@ -75196,18 +75305,18 @@ const TabButton = forwardRef(
|
|
|
75196
75305
|
]
|
|
75197
75306
|
}
|
|
75198
75307
|
) }),
|
|
75199
|
-
/* @__PURE__ */ jsxs(TooltipContent, {
|
|
75308
|
+
/* @__PURE__ */ jsxs(TooltipContent, { portal: IDE === CodyIDE.Web, children: [
|
|
75200
75309
|
title2,
|
|
75201
75310
|
" ",
|
|
75202
75311
|
tooltipExtra
|
|
75203
75312
|
] })
|
|
75204
|
-
] })
|
|
75205
|
-
);
|
|
75313
|
+
] });
|
|
75314
|
+
});
|
|
75206
75315
|
TabButton.displayName = "TabButton";
|
|
75207
75316
|
function useTabs(input) {
|
|
75208
75317
|
const { IDE, onDownloadChatClick } = input;
|
|
75209
75318
|
const {
|
|
75210
|
-
config: {
|
|
75319
|
+
config: { multipleWebviewsEnabled }
|
|
75211
75320
|
} = useConfig();
|
|
75212
75321
|
return useMemo(
|
|
75213
75322
|
() => [
|
|
@@ -75215,24 +75324,6 @@ function useTabs(input) {
|
|
|
75215
75324
|
view: View.Chat,
|
|
75216
75325
|
title: "Chat",
|
|
75217
75326
|
Icon: MessagesSquare,
|
|
75218
|
-
subActions: [
|
|
75219
|
-
{
|
|
75220
|
-
title: "New Chat",
|
|
75221
|
-
alwaysShowTitle: true,
|
|
75222
|
-
tooltipExtra: /* @__PURE__ */ jsx(Fragment, { children: IDE === CodyIDE.VSCode && /* @__PURE__ */ jsx(Kbd, { macOS: "shift+opt+l", linuxAndWindows: "shift+alt+l" }) }),
|
|
75223
|
-
Icon: MessageSquarePlus,
|
|
75224
|
-
command: getCreateNewChatCommand({
|
|
75225
|
-
IDE,
|
|
75226
|
-
webviewType,
|
|
75227
|
-
multipleWebviewsEnabled
|
|
75228
|
-
})
|
|
75229
|
-
},
|
|
75230
|
-
multipleWebviewsEnabled ? {
|
|
75231
|
-
title: "Open in Editor",
|
|
75232
|
-
Icon: Columns2,
|
|
75233
|
-
command: "cody.chat.moveToEditor"
|
|
75234
|
-
} : null
|
|
75235
|
-
].filter(isDefined),
|
|
75236
75327
|
changesView: true
|
|
75237
75328
|
},
|
|
75238
75329
|
{
|
|
@@ -75241,13 +75332,13 @@ function useTabs(input) {
|
|
|
75241
75332
|
Icon: History,
|
|
75242
75333
|
subActions: [
|
|
75243
75334
|
{
|
|
75244
|
-
title: "Export
|
|
75335
|
+
title: "Export",
|
|
75245
75336
|
Icon: Download,
|
|
75246
75337
|
command: "cody.chat.history.export",
|
|
75247
75338
|
callback: onDownloadChatClick
|
|
75248
75339
|
},
|
|
75249
75340
|
{
|
|
75250
|
-
title: "
|
|
75341
|
+
title: "Delete all",
|
|
75251
75342
|
Icon: Trash2,
|
|
75252
75343
|
command: "cody.chat.history.clear",
|
|
75253
75344
|
// Show Cody Chat UI confirmation modal with this message only for
|
|
@@ -75286,7 +75377,7 @@ function useTabs(input) {
|
|
|
75286
75377
|
changesView: IDE !== CodyIDE.VSCode
|
|
75287
75378
|
} : null
|
|
75288
75379
|
].filter(isDefined),
|
|
75289
|
-
[IDE,
|
|
75380
|
+
[IDE, onDownloadChatClick, multipleWebviewsEnabled]
|
|
75290
75381
|
);
|
|
75291
75382
|
}
|
|
75292
75383
|
const CodyPanel = ({
|
|
@@ -75385,7 +75476,7 @@ const ErrorBanner = ({ errors, setErrors }) => /* @__PURE__ */ jsx("div", { clas
|
|
|
75385
75476
|
)
|
|
75386
75477
|
] }, i2)
|
|
75387
75478
|
)) });
|
|
75388
|
-
function getAppWrappers(vscodeAPI, telemetryRecorder,
|
|
75479
|
+
function getAppWrappers(vscodeAPI, telemetryRecorder, clientState, config, chatEnvironmentContext) {
|
|
75389
75480
|
return [
|
|
75390
75481
|
{
|
|
75391
75482
|
provider: TelemetryRecorderContext.Provider,
|
|
@@ -75395,10 +75486,6 @@ function getAppWrappers(vscodeAPI, telemetryRecorder, chatModelContext, clientSt
|
|
|
75395
75486
|
component: ExtensionAPIProviderFromVSCodeAPI,
|
|
75396
75487
|
props: { vscodeAPI }
|
|
75397
75488
|
},
|
|
75398
|
-
{
|
|
75399
|
-
provider: ChatModelContextProvider,
|
|
75400
|
-
value: chatModelContext
|
|
75401
|
-
},
|
|
75402
75489
|
{
|
|
75403
75490
|
provider: ClientStateContextProvider,
|
|
75404
75491
|
value: clientState
|
|
@@ -75723,9 +75810,6 @@ const CodyWebChat = ({
|
|
|
75723
75810
|
}
|
|
75724
75811
|
) }) });
|
|
75725
75812
|
};
|
|
75726
|
-
const CONTEXT_MENTIONS_SETTINGS = {
|
|
75727
|
-
resolutionMode: "remote"
|
|
75728
|
-
};
|
|
75729
75813
|
const CodyWebPanel = (props) => {
|
|
75730
75814
|
const { vscodeAPI, initialContext, className } = props;
|
|
75731
75815
|
const dispatchClientAction = useClientActionDispatcher();
|
|
@@ -75733,7 +75817,6 @@ const CodyWebPanel = (props) => {
|
|
|
75733
75817
|
const [isTranscriptError, setIsTranscriptError] = useState(false);
|
|
75734
75818
|
const [messageInProgress, setMessageInProgress] = useState(null);
|
|
75735
75819
|
const [transcript, setTranscript] = useState([]);
|
|
75736
|
-
const [chatModels, setChatModels] = useState();
|
|
75737
75820
|
const [config, setConfig] = useState(null);
|
|
75738
75821
|
const [view, setView] = useState();
|
|
75739
75822
|
const [userHistory, setUserHistory] = useState();
|
|
@@ -75765,9 +75848,6 @@ const CodyWebPanel = (props) => {
|
|
|
75765
75848
|
case "transcript-errors":
|
|
75766
75849
|
setIsTranscriptError(message2.isTranscriptError);
|
|
75767
75850
|
break;
|
|
75768
|
-
case "chatModels":
|
|
75769
|
-
setChatModels(message2.models);
|
|
75770
|
-
break;
|
|
75771
75851
|
case "config":
|
|
75772
75852
|
message2.config.webviewType = "sidebar";
|
|
75773
75853
|
message2.config.multipleWebviewsEnabled = false;
|
|
@@ -75783,26 +75863,6 @@ const CodyWebPanel = (props) => {
|
|
|
75783
75863
|
});
|
|
75784
75864
|
}, [vscodeAPI, dispatchClientAction]);
|
|
75785
75865
|
const telemetryRecorder = useMemo(() => createWebviewTelemetryRecorder(vscodeAPI), [vscodeAPI]);
|
|
75786
|
-
const onCurrentChatModelChange = useCallback(
|
|
75787
|
-
(selected) => {
|
|
75788
|
-
if (!chatModels || !setChatModels) {
|
|
75789
|
-
return;
|
|
75790
|
-
}
|
|
75791
|
-
vscodeAPI.postMessage({
|
|
75792
|
-
command: "chatModel",
|
|
75793
|
-
model: selected.id
|
|
75794
|
-
});
|
|
75795
|
-
},
|
|
75796
|
-
[chatModels, vscodeAPI]
|
|
75797
|
-
);
|
|
75798
|
-
const chatModelContext = useMemo(
|
|
75799
|
-
() => ({
|
|
75800
|
-
chatModels,
|
|
75801
|
-
onCurrentChatModelChange,
|
|
75802
|
-
serverSentModelsEnabled: config == null ? void 0 : config.configFeatures.serverSentModels
|
|
75803
|
-
}),
|
|
75804
|
-
[chatModels, onCurrentChatModelChange, config]
|
|
75805
|
-
);
|
|
75806
75866
|
const clientState = useMemo(() => {
|
|
75807
75867
|
const { repository, fileURL, isDirectory } = initialContext ?? {};
|
|
75808
75868
|
if (!repository) {
|
|
@@ -75863,10 +75923,17 @@ const CodyWebPanel = (props) => {
|
|
|
75863
75923
|
}, [initialContext]);
|
|
75864
75924
|
const envVars = useMemo(() => ({ clientType: CodyIDE.Web }), []);
|
|
75865
75925
|
const wrappers = useMemo(
|
|
75866
|
-
() => getAppWrappers(vscodeAPI, telemetryRecorder,
|
|
75867
|
-
[vscodeAPI, telemetryRecorder,
|
|
75926
|
+
() => getAppWrappers(vscodeAPI, telemetryRecorder, clientState, config, envVars),
|
|
75927
|
+
[vscodeAPI, telemetryRecorder, clientState, config, envVars]
|
|
75868
75928
|
);
|
|
75869
|
-
const
|
|
75929
|
+
const CONTEXT_MENTIONS_SETTINGS = useMemo(() => {
|
|
75930
|
+
const { repository } = initialContext ?? {};
|
|
75931
|
+
return {
|
|
75932
|
+
resolutionMode: "remote",
|
|
75933
|
+
remoteRepositoriesNames: (repository == null ? void 0 : repository.name) ? [repository.name] : []
|
|
75934
|
+
};
|
|
75935
|
+
}, [initialContext]);
|
|
75936
|
+
const isLoading = !config || !view || !userHistory;
|
|
75870
75937
|
return /* @__PURE__ */ jsx("div", { className, "data-cody-web-chat": true, children: !isLoading && /* @__PURE__ */ jsx(ChatEnvironmentContext.Provider, { value: envVars, children: /* @__PURE__ */ jsx(ChatMentionContext.Provider, { value: CONTEXT_MENTIONS_SETTINGS, children: /* @__PURE__ */ jsx(ComposedWrappers, { wrappers, children: /* @__PURE__ */ jsx(
|
|
75871
75938
|
CodyPanel,
|
|
75872
75939
|
{
|