@marimo-team/islands 0.23.14-dev6 → 0.23.14-dev8
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/{ConnectedDataExplorerComponent-Du3_nUzI.js → ConnectedDataExplorerComponent-DXBx_nQg.js} +4 -4
- package/dist/{chat-ui-BZxLHwyD.js → chat-ui-DYBcNEdd.js} +81 -81
- package/dist/{code-visibility-C90Am97q.js → code-visibility-DKavYkBl.js} +1030 -837
- package/dist/{formats-d6MhLuQ9.js → formats-WsOgyW_K.js} +1 -1
- package/dist/{glide-data-editor-DkzAInWG.js → glide-data-editor-qpmKyAPn.js} +2 -2
- package/dist/{html-to-image-CGp_08St.js → html-to-image-MqcD07Bw.js} +73 -72
- package/dist/{input-CbEz_aj_.js → input-BSdZp5Ng.js} +1 -1
- package/dist/main.js +254 -254
- package/dist/{mermaid-CJW9vIyO.js → mermaid-D-HYBMEV.js} +2 -2
- package/dist/{process-output-R6JsYrv3.js → process-output-Dt3icftd.js} +1 -1
- package/dist/{reveal-component-C_u9FY4_.js → reveal-component-CuFatyYX.js} +5 -5
- package/dist/{spec-Bv-XlYiv.js → spec-CnTgI25l.js} +1 -1
- package/dist/{toDate-D-l5s8nn.js → toDate-D1Z7ZXWh.js} +1 -1
- package/dist/{useAsyncData-1Dhzjfwf.js → useAsyncData-BMc8itk2.js} +1 -1
- package/dist/{useDeepCompareMemoize-CDWT3BDz.js → useDeepCompareMemoize-ZwmDBRDY.js} +1 -1
- package/dist/{useLifecycle-AHlswLw-.js → useLifecycle-CxffarYV.js} +1 -1
- package/dist/{useTheme-BrYvK-_A.js → useTheme-yGsGEk82.js} +26 -24
- package/dist/{vega-component-Pk6lyc_a.js → vega-component-BFJTyykA.js} +5 -5
- package/package.json +1 -1
- package/src/components/chat/acp/agent-panel.tsx +35 -1
- package/src/components/chat/chat-panel.tsx +68 -29
- package/src/components/editor/actions/useNotebookActions.tsx +2 -2
- package/src/components/editor/chrome/wrapper/__tests__/useOpenAiAssistant.test.ts +36 -0
- package/src/components/editor/chrome/wrapper/useAiPanel.ts +3 -1
- package/src/components/editor/chrome/wrapper/useOpenAiAssistant.ts +88 -0
- package/src/components/editor/errors/__tests__/auto-fix.test.ts +119 -0
- package/src/components/editor/errors/auto-fix.tsx +108 -34
- package/src/components/editor/errors/fix-mode.ts +1 -1
- package/src/components/editor/output/MarimoTracebackOutput.tsx +10 -1
- package/src/components/editor/output/__tests__/traceback.test.tsx +14 -6
- package/src/core/ai/config.ts +2 -2
- package/src/core/ai/state.ts +11 -0
- package/src/core/codemirror/utils.ts +15 -0
|
@@ -3,8 +3,8 @@ import { _ as Logger, c as Objects, g as cn, t as Button } from "./button-BacYv-
|
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
5
|
import { u as createLucideIcon } from "./dist--2Bqjvs0.js";
|
|
6
|
-
import { A as SquareFunction, t as augmentSpecWithData } from "./spec-
|
|
7
|
-
import { a as Type, c as Calendar, i as createReducerAndAtoms, o as ToggleLeft, r as Badge, s as Hash, t as useOnMount } from "./useLifecycle-
|
|
6
|
+
import { A as SquareFunction, t as augmentSpecWithData } from "./spec-CnTgI25l.js";
|
|
7
|
+
import { a as Type, c as Calendar, i as createReducerAndAtoms, o as ToggleLeft, r as Badge, s as Hash, t as useOnMount } from "./useLifecycle-CxffarYV.js";
|
|
8
8
|
import { a as ListFilter, t as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from "./useDateFormatter-CMnRuVmN.js";
|
|
9
9
|
import { a as SelectGroup, c as SelectSeparator, i as SelectContent, l as SelectTrigger, o as SelectItem, r as Select, s as SelectLabel, t as Strings, u as SelectValue, w as $a916eb452884faea$export$b7a616150fdb9f44 } from "./strings-Dq_j3Rxw.js";
|
|
10
10
|
import "./react-dom-BTJzcVJ9.js";
|
|
@@ -13,14 +13,14 @@ import "./zod-CijjQh4u.js";
|
|
|
13
13
|
import { n as ErrorBanner } from "./error-banner-DFPfz_Qf.js";
|
|
14
14
|
import { t as Label } from "./label-WfTSU8L4.js";
|
|
15
15
|
import { t as Tooltip } from "./tooltip-Czds6Qr8.js";
|
|
16
|
-
import {
|
|
16
|
+
import { C as createStore, S as atom, _ as Provider, n as useTheme, y as useAtomValue } from "./useTheme-yGsGEk82.js";
|
|
17
17
|
import { t as invariant } from "./invariant-wRzNXIsJ.js";
|
|
18
18
|
import "./vega-loader.browser-CZ-J8Py3.js";
|
|
19
19
|
import { a as getContainerWidth, n as vegaLoadData, s as tooltipHandler } from "./loader-Boph2xIS.js";
|
|
20
20
|
import { n as q, r as contains } from "./react-vega-B0sAlDTL.js";
|
|
21
21
|
import "./defaultLocale-u-3osm0P.js";
|
|
22
22
|
import "./defaultLocale-BoHTsDG6.js";
|
|
23
|
-
import { t as useAsyncData } from "./useAsyncData-
|
|
23
|
+
import { t as useAsyncData } from "./useAsyncData-BMc8itk2.js";
|
|
24
24
|
var ChartColumnBig = createLucideIcon("chart-column-big", [
|
|
25
25
|
["path", {
|
|
26
26
|
d: "M3 3v16a2 2 0 0 0 2 2h16",
|
|
@@ -6,13 +6,13 @@ import { _ as Logger, c as Objects, g as cn, l as useEventListener, t as Button
|
|
|
6
6
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
7
7
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
8
8
|
import { r as toast } from "./copy-COam1EG7.js";
|
|
9
|
-
import { C as AccordionContent, D as ChatBubbleIcon,
|
|
9
|
+
import { Bn as CircleX, C as AccordionContent, D as ChatBubbleIcon, Dn as Trash2, En as Wrench, Et as createVariableInfoElement, Fn as FileText, G as cellErrorsAtom, Gt as dataSourceConnectionsAtom, Jt as getRequestClient, Kt as getTableType, Ln as ExternalLink, Lt as jotaiJsonStorage, Mn as LoaderCircle, Mt as generateUUID, P as base64ToDataURL, Pn as Info, Qt as singleFacet, Rt as variablesAtom, S as Accordion, T as AccordionTrigger, V as renderHTML, Wt as allTablesAtom, X as notebookAtom, _ as Boosts, b as AIContextProvider, bn as Anchor2, c as Popover, cn as CellOutputId, d as PopoverTrigger, f as isOutputEmpty, h as DatasourceContextProvider, kt as moveToEndOfEditor, n as Spinner, r as MarkdownRenderer, rn as ZodLocalStorage, t as toPng, u as PopoverContent, v as Sections, vn as atomWithStorage, w as AccordionItem, x as AIContextRegistry, y as contextToXml, yt as displayCellName, zt as PluralWord } from "./html-to-image-MqcD07Bw.js";
|
|
10
10
|
import "./chunk-5FQGJX7Z-BbqSm5gU.js";
|
|
11
11
|
import { u as createLucideIcon } from "./dist--2Bqjvs0.js";
|
|
12
12
|
import { C as logNever, I as X, R as ChevronDown, t as Strings } from "./strings-Dq_j3Rxw.js";
|
|
13
|
-
import { C as DropdownMenuTrigger, a as NumberField, f as DropdownMenu, h as DropdownMenuItem, p as DropdownMenuContent, r as Input } from "./input-
|
|
14
|
-
import { p as isUrl, v as CircleQuestionMark } from "./toDate-
|
|
15
|
-
import { a as MarimoIncomingMessageEvent, d as Square, f as File$1, n as blobToString, t as processOutput, u as deserializeBlob } from "./process-output-
|
|
13
|
+
import { C as DropdownMenuTrigger, a as NumberField, f as DropdownMenu, h as DropdownMenuItem, p as DropdownMenuContent, r as Input } from "./input-BSdZp5Ng.js";
|
|
14
|
+
import { p as isUrl, v as CircleQuestionMark } from "./toDate-D1Z7ZXWh.js";
|
|
15
|
+
import { a as MarimoIncomingMessageEvent, d as Square, f as File$1, n as blobToString, t as processOutput, u as deserializeBlob } from "./process-output-Dt3icftd.js";
|
|
16
16
|
import "./react-dom-BTJzcVJ9.js";
|
|
17
17
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
18
18
|
import { A as looseObject, B as union, C as any, D as discriminatedUnion, E as custom, H as safeParseAsync, I as record, L as strictObject, M as never, N as number, O as lazy, P as object$1, R as string, S as _null, T as boolean, V as unknown, W as toJSONSchema, b as _enum, k as literal, w as array$1, x as _instanceof } from "./zod-CijjQh4u.js";
|
|
@@ -21,7 +21,7 @@ import { t as Label } from "./label-WfTSU8L4.js";
|
|
|
21
21
|
import { t as Tooltip } from "./tooltip-Czds6Qr8.js";
|
|
22
22
|
import { f as CopyClipboardIcon } from "./extends-9MVIxxRo.js";
|
|
23
23
|
import { t as isEmpty_default } from "./isEmpty-CJJMn-QP.js";
|
|
24
|
-
import {
|
|
24
|
+
import { D as useEvent_default, n as useTheme, x as useStore } from "./useTheme-yGsGEk82.js";
|
|
25
25
|
import { $ as EditorView, At as Facet, It as StateEffect, Lt as StateField, Mt as Prec, Z as Decoration, ft as hoverTooltip, kt as EditorState, nt as WidgetType, pt as keymap, tt as ViewPlugin, zt as Transaction } from "./dist-U4F-tbMs.js";
|
|
26
26
|
import { n as acceptCompletion, o as closeCompletion, r as autocompletion } from "./dist-hT4QzYX-.js";
|
|
27
27
|
import "./main-Tj_-QTyF.js";
|
|
@@ -32,7 +32,7 @@ import "./dist-M9Vag9Y0.js";
|
|
|
32
32
|
import "./dist-C_Y3oV3C.js";
|
|
33
33
|
import { n as minimalSetup, t as esm_default } from "./esm-M837UxV5.js";
|
|
34
34
|
import "./purify.es-H92eMd9-.js";
|
|
35
|
-
import { t as useAsyncData } from "./useAsyncData-
|
|
35
|
+
import { t as useAsyncData } from "./useAsyncData-BMc8itk2.js";
|
|
36
36
|
var Ban = createLucideIcon("ban", [["path", {
|
|
37
37
|
d: "M4.929 4.929 19.07 19.071",
|
|
38
38
|
key: "196cmz"
|
|
@@ -6515,15 +6515,15 @@ var import_compiler_runtime$8 = require_compiler_runtime();
|
|
|
6515
6515
|
const ReasoningAccordion = (e18) => {
|
|
6516
6516
|
let m = (0, import_compiler_runtime$8.c)(13), { reasoning: h, index: g, isStreaming: _ } = e18, v = g === void 0 ? 0 : g, y = _ === void 0 ? false : _, [b, x] = import_react.useState("");
|
|
6517
6517
|
if (!h && !y) return null;
|
|
6518
|
-
let S = y ? "reasoning" : b,
|
|
6519
|
-
m[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
6518
|
+
let S = y ? "reasoning" : b, C;
|
|
6519
|
+
m[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BotMessageSquare, { className: "h-3 w-3" }), m[0] = C) : C = m[0];
|
|
6520
6520
|
let T = y ? "Thinking" : "View reasoning", E = h.length > 0 && ` (${h.length} chars)`, D;
|
|
6521
6521
|
m[1] !== T || m[2] !== E ? (D = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionTrigger, {
|
|
6522
6522
|
className: "text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",
|
|
6523
6523
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
6524
6524
|
className: "flex items-center gap-2",
|
|
6525
6525
|
children: [
|
|
6526
|
-
|
|
6526
|
+
C,
|
|
6527
6527
|
T,
|
|
6528
6528
|
E
|
|
6529
6529
|
]
|
|
@@ -6649,53 +6649,53 @@ const ToolApprovalCard = (e18) => {
|
|
|
6649
6649
|
};
|
|
6650
6650
|
var import_compiler_runtime$5 = require_compiler_runtime();
|
|
6651
6651
|
const ToolErrorCard = (e18) => {
|
|
6652
|
-
let m = (0, import_compiler_runtime$5.c)(28), { toolName: h, input: g, errorText: v, isLive: y, className: b } = e18, [x, S] = import_react.useState(y),
|
|
6653
|
-
m[0] === y ? (
|
|
6654
|
-
|
|
6655
|
-
},
|
|
6656
|
-
let E;
|
|
6657
|
-
m[3] === b ? E = m[4] : (E = cn("rounded-md border border-(--red-6) bg-(--red-2)", b), m[3] = b, m[4] = E);
|
|
6652
|
+
let m = (0, import_compiler_runtime$5.c)(28), { toolName: h, input: g, errorText: v, isLive: y, className: b } = e18, [x, S] = import_react.useState(y), w = import_react.useRef(y), T, E;
|
|
6653
|
+
m[0] === y ? (T = m[1], E = m[2]) : (T = () => {
|
|
6654
|
+
w.current && !y && S(false), w.current = y;
|
|
6655
|
+
}, E = [y], m[0] = y, m[1] = T, m[2] = E), import_react.useEffect(T, E);
|
|
6658
6656
|
let D;
|
|
6659
|
-
m[
|
|
6657
|
+
m[3] === b ? D = m[4] : (D = cn("rounded-md border border-(--red-6) bg-(--red-2)", b), m[3] = b, m[4] = D);
|
|
6660
6658
|
let O;
|
|
6661
|
-
m[
|
|
6659
|
+
m[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = () => S(_temp$2), m[5] = O) : O = m[5];
|
|
6662
6660
|
let k;
|
|
6663
|
-
m[
|
|
6661
|
+
m[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CircleX, { className: "h-3.5 w-3.5 shrink-0" }), m[6] = k) : k = m[6];
|
|
6662
|
+
let A;
|
|
6663
|
+
m[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
6664
6664
|
className: "font-semibold",
|
|
6665
6665
|
children: "Failed:"
|
|
6666
|
-
}), m[7] =
|
|
6667
|
-
let A;
|
|
6668
|
-
m[8] === h ? A = m[9] : (A = formatToolName(h), m[8] = h, m[9] = A);
|
|
6666
|
+
}), m[7] = A) : A = m[7];
|
|
6669
6667
|
let j;
|
|
6670
|
-
m[
|
|
6668
|
+
m[8] === h ? j = m[9] : (j = formatToolName(h), m[8] = h, m[9] = j);
|
|
6669
|
+
let M;
|
|
6670
|
+
m[10] === j ? M = m[11] : (M = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
6671
6671
|
className: "flex-1 text-left",
|
|
6672
6672
|
children: [
|
|
6673
|
-
|
|
6673
|
+
A,
|
|
6674
6674
|
" ",
|
|
6675
6675
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
|
6676
6676
|
className: "font-mono",
|
|
6677
|
-
children:
|
|
6677
|
+
children: j
|
|
6678
6678
|
})
|
|
6679
6679
|
]
|
|
6680
|
-
}), m[10] =
|
|
6681
|
-
let
|
|
6682
|
-
m[12] ===
|
|
6683
|
-
let P;
|
|
6684
|
-
m[14] === N ? P = m[15] : (P = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, { className: N }), m[14] = N, m[15] = P);
|
|
6680
|
+
}), m[10] = j, m[11] = M);
|
|
6681
|
+
let N = x && "rotate-180", P;
|
|
6682
|
+
m[12] === N ? P = m[13] : (P = cn("h-3.5 w-3.5 shrink-0 transition-transform", N), m[12] = N, m[13] = P);
|
|
6685
6683
|
let F;
|
|
6686
|
-
m[
|
|
6684
|
+
m[14] === P ? F = m[15] : (F = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, { className: P }), m[14] = P, m[15] = F);
|
|
6685
|
+
let I;
|
|
6686
|
+
m[16] !== x || m[17] !== F || m[18] !== M ? (I = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
6687
6687
|
type: "button",
|
|
6688
|
-
onClick:
|
|
6688
|
+
onClick: O,
|
|
6689
6689
|
className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-(--red-11) hover:bg-(--red-3) rounded-md transition-colors",
|
|
6690
6690
|
"aria-expanded": x,
|
|
6691
6691
|
children: [
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6692
|
+
k,
|
|
6693
|
+
M,
|
|
6694
|
+
F
|
|
6695
6695
|
]
|
|
6696
|
-
}), m[16] = x, m[17] =
|
|
6697
|
-
let
|
|
6698
|
-
m[20] !== v || m[21] !== g || m[22] !== x ? (
|
|
6696
|
+
}), m[16] = x, m[17] = F, m[18] = M, m[19] = I) : I = m[19];
|
|
6697
|
+
let L;
|
|
6698
|
+
m[20] !== v || m[21] !== g || m[22] !== x ? (L = x && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6699
6699
|
className: "px-3 pb-3 space-y-3 border-t border-(--red-6)/40 pt-3",
|
|
6700
6700
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolArgsRenderer, { input: g }), v && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
6701
6701
|
className: "text-xs font-semibold text-(--red-11) mb-1",
|
|
@@ -6704,12 +6704,12 @@ const ToolErrorCard = (e18) => {
|
|
|
6704
6704
|
className: "bg-(--red-2) border border-(--red-6) rounded p-2 text-xs text-(--red-11) leading-relaxed overflow-auto scrollbar-thin max-h-64 whitespace-pre-wrap",
|
|
6705
6705
|
children: v
|
|
6706
6706
|
})] })]
|
|
6707
|
-
}), m[20] = v, m[21] = g, m[22] = x, m[23] =
|
|
6708
|
-
let
|
|
6709
|
-
return m[24] !==
|
|
6710
|
-
className:
|
|
6711
|
-
children: [
|
|
6712
|
-
}), m[24] =
|
|
6707
|
+
}), m[20] = v, m[21] = g, m[22] = x, m[23] = L) : L = m[23];
|
|
6708
|
+
let R;
|
|
6709
|
+
return m[24] !== I || m[25] !== L || m[26] !== D ? (R = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
6710
|
+
className: D,
|
|
6711
|
+
children: [I, L]
|
|
6712
|
+
}), m[24] = I, m[25] = L, m[26] = D, m[27] = R) : R = m[27], R;
|
|
6713
6713
|
};
|
|
6714
6714
|
function _temp$2(e18) {
|
|
6715
6715
|
return !e18;
|
|
@@ -6854,7 +6854,7 @@ function getTriggerToneClass(e18) {
|
|
|
6854
6854
|
}
|
|
6855
6855
|
}
|
|
6856
6856
|
const ToolHistoryRow = (e18) => {
|
|
6857
|
-
let m = (0, import_compiler_runtime$3.c)(34), { toolName: h, state: g, input: v, result: y, approval: b, index: x, className: S, isActive:
|
|
6857
|
+
let m = (0, import_compiler_runtime$3.c)(34), { toolName: h, state: g, input: v, result: y, approval: b, index: x, className: S, isActive: C } = e18, T = x === void 0 ? 0 : x, E = C === void 0 ? true : C, D;
|
|
6858
6858
|
m[0] !== E || m[1] !== g ? (D = !E && PENDING_STATES.has(g), m[0] = E, m[1] = g, m[2] = D) : D = m[2];
|
|
6859
6859
|
let O = D, k = `tool-${T}`, A;
|
|
6860
6860
|
m[3] === S ? A = m[4] : (A = cn("w-full", S), m[3] = S, m[4] = A);
|
|
@@ -6882,13 +6882,13 @@ const ToolHistoryRow = (e18) => {
|
|
|
6882
6882
|
F
|
|
6883
6883
|
]
|
|
6884
6884
|
}), m[15] = F, m[16] = M, m[17] = N, m[18] = I) : I = m[18];
|
|
6885
|
-
let
|
|
6886
|
-
m[19] !== I || m[20] !== j ? (
|
|
6885
|
+
let L;
|
|
6886
|
+
m[19] !== I || m[20] !== j ? (L = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionTrigger, {
|
|
6887
6887
|
className: j,
|
|
6888
6888
|
children: I
|
|
6889
|
-
}), m[19] = I, m[20] = j, m[21] =
|
|
6890
|
-
let
|
|
6891
|
-
m[22] !== b || m[23] !== v || m[24] !== y || m[25] !== g ? (
|
|
6889
|
+
}), m[19] = I, m[20] = j, m[21] = L) : L = m[21];
|
|
6890
|
+
let R;
|
|
6891
|
+
m[22] !== b || m[23] !== v || m[24] !== y || m[25] !== g ? (R = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AccordionContent, {
|
|
6892
6892
|
className: "py-2 px-2",
|
|
6893
6893
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HistoryContent, {
|
|
6894
6894
|
state: g,
|
|
@@ -6896,20 +6896,20 @@ const ToolHistoryRow = (e18) => {
|
|
|
6896
6896
|
result: y,
|
|
6897
6897
|
approval: b
|
|
6898
6898
|
})
|
|
6899
|
-
}), m[22] = b, m[23] = v, m[24] = y, m[25] = g, m[26] =
|
|
6900
|
-
let
|
|
6901
|
-
m[27] !==
|
|
6899
|
+
}), m[22] = b, m[23] = v, m[24] = y, m[25] = g, m[26] = R) : R = m[26];
|
|
6900
|
+
let z;
|
|
6901
|
+
m[27] !== L || m[28] !== R ? (z = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AccordionItem, {
|
|
6902
6902
|
value: "tool-call",
|
|
6903
6903
|
className: "border-0",
|
|
6904
|
-
children: [
|
|
6905
|
-
}), m[27] =
|
|
6906
|
-
let
|
|
6907
|
-
return m[30] !==
|
|
6904
|
+
children: [L, R]
|
|
6905
|
+
}), m[27] = L, m[28] = R, m[29] = z) : z = m[29];
|
|
6906
|
+
let B;
|
|
6907
|
+
return m[30] !== z || m[31] !== k || m[32] !== A ? (B = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Accordion, {
|
|
6908
6908
|
type: "single",
|
|
6909
6909
|
collapsible: true,
|
|
6910
6910
|
className: A,
|
|
6911
|
-
children:
|
|
6912
|
-
}, k), m[30] =
|
|
6911
|
+
children: z
|
|
6912
|
+
}, k), m[30] = z, m[31] = k, m[32] = A, m[33] = B) : B = m[33], B;
|
|
6913
6913
|
};
|
|
6914
6914
|
var HistoryContent = (e18) => {
|
|
6915
6915
|
let m = (0, import_compiler_runtime$3.c)(16), { state: h, input: g, result: _, approval: v } = e18;
|
|
@@ -7612,11 +7612,11 @@ function routeIncomingChatChunk(e18, m) {
|
|
|
7612
7612
|
}
|
|
7613
7613
|
const Chatbot = (e18) => {
|
|
7614
7614
|
var _a;
|
|
7615
|
-
let [m, g] = (0, import_react.useState)(""), [b, x] = (0, import_react.useState)(e18.config), [S, C] = (0, import_react.useState)(e18.config), [w,
|
|
7615
|
+
let [m, g] = (0, import_react.useState)(""), [b, x] = (0, import_react.useState)(e18.config), [S, C] = (0, import_react.useState)(e18.config), [w, T] = (0, import_react.useState)(void 0), D = (0, import_react.useRef)(null), O = (0, import_react.useRef)(null), k = (0, import_react.useRef)(null), A = (0, import_react.useRef)(null);
|
|
7616
7616
|
Object.keys(e18.config).some((m2) => e18.config[m2] !== S[m2]) && (x(e18.config), C(e18.config));
|
|
7617
7617
|
let j = (0, import_react.useRef)(b);
|
|
7618
7618
|
j.current = b;
|
|
7619
|
-
let
|
|
7619
|
+
let M = (0, import_react.useRef)(null), N = (0, import_react.useRef)(null), { data: P } = useAsyncData(async () => (await e18.get_chat_history({})).messages, []), F = e18.value.length > 0 ? e18.value : P, { messages: I, sendMessage: R, setMessages: z, status: B, stop: V, error: H, regenerate: U, clearError: W, addToolApprovalResponse: G } = useChat({
|
|
7620
7620
|
sendAutomaticallyWhen: ({ messages: e19 }) => hasPendingToolCalls(e19),
|
|
7621
7621
|
transport: new DefaultChatTransport({ fetch: async (m2, g2) => {
|
|
7622
7622
|
var _a2;
|
|
@@ -7638,14 +7638,14 @@ const Chatbot = (e18) => {
|
|
|
7638
7638
|
};
|
|
7639
7639
|
}), g3 = generateUUID(), b2 = new ReadableStream({
|
|
7640
7640
|
start(m4) {
|
|
7641
|
-
|
|
7641
|
+
M.current = m4, N.current = g3;
|
|
7642
7642
|
let _2 = () => {
|
|
7643
7643
|
try {
|
|
7644
7644
|
m4.close();
|
|
7645
7645
|
} catch (e19) {
|
|
7646
7646
|
Logger.debug("Controller may already be closed", { error: e19 });
|
|
7647
7647
|
}
|
|
7648
|
-
|
|
7648
|
+
M.current = null, N.current = null, e18.cancel_prompt({ request_id: g3 }).catch((e19) => {
|
|
7649
7649
|
Logger.debug("cancel_prompt failed", { error: e19 });
|
|
7650
7650
|
});
|
|
7651
7651
|
};
|
|
@@ -7654,7 +7654,7 @@ const Chatbot = (e18) => {
|
|
|
7654
7654
|
};
|
|
7655
7655
|
},
|
|
7656
7656
|
cancel() {
|
|
7657
|
-
|
|
7657
|
+
M.current = null, N.current = null;
|
|
7658
7658
|
}
|
|
7659
7659
|
});
|
|
7660
7660
|
return e18.send_prompt({
|
|
@@ -7663,7 +7663,7 @@ const Chatbot = (e18) => {
|
|
|
7663
7663
|
config: y
|
|
7664
7664
|
}).catch((e19) => {
|
|
7665
7665
|
var _a3;
|
|
7666
|
-
(_a3 =
|
|
7666
|
+
(_a3 = M.current) == null ? void 0 : _a3.error(e19), M.current = null, N.current = null;
|
|
7667
7667
|
}), createUIMessageStreamResponse({ stream: b2 });
|
|
7668
7668
|
} catch (e19) {
|
|
7669
7669
|
if (e19 instanceof Error && e19.name === "AbortError") return new Response("Aborted", { status: 499 });
|
|
@@ -7671,9 +7671,9 @@ const Chatbot = (e18) => {
|
|
|
7671
7671
|
return new Response(m3, { status: 400 });
|
|
7672
7672
|
}
|
|
7673
7673
|
} }),
|
|
7674
|
-
messages:
|
|
7674
|
+
messages: F,
|
|
7675
7675
|
onFinish: (m2) => {
|
|
7676
|
-
|
|
7676
|
+
T(void 0), D.current && (D.current.value = ""), Logger.debug("Finished streaming message:", m2), e18.setValue(m2.messages);
|
|
7677
7677
|
},
|
|
7678
7678
|
onError: (e19) => {
|
|
7679
7679
|
Logger.error("An error occurred:", e19);
|
|
@@ -7682,14 +7682,14 @@ const Chatbot = (e18) => {
|
|
|
7682
7682
|
useEventListener(e18.host, MarimoIncomingMessageEvent.TYPE, (e19) => {
|
|
7683
7683
|
let m2 = ChatMessageIncomingSchema.safeParse(e19.detail.message);
|
|
7684
7684
|
m2.success && routeIncomingChatChunk(m2.data, {
|
|
7685
|
-
controllerRef:
|
|
7686
|
-
activeRequestIdRef:
|
|
7685
|
+
controllerRef: M,
|
|
7686
|
+
activeRequestIdRef: N
|
|
7687
7687
|
});
|
|
7688
7688
|
});
|
|
7689
7689
|
let K = B === "submitted" || B === "streaming", q = (m2) => {
|
|
7690
|
-
let h =
|
|
7690
|
+
let h = I.findIndex((e19) => e19.id === m2);
|
|
7691
7691
|
if (h !== -1) {
|
|
7692
|
-
let g2 =
|
|
7692
|
+
let g2 = I.filter((e19) => e19.id !== m2);
|
|
7693
7693
|
e18.delete_chat_message({ index: h }), z(g2), e18.setValue(g2);
|
|
7694
7694
|
}
|
|
7695
7695
|
}, J = Array.isArray(e18.allowAttachments) && e18.allowAttachments.length > 0 || e18.allowAttachments === true, Y = {
|
|
@@ -7706,7 +7706,7 @@ const Chatbot = (e18) => {
|
|
|
7706
7706
|
top: A.current.scrollHeight,
|
|
7707
7707
|
behavior: "smooth"
|
|
7708
7708
|
});
|
|
7709
|
-
}, [
|
|
7709
|
+
}, [I.length, A]);
|
|
7710
7710
|
let Q = (_a = k.current) == null ? void 0 : _a.view, $ = () => {
|
|
7711
7711
|
if (Q) {
|
|
7712
7712
|
let e19 = Q.state.doc.length;
|
|
@@ -7727,7 +7727,7 @@ const Chatbot = (e18) => {
|
|
|
7727
7727
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
|
|
7728
7728
|
variant: "text",
|
|
7729
7729
|
size: "icon",
|
|
7730
|
-
disabled:
|
|
7730
|
+
disabled: I.length === 0,
|
|
7731
7731
|
onClick: () => {
|
|
7732
7732
|
z([]), e18.setValue([]), e18.delete_chat_history({}), W();
|
|
7733
7733
|
},
|
|
@@ -7738,7 +7738,7 @@ const Chatbot = (e18) => {
|
|
|
7738
7738
|
className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
|
|
7739
7739
|
ref: A,
|
|
7740
7740
|
children: [
|
|
7741
|
-
|
|
7741
|
+
I.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
7742
7742
|
className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
|
|
7743
7743
|
children: [
|
|
7744
7744
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BotMessageSquare, { className: "h-12 w-12 mb-4" }),
|
|
@@ -7752,9 +7752,9 @@ const Chatbot = (e18) => {
|
|
|
7752
7752
|
})
|
|
7753
7753
|
]
|
|
7754
7754
|
}),
|
|
7755
|
-
|
|
7755
|
+
I.map((e19, m2) => {
|
|
7756
7756
|
var _a2;
|
|
7757
|
-
let h = (_a2 = e19.parts) == null ? void 0 : _a2.filter((e20) => e20.type === "text").map((e20) => e20.text).join("\n"), g2 = m2 ===
|
|
7757
|
+
let h = (_a2 = e19.parts) == null ? void 0 : _a2.filter((e20) => e20.type === "text").map((e20) => e20.text).join("\n"), g2 = m2 === I.length - 1;
|
|
7758
7758
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
7759
7759
|
className: cn("flex flex-col group gap-2", e19.role === "user" ? "items-end" : "items-start"),
|
|
7760
7760
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -7854,7 +7854,7 @@ const Chatbot = (e18) => {
|
|
|
7854
7854
|
variant: "text",
|
|
7855
7855
|
size: "sm",
|
|
7856
7856
|
onClick: () => {
|
|
7857
|
-
|
|
7857
|
+
T(void 0), D.current && (D.current.value = "");
|
|
7858
7858
|
},
|
|
7859
7859
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { className: "size-3" })
|
|
7860
7860
|
}),
|
|
@@ -7874,7 +7874,7 @@ const Chatbot = (e18) => {
|
|
|
7874
7874
|
multiple: true,
|
|
7875
7875
|
accept: Array.isArray(e18.allowAttachments) ? e18.allowAttachments.join(",") : void 0,
|
|
7876
7876
|
onChange: (e19) => {
|
|
7877
|
-
e19.target.files &&
|
|
7877
|
+
e19.target.files && T([...e19.target.files]);
|
|
7878
7878
|
}
|
|
7879
7879
|
})] }),
|
|
7880
7880
|
K ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip, {
|
|
@@ -8022,8 +8022,8 @@ var configDescriptions = {
|
|
|
8022
8022
|
m[0] === g ? S = m[1] : (S = (e19) => {
|
|
8023
8023
|
[...e19.matchAll(/{{(\w+)}}/g)].length > 0 ? (x(e19), v(true)) : g(e19);
|
|
8024
8024
|
}, m[0] = g, m[1] = S);
|
|
8025
|
-
let C = S,
|
|
8026
|
-
m[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
8025
|
+
let C = S, w;
|
|
8026
|
+
m[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip, {
|
|
8027
8027
|
content: "Select a prompt",
|
|
8028
8028
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuTrigger, {
|
|
8029
8029
|
asChild: true,
|
|
@@ -8034,7 +8034,7 @@ var configDescriptions = {
|
|
|
8034
8034
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChatBubbleIcon, { className: "h-3 w-3" })
|
|
8035
8035
|
})
|
|
8036
8036
|
})
|
|
8037
|
-
}), m[2] =
|
|
8037
|
+
}), m[2] = w) : w = m[2];
|
|
8038
8038
|
let E;
|
|
8039
8039
|
if (m[3] !== C || m[4] !== h) {
|
|
8040
8040
|
let e19;
|
|
@@ -8045,7 +8045,7 @@ var configDescriptions = {
|
|
|
8045
8045
|
}, m2), m[6] = C, m[7] = e19), E = h.map(e19), m[3] = C, m[4] = h, m[5] = E;
|
|
8046
8046
|
} else E = m[5];
|
|
8047
8047
|
let D;
|
|
8048
|
-
m[8] === E ? D = m[9] : (D = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverAnchor, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DropdownMenu, { children: [
|
|
8048
|
+
m[8] === E ? D = m[9] : (D = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverAnchor, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DropdownMenu, { children: [w, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuContent, {
|
|
8049
8049
|
side: "right",
|
|
8050
8050
|
align: "end",
|
|
8051
8051
|
onCloseAutoFocus: _temp,
|