@marimo-team/islands 0.25.3-dev209 → 0.25.3-dev210
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-ApTYh0V3.js → ConnectedDataExplorerComponent-D6RHJV8D.js} +114 -112
- package/dist/{ErrorBoundary-B1QlXN-y.js → ErrorBoundary-VruaQLnK.js} +10 -10
- package/dist/{abnfDiagram-VCTEODGH-uo9xhZY0.js → abnfDiagram-VCTEODGH-0q7Lbmii.js} +2 -2
- package/dist/{any-language-editor-BVFHDDQ3.js → any-language-editor-jGaR0EAo.js} +5 -5
- package/dist/{architectureDiagram-5GKGNRK7-Hz6eyeOD.js → architectureDiagram-5GKGNRK7-1PydKPmE.js} +1 -1
- package/dist/{button-BQRdqQi1.js → button-B6RjDKJx.js} +54 -51
- package/dist/{capabilities-C2QUNRXi.js → capabilities-CkVzWJEX.js} +1 -1
- package/dist/{chat-ui-BTA1I5i1.js → chat-ui-B5pH_aXk.js} +414 -413
- package/dist/{check-C9Mp9eCK.js → check-Z_vtI3OL.js} +1 -1
- package/dist/{chunk-IMKFNOWR-DBM2i23k.js → chunk-IMKFNOWR-DEzZZ1Zc.js} +1 -1
- package/dist/{chunk-SHT3W25Y-L8KQLLBy.js → chunk-SHT3W25Y-CuHj-hnn.js} +1 -1
- package/dist/{chunk-SVP7TREG-BOUJKJEP.js → chunk-SVP7TREG-BPiZK2bA.js} +1 -1
- package/dist/{chunk-TICWLB2K-DY3CzFjX.js → chunk-TICWLB2K-DF6XcIjM.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-s9iwW-q4.js → classDiagram-ZZMXUADV-CMdR-cP4.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-2GI5CjGB.js → classDiagram-v2-VYDZK3BY-DRvc3_7Y.js} +2 -2
- package/dist/{code-visibility-CCGlDSq4.js → code-visibility-BdFhHfIC.js} +28 -28
- package/dist/{common-C1PmVtVW.js → common-Ce1SgsX1.js} +8034 -8027
- package/dist/{toDate-BZZ64K_m.js → config-DbjzjwxX.js} +98 -164
- package/dist/{copy-icon-De584pZ4.js → copy-icon-CG57cxwb.js} +3 -3
- package/dist/createReducer-DePYJ0F3.js +63 -0
- package/dist/{cynefinDiagram-5FMLGOSQ-DOxnhBK2.js → cynefinDiagram-5FMLGOSQ-BkBjEY9l.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-D1AhEfpM.js → dagre-GXQ25YYZ-D-HEaW4I.js} +1 -1
- package/dist/{data-grid-overlay-editor-B3KXkZvo.js → data-grid-overlay-editor-Bps1p6jQ.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-DV_GebF_.js → diagram-S7CK7UJ4-Bn-oF-rB.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-6dNzGFfD.js → diagram-UQ7AKVKN-BpzzXWBj.js} +1 -1
- package/dist/{diagram-VX7I27RA-DUh9jsfi.js → diagram-VX7I27RA-COOtvfBP.js} +1 -1
- package/dist/{diagram-Z3DM3KII-Cug-qcQ8.js → diagram-Z3DM3KII-K5cXvbrl.js} +1 -1
- package/dist/{dialog-DVRfQuhD.js → dialog-DsZ49mmU.js} +26 -26
- package/dist/{dist-BJtmSgcE.js → dist-11T5wq3_.js} +41 -40
- package/dist/{dist-B1M0bGO3.js → dist-17ugwGZc.js} +59 -58
- package/dist/{dist-D7mrh5sO.js → dist-7cRjf--y.js} +135 -134
- package/dist/{dist-Ck_C32ye.js → dist-B8pkfkzc.js} +31 -30
- package/dist/{dist-Ba2VIn1K.js → dist-B9UoM_wq.js} +54 -53
- package/dist/{dist-KN80qWCP.js → dist-BGuMTs1i.js} +118 -117
- package/dist/{dist-T5rh6JvL.js → dist-BHW11fni.js} +18 -17
- package/dist/dist-BLY4m1Wi.js +850 -0
- package/dist/{dist-Bj4bmwUm.js → dist-BNlcVoxs.js} +31 -30
- package/dist/{dist-BA13RJj5.js → dist-BQYe5Bju.js} +47 -46
- package/dist/{dist-OUle2RT7.js → dist-BX1mn8na.js} +297 -297
- package/dist/{dist-CTi5FTiV.js → dist-Bh0PTKUW.js} +108 -107
- package/dist/{dist-D9Q3xjiP.js → dist-CKaXK92p.js} +56 -55
- package/dist/{dist-DYXM73-k.js → dist-CLhwfhpJ.js} +58 -57
- package/dist/{dist-BmS-ZGjl.js → dist-CYeqK4Xw.js} +1854 -2702
- package/dist/{dist-D1fnFp1J.js → dist-Cxlp3WH6.js} +16 -15
- package/dist/{dist-DVVwOfrD.js → dist-DSJPGj42.js} +64 -63
- package/dist/{dist-Bzogh7CW.js → dist-DU9ICsWZ.js} +93 -92
- package/dist/{dist-DjeybPOb.js → dist-DWv0ALBi.js} +47 -46
- package/dist/{dist-D3x9__Fu.js → dist-DiBpWEsB.js} +39 -38
- package/dist/{dist-DtGn9N4h.js → dist-DiLFTlnl.js} +165 -165
- package/dist/{dist-DTv9KkpW.js → dist-cVDV5IuI.js} +26 -25
- package/dist/{dist-DP60Ubh8.js → dist-fRfaOoq8.js} +44 -43
- package/dist/{dist-O0qFpEJh.js → dist-gTTI-9Px.js} +66 -65
- package/dist/{dropdown-menu-dlEm41Bt.js → dropdown-menu-CSNdPSnS.js} +2886 -1529
- package/dist/{ebnfDiagram-PWID7BFC-d5LKx7Vb.js → ebnfDiagram-PWID7BFC-BI1ZmjVm.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-BwvlkcID.js → erDiagram-RLTQ6QDP-BtWjj9xy.js} +1 -1
- package/dist/{error-banner-DxJ3s8YO.js → error-banner-IsonnvA0.js} +47 -46
- package/dist/error-entries-CRPfxMqm.js +2505 -0
- package/dist/{esm-Bbw_Njjx.js → esm-BgKjMvWw.js} +389 -388
- package/dist/{esm-mDQNEFe_.js → esm-CHjVSexr.js} +305 -306
- package/dist/{feedback-button-UsovT9sL.js → feedback-button-2ycmR9GG.js} +112 -112
- package/dist/{flowDiagram-HODETNUW-CJcSoFer.js → flowDiagram-HODETNUW-DQvZh96A.js} +2 -2
- package/dist/{formats-Ry7c-aIV.js → formats-BK4VefeF.js} +6 -6
- package/dist/{glide-data-editor-CRd8kBSp.js → glide-data-editor-Buj2OZjL.js} +99 -99
- package/dist/{glide-utils-D98laidb.js → glide-utils-CQddGpa-.js} +3 -3
- package/dist/{globals-BDWrOstF.js → globals-B-14fUeb.js} +3 -3
- package/dist/{error-entries-CVUHA5r_.js → html-to-image-CgAnxFi8.js} +26314 -25474
- package/dist/{infoDiagram-27XIBGKW-Cezgppw3.js → infoDiagram-27XIBGKW-BdAObnc_.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-BahZQwJz.js → ishikawaDiagram-5VMMS53U-DP-jE8dw.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-Cvfn_Obm.js → kanban-definition-UXKFOSKX-BkMgPjfm.js} +1 -1
- package/dist/{loader-DOVB0Syl.js → loader-BisjOLiW.js} +1 -1
- package/dist/main.js +2996 -2992
- package/dist/{mermaid-BrdwbArF.js → mermaid-B-OFqheA.js} +36 -36
- package/dist/{mindmap-definition-YA3MSWOX-uB4B2d-J.js → mindmap-definition-YA3MSWOX-Du7toAZX.js} +1 -1
- package/dist/{number-overlay-editor-Bp9a4z5Q.js → number-overlay-editor-ZVFcJ7_u.js} +1 -1
- package/dist/{dist-CThPVKaP.js → objectWithoutPropertiesLoose-ai5NUqGa.js} +1139 -1120
- package/dist/{pegDiagram-XKGWAZYB-CYaIwAmH.js → pegDiagram-XKGWAZYB-CX_729j0.js} +2 -2
- package/dist/{pieDiagram-E7YTZNPT-BJ1oUxVv.js → pieDiagram-E7YTZNPT-dtTFJcVI.js} +1 -1
- package/dist/{process-output-SjJxB1wh.js → process-output-Bmev5azU.js} +5 -5
- package/dist/{railroadDiagram-O6MQD6OU-BqKSaBux.js → railroadDiagram-O6MQD6OU-Dsc2Cf4c.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-DwFhgDhH.js → requirementDiagram-BXWQKSXE-D3g0c60I.js} +1 -1
- package/dist/{reveal-component-ov3pS-oO.js → reveal-component-BWz1KjWe.js} +725 -725
- package/dist/schemas-CdscWNy_.js +4747 -0
- package/dist/select-BSxlITBo.js +1200 -0
- package/dist/{sequenceDiagram-WJ2MYXX4-L7ENjfKF.js → sequenceDiagram-WJ2MYXX4-w1pWbIpk.js} +1 -1
- package/dist/{spec-BcJ9ncAY.js → spec-Dq8RNplp.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-CVf88u-p.js → stateDiagram-D77RDMKH-BCv7kP4H.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-DvpkQ1V6.js → stateDiagram-v2-MP3YSRHH-D1cTOt0x.js} +2 -2
- package/dist/static-state-BldGd99T.js +72 -0
- package/dist/strings-BGW-fXVJ.js +507 -0
- package/dist/{swimlanes-42K2YHIH-DIuFHbVE.js → swimlanes-42K2YHIH-DNO6jDnd.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-CAqHAziW.js → swimlanesDiagram-VR7AAH4N-CkSWsxYJ.js} +2 -2
- package/dist/{swiper-component-BVfnhbnt.js → swiper-component-Dir1o8ml.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-xO4EQqBm.js → timeline-definition-24CTP7MA-DQvqGFM9.js} +1 -1
- package/dist/toast-BWIPi3aF.js +491 -0
- package/dist/{tooltip-s4zZxwKe.js → tooltip-C3UnvsRe.js} +58 -58
- package/dist/use-restore-focus-BWO0z1lo.js +1672 -0
- package/dist/{useAsyncData-Dqw22wZQ.js → useAsyncData-DsZMvNXn.js} +1 -1
- package/dist/{useDateFormatter-D3Tkfzej.js → useDateFormatter-ChB4eyim.js} +2 -2
- package/dist/{useDeepCompareMemoize-D3gozcjJ.js → useDeepCompareMemoize-KMBBux8C.js} +1 -1
- package/dist/{useIframeCapabilities-6a_yDNXp.js → useIframeCapabilities-cMNQ80CK.js} +1 -1
- package/dist/useLifecycle-BquH9ET-.js +112 -0
- package/dist/useTheme-B9C1JIy9.js +307 -0
- package/dist/utils-DXkj82sK.js +813 -0
- package/dist/{vega-component-Blvspl7v.js → vega-component-9NOEITbg.js} +55 -54
- package/dist/{vennDiagram-4TSXK5OY-DzCi-lRh.js → vennDiagram-4TSXK5OY-BfzXp4SH.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-CW48xa0n.js → wardleyDiagram-VM6X3IG4-CiqEE8eq.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-UPxGGI2B.js → xychartDiagram-S5SC5T6Z-BTIHCVOI.js} +1 -1
- package/package.json +1 -1
- package/src/components/editor/cell/__tests__/StagedAICell.test.tsx +1 -1
- package/src/components/editor/cell/code/cell-editor.tsx +13 -36
- package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +1 -1
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +11 -5
- package/src/components/editor/notebook-cell.tsx +0 -1
- package/src/components/scratchpad/scratchpad.test.tsx +3 -11
- package/src/components/scratchpad/scratchpad.tsx +24 -22
- package/src/components/scratchpad/state.ts +7 -0
- package/src/core/ai/__tests__/staged-cells.test.ts +6 -8
- package/src/core/ai/staged-cells.ts +4 -2
- package/src/core/cells/__tests__/cells.test.ts +44 -60
- package/src/core/cells/__tests__/document.test.ts +1 -139
- package/src/core/cells/__tests__/notebook-outline.test.ts +8 -6
- package/src/core/cells/actions.ts +39 -0
- package/src/core/cells/cells.ts +15 -35
- package/src/core/cells/document.ts +9 -84
- package/src/core/codemirror/__tests__/format.test.ts +0 -34
- package/src/core/codemirror/cells/extensions.ts +20 -18
- package/src/core/codemirror/cells/state.ts +0 -5
- package/src/core/codemirror/format.ts +1 -19
- package/src/core/codemirror/misc/__tests__/paste.test.ts +3 -1
- package/src/core/codemirror/misc/paste.ts +1 -1
- package/src/core/notebook/document/__tests__/codemirror.test.ts +172 -0
- package/src/stories/layout/vertical/one-column.stories.tsx +26 -18
- package/dist/html-to-image--E3uFbJ9.js +0 -3348
- package/dist/label-Qvw1E97W.js +0 -281
- package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +0 -23
- package/dist/select-2KOiReNY.js +0 -1423
- package/dist/toast-B5t9o6s_.js +0 -1848
- package/dist/use-restore-focus-BgDTd2tc.js +0 -6418
- package/dist/useLifecycle-CaZi4wTw.js +0 -172
- package/dist/useTheme-TzPgWXwB.js +0 -1114
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { a as e, t } from "./rolldown-runtime-Cb76FRpK.js";
|
|
2
|
-
import { c as n, g as r, h as i, t as a } from "./button-
|
|
2
|
+
import { c as n, g as r, h as i, t as a } from "./button-B6RjDKJx.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 {
|
|
7
|
-
import { m as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { d as
|
|
5
|
+
import { i as c, t as l } from "./copy-icon-CG57cxwb.js";
|
|
6
|
+
import { Bt as u, Ct as d, I as f, K as p, Lt as m, Mt as h, S as g, Tt as _, W as v, Wt as y, _ as b, _t as x, a as S, b as C, ct as w, f as T, g as E, gt as D, h as O, jt as ee, l as k, lt as te, m as A, n as ne, nt as re, p as j, pt as ie, q as ae, r as oe, st as se, t as ce, u as le, ut as ue, v as de, y as fe, zt as pe } from "./html-to-image-CgAnxFi8.js";
|
|
7
|
+
import { m as M, t as me } from "./tooltip-C3UnvsRe.js";
|
|
8
|
+
import { M as he, d as ge } from "./select-BSxlITBo.js";
|
|
9
|
+
import { _ as _e, f as ve, h as ye, i as be, n as xe, t as Se } from "./dropdown-menu-CSNdPSnS.js";
|
|
10
|
+
import { a as Ce, l as we } from "./config-DbjzjwxX.js";
|
|
11
|
+
import { F as Te, G as Ee, M as De, et as Oe, h as ke, i as Ae, r as je, st as Me, t as Ne, wt as Pe, zt as Fe } from "./error-entries-CRPfxMqm.js";
|
|
12
|
+
import { d as Ie, f as Le, i as Re, n as ze, t as Be, u as Ve } from "./process-output-Bmev5azU.js";
|
|
13
|
+
import { i as He, s as Ue, t as We } from "./strings-BGW-fXVJ.js";
|
|
13
14
|
import { t as Ge } from "./jsx-runtime-3BD1kT0s.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { n as
|
|
22
|
-
import { n as
|
|
23
|
-
import { n as
|
|
24
|
-
import { t as
|
|
25
|
-
var
|
|
15
|
+
import { n as Ke } from "./error-banner-IsonnvA0.js";
|
|
16
|
+
import { t as qe } from "./isEmpty-BSZ1LaUo.js";
|
|
17
|
+
import { n as Je } from "./useTheme-B9C1JIy9.js";
|
|
18
|
+
import { C as Ye, D as Xe, h as Ze } from "./utils-DXkj82sK.js";
|
|
19
|
+
import { t as Qe } from "./objects-DCmMvZtn.js";
|
|
20
|
+
import { Dt as $e, Et as et, St as tt, U as nt, V as rt, W as it, bt as at, kt as ot, nt as st, rt as ct, yt as lt, z as ut } from "./dist-CYeqK4Xw.js";
|
|
21
|
+
import { B as dt, C as ft, D as pt, F as mt, H as ht, I as gt, M as _t, N as vt, O as yt, R as bt, S as xt, T as St, b as Ct, j as wt, k as Tt, v as Et, w as Dt, x as Ot, y as kt, z as At } from "./schemas-CdscWNy_.js";
|
|
22
|
+
import { n as jt, o as Mt, r as Nt } from "./dist-BX1mn8na.js";
|
|
23
|
+
import { n as Pt } from "./dist-DiLFTlnl.js";
|
|
24
|
+
import { n as Ft, t as It } from "./esm-CHjVSexr.js";
|
|
25
|
+
import { t as Lt } from "./useAsyncData-DsZMvNXn.js";
|
|
26
|
+
var Rt = M("ban", [["circle", {
|
|
26
27
|
cx: "12",
|
|
27
28
|
cy: "12",
|
|
28
29
|
r: "10",
|
|
@@ -30,7 +31,7 @@ var zt = j("ban", [["circle", {
|
|
|
30
31
|
}], ["path", {
|
|
31
32
|
d: "M4.929 4.929 19.07 19.071",
|
|
32
33
|
key: "196cmz"
|
|
33
|
-
}]]),
|
|
34
|
+
}]]), zt = M("bot-message-square", [
|
|
34
35
|
["path", {
|
|
35
36
|
d: "M12 6V2H8",
|
|
36
37
|
key: "1155em"
|
|
@@ -55,13 +56,13 @@ var zt = j("ban", [["circle", {
|
|
|
55
56
|
d: "M9 11v2",
|
|
56
57
|
key: "1ueba0"
|
|
57
58
|
}]
|
|
58
|
-
]),
|
|
59
|
+
]), Bt = M("circle-check-big", [["path", {
|
|
59
60
|
d: "M21.801 10A10 10 0 1 1 17 3.335",
|
|
60
61
|
key: "yps3ct"
|
|
61
62
|
}], ["path", {
|
|
62
63
|
d: "m9 11 3 3L22 4",
|
|
63
64
|
key: "1pflzl"
|
|
64
|
-
}]]),
|
|
65
|
+
}]]), Vt = M("circle-slash", [["circle", {
|
|
65
66
|
cx: "12",
|
|
66
67
|
cy: "12",
|
|
67
68
|
r: "10",
|
|
@@ -72,22 +73,22 @@ var zt = j("ban", [["circle", {
|
|
|
72
73
|
y1: "15",
|
|
73
74
|
y2: "9",
|
|
74
75
|
key: "1dfufj"
|
|
75
|
-
}]]),
|
|
76
|
+
}]]), Ht = M("paperclip", [["path", {
|
|
76
77
|
d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
|
|
77
78
|
key: "1miecu"
|
|
78
|
-
}]]),
|
|
79
|
+
}]]), Ut = M("rotate-cw", [["path", {
|
|
79
80
|
d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
|
|
80
81
|
key: "1p45f6"
|
|
81
82
|
}], ["path", {
|
|
82
83
|
d: "M21 3v5h-5",
|
|
83
84
|
key: "1q7to0"
|
|
84
|
-
}]]),
|
|
85
|
+
}]]), Wt = M("send-horizontal", [["path", {
|
|
85
86
|
d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",
|
|
86
87
|
key: "117uat"
|
|
87
88
|
}], ["path", {
|
|
88
89
|
d: "M6 12h16",
|
|
89
90
|
key: "s4cdu5"
|
|
90
|
-
}]]),
|
|
91
|
+
}]]), Gt = M("settings", [["path", {
|
|
91
92
|
d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
|
|
92
93
|
key: "1i5ecw"
|
|
93
94
|
}], ["circle", {
|
|
@@ -95,7 +96,7 @@ var zt = j("ban", [["circle", {
|
|
|
95
96
|
cy: "12",
|
|
96
97
|
r: "3",
|
|
97
98
|
key: "1v7zrd"
|
|
98
|
-
}]]),
|
|
99
|
+
}]]), Kt = M("shield-question-mark", [
|
|
99
100
|
["path", {
|
|
100
101
|
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
101
102
|
key: "oel41y"
|
|
@@ -108,66 +109,66 @@ var zt = j("ban", [["circle", {
|
|
|
108
109
|
d: "M12 17h.01",
|
|
109
110
|
key: "p32p05"
|
|
110
111
|
}]
|
|
111
|
-
]),
|
|
112
|
+
]), N = s(), qt = "vercel.ai.error", Jt = Symbol.for(qt), Yt, Xt, P = class e extends (Xt = Error, Yt = Jt, Xt) {
|
|
112
113
|
constructor({ name: e, message: t, cause: n }) {
|
|
113
|
-
super(t), this[
|
|
114
|
+
super(t), this[Yt] = !0, this.name = e, this.cause = n;
|
|
114
115
|
}
|
|
115
116
|
static isInstance(t) {
|
|
116
|
-
return e.hasMarker(t,
|
|
117
|
+
return e.hasMarker(t, qt);
|
|
117
118
|
}
|
|
118
119
|
static hasMarker(e, t) {
|
|
119
120
|
let n = Symbol.for(t);
|
|
120
121
|
return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
|
|
121
122
|
}
|
|
122
|
-
},
|
|
123
|
+
}, Zt = "AI_APICallError", Qt = `vercel.ai.error.${Zt}`, $t = Symbol.for(Qt), en, tn, nn = class extends (tn = P, en = $t, tn) {
|
|
123
124
|
constructor({ message: e, url: t, requestBodyValues: n, statusCode: r, responseHeaders: i, responseBody: a, cause: o, isRetryable: s = r != null && (r === 408 || r === 409 || r === 429 || r >= 500), data: c }) {
|
|
124
125
|
super({
|
|
125
|
-
name:
|
|
126
|
+
name: Zt,
|
|
126
127
|
message: e,
|
|
127
128
|
cause: o
|
|
128
|
-
}), this[
|
|
129
|
+
}), this[en] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
|
|
129
130
|
}
|
|
130
131
|
static isInstance(e) {
|
|
131
|
-
return
|
|
132
|
+
return P.hasMarker(e, Qt);
|
|
132
133
|
}
|
|
133
|
-
},
|
|
134
|
+
}, rn = "AI_EmptyResponseBodyError", an = `vercel.ai.error.${rn}`, on = Symbol.for(an), sn, cn, ln = class extends (cn = P, sn = on, cn) {
|
|
134
135
|
constructor({ message: e = "Empty response body" } = {}) {
|
|
135
136
|
super({
|
|
136
|
-
name:
|
|
137
|
+
name: rn,
|
|
137
138
|
message: e
|
|
138
|
-
}), this[
|
|
139
|
+
}), this[sn] = !0;
|
|
139
140
|
}
|
|
140
141
|
static isInstance(e) {
|
|
141
|
-
return
|
|
142
|
+
return P.hasMarker(e, an);
|
|
142
143
|
}
|
|
143
144
|
};
|
|
144
|
-
function
|
|
145
|
+
function un(e) {
|
|
145
146
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
|
|
146
147
|
}
|
|
147
|
-
var
|
|
148
|
+
var dn = "AI_InvalidArgumentError", fn = `vercel.ai.error.${dn}`, pn = Symbol.for(fn), mn, hn, gn = class extends (hn = P, mn = pn, hn) {
|
|
148
149
|
constructor({ message: e, cause: t, argument: n }) {
|
|
149
150
|
super({
|
|
150
|
-
name:
|
|
151
|
+
name: dn,
|
|
151
152
|
message: e,
|
|
152
153
|
cause: t
|
|
153
|
-
}), this[
|
|
154
|
+
}), this[mn] = !0, this.argument = n;
|
|
154
155
|
}
|
|
155
156
|
static isInstance(e) {
|
|
156
|
-
return
|
|
157
|
+
return P.hasMarker(e, fn);
|
|
157
158
|
}
|
|
158
|
-
},
|
|
159
|
+
}, _n = "AI_JSONParseError", vn = `vercel.ai.error.${_n}`, yn = Symbol.for(vn), bn, xn, Sn = class extends (xn = P, bn = yn, xn) {
|
|
159
160
|
constructor({ text: e, cause: t }) {
|
|
160
161
|
super({
|
|
161
|
-
name:
|
|
162
|
+
name: _n,
|
|
162
163
|
message: `JSON parsing failed: Text: ${e}.
|
|
163
|
-
Error message: ${
|
|
164
|
+
Error message: ${un(t)}`,
|
|
164
165
|
cause: t
|
|
165
|
-
}), this[
|
|
166
|
+
}), this[bn] = !0, this.text = e;
|
|
166
167
|
}
|
|
167
168
|
static isInstance(e) {
|
|
168
|
-
return
|
|
169
|
+
return P.hasMarker(e, vn);
|
|
169
170
|
}
|
|
170
|
-
},
|
|
171
|
+
}, Cn = "AI_TypeValidationError", wn = `vercel.ai.error.${Cn}`, Tn = Symbol.for(wn), En, Dn, F = class e extends (Dn = P, En = Tn, Dn) {
|
|
171
172
|
constructor({ value: e, cause: t, context: n }) {
|
|
172
173
|
let r = "Type validation failed";
|
|
173
174
|
if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
|
|
@@ -176,14 +177,14 @@ Error message: ${dn(t)}`,
|
|
|
176
177
|
n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
|
|
177
178
|
}
|
|
178
179
|
super({
|
|
179
|
-
name:
|
|
180
|
+
name: Cn,
|
|
180
181
|
message: `${r}: Value: ${JSON.stringify(e)}.
|
|
181
|
-
Error message: ${
|
|
182
|
+
Error message: ${un(t)}`,
|
|
182
183
|
cause: t
|
|
183
|
-
}), this[
|
|
184
|
+
}), this[En] = !0, this.value = e, this.context = n;
|
|
184
185
|
}
|
|
185
186
|
static isInstance(e) {
|
|
186
|
-
return
|
|
187
|
+
return P.hasMarker(e, wn);
|
|
187
188
|
}
|
|
188
189
|
static wrap({ value: t, cause: n, context: r }) {
|
|
189
190
|
return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
|
|
@@ -192,25 +193,25 @@ Error message: ${dn(t)}`,
|
|
|
192
193
|
context: r
|
|
193
194
|
});
|
|
194
195
|
}
|
|
195
|
-
},
|
|
196
|
+
}, On = "AI_UnsupportedFunctionalityError", kn = `vercel.ai.error.${On}`, An = Symbol.for(kn), jn, Mn, Nn = class extends (Mn = P, jn = An, Mn) {
|
|
196
197
|
constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
|
|
197
198
|
super({
|
|
198
|
-
name:
|
|
199
|
+
name: On,
|
|
199
200
|
message: t
|
|
200
|
-
}), this[
|
|
201
|
+
}), this[jn] = !0, this.functionality = e;
|
|
201
202
|
}
|
|
202
203
|
static isInstance(e) {
|
|
203
|
-
return
|
|
204
|
+
return P.hasMarker(e, kn);
|
|
204
205
|
}
|
|
205
|
-
},
|
|
206
|
+
}, Pn = class extends Error {
|
|
206
207
|
constructor(e, t) {
|
|
207
208
|
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
208
209
|
}
|
|
209
|
-
},
|
|
210
|
-
function
|
|
211
|
-
function
|
|
210
|
+
}, Fn = 10, In = 13, Ln = 32;
|
|
211
|
+
function Rn(e) {}
|
|
212
|
+
function zn(e) {
|
|
212
213
|
if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
|
|
213
|
-
let { onEvent: t =
|
|
214
|
+
let { onEvent: t = Rn, onError: n = Rn, onRetry: r = Rn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
|
|
214
215
|
function m(e) {
|
|
215
216
|
if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
|
|
216
217
|
if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
|
|
@@ -229,7 +230,7 @@ function Bn(e) {
|
|
|
229
230
|
n !== "" && (o.push(n), s = n.length), h();
|
|
230
231
|
}
|
|
231
232
|
function h() {
|
|
232
|
-
a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new
|
|
233
|
+
a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new Pn(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
|
|
233
234
|
}
|
|
234
235
|
function g(e) {
|
|
235
236
|
let n = 0;
|
|
@@ -245,9 +246,9 @@ function Bn(e) {
|
|
|
245
246
|
continue;
|
|
246
247
|
}
|
|
247
248
|
let i = e.charCodeAt(n);
|
|
248
|
-
if (
|
|
249
|
-
let i = e.charCodeAt(n + 5) ===
|
|
250
|
-
if (d === 0 && e.charCodeAt(r + 1) ===
|
|
249
|
+
if (Bn(e, n, i)) {
|
|
250
|
+
let i = e.charCodeAt(n + 5) === Ln ? n + 6 : n + 5, a = e.slice(i, r);
|
|
251
|
+
if (d === 0 && e.charCodeAt(r + 1) === Fn) {
|
|
251
252
|
t({
|
|
252
253
|
id: l,
|
|
253
254
|
event: f,
|
|
@@ -257,7 +258,7 @@ function Bn(e) {
|
|
|
257
258
|
}
|
|
258
259
|
u = d === 0 ? a : `${u}
|
|
259
260
|
${a}`, d++;
|
|
260
|
-
} else
|
|
261
|
+
} else Vn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === Ln ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
|
|
261
262
|
n = r + 1, r = e.indexOf("\n", n);
|
|
262
263
|
}
|
|
263
264
|
return e.slice(n);
|
|
@@ -265,7 +266,7 @@ ${a}`, d++;
|
|
|
265
266
|
for (; n < e.length;) {
|
|
266
267
|
let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
|
|
267
268
|
if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break;
|
|
268
|
-
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) ===
|
|
269
|
+
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) === In && e.charCodeAt(n) === Fn && n++;
|
|
269
270
|
}
|
|
270
271
|
return e.slice(n);
|
|
271
272
|
}
|
|
@@ -275,25 +276,25 @@ ${a}`, d++;
|
|
|
275
276
|
return;
|
|
276
277
|
}
|
|
277
278
|
let r = e.charCodeAt(t);
|
|
278
|
-
if (
|
|
279
|
-
let r = e.charCodeAt(t + 5) ===
|
|
279
|
+
if (Bn(e, t, r)) {
|
|
280
|
+
let r = e.charCodeAt(t + 5) === Ln ? t + 6 : t + 5, i = e.slice(r, n);
|
|
280
281
|
u = d === 0 ? i : `${u}
|
|
281
282
|
${i}`, d++;
|
|
282
283
|
return;
|
|
283
284
|
}
|
|
284
|
-
if (
|
|
285
|
-
f = e.slice(e.charCodeAt(t + 6) ===
|
|
285
|
+
if (Vn(e, t, r)) {
|
|
286
|
+
f = e.slice(e.charCodeAt(t + 6) === Ln ? t + 7 : t + 6, n) || void 0;
|
|
286
287
|
return;
|
|
287
288
|
}
|
|
288
289
|
if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
|
|
289
|
-
let r = e.slice(e.charCodeAt(t + 3) ===
|
|
290
|
+
let r = e.slice(e.charCodeAt(t + 3) === Ln ? t + 4 : t + 3, n);
|
|
290
291
|
l = r.includes("\0") ? void 0 : r;
|
|
291
292
|
return;
|
|
292
293
|
}
|
|
293
294
|
if (r === 58) {
|
|
294
295
|
if (i) {
|
|
295
296
|
let r = e.slice(t, n);
|
|
296
|
-
i(r.slice(e.charCodeAt(t + 1) ===
|
|
297
|
+
i(r.slice(e.charCodeAt(t + 1) === Ln ? 2 : 1));
|
|
297
298
|
}
|
|
298
299
|
return;
|
|
299
300
|
}
|
|
@@ -302,7 +303,7 @@ ${i}`, d++;
|
|
|
302
303
|
v(a, "", a);
|
|
303
304
|
return;
|
|
304
305
|
}
|
|
305
|
-
let s = a.slice(0, o), c = a.charCodeAt(o + 1) ===
|
|
306
|
+
let s = a.slice(0, o), c = a.charCodeAt(o + 1) === Ln ? 2 : 1;
|
|
306
307
|
v(s, a.slice(o + c), a);
|
|
307
308
|
}
|
|
308
309
|
function v(e, t, i) {
|
|
@@ -318,13 +319,13 @@ ${t}`, d++;
|
|
|
318
319
|
l = t.includes("\0") ? void 0 : t;
|
|
319
320
|
break;
|
|
320
321
|
case "retry":
|
|
321
|
-
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new
|
|
322
|
+
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Pn(`Invalid \`retry\` value: "${t}"`, {
|
|
322
323
|
type: "invalid-retry",
|
|
323
324
|
value: t,
|
|
324
325
|
line: i
|
|
325
326
|
}));
|
|
326
327
|
break;
|
|
327
|
-
default: n(new
|
|
328
|
+
default: n(new Pn(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
|
|
328
329
|
type: "unknown-field",
|
|
329
330
|
field: e,
|
|
330
331
|
value: t,
|
|
@@ -351,20 +352,20 @@ ${t}`, d++;
|
|
|
351
352
|
reset: b
|
|
352
353
|
};
|
|
353
354
|
}
|
|
354
|
-
function
|
|
355
|
+
function Bn(e, t, n) {
|
|
355
356
|
return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
|
|
356
357
|
}
|
|
357
|
-
function
|
|
358
|
+
function Vn(e, t, n) {
|
|
358
359
|
return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58;
|
|
359
360
|
}
|
|
360
361
|
//#endregion
|
|
361
362
|
//#region ../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
|
|
362
|
-
var
|
|
363
|
+
var Hn = class extends TransformStream {
|
|
363
364
|
constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
|
|
364
365
|
let i;
|
|
365
366
|
super({
|
|
366
367
|
start(a) {
|
|
367
|
-
i =
|
|
368
|
+
i = zn({
|
|
368
369
|
onEvent: (e) => {
|
|
369
370
|
a.enqueue(e);
|
|
370
371
|
},
|
|
@@ -383,8 +384,8 @@ var Un = class extends TransformStream {
|
|
|
383
384
|
}
|
|
384
385
|
};
|
|
385
386
|
new TextDecoder();
|
|
386
|
-
var { btoa:
|
|
387
|
-
function
|
|
387
|
+
var { btoa: Un, atob: Wn } = globalThis;
|
|
388
|
+
function Gn(e) {
|
|
388
389
|
if (e == null) return {};
|
|
389
390
|
let t = {};
|
|
390
391
|
if (e instanceof Headers) e.forEach((e, n) => {
|
|
@@ -396,28 +397,28 @@ function Kn(e) {
|
|
|
396
397
|
}
|
|
397
398
|
return t;
|
|
398
399
|
}
|
|
399
|
-
var
|
|
400
|
+
var I = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
|
|
400
401
|
let i = () => {
|
|
401
402
|
let e = n.length, r = Array(t);
|
|
402
403
|
for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
|
|
403
404
|
return r.join("");
|
|
404
405
|
};
|
|
405
406
|
if (e == null) return i;
|
|
406
|
-
if (n.includes(r)) throw new
|
|
407
|
+
if (n.includes(r)) throw new gn({
|
|
407
408
|
argument: "separator",
|
|
408
409
|
message: `The separator "${r}" must not be part of the alphabet "${n}".`
|
|
409
410
|
});
|
|
410
411
|
return () => `${e}${r}${i()}`;
|
|
411
|
-
},
|
|
412
|
-
function
|
|
412
|
+
}, Kn = I();
|
|
413
|
+
function qn(e) {
|
|
413
414
|
return globalThis.Buffer?.isBuffer(e) ?? !1;
|
|
414
415
|
}
|
|
415
|
-
var
|
|
416
|
-
function
|
|
416
|
+
var Jn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Yn = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
417
|
+
function Xn(e) {
|
|
417
418
|
let t = JSON.parse(e);
|
|
418
|
-
return typeof t != "object" || !t ||
|
|
419
|
+
return typeof t != "object" || !t || Jn.test(e) === !1 && Yn.test(e) === !1 ? t : Zn(t);
|
|
419
420
|
}
|
|
420
|
-
function
|
|
421
|
+
function Zn(e) {
|
|
421
422
|
let t = [e];
|
|
422
423
|
for (; t.length;) {
|
|
423
424
|
let e = t;
|
|
@@ -432,33 +433,33 @@ function Qn(e) {
|
|
|
432
433
|
}
|
|
433
434
|
return e;
|
|
434
435
|
}
|
|
435
|
-
function
|
|
436
|
+
function Qn(e) {
|
|
436
437
|
let { stackTraceLimit: t } = Error;
|
|
437
438
|
try {
|
|
438
439
|
Error.stackTraceLimit = 0;
|
|
439
440
|
} catch {
|
|
440
|
-
return
|
|
441
|
+
return Xn(e);
|
|
441
442
|
}
|
|
442
443
|
try {
|
|
443
|
-
return
|
|
444
|
+
return Xn(e);
|
|
444
445
|
} finally {
|
|
445
446
|
Error.stackTraceLimit = t;
|
|
446
447
|
}
|
|
447
448
|
}
|
|
448
|
-
function
|
|
449
|
+
function $n(e) {
|
|
449
450
|
if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
|
|
450
451
|
let { additionalProperties: t } = e;
|
|
451
|
-
e.additionalProperties = t != null && typeof t != "boolean" &&
|
|
452
|
+
e.additionalProperties = t != null && typeof t != "boolean" && er(t);
|
|
452
453
|
let { properties: n } = e;
|
|
453
|
-
if (n != null) for (let e of Object.keys(n)) n[e] =
|
|
454
|
+
if (n != null) for (let e of Object.keys(n)) n[e] = er(n[e]);
|
|
454
455
|
}
|
|
455
|
-
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(
|
|
456
|
+
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(er) : er(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(er)), e.allOf != null && (e.allOf = e.allOf.map(er)), e.oneOf != null && (e.oneOf = e.oneOf.map(er));
|
|
456
457
|
let { definitions: t } = e;
|
|
457
|
-
if (t != null) for (let e of Object.keys(t)) t[e] =
|
|
458
|
+
if (t != null) for (let e of Object.keys(t)) t[e] = er(t[e]);
|
|
458
459
|
return e;
|
|
459
460
|
}
|
|
460
|
-
function
|
|
461
|
-
return typeof e == "boolean" ? e :
|
|
461
|
+
function er(e) {
|
|
462
|
+
return typeof e == "boolean" ? e : $n(e);
|
|
462
463
|
}
|
|
463
464
|
var tr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), nr = {
|
|
464
465
|
name: void 0,
|
|
@@ -1218,7 +1219,7 @@ function ei(e) {
|
|
|
1218
1219
|
function ti(e) {
|
|
1219
1220
|
return Qr(() => {
|
|
1220
1221
|
if (!ni(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
|
|
1221
|
-
return
|
|
1222
|
+
return $n(e["~standard"].jsonSchema.input({ target: "draft-07" }));
|
|
1222
1223
|
}, { validate: async (t) => {
|
|
1223
1224
|
let n = await e["~standard"].validate(t);
|
|
1224
1225
|
return "value" in n ? {
|
|
@@ -1226,7 +1227,7 @@ function ti(e) {
|
|
|
1226
1227
|
value: n.value
|
|
1227
1228
|
} : {
|
|
1228
1229
|
success: !1,
|
|
1229
|
-
error: new
|
|
1230
|
+
error: new F({
|
|
1230
1231
|
value: t,
|
|
1231
1232
|
cause: n.issues
|
|
1232
1233
|
})
|
|
@@ -1251,12 +1252,12 @@ function ri(e, t) {
|
|
|
1251
1252
|
}
|
|
1252
1253
|
function ii(e, t) {
|
|
1253
1254
|
let n = t?.useReferences ?? !1;
|
|
1254
|
-
return Qr(() =>
|
|
1255
|
+
return Qr(() => $n(ht(e, {
|
|
1255
1256
|
target: "draft-7",
|
|
1256
1257
|
io: "input",
|
|
1257
1258
|
reused: n ? "ref" : "inline"
|
|
1258
1259
|
})), { validate: async (t) => {
|
|
1259
|
-
let n = await
|
|
1260
|
+
let n = await dt(e, t);
|
|
1260
1261
|
return n.success ? {
|
|
1261
1262
|
success: !0,
|
|
1262
1263
|
value: n.data
|
|
@@ -1278,7 +1279,7 @@ async function si({ value: e, schema: t, context: n }) {
|
|
|
1278
1279
|
schema: t,
|
|
1279
1280
|
context: n
|
|
1280
1281
|
});
|
|
1281
|
-
if (!r.success) throw
|
|
1282
|
+
if (!r.success) throw F.wrap({
|
|
1282
1283
|
value: e,
|
|
1283
1284
|
cause: r.error,
|
|
1284
1285
|
context: n
|
|
@@ -1300,7 +1301,7 @@ async function ci({ value: e, schema: t, context: n }) {
|
|
|
1300
1301
|
rawValue: e
|
|
1301
1302
|
} : {
|
|
1302
1303
|
success: !1,
|
|
1303
|
-
error:
|
|
1304
|
+
error: F.wrap({
|
|
1304
1305
|
value: e,
|
|
1305
1306
|
cause: t.error,
|
|
1306
1307
|
context: n
|
|
@@ -1310,7 +1311,7 @@ async function ci({ value: e, schema: t, context: n }) {
|
|
|
1310
1311
|
} catch (t) {
|
|
1311
1312
|
return {
|
|
1312
1313
|
success: !1,
|
|
1313
|
-
error:
|
|
1314
|
+
error: F.wrap({
|
|
1314
1315
|
value: e,
|
|
1315
1316
|
cause: t,
|
|
1316
1317
|
context: n
|
|
@@ -1321,7 +1322,7 @@ async function ci({ value: e, schema: t, context: n }) {
|
|
|
1321
1322
|
}
|
|
1322
1323
|
async function li({ text: e, schema: t }) {
|
|
1323
1324
|
try {
|
|
1324
|
-
let n =
|
|
1325
|
+
let n = Qn(e);
|
|
1325
1326
|
return t == null ? {
|
|
1326
1327
|
success: !0,
|
|
1327
1328
|
value: n,
|
|
@@ -1333,7 +1334,7 @@ async function li({ text: e, schema: t }) {
|
|
|
1333
1334
|
} catch (t) {
|
|
1334
1335
|
return {
|
|
1335
1336
|
success: !1,
|
|
1336
|
-
error:
|
|
1337
|
+
error: Sn.isInstance(t) ? t : new Sn({
|
|
1337
1338
|
text: e,
|
|
1338
1339
|
cause: t
|
|
1339
1340
|
}),
|
|
@@ -1342,7 +1343,7 @@ async function li({ text: e, schema: t }) {
|
|
|
1342
1343
|
}
|
|
1343
1344
|
}
|
|
1344
1345
|
function ui({ stream: e, schema: t }) {
|
|
1345
|
-
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
1346
|
+
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Hn()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
|
|
1346
1347
|
e !== "[DONE]" && n.enqueue(await li({
|
|
1347
1348
|
text: e,
|
|
1348
1349
|
schema: t
|
|
@@ -1358,7 +1359,7 @@ var di = Object.defineProperty, fi = (e, t) => {
|
|
|
1358
1359
|
get: t[n],
|
|
1359
1360
|
enumerable: !0
|
|
1360
1361
|
});
|
|
1361
|
-
}, pi = "AI_InvalidArgumentError", mi = `vercel.ai.error.${pi}`, hi = Symbol.for(mi), gi, _i, vi = class extends (_i =
|
|
1362
|
+
}, pi = "AI_InvalidArgumentError", mi = `vercel.ai.error.${pi}`, hi = Symbol.for(mi), gi, _i, vi = class extends (_i = P, gi = hi, _i) {
|
|
1362
1363
|
constructor({ parameter: e, value: t, message: n }) {
|
|
1363
1364
|
super({
|
|
1364
1365
|
name: pi,
|
|
@@ -1366,9 +1367,9 @@ var di = Object.defineProperty, fi = (e, t) => {
|
|
|
1366
1367
|
}), this[gi] = !0, this.parameter = e, this.value = t;
|
|
1367
1368
|
}
|
|
1368
1369
|
static isInstance(e) {
|
|
1369
|
-
return
|
|
1370
|
+
return P.hasMarker(e, mi);
|
|
1370
1371
|
}
|
|
1371
|
-
}, yi = "AI_NoObjectGeneratedError", bi = `vercel.ai.error.${yi}`, xi = Symbol.for(bi), Si, Ci, U = class extends (Ci =
|
|
1372
|
+
}, yi = "AI_NoObjectGeneratedError", bi = `vercel.ai.error.${yi}`, xi = Symbol.for(bi), Si, Ci, U = class extends (Ci = P, Si = xi, Ci) {
|
|
1372
1373
|
constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
|
|
1373
1374
|
super({
|
|
1374
1375
|
name: yi,
|
|
@@ -1377,9 +1378,9 @@ var di = Object.defineProperty, fi = (e, t) => {
|
|
|
1377
1378
|
}), this[Si] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
|
|
1378
1379
|
}
|
|
1379
1380
|
static isInstance(e) {
|
|
1380
|
-
return
|
|
1381
|
+
return P.hasMarker(e, bi);
|
|
1381
1382
|
}
|
|
1382
|
-
}, wi = "AI_UIMessageStreamError", Ti = `vercel.ai.error.${wi}`, Ei = Symbol.for(Ti), Di, Oi, ki = class extends (Oi =
|
|
1383
|
+
}, wi = "AI_UIMessageStreamError", Ti = `vercel.ai.error.${wi}`, Ei = Symbol.for(Ti), Di, Oi, ki = class extends (Oi = P, Di = Ei, Oi) {
|
|
1383
1384
|
constructor({ chunkType: e, chunkId: t, message: n }) {
|
|
1384
1385
|
super({
|
|
1385
1386
|
name: wi,
|
|
@@ -1387,7 +1388,7 @@ var di = Object.defineProperty, fi = (e, t) => {
|
|
|
1387
1388
|
}), this[Di] = !0, this.chunkType = e, this.chunkId = t;
|
|
1388
1389
|
}
|
|
1389
1390
|
static isInstance(e) {
|
|
1390
|
-
return
|
|
1391
|
+
return P.hasMarker(e, Ti);
|
|
1391
1392
|
}
|
|
1392
1393
|
};
|
|
1393
1394
|
function Ai({ warning: e, provider: t, model: n }) {
|
|
@@ -1446,23 +1447,23 @@ function Fi(e, t) {
|
|
|
1446
1447
|
return n;
|
|
1447
1448
|
}
|
|
1448
1449
|
var W = {
|
|
1449
|
-
array:
|
|
1450
|
-
boolean:
|
|
1451
|
-
custom:
|
|
1452
|
-
discriminatedUnion:
|
|
1453
|
-
enum:
|
|
1454
|
-
instanceof:
|
|
1455
|
-
lazy:
|
|
1456
|
-
literal:
|
|
1457
|
-
looseObject:
|
|
1458
|
-
never:
|
|
1459
|
-
null:
|
|
1460
|
-
number:
|
|
1461
|
-
object:
|
|
1462
|
-
record:
|
|
1463
|
-
string:
|
|
1464
|
-
union:
|
|
1465
|
-
unknown:
|
|
1450
|
+
array: xt,
|
|
1451
|
+
boolean: ft,
|
|
1452
|
+
custom: Dt,
|
|
1453
|
+
discriminatedUnion: St,
|
|
1454
|
+
enum: Et,
|
|
1455
|
+
instanceof: kt,
|
|
1456
|
+
lazy: pt,
|
|
1457
|
+
literal: yt,
|
|
1458
|
+
looseObject: Tt,
|
|
1459
|
+
never: wt,
|
|
1460
|
+
null: Ct,
|
|
1461
|
+
number: _t,
|
|
1462
|
+
object: vt,
|
|
1463
|
+
record: mt,
|
|
1464
|
+
string: gt,
|
|
1465
|
+
union: bt,
|
|
1466
|
+
unknown: At
|
|
1466
1467
|
}, Ii = W.lazy(() => W.union([
|
|
1467
1468
|
W.null(),
|
|
1468
1469
|
W.string(),
|
|
@@ -1474,7 +1475,7 @@ var W = {
|
|
|
1474
1475
|
W.string(),
|
|
1475
1476
|
W.instanceof(Uint8Array),
|
|
1476
1477
|
W.instanceof(ArrayBuffer),
|
|
1477
|
-
W.custom(
|
|
1478
|
+
W.custom(qn, { message: "Must be a Buffer" })
|
|
1478
1479
|
]), Ri = W.record(W.string(), W.string()), zi = W.object({
|
|
1479
1480
|
type: W.literal("text"),
|
|
1480
1481
|
text: W.string(),
|
|
@@ -1999,7 +2000,7 @@ var ia = () => ({
|
|
|
1999
2000
|
let o = i.value;
|
|
2000
2001
|
if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new U({
|
|
2001
2002
|
message: "No object generated: response did not match schema.",
|
|
2002
|
-
cause: new
|
|
2003
|
+
cause: new F({
|
|
2003
2004
|
value: o,
|
|
2004
2005
|
cause: "response must be an object with an elements array"
|
|
2005
2006
|
}),
|
|
@@ -2092,11 +2093,11 @@ function sa({ name: e, value: t }) {
|
|
|
2092
2093
|
}
|
|
2093
2094
|
}
|
|
2094
2095
|
function ca({ value: e, minItems: t, maxItems: n }) {
|
|
2095
|
-
if (t != null && e.length < t) return new
|
|
2096
|
+
if (t != null && e.length < t) return new F({
|
|
2096
2097
|
value: e,
|
|
2097
2098
|
cause: `elements array must contain at least ${t} items`
|
|
2098
2099
|
});
|
|
2099
|
-
if (n != null && e.length > n) return new
|
|
2100
|
+
if (n != null && e.length > n) return new F({
|
|
2100
2101
|
value: e,
|
|
2101
2102
|
cause: `elements array must contain at most ${n} items`
|
|
2102
2103
|
});
|
|
@@ -2131,7 +2132,7 @@ var la = ({ options: e, name: t, description: n }) => ({
|
|
|
2131
2132
|
let i = r.value;
|
|
2132
2133
|
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new U({
|
|
2133
2134
|
message: "No object generated: response did not match schema.",
|
|
2134
|
-
cause: new
|
|
2135
|
+
cause: new F({
|
|
2135
2136
|
value: i,
|
|
2136
2137
|
cause: "response must be an object that contains a choice value."
|
|
2137
2138
|
}),
|
|
@@ -2187,10 +2188,10 @@ var la = ({ options: e, name: t, description: n }) => ({
|
|
|
2187
2188
|
},
|
|
2188
2189
|
createElementStreamTransform() {}
|
|
2189
2190
|
});
|
|
2190
|
-
new TextEncoder(), new TextEncoder(),
|
|
2191
|
+
new TextEncoder(), new TextEncoder(), I({
|
|
2191
2192
|
prefix: "aitxt",
|
|
2192
2193
|
size: 24
|
|
2193
|
-
}),
|
|
2194
|
+
}), I({
|
|
2194
2195
|
prefix: "call",
|
|
2195
2196
|
size: 24
|
|
2196
2197
|
});
|
|
@@ -2900,25 +2901,25 @@ async function Ea({ stream: e, onError: t, abortSignal: n }) {
|
|
|
2900
2901
|
n?.removeEventListener("abort", i), r.releaseLock();
|
|
2901
2902
|
}
|
|
2902
2903
|
}
|
|
2903
|
-
|
|
2904
|
+
I({
|
|
2904
2905
|
prefix: "aitxt",
|
|
2905
2906
|
size: 24
|
|
2906
|
-
}),
|
|
2907
|
+
}), I({
|
|
2907
2908
|
prefix: "call",
|
|
2908
2909
|
size: 24
|
|
2909
|
-
}),
|
|
2910
|
+
}), I({
|
|
2910
2911
|
prefix: "aitxt",
|
|
2911
2912
|
size: 24
|
|
2912
|
-
}),
|
|
2913
|
+
}), I({
|
|
2913
2914
|
prefix: "call",
|
|
2914
2915
|
size: 24
|
|
2915
|
-
}), W.record(W.string(), Ii.optional()), W.record(W.string(), W.string()),
|
|
2916
|
+
}), W.record(W.string(), Ii.optional()), W.record(W.string(), W.string()), I({
|
|
2916
2917
|
prefix: "call",
|
|
2917
2918
|
size: 24
|
|
2918
|
-
}),
|
|
2919
|
+
}), I({
|
|
2919
2920
|
prefix: "call",
|
|
2920
2921
|
size: 24
|
|
2921
|
-
}), new TextEncoder(),
|
|
2922
|
+
}), new TextEncoder(), I({
|
|
2922
2923
|
prefix: "aiobj",
|
|
2923
2924
|
size: 24
|
|
2924
2925
|
});
|
|
@@ -2944,7 +2945,7 @@ var { atob: Da } = globalThis, Oa = class {
|
|
|
2944
2945
|
});
|
|
2945
2946
|
}
|
|
2946
2947
|
};
|
|
2947
|
-
|
|
2948
|
+
I({
|
|
2948
2949
|
prefix: "aiobj",
|
|
2949
2950
|
size: 24
|
|
2950
2951
|
}), W.object({
|
|
@@ -2964,13 +2965,13 @@ F({
|
|
|
2964
2965
|
description: W.string().optional(),
|
|
2965
2966
|
parameters: W.record(W.string(), W.unknown())
|
|
2966
2967
|
})).optional()
|
|
2967
|
-
}),
|
|
2968
|
+
}), I({
|
|
2968
2969
|
prefix: "call",
|
|
2969
2970
|
size: 24
|
|
2970
2971
|
});
|
|
2971
2972
|
async function ka({ response: e, url: t, fallbackMessage: n }) {
|
|
2972
2973
|
let r = await e.text();
|
|
2973
|
-
return new
|
|
2974
|
+
return new nn({
|
|
2974
2975
|
message: r || n,
|
|
2975
2976
|
url: t,
|
|
2976
2977
|
requestBodyValues: void 0,
|
|
@@ -2980,7 +2981,7 @@ async function ka({ response: e, url: t, fallbackMessage: n }) {
|
|
|
2980
2981
|
}
|
|
2981
2982
|
async function Aa(e) {
|
|
2982
2983
|
if (e == null) return [];
|
|
2983
|
-
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new
|
|
2984
|
+
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Nn({
|
|
2984
2985
|
functionality: "FileList",
|
|
2985
2986
|
message: "FileList is not supported in the current environment"
|
|
2986
2987
|
});
|
|
@@ -3009,8 +3010,8 @@ var Ma = class {
|
|
|
3009
3010
|
}
|
|
3010
3011
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
3011
3012
|
let n = await H(this.body), r = await H(this.headers), i = await H(this.credentials), a = {
|
|
3012
|
-
...
|
|
3013
|
-
...
|
|
3013
|
+
...Gn(r),
|
|
3014
|
+
...Gn(t.headers)
|
|
3014
3015
|
}, o = await this.prepareSendMessagesRequest?.call(this, {
|
|
3015
3016
|
api: this.api,
|
|
3016
3017
|
id: t.chatId,
|
|
@@ -3024,7 +3025,7 @@ var Ma = class {
|
|
|
3024
3025
|
requestMetadata: t.metadata,
|
|
3025
3026
|
trigger: t.trigger,
|
|
3026
3027
|
messageId: t.messageId
|
|
3027
|
-
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a :
|
|
3028
|
+
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : Gn(o.headers), l = o?.body === void 0 ? {
|
|
3028
3029
|
...n,
|
|
3029
3030
|
...t.body,
|
|
3030
3031
|
id: t.chatId,
|
|
@@ -3046,13 +3047,13 @@ var Ma = class {
|
|
|
3046
3047
|
url: s,
|
|
3047
3048
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3048
3049
|
});
|
|
3049
|
-
if (!d.body) throw new
|
|
3050
|
+
if (!d.body) throw new ln({ message: "The response body is empty." });
|
|
3050
3051
|
return this.processResponseStream(d.body);
|
|
3051
3052
|
}
|
|
3052
3053
|
async reconnectToStream(e) {
|
|
3053
3054
|
let t = await H(this.body), n = await H(this.headers), r = await H(this.credentials), i = {
|
|
3054
|
-
...
|
|
3055
|
-
...
|
|
3055
|
+
...Gn(n),
|
|
3056
|
+
...Gn(e.headers)
|
|
3056
3057
|
}, a = await this.prepareReconnectToStreamRequest?.call(this, {
|
|
3057
3058
|
api: this.api,
|
|
3058
3059
|
id: e.chatId,
|
|
@@ -3063,7 +3064,7 @@ var Ma = class {
|
|
|
3063
3064
|
headers: i,
|
|
3064
3065
|
credentials: r,
|
|
3065
3066
|
requestMetadata: e.metadata
|
|
3066
|
-
}), o = a?.api ?? ja(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i :
|
|
3067
|
+
}), o = a?.api ?? ja(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : Gn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
|
|
3067
3068
|
method: "GET",
|
|
3068
3069
|
headers: s,
|
|
3069
3070
|
credentials: c,
|
|
@@ -3075,7 +3076,7 @@ var Ma = class {
|
|
|
3075
3076
|
url: o,
|
|
3076
3077
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3077
3078
|
});
|
|
3078
|
-
if (!l.body) throw new
|
|
3079
|
+
if (!l.body) throw new ln({ message: "The response body is empty." });
|
|
3079
3080
|
return this.processResponseStream(l.body);
|
|
3080
3081
|
}
|
|
3081
3082
|
}, Na = class extends Ma {
|
|
@@ -3092,7 +3093,7 @@ var Ma = class {
|
|
|
3092
3093
|
} }));
|
|
3093
3094
|
}
|
|
3094
3095
|
}, Pa = class {
|
|
3095
|
-
constructor({ generateId: e =
|
|
3096
|
+
constructor({ generateId: e = Kn, id: t = e(), transport: n = new Na(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
|
|
3096
3097
|
this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new Oa(), this.sendMessage = async (e, t) => {
|
|
3097
3098
|
if (e == null) {
|
|
3098
3099
|
await this.makeRequest({
|
|
@@ -3566,7 +3567,7 @@ function ao(e, t) {
|
|
|
3566
3567
|
"<marimo-ui-element"
|
|
3567
3568
|
].some((e) => t.includes(e))) : !1;
|
|
3568
3569
|
}
|
|
3569
|
-
var oo = class extends
|
|
3570
|
+
var oo = class extends O {
|
|
3570
3571
|
title = "Cell Outputs";
|
|
3571
3572
|
mentionPrefix = "@";
|
|
3572
3573
|
contextType = "cell-output";
|
|
@@ -3575,7 +3576,7 @@ var oo = class extends w {
|
|
|
3575
3576
|
super(), this.store = e;
|
|
3576
3577
|
}
|
|
3577
3578
|
getItems() {
|
|
3578
|
-
let e = this.store.get(
|
|
3579
|
+
let e = this.store.get(ke), t = [];
|
|
3579
3580
|
for (let n of e.cellIds) {
|
|
3580
3581
|
let r = lo(n, e), i = r.cellOutput;
|
|
3581
3582
|
if (!i) continue;
|
|
@@ -3599,9 +3600,9 @@ var oo = class extends w {
|
|
|
3599
3600
|
label: `@${n}`,
|
|
3600
3601
|
displayLabel: n,
|
|
3601
3602
|
detail: `${t.outputType} output`,
|
|
3602
|
-
boost: t.outputType === "media" ?
|
|
3603
|
+
boost: t.outputType === "media" ? T.HIGH : T.MEDIUM,
|
|
3603
3604
|
type: this.contextType,
|
|
3604
|
-
section:
|
|
3605
|
+
section: j.CELL_OUTPUT,
|
|
3605
3606
|
apply: `@${n}`,
|
|
3606
3607
|
info: () => {
|
|
3607
3608
|
let e = document.createElement("div");
|
|
@@ -3638,7 +3639,7 @@ var oo = class extends w {
|
|
|
3638
3639
|
outputType: t.outputType,
|
|
3639
3640
|
mimetype: t.output.mimetype
|
|
3640
3641
|
}, o = `Cell Code:\n${i}\n\n`;
|
|
3641
|
-
return t.outputType === "text" && t.processedContent ? o += `Output:\n${t.processedContent}` : t.outputType === "media" && (o += `Media Output: Contains ${t.output.mimetype} content`, t.imageUrl && (o += `\nImage URL: ${t.imageUrl}`)),
|
|
3642
|
+
return t.outputType === "text" && t.processedContent ? o += `Output:\n${t.processedContent}` : t.outputType === "media" && (o += `Media Output: Contains ${t.output.mimetype} content`, t.imageUrl && (o += `\nImage URL: ${t.imageUrl}`)), A({
|
|
3642
3643
|
type: this.contextType,
|
|
3643
3644
|
data: a,
|
|
3644
3645
|
details: o
|
|
@@ -3653,7 +3654,7 @@ async function so(e, t, n) {
|
|
|
3653
3654
|
let i = e.filter((e) => e.shouldDownloadImage && e.outputType === "media");
|
|
3654
3655
|
if (i.length === 0) return [];
|
|
3655
3656
|
let a = i.flatMap((e) => {
|
|
3656
|
-
let i = document.getElementById(
|
|
3657
|
+
let i = document.getElementById(Pe.create(t));
|
|
3657
3658
|
return i ? {
|
|
3658
3659
|
cellId: t,
|
|
3659
3660
|
cellName: n,
|
|
@@ -3666,15 +3667,15 @@ async function so(e, t, n) {
|
|
|
3666
3667
|
type: "file",
|
|
3667
3668
|
filename: `${n}-output-screenshot`,
|
|
3668
3669
|
mediaType: "image/png",
|
|
3669
|
-
url: await
|
|
3670
|
+
url: await ce(e.element)
|
|
3670
3671
|
})));
|
|
3671
3672
|
} catch (e) {
|
|
3672
3673
|
return r.error("Error downloading cell output images:", e), [];
|
|
3673
3674
|
}
|
|
3674
3675
|
}
|
|
3675
3676
|
function co(e) {
|
|
3676
|
-
if (
|
|
3677
|
-
let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r =
|
|
3677
|
+
if (S(e)) return null;
|
|
3678
|
+
let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r = Be(e), i, a = !1;
|
|
3678
3679
|
return n === "media" && (typeof e.data == "string" && e.data.startsWith("data:") || typeof e.data == "string" && e.data.startsWith("http") ? i = e.data : a = !0), {
|
|
3679
3680
|
processedContent: r,
|
|
3680
3681
|
imageUrl: i,
|
|
@@ -3684,10 +3685,10 @@ function co(e) {
|
|
|
3684
3685
|
};
|
|
3685
3686
|
}
|
|
3686
3687
|
function lo(e, t, n) {
|
|
3687
|
-
let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.indexOf(e), s =
|
|
3688
|
+
let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.indexOf(e), s = Me(a.name, o), c;
|
|
3688
3689
|
r && (c = i.consoleOutputs.map((e) => co(e)).filter((e) => e !== null));
|
|
3689
3690
|
let l, u = i.output;
|
|
3690
|
-
return u && !
|
|
3691
|
+
return u && !S(u) && (l = co(u) ?? void 0), {
|
|
3691
3692
|
cellId: e,
|
|
3692
3693
|
cellName: s,
|
|
3693
3694
|
cellCode: a.code,
|
|
@@ -3699,14 +3700,14 @@ function lo(e, t, n) {
|
|
|
3699
3700
|
//#region src/core/ai/context/providers/error.ts
|
|
3700
3701
|
function uo(e, t) {
|
|
3701
3702
|
let n = [`Code:\n${e.cellCode}`];
|
|
3702
|
-
if (e.tracebackHtml && n.push(`Traceback:\n${
|
|
3703
|
-
let r =
|
|
3703
|
+
if (e.tracebackHtml && n.push(`Traceback:\n${Oe(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => je(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
|
|
3704
|
+
let r = le(e.cellId, t);
|
|
3704
3705
|
r && n.push(`Database schema:\n${r}`);
|
|
3705
3706
|
}
|
|
3706
3707
|
return n.join("\n\n");
|
|
3707
3708
|
}
|
|
3708
3709
|
function fo(e, t) {
|
|
3709
|
-
return
|
|
3710
|
+
return A({
|
|
3710
3711
|
type: "error",
|
|
3711
3712
|
data: {
|
|
3712
3713
|
name: e.cellName || `Cell ${e.cellId}`,
|
|
@@ -3716,12 +3717,12 @@ function fo(e, t) {
|
|
|
3716
3717
|
});
|
|
3717
3718
|
}
|
|
3718
3719
|
function po(e) {
|
|
3719
|
-
return e.errorData.length === 1 ?
|
|
3720
|
+
return e.errorData.length === 1 ? Ne(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? Oe(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
|
|
3720
3721
|
}
|
|
3721
3722
|
function mo(e) {
|
|
3722
3723
|
return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
|
|
3723
3724
|
}
|
|
3724
|
-
var ho = new
|
|
3725
|
+
var ho = new re("error", "errors"), go = class extends O {
|
|
3725
3726
|
title = "Errors";
|
|
3726
3727
|
mentionPrefix = "@";
|
|
3727
3728
|
contextType = "error";
|
|
@@ -3730,7 +3731,7 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
3730
3731
|
super(), this.store = e;
|
|
3731
3732
|
}
|
|
3732
3733
|
getItems() {
|
|
3733
|
-
let e =
|
|
3734
|
+
let e = Ae(this.store);
|
|
3734
3735
|
if (e.length === 0) return [];
|
|
3735
3736
|
let t = [{
|
|
3736
3737
|
uri: this.asURI("all"),
|
|
@@ -3763,7 +3764,7 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
3763
3764
|
detail: `${t} ${ho.pluralize(t)}`,
|
|
3764
3765
|
type: "error",
|
|
3765
3766
|
apply: "@error://all",
|
|
3766
|
-
section:
|
|
3767
|
+
section: j.ERROR,
|
|
3767
3768
|
info: () => {
|
|
3768
3769
|
let e = document.createElement("div");
|
|
3769
3770
|
e.classList.add("mo-cm-tooltip", "docs-documentation", "min-w-[200px]", "flex", "flex-col", "gap-1", "p-2");
|
|
@@ -3783,24 +3784,24 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
3783
3784
|
detail: po(t),
|
|
3784
3785
|
type: "error"
|
|
3785
3786
|
}),
|
|
3786
|
-
section:
|
|
3787
|
+
section: j.ERROR
|
|
3787
3788
|
};
|
|
3788
3789
|
}
|
|
3789
3790
|
return {
|
|
3790
3791
|
label: "Error",
|
|
3791
3792
|
displayLabel: "Error",
|
|
3792
|
-
section:
|
|
3793
|
+
section: j.ERROR
|
|
3793
3794
|
};
|
|
3794
3795
|
}
|
|
3795
3796
|
formatContext(e) {
|
|
3796
3797
|
return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => fo(e, this.store)).join("\n\n");
|
|
3797
3798
|
}
|
|
3798
|
-
}, _o =
|
|
3799
|
+
}, _o = d(), vo = {
|
|
3799
3800
|
maxDepth: 3,
|
|
3800
3801
|
maxResults: 20,
|
|
3801
3802
|
defaultResultsLimit: 5,
|
|
3802
3803
|
includeDirectories: !1
|
|
3803
|
-
}, yo = class extends
|
|
3804
|
+
}, yo = class extends O {
|
|
3804
3805
|
title = "Files";
|
|
3805
3806
|
mentionPrefix = "#";
|
|
3806
3807
|
contextType = "file";
|
|
@@ -3902,8 +3903,8 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
3902
3903
|
return {
|
|
3903
3904
|
...this.createBasicCompletion(e),
|
|
3904
3905
|
type: "file",
|
|
3905
|
-
section:
|
|
3906
|
-
boost: t.isDirectory ?
|
|
3906
|
+
section: j.FILE,
|
|
3907
|
+
boost: t.isDirectory ? T.MEDIUM : T.LOW,
|
|
3907
3908
|
detail: t.path,
|
|
3908
3909
|
displayLabel: `${i} ${n}`,
|
|
3909
3910
|
apply: async (e, i, a, o) => {
|
|
@@ -3917,7 +3918,7 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
3917
3918
|
description: e.message
|
|
3918
3919
|
}), null));
|
|
3919
3920
|
if (!l) return;
|
|
3920
|
-
let u = l.mimeType || "text/plain", d =
|
|
3921
|
+
let u = l.mimeType || "text/plain", d = Ve({
|
|
3921
3922
|
contents: l.contents ?? "",
|
|
3922
3923
|
mimeType: u,
|
|
3923
3924
|
isBase64: l.isBase64 ?? !1
|
|
@@ -3926,7 +3927,7 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
3926
3927
|
from: a,
|
|
3927
3928
|
to: o,
|
|
3928
3929
|
insert: ""
|
|
3929
|
-
} }),
|
|
3930
|
+
} }), Mt(e);
|
|
3930
3931
|
},
|
|
3931
3932
|
info: () => {
|
|
3932
3933
|
let e = document.createElement("div");
|
|
@@ -3940,7 +3941,7 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
3940
3941
|
}
|
|
3941
3942
|
formatContext(e) {
|
|
3942
3943
|
let { data: t, name: n } = e;
|
|
3943
|
-
return
|
|
3944
|
+
return A({
|
|
3944
3945
|
type: this.contextType,
|
|
3945
3946
|
data: {
|
|
3946
3947
|
name: n,
|
|
@@ -3950,7 +3951,7 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
3950
3951
|
details: t.isDirectory ? "Directory containing files and subdirectories" : "File"
|
|
3951
3952
|
});
|
|
3952
3953
|
}
|
|
3953
|
-
}, bo = class extends
|
|
3954
|
+
}, bo = class extends O {
|
|
3954
3955
|
title = "Tables";
|
|
3955
3956
|
mentionPrefix = "@";
|
|
3956
3957
|
contextType = "data";
|
|
@@ -3980,7 +3981,7 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
3980
3981
|
l += `${t}\n`;
|
|
3981
3982
|
}
|
|
3982
3983
|
}
|
|
3983
|
-
return
|
|
3984
|
+
return A({
|
|
3984
3985
|
type: this.contextType,
|
|
3985
3986
|
data: {
|
|
3986
3987
|
name: o,
|
|
@@ -3995,12 +3996,12 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
3995
3996
|
label: `@${t}`,
|
|
3996
3997
|
displayLabel: t,
|
|
3997
3998
|
detail: n.source === "memory" ? "in-memory" : n.source,
|
|
3998
|
-
boost: n.source_type === "local" ?
|
|
3999
|
+
boost: n.source_type === "local" ? T.LOCAL_TABLE : T.REMOTE_TABLE,
|
|
3999
4000
|
type: ue(n),
|
|
4000
4001
|
apply: `@${t}`,
|
|
4001
4002
|
section: {
|
|
4002
4003
|
name: ue(n) === "dataframe" ? "Dataframe" : "Table",
|
|
4003
|
-
rank:
|
|
4004
|
+
rank: j.TABLE.rank
|
|
4004
4005
|
},
|
|
4005
4006
|
info: () => this.createTableInfoElement(t, n)
|
|
4006
4007
|
};
|
|
@@ -4058,7 +4059,7 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
4058
4059
|
return e.classList.add("text-xs", "px-1.5", "py-0.5", "rounded-full", "font-medium", ...t.split(" ")), e;
|
|
4059
4060
|
}
|
|
4060
4061
|
}
|
|
4061
|
-
}, xo = class extends
|
|
4062
|
+
}, xo = class extends O {
|
|
4062
4063
|
title = "Variables";
|
|
4063
4064
|
mentionPrefix = "@";
|
|
4064
4065
|
contextType = "variable";
|
|
@@ -4085,13 +4086,13 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
4085
4086
|
displayLabel: n.name,
|
|
4086
4087
|
detail: n.dataType ?? "",
|
|
4087
4088
|
type: this.contextType,
|
|
4088
|
-
section:
|
|
4089
|
-
info: () =>
|
|
4089
|
+
section: j.VARIABLE,
|
|
4090
|
+
info: () => se(n)
|
|
4090
4091
|
};
|
|
4091
4092
|
}
|
|
4092
4093
|
formatContext(e) {
|
|
4093
4094
|
let { data: t } = e, { variable: n } = t;
|
|
4094
|
-
return
|
|
4095
|
+
return A({
|
|
4095
4096
|
type: this.contextType,
|
|
4096
4097
|
data: {
|
|
4097
4098
|
name: n.name,
|
|
@@ -4104,11 +4105,11 @@ var ho = new _e("error", "errors"), go = class extends w {
|
|
|
4104
4105
|
//#endregion
|
|
4105
4106
|
//#region src/core/ai/context/context.ts
|
|
4106
4107
|
function So(e) {
|
|
4107
|
-
let t = e.get(
|
|
4108
|
-
return new
|
|
4108
|
+
let t = e.get(te), n = e.get(w), r = e.get(x);
|
|
4109
|
+
return new E().register(new bo(n)).register(new xo(r, n)).register(new go(e)).register(new oo(e)).register(new k(t.connectionsMap, n));
|
|
4109
4110
|
}
|
|
4110
4111
|
function Co() {
|
|
4111
|
-
return new yo(
|
|
4112
|
+
return new yo(Ee());
|
|
4112
4113
|
}
|
|
4113
4114
|
//#endregion
|
|
4114
4115
|
//#region src/components/editor/ai/completion-utils.ts
|
|
@@ -4128,7 +4129,7 @@ async function To(e) {
|
|
|
4128
4129
|
type: "file",
|
|
4129
4130
|
mediaType: e.type,
|
|
4130
4131
|
filename: e.name,
|
|
4131
|
-
url: await
|
|
4132
|
+
url: await ze(e, "dataUrl")
|
|
4132
4133
|
})));
|
|
4133
4134
|
}
|
|
4134
4135
|
function Eo(e) {
|
|
@@ -4140,7 +4141,7 @@ function Eo(e) {
|
|
|
4140
4141
|
//#endregion
|
|
4141
4142
|
//#region src/components/chat/chat-components.tsx
|
|
4142
4143
|
var Do = (e) => {
|
|
4143
|
-
let t = (0,
|
|
4144
|
+
let t = (0, N.c)(6), { attachment: n } = e;
|
|
4144
4145
|
if (n.mediaType?.startsWith("image/")) {
|
|
4145
4146
|
let e = n.filename || "Attachment", r;
|
|
4146
4147
|
return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, J.jsx)("img", {
|
|
@@ -4150,14 +4151,14 @@ var Do = (e) => {
|
|
|
4150
4151
|
}), t[0] = n.url, t[1] = e, t[2] = r) : r = t[2], r;
|
|
4151
4152
|
}
|
|
4152
4153
|
let r;
|
|
4153
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, J.jsx)(
|
|
4154
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, J.jsx)(Le, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
|
|
4154
4155
|
let i = n.filename || "Attachment", a;
|
|
4155
4156
|
return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4156
4157
|
className: "flex flex-row gap-1 items-center text-xs",
|
|
4157
4158
|
children: [r, i]
|
|
4158
4159
|
}), t[4] = i, t[5] = a), a;
|
|
4159
4160
|
}, Oo = (e) => {
|
|
4160
|
-
let t = (0,
|
|
4161
|
+
let t = (0, N.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
|
|
4161
4162
|
t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, J.jsx)("span", {
|
|
4162
4163
|
className: "truncate font-medium",
|
|
4163
4164
|
children: r
|
|
@@ -4178,7 +4179,7 @@ var Do = (e) => {
|
|
|
4178
4179
|
s
|
|
4179
4180
|
] }), t[4] = n, t[5] = o, t[6] = s, t[7] = c) : c = t[7];
|
|
4180
4181
|
let l = c;
|
|
4181
|
-
if (a &&
|
|
4182
|
+
if (a && Ce(a)) {
|
|
4182
4183
|
let e = i ?? r, n;
|
|
4183
4184
|
return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, J.jsx)("a", {
|
|
4184
4185
|
href: a,
|
|
@@ -4196,12 +4197,12 @@ var Do = (e) => {
|
|
|
4196
4197
|
children: l
|
|
4197
4198
|
}), t[12] = l, t[13] = u, t[14] = d) : d = t[14], d;
|
|
4198
4199
|
}, ko = (e) => {
|
|
4199
|
-
let t = (0,
|
|
4200
|
+
let t = (0, N.c)(13), { reasoning: n, index: r, isStreaming: i } = e, a = r === void 0 ? 0 : r, o = i !== void 0 && i, [s, c] = q.useState("");
|
|
4200
4201
|
if (!n && !o) return null;
|
|
4201
4202
|
let l = o ? "reasoning" : s, u;
|
|
4202
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)(
|
|
4203
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)(zt, { className: "h-3 w-3" }), t[0] = u) : u = t[0];
|
|
4203
4204
|
let d = o ? "Thinking" : "View reasoning", f = n.length > 0 && ` (${n.length} chars)`, p;
|
|
4204
|
-
t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, J.jsx)(
|
|
4205
|
+
t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, J.jsx)(C, {
|
|
4205
4206
|
className: "text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",
|
|
4206
4207
|
children: /* @__PURE__ */ (0, J.jsxs)("span", {
|
|
4207
4208
|
className: "flex items-center gap-2",
|
|
@@ -4213,24 +4214,24 @@ var Do = (e) => {
|
|
|
4213
4214
|
})
|
|
4214
4215
|
}), t[1] = d, t[2] = f, t[3] = p) : p = t[3];
|
|
4215
4216
|
let m;
|
|
4216
|
-
t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, J.jsx)(
|
|
4217
|
+
t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, J.jsx)(de, {
|
|
4217
4218
|
className: "pb-2 px-2",
|
|
4218
4219
|
children: /* @__PURE__ */ (0, J.jsx)("div", {
|
|
4219
4220
|
className: "bg-muted/30 border border-muted/50 rounded-md p-3 italic text-muted-foreground/90 relative",
|
|
4220
4221
|
children: /* @__PURE__ */ (0, J.jsx)("div", {
|
|
4221
4222
|
className: "pr-6",
|
|
4222
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
4223
|
+
children: /* @__PURE__ */ (0, J.jsx)(oe, { content: n })
|
|
4223
4224
|
})
|
|
4224
4225
|
})
|
|
4225
4226
|
}), t[4] = n, t[5] = m);
|
|
4226
4227
|
let h;
|
|
4227
|
-
t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, J.jsxs)(
|
|
4228
|
+
t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, J.jsxs)(fe, {
|
|
4228
4229
|
value: "reasoning",
|
|
4229
4230
|
className: "border-0",
|
|
4230
4231
|
children: [p, m]
|
|
4231
4232
|
}), t[6] = p, t[7] = m, t[8] = h) : h = t[8];
|
|
4232
4233
|
let g;
|
|
4233
|
-
return t[9] !== a || t[10] !== l || t[11] !== h ? (g = /* @__PURE__ */ (0, J.jsx)(
|
|
4234
|
+
return t[9] !== a || t[10] !== l || t[11] !== h ? (g = /* @__PURE__ */ (0, J.jsx)(b, {
|
|
4234
4235
|
type: "single",
|
|
4235
4236
|
collapsible: !0,
|
|
4236
4237
|
className: "w-full mb-2",
|
|
@@ -4247,7 +4248,7 @@ function Ao(e) {
|
|
|
4247
4248
|
//#endregion
|
|
4248
4249
|
//#region src/components/chat/tool-call/tool-args.tsx
|
|
4249
4250
|
var jo = (e) => {
|
|
4250
|
-
let t = (0,
|
|
4251
|
+
let t = (0, N.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
|
|
4251
4252
|
if (n == null) return null;
|
|
4252
4253
|
let a;
|
|
4253
4254
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, J.jsx)("h3", {
|
|
@@ -4267,12 +4268,12 @@ var jo = (e) => {
|
|
|
4267
4268
|
children: [a, s]
|
|
4268
4269
|
}), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4269
4270
|
}, Mo = (e) => {
|
|
4270
|
-
let t = (0,
|
|
4271
|
+
let t = (0, N.c)(27), { toolName: n, input: r, approval: o, onApprove: s, className: c } = e, l;
|
|
4271
4272
|
t[0] === c ? l = t[1] : (l = i("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
|
|
4272
4273
|
let u;
|
|
4273
4274
|
t[2] === n ? u = t[3] : (u = Ao(n), t[2] = n, t[3] = u);
|
|
4274
4275
|
let d = `Approval required for ${u}`, f;
|
|
4275
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(
|
|
4276
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(Kt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
|
|
4276
4277
|
let p;
|
|
4277
4278
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)("span", {
|
|
4278
4279
|
className: "font-semibold",
|
|
@@ -4333,7 +4334,7 @@ var jo = (e) => {
|
|
|
4333
4334
|
]
|
|
4334
4335
|
}), t[21] = l, t[22] = y, t[23] = d, t[24] = h, t[25] = g, t[26] = b) : b = t[26], b;
|
|
4335
4336
|
}, No = (e) => {
|
|
4336
|
-
let t = (0,
|
|
4337
|
+
let t = (0, N.c)(28), { toolName: n, input: r, errorText: a, isLive: o, className: s } = e, [c, l] = q.useState(o), u = q.useRef(o), d, f;
|
|
4337
4338
|
t[0] === o ? (d = t[1], f = t[2]) : (d = () => {
|
|
4338
4339
|
u.current && !o && l(!1), u.current = o;
|
|
4339
4340
|
}, f = [o], t[0] = o, t[1] = d, t[2] = f), q.useEffect(d, f);
|
|
@@ -4342,7 +4343,7 @@ var jo = (e) => {
|
|
|
4342
4343
|
let m;
|
|
4343
4344
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = () => l(Po), t[5] = m) : m = t[5];
|
|
4344
4345
|
let h;
|
|
4345
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, J.jsx)(
|
|
4346
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, J.jsx)(y, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = h) : h = t[6];
|
|
4346
4347
|
let g;
|
|
4347
4348
|
t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, J.jsx)("span", {
|
|
4348
4349
|
className: "font-semibold",
|
|
@@ -4362,12 +4363,12 @@ var jo = (e) => {
|
|
|
4362
4363
|
})
|
|
4363
4364
|
]
|
|
4364
4365
|
}), t[10] = _, t[11] = v);
|
|
4365
|
-
let
|
|
4366
|
-
t[12] ===
|
|
4367
|
-
let x;
|
|
4368
|
-
t[14] === b ? x = t[15] : (x = /* @__PURE__ */ (0, J.jsx)(ke, { className: b }), t[14] = b, t[15] = x);
|
|
4366
|
+
let b = c && "rotate-180", x;
|
|
4367
|
+
t[12] === b ? x = t[13] : (x = i("h-3.5 w-3.5 shrink-0 transition-transform", b), t[12] = b, t[13] = x);
|
|
4369
4368
|
let S;
|
|
4370
|
-
t[
|
|
4369
|
+
t[14] === x ? S = t[15] : (S = /* @__PURE__ */ (0, J.jsx)(he, { className: x }), t[14] = x, t[15] = S);
|
|
4370
|
+
let C;
|
|
4371
|
+
t[16] !== c || t[17] !== S || t[18] !== v ? (C = /* @__PURE__ */ (0, J.jsxs)("button", {
|
|
4371
4372
|
type: "button",
|
|
4372
4373
|
onClick: m,
|
|
4373
4374
|
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",
|
|
@@ -4375,11 +4376,11 @@ var jo = (e) => {
|
|
|
4375
4376
|
children: [
|
|
4376
4377
|
h,
|
|
4377
4378
|
v,
|
|
4378
|
-
|
|
4379
|
+
S
|
|
4379
4380
|
]
|
|
4380
|
-
}), t[16] = c, t[17] =
|
|
4381
|
-
let
|
|
4382
|
-
t[20] !== a || t[21] !== r || t[22] !== c ? (
|
|
4381
|
+
}), t[16] = c, t[17] = S, t[18] = v, t[19] = C) : C = t[19];
|
|
4382
|
+
let w;
|
|
4383
|
+
t[20] !== a || t[21] !== r || t[22] !== c ? (w = c && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4383
4384
|
className: "px-3 pb-3 space-y-3 border-t border-(--red-6)/40 pt-3",
|
|
4384
4385
|
children: [/* @__PURE__ */ (0, J.jsx)(jo, { input: r }), a && /* @__PURE__ */ (0, J.jsxs)("div", { children: [/* @__PURE__ */ (0, J.jsx)("h3", {
|
|
4385
4386
|
className: "text-xs font-semibold text-(--red-11) mb-1",
|
|
@@ -4388,12 +4389,12 @@ var jo = (e) => {
|
|
|
4388
4389
|
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",
|
|
4389
4390
|
children: a
|
|
4390
4391
|
})] })]
|
|
4391
|
-
}), t[20] = a, t[21] = r, t[22] = c, t[23] =
|
|
4392
|
-
let
|
|
4393
|
-
return t[24] !==
|
|
4392
|
+
}), t[20] = a, t[21] = r, t[22] = c, t[23] = w) : w = t[23];
|
|
4393
|
+
let T;
|
|
4394
|
+
return t[24] !== C || t[25] !== w || t[26] !== p ? (T = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4394
4395
|
className: p,
|
|
4395
|
-
children: [
|
|
4396
|
-
}), t[24] =
|
|
4396
|
+
children: [C, w]
|
|
4397
|
+
}), t[24] = C, t[25] = w, t[26] = p, t[27] = T) : T = t[27], T;
|
|
4397
4398
|
};
|
|
4398
4399
|
function Po(e) {
|
|
4399
4400
|
return !e;
|
|
@@ -4401,17 +4402,17 @@ function Po(e) {
|
|
|
4401
4402
|
//#endregion
|
|
4402
4403
|
//#region src/components/chat/tool-call/tool-result.tsx
|
|
4403
4404
|
function Fo(e) {
|
|
4404
|
-
return e == null || typeof e == "object" &&
|
|
4405
|
-
}
|
|
4406
|
-
var Io =
|
|
4407
|
-
status:
|
|
4408
|
-
auth_required:
|
|
4409
|
-
action_url:
|
|
4410
|
-
next_steps:
|
|
4411
|
-
meta:
|
|
4412
|
-
message:
|
|
4405
|
+
return e == null || typeof e == "object" && qe(e);
|
|
4406
|
+
}
|
|
4407
|
+
var Io = Tt({
|
|
4408
|
+
status: gt().default("success"),
|
|
4409
|
+
auth_required: ft().default(!1),
|
|
4410
|
+
action_url: Ot().optional(),
|
|
4411
|
+
next_steps: Ot().optional(),
|
|
4412
|
+
meta: Ot().optional(),
|
|
4413
|
+
message: gt().nullish()
|
|
4413
4414
|
}), Lo = (e) => {
|
|
4414
|
-
let t = (0,
|
|
4415
|
+
let t = (0, N.c)(12), { data: n } = e, r;
|
|
4415
4416
|
if (t[0] !== n) {
|
|
4416
4417
|
let { status: e, auth_required: i, action_url: a, meta: o, next_steps: s, message: c, ...l } = n, u;
|
|
4417
4418
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)("h3", {
|
|
@@ -4439,7 +4440,7 @@ var Io = Ke({
|
|
|
4439
4440
|
let m;
|
|
4440
4441
|
t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4441
4442
|
className: "flex items-start gap-2",
|
|
4442
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
4443
|
+
children: [/* @__PURE__ */ (0, J.jsx)(pe, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, J.jsx)("div", {
|
|
4443
4444
|
className: "text-xs text-foreground",
|
|
4444
4445
|
children: c
|
|
4445
4446
|
})]
|
|
@@ -4457,7 +4458,7 @@ var Io = Ke({
|
|
|
4457
4458
|
} else r = t[1];
|
|
4458
4459
|
return r;
|
|
4459
4460
|
}, Ro = (e) => {
|
|
4460
|
-
let t = (0,
|
|
4461
|
+
let t = (0, N.c)(8), { result: n } = e, r;
|
|
4461
4462
|
t[0] === n ? r = t[1] : (r = Io.safeParse(n), t[0] = n, t[1] = r);
|
|
4462
4463
|
let i = r;
|
|
4463
4464
|
if (i.success) {
|
|
@@ -4498,30 +4499,30 @@ var Bo = {
|
|
|
4498
4499
|
"input-available",
|
|
4499
4500
|
"approval-responded"
|
|
4500
4501
|
]), Ho = (e) => {
|
|
4501
|
-
let t = (0,
|
|
4502
|
+
let t = (0, N.c)(5), { state: n, interrupted: r } = e;
|
|
4502
4503
|
if (r) {
|
|
4503
4504
|
let e;
|
|
4504
|
-
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(
|
|
4505
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Vt, { className: "h-3 w-3 text-muted-foreground" }), t[0] = e) : e = t[0], e;
|
|
4505
4506
|
}
|
|
4506
4507
|
switch (n) {
|
|
4507
4508
|
case "input-streaming":
|
|
4508
4509
|
case "input-available":
|
|
4509
4510
|
case "approval-responded": {
|
|
4510
4511
|
let e;
|
|
4511
|
-
return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(
|
|
4512
|
+
return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(m, { className: "h-3 w-3 animate-spin" }), t[1] = e) : e = t[1], e;
|
|
4512
4513
|
}
|
|
4513
4514
|
case "output-available": {
|
|
4514
4515
|
let e;
|
|
4515
|
-
return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(
|
|
4516
|
+
return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Bt, { className: "h-3 w-3 text-(--grass-11)" }), t[2] = e) : e = t[2], e;
|
|
4516
4517
|
}
|
|
4517
4518
|
case "output-denied": {
|
|
4518
4519
|
let e;
|
|
4519
|
-
return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(
|
|
4520
|
+
return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Rt, { className: "h-3 w-3 text-muted-foreground" }), t[3] = e) : e = t[3], e;
|
|
4520
4521
|
}
|
|
4521
4522
|
default: {
|
|
4522
|
-
|
|
4523
|
+
He(n);
|
|
4523
4524
|
let e;
|
|
4524
|
-
return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(
|
|
4525
|
+
return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(ee, { className: "h-3 w-3" }), t[4] = e) : e = t[4], e;
|
|
4525
4526
|
}
|
|
4526
4527
|
}
|
|
4527
4528
|
};
|
|
@@ -4532,11 +4533,11 @@ function Uo(e) {
|
|
|
4532
4533
|
case "input-streaming":
|
|
4533
4534
|
case "input-available":
|
|
4534
4535
|
case "approval-responded": return "";
|
|
4535
|
-
default: return
|
|
4536
|
+
default: return He(e), "";
|
|
4536
4537
|
}
|
|
4537
4538
|
}
|
|
4538
4539
|
var Wo = (e) => {
|
|
4539
|
-
let t = (0,
|
|
4540
|
+
let t = (0, N.c)(34), { toolName: n, state: r, input: a, result: o, approval: s, index: c, className: l, isActive: u } = e, d = c === void 0 ? 0 : c, f = u === void 0 || u, p;
|
|
4540
4541
|
t[0] !== f || t[1] !== r ? (p = !f && Vo.has(r), t[0] = f, t[1] = r, t[2] = p) : p = t[2];
|
|
4541
4542
|
let m = p, h = `tool-${d}`, g;
|
|
4542
4543
|
t[3] === l ? g = t[4] : (g = i("w-full", l), t[3] = l, t[4] = g);
|
|
@@ -4547,30 +4548,30 @@ var Wo = (e) => {
|
|
|
4547
4548
|
state: r,
|
|
4548
4549
|
interrupted: m
|
|
4549
4550
|
}), t[8] = m, t[9] = r, t[10] = v) : v = t[10];
|
|
4550
|
-
let
|
|
4551
|
-
t[11] === n ?
|
|
4552
|
-
let
|
|
4553
|
-
t[13] ===
|
|
4551
|
+
let y = m ? "Interrupted" : Bo[r], x;
|
|
4552
|
+
t[11] === n ? x = t[12] : (x = Ao(n), t[11] = n, t[12] = x);
|
|
4553
|
+
let S;
|
|
4554
|
+
t[13] === x ? S = t[14] : (S = /* @__PURE__ */ (0, J.jsx)("code", {
|
|
4554
4555
|
className: "font-mono text-xs",
|
|
4555
|
-
children:
|
|
4556
|
-
}), t[13] =
|
|
4556
|
+
children: x
|
|
4557
|
+
}), t[13] = x, t[14] = S);
|
|
4557
4558
|
let w;
|
|
4558
|
-
t[15] !==
|
|
4559
|
+
t[15] !== S || t[16] !== v || t[17] !== y ? (w = /* @__PURE__ */ (0, J.jsxs)("span", {
|
|
4559
4560
|
className: "flex items-center gap-1",
|
|
4560
4561
|
children: [
|
|
4561
4562
|
v,
|
|
4562
|
-
|
|
4563
|
+
y,
|
|
4563
4564
|
":",
|
|
4564
|
-
|
|
4565
|
+
S
|
|
4565
4566
|
]
|
|
4566
|
-
}), t[15] =
|
|
4567
|
+
}), t[15] = S, t[16] = v, t[17] = y, t[18] = w) : w = t[18];
|
|
4567
4568
|
let T;
|
|
4568
|
-
t[19] !== w || t[20] !== _ ? (T = /* @__PURE__ */ (0, J.jsx)(
|
|
4569
|
+
t[19] !== w || t[20] !== _ ? (T = /* @__PURE__ */ (0, J.jsx)(C, {
|
|
4569
4570
|
className: _,
|
|
4570
4571
|
children: w
|
|
4571
4572
|
}), t[19] = w, t[20] = _, t[21] = T) : T = t[21];
|
|
4572
4573
|
let E;
|
|
4573
|
-
t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, J.jsx)(
|
|
4574
|
+
t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, J.jsx)(de, {
|
|
4574
4575
|
className: "py-2 px-2",
|
|
4575
4576
|
children: /* @__PURE__ */ (0, J.jsx)(Go, {
|
|
4576
4577
|
state: r,
|
|
@@ -4580,20 +4581,20 @@ var Wo = (e) => {
|
|
|
4580
4581
|
})
|
|
4581
4582
|
}), t[22] = s, t[23] = a, t[24] = o, t[25] = r, t[26] = E) : E = t[26];
|
|
4582
4583
|
let D;
|
|
4583
|
-
t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, J.jsxs)(
|
|
4584
|
+
t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, J.jsxs)(fe, {
|
|
4584
4585
|
value: "tool-call",
|
|
4585
4586
|
className: "border-0",
|
|
4586
4587
|
children: [T, E]
|
|
4587
4588
|
}), t[27] = T, t[28] = E, t[29] = D) : D = t[29];
|
|
4588
4589
|
let O;
|
|
4589
|
-
return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, J.jsx)(
|
|
4590
|
+
return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, J.jsx)(b, {
|
|
4590
4591
|
type: "single",
|
|
4591
4592
|
collapsible: !0,
|
|
4592
4593
|
className: g,
|
|
4593
4594
|
children: D
|
|
4594
4595
|
}, h), t[30] = D, t[31] = h, t[32] = g, t[33] = O) : O = t[33], O;
|
|
4595
4596
|
}, Go = (e) => {
|
|
4596
|
-
let t = (0,
|
|
4597
|
+
let t = (0, N.c)(16), { state: n, input: r, result: i, approval: a } = e;
|
|
4597
4598
|
switch (n) {
|
|
4598
4599
|
case "input-streaming":
|
|
4599
4600
|
case "input-available":
|
|
@@ -4626,10 +4627,10 @@ var Wo = (e) => {
|
|
|
4626
4627
|
children: [e, i]
|
|
4627
4628
|
}), t[13] = e, t[14] = i, t[15] = o) : o = t[15], o;
|
|
4628
4629
|
}
|
|
4629
|
-
default: return
|
|
4630
|
+
default: return He(n), null;
|
|
4630
4631
|
}
|
|
4631
4632
|
}, Ko = (e) => {
|
|
4632
|
-
let t = (0,
|
|
4633
|
+
let t = (0, N.c)(27), { toolName: n, state: r, result: i, errorText: a, input: o, approval: s, onApprove: c, index: l, className: u, isLive: d, isActive: f } = e, p = d === void 0 || d, m = f === void 0 || f;
|
|
4633
4634
|
switch (r) {
|
|
4634
4635
|
case "approval-requested": {
|
|
4635
4636
|
if (s != null && c != null) {
|
|
@@ -4679,7 +4680,7 @@ var Wo = (e) => {
|
|
|
4679
4680
|
isActive: m
|
|
4680
4681
|
}), t[18] = s, t[19] = u, t[20] = l, t[21] = o, t[22] = m, t[23] = i, t[24] = r, t[25] = n, t[26] = e) : e = t[26], e;
|
|
4681
4682
|
}
|
|
4682
|
-
default: return
|
|
4683
|
+
default: return He(r), null;
|
|
4683
4684
|
}
|
|
4684
4685
|
}, qo = ({ message: e, isStreamingReasoning: t, isLast: n, isActive: i, addToolApprovalResponse: a }) => {
|
|
4685
4686
|
return /* @__PURE__ */ (0, J.jsx)(J.Fragment, { children: e.parts.map((e, t) => o(e, t)) });
|
|
@@ -4699,7 +4700,7 @@ var Wo = (e) => {
|
|
|
4699
4700
|
}, s);
|
|
4700
4701
|
if (Yo(o)) return r.debug("Found data part", o), null;
|
|
4701
4702
|
switch (o.type) {
|
|
4702
|
-
case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, J.jsx)(q.Fragment, { children: f({ html: o.text }) }, s) : /* @__PURE__ */ (0, J.jsx)(
|
|
4703
|
+
case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, J.jsx)(q.Fragment, { children: f({ html: o.text }) }, s) : /* @__PURE__ */ (0, J.jsx)(oe, { content: o.text }, s);
|
|
4703
4704
|
case "reasoning": return /* @__PURE__ */ (0, J.jsx)(ko, {
|
|
4704
4705
|
reasoning: o.text,
|
|
4705
4706
|
index: s,
|
|
@@ -4723,12 +4724,12 @@ var Wo = (e) => {
|
|
|
4723
4724
|
isActive: i
|
|
4724
4725
|
}, s);
|
|
4725
4726
|
case "source-document": return /* @__PURE__ */ (0, J.jsx)(Oo, {
|
|
4726
|
-
icon: /* @__PURE__ */ (0, J.jsx)(
|
|
4727
|
+
icon: /* @__PURE__ */ (0, J.jsx)(u, { className: "h-3 w-3 shrink-0" }),
|
|
4727
4728
|
title: o.title,
|
|
4728
4729
|
subtitle: o.filename
|
|
4729
4730
|
}, s);
|
|
4730
4731
|
case "source-url": return /* @__PURE__ */ (0, J.jsx)(Oo, {
|
|
4731
|
-
icon: /* @__PURE__ */ (0, J.jsx)(
|
|
4732
|
+
icon: /* @__PURE__ */ (0, J.jsx)(Fe, { className: "h-3 w-3 shrink-0" }),
|
|
4732
4733
|
title: o.title ?? o.url,
|
|
4733
4734
|
subtitle: o.title ? o.url : void 0,
|
|
4734
4735
|
href: o.url
|
|
@@ -4738,7 +4739,7 @@ var Wo = (e) => {
|
|
|
4738
4739
|
children: o.kind
|
|
4739
4740
|
}, s);
|
|
4740
4741
|
case "step-start": return null;
|
|
4741
|
-
default: return
|
|
4742
|
+
default: return He(o), null;
|
|
4742
4743
|
}
|
|
4743
4744
|
}
|
|
4744
4745
|
};
|
|
@@ -4751,11 +4752,11 @@ function Yo(e) {
|
|
|
4751
4752
|
//#endregion
|
|
4752
4753
|
//#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
|
|
4753
4754
|
function Xo(e) {
|
|
4754
|
-
return
|
|
4755
|
+
return at.define({ combine: (t) => t[0] ?? e });
|
|
4755
4756
|
}
|
|
4756
4757
|
//#endregion
|
|
4757
4758
|
//#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
|
|
4758
|
-
var Zo = Xo({}), Qo =
|
|
4759
|
+
var Zo = Xo({}), Qo = et.define(), $o = et.define(), es = 50, ts = $e.define({
|
|
4759
4760
|
create() {
|
|
4760
4761
|
return {
|
|
4761
4762
|
prompts: [],
|
|
@@ -4814,7 +4815,7 @@ function is(e = {}) {
|
|
|
4814
4815
|
navigationIndex: -1,
|
|
4815
4816
|
originalText: ""
|
|
4816
4817
|
})), Zo.of(t ?? {})];
|
|
4817
|
-
return n && r.push(
|
|
4818
|
+
return n && r.push(ct.of([{
|
|
4818
4819
|
key: "ArrowUp",
|
|
4819
4820
|
run: ns
|
|
4820
4821
|
}, {
|
|
@@ -4824,7 +4825,7 @@ function is(e = {}) {
|
|
|
4824
4825
|
}
|
|
4825
4826
|
//#endregion
|
|
4826
4827
|
//#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
|
|
4827
|
-
var as =
|
|
4828
|
+
var as = et.define(), Q = $e.define({
|
|
4828
4829
|
create() {
|
|
4829
4830
|
return /* @__PURE__ */ new Map();
|
|
4830
4831
|
},
|
|
@@ -4836,7 +4837,7 @@ var as = bt.define(), Q = Dt.define({
|
|
|
4836
4837
|
}
|
|
4837
4838
|
return r;
|
|
4838
4839
|
}
|
|
4839
|
-
}), os =
|
|
4840
|
+
}), os = $e.define({
|
|
4840
4841
|
create() {
|
|
4841
4842
|
return {
|
|
4842
4843
|
onResourceClick: void 0,
|
|
@@ -4848,8 +4849,8 @@ var as = bt.define(), Q = Dt.define({
|
|
|
4848
4849
|
update(e) {
|
|
4849
4850
|
return e;
|
|
4850
4851
|
}
|
|
4851
|
-
}), ss =
|
|
4852
|
-
|
|
4852
|
+
}), ss = et.define();
|
|
4853
|
+
$e.define({
|
|
4853
4854
|
create() {
|
|
4854
4855
|
return /* @__PURE__ */ new Map();
|
|
4855
4856
|
},
|
|
@@ -4897,7 +4898,7 @@ function $(e) {
|
|
|
4897
4898
|
}
|
|
4898
4899
|
//#endregion
|
|
4899
4900
|
//#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
|
|
4900
|
-
var us = class extends
|
|
4901
|
+
var us = class extends it {
|
|
4901
4902
|
resource;
|
|
4902
4903
|
view;
|
|
4903
4904
|
constructor(e, t) {
|
|
@@ -4918,7 +4919,7 @@ var us = class extends wt {
|
|
|
4918
4919
|
e.preventDefault(), e.stopPropagation(), i(this.resource);
|
|
4919
4920
|
}), e;
|
|
4920
4921
|
}
|
|
4921
|
-
}, ds = class extends
|
|
4922
|
+
}, ds = class extends it {
|
|
4922
4923
|
uri;
|
|
4923
4924
|
view;
|
|
4924
4925
|
constructor(e, t) {
|
|
@@ -4938,12 +4939,12 @@ function fs(e) {
|
|
|
4938
4939
|
let a = e.state.doc.sliceString(r, i);
|
|
4939
4940
|
for (let i of $(a)) {
|
|
4940
4941
|
let a = r + i.index, o = i[0].slice(1), s = t.get(o);
|
|
4941
|
-
s ? n.push(
|
|
4942
|
+
s ? n.push(ut.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(ut.replace({ widget: new ds(o, e) }).range(a, a + i[0].length));
|
|
4942
4943
|
}
|
|
4943
4944
|
}
|
|
4944
|
-
return
|
|
4945
|
+
return ut.set(n);
|
|
4945
4946
|
}
|
|
4946
|
-
var ps =
|
|
4947
|
+
var ps = nt.fromClass(class {
|
|
4947
4948
|
decorations;
|
|
4948
4949
|
constructor(e) {
|
|
4949
4950
|
this.decorations = fs(e);
|
|
@@ -4983,7 +4984,7 @@ function hs(e, t, n, r = 0) {
|
|
|
4983
4984
|
return null;
|
|
4984
4985
|
}
|
|
4985
4986
|
function gs(e) {
|
|
4986
|
-
return
|
|
4987
|
+
return st((t, n) => {
|
|
4987
4988
|
let { from: r, text: i } = t.state.doc.lineAt(n), a = hs(i, n, t.state.field(Q), r);
|
|
4988
4989
|
return a ? {
|
|
4989
4990
|
pos: a.start,
|
|
@@ -5053,8 +5054,8 @@ function xs(e, t) {
|
|
|
5053
5054
|
}
|
|
5054
5055
|
return null;
|
|
5055
5056
|
}
|
|
5056
|
-
var Ss =
|
|
5057
|
-
let t = e.annotation(
|
|
5057
|
+
var Ss = lt.transactionFilter.of((e) => {
|
|
5058
|
+
let t = e.annotation(ot.userEvent);
|
|
5058
5059
|
if (!t) return e;
|
|
5059
5060
|
let n = e.startState.selection.main;
|
|
5060
5061
|
if (!n.empty) return e;
|
|
@@ -5236,11 +5237,11 @@ function Os(e, t) {
|
|
|
5236
5237
|
};
|
|
5237
5238
|
}
|
|
5238
5239
|
function ks(e, t = {}) {
|
|
5239
|
-
return
|
|
5240
|
+
return nt.fromClass(Os(e, t));
|
|
5240
5241
|
}
|
|
5241
5242
|
//#endregion
|
|
5242
5243
|
//#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
|
|
5243
|
-
var As =
|
|
5244
|
+
var As = rt.baseTheme({
|
|
5244
5245
|
".cm-resource-widget": {
|
|
5245
5246
|
background: "light-dark(rgba(86,156,214,0.08),rgba(86,156,214,0.18))",
|
|
5246
5247
|
borderRadius: "4px",
|
|
@@ -5273,10 +5274,10 @@ function Fs(e) {
|
|
|
5273
5274
|
let { language: t, store: n, onAddFiles: i } = e, a = () => Ps(n);
|
|
5274
5275
|
return [
|
|
5275
5276
|
t.data.of({ autocomplete: cs(async () => a(), (e) => e.type === js ? Ns : So(n).getProvider(e.type)?.formatCompletion(e) || {}) }),
|
|
5276
|
-
|
|
5277
|
+
tt.high(ct.of([{
|
|
5277
5278
|
key: "Tab",
|
|
5278
5279
|
preventDefault: !0,
|
|
5279
|
-
run: (e) =>
|
|
5280
|
+
run: (e) => jt(e)
|
|
5280
5281
|
}])),
|
|
5281
5282
|
_o.of({ addAttachment: (e) => i?.([e]) }),
|
|
5282
5283
|
...i ? [t.data.of({ autocomplete: Co().createCompletionSource() })] : [],
|
|
@@ -5303,14 +5304,14 @@ function Is(e) {
|
|
|
5303
5304
|
let t = document.createElement("div");
|
|
5304
5305
|
return t.textContent = e, { dom: t };
|
|
5305
5306
|
}
|
|
5306
|
-
|
|
5307
|
-
var Ls = "marimo:ai-prompt-history", Rs = new
|
|
5308
|
-
let t = (0,
|
|
5307
|
+
Ze("marimo:ai-language", "python", D);
|
|
5308
|
+
var Ls = "marimo:ai-prompt-history", Rs = new Te(xt(gt()), () => []), zs = (e) => {
|
|
5309
|
+
let t = (0, N.c)(35), { value: n, placeholder: r, inputRef: a, className: o, onChange: s, onSubmit: c, onKeyDown: l, onClose: u, onAddFiles: d, additionalCompletions: f, maxHeight: p } = e, m = c, h = u, g = Ye(), { theme: _ } = Je(), v;
|
|
5309
5310
|
t[0] === f ? v = t[1] : (v = (e) => f ? wo([f.triggerCompletionRegex], f.completions)(e) : null, t[0] = f, t[1] = v);
|
|
5310
|
-
let y =
|
|
5311
|
+
let y = Xe(v), b, x, S, C;
|
|
5311
5312
|
if (t[2] !== y || t[3] !== d || t[4] !== g) {
|
|
5312
|
-
let e =
|
|
5313
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (b =
|
|
5313
|
+
let e = Pt();
|
|
5314
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (b = Nt({}), t[9] = b) : b = t[9], x = e, S = Fs({
|
|
5314
5315
|
language: e.language,
|
|
5315
5316
|
store: g,
|
|
5316
5317
|
onAddFiles: d
|
|
@@ -5322,9 +5323,9 @@ var Ls = "marimo:ai-prompt-history", Rs = new xe(Je(Ze()), () => []), zs = (e) =
|
|
|
5322
5323
|
save: Vs
|
|
5323
5324
|
} }), t[10] = w) : w = t[10];
|
|
5324
5325
|
let T;
|
|
5325
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (T =
|
|
5326
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (T = Ft(), t[11] = T) : T = t[11];
|
|
5326
5327
|
let E;
|
|
5327
|
-
t[12] === m ? E = t[13] : (E =
|
|
5328
|
+
t[12] === m ? E = t[13] : (E = tt.highest(ct.of([{
|
|
5328
5329
|
preventDefault: !0,
|
|
5329
5330
|
stopPropagation: !0,
|
|
5330
5331
|
any: (e, t) => {
|
|
@@ -5348,7 +5349,7 @@ var Ls = "marimo:ai-prompt-history", Rs = new xe(Je(Ze()), () => []), zs = (e) =
|
|
|
5348
5349
|
}
|
|
5349
5350
|
}])), t[12] = m, t[13] = E);
|
|
5350
5351
|
let D;
|
|
5351
|
-
t[14] === h ? D = t[15] : (D =
|
|
5352
|
+
t[14] === h ? D = t[15] : (D = ct.of([{
|
|
5352
5353
|
key: "Escape",
|
|
5353
5354
|
preventDefault: !0,
|
|
5354
5355
|
stopPropagation: !0,
|
|
@@ -5361,27 +5362,27 @@ var Ls = "marimo:ai-prompt-history", Rs = new xe(Je(Ze()), () => []), zs = (e) =
|
|
|
5361
5362
|
S,
|
|
5362
5363
|
C,
|
|
5363
5364
|
w,
|
|
5364
|
-
|
|
5365
|
+
rt.lineWrapping,
|
|
5365
5366
|
T,
|
|
5366
5367
|
E,
|
|
5367
5368
|
D
|
|
5368
5369
|
], t[16] = b, t[17] = x, t[18] = S, t[19] = C, t[20] = E, t[21] = D, t[22] = O) : O = t[22];
|
|
5369
|
-
let
|
|
5370
|
-
t[23] === o ?
|
|
5370
|
+
let ee = O, k;
|
|
5371
|
+
t[23] === o ? k = t[24] : (k = i("flex-1 font-sans overflow-auto my-1", o), t[23] = o, t[24] = k);
|
|
5371
5372
|
let te = _ === "dark" ? "dark" : "light", A = r || "Generate with AI, @ to include context", ne;
|
|
5372
|
-
return t[25] !==
|
|
5373
|
+
return t[25] !== ee || t[26] !== a || t[27] !== p || t[28] !== s || t[29] !== l || t[30] !== k || t[31] !== te || t[32] !== A || t[33] !== n ? (ne = /* @__PURE__ */ (0, J.jsx)(It, {
|
|
5373
5374
|
ref: a,
|
|
5374
|
-
className:
|
|
5375
|
+
className: k,
|
|
5375
5376
|
width: "100%",
|
|
5376
5377
|
maxHeight: p,
|
|
5377
5378
|
value: n,
|
|
5378
5379
|
basicSetup: !1,
|
|
5379
|
-
extensions:
|
|
5380
|
+
extensions: ee,
|
|
5380
5381
|
onChange: s,
|
|
5381
5382
|
onKeyDown: l,
|
|
5382
5383
|
theme: te,
|
|
5383
5384
|
placeholder: A
|
|
5384
|
-
}), t[25] =
|
|
5385
|
+
}), t[25] = ee, t[26] = a, t[27] = p, t[28] = s, t[29] = l, t[30] = k, t[31] = te, t[32] = A, t[33] = n, t[34] = ne) : ne = t[34], ne;
|
|
5385
5386
|
};
|
|
5386
5387
|
function Bs() {
|
|
5387
5388
|
return Rs.get(Ls);
|
|
@@ -5391,11 +5392,11 @@ function Vs(e) {
|
|
|
5391
5392
|
}
|
|
5392
5393
|
//#endregion
|
|
5393
5394
|
//#region src/plugins/impl/chat/chat-ui.tsx
|
|
5394
|
-
var Hs =
|
|
5395
|
-
type:
|
|
5396
|
-
message_id:
|
|
5397
|
-
content:
|
|
5398
|
-
is_final:
|
|
5395
|
+
var Hs = _, Us = vt({
|
|
5396
|
+
type: yt("stream_chunk"),
|
|
5397
|
+
message_id: gt(),
|
|
5398
|
+
content: Ot().nullable().transform((e) => e),
|
|
5399
|
+
is_final: ft().optional()
|
|
5399
5400
|
});
|
|
5400
5401
|
function Ws(e, t) {
|
|
5401
5402
|
let { controllerRef: n, activeRequestIdRef: i } = t, a = n.current;
|
|
@@ -5407,7 +5408,7 @@ function Ws(e, t) {
|
|
|
5407
5408
|
}), "dropped-stale") : (e.content && a.enqueue(e.content), e.is_final ? (a.close(), n.current = null, i.current = null, "closed") : "enqueued");
|
|
5408
5409
|
}
|
|
5409
5410
|
var Gs = (e) => {
|
|
5410
|
-
let [t, o] = (0, q.useState)(""), [s, c] = (0, q.useState)(e.config), [u, d] = (0, q.useState)(e.config), [f, p] = (0, q.useState)(void 0), m = (0, q.useRef)(null),
|
|
5411
|
+
let [t, o] = (0, q.useState)(""), [s, c] = (0, q.useState)(e.config), [u, d] = (0, q.useState)(e.config), [f, p] = (0, q.useState)(void 0), m = (0, q.useRef)(null), g = (0, q.useRef)(null), _ = (0, q.useRef)(null), v = (0, q.useRef)(null);
|
|
5411
5412
|
Object.keys(e.config).some((t) => e.config[t] !== u[t]) && (c(e.config), d(e.config));
|
|
5412
5413
|
let y = (0, q.useRef)(s);
|
|
5413
5414
|
(0, q.useLayoutEffect)(() => {
|
|
@@ -5415,7 +5416,7 @@ var Gs = (e) => {
|
|
|
5415
5416
|
}, [s]);
|
|
5416
5417
|
let b = (0, q.useRef)(null), x = (0, q.useRef)(null), S = (0, q.useRef)(null), [C, w] = (0, q.useState)(null), T = () => {
|
|
5417
5418
|
S.current = null, w(null);
|
|
5418
|
-
}, { data: E } =
|
|
5419
|
+
}, { data: E } = Lt(async () => (await e.get_chat_history({})).messages, []), D = e.value.length > 0 ? e.value : E, { messages: O, sendMessage: ee, setMessages: k, status: te, stop: A, error: re, regenerate: j, clearError: ae, addToolApprovalResponse: oe } = eo({
|
|
5419
5420
|
sendAutomaticallyWhen: ({ messages: e }) => Eo(e),
|
|
5420
5421
|
transport: new Na({ fetch: async (t, n) => {
|
|
5421
5422
|
if (n === void 0) return fetch(t);
|
|
@@ -5431,7 +5432,7 @@ var Gs = (e) => {
|
|
|
5431
5432
|
let t = i.messages.map((e) => ({
|
|
5432
5433
|
...e,
|
|
5433
5434
|
content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
|
|
5434
|
-
})), n =
|
|
5435
|
+
})), n = ie();
|
|
5435
5436
|
T();
|
|
5436
5437
|
let s = new ReadableStream({
|
|
5437
5438
|
start(t) {
|
|
@@ -5467,7 +5468,7 @@ var Gs = (e) => {
|
|
|
5467
5468
|
return new Response(t, { status: 400 });
|
|
5468
5469
|
}
|
|
5469
5470
|
} }),
|
|
5470
|
-
messages:
|
|
5471
|
+
messages: D,
|
|
5471
5472
|
onFinish: ({ messages: t, isAbort: n, finishReason: i }) => {
|
|
5472
5473
|
if (p(void 0), m.current && (m.current.value = ""), r.debug("Finished streaming message:", {
|
|
5473
5474
|
finishReason: i,
|
|
@@ -5491,7 +5492,7 @@ var Gs = (e) => {
|
|
|
5491
5492
|
r.error("An error occurred:", e);
|
|
5492
5493
|
}
|
|
5493
5494
|
});
|
|
5494
|
-
n(e.host,
|
|
5495
|
+
n(e.host, Re.TYPE, (e) => {
|
|
5495
5496
|
let t = Us.safeParse(e.detail.message);
|
|
5496
5497
|
if (t.success) {
|
|
5497
5498
|
if (t.data.content && t.data.message_id === x.current) {
|
|
@@ -5504,28 +5505,28 @@ var Gs = (e) => {
|
|
|
5504
5505
|
});
|
|
5505
5506
|
}
|
|
5506
5507
|
});
|
|
5507
|
-
let se =
|
|
5508
|
-
let n =
|
|
5508
|
+
let se = te === "submitted" || te === "streaming", ce = (t) => {
|
|
5509
|
+
let n = O.findIndex((e) => e.id === t);
|
|
5509
5510
|
if (n !== -1) {
|
|
5510
|
-
let r =
|
|
5511
|
-
e.delete_chat_message({ index: n }),
|
|
5511
|
+
let r = O.filter((e) => e.id !== t);
|
|
5512
|
+
e.delete_chat_message({ index: n }), k(r), e.setValue(r), r.length === 0 && T();
|
|
5512
5513
|
}
|
|
5513
|
-
},
|
|
5514
|
+
}, le = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, ue = {
|
|
5514
5515
|
triggerCompletionRegex: /^\/(\w+)?/,
|
|
5515
5516
|
completions: e.prompts.map((e) => ({
|
|
5516
5517
|
label: `/${e}`,
|
|
5517
5518
|
displayLabel: e,
|
|
5518
5519
|
apply: e
|
|
5519
5520
|
}))
|
|
5520
|
-
},
|
|
5521
|
+
}, de = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
|
|
5521
5522
|
(0, q.useEffect)(() => {
|
|
5522
|
-
|
|
5523
|
-
top:
|
|
5523
|
+
v.current?.scrollTo({
|
|
5524
|
+
top: v.current.scrollHeight,
|
|
5524
5525
|
behavior: "smooth"
|
|
5525
5526
|
});
|
|
5526
|
-
}, [
|
|
5527
|
-
let
|
|
5528
|
-
let e =
|
|
5527
|
+
}, [O.length, v]);
|
|
5528
|
+
let fe = () => {
|
|
5529
|
+
let e = _.current?.view;
|
|
5529
5530
|
if (e) {
|
|
5530
5531
|
let t = e.state.doc.length;
|
|
5531
5532
|
e.dispatch({ changes: {
|
|
@@ -5546,21 +5547,21 @@ var Gs = (e) => {
|
|
|
5546
5547
|
"aria-label": "Reset chat",
|
|
5547
5548
|
variant: "text",
|
|
5548
5549
|
size: "icon",
|
|
5549
|
-
disabled:
|
|
5550
|
+
disabled: O.length === 0,
|
|
5550
5551
|
onClick: () => {
|
|
5551
|
-
|
|
5552
|
+
k([]), e.setValue([]), e.delete_chat_history({}), ae(), T();
|
|
5552
5553
|
},
|
|
5553
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5554
|
+
children: /* @__PURE__ */ (0, J.jsx)(Ut, { className: "h-3 w-3" })
|
|
5554
5555
|
})
|
|
5555
5556
|
}),
|
|
5556
5557
|
/* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5557
5558
|
className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
|
|
5558
|
-
ref:
|
|
5559
|
+
ref: v,
|
|
5559
5560
|
children: [
|
|
5560
|
-
|
|
5561
|
+
O.length === 0 && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5561
5562
|
className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
|
|
5562
5563
|
children: [
|
|
5563
|
-
/* @__PURE__ */ (0, J.jsx)(
|
|
5564
|
+
/* @__PURE__ */ (0, J.jsx)(zt, { className: "h-12 w-12 mb-4" }),
|
|
5564
5565
|
/* @__PURE__ */ (0, J.jsx)("h3", {
|
|
5565
5566
|
className: "text-lg font-semibold mb-2",
|
|
5566
5567
|
children: "No messages yet"
|
|
@@ -5571,15 +5572,15 @@ var Gs = (e) => {
|
|
|
5571
5572
|
})
|
|
5572
5573
|
]
|
|
5573
5574
|
}),
|
|
5574
|
-
|
|
5575
|
-
let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), r = t ===
|
|
5575
|
+
O.map((e, t) => {
|
|
5576
|
+
let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), r = t === O.length - 1;
|
|
5576
5577
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5577
5578
|
className: i("flex flex-col group gap-2", e.role === "user" ? "items-end" : "items-start"),
|
|
5578
5579
|
children: [/* @__PURE__ */ (0, J.jsx)("div", {
|
|
5579
5580
|
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)"}`,
|
|
5580
5581
|
children: qo({
|
|
5581
5582
|
message: e,
|
|
5582
|
-
isStreamingReasoning:
|
|
5583
|
+
isStreamingReasoning: te === "streaming",
|
|
5583
5584
|
isLast: r,
|
|
5584
5585
|
isActive: se,
|
|
5585
5586
|
addToolApprovalResponse: r ? oe : void 0
|
|
@@ -5595,25 +5596,25 @@ var Gs = (e) => {
|
|
|
5595
5596
|
"aria-label": "Delete message",
|
|
5596
5597
|
onClick: () => ce(e.id),
|
|
5597
5598
|
className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
|
|
5598
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5599
|
+
children: /* @__PURE__ */ (0, J.jsx)(h, { className: "h-3 w-3 text-(--red-9)" })
|
|
5599
5600
|
})]
|
|
5600
5601
|
})]
|
|
5601
5602
|
}, e.id);
|
|
5602
5603
|
}),
|
|
5603
5604
|
se && /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5604
5605
|
className: "flex items-center justify-center mb-4",
|
|
5605
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5606
|
+
children: /* @__PURE__ */ (0, J.jsx)(ne, { size: "small" })
|
|
5606
5607
|
}),
|
|
5607
|
-
|
|
5608
|
+
re && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5608
5609
|
className: "flex items-center justify-center space-x-2 mb-4",
|
|
5609
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
5610
|
+
children: [/* @__PURE__ */ (0, J.jsx)(Ke, { error: re }), /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5610
5611
|
variant: "outline",
|
|
5611
5612
|
size: "sm",
|
|
5612
|
-
onClick: () =>
|
|
5613
|
+
onClick: () => j(),
|
|
5613
5614
|
children: "Retry"
|
|
5614
5615
|
})]
|
|
5615
5616
|
}),
|
|
5616
|
-
C && !se && !
|
|
5617
|
+
C && !se && !re && /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5617
5618
|
className: "flex justify-center py-2",
|
|
5618
5619
|
children: /* @__PURE__ */ (0, J.jsx)("span", {
|
|
5619
5620
|
className: "text-xs text-muted-foreground",
|
|
@@ -5632,9 +5633,9 @@ var Gs = (e) => {
|
|
|
5632
5633
|
type: "text",
|
|
5633
5634
|
text: t
|
|
5634
5635
|
}, ...r ?? []]
|
|
5635
|
-
}),
|
|
5636
|
+
}), fe();
|
|
5636
5637
|
},
|
|
5637
|
-
ref:
|
|
5638
|
+
ref: g,
|
|
5638
5639
|
inert: e.disabled || void 0,
|
|
5639
5640
|
className: i("flex w-full border-t border-(--slate-6) px-2 py-1 items-center", e.disabled && "opacity-50 cursor-not-allowed"),
|
|
5640
5641
|
children: [
|
|
@@ -5646,23 +5647,23 @@ var Gs = (e) => {
|
|
|
5646
5647
|
prompts: e.prompts,
|
|
5647
5648
|
onSelect: (e) => {
|
|
5648
5649
|
o(e), requestAnimationFrame(() => {
|
|
5649
|
-
let e =
|
|
5650
|
-
e?.focus(),
|
|
5650
|
+
let e = _.current?.view;
|
|
5651
|
+
e?.focus(), De(e);
|
|
5651
5652
|
});
|
|
5652
5653
|
}
|
|
5653
5654
|
}),
|
|
5654
5655
|
/* @__PURE__ */ (0, J.jsx)(zs, {
|
|
5655
5656
|
className: "rounded-sm mr-2",
|
|
5656
|
-
placeholder:
|
|
5657
|
+
placeholder: de,
|
|
5657
5658
|
value: t,
|
|
5658
|
-
inputRef:
|
|
5659
|
+
inputRef: _,
|
|
5659
5660
|
maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
|
|
5660
5661
|
onChange: o,
|
|
5661
5662
|
onSubmit: (e, t) => {
|
|
5662
|
-
t.trim() &&
|
|
5663
|
+
t.trim() && g.current?.requestSubmit();
|
|
5663
5664
|
},
|
|
5664
5665
|
onClose: () => {},
|
|
5665
|
-
additionalCompletions:
|
|
5666
|
+
additionalCompletions: ue
|
|
5666
5667
|
}),
|
|
5667
5668
|
f && f.length === 1 && /* @__PURE__ */ (0, J.jsx)("span", {
|
|
5668
5669
|
title: f[0].name,
|
|
@@ -5681,14 +5682,14 @@ var Gs = (e) => {
|
|
|
5681
5682
|
onClick: () => {
|
|
5682
5683
|
p(void 0), m.current && (m.current.value = "");
|
|
5683
5684
|
},
|
|
5684
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5685
|
+
children: /* @__PURE__ */ (0, J.jsx)(Ue, { className: "size-3" })
|
|
5685
5686
|
}),
|
|
5686
|
-
|
|
5687
|
+
le && /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)(a, {
|
|
5687
5688
|
type: "button",
|
|
5688
5689
|
variant: "text",
|
|
5689
5690
|
size: "sm",
|
|
5690
5691
|
onClick: () => m.current?.click(),
|
|
5691
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5692
|
+
children: /* @__PURE__ */ (0, J.jsx)(Ht, { className: "h-4" })
|
|
5692
5693
|
}), /* @__PURE__ */ (0, J.jsx)("input", {
|
|
5693
5694
|
type: "file",
|
|
5694
5695
|
ref: m,
|
|
@@ -5699,15 +5700,15 @@ var Gs = (e) => {
|
|
|
5699
5700
|
e.target.files && p([...e.target.files]);
|
|
5700
5701
|
}
|
|
5701
5702
|
})] }),
|
|
5702
|
-
se ? /* @__PURE__ */ (0, J.jsx)(
|
|
5703
|
+
se ? /* @__PURE__ */ (0, J.jsx)(me, {
|
|
5703
5704
|
content: "Stop generating",
|
|
5704
5705
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5705
5706
|
type: "button",
|
|
5706
5707
|
variant: "link",
|
|
5707
5708
|
size: "xs",
|
|
5708
|
-
onClick: () =>
|
|
5709
|
+
onClick: () => A(),
|
|
5709
5710
|
className: "text-(--red-9) hover:text-(--red-11)",
|
|
5710
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5711
|
+
children: /* @__PURE__ */ (0, J.jsx)(Ie, { className: "h-4 w-4 fill-current" })
|
|
5711
5712
|
})
|
|
5712
5713
|
}) : /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5713
5714
|
type: "submit",
|
|
@@ -5716,7 +5717,7 @@ var Gs = (e) => {
|
|
|
5716
5717
|
size: "xs",
|
|
5717
5718
|
className: "text-(--slate-11)",
|
|
5718
5719
|
"aria-label": "Send message",
|
|
5719
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5720
|
+
children: /* @__PURE__ */ (0, J.jsx)(Wt, { className: "h-4 w-4" })
|
|
5720
5721
|
})
|
|
5721
5722
|
]
|
|
5722
5723
|
})
|
|
@@ -5756,7 +5757,7 @@ var Gs = (e) => {
|
|
|
5756
5757
|
description: "Penalizes new tokens (-2: favor, 2: avoid)"
|
|
5757
5758
|
}
|
|
5758
5759
|
}, qs = (e) => {
|
|
5759
|
-
let t = (0,
|
|
5760
|
+
let t = (0, N.c)(16), { config: n, onChange: r } = e, [i, o] = (0, q.useState)(!1), s;
|
|
5760
5761
|
t[0] !== n || t[1] !== r ? (s = (e, t) => {
|
|
5761
5762
|
let i = t === null || Number.isNaN(t) ? null : t;
|
|
5762
5763
|
if (i !== null) {
|
|
@@ -5773,44 +5774,44 @@ var Gs = (e) => {
|
|
|
5773
5774
|
t[3] === Symbol.for("react.memo_cache_sentinel") ? (l = (e) => {
|
|
5774
5775
|
e.key === "Enter" && (e.preventDefault(), o(!1));
|
|
5775
5776
|
}, t[3] = l) : l = t[3];
|
|
5776
|
-
let
|
|
5777
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
5777
|
+
let u = l, d;
|
|
5778
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(me, {
|
|
5778
5779
|
content: "Configuration",
|
|
5779
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5780
|
+
children: /* @__PURE__ */ (0, J.jsx)(ae, {
|
|
5780
5781
|
asChild: !0,
|
|
5781
5782
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5782
5783
|
variant: "outline",
|
|
5783
5784
|
size: "sm",
|
|
5784
5785
|
className: "border-none shadow-none hover:bg-transparent",
|
|
5785
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5786
|
+
children: /* @__PURE__ */ (0, J.jsx)(Gt, { className: "h-3 w-3" })
|
|
5786
5787
|
})
|
|
5787
5788
|
})
|
|
5788
|
-
}), t[4] =
|
|
5789
|
-
let
|
|
5790
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
5789
|
+
}), t[4] = d) : d = t[4];
|
|
5790
|
+
let f;
|
|
5791
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)("h4", {
|
|
5791
5792
|
className: "font-bold leading-none",
|
|
5792
5793
|
children: "Configuration"
|
|
5793
|
-
}), t[5] =
|
|
5794
|
-
let
|
|
5794
|
+
}), t[5] = f) : f = t[5];
|
|
5795
|
+
let m;
|
|
5795
5796
|
if (t[6] !== n || t[7] !== c) {
|
|
5796
5797
|
let e;
|
|
5797
5798
|
t[9] === c ? e = t[10] : (e = (e) => {
|
|
5798
5799
|
let [t, n] = e;
|
|
5799
5800
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5800
5801
|
className: "grid grid-cols-3 items-center gap-1",
|
|
5801
|
-
children: [/* @__PURE__ */ (0, J.jsxs)(
|
|
5802
|
+
children: [/* @__PURE__ */ (0, J.jsxs)(ge, {
|
|
5802
5803
|
htmlFor: t,
|
|
5803
5804
|
className: "flex w-full justify-between col-span-3 align-end",
|
|
5804
|
-
children: [
|
|
5805
|
+
children: [We.startCase(t), /* @__PURE__ */ (0, J.jsx)(me, {
|
|
5805
5806
|
delayDuration: 200,
|
|
5806
5807
|
side: "top",
|
|
5807
5808
|
content: /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5808
5809
|
className: "text-xs flex flex-col",
|
|
5809
5810
|
children: Ks[t].description
|
|
5810
5811
|
}),
|
|
5811
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5812
|
+
children: /* @__PURE__ */ (0, J.jsx)(we, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
|
|
5812
5813
|
})]
|
|
5813
|
-
}), /* @__PURE__ */ (0, J.jsx)(
|
|
5814
|
+
}), /* @__PURE__ */ (0, J.jsx)(_e, {
|
|
5814
5815
|
id: t,
|
|
5815
5816
|
"aria-label": t,
|
|
5816
5817
|
value: n ?? NaN,
|
|
@@ -5819,82 +5820,82 @@ var Gs = (e) => {
|
|
|
5819
5820
|
maxValue: Ks[t].max,
|
|
5820
5821
|
step: Ks[t].step ?? 1,
|
|
5821
5822
|
onChange: (e) => c(t, e),
|
|
5822
|
-
onKeyDown:
|
|
5823
|
+
onKeyDown: u,
|
|
5823
5824
|
className: "col-span-3"
|
|
5824
5825
|
})]
|
|
5825
5826
|
}, t);
|
|
5826
|
-
}, t[9] = c, t[10] = e),
|
|
5827
|
-
} else
|
|
5828
|
-
let
|
|
5829
|
-
t[11] ===
|
|
5827
|
+
}, t[9] = c, t[10] = e), m = Qe.entries(n).map(e), t[6] = n, t[7] = c, t[8] = m;
|
|
5828
|
+
} else m = t[8];
|
|
5829
|
+
let h;
|
|
5830
|
+
t[11] === m ? h = t[12] : (h = /* @__PURE__ */ (0, J.jsx)(p, {
|
|
5830
5831
|
className: "w-70 border",
|
|
5831
5832
|
children: /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5832
5833
|
className: "grid gap-3",
|
|
5833
|
-
children: [
|
|
5834
|
+
children: [f, m]
|
|
5834
5835
|
})
|
|
5835
|
-
}), t[11] =
|
|
5836
|
-
let
|
|
5837
|
-
return t[13] !== i || t[14] !==
|
|
5836
|
+
}), t[11] = m, t[12] = h);
|
|
5837
|
+
let g;
|
|
5838
|
+
return t[13] !== i || t[14] !== h ? (g = /* @__PURE__ */ (0, J.jsxs)(v, {
|
|
5838
5839
|
open: i,
|
|
5839
5840
|
onOpenChange: o,
|
|
5840
|
-
children: [
|
|
5841
|
-
}), t[13] = i, t[14] =
|
|
5841
|
+
children: [d, h]
|
|
5842
|
+
}), t[13] = i, t[14] = h, t[15] = g) : g = t[15], g;
|
|
5842
5843
|
}, Js = (e) => {
|
|
5843
|
-
let t = (0,
|
|
5844
|
+
let t = (0, N.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, q.useState)(!1), [s, c] = (0, q.useState)(""), l;
|
|
5844
5845
|
t[0] === r ? l = t[1] : (l = (e) => {
|
|
5845
5846
|
[...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
|
|
5846
5847
|
}, t[0] = r, t[1] = l);
|
|
5847
|
-
let
|
|
5848
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
5848
|
+
let u = l, d;
|
|
5849
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(me, {
|
|
5849
5850
|
content: "Select a prompt",
|
|
5850
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5851
|
+
children: /* @__PURE__ */ (0, J.jsx)(ve, {
|
|
5851
5852
|
asChild: !0,
|
|
5852
5853
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5853
5854
|
variant: "outline",
|
|
5854
5855
|
size: "sm",
|
|
5855
5856
|
className: "border-none shadow-none hover:bg-transparent",
|
|
5856
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5857
|
+
children: /* @__PURE__ */ (0, J.jsx)(g, { className: "h-3 w-3" })
|
|
5857
5858
|
})
|
|
5858
5859
|
})
|
|
5859
|
-
}), t[2] =
|
|
5860
|
-
let
|
|
5861
|
-
if (t[3] !==
|
|
5860
|
+
}), t[2] = d) : d = t[2];
|
|
5861
|
+
let f;
|
|
5862
|
+
if (t[3] !== u || t[4] !== n) {
|
|
5862
5863
|
let e;
|
|
5863
|
-
t[6] ===
|
|
5864
|
-
onSelect: () =>
|
|
5864
|
+
t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(be, {
|
|
5865
|
+
onSelect: () => u(e),
|
|
5865
5866
|
className: "whitespace-normal text-left",
|
|
5866
5867
|
children: e
|
|
5867
|
-
}, t), t[6] =
|
|
5868
|
-
} else
|
|
5869
|
-
let
|
|
5870
|
-
t[8] ===
|
|
5868
|
+
}, t), t[6] = u, t[7] = e), f = n.map(e), t[3] = u, t[4] = n, t[5] = f;
|
|
5869
|
+
} else f = t[5];
|
|
5870
|
+
let m;
|
|
5871
|
+
t[8] === f ? m = t[9] : (m = /* @__PURE__ */ (0, J.jsx)(Hs, { children: /* @__PURE__ */ (0, J.jsxs)(Se, { children: [d, /* @__PURE__ */ (0, J.jsx)(xe, {
|
|
5871
5872
|
side: "right",
|
|
5872
5873
|
align: "end",
|
|
5873
5874
|
onCloseAutoFocus: Xs,
|
|
5874
5875
|
className: "w-64 max-h-96 overflow-y-auto",
|
|
5875
|
-
children:
|
|
5876
|
-
})] }) }), t[8] =
|
|
5876
|
+
children: f
|
|
5877
|
+
})] }) }), t[8] = f, t[9] = m);
|
|
5878
|
+
let h;
|
|
5879
|
+
t[10] === Symbol.for("react.memo_cache_sentinel") ? (h = () => o(!1), t[10] = h) : h = t[10];
|
|
5877
5880
|
let _;
|
|
5878
|
-
t[
|
|
5879
|
-
let v;
|
|
5880
|
-
t[11] !== r || t[12] !== s ? (v = /* @__PURE__ */ (0, J.jsx)(d, {
|
|
5881
|
+
t[11] !== r || t[12] !== s ? (_ = /* @__PURE__ */ (0, J.jsx)(p, {
|
|
5881
5882
|
side: "right",
|
|
5882
5883
|
align: "end",
|
|
5883
5884
|
className: "min-w-80 px-2",
|
|
5884
5885
|
children: /* @__PURE__ */ (0, J.jsx)(Ys, {
|
|
5885
5886
|
prompt: s,
|
|
5886
|
-
onClose:
|
|
5887
|
+
onClose: h,
|
|
5887
5888
|
onSelect: r
|
|
5888
5889
|
}, s)
|
|
5889
|
-
}), t[11] = r, t[12] = s, t[13] =
|
|
5890
|
+
}), t[11] = r, t[12] = s, t[13] = _) : _ = t[13];
|
|
5890
5891
|
let y;
|
|
5891
|
-
return t[14] !== i || t[15] !==
|
|
5892
|
+
return t[14] !== i || t[15] !== m || t[16] !== _ ? (y = /* @__PURE__ */ (0, J.jsxs)(v, {
|
|
5892
5893
|
open: i,
|
|
5893
5894
|
onOpenChange: o,
|
|
5894
|
-
children: [
|
|
5895
|
-
}), t[14] = i, t[15] =
|
|
5895
|
+
children: [m, _]
|
|
5896
|
+
}), t[14] = i, t[15] = m, t[16] = _, t[17] = y) : y = t[17], y;
|
|
5896
5897
|
}, Ys = (e) => {
|
|
5897
|
-
let t = (0,
|
|
5898
|
+
let t = (0, N.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
|
|
5898
5899
|
t[0] === n ? o = t[1] : (o = () => [...n.matchAll(/{{(\w+)}}/g)].reduce(Zs, {}), t[0] = n, t[1] = o);
|
|
5899
5900
|
let [s, c] = (0, q.useState)(o), l;
|
|
5900
5901
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = (e, t) => {
|
|
@@ -5923,11 +5924,11 @@ var Gs = (e) => {
|
|
|
5923
5924
|
let [n, r] = e;
|
|
5924
5925
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5925
5926
|
className: "grid grid-cols-4 items-center gap-2",
|
|
5926
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
5927
|
+
children: [/* @__PURE__ */ (0, J.jsx)(ge, {
|
|
5927
5928
|
htmlFor: n,
|
|
5928
5929
|
className: "font-semibold text-base",
|
|
5929
5930
|
children: n
|
|
5930
|
-
}), /* @__PURE__ */ (0, J.jsx)(
|
|
5931
|
+
}), /* @__PURE__ */ (0, J.jsx)(ye, {
|
|
5931
5932
|
id: n,
|
|
5932
5933
|
value: r,
|
|
5933
5934
|
onChange: (e) => u(n, e.target.value),
|