@floegence/floe-webapp-core 0.35.21 → 0.35.22
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/chat.css +33 -7
- package/dist/components/chat/blocks/FileBlock.js +42 -27
- package/dist/components/chat/blocks/ToolCallBlock.js +150 -149
- package/dist/components/file-browser/Breadcrumb.js +73 -72
- package/dist/components/layout/ActivityBar.d.ts +1 -0
- package/dist/components/layout/ActivityBar.js +51 -45
- package/dist/components/layout/MobileTabBar.d.ts +1 -0
- package/dist/components/layout/MobileTabBar.js +109 -65
- package/dist/components/layout/Shell.js +190 -158
- package/dist/components/layout/Sidebar.d.ts +1 -0
- package/dist/components/layout/Sidebar.js +33 -31
- package/dist/components/layout/SidebarPane.d.ts +1 -0
- package/dist/components/layout/SidebarPane.js +40 -37
- package/dist/components/layout/TopBar.d.ts +1 -0
- package/dist/components/layout/TopBar.js +23 -22
- package/dist/components/ui/Dropdown.d.ts +13 -0
- package/dist/components/ui/Dropdown.js +263 -145
- package/dist/components/ui/Tabs.d.ts +4 -0
- package/dist/components/ui/Tabs.js +207 -149
- package/dist/context/FloeConfigContext.d.ts +17 -0
- package/dist/context/FloeConfigContext.js +34 -25
- package/dist/context/NotificationContext.js +76 -69
- package/dist/styles/tokens.d.ts +4 -4
- package/dist/styles/tokens.js +55 -14
- package/dist/styles.css +1 -1
- package/dist/themes/light.css +2 -2
- package/package.json +1 -1
package/dist/chat.css
CHANGED
|
@@ -993,25 +993,45 @@ pre.chat-md-code-block code {
|
|
|
993
993
|
gap: 0.5rem;
|
|
994
994
|
padding: 0.625rem 0.875rem;
|
|
995
995
|
background-color: color-mix(in srgb, var(--muted) 50%, transparent);
|
|
996
|
-
cursor: pointer;
|
|
997
996
|
transition: background-color 150ms;
|
|
998
997
|
}
|
|
999
998
|
|
|
1000
|
-
.chat-tool-call-header
|
|
999
|
+
.chat-tool-call-header-button {
|
|
1000
|
+
display: flex;
|
|
1001
|
+
min-width: 0;
|
|
1002
|
+
flex: 1 1 auto;
|
|
1003
|
+
align-items: center;
|
|
1004
|
+
gap: 0.5rem;
|
|
1005
|
+
border: none;
|
|
1006
|
+
background: transparent;
|
|
1007
|
+
padding: 0;
|
|
1008
|
+
color: inherit;
|
|
1009
|
+
text-align: left;
|
|
1010
|
+
cursor: pointer;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
.chat-tool-call-header-button:hover,
|
|
1014
|
+
.chat-tool-call-header-button:focus-visible {
|
|
1001
1015
|
background-color: color-mix(in srgb, var(--muted) 70%, transparent);
|
|
1002
1016
|
}
|
|
1003
1017
|
|
|
1018
|
+
.chat-tool-call-header-button:focus-visible {
|
|
1019
|
+
outline: 2px solid color-mix(in srgb, var(--ring) 70%, transparent);
|
|
1020
|
+
outline-offset: 0.25rem;
|
|
1021
|
+
border-radius: 0.375rem;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1004
1024
|
.chat-tool-collapse-btn {
|
|
1025
|
+
display: inline-flex;
|
|
1026
|
+
align-items: center;
|
|
1027
|
+
justify-content: center;
|
|
1005
1028
|
padding: 0.125rem;
|
|
1006
1029
|
border-radius: 0.25rem;
|
|
1007
1030
|
color: var(--muted-foreground);
|
|
1008
|
-
cursor: pointer;
|
|
1009
|
-
border: none;
|
|
1010
|
-
background: transparent;
|
|
1011
1031
|
transition: transform 150ms;
|
|
1012
1032
|
}
|
|
1013
1033
|
|
|
1014
|
-
.chat-tool-
|
|
1034
|
+
.chat-tool-call-header-button:hover .chat-tool-collapse-btn {
|
|
1015
1035
|
background-color: var(--accent);
|
|
1016
1036
|
}
|
|
1017
1037
|
|
|
@@ -1326,8 +1346,9 @@ pre.chat-md-code-block code {
|
|
|
1326
1346
|
border-radius: 0.5rem;
|
|
1327
1347
|
border: 1px solid var(--border);
|
|
1328
1348
|
background-color: var(--card);
|
|
1329
|
-
cursor: pointer;
|
|
1330
1349
|
transition: all 150ms;
|
|
1350
|
+
color: inherit;
|
|
1351
|
+
text-align: left;
|
|
1331
1352
|
}
|
|
1332
1353
|
|
|
1333
1354
|
.chat-file-block:hover {
|
|
@@ -1335,6 +1356,11 @@ pre.chat-md-code-block code {
|
|
|
1335
1356
|
border-color: color-mix(in srgb, var(--border) 80%, var(--primary));
|
|
1336
1357
|
}
|
|
1337
1358
|
|
|
1359
|
+
.chat-file-block:focus-visible {
|
|
1360
|
+
outline: 2px solid color-mix(in srgb, var(--ring) 70%, transparent);
|
|
1361
|
+
outline-offset: 0.125rem;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1338
1364
|
.chat-file-icon {
|
|
1339
1365
|
font-size: 1.5rem;
|
|
1340
1366
|
}
|
|
@@ -1,31 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Show as
|
|
3
|
-
import { cn as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
6
|
-
const
|
|
1
|
+
import { createComponent as i, Dynamic as s, insert as e, effect as f, setAttribute as h, memo as v, template as r } from "solid-js/web";
|
|
2
|
+
import { Show as $ } from "solid-js";
|
|
3
|
+
import { cn as g } from "../../../utils/cn.js";
|
|
4
|
+
var w = /* @__PURE__ */ r("<div class=chat-file-icon>"), _ = /* @__PURE__ */ r("<div class=chat-file-info><div class=chat-file-name></div><div class=chat-file-meta><span class=chat-file-size>"), x = /* @__PURE__ */ r("<div class=chat-file-download>"), k = /* @__PURE__ */ r('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1=12 y1=15 x2=12 y2=3>');
|
|
5
|
+
const F = (n) => {
|
|
6
|
+
const o = (t) => t < 1024 ? `${t} B` : t < 1048576 ? `${(t / 1024).toFixed(1)} KB` : `${(t / 1048576).toFixed(1)} MB`, a = (t) => t.startsWith("image/") ? "🖼️" : t.startsWith("video/") ? "🎬" : t.startsWith("audio/") ? "🎵" : t.includes("pdf") ? "📄" : t.includes("zip") || t.includes("rar") || t.includes("tar") ? "📦" : t.includes("text") || t.includes("json") || t.includes("xml") ? "📝" : t.includes("spreadsheet") || t.includes("excel") ? "📊" : t.includes("presentation") || t.includes("powerpoint") ? "📽️" : t.includes("document") || t.includes("word") ? "📃" : "📁", u = () => {
|
|
7
7
|
n.url && window.open(n.url, "_blank");
|
|
8
8
|
};
|
|
9
|
-
return (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
9
|
+
return i(s, {
|
|
10
|
+
get component() {
|
|
11
|
+
return n.url ? "button" : "div";
|
|
12
|
+
},
|
|
13
|
+
get type() {
|
|
14
|
+
return n.url ? "button" : void 0;
|
|
15
|
+
},
|
|
16
|
+
get class() {
|
|
17
|
+
return g("chat-file-block", n.class);
|
|
18
|
+
},
|
|
19
|
+
get onClick() {
|
|
20
|
+
return n.url ? u : void 0;
|
|
21
|
+
},
|
|
22
|
+
get "aria-label"() {
|
|
23
|
+
return v(() => !!n.url)() ? `Download ${n.name}` : void 0;
|
|
24
|
+
},
|
|
25
|
+
get children() {
|
|
26
|
+
return [(() => {
|
|
27
|
+
var t = w();
|
|
28
|
+
return e(t, () => a(n.mimeType)), t;
|
|
29
|
+
})(), (() => {
|
|
30
|
+
var t = _(), l = t.firstChild, c = l.nextSibling, d = c.firstChild;
|
|
31
|
+
return e(l, () => n.name), e(d, () => o(n.size)), f(() => h(l, "title", n.name)), t;
|
|
32
|
+
})(), i($, {
|
|
33
|
+
get when() {
|
|
34
|
+
return n.url;
|
|
35
|
+
},
|
|
36
|
+
get children() {
|
|
37
|
+
var t = x();
|
|
38
|
+
return e(t, i(B, {})), t;
|
|
39
|
+
}
|
|
40
|
+
})];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}, B = () => k();
|
|
29
44
|
export {
|
|
30
|
-
|
|
45
|
+
F as FileBlock
|
|
31
46
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { insert as c, createComponent as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { deferAfterPaint as
|
|
5
|
-
import { useChatContext as
|
|
6
|
-
import { BlockRenderer as
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { setAttribute as O, insert as c, createComponent as i, memo as I, effect as B, className as T, template as a, delegateEvents as L } from "solid-js/web";
|
|
2
|
+
import { createSignal as v, createUniqueId as q, createEffect as F, Show as b, For as D, onCleanup as V, createMemo as N } from "solid-js";
|
|
3
|
+
import { cn as P } from "../../../utils/cn.js";
|
|
4
|
+
import { deferAfterPaint as U } from "../../../utils/defer.js";
|
|
5
|
+
import { useChatContext as H } from "../ChatProvider.js";
|
|
6
|
+
import { BlockRenderer as W } from "./BlockRenderer.js";
|
|
7
|
+
var z = /* @__PURE__ */ a("<span class=chat-tool-summary>"), G = /* @__PURE__ */ a('<div class=chat-tool-approval-actions><button type=button class="chat-tool-approval-btn chat-tool-approval-btn-approve">Approve</button><button type=button class="chat-tool-approval-btn chat-tool-approval-btn-reject">Reject'), K = /* @__PURE__ */ a("<div class=chat-tool-section>"), Q = /* @__PURE__ */ a('<div class="chat-tool-section chat-tool-error-section"><div class=chat-tool-section-label>Error</div><div class=chat-tool-error>'), X = /* @__PURE__ */ a("<div class=chat-tool-children>"), Y = /* @__PURE__ */ a("<div class=chat-tool-call-body><div class=chat-tool-section>"), Z = /* @__PURE__ */ a("<div><div class=chat-tool-call-header><button type=button class=chat-tool-call-header-button><span class=chat-tool-collapse-btn></span><span></span><span class=chat-tool-name>"), tt = /* @__PURE__ */ a("<button type=button class=chat-tool-json-action-btn>Render full"), et = /* @__PURE__ */ a("<button type=button class=chat-tool-json-action-btn>Preview"), nt = /* @__PURE__ */ a("<button type=button class=chat-tool-json-action-btn>Show more"), rt = /* @__PURE__ */ a("<div class=chat-tool-section-header><div class=chat-tool-section-label></div><div class=chat-tool-json-actions>"), ot = /* @__PURE__ */ a("<pre>"), lt = /* @__PURE__ */ a("<div class=chat-tool-json-hint>Showing first <!> characters."), it = /* @__PURE__ */ a('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polyline points="9 18 15 12 9 6">'), ct = /* @__PURE__ */ a('<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><polyline points="6 9 12 15 18 9">'), st = /* @__PURE__ */ a('<svg width=14 height=14 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><polyline points="12 6 12 12 16 14">'), at = /* @__PURE__ */ a('<svg width=14 height=14 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 class=animate-spin><path d="M21 12a9 9 0 1 1-6.219-8.56">'), ut = /* @__PURE__ */ a('<svg width=14 height=14 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01">'), ft = /* @__PURE__ */ a('<svg width=14 height=14 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><line x1=15 y1=9 x2=9 y2=15></line><line x1=9 y1=9 x2=15 y2=15>');
|
|
8
|
+
const jt = (t) => {
|
|
9
|
+
const r = H(), [s, $] = v(!0), e = `chat-tool-call-body-${q()}`;
|
|
10
|
+
F(() => {
|
|
11
|
+
$(t.block.collapsed ?? !0);
|
|
12
12
|
});
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
},
|
|
13
|
+
const f = () => s(), y = () => {
|
|
14
|
+
$((o) => !o), r.toggleToolCollapse(t.messageId, t.block.toolId);
|
|
15
|
+
}, k = () => {
|
|
16
16
|
switch (t.block.status) {
|
|
17
17
|
case "pending":
|
|
18
18
|
return "text-muted-foreground";
|
|
@@ -28,214 +28,215 @@ const It = (t) => {
|
|
|
28
28
|
}, _ = () => {
|
|
29
29
|
switch (t.block.status) {
|
|
30
30
|
case "pending":
|
|
31
|
-
return
|
|
31
|
+
return i(kt, {});
|
|
32
32
|
case "running":
|
|
33
|
-
return
|
|
33
|
+
return i(wt, {});
|
|
34
34
|
case "success":
|
|
35
|
-
return
|
|
35
|
+
return i(_t, {});
|
|
36
36
|
case "error":
|
|
37
|
-
return
|
|
37
|
+
return i(xt, {});
|
|
38
38
|
default:
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
},
|
|
41
|
+
}, x = () => {
|
|
42
42
|
if (t.block.status === "running") return "Running...";
|
|
43
43
|
if (t.block.status === "error") {
|
|
44
|
-
const
|
|
45
|
-
return `Error: ${
|
|
44
|
+
const o = t.block.error || "Unknown error";
|
|
45
|
+
return `Error: ${o.slice(0, 50)}${o.length > 50 ? "..." : ""}`;
|
|
46
46
|
}
|
|
47
47
|
return t.block.status === "success" ? typeof t.block.result == "string" ? t.block.result.slice(0, 60) + (t.block.result.length > 60 ? "..." : "") : "Completed" : "Pending";
|
|
48
48
|
};
|
|
49
49
|
return (() => {
|
|
50
|
-
var
|
|
51
|
-
return
|
|
50
|
+
var o = Z(), g = o.firstChild, h = g.firstChild, E = h.firstChild, C = E.nextSibling, j = C.nextSibling;
|
|
51
|
+
return h.$$click = y, O(h, "aria-controls", e), c(E, i(b, {
|
|
52
52
|
get when() {
|
|
53
|
-
return
|
|
53
|
+
return f();
|
|
54
54
|
},
|
|
55
55
|
get fallback() {
|
|
56
|
-
return
|
|
56
|
+
return i(yt, {});
|
|
57
57
|
},
|
|
58
58
|
get children() {
|
|
59
|
-
return
|
|
59
|
+
return i($t, {});
|
|
60
60
|
}
|
|
61
|
-
})), c(
|
|
61
|
+
})), c(C, _), c(j, () => t.block.toolName), c(h, i(b, {
|
|
62
62
|
get when() {
|
|
63
|
-
return
|
|
63
|
+
return I(() => !!f())() && !(t.block.requiresApproval === !0 && t.block.approvalState === "required");
|
|
64
64
|
},
|
|
65
65
|
get children() {
|
|
66
|
-
var l =
|
|
67
|
-
return l
|
|
68
|
-
b.stopPropagation(), n.approveToolCall(t.messageId, t.block.toolId, !0);
|
|
69
|
-
}, f.$$click = (b) => {
|
|
70
|
-
b.stopPropagation(), n.approveToolCall(t.messageId, t.block.toolId, !1);
|
|
71
|
-
}, l;
|
|
66
|
+
var l = z();
|
|
67
|
+
return c(l, x), l;
|
|
72
68
|
}
|
|
73
|
-
}), null), c(
|
|
69
|
+
}), null), c(g, i(b, {
|
|
74
70
|
get when() {
|
|
75
|
-
return
|
|
71
|
+
return I(() => t.block.requiresApproval === !0)() && t.block.approvalState === "required";
|
|
76
72
|
},
|
|
77
73
|
get children() {
|
|
78
|
-
var l =
|
|
79
|
-
return
|
|
74
|
+
var l = G(), w = l.firstChild, u = w.nextSibling;
|
|
75
|
+
return w.$$click = () => {
|
|
76
|
+
r.approveToolCall(t.messageId, t.block.toolId, !0);
|
|
77
|
+
}, u.$$click = () => {
|
|
78
|
+
r.approveToolCall(t.messageId, t.block.toolId, !1);
|
|
79
|
+
}, l;
|
|
80
80
|
}
|
|
81
|
-
}), null), c(
|
|
81
|
+
}), null), c(o, i(b, {
|
|
82
82
|
get when() {
|
|
83
|
-
return !
|
|
83
|
+
return !f();
|
|
84
84
|
},
|
|
85
85
|
get children() {
|
|
86
|
-
var l =
|
|
87
|
-
return c(
|
|
86
|
+
var l = Y(), w = l.firstChild;
|
|
87
|
+
return O(l, "id", e), c(w, i(R, {
|
|
88
88
|
label: "Arguments",
|
|
89
89
|
class: "chat-tool-args",
|
|
90
90
|
value: () => t.block.args
|
|
91
|
-
})), c(l,
|
|
91
|
+
})), c(l, i(b, {
|
|
92
92
|
get when() {
|
|
93
93
|
return t.block.result !== void 0;
|
|
94
94
|
},
|
|
95
95
|
get children() {
|
|
96
|
-
var
|
|
97
|
-
return c(
|
|
96
|
+
var u = K();
|
|
97
|
+
return c(u, i(R, {
|
|
98
98
|
label: "Result",
|
|
99
99
|
class: "chat-tool-result",
|
|
100
100
|
value: () => t.block.result
|
|
101
|
-
})),
|
|
101
|
+
})), u;
|
|
102
102
|
}
|
|
103
|
-
}), null), c(l,
|
|
103
|
+
}), null), c(l, i(b, {
|
|
104
104
|
get when() {
|
|
105
105
|
return t.block.error;
|
|
106
106
|
},
|
|
107
107
|
get children() {
|
|
108
|
-
var
|
|
109
|
-
return c(
|
|
108
|
+
var u = Q(), n = u.firstChild, d = n.nextSibling;
|
|
109
|
+
return c(d, () => t.block.error), u;
|
|
110
110
|
}
|
|
111
|
-
}), null), c(l,
|
|
111
|
+
}), null), c(l, i(b, {
|
|
112
112
|
get when() {
|
|
113
|
-
return
|
|
113
|
+
return I(() => !!t.block.children)() && t.block.children.length > 0;
|
|
114
114
|
},
|
|
115
115
|
get children() {
|
|
116
|
-
var
|
|
117
|
-
return c(
|
|
116
|
+
var u = X();
|
|
117
|
+
return c(u, i(D, {
|
|
118
118
|
get each() {
|
|
119
119
|
return t.block.children;
|
|
120
120
|
},
|
|
121
|
-
children: (
|
|
122
|
-
block:
|
|
121
|
+
children: (n, d) => i(W, {
|
|
122
|
+
block: n,
|
|
123
123
|
get messageId() {
|
|
124
124
|
return t.messageId;
|
|
125
125
|
},
|
|
126
126
|
get blockIndex() {
|
|
127
|
-
return
|
|
127
|
+
return d();
|
|
128
128
|
},
|
|
129
129
|
get isStreaming() {
|
|
130
|
-
return
|
|
130
|
+
return r.streamingMessageId() === t.messageId;
|
|
131
131
|
}
|
|
132
132
|
})
|
|
133
|
-
})),
|
|
133
|
+
})), u;
|
|
134
134
|
}
|
|
135
135
|
}), null), l;
|
|
136
136
|
}
|
|
137
|
-
}), null),
|
|
138
|
-
var
|
|
139
|
-
return
|
|
137
|
+
}), null), B((l) => {
|
|
138
|
+
var w = P("chat-tool-call-block", t.class), u = !f(), n = P("chat-tool-status-icon", k());
|
|
139
|
+
return w !== l.e && T(o, l.e = w), u !== l.t && O(h, "aria-expanded", l.t = u), n !== l.a && T(C, l.a = n), l;
|
|
140
140
|
}, {
|
|
141
141
|
e: void 0,
|
|
142
|
-
t: void 0
|
|
143
|
-
|
|
142
|
+
t: void 0,
|
|
143
|
+
a: void 0
|
|
144
|
+
}), o;
|
|
144
145
|
})();
|
|
145
|
-
},
|
|
146
|
-
function
|
|
147
|
-
const [
|
|
148
|
-
let g = 0,
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
}, A = 2e4, ht = 2e4;
|
|
147
|
+
function R(t) {
|
|
148
|
+
const [r, s] = v("full"), [$, e] = v(!1), [f, y] = v(null), [k, _] = v(null), [x, o] = v(A);
|
|
149
|
+
let g = 0, h = !1;
|
|
150
|
+
V(() => {
|
|
151
|
+
h = !0, g++;
|
|
151
152
|
});
|
|
152
|
-
const
|
|
153
|
-
const
|
|
154
|
-
if (!
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
}),
|
|
158
|
-
const
|
|
159
|
-
return !!
|
|
160
|
-
},
|
|
161
|
-
g++, s("preview"), e(!1),
|
|
153
|
+
const E = N(() => dt(t.value())), C = N(() => {
|
|
154
|
+
const n = k();
|
|
155
|
+
if (!n) return "";
|
|
156
|
+
const d = x();
|
|
157
|
+
return n.length > d ? n.slice(0, d) : n;
|
|
158
|
+
}), j = () => {
|
|
159
|
+
const n = k();
|
|
160
|
+
return !!n && n.length > x();
|
|
161
|
+
}, l = () => s("full"), w = () => {
|
|
162
|
+
g++, s("preview"), e(!1), y(null), _(null), o(A);
|
|
162
163
|
};
|
|
163
|
-
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
e(!0),
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
164
|
+
F(() => {
|
|
165
|
+
if (r() !== "full") return;
|
|
166
|
+
const n = t.value(), d = ++g;
|
|
167
|
+
e(!0), y(null), _(null), o(A);
|
|
168
|
+
const S = n;
|
|
169
|
+
U(() => {
|
|
170
|
+
const m = () => !h && d === g;
|
|
171
|
+
if (m())
|
|
171
172
|
try {
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
} catch (
|
|
175
|
-
|
|
173
|
+
const p = gt(S);
|
|
174
|
+
m() && _(p);
|
|
175
|
+
} catch (p) {
|
|
176
|
+
m() && y(p instanceof Error ? p.message : "Failed to render payload");
|
|
176
177
|
} finally {
|
|
177
|
-
|
|
178
|
+
m() && e(!1);
|
|
178
179
|
}
|
|
179
180
|
});
|
|
180
181
|
});
|
|
181
|
-
const
|
|
182
|
+
const u = () => r() === "preview" ? E() : $() ? "Preparing..." : f() ? `Error: ${f()}` : C();
|
|
182
183
|
return [(() => {
|
|
183
|
-
var
|
|
184
|
-
return c(
|
|
184
|
+
var n = rt(), d = n.firstChild, S = d.nextSibling;
|
|
185
|
+
return c(d, () => t.label), c(S, i(b, {
|
|
185
186
|
get when() {
|
|
186
|
-
return
|
|
187
|
+
return r() === "preview";
|
|
187
188
|
},
|
|
188
189
|
get children() {
|
|
189
|
-
var
|
|
190
|
-
return
|
|
190
|
+
var m = tt();
|
|
191
|
+
return m.$$click = l, m;
|
|
191
192
|
}
|
|
192
|
-
}), null), c(
|
|
193
|
+
}), null), c(S, i(b, {
|
|
193
194
|
get when() {
|
|
194
|
-
return
|
|
195
|
+
return r() === "full";
|
|
195
196
|
},
|
|
196
197
|
get children() {
|
|
197
|
-
var
|
|
198
|
-
return
|
|
198
|
+
var m = et();
|
|
199
|
+
return m.$$click = w, m;
|
|
199
200
|
}
|
|
200
|
-
}), null), c(
|
|
201
|
+
}), null), c(S, i(b, {
|
|
201
202
|
get when() {
|
|
202
|
-
return
|
|
203
|
+
return I(() => r() === "full")() && j();
|
|
203
204
|
},
|
|
204
205
|
get children() {
|
|
205
|
-
var
|
|
206
|
-
return
|
|
206
|
+
var m = nt();
|
|
207
|
+
return m.$$click = () => o((p) => p + ht), m;
|
|
207
208
|
}
|
|
208
|
-
}), null),
|
|
209
|
+
}), null), n;
|
|
209
210
|
})(), (() => {
|
|
210
|
-
var
|
|
211
|
-
return c(
|
|
212
|
-
})(),
|
|
211
|
+
var n = ot();
|
|
212
|
+
return c(n, u), B(() => T(n, t.class)), n;
|
|
213
|
+
})(), i(b, {
|
|
213
214
|
get when() {
|
|
214
|
-
return
|
|
215
|
+
return I(() => r() === "full")() && j();
|
|
215
216
|
},
|
|
216
217
|
get children() {
|
|
217
|
-
var
|
|
218
|
-
return
|
|
218
|
+
var n = lt(), d = n.firstChild, S = d.nextSibling;
|
|
219
|
+
return S.nextSibling, c(n, () => x().toLocaleString(), S), n;
|
|
219
220
|
}
|
|
220
221
|
})];
|
|
221
222
|
}
|
|
222
|
-
function ft(t) {
|
|
223
|
-
return typeof t == "string" ? t : ht(t, 2);
|
|
224
|
-
}
|
|
225
223
|
function gt(t) {
|
|
226
|
-
return typeof t == "string" ?
|
|
224
|
+
return typeof t == "string" ? t : mt(t, 2);
|
|
225
|
+
}
|
|
226
|
+
function dt(t) {
|
|
227
|
+
return typeof t == "string" ? M(t, 500) : bt(t, {
|
|
227
228
|
maxDepth: 2,
|
|
228
229
|
maxObjectEntries: 40,
|
|
229
230
|
maxArrayEntries: 40,
|
|
230
231
|
maxStringLen: 200
|
|
231
232
|
});
|
|
232
233
|
}
|
|
233
|
-
function
|
|
234
|
-
return t.length <=
|
|
234
|
+
function M(t, r) {
|
|
235
|
+
return t.length <= r ? t : t.slice(0, r) + "...";
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
+
function mt(t, r) {
|
|
237
238
|
const s = /* @__PURE__ */ new WeakSet();
|
|
238
|
-
return JSON.stringify(t, (
|
|
239
|
+
return JSON.stringify(t, ($, e) => {
|
|
239
240
|
if (typeof e == "bigint") return e.toString();
|
|
240
241
|
if (typeof e == "function")
|
|
241
242
|
return `[Function ${e.name || "anonymous"}]`;
|
|
@@ -247,21 +248,21 @@ function ht(t, n) {
|
|
|
247
248
|
stack: e.stack
|
|
248
249
|
};
|
|
249
250
|
if (e && typeof e == "object") {
|
|
250
|
-
const
|
|
251
|
-
if (s.has(
|
|
252
|
-
s.add(
|
|
251
|
+
const f = e;
|
|
252
|
+
if (s.has(f)) return "[Circular]";
|
|
253
|
+
s.add(f);
|
|
253
254
|
}
|
|
254
255
|
return e;
|
|
255
|
-
},
|
|
256
|
+
}, r);
|
|
256
257
|
}
|
|
257
|
-
function
|
|
258
|
-
return
|
|
258
|
+
function bt(t, r) {
|
|
259
|
+
return J(t, r, 0, /* @__PURE__ */ new WeakSet());
|
|
259
260
|
}
|
|
260
|
-
function
|
|
261
|
+
function J(t, r, s, $) {
|
|
261
262
|
const e = (o) => " ".repeat(o);
|
|
262
263
|
if (t === null) return "null";
|
|
263
264
|
if (t === void 0) return "undefined";
|
|
264
|
-
if (typeof t == "string") return JSON.stringify(
|
|
265
|
+
if (typeof t == "string") return JSON.stringify(M(t, r.maxStringLen));
|
|
265
266
|
if (typeof t == "number" || typeof t == "boolean") return String(t);
|
|
266
267
|
if (typeof t == "bigint") return `"${t.toString()}n"`;
|
|
267
268
|
if (typeof t == "function")
|
|
@@ -273,33 +274,33 @@ function A(t, n, s, y) {
|
|
|
273
274
|
message: t.message
|
|
274
275
|
});
|
|
275
276
|
if (typeof t != "object") return JSON.stringify(String(t));
|
|
276
|
-
const
|
|
277
|
-
if (
|
|
278
|
-
if (
|
|
279
|
-
if (s >=
|
|
280
|
-
const o = ["["], g = Math.min(t.length,
|
|
281
|
-
for (let
|
|
282
|
-
o.push(`${e(s + 1)}${
|
|
277
|
+
const f = t;
|
|
278
|
+
if ($.has(f)) return JSON.stringify("[Circular]");
|
|
279
|
+
if ($.add(f), Array.isArray(t)) {
|
|
280
|
+
if (s >= r.maxDepth) return JSON.stringify(`[Array(${t.length})]`);
|
|
281
|
+
const o = ["["], g = Math.min(t.length, r.maxArrayEntries);
|
|
282
|
+
for (let h = 0; h < g; h++)
|
|
283
|
+
o.push(`${e(s + 1)}${J(t[h], r, s + 1, $)}`);
|
|
283
284
|
return t.length > g && o.push(`${e(s + 1)}"... (${t.length - g} more)"`), o.push(`${e(s)}]`), o.join(`
|
|
284
285
|
`);
|
|
285
286
|
}
|
|
286
|
-
if (s >=
|
|
287
|
-
const
|
|
288
|
-
let
|
|
289
|
-
for (const o in
|
|
290
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
291
|
-
if (
|
|
292
|
-
|
|
287
|
+
if (s >= r.maxDepth) return JSON.stringify("[Object]");
|
|
288
|
+
const y = t, k = ["{"];
|
|
289
|
+
let _ = 0, x = !1;
|
|
290
|
+
for (const o in y) {
|
|
291
|
+
if (!Object.prototype.hasOwnProperty.call(y, o)) continue;
|
|
292
|
+
if (_ >= r.maxObjectEntries) {
|
|
293
|
+
x = !0;
|
|
293
294
|
break;
|
|
294
295
|
}
|
|
295
|
-
const g =
|
|
296
|
-
|
|
296
|
+
const g = y[o], h = J(g, r, s + 1, $);
|
|
297
|
+
k.push(`${e(s + 1)}${JSON.stringify(o)}: ${h}`), _++;
|
|
297
298
|
}
|
|
298
|
-
return
|
|
299
|
+
return x && k.push(`${e(s + 1)}"...": "... (truncated)"`), k.push(`${e(s)}}`), k.join(`
|
|
299
300
|
`);
|
|
300
301
|
}
|
|
301
|
-
const
|
|
302
|
-
|
|
302
|
+
const $t = () => it(), yt = () => ct(), kt = () => st(), wt = () => at(), _t = () => ut(), xt = () => ft();
|
|
303
|
+
L(["click"]);
|
|
303
304
|
export {
|
|
304
|
-
|
|
305
|
+
jt as ToolCallBlock
|
|
305
306
|
};
|