@tangle-network/ui 11.10.0 → 11.11.1

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 (132) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +4 -1
  3. package/dist/active-sessions-store-Gt1R0rFG.js +262 -0
  4. package/dist/{active-sessions-store-CeOmXgv5.d.ts → active-sessions-store-nl70ZnMC.d.ts} +40 -41
  5. package/dist/artifact-pane-BL_DFWNl.d.ts +32 -0
  6. package/dist/artifact-pane-DMXT9a8U.js +70 -0
  7. package/dist/auth-DOETfnd9.js +154 -0
  8. package/dist/auth.d.ts +2 -74
  9. package/dist/auth.js +2 -16
  10. package/dist/branding-26d5ARIr.d.ts +14 -0
  11. package/dist/button-C87nEe2R.js +78 -0
  12. package/dist/button-yoIv77e2.d.ts +16 -0
  13. package/dist/chat-D4jAfEmj.js +667 -0
  14. package/dist/chat.d.ts +2 -201
  15. package/dist/chat.js +2 -31
  16. package/dist/code-block-B36KVUSN.js +165 -0
  17. package/dist/code-block-B9miUPht.d.ts +23 -0
  18. package/dist/diff-preview-BcK3nRXb.js +533 -0
  19. package/dist/document-editor-pane-BcoABlhn.d.ts +131 -0
  20. package/dist/document-editor-pane-BxlPjaTP.js +1287 -0
  21. package/dist/dropdown-menu-BpcLa5vF.js +101 -0
  22. package/dist/editor.d.ts +76 -78
  23. package/dist/editor.js +2 -34
  24. package/dist/file-format-BgXbr-Ib.js +160 -0
  25. package/dist/files-Bug33qCl.js +743 -0
  26. package/dist/files.d.ts +2 -243
  27. package/dist/files.js +3 -41
  28. package/dist/focus-BcE_SHqz.js +57 -0
  29. package/dist/format-DfcLWqMa.js +54 -0
  30. package/dist/hooks.d.ts +30 -37
  31. package/dist/hooks.js +111 -46
  32. package/dist/index-2UntyjBb.d.ts +52 -0
  33. package/dist/index-BgUHilZm.d.ts +108 -0
  34. package/dist/index-COgqsFAQ.d.ts +42 -0
  35. package/dist/index-CPDET_s1.d.ts +549 -0
  36. package/dist/index-CUhfHT_V.d.ts +204 -0
  37. package/dist/index-Cg6gYAqh.d.ts +73 -0
  38. package/dist/index-Cq-EJzqW.d.ts +16 -0
  39. package/dist/index-DhYmSaLF.d.ts +245 -0
  40. package/dist/index-DjKxO357.d.ts +128 -0
  41. package/dist/index.d.ts +26 -43
  42. package/dist/index.js +35 -472
  43. package/dist/markdown-BGqicV82.js +45 -0
  44. package/dist/markdown.d.ts +3 -18
  45. package/dist/markdown.js +3 -15
  46. package/dist/message-vhUI0c5G.d.ts +16 -0
  47. package/dist/nav.d.ts +6 -8
  48. package/dist/nav.js +29 -11
  49. package/dist/openui-artifact-renderer-D3E5bIAI.d.ts +114 -0
  50. package/dist/openui-artifact-renderer-DrU1AdVk.js +266 -0
  51. package/dist/openui.d.ts +2 -115
  52. package/dist/openui.js +2 -13
  53. package/dist/parts-5mhy9yJ3.d.ts +37 -0
  54. package/dist/primitives-Cb8GGVKr.js +1239 -0
  55. package/dist/primitives.d.ts +5 -525
  56. package/dist/primitives.js +9 -212
  57. package/dist/redaction-CGGB2ENG.js +74 -0
  58. package/dist/redaction.d.ts +2 -42
  59. package/dist/redaction.js +2 -7
  60. package/dist/run-OyWmIDqu.d.ts +41 -0
  61. package/dist/run-ZsIKPA6J.js +17 -0
  62. package/dist/run-group-BACLbCFl.js +410 -0
  63. package/dist/run.d.ts +3 -126
  64. package/dist/run.js +5 -40
  65. package/dist/sdk-hooks.d.ts +2 -285
  66. package/dist/sdk-hooks.js +3 -36
  67. package/dist/stores.d.ts +13 -14
  68. package/dist/stores.js +34 -76
  69. package/dist/table-Bss73DhB.js +146 -0
  70. package/dist/tabs-BVHR6NkO.js +40 -0
  71. package/dist/text-shimmer-BUUo6I-g.js +64 -0
  72. package/dist/tool-call-feed-BeB1_4pX.d.ts +47 -0
  73. package/dist/tool-call-feed-Djt2q11V.js +109 -0
  74. package/dist/tool-call-step-DNebqhmX.js +434 -0
  75. package/dist/tool-display-BAuAVa43.js +158 -0
  76. package/dist/{tool-display-z4JcDmMQ.d.ts → tool-display-DgmL5rIU.d.ts} +16 -16
  77. package/dist/tool-previews.d.ts +2 -48
  78. package/dist/tool-previews.js +2 -23
  79. package/dist/types.d.ts +6 -19
  80. package/dist/types.js +0 -1
  81. package/dist/use-auto-scroll-C5Pjeqon.js +153 -0
  82. package/dist/use-sse-stream-BVgO1QBN.js +884 -0
  83. package/dist/use-sse-stream-Dm6R5YWz.d.ts +282 -0
  84. package/dist/utils-Bl_CZ0Qp.js +37 -0
  85. package/dist/{chunk-RQHJBTEU.js → utils-C_uf36nf.js} +4 -6
  86. package/dist/utils.d.ts +2 -104
  87. package/dist/utils.js +6 -44
  88. package/package.json +39 -41
  89. package/src/lib/focus.ts +2 -1
  90. package/dist/artifact-pane-DpuWcAiF.d.ts +0 -33
  91. package/dist/button-CMQuQEW_.d.ts +0 -17
  92. package/dist/chunk-34A66VBG.js +0 -214
  93. package/dist/chunk-3OI2QKFD.js +0 -0
  94. package/dist/chunk-3XXBZL53.js +0 -174
  95. package/dist/chunk-42PAH5D2.js +0 -112
  96. package/dist/chunk-4CLN43XT.js +0 -45
  97. package/dist/chunk-55WHV7SS.js +0 -1604
  98. package/dist/chunk-565EATZZ.js +0 -156
  99. package/dist/chunk-5Z5ZYMOJ.js +0 -0
  100. package/dist/chunk-6BGQA4BQ.js +0 -0
  101. package/dist/chunk-BEBXZPHW.js +0 -299
  102. package/dist/chunk-C5WF4WMV.js +0 -734
  103. package/dist/chunk-HFL6R6IF.js +0 -37
  104. package/dist/chunk-HGML45QH.js +0 -104
  105. package/dist/chunk-HMAPIH7L.js +0 -595
  106. package/dist/chunk-K5XFRUS4.js +0 -1401
  107. package/dist/chunk-KFQGHD73.js +0 -198
  108. package/dist/chunk-L57WRIND.js +0 -59
  109. package/dist/chunk-LTEKI7YJ.js +0 -59
  110. package/dist/chunk-M3QZK62R.js +0 -233
  111. package/dist/chunk-ND3ZFXQK.js +0 -179
  112. package/dist/chunk-OEX7NZE3.js +0 -321
  113. package/dist/chunk-OL5GYLHV.js +0 -60
  114. package/dist/chunk-QGFYBNSO.js +0 -133
  115. package/dist/chunk-R7B3UWPF.js +0 -550
  116. package/dist/chunk-R7SUY4E3.js +0 -65
  117. package/dist/chunk-REJESC5U.js +0 -117
  118. package/dist/chunk-RQGKSCEZ.js +0 -0
  119. package/dist/chunk-SNLR2AEA.js +0 -40
  120. package/dist/chunk-WKWBTL2V.js +0 -15
  121. package/dist/chunk-X7CU776B.js +0 -1048
  122. package/dist/chunk-XU3HB5QL.js +0 -127
  123. package/dist/chunk-YTO5V6QS.js +0 -19
  124. package/dist/chunk-YU4E5J2N.js +0 -437
  125. package/dist/chunk-YZ6AK25N.js +0 -886
  126. package/dist/code-block-0kSpWMnf.d.ts +0 -25
  127. package/dist/document-editor-pane-IAEQn_Dl.d.ts +0 -128
  128. package/dist/document-editor-pane-QHDOBA43.js +0 -13
  129. package/dist/message-BHWbxBtT.d.ts +0 -15
  130. package/dist/parts-dj7AcUg0.d.ts +0 -36
  131. package/dist/run-PfLmDAox.d.ts +0 -41
  132. package/dist/tool-call-feed-D9iofJgW.d.ts +0 -46
@@ -1,550 +0,0 @@
1
- import {
2
- getToolCategory,
3
- getToolDisplayMetadata,
4
- getToolErrorText
5
- } from "./chunk-ND3ZFXQK.js";
6
- import {
7
- CommandPreview,
8
- DiffPreview,
9
- GlobResultsPreview,
10
- GrepResultsPreview,
11
- QuestionPreview,
12
- WebSearchPreview,
13
- WriteFilePreview
14
- } from "./chunk-HMAPIH7L.js";
15
- import {
16
- TextShimmer
17
- } from "./chunk-L57WRIND.js";
18
- import {
19
- formatDuration
20
- } from "./chunk-4CLN43XT.js";
21
- import {
22
- CodeBlock
23
- } from "./chunk-3XXBZL53.js";
24
- import {
25
- cn
26
- } from "./chunk-RQHJBTEU.js";
27
-
28
- // src/run/expanded-tool-detail.tsx
29
- import { memo } from "react";
30
- import {
31
- ArrowRight,
32
- ArrowLeft,
33
- AlertCircle,
34
- Loader2,
35
- FileText
36
- } from "lucide-react";
37
-
38
- // src/run/expandable-content.tsx
39
- import { useEffect, useRef, useState } from "react";
40
- import { jsx, jsxs } from "react/jsx-runtime";
41
- function ExpandableContent({
42
- children,
43
- collapsedMaxPx = 180,
44
- fadeClassName = "from-muted",
45
- className
46
- }) {
47
- const [expanded, setExpanded] = useState(false);
48
- const [overflowing, setOverflowing] = useState(false);
49
- const contentRef = useRef(null);
50
- useEffect(() => {
51
- const el = contentRef.current;
52
- if (!el) return;
53
- const measure = () => setOverflowing(el.scrollHeight > collapsedMaxPx + 4);
54
- measure();
55
- if (typeof ResizeObserver === "undefined") return;
56
- const observer = new ResizeObserver(measure);
57
- observer.observe(el);
58
- return () => observer.disconnect();
59
- }, [collapsedMaxPx]);
60
- const clamped = overflowing && !expanded;
61
- return /* @__PURE__ */ jsxs("div", { className, children: [
62
- /* @__PURE__ */ jsxs(
63
- "div",
64
- {
65
- ref: contentRef,
66
- className: "relative overflow-hidden",
67
- style: clamped ? { maxHeight: collapsedMaxPx } : void 0,
68
- children: [
69
- children,
70
- clamped ? /* @__PURE__ */ jsx(
71
- "div",
72
- {
73
- className: cn(
74
- "pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t to-transparent",
75
- fadeClassName
76
- )
77
- }
78
- ) : null
79
- ]
80
- }
81
- ),
82
- overflowing ? /* @__PURE__ */ jsx(
83
- "button",
84
- {
85
- type: "button",
86
- onClick: () => setExpanded((value) => !value),
87
- className: "mt-1 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground",
88
- children: expanded ? "Show less" : "Show more"
89
- }
90
- ) : null
91
- ] });
92
- }
93
-
94
- // src/run/expanded-tool-detail.tsx
95
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
96
- var EXT_LANG = {
97
- ts: "typescript",
98
- tsx: "tsx",
99
- js: "javascript",
100
- jsx: "jsx",
101
- rs: "rust",
102
- py: "python",
103
- go: "go",
104
- rb: "ruby",
105
- json: "json",
106
- yaml: "yaml",
107
- yml: "yaml",
108
- toml: "toml",
109
- md: "markdown",
110
- css: "css",
111
- scss: "scss",
112
- html: "html",
113
- sh: "bash",
114
- bash: "bash",
115
- zsh: "bash",
116
- sql: "sql",
117
- sol: "solidity",
118
- proto: "protobuf"
119
- };
120
- function langFromPath(path) {
121
- if (!path) return void 0;
122
- const ext = path.split(".").pop()?.toLowerCase();
123
- return ext ? EXT_LANG[ext] : void 0;
124
- }
125
- function formatOutput(value) {
126
- if (value == null) return "";
127
- if (typeof value === "string") return value;
128
- try {
129
- return JSON.stringify(value, null, 2);
130
- } catch {
131
- return String(value);
132
- }
133
- }
134
- var ExpandedToolDetail = memo(({ part }) => {
135
- const meta = getToolDisplayMetadata(part);
136
- const { status, input, output, error } = part.state;
137
- if (meta.displayVariant === "command") {
138
- return /* @__PURE__ */ jsx2(CommandPreview, { part });
139
- }
140
- if (meta.displayVariant === "write-file") {
141
- return /* @__PURE__ */ jsx2(WriteFilePreview, { part });
142
- }
143
- if (meta.displayVariant === "grep") {
144
- return /* @__PURE__ */ jsx2(GrepResultsPreview, { part });
145
- }
146
- if (meta.displayVariant === "glob") {
147
- return /* @__PURE__ */ jsx2(GlobResultsPreview, { part });
148
- }
149
- if (meta.displayVariant === "web-search") {
150
- return /* @__PURE__ */ jsx2(WebSearchPreview, { part });
151
- }
152
- if (meta.displayVariant === "question") {
153
- return /* @__PURE__ */ jsx2(QuestionPreview, { part });
154
- }
155
- if (meta.displayVariant === "diff") {
156
- return /* @__PURE__ */ jsx2(DiffPreview, { part });
157
- }
158
- if (meta.displayVariant === "read-file") {
159
- return /* @__PURE__ */ jsxs2("div", { className: "overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card shadow-[var(--shadow-card)]", children: [
160
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2.5 border-b border-border bg-card px-3 py-2", children: [
161
- /* @__PURE__ */ jsx2("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-[var(--radius-sm)] border border-[var(--border-accent)] bg-muted text-primary", children: /* @__PURE__ */ jsx2(FileText, { className: "h-3.5 w-3.5" }) }),
162
- /* @__PURE__ */ jsxs2("div", { className: "min-w-0 flex items-center gap-2", children: [
163
- /* @__PURE__ */ jsx2("span", { className: "text-xs font-semibold text-foreground", children: "Read file" }),
164
- meta.targetPath ? /* @__PURE__ */ jsx2("span", { className: "truncate text-xs font-mono text-muted-foreground", children: meta.targetPath }) : null
165
- ] })
166
- ] }),
167
- /* @__PURE__ */ jsxs2("div", { className: "space-y-2 px-3 py-2.5", children: [
168
- typeof output === "string" ? /* @__PURE__ */ jsx2(CodeBlock, { code: output, language: langFromPath(meta.targetPath) ?? "text", className: "rounded-[var(--radius-md)]" }) : /* @__PURE__ */ jsx2("div", { className: "rounded-[var(--radius-md)] border border-dashed border-border bg-muted px-3 py-4 text-sm text-muted-foreground", children: "No readable file content was returned." }),
169
- error ? /* @__PURE__ */ jsx2("div", { className: "rounded-[var(--radius-md)] border border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] px-3 py-3 text-sm text-[var(--surface-danger-text)]", children: error }) : null
170
- ] })
171
- ] });
172
- }
173
- const inputStr = formatOutput(input);
174
- const outputStr = formatOutput(output);
175
- return /* @__PURE__ */ jsxs2("div", { className: "space-y-3", children: [
176
- inputStr && /* @__PURE__ */ jsxs2("div", { className: "overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card", children: [
177
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 border-b border-border bg-background px-3 py-2", children: [
178
- /* @__PURE__ */ jsx2(ArrowRight, { className: "h-3 w-3 text-primary" }),
179
- /* @__PURE__ */ jsx2("span", { className: "text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Input" })
180
- ] }),
181
- /* @__PURE__ */ jsx2(CodeBlock, { code: inputStr, language: "json", className: "rounded-none border-0" })
182
- ] }),
183
- status === "completed" && outputStr && /* @__PURE__ */ jsxs2("div", { className: "overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card", children: [
184
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 border-b border-border bg-background px-3 py-2", children: [
185
- /* @__PURE__ */ jsx2(ArrowLeft, { className: "h-3 w-3 text-primary" }),
186
- /* @__PURE__ */ jsx2("span", { className: "text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Output" })
187
- ] }),
188
- /* @__PURE__ */ jsx2(ExpandableContent, { fadeClassName: "from-card", children: /* @__PURE__ */ jsx2(
189
- CodeBlock,
190
- {
191
- code: outputStr.length > 2e3 ? outputStr.slice(0, 2e3) + "\n...(truncated)" : outputStr,
192
- language: "json",
193
- className: "rounded-none border-0"
194
- }
195
- ) })
196
- ] }),
197
- error && /* @__PURE__ */ jsxs2("div", { className: "overflow-hidden rounded-[var(--radius-lg)] border border-[var(--surface-danger-border)]", children: [
198
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 border-b border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] px-3 py-2", children: [
199
- /* @__PURE__ */ jsx2(AlertCircle, { className: "h-3 w-3 text-[var(--surface-danger-text)]" }),
200
- /* @__PURE__ */ jsx2("span", { className: "text-xs font-medium uppercase tracking-[0.08em] text-[var(--surface-danger-text)]", children: "Error" })
201
- ] }),
202
- /* @__PURE__ */ jsx2(ExpandableContent, { fadeClassName: "from-[var(--surface-danger-bg)]", children: /* @__PURE__ */ jsx2("pre", { className: "bg-[var(--surface-danger-bg)] p-3 text-xs font-mono whitespace-pre-wrap break-all text-[var(--surface-danger-text)]", children: error }) })
203
- ] }),
204
- (status === "pending" || status === "running") && /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 rounded-[var(--radius-md)] border border-border bg-muted px-3 py-3 text-xs text-muted-foreground", children: [
205
- /* @__PURE__ */ jsx2(Loader2, { className: cn("h-3 w-3 animate-spin text-primary") }),
206
- "Running\u2026"
207
- ] })
208
- ] });
209
- });
210
- ExpandedToolDetail.displayName = "ExpandedToolDetail";
211
-
212
- // src/run/run-row-shell.tsx
213
- import { useState as useState2 } from "react";
214
- import * as Collapsible from "@radix-ui/react-collapsible";
215
- import { ChevronRight } from "lucide-react";
216
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
217
- function RunRowStatusDot({ status }) {
218
- if (status !== "error") return null;
219
- return /* @__PURE__ */ jsx3(
220
- "span",
221
- {
222
- "data-run-row-status": "error",
223
- className: "h-1.5 w-1.5 shrink-0 rounded-full bg-[var(--surface-danger-text)]"
224
- }
225
- );
226
- }
227
- var SHAPE_CLASS = {
228
- single: "rounded-[var(--radius-lg)]",
229
- first: "rounded-t-[var(--radius-lg)] rounded-b-[var(--radius-sm)]",
230
- middle: "rounded-[var(--radius-sm)]",
231
- last: "rounded-t-[var(--radius-sm)] rounded-b-[var(--radius-lg)]"
232
- };
233
- var HEADER_INSET = "px-2 py-1";
234
- var ERROR_INDENT = "pl-[2.375rem]";
235
- function RunRowShell({
236
- icon,
237
- title,
238
- description,
239
- descriptionMono = false,
240
- status = "idle",
241
- durationMs,
242
- groupPosition = "single",
243
- collapsedError,
244
- actions,
245
- open: openProp,
246
- onOpenChange,
247
- defaultOpen = false,
248
- className,
249
- contentClassName,
250
- children
251
- }) {
252
- const [openState, setOpenState] = useState2(defaultOpen);
253
- const isControlled = openProp !== void 0;
254
- const open = isControlled ? openProp : openState;
255
- const setOpen = (next) => {
256
- if (!isControlled) setOpenState(next);
257
- onOpenChange?.(next);
258
- };
259
- const isRunning = status === "running";
260
- const expandable = children != null;
261
- return /* @__PURE__ */ jsx3(Collapsible.Root, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-2", children: [
262
- /* @__PURE__ */ jsxs3(
263
- "div",
264
- {
265
- "data-run-row": "",
266
- "data-state": open ? "open" : "closed",
267
- className: cn(
268
- "group min-w-0 flex-1 overflow-hidden border transition-colors",
269
- open ? "border-border bg-[var(--md3-surface-container)]" : "border-transparent bg-transparent",
270
- expandable && !open && "hover:bg-[var(--md3-surface-container)]",
271
- SHAPE_CLASS[groupPosition],
272
- className
273
- ),
274
- children: [
275
- /* @__PURE__ */ jsx3(Collapsible.Trigger, { asChild: true, disabled: !expandable, children: /* @__PURE__ */ jsxs3(
276
- "button",
277
- {
278
- type: "button",
279
- className: cn(
280
- "flex w-full items-center gap-2 text-left",
281
- HEADER_INSET,
282
- expandable ? "cursor-pointer" : "cursor-default"
283
- ),
284
- children: [
285
- /* @__PURE__ */ jsxs3(
286
- "span",
287
- {
288
- "aria-hidden": true,
289
- className: "flex h-[1.375rem] w-[1.375rem] shrink-0 items-center justify-center text-muted-foreground",
290
- children: [
291
- /* @__PURE__ */ jsx3(
292
- "span",
293
- {
294
- "data-run-row-glyph": "",
295
- className: cn(
296
- "flex items-center justify-center",
297
- expandable && "group-hover:hidden",
298
- open && "hidden"
299
- ),
300
- children: icon
301
- }
302
- ),
303
- expandable ? /* @__PURE__ */ jsx3(
304
- ChevronRight,
305
- {
306
- "data-run-row-chevron": "",
307
- className: cn(
308
- "hidden h-3.5 w-3.5 transition-transform group-hover:block",
309
- open && "block rotate-90"
310
- )
311
- }
312
- ) : null
313
- ]
314
- }
315
- ),
316
- /* @__PURE__ */ jsx3(
317
- "span",
318
- {
319
- className: cn(
320
- "shrink-0 whitespace-nowrap text-sm font-normal text-muted-foreground transition-colors group-hover:text-foreground",
321
- open && "text-foreground"
322
- ),
323
- children: title
324
- }
325
- ),
326
- description ? /* @__PURE__ */ jsx3(
327
- "span",
328
- {
329
- className: cn(
330
- "hidden min-w-0 flex-1 truncate text-sm text-muted-foreground transition-colors group-hover:text-foreground sm:inline",
331
- descriptionMono && "font-mono"
332
- ),
333
- children: description
334
- }
335
- ) : null,
336
- /* @__PURE__ */ jsxs3("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
337
- !isRunning && durationMs != null ? /* @__PURE__ */ jsx3(
338
- "span",
339
- {
340
- "data-run-row-duration": "",
341
- className: "font-mono text-[10px] tabular-nums text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100",
342
- children: formatDuration(durationMs)
343
- }
344
- ) : null,
345
- /* @__PURE__ */ jsx3(RunRowStatusDot, { status })
346
- ] })
347
- ]
348
- }
349
- ) }),
350
- collapsedError && !open ? /* @__PURE__ */ jsx3(
351
- "div",
352
- {
353
- className: cn(
354
- "pb-1.5 pr-2 text-xs leading-snug text-[var(--surface-danger-text)]",
355
- ERROR_INDENT
356
- ),
357
- children: collapsedError
358
- }
359
- ) : null,
360
- expandable ? /* @__PURE__ */ jsx3(Collapsible.Content, { className: "overflow-hidden data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp", children: /* @__PURE__ */ jsx3("div", { className: cn("border-t border-border", contentClassName), children }) }) : null
361
- ]
362
- }
363
- ),
364
- actions ? /* @__PURE__ */ jsx3(
365
- "div",
366
- {
367
- className: "flex shrink-0 flex-wrap items-center justify-end gap-1.5 pt-1",
368
- onClick: (event) => event.stopPropagation(),
369
- children: actions
370
- }
371
- ) : null
372
- ] }) });
373
- }
374
-
375
- // src/run/inline-tool-item.tsx
376
- import { memo as memo2 } from "react";
377
- import {
378
- Terminal,
379
- FileEdit,
380
- FileSearch,
381
- Search,
382
- PencilLine,
383
- Bot,
384
- Globe,
385
- ClipboardList,
386
- Settings
387
- } from "lucide-react";
388
- import { jsx as jsx4 } from "react/jsx-runtime";
389
- var TOOL_CATEGORY_ICON_MAP = {
390
- command: Terminal,
391
- write: FileEdit,
392
- read: FileSearch,
393
- search: Search,
394
- edit: PencilLine,
395
- task: Bot,
396
- web: Globe,
397
- todo: ClipboardList,
398
- other: Settings
399
- };
400
- function toRowStatus(status) {
401
- if (status === "pending" || status === "running") return "running";
402
- if (status === "error") return "error";
403
- return "success";
404
- }
405
- var InlineToolItem = memo2(
406
- ({
407
- part,
408
- renderToolDetail,
409
- groupPosition = "single",
410
- className,
411
- contentClassName,
412
- actions,
413
- title: titleOverride,
414
- description: descriptionOverride
415
- }) => {
416
- const meta = getToolDisplayMetadata(part);
417
- const title = titleOverride ?? meta.title;
418
- const description = descriptionOverride ?? meta.description;
419
- const errorText = getToolErrorText(part);
420
- const startTime = part.state.time?.start;
421
- const endTime = part.state.time?.end;
422
- const durationMs = startTime != null && endTime != null ? endTime - startTime : void 0;
423
- const category = getToolCategory(part.tool);
424
- const DefaultIcon = TOOL_CATEGORY_ICON_MAP[category] ?? Settings;
425
- const status = toRowStatus(part.state.status);
426
- return /* @__PURE__ */ jsx4(
427
- RunRowShell,
428
- {
429
- icon: /* @__PURE__ */ jsx4(DefaultIcon, { className: "h-3.5 w-3.5" }),
430
- title: status === "running" ? /* @__PURE__ */ jsx4(TextShimmer, { children: title }) : title,
431
- description,
432
- descriptionMono: true,
433
- status,
434
- durationMs,
435
- groupPosition,
436
- collapsedError: errorText ?? void 0,
437
- actions,
438
- className,
439
- contentClassName: cn("p-2", contentClassName),
440
- children: renderToolDetail?.(part) ?? /* @__PURE__ */ jsx4(ExpandedToolDetail, { part })
441
- }
442
- );
443
- }
444
- );
445
- InlineToolItem.displayName = "InlineToolItem";
446
-
447
- // src/run/tool-call-step.tsx
448
- import { jsx as jsx5 } from "react/jsx-runtime";
449
- var EXT_LANGUAGE = {
450
- ts: "typescript",
451
- tsx: "typescript",
452
- js: "javascript",
453
- jsx: "javascript",
454
- mjs: "javascript",
455
- cjs: "javascript",
456
- css: "css",
457
- scss: "scss",
458
- json: "json",
459
- jsonc: "json",
460
- md: "markdown",
461
- mdx: "markdown",
462
- py: "python",
463
- sh: "bash",
464
- bash: "bash",
465
- zsh: "bash",
466
- html: "html",
467
- htm: "html",
468
- yaml: "yaml",
469
- yml: "yaml",
470
- toml: "toml",
471
- rs: "rust",
472
- go: "go",
473
- sql: "sql",
474
- xml: "xml"
475
- };
476
- function inferLanguage(detail, language) {
477
- if (language) return language;
478
- if (!detail) return void 0;
479
- const ext = detail.split(".").pop()?.toLowerCase();
480
- return ext ? EXT_LANGUAGE[ext] : void 0;
481
- }
482
- var STATUS_MAP = {
483
- running: "running",
484
- success: "completed",
485
- error: "error"
486
- };
487
- function ToolCallStep({
488
- type,
489
- label,
490
- status,
491
- detail,
492
- output,
493
- language,
494
- duration,
495
- className,
496
- actions,
497
- part
498
- }) {
499
- const resolvedPart = part ?? {
500
- type: "tool",
501
- id: `${type}:${label}`,
502
- tool: type,
503
- state: {
504
- status: STATUS_MAP[status],
505
- input: detail ? { detail } : void 0,
506
- output,
507
- time: duration != null ? { start: 0, end: duration } : void 0
508
- }
509
- };
510
- const lang = inferLanguage(detail, language);
511
- return /* @__PURE__ */ jsx5(
512
- InlineToolItem,
513
- {
514
- part: resolvedPart,
515
- title: label,
516
- description: detail,
517
- className,
518
- actions,
519
- renderToolDetail: part ? void 0 : output ? () => /* @__PURE__ */ jsx5(
520
- CodeBlock,
521
- {
522
- code: output,
523
- language: lang,
524
- className: "max-h-72 overflow-auto text-xs"
525
- }
526
- ) : () => null
527
- }
528
- );
529
- }
530
- function ToolCallGroup({ title, children, className }) {
531
- return /* @__PURE__ */ jsx5(
532
- "div",
533
- {
534
- role: "group",
535
- "aria-label": title,
536
- className: cn("flex flex-col gap-1", className),
537
- children
538
- }
539
- );
540
- }
541
-
542
- export {
543
- ExpandableContent,
544
- ExpandedToolDetail,
545
- RunRowStatusDot,
546
- RunRowShell,
547
- InlineToolItem,
548
- ToolCallStep,
549
- ToolCallGroup
550
- };
@@ -1,65 +0,0 @@
1
- import {
2
- focusRing
3
- } from "./chunk-WKWBTL2V.js";
4
- import {
5
- cn
6
- } from "./chunk-RQHJBTEU.js";
7
-
8
- // src/primitives/tabs.tsx
9
- import * as TabsPrimitive from "@radix-ui/react-tabs";
10
- import * as React from "react";
11
- import { jsx } from "react/jsx-runtime";
12
- var Tabs = TabsPrimitive.Root;
13
- var TabsList = React.forwardRef(({ className, variant = "default", ...props }, ref) => {
14
- const variants = {
15
- default: "inline-flex h-10 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
16
- pills: "inline-flex items-center gap-2",
17
- underline: "inline-flex items-center gap-4 border-b border-border"
18
- };
19
- return /* @__PURE__ */ jsx(
20
- TabsPrimitive.List,
21
- {
22
- ref,
23
- className: cn(variants[variant], className),
24
- ...props
25
- }
26
- );
27
- });
28
- TabsList.displayName = TabsPrimitive.List.displayName;
29
- var TabsTrigger = React.forwardRef(({ className, variant = "default", ...props }, ref) => {
30
- const variants = {
31
- default: `inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-all ${focusRing} disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm`,
32
- pills: `inline-flex items-center justify-center whitespace-nowrap rounded-full px-4 py-2 text-sm font-medium transition-all ${focusRing} disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=inactive]:text-muted-foreground data-[state=inactive]:hover:bg-muted`,
33
- underline: `inline-flex items-center justify-center whitespace-nowrap rounded-t-md pb-3 text-sm font-medium transition-all ${focusRing} disabled:pointer-events-none disabled:opacity-50 border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:text-foreground data-[state=inactive]:text-muted-foreground`
34
- };
35
- return /* @__PURE__ */ jsx(
36
- TabsPrimitive.Trigger,
37
- {
38
- ref,
39
- className: cn(variants[variant], className),
40
- ...props
41
- }
42
- );
43
- });
44
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
45
- var TabsContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
46
- TabsPrimitive.Content,
47
- {
48
- ref,
49
- className: cn(
50
- "mt-4",
51
- focusRing,
52
- "data-[state=active]:fade-in-0 data-[state=active]:slide-in-from-bottom-2 data-[state=active]:animate-in",
53
- className
54
- ),
55
- ...props
56
- }
57
- ));
58
- TabsContent.displayName = TabsPrimitive.Content.displayName;
59
-
60
- export {
61
- Tabs,
62
- TabsList,
63
- TabsTrigger,
64
- TabsContent
65
- };