@sourcegraph/cody-web 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -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, c as commonjsGlobal, r as require$$1, L as Ls, k as ke$1, a as ks, F as Fi$1, _ as _s, b as ds, e 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, f as ws, B as B$2, h as g$5, j as h$4, l as _i, S as Ss, m as Br, n as ln, o as bi$1, v as vn, s as xn, N as Nn, u as mn, z as li$1, A as n$1, D as ns, M as M$4, E as Ds, G as le$2, H as c$4, I as oe$1, O as z$1, P as yi$1, W as W$2, U as Ue$1, Q as I$2, T as Se$2, V as O$2, X as F$1, Y as Ni$1, Z as ee$1, $ as we$2, a0 as b$2, a1 as T$3, a2 as s$2, a3 as o$4, a4 as w$3, a5 as i$1, a6 as k$3, a7 as D$5, a8 as p$8, a9 as m$7, aa as S$4, ab as v$4, ac as P$2, ad as E$6, ae as Wi$1, af as L$3, ag as d$2, ah as a$3, ai as l$2, aj as f$2, ak as u$6, al as r$6, am as t$2, 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 displayPathBasename, ax as IGNORED_FILE_WARNING_LABEL, ay as LARGE_FILE_WARNING_LABEL, az as Ei$1, aA as xe$2, aB as V$2, aC as Es, aD as U$2, aE as e, aF as Ns, aG as an, aH as gs, aI as serializeContextItem, aJ as CONTEXT_ITEM_MENTION_NODE_TYPE, aK as contextItemMentionNodeDisplayText, C as ContextItemSource, aL as URI, aM as qr, aN as _$2, aO as TEMPLATE_INPUT_NODE_TYPE, aP as N$2, aQ as parseMentionQuery, aR as NO_SYMBOL_MATCHES_HELP_LABEL, aS as FILE_RANGE_TOOLTIP_LABEL, aT as Observable$1, aU as createExtensionAPI, aV as createMessageAPIForWebview, aW as debounce, aX as memoizeLastValue, aY as toSerializedPromptEditorValue, aZ as ri$1, a_ as isEqual, a$ as scanForMentionTriggerInUserTextInput, b0 as fs, b1 as Ts, b2 as ps, b3 as getMentionOperations, b4 as forceHydration, b5 as hydrateAfterPostMessage, b6 as isCodyProUser, b7 as FeatureFlag, b8 as webviewOpenURIForContextItem, b9 as upperFirst, ba as CodyIDE, bb as CodyTaskState, bc as isError, bd as RateLimitError, be as CODY_FEEDBACK_URL, bf as isDefined, bg as reformatBotMessageForChat, bh as isAbortErrorOrSocketHangUp, bi as ModelTag, bj as serializedPromptEditorStateFromChatMessage, bk as contextItemsFromPromptEditorValue, bl as filterContextItemsFromPromptEditorValue, bm as pluralize$1, bn as isCodyProModel, bo as isWaitlistModel, bp as ACCOUNT_USAGE_URL, bq as View, br as ACCOUNT_UPGRADE_URL, bs as CustomCommandType, bt as firstValueFrom, bu as getRelativeChatPeriod, bv as isMacOS, bw as firstResultFromOperation, bx as lodashExports, by as textContentFromSerializedLexicalNode, bz as FAST_CHAT_INPUT_TOKEN_BUDGET, bA as inputTextWithoutContextChipsFromPromptEditorState, bB as deserializeContextItem, bC as truncateTextStart, bD as CHAT_INPUT_TOKEN_BUDGET, bE as isDotCom, bF as browser, bG as isErrorLike, bH as setDisplayPathEnvInfo, bI as PromptString } from "./browser-xmS9GzfL.mjs";
5
+ import { g as getDefaultExportFromCjs, c as commonjsGlobal, r as require$$1, q as qe$1, _ as _s, a as ds, y as ys, x as xi$1, k as ke$1, L as Ls, b as ks, F as Fi$1, e as bs, i as ii$1, K as K$2, J as J$2, R as R$3, f as ws, B as B$2, h as g$5, j as h$4, l as _i, S as Ss, m as Br, n as ln, o as bi$1, v as vn, s as xn, N as Nn, u as mn, z as li$1, A as n$1, D as ns, M as M$4, E as Ds, G as le$2, H as c$4, I as oe$2, O as z$1, P as yi$1, W as W$2, U as Ue$1, Q as I$2, T as Se$2, V as O$2, X as F$1, Y as Ni$1, Z as ee$1, $ as we$2, a0 as b$2, a1 as T$3, a2 as s$2, a3 as o$4, a4 as w$3, a5 as i$1, a6 as k$3, a7 as D$5, a8 as p$8, a9 as m$7, aa as S$4, ab as v$4, ac as P$2, ad as E$6, ae as Wi$1, af as L$3, ag as d$2, ah as a$3, ai as l$2, aj as f$2, ak as u$6, al as r$6, am as t$2, 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 displayPathBasename, ax as IGNORED_FILE_WARNING_LABEL, ay as LARGE_FILE_WARNING_LABEL, az as Ei$1, aA as xe$2, aB as V$2, aC as Es, aD as U$2, aE as e, aF as Ns, aG as an, aH as gs, aI as serializeContextItem, aJ as CONTEXT_ITEM_MENTION_NODE_TYPE, aK as contextItemMentionNodeDisplayText, C as ContextItemSource, aL as URI, aM as qr, aN as _$2, aO as TEMPLATE_INPUT_NODE_TYPE, aP as N$2, aQ as parseMentionQuery, aR as NO_SYMBOL_MATCHES_HELP_LABEL, aS as FILE_RANGE_TOOLTIP_LABEL, aT as Observable$1, aU as createExtensionAPI, aV as createMessageAPIForWebview, aW as debounce, aX as memoizeLastValue, aY as toSerializedPromptEditorValue, aZ as ri$1, a_ as isEqual, a$ as scanForMentionTriggerInUserTextInput, b0 as fs, b1 as Ts, b2 as ps, b3 as getMentionOperations, b4 as forceHydration, b5 as hydrateAfterPostMessage, b6 as isCodyProUser, b7 as FeatureFlag, b8 as webviewOpenURIForContextItem, b9 as upperFirst, ba as CodyIDE, bb as CodyTaskState, bc as isError, bd as RateLimitError, be as CODY_FEEDBACK_URL, bf as isDefined, bg as reformatBotMessageForChat, bh as isAbortErrorOrSocketHangUp, bi as ModelTag, bj as serializedPromptEditorStateFromChatMessage, bk as contextItemsFromPromptEditorValue, bl as filterContextItemsFromPromptEditorValue, bm as pluralize$1, bn as isCodyProModel, bo as isWaitlistModel, bp as ACCOUNT_USAGE_URL, bq as View, br as ACCOUNT_UPGRADE_URL, bs as CustomCommandType, bt as firstValueFrom, bu as getRelativeChatPeriod, bv as isMacOS, bw as firstResultFromOperation, bx as lodashExports, by as textContentFromSerializedLexicalNode, bz as FAST_CHAT_INPUT_TOKEN_BUDGET, bA as inputTextWithoutContextChipsFromPromptEditorState, bB as deserializeContextItem, bC as truncateTextStart, bD as CHAT_INPUT_TOKEN_BUDGET, bE as isDotCom, bF as browser, bG as isErrorLike, bH as setDisplayPathEnvInfo, bI as PromptString } from "./browser-DYM0xYW7.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: {} };
@@ -6592,6 +6592,97 @@ function requireBlowfish() {
6592
6592
  });
6593
6593
  })(cryptoJs);
6594
6594
  var cryptoJsExports = cryptoJs.exports;
6595
+ function m$6(e2) {
6596
+ return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
6597
+ }
6598
+ m$6(function(e2) {
6599
+ const t2 = new URLSearchParams();
6600
+ t2.append("code", e2);
6601
+ for (let e3 = 1; e3 < arguments.length; e3++) t2.append("v", arguments[e3]);
6602
+ throw Error(`Minified Lexical error #${e2}; visit https://lexical.dev/docs/error?${t2} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
6603
+ });
6604
+ const x$5 = /* @__PURE__ */ new Map();
6605
+ function w$2(e2) {
6606
+ const t2 = {}, n2 = e2.split(";");
6607
+ for (const e3 of n2) if ("" !== e3) {
6608
+ const [n3, l2] = e3.split(/:([^]+)/);
6609
+ n3 && l2 && (t2[n3.trim()] = l2.trim());
6610
+ }
6611
+ return t2;
6612
+ }
6613
+ function E$5(e2, n2) {
6614
+ const l2 = e2.getStartEndPoints();
6615
+ if (n2.isSelected(e2) && !n2.isSegmented() && !n2.isToken() && null !== l2) {
6616
+ const [o2, r2] = l2, s2 = e2.isBackward(), i2 = o2.getNode(), c2 = r2.getNode(), f2 = n2.is(i2), u2 = n2.is(c2);
6617
+ if (f2 || u2) {
6618
+ const [l3, o3] = xi$1(e2), r3 = i2.is(c2), f3 = n2.is(s2 ? c2 : i2), u3 = n2.is(s2 ? i2 : c2);
6619
+ let g2, a2 = 0;
6620
+ if (r3) a2 = l3 > o3 ? o3 : l3, g2 = l3 > o3 ? l3 : o3;
6621
+ else if (f3) {
6622
+ a2 = s2 ? o3 : l3, g2 = void 0;
6623
+ } else if (u3) {
6624
+ a2 = 0, g2 = s2 ? l3 : o3;
6625
+ }
6626
+ return n2.__text = n2.__text.slice(a2, g2), n2;
6627
+ }
6628
+ }
6629
+ return n2;
6630
+ }
6631
+ function I$1(e2) {
6632
+ const t2 = e2.getStyle(), n2 = w$2(t2);
6633
+ x$5.set(t2, n2);
6634
+ }
6635
+ function A$2(e2, t2) {
6636
+ const l2 = qe$1(e2.focus, t2);
6637
+ return _s(l2) && !l2.isIsolated() || ds(l2) && !l2.isInline() && !l2.canBeEmpty();
6638
+ }
6639
+ function L$2(e2, t2, n2, l2) {
6640
+ e2.modify(t2 ? "extend" : "move", n2, l2);
6641
+ }
6642
+ function D$4(e2) {
6643
+ const t2 = e2.anchor.getNode();
6644
+ return "rtl" === (ys(t2) ? t2 : t2.getParentOrThrow()).getDirection();
6645
+ }
6646
+ function M$3(e2, t2, n2) {
6647
+ const l2 = D$4(e2);
6648
+ L$2(e2, t2, n2 ? !l2 : l2, "character");
6649
+ }
6650
+ function g$4(e2) {
6651
+ return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
6652
+ }
6653
+ var p$7 = g$4(function(e2) {
6654
+ const t2 = new URLSearchParams();
6655
+ t2.append("code", e2);
6656
+ for (let e3 = 1; e3 < arguments.length; e3++) t2.append("v", arguments[e3]);
6657
+ throw Error(`Minified Lexical error #${e2}; visit https://lexical.dev/docs/error?${t2} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
6658
+ });
6659
+ const h$3 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement, m$5 = h$3 && "documentMode" in document ? document.documentMode : null;
6660
+ !(!h$3 || !("InputEvent" in window) || m$5) && "getTargetRanges" in new window.InputEvent("input");
6661
+ function b$1(...e2) {
6662
+ return () => {
6663
+ for (let t2 = e2.length - 1; t2 >= 0; t2--) e2[t2]();
6664
+ e2.length = 0;
6665
+ };
6666
+ }
6667
+ function J$1(e2) {
6668
+ const t2 = Q$2(e2, (e3) => ds(e3) && !e3.isInline());
6669
+ return ds(t2) || p$7(4, e2.__key), t2;
6670
+ }
6671
+ const Q$2 = (e2, t2) => {
6672
+ let n2 = e2;
6673
+ for (; n2 !== ke$1() && null != n2; ) {
6674
+ if (t2(n2)) return n2;
6675
+ n2 = n2.getParent();
6676
+ }
6677
+ return null;
6678
+ };
6679
+ function te$1(e2, t2) {
6680
+ return null !== e2 && Object.getPrototypeOf(e2).constructor.name === t2.name;
6681
+ }
6682
+ function oe$1(e2, t2) {
6683
+ const n2 = e2.getFirstChild();
6684
+ null !== n2 ? n2.insertBefore(t2) : e2.append(t2);
6685
+ }
6595
6686
  function r$5(e2) {
6596
6687
  var t2, f2, n2 = "";
6597
6688
  if ("string" == typeof e2 || "number" == typeof e2) n2 += e2;
@@ -6624,8 +6715,8 @@ function u$5() {
6624
6715
  const e2 = useContext(l$1);
6625
6716
  return null == e2 && t$1(8), e2;
6626
6717
  }
6627
- const s$1 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement, m$6 = s$1 ? useLayoutEffect : useEffect, u$4 = { tag: "history-merge" };
6628
- function p$7({ initialConfig: a2, children: c2 }) {
6718
+ const s$1 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement, m$4 = s$1 ? useLayoutEffect : useEffect, u$4 = { tag: "history-merge" };
6719
+ function p$6({ initialConfig: a2, children: c2 }) {
6629
6720
  const p2 = useMemo(() => {
6630
6721
  const { theme: t2, namespace: c3, nodes: l2, onError: d2, editorState: m2, html: p3 } = a2, f2 = o$3(null, t2), E2 = Ls({ editable: a2.editable, html: p3, namespace: c3, nodes: l2, onError: (e2) => d2(e2, E2), theme: t2 });
6631
6722
  return function(e2, t3) {
@@ -6655,7 +6746,7 @@ function p$7({ initialConfig: a2, children: c2 }) {
6655
6746
  }
6656
6747
  }(E2, m2), [E2, f2];
6657
6748
  }, []);
6658
- return m$6(() => {
6749
+ return m$4(() => {
6659
6750
  const e2 = a2.editable, [t2] = p2;
6660
6751
  t2.setEditable(void 0 === e2 || e2);
6661
6752
  }, []), jsx(l$1.Provider, { value: p2, children: c2 });
@@ -6687,7 +6778,7 @@ function c$3(o2) {
6687
6778
  }
6688
6779
  return true;
6689
6780
  }
6690
- function g$4(t2) {
6781
+ function g$3(t2) {
6691
6782
  return () => c$3(t2);
6692
6783
  }
6693
6784
  function d$1(t2) {
@@ -6699,93 +6790,6 @@ d$1(function(t2) {
6699
6790
  for (let t3 = 1; t3 < arguments.length; t3++) e2.append("v", arguments[t3]);
6700
6791
  throw Error(`Minified Lexical error #${t2}; visit https://lexical.dev/docs/error?${e2} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
6701
6792
  });
6702
- function m$5(e2) {
6703
- return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
6704
- }
6705
- m$5(function(e2) {
6706
- const t2 = new URLSearchParams();
6707
- t2.append("code", e2);
6708
- for (let e3 = 1; e3 < arguments.length; e3++) t2.append("v", arguments[e3]);
6709
- throw Error(`Minified Lexical error #${e2}; visit https://lexical.dev/docs/error?${t2} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
6710
- });
6711
- const x$5 = /* @__PURE__ */ new Map();
6712
- function w$2(e2) {
6713
- const t2 = {}, n2 = e2.split(";");
6714
- for (const e3 of n2) if ("" !== e3) {
6715
- const [n3, l2] = e3.split(/:([^]+)/);
6716
- n3 && l2 && (t2[n3.trim()] = l2.trim());
6717
- }
6718
- return t2;
6719
- }
6720
- function E$5(e2, n2) {
6721
- const l2 = e2.getStartEndPoints();
6722
- if (n2.isSelected(e2) && !n2.isSegmented() && !n2.isToken() && null !== l2) {
6723
- const [o2, r2] = l2, s2 = e2.isBackward(), i2 = o2.getNode(), c2 = r2.getNode(), f2 = n2.is(i2), u2 = n2.is(c2);
6724
- if (f2 || u2) {
6725
- const [l3, o3] = xi$1(e2), r3 = i2.is(c2), f3 = n2.is(s2 ? c2 : i2), u3 = n2.is(s2 ? i2 : c2);
6726
- let g2, a2 = 0;
6727
- if (r3) a2 = l3 > o3 ? o3 : l3, g2 = l3 > o3 ? l3 : o3;
6728
- else if (f3) {
6729
- a2 = s2 ? o3 : l3, g2 = void 0;
6730
- } else if (u3) {
6731
- a2 = 0, g2 = s2 ? l3 : o3;
6732
- }
6733
- return n2.__text = n2.__text.slice(a2, g2), n2;
6734
- }
6735
- }
6736
- return n2;
6737
- }
6738
- function I$1(e2) {
6739
- const t2 = e2.getStyle(), n2 = w$2(t2);
6740
- x$5.set(t2, n2);
6741
- }
6742
- function A$2(e2, t2) {
6743
- const l2 = qe$1(e2.focus, t2);
6744
- return _s(l2) && !l2.isIsolated() || ds(l2) && !l2.isInline() && !l2.canBeEmpty();
6745
- }
6746
- function L$2(e2, t2, n2, l2) {
6747
- e2.modify(t2 ? "extend" : "move", n2, l2);
6748
- }
6749
- function D$4(e2) {
6750
- const t2 = e2.anchor.getNode();
6751
- return "rtl" === (ys(t2) ? t2 : t2.getParentOrThrow()).getDirection();
6752
- }
6753
- function M$3(e2, t2, n2) {
6754
- const l2 = D$4(e2);
6755
- L$2(e2, t2, n2 ? !l2 : l2, "character");
6756
- }
6757
- function g$3(e2) {
6758
- return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
6759
- }
6760
- var p$6 = g$3(function(e2) {
6761
- const t2 = new URLSearchParams();
6762
- t2.append("code", e2);
6763
- for (let e3 = 1; e3 < arguments.length; e3++) t2.append("v", arguments[e3]);
6764
- throw Error(`Minified Lexical error #${e2}; visit https://lexical.dev/docs/error?${t2} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
6765
- });
6766
- const h$3 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement, m$4 = h$3 && "documentMode" in document ? document.documentMode : null;
6767
- !(!h$3 || !("InputEvent" in window) || m$4) && "getTargetRanges" in new window.InputEvent("input");
6768
- function b$1(...e2) {
6769
- return () => {
6770
- for (let t2 = e2.length - 1; t2 >= 0; t2--) e2[t2]();
6771
- e2.length = 0;
6772
- };
6773
- }
6774
- function J$1(e2) {
6775
- const t2 = Q$2(e2, (e3) => ds(e3) && !e3.isInline());
6776
- return ds(t2) || p$6(4, e2.__key), t2;
6777
- }
6778
- const Q$2 = (e2, t2) => {
6779
- let n2 = e2;
6780
- for (; n2 !== ke$1() && null != n2; ) {
6781
- if (t2(n2)) return n2;
6782
- n2 = n2.getParent();
6783
- }
6784
- return null;
6785
- };
6786
- function te$1(e2, t2) {
6787
- return null !== e2 && Object.getPrototypeOf(e2).constructor.name === t2.name;
6788
- }
6789
6793
  const m$3 = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement ? useLayoutEffect : useEffect;
6790
6794
  function f$1({ editor: e2, ariaActiveDescendant: t2, ariaAutoComplete: i2, ariaControls: a2, ariaDescribedBy: d2, ariaExpanded: c2, ariaLabel: s2, ariaLabelledBy: u2, ariaMultiline: f2, ariaOwns: b2, ariaRequired: p2, autoCapitalize: x2, className: E2, id: v2, role: w2 = "textbox", spellCheck: y2 = true, style: C2, tabIndex: h2, "data-testid": L2, ...g2 }, D2) {
6791
6795
  const [R2, k2] = useState(e2.isEditable()), q = useCallback((t3) => {
@@ -6803,7 +6807,7 @@ function f$1({ editor: e2, ariaActiveDescendant: t2, ariaAutoComplete: i2, ariaC
6803
6807
  }
6804
6808
  const b = forwardRef(f$1);
6805
6809
  function p$5(e2) {
6806
- return e2.getEditorState().read(g$4(e2.isComposing()));
6810
+ return e2.getEditorState().read(g$3(e2.isComposing()));
6807
6811
  }
6808
6812
  const x$4 = forwardRef(E$4);
6809
6813
  function E$4(t2, i2) {
@@ -14140,7 +14144,7 @@ function Tt(o2) {
14140
14144
  }(t2, o2), true), ws), o2.registerCommand(c$4, (e2) => {
14141
14145
  const [, n2, r2] = Nt(e2);
14142
14146
  if (n2.length > 0 && !r2) return o2.dispatchCommand(gt, n2), true;
14143
- if (oe$1(e2.target)) return false;
14147
+ if (oe$2(e2.target)) return false;
14144
14148
  return null !== Fi$1() && (function(e3, n3) {
14145
14149
  e3.preventDefault(), n3.update(() => {
14146
14150
  const r3 = Fi$1(), o3 = te$1(e3, InputEvent) || te$1(e3, KeyboardEvent) ? null : e3.clipboardData;
@@ -14151,7 +14155,7 @@ function Tt(o2) {
14151
14155
  }
14152
14156
  const g = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement ? useLayoutEffect : useEffect;
14153
14157
  function E$1(t2) {
14154
- return t2.getEditorState().read(g$4(t2.isComposing()));
14158
+ return t2.getEditorState().read(g$3(t2.isComposing()));
14155
14159
  }
14156
14160
  function h({ contentEditable: e2, placeholder: r2 = null, ErrorBoundary: n2 }) {
14157
14161
  const [E2] = u$5(), h2 = function(t2, e3) {
@@ -14196,7 +14200,7 @@ const editor$2 = "_editor_s4gjm_1";
14196
14200
  const contentEditable = "_content-editable_s4gjm_6";
14197
14201
  const placeholder = "_placeholder_s4gjm_14";
14198
14202
  const themeParagraph = "_theme-paragraph_s4gjm_29";
14199
- const styles$y = {
14203
+ const styles$A = {
14200
14204
  editor: editor$2,
14201
14205
  contentEditable,
14202
14206
  placeholder,
@@ -14384,6 +14388,19 @@ const BookText = createLucideIcon("BookText", [
14384
14388
  ["path", { d: "M8 7h6", key: "1f0q6e" }],
14385
14389
  ["path", { d: "M8 11h8", key: "vwpz6n" }]
14386
14390
  ]);
14391
+ /**
14392
+ * @license lucide-react v0.378.0 - ISC
14393
+ *
14394
+ * This source code is licensed under the ISC license.
14395
+ * See the LICENSE file in the root directory of this source tree.
14396
+ */
14397
+ const BookUp2 = createLucideIcon("BookUp2", [
14398
+ ["path", { d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2", key: "1lorq7" }],
14399
+ ["path", { d: "M18 2h2v20H6.5a2.5 2.5 0 0 1 0-5H20", key: "1nfm9i" }],
14400
+ ["path", { d: "M12 13V7", key: "h0r20n" }],
14401
+ ["path", { d: "m9 10 3-3 3 3", key: "11gsxs" }],
14402
+ ["path", { d: "m9 5 3-3 3 3", key: "l8vdw6" }]
14403
+ ]);
14387
14404
  /**
14388
14405
  * @license lucide-react v0.378.0 - ISC
14389
14406
  *
@@ -14606,6 +14623,23 @@ const File = createLucideIcon("File", [
14606
14623
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
14607
14624
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
14608
14625
  ]);
14626
+ /**
14627
+ * @license lucide-react v0.378.0 - ISC
14628
+ *
14629
+ * This source code is licensed under the ISC license.
14630
+ * See the LICENSE file in the root directory of this source tree.
14631
+ */
14632
+ const FlaskConical = createLucideIcon("FlaskConical", [
14633
+ [
14634
+ "path",
14635
+ {
14636
+ d: "M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",
14637
+ key: "pzvekw"
14638
+ }
14639
+ ],
14640
+ ["path", { d: "M8.5 2h7", key: "csnxdl" }],
14641
+ ["path", { d: "M7 16h10", key: "wp8him" }]
14642
+ ]);
14609
14643
  /**
14610
14644
  * @license lucide-react v0.378.0 - ISC
14611
14645
  *
@@ -14962,7 +14996,7 @@ const title$1 = "_title_1nc1q_5";
14962
14996
  const description = "_description_1nc1q_5";
14963
14997
  const warning = "_warning_1nc1q_5";
14964
14998
  const row$1 = "_row_1nc1q_11";
14965
- const styles$x = {
14999
+ const styles$z = {
14966
15000
  title: title$1,
14967
15001
  description,
14968
15002
  warning,
@@ -15016,17 +15050,17 @@ const MentionMenuContextItemContent = ({ query, item: item2 }) => {
15016
15050
  warning2 = "";
15017
15051
  }
15018
15052
  return /* @__PURE__ */ jsxs(Fragment, { children: [
15019
- /* @__PURE__ */ jsxs("div", { className: styles$x.row, children: [
15053
+ /* @__PURE__ */ jsxs("div", { className: styles$z.row, children: [
15020
15054
  icon2 && /* @__PURE__ */ jsx("i", { className: `codicon codicon-${icon2}`, title: isSymbol ? item2.kind : "" }),
15021
- /* @__PURE__ */ jsx("span", { className: clsx$1(styles$x.title, warning2 && styles$x.titleWithWarning), title: title2, children: displayName }),
15022
- description2 && /* @__PURE__ */ jsx("span", { className: styles$x.description, title: description2, children: description2 })
15055
+ /* @__PURE__ */ jsx("span", { className: clsx$1(styles$z.title, warning2 && styles$z.titleWithWarning), title: title2, children: displayName }),
15056
+ description2 && /* @__PURE__ */ jsx("span", { className: styles$z.description, title: description2, children: description2 })
15023
15057
  ] }),
15024
- warning2 && /* @__PURE__ */ jsx("span", { className: styles$x.warning, children: warning2 })
15058
+ warning2 && /* @__PURE__ */ jsx("span", { className: styles$z.warning, children: warning2 })
15025
15059
  ] });
15026
15060
  };
15027
15061
  const MentionMenuProviderItemContent = ({ provider }) => {
15028
15062
  const Icon2 = iconForProvider[provider.id] ?? Database;
15029
- return /* @__PURE__ */ jsxs("div", { className: styles$x.row, title: provider.id, children: [
15063
+ return /* @__PURE__ */ jsxs("div", { className: styles$z.row, title: provider.id, children: [
15030
15064
  /* @__PURE__ */ jsx(Icon2, { size: 16, strokeWidth: 1.75 }),
15031
15065
  provider.title ?? provider.id,
15032
15066
  /* @__PURE__ */ jsx(ArrowRight, { size: 16, strokeWidth: 1.25, style: { opacity: "0.5" } })
@@ -15062,7 +15096,7 @@ const contextItemMentionNode = "_context-item-mention-node_1eamp_1";
15062
15096
  const icon$1 = "_icon_1eamp_14";
15063
15097
  const contextItemMentionChipNodeFocused = "_context-item-mention-chip-node--focused_1eamp_28";
15064
15098
  const isTooLargeOrIgnored = "_is-too-large-or-ignored_1eamp_33";
15065
- const styles$w = {
15099
+ const styles$y = {
15066
15100
  contextItemMentionNode,
15067
15101
  icon: icon$1,
15068
15102
  contextItemMentionChipNodeFocused,
@@ -15309,7 +15343,7 @@ const MentionComponent = ({ nodeKey, node: node2, tooltip, icon: Icon2, classNam
15309
15343
  tooltip && /* @__PURE__ */ jsx(TooltipContent2, { children: tooltip })
15310
15344
  ] });
15311
15345
  };
15312
- const MENTION_CLASS_NAME = styles$w.contextItemMentionNode;
15346
+ const MENTION_CLASS_NAME = styles$y.contextItemMentionNode;
15313
15347
  function convertContextItemMentionElement(domNode) {
15314
15348
  const data = domNode.getAttribute(DOM_DATA_ATTR);
15315
15349
  if (data !== null) {
@@ -15413,8 +15447,8 @@ class ContextItemMentionNode extends gs {
15413
15447
  className: `${MENTION_NODE_CLASS_NAME} ${extraClassNamesForContextItem(
15414
15448
  this.contextItem
15415
15449
  )}`,
15416
- focusedClassName: styles$w.contextItemMentionChipNodeFocused,
15417
- iconClassName: styles$w.icon
15450
+ focusedClassName: styles$y.contextItemMentionChipNodeFocused,
15451
+ iconClassName: styles$y.icon
15418
15452
  }
15419
15453
  );
15420
15454
  }
@@ -15433,7 +15467,7 @@ function $createContextItemMentionNode(contextItem2, { isFromInitialContext } =
15433
15467
  function extraClassNamesForContextItem(contextItem2) {
15434
15468
  const classNames2 = [];
15435
15469
  if (contextItem2.isTooLarge || contextItem2.isIgnored) {
15436
- classNames2.push(styles$w.isTooLargeOrIgnored);
15470
+ classNames2.push(styles$y.isTooLargeOrIgnored);
15437
15471
  }
15438
15472
  return classNames2.join(" ");
15439
15473
  }
@@ -15504,7 +15538,7 @@ const TemplateInputComponent = ({ editor: editor2, nodeKey, node: node2, classNa
15504
15538
  };
15505
15539
  const templateInputNode = "_template-input-node_14yoh_1";
15506
15540
  const templateInputNodeFocused = "_template-input-node--focused_14yoh_16";
15507
- const styles$v = {
15541
+ const styles$x = {
15508
15542
  templateInputNode,
15509
15543
  templateInputNodeFocused
15510
15544
  };
@@ -15537,8 +15571,8 @@ class TemplateInputNode extends gs {
15537
15571
  editor: editor2,
15538
15572
  nodeKey: this.getKey(),
15539
15573
  node: this,
15540
- className: `${styles$v.templateInputNode}`,
15541
- focusedClassName: `${styles$v.templateInputNodeFocused}`
15574
+ className: `${styles$x.templateInputNode}`,
15575
+ focusedClassName: `${styles$x.templateInputNodeFocused}`
15542
15576
  }
15543
15577
  );
15544
15578
  }
@@ -15744,7 +15778,7 @@ function L({ options: e2, onQueryChange: n2, onSelectOption: o2, onOpen: r2, onC
15744
15778
  }
15745
15779
  const popoverDimensions = "_popover-dimensions_1uf3m_1";
15746
15780
  const popover$1 = "_popover_1uf3m_1";
15747
- const styles$u = {
15781
+ const styles$w = {
15748
15782
  popoverDimensions,
15749
15783
  popover: popover$1
15750
15784
  };
@@ -15762,7 +15796,7 @@ const container$2 = "_container_fr158_1";
15762
15796
  const item$2 = "_item_fr158_8";
15763
15797
  const contextItem$1 = "_context-item_fr158_9";
15764
15798
  const experimental = "_experimental_fr158_17";
15765
- const styles$t = {
15799
+ const styles$v = {
15766
15800
  container: container$2,
15767
15801
  item: item$2,
15768
15802
  contextItem: contextItem$1,
@@ -15917,7 +15951,7 @@ const MentionMenu = ({
15917
15951
  {
15918
15952
  value: commandRowValue$1(provider),
15919
15953
  onSelect: onProviderSelect,
15920
- className: clsx$1(styles$t.item, COMMAND_ROW_CLASS_NAME),
15954
+ className: clsx$1(styles$v.item, COMMAND_ROW_CLASS_NAME),
15921
15955
  children: /* @__PURE__ */ jsx(MentionMenuProviderItemContent, { provider })
15922
15956
  },
15923
15957
  commandRowValue$1(provider)
@@ -15930,7 +15964,7 @@ const MentionMenu = ({
15930
15964
  shouldFilter: false,
15931
15965
  value: effectiveValueRow ? commandRowValue$1(effectiveValueRow) : void 0,
15932
15966
  onValueChange: setValue,
15933
- className: styles$t.container,
15967
+ className: styles$v.container,
15934
15968
  label: "@-mention context",
15935
15969
  ref: ref2,
15936
15970
  "data-testid": "mention-menu",
@@ -15942,7 +15976,7 @@ const MentionMenu = ({
15942
15976
  value: commandRowValue$1(item2),
15943
15977
  disabled: item2.isIgnored,
15944
15978
  onSelect: onCommandSelect,
15945
- className: clsx$1(styles$t.item, styles$t.contextItem, COMMAND_ROW_CLASS_NAME),
15979
+ className: clsx$1(styles$v.item, styles$v.contextItem, COMMAND_ROW_CLASS_NAME),
15946
15980
  children: /* @__PURE__ */ jsx(MentionMenuContextItemContent, { query: mentionQuery, item: item2 })
15947
15981
  },
15948
15982
  commandRowValue$1(item2)
@@ -16009,7 +16043,7 @@ function getItemsHeading(parentItem, mentionQuery) {
16009
16043
  {
16010
16044
  className: clsx$1(
16011
16045
  "tw-text-xs tw-rounded tw-px-2 tw-text-foreground",
16012
- styles$t.experimental
16046
+ styles$v.experimental
16013
16047
  ),
16014
16048
  children: "Experimental"
16015
16049
  }
@@ -16025,10 +16059,10 @@ const ChatMentionContext = createContext({
16025
16059
  resolutionMode: "local"
16026
16060
  });
16027
16061
  const context = createContext(void 0);
16028
- const ExtensionAPIProviderFromVSCodeAPI = ({ vscodeAPI, staticInitialContext, children: children2 }) => {
16062
+ const ExtensionAPIProviderFromVSCodeAPI = ({ vscodeAPI, staticDefaultContext, children: children2 }) => {
16029
16063
  const extensionAPI = useMemo(
16030
- () => createExtensionAPI(createMessageAPIForWebview(vscodeAPI), staticInitialContext),
16031
- [vscodeAPI, staticInitialContext]
16064
+ () => createExtensionAPI(createMessageAPIForWebview(vscodeAPI), staticDefaultContext),
16065
+ [vscodeAPI, staticDefaultContext]
16032
16066
  );
16033
16067
  return /* @__PURE__ */ jsx(context.Provider, { value: extensionAPI, children: children2 });
16034
16068
  };
@@ -16096,11 +16130,14 @@ function useObservable(observable2, options) {
16096
16130
  }, [observable2, options == null ? void 0 : options.preserveValueKey]);
16097
16131
  return state;
16098
16132
  }
16099
- function useInitialContextForChat() {
16100
- const initialContext = useExtensionAPI().initialContext;
16101
- return useObservable(useMemo(() => initialContext(), [initialContext])).value ?? EMPTY$1;
16133
+ function useDefaultContextForChat() {
16134
+ const defaultContext = useExtensionAPI().defaultContext;
16135
+ return useObservable(useMemo(() => defaultContext(), [defaultContext])).value ?? EMPTY$1;
16102
16136
  }
16103
- const EMPTY$1 = [];
16137
+ const EMPTY$1 = {
16138
+ initialContext: [],
16139
+ corpusContext: []
16140
+ };
16104
16141
  function useMentionMenuParams() {
16105
16142
  var _a;
16106
16143
  const mentionSettings = useContext(ChatMentionContext);
@@ -16140,35 +16177,31 @@ function useMentionMenuParams() {
16140
16177
  );
16141
16178
  }
16142
16179
  function useMentionMenuData(params, { remainingTokenBudget, limit: limit2 }) {
16143
- var _a, _b;
16180
+ var _a, _b, _c;
16144
16181
  const { value, error: error2 } = useCallMentionMenuData(params);
16145
16182
  const queryLower = ((_b = (_a = params.query) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.trim()) ?? null;
16146
16183
  const isInProvider = !!params.parentItem;
16147
- const initialContext = useInitialContextForChat();
16184
+ const defaultContext = useDefaultContextForChat();
16185
+ const initialContext = [...defaultContext.initialContext, ...defaultContext.corpusContext];
16148
16186
  const filteredInitialContextItems = isInProvider ? [] : initialContext.filter(
16149
16187
  (item2) => {
16150
16188
  var _a2, _b2;
16151
16189
  return queryLower ? ((_a2 = item2.title) == null ? void 0 : _a2.toLowerCase().includes(queryLower)) || item2.uri.toString().toLowerCase().includes(queryLower) || ((_b2 = item2.description) == null ? void 0 : _b2.toString().toLowerCase().includes(queryLower)) : true;
16152
16190
  }
16153
16191
  );
16192
+ const additionalItems = ((_c = value == null ? void 0 : value.items) == null ? void 0 : _c.filter(
16193
+ // If an item is shown as initial context, don't show it twice.
16194
+ (item2) => !filteredInitialContextItems.some(
16195
+ (initialItem) => initialItem.uri.toString() === item2.uri.toString() && initialItem.type === item2.type
16196
+ )
16197
+ ).slice(0, limit2).map((item2) => prepareUserContextItem(item2, remainingTokenBudget))) ?? [];
16154
16198
  return useMemo(
16155
- () => {
16156
- var _a2;
16157
- return {
16158
- providers: (value == null ? void 0 : value.providers) ?? [],
16159
- items: [
16160
- ...filteredInitialContextItems,
16161
- ...((_a2 = value == null ? void 0 : value.items) == null ? void 0 : _a2.filter(
16162
- // If an item is shown as initial context, don't show it twice.
16163
- (item2) => !filteredInitialContextItems.some(
16164
- (initialItem) => initialItem.uri.toString() === item2.uri.toString() && initialItem.type === item2.type
16165
- )
16166
- ).slice(0, limit2).map((item2) => prepareUserContextItem(item2, remainingTokenBudget))) ?? []
16167
- ],
16168
- error: (value == null ? void 0 : value.error) ?? (error2 ? `Unexpected error: ${error2}` : void 0)
16169
- };
16170
- },
16171
- [value, error2, filteredInitialContextItems, limit2, remainingTokenBudget]
16199
+ () => ({
16200
+ providers: (value == null ? void 0 : value.providers) ?? [],
16201
+ items: [...filteredInitialContextItems, ...additionalItems],
16202
+ error: (value == null ? void 0 : value.error) ?? (error2 ? `Unexpected error: ${error2}` : void 0)
16203
+ }),
16204
+ [value, error2, filteredInitialContextItems, additionalItems]
16172
16205
  );
16173
16206
  }
16174
16207
  function prepareUserContextItem(item2, remainingTokenBudget) {
@@ -16340,7 +16373,7 @@ const MentionsPlugin = memo(
16340
16373
  // max height of the visible menu. This ensures that the menu does not
16341
16374
  // flip orientation as the user is typing if it suddenly has less
16342
16375
  // results. It also makes the positioning less glitchy.
16343
- /* @__PURE__ */ jsx("div", { "data-at-mention-menu": "", className: clsx$1(styles$u.popoverDimensions), children: /* @__PURE__ */ jsx("div", { className: styles$u.popover, children: /* @__PURE__ */ jsx(
16376
+ /* @__PURE__ */ jsx("div", { "data-at-mention-menu": "", className: clsx$1(styles$w.popoverDimensions), children: /* @__PURE__ */ jsx("div", { className: styles$w.popover, children: /* @__PURE__ */ jsx(
16344
16377
  MentionMenu,
16345
16378
  {
16346
16379
  params,
@@ -16469,7 +16502,7 @@ const BaseEditor = ({
16469
16502
  const initialConfig = useMemo(
16470
16503
  () => ({
16471
16504
  namespace: "BaseEditor",
16472
- theme: { paragraph: styles$y.themeParagraph },
16505
+ theme: { paragraph: styles$A.themeParagraph },
16473
16506
  onError: (error2) => console.error(error2),
16474
16507
  editorState: initialEditorState !== null ? JSON.stringify(initialEditorState) : void 0,
16475
16508
  editable: !disabled2,
@@ -16477,18 +16510,18 @@ const BaseEditor = ({
16477
16510
  }),
16478
16511
  []
16479
16512
  );
16480
- return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("div", { className: styles$y.editor, children: /* @__PURE__ */ jsxs(p$7, { initialConfig, children: [
16513
+ return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("div", { className: styles$A.editor, children: /* @__PURE__ */ jsxs(p$6, { initialConfig, children: [
16481
16514
  /* @__PURE__ */ jsx(
16482
16515
  h,
16483
16516
  {
16484
16517
  contentEditable: /* @__PURE__ */ jsx(
16485
16518
  x$4,
16486
16519
  {
16487
- className: clsx$1(styles$y.contentEditable, contentEditableClassName),
16520
+ className: clsx$1(styles$A.contentEditable, contentEditableClassName),
16488
16521
  ariaLabel
16489
16522
  }
16490
16523
  ),
16491
- placeholder: /* @__PURE__ */ jsx("div", { className: styles$y.placeholder, children: placeholder2 }),
16524
+ placeholder: /* @__PURE__ */ jsx("div", { className: styles$A.placeholder, children: placeholder2 }),
16492
16525
  ErrorBoundary: a$2
16493
16526
  }
16494
16527
  ),
@@ -16511,7 +16544,7 @@ const BaseEditor = ({
16511
16544
  const editor$1 = "_editor_pujow_6";
16512
16545
  const seamless = "_seamless_pujow_16";
16513
16546
  const disabled$1 = "_disabled_pujow_36";
16514
- const styles$s = {
16547
+ const styles$u = {
16515
16548
  editor: editor$1,
16516
16549
  seamless,
16517
16550
  disabled: disabled$1
@@ -16566,22 +16599,30 @@ function getContextItemsForEditor(editor2) {
16566
16599
  });
16567
16600
  }
16568
16601
  function visitContextItemsForEditor(editor2, visit2) {
16569
- editor2.update(() => {
16570
- walkLexicalNodes(ke$1(), (node2) => {
16571
- if (node2 instanceof ContextItemMentionNode) {
16572
- visit2(node2);
16573
- }
16574
- return true;
16575
- });
16602
+ return new Promise((resolve) => {
16603
+ editor2.update(
16604
+ () => {
16605
+ walkLexicalNodes(ke$1(), (node2) => {
16606
+ if (node2 instanceof ContextItemMentionNode) {
16607
+ visit2(node2);
16608
+ }
16609
+ return true;
16610
+ });
16611
+ },
16612
+ { onUpdate: resolve }
16613
+ );
16576
16614
  });
16577
16615
  }
16578
16616
  function lexicalNodesForContextItems(items, {
16579
16617
  isFromInitialContext
16580
- }) {
16581
- const nodes = items.flatMap((item2) => [
16582
- $createContextItemMentionNode(item2, { isFromInitialContext }),
16583
- ri$1(" ")
16584
- ]);
16618
+ }, sep = " ") {
16619
+ const nodes = [];
16620
+ for (let i2 = 0; i2 < items.length; i2++) {
16621
+ nodes.push($createContextItemMentionNode(items[i2], { isFromInitialContext }));
16622
+ if (i2 < items.length - 1) {
16623
+ nodes.push(ri$1(sep));
16624
+ }
16625
+ }
16585
16626
  return nodes;
16586
16627
  }
16587
16628
  function isEditorContentOnlyInitialContext(editor2) {
@@ -16626,11 +16667,10 @@ const PromptEditor = ({
16626
16667
  useImperativeHandle(
16627
16668
  ref2,
16628
16669
  () => ({
16629
- setEditorState(state, onUpdate) {
16670
+ setEditorState(state) {
16630
16671
  const editor2 = editorRef.current;
16631
16672
  if (editor2) {
16632
16673
  editor2.setEditorState(editor2.parseEditorState(state.lexicalEditorState));
16633
- onUpdate == null ? void 0 : onUpdate();
16634
16674
  }
16635
16675
  },
16636
16676
  getSerializedValue() {
@@ -16639,64 +16679,80 @@ const PromptEditor = ({
16639
16679
  }
16640
16680
  return toSerializedPromptEditorValue(editorRef.current);
16641
16681
  },
16642
- // biome-ignore lint/style/useDefaultParameterLast:
16643
- setFocus(focus, { moveCursorToEnd } = {}, cb2) {
16644
- const editor2 = editorRef.current;
16645
- if (editor2) {
16646
- if (focus) {
16647
- editor2.update(
16682
+ setFocus(focus, { moveCursorToEnd } = {}) {
16683
+ return new Promise((resolve) => {
16684
+ const editor2 = editorRef.current;
16685
+ if (editor2) {
16686
+ if (focus) {
16687
+ editor2.update(
16688
+ () => {
16689
+ const selection = Fi$1();
16690
+ const root2 = ke$1();
16691
+ if (selection !== null) {
16692
+ selection.dirty = true;
16693
+ } else if (root2.getChildrenSize() !== 0) {
16694
+ root2.selectEnd();
16695
+ }
16696
+ if (moveCursorToEnd) {
16697
+ root2.selectEnd();
16698
+ }
16699
+ const doFocus = () => {
16700
+ var _a;
16701
+ return (_a = editor2.getRootElement()) == null ? void 0 : _a.focus({ preventScroll: false });
16702
+ };
16703
+ doFocus();
16704
+ setTimeout(doFocus);
16705
+ },
16706
+ { tag: "skip-scroll-into-view", onUpdate: resolve }
16707
+ );
16708
+ } else {
16709
+ editor2.blur();
16710
+ resolve == null ? void 0 : resolve();
16711
+ }
16712
+ } else {
16713
+ resolve == null ? void 0 : resolve();
16714
+ }
16715
+ });
16716
+ },
16717
+ appendText(text2) {
16718
+ return new Promise(
16719
+ (resolve) => {
16720
+ var _a;
16721
+ return (_a = editorRef.current) == null ? void 0 : _a.update(
16648
16722
  () => {
16649
- const selection = Fi$1();
16650
16723
  const root2 = ke$1();
16651
- if (selection !== null) {
16652
- selection.dirty = true;
16653
- } else if (root2.getChildrenSize() !== 0) {
16654
- root2.selectEnd();
16655
- }
16656
- if (moveCursorToEnd) {
16657
- root2.selectEnd();
16658
- }
16659
- const doFocus = () => {
16660
- var _a;
16661
- return (_a = editor2.getRootElement()) == null ? void 0 : _a.focus({ preventScroll: true });
16662
- };
16663
- doFocus();
16664
- setTimeout(doFocus);
16724
+ root2.selectEnd();
16725
+ Wi$1([ri$1(`${getWhitespace(root2)}${text2}`)]);
16726
+ root2.selectEnd();
16665
16727
  },
16666
- { tag: "skip-scroll-into-view", onUpdate: cb2 }
16728
+ { onUpdate: resolve }
16667
16729
  );
16668
- } else {
16669
- editor2.blur();
16670
- cb2 == null ? void 0 : cb2();
16671
16730
  }
16672
- } else {
16673
- cb2 == null ? void 0 : cb2();
16674
- }
16675
- },
16676
- appendText(text2, cb2) {
16677
- var _a;
16678
- (_a = editorRef.current) == null ? void 0 : _a.update(
16679
- () => {
16680
- const root2 = ke$1();
16681
- root2.selectEnd();
16682
- Wi$1([ri$1(`${getWhitespace(root2)}${text2}`)]);
16683
- root2.selectEnd();
16684
- },
16685
- { onUpdate: cb2 }
16686
16731
  );
16687
16732
  },
16688
- addMentions(items, cb2) {
16689
- var _a;
16733
+ filterMentions(filter) {
16734
+ return new Promise((resolve) => {
16735
+ if (!editorRef.current) {
16736
+ resolve();
16737
+ return;
16738
+ }
16739
+ visitContextItemsForEditor(editorRef.current, (node2) => {
16740
+ if (!filter(node2.contextItem)) {
16741
+ node2.remove();
16742
+ }
16743
+ }).then(resolve);
16744
+ });
16745
+ },
16746
+ async addMentions(items, position2 = "after", sep = " ") {
16690
16747
  const editor2 = editorRef.current;
16691
16748
  if (!editor2) {
16692
- cb2 == null ? void 0 : cb2();
16693
16749
  return;
16694
16750
  }
16695
16751
  const newContextItems = items.map(serializeContextItem);
16696
16752
  const existingMentions = getContextItemsForEditor(editor2);
16697
16753
  const ops = getMentionOperations(existingMentions, newContextItems);
16698
16754
  if (ops.modify.size + ops.delete.size > 0) {
16699
- visitContextItemsForEditor(editor2, (existing) => {
16755
+ await visitContextItemsForEditor(editor2, (existing) => {
16700
16756
  const update = ops.modify.get(existing.contextItem);
16701
16757
  if (update) {
16702
16758
  existing.replace($createContextItemMentionNode(update));
@@ -16707,46 +16763,78 @@ const PromptEditor = ({
16707
16763
  });
16708
16764
  }
16709
16765
  if (ops.create.length === 0) {
16710
- cb2 == null ? void 0 : cb2();
16711
16766
  return;
16712
16767
  }
16713
- (_a = editorRef.current) == null ? void 0 : _a.update(
16714
- () => {
16715
- const nodesToInsert = lexicalNodesForContextItems(ops.create, {
16716
- isFromInitialContext: false
16717
- });
16718
- Wi$1([ri$1(getWhitespace(ke$1())), ...nodesToInsert]);
16719
- const lastNode = nodesToInsert.at(-1);
16720
- if (lastNode) {
16721
- $selectAfter(lastNode);
16722
- }
16723
- },
16724
- { onUpdate: cb2 }
16768
+ return new Promise(
16769
+ (resolve) => {
16770
+ var _a;
16771
+ return (_a = editorRef.current) == null ? void 0 : _a.update(
16772
+ () => {
16773
+ switch (position2) {
16774
+ case "before": {
16775
+ const nodesToInsert = lexicalNodesForContextItems(
16776
+ ops.create,
16777
+ {
16778
+ isFromInitialContext: false
16779
+ },
16780
+ sep
16781
+ );
16782
+ const pNode = ks();
16783
+ pNode.append(...nodesToInsert);
16784
+ oe$1(ke$1(), pNode);
16785
+ $selectEnd();
16786
+ break;
16787
+ }
16788
+ case "after": {
16789
+ const lexicalNodes = lexicalNodesForContextItems(
16790
+ ops.create,
16791
+ {
16792
+ isFromInitialContext: false
16793
+ },
16794
+ sep
16795
+ );
16796
+ const pNode = ks();
16797
+ pNode.append(
16798
+ ri$1(getWhitespace(ke$1())),
16799
+ ...lexicalNodes,
16800
+ ri$1(sep)
16801
+ );
16802
+ Wi$1([pNode]);
16803
+ $selectEnd();
16804
+ break;
16805
+ }
16806
+ }
16807
+ },
16808
+ { onUpdate: resolve }
16809
+ );
16810
+ }
16725
16811
  );
16726
16812
  },
16727
- setInitialContextMentions(items, cb2) {
16728
- const editor2 = editorRef.current;
16729
- if (!editor2) {
16730
- cb2 == null ? void 0 : cb2();
16731
- return;
16732
- }
16733
- editor2.update(
16734
- () => {
16735
- if (!hasSetInitialContext.current || isEditorContentOnlyInitialContext(editor2)) {
16736
- if (isEditorContentOnlyInitialContext(editor2)) {
16737
- ke$1().clear();
16813
+ setInitialContextMentions(items) {
16814
+ return new Promise((resolve) => {
16815
+ const editor2 = editorRef.current;
16816
+ if (!editor2) {
16817
+ return resolve();
16818
+ }
16819
+ editor2.update(
16820
+ () => {
16821
+ if (!hasSetInitialContext.current || isEditorContentOnlyInitialContext(editor2)) {
16822
+ if (isEditorContentOnlyInitialContext(editor2)) {
16823
+ ke$1().clear();
16824
+ }
16825
+ const nodesToInsert = lexicalNodesForContextItems(items, {
16826
+ isFromInitialContext: true
16827
+ });
16828
+ nodesToInsert.push(ri$1(" "));
16829
+ we$2(ke$1().selectStart());
16830
+ Wi$1(nodesToInsert);
16831
+ $selectEnd();
16832
+ hasSetInitialContext.current = true;
16738
16833
  }
16739
- const nodesToInsert = lexicalNodesForContextItems(items, {
16740
- isFromInitialContext: true
16741
- });
16742
- we$2(ke$1().selectStart());
16743
- Wi$1(nodesToInsert);
16744
- $selectEnd();
16745
- hasSetInitialContext.current = true;
16746
- }
16747
- },
16748
- { onUpdate: cb2 }
16749
- );
16834
+ },
16835
+ { onUpdate: resolve }
16836
+ );
16837
+ });
16750
16838
  }
16751
16839
  }),
16752
16840
  []
@@ -16775,9 +16863,9 @@ const PromptEditor = ({
16775
16863
  return /* @__PURE__ */ jsx(
16776
16864
  BaseEditor,
16777
16865
  {
16778
- className: clsx$1(styles$s.editor, editorClassName, {
16779
- [styles$s.disabled]: disabled2,
16780
- [styles$s.seamless]: seamless2
16866
+ className: clsx$1(styles$u.editor, editorClassName, {
16867
+ [styles$u.disabled]: disabled2,
16868
+ [styles$u.seamless]: seamless2
16781
16869
  }),
16782
16870
  contentEditableClassName,
16783
16871
  initialEditorState: (initialEditorState == null ? void 0 : initialEditorState.lexicalEditorState) ?? null,
@@ -22824,17 +22912,17 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22824
22912
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22825
22913
  PERFORMANCE OF THIS SOFTWARE.
22826
22914
  ***************************************************************************** */
22827
- var __assign$1 = function() {
22828
- __assign$1 = Object.assign || function __assign2(t2) {
22915
+ var __assign = function() {
22916
+ __assign = Object.assign || function __assign2(t2) {
22829
22917
  for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
22830
22918
  s2 = arguments[i2];
22831
22919
  for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2];
22832
22920
  }
22833
22921
  return t2;
22834
22922
  };
22835
- return __assign$1.apply(this, arguments);
22923
+ return __assign.apply(this, arguments);
22836
22924
  };
22837
- function __rest$1(s2, e2) {
22925
+ function __rest(s2, e2) {
22838
22926
  var t2 = {};
22839
22927
  for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0)
22840
22928
  t2[p2] = s2[p2];
@@ -22845,8 +22933,8 @@ function __rest$1(s2, e2) {
22845
22933
  }
22846
22934
  return t2;
22847
22935
  }
22848
- function __decorate$1(decorators, target, key, desc) {
22849
- var c2 = arguments.length, r2 = c2 < 3 ? target : desc, d2;
22936
+ function __decorate(decorators, target, key, desc) {
22937
+ var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2;
22850
22938
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
22851
22939
  else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2;
22852
22940
  return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
@@ -22922,31 +23010,6 @@ function useMergeRefs(refs, defaultValue) {
22922
23010
  }, [refs]);
22923
23011
  return callbackRef;
22924
23012
  }
22925
- var __assign = function() {
22926
- __assign = Object.assign || function __assign2(t2) {
22927
- for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
22928
- s2 = arguments[i2];
22929
- for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2];
22930
- }
22931
- return t2;
22932
- };
22933
- return __assign.apply(this, arguments);
22934
- };
22935
- function __rest(s2, e2) {
22936
- var t2 = {};
22937
- for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0)
22938
- t2[p2] = s2[p2];
22939
- if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
22940
- for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) {
22941
- if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2]))
22942
- t2[p2[i2]] = s2[p2[i2]];
22943
- }
22944
- return t2;
22945
- }
22946
- typeof SuppressedError === "function" ? SuppressedError : function(error2, suppressed, message2) {
22947
- var e2 = new Error(message2);
22948
- return e2.name = "SuppressedError", e2.error = error2, e2.suppressed = suppressed, e2;
22949
- };
22950
23013
  function ItoI(a2) {
22951
23014
  return a2;
22952
23015
  }
@@ -23058,15 +23121,15 @@ var RemoveScroll = React.forwardRef(function(props, parentRef) {
23058
23121
  onWheelCapture: nothing,
23059
23122
  onTouchMoveCapture: nothing
23060
23123
  }), callbacks = _a[0], setCallbacks = _a[1];
23061
- var forwardProps = props.forwardProps, children2 = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container2 = _b === void 0 ? "div" : _b, rest = __rest$1(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
23124
+ var forwardProps = props.forwardProps, children2 = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container2 = _b === void 0 ? "div" : _b, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
23062
23125
  var SideCar2 = sideCar;
23063
23126
  var containerRef = useMergeRefs([ref2, parentRef]);
23064
- var containerProps = __assign$1(__assign$1({}, rest), callbacks);
23127
+ var containerProps = __assign(__assign({}, rest), callbacks);
23065
23128
  return React.createElement(
23066
23129
  React.Fragment,
23067
23130
  null,
23068
23131
  enabled && React.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref2 }),
23069
- forwardProps ? React.cloneElement(React.Children.only(children2), __assign$1(__assign$1({}, containerProps), { ref: containerRef })) : React.createElement(Container2, __assign$1({}, containerProps, { className, ref: containerRef }), children2)
23132
+ forwardProps ? React.cloneElement(React.Children.only(children2), __assign(__assign({}, containerProps), { ref: containerRef })) : React.createElement(Container2, __assign({}, containerProps, { className, ref: containerRef }), children2)
23070
23133
  );
23071
23134
  });
23072
23135
  RemoveScroll.defaultProps = {
@@ -23481,7 +23544,7 @@ function RemoveScrollSideCar(props) {
23481
23544
  }
23482
23545
  const SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
23483
23546
  var ReactRemoveScroll = React.forwardRef(function(props, ref2) {
23484
- return React.createElement(RemoveScroll, __assign$1({}, props, { ref: ref2, sideCar: SideCar }));
23547
+ return React.createElement(RemoveScroll, __assign({}, props, { ref: ref2, sideCar: SideCar }));
23485
23548
  });
23486
23549
  ReactRemoveScroll.classNames = RemoveScroll.classNames;
23487
23550
  var getDefaultParent = function(originalTarget) {
@@ -24353,7 +24416,7 @@ const outerContainer = "_outer-container_t0bbj_1";
24353
24416
  const errorContainer = "_error-container_t0bbj_10";
24354
24417
  const error$2 = "_error_t0bbj_10";
24355
24418
  const closeBtn = "_close-btn_t0bbj_28";
24356
- const styles$r = {
24419
+ const styles$t = {
24357
24420
  outerContainer,
24358
24421
  errorContainer,
24359
24422
  error: error$2,
@@ -25177,7 +25240,7 @@ const basename$1 = "_basename_1dh30_14";
25177
25240
  const repoShortName = "_repoShortName_1dh30_18";
25178
25241
  const dirname$1 = "_dirname_1dh30_23";
25179
25242
  const range$1 = "_range_1dh30_28";
25180
- const styles$q = {
25243
+ const styles$s = {
25181
25244
  path: path$2,
25182
25245
  excluded,
25183
25246
  basename: basename$1,
@@ -25286,7 +25349,7 @@ included from Sourcegraph search`;
25286
25349
  /* @__PURE__ */ jsx(
25287
25350
  "div",
25288
25351
  {
25289
- className: clsx$1(styles$q.path, (isTooLarge || isIgnored) && styles$q.excluded),
25352
+ className: clsx$1(styles$s.path, (isTooLarge || isIgnored) && styles$s.excluded),
25290
25353
  "data-source": source2 || "unknown",
25291
25354
  children: /* @__PURE__ */ jsx(
25292
25355
  PrettyPrintedContextItem,
@@ -25321,7 +25384,7 @@ included from Sourcegraph search`;
25321
25384
  /* @__PURE__ */ jsx(
25322
25385
  "div",
25323
25386
  {
25324
- className: clsx$1(styles$q.path, (isTooLarge || isIgnored) && styles$q.excluded),
25387
+ className: clsx$1(styles$s.path, (isTooLarge || isIgnored) && styles$s.excluded),
25325
25388
  "data-source": source2 || "unknown",
25326
25389
  children: /* @__PURE__ */ jsx(
25327
25390
  PrettyPrintedContextItem,
@@ -25348,14 +25411,14 @@ const PrettyPrintedContextItem = ({ path: path2, range: range2, repoShortName: r
25348
25411
  const basename2 = path2.split(sep).pop() || "";
25349
25412
  const dirname2 = path2.split(sep).slice(0, -1).join(sep);
25350
25413
  return /* @__PURE__ */ jsxs(Fragment, { children: [
25351
- /* @__PURE__ */ jsx("span", { className: styles$q.basename, children: basename2 }),
25352
- /* @__PURE__ */ jsx("span", { className: styles$q.range, children: range2 ? `:${range2}` : "" }),
25414
+ /* @__PURE__ */ jsx("span", { className: styles$s.basename, children: basename2 }),
25415
+ /* @__PURE__ */ jsx("span", { className: styles$s.range, children: range2 ? `:${range2}` : "" }),
25353
25416
  " ",
25354
- repoShortName2 && /* @__PURE__ */ jsxs("span", { className: styles$q.repoShortName, children: [
25417
+ repoShortName2 && /* @__PURE__ */ jsxs("span", { className: styles$s.repoShortName, children: [
25355
25418
  repoShortName2,
25356
25419
  dirname2.length === 0 || dirname2.startsWith(sep) ? "" : sep
25357
25420
  ] }),
25358
- /* @__PURE__ */ jsx("span", { className: styles$q.dirname, children: dirname2 })
25421
+ /* @__PURE__ */ jsx("span", { className: styles$s.dirname, children: dirname2 })
25359
25422
  ] });
25360
25423
  };
25361
25424
  function parseLineOrPosition(lineOrPosition) {
@@ -25834,18 +25897,18 @@ function highlightNodeHelper(currentNode, currentOffset, start, length) {
25834
25897
  }
25835
25898
  const code$3 = "_code_1suzz_6";
25836
25899
  const small = "_small_1suzz_13";
25837
- const styles$p = {
25900
+ const styles$r = {
25838
25901
  code: code$3,
25839
25902
  small
25840
25903
  };
25841
- const getFontWeightStyle = (weight) => clsx$1(styles$p[`fontWeight${upperFirst(weight)}`]);
25904
+ const getFontWeightStyle = (weight) => clsx$1(styles$r[`fontWeight${upperFirst(weight)}`]);
25842
25905
  const Code = forwardRef(function Code2({ children: children2, as: Component = "code", size: size2, weight, className, ...props }, reference) {
25843
25906
  return /* @__PURE__ */ jsx(
25844
25907
  Component,
25845
25908
  {
25846
25909
  className: clsx$1(
25847
- styles$p.code,
25848
- size2 === "small" && styles$p.small,
25910
+ styles$r.code,
25911
+ size2 === "small" && styles$r.small,
25849
25912
  weight && getFontWeightStyle(weight),
25850
25913
  className
25851
25914
  ),
@@ -25858,7 +25921,7 @@ const Code = forwardRef(function Code2({ children: children2, as: Component = "c
25858
25921
  const codeExcerpt = "_code-excerpt_1gr2h_1";
25859
25922
  const codeExcerptError = "_code-excerpt-error_1gr2h_1";
25860
25923
  const codeExcerptAlert = "_code-excerpt-alert_1gr2h_1";
25861
- const styles$o = {
25924
+ const styles$q = {
25862
25925
  codeExcerpt,
25863
25926
  codeExcerptError,
25864
25927
  codeExcerptAlert
@@ -25935,7 +25998,7 @@ const CodeExcerpt = (props) => {
25935
25998
  }
25936
25999
  }
25937
26000
  }, [highlightRanges, startLine, endLine, tableContainerElement, table2]);
25938
- return /* @__PURE__ */ jsx(Code, { className: clsx$1(styles$o.codeExcerpt, className), "data-code-excerpt": true, children: /* @__PURE__ */ jsx("div", { ref: setTableContainerElement, children: table2 }) });
26001
+ return /* @__PURE__ */ jsx(Code, { className: clsx$1(styles$q.codeExcerpt, className), "data-code-excerpt": true, children: /* @__PURE__ */ jsx("div", { ref: setTableContainerElement, children: table2 }) });
25939
26002
  };
25940
26003
  const resultContainer = "_result-container_1poiy_12";
25941
26004
  const header$2 = "_header_1poiy_32";
@@ -25953,7 +26016,7 @@ const titleInner = "_title-inner_1poiy_120";
25953
26016
  const toggleMatchesButton = "_toggle-matches-button_1poiy_124";
25954
26017
  const toggleMatchesButtonExpanded = "_toggle-matches-button--expanded_1poiy_1";
25955
26018
  const toggleMatchesButtonText = "_toggle-matches-button-text_1poiy_1";
25956
- const styles$n = {
26019
+ const styles$p = {
25957
26020
  resultContainer,
25958
26021
  header: header$2,
25959
26022
  headerTitle,
@@ -25972,7 +26035,7 @@ const styles$n = {
25972
26035
  toggleMatchesButtonText
25973
26036
  };
25974
26037
  const chunk = "_chunk_1nj7l_1";
25975
- const styles$m = {
26038
+ const styles$o = {
25976
26039
  chunk
25977
26040
  };
25978
26041
  const FileMatchChildren = (props) => {
@@ -26005,10 +26068,10 @@ const FileMatchChildren = (props) => {
26005
26068
  "data-href": createCodeExcerptLink(group),
26006
26069
  className: clsx$1(
26007
26070
  "test-file-match-children-item",
26008
- styles$m.chunk,
26009
- styles$n.clickable,
26010
- styles$n.focusableBlock,
26011
- styles$n.horizontalDividerBetween
26071
+ styles$o.chunk,
26072
+ styles$p.clickable,
26073
+ styles$p.focusableBlock,
26074
+ styles$p.horizontalDividerBetween
26012
26075
  ),
26013
26076
  children: /* @__PURE__ */ jsx(
26014
26077
  CodeExcerpt,
@@ -26237,7 +26300,7 @@ const $cb5cc270b50c6fcd$export$41fb9f06171c75f4 = $cb5cc270b50c6fcd$export$7dacb
26237
26300
  const $cb5cc270b50c6fcd$export$602eac185826482c = $cb5cc270b50c6fcd$export$dd679ffb4362d2d4;
26238
26301
  const $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2 = $cb5cc270b50c6fcd$export$d7e1f420b25549ff;
26239
26302
  const popover = "_popover_1ah8d_2";
26240
- const styles$l = {
26303
+ const styles$n = {
26241
26304
  popover
26242
26305
  };
26243
26306
  const Popover = $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9;
@@ -26255,7 +26318,7 @@ const PopoverContent = React.forwardRef(({ className, align = "start", sideOffse
26255
26318
  className: cn(
26256
26319
  "tw-z-50 tw-w-72 tw-rounded-md tw-border tw-border-border tw-bg-popover tw-p-4 tw-text-popover-foreground tw-outline-none",
26257
26320
  className,
26258
- styles$l.popover
26321
+ styles$n.popover
26259
26322
  ),
26260
26323
  ...props
26261
26324
  }
@@ -26660,7 +26723,7 @@ const FileContentSearchResult = (props) => {
26660
26723
  pathMatchRanges: result2.pathMatches ?? [],
26661
26724
  fileURL,
26662
26725
  repoDisplayName: repoDisplayName ? `${repoDisplayName}${revisionDisplayName ? `@${revisionDisplayName}` : ""}` : void 0,
26663
- className: styles$n.titleInner,
26726
+ className: styles$p.titleInner,
26664
26727
  collapsed: hidden2,
26665
26728
  onToggleCollapse: () => setHidden((current) => !current),
26666
26729
  onAddToFollowupChat
@@ -26698,13 +26761,13 @@ const FileContentSearchResult = (props) => {
26698
26761
  {
26699
26762
  type: "button",
26700
26763
  className: clsx$1(
26701
- styles$n.toggleMatchesButton,
26702
- styles$n.focusableBlock,
26703
- styles$n.clickable,
26704
- { [styles$n.toggleMatchesButtonExpanded]: expanded }
26764
+ styles$p.toggleMatchesButton,
26765
+ styles$p.focusableBlock,
26766
+ styles$p.clickable,
26767
+ { [styles$p.toggleMatchesButtonExpanded]: expanded }
26705
26768
  ),
26706
26769
  onClick: toggleExpand,
26707
- children: /* @__PURE__ */ jsx("span", { className: styles$n.toggleMatchesButtonText, children: expanded ? "Show less" : `Show ${hiddenMatchesCount} more ${pluralize(
26770
+ children: /* @__PURE__ */ jsx("span", { className: styles$p.toggleMatchesButtonText, children: expanded ? "Show less" : `Show ${hiddenMatchesCount} more ${pluralize(
26708
26771
  "match",
26709
26772
  hiddenMatchesCount,
26710
26773
  "matches"
@@ -26738,20 +26801,20 @@ const ResultContainer = forwardRef(function ResultContainer2(props, reference) {
26738
26801
  Component,
26739
26802
  {
26740
26803
  ref: reference,
26741
- className: clsx$1(className, styles$n.resultContainer, "tw-group"),
26804
+ className: clsx$1(className, styles$p.resultContainer, "tw-group"),
26742
26805
  onClick: onResultClicked,
26743
26806
  children: /* @__PURE__ */ jsxs("article", { children: [
26744
- /* @__PURE__ */ jsxs("header", { className: styles$n.header, "data-result-header": true, children: [
26807
+ /* @__PURE__ */ jsxs("header", { className: styles$p.header, "data-result-header": true, children: [
26745
26808
  /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
26746
26809
  resultType ? accessibleResultType[resultType] : "search",
26747
26810
  " result,"
26748
26811
  ] }),
26749
- /* @__PURE__ */ jsx("div", { className: clsx$1(styles$n.headerTitle, titleClassName), children: title2 }),
26812
+ /* @__PURE__ */ jsx("div", { className: clsx$1(styles$p.headerTitle, titleClassName), children: title2 }),
26750
26813
  actions2,
26751
26814
  formattedRepositoryStarCount && /* @__PURE__ */ jsx("span", { className: "d-flex align-items-center", children: /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: formattedRepositoryStarCount }) })
26752
26815
  ] }),
26753
26816
  rankingDebug && /* @__PURE__ */ jsx("div", { children: rankingDebug }),
26754
- children2 && !collapsed && /* @__PURE__ */ jsx("div", { className: clsx$1(styles$n.result, resultClassName), children: children2 })
26817
+ children2 && !collapsed && /* @__PURE__ */ jsx("div", { className: clsx$1(styles$p.result, resultClassName), children: children2 })
26755
26818
  ] })
26756
26819
  }
26757
26820
  );
@@ -26909,7 +26972,7 @@ const linkContainer = "_link-container_15z33_7";
26909
26972
  const header$1 = "_header_15z33_13";
26910
26973
  const contextItemLink = "_context-item-link_15z33_19";
26911
26974
  const codeBlock = "_code-block_15z33_40";
26912
- const styles$k = {
26975
+ const styles$m = {
26913
26976
  root: root$7,
26914
26977
  linkContainer,
26915
26978
  header: header$1,
@@ -26934,8 +26997,8 @@ const FileContextItem = ({
26934
26997
  isTooLarge: item2.isTooLarge,
26935
26998
  isTooLargeReason: item2.isTooLargeReason,
26936
26999
  isIgnored: item2.isIgnored,
26937
- linkClassName: styles$k.contextItemLink,
26938
- className: clsx$1(styles$k.linkContainer, MENTION_CLASS_NAME)
27000
+ linkClassName: styles$m.contextItemLink,
27001
+ className: clsx$1(styles$m.linkContainer, MENTION_CLASS_NAME)
26939
27002
  }
26940
27003
  );
26941
27004
  }
@@ -26943,7 +27006,7 @@ const FileContextItem = ({
26943
27006
  FileSnippet,
26944
27007
  {
26945
27008
  item: item2,
26946
- className: styles$k.codeBlock,
27009
+ className: styles$m.codeBlock,
26947
27010
  onAddToFollowupChat
26948
27011
  }
26949
27012
  );
@@ -27598,6 +27661,12 @@ var Item$1 = AccordionItem$1;
27598
27661
  var Header = AccordionHeader;
27599
27662
  var Trigger2 = AccordionTrigger$1;
27600
27663
  var Content2 = AccordionContent$1;
27664
+ const accordionTrigger = "_accordion-trigger_12003_1";
27665
+ const accordionTriggerChevron = "_accordion-trigger-chevron_12003_11";
27666
+ const styles$l = {
27667
+ accordionTrigger,
27668
+ accordionTriggerChevron
27669
+ };
27601
27670
  const Accordion = Root2$1;
27602
27671
  const AccordionItem = React.forwardRef(({ className, ...props }, ref2) => /* @__PURE__ */ jsx(Item$1, { ref: ref2, className, ...props }));
27603
27672
  AccordionItem.displayName = "AccordionItem";
@@ -27605,14 +27674,16 @@ const AccordionTrigger = React.forwardRef(({ className, children: children2, ...
27605
27674
  Trigger2,
27606
27675
  {
27607
27676
  ref: ref2,
27608
- className: cn(
27609
- "tw-flex tw-gap-1 tw-items-center tw-justify-between tw-transition-all [&[data-state=open]>svg.lucide]:tw-rotate-90",
27610
- className
27611
- ),
27677
+ className: clsx$1(styles$l.accordionTrigger, className),
27612
27678
  ...props,
27613
27679
  children: [
27614
27680
  children2,
27615
- /* @__PURE__ */ jsx(ChevronRight, { className: "tw-h-8 tw-w-8 tw-shrink-0 tw-transition-transform tw-duration-150 tw-text-muted-foreground" })
27681
+ /* @__PURE__ */ jsx(
27682
+ ChevronRight,
27683
+ {
27684
+ className: cn("tw-h-8 tw-w-8 tw-text-muted-foreground", styles$l.accordionTriggerChevron)
27685
+ }
27686
+ )
27616
27687
  ]
27617
27688
  }
27618
27689
  ) }));
@@ -27701,15 +27772,15 @@ function CodyIcon({ className }) {
27701
27772
  const dotsHolder = "_dots-holder_10c80_1";
27702
27773
  const dot = "_dot_10c80_1";
27703
27774
  const flash = "_flash_10c80_1";
27704
- const styles$j = {
27775
+ const styles$k = {
27705
27776
  dotsHolder,
27706
27777
  dot,
27707
27778
  flash
27708
27779
  };
27709
- const LoadingDots = () => /* @__PURE__ */ jsxs("div", { className: styles$j.dotsHolder, role: "status", "aria-busy": true, children: [
27710
- /* @__PURE__ */ jsx("div", { className: styles$j.dot }),
27711
- /* @__PURE__ */ jsx("div", { className: styles$j.dot }),
27712
- /* @__PURE__ */ jsx("div", { className: styles$j.dot })
27780
+ const LoadingDots = () => /* @__PURE__ */ jsxs("div", { className: styles$k.dotsHolder, role: "status", "aria-busy": true, children: [
27781
+ /* @__PURE__ */ jsx("div", { className: styles$k.dot }),
27782
+ /* @__PURE__ */ jsx("div", { className: styles$k.dot }),
27783
+ /* @__PURE__ */ jsx("div", { className: styles$k.dot })
27713
27784
  ] });
27714
27785
  const Cell = forwardRef((props, ref2) => {
27715
27786
  const {
@@ -68107,7 +68178,7 @@ const codiconLoading = "_codicon-loading_1kf9a_100";
68107
68178
  const spin$1 = "_spin_1kf9a_1";
68108
68179
  const content = "_content_1kf9a_116";
68109
68180
  const fileNameContainer = "_file-name-container_1kf9a_216";
68110
- const styles$i = {
68181
+ const styles$j = {
68111
68182
  buttonsContainer,
68112
68183
  buttons,
68113
68184
  button: button$1,
@@ -68126,7 +68197,7 @@ const styles$i = {
68126
68197
  fileNameContainer
68127
68198
  };
68128
68199
  const spin = "_spin_56lwz_7";
68129
- const styles$h = {
68200
+ const styles$i = {
68130
68201
  spin
68131
68202
  };
68132
68203
  const SaveCodeBlockIcon = '<svg role="img" height=16 width=16 viewBox="0 0 16 16" fill="currentColor"><path fillRule="evenodd" clipRule="evenodd" d="M9.5 1.1l3.4 3.5.1.4v2h-1V6H8V2H3v11h4v1H2.5l-.5-.5v-12l.5-.5h6.7l.3.1zM9 2v3h2.9L9 2zm4 14h-1v-3H9v-1h3V9h1v3h3v1h-3v3z"/></svg>';
@@ -68136,12 +68207,12 @@ const CheckCodeBlockIcon = '<svg role="img" height=16 width=16 viewBox="0 0 16 1
68136
68207
  const ShieldIcon = '<svg role="img" height=16 width=16 viewBox="0 0 16 16" fill="currentColor"><path fillRule="evenodd" clipRule="evenodd" d="M8.24599 14.713C7.73426 14.4115 7.23234 14.0937 6.74099 13.76C6.23999 13.42 5.75799 13.053 5.29699 12.66C4.83899 12.265 4.40899 11.84 4.00899 11.386C3.60899 10.931 3.25599 10.436 2.95899 9.90801C2.66018 9.37408 2.42523 8.80684 2.25899 8.21801C2.08478 7.59364 1.99762 6.94821 1.99999 6.30001V3.10001L2.49999 2.60001C2.83299 2.60001 3.15599 2.58901 3.46999 2.56401C3.76599 2.54101 4.06099 2.49801 4.35199 2.43601C4.63599 2.37401 4.91399 2.28801 5.18399 2.18001C5.46799 2.06201 5.74099 1.91901 5.99999 1.75301C6.36712 1.5117 6.76546 1.32161 7.18399 1.18801C7.83322 1.00041 8.51476 0.95202 9.18399 1.04601C9.61431 1.10595 10.0321 1.2353 10.421 1.42901C10.62 1.52601 10.813 1.63301 11.001 1.75101C11.261 1.91801 11.536 2.06101 11.822 2.17901C12.092 2.28801 12.369 2.37301 12.653 2.43501C12.944 2.49701 13.24 2.54101 13.537 2.56401C13.848 2.58801 14.171 2.59901 14.504 2.59901L15.004 3.09901V6.29901C15.0074 6.94741 14.9212 7.59317 14.748 8.21801C14.5817 8.80683 14.3468 9.37406 14.048 9.90801C13.7501 10.4357 13.3982 10.931 12.998 11.386C12.598 11.838 12.169 12.263 11.712 12.656C11.2506 13.0499 10.7672 13.4172 10.264 13.756C9.7707 14.0903 9.26712 14.4091 8.75399 14.712H8.24599V14.713ZM2.99999 3.59001V6.30001C2.99599 6.85501 3.06999 7.41001 3.21999 7.94501C3.36397 8.45853 3.56875 8.95303 3.82999 9.41801C4.09299 9.88501 4.40499 10.323 4.75999 10.726C5.12999 11.143 5.52599 11.536 5.94799 11.9C6.37999 12.268 6.83099 12.612 7.29999 12.93C7.69999 13.197 8.09999 13.453 8.49999 13.699C8.89999 13.457 9.29999 13.201 9.69999 12.931C10.17 12.612 10.623 12.268 11.055 11.9C11.476 11.536 11.872 11.144 12.241 10.728C12.5951 10.3251 12.9068 9.88682 13.171 9.42001C13.432 8.95501 13.637 8.46001 13.781 7.94701C13.931 7.41001 14.004 6.85701 14.001 6.30001V3.59001C13.842 3.59001 13.688 3.57801 13.536 3.56701L13.457 3.56101C13.1148 3.53403 12.7748 3.48493 12.439 3.41401C11.7376 3.26082 11.0687 2.98528 10.463 2.60001C10.3073 2.50147 10.1464 2.41134 9.98099 2.33001C9.684 2.18399 9.3657 2.0861 9.03799 2.04001C8.51704 1.96366 7.98579 1.99981 7.47999 2.14601C7.14799 2.25401 6.83099 2.40601 6.53999 2.59801C6.22799 2.79801 5.89999 2.97001 5.55699 3.11101C5.23259 3.24045 4.89814 3.34313 4.55699 3.41801C4.22199 3.48801 3.88199 3.53801 3.53999 3.56401C3.36599 3.57401 3.18499 3.58401 2.99999 3.59001Z"/><path d="M7.89199 5.702L6.07499 7.53L7.89099 9.35L7.18399 10.057L5.01299 7.883V7.176L7.18299 4.997L7.89199 5.702Z"/><path d="M9.81 4.972L9.11 5.681L10.94 7.5L9.11 9.32L9.81 10.029L12 7.856V7.147L9.81 4.972Z"/></svg>';
68137
68208
  const SparkleIcon = '<svg role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M5.39804 10.8069C5.57428 10.9312 5.78476 10.9977 6.00043 10.9973C6.21633 10.9975 6.42686 10.93 6.60243 10.8043C6.77993 10.6739 6.91464 10.4936 6.98943 10.2863L7.43643 8.91335C7.55086 8.56906 7.74391 8.25615 8.00028 7.99943C8.25665 7.74272 8.56929 7.54924 8.91343 7.43435L10.3044 6.98335C10.4564 6.92899 10.5936 6.84019 10.7055 6.7239C10.8174 6.60762 10.9008 6.467 10.9492 6.31308C10.9977 6.15916 11.0098 5.99611 10.9847 5.83672C10.9596 5.67732 10.8979 5.52591 10.8044 5.39435C10.6703 5.20842 10.4794 5.07118 10.2604 5.00335L8.88543 4.55635C8.54091 4.44212 8.22777 4.24915 7.97087 3.99277C7.71396 3.73638 7.52035 3.42363 7.40543 3.07935L6.95343 1.69135C6.88113 1.48904 6.74761 1.31428 6.57143 1.19135C6.43877 1.09762 6.28607 1.03614 6.12548 1.01179C5.96489 0.987448 5.80083 1.00091 5.64636 1.05111C5.49188 1.1013 5.35125 1.18685 5.23564 1.30095C5.12004 1.41505 5.03265 1.55454 4.98043 1.70835L4.52343 3.10835C4.40884 3.44317 4.21967 3.74758 3.97022 3.9986C3.72076 4.24962 3.41753 4.44067 3.08343 4.55735L1.69243 5.00535C1.54065 5.05974 1.40352 5.14852 1.29177 5.26474C1.18001 5.38095 1.09666 5.52145 1.04824 5.67523C0.999819 5.82902 0.987639 5.99192 1.01265 6.1512C1.03767 6.31048 1.0992 6.46181 1.19243 6.59335C1.32027 6.7728 1.50105 6.90777 1.70943 6.97935L3.08343 7.42435C3.52354 7.57083 3.90999 7.84518 4.19343 8.21235C4.35585 8.42298 4.4813 8.65968 4.56443 8.91235L5.01643 10.3033C5.08846 10.5066 5.22179 10.6826 5.39804 10.8069ZM5.48343 3.39235L6.01043 2.01535L6.44943 3.39235C6.61312 3.8855 6.88991 4.33351 7.25767 4.70058C7.62544 5.06765 8.07397 5.34359 8.56743 5.50635L9.97343 6.03535L8.59143 6.48335C8.09866 6.64764 7.65095 6.92451 7.28382 7.29198C6.9167 7.65945 6.64026 8.10742 6.47643 8.60035L5.95343 9.97835L5.50443 8.59935C5.34335 8.10608 5.06943 7.65718 4.70443 7.28835C4.3356 6.92031 3.88653 6.64272 3.39243 6.47735L2.01443 5.95535L3.40043 5.50535C3.88672 5.33672 4.32775 5.05855 4.68943 4.69235C5.04901 4.32464 5.32049 3.88016 5.48343 3.39235ZM11.5353 14.8494C11.6713 14.9456 11.8337 14.9973 12.0003 14.9974C12.1654 14.9974 12.3264 14.9464 12.4613 14.8514C12.6008 14.7529 12.7058 14.6129 12.7613 14.4514L13.0093 13.6894C13.0625 13.5309 13.1515 13.3869 13.2693 13.2684C13.3867 13.1498 13.5307 13.0611 13.6893 13.0094L14.4613 12.7574C14.619 12.7029 14.7557 12.6004 14.8523 12.4644C14.9257 12.3614 14.9736 12.2424 14.9921 12.1173C15.0106 11.9922 14.9992 11.8645 14.9588 11.7447C14.9184 11.6249 14.8501 11.5163 14.7597 11.428C14.6692 11.3396 14.5591 11.2739 14.4383 11.2364L13.6743 10.9874C13.5162 10.9348 13.3724 10.8462 13.2544 10.7285C13.1364 10.6109 13.0473 10.4674 12.9943 10.3094L12.7423 9.53638C12.6886 9.37853 12.586 9.24191 12.4493 9.14638C12.3473 9.07343 12.2295 9.02549 12.1056 9.00642C11.9816 8.98736 11.8549 8.99772 11.7357 9.03665C11.6164 9.07558 11.508 9.142 11.4192 9.23054C11.3304 9.31909 11.2636 9.42727 11.2243 9.54638L10.9773 10.3084C10.925 10.466 10.8375 10.6097 10.7213 10.7284C10.6066 10.8449 10.4667 10.9335 10.3123 10.9874L9.53931 11.2394C9.38025 11.2933 9.2422 11.3959 9.1447 11.5326C9.04721 11.6694 8.99522 11.8333 8.99611 12.0013C8.99699 12.1692 9.0507 12.3326 9.14963 12.4683C9.24856 12.604 9.38769 12.7051 9.54731 12.7574L10.3103 13.0044C10.4692 13.0578 10.6136 13.1471 10.7323 13.2654C10.8505 13.3836 10.939 13.5283 10.9903 13.6874L11.2433 14.4614C11.2981 14.6178 11.4001 14.7534 11.5353 14.8494ZM10.6223 12.0564L10.4433 11.9974L10.6273 11.9334C10.9291 11.8284 11.2027 11.6556 11.4273 11.4284C11.6537 11.1994 11.8248 10.9216 11.9273 10.6164L11.9853 10.4384L12.0443 10.6194C12.1463 10.9261 12.3185 11.2047 12.5471 11.4332C12.7757 11.6617 13.0545 11.8336 13.3613 11.9354L13.5563 11.9984L13.3763 12.0574C13.0689 12.1596 12.7898 12.3322 12.5611 12.5616C12.3324 12.791 12.1606 13.0707 12.0593 13.3784L12.0003 13.5594L11.9423 13.3784C11.8409 13.0702 11.6687 12.7901 11.4394 12.5605C11.2102 12.3309 10.9303 12.1583 10.6223 12.0564Z"/></svg>';
68138
68209
  const EllipsisIcon = '<svg role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M4 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/></svg>';
68139
- const SyncSpinIcon = `<svg class="${styles$h.spin}" role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.006 8.267L.78 9.5 0 8.73l2.09-2.07.76.01 2.09 2.12-.76.76-1.167-1.18a5 5 0 0 0 9.4 1.983l.813.597a6 6 0 0 1-11.22-2.683zm10.99-.466L11.76 6.55l-.76.76 2.09 2.11.76.01 2.09-2.07-.75-.76-1.194 1.18a6 6 0 0 0-11.11-2.92l.81.594a5 5 0 0 1 9.3 2.346z"/></svg>`;
68210
+ const SyncSpinIcon = `<svg class="${styles$i.spin}" role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.006 8.267L.78 9.5 0 8.73l2.09-2.07.76.01 2.09 2.12-.76.76-1.167-1.18a5 5 0 0 0 9.4 1.983l.813.597a6 6 0 0 1-11.22-2.683zm10.99-.466L11.76 6.55l-.76.76 2.09 2.11.76.01 2.09-2.07-.75-.76-1.194 1.18a6 6 0 0 0-11.11-2.92l.81.594a5 5 0 0 1 9.3 2.346z"/></svg>`;
68140
68211
  const TickIcon = '<svg role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z"/></svg>';
68141
68212
  const CloseIcon = '<svg role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"/></svg>';
68142
68213
  class GuardrailsStatusController {
68143
68214
  constructor(container2) {
68144
- __publicField(this, "statusSpinning", `<i class="codicon codicon-loading ${styles$i.codiconLoading}"></i>`);
68215
+ __publicField(this, "statusSpinning", `<i class="codicon codicon-loading ${styles$j.codiconLoading}"></i>`);
68145
68216
  __publicField(this, "statusPass", '<i class="codicon codicon-pass"></i>');
68146
68217
  __publicField(this, "statusFailed", "Guardrails Check Failed");
68147
68218
  __publicField(this, "statusUnavailable", "Guardrails API Error");
@@ -68152,13 +68223,13 @@ class GuardrailsStatusController {
68152
68223
  this.findOrAppend(this.iconClass, () => {
68153
68224
  const icon2 = document.createElement("div");
68154
68225
  icon2.innerHTML = ShieldIcon;
68155
- icon2.classList.add(styles$i.attributionIcon, this.iconClass);
68226
+ icon2.classList.add(styles$j.attributionIcon, this.iconClass);
68156
68227
  icon2.setAttribute("data-testid", "attribution-indicator");
68157
68228
  return icon2;
68158
68229
  });
68159
68230
  this.status = this.findOrAppend(this.statusClass, () => {
68160
68231
  const status2 = document.createElement("div");
68161
- status2.classList.add(styles$i.status, this.statusClass);
68232
+ status2.classList.add(styles$j.status, this.statusClass);
68162
68233
  return status2;
68163
68234
  });
68164
68235
  }
@@ -68184,7 +68255,7 @@ class GuardrailsStatusController {
68184
68255
  * where attribution was found, and whether the attribution limit was hit.
68185
68256
  */
68186
68257
  setFailure(repos, limitHit) {
68187
- this.container.classList.add(styles$i.attributionIconFound);
68258
+ this.container.classList.add(styles$j.attributionIconFound);
68188
68259
  this.container.title = this.tooltip(repos, limitHit);
68189
68260
  this.status.innerHTML = this.statusFailed;
68190
68261
  }
@@ -68194,7 +68265,7 @@ class GuardrailsStatusController {
68194
68265
  * search is unavailable.
68195
68266
  */
68196
68267
  setUnavailable(error2) {
68197
- this.container.classList.add(styles$i.attributionIconUnavailable);
68268
+ this.container.classList.add(styles$j.attributionIconUnavailable);
68198
68269
  this.container.title = `Guardrails API error: ${error2.message}`;
68199
68270
  this.status.innerHTML = this.statusUnavailable;
68200
68271
  }
@@ -68218,12 +68289,12 @@ class GuardrailsStatusController {
68218
68289
  }
68219
68290
  function createButtons(preText, copyButtonOnSubmit, insertButtonOnSubmit) {
68220
68291
  const container2 = document.createElement("div");
68221
- container2.className = styles$i.buttonsContainer;
68292
+ container2.className = styles$j.buttonsContainer;
68222
68293
  if (!copyButtonOnSubmit) {
68223
68294
  return container2;
68224
68295
  }
68225
68296
  const buttons2 = document.createElement("div");
68226
- buttons2.className = styles$i.buttons;
68297
+ buttons2.className = styles$j.buttons;
68227
68298
  const codeBlockActions = {
68228
68299
  copy: copyButtonOnSubmit,
68229
68300
  insert: insertButtonOnSubmit
@@ -68261,12 +68332,12 @@ function createButtons(preText, copyButtonOnSubmit, insertButtonOnSubmit) {
68261
68332
  }
68262
68333
  function createButtonsExperimentalUI(preText, humanMessage, config, codeBlockName, copyButtonOnSubmit, insertButtonOnSubmit, smartApply, smartApplyId, smartApplyState) {
68263
68334
  const container2 = document.createElement("div");
68264
- container2.className = styles$i.buttonsContainer;
68335
+ container2.className = styles$j.buttonsContainer;
68265
68336
  if (!copyButtonOnSubmit) {
68266
68337
  return container2;
68267
68338
  }
68268
68339
  const buttons2 = document.createElement("div");
68269
- buttons2.className = styles$i.buttons;
68340
+ buttons2.className = styles$j.buttons;
68270
68341
  if (smartApply && smartApplyState === CodyTaskState.Applied && smartApplyId) {
68271
68342
  const acceptButton = createAcceptButton(smartApplyId, smartApply);
68272
68343
  const rejectButton = createRejectButton(smartApplyId, smartApply);
@@ -68302,7 +68373,7 @@ function createButtonsExperimentalUI(preText, humanMessage, config, codeBlockNam
68302
68373
  function createInsertButton(preText, insertButtonOnSubmit) {
68303
68374
  const button2 = document.createElement("button");
68304
68375
  button2.title = "Insert Code at Cursor";
68305
- button2.className = styles$i.button;
68376
+ button2.className = styles$j.button;
68306
68377
  button2.innerHTML = InsertCodeBlockIcon;
68307
68378
  if (insertButtonOnSubmit) {
68308
68379
  button2.addEventListener("click", () => {
@@ -68314,7 +68385,7 @@ function createInsertButton(preText, insertButtonOnSubmit) {
68314
68385
  function createSaveButton(preText, insertButtonOnSubmit) {
68315
68386
  const button2 = document.createElement("button");
68316
68387
  button2.title = "Save Code to New File...";
68317
- button2.className = styles$i.button;
68388
+ button2.className = styles$j.button;
68318
68389
  button2.innerHTML = SaveCodeBlockIcon;
68319
68390
  if (insertButtonOnSubmit) {
68320
68391
  button2.addEventListener("click", () => insertButtonOnSubmit(preText, true));
@@ -68323,7 +68394,7 @@ function createSaveButton(preText, insertButtonOnSubmit) {
68323
68394
  }
68324
68395
  function createCodeBlockActionButton(type, text2, title2, iconSvg, codeBlockActions) {
68325
68396
  const button2 = document.createElement("button");
68326
- const className = type === "copy" ? styles$i.copyButton : styles$i.insertButton;
68397
+ const className = type === "copy" ? styles$j.copyButton : styles$j.insertButton;
68327
68398
  button2.innerHTML = iconSvg;
68328
68399
  button2.title = title2;
68329
68400
  button2.className = className;
@@ -68356,24 +68427,24 @@ function createCodeBlockActionButton(type, text2, title2, iconSvg, codeBlockActi
68356
68427
  function createCopyButton(preText, onCopy) {
68357
68428
  const button2 = document.createElement("button");
68358
68429
  button2.innerHTML = "Copy";
68359
- button2.className = styles$i.button;
68430
+ button2.className = styles$j.button;
68360
68431
  const iconContainer2 = document.createElement("div");
68361
- iconContainer2.className = styles$i.iconContainer;
68432
+ iconContainer2.className = styles$j.iconContainer;
68362
68433
  iconContainer2.innerHTML = CopyCodeBlockIcon;
68363
68434
  button2.prepend(iconContainer2);
68364
68435
  button2.addEventListener("click", () => {
68365
68436
  iconContainer2.innerHTML = CheckCodeBlockIcon;
68366
- iconContainer2.className = styles$i.iconContainer;
68437
+ iconContainer2.className = styles$j.iconContainer;
68367
68438
  button2.innerHTML = "Copied";
68368
- button2.className = styles$i.button;
68439
+ button2.className = styles$j.button;
68369
68440
  button2.prepend(iconContainer2);
68370
68441
  navigator.clipboard.writeText(preText).catch((error2) => console.error(error2));
68371
68442
  onCopy(preText, "Button");
68372
68443
  setTimeout(() => {
68373
68444
  iconContainer2.innerHTML = CopyCodeBlockIcon;
68374
- iconContainer2.className = styles$i.iconContainer;
68445
+ iconContainer2.className = styles$j.iconContainer;
68375
68446
  button2.innerHTML = "Copy";
68376
- button2.className = styles$i.button;
68447
+ button2.className = styles$j.button;
68377
68448
  button2.prepend(iconContainer2);
68378
68449
  }, 5e3);
68379
68450
  console.log("Code: Copy to Clipboard", preText);
@@ -68382,13 +68453,13 @@ function createCopyButton(preText, onCopy) {
68382
68453
  }
68383
68454
  function createApplyButton(preText, humanMessage, smartApply, smartApplyId, smartApplyState, fileName) {
68384
68455
  const button2 = document.createElement("button");
68385
- button2.className = styles$i.button;
68456
+ button2.className = styles$j.button;
68386
68457
  switch (smartApplyState) {
68387
68458
  case "Working": {
68388
68459
  button2.innerHTML = "Applying";
68389
68460
  button2.disabled = true;
68390
68461
  const iconContainer2 = document.createElement("div");
68391
- iconContainer2.className = styles$i.iconContainer;
68462
+ iconContainer2.className = styles$j.iconContainer;
68392
68463
  iconContainer2.innerHTML = SyncSpinIcon;
68393
68464
  button2.prepend(iconContainer2);
68394
68465
  break;
@@ -68396,7 +68467,7 @@ function createApplyButton(preText, humanMessage, smartApply, smartApplyId, smar
68396
68467
  default: {
68397
68468
  button2.innerHTML = "Apply";
68398
68469
  const iconContainer2 = document.createElement("div");
68399
- iconContainer2.className = styles$i.iconContainer;
68470
+ iconContainer2.className = styles$j.iconContainer;
68400
68471
  iconContainer2.innerHTML = SparkleIcon;
68401
68472
  button2.prepend(iconContainer2);
68402
68473
  button2.addEventListener(
@@ -68409,11 +68480,11 @@ function createApplyButton(preText, humanMessage, smartApply, smartApplyId, smar
68409
68480
  }
68410
68481
  function createExecuteButton(command) {
68411
68482
  const button2 = document.createElement("button");
68412
- button2.className = styles$i.button;
68483
+ button2.className = styles$j.button;
68413
68484
  button2.innerHTML = "Execute";
68414
68485
  button2.title = "Send command to Terminal";
68415
68486
  const iconContainer2 = document.createElement("div");
68416
- iconContainer2.className = styles$i.iconContainer;
68487
+ iconContainer2.className = styles$j.iconContainer;
68417
68488
  iconContainer2.innerHTML = '<i class="codicon codicon-terminal tw-align-middle"></i>';
68418
68489
  button2.prepend(iconContainer2);
68419
68490
  button2.addEventListener("click", () => {
@@ -68427,10 +68498,10 @@ function createExecuteButton(command) {
68427
68498
  }
68428
68499
  function createAcceptButton(id2, smartApply) {
68429
68500
  const button2 = document.createElement("button");
68430
- button2.className = styles$i.button;
68501
+ button2.className = styles$j.button;
68431
68502
  button2.innerHTML = "Accept";
68432
68503
  const iconContainer2 = document.createElement("div");
68433
- iconContainer2.className = styles$i.iconContainer;
68504
+ iconContainer2.className = styles$j.iconContainer;
68434
68505
  iconContainer2.innerHTML = TickIcon;
68435
68506
  button2.prepend(iconContainer2);
68436
68507
  button2.addEventListener("click", () => {
@@ -68440,10 +68511,10 @@ function createAcceptButton(id2, smartApply) {
68440
68511
  }
68441
68512
  function createRejectButton(id2, smartApply) {
68442
68513
  const button2 = document.createElement("button");
68443
- button2.className = styles$i.button;
68514
+ button2.className = styles$j.button;
68444
68515
  button2.innerHTML = "Reject";
68445
68516
  const iconContainer2 = document.createElement("div");
68446
- iconContainer2.className = styles$i.iconContainer;
68517
+ iconContainer2.className = styles$j.iconContainer;
68447
68518
  iconContainer2.innerHTML = CloseIcon;
68448
68519
  button2.prepend(iconContainer2);
68449
68520
  button2.addEventListener("click", () => {
@@ -68455,7 +68526,7 @@ function createActionsDropdown(preText) {
68455
68526
  const button2 = document.createElement("button");
68456
68527
  button2.innerHTML = EllipsisIcon;
68457
68528
  button2.title = "More Actions...";
68458
- button2.className = styles$i.button;
68529
+ button2.className = styles$j.button;
68459
68530
  const vscodeContext = {
68460
68531
  webviewSection: "codeblock-actions",
68461
68532
  preventDefaultContextMenuItems: true,
@@ -68531,7 +68602,7 @@ const ChatMessageContent = ({
68531
68602
  if (!(preElements == null ? void 0 : preElements.length) || !copyButtonOnSubmit) {
68532
68603
  return;
68533
68604
  }
68534
- const existingButtons = rootRef.current.querySelectorAll(`.${styles$i.buttonsContainer}`);
68605
+ const existingButtons = rootRef.current.querySelectorAll(`.${styles$j.buttonsContainer}`);
68535
68606
  for (const existingButton of existingButtons) {
68536
68607
  existingButton.remove();
68537
68608
  }
@@ -68552,20 +68623,24 @@ const ChatMessageContent = ({
68552
68623
  config,
68553
68624
  codeBlockName,
68554
68625
  copyButtonOnSubmit,
68555
- insertButtonOnSubmit,
68626
+ config.config.hasEditCapability ? insertButtonOnSubmit : void 0,
68556
68627
  smartApplyInterceptor,
68557
68628
  smartApplyId,
68558
68629
  smartApplyState
68559
68630
  );
68560
68631
  } else {
68561
- buttons2 = createButtons(preText, copyButtonOnSubmit, insertButtonOnSubmit);
68632
+ buttons2 = createButtons(
68633
+ preText,
68634
+ copyButtonOnSubmit,
68635
+ config.config.hasEditCapability ? insertButtonOnSubmit : void 0
68636
+ );
68562
68637
  }
68563
68638
  const metadataContainer2 = document.createElement("div");
68564
- metadataContainer2.classList.add(styles$i.metadataContainer);
68639
+ metadataContainer2.classList.add(styles$j.metadataContainer);
68565
68640
  buttons2.append(metadataContainer2);
68566
68641
  if (guardrails) {
68567
68642
  const container2 = document.createElement("div");
68568
- container2.classList.add(styles$i.attributionContainer);
68643
+ container2.classList.add(styles$j.attributionContainer);
68569
68644
  metadataContainer2.append(container2);
68570
68645
  if (!isMessageLoading) {
68571
68646
  const g2 = new GuardrailsStatusController(container2);
@@ -68589,7 +68664,7 @@ const ChatMessageContent = ({
68589
68664
  }
68590
68665
  if (fileName) {
68591
68666
  const fileNameContainer2 = document.createElement("div");
68592
- fileNameContainer2.className = styles$i.fileNameContainer;
68667
+ fileNameContainer2.className = styles$j.fileNameContainer;
68593
68668
  fileNameContainer2.textContent = getFileName(fileName);
68594
68669
  fileNameContainer2.title = fileName;
68595
68670
  metadataContainer2.append(fileNameContainer2);
@@ -68608,7 +68683,7 @@ const ChatMessageContent = ({
68608
68683
  smartApplyInterceptor,
68609
68684
  smartApplyStates
68610
68685
  ]);
68611
- return /* @__PURE__ */ jsx("div", { ref: rootRef, "data-testid": "chat-message-content", children: /* @__PURE__ */ jsx(MarkdownFromCody, { className: clsx$1(styles$i.content, className), children: displayMarkdown }) });
68686
+ return /* @__PURE__ */ jsx("div", { ref: rootRef, "data-testid": "chat-message-content", children: /* @__PURE__ */ jsx(MarkdownFromCody, { className: clsx$1(styles$j.content, className), children: displayMarkdown }) });
68612
68687
  };
68613
68688
  const $global = function() {
68614
68689
  if (typeof globalThis !== "undefined") {
@@ -71674,26 +71749,6 @@ html`
71674
71749
  ></slot>
71675
71750
  </span>
71676
71751
  `;
71677
- /*! *****************************************************************************
71678
- Copyright (c) Microsoft Corporation.
71679
-
71680
- Permission to use, copy, modify, and/or distribute this software for any
71681
- purpose with or without fee is hereby granted.
71682
-
71683
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
71684
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
71685
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
71686
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
71687
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
71688
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
71689
- PERFORMANCE OF THIS SOFTWARE.
71690
- ***************************************************************************** */
71691
- function __decorate(decorators, target, key, desc) {
71692
- var c2 = arguments.length, r2 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2;
71693
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
71694
- else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d2 = decorators[i2]) r2 = (c2 < 3 ? d2(r2) : c2 > 3 ? d2(target, key, r2) : d2(target, key)) || r2;
71695
- return c2 > 3 && r2 && Object.defineProperty(target, key, r2), r2;
71696
- }
71697
71752
  const metadataByTarget = /* @__PURE__ */ new Map();
71698
71753
  if (!("metadata" in Reflect)) {
71699
71754
  Reflect.metadata = function(key, value) {
@@ -79006,7 +79061,7 @@ class Button2 extends Button$1 {
79006
79061
  }
79007
79062
  }
79008
79063
  }
79009
- __decorate$1([
79064
+ __decorate([
79010
79065
  attr
79011
79066
  ], Button2.prototype, "appearance", void 0);
79012
79067
  const vsCodeButton = Button2.compose({
@@ -80298,17 +80353,17 @@ wrap(vsCodeTextField(), {
80298
80353
  const errorItem = "_error-item_1qtot_1";
80299
80354
  const icon = "_icon_1qtot_7";
80300
80355
  const body = "_body_1qtot_11";
80301
- const actions$1 = "_actions_1qtot_44";
80356
+ const actions$2 = "_actions_1qtot_44";
80302
80357
  const retryMessage = "_retry-message_1qtot_50";
80303
80358
  const bannerContainer = "_banner-container_1qtot_55";
80304
80359
  const banner = "_banner_1qtot_55";
80305
80360
  const requestError = "_request-error_1qtot_128";
80306
80361
  const requestErrorTitle = "_request-error-title_1qtot_141";
80307
- const styles$g = {
80362
+ const styles$h = {
80308
80363
  errorItem,
80309
80364
  icon,
80310
80365
  body,
80311
- actions: actions$1,
80366
+ actions: actions$2,
80312
80367
  retryMessage,
80313
80368
  bannerContainer,
80314
80369
  banner,
@@ -80328,8 +80383,8 @@ const ErrorItem = ({ error: error2, userInfo, postMessage }) => {
80328
80383
  }
80329
80384
  return /* @__PURE__ */ jsx(RequestErrorItem, { error: error2.message });
80330
80385
  };
80331
- const RequestErrorItem = ({ error: error2 }) => /* @__PURE__ */ jsxs("div", { className: styles$g.requestError, children: [
80332
- /* @__PURE__ */ jsx("span", { className: styles$g.requestErrorTitle, children: "Request Failed: " }),
80386
+ const RequestErrorItem = ({ error: error2 }) => /* @__PURE__ */ jsxs("div", { className: styles$h.requestError, children: [
80387
+ /* @__PURE__ */ jsx("span", { className: styles$h.requestErrorTitle, children: "Request Failed: " }),
80333
80388
  error2
80334
80389
  ] });
80335
80390
  const RateLimitErrorItem = ({ error: error2, userInfo, postMessage }) => {
@@ -80362,9 +80417,9 @@ const RateLimitErrorItem = ({ error: error2, userInfo, postMessage }) => {
80362
80417
  },
80363
80418
  [postMessage, tier, telemetryRecorder]
80364
80419
  );
80365
- return /* @__PURE__ */ jsxs("div", { className: styles$g.errorItem, children: [
80366
- canUpgrade && /* @__PURE__ */ jsx("div", { className: styles$g.icon, children: "⚡️" }),
80367
- /* @__PURE__ */ jsxs("div", { className: styles$g.body, children: [
80420
+ return /* @__PURE__ */ jsxs("div", { className: styles$h.errorItem, children: [
80421
+ canUpgrade && /* @__PURE__ */ jsx("div", { className: styles$h.icon, children: "⚡️" }),
80422
+ /* @__PURE__ */ jsxs("div", { className: styles$h.body, children: [
80368
80423
  /* @__PURE__ */ jsxs("header", { children: [
80369
80424
  /* @__PURE__ */ jsx("h1", { children: canUpgrade ? "Upgrade to Cody Pro" : "Unable to Send Message" }),
80370
80425
  /* @__PURE__ */ jsxs("p", { children: [
@@ -80372,7 +80427,7 @@ const RateLimitErrorItem = ({ error: error2, userInfo, postMessage }) => {
80372
80427
  canUpgrade && " Upgrade to Cody Pro for unlimited autocomplete suggestions, chat messages and commands."
80373
80428
  ] })
80374
80429
  ] }),
80375
- /* @__PURE__ */ jsxs("div", { className: styles$g.actions, children: [
80430
+ /* @__PURE__ */ jsxs("div", { className: styles$h.actions, children: [
80376
80431
  canUpgrade && /* @__PURE__ */ jsx(
80377
80432
  VSCodeButton,
80378
80433
  {
@@ -80391,12 +80446,12 @@ const RateLimitErrorItem = ({ error: error2, userInfo, postMessage }) => {
80391
80446
  }
80392
80447
  )
80393
80448
  ] }),
80394
- error2.retryMessage && /* @__PURE__ */ jsx("p", { className: styles$g.retryMessage, children: error2.retryMessage })
80449
+ error2.retryMessage && /* @__PURE__ */ jsx("p", { className: styles$h.retryMessage, children: error2.retryMessage })
80395
80450
  ] }),
80396
- canUpgrade && /* @__PURE__ */ jsx("div", { className: styles$g.bannerContainer, children: /* @__PURE__ */ jsx(
80451
+ canUpgrade && /* @__PURE__ */ jsx("div", { className: styles$h.bannerContainer, children: /* @__PURE__ */ jsx(
80397
80452
  "div",
80398
80453
  {
80399
- className: styles$g.banner,
80454
+ className: styles$h.banner,
80400
80455
  role: "button",
80401
80456
  tabIndex: -1,
80402
80457
  onClick: () => onButtonClick("upgrade", "upgrade"),
@@ -80409,7 +80464,7 @@ const RateLimitErrorItem = ({ error: error2, userInfo, postMessage }) => {
80409
80464
  const feedbackButtons = "_feedback-buttons_16gni_1";
80410
80465
  const feedbackButton = "_feedback-button_16gni_1";
80411
80466
  const thumbsDownFeedbackContainer = "_thumbs-down-feedback-container_16gni_14";
80412
- const styles$f = {
80467
+ const styles$g = {
80413
80468
  feedbackButtons,
80414
80469
  feedbackButton,
80415
80470
  thumbsDownFeedbackContainer
@@ -80426,12 +80481,12 @@ const FeedbackButtons = ({
80426
80481
  },
80427
80482
  [feedbackButtonsOnSubmit]
80428
80483
  );
80429
- return /* @__PURE__ */ jsxs("div", { className: clsx$1(styles$f.feedbackButtons, className), children: [
80484
+ return /* @__PURE__ */ jsxs("div", { className: clsx$1(styles$g.feedbackButtons, className), children: [
80430
80485
  !feedbackSubmitted && /* @__PURE__ */ jsxs(Fragment, { children: [
80431
80486
  /* @__PURE__ */ jsx(
80432
80487
  VSCodeButton,
80433
80488
  {
80434
- className: clsx$1("tw-text-muted-foreground", styles$f.feedbackButton),
80489
+ className: clsx$1("tw-text-muted-foreground", styles$g.feedbackButton),
80435
80490
  appearance: "icon",
80436
80491
  type: "button",
80437
80492
  onClick: () => onFeedbackBtnSubmit("thumbsUp"),
@@ -80442,7 +80497,7 @@ const FeedbackButtons = ({
80442
80497
  /* @__PURE__ */ jsx(
80443
80498
  VSCodeButton,
80444
80499
  {
80445
- className: clsx$1("tw-text-muted-foreground", styles$f.feedbackButton),
80500
+ className: clsx$1("tw-text-muted-foreground", styles$g.feedbackButton),
80446
80501
  appearance: "icon",
80447
80502
  type: "button",
80448
80503
  onClick: () => onFeedbackBtnSubmit("thumbsDown"),
@@ -80454,7 +80509,7 @@ const FeedbackButtons = ({
80454
80509
  feedbackSubmitted === "thumbsUp" && /* @__PURE__ */ jsxs(
80455
80510
  VSCodeButton,
80456
80511
  {
80457
- className: clsx$1(styles$f.feedbackButton),
80512
+ className: clsx$1(styles$g.feedbackButton),
80458
80513
  appearance: "icon",
80459
80514
  type: "button",
80460
80515
  disabled: true,
@@ -80465,11 +80520,11 @@ const FeedbackButtons = ({
80465
80520
  ]
80466
80521
  }
80467
80522
  ),
80468
- feedbackSubmitted === "thumbsDown" && /* @__PURE__ */ jsxs("span", { className: styles$f.thumbsDownFeedbackContainer, children: [
80523
+ feedbackSubmitted === "thumbsDown" && /* @__PURE__ */ jsxs("span", { className: styles$g.thumbsDownFeedbackContainer, children: [
80469
80524
  /* @__PURE__ */ jsxs(
80470
80525
  VSCodeButton,
80471
80526
  {
80472
- className: clsx$1(styles$f.feedbackButton),
80527
+ className: clsx$1(styles$g.feedbackButton),
80473
80528
  appearance: "icon",
80474
80529
  type: "button",
80475
80530
  disabled: true,
@@ -80752,11 +80807,15 @@ function useChatModelByID(model, chatModels) {
80752
80807
  tags: []
80753
80808
  } : void 0);
80754
80809
  }
80755
- const contextItem = "_context-item_911i8_1";
80756
- const contextItemMetadata = "_context-item-metadata_911i8_6";
80757
- const styles$e = {
80810
+ const contextItem = "_context-item_19lcq_1";
80811
+ const contextItemMetadata = "_context-item-metadata_19lcq_6";
80812
+ const contextItemEditButton = "_context-item-edit-button_19lcq_12";
80813
+ const contextItemEditButtonIcon = "_context-item-edit-button-icon_19lcq_20";
80814
+ const styles$f = {
80758
80815
  contextItem,
80759
- contextItemMetadata
80816
+ contextItemMetadata,
80817
+ contextItemEditButton,
80818
+ contextItemEditButtonIcon
80760
80819
  };
80761
80820
  const ContextCell = memo(
80762
80821
  ({
@@ -80770,7 +80829,9 @@ const ContextCell = memo(
80770
80829
  reSubmitWithChatIntent,
80771
80830
  showSnippets = false,
80772
80831
  isContextLoading,
80773
- onAddToFollowupChat
80832
+ onAddToFollowupChat,
80833
+ onManuallyEditContext,
80834
+ editContextText
80774
80835
  }) => {
80775
80836
  const [selectedAlternative, setSelectedAlternative] = useState(void 0);
80776
80837
  const incrementSelectedAlternative = useCallback(
@@ -80801,14 +80862,26 @@ const ContextCell = memo(
80801
80862
  contextItemsToDisplay,
80802
80863
  isForFirstMessage
80803
80864
  );
80804
- const logContextOpening = useCallback(() => {
80805
- telemetryRecorder.recordEvent("cody.contextCell", "opened", {
80806
- metadata: {
80807
- fileCount: new Set(usedContext.map((file) => file.uri.toString())).size,
80808
- excludedAtContext: excludedContext.length
80865
+ const [accordionValue, setAccordionValue] = useState(
80866
+ (__storybook__initialOpen || defaultOpen) && "item-1" || void 0
80867
+ );
80868
+ const triggerAccordion = useCallback(() => {
80869
+ setAccordionValue((prev) => {
80870
+ if (!prev) {
80871
+ telemetryRecorder.recordEvent("cody.contextCell", "opened", {
80872
+ metadata: {
80873
+ fileCount: new Set(usedContext.map((file) => file.uri.toString())).size,
80874
+ excludedAtContext: excludedContext.length
80875
+ }
80876
+ });
80809
80877
  }
80878
+ return prev ? "" : "item-1";
80810
80879
  });
80811
80880
  }, [excludedContext.length, usedContext]);
80881
+ const onEditContext = useCallback(() => {
80882
+ triggerAccordion();
80883
+ onManuallyEditContext();
80884
+ }, [triggerAccordion, onManuallyEditContext]);
80812
80885
  const {
80813
80886
  config: { internalDebugContext }
80814
80887
  } = useConfig();
@@ -80825,6 +80898,7 @@ const ContextCell = memo(
80825
80898
  [telemetryRecorder, oneboxEnabled]
80826
80899
  );
80827
80900
  const [showAllResults, setShowAllResults] = useState(false);
80901
+ const isDeepCodyEnabled = useMemo(() => model == null ? void 0 : model.includes("deep-cody"), [model]);
80828
80902
  return /* @__PURE__ */ jsxs("div", { children: [
80829
80903
  (contextItemsToDisplay === void 0 || contextItemsToDisplay.length !== 0) && /* @__PURE__ */ jsx(
80830
80904
  Accordion,
@@ -80834,14 +80908,14 @@ const ContextCell = memo(
80834
80908
  defaultValue: (__storybook__initialOpen || defaultOpen) && "item-1" || void 0,
80835
80909
  onValueChange: logValueChange,
80836
80910
  asChild: true,
80911
+ value: accordionValue,
80837
80912
  children: /* @__PURE__ */ jsx(AccordionItem, { value: "item-1", asChild: true, children: /* @__PURE__ */ jsx(
80838
80913
  Cell,
80839
80914
  {
80840
80915
  header: /* @__PURE__ */ jsxs(
80841
80916
  AccordionTrigger,
80842
80917
  {
80843
- onClick: logContextOpening,
80844
- onKeyUp: logContextOpening,
80918
+ onClick: triggerAccordion,
80845
80919
  title: itemCountLabel,
80846
80920
  className: "tw-flex tw-items-center tw-gap-4",
80847
80921
  disabled: isContextLoading,
@@ -80854,14 +80928,11 @@ const ContextCell = memo(
80854
80928
  }
80855
80929
  ),
80856
80930
  /* @__PURE__ */ jsxs("span", { className: "tw-flex tw-items-baseline", children: [
80857
- "Context",
80931
+ isContextLoading ? isDeepCodyEnabled ? "Thinking" : "Fetching context" : "Fetched context",
80858
80932
  /* @__PURE__ */ jsxs("span", { className: "tw-opacity-60 tw-text-sm tw-ml-2", children: [
80859
80933
  "—",
80860
80934
  " ",
80861
- isContextLoading ? (
80862
- // TODO: Removes hardcoded model.
80863
- (model == null ? void 0 : model.includes("deep-cody")) ? "Thinking..." : "Retrieving codebase files…"
80864
- ) : itemCountLabel
80935
+ isContextLoading ? isDeepCodyEnabled ? "Retrieving context…" : "Retrieving codebase files…" : itemCountLabel
80865
80936
  ] })
80866
80937
  ] })
80867
80938
  ]
@@ -80871,6 +80942,16 @@ const ContextCell = memo(
80871
80942
  contentClassName: "tw-flex tw-flex-col tw-gap-4 tw-max-w-full",
80872
80943
  "data-testid": "context",
80873
80944
  children: contextItems === void 0 ? /* @__PURE__ */ jsx(LoadingDots, {}) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(AccordionContent, { overflow: showSnippets, children: [
80945
+ /* @__PURE__ */ jsx(
80946
+ Button$2,
80947
+ {
80948
+ size: "sm",
80949
+ variant: "outline",
80950
+ className: clsx$1("tw-pr-4", styles$f.contextItemEditButton),
80951
+ onClick: onEditContext,
80952
+ children: editContextText
80953
+ }
80954
+ ),
80874
80955
  internalDebugContext && contextAlternatives && /* @__PURE__ */ jsxs("div", { children: [
80875
80956
  /* @__PURE__ */ jsx(
80876
80957
  "button",
@@ -80911,7 +80992,7 @@ const ContextCell = memo(
80911
80992
  internalDebugContext && item2.metadata && item2.metadata.length > 0 && /* @__PURE__ */ jsx(
80912
80993
  "span",
80913
80994
  {
80914
- className: styles$e.contextItemMetadata,
80995
+ className: styles$f.contextItemMetadata,
80915
80996
  children: item2.metadata.join(", ")
80916
80997
  }
80917
80998
  )
@@ -80951,7 +81032,7 @@ const ContextCell = memo(
80951
81032
  "span",
80952
81033
  {
80953
81034
  className: clsx$1(
80954
- styles$e.contextItem,
81035
+ styles$f.contextItem,
80955
81036
  "tw-flex tw-items-center tw-gap-2"
80956
81037
  ),
80957
81038
  children: [
@@ -80971,7 +81052,7 @@ const ContextCell = memo(
80971
81052
  "span",
80972
81053
  {
80973
81054
  className: clsx$1(
80974
- styles$e.contextItem,
81055
+ styles$f.contextItem,
80975
81056
  "tw-flex tw-items-center tw-gap-2"
80976
81057
  ),
80977
81058
  children: [
@@ -80982,7 +81063,7 @@ const ContextCell = memo(
80982
81063
  className: "tw-ml-1"
80983
81064
  }
80984
81065
  ),
80985
- /* @__PURE__ */ jsx("span", { children: "Public knowledge" })
81066
+ /* @__PURE__ */ jsx("span", { children: isDeepCodyEnabled ? "Reviewed by Deep Cody" : "Public knowledge" })
80986
81067
  ]
80987
81068
  }
80988
81069
  ) }),
@@ -81048,7 +81129,7 @@ const ExcludedContextWarning = ({ message: message2 }) => /* @__PURE__ */ jsxs("
81048
81129
  ] });
81049
81130
  const userAvatar = "_user-avatar_1ll2x_1";
81050
81131
  const sourcegraphGradientBorder = "_sourcegraph-gradient-border_1ll2x_12";
81051
- const styles$d = {
81132
+ const styles$e = {
81052
81133
  userAvatar,
81053
81134
  sourcegraphGradientBorder
81054
81135
  };
@@ -81067,7 +81148,7 @@ const UserAvatar = ({
81067
81148
  className: sourcegraphGradientBorder2 ? void 0 : className
81068
81149
  }
81069
81150
  );
81070
- return sourcegraphGradientBorder2 ? /* @__PURE__ */ jsx("div", { className: clsx$1(styles$d.sourcegraphGradientBorder, "tw-inline-flex", className), children: inner }) : inner;
81151
+ return sourcegraphGradientBorder2 ? /* @__PURE__ */ jsx("div", { className: clsx$1(styles$e.sourcegraphGradientBorder, "tw-inline-flex", className), children: inner }) : inner;
81071
81152
  };
81072
81153
  const InnerUserAvatar = ({
81073
81154
  user,
@@ -81089,7 +81170,7 @@ const InnerUserAvatar = ({
81089
81170
  return /* @__PURE__ */ jsx(
81090
81171
  "img",
81091
81172
  {
81092
- className: styles$d.userAvatar,
81173
+ className: styles$e.userAvatar,
81093
81174
  src: url,
81094
81175
  role: "presentation",
81095
81176
  title: title2,
@@ -81103,9 +81184,9 @@ const InnerUserAvatar = ({
81103
81184
  "div",
81104
81185
  {
81105
81186
  title: title2,
81106
- className: clsx$1(styles$d.userAvatar, className),
81187
+ className: clsx$1(styles$e.userAvatar, className),
81107
81188
  style: { width: `${size2}px`, height: `${size2}px` },
81108
- children: /* @__PURE__ */ jsx("span", { className: styles$d.initials, children: getInitials((user == null ? void 0 : user.displayName) || (user == null ? void 0 : user.username) || "") })
81189
+ children: /* @__PURE__ */ jsx("span", { className: styles$e.initials, children: getInitials((user == null ? void 0 : user.displayName) || (user == null ? void 0 : user.username) || "") })
81109
81190
  }
81110
81191
  );
81111
81192
  };
@@ -81117,12 +81198,12 @@ function getInitials(fullName) {
81117
81198
  }
81118
81199
  return initials[0];
81119
81200
  }
81120
- const container$1 = "_container_16hae_6";
81121
- const editor = "_editor_16hae_17";
81122
- const toolbar = "_toolbar_16hae_23";
81123
- const focused = "_focused_16hae_28";
81124
- const editorContentEditable = "_editor-content-editable_16hae_50";
81125
- const styles$c = {
81201
+ const container$1 = "_container_1eiqs_6";
81202
+ const editor = "_editor_1eiqs_17";
81203
+ const toolbar = "_toolbar_1eiqs_23";
81204
+ const focused = "_focused_1eiqs_28";
81205
+ const editorContentEditable = "_editor-content-editable_1eiqs_30";
81206
+ const styles$d = {
81126
81207
  container: container$1,
81127
81208
  editor,
81128
81209
  toolbar,
@@ -81152,7 +81233,7 @@ const buttonPrimary = "_button--primary_rqosg_41";
81152
81233
  const buttonNoIconStart = "_button--no-icon-start_rqosg_45";
81153
81234
  const buttonNoIconEnd = "_button--no-icon-end_rqosg_49";
81154
81235
  const buttonSecondary = "_button--secondary_rqosg_54";
81155
- const styles$b = {
81236
+ const styles$c = {
81156
81237
  button,
81157
81238
  buttonIconEndChevron,
81158
81239
  buttonPrimary,
@@ -81186,11 +81267,11 @@ const ToolbarButton = forwardRef(
81186
81267
  const button2 = /* @__PURE__ */ jsxs(
81187
81268
  Comp,
81188
81269
  {
81189
- className: cn(buttonVariants({ variant, className }), styles$b.button, {
81190
- [styles$b.buttonPrimary]: variant === "primary",
81191
- [styles$b.buttonSecondary]: variant === "secondary",
81192
- [styles$b.buttonNoIconStart]: children2 && !IconStart,
81193
- [styles$b.buttonNoIconEnd]: children2 && !IconEnd
81270
+ className: cn(buttonVariants({ variant, className }), styles$c.button, {
81271
+ [styles$c.buttonPrimary]: variant === "primary",
81272
+ [styles$c.buttonSecondary]: variant === "secondary",
81273
+ [styles$c.buttonNoIconStart]: children2 && !IconStart,
81274
+ [styles$c.buttonNoIconEnd]: children2 && !IconEnd
81194
81275
  }),
81195
81276
  ref: ref2,
81196
81277
  ...props,
@@ -81285,7 +81366,7 @@ const disabled = "_disabled_1bw6t_23";
81285
81366
  const modelIcon = "_model-icon_1bw6t_27";
81286
81367
  const rightIcon = "_right-icon_1bw6t_31";
81287
81368
  const badge = "_badge_1bw6t_35";
81288
- const styles$a = {
81369
+ const styles$b = {
81289
81370
  modelTitleWithIcon,
81290
81371
  modelName,
81291
81372
  modelProvider,
@@ -81436,7 +81517,7 @@ const ModelSelectField = ({
81436
81517
  children: /* @__PURE__ */ jsxs(
81437
81518
  CommandList,
81438
81519
  {
81439
- className: "model-selector-popover",
81520
+ className: "model-selector-popover tw-max-h-[80vh] tw-overflow-y-auto",
81440
81521
  "data-testid": "chat-model-popover-option",
81441
81522
  children: [
81442
81523
  optionsByGroup.map(({ group, options: options2 }) => /* @__PURE__ */ jsx(CommandGroup, { heading: group, children: options2.map((option) => /* @__PURE__ */ jsx(
@@ -81460,14 +81541,14 @@ const ModelSelectField = ({
81460
81541
  href: "https://sourcegraph.com/docs/cody/clients/install-vscode#supported-llm-models",
81461
81542
  target: "_blank",
81462
81543
  rel: "noreferrer",
81463
- className: styles$a.modelTitleWithIcon,
81544
+ className: styles$b.modelTitleWithIcon,
81464
81545
  children: [
81465
- /* @__PURE__ */ jsxs("span", { className: styles$a.modelIcon, children: [
81546
+ /* @__PURE__ */ jsxs("span", { className: styles$b.modelIcon, children: [
81466
81547
  /* @__PURE__ */ jsx(BookOpen, { size: 16, strokeWidth: 2 }),
81467
81548
  " "
81468
81549
  ] }),
81469
- /* @__PURE__ */ jsx("span", { className: styles$a.modelName, children: "Documentation" }),
81470
- /* @__PURE__ */ jsx("span", { className: styles$a.rightIcon, children: /* @__PURE__ */ jsx(
81550
+ /* @__PURE__ */ jsx("span", { className: styles$b.modelName, children: "Documentation" }),
81551
+ /* @__PURE__ */ jsx("span", { className: styles$b.rightIcon, children: /* @__PURE__ */ jsx(
81471
81552
  ExternalLink,
81472
81553
  {
81473
81554
  size: 16,
@@ -81496,14 +81577,14 @@ const ModelSelectField = ({
81496
81577
  }
81497
81578
  );
81498
81579
  },
81499
- className: styles$a.modelTitleWithIcon,
81580
+ className: styles$b.modelTitleWithIcon,
81500
81581
  children: [
81501
- /* @__PURE__ */ jsxs("span", { className: styles$a.modelIcon, children: [
81582
+ /* @__PURE__ */ jsxs("span", { className: styles$b.modelIcon, children: [
81502
81583
  /* @__PURE__ */ jsx(Building, { size: 16, strokeWidth: 2 }),
81503
81584
  " "
81504
81585
  ] }),
81505
- /* @__PURE__ */ jsx("span", { className: styles$a.modelName, children: "Enterprise Model Options" }),
81506
- /* @__PURE__ */ jsx("span", { className: styles$a.rightIcon, children: /* @__PURE__ */ jsx(
81586
+ /* @__PURE__ */ jsx("span", { className: styles$b.modelName, children: "Enterprise Model Options" }),
81587
+ /* @__PURE__ */ jsx("span", { className: styles$b.rightIcon, children: /* @__PURE__ */ jsx(
81507
81588
  ExternalLink,
81508
81589
  {
81509
81590
  size: 16,
@@ -81543,19 +81624,23 @@ function modelAvailability(userInfo, serverSentModelsEnabled, model) {
81543
81624
  return "available";
81544
81625
  }
81545
81626
  function getTooltip(model, availability) {
81627
+ if (model.id.includes("deep-cody")) {
81628
+ return "Uses Claude 3.5 Sonnet (New) with other models to fetch any extra context needed for better responses";
81629
+ }
81546
81630
  if (model.tags.includes(ModelTag.Waitlist)) {
81547
81631
  return "Request access to this new model";
81548
81632
  }
81549
81633
  if (model.tags.includes(ModelTag.OnWaitlist)) {
81550
81634
  return "Request received, we will reach out with next steps";
81551
81635
  }
81636
+ const capitalizedProvider = model.provider === "openai" ? "OpenAI" : model.provider.charAt(0).toUpperCase() + model.provider.slice(1);
81552
81637
  switch (availability) {
81553
81638
  case "not-selectable-on-enterprise":
81554
81639
  return "Chat model set by your Sourcegraph Enterprise admin";
81555
81640
  case "needs-cody-pro":
81556
- return `Upgrade to Cody Pro to use ${model.title} by ${model.provider}`;
81641
+ return `Upgrade to Cody Pro to use ${model.title} by ${capitalizedProvider}`;
81557
81642
  default:
81558
- return `${model.title} by ${model.provider}`;
81643
+ return `${model.title} by ${capitalizedProvider}`;
81559
81644
  }
81560
81645
  }
81561
81646
  const getBadgeText = (model, modelAvailability2) => {
@@ -81575,14 +81660,21 @@ const getBadgeText = (model, modelAvailability2) => {
81575
81660
  const ModelTitleWithIcon = ({ model, showIcon, modelAvailability: modelAvailability2 }) => {
81576
81661
  const modelBadge = getBadgeText(model, modelAvailability2);
81577
81662
  const isDisabled = modelAvailability2 !== "available";
81578
- return /* @__PURE__ */ jsxs("span", { className: clsx$1(styles$a.modelTitleWithIcon, { [styles$a.disabled]: isDisabled }), children: [
81579
- showIcon && /* @__PURE__ */ jsx(ChatModelIcon, { model: model.provider, className: styles$a.modelIcon }),
81580
- /* @__PURE__ */ jsx("span", { className: clsx$1("tw-flex-grow", styles$a.modelName), children: model.title }),
81663
+ if (model.id.includes("deep-cody")) {
81664
+ return /* @__PURE__ */ jsxs("span", { className: clsx$1(styles$b.modelTitleWithIcon, { [styles$b.disabled]: isDisabled }), children: [
81665
+ showIcon && /* @__PURE__ */ jsx(FlaskConical, { size: 16, className: styles$b.modelIcon }),
81666
+ /* @__PURE__ */ jsx("span", { className: clsx$1("tw-flex-grow", styles$b.modelName), children: model.title }),
81667
+ /* @__PURE__ */ jsx(Badge3, { variant: "secondary", className: styles$b.badge, children: "Experimental ⓘ" })
81668
+ ] });
81669
+ }
81670
+ return /* @__PURE__ */ jsxs("span", { className: clsx$1(styles$b.modelTitleWithIcon, { [styles$b.disabled]: isDisabled }), children: [
81671
+ showIcon && /* @__PURE__ */ jsx(ChatModelIcon, { model: model.provider, className: styles$b.modelIcon }),
81672
+ /* @__PURE__ */ jsx("span", { className: clsx$1("tw-flex-grow", styles$b.modelName), children: model.title }),
81581
81673
  modelBadge && /* @__PURE__ */ jsx(
81582
81674
  Badge3,
81583
81675
  {
81584
81676
  variant: "secondary",
81585
- className: clsx$1(styles$a.badge, {
81677
+ className: clsx$1(styles$b.badge, {
81586
81678
  "tw-opacity-75": modelAvailability2 === "needs-cody-pro"
81587
81679
  }),
81588
81680
  children: modelBadge
@@ -81598,7 +81690,7 @@ const ChatModelIcon = ({
81598
81690
  return ModelIcon ? /* @__PURE__ */ jsx(ModelIcon, { size: 16, className }) : null;
81599
81691
  };
81600
81692
  const ModelUIGroup = {
81601
- DeepCody: "Mixed models",
81693
+ DeepCody: "Mixed models, extended processing",
81602
81694
  Power: "More powerful models",
81603
81695
  Balanced: "Balanced for power and speed",
81604
81696
  Speed: "Faster models",
@@ -81736,16 +81828,16 @@ const useDebounce = (value, delay) => {
81736
81828
  function commandRowValue(row2) {
81737
81829
  return row2.actionType === "prompt" ? `prompt-${row2.id}` : `command-${row2.key}`;
81738
81830
  }
81739
- const item$1 = "_item_1xr6n_2";
81740
- const itemIndicator = "_item--indicator_1xr6n_13";
81741
- const promptAvatar = "_prompt--avatar_1xr6n_18";
81742
- const promptDescription = "_prompt--description_1xr6n_18";
81743
- const promptIcon = "_prompt--icon_1xr6n_18";
81744
- const prompt = "_prompt_1xr6n_18";
81745
- const promptContent = "_prompt--content_1xr6n_1";
81746
- const promptTitle = "_prompt--title_1xr6n_1";
81747
- const promptName = "_prompt--name_1xr6n_1";
81748
- const styles$9 = {
81831
+ const item$1 = "_item_105bl_2";
81832
+ const itemIndicator = "_item--indicator_105bl_13";
81833
+ const promptAvatar = "_prompt--avatar_105bl_18";
81834
+ const promptDescription = "_prompt--description_105bl_18";
81835
+ const promptIcon = "_prompt--icon_105bl_18";
81836
+ const prompt = "_prompt_105bl_18";
81837
+ const promptContent = "_prompt--content_105bl_1";
81838
+ const promptTitle = "_prompt--title_105bl_1";
81839
+ const promptName = "_prompt--name_105bl_1";
81840
+ const styles$a = {
81749
81841
  item: item$1,
81750
81842
  itemIndicator,
81751
81843
  promptAvatar,
@@ -81762,7 +81854,7 @@ const ActionItem = (props) => {
81762
81854
  CommandItem,
81763
81855
  {
81764
81856
  value: commandRowValue(action2),
81765
- className: clsx$1(className, styles$9.item),
81857
+ className: clsx$1(className, styles$a.item),
81766
81858
  onSelect,
81767
81859
  children: action2.actionType === "prompt" ? /* @__PURE__ */ jsx(ActionPrompt, { prompt: action2 }) : /* @__PURE__ */ jsx(ActionCommand, { command: action2 })
81768
81860
  }
@@ -81770,21 +81862,25 @@ const ActionItem = (props) => {
81770
81862
  };
81771
81863
  const ActionPrompt = (props) => {
81772
81864
  const { prompt: prompt2 } = props;
81773
- return /* @__PURE__ */ jsxs("div", { className: styles$9.prompt, children: [
81865
+ return /* @__PURE__ */ jsxs("div", { className: styles$a.prompt, children: [
81774
81866
  /* @__PURE__ */ jsx(
81775
81867
  UserAvatar,
81776
81868
  {
81777
81869
  size: 22,
81778
81870
  user: { ...prompt2.createdBy, endpoint: "" },
81779
- className: styles$9.promptAvatar
81871
+ className: styles$a.promptAvatar
81780
81872
  }
81781
81873
  ),
81782
- /* @__PURE__ */ jsxs("div", { className: styles$9.promptContent, children: [
81783
- /* @__PURE__ */ jsxs("div", { className: styles$9.promptTitle, children: [
81784
- /* @__PURE__ */ jsx("strong", { className: styles$9.promptName, children: prompt2.name }),
81785
- prompt2.draft && /* @__PURE__ */ jsx(Badge3, { variant: "secondary", className: "tw-text-xxs tw-mt-0.5", children: "Draft" })
81874
+ /* @__PURE__ */ jsxs("div", { className: styles$a.promptContent, children: [
81875
+ /* @__PURE__ */ jsxs("div", { className: styles$a.promptTitle, children: [
81876
+ /* @__PURE__ */ jsx("strong", { className: styles$a.promptName, children: prompt2.name }),
81877
+ prompt2.draft && /* @__PURE__ */ jsx(Badge3, { variant: "secondary", className: "tw-text-xxs tw-mt-0.5", children: "Draft" }),
81878
+ prompt2.recommended && /* @__PURE__ */ jsxs(Tooltip, { children: [
81879
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(BookUp2, { size: 12, className: styles$a.promptIcon }) }),
81880
+ /* @__PURE__ */ jsx(TooltipContent, { children: "This prompt was promoted by your admin" })
81881
+ ] })
81786
81882
  ] }),
81787
- /* @__PURE__ */ jsx("span", { className: styles$9.promptDescription, children: prompt2.description ?? "(No description provided)" })
81883
+ /* @__PURE__ */ jsx("span", { className: styles$a.promptDescription, children: prompt2.description ?? "(No description provided)" })
81788
81884
  ] })
81789
81885
  ] });
81790
81886
  };
@@ -81806,11 +81902,11 @@ const ActionCommand = (props) => {
81806
81902
  const { command } = props;
81807
81903
  const Icon2 = COMMAND_ICONS[command.key] ?? PencilRuler;
81808
81904
  const description2 = command.type !== "default" ? command.description : COMMAND_DESCRIPTIONS[command.key];
81809
- return /* @__PURE__ */ jsxs("div", { className: styles$9.prompt, children: [
81810
- /* @__PURE__ */ jsx("div", { className: styles$9.promptAvatar, children: /* @__PURE__ */ jsx(Icon2, { size: 16, strokeWidth: 1.5, className: styles$9.promptIcon }) }),
81811
- /* @__PURE__ */ jsxs("div", { className: styles$9.promptContent, children: [
81812
- /* @__PURE__ */ jsxs("div", { className: styles$9.promptTitle, children: [
81813
- /* @__PURE__ */ jsx("strong", { className: styles$9.promptName, children: command.type === "default" ? command.description : command.key }),
81905
+ return /* @__PURE__ */ jsxs("div", { className: styles$a.prompt, children: [
81906
+ /* @__PURE__ */ jsx("div", { className: styles$a.promptAvatar, children: /* @__PURE__ */ jsx(Icon2, { size: 16, strokeWidth: 1.5, className: styles$a.promptIcon }) }),
81907
+ /* @__PURE__ */ jsxs("div", { className: styles$a.promptContent, children: [
81908
+ /* @__PURE__ */ jsxs("div", { className: styles$a.promptTitle, children: [
81909
+ /* @__PURE__ */ jsx("strong", { className: styles$a.promptName, children: command.type === "default" ? command.description : command.key }),
81814
81910
  command.type !== "default" && /* @__PURE__ */ jsx(
81815
81911
  Badge3,
81816
81912
  {
@@ -81820,20 +81916,20 @@ const ActionCommand = (props) => {
81820
81916
  }
81821
81917
  )
81822
81918
  ] }),
81823
- /* @__PURE__ */ jsx("span", { className: styles$9.promptDescription, children: description2 ?? "(No description provided)" })
81919
+ /* @__PURE__ */ jsx("span", { className: styles$a.promptDescription, children: description2 ?? "(No description provided)" })
81824
81920
  ] })
81825
81921
  ] });
81826
81922
  };
81827
- function usePromptsQuery(query) {
81923
+ function usePromptsQuery(input) {
81828
81924
  const prompts = useExtensionAPI().prompts;
81829
- return useObservable(useMemo(() => prompts(query), [prompts, query]));
81925
+ return useObservable(useMemo(() => prompts(input), [prompts, input]));
81830
81926
  }
81831
81927
  const list = "_list_q63t8_2";
81832
81928
  const listInputContainer = "_list--input-container_q63t8_1";
81833
81929
  const listInput = "_list--input_q63t8_1";
81834
81930
  const listChips = "_list-chips_q63t8_1";
81835
81931
  const listItem = "_list--item_q63t8_32";
81836
- const styles$8 = {
81932
+ const styles$9 = {
81837
81933
  list,
81838
81934
  listInputContainer,
81839
81935
  listInput,
@@ -81846,14 +81942,13 @@ const PromptList = (props) => {
81846
81942
  showFirstNItems,
81847
81943
  telemetryLocation,
81848
81944
  showOnlyPromptInsertableCommands,
81849
- showInitialSelectedItem = true,
81850
81945
  showPromptLibraryUnsupportedMessage = true,
81851
81946
  className,
81852
81947
  inputClassName,
81853
81948
  paddingLevels = "none",
81854
81949
  appearanceMode = "flat-list",
81855
81950
  lastUsedSorting,
81856
- includeEditCommandOnTop,
81951
+ recommendedOnly,
81857
81952
  onSelect: parentOnSelect
81858
81953
  } = props;
81859
81954
  const endpointURL = new URL(useConfig().authStatus.endpoint);
@@ -81864,7 +81959,15 @@ const PromptList = (props) => {
81864
81959
  };
81865
81960
  const [query, setQuery] = useState("");
81866
81961
  const debouncedQuery = useDebounce(query, 250);
81867
- const { value: result2, error: error2 } = usePromptsQuery(debouncedQuery);
81962
+ const promptInput = useMemo(
81963
+ () => ({
81964
+ query: debouncedQuery,
81965
+ first: showFirstNItems,
81966
+ recommendedOnly: recommendedOnly ?? false
81967
+ }),
81968
+ [debouncedQuery, showFirstNItems, recommendedOnly]
81969
+ );
81970
+ const { value: result2, error: error2 } = usePromptsQuery(promptInput);
81868
81971
  const onSelect = useCallback(
81869
81972
  (rowValue) => {
81870
81973
  const action2 = result2 == null ? void 0 : result2.actions.find((p2) => commandRowValue(p2) === rowValue);
@@ -81919,14 +82022,8 @@ const PromptList = (props) => {
81919
82022
  );
81920
82023
  const allActions = showOnlyPromptInsertableCommands ? (result2 == null ? void 0 : result2.actions.filter((action2) => action2.actionType === "prompt" || action2.mode === "ask")) ?? [] : (result2 == null ? void 0 : result2.actions) ?? [];
81921
82024
  const sortedActions = lastUsedSorting ? getSortedActions(allActions, lastUsedActions) : allActions;
81922
- const editCommandIndex = sortedActions.findIndex(
81923
- (action2) => action2.actionType === "command" && action2.key === "edit"
81924
- );
81925
- if (includeEditCommandOnTop && editCommandIndex !== -1) {
81926
- sortedActions.unshift(sortedActions.splice(editCommandIndex, 1)[0]);
81927
- }
81928
82025
  const actions2 = showFirstNItems ? sortedActions.slice(0, showFirstNItems) : sortedActions;
81929
- const inputPaddingClass = paddingLevels !== "none" ? paddingLevels === "middle" ? "!tw-p-2" : "!tw-p-4" : "";
82026
+ const inputPaddingClass = paddingLevels !== "none" ? paddingLevels === "middle" ? "!tw-p-0" : "!tw-p-4" : "";
81930
82027
  const itemPaddingClass = paddingLevels !== "none" ? paddingLevels === "middle" ? "!tw-px-6" : "!tw-px-8" : "";
81931
82028
  return /* @__PURE__ */ jsx(
81932
82029
  Command,
@@ -81934,23 +82031,23 @@ const PromptList = (props) => {
81934
82031
  loop: true,
81935
82032
  tabIndex: 0,
81936
82033
  shouldFilter: false,
81937
- defaultValue: showInitialSelectedItem ? void 0 : "xxx-no-item",
81938
- className: clsx$1(className, styles$8.list, {
81939
- [styles$8.listChips]: appearanceMode === "chips-list"
82034
+ defaultValue: "xxx-no-item",
82035
+ className: clsx$1(className, styles$9.list, {
82036
+ [styles$9.listChips]: appearanceMode === "chips-list"
81940
82037
  }),
81941
82038
  children: /* @__PURE__ */ jsxs(CommandList, { className, children: [
81942
- showSearch && /* @__PURE__ */ jsx("div", { className: clsx$1(inputPaddingClass, inputClassName, styles$8.listInputContainer), children: /* @__PURE__ */ jsx(
82039
+ showSearch && /* @__PURE__ */ jsx("div", { className: clsx$1(inputPaddingClass, inputClassName, styles$9.listInputContainer), children: /* @__PURE__ */ jsx(
81943
82040
  CommandInput,
81944
82041
  {
81945
82042
  value: query,
81946
82043
  onValueChange: setQuery,
81947
82044
  placeholder: "Search...",
81948
82045
  autoFocus: true,
81949
- className: styles$8.listInput
82046
+ className: styles$9.listInput
81950
82047
  }
81951
82048
  ) }),
81952
82049
  !result2 && !error2 && /* @__PURE__ */ jsx(CommandLoading, { className: itemPaddingClass, children: "Loading..." }),
81953
- result2 && allActions.filter((action2) => action2.actionType === "prompt").length === 0 && /* @__PURE__ */ jsx(CommandLoading, { className: itemPaddingClass, children: (result2 == null ? void 0 : result2.query) === "" ? /* @__PURE__ */ jsxs(Fragment, { children: [
82050
+ !recommendedOnly && result2 && allActions.filter((action2) => action2.actionType === "prompt").length === 0 && /* @__PURE__ */ jsx(CommandLoading, { className: itemPaddingClass, children: (result2 == null ? void 0 : result2.query) === "" ? /* @__PURE__ */ jsxs(Fragment, { children: [
81954
82051
  "Your Prompt Library is empty.",
81955
82052
  " ",
81956
82053
  /* @__PURE__ */ jsx(
@@ -81970,7 +82067,7 @@ const PromptList = (props) => {
81970
82067
  {
81971
82068
  action: action2,
81972
82069
  onSelect,
81973
- className: clsx$1(itemPaddingClass, styles$8.listItem)
82070
+ className: clsx$1(itemPaddingClass, styles$9.listItem)
81974
82071
  },
81975
82072
  commandRowValue(action2)
81976
82073
  )),
@@ -82085,24 +82182,24 @@ Defaulting to \`null\`.`;
82085
82182
  }
82086
82183
  var Root$1 = Progress;
82087
82184
  var Indicator = ProgressIndicator;
82088
- const root$2 = "_root_18l4i_2";
82089
- const iconsHeader = "_icons-header_18l4i_11";
82090
- const heading = "_heading_18l4i_17";
82091
- const descriptionText = "_description-text_18l4i_24";
82092
- const actions = "_actions_18l4i_30";
82093
- const action = "_action_18l4i_30";
82094
- const footer = "_footer_18l4i_41";
82095
- const innerContainer = "_inner-container_18l4i_47";
82096
- const loader = "_loader_18l4i_51";
82097
- const loaderIndicator = "_loader-indicator_18l4i_1";
82098
- const error = "_error_18l4i_73";
82099
- const close = "_close_18l4i_83";
82100
- const styles$7 = {
82185
+ const root$2 = "_root_oxlxy_2";
82186
+ const iconsHeader = "_icons-header_oxlxy_11";
82187
+ const heading = "_heading_oxlxy_17";
82188
+ const descriptionText = "_description-text_oxlxy_24";
82189
+ const actions$1 = "_actions_oxlxy_30";
82190
+ const action = "_action_oxlxy_30";
82191
+ const footer = "_footer_oxlxy_41";
82192
+ const innerContainer = "_inner-container_oxlxy_47";
82193
+ const loader = "_loader_oxlxy_51";
82194
+ const loaderIndicator = "_loader-indicator_oxlxy_1";
82195
+ const error = "_error_oxlxy_73";
82196
+ const close = "_close_oxlxy_83";
82197
+ const styles$8 = {
82101
82198
  root: root$2,
82102
82199
  iconsHeader,
82103
82200
  heading,
82104
82201
  descriptionText,
82105
- actions,
82202
+ actions: actions$1,
82106
82203
  action,
82107
82204
  footer,
82108
82205
  innerContainer,
@@ -82140,16 +82237,16 @@ const PromptsMigration = (props) => {
82140
82237
  if (dismissible && wasDismissed) {
82141
82238
  return null;
82142
82239
  }
82143
- return /* @__PURE__ */ jsxs("div", { className: clsx$1(className, styles$7.root), children: [
82144
- /* @__PURE__ */ jsxs("header", { className: clsx$1("tw-text-muted-foreground", styles$7.iconsHeader), children: [
82145
- /* @__PURE__ */ jsx(PencilRuler, { size: 20 }),
82146
- /* @__PURE__ */ jsx(ArrowRight, { size: 20 }),
82147
- /* @__PURE__ */ jsx(BookText, { size: 20 }),
82240
+ return /* @__PURE__ */ jsxs("div", { className: clsx$1(className, styles$8.root), children: [
82241
+ /* @__PURE__ */ jsxs("header", { className: clsx$1("tw-text-muted-foreground", styles$8.iconsHeader), children: [
82242
+ /* @__PURE__ */ jsx(PencilRuler, { size: 18 }),
82243
+ /* @__PURE__ */ jsx(ArrowRight, { size: 18 }),
82244
+ /* @__PURE__ */ jsx(BookText, { size: 18 }),
82148
82245
  dismissible && /* @__PURE__ */ jsx(
82149
82246
  Button$2,
82150
82247
  {
82151
82248
  variant: "ghost",
82152
- className: clsx$1("tw-text-muted-foreground", styles$7.close),
82249
+ className: clsx$1("tw-text-muted-foreground", styles$8.close),
82153
82250
  onClick: () => setDismissed(true),
82154
82251
  children: /* @__PURE__ */ jsx(X$2, { size: 16 })
82155
82252
  }
@@ -82177,14 +82274,14 @@ const PromptsMigration = (props) => {
82177
82274
  const PromptsMigrationInitial = (props) => {
82178
82275
  const { isMigrationAvailable, onMigrationStart } = props;
82179
82276
  return /* @__PURE__ */ jsxs(Fragment, { children: [
82180
- /* @__PURE__ */ jsx("h3", { className: styles$7.heading, children: "Commands are now Prompts" }),
82181
- /* @__PURE__ */ jsx("span", { className: styles$7.descriptionText, children: "Prompts are assuming the features of commands, including custom commands." }),
82182
- /* @__PURE__ */ jsxs("div", { className: styles$7.actions, children: [
82183
- isMigrationAvailable && /* @__PURE__ */ jsxs(Button$2, { variant: "default", className: styles$7.action, onClick: onMigrationStart, children: [
82277
+ /* @__PURE__ */ jsx("h3", { className: styles$8.heading, children: "Commands are now Prompts" }),
82278
+ /* @__PURE__ */ jsx("span", { className: styles$8.descriptionText, children: "Prompts are assuming the features of commands, including custom commands." }),
82279
+ /* @__PURE__ */ jsxs("div", { className: styles$8.actions, children: [
82280
+ isMigrationAvailable && /* @__PURE__ */ jsxs(Button$2, { variant: "default", className: styles$8.action, onClick: onMigrationStart, children: [
82184
82281
  /* @__PURE__ */ jsx(SquareChevronRight, { size: 16 }),
82185
82282
  "Migrate commands"
82186
82283
  ] }),
82187
- /* @__PURE__ */ jsx(Button$2, { variant: "outline", className: styles$7.action, asChild: true, children: /* @__PURE__ */ jsxs(
82284
+ /* @__PURE__ */ jsx(Button$2, { variant: "outline", className: styles$8.action, asChild: true, children: /* @__PURE__ */ jsxs(
82188
82285
  "a",
82189
82286
  {
82190
82287
  target: "_blank",
@@ -82197,7 +82294,7 @@ const PromptsMigrationInitial = (props) => {
82197
82294
  }
82198
82295
  ) })
82199
82296
  ] }),
82200
- isMigrationAvailable && /* @__PURE__ */ jsxs("span", { className: clsx$1(styles$7.footer, "tw-text-muted-foreground"), children: [
82297
+ isMigrationAvailable && /* @__PURE__ */ jsxs("span", { className: clsx$1(styles$8.footer, "tw-text-muted-foreground"), children: [
82201
82298
  "Migrate your local custom commands into prompts to keep them.",
82202
82299
  " ",
82203
82300
  /* @__PURE__ */ jsx("span", { className: "tw-underline", children: "Commands will be deprecated." })
@@ -82207,16 +82304,16 @@ const PromptsMigrationInitial = (props) => {
82207
82304
  const PromptsMigrationLoading = (props) => {
82208
82305
  const { migratedPrompts, promptsToMigrate } = props;
82209
82306
  const isScanningPromptLibrary = promptsToMigrate === void 0;
82210
- return /* @__PURE__ */ jsxs("div", { className: styles$7.innerContainer, children: [
82307
+ return /* @__PURE__ */ jsxs("div", { className: styles$8.innerContainer, children: [
82211
82308
  isScanningPromptLibrary && /* @__PURE__ */ jsxs(Fragment, { children: [
82212
- /* @__PURE__ */ jsxs("span", { className: styles$7.descriptionText, children: [
82309
+ /* @__PURE__ */ jsxs("span", { className: styles$8.descriptionText, children: [
82213
82310
  "Scanning prompts library and custom commands",
82214
82311
  " "
82215
82312
  ] }),
82216
82313
  /* @__PURE__ */ jsx(LoadingDots, {})
82217
82314
  ] }),
82218
82315
  !isScanningPromptLibrary && /* @__PURE__ */ jsxs(Fragment, { children: [
82219
- /* @__PURE__ */ jsxs("span", { className: styles$7.descriptionText, children: [
82316
+ /* @__PURE__ */ jsxs("span", { className: styles$8.descriptionText, children: [
82220
82317
  "Migrating, ",
82221
82318
  migratedPrompts,
82222
82319
  " out of ",
@@ -82226,12 +82323,12 @@ const PromptsMigrationLoading = (props) => {
82226
82323
  /* @__PURE__ */ jsx(
82227
82324
  Root$1,
82228
82325
  {
82229
- className: styles$7.loader,
82326
+ className: styles$8.loader,
82230
82327
  value: migratedPrompts / promptsToMigrate * 100,
82231
82328
  children: /* @__PURE__ */ jsx(
82232
82329
  Indicator,
82233
82330
  {
82234
- className: styles$7.loaderIndicator,
82331
+ className: styles$8.loaderIndicator,
82235
82332
  style: {
82236
82333
  transform: `translateX(-${100 - migratedPrompts / promptsToMigrate * 100}%)`
82237
82334
  }
@@ -82244,8 +82341,8 @@ const PromptsMigrationLoading = (props) => {
82244
82341
  };
82245
82342
  const PromptMigrationFailed = (props) => {
82246
82343
  const { errorMessage } = props;
82247
- return /* @__PURE__ */ jsxs("div", { className: styles$7.innerContainer, children: [
82248
- /* @__PURE__ */ jsx("div", { className: styles$7.error, children: errorMessage }),
82344
+ return /* @__PURE__ */ jsxs("div", { className: styles$8.innerContainer, children: [
82345
+ /* @__PURE__ */ jsx("div", { className: styles$8.error, children: errorMessage }),
82249
82346
  /* @__PURE__ */ jsxs(Button$2, { variant: "outline", className: "tw-mt-5", children: [
82250
82347
  /* @__PURE__ */ jsx(SquareChevronRight, { size: 16 }),
82251
82348
  "Try again"
@@ -82254,22 +82351,22 @@ const PromptMigrationFailed = (props) => {
82254
82351
  };
82255
82352
  const PromptMigrationSuccess = () => {
82256
82353
  return /* @__PURE__ */ jsxs(Fragment, { children: [
82257
- /* @__PURE__ */ jsx("h3", { className: styles$7.heading, children: "Migration completed" }),
82258
- /* @__PURE__ */ jsx("span", { className: styles$7.descriptionText, children: "All custom commands were migrated and now available in prompts library." })
82354
+ /* @__PURE__ */ jsx("h3", { className: styles$8.heading, children: "Migration completed" }),
82355
+ /* @__PURE__ */ jsx("span", { className: styles$8.descriptionText, children: "All custom commands were migrated and now available in prompts library." })
82259
82356
  ] });
82260
82357
  };
82261
82358
  const promptsInput = "_prompts-input_lclhy_2";
82262
82359
  const promptsContainer = "_prompts-container_lclhy_6";
82263
82360
  const promptMigrationWidget = "_prompt-migration-widget_lclhy_11";
82264
- const styles$6 = {
82361
+ const styles$7 = {
82265
82362
  promptsInput,
82266
82363
  promptsContainer,
82267
82364
  promptMigrationWidget
82268
82365
  };
82269
- const PromptsTab = ({ setView, isUnifiedPromptsEnabled }) => {
82366
+ const PromptsTab = ({ IDE, setView, isPromptsV2Enabled }) => {
82270
82367
  const runAction = useActionSelect();
82271
82368
  return /* @__PURE__ */ jsxs("div", { className: "tw-overflow-auto tw-h-full tw-flex tw-flex-col tw-gap-6", children: [
82272
- isUnifiedPromptsEnabled && /* @__PURE__ */ jsx(PromptMigrationWidget, { dismissible: false, className: styles$6.promptMigrationWidget }),
82369
+ isPromptsV2Enabled && IDE !== CodyIDE.Web && /* @__PURE__ */ jsx(PromptMigrationWidget, { dismissible: false, className: styles$7.promptMigrationWidget }),
82273
82370
  /* @__PURE__ */ jsx(
82274
82371
  PromptList,
82275
82372
  {
@@ -82277,11 +82374,12 @@ const PromptsTab = ({ setView, isUnifiedPromptsEnabled }) => {
82277
82374
  showCommandOrigins: true,
82278
82375
  paddingLevels: "big",
82279
82376
  telemetryLocation: "PromptsTab",
82280
- showPromptLibraryUnsupportedMessage: true,
82377
+ recommendedOnly: false,
82281
82378
  showOnlyPromptInsertableCommands: false,
82379
+ showPromptLibraryUnsupportedMessage: true,
82282
82380
  onSelect: (item2) => runAction(item2, setView),
82283
- className: styles$6.promptsContainer,
82284
- inputClassName: styles$6.promptsInput
82381
+ className: styles$7.promptsContainer,
82382
+ inputClassName: styles$7.promptsInput
82285
82383
  }
82286
82384
  )
82287
82385
  ] });
@@ -83031,7 +83129,7 @@ const dialogContent = "_dialog-content_a1f96_1";
83031
83129
  const dialogTitle = "_dialog-title_a1f96_1";
83032
83130
  const dialogDescription = "_dialog-description_a1f96_1";
83033
83131
  const dialogFooter = "_dialog-footer_a1f96_1";
83034
- const styles$5 = {
83132
+ const styles$6 = {
83035
83133
  tabsRoot,
83036
83134
  tabsContainer,
83037
83135
  tabs,
@@ -83080,8 +83178,8 @@ const TabsBar = memo((props) => {
83080
83178
  },
83081
83179
  [setView]
83082
83180
  );
83083
- return /* @__PURE__ */ jsx("div", { className: clsx$1(styles$5.tabsRoot, { [styles$5.tabsRootCodyWeb]: IDE === CodyIDE.Web }), children: /* @__PURE__ */ jsxs(List, { "aria-label": "cody-webview", className: styles$5.tabsContainer, children: [
83084
- /* @__PURE__ */ jsxs("div", { className: styles$5.tabs, children: [
83181
+ return /* @__PURE__ */ jsx("div", { className: clsx$1(styles$6.tabsRoot, { [styles$6.tabsRootCodyWeb]: IDE === CodyIDE.Web }), children: /* @__PURE__ */ jsxs(List, { "aria-label": "cody-webview", className: styles$6.tabsContainer, children: [
83182
+ /* @__PURE__ */ jsxs("div", { className: styles$6.tabs, children: [
83085
83183
  tabItems.map(({ Icon: Icon2, view, command, title: title2, changesView }) => /* @__PURE__ */ jsx(Trigger, { value: view, asChild: true, children: /* @__PURE__ */ jsx(
83086
83184
  TabButton,
83087
83185
  {
@@ -83115,7 +83213,7 @@ const TabsBar = memo((props) => {
83115
83213
  }
83116
83214
  ) })
83117
83215
  ] }),
83118
- /* @__PURE__ */ jsx("div", { className: styles$5.subTabs, children: currentViewSubActions.map((subAction) => /* @__PURE__ */ jsx(Fragment$1, { children: subAction.confirmation ? /* @__PURE__ */ jsx(
83216
+ /* @__PURE__ */ jsx("div", { className: styles$6.subTabs, children: currentViewSubActions.map((subAction) => /* @__PURE__ */ jsx(Fragment$1, { children: subAction.confirmation ? /* @__PURE__ */ jsx(
83119
83217
  ActionButtonWithConfirmation,
83120
83218
  {
83121
83219
  title: subAction.title,
@@ -83170,11 +83268,11 @@ const ActionButtonWithConfirmation = (props) => {
83170
83268
  }
83171
83269
  ),
83172
83270
  /* @__PURE__ */ jsxs($5d3850c4d0b4e6c7$export$602eac185826482c, { children: [
83173
- /* @__PURE__ */ jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { className: styles$5.dialogOverlay }),
83174
- /* @__PURE__ */ jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, { className: styles$5.dialogContent, "data-cody-ui-dialog": true, children: [
83175
- /* @__PURE__ */ jsx($5d3850c4d0b4e6c7$export$f99233281efd08a0, { className: styles$5.dialogTitle, children: dialogTitle2 }),
83176
- /* @__PURE__ */ jsx($5d3850c4d0b4e6c7$export$393edc798c47379d, { className: styles$5.dialogDescription, children: dialogDescription2 }),
83177
- /* @__PURE__ */ jsxs("footer", { className: styles$5.dialogFooter, children: [
83271
+ /* @__PURE__ */ jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { className: styles$6.dialogOverlay }),
83272
+ /* @__PURE__ */ jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, { className: styles$6.dialogContent, "data-cody-ui-dialog": true, children: [
83273
+ /* @__PURE__ */ jsx($5d3850c4d0b4e6c7$export$f99233281efd08a0, { className: styles$6.dialogTitle, children: dialogTitle2 }),
83274
+ /* @__PURE__ */ jsx($5d3850c4d0b4e6c7$export$393edc798c47379d, { className: styles$6.dialogDescription, children: dialogDescription2 }),
83275
+ /* @__PURE__ */ jsxs("footer", { className: styles$6.dialogFooter, children: [
83178
83276
  /* @__PURE__ */ jsx(Button$2, { variant: "secondary", onClick: () => setState(false), children: "Cancel" }),
83179
83277
  /* @__PURE__ */ jsx(
83180
83278
  Button$2,
@@ -83226,7 +83324,7 @@ const TabButton = forwardRef((props, ref2) => {
83226
83324
  "data-testid": dataTestId,
83227
83325
  children: [
83228
83326
  /* @__PURE__ */ jsx(Icon2, { size: 16, strokeWidth: 1.25, className: "tw-w-8 tw-h-8" }),
83229
- /* @__PURE__ */ jsx("span", { className: alwaysShowTitle ? "" : styles$5.tabActionLabel, children: title2 })
83327
+ /* @__PURE__ */ jsx("span", { className: alwaysShowTitle ? "" : styles$6.tabActionLabel, children: title2 })
83230
83328
  ]
83231
83329
  }
83232
83330
  ) }),
@@ -83371,6 +83469,7 @@ const PromptSelectField = ({ onSelect, onCloseByEscape, className, __storybook__
83371
83469
  showOnlyPromptInsertableCommands: true,
83372
83470
  showPromptLibraryUnsupportedMessage: true,
83373
83471
  lastUsedSorting: true,
83472
+ recommendedOnly: false,
83374
83473
  inputClassName: "tw-bg-popover"
83375
83474
  }
83376
83475
  ),
@@ -83519,20 +83618,20 @@ const SubmitButton = ({ onClick, state = "submittable", className, intent, onSel
83519
83618
  iconEnd: "chevron",
83520
83619
  className: "tw-justify-between tw-inline-flex",
83521
83620
  "aria-label": "Insert prompt",
83522
- popoverContent: (close2) => /* @__PURE__ */ jsx(Command, { children: /* @__PURE__ */ jsx(CommandList, { children: intentOptions.map((option) => /* @__PURE__ */ jsx(
83621
+ popoverContent: (close2) => /* @__PURE__ */ jsx(Command, { children: /* @__PURE__ */ jsx(CommandList, { className: "tw-p-2", children: intentOptions.map((option) => /* @__PURE__ */ jsx(
83523
83622
  CommandItem,
83524
83623
  {
83525
83624
  onSelect: () => {
83526
83625
  onSelectIntent == null ? void 0 : onSelectIntent(option.intent);
83527
83626
  close2();
83528
83627
  },
83529
- className: "tw-flex tw-text-left tw-justify-between",
83628
+ className: "tw-flex tw-text-left tw-justify-between tw-rounded-sm",
83530
83629
  children: /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-items-center tw-gap-2", children: [
83531
83630
  /* @__PURE__ */ jsx(option.icon, { className: "tw-size-8" }),
83532
83631
  option.title
83533
83632
  ] })
83534
83633
  },
83535
- option.intent
83634
+ option.intent ?? option.title
83536
83635
  )) }) }),
83537
83636
  popoverContentProps: {
83538
83637
  className: "tw-w-[225px] !tw-p-0",
@@ -83697,12 +83796,20 @@ const HumanMessageEditor = ({
83697
83796
  const [submitIntent, setSubmitIntent] = useState(
83698
83797
  initialIntent || (experimentalOneBoxEnabled ? void 0 : "chat")
83699
83798
  );
83799
+ useEffect(() => {
83800
+ if (isEmptyEditorValue) {
83801
+ setSubmitIntent(void 0);
83802
+ }
83803
+ }, [isEmptyEditorValue]);
83804
+ useEffect(() => {
83805
+ setSubmitIntent(initialIntent);
83806
+ }, [initialIntent]);
83700
83807
  const onSubmitClick = useCallback(
83701
- (intent) => {
83702
- if (submitState === "emptyEditorValue") {
83808
+ (intent, forceSubmit) => {
83809
+ if (!forceSubmit && submitState === "emptyEditorValue") {
83703
83810
  return;
83704
83811
  }
83705
- if (submitState === "waitingResponseComplete") {
83812
+ if (!forceSubmit && submitState === "waitingResponseComplete") {
83706
83813
  onStop();
83707
83814
  return;
83708
83815
  }
@@ -83830,47 +83937,47 @@ const HumanMessageEditor = ({
83830
83937
  return;
83831
83938
  }
83832
83939
  const updates = [];
83833
- const awaitUpdate = () => {
83834
- let resolve;
83835
- updates.push(
83836
- new Promise((r2) => {
83837
- resolve = r2;
83838
- })
83839
- );
83840
- return () => {
83841
- resolve == null ? void 0 : resolve();
83842
- };
83843
- };
83844
83940
  if (addContextItemsToLastHumanInput && addContextItemsToLastHumanInput.length > 0) {
83845
83941
  const editor2 = editorRef.current;
83846
83942
  if (editor2) {
83847
- editor2.addMentions(addContextItemsToLastHumanInput, awaitUpdate());
83848
- editor2.setFocus(true);
83943
+ updates.push(editor2.addMentions(addContextItemsToLastHumanInput, "after"));
83944
+ updates.push(editor2.setFocus(true));
83849
83945
  }
83850
83946
  }
83851
83947
  if (appendTextToLastPromptEditor) {
83852
- const onUpdate = awaitUpdate();
83853
- requestAnimationFrame(() => {
83854
- if (editorRef.current) {
83855
- editorRef.current.appendText(appendTextToLastPromptEditor, onUpdate);
83856
- }
83857
- });
83948
+ updates.push(
83949
+ new Promise((resolve) => {
83950
+ requestAnimationFrame(() => {
83951
+ if (editorRef.current) {
83952
+ editorRef.current.appendText(appendTextToLastPromptEditor).then(resolve);
83953
+ } else {
83954
+ resolve();
83955
+ }
83956
+ });
83957
+ })
83958
+ );
83858
83959
  }
83859
83960
  if (editorState) {
83860
- const onUpdate = awaitUpdate();
83861
- requestAnimationFrame(() => {
83862
- if (editorRef.current) {
83863
- editorRef.current.setEditorState(editorState, onUpdate);
83864
- editorRef.current.setFocus(true);
83865
- }
83866
- });
83961
+ updates.push(
83962
+ new Promise((resolve) => {
83963
+ requestAnimationFrame(async () => {
83964
+ if (editorRef.current) {
83965
+ await Promise.all([
83966
+ editorRef.current.setEditorState(editorState),
83967
+ editorRef.current.setFocus(true)
83968
+ ]);
83969
+ }
83970
+ resolve();
83971
+ });
83972
+ })
83973
+ );
83867
83974
  }
83868
83975
  if (setLastHumanInputIntent) {
83869
83976
  setSubmitIntent(setLastHumanInputIntent);
83870
83977
  }
83871
83978
  if (submitHumanInput) {
83872
83979
  Promise.all(updates).then(
83873
- () => onSubmitClick(setLastHumanInputIntent || submitIntent)
83980
+ () => onSubmitClick(setLastHumanInputIntent || submitIntent, true)
83874
83981
  );
83875
83982
  }
83876
83983
  },
@@ -83878,9 +83985,10 @@ const HumanMessageEditor = ({
83878
83985
  )
83879
83986
  );
83880
83987
  const currentChatModel = useMemo(() => models[0], [models[0]]);
83881
- let initialContext = useInitialContextForChat();
83988
+ const defaultContext = useDefaultContextForChat();
83882
83989
  useEffect(() => {
83883
83990
  var _a2;
83991
+ let { initialContext } = defaultContext;
83884
83992
  if (!isSent && isFirstMessage) {
83885
83993
  const editor2 = editorRef.current;
83886
83994
  if (editor2) {
@@ -83890,7 +83998,7 @@ const HumanMessageEditor = ({
83890
83998
  editor2.setInitialContextMentions(initialContext);
83891
83999
  }
83892
84000
  }
83893
- }, [initialContext, isSent, isFirstMessage, currentChatModel]);
84001
+ }, [defaultContext, isSent, isFirstMessage, currentChatModel]);
83894
84002
  const focusEditor = useCallback(() => {
83895
84003
  var _a2;
83896
84004
  return (_a2 = editorRef.current) == null ? void 0 : _a2.setFocus(true);
@@ -83908,10 +84016,10 @@ const HumanMessageEditor = ({
83908
84016
  "div",
83909
84017
  {
83910
84018
  className: clsx$1(
83911
- styles$c.container,
84019
+ styles$d.container,
83912
84020
  {
83913
- [styles$c.sent]: isSent,
83914
- [styles$c.focused]: focused2
84021
+ [styles$d.sent]: isSent,
84022
+ [styles$d.focused]: focused2
83915
84023
  },
83916
84024
  "tw-transition",
83917
84025
  className
@@ -83934,8 +84042,8 @@ const HumanMessageEditor = ({
83934
84042
  editorRef,
83935
84043
  disabled: disabled2,
83936
84044
  contextWindowSizeInTokens,
83937
- editorClassName: styles$c.editor,
83938
- contentEditableClassName: styles$c.editorContentEditable
84045
+ editorClassName: styles$d.editor,
84046
+ contentEditableClassName: styles$d.editorContentEditable
83939
84047
  }
83940
84048
  ),
83941
84049
  !disabled2 && /* @__PURE__ */ jsx(
@@ -83950,7 +84058,7 @@ const HumanMessageEditor = ({
83950
84058
  onGapClick,
83951
84059
  focusEditor,
83952
84060
  hidden: !focused2 && isSent,
83953
- className: styles$c.toolbar,
84061
+ className: styles$d.toolbar,
83954
84062
  intent: submitIntent,
83955
84063
  onSelectIntent: setSubmitIntent
83956
84064
  }
@@ -84015,7 +84123,7 @@ const HumanMessageCellContent = memo((props) => {
84015
84123
  models,
84016
84124
  userInfo,
84017
84125
  initialEditorState,
84018
- placeholder: isFirstMessage ? "Ask..." : "Ask a followup...",
84126
+ placeholder: isFirstMessage ? "Ask anything. Use @ to specify context..." : "Ask a followup...",
84019
84127
  isFirstMessage,
84020
84128
  isSent,
84021
84129
  isPendingPriorResponse,
@@ -84062,11 +84170,11 @@ const OpenInNewEditorAction = () => {
84062
84170
  ] });
84063
84171
  };
84064
84172
  const infoMessage = "_info-message_6yx2w_1";
84065
- const styles$4 = {
84173
+ const styles$5 = {
84066
84174
  infoMessage
84067
84175
  };
84068
84176
  const InfoMessage = ({ children: children2, className }) => {
84069
- return /* @__PURE__ */ jsx("div", { className: cn(styles$4.infoMessage, "tw-p-4 tw-rounded-sm", className), children: children2 });
84177
+ return /* @__PURE__ */ jsx("div", { className: cn(styles$5.infoMessage, "tw-p-4 tw-rounded-sm", className), children: children2 });
84070
84178
  };
84071
84179
  const Transcript = (props) => {
84072
84180
  const {
@@ -84120,7 +84228,7 @@ const Transcript = (props) => {
84120
84228
  return /* @__PURE__ */ jsx(
84121
84229
  "div",
84122
84230
  {
84123
- className: clsx$1("tw-px-6 tw-pt-8 tw-pb-12 tw-flex tw-flex-col tw-gap-8", {
84231
+ className: clsx$1("tw-px-8 tw-pt-8 tw-pb-6 tw-flex tw-flex-col tw-gap-8", {
84124
84232
  "tw-flex-grow": transcript.length > 0
84125
84233
  }),
84126
84234
  children: interactions.map((interaction, i2) => {
@@ -84185,6 +84293,7 @@ function transcriptToInteractionPairs(transcript, assistantMessageInProgress) {
84185
84293
  return pairs;
84186
84294
  }
84187
84295
  const TranscriptInteraction = memo((props) => {
84296
+ var _a;
84188
84297
  const {
84189
84298
  interaction: { humanMessage, assistantMessage },
84190
84299
  models,
@@ -84209,11 +84318,11 @@ const TranscriptInteraction = memo((props) => {
84209
84318
  useImperativeHandle(parentEditorRef, () => humanEditorRef.current);
84210
84319
  const onEditSubmit = useCallback(
84211
84320
  (editorValue, intentFromSubmit) => {
84212
- var _a, _b;
84321
+ var _a2, _b;
84213
84322
  editHumanMessage({
84214
84323
  messageIndexInTranscript: humanMessage.index,
84215
84324
  editorValue,
84216
- intent: intentFromSubmit || ((_a = intentResults.current) == null ? void 0 : _a.intent),
84325
+ intent: intentFromSubmit || ((_a2 = intentResults.current) == null ? void 0 : _a2.intent),
84217
84326
  intentScores: intentFromSubmit ? void 0 : (_b = intentResults.current) == null ? void 0 : _b.allScores,
84218
84327
  manuallySelectedIntent: !!intentFromSubmit
84219
84328
  });
@@ -84222,10 +84331,10 @@ const TranscriptInteraction = memo((props) => {
84222
84331
  );
84223
84332
  const onFollowupSubmit = useCallback(
84224
84333
  (editorValue, intentFromSubmit) => {
84225
- var _a, _b;
84334
+ var _a2, _b;
84226
84335
  submitHumanMessage({
84227
84336
  editorValue,
84228
- intent: intentFromSubmit || ((_a = intentResults.current) == null ? void 0 : _a.intent),
84337
+ intent: intentFromSubmit || ((_a2 = intentResults.current) == null ? void 0 : _a2.intent),
84229
84338
  intentScores: intentFromSubmit ? void 0 : (_b = intentResults.current) == null ? void 0 : _b.allScores,
84230
84339
  manuallySelectedIntent: !!intentFromSubmit
84231
84340
  });
@@ -84268,8 +84377,8 @@ const TranscriptInteraction = memo((props) => {
84268
84377
  const telemetryRecorder = useTelemetryRecorder();
84269
84378
  const reSubmitWithIntent = useCallback(
84270
84379
  (intent) => {
84271
- var _a;
84272
- const editorState = (_a = humanEditorRef.current) == null ? void 0 : _a.getSerializedValue();
84380
+ var _a2;
84381
+ const editorState = (_a2 = humanEditorRef.current) == null ? void 0 : _a2.getSerializedValue();
84273
84382
  if (editorState) {
84274
84383
  onEditSubmit(editorState, intent);
84275
84384
  telemetryRecorder.recordEvent("onebox.intentCorrection", "clicked", {
@@ -84286,12 +84395,38 @@ const TranscriptInteraction = memo((props) => {
84286
84395
  },
84287
84396
  [onEditSubmit, telemetryRecorder, humanMessage]
84288
84397
  );
84398
+ const { corpusContext: corpusContextItems } = useDefaultContextForChat();
84399
+ const resubmitWithRepoContext = useCallback(async () => {
84400
+ var _a2, _b;
84401
+ const editorState = (_a2 = humanEditorRef.current) == null ? void 0 : _a2.getSerializedValue();
84402
+ if (editorState) {
84403
+ const editor2 = humanEditorRef.current;
84404
+ if (corpusContextItems.length === 0 || !editor2) {
84405
+ return;
84406
+ }
84407
+ await editor2.addMentions(corpusContextItems, "before", " ");
84408
+ const newEditorState = (_b = humanEditorRef.current) == null ? void 0 : _b.getSerializedValue();
84409
+ if (newEditorState) {
84410
+ onEditSubmit(newEditorState, "chat");
84411
+ }
84412
+ }
84413
+ }, [corpusContextItems, onEditSubmit]);
84289
84414
  const reSubmitWithChatIntent = useCallback(() => reSubmitWithIntent("chat"), [reSubmitWithIntent]);
84290
84415
  const reSubmitWithSearchIntent = useCallback(
84291
84416
  () => reSubmitWithIntent("search"),
84292
84417
  [reSubmitWithIntent]
84293
84418
  );
84294
84419
  const resetIntent = useCallback(() => setIntentResults(void 0), [setIntentResults]);
84420
+ const manuallyEditContext = useCallback(() => {
84421
+ const contextFiles = humanMessage.contextFiles;
84422
+ const editor2 = humanEditorRef.current;
84423
+ if (!contextFiles || !editor2) {
84424
+ return;
84425
+ }
84426
+ editor2.filterMentions((item2) => item2.type !== "repository");
84427
+ editor2.addMentions(contextFiles, "before", "\n");
84428
+ }, [humanMessage.contextFiles]);
84429
+ const mentionsContainRepository = (_a = humanEditorRef.current) == null ? void 0 : _a.getSerializedValue().contextItems.some((item2) => item2.type === "repository");
84295
84430
  return /* @__PURE__ */ jsxs(Fragment, { children: [
84296
84431
  /* @__PURE__ */ jsx(
84297
84432
  HumanMessageCell,
@@ -84346,6 +84481,7 @@ const TranscriptInteraction = memo((props) => {
84346
84481
  }
84347
84482
  ) })
84348
84483
  ] }) }),
84484
+ corpusContextItems.length > 0 && !mentionsContainRepository && assistantMessage && !assistantMessage.isLoading && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button$2, { onClick: resubmitWithRepoContext, type: "button", children: "Resend with current repository context" }) }),
84349
84485
  (humanMessage.contextFiles && humanMessage.contextFiles.length > 0 || isContextLoading) && /* @__PURE__ */ jsx(
84350
84486
  ContextCell,
84351
84487
  {
@@ -84357,7 +84493,17 @@ const TranscriptInteraction = memo((props) => {
84357
84493
  defaultOpen: experimentalOneBoxEnabled && humanMessage.intent === "search",
84358
84494
  reSubmitWithChatIntent,
84359
84495
  isContextLoading,
84360
- onAddToFollowupChat
84496
+ onAddToFollowupChat,
84497
+ onManuallyEditContext: manuallyEditContext,
84498
+ editContextText: humanMessage.intent === "search" ? /* @__PURE__ */ jsxs(Fragment, { children: [
84499
+ /* @__PURE__ */ jsx(ArrowBigUp, { className: "-tw-mr-6 tw-py-0" }),
84500
+ /* @__PURE__ */ jsx(AtSign, { className: "-tw-mr-2 tw-py-2" }),
84501
+ /* @__PURE__ */ jsx("div", { children: "Edit results as mentions" })
84502
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
84503
+ /* @__PURE__ */ jsx(ArrowBigUp, { className: "-tw-mr-6 tw-py-0" }),
84504
+ /* @__PURE__ */ jsx(AtSign, { className: "-tw-mr-2 tw-py-2" }),
84505
+ /* @__PURE__ */ jsx("div", { children: "Copy and edit as mentions" })
84506
+ ] })
84361
84507
  },
84362
84508
  `${humanMessage.index}-${humanMessage.intent}-context`
84363
84509
  ),
@@ -84435,15 +84581,15 @@ function submitHumanMessage({
84435
84581
  focusLastHumanMessageEditor();
84436
84582
  }
84437
84583
  const chatDisabled = "_chat-disabled_rc7no_1";
84438
- const styles$3 = {
84584
+ const styles$4 = {
84439
84585
  chatDisabled
84440
84586
  };
84441
- const welcomeFooter = "_welcome-footer_q2fi5_1";
84442
- const tips = "_tips_q2fi5_11";
84443
- const links = "_links_q2fi5_20";
84444
- const item = "_item_q2fi5_31";
84445
- const link = "_link_q2fi5_20";
84446
- const styles$2 = {
84587
+ const welcomeFooter = "_welcome-footer_g0fdz_1";
84588
+ const tips = "_tips_g0fdz_9";
84589
+ const links = "_links_g0fdz_18";
84590
+ const item = "_item_g0fdz_25";
84591
+ const link = "_link_g0fdz_18";
84592
+ const styles$3 = {
84447
84593
  welcomeFooter,
84448
84594
  tips,
84449
84595
  links,
@@ -84457,7 +84603,7 @@ const chatTips = [
84457
84603
  vsCodeOnly: true
84458
84604
  },
84459
84605
  {
84460
- message: "Start a new chat using/ or the New Chat button",
84606
+ message: "Start a new chat with L or switch to chat with ⌥ /",
84461
84607
  icon: MessageSquarePlus,
84462
84608
  vsCodeOnly: false
84463
84609
  },
@@ -84486,7 +84632,7 @@ function WelcomeFooter({ IDE }) {
84486
84632
  if (tip.vsCodeOnly && IDE !== CodyIDE.VSCode) {
84487
84633
  return null;
84488
84634
  }
84489
- return /* @__PURE__ */ jsxs("div", { className: styles$2.item, children: [
84635
+ return /* @__PURE__ */ jsxs("div", { className: styles$3.item, children: [
84490
84636
  /* @__PURE__ */ jsx(Icon2, { className: "tw-w-8 tw-h-8 tw-shrink-0", strokeWidth: 1.25 }),
84491
84637
  /* @__PURE__ */ jsx("div", { className: "tw-text-muted-foreground", children: tip.message })
84492
84638
  ] }, `tip-${key + 1}`);
@@ -84495,26 +84641,35 @@ function WelcomeFooter({ IDE }) {
84495
84641
  function links2() {
84496
84642
  return chatLinks.map((link2, key) => {
84497
84643
  const Icon2 = link2.icon;
84498
- return /* @__PURE__ */ jsxs("div", { className: styles$2.item, children: [
84644
+ return /* @__PURE__ */ jsxs("div", { className: styles$3.item, children: [
84499
84645
  /* @__PURE__ */ jsx(Icon2, { className: "tw-w-8 tw-h-8", strokeWidth: 1.25 }),
84500
- /* @__PURE__ */ jsx("a", { href: link2.url, className: styles$2.link, rel: "noreferrer", target: "_blank", children: link2.text })
84646
+ /* @__PURE__ */ jsx("a", { href: link2.url, className: styles$3.link, rel: "noreferrer", target: "_blank", children: link2.text })
84501
84647
  ] }, `link-${key + 1}`);
84502
84648
  });
84503
84649
  }
84504
- return /* @__PURE__ */ jsxs("div", { className: styles$2.welcomeFooter, children: [
84505
- /* @__PURE__ */ jsx("div", { className: styles$2.tips, children: tips2() }),
84506
- /* @__PURE__ */ jsx("div", { className: styles$2.links, children: links2() })
84650
+ return /* @__PURE__ */ jsxs("div", { className: styles$3.welcomeFooter, children: [
84651
+ /* @__PURE__ */ jsx("div", { className: styles$3.tips, children: tips2() }),
84652
+ /* @__PURE__ */ jsx("div", { className: styles$3.links, children: links2() })
84507
84653
  ] });
84508
84654
  }
84655
+ const actions = "_actions_129f5_2";
84656
+ const styles$2 = {
84657
+ actions
84658
+ };
84509
84659
  const localStorageKey = "chat.welcome-message-dismissed";
84510
84660
  const WelcomeMessage = ({
84511
84661
  setView,
84512
- isUnifiedPromptsEnabled
84662
+ IDE,
84663
+ isPromptsV2Enabled
84513
84664
  }) => {
84514
84665
  localStorage.removeItem(localStorageKey);
84515
84666
  const runAction = useActionSelect();
84516
- return /* @__PURE__ */ jsxs("div", { className: "tw-flex-1 tw-flex tw-flex-col tw-items-start tw-w-full tw-px-6 tw-gap-4 tw-transition-all", children: [
84517
- isUnifiedPromptsEnabled && /* @__PURE__ */ jsx(PromptMigrationWidget, { dismissible: true, className: "tw-w-full" }),
84667
+ const handleRecentlyUsed = () => {
84668
+ var _a;
84669
+ (_a = document.querySelector("button[aria-label='Insert prompt']")) == null ? void 0 : _a.click();
84670
+ };
84671
+ return /* @__PURE__ */ jsxs("div", { className: "tw-flex-1 tw-flex tw-flex-col tw-items-start tw-w-full tw-px-8 tw-gap-6 tw-transition-all", children: [
84672
+ isPromptsV2Enabled && IDE !== CodyIDE.Web && /* @__PURE__ */ jsx(PromptMigrationWidget, { dismissible: true, className: "tw-w-full" }),
84518
84673
  /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-flex-col tw-gap-4 tw-w-full", children: [
84519
84674
  /* @__PURE__ */ jsx(
84520
84675
  PromptList,
@@ -84526,20 +84681,22 @@ const WelcomeMessage = ({
84526
84681
  showCommandOrigins: true,
84527
84682
  showOnlyPromptInsertableCommands: false,
84528
84683
  showPromptLibraryUnsupportedMessage: false,
84684
+ recommendedOnly: true,
84529
84685
  onSelect: (item2) => runAction(item2, setView)
84530
84686
  }
84531
84687
  ),
84532
- /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-gap-8 tw-justify-center", children: [
84533
- /* @__PURE__ */ jsx(
84688
+ /* @__PURE__ */ jsxs("div", { className: clsx$1(styles$2.actions, "tw-flex tw-py-2 tw-gap-8 tw-justify-center"), children: [
84689
+ /* @__PURE__ */ jsxs(
84534
84690
  Button$2,
84535
84691
  {
84536
84692
  variant: "ghost",
84537
84693
  className: "tw-justify-center tw-basis-0 tw-whitespace-nowrap",
84538
- onClick: () => {
84539
- var _a;
84540
- return (_a = document.querySelector("button[aria-label='Insert prompt']")) == null ? void 0 : _a.click();
84541
- },
84542
- children: "Recently used"
84694
+ onClick: handleRecentlyUsed,
84695
+ children: [
84696
+ "Recently used",
84697
+ " ",
84698
+ IDE === CodyIDE.VSCode && /* @__PURE__ */ jsx(Kbd, { macOS: "opt+p", linuxAndWindows: "alt+p" })
84699
+ ]
84543
84700
  }
84544
84701
  ),
84545
84702
  /* @__PURE__ */ jsx(
@@ -84611,7 +84768,7 @@ const Chat = ({
84611
84768
  showIDESnippetActions = true,
84612
84769
  setView,
84613
84770
  smartApplyEnabled,
84614
- isUnifiedPromptsEnabled
84771
+ isPromptsV2Enabled
84615
84772
  }) => {
84616
84773
  const telemetryRecorder = useTelemetryRecorder();
84617
84774
  const transcriptRef = useRef(transcript);
@@ -84736,7 +84893,7 @@ const Chat = ({
84736
84893
  focusLastHumanMessageEditor();
84737
84894
  }, [transcript]);
84738
84895
  return /* @__PURE__ */ jsxs(Fragment, { children: [
84739
- !chatEnabled && /* @__PURE__ */ jsx("div", { className: styles$3.chatDisabled, children: "Cody chat is disabled by your Sourcegraph site administrator" }),
84896
+ !chatEnabled && /* @__PURE__ */ jsx("div", { className: styles$4.chatDisabled, children: "Cody chat is disabled by your Sourcegraph site administrator" }),
84740
84897
  /* @__PURE__ */ jsx(
84741
84898
  Transcript,
84742
84899
  {
@@ -84758,8 +84915,9 @@ const Chat = ({
84758
84915
  /* @__PURE__ */ jsx(
84759
84916
  WelcomeMessage,
84760
84917
  {
84918
+ IDE: userInfo.IDE,
84761
84919
  setView,
84762
- isUnifiedPromptsEnabled
84920
+ isPromptsV2Enabled
84763
84921
  }
84764
84922
  ),
84765
84923
  /* @__PURE__ */ jsx(WelcomeFooter, { IDE: userInfo.IDE })
@@ -84837,7 +84995,7 @@ const StateDebugOverlayInner = ({
84837
84995
  const authStatus = useAuthStatus();
84838
84996
  const modelsData = useModelsData();
84839
84997
  const transcript = useTranscript();
84840
- const initialContext = useInitialContextForChat();
84998
+ const { initialContext } = useDefaultContextForChat();
84841
84999
  const tabs2 = useMemo(
84842
85000
  () => [
84843
85001
  { id: "resolvedConfig", value: resolvedConfig },
@@ -84971,19 +85129,37 @@ const CodyPanel = ({
84971
85129
  guardrails,
84972
85130
  showIDESnippetActions,
84973
85131
  showWelcomeMessage,
84974
- smartApplyEnabled
85132
+ smartApplyEnabled,
85133
+ onExternalApiReady
84975
85134
  }) => {
84976
85135
  const tabContainerRef = useRef(null);
85136
+ const externalAPI = useExternalAPI();
84977
85137
  const api2 = useExtensionAPI();
84978
85138
  const { value: chatModels } = useObservable(useMemo(() => api2.chatModels(), [api2.chatModels]));
84979
- const isUnifiedPromptsEnabled = useFeatureFlag(FeatureFlag.CodyUnifiedPrompts);
85139
+ const isPromptsV2Enabled = useFeatureFlag(FeatureFlag.CodyPromptsV2);
85140
+ useEffect(() => {
85141
+ onExternalApiReady == null ? void 0 : onExternalApiReady(externalAPI);
85142
+ }, [onExternalApiReady, externalAPI]);
85143
+ useEffect(() => {
85144
+ const subscription = api2.clientActionBroadcast().subscribe((action2) => {
85145
+ var _a;
85146
+ switch (action2.type) {
85147
+ case "open-recently-prompts": {
85148
+ (_a = document.querySelector("button[aria-label='Insert prompt']")) == null ? void 0 : _a.click();
85149
+ }
85150
+ }
85151
+ });
85152
+ return () => {
85153
+ subscription.unsubscribe();
85154
+ };
85155
+ }, [api2.clientActionBroadcast]);
84980
85156
  return /* @__PURE__ */ jsx(TabViewContext.Provider, { value: useMemo(() => ({ view, setView }), [view, setView]), children: /* @__PURE__ */ jsxs(
84981
85157
  TabRoot,
84982
85158
  {
84983
85159
  defaultValue: View.Chat,
84984
85160
  value: view,
84985
85161
  orientation: "vertical",
84986
- className: styles$r.outerContainer,
85162
+ className: styles$t.outerContainer,
84987
85163
  children: [
84988
85164
  !authStatus.authenticated && authStatus.showNetworkError && /* @__PURE__ */ jsx(ConnectivityStatusBanner, {}),
84989
85165
  (clientCapabilities.agentIDE === CodyIDE.Web || config.webviewType !== "editor") && /* @__PURE__ */ jsx(TabsBar, { currentView: view, setView, IDE: clientCapabilities.agentIDE }),
@@ -85003,7 +85179,7 @@ const CodyPanel = ({
85003
85179
  showWelcomeMessage,
85004
85180
  scrollableParent: tabContainerRef.current,
85005
85181
  smartApplyEnabled,
85006
- isUnifiedPromptsEnabled,
85182
+ isPromptsV2Enabled,
85007
85183
  setView
85008
85184
  }
85009
85185
  ),
@@ -85019,8 +85195,9 @@ const CodyPanel = ({
85019
85195
  view === View.Prompts && /* @__PURE__ */ jsx(
85020
85196
  PromptsTab,
85021
85197
  {
85198
+ IDE: clientCapabilities.agentIDE,
85022
85199
  setView,
85023
- isUnifiedPromptsEnabled
85200
+ isPromptsV2Enabled
85024
85201
  }
85025
85202
  ),
85026
85203
  view === View.Account && /* @__PURE__ */ jsx(AccountTab, { setView }),
@@ -85031,22 +85208,51 @@ const CodyPanel = ({
85031
85208
  }
85032
85209
  ) });
85033
85210
  };
85034
- const ErrorBanner = ({ errors, setErrors }) => /* @__PURE__ */ jsx("div", { className: styles$r.errorContainer, children: errors.map((error2, i2) => (
85211
+ const ErrorBanner = ({ errors, setErrors }) => /* @__PURE__ */ jsx("div", { className: styles$t.errorContainer, children: errors.map((error2, i2) => (
85035
85212
  // biome-ignore lint/suspicious/noArrayIndexKey: error strings might not be unique, so we have no natural id
85036
- /* @__PURE__ */ jsxs("div", { className: styles$r.error, children: [
85213
+ /* @__PURE__ */ jsxs("div", { className: styles$t.error, children: [
85037
85214
  /* @__PURE__ */ jsx("span", { children: error2 }),
85038
85215
  /* @__PURE__ */ jsx(
85039
85216
  "button",
85040
85217
  {
85041
85218
  type: "button",
85042
- className: styles$r.closeBtn,
85219
+ className: styles$t.closeBtn,
85043
85220
  onClick: () => setErrors(errors.filter((e2) => e2 !== error2)),
85044
85221
  children: "×"
85045
85222
  }
85046
85223
  )
85047
85224
  ] }, i2)
85048
85225
  )) });
85049
- function getAppWrappers(vscodeAPI, telemetryRecorder, config, staticInitialContext) {
85226
+ function useExternalAPI() {
85227
+ const dispatchClientAction = useClientActionDispatcher();
85228
+ const extensionAPI = useExtensionAPI();
85229
+ return useMemo(
85230
+ () => ({
85231
+ runPrompt: async (prompt2) => {
85232
+ const promptEditorState = await firstValueFrom(
85233
+ extensionAPI.hydratePromptMessage(prompt2.text)
85234
+ );
85235
+ dispatchClientAction(
85236
+ {
85237
+ editorState: promptEditorState,
85238
+ submitHumanInput: prompt2.autoSubmit,
85239
+ setLastHumanInputIntent: prompt2.mode ?? "chat"
85240
+ },
85241
+ // Buffer because PromptEditor is not guaranteed to be mounted after the `setView`
85242
+ // call above, and it needs to be mounted to receive the action.
85243
+ { buffer: true }
85244
+ );
85245
+ }
85246
+ }),
85247
+ [extensionAPI, dispatchClientAction]
85248
+ );
85249
+ }
85250
+ function getAppWrappers({
85251
+ vscodeAPI,
85252
+ telemetryRecorder,
85253
+ config,
85254
+ staticDefaultContext
85255
+ }) {
85050
85256
  return [
85051
85257
  {
85052
85258
  provider: TelemetryRecorderContext.Provider,
@@ -85054,7 +85260,7 @@ function getAppWrappers(vscodeAPI, telemetryRecorder, config, staticInitialConte
85054
85260
  },
85055
85261
  {
85056
85262
  component: ExtensionAPIProviderFromVSCodeAPI,
85057
- props: { vscodeAPI, staticInitialContext }
85263
+ props: { vscodeAPI, staticDefaultContext }
85058
85264
  },
85059
85265
  {
85060
85266
  component: ConfigProvider,
@@ -85346,7 +85552,8 @@ const CodyWebChat = ({
85346
85552
  initialContext,
85347
85553
  telemetryClientName,
85348
85554
  customHeaders,
85349
- className
85555
+ className,
85556
+ onExternalApiReady
85350
85557
  }) => {
85351
85558
  const { client, vscodeAPI } = useCodyWebAgent({
85352
85559
  serverEndpoint,
@@ -85370,12 +85577,13 @@ const CodyWebChat = ({
85370
85577
  {
85371
85578
  vscodeAPI,
85372
85579
  initialContext,
85373
- className: styles$1.container
85580
+ className: styles$1.container,
85581
+ onExternalApiReady
85374
85582
  }
85375
85583
  ) }) });
85376
85584
  };
85377
85585
  const CodyWebPanel = (props) => {
85378
- const { vscodeAPI, initialContext: initialContextData, className } = props;
85586
+ const { vscodeAPI, initialContext: initialContextData, className, onExternalApiReady } = props;
85379
85587
  const dispatchClientAction = useClientActionDispatcher();
85380
85588
  const [errorMessages, setErrorMessages] = useState([]);
85381
85589
  const [messageInProgress, setMessageInProgress] = useState(null);
@@ -85417,12 +85625,13 @@ const CodyWebPanel = (props) => {
85417
85625
  });
85418
85626
  }, [vscodeAPI, dispatchClientAction]);
85419
85627
  const telemetryRecorder = useMemo(() => createWebviewTelemetryRecorder(vscodeAPI), [vscodeAPI]);
85420
- const initialContext = useMemo(() => {
85628
+ const staticDefaultContext = useMemo(() => {
85421
85629
  const { repository, fileURL, isDirectory } = initialContextData ?? {};
85422
85630
  if (!repository) {
85423
- return [];
85631
+ return { initialContext: [], corpusContext: [] };
85424
85632
  }
85425
- const mentions = [
85633
+ const initialContext = [];
85634
+ const corpusContext = [
85426
85635
  {
85427
85636
  type: "repository",
85428
85637
  id: repository.id,
@@ -85435,11 +85644,12 @@ const CodyWebPanel = (props) => {
85435
85644
  source: ContextItemSource.Initial,
85436
85645
  icon: "folder",
85437
85646
  title: "Current Repository"
85647
+ // web chat default initial context
85438
85648
  }
85439
85649
  ];
85440
85650
  if (fileURL) {
85441
85651
  if (isDirectory) {
85442
- mentions.push({
85652
+ initialContext.push({
85443
85653
  type: "openctx",
85444
85654
  provider: "openctx",
85445
85655
  title: fileURL,
@@ -85457,7 +85667,7 @@ const CodyWebPanel = (props) => {
85457
85667
  }
85458
85668
  });
85459
85669
  } else {
85460
- mentions.push({
85670
+ initialContext.push({
85461
85671
  type: "file",
85462
85672
  isIgnored: false,
85463
85673
  title: (initialContextData == null ? void 0 : initialContextData.fileRange) ? "Current Selection" : "Current File",
@@ -85471,11 +85681,16 @@ const CodyWebPanel = (props) => {
85471
85681
  });
85472
85682
  }
85473
85683
  }
85474
- return mentions;
85684
+ return { initialContext, corpusContext };
85475
85685
  }, [initialContextData]);
85476
85686
  const wrappers = useMemo(
85477
- () => getAppWrappers(vscodeAPI, telemetryRecorder, config, initialContext),
85478
- [vscodeAPI, telemetryRecorder, config, initialContext]
85687
+ () => getAppWrappers({
85688
+ vscodeAPI,
85689
+ telemetryRecorder,
85690
+ config,
85691
+ staticDefaultContext
85692
+ }),
85693
+ [vscodeAPI, telemetryRecorder, config, staticDefaultContext]
85479
85694
  );
85480
85695
  const CONTEXT_MENTIONS_SETTINGS = useMemo(() => {
85481
85696
  const { repository } = initialContextData ?? {};
@@ -85499,7 +85714,8 @@ const CodyWebPanel = (props) => {
85499
85714
  showIDESnippetActions: false,
85500
85715
  messageInProgress,
85501
85716
  transcript,
85502
- vscodeAPI
85717
+ vscodeAPI,
85718
+ onExternalApiReady
85503
85719
  }
85504
85720
  ) }) }) });
85505
85721
  };