@marimo-team/islands 0.25.3-dev308 → 0.25.3-dev310
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-DJnSxHJB.js → ConnectedDataExplorerComponent-DieU6L4x.js} +1 -1
- package/dist/{ErrorBoundary-flfhLFje.js → ErrorBoundary-DjoeT4kv.js} +1 -1
- package/dist/{abnfDiagram-VCTEODGH-CR0U5hup.js → abnfDiagram-VCTEODGH-LOVrjbdp.js} +2 -2
- package/dist/{any-language-editor-C5dsTpeB.js → any-language-editor-DMC2JE9_.js} +1 -1
- package/dist/{architectureDiagram-5GKGNRK7-Bc_fbI1Q.js → architectureDiagram-5GKGNRK7-RZsm312h.js} +1 -1
- package/dist/assets/__vite-browser-external-BSp9tJ_k.js +1 -0
- package/dist/assets/worker-BdfPA0g5.js +171 -0
- package/dist/{chat-ui-C4iLRzY0.js → chat-ui-DkuxGEDp.js} +418 -418
- package/dist/{chunk-IMKFNOWR-y9z5oeAY.js → chunk-IMKFNOWR-B6agbLjo.js} +1 -1
- package/dist/{chunk-SHT3W25Y-Tu-V-e_v.js → chunk-SHT3W25Y-CfULafYG.js} +1 -1
- package/dist/{chunk-SVP7TREG-CJFxs5R_.js → chunk-SVP7TREG-DEOpPMJp.js} +1 -1
- package/dist/{chunk-TICWLB2K-zkTP7ya7.js → chunk-TICWLB2K-DaH-gkX5.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-DxJAZI0N.js → classDiagram-ZZMXUADV-C0CyiWQ7.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-TmHo2BpS.js → classDiagram-v2-VYDZK3BY-xfIc9e2Y.js} +2 -2
- package/dist/{code-visibility-BDs_r7jH.js → code-visibility-CduMVVFS.js} +32 -32
- package/dist/{common-CMTsL35V.js → common-CMcEcucH.js} +919 -919
- package/dist/{config-BG2qKzDg.js → config-BVYA1P0C.js} +103 -76
- package/dist/{cynefinDiagram-5FMLGOSQ-Eb40hmhD.js → cynefinDiagram-5FMLGOSQ-DwGYhKu0.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-_paaVwit.js → dagre-GXQ25YYZ-DfMaWJOV.js} +1 -1
- package/dist/{data-grid-overlay-editor-es6V6qf-.js → data-grid-overlay-editor-BYrIVut3.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-BtKJm1_4.js → diagram-S7CK7UJ4-Bw_L87GZ.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-DQbxhEMd.js → diagram-UQ7AKVKN-nsrs3Fbz.js} +1 -1
- package/dist/{diagram-VX7I27RA-DITDIfGC.js → diagram-VX7I27RA-7ST9lEqP.js} +1 -1
- package/dist/{diagram-Z3DM3KII-Ct9_zo6F.js → diagram-Z3DM3KII-BnGte-HX.js} +1 -1
- package/dist/{ebnfDiagram-PWID7BFC-6cOntwfv.js → ebnfDiagram-PWID7BFC-zaKyJ1YL.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-CJiOER41.js → erDiagram-RLTQ6QDP-Cx7g95FZ.js} +1 -1
- package/dist/{error-banner-DGOrmBk5.js → error-banner-DkQNU4bn.js} +128 -128
- package/dist/{error-entries-BWmleiL0.js → error-entries-istW7Xbs.js} +589 -544
- package/dist/{feedback-button-D4eVjeNs.js → feedback-button-Zvm26aOQ.js} +107 -106
- package/dist/{flowDiagram-HODETNUW-1lPBEUuW.js → flowDiagram-HODETNUW-C7nIqaHP.js} +2 -2
- package/dist/{formats-qhBmYb0l.js → formats-CMa7L3E8.js} +1 -1
- package/dist/{glide-data-editor-ahfaPdFW.js → glide-data-editor-BE-GgVp4.js} +3 -3
- package/dist/{globals-m8oswz--.js → globals-Dbru-WLP.js} +1 -1
- package/dist/{html-to-image-B8hE6HIH.js → html-to-image-pPbR2cDx.js} +4512 -4464
- package/dist/{infoDiagram-27XIBGKW-C6K4tri5.js → infoDiagram-27XIBGKW-BTM_NXsn.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-DwcwgRNH.js → ishikawaDiagram-5VMMS53U-K0FZrlvv.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-E489OMdc.js → kanban-definition-UXKFOSKX-ftznOyrz.js} +1 -1
- package/dist/main.js +6595 -6186
- package/dist/{mermaid-DMPMkVqY.js → mermaid-CNgH43ED.js} +33 -33
- package/dist/{mindmap-definition-YA3MSWOX-DWHjasOp.js → mindmap-definition-YA3MSWOX-CmzbxKfM.js} +1 -1
- package/dist/{number-overlay-editor-C6klKzEr.js → number-overlay-editor-qvlPZ-l-.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-COjcPOZT.js → pegDiagram-XKGWAZYB-DfTAWfGE.js} +2 -2
- package/dist/{pieDiagram-E7YTZNPT-BHAVZ38h.js → pieDiagram-E7YTZNPT-_kGQstZj.js} +1 -1
- package/dist/{process-output-DZDL_j1a.js → process-output-BySO1nIs.js} +3 -3
- package/dist/{railroadDiagram-O6MQD6OU-94ThFyKX.js → railroadDiagram-O6MQD6OU-D41WmIff.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-CpF-Fxbb.js → requirementDiagram-BXWQKSXE-Bh53ZI3I.js} +1 -1
- package/dist/{reveal-component-DwnxPyVz.js → reveal-component-DQaegdcW.js} +4 -4
- package/dist/{sequenceDiagram-WJ2MYXX4-CvANK2x7.js → sequenceDiagram-WJ2MYXX4-DBX27dNm.js} +1 -1
- package/dist/{stateDiagram-D77RDMKH-WHuJ4mJL.js → stateDiagram-D77RDMKH-CSYz2IZi.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-DbO7lwYq.js → stateDiagram-v2-MP3YSRHH-DVLvtOqn.js} +2 -2
- package/dist/{swimlanes-42K2YHIH-CS2s29Vo.js → swimlanes-42K2YHIH-D59N0ktA.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-CXaA1vQg.js → swimlanesDiagram-VR7AAH4N-CRgpmVSW.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-B-SQMg5h.js → timeline-definition-24CTP7MA-C_xIIZDM.js} +1 -1
- package/dist/toDate-5qPtZ6HL.js +94 -0
- package/dist/{vega-component-DwqGfN3_.js → vega-component-Bly2lDhz.js} +10 -10
- package/dist/{vennDiagram-4TSXK5OY-etEFgvaG.js → vennDiagram-4TSXK5OY-DlOf0Mjs.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-BEQN7g62.js → wardleyDiagram-VM6X3IG4-zD_2guVe.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-D8-e5Z0R.js → xychartDiagram-S5SC5T6Z-CA0Dy1ZM.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/executions.ts +35 -13
- package/src/__mocks__/requests.ts +0 -1
- package/src/components/editor/cell/__tests__/useRunCells.test.tsx +86 -101
- package/src/components/editor/cell/useRunCells.ts +38 -65
- package/src/components/editor/notebook-cell.tsx +32 -20
- package/src/components/editor/output/ansi-reduce.ts +7 -0
- package/src/core/ai/__tests__/staged-cells.test.ts +1 -1
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +2 -0
- package/src/core/cells/__tests__/cells.test.ts +0 -14
- package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +15 -0
- package/src/core/cells/__tests__/utils.test.ts +1 -1
- package/src/core/cells/add-missing-import.ts +2 -5
- package/src/core/cells/cell.ts +1 -0
- package/src/core/cells/cells.ts +1 -2
- package/src/core/executions/__tests__/atoms.test.ts +227 -43
- package/src/core/executions/__tests__/hooks.test.tsx +1 -2
- package/src/core/executions/__tests__/input.test.ts +86 -0
- package/src/core/executions/__tests__/run.test.ts +390 -0
- package/src/core/executions/__tests__/select.test.ts +105 -30
- package/src/core/executions/atoms.ts +186 -71
- package/src/core/executions/index.ts +7 -6
- package/src/core/executions/input.ts +55 -0
- package/src/core/executions/run.ts +120 -0
- package/src/core/executions/select.ts +59 -24
- package/src/core/islands/__tests__/bridge.test.ts +35 -54
- package/src/core/islands/bootstrap.ts +5 -1
- package/src/core/islands/bridge.ts +16 -28
- package/src/core/islands/components/IslandControls.tsx +15 -7
- package/src/core/islands/components/__tests__/IslandControls.test.tsx +36 -53
- package/src/core/islands/worker/worker.tsx +45 -19
- package/src/core/network/__tests__/requests-lazy.test.ts +14 -24
- package/src/core/network/__tests__/requests-toasting.test.tsx +7 -7
- package/src/core/network/requests-lazy.ts +2 -3
- package/src/core/network/requests-network.ts +0 -9
- package/src/core/network/requests-static.ts +0 -1
- package/src/core/network/requests-toasting.tsx +0 -1
- package/src/core/network/types.ts +0 -2
- package/src/core/notebook/replica/__tests__/fixtures.ts +17 -1
- package/src/core/notebook/replica/backend.ts +3 -1
- package/src/core/runtime/__tests__/runtime.test.ts +36 -0
- package/src/core/runtime/config.ts +36 -1
- package/src/core/runtime/runtime.ts +21 -1
- package/src/core/transports/static.ts +4 -3
- package/src/core/wasm/bridge.ts +0 -17
- package/dist/assets/__vite-browser-external-DzTYIHH_.js +0 -1
- package/dist/assets/worker-BH08I2Il.js +0 -171
- package/dist/static-state-Dtocd9UO.js +0 -68
|
@@ -3,27 +3,27 @@ import { g as n, h as r, i, t as a } from "./button-BuSV-mLI.js";
|
|
|
3
3
|
import { t as o } from "./react-CHbZqgBF.js";
|
|
4
4
|
import { t as s } from "./compiler-runtime-DNezxW8I.js";
|
|
5
5
|
import { i as c, t as l } from "./copy-icon-oHFcxX_y.js";
|
|
6
|
-
import {
|
|
7
|
-
import { h as
|
|
8
|
-
import { d as
|
|
9
|
-
import { Sn as
|
|
10
|
-
import {
|
|
11
|
-
import { Gt as
|
|
12
|
-
import { d as
|
|
13
|
-
import { t as
|
|
14
|
-
import { n as
|
|
15
|
-
import { t as
|
|
16
|
-
import { $ as
|
|
17
|
-
import { n as
|
|
18
|
-
import { t as
|
|
19
|
-
import { t as
|
|
20
|
-
import { t as
|
|
21
|
-
import { Dt as
|
|
22
|
-
import { n as
|
|
23
|
-
import { n as
|
|
24
|
-
import { n as
|
|
25
|
-
import { t as
|
|
26
|
-
var
|
|
6
|
+
import { At as u, Bt as d, Dt as f, Et as p, Ft as m, Ht as h, J as g, Lt as _, M as v, Ot as y, Pt as b, Rt as x, U as S, V as C, W as w, Y as T, a as E, dt as D, et as ee, f as O, g as k, h as A, ht as j, l as te, m as M, n as ne, nt as re, p as ie, r as ae, st as oe, t as se, tt as ce, u as le, v as ue, wt as de, xt as fe } from "./html-to-image-pPbR2cDx.js";
|
|
7
|
+
import { h as N, t as pe } from "./tooltip-BekOCQ3v.js";
|
|
8
|
+
import { d as me } from "./select-XmXyen3r.js";
|
|
9
|
+
import { Sn as he, _ as ge, bn as _e, f as ve, h as ye, i as be, n as xe, t as Se } from "./dropdown-menu-CAejOChE.js";
|
|
10
|
+
import { o as Ce, u as we } from "./config-BVYA1P0C.js";
|
|
11
|
+
import { Gt as Te, O as Ee, V as De, X as Oe, bt as ke, h as Ae, i as je, j as Me, r as Ne, rt as Pe, t as Fe } from "./error-entries-istW7Xbs.js";
|
|
12
|
+
import { d as Ie, f as Le, i as Re, n as ze, t as Be, u as Ve } from "./process-output-BySO1nIs.js";
|
|
13
|
+
import { t as He } from "./pencil-BUfnNZAE.js";
|
|
14
|
+
import { n as Ue, r as We, s as Ge } from "./assertNever-efcK_v3t.js";
|
|
15
|
+
import { t as Ke } from "./jsx-runtime-6ZiU38At.js";
|
|
16
|
+
import { $ as qe, Ft as Je, G as Ye, H as Xe, J as Ze, K as Qe, Lt as $e, Q as et, U as tt, W as nt, Y as rt, Z as it, at, ct as ot, ft as st, h as ct, lt, nt as ut, ot as dt, q as ft, rt as pt, tt as mt, u as ht, ut as gt } from "./use-restore-focus-DyrKLdSB.js";
|
|
17
|
+
import { n as _t } from "./error-banner-DkQNU4bn.js";
|
|
18
|
+
import { t as vt } from "./isEmpty-CdX7MTE1.js";
|
|
19
|
+
import { t as yt } from "./objects-DCmMvZtn.js";
|
|
20
|
+
import { t as bt } from "./useEvent-xDnF2X04.js";
|
|
21
|
+
import { Dt as xt, Et as St, St as Ct, U as wt, V as Tt, W as Et, bt as Dt, kt as Ot, nt as kt, rt as At, yt as jt, z as Mt } from "./dist-B_xgcU0N.js";
|
|
22
|
+
import { n as Nt, o as Pt, r as Ft } from "./dist-C3dYgyiI.js";
|
|
23
|
+
import { n as It } from "./dist-U4WlxEDL.js";
|
|
24
|
+
import { n as Lt, t as Rt } from "./esm-BvhFNYzM.js";
|
|
25
|
+
import { t as zt } from "./useAsyncData-DMBliR6D.js";
|
|
26
|
+
var Bt = N("ban", [["circle", {
|
|
27
27
|
cx: "12",
|
|
28
28
|
cy: "12",
|
|
29
29
|
r: "10",
|
|
@@ -31,13 +31,13 @@ var zt = P("ban", [["circle", {
|
|
|
31
31
|
}], ["path", {
|
|
32
32
|
d: "M4.929 4.929 19.07 19.071",
|
|
33
33
|
key: "196cmz"
|
|
34
|
-
}]]),
|
|
34
|
+
}]]), Vt = N("book-open", [["path", {
|
|
35
35
|
d: "M12 7v14",
|
|
36
36
|
key: "1akyts"
|
|
37
37
|
}], ["path", {
|
|
38
38
|
d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",
|
|
39
39
|
key: "ruj8y"
|
|
40
|
-
}]]),
|
|
40
|
+
}]]), Ht = N("bot-message-square", [
|
|
41
41
|
["path", {
|
|
42
42
|
d: "M12 6V2H8",
|
|
43
43
|
key: "1155em"
|
|
@@ -62,7 +62,7 @@ var zt = P("ban", [["circle", {
|
|
|
62
62
|
d: "M9 11v2",
|
|
63
63
|
key: "1ueba0"
|
|
64
64
|
}]
|
|
65
|
-
]),
|
|
65
|
+
]), Ut = N("brain", [
|
|
66
66
|
["path", {
|
|
67
67
|
d: "M12 18V5",
|
|
68
68
|
key: "adv99a"
|
|
@@ -95,7 +95,7 @@ var zt = P("ban", [["circle", {
|
|
|
95
95
|
d: "M6.003 5.125a4 4 0 0 0-2.526 5.77",
|
|
96
96
|
key: "q97ue3"
|
|
97
97
|
}]
|
|
98
|
-
]),
|
|
98
|
+
]), Wt = N("bug", [
|
|
99
99
|
["path", {
|
|
100
100
|
d: "M12 20v-9",
|
|
101
101
|
key: "1qisl0"
|
|
@@ -140,7 +140,7 @@ var zt = P("ban", [["circle", {
|
|
|
140
140
|
d: "M9 7.13V6a3 3 0 1 1 6 0v1.13",
|
|
141
141
|
key: "1vgav8"
|
|
142
142
|
}]
|
|
143
|
-
]),
|
|
143
|
+
]), Gt = N("circle-slash", [["circle", {
|
|
144
144
|
cx: "12",
|
|
145
145
|
cy: "12",
|
|
146
146
|
r: "10",
|
|
@@ -151,7 +151,7 @@ var zt = P("ban", [["circle", {
|
|
|
151
151
|
y1: "15",
|
|
152
152
|
y2: "9",
|
|
153
153
|
key: "1dfufj"
|
|
154
|
-
}]]),
|
|
154
|
+
}]]), Kt = N("file-search", [
|
|
155
155
|
["path", {
|
|
156
156
|
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
157
157
|
key: "1oefj6"
|
|
@@ -170,7 +170,7 @@ var zt = P("ban", [["circle", {
|
|
|
170
170
|
d: "M13.3 16.3 15 18",
|
|
171
171
|
key: "2quom7"
|
|
172
172
|
}]
|
|
173
|
-
]),
|
|
173
|
+
]), qt = N("list-checks", [
|
|
174
174
|
["path", {
|
|
175
175
|
d: "M13 5h8",
|
|
176
176
|
key: "a7qcls"
|
|
@@ -191,7 +191,7 @@ var zt = P("ban", [["circle", {
|
|
|
191
191
|
d: "m3 7 2 2 4-4",
|
|
192
192
|
key: "1obspn"
|
|
193
193
|
}]
|
|
194
|
-
]),
|
|
194
|
+
]), Jt = N("notebook", [
|
|
195
195
|
["path", {
|
|
196
196
|
d: "M2 6h4",
|
|
197
197
|
key: "aawbzj"
|
|
@@ -220,16 +220,16 @@ var zt = P("ban", [["circle", {
|
|
|
220
220
|
d: "M16 2v20",
|
|
221
221
|
key: "rotuqe"
|
|
222
222
|
}]
|
|
223
|
-
]),
|
|
223
|
+
]), Yt = N("paperclip", [["path", {
|
|
224
224
|
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",
|
|
225
225
|
key: "1miecu"
|
|
226
|
-
}]]),
|
|
226
|
+
}]]), Xt = N("rotate-cw", [["path", {
|
|
227
227
|
d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
|
|
228
228
|
key: "1p45f6"
|
|
229
229
|
}], ["path", {
|
|
230
230
|
d: "M21 3v5h-5",
|
|
231
231
|
key: "1q7to0"
|
|
232
|
-
}]]),
|
|
232
|
+
}]]), Zt = N("scan-search", [
|
|
233
233
|
["path", {
|
|
234
234
|
d: "M3 7V5a2 2 0 0 1 2-2h2",
|
|
235
235
|
key: "aa7l1z"
|
|
@@ -256,13 +256,13 @@ var zt = P("ban", [["circle", {
|
|
|
256
256
|
d: "m16 16-1.9-1.9",
|
|
257
257
|
key: "1dq9hf"
|
|
258
258
|
}]
|
|
259
|
-
]),
|
|
259
|
+
]), Qt = N("send-horizontal", [["path", {
|
|
260
260
|
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",
|
|
261
261
|
key: "117uat"
|
|
262
262
|
}], ["path", {
|
|
263
263
|
d: "M6 12h16",
|
|
264
264
|
key: "s4cdu5"
|
|
265
|
-
}]]),
|
|
265
|
+
}]]), $t = N("settings", [["path", {
|
|
266
266
|
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",
|
|
267
267
|
key: "1i5ecw"
|
|
268
268
|
}], ["circle", {
|
|
@@ -270,7 +270,7 @@ var zt = P("ban", [["circle", {
|
|
|
270
270
|
cy: "12",
|
|
271
271
|
r: "3",
|
|
272
272
|
key: "1v7zrd"
|
|
273
|
-
}]]),
|
|
273
|
+
}]]), en = N("shield-question-mark", [
|
|
274
274
|
["path", {
|
|
275
275
|
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",
|
|
276
276
|
key: "oel41y"
|
|
@@ -283,66 +283,66 @@ var zt = P("ban", [["circle", {
|
|
|
283
283
|
d: "M12 17h.01",
|
|
284
284
|
key: "p32p05"
|
|
285
285
|
}]
|
|
286
|
-
]),
|
|
286
|
+
]), P = s(), tn = "vercel.ai.error", nn = Symbol.for(tn), rn, an, F = class e extends (an = Error, rn = nn, an) {
|
|
287
287
|
constructor({ name: e, message: t, cause: n }) {
|
|
288
|
-
super(t), this[
|
|
288
|
+
super(t), this[rn] = !0, this.name = e, this.cause = n;
|
|
289
289
|
}
|
|
290
290
|
static isInstance(t) {
|
|
291
|
-
return e.hasMarker(t,
|
|
291
|
+
return e.hasMarker(t, tn);
|
|
292
292
|
}
|
|
293
293
|
static hasMarker(e, t) {
|
|
294
294
|
let n = Symbol.for(t);
|
|
295
295
|
return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
|
|
296
296
|
}
|
|
297
|
-
},
|
|
297
|
+
}, on = "AI_APICallError", sn = `vercel.ai.error.${on}`, cn = Symbol.for(sn), ln, un, dn = class extends (un = F, ln = cn, un) {
|
|
298
298
|
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 }) {
|
|
299
299
|
super({
|
|
300
|
-
name:
|
|
300
|
+
name: on,
|
|
301
301
|
message: e,
|
|
302
302
|
cause: o
|
|
303
|
-
}), this[
|
|
303
|
+
}), this[ln] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
|
|
304
304
|
}
|
|
305
305
|
static isInstance(e) {
|
|
306
|
-
return
|
|
306
|
+
return F.hasMarker(e, sn);
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, fn = "AI_EmptyResponseBodyError", pn = `vercel.ai.error.${fn}`, mn = Symbol.for(pn), hn, gn, _n = class extends (gn = F, hn = mn, gn) {
|
|
309
309
|
constructor({ message: e = "Empty response body" } = {}) {
|
|
310
310
|
super({
|
|
311
|
-
name:
|
|
311
|
+
name: fn,
|
|
312
312
|
message: e
|
|
313
|
-
}), this[
|
|
313
|
+
}), this[hn] = !0;
|
|
314
314
|
}
|
|
315
315
|
static isInstance(e) {
|
|
316
|
-
return
|
|
316
|
+
return F.hasMarker(e, pn);
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
|
-
function
|
|
319
|
+
function vn(e) {
|
|
320
320
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
|
|
321
321
|
}
|
|
322
|
-
var
|
|
322
|
+
var yn = "AI_InvalidArgumentError", bn = `vercel.ai.error.${yn}`, xn = Symbol.for(bn), Sn, Cn, wn = class extends (Cn = F, Sn = xn, Cn) {
|
|
323
323
|
constructor({ message: e, cause: t, argument: n }) {
|
|
324
324
|
super({
|
|
325
|
-
name:
|
|
325
|
+
name: yn,
|
|
326
326
|
message: e,
|
|
327
327
|
cause: t
|
|
328
|
-
}), this[
|
|
328
|
+
}), this[Sn] = !0, this.argument = n;
|
|
329
329
|
}
|
|
330
330
|
static isInstance(e) {
|
|
331
|
-
return
|
|
331
|
+
return F.hasMarker(e, bn);
|
|
332
332
|
}
|
|
333
|
-
},
|
|
333
|
+
}, Tn = "AI_JSONParseError", En = `vercel.ai.error.${Tn}`, Dn = Symbol.for(En), On, kn, An = class extends (kn = F, On = Dn, kn) {
|
|
334
334
|
constructor({ text: e, cause: t }) {
|
|
335
335
|
super({
|
|
336
|
-
name:
|
|
336
|
+
name: Tn,
|
|
337
337
|
message: `JSON parsing failed: Text: ${e}.
|
|
338
|
-
Error message: ${
|
|
338
|
+
Error message: ${vn(t)}`,
|
|
339
339
|
cause: t
|
|
340
|
-
}), this[
|
|
340
|
+
}), this[On] = !0, this.text = e;
|
|
341
341
|
}
|
|
342
342
|
static isInstance(e) {
|
|
343
|
-
return
|
|
343
|
+
return F.hasMarker(e, En);
|
|
344
344
|
}
|
|
345
|
-
},
|
|
345
|
+
}, jn = "AI_TypeValidationError", Mn = `vercel.ai.error.${jn}`, Nn = Symbol.for(Mn), Pn, Fn, In = class e extends (Fn = F, Pn = Nn, Fn) {
|
|
346
346
|
constructor({ value: e, cause: t, context: n }) {
|
|
347
347
|
let r = "Type validation failed";
|
|
348
348
|
if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
|
|
@@ -351,14 +351,14 @@ Error message: ${_n(t)}`,
|
|
|
351
351
|
n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
|
|
352
352
|
}
|
|
353
353
|
super({
|
|
354
|
-
name:
|
|
354
|
+
name: jn,
|
|
355
355
|
message: `${r}: Value: ${JSON.stringify(e)}.
|
|
356
|
-
Error message: ${
|
|
356
|
+
Error message: ${vn(t)}`,
|
|
357
357
|
cause: t
|
|
358
|
-
}), this[
|
|
358
|
+
}), this[Pn] = !0, this.value = e, this.context = n;
|
|
359
359
|
}
|
|
360
360
|
static isInstance(e) {
|
|
361
|
-
return
|
|
361
|
+
return F.hasMarker(e, Mn);
|
|
362
362
|
}
|
|
363
363
|
static wrap({ value: t, cause: n, context: r }) {
|
|
364
364
|
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({
|
|
@@ -367,25 +367,25 @@ Error message: ${_n(t)}`,
|
|
|
367
367
|
context: r
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
|
-
},
|
|
370
|
+
}, Ln = "AI_UnsupportedFunctionalityError", Rn = `vercel.ai.error.${Ln}`, zn = Symbol.for(Rn), Bn, Vn, Hn = class extends (Vn = F, Bn = zn, Vn) {
|
|
371
371
|
constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
|
|
372
372
|
super({
|
|
373
|
-
name:
|
|
373
|
+
name: Ln,
|
|
374
374
|
message: t
|
|
375
|
-
}), this[
|
|
375
|
+
}), this[Bn] = !0, this.functionality = e;
|
|
376
376
|
}
|
|
377
377
|
static isInstance(e) {
|
|
378
|
-
return
|
|
378
|
+
return F.hasMarker(e, Rn);
|
|
379
379
|
}
|
|
380
|
-
},
|
|
380
|
+
}, Un = class extends Error {
|
|
381
381
|
constructor(e, t) {
|
|
382
382
|
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
383
383
|
}
|
|
384
|
-
},
|
|
385
|
-
function
|
|
386
|
-
function
|
|
384
|
+
}, Wn = 10, Gn = 13, Kn = 32;
|
|
385
|
+
function qn(e) {}
|
|
386
|
+
function Jn(e) {
|
|
387
387
|
if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
|
|
388
|
-
let { onEvent: t =
|
|
388
|
+
let { onEvent: t = qn, onError: n = qn, onRetry: r = qn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
|
|
389
389
|
function m(e) {
|
|
390
390
|
if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
|
|
391
391
|
if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
|
|
@@ -404,7 +404,7 @@ function qn(e) {
|
|
|
404
404
|
n !== "" && (o.push(n), s = n.length), h();
|
|
405
405
|
}
|
|
406
406
|
function h() {
|
|
407
|
-
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
|
|
407
|
+
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 Un(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
|
|
408
408
|
}
|
|
409
409
|
function g(e) {
|
|
410
410
|
let n = 0;
|
|
@@ -420,9 +420,9 @@ function qn(e) {
|
|
|
420
420
|
continue;
|
|
421
421
|
}
|
|
422
422
|
let i = e.charCodeAt(n);
|
|
423
|
-
if (
|
|
424
|
-
let i = e.charCodeAt(n + 5) ===
|
|
425
|
-
if (d === 0 && e.charCodeAt(r + 1) ===
|
|
423
|
+
if (Yn(e, n, i)) {
|
|
424
|
+
let i = e.charCodeAt(n + 5) === Kn ? n + 6 : n + 5, a = e.slice(i, r);
|
|
425
|
+
if (d === 0 && e.charCodeAt(r + 1) === Wn) {
|
|
426
426
|
t({
|
|
427
427
|
id: l,
|
|
428
428
|
event: f,
|
|
@@ -432,7 +432,7 @@ function qn(e) {
|
|
|
432
432
|
}
|
|
433
433
|
u = d === 0 ? a : `${u}
|
|
434
434
|
${a}`, d++;
|
|
435
|
-
} else
|
|
435
|
+
} else Xn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === Kn ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
|
|
436
436
|
n = r + 1, r = e.indexOf("\n", n);
|
|
437
437
|
}
|
|
438
438
|
return e.slice(n);
|
|
@@ -440,7 +440,7 @@ ${a}`, d++;
|
|
|
440
440
|
for (; n < e.length;) {
|
|
441
441
|
let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
|
|
442
442
|
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;
|
|
443
|
-
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) ===
|
|
443
|
+
_(e, n, i), n = i + 1, e.charCodeAt(n - 1) === Gn && e.charCodeAt(n) === Wn && n++;
|
|
444
444
|
}
|
|
445
445
|
return e.slice(n);
|
|
446
446
|
}
|
|
@@ -450,25 +450,25 @@ ${a}`, d++;
|
|
|
450
450
|
return;
|
|
451
451
|
}
|
|
452
452
|
let r = e.charCodeAt(t);
|
|
453
|
-
if (
|
|
454
|
-
let r = e.charCodeAt(t + 5) ===
|
|
453
|
+
if (Yn(e, t, r)) {
|
|
454
|
+
let r = e.charCodeAt(t + 5) === Kn ? t + 6 : t + 5, i = e.slice(r, n);
|
|
455
455
|
u = d === 0 ? i : `${u}
|
|
456
456
|
${i}`, d++;
|
|
457
457
|
return;
|
|
458
458
|
}
|
|
459
|
-
if (
|
|
460
|
-
f = e.slice(e.charCodeAt(t + 6) ===
|
|
459
|
+
if (Xn(e, t, r)) {
|
|
460
|
+
f = e.slice(e.charCodeAt(t + 6) === Kn ? t + 7 : t + 6, n) || void 0;
|
|
461
461
|
return;
|
|
462
462
|
}
|
|
463
463
|
if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
|
|
464
|
-
let r = e.slice(e.charCodeAt(t + 3) ===
|
|
464
|
+
let r = e.slice(e.charCodeAt(t + 3) === Kn ? t + 4 : t + 3, n);
|
|
465
465
|
l = r.includes("\0") ? void 0 : r;
|
|
466
466
|
return;
|
|
467
467
|
}
|
|
468
468
|
if (r === 58) {
|
|
469
469
|
if (i) {
|
|
470
470
|
let r = e.slice(t, n);
|
|
471
|
-
i(r.slice(e.charCodeAt(t + 1) ===
|
|
471
|
+
i(r.slice(e.charCodeAt(t + 1) === Kn ? 2 : 1));
|
|
472
472
|
}
|
|
473
473
|
return;
|
|
474
474
|
}
|
|
@@ -477,7 +477,7 @@ ${i}`, d++;
|
|
|
477
477
|
v(a, "", a);
|
|
478
478
|
return;
|
|
479
479
|
}
|
|
480
|
-
let s = a.slice(0, o), c = a.charCodeAt(o + 1) ===
|
|
480
|
+
let s = a.slice(0, o), c = a.charCodeAt(o + 1) === Kn ? 2 : 1;
|
|
481
481
|
v(s, a.slice(o + c), a);
|
|
482
482
|
}
|
|
483
483
|
function v(e, t, i) {
|
|
@@ -493,13 +493,13 @@ ${t}`, d++;
|
|
|
493
493
|
l = t.includes("\0") ? void 0 : t;
|
|
494
494
|
break;
|
|
495
495
|
case "retry":
|
|
496
|
-
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new
|
|
496
|
+
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Un(`Invalid \`retry\` value: "${t}"`, {
|
|
497
497
|
type: "invalid-retry",
|
|
498
498
|
value: t,
|
|
499
499
|
line: i
|
|
500
500
|
}));
|
|
501
501
|
break;
|
|
502
|
-
default: n(new
|
|
502
|
+
default: n(new Un(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
|
|
503
503
|
type: "unknown-field",
|
|
504
504
|
field: e,
|
|
505
505
|
value: t,
|
|
@@ -526,20 +526,20 @@ ${t}`, d++;
|
|
|
526
526
|
reset: b
|
|
527
527
|
};
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function Yn(e, t, n) {
|
|
530
530
|
return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Xn(e, t, n) {
|
|
533
533
|
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;
|
|
534
534
|
}
|
|
535
535
|
//#endregion
|
|
536
536
|
//#region ../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
|
|
537
|
-
var
|
|
537
|
+
var Zn = class extends TransformStream {
|
|
538
538
|
constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
|
|
539
539
|
let i;
|
|
540
540
|
super({
|
|
541
541
|
start(a) {
|
|
542
|
-
i =
|
|
542
|
+
i = Jn({
|
|
543
543
|
onEvent: (e) => {
|
|
544
544
|
a.enqueue(e);
|
|
545
545
|
},
|
|
@@ -558,8 +558,8 @@ var Xn = class extends TransformStream {
|
|
|
558
558
|
}
|
|
559
559
|
};
|
|
560
560
|
new TextDecoder();
|
|
561
|
-
var { btoa:
|
|
562
|
-
function
|
|
561
|
+
var { btoa: Qn, atob: $n } = globalThis;
|
|
562
|
+
function er(e) {
|
|
563
563
|
if (e == null) return {};
|
|
564
564
|
let t = {};
|
|
565
565
|
if (e instanceof Headers) e.forEach((e, n) => {
|
|
@@ -571,28 +571,28 @@ function $n(e) {
|
|
|
571
571
|
}
|
|
572
572
|
return t;
|
|
573
573
|
}
|
|
574
|
-
var
|
|
574
|
+
var I = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
|
|
575
575
|
let i = () => {
|
|
576
576
|
let e = n.length, r = Array(t);
|
|
577
577
|
for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
|
|
578
578
|
return r.join("");
|
|
579
579
|
};
|
|
580
580
|
if (e == null) return i;
|
|
581
|
-
if (n.includes(r)) throw new
|
|
581
|
+
if (n.includes(r)) throw new wn({
|
|
582
582
|
argument: "separator",
|
|
583
583
|
message: `The separator "${r}" must not be part of the alphabet "${n}".`
|
|
584
584
|
});
|
|
585
585
|
return () => `${e}${r}${i()}`;
|
|
586
|
-
},
|
|
587
|
-
function
|
|
586
|
+
}, tr = I();
|
|
587
|
+
function nr(e) {
|
|
588
588
|
return globalThis.Buffer?.isBuffer(e) ?? !1;
|
|
589
589
|
}
|
|
590
|
-
var
|
|
591
|
-
function
|
|
590
|
+
var rr = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, ir = /"(?: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*:/;
|
|
591
|
+
function ar(e) {
|
|
592
592
|
let t = JSON.parse(e);
|
|
593
|
-
return typeof t != "object" || !t ||
|
|
593
|
+
return typeof t != "object" || !t || rr.test(e) === !1 && ir.test(e) === !1 ? t : or(t);
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function or(e) {
|
|
596
596
|
let t = [e];
|
|
597
597
|
for (; t.length;) {
|
|
598
598
|
let e = t;
|
|
@@ -607,33 +607,33 @@ function ar(e) {
|
|
|
607
607
|
}
|
|
608
608
|
return e;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function sr(e) {
|
|
611
611
|
let { stackTraceLimit: t } = Error;
|
|
612
612
|
try {
|
|
613
613
|
Error.stackTraceLimit = 0;
|
|
614
614
|
} catch {
|
|
615
|
-
return
|
|
615
|
+
return ar(e);
|
|
616
616
|
}
|
|
617
617
|
try {
|
|
618
|
-
return
|
|
618
|
+
return ar(e);
|
|
619
619
|
} finally {
|
|
620
620
|
Error.stackTraceLimit = t;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function cr(e) {
|
|
624
624
|
if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
|
|
625
625
|
let { additionalProperties: t } = e;
|
|
626
|
-
e.additionalProperties = t != null && typeof t != "boolean" &&
|
|
626
|
+
e.additionalProperties = t != null && typeof t != "boolean" && L(t);
|
|
627
627
|
let { properties: n } = e;
|
|
628
|
-
if (n != null) for (let e of Object.keys(n)) n[e] =
|
|
628
|
+
if (n != null) for (let e of Object.keys(n)) n[e] = L(n[e]);
|
|
629
629
|
}
|
|
630
|
-
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(
|
|
630
|
+
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(L) : L(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(L)), e.allOf != null && (e.allOf = e.allOf.map(L)), e.oneOf != null && (e.oneOf = e.oneOf.map(L));
|
|
631
631
|
let { definitions: t } = e;
|
|
632
|
-
if (t != null) for (let e of Object.keys(t)) t[e] =
|
|
632
|
+
if (t != null) for (let e of Object.keys(t)) t[e] = L(t[e]);
|
|
633
633
|
return e;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
return typeof e == "boolean" ? e :
|
|
635
|
+
function L(e) {
|
|
636
|
+
return typeof e == "boolean" ? e : cr(e);
|
|
637
637
|
}
|
|
638
638
|
var lr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), ur = {
|
|
639
639
|
name: void 0,
|
|
@@ -1386,7 +1386,7 @@ function ci(e) {
|
|
|
1386
1386
|
function li(e) {
|
|
1387
1387
|
return oi(() => {
|
|
1388
1388
|
if (!ui(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
|
|
1389
|
-
return
|
|
1389
|
+
return cr(e["~standard"].jsonSchema.input({ target: "draft-07" }));
|
|
1390
1390
|
}, { validate: async (t) => {
|
|
1391
1391
|
let n = await e["~standard"].validate(t);
|
|
1392
1392
|
return "value" in n ? {
|
|
@@ -1394,7 +1394,7 @@ function li(e) {
|
|
|
1394
1394
|
value: n.value
|
|
1395
1395
|
} : {
|
|
1396
1396
|
success: !1,
|
|
1397
|
-
error: new
|
|
1397
|
+
error: new In({
|
|
1398
1398
|
value: t,
|
|
1399
1399
|
cause: n.issues
|
|
1400
1400
|
})
|
|
@@ -1419,12 +1419,12 @@ function di(e, t) {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
function fi(e, t) {
|
|
1421
1421
|
let n = t?.useReferences ?? !1;
|
|
1422
|
-
return oi(() =>
|
|
1422
|
+
return oi(() => cr(st(e, {
|
|
1423
1423
|
target: "draft-7",
|
|
1424
1424
|
io: "input",
|
|
1425
1425
|
reused: n ? "ref" : "inline"
|
|
1426
1426
|
})), { validate: async (t) => {
|
|
1427
|
-
let n = await
|
|
1427
|
+
let n = await gt(e, t);
|
|
1428
1428
|
return n.success ? {
|
|
1429
1429
|
success: !0,
|
|
1430
1430
|
value: n.data
|
|
@@ -1446,7 +1446,7 @@ async function hi({ value: e, schema: t, context: n }) {
|
|
|
1446
1446
|
schema: t,
|
|
1447
1447
|
context: n
|
|
1448
1448
|
});
|
|
1449
|
-
if (!r.success) throw
|
|
1449
|
+
if (!r.success) throw In.wrap({
|
|
1450
1450
|
value: e,
|
|
1451
1451
|
cause: r.error,
|
|
1452
1452
|
context: n
|
|
@@ -1468,7 +1468,7 @@ async function gi({ value: e, schema: t, context: n }) {
|
|
|
1468
1468
|
rawValue: e
|
|
1469
1469
|
} : {
|
|
1470
1470
|
success: !1,
|
|
1471
|
-
error:
|
|
1471
|
+
error: In.wrap({
|
|
1472
1472
|
value: e,
|
|
1473
1473
|
cause: t.error,
|
|
1474
1474
|
context: n
|
|
@@ -1478,7 +1478,7 @@ async function gi({ value: e, schema: t, context: n }) {
|
|
|
1478
1478
|
} catch (t) {
|
|
1479
1479
|
return {
|
|
1480
1480
|
success: !1,
|
|
1481
|
-
error:
|
|
1481
|
+
error: In.wrap({
|
|
1482
1482
|
value: e,
|
|
1483
1483
|
cause: t,
|
|
1484
1484
|
context: n
|
|
@@ -1489,7 +1489,7 @@ async function gi({ value: e, schema: t, context: n }) {
|
|
|
1489
1489
|
}
|
|
1490
1490
|
async function _i({ text: e, schema: t }) {
|
|
1491
1491
|
try {
|
|
1492
|
-
let n =
|
|
1492
|
+
let n = sr(e);
|
|
1493
1493
|
return t == null ? {
|
|
1494
1494
|
success: !0,
|
|
1495
1495
|
value: n,
|
|
@@ -1501,7 +1501,7 @@ async function _i({ text: e, schema: t }) {
|
|
|
1501
1501
|
} catch (t) {
|
|
1502
1502
|
return {
|
|
1503
1503
|
success: !1,
|
|
1504
|
-
error:
|
|
1504
|
+
error: An.isInstance(t) ? t : new An({
|
|
1505
1505
|
text: e,
|
|
1506
1506
|
cause: t
|
|
1507
1507
|
}),
|
|
@@ -1510,7 +1510,7 @@ async function _i({ text: e, schema: t }) {
|
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
1512
|
function vi({ stream: e, schema: t }) {
|
|
1513
|
-
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
1513
|
+
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Zn()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
|
|
1514
1514
|
e !== "[DONE]" && n.enqueue(await _i({
|
|
1515
1515
|
text: e,
|
|
1516
1516
|
schema: t
|
|
@@ -1526,7 +1526,7 @@ var bi = Object.defineProperty, xi = (e, t) => {
|
|
|
1526
1526
|
get: t[n],
|
|
1527
1527
|
enumerable: !0
|
|
1528
1528
|
});
|
|
1529
|
-
}, Si = "AI_InvalidArgumentError", Ci = `vercel.ai.error.${Si}`, wi = Symbol.for(Ci), Ti, Ei, Di = class extends (Ei =
|
|
1529
|
+
}, Si = "AI_InvalidArgumentError", Ci = `vercel.ai.error.${Si}`, wi = Symbol.for(Ci), Ti, Ei, Di = class extends (Ei = F, Ti = wi, Ei) {
|
|
1530
1530
|
constructor({ parameter: e, value: t, message: n }) {
|
|
1531
1531
|
super({
|
|
1532
1532
|
name: Si,
|
|
@@ -1534,9 +1534,9 @@ var bi = Object.defineProperty, xi = (e, t) => {
|
|
|
1534
1534
|
}), this[Ti] = !0, this.parameter = e, this.value = t;
|
|
1535
1535
|
}
|
|
1536
1536
|
static isInstance(e) {
|
|
1537
|
-
return
|
|
1537
|
+
return F.hasMarker(e, Ci);
|
|
1538
1538
|
}
|
|
1539
|
-
}, Oi = "AI_NoObjectGeneratedError", ki = `vercel.ai.error.${Oi}`, Ai = Symbol.for(ki), ji, Mi, U = class extends (Mi =
|
|
1539
|
+
}, Oi = "AI_NoObjectGeneratedError", ki = `vercel.ai.error.${Oi}`, Ai = Symbol.for(ki), ji, Mi, U = class extends (Mi = F, ji = Ai, Mi) {
|
|
1540
1540
|
constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
|
|
1541
1541
|
super({
|
|
1542
1542
|
name: Oi,
|
|
@@ -1545,9 +1545,9 @@ var bi = Object.defineProperty, xi = (e, t) => {
|
|
|
1545
1545
|
}), this[ji] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
|
|
1546
1546
|
}
|
|
1547
1547
|
static isInstance(e) {
|
|
1548
|
-
return
|
|
1548
|
+
return F.hasMarker(e, ki);
|
|
1549
1549
|
}
|
|
1550
|
-
}, Ni = "AI_UIMessageStreamError", Pi = `vercel.ai.error.${Ni}`, Fi = Symbol.for(Pi), Ii, Li, Ri = class extends (Li =
|
|
1550
|
+
}, Ni = "AI_UIMessageStreamError", Pi = `vercel.ai.error.${Ni}`, Fi = Symbol.for(Pi), Ii, Li, Ri = class extends (Li = F, Ii = Fi, Li) {
|
|
1551
1551
|
constructor({ chunkType: e, chunkId: t, message: n }) {
|
|
1552
1552
|
super({
|
|
1553
1553
|
name: Ni,
|
|
@@ -1555,7 +1555,7 @@ var bi = Object.defineProperty, xi = (e, t) => {
|
|
|
1555
1555
|
}), this[Ii] = !0, this.chunkType = e, this.chunkId = t;
|
|
1556
1556
|
}
|
|
1557
1557
|
static isInstance(e) {
|
|
1558
|
-
return
|
|
1558
|
+
return F.hasMarker(e, Pi);
|
|
1559
1559
|
}
|
|
1560
1560
|
};
|
|
1561
1561
|
function zi({ warning: e, provider: t, model: n }) {
|
|
@@ -1613,23 +1613,23 @@ function Wi(e, t) {
|
|
|
1613
1613
|
return n;
|
|
1614
1614
|
}
|
|
1615
1615
|
var W = {
|
|
1616
|
-
array:
|
|
1617
|
-
boolean:
|
|
1618
|
-
custom:
|
|
1619
|
-
discriminatedUnion:
|
|
1620
|
-
enum:
|
|
1621
|
-
instanceof:
|
|
1622
|
-
lazy:
|
|
1623
|
-
literal:
|
|
1624
|
-
looseObject:
|
|
1625
|
-
never:
|
|
1626
|
-
null:
|
|
1627
|
-
number:
|
|
1628
|
-
object:
|
|
1629
|
-
record:
|
|
1630
|
-
string:
|
|
1631
|
-
union:
|
|
1632
|
-
unknown:
|
|
1616
|
+
array: Qe,
|
|
1617
|
+
boolean: ft,
|
|
1618
|
+
custom: Ze,
|
|
1619
|
+
discriminatedUnion: rt,
|
|
1620
|
+
enum: Xe,
|
|
1621
|
+
instanceof: tt,
|
|
1622
|
+
lazy: it,
|
|
1623
|
+
literal: et,
|
|
1624
|
+
looseObject: qe,
|
|
1625
|
+
never: mt,
|
|
1626
|
+
null: nt,
|
|
1627
|
+
number: ut,
|
|
1628
|
+
object: pt,
|
|
1629
|
+
record: at,
|
|
1630
|
+
string: dt,
|
|
1631
|
+
union: ot,
|
|
1632
|
+
unknown: lt
|
|
1633
1633
|
}, Gi = W.lazy(() => W.union([
|
|
1634
1634
|
W.null(),
|
|
1635
1635
|
W.string(),
|
|
@@ -1641,7 +1641,7 @@ var W = {
|
|
|
1641
1641
|
W.string(),
|
|
1642
1642
|
W.instanceof(Uint8Array),
|
|
1643
1643
|
W.instanceof(ArrayBuffer),
|
|
1644
|
-
W.custom(
|
|
1644
|
+
W.custom(nr, { message: "Must be a Buffer" })
|
|
1645
1645
|
]), qi = W.record(W.string(), W.string()), Ji = W.object({
|
|
1646
1646
|
type: W.literal("text"),
|
|
1647
1647
|
text: W.string(),
|
|
@@ -2166,7 +2166,7 @@ var pa = () => ({
|
|
|
2166
2166
|
let o = i.value;
|
|
2167
2167
|
if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new U({
|
|
2168
2168
|
message: "No object generated: response did not match schema.",
|
|
2169
|
-
cause: new
|
|
2169
|
+
cause: new In({
|
|
2170
2170
|
value: o,
|
|
2171
2171
|
cause: "response must be an object with an elements array"
|
|
2172
2172
|
}),
|
|
@@ -2259,11 +2259,11 @@ function ga({ name: e, value: t }) {
|
|
|
2259
2259
|
}
|
|
2260
2260
|
}
|
|
2261
2261
|
function _a({ value: e, minItems: t, maxItems: n }) {
|
|
2262
|
-
if (t != null && e.length < t) return new
|
|
2262
|
+
if (t != null && e.length < t) return new In({
|
|
2263
2263
|
value: e,
|
|
2264
2264
|
cause: `elements array must contain at least ${t} items`
|
|
2265
2265
|
});
|
|
2266
|
-
if (n != null && e.length > n) return new
|
|
2266
|
+
if (n != null && e.length > n) return new In({
|
|
2267
2267
|
value: e,
|
|
2268
2268
|
cause: `elements array must contain at most ${n} items`
|
|
2269
2269
|
});
|
|
@@ -2298,7 +2298,7 @@ var va = ({ options: e, name: t, description: n }) => ({
|
|
|
2298
2298
|
let i = r.value;
|
|
2299
2299
|
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new U({
|
|
2300
2300
|
message: "No object generated: response did not match schema.",
|
|
2301
|
-
cause: new
|
|
2301
|
+
cause: new In({
|
|
2302
2302
|
value: i,
|
|
2303
2303
|
cause: "response must be an object that contains a choice value."
|
|
2304
2304
|
}),
|
|
@@ -2354,10 +2354,10 @@ var va = ({ options: e, name: t, description: n }) => ({
|
|
|
2354
2354
|
},
|
|
2355
2355
|
createElementStreamTransform() {}
|
|
2356
2356
|
});
|
|
2357
|
-
new TextEncoder(), new TextEncoder(),
|
|
2357
|
+
new TextEncoder(), new TextEncoder(), I({
|
|
2358
2358
|
prefix: "aitxt",
|
|
2359
2359
|
size: 24
|
|
2360
|
-
}),
|
|
2360
|
+
}), I({
|
|
2361
2361
|
prefix: "call",
|
|
2362
2362
|
size: 24
|
|
2363
2363
|
});
|
|
@@ -3067,25 +3067,25 @@ async function Fa({ stream: e, onError: t, abortSignal: n }) {
|
|
|
3067
3067
|
n?.removeEventListener("abort", i), r.releaseLock();
|
|
3068
3068
|
}
|
|
3069
3069
|
}
|
|
3070
|
-
|
|
3070
|
+
I({
|
|
3071
3071
|
prefix: "aitxt",
|
|
3072
3072
|
size: 24
|
|
3073
|
-
}),
|
|
3073
|
+
}), I({
|
|
3074
3074
|
prefix: "call",
|
|
3075
3075
|
size: 24
|
|
3076
|
-
}),
|
|
3076
|
+
}), I({
|
|
3077
3077
|
prefix: "aitxt",
|
|
3078
3078
|
size: 24
|
|
3079
|
-
}),
|
|
3079
|
+
}), I({
|
|
3080
3080
|
prefix: "call",
|
|
3081
3081
|
size: 24
|
|
3082
|
-
}), W.record(W.string(), Gi.optional()), W.record(W.string(), W.string()),
|
|
3082
|
+
}), W.record(W.string(), Gi.optional()), W.record(W.string(), W.string()), I({
|
|
3083
3083
|
prefix: "call",
|
|
3084
3084
|
size: 24
|
|
3085
|
-
}),
|
|
3085
|
+
}), I({
|
|
3086
3086
|
prefix: "call",
|
|
3087
3087
|
size: 24
|
|
3088
|
-
}), new TextEncoder(),
|
|
3088
|
+
}), new TextEncoder(), I({
|
|
3089
3089
|
prefix: "aiobj",
|
|
3090
3090
|
size: 24
|
|
3091
3091
|
});
|
|
@@ -3111,7 +3111,7 @@ var { atob: Ia } = globalThis, La = class {
|
|
|
3111
3111
|
});
|
|
3112
3112
|
}
|
|
3113
3113
|
};
|
|
3114
|
-
|
|
3114
|
+
I({
|
|
3115
3115
|
prefix: "aiobj",
|
|
3116
3116
|
size: 24
|
|
3117
3117
|
}), W.object({
|
|
@@ -3131,13 +3131,13 @@ L({
|
|
|
3131
3131
|
description: W.string().optional(),
|
|
3132
3132
|
parameters: W.record(W.string(), W.unknown())
|
|
3133
3133
|
})).optional()
|
|
3134
|
-
}),
|
|
3134
|
+
}), I({
|
|
3135
3135
|
prefix: "call",
|
|
3136
3136
|
size: 24
|
|
3137
3137
|
});
|
|
3138
3138
|
async function Ra({ response: e, url: t, fallbackMessage: n }) {
|
|
3139
3139
|
let r = await e.text();
|
|
3140
|
-
return new
|
|
3140
|
+
return new dn({
|
|
3141
3141
|
message: r || n,
|
|
3142
3142
|
url: t,
|
|
3143
3143
|
requestBodyValues: void 0,
|
|
@@ -3147,7 +3147,7 @@ async function Ra({ response: e, url: t, fallbackMessage: n }) {
|
|
|
3147
3147
|
}
|
|
3148
3148
|
async function za(e) {
|
|
3149
3149
|
if (e == null) return [];
|
|
3150
|
-
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new
|
|
3150
|
+
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Hn({
|
|
3151
3151
|
functionality: "FileList",
|
|
3152
3152
|
message: "FileList is not supported in the current environment"
|
|
3153
3153
|
});
|
|
@@ -3176,8 +3176,8 @@ var Va = class {
|
|
|
3176
3176
|
}
|
|
3177
3177
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
3178
3178
|
let n = await yi(this.body), r = await yi(this.headers), i = await yi(this.credentials), a = {
|
|
3179
|
-
|
|
3180
|
-
|
|
3179
|
+
...er(r),
|
|
3180
|
+
...er(t.headers)
|
|
3181
3181
|
}, o = await this.prepareSendMessagesRequest?.call(this, {
|
|
3182
3182
|
api: this.api,
|
|
3183
3183
|
id: t.chatId,
|
|
@@ -3191,7 +3191,7 @@ var Va = class {
|
|
|
3191
3191
|
requestMetadata: t.metadata,
|
|
3192
3192
|
trigger: t.trigger,
|
|
3193
3193
|
messageId: t.messageId
|
|
3194
|
-
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a :
|
|
3194
|
+
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : er(o.headers), l = o?.body === void 0 ? {
|
|
3195
3195
|
...n,
|
|
3196
3196
|
...t.body,
|
|
3197
3197
|
id: t.chatId,
|
|
@@ -3213,13 +3213,13 @@ var Va = class {
|
|
|
3213
3213
|
url: s,
|
|
3214
3214
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3215
3215
|
});
|
|
3216
|
-
if (!d.body) throw new
|
|
3216
|
+
if (!d.body) throw new _n({ message: "The response body is empty." });
|
|
3217
3217
|
return this.processResponseStream(d.body);
|
|
3218
3218
|
}
|
|
3219
3219
|
async reconnectToStream(e) {
|
|
3220
3220
|
let t = await yi(this.body), n = await yi(this.headers), r = await yi(this.credentials), i = {
|
|
3221
|
-
|
|
3222
|
-
|
|
3221
|
+
...er(n),
|
|
3222
|
+
...er(e.headers)
|
|
3223
3223
|
}, a = await this.prepareReconnectToStreamRequest?.call(this, {
|
|
3224
3224
|
api: this.api,
|
|
3225
3225
|
id: e.chatId,
|
|
@@ -3230,7 +3230,7 @@ var Va = class {
|
|
|
3230
3230
|
headers: i,
|
|
3231
3231
|
credentials: r,
|
|
3232
3232
|
requestMetadata: e.metadata
|
|
3233
|
-
}), o = a?.api ?? Ba(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i :
|
|
3233
|
+
}), o = a?.api ?? Ba(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : er(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
|
|
3234
3234
|
method: "GET",
|
|
3235
3235
|
headers: s,
|
|
3236
3236
|
credentials: c,
|
|
@@ -3242,7 +3242,7 @@ var Va = class {
|
|
|
3242
3242
|
url: o,
|
|
3243
3243
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3244
3244
|
});
|
|
3245
|
-
if (!l.body) throw new
|
|
3245
|
+
if (!l.body) throw new _n({ message: "The response body is empty." });
|
|
3246
3246
|
return this.processResponseStream(l.body);
|
|
3247
3247
|
}
|
|
3248
3248
|
}, Ha = class extends Va {
|
|
@@ -3259,7 +3259,7 @@ var Va = class {
|
|
|
3259
3259
|
} }));
|
|
3260
3260
|
}
|
|
3261
3261
|
}, Ua = class {
|
|
3262
|
-
constructor({ generateId: e =
|
|
3262
|
+
constructor({ generateId: e = tr, id: t = e(), transport: n = new Ha(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
|
|
3263
3263
|
this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new La(), this.sendMessage = async (e, t) => {
|
|
3264
3264
|
if (e == null) {
|
|
3265
3265
|
await this.makeRequest({
|
|
@@ -3542,7 +3542,7 @@ var Ka = /* @__PURE__ */ t(((e, t) => {
|
|
|
3542
3542
|
};
|
|
3543
3543
|
}
|
|
3544
3544
|
t.exports = n;
|
|
3545
|
-
})), q = /* @__PURE__ */ e(o(), 1), qa = /* @__PURE__ */ e(Ka(), 1), J =
|
|
3545
|
+
})), q = /* @__PURE__ */ e(o(), 1), qa = /* @__PURE__ */ e(Ka(), 1), J = Ke(), Ja = (e, t, n) => {
|
|
3546
3546
|
if (!t.has(e)) throw TypeError("Cannot " + n);
|
|
3547
3547
|
}, Y = (e, t, n) => (Ja(e, t, "read from private field"), n ? n.call(e) : t.get(e)), X = (e, t, n) => {
|
|
3548
3548
|
if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
|
|
@@ -3734,7 +3734,7 @@ function go(e) {
|
|
|
3734
3734
|
//#endregion
|
|
3735
3735
|
//#region src/components/chat/agent-activity.tsx
|
|
3736
3736
|
var _o = (e) => {
|
|
3737
|
-
let t = (0,
|
|
3737
|
+
let t = (0, P.c)(19), { running: n, thinking: i, interrupted: a, defaultOpen: o, timing: s, toolCount: c, failedCount: l, steps: u } = e, d = i !== void 0 && i, f = a !== void 0 && a, p = o !== void 0 && o, m = c === void 0 ? 0 : c, h = l === void 0 ? 0 : l, g = u === void 0 ? vo : u, [_, v] = q.useState(), y = _ ?? (n || p), b = xo(n), x = g.length > 0, S;
|
|
3738
3738
|
t[0] !== h || t[1] !== f || t[2] !== b || t[3] !== n || t[4] !== d || t[5] !== s || t[6] !== m ? (S = n ? /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)("output", {
|
|
3739
3739
|
className: yo,
|
|
3740
3740
|
children: d ? "Thinking…" : "Working…"
|
|
@@ -3759,7 +3759,7 @@ var _o = (e) => {
|
|
|
3759
3759
|
onClick: () => v(!y),
|
|
3760
3760
|
"aria-expanded": y,
|
|
3761
3761
|
className: "group/activity -mx-1.5 flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-foreground/6 hover:text-foreground focus-visible:outline-1 focus-visible:outline-(--slate-8)",
|
|
3762
|
-
children: [C, /* @__PURE__ */ (0, J.jsx)(
|
|
3762
|
+
children: [C, /* @__PURE__ */ (0, J.jsx)(he, {
|
|
3763
3763
|
"aria-hidden": !0,
|
|
3764
3764
|
className: r("size-3 shrink-0 opacity-60 transition-transform group-hover/activity:opacity-100", y && "rotate-90")
|
|
3765
3765
|
})]
|
|
@@ -3783,7 +3783,7 @@ function bo({ interrupted: e, timing: t, toolCount: n }) {
|
|
|
3783
3783
|
return e ? r ? `Stopped after ${r}` : "Stopped" : n === 0 ? r ? `Thought for ${r}` : "Thought process" : r ? `Worked for ${r}` : `Worked through ${n} ${n === 1 ? "step" : "steps"}`;
|
|
3784
3784
|
}
|
|
3785
3785
|
function xo(e) {
|
|
3786
|
-
let t = (0,
|
|
3786
|
+
let t = (0, P.c)(3), [n, r] = q.useState(So), i, a;
|
|
3787
3787
|
return t[0] === e ? (i = t[1], a = t[2]) : (i = () => {
|
|
3788
3788
|
if (!e) return;
|
|
3789
3789
|
let t = () => r(Date.now()), n = requestAnimationFrame(t), i = setInterval(t, 1e3);
|
|
@@ -3811,7 +3811,7 @@ var Co = class extends A {
|
|
|
3811
3811
|
let r = e.cellData[t];
|
|
3812
3812
|
return {
|
|
3813
3813
|
uri: this.asURI(t),
|
|
3814
|
-
name:
|
|
3814
|
+
name: Pe(r.name, n),
|
|
3815
3815
|
type: this.contextType,
|
|
3816
3816
|
description: "Cell code",
|
|
3817
3817
|
data: {
|
|
@@ -3828,7 +3828,7 @@ var Co = class extends A {
|
|
|
3828
3828
|
};
|
|
3829
3829
|
}
|
|
3830
3830
|
formatContext(e) {
|
|
3831
|
-
return
|
|
3831
|
+
return M({
|
|
3832
3832
|
type: "cell",
|
|
3833
3833
|
data: {
|
|
3834
3834
|
cellId: e.data.cellId,
|
|
@@ -3891,7 +3891,7 @@ var To = class extends A {
|
|
|
3891
3891
|
detail: `${t.outputType} output`,
|
|
3892
3892
|
boost: t.outputType === "media" ? O.HIGH : O.MEDIUM,
|
|
3893
3893
|
type: this.contextType,
|
|
3894
|
-
section:
|
|
3894
|
+
section: ie.CELL_OUTPUT,
|
|
3895
3895
|
apply: `@${n}`,
|
|
3896
3896
|
info: () => {
|
|
3897
3897
|
let e = document.createElement("div");
|
|
@@ -3928,7 +3928,7 @@ var To = class extends A {
|
|
|
3928
3928
|
outputType: t.outputType,
|
|
3929
3929
|
mimetype: t.output.mimetype
|
|
3930
3930
|
}, o = `Cell Code:\n${i}\n\n`;
|
|
3931
|
-
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}`)),
|
|
3931
|
+
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}`)), M({
|
|
3932
3932
|
type: this.contextType,
|
|
3933
3933
|
data: a,
|
|
3934
3934
|
details: o
|
|
@@ -3943,7 +3943,7 @@ async function Eo(e, t, r) {
|
|
|
3943
3943
|
let i = e.filter((e) => e.shouldDownloadImage && e.outputType === "media");
|
|
3944
3944
|
if (i.length === 0) return [];
|
|
3945
3945
|
let a = i.flatMap((e) => {
|
|
3946
|
-
let i = document.getElementById(
|
|
3946
|
+
let i = document.getElementById(ke.create(t));
|
|
3947
3947
|
return i ? {
|
|
3948
3948
|
cellId: t,
|
|
3949
3949
|
cellName: r,
|
|
@@ -3956,15 +3956,15 @@ async function Eo(e, t, r) {
|
|
|
3956
3956
|
type: "file",
|
|
3957
3957
|
filename: `${r}-output-screenshot`,
|
|
3958
3958
|
mediaType: "image/png",
|
|
3959
|
-
url: await
|
|
3959
|
+
url: await se(e.element)
|
|
3960
3960
|
})));
|
|
3961
3961
|
} catch (e) {
|
|
3962
3962
|
return n.error("Error downloading cell output images:", e), [];
|
|
3963
3963
|
}
|
|
3964
3964
|
}
|
|
3965
3965
|
function Do(e) {
|
|
3966
|
-
if (
|
|
3967
|
-
let t = e.mimetype, n = wo(t, String(e.data)) ? "media" : "text", r =
|
|
3966
|
+
if (E(e)) return null;
|
|
3967
|
+
let t = e.mimetype, n = wo(t, String(e.data)) ? "media" : "text", r = Be(e), i, a = !1;
|
|
3968
3968
|
return n === "media" && (typeof e.data == "string" && e.data.startsWith("data:") || typeof e.data == "string" && e.data.startsWith("http") ? i = e.data : a = !0), {
|
|
3969
3969
|
processedContent: r,
|
|
3970
3970
|
imageUrl: i,
|
|
@@ -3974,10 +3974,10 @@ function Do(e) {
|
|
|
3974
3974
|
};
|
|
3975
3975
|
}
|
|
3976
3976
|
function Oo(e, t, n) {
|
|
3977
|
-
let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.indexOf(e), s =
|
|
3977
|
+
let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.indexOf(e), s = Pe(a.name, o), c;
|
|
3978
3978
|
r && (c = i.consoleOutputs.map((e) => Do(e)).filter((e) => e !== null));
|
|
3979
3979
|
let l, u = i.output;
|
|
3980
|
-
return u && !
|
|
3980
|
+
return u && !E(u) && (l = Do(u) ?? void 0), {
|
|
3981
3981
|
cellId: e,
|
|
3982
3982
|
cellName: s,
|
|
3983
3983
|
cellCode: a.code,
|
|
@@ -3989,14 +3989,14 @@ function Oo(e, t, n) {
|
|
|
3989
3989
|
//#region src/core/ai/context/providers/error.ts
|
|
3990
3990
|
function ko(e, t) {
|
|
3991
3991
|
let n = [`Code:\n${e.cellCode}`];
|
|
3992
|
-
if (e.tracebackHtml && n.push(`Traceback:\n${
|
|
3993
|
-
let r =
|
|
3992
|
+
if (e.tracebackHtml && n.push(`Traceback:\n${Oe(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => Ne(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
|
|
3993
|
+
let r = le(e.cellId, t);
|
|
3994
3994
|
r && n.push(`Database schema:\n${r}`);
|
|
3995
3995
|
}
|
|
3996
3996
|
return n.join("\n\n");
|
|
3997
3997
|
}
|
|
3998
3998
|
function Ao(e, t) {
|
|
3999
|
-
return
|
|
3999
|
+
return M({
|
|
4000
4000
|
type: "error",
|
|
4001
4001
|
data: {
|
|
4002
4002
|
name: e.cellName || `Cell ${e.cellId}`,
|
|
@@ -4006,12 +4006,12 @@ function Ao(e, t) {
|
|
|
4006
4006
|
});
|
|
4007
4007
|
}
|
|
4008
4008
|
function jo(e) {
|
|
4009
|
-
return e.errorData.length === 1 ?
|
|
4009
|
+
return e.errorData.length === 1 ? Fe(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";
|
|
4010
4010
|
}
|
|
4011
4011
|
function Mo(e) {
|
|
4012
4012
|
return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
|
|
4013
4013
|
}
|
|
4014
|
-
var No = new
|
|
4014
|
+
var No = new T("error", "errors"), Po = class extends A {
|
|
4015
4015
|
title = "Errors";
|
|
4016
4016
|
mentionPrefix = "@";
|
|
4017
4017
|
contextType = "error";
|
|
@@ -4053,7 +4053,7 @@ var No = new w("error", "errors"), Po = class extends A {
|
|
|
4053
4053
|
detail: `${t} ${No.pluralize(t)}`,
|
|
4054
4054
|
type: "error",
|
|
4055
4055
|
apply: "@error://all",
|
|
4056
|
-
section:
|
|
4056
|
+
section: ie.ERROR,
|
|
4057
4057
|
info: () => {
|
|
4058
4058
|
let e = document.createElement("div");
|
|
4059
4059
|
e.classList.add("mo-cm-tooltip", "docs-documentation", "min-w-[200px]", "flex", "flex-col", "gap-1", "p-2");
|
|
@@ -4073,19 +4073,19 @@ var No = new w("error", "errors"), Po = class extends A {
|
|
|
4073
4073
|
detail: jo(t),
|
|
4074
4074
|
type: "error"
|
|
4075
4075
|
}),
|
|
4076
|
-
section:
|
|
4076
|
+
section: ie.ERROR
|
|
4077
4077
|
};
|
|
4078
4078
|
}
|
|
4079
4079
|
return {
|
|
4080
4080
|
label: "Error",
|
|
4081
4081
|
displayLabel: "Error",
|
|
4082
|
-
section:
|
|
4082
|
+
section: ie.ERROR
|
|
4083
4083
|
};
|
|
4084
4084
|
}
|
|
4085
4085
|
formatContext(e) {
|
|
4086
4086
|
return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => Ao(e, this.store)).join("\n\n");
|
|
4087
4087
|
}
|
|
4088
|
-
}, Fo =
|
|
4088
|
+
}, Fo = fe(), Io = {
|
|
4089
4089
|
maxDepth: 3,
|
|
4090
4090
|
maxResults: 20,
|
|
4091
4091
|
defaultResultsLimit: 5,
|
|
@@ -4192,7 +4192,7 @@ var No = new w("error", "errors"), Po = class extends A {
|
|
|
4192
4192
|
return {
|
|
4193
4193
|
...this.createBasicCompletion(e),
|
|
4194
4194
|
type: "file",
|
|
4195
|
-
section:
|
|
4195
|
+
section: ie.FILE,
|
|
4196
4196
|
boost: t.isDirectory ? O.MEDIUM : O.LOW,
|
|
4197
4197
|
detail: t.path,
|
|
4198
4198
|
displayLabel: `${i} ${r}`,
|
|
@@ -4207,7 +4207,7 @@ var No = new w("error", "errors"), Po = class extends A {
|
|
|
4207
4207
|
description: e.message
|
|
4208
4208
|
}), null));
|
|
4209
4209
|
if (!l) return;
|
|
4210
|
-
let u = l.mimeType || "text/plain", d =
|
|
4210
|
+
let u = l.mimeType || "text/plain", d = Ve({
|
|
4211
4211
|
contents: l.contents ?? "",
|
|
4212
4212
|
mimeType: u,
|
|
4213
4213
|
isBase64: l.isBase64 ?? !1
|
|
@@ -4216,7 +4216,7 @@ var No = new w("error", "errors"), Po = class extends A {
|
|
|
4216
4216
|
from: a,
|
|
4217
4217
|
to: o,
|
|
4218
4218
|
insert: ""
|
|
4219
|
-
} }),
|
|
4219
|
+
} }), Pt(e);
|
|
4220
4220
|
},
|
|
4221
4221
|
info: () => {
|
|
4222
4222
|
let e = document.createElement("div");
|
|
@@ -4230,7 +4230,7 @@ var No = new w("error", "errors"), Po = class extends A {
|
|
|
4230
4230
|
}
|
|
4231
4231
|
formatContext(e) {
|
|
4232
4232
|
let { data: t, name: n } = e;
|
|
4233
|
-
return
|
|
4233
|
+
return M({
|
|
4234
4234
|
type: this.contextType,
|
|
4235
4235
|
data: {
|
|
4236
4236
|
name: n,
|
|
@@ -4270,7 +4270,7 @@ var No = new w("error", "errors"), Po = class extends A {
|
|
|
4270
4270
|
l += `${t}\n`;
|
|
4271
4271
|
}
|
|
4272
4272
|
}
|
|
4273
|
-
return
|
|
4273
|
+
return M({
|
|
4274
4274
|
type: this.contextType,
|
|
4275
4275
|
data: {
|
|
4276
4276
|
name: o,
|
|
@@ -4286,11 +4286,11 @@ var No = new w("error", "errors"), Po = class extends A {
|
|
|
4286
4286
|
displayLabel: t,
|
|
4287
4287
|
detail: n.source === "memory" ? "in-memory" : n.source,
|
|
4288
4288
|
boost: n.source_type === "local" ? O.LOCAL_TABLE : O.REMOTE_TABLE,
|
|
4289
|
-
type:
|
|
4289
|
+
type: re(n),
|
|
4290
4290
|
apply: `@${t}`,
|
|
4291
4291
|
section: {
|
|
4292
|
-
name:
|
|
4293
|
-
rank:
|
|
4292
|
+
name: re(n) === "dataframe" ? "Dataframe" : "Table",
|
|
4293
|
+
rank: ie.TABLE.rank
|
|
4294
4294
|
},
|
|
4295
4295
|
info: () => this.createTableInfoElement(t, n)
|
|
4296
4296
|
};
|
|
@@ -4375,13 +4375,13 @@ var No = new w("error", "errors"), Po = class extends A {
|
|
|
4375
4375
|
displayLabel: n.name,
|
|
4376
4376
|
detail: n.dataType ?? "",
|
|
4377
4377
|
type: this.contextType,
|
|
4378
|
-
section:
|
|
4379
|
-
info: () =>
|
|
4378
|
+
section: ie.VARIABLE,
|
|
4379
|
+
info: () => oe(n)
|
|
4380
4380
|
};
|
|
4381
4381
|
}
|
|
4382
4382
|
formatContext(e) {
|
|
4383
4383
|
let { data: t } = e, { variable: n } = t;
|
|
4384
|
-
return
|
|
4384
|
+
return M({
|
|
4385
4385
|
type: this.contextType,
|
|
4386
4386
|
data: {
|
|
4387
4387
|
name: n.name,
|
|
@@ -4394,11 +4394,11 @@ var No = new w("error", "errors"), Po = class extends A {
|
|
|
4394
4394
|
//#endregion
|
|
4395
4395
|
//#region src/core/ai/context/context.ts
|
|
4396
4396
|
function Bo(e) {
|
|
4397
|
-
let t = e.get(
|
|
4398
|
-
return new k().register(new Ro(n)).register(new zo(r, n)).register(new Po(e)).register(new To(e)).register(new Co(e)).register(new
|
|
4397
|
+
let t = e.get(ce), n = e.get(ee), r = e.get(j);
|
|
4398
|
+
return new k().register(new Ro(n)).register(new zo(r, n)).register(new Po(e)).register(new To(e)).register(new Co(e)).register(new te(t.connectionsMap, n));
|
|
4399
4399
|
}
|
|
4400
4400
|
function Vo() {
|
|
4401
|
-
return new Lo(
|
|
4401
|
+
return new Lo(De());
|
|
4402
4402
|
}
|
|
4403
4403
|
//#endregion
|
|
4404
4404
|
//#region src/components/editor/ai/completion-utils.ts
|
|
@@ -4418,7 +4418,7 @@ async function Uo(e) {
|
|
|
4418
4418
|
type: "file",
|
|
4419
4419
|
mediaType: e.type,
|
|
4420
4420
|
filename: e.name,
|
|
4421
|
-
url: await
|
|
4421
|
+
url: await ze(e, "dataUrl")
|
|
4422
4422
|
})));
|
|
4423
4423
|
}
|
|
4424
4424
|
function Wo(e) {
|
|
@@ -4430,7 +4430,7 @@ function Wo(e) {
|
|
|
4430
4430
|
//#endregion
|
|
4431
4431
|
//#region src/components/chat/chat-components.tsx
|
|
4432
4432
|
var Go = (e) => {
|
|
4433
|
-
let t = (0,
|
|
4433
|
+
let t = (0, P.c)(6), { attachment: n } = e;
|
|
4434
4434
|
if (n.mediaType?.startsWith("image/")) {
|
|
4435
4435
|
let e = n.filename || "Attachment", r;
|
|
4436
4436
|
return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, J.jsx)("img", {
|
|
@@ -4440,14 +4440,14 @@ var Go = (e) => {
|
|
|
4440
4440
|
}), t[0] = n.url, t[1] = e, t[2] = r) : r = t[2], r;
|
|
4441
4441
|
}
|
|
4442
4442
|
let r;
|
|
4443
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, J.jsx)(
|
|
4443
|
+
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];
|
|
4444
4444
|
let i = n.filename || "Attachment", a;
|
|
4445
4445
|
return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4446
4446
|
className: "flex flex-row gap-1 items-center text-xs",
|
|
4447
4447
|
children: [r, i]
|
|
4448
4448
|
}), t[4] = i, t[5] = a), a;
|
|
4449
4449
|
}, Ko = (e) => {
|
|
4450
|
-
let t = (0,
|
|
4450
|
+
let t = (0, P.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
|
|
4451
4451
|
t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, J.jsx)("span", {
|
|
4452
4452
|
className: "truncate font-medium",
|
|
4453
4453
|
children: r
|
|
@@ -4468,7 +4468,7 @@ var Go = (e) => {
|
|
|
4468
4468
|
s
|
|
4469
4469
|
] }), t[4] = n, t[5] = o, t[6] = s, t[7] = c) : c = t[7];
|
|
4470
4470
|
let l = c;
|
|
4471
|
-
if (a &&
|
|
4471
|
+
if (a && Ce(a)) {
|
|
4472
4472
|
let e = i ?? r, n;
|
|
4473
4473
|
return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, J.jsx)("a", {
|
|
4474
4474
|
href: a,
|
|
@@ -4489,8 +4489,8 @@ var Go = (e) => {
|
|
|
4489
4489
|
//#endregion
|
|
4490
4490
|
//#region src/components/chat/chat-markdown.tsx
|
|
4491
4491
|
function qo(e) {
|
|
4492
|
-
let t = (0,
|
|
4493
|
-
return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ (0, J.jsx)(
|
|
4492
|
+
let t = (0, P.c)(3), { content: n } = e, r = Je(ct)?.mode, i = r !== "agent" && r !== "code_mode", a;
|
|
4493
|
+
return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ (0, J.jsx)(ae, {
|
|
4494
4494
|
content: n,
|
|
4495
4495
|
allowNotebookInsertion: i
|
|
4496
4496
|
}), t[0] = n, t[1] = i, t[2] = a) : a = t[2], a;
|
|
@@ -4508,7 +4508,7 @@ function Yo(e) {
|
|
|
4508
4508
|
//#endregion
|
|
4509
4509
|
//#region src/components/chat/tool-call/tool-args.tsx
|
|
4510
4510
|
var Xo = (e) => {
|
|
4511
|
-
let t = (0,
|
|
4511
|
+
let t = (0, P.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
|
|
4512
4512
|
if (n == null) return null;
|
|
4513
4513
|
let a;
|
|
4514
4514
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, J.jsx)("h3", {
|
|
@@ -4528,12 +4528,12 @@ var Xo = (e) => {
|
|
|
4528
4528
|
children: [a, s]
|
|
4529
4529
|
}), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4530
4530
|
}, Zo = (e) => {
|
|
4531
|
-
let t = (0,
|
|
4531
|
+
let t = (0, P.c)(27), { toolName: n, input: i, approval: o, onApprove: s, className: c } = e, l;
|
|
4532
4532
|
t[0] === c ? l = t[1] : (l = r("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
|
|
4533
4533
|
let u;
|
|
4534
4534
|
t[2] === n ? u = t[3] : (u = Yo(n), t[2] = n, t[3] = u);
|
|
4535
4535
|
let d = `Approval required for ${u}`, f;
|
|
4536
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(
|
|
4536
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(en, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
|
|
4537
4537
|
let p;
|
|
4538
4538
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)("span", {
|
|
4539
4539
|
className: "font-semibold",
|
|
@@ -4597,27 +4597,27 @@ var Xo = (e) => {
|
|
|
4597
4597
|
get_marimo_rules: {
|
|
4598
4598
|
running: "Reading marimo guidelines",
|
|
4599
4599
|
done: "Read marimo guidelines",
|
|
4600
|
-
icon:
|
|
4600
|
+
icon: Vt
|
|
4601
4601
|
},
|
|
4602
4602
|
get_active_notebooks: {
|
|
4603
4603
|
running: "Listing notebooks",
|
|
4604
4604
|
done: "Listed notebooks",
|
|
4605
|
-
icon:
|
|
4605
|
+
icon: Jt
|
|
4606
4606
|
},
|
|
4607
4607
|
get_lightweight_cell_map: {
|
|
4608
4608
|
running: "Reading notebook",
|
|
4609
4609
|
done: "Read notebook",
|
|
4610
|
-
icon:
|
|
4610
|
+
icon: Kt
|
|
4611
4611
|
},
|
|
4612
4612
|
get_cell_runtime_data: {
|
|
4613
4613
|
running: "Inspecting cells",
|
|
4614
4614
|
done: "Inspected cells",
|
|
4615
|
-
icon:
|
|
4615
|
+
icon: Zt
|
|
4616
4616
|
},
|
|
4617
4617
|
get_cell_outputs: {
|
|
4618
4618
|
running: "Reading cell outputs",
|
|
4619
4619
|
done: "Read cell outputs",
|
|
4620
|
-
icon:
|
|
4620
|
+
icon: Zt
|
|
4621
4621
|
},
|
|
4622
4622
|
get_tables_and_variables: {
|
|
4623
4623
|
running: "Reading variables",
|
|
@@ -4627,38 +4627,38 @@ var Xo = (e) => {
|
|
|
4627
4627
|
get_database_tables: {
|
|
4628
4628
|
running: "Reading database tables",
|
|
4629
4629
|
done: "Read database tables",
|
|
4630
|
-
icon:
|
|
4630
|
+
icon: d
|
|
4631
4631
|
},
|
|
4632
4632
|
get_notebook_errors: {
|
|
4633
4633
|
running: "Checking for errors",
|
|
4634
4634
|
done: "Checked for errors",
|
|
4635
|
-
icon:
|
|
4635
|
+
icon: Wt
|
|
4636
4636
|
},
|
|
4637
4637
|
lint_notebook: {
|
|
4638
4638
|
running: "Linting notebook",
|
|
4639
4639
|
done: "Linted notebook",
|
|
4640
|
-
icon:
|
|
4640
|
+
icon: qt
|
|
4641
4641
|
},
|
|
4642
4642
|
get_cell_dependency_graph: {
|
|
4643
4643
|
running: "Reading dependency graph",
|
|
4644
4644
|
done: "Read dependency graph",
|
|
4645
|
-
icon:
|
|
4645
|
+
icon: b
|
|
4646
4646
|
}
|
|
4647
4647
|
}, $o = {
|
|
4648
4648
|
add_cell: {
|
|
4649
4649
|
running: "Adding cell",
|
|
4650
4650
|
done: "Added cell",
|
|
4651
|
-
icon:
|
|
4651
|
+
icon: _e
|
|
4652
4652
|
},
|
|
4653
4653
|
update_cell: {
|
|
4654
4654
|
running: "Editing cell",
|
|
4655
4655
|
done: "Edited cell",
|
|
4656
|
-
icon:
|
|
4656
|
+
icon: He
|
|
4657
4657
|
},
|
|
4658
4658
|
delete_cell: {
|
|
4659
4659
|
running: "Deleting cell",
|
|
4660
4660
|
done: "Deleted cell",
|
|
4661
|
-
icon:
|
|
4661
|
+
icon: y
|
|
4662
4662
|
}
|
|
4663
4663
|
};
|
|
4664
4664
|
function es(e, t, n) {
|
|
@@ -4666,7 +4666,7 @@ function es(e, t, n) {
|
|
|
4666
4666
|
if (r === "execute_code") return {
|
|
4667
4667
|
label: n === "running" ? "Running code" : "Ran code",
|
|
4668
4668
|
detail: rs(t) ? ns(t.code) : void 0,
|
|
4669
|
-
icon:
|
|
4669
|
+
icon: u
|
|
4670
4670
|
};
|
|
4671
4671
|
if (r === "edit_notebook_tool") {
|
|
4672
4672
|
let e = ts(t);
|
|
@@ -4680,7 +4680,7 @@ function es(e, t, n) {
|
|
|
4680
4680
|
}
|
|
4681
4681
|
return {
|
|
4682
4682
|
label: n === "running" ? "Editing notebook" : "Edited notebook",
|
|
4683
|
-
icon:
|
|
4683
|
+
icon: He
|
|
4684
4684
|
};
|
|
4685
4685
|
}
|
|
4686
4686
|
if (Object.hasOwn(Qo, r)) {
|
|
@@ -4693,7 +4693,7 @@ function es(e, t, n) {
|
|
|
4693
4693
|
return {
|
|
4694
4694
|
label: n === "running" ? "Calling" : "Called",
|
|
4695
4695
|
detail: r,
|
|
4696
|
-
icon:
|
|
4696
|
+
icon: p
|
|
4697
4697
|
};
|
|
4698
4698
|
}
|
|
4699
4699
|
function ts(e) {
|
|
@@ -4715,17 +4715,17 @@ function rs(e) {
|
|
|
4715
4715
|
//#endregion
|
|
4716
4716
|
//#region src/components/chat/tool-call/tool-result.tsx
|
|
4717
4717
|
function is(e) {
|
|
4718
|
-
return e == null || typeof e == "object" &&
|
|
4719
|
-
}
|
|
4720
|
-
var as =
|
|
4721
|
-
status:
|
|
4722
|
-
auth_required:
|
|
4723
|
-
action_url:
|
|
4724
|
-
next_steps:
|
|
4725
|
-
meta:
|
|
4726
|
-
message:
|
|
4718
|
+
return e == null || typeof e == "object" && vt(e);
|
|
4719
|
+
}
|
|
4720
|
+
var as = qe({
|
|
4721
|
+
status: dt().default("success"),
|
|
4722
|
+
auth_required: ft().default(!1),
|
|
4723
|
+
action_url: Ye().optional(),
|
|
4724
|
+
next_steps: Ye().optional(),
|
|
4725
|
+
meta: Ye().optional(),
|
|
4726
|
+
message: dt().nullish()
|
|
4727
4727
|
}), os = (e) => {
|
|
4728
|
-
let t = (0,
|
|
4728
|
+
let t = (0, P.c)(12), { data: n } = e, r;
|
|
4729
4729
|
if (t[0] !== n) {
|
|
4730
4730
|
let { status: e, auth_required: i, action_url: a, meta: o, next_steps: s, message: c, ...l } = n, u;
|
|
4731
4731
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)("h3", {
|
|
@@ -4742,26 +4742,26 @@ var as = Ke({
|
|
|
4742
4742
|
className: "text-xs px-2 py-0.5 bg-(--amber-2) text-(--amber-11) rounded-full",
|
|
4743
4743
|
children: "Auth Required"
|
|
4744
4744
|
}), t[5] = i, t[6] = f);
|
|
4745
|
-
let
|
|
4746
|
-
t[7] !== d || t[8] !== f ? (
|
|
4745
|
+
let p;
|
|
4746
|
+
t[7] !== d || t[8] !== f ? (p = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4747
4747
|
className: "flex items-center justify-between",
|
|
4748
4748
|
children: [u, /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4749
4749
|
className: "flex items-center gap-2",
|
|
4750
4750
|
children: [d, f]
|
|
4751
4751
|
})]
|
|
4752
|
-
}), t[7] = d, t[8] = f, t[9] =
|
|
4753
|
-
let
|
|
4754
|
-
t[10] === c ?
|
|
4752
|
+
}), t[7] = d, t[8] = f, t[9] = p) : p = t[9];
|
|
4753
|
+
let m;
|
|
4754
|
+
t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4755
4755
|
className: "flex items-start gap-2",
|
|
4756
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
4756
|
+
children: [/* @__PURE__ */ (0, J.jsx)(_, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, J.jsx)("div", {
|
|
4757
4757
|
className: "text-xs text-foreground",
|
|
4758
4758
|
children: c
|
|
4759
4759
|
})]
|
|
4760
|
-
}), t[10] = c, t[11] =
|
|
4760
|
+
}), t[10] = c, t[11] = m), r = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4761
4761
|
className: "flex flex-col gap-1.5",
|
|
4762
4762
|
children: [
|
|
4763
|
+
p,
|
|
4763
4764
|
m,
|
|
4764
|
-
h,
|
|
4765
4765
|
l && /* @__PURE__ */ (0, J.jsx)("div", {
|
|
4766
4766
|
className: "space-y-3",
|
|
4767
4767
|
children: Object.entries(l).map(cs)
|
|
@@ -4771,7 +4771,7 @@ var as = Ke({
|
|
|
4771
4771
|
} else r = t[1];
|
|
4772
4772
|
return r;
|
|
4773
4773
|
}, ss = (e) => {
|
|
4774
|
-
let t = (0,
|
|
4774
|
+
let t = (0, P.c)(8), { result: n } = e, r;
|
|
4775
4775
|
t[0] === n ? r = t[1] : (r = as.safeParse(n), t[0] = n, t[1] = r);
|
|
4776
4776
|
let i = r;
|
|
4777
4777
|
if (i.success) {
|
|
@@ -4802,7 +4802,7 @@ function cs(e) {
|
|
|
4802
4802
|
//#endregion
|
|
4803
4803
|
//#region src/components/chat/tool-call/tool-step.tsx
|
|
4804
4804
|
var ls = (e) => {
|
|
4805
|
-
let t = (0,
|
|
4805
|
+
let t = (0, P.c)(58), { toolName: n, state: i, input: a, result: o, errorText: s, approval: c, isActive: l, className: u } = e, d = l === void 0 || l, [f, p] = q.useState(!1), m, h, g, _, v, y, b, x, S, C, w;
|
|
4806
4806
|
if (t[0] !== u || t[1] !== a || t[2] !== d || t[3] !== f || t[4] !== i || t[5] !== n) {
|
|
4807
4807
|
let e = Jo.has(i), { label: o, detail: s, icon: c } = es(n, a, e ? "running" : "done");
|
|
4808
4808
|
g = o, h = s, _ = us(i, e && !d, c);
|
|
@@ -4826,20 +4826,20 @@ var ls = (e) => {
|
|
|
4826
4826
|
className: "min-w-0 truncate font-mono text-[0.6875rem] opacity-80",
|
|
4827
4827
|
children: h
|
|
4828
4828
|
}), t[29] = h, t[30] = D);
|
|
4829
|
-
let
|
|
4830
|
-
t[31] === _.suffix ?
|
|
4829
|
+
let ee;
|
|
4830
|
+
t[31] === _.suffix ? ee = t[32] : (ee = _.suffix && /* @__PURE__ */ (0, J.jsxs)("span", {
|
|
4831
4831
|
className: "shrink-0 opacity-80",
|
|
4832
4832
|
children: ["· ", _.suffix]
|
|
4833
|
-
}), t[31] = _.suffix, t[32] =
|
|
4834
|
-
let
|
|
4835
|
-
t[33] ===
|
|
4836
|
-
let
|
|
4837
|
-
t[35] ===
|
|
4833
|
+
}), t[31] = _.suffix, t[32] = ee);
|
|
4834
|
+
let O = f && "rotate-90 opacity-100", k;
|
|
4835
|
+
t[33] === O ? k = t[34] : (k = r("size-3 shrink-0 opacity-40 transition-transform group-hover/step:opacity-100", O), t[33] = O, t[34] = k);
|
|
4836
|
+
let A;
|
|
4837
|
+
t[35] === k ? A = t[36] : (A = /* @__PURE__ */ (0, J.jsx)(he, {
|
|
4838
4838
|
"aria-hidden": !0,
|
|
4839
|
-
className:
|
|
4840
|
-
}), t[35] =
|
|
4841
|
-
let
|
|
4842
|
-
t[37] !== E || t[38] !== D || t[39] !==
|
|
4839
|
+
className: k
|
|
4840
|
+
}), t[35] = k, t[36] = A);
|
|
4841
|
+
let j;
|
|
4842
|
+
t[37] !== E || t[38] !== D || t[39] !== ee || t[40] !== A || t[41] !== b || t[42] !== x || t[43] !== S || t[44] !== C || t[45] !== T ? (j = /* @__PURE__ */ (0, J.jsxs)("button", {
|
|
4843
4843
|
type: b,
|
|
4844
4844
|
onClick: x,
|
|
4845
4845
|
"aria-expanded": S,
|
|
@@ -4848,47 +4848,47 @@ var ls = (e) => {
|
|
|
4848
4848
|
T,
|
|
4849
4849
|
E,
|
|
4850
4850
|
D,
|
|
4851
|
-
|
|
4852
|
-
|
|
4851
|
+
ee,
|
|
4852
|
+
A
|
|
4853
4853
|
]
|
|
4854
|
-
}), t[37] = E, t[38] = D, t[39] =
|
|
4855
|
-
let
|
|
4856
|
-
t[47] !== c || t[48] !== s || t[49] !== a || t[50] !== f || t[51] !== o || t[52] !== i ? (
|
|
4854
|
+
}), t[37] = E, t[38] = D, t[39] = ee, t[40] = A, t[41] = b, t[42] = x, t[43] = S, t[44] = C, t[45] = T, t[46] = j) : j = t[46];
|
|
4855
|
+
let te;
|
|
4856
|
+
t[47] !== c || t[48] !== s || t[49] !== a || t[50] !== f || t[51] !== o || t[52] !== i ? (te = f && /* @__PURE__ */ (0, J.jsx)(ds, {
|
|
4857
4857
|
state: i,
|
|
4858
4858
|
input: a,
|
|
4859
4859
|
result: o,
|
|
4860
4860
|
errorText: s,
|
|
4861
4861
|
approval: c
|
|
4862
|
-
}), t[47] = c, t[48] = s, t[49] = a, t[50] = f, t[51] = o, t[52] = i, t[53] =
|
|
4863
|
-
let
|
|
4864
|
-
return t[54] !==
|
|
4862
|
+
}), t[47] = c, t[48] = s, t[49] = a, t[50] = f, t[51] = o, t[52] = i, t[53] = te) : te = t[53];
|
|
4863
|
+
let M;
|
|
4864
|
+
return t[54] !== j || t[55] !== te || t[56] !== w ? (M = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4865
4865
|
className: w,
|
|
4866
|
-
children: [
|
|
4867
|
-
}), t[54] =
|
|
4866
|
+
children: [j, te]
|
|
4867
|
+
}), t[54] = j, t[55] = te, t[56] = w, t[57] = M) : M = t[57], M;
|
|
4868
4868
|
};
|
|
4869
4869
|
function us(e, t, n) {
|
|
4870
4870
|
if (t) return {
|
|
4871
|
-
icon:
|
|
4871
|
+
icon: Gt,
|
|
4872
4872
|
suffix: "Stopped"
|
|
4873
4873
|
};
|
|
4874
4874
|
switch (e) {
|
|
4875
4875
|
case "output-error": return {
|
|
4876
|
-
icon:
|
|
4876
|
+
icon: h,
|
|
4877
4877
|
suffix: "Failed"
|
|
4878
4878
|
};
|
|
4879
4879
|
case "output-denied": return {
|
|
4880
|
-
icon:
|
|
4880
|
+
icon: Bt,
|
|
4881
4881
|
suffix: "Denied"
|
|
4882
4882
|
};
|
|
4883
4883
|
case "output-available": return { icon: n };
|
|
4884
4884
|
default: return {
|
|
4885
|
-
icon:
|
|
4885
|
+
icon: m,
|
|
4886
4886
|
spinning: !0
|
|
4887
4887
|
};
|
|
4888
4888
|
}
|
|
4889
4889
|
}
|
|
4890
4890
|
var ds = (e) => {
|
|
4891
|
-
let t = (0,
|
|
4891
|
+
let t = (0, P.c)(16), { state: n, input: r, result: i, errorText: a, approval: o } = e, s;
|
|
4892
4892
|
t[0] === r ? s = t[1] : (s = /* @__PURE__ */ (0, J.jsx)(Xo, { input: r }), t[0] = r, t[1] = s);
|
|
4893
4893
|
let c;
|
|
4894
4894
|
t[2] !== i || t[3] !== n ? (c = n === "output-available" && i != null && /* @__PURE__ */ (0, J.jsx)(ss, { result: i }), t[2] = i, t[3] = n, t[4] = c) : c = t[4];
|
|
@@ -4919,7 +4919,7 @@ function fs(e) {
|
|
|
4919
4919
|
//#endregion
|
|
4920
4920
|
//#region src/components/chat/tool-call/tool-call-view.tsx
|
|
4921
4921
|
var ps = (e) => {
|
|
4922
|
-
let t = (0,
|
|
4922
|
+
let t = (0, P.c)(16), n, r, i, a, o;
|
|
4923
4923
|
if (t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5]) : ({toolName: o, state: a, approval: n, onApprove: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o), a === "approval-requested") {
|
|
4924
4924
|
let e;
|
|
4925
4925
|
return t[6] !== n || t[7] !== r || t[8] !== i || t[9] !== o ? (e = n != null && r != null ? /* @__PURE__ */ (0, J.jsx)(Zo, {
|
|
@@ -4972,13 +4972,13 @@ var ps = (e) => {
|
|
|
4972
4972
|
}, t);
|
|
4973
4973
|
if (bs(e)) return null;
|
|
4974
4974
|
switch (e.type) {
|
|
4975
|
-
case "text": return e.text.includes("<marimo-") ? /* @__PURE__ */ (0, J.jsx)(q.Fragment, { children:
|
|
4975
|
+
case "text": return e.text.includes("<marimo-") ? /* @__PURE__ */ (0, J.jsx)(q.Fragment, { children: v({ html: e.text }) }, t) : /* @__PURE__ */ (0, J.jsx)("div", {
|
|
4976
4976
|
className: n ? "py-1.5" : void 0,
|
|
4977
4977
|
children: /* @__PURE__ */ (0, J.jsx)(qo, { content: e.text })
|
|
4978
4978
|
}, t);
|
|
4979
4979
|
case "reasoning": return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4980
4980
|
className: "flex gap-1.5 py-1.5 text-muted-foreground",
|
|
4981
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
4981
|
+
children: [/* @__PURE__ */ (0, J.jsx)(Ut, {
|
|
4982
4982
|
"aria-hidden": !0,
|
|
4983
4983
|
className: "-ml-px mt-1 size-3 shrink-0"
|
|
4984
4984
|
}), /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
@@ -4996,12 +4996,12 @@ var ps = (e) => {
|
|
|
4996
4996
|
url: e.url
|
|
4997
4997
|
} }, t);
|
|
4998
4998
|
case "source-document": return /* @__PURE__ */ (0, J.jsx)(Ko, {
|
|
4999
|
-
icon: /* @__PURE__ */ (0, J.jsx)(
|
|
4999
|
+
icon: /* @__PURE__ */ (0, J.jsx)(x, { className: "h-3 w-3 shrink-0" }),
|
|
5000
5000
|
title: e.title,
|
|
5001
5001
|
subtitle: e.filename
|
|
5002
5002
|
}, t);
|
|
5003
5003
|
case "source-url": return /* @__PURE__ */ (0, J.jsx)(Ko, {
|
|
5004
|
-
icon: /* @__PURE__ */ (0, J.jsx)(
|
|
5004
|
+
icon: /* @__PURE__ */ (0, J.jsx)(Te, { className: "h-3 w-3 shrink-0" }),
|
|
5005
5005
|
title: e.title ?? e.url,
|
|
5006
5006
|
subtitle: e.title ? e.url : void 0,
|
|
5007
5007
|
href: e.url
|
|
@@ -5011,7 +5011,7 @@ var ps = (e) => {
|
|
|
5011
5011
|
children: e.kind
|
|
5012
5012
|
}, t);
|
|
5013
5013
|
case "step-start": return null;
|
|
5014
|
-
default: return
|
|
5014
|
+
default: return Ue(e), null;
|
|
5015
5015
|
}
|
|
5016
5016
|
}
|
|
5017
5017
|
};
|
|
@@ -5048,11 +5048,11 @@ function bs(e) {
|
|
|
5048
5048
|
//#endregion
|
|
5049
5049
|
//#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
|
|
5050
5050
|
function xs(e) {
|
|
5051
|
-
return
|
|
5051
|
+
return Dt.define({ combine: (t) => t[0] ?? e });
|
|
5052
5052
|
}
|
|
5053
5053
|
//#endregion
|
|
5054
5054
|
//#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
|
|
5055
|
-
var Ss = xs({}), Cs =
|
|
5055
|
+
var Ss = xs({}), Cs = St.define(), ws = St.define(), Ts = 50, Es = xt.define({
|
|
5056
5056
|
create() {
|
|
5057
5057
|
return {
|
|
5058
5058
|
prompts: [],
|
|
@@ -5111,7 +5111,7 @@ function ks(e = {}) {
|
|
|
5111
5111
|
navigationIndex: -1,
|
|
5112
5112
|
originalText: ""
|
|
5113
5113
|
})), Ss.of(t ?? {})];
|
|
5114
|
-
return n && r.push(
|
|
5114
|
+
return n && r.push(At.of([{
|
|
5115
5115
|
key: "ArrowUp",
|
|
5116
5116
|
run: Ds
|
|
5117
5117
|
}, {
|
|
@@ -5121,7 +5121,7 @@ function ks(e = {}) {
|
|
|
5121
5121
|
}
|
|
5122
5122
|
//#endregion
|
|
5123
5123
|
//#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
|
|
5124
|
-
var As =
|
|
5124
|
+
var As = St.define(), Q = xt.define({
|
|
5125
5125
|
create() {
|
|
5126
5126
|
return /* @__PURE__ */ new Map();
|
|
5127
5127
|
},
|
|
@@ -5133,7 +5133,7 @@ var As = xt.define(), Q = bt.define({
|
|
|
5133
5133
|
}
|
|
5134
5134
|
return r;
|
|
5135
5135
|
}
|
|
5136
|
-
}), js =
|
|
5136
|
+
}), js = xt.define({
|
|
5137
5137
|
create() {
|
|
5138
5138
|
return {
|
|
5139
5139
|
onResourceClick: void 0,
|
|
@@ -5145,8 +5145,8 @@ var As = xt.define(), Q = bt.define({
|
|
|
5145
5145
|
update(e) {
|
|
5146
5146
|
return e;
|
|
5147
5147
|
}
|
|
5148
|
-
}), Ms =
|
|
5149
|
-
|
|
5148
|
+
}), Ms = St.define();
|
|
5149
|
+
xt.define({
|
|
5150
5150
|
create() {
|
|
5151
5151
|
return /* @__PURE__ */ new Map();
|
|
5152
5152
|
},
|
|
@@ -5194,7 +5194,7 @@ function $(e) {
|
|
|
5194
5194
|
}
|
|
5195
5195
|
//#endregion
|
|
5196
5196
|
//#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
|
|
5197
|
-
var Fs = class extends
|
|
5197
|
+
var Fs = class extends Et {
|
|
5198
5198
|
resource;
|
|
5199
5199
|
view;
|
|
5200
5200
|
constructor(e, t) {
|
|
@@ -5215,7 +5215,7 @@ var Fs = class extends Tt {
|
|
|
5215
5215
|
e.preventDefault(), e.stopPropagation(), i(this.resource);
|
|
5216
5216
|
}), e;
|
|
5217
5217
|
}
|
|
5218
|
-
}, Is = class extends
|
|
5218
|
+
}, Is = class extends Et {
|
|
5219
5219
|
uri;
|
|
5220
5220
|
view;
|
|
5221
5221
|
constructor(e, t) {
|
|
@@ -5235,12 +5235,12 @@ function Ls(e) {
|
|
|
5235
5235
|
let a = e.state.doc.sliceString(r, i);
|
|
5236
5236
|
for (let i of $(a)) {
|
|
5237
5237
|
let a = r + i.index, o = i[0].slice(1), s = t.get(o);
|
|
5238
|
-
s ? n.push(
|
|
5238
|
+
s ? n.push(Mt.replace({ widget: new Fs(s, e) }).range(a, a + i[0].length)) : n.push(Mt.replace({ widget: new Is(o, e) }).range(a, a + i[0].length));
|
|
5239
5239
|
}
|
|
5240
5240
|
}
|
|
5241
|
-
return
|
|
5241
|
+
return Mt.set(n);
|
|
5242
5242
|
}
|
|
5243
|
-
var Rs =
|
|
5243
|
+
var Rs = wt.fromClass(class {
|
|
5244
5244
|
decorations;
|
|
5245
5245
|
constructor(e) {
|
|
5246
5246
|
this.decorations = Ls(e);
|
|
@@ -5280,7 +5280,7 @@ function Bs(e, t, n, r = 0) {
|
|
|
5280
5280
|
return null;
|
|
5281
5281
|
}
|
|
5282
5282
|
function Vs(e) {
|
|
5283
|
-
return
|
|
5283
|
+
return kt((t, n) => {
|
|
5284
5284
|
let { from: r, text: i } = t.state.doc.lineAt(n), a = Bs(i, n, t.state.field(Q), r);
|
|
5285
5285
|
return a ? {
|
|
5286
5286
|
pos: a.start,
|
|
@@ -5350,8 +5350,8 @@ function Ks(e, t) {
|
|
|
5350
5350
|
}
|
|
5351
5351
|
return null;
|
|
5352
5352
|
}
|
|
5353
|
-
var qs =
|
|
5354
|
-
let t = e.annotation(
|
|
5353
|
+
var qs = jt.transactionFilter.of((e) => {
|
|
5354
|
+
let t = e.annotation(Ot.userEvent);
|
|
5355
5355
|
if (!t) return e;
|
|
5356
5356
|
let n = e.startState.selection.main;
|
|
5357
5357
|
if (!n.empty) return e;
|
|
@@ -5524,11 +5524,11 @@ function $s(e, t) {
|
|
|
5524
5524
|
};
|
|
5525
5525
|
}
|
|
5526
5526
|
function ec(e, t = {}) {
|
|
5527
|
-
return
|
|
5527
|
+
return wt.fromClass($s(e, t));
|
|
5528
5528
|
}
|
|
5529
5529
|
//#endregion
|
|
5530
5530
|
//#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
|
|
5531
|
-
var tc =
|
|
5531
|
+
var tc = Tt.baseTheme({
|
|
5532
5532
|
".cm-resource-widget": {
|
|
5533
5533
|
background: "light-dark(rgba(86,156,214,0.08),rgba(86,156,214,0.18))",
|
|
5534
5534
|
borderRadius: "4px",
|
|
@@ -5561,10 +5561,10 @@ function oc(e) {
|
|
|
5561
5561
|
let { language: t, store: r, onAddFiles: i } = e, a = () => ac(r);
|
|
5562
5562
|
return [
|
|
5563
5563
|
t.data.of({ autocomplete: Ns(async () => a(), (e) => e.type === nc ? ic : Bo(r).getProvider(e.type)?.formatCompletion(e) || {}) }),
|
|
5564
|
-
|
|
5564
|
+
Ct.high(At.of([{
|
|
5565
5565
|
key: "Tab",
|
|
5566
5566
|
preventDefault: !0,
|
|
5567
|
-
run: (e) =>
|
|
5567
|
+
run: (e) => Nt(e)
|
|
5568
5568
|
}])),
|
|
5569
5569
|
Fo.of({ addAttachment: (e) => i?.([e]) }),
|
|
5570
5570
|
...i ? [t.data.of({ autocomplete: Vo().createCompletionSource() })] : [],
|
|
@@ -5593,13 +5593,13 @@ function sc(e) {
|
|
|
5593
5593
|
}
|
|
5594
5594
|
//#endregion
|
|
5595
5595
|
//#region src/components/editor/ai/prompt-input.tsx
|
|
5596
|
-
var cc = "marimo:ai-prompt-history", lc = new
|
|
5597
|
-
let t = (0,
|
|
5596
|
+
var cc = "marimo:ai-prompt-history", lc = new Me(Qe(dt()), () => []), uc = (e) => {
|
|
5597
|
+
let t = (0, P.c)(28), { value: n, placeholder: i, placeholderAction: a, inputRef: o, className: s, onChange: c, onSubmit: l, onKeyDown: u, onClose: d, onAddFiles: f, additionalCompletions: p, maxHeight: m } = e, h = bt(l), _ = bt(d), v = $e(), { theme: y } = ht(), b;
|
|
5598
5598
|
t[0] === p ? b = t[1] : (b = (e) => p ? Ho([p.triggerCompletionRegex], p.completions)(e) : null, t[0] = p, t[1] = b);
|
|
5599
|
-
let x =
|
|
5600
|
-
if (t[2] !== x || t[3] !== _ || t[4] !==
|
|
5601
|
-
let e =
|
|
5602
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (n =
|
|
5599
|
+
let x = bt(b), S;
|
|
5600
|
+
if (t[2] !== x || t[3] !== _ || t[4] !== h || t[5] !== f || t[6] !== a || t[7] !== v) {
|
|
5601
|
+
let e = It(), n;
|
|
5602
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (n = Ft({}), t[9] = n) : n = t[9];
|
|
5603
5603
|
let r = oc({
|
|
5604
5604
|
language: e.language,
|
|
5605
5605
|
store: v,
|
|
@@ -5610,43 +5610,43 @@ var cc = "marimo:ai-prompt-history", lc = new Te(Ze(ut()), () => []), uc = (e) =
|
|
|
5610
5610
|
save: fc
|
|
5611
5611
|
} }), t[10] = o) : o = t[10];
|
|
5612
5612
|
let s;
|
|
5613
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (s =
|
|
5613
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (s = Lt(), t[11] = s) : s = t[11];
|
|
5614
5614
|
let c;
|
|
5615
|
-
t[12] ===
|
|
5615
|
+
t[12] === h ? c = t[13] : (c = Ct.highest(At.of([{
|
|
5616
5616
|
preventDefault: !0,
|
|
5617
5617
|
stopPropagation: !0,
|
|
5618
5618
|
any: (e, t) => {
|
|
5619
5619
|
let n = t.metaKey || t.ctrlKey || t.shiftKey;
|
|
5620
|
-
return t.key === "Enter" && !n ? (
|
|
5620
|
+
return t.key === "Enter" && !n ? (h(t, e.state.doc.toString()), t.preventDefault(), t.stopPropagation(), !0) : t.key === "Enter" && t.shiftKey ? (e.dispatch(e.state.replaceSelection("\n")), t.preventDefault(), t.stopPropagation(), !0) : !1;
|
|
5621
5621
|
}
|
|
5622
|
-
}])), t[12] =
|
|
5622
|
+
}])), t[12] = h, t[13] = c);
|
|
5623
5623
|
let l;
|
|
5624
|
-
t[14] === _ ? l = t[15] : (l =
|
|
5624
|
+
t[14] === _ ? l = t[15] : (l = At.of([{
|
|
5625
5625
|
key: "Escape",
|
|
5626
5626
|
preventDefault: !0,
|
|
5627
5627
|
stopPropagation: !0,
|
|
5628
5628
|
run: () => (_(), !0)
|
|
5629
5629
|
}]), t[14] = _, t[15] = l), S = [
|
|
5630
|
-
...a ?
|
|
5630
|
+
...a ? g(a) : [],
|
|
5631
5631
|
n,
|
|
5632
5632
|
e,
|
|
5633
5633
|
r,
|
|
5634
5634
|
i,
|
|
5635
5635
|
o,
|
|
5636
|
-
|
|
5636
|
+
Tt.lineWrapping,
|
|
5637
5637
|
s,
|
|
5638
5638
|
c,
|
|
5639
5639
|
l
|
|
5640
|
-
], t[2] = x, t[3] = _, t[4] =
|
|
5640
|
+
], t[2] = x, t[3] = _, t[4] = h, t[5] = f, t[6] = a, t[7] = v, t[8] = S;
|
|
5641
5641
|
} else S = t[8];
|
|
5642
5642
|
let C = S, w;
|
|
5643
5643
|
t[16] === s ? w = t[17] : (w = r("mo-ai-prompt flex-1 font-sans text-sm leading-6 overflow-auto my-1", s), t[16] = s, t[17] = w);
|
|
5644
5644
|
let T = y === "dark" ? "dark" : "light", E = a ? void 0 : i || "Generate with AI, @ to include context", D;
|
|
5645
|
-
return t[18] !== C || t[19] !== o || t[20] !==
|
|
5645
|
+
return t[18] !== C || t[19] !== o || t[20] !== m || t[21] !== c || t[22] !== u || t[23] !== w || t[24] !== T || t[25] !== E || t[26] !== n ? (D = /* @__PURE__ */ (0, J.jsx)(Rt, {
|
|
5646
5646
|
ref: o,
|
|
5647
5647
|
className: w,
|
|
5648
5648
|
width: "100%",
|
|
5649
|
-
maxHeight:
|
|
5649
|
+
maxHeight: m,
|
|
5650
5650
|
value: n,
|
|
5651
5651
|
basicSetup: !1,
|
|
5652
5652
|
extensions: C,
|
|
@@ -5654,7 +5654,7 @@ var cc = "marimo:ai-prompt-history", lc = new Te(Ze(ut()), () => []), uc = (e) =
|
|
|
5654
5654
|
onKeyDown: u,
|
|
5655
5655
|
theme: T,
|
|
5656
5656
|
placeholder: E
|
|
5657
|
-
}), t[18] = C, t[19] = o, t[20] =
|
|
5657
|
+
}), t[18] = C, t[19] = o, t[20] = m, t[21] = c, t[22] = u, t[23] = w, t[24] = T, t[25] = E, t[26] = n, t[27] = D) : D = t[27], D;
|
|
5658
5658
|
};
|
|
5659
5659
|
function dc() {
|
|
5660
5660
|
return lc.get(cc);
|
|
@@ -5664,11 +5664,11 @@ function fc(e) {
|
|
|
5664
5664
|
}
|
|
5665
5665
|
//#endregion
|
|
5666
5666
|
//#region src/plugins/impl/chat/chat-ui.tsx
|
|
5667
|
-
var pc =
|
|
5668
|
-
type:
|
|
5669
|
-
message_id:
|
|
5670
|
-
content:
|
|
5671
|
-
is_final:
|
|
5667
|
+
var pc = de, mc = pt({
|
|
5668
|
+
type: et("stream_chunk"),
|
|
5669
|
+
message_id: dt(),
|
|
5670
|
+
content: Ye().nullable().transform((e) => e),
|
|
5671
|
+
is_final: ft().optional()
|
|
5672
5672
|
});
|
|
5673
5673
|
function hc(e, t) {
|
|
5674
5674
|
let { controllerRef: r, activeRequestIdRef: i } = t, a = r.current;
|
|
@@ -5680,31 +5680,31 @@ function hc(e, t) {
|
|
|
5680
5680
|
}), "dropped-stale") : (e.content && a.enqueue(e.content), e.is_final ? (a.close(), r.current = null, i.current = null, "closed") : "enqueued");
|
|
5681
5681
|
}
|
|
5682
5682
|
var gc = (e) => {
|
|
5683
|
-
let [t, o] = (0, q.useState)(""), [s, c] = (0, q.useState)(e.config), [u,
|
|
5684
|
-
Object.keys(e.config).some((t) => e.config[t] !== u[t]) && (c(e.config),
|
|
5685
|
-
let
|
|
5683
|
+
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), h = (0, q.useRef)(null), g = (0, q.useRef)(null), _ = (0, q.useRef)(null);
|
|
5684
|
+
Object.keys(e.config).some((t) => e.config[t] !== u[t]) && (c(e.config), d(e.config));
|
|
5685
|
+
let v = (0, q.useRef)(s);
|
|
5686
5686
|
(0, q.useLayoutEffect)(() => {
|
|
5687
|
-
|
|
5687
|
+
v.current = s;
|
|
5688
5688
|
}, [s]);
|
|
5689
5689
|
let b = (0, q.useRef)(null), x = (0, q.useRef)(null), S = (0, q.useRef)(null), [C, w] = (0, q.useState)(null), T = () => {
|
|
5690
5690
|
S.current = null, w(null);
|
|
5691
|
-
}, { data:
|
|
5691
|
+
}, { data: E } = zt(async () => (await e.get_chat_history({})).messages, []), ee = e.value.length > 0 ? e.value : E, { messages: O, sendMessage: k, setMessages: A, status: j, stop: te, error: M, regenerate: re, clearError: ie, addToolApprovalResponse: ae } = lo({
|
|
5692
5692
|
sendAutomaticallyWhen: ({ messages: e }) => Wo(e),
|
|
5693
5693
|
transport: new Ha({ fetch: async (t, r) => {
|
|
5694
5694
|
if (r === void 0) return fetch(t);
|
|
5695
5695
|
let i = JSON.parse(r.body), a = r.signal, o = {
|
|
5696
|
-
max_tokens:
|
|
5697
|
-
temperature:
|
|
5698
|
-
top_p:
|
|
5699
|
-
top_k:
|
|
5700
|
-
frequency_penalty:
|
|
5701
|
-
presence_penalty:
|
|
5696
|
+
max_tokens: v.current.max_tokens,
|
|
5697
|
+
temperature: v.current.temperature,
|
|
5698
|
+
top_p: v.current.top_p,
|
|
5699
|
+
top_k: v.current.top_k,
|
|
5700
|
+
frequency_penalty: v.current.frequency_penalty,
|
|
5701
|
+
presence_penalty: v.current.presence_penalty
|
|
5702
5702
|
};
|
|
5703
5703
|
try {
|
|
5704
5704
|
let t = i.messages.map((e) => ({
|
|
5705
5705
|
...e,
|
|
5706
5706
|
content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
|
|
5707
|
-
})), r =
|
|
5707
|
+
})), r = D();
|
|
5708
5708
|
T();
|
|
5709
5709
|
let s = new ReadableStream({
|
|
5710
5710
|
start(t) {
|
|
@@ -5740,9 +5740,9 @@ var gc = (e) => {
|
|
|
5740
5740
|
return new Response(t, { status: 400 });
|
|
5741
5741
|
}
|
|
5742
5742
|
} }),
|
|
5743
|
-
messages:
|
|
5743
|
+
messages: ee,
|
|
5744
5744
|
onFinish: ({ messages: t, isAbort: r, finishReason: i }) => {
|
|
5745
|
-
if (
|
|
5745
|
+
if (p(void 0), m.current && (m.current.value = ""), n.debug("Finished streaming message:", {
|
|
5746
5746
|
finishReason: i,
|
|
5747
5747
|
isAbort: r
|
|
5748
5748
|
}), r) {
|
|
@@ -5764,7 +5764,7 @@ var gc = (e) => {
|
|
|
5764
5764
|
n.error("An error occurred:", e);
|
|
5765
5765
|
}
|
|
5766
5766
|
});
|
|
5767
|
-
i(e.host,
|
|
5767
|
+
i(e.host, Re.TYPE, (e) => {
|
|
5768
5768
|
let t = mc.safeParse(e.detail.message);
|
|
5769
5769
|
if (t.success) {
|
|
5770
5770
|
if (t.data.content && t.data.message_id === x.current) {
|
|
@@ -5777,28 +5777,28 @@ var gc = (e) => {
|
|
|
5777
5777
|
});
|
|
5778
5778
|
}
|
|
5779
5779
|
});
|
|
5780
|
-
let
|
|
5781
|
-
let n =
|
|
5780
|
+
let oe = j === "submitted" || j === "streaming", se = (t) => {
|
|
5781
|
+
let n = O.findIndex((e) => e.id === t);
|
|
5782
5782
|
if (n !== -1) {
|
|
5783
|
-
let r =
|
|
5784
|
-
e.delete_chat_message({ index: n }),
|
|
5783
|
+
let r = O.filter((e) => e.id !== t);
|
|
5784
|
+
e.delete_chat_message({ index: n }), A(r), e.setValue(r), r.length === 0 && T();
|
|
5785
5785
|
}
|
|
5786
|
-
},
|
|
5786
|
+
}, ce = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, le = {
|
|
5787
5787
|
triggerCompletionRegex: /^\/(\w+)?/,
|
|
5788
5788
|
completions: e.prompts.map((e) => ({
|
|
5789
5789
|
label: `/${e}`,
|
|
5790
5790
|
displayLabel: e,
|
|
5791
5791
|
apply: e
|
|
5792
5792
|
}))
|
|
5793
|
-
},
|
|
5793
|
+
}, ue = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
|
|
5794
5794
|
(0, q.useEffect)(() => {
|
|
5795
|
-
|
|
5796
|
-
top:
|
|
5795
|
+
_.current?.scrollTo({
|
|
5796
|
+
top: _.current.scrollHeight,
|
|
5797
5797
|
behavior: "smooth"
|
|
5798
5798
|
});
|
|
5799
|
-
}, [
|
|
5800
|
-
let
|
|
5801
|
-
let e =
|
|
5799
|
+
}, [O.length, _]);
|
|
5800
|
+
let de = () => {
|
|
5801
|
+
let e = g.current?.view;
|
|
5802
5802
|
if (e) {
|
|
5803
5803
|
let t = e.state.doc.length;
|
|
5804
5804
|
e.dispatch({ changes: {
|
|
@@ -5819,21 +5819,21 @@ var gc = (e) => {
|
|
|
5819
5819
|
"aria-label": "Reset chat",
|
|
5820
5820
|
variant: "text",
|
|
5821
5821
|
size: "icon",
|
|
5822
|
-
disabled:
|
|
5822
|
+
disabled: O.length === 0,
|
|
5823
5823
|
onClick: () => {
|
|
5824
|
-
|
|
5824
|
+
A([]), e.setValue([]), e.delete_chat_history({}), ie(), T();
|
|
5825
5825
|
},
|
|
5826
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5826
|
+
children: /* @__PURE__ */ (0, J.jsx)(Xt, { className: "h-3 w-3" })
|
|
5827
5827
|
})
|
|
5828
5828
|
}),
|
|
5829
5829
|
/* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5830
5830
|
className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
|
|
5831
|
-
ref:
|
|
5831
|
+
ref: _,
|
|
5832
5832
|
children: [
|
|
5833
|
-
|
|
5833
|
+
O.length === 0 && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5834
5834
|
className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
|
|
5835
5835
|
children: [
|
|
5836
|
-
/* @__PURE__ */ (0, J.jsx)(
|
|
5836
|
+
/* @__PURE__ */ (0, J.jsx)(Ht, { className: "h-12 w-12 mb-4" }),
|
|
5837
5837
|
/* @__PURE__ */ (0, J.jsx)("h3", {
|
|
5838
5838
|
className: "text-lg font-semibold mb-2",
|
|
5839
5839
|
children: "No messages yet"
|
|
@@ -5844,8 +5844,8 @@ var gc = (e) => {
|
|
|
5844
5844
|
})
|
|
5845
5845
|
]
|
|
5846
5846
|
}),
|
|
5847
|
-
|
|
5848
|
-
let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), i = t ===
|
|
5847
|
+
O.map((e, t) => {
|
|
5848
|
+
let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), i = t === O.length - 1;
|
|
5849
5849
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5850
5850
|
className: r("flex flex-col group gap-2", e.role === "user" ? "items-end" : "items-start"),
|
|
5851
5851
|
children: [/* @__PURE__ */ (0, J.jsx)("div", {
|
|
@@ -5853,8 +5853,8 @@ var gc = (e) => {
|
|
|
5853
5853
|
children: ms({
|
|
5854
5854
|
message: e,
|
|
5855
5855
|
isLast: i,
|
|
5856
|
-
isActive:
|
|
5857
|
-
addToolApprovalResponse: i ?
|
|
5856
|
+
isActive: oe,
|
|
5857
|
+
addToolApprovalResponse: i ? ae : void 0
|
|
5858
5858
|
})
|
|
5859
5859
|
}), /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5860
5860
|
className: "flex justify-end text-xs gap-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100",
|
|
@@ -5865,27 +5865,27 @@ var gc = (e) => {
|
|
|
5865
5865
|
}), /* @__PURE__ */ (0, J.jsx)("button", {
|
|
5866
5866
|
type: "button",
|
|
5867
5867
|
"aria-label": "Delete message",
|
|
5868
|
-
onClick: () =>
|
|
5868
|
+
onClick: () => se(e.id),
|
|
5869
5869
|
className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
|
|
5870
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5870
|
+
children: /* @__PURE__ */ (0, J.jsx)(y, { className: "h-3 w-3 text-(--red-9)" })
|
|
5871
5871
|
})]
|
|
5872
5872
|
})]
|
|
5873
5873
|
}, e.id);
|
|
5874
5874
|
}),
|
|
5875
|
-
|
|
5875
|
+
oe && O.at(-1)?.role !== "assistant" && /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5876
5876
|
className: "flex items-center justify-center mb-4",
|
|
5877
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5877
|
+
children: /* @__PURE__ */ (0, J.jsx)(ne, { size: "small" })
|
|
5878
5878
|
}),
|
|
5879
|
-
|
|
5879
|
+
M && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5880
5880
|
className: "flex items-center justify-center space-x-2 mb-4",
|
|
5881
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
5881
|
+
children: [/* @__PURE__ */ (0, J.jsx)(_t, { error: M }), /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5882
5882
|
variant: "outline",
|
|
5883
5883
|
size: "sm",
|
|
5884
|
-
onClick: () =>
|
|
5884
|
+
onClick: () => re(),
|
|
5885
5885
|
children: "Retry"
|
|
5886
5886
|
})]
|
|
5887
5887
|
}),
|
|
5888
|
-
C && !
|
|
5888
|
+
C && !oe && !M && /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5889
5889
|
className: "flex justify-center py-2",
|
|
5890
5890
|
children: /* @__PURE__ */ (0, J.jsx)("span", {
|
|
5891
5891
|
className: "text-xs text-muted-foreground",
|
|
@@ -5897,16 +5897,16 @@ var gc = (e) => {
|
|
|
5897
5897
|
/* @__PURE__ */ (0, J.jsxs)("form", {
|
|
5898
5898
|
onSubmit: async (n) => {
|
|
5899
5899
|
if (n.preventDefault(), e.disabled) return;
|
|
5900
|
-
let r =
|
|
5901
|
-
|
|
5900
|
+
let r = f ? await Uo(f) : void 0;
|
|
5901
|
+
k({
|
|
5902
5902
|
role: "user",
|
|
5903
5903
|
parts: [{
|
|
5904
5904
|
type: "text",
|
|
5905
5905
|
text: t
|
|
5906
5906
|
}, ...r ?? []]
|
|
5907
|
-
}),
|
|
5907
|
+
}), de();
|
|
5908
5908
|
},
|
|
5909
|
-
ref:
|
|
5909
|
+
ref: h,
|
|
5910
5910
|
inert: e.disabled || void 0,
|
|
5911
5911
|
className: r("flex w-full border-t border-(--slate-6) px-2 py-1 items-center", e.disabled && "opacity-50 cursor-not-allowed"),
|
|
5912
5912
|
children: [
|
|
@@ -5918,68 +5918,68 @@ var gc = (e) => {
|
|
|
5918
5918
|
prompts: e.prompts,
|
|
5919
5919
|
onSelect: (e) => {
|
|
5920
5920
|
o(e), requestAnimationFrame(() => {
|
|
5921
|
-
let e =
|
|
5922
|
-
e?.focus(),
|
|
5921
|
+
let e = g.current?.view;
|
|
5922
|
+
e?.focus(), Ee(e);
|
|
5923
5923
|
});
|
|
5924
5924
|
}
|
|
5925
5925
|
}),
|
|
5926
5926
|
/* @__PURE__ */ (0, J.jsx)(uc, {
|
|
5927
5927
|
className: "rounded-sm mr-2",
|
|
5928
|
-
placeholder:
|
|
5928
|
+
placeholder: ue,
|
|
5929
5929
|
value: t,
|
|
5930
|
-
inputRef:
|
|
5930
|
+
inputRef: g,
|
|
5931
5931
|
maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
|
|
5932
5932
|
onChange: o,
|
|
5933
5933
|
onSubmit: (e, t) => {
|
|
5934
|
-
t.trim() &&
|
|
5934
|
+
t.trim() && h.current?.requestSubmit();
|
|
5935
5935
|
},
|
|
5936
5936
|
onClose: () => {},
|
|
5937
|
-
additionalCompletions:
|
|
5937
|
+
additionalCompletions: le
|
|
5938
5938
|
}),
|
|
5939
|
-
|
|
5940
|
-
title:
|
|
5939
|
+
f && f.length === 1 && /* @__PURE__ */ (0, J.jsx)("span", {
|
|
5940
|
+
title: f[0].name,
|
|
5941
5941
|
className: "text-sm text-(--slate-11) truncate shrink-0 w-fit max-w-24",
|
|
5942
|
-
children:
|
|
5942
|
+
children: f[0].name
|
|
5943
5943
|
}),
|
|
5944
|
-
|
|
5945
|
-
title: [...
|
|
5944
|
+
f && f.length > 1 && /* @__PURE__ */ (0, J.jsxs)("span", {
|
|
5945
|
+
title: [...f].map((e) => e.name).join("\n"),
|
|
5946
5946
|
className: "text-sm text-(--slate-11) truncate shrink-0",
|
|
5947
|
-
children: [
|
|
5947
|
+
children: [f.length, " files"]
|
|
5948
5948
|
}),
|
|
5949
|
-
|
|
5949
|
+
f && f.length > 0 && /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5950
5950
|
type: "button",
|
|
5951
5951
|
variant: "text",
|
|
5952
5952
|
size: "sm",
|
|
5953
5953
|
onClick: () => {
|
|
5954
|
-
|
|
5954
|
+
p(void 0), m.current && (m.current.value = "");
|
|
5955
5955
|
},
|
|
5956
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5956
|
+
children: /* @__PURE__ */ (0, J.jsx)(Ge, { className: "size-3" })
|
|
5957
5957
|
}),
|
|
5958
|
-
|
|
5958
|
+
ce && /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)(a, {
|
|
5959
5959
|
type: "button",
|
|
5960
5960
|
variant: "text",
|
|
5961
5961
|
size: "sm",
|
|
5962
|
-
onClick: () =>
|
|
5963
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5962
|
+
onClick: () => m.current?.click(),
|
|
5963
|
+
children: /* @__PURE__ */ (0, J.jsx)(Yt, { className: "h-4" })
|
|
5964
5964
|
}), /* @__PURE__ */ (0, J.jsx)("input", {
|
|
5965
5965
|
type: "file",
|
|
5966
|
-
ref:
|
|
5966
|
+
ref: m,
|
|
5967
5967
|
className: "hidden",
|
|
5968
5968
|
multiple: !0,
|
|
5969
5969
|
accept: Array.isArray(e.allowAttachments) ? e.allowAttachments.join(",") : void 0,
|
|
5970
5970
|
onChange: (e) => {
|
|
5971
|
-
e.target.files &&
|
|
5971
|
+
e.target.files && p([...e.target.files]);
|
|
5972
5972
|
}
|
|
5973
5973
|
})] }),
|
|
5974
|
-
|
|
5974
|
+
oe ? /* @__PURE__ */ (0, J.jsx)(pe, {
|
|
5975
5975
|
content: "Stop generating",
|
|
5976
5976
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5977
5977
|
type: "button",
|
|
5978
5978
|
variant: "link",
|
|
5979
5979
|
size: "xs",
|
|
5980
|
-
onClick: () =>
|
|
5980
|
+
onClick: () => te(),
|
|
5981
5981
|
className: "text-(--red-9) hover:text-(--red-11)",
|
|
5982
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5982
|
+
children: /* @__PURE__ */ (0, J.jsx)(Ie, { className: "h-4 w-4 fill-current" })
|
|
5983
5983
|
})
|
|
5984
5984
|
}) : /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5985
5985
|
type: "submit",
|
|
@@ -5988,7 +5988,7 @@ var gc = (e) => {
|
|
|
5988
5988
|
size: "xs",
|
|
5989
5989
|
className: "text-(--slate-11)",
|
|
5990
5990
|
"aria-label": "Send message",
|
|
5991
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5991
|
+
children: /* @__PURE__ */ (0, J.jsx)(Qt, { className: "h-4 w-4" })
|
|
5992
5992
|
})
|
|
5993
5993
|
]
|
|
5994
5994
|
})
|
|
@@ -6028,7 +6028,7 @@ var gc = (e) => {
|
|
|
6028
6028
|
description: "Penalizes new tokens (-2: favor, 2: avoid)"
|
|
6029
6029
|
}
|
|
6030
6030
|
}, vc = (e) => {
|
|
6031
|
-
let t = (0,
|
|
6031
|
+
let t = (0, P.c)(16), { config: n, onChange: r } = e, [i, o] = (0, q.useState)(!1), s;
|
|
6032
6032
|
t[0] !== n || t[1] !== r ? (s = (e, t) => {
|
|
6033
6033
|
let i = t === null || Number.isNaN(t) ? null : t;
|
|
6034
6034
|
if (i !== null) {
|
|
@@ -6046,15 +6046,15 @@ var gc = (e) => {
|
|
|
6046
6046
|
e.key === "Enter" && (e.preventDefault(), o(!1));
|
|
6047
6047
|
}, t[3] = l) : l = t[3];
|
|
6048
6048
|
let u = l, d;
|
|
6049
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(
|
|
6049
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(pe, {
|
|
6050
6050
|
content: "Configuration",
|
|
6051
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
6051
|
+
children: /* @__PURE__ */ (0, J.jsx)(w, {
|
|
6052
6052
|
asChild: !0,
|
|
6053
6053
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
6054
6054
|
variant: "outline",
|
|
6055
6055
|
size: "sm",
|
|
6056
6056
|
className: "border-none shadow-none hover:bg-transparent",
|
|
6057
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
6057
|
+
children: /* @__PURE__ */ (0, J.jsx)($t, { className: "h-3 w-3" })
|
|
6058
6058
|
})
|
|
6059
6059
|
})
|
|
6060
6060
|
}), t[4] = d) : d = t[4];
|
|
@@ -6070,19 +6070,19 @@ var gc = (e) => {
|
|
|
6070
6070
|
let [t, n] = e;
|
|
6071
6071
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
6072
6072
|
className: "grid grid-cols-3 items-center gap-1",
|
|
6073
|
-
children: [/* @__PURE__ */ (0, J.jsxs)(
|
|
6073
|
+
children: [/* @__PURE__ */ (0, J.jsxs)(me, {
|
|
6074
6074
|
htmlFor: t,
|
|
6075
6075
|
className: "flex w-full justify-between col-span-3 align-end",
|
|
6076
|
-
children: [
|
|
6076
|
+
children: [We.startCase(t), /* @__PURE__ */ (0, J.jsx)(pe, {
|
|
6077
6077
|
delayDuration: 200,
|
|
6078
6078
|
side: "top",
|
|
6079
6079
|
content: /* @__PURE__ */ (0, J.jsx)("div", {
|
|
6080
6080
|
className: "text-xs flex flex-col",
|
|
6081
6081
|
children: _c[t].description
|
|
6082
6082
|
}),
|
|
6083
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
6083
|
+
children: /* @__PURE__ */ (0, J.jsx)(we, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
|
|
6084
6084
|
})]
|
|
6085
|
-
}), /* @__PURE__ */ (0, J.jsx)(
|
|
6085
|
+
}), /* @__PURE__ */ (0, J.jsx)(ge, {
|
|
6086
6086
|
id: t,
|
|
6087
6087
|
"aria-label": t,
|
|
6088
6088
|
value: n ?? NaN,
|
|
@@ -6095,10 +6095,10 @@ var gc = (e) => {
|
|
|
6095
6095
|
className: "col-span-3"
|
|
6096
6096
|
})]
|
|
6097
6097
|
}, t);
|
|
6098
|
-
}, t[9] = c, t[10] = e), p =
|
|
6098
|
+
}, t[9] = c, t[10] = e), p = yt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = p;
|
|
6099
6099
|
} else p = t[8];
|
|
6100
6100
|
let m;
|
|
6101
|
-
t[11] === p ? m = t[12] : (m = /* @__PURE__ */ (0, J.jsx)(
|
|
6101
|
+
t[11] === p ? m = t[12] : (m = /* @__PURE__ */ (0, J.jsx)(S, {
|
|
6102
6102
|
className: "w-70 border",
|
|
6103
6103
|
children: /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
6104
6104
|
className: "grid gap-3",
|
|
@@ -6106,40 +6106,40 @@ var gc = (e) => {
|
|
|
6106
6106
|
})
|
|
6107
6107
|
}), t[11] = p, t[12] = m);
|
|
6108
6108
|
let h;
|
|
6109
|
-
return t[13] !== i || t[14] !== m ? (h = /* @__PURE__ */ (0, J.jsxs)(
|
|
6109
|
+
return t[13] !== i || t[14] !== m ? (h = /* @__PURE__ */ (0, J.jsxs)(C, {
|
|
6110
6110
|
open: i,
|
|
6111
6111
|
onOpenChange: o,
|
|
6112
6112
|
children: [d, m]
|
|
6113
6113
|
}), t[13] = i, t[14] = m, t[15] = h) : h = t[15], h;
|
|
6114
6114
|
}, yc = (e) => {
|
|
6115
|
-
let t = (0,
|
|
6115
|
+
let t = (0, P.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, q.useState)(!1), [s, c] = (0, q.useState)(""), l;
|
|
6116
6116
|
t[0] === r ? l = t[1] : (l = (e) => {
|
|
6117
6117
|
[...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
|
|
6118
6118
|
}, t[0] = r, t[1] = l);
|
|
6119
6119
|
let u = l, d;
|
|
6120
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(
|
|
6120
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(pe, {
|
|
6121
6121
|
content: "Select a prompt",
|
|
6122
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
6122
|
+
children: /* @__PURE__ */ (0, J.jsx)(ve, {
|
|
6123
6123
|
asChild: !0,
|
|
6124
6124
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
6125
6125
|
variant: "outline",
|
|
6126
6126
|
size: "sm",
|
|
6127
6127
|
className: "border-none shadow-none hover:bg-transparent",
|
|
6128
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
6128
|
+
children: /* @__PURE__ */ (0, J.jsx)(ue, { className: "h-3 w-3" })
|
|
6129
6129
|
})
|
|
6130
6130
|
})
|
|
6131
6131
|
}), t[2] = d) : d = t[2];
|
|
6132
6132
|
let f;
|
|
6133
6133
|
if (t[3] !== u || t[4] !== n) {
|
|
6134
6134
|
let e;
|
|
6135
|
-
t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(
|
|
6135
|
+
t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(be, {
|
|
6136
6136
|
onSelect: () => u(e),
|
|
6137
6137
|
className: "whitespace-normal text-left",
|
|
6138
6138
|
children: e
|
|
6139
6139
|
}, t), t[6] = u, t[7] = e), f = n.map(e), t[3] = u, t[4] = n, t[5] = f;
|
|
6140
6140
|
} else f = t[5];
|
|
6141
6141
|
let p;
|
|
6142
|
-
t[8] === f ? p = t[9] : (p = /* @__PURE__ */ (0, J.jsx)(pc, { children: /* @__PURE__ */ (0, J.jsxs)(
|
|
6142
|
+
t[8] === f ? p = t[9] : (p = /* @__PURE__ */ (0, J.jsx)(pc, { children: /* @__PURE__ */ (0, J.jsxs)(Se, { children: [d, /* @__PURE__ */ (0, J.jsx)(xe, {
|
|
6143
6143
|
side: "right",
|
|
6144
6144
|
align: "end",
|
|
6145
6145
|
onCloseAutoFocus: xc,
|
|
@@ -6149,7 +6149,7 @@ var gc = (e) => {
|
|
|
6149
6149
|
let m;
|
|
6150
6150
|
t[10] === Symbol.for("react.memo_cache_sentinel") ? (m = () => o(!1), t[10] = m) : m = t[10];
|
|
6151
6151
|
let h;
|
|
6152
|
-
t[11] !== r || t[12] !== s ? (h = /* @__PURE__ */ (0, J.jsx)(
|
|
6152
|
+
t[11] !== r || t[12] !== s ? (h = /* @__PURE__ */ (0, J.jsx)(S, {
|
|
6153
6153
|
side: "right",
|
|
6154
6154
|
align: "end",
|
|
6155
6155
|
className: "min-w-80 px-2",
|
|
@@ -6160,13 +6160,13 @@ var gc = (e) => {
|
|
|
6160
6160
|
}, s)
|
|
6161
6161
|
}), t[11] = r, t[12] = s, t[13] = h) : h = t[13];
|
|
6162
6162
|
let g;
|
|
6163
|
-
return t[14] !== i || t[15] !== p || t[16] !== h ? (g = /* @__PURE__ */ (0, J.jsxs)(
|
|
6163
|
+
return t[14] !== i || t[15] !== p || t[16] !== h ? (g = /* @__PURE__ */ (0, J.jsxs)(C, {
|
|
6164
6164
|
open: i,
|
|
6165
6165
|
onOpenChange: o,
|
|
6166
6166
|
children: [p, h]
|
|
6167
6167
|
}), t[14] = i, t[15] = p, t[16] = h, t[17] = g) : g = t[17], g;
|
|
6168
6168
|
}, bc = (e) => {
|
|
6169
|
-
let t = (0,
|
|
6169
|
+
let t = (0, P.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
|
|
6170
6170
|
t[0] === n ? o = t[1] : (o = () => [...n.matchAll(/{{(\w+)}}/g)].reduce(Sc, {}), t[0] = n, t[1] = o);
|
|
6171
6171
|
let [s, c] = (0, q.useState)(o), l;
|
|
6172
6172
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = (e, t) => {
|
|
@@ -6195,11 +6195,11 @@ var gc = (e) => {
|
|
|
6195
6195
|
let [n, r] = e;
|
|
6196
6196
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
6197
6197
|
className: "grid grid-cols-4 items-center gap-2",
|
|
6198
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
6198
|
+
children: [/* @__PURE__ */ (0, J.jsx)(me, {
|
|
6199
6199
|
htmlFor: n,
|
|
6200
6200
|
className: "font-semibold text-base",
|
|
6201
6201
|
children: n
|
|
6202
|
-
}), /* @__PURE__ */ (0, J.jsx)(
|
|
6202
|
+
}), /* @__PURE__ */ (0, J.jsx)(ye, {
|
|
6203
6203
|
id: n,
|
|
6204
6204
|
value: r,
|
|
6205
6205
|
onChange: (e) => u(n, e.target.value),
|