@floegence/floe-webapp-core 0.35.21 → 0.35.23

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.
Files changed (33) hide show
  1. package/dist/chat.css +33 -7
  2. package/dist/components/chat/blocks/FileBlock.js +42 -27
  3. package/dist/components/chat/blocks/ToolCallBlock.js +150 -149
  4. package/dist/components/file-browser/Breadcrumb.js +73 -72
  5. package/dist/components/file-browser/DragPreview.d.ts +2 -2
  6. package/dist/components/file-browser/DragPreview.js +15 -15
  7. package/dist/components/file-browser/FileBrowser.js +13 -13
  8. package/dist/components/file-browser/index.d.ts +1 -0
  9. package/dist/components/layout/ActivityBar.d.ts +1 -0
  10. package/dist/components/layout/ActivityBar.js +51 -45
  11. package/dist/components/layout/MobileTabBar.d.ts +1 -0
  12. package/dist/components/layout/MobileTabBar.js +109 -65
  13. package/dist/components/layout/Shell.js +190 -158
  14. package/dist/components/layout/Sidebar.d.ts +1 -0
  15. package/dist/components/layout/Sidebar.js +33 -31
  16. package/dist/components/layout/SidebarPane.d.ts +1 -0
  17. package/dist/components/layout/SidebarPane.js +40 -37
  18. package/dist/components/layout/TopBar.d.ts +1 -0
  19. package/dist/components/layout/TopBar.js +23 -22
  20. package/dist/components/ui/Dropdown.d.ts +13 -0
  21. package/dist/components/ui/Dropdown.js +263 -145
  22. package/dist/components/ui/Tabs.d.ts +4 -0
  23. package/dist/components/ui/Tabs.js +207 -149
  24. package/dist/context/FloeConfigContext.d.ts +17 -0
  25. package/dist/context/FloeConfigContext.js +34 -25
  26. package/dist/context/NotificationContext.js +76 -69
  27. package/dist/file-browser.js +19 -17
  28. package/dist/full.js +302 -300
  29. package/dist/styles/tokens.d.ts +4 -4
  30. package/dist/styles/tokens.js +55 -14
  31. package/dist/styles.css +1 -1
  32. package/dist/themes/light.css +2 -2
  33. 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:hover {
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-collapse-btn:hover {
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 { insert as i, createComponent as s, effect as w, className as x, setAttribute as g, template as r, delegateEvents as k } from "solid-js/web";
2
- import { Show as _ } from "solid-js";
3
- import { cn as B } from "../../../utils/cn.js";
4
- var C = /* @__PURE__ */ r("<div class=chat-file-download>"), z = /* @__PURE__ */ r("<div><div class=chat-file-icon></div><div class=chat-file-info><div class=chat-file-name></div><div class=chat-file-meta><span class=chat-file-size>"), F = /* @__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 I = (n) => {
6
- const d = (t) => t < 1024 ? `${t} B` : t < 1048576 ? `${(t / 1024).toFixed(1)} KB` : `${(t / 1048576).toFixed(1)} MB`, u = (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") ? "📃" : "📁", f = () => {
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
- var t = z(), c = t.firstChild, h = c.nextSibling, l = h.firstChild, v = l.nextSibling, $ = v.firstChild;
11
- return t.$$click = f, i(c, () => u(n.mimeType)), i(l, () => n.name), i($, () => d(n.size)), i(t, s(_, {
12
- get when() {
13
- return n.url;
14
- },
15
- get children() {
16
- var e = C();
17
- return i(e, s(S, {})), e;
18
- }
19
- }), null), w((e) => {
20
- var o = B("chat-file-block", n.class), a = n.name;
21
- return o !== e.e && x(t, e.e = o), a !== e.t && g(l, "title", e.t = a), e;
22
- }, {
23
- e: void 0,
24
- t: void 0
25
- }), t;
26
- })();
27
- }, S = () => F();
28
- k(["click"]);
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
- I as FileBlock
45
+ F as FileBlock
31
46
  };
@@ -1,18 +1,18 @@
1
- import { insert as c, createComponent as r, memo as E, effect as R, className as P, template as a, delegateEvents as M } from "solid-js/web";
2
- import { createSignal as C, createEffect as B, Show as $, For as L, onCleanup as D, createMemo as T } from "solid-js";
3
- import { cn as J } from "../../../utils/cn.js";
4
- import { deferAfterPaint as V } from "../../../utils/defer.js";
5
- import { useChatContext as q } from "../ChatProvider.js";
6
- import { BlockRenderer as H } from "./BlockRenderer.js";
7
- var U = /* @__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'), W = /* @__PURE__ */ a("<span class=chat-tool-summary>"), z = /* @__PURE__ */ a("<div class=chat-tool-section>"), G = /* @__PURE__ */ a('<div class="chat-tool-section chat-tool-error-section"><div class=chat-tool-section-label>Error</div><div class=chat-tool-error>'), K = /* @__PURE__ */ a("<div class=chat-tool-children>"), Q = /* @__PURE__ */ a("<div class=chat-tool-call-body><div class=chat-tool-section>"), X = /* @__PURE__ */ a("<div><div class=chat-tool-call-header><button type=button class=chat-tool-collapse-btn></button><span></span><span class=chat-tool-name>"), Y = /* @__PURE__ */ a("<button type=button class=chat-tool-json-action-btn>Render full"), Z = /* @__PURE__ */ a("<button type=button class=chat-tool-json-action-btn>Preview"), tt = /* @__PURE__ */ a("<button type=button class=chat-tool-json-action-btn>Show more"), et = /* @__PURE__ */ a("<div class=chat-tool-section-header><div class=chat-tool-section-label></div><div class=chat-tool-json-actions>"), nt = /* @__PURE__ */ a("<pre>"), rt = /* @__PURE__ */ a("<div class=chat-tool-json-hint>Showing first <!> characters."), ot = /* @__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">'), lt = /* @__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">'), it = /* @__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">'), ct = /* @__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">'), st = /* @__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">'), at = /* @__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 It = (t) => {
9
- const n = q(), [s, y] = C(!0);
10
- B(() => {
11
- y(t.block.collapsed ?? !0);
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 e = () => s(), m = () => {
14
- y((u) => !u), n.toggleToolCollapse(t.messageId, t.block.toolId);
15
- }, w = () => {
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 r($t, {});
31
+ return i(kt, {});
32
32
  case "running":
33
- return r(yt, {});
33
+ return i(wt, {});
34
34
  case "success":
35
- return r(kt, {});
35
+ return i(_t, {});
36
36
  case "error":
37
- return r(wt, {});
37
+ return i(xt, {});
38
38
  default:
39
39
  return null;
40
40
  }
41
- }, S = () => {
41
+ }, x = () => {
42
42
  if (t.block.status === "running") return "Running...";
43
43
  if (t.block.status === "error") {
44
- const u = t.block.error || "Unknown error";
45
- return `Error: ${u.slice(0, 50)}${u.length > 50 ? "..." : ""}`;
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 u = X(), o = u.firstChild, g = o.firstChild, d = g.nextSibling, j = d.nextSibling;
51
- return o.$$click = m, c(g, r($, {
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 e();
53
+ return f();
54
54
  },
55
55
  get fallback() {
56
- return r(bt, {});
56
+ return i(yt, {});
57
57
  },
58
58
  get children() {
59
- return r(mt, {});
59
+ return i($t, {});
60
60
  }
61
- })), c(d, _), c(j, () => t.block.toolName), c(o, r($, {
61
+ })), c(C, _), c(j, () => t.block.toolName), c(h, i(b, {
62
62
  get when() {
63
- return E(() => t.block.requiresApproval === !0)() && t.block.approvalState === "required";
63
+ return I(() => !!f())() && !(t.block.requiresApproval === !0 && t.block.approvalState === "required");
64
64
  },
65
65
  get children() {
66
- var l = U(), k = l.firstChild, f = k.nextSibling;
67
- return l.$$click = (b) => b.stopPropagation(), k.$$click = (b) => {
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(o, r($, {
69
+ }), null), c(g, i(b, {
74
70
  get when() {
75
- return E(() => !!e())() && !(t.block.requiresApproval === !0 && t.block.approvalState === "required");
71
+ return I(() => t.block.requiresApproval === !0)() && t.block.approvalState === "required";
76
72
  },
77
73
  get children() {
78
- var l = W();
79
- return c(l, S), l;
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(u, r($, {
81
+ }), null), c(o, i(b, {
82
82
  get when() {
83
- return !e();
83
+ return !f();
84
84
  },
85
85
  get children() {
86
- var l = Q(), k = l.firstChild;
87
- return c(k, r(N, {
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, r($, {
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 f = z();
97
- return c(f, r(N, {
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
- })), f;
101
+ })), u;
102
102
  }
103
- }), null), c(l, r($, {
103
+ }), null), c(l, i(b, {
104
104
  get when() {
105
105
  return t.block.error;
106
106
  },
107
107
  get children() {
108
- var f = G(), b = f.firstChild, I = b.nextSibling;
109
- return c(I, () => t.block.error), f;
108
+ var u = Q(), n = u.firstChild, d = n.nextSibling;
109
+ return c(d, () => t.block.error), u;
110
110
  }
111
- }), null), c(l, r($, {
111
+ }), null), c(l, i(b, {
112
112
  get when() {
113
- return E(() => !!t.block.children)() && t.block.children.length > 0;
113
+ return I(() => !!t.block.children)() && t.block.children.length > 0;
114
114
  },
115
115
  get children() {
116
- var f = K();
117
- return c(f, r(L, {
116
+ var u = X();
117
+ return c(u, i(D, {
118
118
  get each() {
119
119
  return t.block.children;
120
120
  },
121
- children: (b, I) => r(H, {
122
- block: b,
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 I();
127
+ return d();
128
128
  },
129
129
  get isStreaming() {
130
- return n.streamingMessageId() === t.messageId;
130
+ return r.streamingMessageId() === t.messageId;
131
131
  }
132
132
  })
133
- })), f;
133
+ })), u;
134
134
  }
135
135
  }), null), l;
136
136
  }
137
- }), null), R((l) => {
138
- var k = J("chat-tool-call-block", t.class), f = J("chat-tool-status-icon", w());
139
- return k !== l.e && P(u, l.e = k), f !== l.t && P(d, l.t = f), l;
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
- }), u;
142
+ t: void 0,
143
+ a: void 0
144
+ }), o;
144
145
  })();
145
- }, O = 2e4, ut = 2e4;
146
- function N(t) {
147
- const [n, s] = C("full"), [y, e] = C(!1), [m, w] = C(null), [_, S] = C(null), [u, o] = C(O);
148
- let g = 0, d = !1;
149
- D(() => {
150
- d = !0, g++;
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 j = T(() => gt(t.value())), l = T(() => {
153
- const i = _();
154
- if (!i) return "";
155
- const p = u();
156
- return i.length > p ? i.slice(0, p) : i;
157
- }), k = () => {
158
- const i = _();
159
- return !!i && i.length > u();
160
- }, f = () => s("full"), b = () => {
161
- g++, s("preview"), e(!1), w(null), S(null), o(O);
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
- B(() => {
164
- if (n() !== "full") return;
165
- const i = t.value(), p = ++g;
166
- e(!0), w(null), S(null), o(O);
167
- const x = i;
168
- V(() => {
169
- const h = () => !d && p === g;
170
- if (h())
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 v = ft(x);
173
- h() && S(v);
174
- } catch (v) {
175
- h() && w(v instanceof Error ? v.message : "Failed to render payload");
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
- h() && e(!1);
178
+ m() && e(!1);
178
179
  }
179
180
  });
180
181
  });
181
- const I = () => n() === "preview" ? j() : y() ? "Preparing..." : m() ? `Error: ${m()}` : l();
182
+ const u = () => r() === "preview" ? E() : $() ? "Preparing..." : f() ? `Error: ${f()}` : C();
182
183
  return [(() => {
183
- var i = et(), p = i.firstChild, x = p.nextSibling;
184
- return c(p, () => t.label), c(x, r($, {
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 n() === "preview";
187
+ return r() === "preview";
187
188
  },
188
189
  get children() {
189
- var h = Y();
190
- return h.$$click = f, h;
190
+ var m = tt();
191
+ return m.$$click = l, m;
191
192
  }
192
- }), null), c(x, r($, {
193
+ }), null), c(S, i(b, {
193
194
  get when() {
194
- return n() === "full";
195
+ return r() === "full";
195
196
  },
196
197
  get children() {
197
- var h = Z();
198
- return h.$$click = b, h;
198
+ var m = et();
199
+ return m.$$click = w, m;
199
200
  }
200
- }), null), c(x, r($, {
201
+ }), null), c(S, i(b, {
201
202
  get when() {
202
- return E(() => n() === "full")() && k();
203
+ return I(() => r() === "full")() && j();
203
204
  },
204
205
  get children() {
205
- var h = tt();
206
- return h.$$click = () => o((v) => v + ut), h;
206
+ var m = nt();
207
+ return m.$$click = () => o((p) => p + ht), m;
207
208
  }
208
- }), null), i;
209
+ }), null), n;
209
210
  })(), (() => {
210
- var i = nt();
211
- return c(i, I), R(() => P(i, t.class)), i;
212
- })(), r($, {
211
+ var n = ot();
212
+ return c(n, u), B(() => T(n, t.class)), n;
213
+ })(), i(b, {
213
214
  get when() {
214
- return E(() => n() === "full")() && k();
215
+ return I(() => r() === "full")() && j();
215
216
  },
216
217
  get children() {
217
- var i = rt(), p = i.firstChild, x = p.nextSibling;
218
- return x.nextSibling, c(i, () => u().toLocaleString(), x), i;
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" ? F(t, 500) : dt(t, {
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 F(t, n) {
234
- return t.length <= n ? t : t.slice(0, n) + "...";
234
+ function M(t, r) {
235
+ return t.length <= r ? t : t.slice(0, r) + "...";
235
236
  }
236
- function ht(t, n) {
237
+ function mt(t, r) {
237
238
  const s = /* @__PURE__ */ new WeakSet();
238
- return JSON.stringify(t, (y, e) => {
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 m = e;
251
- if (s.has(m)) return "[Circular]";
252
- s.add(m);
251
+ const f = e;
252
+ if (s.has(f)) return "[Circular]";
253
+ s.add(f);
253
254
  }
254
255
  return e;
255
- }, n);
256
+ }, r);
256
257
  }
257
- function dt(t, n) {
258
- return A(t, n, 0, /* @__PURE__ */ new WeakSet());
258
+ function bt(t, r) {
259
+ return J(t, r, 0, /* @__PURE__ */ new WeakSet());
259
260
  }
260
- function A(t, n, s, y) {
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(F(t, n.maxStringLen));
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 m = t;
277
- if (y.has(m)) return JSON.stringify("[Circular]");
278
- if (y.add(m), Array.isArray(t)) {
279
- if (s >= n.maxDepth) return JSON.stringify(`[Array(${t.length})]`);
280
- const o = ["["], g = Math.min(t.length, n.maxArrayEntries);
281
- for (let d = 0; d < g; d++)
282
- o.push(`${e(s + 1)}${A(t[d], n, s + 1, y)}`);
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 >= n.maxDepth) return JSON.stringify("[Object]");
287
- const w = t, _ = ["{"];
288
- let S = 0, u = !1;
289
- for (const o in w) {
290
- if (!Object.prototype.hasOwnProperty.call(w, o)) continue;
291
- if (S >= n.maxObjectEntries) {
292
- u = !0;
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 = w[o], d = A(g, n, s + 1, y);
296
- _.push(`${e(s + 1)}${JSON.stringify(o)}: ${d}`), S++;
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 u && _.push(`${e(s + 1)}"...": "... (truncated)"`), _.push(`${e(s)}}`), _.join(`
299
+ return x && k.push(`${e(s + 1)}"...": "... (truncated)"`), k.push(`${e(s)}}`), k.join(`
299
300
  `);
300
301
  }
301
- const mt = () => ot(), bt = () => lt(), $t = () => it(), yt = () => ct(), kt = () => st(), wt = () => at();
302
- M(["click"]);
302
+ const $t = () => it(), yt = () => ct(), kt = () => st(), wt = () => at(), _t = () => ut(), xt = () => ft();
303
+ L(["click"]);
303
304
  export {
304
- It as ToolCallBlock
305
+ jt as ToolCallBlock
305
306
  };