@marimo-team/islands 0.25.3-dev275 → 0.25.3-dev279
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/{ErrorBoundary-BuIXiuc5.js → ErrorBoundary-DmTMuDPR.js} +1 -1
- package/dist/{chat-ui-SZ6lSH52.js → chat-ui-v1Fdh0NA.js} +270 -270
- package/dist/{code-visibility-BEAPMrC-.js → code-visibility-Dw4-TXN0.js} +2 -2
- package/dist/{common-CEmzaoJ8.js → common-BXMFi4lr.js} +4947 -4943
- package/dist/{data-grid-overlay-editor-CUo25_W8.js → data-grid-overlay-editor-hZzwX7Ia.js} +1 -1
- package/dist/{error-entries-B-1yUdcH.js → error-entries-C1S-Rmyt.js} +545 -535
- package/dist/{feedback-button-BqiR7zMO.js → feedback-button-6Ui2TDLR.js} +5 -5
- package/dist/{glide-data-editor-B7dguvqk.js → glide-data-editor-PZNlrSDI.js} +3 -3
- package/dist/{globals-CYykXfGI.js → globals-DX6FPZYq.js} +1 -1
- package/dist/{html-to-image-DC_pmZLs.js → html-to-image-CqGUd58T.js} +14452 -14452
- package/dist/main.js +6031 -6036
- package/dist/{number-overlay-editor-C4u7SJAJ.js → number-overlay-editor-D0CsL3_R.js} +1 -1
- package/dist/{process-output-DYu84VfZ.js → process-output-DskX9jLa.js} +2 -2
- package/dist/{reveal-component-DGi-irHV.js → reveal-component-D7xeI1QR.js} +906 -906
- package/package.json +1 -1
- package/src/__mocks__/executions.ts +4 -2
- package/src/__mocks__/notebook.ts +0 -2
- package/src/__tests__/CellStatus.test.tsx +6 -6
- package/src/components/editor/__tests__/data-attributes.test.tsx +0 -2
- package/src/components/editor/__tests__/output-persistence.test.tsx +20 -5
- package/src/components/editor/cell/CellStatus.tsx +6 -5
- package/src/components/editor/cell/__tests__/useRunCells.test.tsx +169 -0
- package/src/components/editor/cell/collapse.tsx +3 -4
- package/src/components/editor/cell/useRunCells.ts +32 -3
- package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +2 -3
- package/src/components/editor/notebook-cell.tsx +23 -37
- package/src/components/editor/renderers/grid-layout/grid-layout.tsx +4 -10
- package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +0 -2
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +8 -5
- package/src/components/slides/minimap.tsx +3 -2
- package/src/components/slides/reveal-component.tsx +3 -2
- package/src/components/slides/slide-cell-view.tsx +8 -8
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +0 -101
- package/src/core/cells/__tests__/actions.test.ts +0 -1
- package/src/core/cells/__tests__/cell.test.ts +81 -17
- package/src/core/cells/__tests__/cells.test.ts +0 -100
- package/src/core/cells/__tests__/document.test.ts +2 -8
- package/src/core/cells/__tests__/utils.test.ts +93 -24
- package/src/core/cells/actions.ts +0 -1
- package/src/core/cells/cell.ts +37 -14
- package/src/core/cells/cells.ts +10 -99
- package/src/core/cells/document.ts +2 -13
- package/src/core/cells/types.ts +0 -23
- package/src/core/cells/utils.ts +44 -17
- package/src/core/codemirror/cells/extensions.ts +0 -14
- package/src/core/errors/__tests__/error-entries.test.ts +40 -1
- package/src/core/errors/error-entries.ts +2 -3
- package/src/core/executions/__tests__/freshness.test.ts +420 -0
- package/src/core/executions/__tests__/hooks.test.tsx +106 -0
- package/src/core/executions/atoms.ts +22 -0
- package/src/core/executions/freshness.ts +164 -0
- package/src/core/executions/hooks.ts +17 -1
- package/src/core/executions/index.ts +3 -1
- package/src/core/islands/bootstrap.ts +0 -1
- package/src/core/kernel/handlers.ts +0 -4
- package/src/core/session/useNotebookSession.tsx +2 -7
- package/src/stories/cell-status.stories.tsx +12 -14
- package/src/stories/cell.stories.tsx +44 -10
- package/src/stories/layout/vertical/one-column.stories.tsx +0 -10
- package/src/components/editor/cell/__tests__/useRunCells.test.ts +0 -45
|
@@ -3,27 +3,27 @@ import { g as n, h as r, i, t as a } from "./button-DZuNnIZO.js";
|
|
|
3
3
|
import { t as o } from "./react-sHtZdjeP.js";
|
|
4
4
|
import { t as s } from "./compiler-runtime-CldRdSsv.js";
|
|
5
5
|
import { i as c, t as l } from "./copy-icon-CtllOdmg.js";
|
|
6
|
-
import { Ct as u, Dt as d, Et as f, It as p, J as m, Lt as h, M as g, Nt as _, Pt as v, Tt as y, U as b, V as x, Vt as S, W as C,
|
|
7
|
-
import { h as
|
|
8
|
-
import { d as
|
|
9
|
-
import { Sn as
|
|
10
|
-
import { a as
|
|
11
|
-
import { I as Te, K as Ee, N as De, Tt as Oe,
|
|
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 { Ct as u, Dt as d, Et as f, It as p, J as m, Lt as h, M as g, Nt as _, Pt as v, Tt as y, U as b, V as x, Vt as S, W as C, Y as w, a as T, dt as E, et as D, f as O, g as k, h as A, ht as j, kt as M, l as ee, m as N, n as te, nt as ne, p as re, r as ie, st as ae, t as oe, tt as se, u as ce, v as le, xt as ue, zt as de } from "./html-to-image-CqGUd58T.js";
|
|
7
|
+
import { h as P, t as fe } from "./tooltip-DMMiOn2f.js";
|
|
8
|
+
import { d as pe } from "./select-DsoP1qe8.js";
|
|
9
|
+
import { Sn as me, _ as he, bn as ge, f as _e, h as ve, i as ye, n as be, t as xe } from "./dropdown-menu-Bb0bFOIk.js";
|
|
10
|
+
import { a as Se, l as Ce } from "./config-C8MFHQ2E.js";
|
|
11
|
+
import { Gt as we, I as Te, K as Ee, N as De, Tt as Oe, ct as ke, h as Ae, i as je, r as Me, t as Ne, tt as Pe } from "./error-entries-C1S-Rmyt.js";
|
|
12
|
+
import { d as Fe, f as Ie, i as Le, n as Re, t as ze, u as Be } from "./process-output-DskX9jLa.js";
|
|
13
|
+
import { t as Ve } from "./pencil-DYUlSKxZ.js";
|
|
14
|
+
import { n as He, r as Ue, s as We } from "./assertNever-B-YzWzbL.js";
|
|
15
|
+
import { t as Ge } from "./jsx-runtime-3BD1kT0s.js";
|
|
16
|
+
import { $ as Ke, Ft as qe, G as Je, H as Ye, J as Xe, K as Ze, Lt as Qe, Q as $e, U as et, W as tt, Y as nt, Z as rt, at as it, ct as at, ft as ot, h as st, lt as ct, nt as lt, ot as ut, q as dt, rt as ft, tt as pt, u as mt, ut as ht } from "./use-restore-focus-CosX7-gx.js";
|
|
17
|
+
import { n as gt } from "./error-banner-CHCdHVFB.js";
|
|
18
|
+
import { t as _t } from "./isEmpty-CdX7MTE1.js";
|
|
19
|
+
import { t as vt } from "./objects-DCmMvZtn.js";
|
|
20
|
+
import { t as yt } from "./useEvent-BRH-aCqi.js";
|
|
21
|
+
import { Dt as bt, Et as xt, St, U as Ct, V as wt, W as Tt, bt as Et, kt as Dt, nt as Ot, rt as kt, yt as At, z as jt } from "./dist-CYeqK4Xw.js";
|
|
22
|
+
import { n as Mt, o as Nt, r as Pt } from "./dist-BX1mn8na.js";
|
|
23
|
+
import { n as Ft } from "./dist-DiLFTlnl.js";
|
|
24
|
+
import { n as It, t as Lt } from "./esm-BDqqT86j.js";
|
|
25
|
+
import { t as Rt } from "./useAsyncData-Ci4AvJff.js";
|
|
26
|
+
var zt = P("ban", [["circle", {
|
|
27
27
|
cx: "12",
|
|
28
28
|
cy: "12",
|
|
29
29
|
r: "10",
|
|
@@ -31,13 +31,13 @@ var Bt = N("ban", [["circle", {
|
|
|
31
31
|
}], ["path", {
|
|
32
32
|
d: "M4.929 4.929 19.07 19.071",
|
|
33
33
|
key: "196cmz"
|
|
34
|
-
}]]),
|
|
34
|
+
}]]), Bt = P("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
|
+
}]]), Vt = P("bot-message-square", [
|
|
41
41
|
["path", {
|
|
42
42
|
d: "M12 6V2H8",
|
|
43
43
|
key: "1155em"
|
|
@@ -62,7 +62,7 @@ var Bt = N("ban", [["circle", {
|
|
|
62
62
|
d: "M9 11v2",
|
|
63
63
|
key: "1ueba0"
|
|
64
64
|
}]
|
|
65
|
-
]),
|
|
65
|
+
]), Ht = P("brain", [
|
|
66
66
|
["path", {
|
|
67
67
|
d: "M12 18V5",
|
|
68
68
|
key: "adv99a"
|
|
@@ -95,7 +95,7 @@ var Bt = N("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
|
+
]), Ut = P("bug", [
|
|
99
99
|
["path", {
|
|
100
100
|
d: "M12 20v-9",
|
|
101
101
|
key: "1qisl0"
|
|
@@ -140,7 +140,7 @@ var Bt = N("ban", [["circle", {
|
|
|
140
140
|
d: "M9 7.13V6a3 3 0 1 1 6 0v1.13",
|
|
141
141
|
key: "1vgav8"
|
|
142
142
|
}]
|
|
143
|
-
]),
|
|
143
|
+
]), Wt = P("circle-slash", [["circle", {
|
|
144
144
|
cx: "12",
|
|
145
145
|
cy: "12",
|
|
146
146
|
r: "10",
|
|
@@ -151,7 +151,7 @@ var Bt = N("ban", [["circle", {
|
|
|
151
151
|
y1: "15",
|
|
152
152
|
y2: "9",
|
|
153
153
|
key: "1dfufj"
|
|
154
|
-
}]]),
|
|
154
|
+
}]]), Gt = P("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 Bt = N("ban", [["circle", {
|
|
|
170
170
|
d: "M13.3 16.3 15 18",
|
|
171
171
|
key: "2quom7"
|
|
172
172
|
}]
|
|
173
|
-
]),
|
|
173
|
+
]), Kt = P("list-checks", [
|
|
174
174
|
["path", {
|
|
175
175
|
d: "M13 5h8",
|
|
176
176
|
key: "a7qcls"
|
|
@@ -191,7 +191,7 @@ var Bt = N("ban", [["circle", {
|
|
|
191
191
|
d: "m3 7 2 2 4-4",
|
|
192
192
|
key: "1obspn"
|
|
193
193
|
}]
|
|
194
|
-
]),
|
|
194
|
+
]), qt = P("notebook", [
|
|
195
195
|
["path", {
|
|
196
196
|
d: "M2 6h4",
|
|
197
197
|
key: "aawbzj"
|
|
@@ -220,16 +220,16 @@ var Bt = N("ban", [["circle", {
|
|
|
220
220
|
d: "M16 2v20",
|
|
221
221
|
key: "rotuqe"
|
|
222
222
|
}]
|
|
223
|
-
]),
|
|
223
|
+
]), Jt = P("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
|
+
}]]), Yt = P("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
|
+
}]]), Xt = P("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 Bt = N("ban", [["circle", {
|
|
|
256
256
|
d: "m16 16-1.9-1.9",
|
|
257
257
|
key: "1dq9hf"
|
|
258
258
|
}]
|
|
259
|
-
]),
|
|
259
|
+
]), Zt = P("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
|
+
}]]), Qt = P("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 Bt = N("ban", [["circle", {
|
|
|
270
270
|
cy: "12",
|
|
271
271
|
r: "3",
|
|
272
272
|
key: "1v7zrd"
|
|
273
|
-
}]]),
|
|
273
|
+
}]]), $t = P("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 Bt = N("ban", [["circle", {
|
|
|
283
283
|
d: "M12 17h.01",
|
|
284
284
|
key: "p32p05"
|
|
285
285
|
}]
|
|
286
|
-
]),
|
|
286
|
+
]), F = s(), en = "vercel.ai.error", tn = Symbol.for(en), nn, rn, I = class e extends (rn = Error, nn = tn, rn) {
|
|
287
287
|
constructor({ name: e, message: t, cause: n }) {
|
|
288
|
-
super(t), this[
|
|
288
|
+
super(t), this[nn] = !0, this.name = e, this.cause = n;
|
|
289
289
|
}
|
|
290
290
|
static isInstance(t) {
|
|
291
|
-
return e.hasMarker(t,
|
|
291
|
+
return e.hasMarker(t, en);
|
|
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
|
+
}, an = "AI_APICallError", on = `vercel.ai.error.${an}`, sn = Symbol.for(on), cn, ln, un = class extends (ln = I, cn = sn, ln) {
|
|
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: an,
|
|
301
301
|
message: e,
|
|
302
302
|
cause: o
|
|
303
|
-
}), this[
|
|
303
|
+
}), this[cn] = !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 I.hasMarker(e, on);
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, dn = "AI_EmptyResponseBodyError", fn = `vercel.ai.error.${dn}`, pn = Symbol.for(fn), mn, hn, gn = class extends (hn = I, mn = pn, hn) {
|
|
309
309
|
constructor({ message: e = "Empty response body" } = {}) {
|
|
310
310
|
super({
|
|
311
|
-
name:
|
|
311
|
+
name: dn,
|
|
312
312
|
message: e
|
|
313
|
-
}), this[
|
|
313
|
+
}), this[mn] = !0;
|
|
314
314
|
}
|
|
315
315
|
static isInstance(e) {
|
|
316
|
-
return
|
|
316
|
+
return I.hasMarker(e, fn);
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
|
-
function
|
|
319
|
+
function _n(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 vn = "AI_InvalidArgumentError", yn = `vercel.ai.error.${vn}`, bn = Symbol.for(yn), xn, Sn, Cn = class extends (Sn = I, xn = bn, Sn) {
|
|
323
323
|
constructor({ message: e, cause: t, argument: n }) {
|
|
324
324
|
super({
|
|
325
|
-
name:
|
|
325
|
+
name: vn,
|
|
326
326
|
message: e,
|
|
327
327
|
cause: t
|
|
328
|
-
}), this[
|
|
328
|
+
}), this[xn] = !0, this.argument = n;
|
|
329
329
|
}
|
|
330
330
|
static isInstance(e) {
|
|
331
|
-
return
|
|
331
|
+
return I.hasMarker(e, yn);
|
|
332
332
|
}
|
|
333
|
-
},
|
|
333
|
+
}, wn = "AI_JSONParseError", Tn = `vercel.ai.error.${wn}`, En = Symbol.for(Tn), Dn, On, kn = class extends (On = I, Dn = En, On) {
|
|
334
334
|
constructor({ text: e, cause: t }) {
|
|
335
335
|
super({
|
|
336
|
-
name:
|
|
336
|
+
name: wn,
|
|
337
337
|
message: `JSON parsing failed: Text: ${e}.
|
|
338
|
-
Error message: ${
|
|
338
|
+
Error message: ${_n(t)}`,
|
|
339
339
|
cause: t
|
|
340
|
-
}), this[
|
|
340
|
+
}), this[Dn] = !0, this.text = e;
|
|
341
341
|
}
|
|
342
342
|
static isInstance(e) {
|
|
343
|
-
return
|
|
343
|
+
return I.hasMarker(e, Tn);
|
|
344
344
|
}
|
|
345
|
-
},
|
|
345
|
+
}, An = "AI_TypeValidationError", jn = `vercel.ai.error.${An}`, Mn = Symbol.for(jn), Nn, Pn, Fn = class e extends (Pn = I, Nn = Mn, Pn) {
|
|
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: ${vn(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: An,
|
|
355
355
|
message: `${r}: Value: ${JSON.stringify(e)}.
|
|
356
|
-
Error message: ${
|
|
356
|
+
Error message: ${_n(t)}`,
|
|
357
357
|
cause: t
|
|
358
|
-
}), this[
|
|
358
|
+
}), this[Nn] = !0, this.value = e, this.context = n;
|
|
359
359
|
}
|
|
360
360
|
static isInstance(e) {
|
|
361
|
-
return
|
|
361
|
+
return I.hasMarker(e, jn);
|
|
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,7 +367,7 @@ Error message: ${vn(t)}`,
|
|
|
367
367
|
context: r
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
|
-
}, In = "AI_UnsupportedFunctionalityError", Ln = `vercel.ai.error.${In}`, Rn = Symbol.for(Ln), zn, Bn, Vn = class extends (Bn =
|
|
370
|
+
}, In = "AI_UnsupportedFunctionalityError", Ln = `vercel.ai.error.${In}`, Rn = Symbol.for(Ln), zn, Bn, Vn = class extends (Bn = I, zn = Rn, Bn) {
|
|
371
371
|
constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
|
|
372
372
|
super({
|
|
373
373
|
name: In,
|
|
@@ -375,7 +375,7 @@ Error message: ${vn(t)}`,
|
|
|
375
375
|
}), this[zn] = !0, this.functionality = e;
|
|
376
376
|
}
|
|
377
377
|
static isInstance(e) {
|
|
378
|
-
return
|
|
378
|
+
return I.hasMarker(e, Ln);
|
|
379
379
|
}
|
|
380
380
|
}, Hn = class extends Error {
|
|
381
381
|
constructor(e, t) {
|
|
@@ -578,7 +578,7 @@ var L = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRS
|
|
|
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 Cn({
|
|
582
582
|
argument: "separator",
|
|
583
583
|
message: `The separator "${r}" must not be part of the alphabet "${n}".`
|
|
584
584
|
});
|
|
@@ -1401,7 +1401,7 @@ function li(e) {
|
|
|
1401
1401
|
value: n.value
|
|
1402
1402
|
} : {
|
|
1403
1403
|
success: !1,
|
|
1404
|
-
error: new
|
|
1404
|
+
error: new Fn({
|
|
1405
1405
|
value: t,
|
|
1406
1406
|
cause: n.issues
|
|
1407
1407
|
})
|
|
@@ -1426,12 +1426,12 @@ function di(e, t) {
|
|
|
1426
1426
|
}
|
|
1427
1427
|
function fi(e, t) {
|
|
1428
1428
|
let n = t?.useReferences ?? !1;
|
|
1429
|
-
return oi(() => sr(
|
|
1429
|
+
return oi(() => sr(ot(e, {
|
|
1430
1430
|
target: "draft-7",
|
|
1431
1431
|
io: "input",
|
|
1432
1432
|
reused: n ? "ref" : "inline"
|
|
1433
1433
|
})), { validate: async (t) => {
|
|
1434
|
-
let n = await
|
|
1434
|
+
let n = await ht(e, t);
|
|
1435
1435
|
return n.success ? {
|
|
1436
1436
|
success: !0,
|
|
1437
1437
|
value: n.data
|
|
@@ -1453,7 +1453,7 @@ async function hi({ value: e, schema: t, context: n }) {
|
|
|
1453
1453
|
schema: t,
|
|
1454
1454
|
context: n
|
|
1455
1455
|
});
|
|
1456
|
-
if (!r.success) throw
|
|
1456
|
+
if (!r.success) throw Fn.wrap({
|
|
1457
1457
|
value: e,
|
|
1458
1458
|
cause: r.error,
|
|
1459
1459
|
context: n
|
|
@@ -1475,7 +1475,7 @@ async function gi({ value: e, schema: t, context: n }) {
|
|
|
1475
1475
|
rawValue: e
|
|
1476
1476
|
} : {
|
|
1477
1477
|
success: !1,
|
|
1478
|
-
error:
|
|
1478
|
+
error: Fn.wrap({
|
|
1479
1479
|
value: e,
|
|
1480
1480
|
cause: t.error,
|
|
1481
1481
|
context: n
|
|
@@ -1485,7 +1485,7 @@ async function gi({ value: e, schema: t, context: n }) {
|
|
|
1485
1485
|
} catch (t) {
|
|
1486
1486
|
return {
|
|
1487
1487
|
success: !1,
|
|
1488
|
-
error:
|
|
1488
|
+
error: Fn.wrap({
|
|
1489
1489
|
value: e,
|
|
1490
1490
|
cause: t,
|
|
1491
1491
|
context: n
|
|
@@ -1508,7 +1508,7 @@ async function _i({ text: e, schema: t }) {
|
|
|
1508
1508
|
} catch (t) {
|
|
1509
1509
|
return {
|
|
1510
1510
|
success: !1,
|
|
1511
|
-
error:
|
|
1511
|
+
error: kn.isInstance(t) ? t : new kn({
|
|
1512
1512
|
text: e,
|
|
1513
1513
|
cause: t
|
|
1514
1514
|
}),
|
|
@@ -1533,7 +1533,7 @@ var bi = Object.defineProperty, xi = (e, t) => {
|
|
|
1533
1533
|
get: t[n],
|
|
1534
1534
|
enumerable: !0
|
|
1535
1535
|
});
|
|
1536
|
-
}, Si = "AI_InvalidArgumentError", Ci = `vercel.ai.error.${Si}`, wi = Symbol.for(Ci), Ti, Ei, Di = class extends (Ei =
|
|
1536
|
+
}, Si = "AI_InvalidArgumentError", Ci = `vercel.ai.error.${Si}`, wi = Symbol.for(Ci), Ti, Ei, Di = class extends (Ei = I, Ti = wi, Ei) {
|
|
1537
1537
|
constructor({ parameter: e, value: t, message: n }) {
|
|
1538
1538
|
super({
|
|
1539
1539
|
name: Si,
|
|
@@ -1541,9 +1541,9 @@ var bi = Object.defineProperty, xi = (e, t) => {
|
|
|
1541
1541
|
}), this[Ti] = !0, this.parameter = e, this.value = t;
|
|
1542
1542
|
}
|
|
1543
1543
|
static isInstance(e) {
|
|
1544
|
-
return
|
|
1544
|
+
return I.hasMarker(e, Ci);
|
|
1545
1545
|
}
|
|
1546
|
-
}, Oi = "AI_NoObjectGeneratedError", ki = `vercel.ai.error.${Oi}`, Ai = Symbol.for(ki), ji, Mi, U = class extends (Mi =
|
|
1546
|
+
}, Oi = "AI_NoObjectGeneratedError", ki = `vercel.ai.error.${Oi}`, Ai = Symbol.for(ki), ji, Mi, U = class extends (Mi = I, ji = Ai, Mi) {
|
|
1547
1547
|
constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
|
|
1548
1548
|
super({
|
|
1549
1549
|
name: Oi,
|
|
@@ -1552,9 +1552,9 @@ var bi = Object.defineProperty, xi = (e, t) => {
|
|
|
1552
1552
|
}), this[ji] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
|
|
1553
1553
|
}
|
|
1554
1554
|
static isInstance(e) {
|
|
1555
|
-
return
|
|
1555
|
+
return I.hasMarker(e, ki);
|
|
1556
1556
|
}
|
|
1557
|
-
}, Ni = "AI_UIMessageStreamError", Pi = `vercel.ai.error.${Ni}`, Fi = Symbol.for(Pi), Ii, Li, Ri = class extends (Li =
|
|
1557
|
+
}, Ni = "AI_UIMessageStreamError", Pi = `vercel.ai.error.${Ni}`, Fi = Symbol.for(Pi), Ii, Li, Ri = class extends (Li = I, Ii = Fi, Li) {
|
|
1558
1558
|
constructor({ chunkType: e, chunkId: t, message: n }) {
|
|
1559
1559
|
super({
|
|
1560
1560
|
name: Ni,
|
|
@@ -1562,7 +1562,7 @@ var bi = Object.defineProperty, xi = (e, t) => {
|
|
|
1562
1562
|
}), this[Ii] = !0, this.chunkType = e, this.chunkId = t;
|
|
1563
1563
|
}
|
|
1564
1564
|
static isInstance(e) {
|
|
1565
|
-
return
|
|
1565
|
+
return I.hasMarker(e, Pi);
|
|
1566
1566
|
}
|
|
1567
1567
|
};
|
|
1568
1568
|
function zi({ warning: e, provider: t, model: n }) {
|
|
@@ -1621,23 +1621,23 @@ function Wi(e, t) {
|
|
|
1621
1621
|
return n;
|
|
1622
1622
|
}
|
|
1623
1623
|
var W = {
|
|
1624
|
-
array:
|
|
1625
|
-
boolean:
|
|
1626
|
-
custom:
|
|
1627
|
-
discriminatedUnion:
|
|
1628
|
-
enum:
|
|
1629
|
-
instanceof:
|
|
1630
|
-
lazy:
|
|
1631
|
-
literal:
|
|
1632
|
-
looseObject:
|
|
1633
|
-
never:
|
|
1634
|
-
null:
|
|
1635
|
-
number:
|
|
1636
|
-
object:
|
|
1637
|
-
record:
|
|
1638
|
-
string:
|
|
1639
|
-
union:
|
|
1640
|
-
unknown:
|
|
1624
|
+
array: Ze,
|
|
1625
|
+
boolean: dt,
|
|
1626
|
+
custom: Xe,
|
|
1627
|
+
discriminatedUnion: nt,
|
|
1628
|
+
enum: Ye,
|
|
1629
|
+
instanceof: et,
|
|
1630
|
+
lazy: rt,
|
|
1631
|
+
literal: $e,
|
|
1632
|
+
looseObject: Ke,
|
|
1633
|
+
never: pt,
|
|
1634
|
+
null: tt,
|
|
1635
|
+
number: lt,
|
|
1636
|
+
object: ft,
|
|
1637
|
+
record: it,
|
|
1638
|
+
string: ut,
|
|
1639
|
+
union: at,
|
|
1640
|
+
unknown: ct
|
|
1641
1641
|
}, Gi = W.lazy(() => W.union([
|
|
1642
1642
|
W.null(),
|
|
1643
1643
|
W.string(),
|
|
@@ -2174,7 +2174,7 @@ var pa = () => ({
|
|
|
2174
2174
|
let o = i.value;
|
|
2175
2175
|
if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new U({
|
|
2176
2176
|
message: "No object generated: response did not match schema.",
|
|
2177
|
-
cause: new
|
|
2177
|
+
cause: new Fn({
|
|
2178
2178
|
value: o,
|
|
2179
2179
|
cause: "response must be an object with an elements array"
|
|
2180
2180
|
}),
|
|
@@ -2267,11 +2267,11 @@ function ga({ name: e, value: t }) {
|
|
|
2267
2267
|
}
|
|
2268
2268
|
}
|
|
2269
2269
|
function _a({ value: e, minItems: t, maxItems: n }) {
|
|
2270
|
-
if (t != null && e.length < t) return new
|
|
2270
|
+
if (t != null && e.length < t) return new Fn({
|
|
2271
2271
|
value: e,
|
|
2272
2272
|
cause: `elements array must contain at least ${t} items`
|
|
2273
2273
|
});
|
|
2274
|
-
if (n != null && e.length > n) return new
|
|
2274
|
+
if (n != null && e.length > n) return new Fn({
|
|
2275
2275
|
value: e,
|
|
2276
2276
|
cause: `elements array must contain at most ${n} items`
|
|
2277
2277
|
});
|
|
@@ -2306,7 +2306,7 @@ var va = ({ options: e, name: t, description: n }) => ({
|
|
|
2306
2306
|
let i = r.value;
|
|
2307
2307
|
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new U({
|
|
2308
2308
|
message: "No object generated: response did not match schema.",
|
|
2309
|
-
cause: new
|
|
2309
|
+
cause: new Fn({
|
|
2310
2310
|
value: i,
|
|
2311
2311
|
cause: "response must be an object that contains a choice value."
|
|
2312
2312
|
}),
|
|
@@ -3145,7 +3145,7 @@ L({
|
|
|
3145
3145
|
});
|
|
3146
3146
|
async function Ra({ response: e, url: t, fallbackMessage: n }) {
|
|
3147
3147
|
let r = await e.text();
|
|
3148
|
-
return new
|
|
3148
|
+
return new un({
|
|
3149
3149
|
message: r || n,
|
|
3150
3150
|
url: t,
|
|
3151
3151
|
requestBodyValues: void 0,
|
|
@@ -3221,7 +3221,7 @@ var Va = class {
|
|
|
3221
3221
|
url: s,
|
|
3222
3222
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3223
3223
|
});
|
|
3224
|
-
if (!d.body) throw new
|
|
3224
|
+
if (!d.body) throw new gn({ message: "The response body is empty." });
|
|
3225
3225
|
return this.processResponseStream(d.body);
|
|
3226
3226
|
}
|
|
3227
3227
|
async reconnectToStream(e) {
|
|
@@ -3250,7 +3250,7 @@ var Va = class {
|
|
|
3250
3250
|
url: o,
|
|
3251
3251
|
fallbackMessage: "Failed to fetch the chat response."
|
|
3252
3252
|
});
|
|
3253
|
-
if (!l.body) throw new
|
|
3253
|
+
if (!l.body) throw new gn({ message: "The response body is empty." });
|
|
3254
3254
|
return this.processResponseStream(l.body);
|
|
3255
3255
|
}
|
|
3256
3256
|
}, Ha = class extends Va {
|
|
@@ -3550,7 +3550,7 @@ var Ka = /* @__PURE__ */ t(((e, t) => {
|
|
|
3550
3550
|
};
|
|
3551
3551
|
}
|
|
3552
3552
|
t.exports = n;
|
|
3553
|
-
})), q = /* @__PURE__ */ e(o(), 1), qa = /* @__PURE__ */ e(Ka(), 1), J =
|
|
3553
|
+
})), q = /* @__PURE__ */ e(o(), 1), qa = /* @__PURE__ */ e(Ka(), 1), J = Ge(), Ja = (e, t, n) => {
|
|
3554
3554
|
if (!t.has(e)) throw TypeError("Cannot " + n);
|
|
3555
3555
|
}, Y = (e, t, n) => (Ja(e, t, "read from private field"), n ? n.call(e) : t.get(e)), X = (e, t, n) => {
|
|
3556
3556
|
if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
|
|
@@ -3742,7 +3742,7 @@ function go(e) {
|
|
|
3742
3742
|
//#endregion
|
|
3743
3743
|
//#region src/components/chat/agent-activity.tsx
|
|
3744
3744
|
var _o = (e) => {
|
|
3745
|
-
let t = (0,
|
|
3745
|
+
let t = (0, F.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;
|
|
3746
3746
|
t[0] !== h || t[1] !== f || t[2] !== b || t[3] !== n || t[4] !== d || t[5] !== s || t[6] !== m ? (S = n ? /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)("output", {
|
|
3747
3747
|
className: yo,
|
|
3748
3748
|
children: d ? "Thinking…" : "Working…"
|
|
@@ -3767,7 +3767,7 @@ var _o = (e) => {
|
|
|
3767
3767
|
onClick: () => v(!y),
|
|
3768
3768
|
"aria-expanded": y,
|
|
3769
3769
|
className: "group/activity -mx-1.5 flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-foreground/6 hover:text-foreground focus-visible:outline-1 focus-visible:outline-(--slate-8)",
|
|
3770
|
-
children: [C, /* @__PURE__ */ (0, J.jsx)(
|
|
3770
|
+
children: [C, /* @__PURE__ */ (0, J.jsx)(me, {
|
|
3771
3771
|
"aria-hidden": !0,
|
|
3772
3772
|
className: r("size-3 shrink-0 opacity-60 transition-transform group-hover/activity:opacity-100", y && "rotate-90")
|
|
3773
3773
|
})]
|
|
@@ -3791,7 +3791,7 @@ function bo({ interrupted: e, timing: t, toolCount: n }) {
|
|
|
3791
3791
|
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"}`;
|
|
3792
3792
|
}
|
|
3793
3793
|
function xo(e) {
|
|
3794
|
-
let t = (0,
|
|
3794
|
+
let t = (0, F.c)(3), [n, r] = q.useState(So), i, a;
|
|
3795
3795
|
return t[0] === e ? (i = t[1], a = t[2]) : (i = () => {
|
|
3796
3796
|
if (!e) return;
|
|
3797
3797
|
let t = () => r(Date.now()), n = requestAnimationFrame(t), i = setInterval(t, 1e3);
|
|
@@ -3805,7 +3805,7 @@ function So() {
|
|
|
3805
3805
|
}
|
|
3806
3806
|
//#endregion
|
|
3807
3807
|
//#region src/core/ai/context/providers/cell.ts
|
|
3808
|
-
var Co = class extends
|
|
3808
|
+
var Co = class extends A {
|
|
3809
3809
|
title = "Cells";
|
|
3810
3810
|
mentionPrefix = "@";
|
|
3811
3811
|
contextType = "cell";
|
|
@@ -3814,12 +3814,12 @@ var Co = class extends j {
|
|
|
3814
3814
|
super(), this.store = e;
|
|
3815
3815
|
}
|
|
3816
3816
|
getItems() {
|
|
3817
|
-
let e = this.store.get(
|
|
3817
|
+
let e = this.store.get(Ae);
|
|
3818
3818
|
return e.cellIds.map((t, n) => {
|
|
3819
3819
|
let r = e.cellData[t];
|
|
3820
3820
|
return {
|
|
3821
3821
|
uri: this.asURI(t),
|
|
3822
|
-
name:
|
|
3822
|
+
name: ke(r.name, n),
|
|
3823
3823
|
type: this.contextType,
|
|
3824
3824
|
description: "Cell code",
|
|
3825
3825
|
data: {
|
|
@@ -3836,7 +3836,7 @@ var Co = class extends j {
|
|
|
3836
3836
|
};
|
|
3837
3837
|
}
|
|
3838
3838
|
formatContext(e) {
|
|
3839
|
-
return
|
|
3839
|
+
return N({
|
|
3840
3840
|
type: "cell",
|
|
3841
3841
|
data: {
|
|
3842
3842
|
cellId: e.data.cellId,
|
|
@@ -3864,7 +3864,7 @@ function wo(e, t) {
|
|
|
3864
3864
|
"<marimo-ui-element"
|
|
3865
3865
|
].some((e) => t.includes(e))) : !1;
|
|
3866
3866
|
}
|
|
3867
|
-
var To = class extends
|
|
3867
|
+
var To = class extends A {
|
|
3868
3868
|
title = "Cell Outputs";
|
|
3869
3869
|
mentionPrefix = "@";
|
|
3870
3870
|
contextType = "cell-output";
|
|
@@ -3873,7 +3873,7 @@ var To = class extends j {
|
|
|
3873
3873
|
super(), this.store = e;
|
|
3874
3874
|
}
|
|
3875
3875
|
getItems() {
|
|
3876
|
-
let e = this.store.get(
|
|
3876
|
+
let e = this.store.get(Ae), t = [];
|
|
3877
3877
|
for (let n of e.cellIds) {
|
|
3878
3878
|
let r = Oo(n, e), i = r.cellOutput;
|
|
3879
3879
|
if (!i) continue;
|
|
@@ -3897,9 +3897,9 @@ var To = class extends j {
|
|
|
3897
3897
|
label: `@${n}`,
|
|
3898
3898
|
displayLabel: n,
|
|
3899
3899
|
detail: `${t.outputType} output`,
|
|
3900
|
-
boost: t.outputType === "media" ?
|
|
3900
|
+
boost: t.outputType === "media" ? O.HIGH : O.MEDIUM,
|
|
3901
3901
|
type: this.contextType,
|
|
3902
|
-
section:
|
|
3902
|
+
section: re.CELL_OUTPUT,
|
|
3903
3903
|
apply: `@${n}`,
|
|
3904
3904
|
info: () => {
|
|
3905
3905
|
let e = document.createElement("div");
|
|
@@ -3936,7 +3936,7 @@ var To = class extends j {
|
|
|
3936
3936
|
outputType: t.outputType,
|
|
3937
3937
|
mimetype: t.output.mimetype
|
|
3938
3938
|
}, o = `Cell Code:\n${i}\n\n`;
|
|
3939
|
-
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}`)),
|
|
3939
|
+
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}`)), N({
|
|
3940
3940
|
type: this.contextType,
|
|
3941
3941
|
data: a,
|
|
3942
3942
|
details: o
|
|
@@ -3964,15 +3964,15 @@ async function Eo(e, t, r) {
|
|
|
3964
3964
|
type: "file",
|
|
3965
3965
|
filename: `${r}-output-screenshot`,
|
|
3966
3966
|
mediaType: "image/png",
|
|
3967
|
-
url: await
|
|
3967
|
+
url: await oe(e.element)
|
|
3968
3968
|
})));
|
|
3969
3969
|
} catch (e) {
|
|
3970
3970
|
return n.error("Error downloading cell output images:", e), [];
|
|
3971
3971
|
}
|
|
3972
3972
|
}
|
|
3973
3973
|
function Do(e) {
|
|
3974
|
-
if (
|
|
3975
|
-
let t = e.mimetype, n = wo(t, String(e.data)) ? "media" : "text", r =
|
|
3974
|
+
if (T(e)) return null;
|
|
3975
|
+
let t = e.mimetype, n = wo(t, String(e.data)) ? "media" : "text", r = ze(e), i, a = !1;
|
|
3976
3976
|
return n === "media" && (typeof e.data == "string" && e.data.startsWith("data:") || typeof e.data == "string" && e.data.startsWith("http") ? i = e.data : a = !0), {
|
|
3977
3977
|
processedContent: r,
|
|
3978
3978
|
imageUrl: i,
|
|
@@ -3982,10 +3982,10 @@ function Do(e) {
|
|
|
3982
3982
|
};
|
|
3983
3983
|
}
|
|
3984
3984
|
function Oo(e, t, n) {
|
|
3985
|
-
let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.indexOf(e), s =
|
|
3985
|
+
let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.indexOf(e), s = ke(a.name, o), c;
|
|
3986
3986
|
r && (c = i.consoleOutputs.map((e) => Do(e)).filter((e) => e !== null));
|
|
3987
3987
|
let l, u = i.output;
|
|
3988
|
-
return u && !
|
|
3988
|
+
return u && !T(u) && (l = Do(u) ?? void 0), {
|
|
3989
3989
|
cellId: e,
|
|
3990
3990
|
cellName: s,
|
|
3991
3991
|
cellCode: a.code,
|
|
@@ -3997,14 +3997,14 @@ function Oo(e, t, n) {
|
|
|
3997
3997
|
//#region src/core/ai/context/providers/error.ts
|
|
3998
3998
|
function ko(e, t) {
|
|
3999
3999
|
let n = [`Code:\n${e.cellCode}`];
|
|
4000
|
-
if (e.tracebackHtml && n.push(`Traceback:\n${
|
|
4001
|
-
let r =
|
|
4000
|
+
if (e.tracebackHtml && n.push(`Traceback:\n${Pe(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => Me(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
|
|
4001
|
+
let r = ce(e.cellId, t);
|
|
4002
4002
|
r && n.push(`Database schema:\n${r}`);
|
|
4003
4003
|
}
|
|
4004
4004
|
return n.join("\n\n");
|
|
4005
4005
|
}
|
|
4006
4006
|
function Ao(e, t) {
|
|
4007
|
-
return
|
|
4007
|
+
return N({
|
|
4008
4008
|
type: "error",
|
|
4009
4009
|
data: {
|
|
4010
4010
|
name: e.cellName || `Cell ${e.cellId}`,
|
|
@@ -4014,12 +4014,12 @@ function Ao(e, t) {
|
|
|
4014
4014
|
});
|
|
4015
4015
|
}
|
|
4016
4016
|
function jo(e) {
|
|
4017
|
-
return e.errorData.length === 1 ?
|
|
4017
|
+
return e.errorData.length === 1 ? Ne(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? Pe(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
|
|
4018
4018
|
}
|
|
4019
4019
|
function Mo(e) {
|
|
4020
4020
|
return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
|
|
4021
4021
|
}
|
|
4022
|
-
var No = new
|
|
4022
|
+
var No = new w("error", "errors"), Po = class extends A {
|
|
4023
4023
|
title = "Errors";
|
|
4024
4024
|
mentionPrefix = "@";
|
|
4025
4025
|
contextType = "error";
|
|
@@ -4028,7 +4028,7 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4028
4028
|
super(), this.store = e;
|
|
4029
4029
|
}
|
|
4030
4030
|
getItems() {
|
|
4031
|
-
let e =
|
|
4031
|
+
let e = je(this.store);
|
|
4032
4032
|
if (e.length === 0) return [];
|
|
4033
4033
|
let t = [{
|
|
4034
4034
|
uri: this.asURI("all"),
|
|
@@ -4061,7 +4061,7 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4061
4061
|
detail: `${t} ${No.pluralize(t)}`,
|
|
4062
4062
|
type: "error",
|
|
4063
4063
|
apply: "@error://all",
|
|
4064
|
-
section:
|
|
4064
|
+
section: re.ERROR,
|
|
4065
4065
|
info: () => {
|
|
4066
4066
|
let e = document.createElement("div");
|
|
4067
4067
|
e.classList.add("mo-cm-tooltip", "docs-documentation", "min-w-[200px]", "flex", "flex-col", "gap-1", "p-2");
|
|
@@ -4081,24 +4081,24 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4081
4081
|
detail: jo(t),
|
|
4082
4082
|
type: "error"
|
|
4083
4083
|
}),
|
|
4084
|
-
section:
|
|
4084
|
+
section: re.ERROR
|
|
4085
4085
|
};
|
|
4086
4086
|
}
|
|
4087
4087
|
return {
|
|
4088
4088
|
label: "Error",
|
|
4089
4089
|
displayLabel: "Error",
|
|
4090
|
-
section:
|
|
4090
|
+
section: re.ERROR
|
|
4091
4091
|
};
|
|
4092
4092
|
}
|
|
4093
4093
|
formatContext(e) {
|
|
4094
4094
|
return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => Ao(e, this.store)).join("\n\n");
|
|
4095
4095
|
}
|
|
4096
|
-
}, Fo =
|
|
4096
|
+
}, Fo = ue(), Io = {
|
|
4097
4097
|
maxDepth: 3,
|
|
4098
4098
|
maxResults: 20,
|
|
4099
4099
|
defaultResultsLimit: 5,
|
|
4100
4100
|
includeDirectories: !1
|
|
4101
|
-
}, Lo = class extends
|
|
4101
|
+
}, Lo = class extends A {
|
|
4102
4102
|
title = "Files";
|
|
4103
4103
|
mentionPrefix = "#";
|
|
4104
4104
|
contextType = "file";
|
|
@@ -4200,8 +4200,8 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4200
4200
|
return {
|
|
4201
4201
|
...this.createBasicCompletion(e),
|
|
4202
4202
|
type: "file",
|
|
4203
|
-
section:
|
|
4204
|
-
boost: t.isDirectory ?
|
|
4203
|
+
section: re.FILE,
|
|
4204
|
+
boost: t.isDirectory ? O.MEDIUM : O.LOW,
|
|
4205
4205
|
detail: t.path,
|
|
4206
4206
|
displayLabel: `${i} ${r}`,
|
|
4207
4207
|
apply: async (e, i, a, o) => {
|
|
@@ -4215,7 +4215,7 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4215
4215
|
description: e.message
|
|
4216
4216
|
}), null));
|
|
4217
4217
|
if (!l) return;
|
|
4218
|
-
let u = l.mimeType || "text/plain", d =
|
|
4218
|
+
let u = l.mimeType || "text/plain", d = Be({
|
|
4219
4219
|
contents: l.contents ?? "",
|
|
4220
4220
|
mimeType: u,
|
|
4221
4221
|
isBase64: l.isBase64 ?? !1
|
|
@@ -4224,7 +4224,7 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4224
4224
|
from: a,
|
|
4225
4225
|
to: o,
|
|
4226
4226
|
insert: ""
|
|
4227
|
-
} }),
|
|
4227
|
+
} }), Nt(e);
|
|
4228
4228
|
},
|
|
4229
4229
|
info: () => {
|
|
4230
4230
|
let e = document.createElement("div");
|
|
@@ -4238,7 +4238,7 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4238
4238
|
}
|
|
4239
4239
|
formatContext(e) {
|
|
4240
4240
|
let { data: t, name: n } = e;
|
|
4241
|
-
return
|
|
4241
|
+
return N({
|
|
4242
4242
|
type: this.contextType,
|
|
4243
4243
|
data: {
|
|
4244
4244
|
name: n,
|
|
@@ -4248,7 +4248,7 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4248
4248
|
details: t.isDirectory ? "Directory containing files and subdirectories" : "File"
|
|
4249
4249
|
});
|
|
4250
4250
|
}
|
|
4251
|
-
}, Ro = class extends
|
|
4251
|
+
}, Ro = class extends A {
|
|
4252
4252
|
title = "Tables";
|
|
4253
4253
|
mentionPrefix = "@";
|
|
4254
4254
|
contextType = "data";
|
|
@@ -4278,7 +4278,7 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4278
4278
|
l += `${t}\n`;
|
|
4279
4279
|
}
|
|
4280
4280
|
}
|
|
4281
|
-
return
|
|
4281
|
+
return N({
|
|
4282
4282
|
type: this.contextType,
|
|
4283
4283
|
data: {
|
|
4284
4284
|
name: o,
|
|
@@ -4293,12 +4293,12 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4293
4293
|
label: `@${t}`,
|
|
4294
4294
|
displayLabel: t,
|
|
4295
4295
|
detail: n.source === "memory" ? "in-memory" : n.source,
|
|
4296
|
-
boost: n.source_type === "local" ?
|
|
4297
|
-
type:
|
|
4296
|
+
boost: n.source_type === "local" ? O.LOCAL_TABLE : O.REMOTE_TABLE,
|
|
4297
|
+
type: ne(n),
|
|
4298
4298
|
apply: `@${t}`,
|
|
4299
4299
|
section: {
|
|
4300
|
-
name:
|
|
4301
|
-
rank:
|
|
4300
|
+
name: ne(n) === "dataframe" ? "Dataframe" : "Table",
|
|
4301
|
+
rank: re.TABLE.rank
|
|
4302
4302
|
},
|
|
4303
4303
|
info: () => this.createTableInfoElement(t, n)
|
|
4304
4304
|
};
|
|
@@ -4356,7 +4356,7 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4356
4356
|
return e.classList.add("text-xs", "px-1.5", "py-0.5", "rounded-full", "font-medium", ...t.split(" ")), e;
|
|
4357
4357
|
}
|
|
4358
4358
|
}
|
|
4359
|
-
}, zo = class extends
|
|
4359
|
+
}, zo = class extends A {
|
|
4360
4360
|
title = "Variables";
|
|
4361
4361
|
mentionPrefix = "@";
|
|
4362
4362
|
contextType = "variable";
|
|
@@ -4383,13 +4383,13 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4383
4383
|
displayLabel: n.name,
|
|
4384
4384
|
detail: n.dataType ?? "",
|
|
4385
4385
|
type: this.contextType,
|
|
4386
|
-
section:
|
|
4387
|
-
info: () =>
|
|
4386
|
+
section: re.VARIABLE,
|
|
4387
|
+
info: () => ae(n)
|
|
4388
4388
|
};
|
|
4389
4389
|
}
|
|
4390
4390
|
formatContext(e) {
|
|
4391
4391
|
let { data: t } = e, { variable: n } = t;
|
|
4392
|
-
return
|
|
4392
|
+
return N({
|
|
4393
4393
|
type: this.contextType,
|
|
4394
4394
|
data: {
|
|
4395
4395
|
name: n.name,
|
|
@@ -4402,8 +4402,8 @@ var No = new O("error", "errors"), Po = class extends j {
|
|
|
4402
4402
|
//#endregion
|
|
4403
4403
|
//#region src/core/ai/context/context.ts
|
|
4404
4404
|
function Bo(e) {
|
|
4405
|
-
let t = e.get(se), n = e.get(
|
|
4406
|
-
return new
|
|
4405
|
+
let t = e.get(se), n = e.get(D), r = e.get(j);
|
|
4406
|
+
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 ee(t.connectionsMap, n));
|
|
4407
4407
|
}
|
|
4408
4408
|
function Vo() {
|
|
4409
4409
|
return new Lo(Ee());
|
|
@@ -4426,7 +4426,7 @@ async function Uo(e) {
|
|
|
4426
4426
|
type: "file",
|
|
4427
4427
|
mediaType: e.type,
|
|
4428
4428
|
filename: e.name,
|
|
4429
|
-
url: await
|
|
4429
|
+
url: await Re(e, "dataUrl")
|
|
4430
4430
|
})));
|
|
4431
4431
|
}
|
|
4432
4432
|
function Wo(e) {
|
|
@@ -4438,7 +4438,7 @@ function Wo(e) {
|
|
|
4438
4438
|
//#endregion
|
|
4439
4439
|
//#region src/components/chat/chat-components.tsx
|
|
4440
4440
|
var Go = (e) => {
|
|
4441
|
-
let t = (0,
|
|
4441
|
+
let t = (0, F.c)(6), { attachment: n } = e;
|
|
4442
4442
|
if (n.mediaType?.startsWith("image/")) {
|
|
4443
4443
|
let e = n.filename || "Attachment", r;
|
|
4444
4444
|
return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, J.jsx)("img", {
|
|
@@ -4448,14 +4448,14 @@ var Go = (e) => {
|
|
|
4448
4448
|
}), t[0] = n.url, t[1] = e, t[2] = r) : r = t[2], r;
|
|
4449
4449
|
}
|
|
4450
4450
|
let r;
|
|
4451
|
-
t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, J.jsx)(
|
|
4451
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, J.jsx)(Ie, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
|
|
4452
4452
|
let i = n.filename || "Attachment", a;
|
|
4453
4453
|
return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4454
4454
|
className: "flex flex-row gap-1 items-center text-xs",
|
|
4455
4455
|
children: [r, i]
|
|
4456
4456
|
}), t[4] = i, t[5] = a), a;
|
|
4457
4457
|
}, Ko = (e) => {
|
|
4458
|
-
let t = (0,
|
|
4458
|
+
let t = (0, F.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
|
|
4459
4459
|
t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, J.jsx)("span", {
|
|
4460
4460
|
className: "truncate font-medium",
|
|
4461
4461
|
children: r
|
|
@@ -4476,7 +4476,7 @@ var Go = (e) => {
|
|
|
4476
4476
|
s
|
|
4477
4477
|
] }), t[4] = n, t[5] = o, t[6] = s, t[7] = c) : c = t[7];
|
|
4478
4478
|
let l = c;
|
|
4479
|
-
if (a &&
|
|
4479
|
+
if (a && Se(a)) {
|
|
4480
4480
|
let e = i ?? r, n;
|
|
4481
4481
|
return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, J.jsx)("a", {
|
|
4482
4482
|
href: a,
|
|
@@ -4497,8 +4497,8 @@ var Go = (e) => {
|
|
|
4497
4497
|
//#endregion
|
|
4498
4498
|
//#region src/components/chat/chat-markdown.tsx
|
|
4499
4499
|
function qo(e) {
|
|
4500
|
-
let t = (0,
|
|
4501
|
-
return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ (0, J.jsx)(
|
|
4500
|
+
let t = (0, F.c)(3), { content: n } = e, r = qe(st)?.mode, i = r !== "agent" && r !== "code_mode", a;
|
|
4501
|
+
return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ (0, J.jsx)(ie, {
|
|
4502
4502
|
content: n,
|
|
4503
4503
|
allowNotebookInsertion: i
|
|
4504
4504
|
}), t[0] = n, t[1] = i, t[2] = a) : a = t[2], a;
|
|
@@ -4516,7 +4516,7 @@ function Yo(e) {
|
|
|
4516
4516
|
//#endregion
|
|
4517
4517
|
//#region src/components/chat/tool-call/tool-args.tsx
|
|
4518
4518
|
var Xo = (e) => {
|
|
4519
|
-
let t = (0,
|
|
4519
|
+
let t = (0, F.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
|
|
4520
4520
|
if (n == null) return null;
|
|
4521
4521
|
let a;
|
|
4522
4522
|
t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, J.jsx)("h3", {
|
|
@@ -4536,12 +4536,12 @@ var Xo = (e) => {
|
|
|
4536
4536
|
children: [a, s]
|
|
4537
4537
|
}), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
|
|
4538
4538
|
}, Zo = (e) => {
|
|
4539
|
-
let t = (0,
|
|
4539
|
+
let t = (0, F.c)(27), { toolName: n, input: i, approval: o, onApprove: s, className: c } = e, l;
|
|
4540
4540
|
t[0] === c ? l = t[1] : (l = r("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
|
|
4541
4541
|
let u;
|
|
4542
4542
|
t[2] === n ? u = t[3] : (u = Yo(n), t[2] = n, t[3] = u);
|
|
4543
4543
|
let d = `Approval required for ${u}`, f;
|
|
4544
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(
|
|
4544
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)($t, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
|
|
4545
4545
|
let p;
|
|
4546
4546
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)("span", {
|
|
4547
4547
|
className: "font-semibold",
|
|
@@ -4605,27 +4605,27 @@ var Xo = (e) => {
|
|
|
4605
4605
|
get_marimo_rules: {
|
|
4606
4606
|
running: "Reading marimo guidelines",
|
|
4607
4607
|
done: "Read marimo guidelines",
|
|
4608
|
-
icon:
|
|
4608
|
+
icon: Bt
|
|
4609
4609
|
},
|
|
4610
4610
|
get_active_notebooks: {
|
|
4611
4611
|
running: "Listing notebooks",
|
|
4612
4612
|
done: "Listed notebooks",
|
|
4613
|
-
icon:
|
|
4613
|
+
icon: qt
|
|
4614
4614
|
},
|
|
4615
4615
|
get_lightweight_cell_map: {
|
|
4616
4616
|
running: "Reading notebook",
|
|
4617
4617
|
done: "Read notebook",
|
|
4618
|
-
icon:
|
|
4618
|
+
icon: Gt
|
|
4619
4619
|
},
|
|
4620
4620
|
get_cell_runtime_data: {
|
|
4621
4621
|
running: "Inspecting cells",
|
|
4622
4622
|
done: "Inspected cells",
|
|
4623
|
-
icon:
|
|
4623
|
+
icon: Xt
|
|
4624
4624
|
},
|
|
4625
4625
|
get_cell_outputs: {
|
|
4626
4626
|
running: "Reading cell outputs",
|
|
4627
4627
|
done: "Read cell outputs",
|
|
4628
|
-
icon:
|
|
4628
|
+
icon: Xt
|
|
4629
4629
|
},
|
|
4630
4630
|
get_tables_and_variables: {
|
|
4631
4631
|
running: "Reading variables",
|
|
@@ -4635,17 +4635,17 @@ var Xo = (e) => {
|
|
|
4635
4635
|
get_database_tables: {
|
|
4636
4636
|
running: "Reading database tables",
|
|
4637
4637
|
done: "Read database tables",
|
|
4638
|
-
icon:
|
|
4638
|
+
icon: de
|
|
4639
4639
|
},
|
|
4640
4640
|
get_notebook_errors: {
|
|
4641
4641
|
running: "Checking for errors",
|
|
4642
4642
|
done: "Checked for errors",
|
|
4643
|
-
icon:
|
|
4643
|
+
icon: Ut
|
|
4644
4644
|
},
|
|
4645
4645
|
lint_notebook: {
|
|
4646
4646
|
running: "Linting notebook",
|
|
4647
4647
|
done: "Linted notebook",
|
|
4648
|
-
icon:
|
|
4648
|
+
icon: Kt
|
|
4649
4649
|
},
|
|
4650
4650
|
get_cell_dependency_graph: {
|
|
4651
4651
|
running: "Reading dependency graph",
|
|
@@ -4656,12 +4656,12 @@ var Xo = (e) => {
|
|
|
4656
4656
|
add_cell: {
|
|
4657
4657
|
running: "Adding cell",
|
|
4658
4658
|
done: "Added cell",
|
|
4659
|
-
icon:
|
|
4659
|
+
icon: ge
|
|
4660
4660
|
},
|
|
4661
4661
|
update_cell: {
|
|
4662
4662
|
running: "Editing cell",
|
|
4663
4663
|
done: "Edited cell",
|
|
4664
|
-
icon:
|
|
4664
|
+
icon: Ve
|
|
4665
4665
|
},
|
|
4666
4666
|
delete_cell: {
|
|
4667
4667
|
running: "Deleting cell",
|
|
@@ -4674,7 +4674,7 @@ function es(e, t, n) {
|
|
|
4674
4674
|
if (r === "execute_code") return {
|
|
4675
4675
|
label: n === "running" ? "Running code" : "Ran code",
|
|
4676
4676
|
detail: rs(t) ? ns(t.code) : void 0,
|
|
4677
|
-
icon:
|
|
4677
|
+
icon: M
|
|
4678
4678
|
};
|
|
4679
4679
|
if (r === "edit_notebook_tool") {
|
|
4680
4680
|
let e = ts(t);
|
|
@@ -4688,7 +4688,7 @@ function es(e, t, n) {
|
|
|
4688
4688
|
}
|
|
4689
4689
|
return {
|
|
4690
4690
|
label: n === "running" ? "Editing notebook" : "Edited notebook",
|
|
4691
|
-
icon:
|
|
4691
|
+
icon: Ve
|
|
4692
4692
|
};
|
|
4693
4693
|
}
|
|
4694
4694
|
if (Object.hasOwn(Qo, r)) {
|
|
@@ -4723,17 +4723,17 @@ function rs(e) {
|
|
|
4723
4723
|
//#endregion
|
|
4724
4724
|
//#region src/components/chat/tool-call/tool-result.tsx
|
|
4725
4725
|
function is(e) {
|
|
4726
|
-
return e == null || typeof e == "object" &&
|
|
4727
|
-
}
|
|
4728
|
-
var as =
|
|
4729
|
-
status:
|
|
4730
|
-
auth_required:
|
|
4731
|
-
action_url:
|
|
4732
|
-
next_steps:
|
|
4733
|
-
meta:
|
|
4734
|
-
message:
|
|
4726
|
+
return e == null || typeof e == "object" && _t(e);
|
|
4727
|
+
}
|
|
4728
|
+
var as = Ke({
|
|
4729
|
+
status: ut().default("success"),
|
|
4730
|
+
auth_required: dt().default(!1),
|
|
4731
|
+
action_url: Je().optional(),
|
|
4732
|
+
next_steps: Je().optional(),
|
|
4733
|
+
meta: Je().optional(),
|
|
4734
|
+
message: ut().nullish()
|
|
4735
4735
|
}), os = (e) => {
|
|
4736
|
-
let t = (0,
|
|
4736
|
+
let t = (0, F.c)(12), { data: n } = e, r;
|
|
4737
4737
|
if (t[0] !== n) {
|
|
4738
4738
|
let { status: e, auth_required: i, action_url: a, meta: o, next_steps: s, message: c, ...l } = n, u;
|
|
4739
4739
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)("h3", {
|
|
@@ -4779,7 +4779,7 @@ var as = qe({
|
|
|
4779
4779
|
} else r = t[1];
|
|
4780
4780
|
return r;
|
|
4781
4781
|
}, ss = (e) => {
|
|
4782
|
-
let t = (0,
|
|
4782
|
+
let t = (0, F.c)(8), { result: n } = e, r;
|
|
4783
4783
|
t[0] === n ? r = t[1] : (r = as.safeParse(n), t[0] = n, t[1] = r);
|
|
4784
4784
|
let i = r;
|
|
4785
4785
|
if (i.success) {
|
|
@@ -4810,7 +4810,7 @@ function cs(e) {
|
|
|
4810
4810
|
//#endregion
|
|
4811
4811
|
//#region src/components/chat/tool-call/tool-step.tsx
|
|
4812
4812
|
var ls = (e) => {
|
|
4813
|
-
let t = (0,
|
|
4813
|
+
let t = (0, F.c)(58), { toolName: n, state: i, input: a, result: o, errorText: s, approval: c, isActive: l, className: u } = e, d = l === void 0 || l, [f, p] = q.useState(!1), m, h, g, _, v, y, b, x, S, C, w;
|
|
4814
4814
|
if (t[0] !== u || t[1] !== a || t[2] !== d || t[3] !== f || t[4] !== i || t[5] !== n) {
|
|
4815
4815
|
let e = Jo.has(i), { label: o, detail: s, icon: c } = es(n, a, e ? "running" : "done");
|
|
4816
4816
|
g = o, h = s, _ = us(i, e && !d, c);
|
|
@@ -4842,7 +4842,7 @@ var ls = (e) => {
|
|
|
4842
4842
|
let k = f && "rotate-90 opacity-100", A;
|
|
4843
4843
|
t[33] === k ? A = t[34] : (A = r("size-3 shrink-0 opacity-40 transition-transform group-hover/step:opacity-100", k), t[33] = k, t[34] = A);
|
|
4844
4844
|
let j;
|
|
4845
|
-
t[35] === A ? j = t[36] : (j = /* @__PURE__ */ (0, J.jsx)(
|
|
4845
|
+
t[35] === A ? j = t[36] : (j = /* @__PURE__ */ (0, J.jsx)(me, {
|
|
4846
4846
|
"aria-hidden": !0,
|
|
4847
4847
|
className: A
|
|
4848
4848
|
}), t[35] = A, t[36] = j);
|
|
@@ -4868,15 +4868,15 @@ var ls = (e) => {
|
|
|
4868
4868
|
errorText: s,
|
|
4869
4869
|
approval: c
|
|
4870
4870
|
}), t[47] = c, t[48] = s, t[49] = a, t[50] = f, t[51] = o, t[52] = i, t[53] = ee) : ee = t[53];
|
|
4871
|
-
let
|
|
4872
|
-
return t[54] !== M || t[55] !== ee || t[56] !== w ? (
|
|
4871
|
+
let N;
|
|
4872
|
+
return t[54] !== M || t[55] !== ee || t[56] !== w ? (N = /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4873
4873
|
className: w,
|
|
4874
4874
|
children: [M, ee]
|
|
4875
|
-
}), t[54] = M, t[55] = ee, t[56] = w, t[57] =
|
|
4875
|
+
}), t[54] = M, t[55] = ee, t[56] = w, t[57] = N) : N = t[57], N;
|
|
4876
4876
|
};
|
|
4877
4877
|
function us(e, t, n) {
|
|
4878
4878
|
if (t) return {
|
|
4879
|
-
icon:
|
|
4879
|
+
icon: Wt,
|
|
4880
4880
|
suffix: "Stopped"
|
|
4881
4881
|
};
|
|
4882
4882
|
switch (e) {
|
|
@@ -4885,7 +4885,7 @@ function us(e, t, n) {
|
|
|
4885
4885
|
suffix: "Failed"
|
|
4886
4886
|
};
|
|
4887
4887
|
case "output-denied": return {
|
|
4888
|
-
icon:
|
|
4888
|
+
icon: zt,
|
|
4889
4889
|
suffix: "Denied"
|
|
4890
4890
|
};
|
|
4891
4891
|
case "output-available": return { icon: n };
|
|
@@ -4896,7 +4896,7 @@ function us(e, t, n) {
|
|
|
4896
4896
|
}
|
|
4897
4897
|
}
|
|
4898
4898
|
var ds = (e) => {
|
|
4899
|
-
let t = (0,
|
|
4899
|
+
let t = (0, F.c)(16), { state: n, input: r, result: i, errorText: a, approval: o } = e, s;
|
|
4900
4900
|
t[0] === r ? s = t[1] : (s = /* @__PURE__ */ (0, J.jsx)(Xo, { input: r }), t[0] = r, t[1] = s);
|
|
4901
4901
|
let c;
|
|
4902
4902
|
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];
|
|
@@ -4927,7 +4927,7 @@ function fs(e) {
|
|
|
4927
4927
|
//#endregion
|
|
4928
4928
|
//#region src/components/chat/tool-call/tool-call-view.tsx
|
|
4929
4929
|
var ps = (e) => {
|
|
4930
|
-
let t = (0,
|
|
4930
|
+
let t = (0, F.c)(16), n, r, i, a, o;
|
|
4931
4931
|
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") {
|
|
4932
4932
|
let e;
|
|
4933
4933
|
return t[6] !== n || t[7] !== r || t[8] !== i || t[9] !== o ? (e = n != null && r != null ? /* @__PURE__ */ (0, J.jsx)(Zo, {
|
|
@@ -4986,7 +4986,7 @@ var ps = (e) => {
|
|
|
4986
4986
|
}, t);
|
|
4987
4987
|
case "reasoning": return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
4988
4988
|
className: "flex gap-1.5 py-1.5 text-muted-foreground",
|
|
4989
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
4989
|
+
children: [/* @__PURE__ */ (0, J.jsx)(Ht, {
|
|
4990
4990
|
"aria-hidden": !0,
|
|
4991
4991
|
className: "-ml-px mt-1 size-3 shrink-0"
|
|
4992
4992
|
}), /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
@@ -5009,7 +5009,7 @@ var ps = (e) => {
|
|
|
5009
5009
|
subtitle: e.filename
|
|
5010
5010
|
}, t);
|
|
5011
5011
|
case "source-url": return /* @__PURE__ */ (0, J.jsx)(Ko, {
|
|
5012
|
-
icon: /* @__PURE__ */ (0, J.jsx)(
|
|
5012
|
+
icon: /* @__PURE__ */ (0, J.jsx)(we, { className: "h-3 w-3 shrink-0" }),
|
|
5013
5013
|
title: e.title ?? e.url,
|
|
5014
5014
|
subtitle: e.title ? e.url : void 0,
|
|
5015
5015
|
href: e.url
|
|
@@ -5019,7 +5019,7 @@ var ps = (e) => {
|
|
|
5019
5019
|
children: e.kind
|
|
5020
5020
|
}, t);
|
|
5021
5021
|
case "step-start": return null;
|
|
5022
|
-
default: return
|
|
5022
|
+
default: return He(e), null;
|
|
5023
5023
|
}
|
|
5024
5024
|
}
|
|
5025
5025
|
};
|
|
@@ -5056,11 +5056,11 @@ function bs(e) {
|
|
|
5056
5056
|
//#endregion
|
|
5057
5057
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/utils/facet.js
|
|
5058
5058
|
function xs(e) {
|
|
5059
|
-
return
|
|
5059
|
+
return Et.define({ combine: (t) => t[0] ?? e });
|
|
5060
5060
|
}
|
|
5061
5061
|
//#endregion
|
|
5062
5062
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/prompt-history/extension.js
|
|
5063
|
-
var Ss = xs({}), Cs =
|
|
5063
|
+
var Ss = xs({}), Cs = xt.define(), ws = xt.define(), Ts = 50, Es = bt.define({
|
|
5064
5064
|
create() {
|
|
5065
5065
|
return {
|
|
5066
5066
|
prompts: [],
|
|
@@ -5119,7 +5119,7 @@ function ks(e = {}) {
|
|
|
5119
5119
|
navigationIndex: -1,
|
|
5120
5120
|
originalText: ""
|
|
5121
5121
|
})), Ss.of(t ?? {})];
|
|
5122
|
-
return n && r.push(
|
|
5122
|
+
return n && r.push(kt.of([{
|
|
5123
5123
|
key: "ArrowUp",
|
|
5124
5124
|
run: Ds
|
|
5125
5125
|
}, {
|
|
@@ -5129,7 +5129,7 @@ function ks(e = {}) {
|
|
|
5129
5129
|
}
|
|
5130
5130
|
//#endregion
|
|
5131
5131
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/state.js
|
|
5132
|
-
var As =
|
|
5132
|
+
var As = xt.define(), Q = bt.define({
|
|
5133
5133
|
create() {
|
|
5134
5134
|
return /* @__PURE__ */ new Map();
|
|
5135
5135
|
},
|
|
@@ -5141,7 +5141,7 @@ var As = St.define(), Q = xt.define({
|
|
|
5141
5141
|
}
|
|
5142
5142
|
return r;
|
|
5143
5143
|
}
|
|
5144
|
-
}), js =
|
|
5144
|
+
}), js = bt.define({
|
|
5145
5145
|
create() {
|
|
5146
5146
|
return {
|
|
5147
5147
|
onResourceClick: void 0,
|
|
@@ -5153,8 +5153,8 @@ var As = St.define(), Q = xt.define({
|
|
|
5153
5153
|
update(e) {
|
|
5154
5154
|
return e;
|
|
5155
5155
|
}
|
|
5156
|
-
}), Ms =
|
|
5157
|
-
|
|
5156
|
+
}), Ms = xt.define();
|
|
5157
|
+
bt.define({
|
|
5158
5158
|
create() {
|
|
5159
5159
|
return /* @__PURE__ */ new Map();
|
|
5160
5160
|
},
|
|
@@ -5202,7 +5202,7 @@ function $(e) {
|
|
|
5202
5202
|
}
|
|
5203
5203
|
//#endregion
|
|
5204
5204
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
|
|
5205
|
-
var Fs = class extends
|
|
5205
|
+
var Fs = class extends Tt {
|
|
5206
5206
|
resource;
|
|
5207
5207
|
view;
|
|
5208
5208
|
constructor(e, t) {
|
|
@@ -5223,7 +5223,7 @@ var Fs = class extends Et {
|
|
|
5223
5223
|
e.preventDefault(), e.stopPropagation(), i(this.resource);
|
|
5224
5224
|
}), e;
|
|
5225
5225
|
}
|
|
5226
|
-
}, Is = class extends
|
|
5226
|
+
}, Is = class extends Tt {
|
|
5227
5227
|
uri;
|
|
5228
5228
|
view;
|
|
5229
5229
|
constructor(e, t) {
|
|
@@ -5243,12 +5243,12 @@ function Ls(e) {
|
|
|
5243
5243
|
let a = e.state.doc.sliceString(r, i);
|
|
5244
5244
|
for (let i of $(a)) {
|
|
5245
5245
|
let a = r + i.index, o = i[0].slice(1), s = t.get(o);
|
|
5246
|
-
s ? n.push(
|
|
5246
|
+
s ? n.push(jt.replace({ widget: new Fs(s, e) }).range(a, a + i[0].length)) : n.push(jt.replace({ widget: new Is(o, e) }).range(a, a + i[0].length));
|
|
5247
5247
|
}
|
|
5248
5248
|
}
|
|
5249
|
-
return
|
|
5249
|
+
return jt.set(n);
|
|
5250
5250
|
}
|
|
5251
|
-
var Rs =
|
|
5251
|
+
var Rs = Ct.fromClass(class {
|
|
5252
5252
|
decorations;
|
|
5253
5253
|
constructor(e) {
|
|
5254
5254
|
this.decorations = Ls(e);
|
|
@@ -5288,7 +5288,7 @@ function Bs(e, t, n, r = 0) {
|
|
|
5288
5288
|
return null;
|
|
5289
5289
|
}
|
|
5290
5290
|
function Vs(e) {
|
|
5291
|
-
return
|
|
5291
|
+
return Ot((t, n) => {
|
|
5292
5292
|
let { from: r, text: i } = t.state.doc.lineAt(n), a = Bs(i, n, t.state.field(Q), r);
|
|
5293
5293
|
return a ? {
|
|
5294
5294
|
pos: a.start,
|
|
@@ -5358,8 +5358,8 @@ function Ks(e, t) {
|
|
|
5358
5358
|
}
|
|
5359
5359
|
return null;
|
|
5360
5360
|
}
|
|
5361
|
-
var qs =
|
|
5362
|
-
let t = e.annotation(
|
|
5361
|
+
var qs = At.transactionFilter.of((e) => {
|
|
5362
|
+
let t = e.annotation(Dt.userEvent);
|
|
5363
5363
|
if (!t) return e;
|
|
5364
5364
|
let n = e.startState.selection.main;
|
|
5365
5365
|
if (!n.empty) return e;
|
|
@@ -5541,11 +5541,11 @@ function $s(e, t) {
|
|
|
5541
5541
|
};
|
|
5542
5542
|
}
|
|
5543
5543
|
function ec(e, t = {}) {
|
|
5544
|
-
return
|
|
5544
|
+
return Ct.fromClass($s(e, t));
|
|
5545
5545
|
}
|
|
5546
5546
|
//#endregion
|
|
5547
5547
|
//#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
|
|
5548
|
-
var tc =
|
|
5548
|
+
var tc = wt.baseTheme({
|
|
5549
5549
|
".cm-resource-widget": {
|
|
5550
5550
|
background: "light-dark(rgba(86,156,214,0.08),rgba(86,156,214,0.18))",
|
|
5551
5551
|
borderRadius: "4px",
|
|
@@ -5578,10 +5578,10 @@ function oc(e) {
|
|
|
5578
5578
|
let { language: t, store: r, onAddFiles: i } = e, a = () => ac(r);
|
|
5579
5579
|
return [
|
|
5580
5580
|
t.data.of({ autocomplete: Ns(async () => a(), (e) => e.type === nc ? ic : Bo(r).getProvider(e.type)?.formatCompletion(e) || {}) }),
|
|
5581
|
-
|
|
5581
|
+
St.high(kt.of([{
|
|
5582
5582
|
key: "Tab",
|
|
5583
5583
|
preventDefault: !0,
|
|
5584
|
-
run: (e) =>
|
|
5584
|
+
run: (e) => Mt(e)
|
|
5585
5585
|
}])),
|
|
5586
5586
|
Fo.of({ addAttachment: (e) => i?.([e]) }),
|
|
5587
5587
|
...i ? [t.data.of({ autocomplete: Vo().createCompletionSource() })] : [],
|
|
@@ -5610,13 +5610,13 @@ function sc(e) {
|
|
|
5610
5610
|
}
|
|
5611
5611
|
//#endregion
|
|
5612
5612
|
//#region src/components/editor/ai/prompt-input.tsx
|
|
5613
|
-
var cc = "marimo:ai-prompt-history", lc = new Te(
|
|
5614
|
-
let t = (0,
|
|
5613
|
+
var cc = "marimo:ai-prompt-history", lc = new Te(Ze(ut()), () => []), uc = (e) => {
|
|
5614
|
+
let t = (0, F.c)(28), { value: n, placeholder: i, placeholderAction: a, inputRef: o, className: s, onChange: c, onSubmit: l, onKeyDown: u, onClose: d, onAddFiles: f, additionalCompletions: p, maxHeight: h } = e, g = yt(l), _ = yt(d), v = Qe(), { theme: y } = mt(), b;
|
|
5615
5615
|
t[0] === p ? b = t[1] : (b = (e) => p ? Ho([p.triggerCompletionRegex], p.completions)(e) : null, t[0] = p, t[1] = b);
|
|
5616
|
-
let x =
|
|
5616
|
+
let x = yt(b), S;
|
|
5617
5617
|
if (t[2] !== x || t[3] !== _ || t[4] !== g || t[5] !== f || t[6] !== a || t[7] !== v) {
|
|
5618
|
-
let e =
|
|
5619
|
-
t[9] === Symbol.for("react.memo_cache_sentinel") ? (n =
|
|
5618
|
+
let e = Ft(), n;
|
|
5619
|
+
t[9] === Symbol.for("react.memo_cache_sentinel") ? (n = Pt({}), t[9] = n) : n = t[9];
|
|
5620
5620
|
let r = oc({
|
|
5621
5621
|
language: e.language,
|
|
5622
5622
|
store: v,
|
|
@@ -5627,9 +5627,9 @@ var cc = "marimo:ai-prompt-history", lc = new Te(Qe(dt()), () => []), uc = (e) =
|
|
|
5627
5627
|
save: fc
|
|
5628
5628
|
} }), t[10] = o) : o = t[10];
|
|
5629
5629
|
let s;
|
|
5630
|
-
t[11] === Symbol.for("react.memo_cache_sentinel") ? (s =
|
|
5630
|
+
t[11] === Symbol.for("react.memo_cache_sentinel") ? (s = It(), t[11] = s) : s = t[11];
|
|
5631
5631
|
let c;
|
|
5632
|
-
t[12] === g ? c = t[13] : (c =
|
|
5632
|
+
t[12] === g ? c = t[13] : (c = St.highest(kt.of([{
|
|
5633
5633
|
preventDefault: !0,
|
|
5634
5634
|
stopPropagation: !0,
|
|
5635
5635
|
any: (e, t) => {
|
|
@@ -5638,7 +5638,7 @@ var cc = "marimo:ai-prompt-history", lc = new Te(Qe(dt()), () => []), uc = (e) =
|
|
|
5638
5638
|
}
|
|
5639
5639
|
}])), t[12] = g, t[13] = c);
|
|
5640
5640
|
let l;
|
|
5641
|
-
t[14] === _ ? l = t[15] : (l =
|
|
5641
|
+
t[14] === _ ? l = t[15] : (l = kt.of([{
|
|
5642
5642
|
key: "Escape",
|
|
5643
5643
|
preventDefault: !0,
|
|
5644
5644
|
stopPropagation: !0,
|
|
@@ -5650,7 +5650,7 @@ var cc = "marimo:ai-prompt-history", lc = new Te(Qe(dt()), () => []), uc = (e) =
|
|
|
5650
5650
|
r,
|
|
5651
5651
|
i,
|
|
5652
5652
|
o,
|
|
5653
|
-
|
|
5653
|
+
wt.lineWrapping,
|
|
5654
5654
|
s,
|
|
5655
5655
|
c,
|
|
5656
5656
|
l
|
|
@@ -5659,7 +5659,7 @@ var cc = "marimo:ai-prompt-history", lc = new Te(Qe(dt()), () => []), uc = (e) =
|
|
|
5659
5659
|
let C = S, w;
|
|
5660
5660
|
t[16] === s ? w = t[17] : (w = r("mo-ai-prompt flex-1 font-sans text-sm leading-6 overflow-auto my-1", s), t[16] = s, t[17] = w);
|
|
5661
5661
|
let T = y === "dark" ? "dark" : "light", E = a ? void 0 : i || "Generate with AI, @ to include context", D;
|
|
5662
|
-
return t[18] !== C || t[19] !== o || t[20] !== h || t[21] !== c || t[22] !== u || t[23] !== w || t[24] !== T || t[25] !== E || t[26] !== n ? (D = /* @__PURE__ */ (0, J.jsx)(
|
|
5662
|
+
return t[18] !== C || t[19] !== o || t[20] !== h || t[21] !== c || t[22] !== u || t[23] !== w || t[24] !== T || t[25] !== E || t[26] !== n ? (D = /* @__PURE__ */ (0, J.jsx)(Lt, {
|
|
5663
5663
|
ref: o,
|
|
5664
5664
|
className: w,
|
|
5665
5665
|
width: "100%",
|
|
@@ -5681,11 +5681,11 @@ function fc(e) {
|
|
|
5681
5681
|
}
|
|
5682
5682
|
//#endregion
|
|
5683
5683
|
//#region src/plugins/impl/chat/chat-ui.tsx
|
|
5684
|
-
var pc = u, mc =
|
|
5685
|
-
type:
|
|
5686
|
-
message_id:
|
|
5687
|
-
content:
|
|
5688
|
-
is_final:
|
|
5684
|
+
var pc = u, mc = ft({
|
|
5685
|
+
type: $e("stream_chunk"),
|
|
5686
|
+
message_id: ut(),
|
|
5687
|
+
content: Je().nullable().transform((e) => e),
|
|
5688
|
+
is_final: dt().optional()
|
|
5689
5689
|
});
|
|
5690
5690
|
function hc(e, t) {
|
|
5691
5691
|
let { controllerRef: r, activeRequestIdRef: i } = t, a = r.current;
|
|
@@ -5705,7 +5705,7 @@ var gc = (e) => {
|
|
|
5705
5705
|
}, [s]);
|
|
5706
5706
|
let b = (0, q.useRef)(null), x = (0, q.useRef)(null), S = (0, q.useRef)(null), [C, w] = (0, q.useState)(null), T = () => {
|
|
5707
5707
|
S.current = null, w(null);
|
|
5708
|
-
}, { data:
|
|
5708
|
+
}, { data: D } = Rt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : D, { messages: k, sendMessage: A, setMessages: j, status: M, stop: ee, error: N, regenerate: ne, clearError: re, addToolApprovalResponse: ie } = lo({
|
|
5709
5709
|
sendAutomaticallyWhen: ({ messages: e }) => Wo(e),
|
|
5710
5710
|
transport: new Ha({ fetch: async (t, r) => {
|
|
5711
5711
|
if (r === void 0) return fetch(t);
|
|
@@ -5721,7 +5721,7 @@ var gc = (e) => {
|
|
|
5721
5721
|
let t = i.messages.map((e) => ({
|
|
5722
5722
|
...e,
|
|
5723
5723
|
content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
|
|
5724
|
-
})), r =
|
|
5724
|
+
})), r = E();
|
|
5725
5725
|
T();
|
|
5726
5726
|
let s = new ReadableStream({
|
|
5727
5727
|
start(t) {
|
|
@@ -5781,7 +5781,7 @@ var gc = (e) => {
|
|
|
5781
5781
|
n.error("An error occurred:", e);
|
|
5782
5782
|
}
|
|
5783
5783
|
});
|
|
5784
|
-
i(e.host,
|
|
5784
|
+
i(e.host, Le.TYPE, (e) => {
|
|
5785
5785
|
let t = mc.safeParse(e.detail.message);
|
|
5786
5786
|
if (t.success) {
|
|
5787
5787
|
if (t.data.content && t.data.message_id === x.current) {
|
|
@@ -5794,27 +5794,27 @@ var gc = (e) => {
|
|
|
5794
5794
|
});
|
|
5795
5795
|
}
|
|
5796
5796
|
});
|
|
5797
|
-
let
|
|
5797
|
+
let ae = M === "submitted" || M === "streaming", oe = (t) => {
|
|
5798
5798
|
let n = k.findIndex((e) => e.id === t);
|
|
5799
5799
|
if (n !== -1) {
|
|
5800
5800
|
let r = k.filter((e) => e.id !== t);
|
|
5801
5801
|
e.delete_chat_message({ index: n }), j(r), e.setValue(r), r.length === 0 && T();
|
|
5802
5802
|
}
|
|
5803
|
-
},
|
|
5803
|
+
}, se = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, ce = {
|
|
5804
5804
|
triggerCompletionRegex: /^\/(\w+)?/,
|
|
5805
5805
|
completions: e.prompts.map((e) => ({
|
|
5806
5806
|
label: `/${e}`,
|
|
5807
5807
|
displayLabel: e,
|
|
5808
5808
|
apply: e
|
|
5809
5809
|
}))
|
|
5810
|
-
},
|
|
5810
|
+
}, le = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
|
|
5811
5811
|
(0, q.useEffect)(() => {
|
|
5812
5812
|
v.current?.scrollTo({
|
|
5813
5813
|
top: v.current.scrollHeight,
|
|
5814
5814
|
behavior: "smooth"
|
|
5815
5815
|
});
|
|
5816
5816
|
}, [k.length, v]);
|
|
5817
|
-
let
|
|
5817
|
+
let ue = () => {
|
|
5818
5818
|
let e = _.current?.view;
|
|
5819
5819
|
if (e) {
|
|
5820
5820
|
let t = e.state.doc.length;
|
|
@@ -5838,9 +5838,9 @@ var gc = (e) => {
|
|
|
5838
5838
|
size: "icon",
|
|
5839
5839
|
disabled: k.length === 0,
|
|
5840
5840
|
onClick: () => {
|
|
5841
|
-
j([]), e.setValue([]), e.delete_chat_history({}),
|
|
5841
|
+
j([]), e.setValue([]), e.delete_chat_history({}), re(), T();
|
|
5842
5842
|
},
|
|
5843
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5843
|
+
children: /* @__PURE__ */ (0, J.jsx)(Yt, { className: "h-3 w-3" })
|
|
5844
5844
|
})
|
|
5845
5845
|
}),
|
|
5846
5846
|
/* @__PURE__ */ (0, J.jsxs)("div", {
|
|
@@ -5850,7 +5850,7 @@ var gc = (e) => {
|
|
|
5850
5850
|
k.length === 0 && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5851
5851
|
className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
|
|
5852
5852
|
children: [
|
|
5853
|
-
/* @__PURE__ */ (0, J.jsx)(
|
|
5853
|
+
/* @__PURE__ */ (0, J.jsx)(Vt, { className: "h-12 w-12 mb-4" }),
|
|
5854
5854
|
/* @__PURE__ */ (0, J.jsx)("h3", {
|
|
5855
5855
|
className: "text-lg font-semibold mb-2",
|
|
5856
5856
|
children: "No messages yet"
|
|
@@ -5870,8 +5870,8 @@ var gc = (e) => {
|
|
|
5870
5870
|
children: ms({
|
|
5871
5871
|
message: e,
|
|
5872
5872
|
isLast: i,
|
|
5873
|
-
isActive:
|
|
5874
|
-
addToolApprovalResponse: i ?
|
|
5873
|
+
isActive: ae,
|
|
5874
|
+
addToolApprovalResponse: i ? ie : void 0
|
|
5875
5875
|
})
|
|
5876
5876
|
}), /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5877
5877
|
className: "flex justify-end text-xs gap-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100",
|
|
@@ -5882,27 +5882,27 @@ var gc = (e) => {
|
|
|
5882
5882
|
}), /* @__PURE__ */ (0, J.jsx)("button", {
|
|
5883
5883
|
type: "button",
|
|
5884
5884
|
"aria-label": "Delete message",
|
|
5885
|
-
onClick: () =>
|
|
5885
|
+
onClick: () => oe(e.id),
|
|
5886
5886
|
className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
|
|
5887
5887
|
children: /* @__PURE__ */ (0, J.jsx)(d, { className: "h-3 w-3 text-(--red-9)" })
|
|
5888
5888
|
})]
|
|
5889
5889
|
})]
|
|
5890
5890
|
}, e.id);
|
|
5891
5891
|
}),
|
|
5892
|
-
|
|
5892
|
+
ae && k.at(-1)?.role !== "assistant" && /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5893
5893
|
className: "flex items-center justify-center mb-4",
|
|
5894
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5894
|
+
children: /* @__PURE__ */ (0, J.jsx)(te, { size: "small" })
|
|
5895
5895
|
}),
|
|
5896
|
-
|
|
5896
|
+
N && /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
5897
5897
|
className: "flex items-center justify-center space-x-2 mb-4",
|
|
5898
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
5898
|
+
children: [/* @__PURE__ */ (0, J.jsx)(gt, { error: N }), /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5899
5899
|
variant: "outline",
|
|
5900
5900
|
size: "sm",
|
|
5901
5901
|
onClick: () => ne(),
|
|
5902
5902
|
children: "Retry"
|
|
5903
5903
|
})]
|
|
5904
5904
|
}),
|
|
5905
|
-
C && !
|
|
5905
|
+
C && !ae && !N && /* @__PURE__ */ (0, J.jsx)("div", {
|
|
5906
5906
|
className: "flex justify-center py-2",
|
|
5907
5907
|
children: /* @__PURE__ */ (0, J.jsx)("span", {
|
|
5908
5908
|
className: "text-xs text-muted-foreground",
|
|
@@ -5921,7 +5921,7 @@ var gc = (e) => {
|
|
|
5921
5921
|
type: "text",
|
|
5922
5922
|
text: t
|
|
5923
5923
|
}, ...r ?? []]
|
|
5924
|
-
}),
|
|
5924
|
+
}), ue();
|
|
5925
5925
|
},
|
|
5926
5926
|
ref: g,
|
|
5927
5927
|
inert: e.disabled || void 0,
|
|
@@ -5942,7 +5942,7 @@ var gc = (e) => {
|
|
|
5942
5942
|
}),
|
|
5943
5943
|
/* @__PURE__ */ (0, J.jsx)(uc, {
|
|
5944
5944
|
className: "rounded-sm mr-2",
|
|
5945
|
-
placeholder:
|
|
5945
|
+
placeholder: le,
|
|
5946
5946
|
value: t,
|
|
5947
5947
|
inputRef: _,
|
|
5948
5948
|
maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
|
|
@@ -5951,7 +5951,7 @@ var gc = (e) => {
|
|
|
5951
5951
|
t.trim() && g.current?.requestSubmit();
|
|
5952
5952
|
},
|
|
5953
5953
|
onClose: () => {},
|
|
5954
|
-
additionalCompletions:
|
|
5954
|
+
additionalCompletions: ce
|
|
5955
5955
|
}),
|
|
5956
5956
|
p && p.length === 1 && /* @__PURE__ */ (0, J.jsx)("span", {
|
|
5957
5957
|
title: p[0].name,
|
|
@@ -5970,14 +5970,14 @@ var gc = (e) => {
|
|
|
5970
5970
|
onClick: () => {
|
|
5971
5971
|
m(void 0), h.current && (h.current.value = "");
|
|
5972
5972
|
},
|
|
5973
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5973
|
+
children: /* @__PURE__ */ (0, J.jsx)(We, { className: "size-3" })
|
|
5974
5974
|
}),
|
|
5975
|
-
|
|
5975
|
+
se && /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)(a, {
|
|
5976
5976
|
type: "button",
|
|
5977
5977
|
variant: "text",
|
|
5978
5978
|
size: "sm",
|
|
5979
5979
|
onClick: () => h.current?.click(),
|
|
5980
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5980
|
+
children: /* @__PURE__ */ (0, J.jsx)(Jt, { className: "h-4" })
|
|
5981
5981
|
}), /* @__PURE__ */ (0, J.jsx)("input", {
|
|
5982
5982
|
type: "file",
|
|
5983
5983
|
ref: h,
|
|
@@ -5988,7 +5988,7 @@ var gc = (e) => {
|
|
|
5988
5988
|
e.target.files && m([...e.target.files]);
|
|
5989
5989
|
}
|
|
5990
5990
|
})] }),
|
|
5991
|
-
|
|
5991
|
+
ae ? /* @__PURE__ */ (0, J.jsx)(fe, {
|
|
5992
5992
|
content: "Stop generating",
|
|
5993
5993
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
5994
5994
|
type: "button",
|
|
@@ -5996,7 +5996,7 @@ var gc = (e) => {
|
|
|
5996
5996
|
size: "xs",
|
|
5997
5997
|
onClick: () => ee(),
|
|
5998
5998
|
className: "text-(--red-9) hover:text-(--red-11)",
|
|
5999
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
5999
|
+
children: /* @__PURE__ */ (0, J.jsx)(Fe, { className: "h-4 w-4 fill-current" })
|
|
6000
6000
|
})
|
|
6001
6001
|
}) : /* @__PURE__ */ (0, J.jsx)(a, {
|
|
6002
6002
|
type: "submit",
|
|
@@ -6005,7 +6005,7 @@ var gc = (e) => {
|
|
|
6005
6005
|
size: "xs",
|
|
6006
6006
|
className: "text-(--slate-11)",
|
|
6007
6007
|
"aria-label": "Send message",
|
|
6008
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
6008
|
+
children: /* @__PURE__ */ (0, J.jsx)(Zt, { className: "h-4 w-4" })
|
|
6009
6009
|
})
|
|
6010
6010
|
]
|
|
6011
6011
|
})
|
|
@@ -6045,7 +6045,7 @@ var gc = (e) => {
|
|
|
6045
6045
|
description: "Penalizes new tokens (-2: favor, 2: avoid)"
|
|
6046
6046
|
}
|
|
6047
6047
|
}, vc = (e) => {
|
|
6048
|
-
let t = (0,
|
|
6048
|
+
let t = (0, F.c)(16), { config: n, onChange: r } = e, [i, o] = (0, q.useState)(!1), s;
|
|
6049
6049
|
t[0] !== n || t[1] !== r ? (s = (e, t) => {
|
|
6050
6050
|
let i = t === null || Number.isNaN(t) ? null : t;
|
|
6051
6051
|
if (i !== null) {
|
|
@@ -6063,7 +6063,7 @@ var gc = (e) => {
|
|
|
6063
6063
|
e.key === "Enter" && (e.preventDefault(), o(!1));
|
|
6064
6064
|
}, t[3] = l) : l = t[3];
|
|
6065
6065
|
let u = l, d;
|
|
6066
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(
|
|
6066
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(fe, {
|
|
6067
6067
|
content: "Configuration",
|
|
6068
6068
|
children: /* @__PURE__ */ (0, J.jsx)(C, {
|
|
6069
6069
|
asChild: !0,
|
|
@@ -6071,7 +6071,7 @@ var gc = (e) => {
|
|
|
6071
6071
|
variant: "outline",
|
|
6072
6072
|
size: "sm",
|
|
6073
6073
|
className: "border-none shadow-none hover:bg-transparent",
|
|
6074
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
6074
|
+
children: /* @__PURE__ */ (0, J.jsx)(Qt, { className: "h-3 w-3" })
|
|
6075
6075
|
})
|
|
6076
6076
|
})
|
|
6077
6077
|
}), t[4] = d) : d = t[4];
|
|
@@ -6087,19 +6087,19 @@ var gc = (e) => {
|
|
|
6087
6087
|
let [t, n] = e;
|
|
6088
6088
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
6089
6089
|
className: "grid grid-cols-3 items-center gap-1",
|
|
6090
|
-
children: [/* @__PURE__ */ (0, J.jsxs)(
|
|
6090
|
+
children: [/* @__PURE__ */ (0, J.jsxs)(pe, {
|
|
6091
6091
|
htmlFor: t,
|
|
6092
6092
|
className: "flex w-full justify-between col-span-3 align-end",
|
|
6093
|
-
children: [
|
|
6093
|
+
children: [Ue.startCase(t), /* @__PURE__ */ (0, J.jsx)(fe, {
|
|
6094
6094
|
delayDuration: 200,
|
|
6095
6095
|
side: "top",
|
|
6096
6096
|
content: /* @__PURE__ */ (0, J.jsx)("div", {
|
|
6097
6097
|
className: "text-xs flex flex-col",
|
|
6098
6098
|
children: _c[t].description
|
|
6099
6099
|
}),
|
|
6100
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
6100
|
+
children: /* @__PURE__ */ (0, J.jsx)(Ce, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
|
|
6101
6101
|
})]
|
|
6102
|
-
}), /* @__PURE__ */ (0, J.jsx)(
|
|
6102
|
+
}), /* @__PURE__ */ (0, J.jsx)(he, {
|
|
6103
6103
|
id: t,
|
|
6104
6104
|
"aria-label": t,
|
|
6105
6105
|
value: n ?? NaN,
|
|
@@ -6112,7 +6112,7 @@ var gc = (e) => {
|
|
|
6112
6112
|
className: "col-span-3"
|
|
6113
6113
|
})]
|
|
6114
6114
|
}, t);
|
|
6115
|
-
}, t[9] = c, t[10] = e), p =
|
|
6115
|
+
}, t[9] = c, t[10] = e), p = vt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = p;
|
|
6116
6116
|
} else p = t[8];
|
|
6117
6117
|
let m;
|
|
6118
6118
|
t[11] === p ? m = t[12] : (m = /* @__PURE__ */ (0, J.jsx)(b, {
|
|
@@ -6129,34 +6129,34 @@ var gc = (e) => {
|
|
|
6129
6129
|
children: [d, m]
|
|
6130
6130
|
}), t[13] = i, t[14] = m, t[15] = h) : h = t[15], h;
|
|
6131
6131
|
}, yc = (e) => {
|
|
6132
|
-
let t = (0,
|
|
6132
|
+
let t = (0, F.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, q.useState)(!1), [s, c] = (0, q.useState)(""), l;
|
|
6133
6133
|
t[0] === r ? l = t[1] : (l = (e) => {
|
|
6134
6134
|
[...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
|
|
6135
6135
|
}, t[0] = r, t[1] = l);
|
|
6136
6136
|
let u = l, d;
|
|
6137
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(
|
|
6137
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(fe, {
|
|
6138
6138
|
content: "Select a prompt",
|
|
6139
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
6139
|
+
children: /* @__PURE__ */ (0, J.jsx)(_e, {
|
|
6140
6140
|
asChild: !0,
|
|
6141
6141
|
children: /* @__PURE__ */ (0, J.jsx)(a, {
|
|
6142
6142
|
variant: "outline",
|
|
6143
6143
|
size: "sm",
|
|
6144
6144
|
className: "border-none shadow-none hover:bg-transparent",
|
|
6145
|
-
children: /* @__PURE__ */ (0, J.jsx)(
|
|
6145
|
+
children: /* @__PURE__ */ (0, J.jsx)(le, { className: "h-3 w-3" })
|
|
6146
6146
|
})
|
|
6147
6147
|
})
|
|
6148
6148
|
}), t[2] = d) : d = t[2];
|
|
6149
6149
|
let f;
|
|
6150
6150
|
if (t[3] !== u || t[4] !== n) {
|
|
6151
6151
|
let e;
|
|
6152
|
-
t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(
|
|
6152
|
+
t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(ye, {
|
|
6153
6153
|
onSelect: () => u(e),
|
|
6154
6154
|
className: "whitespace-normal text-left",
|
|
6155
6155
|
children: e
|
|
6156
6156
|
}, t), t[6] = u, t[7] = e), f = n.map(e), t[3] = u, t[4] = n, t[5] = f;
|
|
6157
6157
|
} else f = t[5];
|
|
6158
6158
|
let p;
|
|
6159
|
-
t[8] === f ? p = t[9] : (p = /* @__PURE__ */ (0, J.jsx)(pc, { children: /* @__PURE__ */ (0, J.jsxs)(
|
|
6159
|
+
t[8] === f ? p = t[9] : (p = /* @__PURE__ */ (0, J.jsx)(pc, { children: /* @__PURE__ */ (0, J.jsxs)(xe, { children: [d, /* @__PURE__ */ (0, J.jsx)(be, {
|
|
6160
6160
|
side: "right",
|
|
6161
6161
|
align: "end",
|
|
6162
6162
|
onCloseAutoFocus: xc,
|
|
@@ -6183,7 +6183,7 @@ var gc = (e) => {
|
|
|
6183
6183
|
children: [p, h]
|
|
6184
6184
|
}), t[14] = i, t[15] = p, t[16] = h, t[17] = g) : g = t[17], g;
|
|
6185
6185
|
}, bc = (e) => {
|
|
6186
|
-
let t = (0,
|
|
6186
|
+
let t = (0, F.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
|
|
6187
6187
|
t[0] === n ? o = t[1] : (o = () => [...n.matchAll(/{{(\w+)}}/g)].reduce(Sc, {}), t[0] = n, t[1] = o);
|
|
6188
6188
|
let [s, c] = (0, q.useState)(o), l;
|
|
6189
6189
|
t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = (e, t) => {
|
|
@@ -6212,11 +6212,11 @@ var gc = (e) => {
|
|
|
6212
6212
|
let [n, r] = e;
|
|
6213
6213
|
return /* @__PURE__ */ (0, J.jsxs)("div", {
|
|
6214
6214
|
className: "grid grid-cols-4 items-center gap-2",
|
|
6215
|
-
children: [/* @__PURE__ */ (0, J.jsx)(
|
|
6215
|
+
children: [/* @__PURE__ */ (0, J.jsx)(pe, {
|
|
6216
6216
|
htmlFor: n,
|
|
6217
6217
|
className: "font-semibold text-base",
|
|
6218
6218
|
children: n
|
|
6219
|
-
}), /* @__PURE__ */ (0, J.jsx)(
|
|
6219
|
+
}), /* @__PURE__ */ (0, J.jsx)(ve, {
|
|
6220
6220
|
id: n,
|
|
6221
6221
|
value: r,
|
|
6222
6222
|
onChange: (e) => u(n, e.target.value),
|