@marimo-team/islands 0.25.3-dev273 → 0.25.3-dev275
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-eLHPh6uu.js → ConnectedDataExplorerComponent-CErm132k.js} +25 -26
- package/dist/{ErrorBoundary-DBh-wUT9.js → ErrorBoundary-BuIXiuc5.js} +43 -44
- package/dist/{abnfDiagram-VCTEODGH-hqd0IBtX.js → abnfDiagram-VCTEODGH-d-Qn2fwb.js} +2 -2
- package/dist/{any-language-editor-DnG26QXh.js → any-language-editor-6k6F12Z3.js} +3 -3
- package/dist/{architectureDiagram-5GKGNRK7-BzLAFcc0.js → architectureDiagram-5GKGNRK7-DxragHYv.js} +1 -1
- package/dist/{assertNever-DIU3JJbt.js → assertNever-B-YzWzbL.js} +14 -14
- package/dist/{button-0-RqY1DW.js → button-DZuNnIZO.js} +220 -223
- package/dist/{capabilities-B6yy_CBN.js → capabilities-D9FskwsK.js} +1 -1
- package/dist/{chat-ui-BWIkve2R.js → chat-ui-SZ6lSH52.js} +144 -145
- package/dist/{check-gUSZbRsl.js → check-XFzZeH-y.js} +1 -1
- package/dist/{chunk-IMKFNOWR-DOeVvuyE.js → chunk-IMKFNOWR-C0x0feFg.js} +1 -1
- package/dist/{chunk-SHT3W25Y-DZoFI8wR.js → chunk-SHT3W25Y-D0ZdASqB.js} +1 -1
- package/dist/{chunk-SVP7TREG-CWu86PSW.js → chunk-SVP7TREG-BHjL96zx.js} +1 -1
- package/dist/{chunk-TICWLB2K-BrM0GoP3.js → chunk-TICWLB2K-CzcrwGfp.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-DYi4V2bB.js → classDiagram-ZZMXUADV-BTqFAZTP.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-tN7FIk-m.js → classDiagram-v2-VYDZK3BY-EPXb0Elt.js} +2 -2
- package/dist/{code-visibility-M_dXDGp6.js → code-visibility-BEAPMrC-.js} +20 -20
- package/dist/{common-DV0fvw_I.js → common-CEmzaoJ8.js} +799 -801
- package/dist/{config-BsPruWMR.js → config-C8MFHQ2E.js} +23 -22
- package/dist/{copy-icon-C2I8sw4h.js → copy-icon-CtllOdmg.js} +3 -3
- package/dist/{createReducer-DdtT_7ji.js → createReducer-DRqwmaTc.js} +2 -2
- package/dist/{cynefinDiagram-5FMLGOSQ-D5nCnDc-.js → cynefinDiagram-5FMLGOSQ-CBSD344q.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-BHkd7f_i.js → dagre-GXQ25YYZ-JItjh3Ge.js} +1 -1
- package/dist/{data-grid-overlay-editor-Cd1zGKBt.js → data-grid-overlay-editor-CUo25_W8.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-D1ALppT2.js → diagram-S7CK7UJ4-CTD9xTVb.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-DLv0b83L.js → diagram-UQ7AKVKN-DTfnFai8.js} +1 -1
- package/dist/{diagram-VX7I27RA-7XJ7J6qg.js → diagram-VX7I27RA-BcSnucV-.js} +1 -1
- package/dist/{diagram-Z3DM3KII-7M7zbHp_.js → diagram-Z3DM3KII-C2ATIE8A.js} +1 -1
- package/dist/{dialog-DzCj1qQv.js → dialog-CaYm5imE.js} +33 -33
- package/dist/{dropdown-menu-CdXE15an.js → dropdown-menu-Bb0bFOIk.js} +149 -149
- package/dist/{ebnfDiagram-PWID7BFC-DHH1qlmV.js → ebnfDiagram-PWID7BFC-B7B9JPxc.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-fI_0dGef.js → erDiagram-RLTQ6QDP-v6hDno1O.js} +1 -1
- package/dist/{error-banner-DPc9eIw5.js → error-banner-CHCdHVFB.js} +44 -45
- package/dist/{error-entries-CxN-Nq3V.js → error-entries-B-1yUdcH.js} +406 -407
- package/dist/{feedback-button-CE2gPi4-.js → feedback-button-BqiR7zMO.js} +11 -11
- package/dist/{flowDiagram-HODETNUW-Brg9MA6i.js → flowDiagram-HODETNUW-aIFlAtOy.js} +2 -2
- package/dist/{formats-DbSvAPY-.js → formats-PzBQMUnr.js} +3 -3
- package/dist/{glide-data-editor-BycATbgF.js → glide-data-editor-B7dguvqk.js} +14 -16
- package/dist/{glide-utils-BSw3SSHF.js → glide-utils-BSQr4d90.js} +51 -59
- package/dist/{globals-CW6OvnI5.js → globals-CYykXfGI.js} +3 -3
- package/dist/{html-to-image-Bc2AvXHG.js → html-to-image-DC_pmZLs.js} +546 -548
- package/dist/{infoDiagram-27XIBGKW-E9e403YT.js → infoDiagram-27XIBGKW-D6YHLeCP.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-C-RlYDRo.js → ishikawaDiagram-5VMMS53U-D1ZvprOX.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-CLFl_uqK.js → kanban-definition-UXKFOSKX-Bna_3BMr.js} +1 -1
- package/dist/{loader-BVEtQ4F3.js → loader-DZvtzQoD.js} +1 -1
- package/dist/main.js +6772 -6771
- package/dist/{mermaid-rd09e1JL.js → mermaid-A36unKXJ.js} +50 -50
- package/dist/{mindmap-definition-YA3MSWOX-BQ8TWtyB.js → mindmap-definition-YA3MSWOX-CyVCs__G.js} +1 -1
- package/dist/{number-overlay-editor-B_rR-LdM.js → number-overlay-editor-C4u7SJAJ.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-CN8UHFPi.js → pegDiagram-XKGWAZYB-9hNBD2wZ.js} +2 -2
- package/dist/{pencil-DcT8AE0h.js → pencil-DYUlSKxZ.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-DGuJ0EBd.js → pieDiagram-E7YTZNPT-8tr-NYo7.js} +1 -1
- package/dist/{process-output-qecD7Dk8.js → process-output-DYu84VfZ.js} +4 -4
- package/dist/{railroadDiagram-O6MQD6OU-BPDA8wy8.js → railroadDiagram-O6MQD6OU-Dzg1dyyp.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-ChzLGbGW.js → requirementDiagram-BXWQKSXE-B7sNqwGG.js} +1 -1
- package/dist/{reveal-component-CngVwOSy.js → reveal-component-DGi-irHV.js} +589 -589
- package/dist/{select-OxgozOC8.js → select-DsoP1qe8.js} +290 -290
- package/dist/{sequenceDiagram-WJ2MYXX4-DFX-bE6O.js → sequenceDiagram-WJ2MYXX4-oP9shbaG.js} +1 -1
- package/dist/{spec-oJn0RhpQ.js → spec-BZMDxAu7.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-BR7cI3wK.js → stateDiagram-D77RDMKH-CjCv4ogv.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-oGqB5UDI.js → stateDiagram-v2-MP3YSRHH-BW9X162a.js} +2 -2
- package/dist/{static-state-CuV6Pc3a.js → static-state-D-Q-Ajaa.js} +8 -8
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-DwSZl1yC.js → swimlanes-42K2YHIH-Ckfs9Wrn.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-BHlcd-Ri.js → swimlanesDiagram-VR7AAH4N-DpTNG9YP.js} +2 -2
- package/dist/{swiper-component-Dvj-goaD.js → swiper-component-DQbK_ZWm.js} +7 -7
- package/dist/{timeline-definition-24CTP7MA-DMmP-G2O.js → timeline-definition-24CTP7MA-BXaBlV6U.js} +1 -1
- package/dist/{toast-DbBHmxmB.js → toast-BhjIy3Tq.js} +158 -158
- package/dist/{tooltip-BfcDQd2j.js → tooltip-DMMiOn2f.js} +64 -64
- package/dist/use-restore-focus-CosX7-gx.js +7568 -0
- package/dist/{useAsyncData-BYIAoMqn.js → useAsyncData-Ci4AvJff.js} +4 -4
- package/dist/{useDateFormatter-ButWkdcK.js → useDateFormatter-CPlava52.js} +2 -2
- package/dist/{useDeepCompareMemoize-Bz0c5GN6.js → useDeepCompareMemoize-NaaWoFlX.js} +1 -1
- package/dist/useEvent-BRH-aCqi.js +19 -0
- package/dist/{useIframeCapabilities-BIolGsF1.js → useIframeCapabilities-BXhDDoCG.js} +1 -1
- package/dist/{useLifecycle-JjxCC7Vu.js → useLifecycle-SniivYmC.js} +2 -2
- package/dist/{vega-component-rxIxAAh9.js → vega-component-DIxaDQNs.js} +40 -40
- package/dist/{vennDiagram-4TSXK5OY-Db8GtH1G.js → vennDiagram-4TSXK5OY-C-hQ4iNJ.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-DmIiC3FU.js → wardleyDiagram-VM6X3IG4-C2MQ_Umv.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-DS9OPrNq.js → xychartDiagram-S5SC5T6Z-BtTTBn7Q.js} +1 -1
- package/package.json +1 -1
- package/src/core/islands/components/__tests__/web-components.test.tsx +63 -0
- package/src/core/islands/components/web-components.tsx +11 -0
- package/src/css/globals.css +6 -2
- package/src/plugins/impl/DataEditorPlugin.tsx +0 -4
- package/src/plugins/impl/data-editor/__tests__/column-types.test.ts +5 -0
- package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +9 -5
- package/src/plugins/impl/data-editor/column-types.ts +3 -0
- package/src/plugins/impl/data-editor/glide-data-editor.tsx +6 -5
- package/src/plugins/impl/data-editor/glide-utils.ts +10 -32
- package/src/plugins/impl/data-editor/types.ts +0 -2
- package/src/theme/__tests__/islands-theme.test.tsx +276 -0
- package/src/theme/namespace.tsx +4 -3
- package/src/theme/useTheme.ts +71 -41
- package/dist/schemas-CdscWNy_.js +0 -4747
- package/dist/use-restore-focus-CmflVLWJ.js +0 -1672
- package/dist/useTheme-DPLobSFs.js +0 -339
- package/dist/utils-EBklsC5R.js +0 -813
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { a as e, t } from "./rolldown-runtime-Cb76FRpK.js";
|
|
2
|
-
import {
|
|
2
|
+
import { g as n, h as r, i, t as a } from "./button-DZuNnIZO.js";
|
|
3
3
|
import { t as o } from "./react-sHtZdjeP.js";
|
|
4
4
|
import { t as s } from "./compiler-runtime-CldRdSsv.js";
|
|
5
|
-
import { i as c, t as l } from "./copy-icon-
|
|
6
|
-
import { Ct as u, Dt as d, Et as f, It as p, J as m, Lt as h, M as g, Nt as _, Pt as v, Tt as y, U as b, V as x, Vt as S, W as C, a as w, at as T, ct as E, dt as D, et as O, f as k, g as A, h as j, ht as M, kt as ee, l as te, m as ne, n as re, ot as ie, p as ae, r as oe, st as se, t as ce, u as le, v as ue, xt as de, zt as fe } from "./html-to-image-
|
|
7
|
-
import { h as N, t as pe } from "./tooltip-
|
|
8
|
-
import { d as me } from "./select-
|
|
9
|
-
import { Sn as he, _ as ge, bn as _e, f as ve, h as ye, i as be, n as xe, t as Se } from "./dropdown-menu-
|
|
10
|
-
import { a as Ce, l as we } from "./config-
|
|
11
|
-
import { I as Te, K as Ee, N as De, Tt as Oe, Wt as ke, ct as Ae, h as je, i as Me, r as Ne, t as Pe, tt as Fe } from "./error-entries-
|
|
12
|
-
import { d as Ie, f as Le, i as Re, n as ze, t as Be, u as Ve } from "./process-output-
|
|
13
|
-
import { t as He } from "./pencil-
|
|
14
|
-
import { n as Ue, r as We, s as Ge } from "./assertNever-
|
|
5
|
+
import { i as c, t as l } from "./copy-icon-CtllOdmg.js";
|
|
6
|
+
import { Ct as u, Dt as d, Et as f, It as p, J as m, Lt as h, M as g, Nt as _, Pt as v, Tt as y, U as b, V as x, Vt as S, W as C, a as w, at as T, ct as E, dt as D, et as O, f as k, g as A, h as j, ht as M, kt as ee, l as te, m as ne, n as re, ot as ie, p as ae, r as oe, st as se, t as ce, u as le, v as ue, xt as de, zt as fe } from "./html-to-image-DC_pmZLs.js";
|
|
7
|
+
import { h as N, t as pe } from "./tooltip-DMMiOn2f.js";
|
|
8
|
+
import { d as me } from "./select-DsoP1qe8.js";
|
|
9
|
+
import { Sn as he, _ as ge, bn as _e, f as ve, h as ye, i as be, n as xe, t as Se } from "./dropdown-menu-Bb0bFOIk.js";
|
|
10
|
+
import { a as Ce, l as we } from "./config-C8MFHQ2E.js";
|
|
11
|
+
import { I as Te, K as Ee, N as De, Tt as Oe, Wt as ke, ct as Ae, h as je, i as Me, r as Ne, t as Pe, tt as Fe } from "./error-entries-B-1yUdcH.js";
|
|
12
|
+
import { d as Ie, f as Le, i as Re, n as ze, t as Be, u as Ve } from "./process-output-DYu84VfZ.js";
|
|
13
|
+
import { t as He } from "./pencil-DYUlSKxZ.js";
|
|
14
|
+
import { n as Ue, r as We, s as Ge } from "./assertNever-B-YzWzbL.js";
|
|
15
15
|
import { t as Ke } from "./jsx-runtime-3BD1kT0s.js";
|
|
16
|
-
import {
|
|
17
|
-
import { n as
|
|
18
|
-
import { t as
|
|
19
|
-
import {
|
|
20
|
-
import { t as
|
|
21
|
-
import { Dt as
|
|
22
|
-
import { B as pt, C as mt, D as ht, F as gt, H as _t, I as vt, M as yt, N as bt, O as xt, R as St, S as Ct, T as wt, b as Tt, j as Et, k as Dt, v as Ot, w as kt, x as At, y as jt, z as Mt } from "./schemas-CdscWNy_.js";
|
|
16
|
+
import { $ as qe, Ft as Je, G as Ye, H as Xe, J as Ze, K as Qe, Lt as $e, Q as et, U as tt, W as nt, Y as rt, Z as it, at, ct as ot, ft as st, h as ct, lt, nt as ut, ot as dt, q as ft, rt as pt, tt as mt, u as ht, ut as gt } from "./use-restore-focus-CosX7-gx.js";
|
|
17
|
+
import { n as _t } from "./error-banner-CHCdHVFB.js";
|
|
18
|
+
import { t as vt } from "./isEmpty-CdX7MTE1.js";
|
|
19
|
+
import { t as yt } from "./objects-DCmMvZtn.js";
|
|
20
|
+
import { t as bt } from "./useEvent-BRH-aCqi.js";
|
|
21
|
+
import { Dt as xt, Et as St, St as Ct, U as wt, V as Tt, W as Et, bt as Dt, kt as Ot, nt as kt, rt as At, yt as jt, z as Mt } from "./dist-CYeqK4Xw.js";
|
|
23
22
|
import { n as Nt, o as Pt, r as Ft } from "./dist-BX1mn8na.js";
|
|
24
23
|
import { n as It } from "./dist-DiLFTlnl.js";
|
|
25
24
|
import { n as Lt, t as Rt } from "./esm-BDqqT86j.js";
|
|
26
|
-
import { t as zt } from "./useAsyncData-
|
|
25
|
+
import { t as zt } from "./useAsyncData-Ci4AvJff.js";
|
|
27
26
|
var Bt = N("ban", [["circle", {
|
|
28
27
|
cx: "12",
|
|
29
28
|
cy: "12",
|
|
@@ -1427,12 +1426,12 @@ function di(e, t) {
|
|
|
1427
1426
|
}
|
|
1428
1427
|
function fi(e, t) {
|
|
1429
1428
|
let n = t?.useReferences ?? !1;
|
|
1430
|
-
return oi(() => sr(
|
|
1429
|
+
return oi(() => sr(st(e, {
|
|
1431
1430
|
target: "draft-7",
|
|
1432
1431
|
io: "input",
|
|
1433
1432
|
reused: n ? "ref" : "inline"
|
|
1434
1433
|
})), { validate: async (t) => {
|
|
1435
|
-
let n = await
|
|
1434
|
+
let n = await gt(e, t);
|
|
1436
1435
|
return n.success ? {
|
|
1437
1436
|
success: !0,
|
|
1438
1437
|
value: n.data
|
|
@@ -1622,23 +1621,23 @@ function Wi(e, t) {
|
|
|
1622
1621
|
return n;
|
|
1623
1622
|
}
|
|
1624
1623
|
var W = {
|
|
1625
|
-
array:
|
|
1626
|
-
boolean:
|
|
1627
|
-
custom:
|
|
1628
|
-
discriminatedUnion:
|
|
1629
|
-
enum:
|
|
1630
|
-
instanceof:
|
|
1631
|
-
lazy:
|
|
1632
|
-
literal:
|
|
1633
|
-
looseObject:
|
|
1634
|
-
never:
|
|
1635
|
-
null:
|
|
1636
|
-
number:
|
|
1637
|
-
object:
|
|
1638
|
-
record:
|
|
1639
|
-
string:
|
|
1640
|
-
union:
|
|
1641
|
-
unknown:
|
|
1624
|
+
array: Qe,
|
|
1625
|
+
boolean: ft,
|
|
1626
|
+
custom: Ze,
|
|
1627
|
+
discriminatedUnion: rt,
|
|
1628
|
+
enum: Xe,
|
|
1629
|
+
instanceof: tt,
|
|
1630
|
+
lazy: it,
|
|
1631
|
+
literal: et,
|
|
1632
|
+
looseObject: qe,
|
|
1633
|
+
never: mt,
|
|
1634
|
+
null: nt,
|
|
1635
|
+
number: ut,
|
|
1636
|
+
object: pt,
|
|
1637
|
+
record: at,
|
|
1638
|
+
string: dt,
|
|
1639
|
+
union: ot,
|
|
1640
|
+
unknown: lt
|
|
1642
1641
|
}, Gi = W.lazy(() => W.union([
|
|
1643
1642
|
W.null(),
|
|
1644
1643
|
W.string(),
|
|
@@ -3743,7 +3742,7 @@ function go(e) {
|
|
|
3743
3742
|
//#endregion
|
|
3744
3743
|
//#region src/components/chat/agent-activity.tsx
|
|
3745
3744
|
var _o = (e) => {
|
|
3746
|
-
let t = (0, P.c)(19), { running: n, thinking:
|
|
3745
|
+
let t = (0, P.c)(19), { running: n, thinking: i, interrupted: a, defaultOpen: o, timing: s, toolCount: c, failedCount: l, steps: u } = e, d = i !== void 0 && i, f = a !== void 0 && a, p = o !== void 0 && o, m = c === void 0 ? 0 : c, h = l === void 0 ? 0 : l, g = u === void 0 ? vo : u, [_, v] = q.useState(), y = _ ?? (n || p), b = xo(n), x = g.length > 0, S;
|
|
3747
3746
|
t[0] !== h || t[1] !== f || t[2] !== b || t[3] !== n || t[4] !== d || t[5] !== s || t[6] !== m ? (S = n ? /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)("output", {
|
|
3748
3747
|
className: yo,
|
|
3749
3748
|
children: d ? "Thinking…" : "Working…"
|
|
@@ -3770,7 +3769,7 @@ var _o = (e) => {
|
|
|
3770
3769
|
className: "group/activity -mx-1.5 flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-foreground/6 hover:text-foreground focus-visible:outline-1 focus-visible:outline-(--slate-8)",
|
|
3771
3770
|
children: [C, /* @__PURE__ */ (0, J.jsx)(he, {
|
|
3772
3771
|
"aria-hidden": !0,
|
|
3773
|
-
className:
|
|
3772
|
+
className: r("size-3 shrink-0 opacity-60 transition-transform group-hover/activity:opacity-100", y && "rotate-90")
|
|
3774
3773
|
})]
|
|
3775
3774
|
}) : /* @__PURE__ */ (0, J.jsx)("div", {
|
|
3776
3775
|
className: "flex items-center gap-1.5 py-0.5 text-xs text-muted-foreground",
|
|
@@ -3948,27 +3947,27 @@ var To = class extends j {
|
|
|
3948
3947
|
return Eo(e.map((e) => e.data.cellOutput), t, n);
|
|
3949
3948
|
}
|
|
3950
3949
|
};
|
|
3951
|
-
async function Eo(e, t,
|
|
3950
|
+
async function Eo(e, t, r) {
|
|
3952
3951
|
let i = e.filter((e) => e.shouldDownloadImage && e.outputType === "media");
|
|
3953
3952
|
if (i.length === 0) return [];
|
|
3954
3953
|
let a = i.flatMap((e) => {
|
|
3955
3954
|
let i = document.getElementById(Oe.create(t));
|
|
3956
3955
|
return i ? {
|
|
3957
3956
|
cellId: t,
|
|
3958
|
-
cellName:
|
|
3957
|
+
cellName: r,
|
|
3959
3958
|
mimetype: e.output.mimetype,
|
|
3960
3959
|
element: i
|
|
3961
|
-
} : (
|
|
3960
|
+
} : (n.warn(`Output element not found for cell ${t}`), []);
|
|
3962
3961
|
});
|
|
3963
3962
|
try {
|
|
3964
3963
|
return await Promise.all(a.map(async (e) => ({
|
|
3965
3964
|
type: "file",
|
|
3966
|
-
filename: `${
|
|
3965
|
+
filename: `${r}-output-screenshot`,
|
|
3967
3966
|
mediaType: "image/png",
|
|
3968
3967
|
url: await ce(e.element)
|
|
3969
3968
|
})));
|
|
3970
3969
|
} catch (e) {
|
|
3971
|
-
return
|
|
3970
|
+
return n.error("Error downloading cell output images:", e), [];
|
|
3972
3971
|
}
|
|
3973
3972
|
}
|
|
3974
3973
|
function Do(e) {
|
|
@@ -4112,9 +4111,9 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4112
4111
|
return async (e) => {
|
|
4113
4112
|
let t = e.matchBefore(/#[^\s#]*/);
|
|
4114
4113
|
if (!t) return null;
|
|
4115
|
-
let
|
|
4116
|
-
if (!
|
|
4117
|
-
let i =
|
|
4114
|
+
let r = t.text;
|
|
4115
|
+
if (!r.startsWith("#")) return null;
|
|
4116
|
+
let i = r.slice(1);
|
|
4118
4117
|
if (i.length === 0) return this.getDefaultCompletions(t);
|
|
4119
4118
|
try {
|
|
4120
4119
|
let e = (await this.searchFiles(i) || []).map((e) => {
|
|
@@ -4135,7 +4134,7 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4135
4134
|
options: e
|
|
4136
4135
|
};
|
|
4137
4136
|
} catch (e) {
|
|
4138
|
-
return
|
|
4137
|
+
return n.error("Failed to search files:", e), null;
|
|
4139
4138
|
}
|
|
4140
4139
|
};
|
|
4141
4140
|
}
|
|
@@ -4183,32 +4182,32 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4183
4182
|
};
|
|
4184
4183
|
}
|
|
4185
4184
|
} catch (e) {
|
|
4186
|
-
|
|
4185
|
+
n.error("Failed to get default file completions:", e);
|
|
4187
4186
|
}
|
|
4188
4187
|
return {
|
|
4189
4188
|
from: e.from,
|
|
4190
4189
|
options: []
|
|
4191
4190
|
};
|
|
4192
4191
|
} catch (e) {
|
|
4193
|
-
return
|
|
4192
|
+
return n.error("Failed to get default file completions:", e), null;
|
|
4194
4193
|
}
|
|
4195
4194
|
}
|
|
4196
4195
|
getItems() {
|
|
4197
4196
|
return [];
|
|
4198
4197
|
}
|
|
4199
4198
|
formatCompletion(e) {
|
|
4200
|
-
let { data: t, name:
|
|
4199
|
+
let { data: t, name: r } = e, i = t.isDirectory ? "📁" : "📄";
|
|
4201
4200
|
return {
|
|
4202
4201
|
...this.createBasicCompletion(e),
|
|
4203
4202
|
type: "file",
|
|
4204
4203
|
section: ae.FILE,
|
|
4205
4204
|
boost: t.isDirectory ? k.MEDIUM : k.LOW,
|
|
4206
4205
|
detail: t.path,
|
|
4207
|
-
displayLabel: `${i} ${
|
|
4206
|
+
displayLabel: `${i} ${r}`,
|
|
4208
4207
|
apply: async (e, i, a, o) => {
|
|
4209
4208
|
let s = e.state.facet(Fo)?.addAttachment;
|
|
4210
4209
|
if (!s) {
|
|
4211
|
-
|
|
4210
|
+
n.warn("No addAttachment callback provided");
|
|
4212
4211
|
return;
|
|
4213
4212
|
}
|
|
4214
4213
|
let l = await this.apiRequests.sendFileDetails({ path: t.path }).catch((e) => (c({
|
|
@@ -4221,7 +4220,7 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4221
4220
|
mimeType: u,
|
|
4222
4221
|
isBase64: l.isBase64 ?? !1
|
|
4223
4222
|
});
|
|
4224
|
-
s(new File([d],
|
|
4223
|
+
s(new File([d], r, { type: u })), e.dispatch({ changes: {
|
|
4225
4224
|
from: a,
|
|
4226
4225
|
to: o,
|
|
4227
4226
|
insert: ""
|
|
@@ -4230,8 +4229,8 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4230
4229
|
info: () => {
|
|
4231
4230
|
let e = document.createElement("div");
|
|
4232
4231
|
e.classList.add("flex", "flex-col", "gap-1", "p-2");
|
|
4233
|
-
let
|
|
4234
|
-
|
|
4232
|
+
let n = document.createElement("div");
|
|
4233
|
+
n.classList.add("font-bold"), n.textContent = r, e.append(n);
|
|
4235
4234
|
let i = document.createElement("div");
|
|
4236
4235
|
return i.classList.add("text-xs", "text-muted-foreground"), i.textContent = t.path, e.append(i), e;
|
|
4237
4236
|
}
|
|
@@ -4498,7 +4497,7 @@ var Go = (e) => {
|
|
|
4498
4497
|
//#endregion
|
|
4499
4498
|
//#region src/components/chat/chat-markdown.tsx
|
|
4500
4499
|
function qo(e) {
|
|
4501
|
-
let t = (0, P.c)(3), { content: n } = e, r =
|
|
4500
|
+
let t = (0, P.c)(3), { content: n } = e, r = Je(ct)?.mode, i = r !== "agent" && r !== "code_mode", a;
|
|
4502
4501
|
return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ (0, J.jsx)(oe, {
|
|
4503
4502
|
content: n,
|
|
4504
4503
|
allowNotebookInsertion: i
|
|
@@ -4537,8 +4536,8 @@ var Xo = (e) => {
|
|
|
4537
4536
|
children: [a, s]
|
|
4538
4537
|
}), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4539
4538
|
}, Zo = (e) => {
|
|
4540
|
-
let t = (0, P.c)(27), { toolName: n, input:
|
|
4541
|
-
t[0] === c ? l = t[1] : (l =
|
|
4539
|
+
let t = (0, P.c)(27), { toolName: n, input: i, approval: o, onApprove: s, className: c } = e, l;
|
|
4540
|
+
t[0] === c ? l = t[1] : (l = r("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
|
|
4542
4541
|
let u;
|
|
4543
4542
|
t[2] === n ? u = t[3] : (u = Yo(n), t[2] = n, t[3] = u);
|
|
4544
4543
|
let d = `Approval required for ${u}`, f;
|
|
@@ -4566,7 +4565,7 @@ var Xo = (e) => {
|
|
|
4566
4565
|
})]
|
|
4567
4566
|
}), t[8] = m, t[9] = h);
|
|
4568
4567
|
let g;
|
|
4569
|
-
t[10] ===
|
|
4568
|
+
t[10] === i ? g = t[11] : (g = /* @__PURE__ */ (0, J.jsx)(Xo, { input: i }), t[10] = i, t[11] = g);
|
|
4570
4569
|
let _;
|
|
4571
4570
|
t[12] !== o.id || t[13] !== s ? (_ = /* @__PURE__ */ (0, J.jsx)(a, {
|
|
4572
4571
|
size: "xs",
|
|
@@ -4724,15 +4723,15 @@ function rs(e) {
|
|
|
4724
4723
|
//#endregion
|
|
4725
4724
|
//#region src/components/chat/tool-call/tool-result.tsx
|
|
4726
4725
|
function is(e) {
|
|
4727
|
-
return e == null || typeof e == "object" &&
|
|
4728
|
-
}
|
|
4729
|
-
var as =
|
|
4730
|
-
status:
|
|
4731
|
-
auth_required:
|
|
4732
|
-
action_url:
|
|
4733
|
-
next_steps:
|
|
4734
|
-
meta:
|
|
4735
|
-
message:
|
|
4726
|
+
return e == null || typeof e == "object" && vt(e);
|
|
4727
|
+
}
|
|
4728
|
+
var as = qe({
|
|
4729
|
+
status: dt().default("success"),
|
|
4730
|
+
auth_required: ft().default(!1),
|
|
4731
|
+
action_url: Ye().optional(),
|
|
4732
|
+
next_steps: Ye().optional(),
|
|
4733
|
+
meta: Ye().optional(),
|
|
4734
|
+
message: dt().nullish()
|
|
4736
4735
|
}), os = (e) => {
|
|
4737
4736
|
let t = (0, P.c)(12), { data: n } = e, r;
|
|
4738
4737
|
if (t[0] !== n) {
|
|
@@ -4811,14 +4810,14 @@ function cs(e) {
|
|
|
4811
4810
|
//#endregion
|
|
4812
4811
|
//#region src/components/chat/tool-call/tool-step.tsx
|
|
4813
4812
|
var ls = (e) => {
|
|
4814
|
-
let t = (0, P.c)(58), { toolName: n, state:
|
|
4815
|
-
if (t[0] !== u || t[1] !== a || t[2] !== d || t[3] !== f || t[4] !==
|
|
4816
|
-
let e = Jo.has(
|
|
4817
|
-
g = o, h = s, _ = us(
|
|
4818
|
-
let l =
|
|
4819
|
-
t[17] === u ? w = t[18] : (w =
|
|
4813
|
+
let t = (0, P.c)(58), { toolName: n, state: i, input: a, result: o, errorText: s, approval: c, isActive: l, className: u } = e, d = l === void 0 || l, [f, p] = q.useState(!1), m, h, g, _, v, y, b, x, S, C, w;
|
|
4814
|
+
if (t[0] !== u || t[1] !== a || t[2] !== d || t[3] !== f || t[4] !== i || t[5] !== n) {
|
|
4815
|
+
let e = Jo.has(i), { label: o, detail: s, icon: c } = es(n, a, e ? "running" : "done");
|
|
4816
|
+
g = o, h = s, _ = us(i, e && !d, c);
|
|
4817
|
+
let l = i === "output-error";
|
|
4818
|
+
t[17] === u ? w = t[18] : (w = r("w-full", u), t[17] = u, t[18] = w), b = "button", t[19] === Symbol.for("react.memo_cache_sentinel") ? (x = () => p(fs), t[19] = x) : x = t[19], S = f;
|
|
4820
4819
|
let T = f && "text-foreground", E = l && "text-(--red-11) hover:bg-(--red-3) hover:text-(--red-11)";
|
|
4821
|
-
t[20] !== T || t[21] !== E ? (C =
|
|
4820
|
+
t[20] !== T || t[21] !== E ? (C = r("group/step -mx-1.5 flex w-fit max-w-full min-w-0 items-center gap-1.5 rounded-md px-1.5 py-0.5 text-left text-xs leading-4 text-muted-foreground transition-colors hover:bg-foreground/6 hover:text-foreground focus-visible:outline-1 focus-visible:outline-(--slate-8)", T, E), t[20] = T, t[21] = E, t[22] = C) : C = t[22], m = _.icon, v = !0, y = r("-ml-px size-3 shrink-0", _.spinning && "animate-spin"), t[0] = u, t[1] = a, t[2] = d, t[3] = f, t[4] = i, t[5] = n, t[6] = m, t[7] = h, t[8] = g, t[9] = _, t[10] = v, t[11] = y, t[12] = b, t[13] = x, t[14] = S, t[15] = C, t[16] = w;
|
|
4822
4821
|
} else m = t[6], h = t[7], g = t[8], _ = t[9], v = t[10], y = t[11], b = t[12], x = t[13], S = t[14], C = t[15], w = t[16];
|
|
4823
4822
|
let T;
|
|
4824
4823
|
t[23] !== m || t[24] !== v || t[25] !== y ? (T = /* @__PURE__ */ (0, J.jsx)(m, {
|
|
@@ -4841,7 +4840,7 @@ var ls = (e) => {
|
|
|
4841
4840
|
children: ["· ", _.suffix]
|
|
4842
4841
|
}), t[31] = _.suffix, t[32] = O);
|
|
4843
4842
|
let k = f && "rotate-90 opacity-100", A;
|
|
4844
|
-
t[33] === k ? A = t[34] : (A =
|
|
4843
|
+
t[33] === k ? A = t[34] : (A = r("size-3 shrink-0 opacity-40 transition-transform group-hover/step:opacity-100", k), t[33] = k, t[34] = A);
|
|
4845
4844
|
let j;
|
|
4846
4845
|
t[35] === A ? j = t[36] : (j = /* @__PURE__ */ (0, J.jsx)(he, {
|
|
4847
4846
|
"aria-hidden": !0,
|
|
@@ -4862,13 +4861,13 @@ var ls = (e) => {
|
|
|
4862
4861
|
]
|
|
4863
4862
|
}), t[37] = E, t[38] = D, t[39] = O, t[40] = j, t[41] = b, t[42] = x, t[43] = S, t[44] = C, t[45] = T, t[46] = M) : M = t[46];
|
|
4864
4863
|
let ee;
|
|
4865
|
-
t[47] !== c || t[48] !== s || t[49] !== a || t[50] !== f || t[51] !== o || t[52] !==
|
|
4866
|
-
state:
|
|
4864
|
+
t[47] !== c || t[48] !== s || t[49] !== a || t[50] !== f || t[51] !== o || t[52] !== i ? (ee = f && /* @__PURE__ */ (0, J.jsx)(ds, {
|
|
4865
|
+
state: i,
|
|
4867
4866
|
input: a,
|
|
4868
4867
|
result: o,
|
|
4869
4868
|
errorText: s,
|
|
4870
4869
|
approval: c
|
|
4871
|
-
}), t[47] = c, t[48] = s, t[49] = a, t[50] = f, t[51] = o, t[52] =
|
|
4870
|
+
}), t[47] = c, t[48] = s, t[49] = a, t[50] = f, t[51] = o, t[52] = i, t[53] = ee) : ee = t[53];
|
|
4872
4871
|
let te;
|
|
4873
4872
|
return t[54] !== M || t[55] !== ee || t[56] !== w ? (te = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4874
4873
|
className: w,
|
|
@@ -5057,11 +5056,11 @@ function bs(e) {
|
|
|
5057
5056
|
//#endregion
|
|
5058
5057
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/utils/facet.js
|
|
5059
5058
|
function xs(e) {
|
|
5060
|
-
return
|
|
5059
|
+
return Dt.define({ combine: (t) => t[0] ?? e });
|
|
5061
5060
|
}
|
|
5062
5061
|
//#endregion
|
|
5063
5062
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/prompt-history/extension.js
|
|
5064
|
-
var Ss = xs({}), Cs =
|
|
5063
|
+
var Ss = xs({}), Cs = St.define(), ws = St.define(), Ts = 50, Es = xt.define({
|
|
5065
5064
|
create() {
|
|
5066
5065
|
return {
|
|
5067
5066
|
prompts: [],
|
|
@@ -5120,7 +5119,7 @@ function ks(e = {}) {
|
|
|
5120
5119
|
navigationIndex: -1,
|
|
5121
5120
|
originalText: ""
|
|
5122
5121
|
})), Ss.of(t ?? {})];
|
|
5123
|
-
return n && r.push(
|
|
5122
|
+
return n && r.push(At.of([{
|
|
5124
5123
|
key: "ArrowUp",
|
|
5125
5124
|
run: Ds
|
|
5126
5125
|
}, {
|
|
@@ -5130,7 +5129,7 @@ function ks(e = {}) {
|
|
|
5130
5129
|
}
|
|
5131
5130
|
//#endregion
|
|
5132
5131
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/state.js
|
|
5133
|
-
var As =
|
|
5132
|
+
var As = St.define(), Q = xt.define({
|
|
5134
5133
|
create() {
|
|
5135
5134
|
return /* @__PURE__ */ new Map();
|
|
5136
5135
|
},
|
|
@@ -5142,7 +5141,7 @@ var As = nt.define(), Q = tt.define({
|
|
|
5142
5141
|
}
|
|
5143
5142
|
return r;
|
|
5144
5143
|
}
|
|
5145
|
-
}), js =
|
|
5144
|
+
}), js = xt.define({
|
|
5146
5145
|
create() {
|
|
5147
5146
|
return {
|
|
5148
5147
|
onResourceClick: void 0,
|
|
@@ -5154,8 +5153,8 @@ var As = nt.define(), Q = tt.define({
|
|
|
5154
5153
|
update(e) {
|
|
5155
5154
|
return e;
|
|
5156
5155
|
}
|
|
5157
|
-
}), Ms =
|
|
5158
|
-
|
|
5156
|
+
}), Ms = St.define();
|
|
5157
|
+
xt.define({
|
|
5159
5158
|
create() {
|
|
5160
5159
|
return /* @__PURE__ */ new Map();
|
|
5161
5160
|
},
|
|
@@ -5203,7 +5202,7 @@ function $(e) {
|
|
|
5203
5202
|
}
|
|
5204
5203
|
//#endregion
|
|
5205
5204
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
|
|
5206
|
-
var Fs = class extends
|
|
5205
|
+
var Fs = class extends Et {
|
|
5207
5206
|
resource;
|
|
5208
5207
|
view;
|
|
5209
5208
|
constructor(e, t) {
|
|
@@ -5224,7 +5223,7 @@ var Fs = class extends ot {
|
|
|
5224
5223
|
e.preventDefault(), e.stopPropagation(), i(this.resource);
|
|
5225
5224
|
}), e;
|
|
5226
5225
|
}
|
|
5227
|
-
}, Is = class extends
|
|
5226
|
+
}, Is = class extends Et {
|
|
5228
5227
|
uri;
|
|
5229
5228
|
view;
|
|
5230
5229
|
constructor(e, t) {
|
|
@@ -5244,12 +5243,12 @@ function Ls(e) {
|
|
|
5244
5243
|
let a = e.state.doc.sliceString(r, i);
|
|
5245
5244
|
for (let i of $(a)) {
|
|
5246
5245
|
let a = r + i.index, o = i[0].slice(1), s = t.get(o);
|
|
5247
|
-
s ? n.push(
|
|
5246
|
+
s ? n.push(Mt.replace({ widget: new Fs(s, e) }).range(a, a + i[0].length)) : n.push(Mt.replace({ widget: new Is(o, e) }).range(a, a + i[0].length));
|
|
5248
5247
|
}
|
|
5249
5248
|
}
|
|
5250
|
-
return
|
|
5249
|
+
return Mt.set(n);
|
|
5251
5250
|
}
|
|
5252
|
-
var Rs =
|
|
5251
|
+
var Rs = wt.fromClass(class {
|
|
5253
5252
|
decorations;
|
|
5254
5253
|
constructor(e) {
|
|
5255
5254
|
this.decorations = Ls(e);
|
|
@@ -5289,7 +5288,7 @@ function Bs(e, t, n, r = 0) {
|
|
|
5289
5288
|
return null;
|
|
5290
5289
|
}
|
|
5291
5290
|
function Vs(e) {
|
|
5292
|
-
return
|
|
5291
|
+
return kt((t, n) => {
|
|
5293
5292
|
let { from: r, text: i } = t.state.doc.lineAt(n), a = Bs(i, n, t.state.field(Q), r);
|
|
5294
5293
|
return a ? {
|
|
5295
5294
|
pos: a.start,
|
|
@@ -5359,8 +5358,8 @@ function Ks(e, t) {
|
|
|
5359
5358
|
}
|
|
5360
5359
|
return null;
|
|
5361
5360
|
}
|
|
5362
|
-
var qs =
|
|
5363
|
-
let t = e.annotation(
|
|
5361
|
+
var qs = jt.transactionFilter.of((e) => {
|
|
5362
|
+
let t = e.annotation(Ot.userEvent);
|
|
5364
5363
|
if (!t) return e;
|
|
5365
5364
|
let n = e.startState.selection.main;
|
|
5366
5365
|
if (!n.empty) return e;
|
|
@@ -5542,11 +5541,11 @@ function $s(e, t) {
|
|
|
5542
5541
|
};
|
|
5543
5542
|
}
|
|
5544
5543
|
function ec(e, t = {}) {
|
|
5545
|
-
return
|
|
5544
|
+
return wt.fromClass($s(e, t));
|
|
5546
5545
|
}
|
|
5547
5546
|
//#endregion
|
|
5548
5547
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
|
|
5549
|
-
var tc =
|
|
5548
|
+
var tc = Tt.baseTheme({
|
|
5550
5549
|
".cm-resource-widget": {
|
|
5551
5550
|
background: "light-dark(rgba(86,156,214,0.08),rgba(86,156,214,0.18))",
|
|
5552
5551
|
borderRadius: "4px",
|
|
@@ -5576,10 +5575,10 @@ function ac(e) {
|
|
|
5576
5575
|
return t.length === 0 ? rc : t;
|
|
5577
5576
|
}
|
|
5578
5577
|
function oc(e) {
|
|
5579
|
-
let { language: t, store:
|
|
5578
|
+
let { language: t, store: r, onAddFiles: i } = e, a = () => ac(r);
|
|
5580
5579
|
return [
|
|
5581
|
-
t.data.of({ autocomplete: Ns(async () => a(), (e) => e.type === nc ? ic : Bo(
|
|
5582
|
-
|
|
5580
|
+
t.data.of({ autocomplete: Ns(async () => a(), (e) => e.type === nc ? ic : Bo(r).getProvider(e.type)?.formatCompletion(e) || {}) }),
|
|
5581
|
+
Ct.high(At.of([{
|
|
5583
5582
|
key: "Tab",
|
|
5584
5583
|
preventDefault: !0,
|
|
5585
5584
|
run: (e) => Nt(e)
|
|
@@ -5588,20 +5587,20 @@ function oc(e) {
|
|
|
5588
5587
|
...i ? [t.data.of({ autocomplete: Vo().createCompletionSource() })] : [],
|
|
5589
5588
|
Rs,
|
|
5590
5589
|
qs,
|
|
5591
|
-
ec(a, { logger:
|
|
5590
|
+
ec(a, { logger: n }),
|
|
5592
5591
|
Q.init(() => {
|
|
5593
|
-
let e = ac(
|
|
5592
|
+
let e = ac(r);
|
|
5594
5593
|
return new Map(e.map((e) => [e.uri, e]));
|
|
5595
5594
|
}),
|
|
5596
5595
|
tc,
|
|
5597
5596
|
Vs({ createTooltip: (e) => {
|
|
5598
|
-
let t = Bo(
|
|
5599
|
-
if (!t) return
|
|
5597
|
+
let t = Bo(r).getProvider(e.type);
|
|
5598
|
+
if (!t) return n.warn("No provider found for resource", e), sc(e.description || e.name);
|
|
5600
5599
|
let i = t.formatCompletion(e), a = e.description || e.name;
|
|
5601
5600
|
if (!i?.info) return sc(a);
|
|
5602
5601
|
if (typeof i.info == "string") return sc(i.info);
|
|
5603
5602
|
let o = i.info(i);
|
|
5604
|
-
return o ? "dom" in o ? { dom: o.dom } : "then" in o ? (
|
|
5603
|
+
return o ? "dom" in o ? { dom: o.dom } : "then" in o ? (n.warn("info is a promise. This is not supported", o), sc(a)) : { dom: o } : sc(a);
|
|
5605
5604
|
} })
|
|
5606
5605
|
];
|
|
5607
5606
|
}
|
|
@@ -5611,10 +5610,10 @@ function sc(e) {
|
|
|
5611
5610
|
}
|
|
5612
5611
|
//#endregion
|
|
5613
5612
|
//#region src/components/editor/ai/prompt-input.tsx
|
|
5614
|
-
var cc = "marimo:ai-prompt-history", lc = new Te(
|
|
5615
|
-
let t = (0, P.c)(28), { value: n, placeholder:
|
|
5613
|
+
var cc = "marimo:ai-prompt-history", lc = new Te(Qe(dt()), () => []), uc = (e) => {
|
|
5614
|
+
let t = (0, P.c)(28), { value: n, placeholder: i, placeholderAction: a, inputRef: o, className: s, onChange: c, onSubmit: l, onKeyDown: u, onClose: d, onAddFiles: f, additionalCompletions: p, maxHeight: h } = e, g = bt(l), _ = bt(d), v = $e(), { theme: y } = ht(), b;
|
|
5616
5615
|
t[0] === p ? b = t[1] : (b = (e) => p ? Ho([p.triggerCompletionRegex], p.completions)(e) : null, t[0] = p, t[1] = b);
|
|
5617
|
-
let x =
|
|
5616
|
+
let x = bt(b), S;
|
|
5618
5617
|
if (t[2] !== x || t[3] !== _ || t[4] !== g || t[5] !== f || t[6] !== a || t[7] !== v) {
|
|
5619
5618
|
let e = It(), n;
|
|
5620
5619
|
t[9] === Symbol.for("react.memo_cache_sentinel") ? (n = Ft({}), t[9] = n) : n = t[9];
|
|
@@ -5630,7 +5629,7 @@ var cc = "marimo:ai-prompt-history", lc = new Te(Ct(vt()), () => []), uc = (e) =
|
|
|
5630
5629
|
let s;
|
|
5631
5630
|
t[11] === Symbol.for("react.memo_cache_sentinel") ? (s = Lt(), t[11] = s) : s = t[11];
|
|
5632
5631
|
let c;
|
|
5633
|
-
t[12] === g ? c = t[13] : (c =
|
|
5632
|
+
t[12] === g ? c = t[13] : (c = Ct.highest(At.of([{
|
|
5634
5633
|
preventDefault: !0,
|
|
5635
5634
|
stopPropagation: !0,
|
|
5636
5635
|
any: (e, t) => {
|
|
@@ -5639,7 +5638,7 @@ var cc = "marimo:ai-prompt-history", lc = new Te(Ct(vt()), () => []), uc = (e) =
|
|
|
5639
5638
|
}
|
|
5640
5639
|
}])), t[12] = g, t[13] = c);
|
|
5641
5640
|
let l;
|
|
5642
|
-
t[14] === _ ? l = t[15] : (l =
|
|
5641
|
+
t[14] === _ ? l = t[15] : (l = At.of([{
|
|
5643
5642
|
key: "Escape",
|
|
5644
5643
|
preventDefault: !0,
|
|
5645
5644
|
stopPropagation: !0,
|
|
@@ -5651,15 +5650,15 @@ var cc = "marimo:ai-prompt-history", lc = new Te(Ct(vt()), () => []), uc = (e) =
|
|
|
5651
5650
|
r,
|
|
5652
5651
|
i,
|
|
5653
5652
|
o,
|
|
5654
|
-
|
|
5653
|
+
Tt.lineWrapping,
|
|
5655
5654
|
s,
|
|
5656
5655
|
c,
|
|
5657
5656
|
l
|
|
5658
5657
|
], t[2] = x, t[3] = _, t[4] = g, t[5] = f, t[6] = a, t[7] = v, t[8] = S;
|
|
5659
5658
|
} else S = t[8];
|
|
5660
5659
|
let C = S, w;
|
|
5661
|
-
t[16] === s ? w = t[17] : (w =
|
|
5662
|
-
let T = y === "dark" ? "dark" : "light", E = a ? void 0 :
|
|
5660
|
+
t[16] === s ? w = t[17] : (w = r("mo-ai-prompt flex-1 font-sans text-sm leading-6 overflow-auto my-1", s), t[16] = s, t[17] = w);
|
|
5661
|
+
let T = y === "dark" ? "dark" : "light", E = a ? void 0 : i || "Generate with AI, @ to include context", D;
|
|
5663
5662
|
return t[18] !== C || t[19] !== o || t[20] !== h || t[21] !== c || t[22] !== u || t[23] !== w || t[24] !== T || t[25] !== E || t[26] !== n ? (D = /* @__PURE__ */ (0, J.jsx)(Rt, {
|
|
5664
5663
|
ref: o,
|
|
5665
5664
|
className: w,
|
|
@@ -5682,20 +5681,20 @@ function fc(e) {
|
|
|
5682
5681
|
}
|
|
5683
5682
|
//#endregion
|
|
5684
5683
|
//#region src/plugins/impl/chat/chat-ui.tsx
|
|
5685
|
-
var pc = u, mc =
|
|
5686
|
-
type:
|
|
5687
|
-
message_id:
|
|
5688
|
-
content:
|
|
5689
|
-
is_final:
|
|
5684
|
+
var pc = u, mc = pt({
|
|
5685
|
+
type: et("stream_chunk"),
|
|
5686
|
+
message_id: dt(),
|
|
5687
|
+
content: Ye().nullable().transform((e) => e),
|
|
5688
|
+
is_final: ft().optional()
|
|
5690
5689
|
});
|
|
5691
5690
|
function hc(e, t) {
|
|
5692
|
-
let { controllerRef:
|
|
5691
|
+
let { controllerRef: r, activeRequestIdRef: i } = t, a = r.current;
|
|
5693
5692
|
if (a === null) return "dropped-no-controller";
|
|
5694
5693
|
let o = i.current;
|
|
5695
|
-
return o !== null && e.message_id !== o ? (
|
|
5694
|
+
return o !== null && e.message_id !== o ? (n.debug("Dropping stale chat chunk", {
|
|
5696
5695
|
chunkRequestId: e.message_id,
|
|
5697
5696
|
activeRequestId: o
|
|
5698
|
-
}), "dropped-stale") : (e.content && a.enqueue(e.content), e.is_final ? (a.close(),
|
|
5697
|
+
}), "dropped-stale") : (e.content && a.enqueue(e.content), e.is_final ? (a.close(), r.current = null, i.current = null, "closed") : "enqueued");
|
|
5699
5698
|
}
|
|
5700
5699
|
var gc = (e) => {
|
|
5701
5700
|
let [t, o] = (0, q.useState)(""), [s, c] = (0, q.useState)(e.config), [u, f] = (0, q.useState)(e.config), [p, m] = (0, q.useState)(void 0), h = (0, q.useRef)(null), g = (0, q.useRef)(null), _ = (0, q.useRef)(null), v = (0, q.useRef)(null);
|
|
@@ -5708,9 +5707,9 @@ var gc = (e) => {
|
|
|
5708
5707
|
S.current = null, w(null);
|
|
5709
5708
|
}, { data: E } = zt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : E, { messages: k, sendMessage: A, setMessages: j, status: M, stop: ee, error: te, regenerate: ne, clearError: ie, addToolApprovalResponse: ae } = lo({
|
|
5710
5709
|
sendAutomaticallyWhen: ({ messages: e }) => Wo(e),
|
|
5711
|
-
transport: new Ha({ fetch: async (t,
|
|
5712
|
-
if (
|
|
5713
|
-
let i = JSON.parse(
|
|
5710
|
+
transport: new Ha({ fetch: async (t, r) => {
|
|
5711
|
+
if (r === void 0) return fetch(t);
|
|
5712
|
+
let i = JSON.parse(r.body), a = r.signal, o = {
|
|
5714
5713
|
max_tokens: y.current.max_tokens,
|
|
5715
5714
|
temperature: y.current.temperature,
|
|
5716
5715
|
top_p: y.current.top_p,
|
|
@@ -5722,19 +5721,19 @@ var gc = (e) => {
|
|
|
5722
5721
|
let t = i.messages.map((e) => ({
|
|
5723
5722
|
...e,
|
|
5724
5723
|
content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
|
|
5725
|
-
})),
|
|
5724
|
+
})), r = D();
|
|
5726
5725
|
T();
|
|
5727
5726
|
let s = new ReadableStream({
|
|
5728
5727
|
start(t) {
|
|
5729
|
-
b.current = t, x.current =
|
|
5728
|
+
b.current = t, x.current = r;
|
|
5730
5729
|
let i = () => {
|
|
5731
5730
|
try {
|
|
5732
5731
|
t.close();
|
|
5733
5732
|
} catch (e) {
|
|
5734
|
-
|
|
5733
|
+
n.debug("Controller may already be closed", { error: e });
|
|
5735
5734
|
}
|
|
5736
|
-
b.current = null, x.current = null, e.cancel_prompt({ request_id:
|
|
5737
|
-
|
|
5735
|
+
b.current = null, x.current = null, e.cancel_prompt({ request_id: r }).catch((e) => {
|
|
5736
|
+
n.debug("cancel_prompt failed", { error: e });
|
|
5738
5737
|
});
|
|
5739
5738
|
};
|
|
5740
5739
|
return a?.addEventListener("abort", i), () => {
|
|
@@ -5746,7 +5745,7 @@ var gc = (e) => {
|
|
|
5746
5745
|
}
|
|
5747
5746
|
});
|
|
5748
5747
|
return e.send_prompt({
|
|
5749
|
-
request_id:
|
|
5748
|
+
request_id: r,
|
|
5750
5749
|
messages: t,
|
|
5751
5750
|
config: o
|
|
5752
5751
|
}).catch((e) => {
|
|
@@ -5759,18 +5758,18 @@ var gc = (e) => {
|
|
|
5759
5758
|
}
|
|
5760
5759
|
} }),
|
|
5761
5760
|
messages: O,
|
|
5762
|
-
onFinish: ({ messages: t, isAbort:
|
|
5763
|
-
if (m(void 0), h.current && (h.current.value = ""),
|
|
5761
|
+
onFinish: ({ messages: t, isAbort: r, finishReason: i }) => {
|
|
5762
|
+
if (m(void 0), h.current && (h.current.value = ""), n.debug("Finished streaming message:", {
|
|
5764
5763
|
finishReason: i,
|
|
5765
|
-
isAbort:
|
|
5766
|
-
}),
|
|
5764
|
+
isAbort: r
|
|
5765
|
+
}), r) {
|
|
5767
5766
|
let e = po({
|
|
5768
5767
|
isAbort: !0,
|
|
5769
5768
|
streamReason: S.current
|
|
5770
5769
|
});
|
|
5771
5770
|
if (T(), e != null) {
|
|
5772
5771
|
let t = mo(e);
|
|
5773
|
-
|
|
5772
|
+
n.debug("Chat stream aborted", {
|
|
5774
5773
|
reason: e,
|
|
5775
5774
|
finishReason: i
|
|
5776
5775
|
}), w(t);
|
|
@@ -5779,10 +5778,10 @@ var gc = (e) => {
|
|
|
5779
5778
|
e.setValue(t);
|
|
5780
5779
|
},
|
|
5781
5780
|
onError: (e) => {
|
|
5782
|
-
|
|
5781
|
+
n.error("An error occurred:", e);
|
|
5783
5782
|
}
|
|
5784
5783
|
});
|
|
5785
|
-
|
|
5784
|
+
i(e.host, Re.TYPE, (e) => {
|
|
5786
5785
|
let t = mc.safeParse(e.detail.message);
|
|
5787
5786
|
if (t.success) {
|
|
5788
5787
|
if (t.data.content && t.data.message_id === x.current) {
|
|
@@ -5863,16 +5862,16 @@ var gc = (e) => {
|
|
|
5863
5862
|
]
|
|
5864
5863
|
}),
|
|
5865
5864
|
k.map((e, t) => {
|
|
5866
|
-
let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"),
|
|
5865
|
+
let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), i = t === k.length - 1;
|
|
5867
5866
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5868
|
-
className:
|
|
5867
|
+
className: r("flex flex-col group gap-2", e.role === "user" ? "items-end" : "items-start"),
|
|
5869
5868
|
children: [/* @__PURE__ */ (0, J.jsx)("div", {
|
|
5870
5869
|
className: `max-w-[80%] p-3 rounded-lg ${e.role === "user" ? "bg-(--sky-11) text-(--slate-1) whitespace-pre-wrap" : "bg-(--slate-4) text-(--slate-12) [--muted-foreground:var(--slate-11)]"}`,
|
|
5871
5870
|
children: ms({
|
|
5872
5871
|
message: e,
|
|
5873
|
-
isLast:
|
|
5872
|
+
isLast: i,
|
|
5874
5873
|
isActive: oe,
|
|
5875
|
-
addToolApprovalResponse:
|
|
5874
|
+
addToolApprovalResponse: i ? ae : void 0
|
|
5876
5875
|
})
|
|
5877
5876
|
}), /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5878
5877
|
className: "flex justify-end text-xs gap-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100",
|
|
@@ -5896,7 +5895,7 @@ var gc = (e) => {
|
|
|
5896
5895
|
}),
|
|
5897
5896
|
te && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5898
5897
|
className: "flex items-center justify-center space-x-2 mb-4",
|
|
5899
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
5898
|
+
children: [/* @__PURE__ */ (0, J.jsx)(_t, { error: te }), /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5900
5899
|
variant: "outline",
|
|
5901
5900
|
size: "sm",
|
|
5902
5901
|
onClick: () => ne(),
|
|
@@ -5926,7 +5925,7 @@ var gc = (e) => {
|
|
|
5926
5925
|
},
|
|
5927
5926
|
ref: g,
|
|
5928
5927
|
inert: e.disabled || void 0,
|
|
5929
|
-
className:
|
|
5928
|
+
className: r("flex w-full border-t border-(--slate-6) px-2 py-1 items-center", e.disabled && "opacity-50 cursor-not-allowed"),
|
|
5930
5929
|
children: [
|
|
5931
5930
|
e.showConfigurationControls && /* @__PURE__ */ (0, J.jsx)(vc, {
|
|
5932
5931
|
config: s,
|
|
@@ -6113,7 +6112,7 @@ var gc = (e) => {
|
|
|
6113
6112
|
className: "col-span-3"
|
|
6114
6113
|
})]
|
|
6115
6114
|
}, t);
|
|
6116
|
-
}, t[9] = c, t[10] = e), p =
|
|
6115
|
+
}, t[9] = c, t[10] = e), p = yt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = p;
|
|
6117
6116
|
} else p = t[8];
|
|
6118
6117
|
let m;
|
|
6119
6118
|
t[11] === p ? m = t[12] : (m = /* @__PURE__ */ (0, J.jsx)(b, {
|