@tangle-network/ui 8.1.0 → 9.1.0

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  InlineToolItem,
3
3
  LiveDuration
4
- } from "./chunk-RKQDBRTC.js";
4
+ } from "./chunk-J6RQHBHR.js";
5
5
  import {
6
6
  formatDuration,
7
7
  truncateText
@@ -108,68 +108,14 @@ var InlineThinkingItem = memo(
108
108
  );
109
109
  InlineThinkingItem.displayName = "InlineThinkingItem";
110
110
 
111
- // src/run/assistant-run-shell.tsx
112
- import * as Collapsible2 from "@radix-ui/react-collapsible";
113
- import { ChevronDown, ChevronRight as ChevronRight2, Loader2, Sparkles } from "lucide-react";
114
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
115
- function AssistantRunShell({
116
- label,
117
- summary,
118
- collapsedPreview,
119
- badges,
120
- isStreaming,
121
- collapsed,
122
- onToggle,
123
- headerActions,
124
- children,
125
- className
126
- }) {
127
- return /* @__PURE__ */ jsx2(Collapsible2.Root, { open: !collapsed, onOpenChange: () => onToggle(), children: /* @__PURE__ */ jsxs2(
128
- "div",
129
- {
130
- className: cn(
131
- "rounded-[28px] border border-[var(--border-subtle)] bg-[var(--bg-card)] shadow-none",
132
- className
133
- ),
134
- children: [
135
- /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-3 px-3 py-2.5", children: [
136
- /* @__PURE__ */ jsx2(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx2(
137
- "button",
138
- {
139
- type: "button",
140
- className: "w-full rounded-[20px] bg-transparent px-0 py-0 text-left transition-colors hover:bg-transparent",
141
- children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
142
- /* @__PURE__ */ jsx2("span", { className: "font-semibold text-foreground text-sm", children: label }),
143
- summary ? /* @__PURE__ */ jsx2("span", { className: "text-[11px] text-muted-foreground", children: summary }) : null,
144
- collapsed && collapsedPreview ? /* @__PURE__ */ jsx2("span", { className: "min-w-0 truncate text-[11px] text-foreground/70", children: collapsedPreview }) : null,
145
- /* @__PURE__ */ jsxs2("div", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
146
- badges,
147
- isStreaming ? /* @__PURE__ */ jsxs2("span", { className: "inline-flex items-center gap-1 rounded-full border border-[var(--border-accent)] bg-[var(--accent-surface-soft)] px-2 py-px text-[10px] font-semibold uppercase text-[var(--accent-text)]", children: [
148
- /* @__PURE__ */ jsx2(Loader2, { className: "h-2.5 w-2.5 animate-spin" }),
149
- "Running"
150
- ] }) : /* @__PURE__ */ jsxs2("span", { className: "inline-flex items-center gap-1 rounded-full border border-border px-2 py-px text-[10px] font-semibold uppercase text-muted-foreground", children: [
151
- /* @__PURE__ */ jsx2(Sparkles, { className: "h-2.5 w-2.5" }),
152
- "Done"
153
- ] }),
154
- collapsed ? /* @__PURE__ */ jsx2(ChevronRight2, { className: "h-3.5 w-3.5 text-muted-foreground" }) : /* @__PURE__ */ jsx2(ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" })
155
- ] })
156
- ] })
157
- }
158
- ) }),
159
- headerActions ? /* @__PURE__ */ jsx2("div", { className: "flex shrink-0 flex-wrap items-center justify-end gap-1.5 pt-1", children: headerActions }) : null
160
- ] }),
161
- collapsed && collapsedPreview ? /* @__PURE__ */ jsx2("div", { className: "line-clamp-2 px-4 pb-4 text-sm leading-6 text-muted-foreground", children: collapsedPreview }) : null,
162
- /* @__PURE__ */ jsx2(Collapsible2.Content, { className: "overflow-hidden data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp", children: /* @__PURE__ */ jsx2("div", { className: "border-t border-[var(--border-subtle)] px-4 pb-4 pt-3", children }) })
163
- ]
164
- }
165
- ) });
166
- }
167
-
168
111
  // src/run/run-group.tsx
169
112
  import { memo as memo2, useMemo } from "react";
113
+ import * as Collapsible2 from "@radix-ui/react-collapsible";
170
114
  import {
171
115
  Bot,
172
- Loader2 as Loader22,
116
+ Loader2,
117
+ ChevronDown,
118
+ ChevronRight as ChevronRight2,
173
119
  Terminal,
174
120
  FileEdit,
175
121
  FileSearch,
@@ -177,9 +123,31 @@ import {
177
123
  PencilLine,
178
124
  Globe,
179
125
  ClipboardList,
180
- Settings
126
+ Settings,
127
+ Sparkles
181
128
  } from "lucide-react";
182
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
129
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
130
+ function SpineRow({
131
+ accentClassName,
132
+ isLast,
133
+ children
134
+ }) {
135
+ return /* @__PURE__ */ jsxs2("div", { className: "grid grid-cols-[1.25rem_minmax(0,1fr)] gap-x-3", children: [
136
+ /* @__PURE__ */ jsxs2("div", { className: "relative flex justify-center", children: [
137
+ !isLast && /* @__PURE__ */ jsx2("span", { className: "absolute top-3.5 bottom-[-0.75rem] left-1/2 w-px -translate-x-1/2 bg-[var(--border-subtle)]" }),
138
+ /* @__PURE__ */ jsx2(
139
+ "span",
140
+ {
141
+ className: cn(
142
+ "relative mt-1.5 h-[var(--timeline-dot-size,0.5rem)] w-[var(--timeline-dot-size,0.5rem)] rounded-full ring-4 ring-[var(--bg-root)]",
143
+ accentClassName
144
+ )
145
+ }
146
+ )
147
+ ] }),
148
+ /* @__PURE__ */ jsx2("div", { className: "min-w-0 pb-3", children })
149
+ ] });
150
+ }
183
151
  var DEFAULT_BRANDING = {
184
152
  label: "Agent",
185
153
  accentClass: "text-primary",
@@ -195,15 +163,15 @@ function AssistantShell({
195
163
  isStreaming,
196
164
  children
197
165
  }) {
198
- return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-1", children: [
199
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 px-1 font-medium text-muted-foreground text-xs", children: [
200
- /* @__PURE__ */ jsx3("span", { children: branding.label }),
201
- isStreaming ? /* @__PURE__ */ jsxs3("span", { className: "inline-flex items-center gap-1.5", children: [
202
- /* @__PURE__ */ jsx3(Loader22, { className: "h-3 w-3 animate-spin" }),
166
+ return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-1", children: [
167
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 px-1 font-medium text-muted-foreground text-xs", children: [
168
+ /* @__PURE__ */ jsx2("span", { children: branding.label }),
169
+ isStreaming ? /* @__PURE__ */ jsxs2("span", { className: "inline-flex items-center gap-1.5", children: [
170
+ /* @__PURE__ */ jsx2(Loader2, { className: "h-3 w-3 animate-spin" }),
203
171
  "Thinking"
204
172
  ] }) : null
205
173
  ] }),
206
- /* @__PURE__ */ jsx3("div", { className: ASSISTANT_SHELL, children })
174
+ /* @__PURE__ */ jsx2("div", { className: ASSISTANT_SHELL, children })
207
175
  ] });
208
176
  }
209
177
  var CATEGORY_ICON_MAP = {
@@ -295,14 +263,14 @@ function CategoryBadges({ categories }) {
295
263
  [categories]
296
264
  );
297
265
  if (sorted.length === 0) return null;
298
- return /* @__PURE__ */ jsx3("div", { className: "flex items-center gap-1", children: sorted.map((cat) => {
266
+ return /* @__PURE__ */ jsx2("div", { className: "flex items-center gap-1", children: sorted.map((cat) => {
299
267
  const Icon = CATEGORY_ICON_MAP[cat] ?? Settings;
300
- return /* @__PURE__ */ jsx3(
268
+ return /* @__PURE__ */ jsx2(
301
269
  "span",
302
270
  {
303
271
  title: cat,
304
272
  className: "flex h-5 w-5 items-center justify-center rounded border border-border text-muted-foreground",
305
- children: /* @__PURE__ */ jsx3(Icon, { className: "h-3 w-3" })
273
+ children: /* @__PURE__ */ jsx2(Icon, { className: "h-3 w-3" })
306
274
  },
307
275
  cat
308
276
  );
@@ -321,16 +289,6 @@ function renderSummary(run) {
321
289
  }
322
290
  return parts.join(", ");
323
291
  }
324
- function getToolGroupPosition(currentIndex, parts) {
325
- const previous = parts[currentIndex - 1]?.part;
326
- const next = parts[currentIndex + 1]?.part;
327
- const previousIsTool = previous?.type === "tool";
328
- const nextIsTool = next?.type === "tool";
329
- if (previousIsTool && nextIsTool) return "middle";
330
- if (previousIsTool) return "last";
331
- if (nextIsTool) return "first";
332
- return "single";
333
- }
334
292
  var RunGroup = memo2(
335
293
  ({
336
294
  run,
@@ -363,10 +321,10 @@ var RunGroup = memo2(
363
321
  if (!isStreaming) {
364
322
  return null;
365
323
  }
366
- return /* @__PURE__ */ jsx3(AssistantShell, { branding, isStreaming: true, children: /* @__PURE__ */ jsx3("div", { className: "flex items-center gap-2 px-0.5 py-0.5 text-sm text-[var(--text-muted)]", children: /* @__PURE__ */ jsxs3("span", { className: "flex gap-[5px]", children: [
367
- /* @__PURE__ */ jsx3("span", { className: "h-2 w-2 animate-bounce rounded-full bg-[var(--brand-glow)]", style: { animationDelay: "0ms" } }),
368
- /* @__PURE__ */ jsx3("span", { className: "h-2 w-2 animate-bounce rounded-full bg-[var(--brand-glow)]", style: { animationDelay: "150ms" } }),
369
- /* @__PURE__ */ jsx3("span", { className: "h-2 w-2 animate-bounce rounded-full bg-[var(--brand-glow)]", style: { animationDelay: "300ms" } })
324
+ return /* @__PURE__ */ jsx2(AssistantShell, { branding, isStreaming: true, children: /* @__PURE__ */ jsx2("div", { className: "flex items-center gap-2 px-0.5 py-0.5 text-sm text-[var(--text-muted)]", children: /* @__PURE__ */ jsxs2("span", { className: "flex gap-[5px]", children: [
325
+ /* @__PURE__ */ jsx2("span", { className: "h-2 w-2 animate-bounce rounded-full bg-[var(--brand-glow)]", style: { animationDelay: "0ms" } }),
326
+ /* @__PURE__ */ jsx2("span", { className: "h-2 w-2 animate-bounce rounded-full bg-[var(--brand-glow)]", style: { animationDelay: "150ms" } }),
327
+ /* @__PURE__ */ jsx2("span", { className: "h-2 w-2 animate-bounce rounded-full bg-[var(--brand-glow)]", style: { animationDelay: "300ms" } })
370
328
  ] }) }) });
371
329
  }
372
330
  const showTraceChrome = allParts.some(({ part }) => {
@@ -379,32 +337,32 @@ var RunGroup = memo2(
379
337
  return false;
380
338
  });
381
339
  if (!showTraceChrome) {
382
- return /* @__PURE__ */ jsx3(AssistantShell, { branding, isStreaming, children: allParts.map(({ part, msgId, index }) => {
340
+ return /* @__PURE__ */ jsx2(AssistantShell, { branding, isStreaming, children: allParts.map(({ part, msgId, index }) => {
383
341
  const key = `${msgId}-${index}`;
384
342
  if (part.type === "tool" && isOpenUITool(part)) {
385
343
  const toolPart = part;
386
344
  const schema = extractOpenUISchema(toolPart.state.output);
387
345
  const summary = getOpenUISummary(toolPart.state.output);
388
346
  if (toolPart.state.status === "completed" && schema) {
389
- return /* @__PURE__ */ jsxs3(
347
+ return /* @__PURE__ */ jsxs2(
390
348
  "div",
391
349
  {
392
350
  className: "overflow-hidden rounded-[22px] border border-[var(--border-subtle)] bg-[var(--bg-root)]",
393
351
  children: [
394
- summary ? /* @__PURE__ */ jsx3("div", { className: "border-b border-[var(--border-subtle)] px-4 py-3 text-sm leading-6 text-foreground", children: summary }) : null,
395
- /* @__PURE__ */ jsx3("div", { className: "p-4", children: /* @__PURE__ */ jsx3(OpenUIArtifactRenderer, { schema }) })
352
+ summary ? /* @__PURE__ */ jsx2("div", { className: "border-b border-[var(--border-subtle)] px-4 py-3 text-sm leading-6 text-foreground", children: summary }) : null,
353
+ /* @__PURE__ */ jsx2("div", { className: "p-4", children: /* @__PURE__ */ jsx2(OpenUIArtifactRenderer, { schema }) })
396
354
  ]
397
355
  },
398
356
  key
399
357
  );
400
358
  }
401
359
  if (toolPart.state.status === "running") {
402
- return /* @__PURE__ */ jsxs3(
360
+ return /* @__PURE__ */ jsxs2(
403
361
  "div",
404
362
  {
405
363
  className: "flex items-center gap-2 rounded-[18px] border border-[var(--border-subtle)] bg-[var(--bg-root)] px-4 py-3 text-sm text-muted-foreground",
406
364
  children: [
407
- /* @__PURE__ */ jsx3(Loader22, { className: "h-4 w-4 animate-spin text-primary" }),
365
+ /* @__PURE__ */ jsx2(Loader2, { className: "h-4 w-4 animate-spin text-primary" }),
408
366
  "Building view\u2026"
409
367
  ]
410
368
  },
@@ -413,85 +371,97 @@ var RunGroup = memo2(
413
371
  }
414
372
  }
415
373
  if (part.type === "text" && !part.synthetic && part.text.trim()) {
416
- return /* @__PURE__ */ jsx3("div", { className: "px-0.5", children: /* @__PURE__ */ jsx3(Markdown, { className: "tangle-prose text-[15px] leading-7 text-[var(--text-primary)]", children: part.text }) }, key);
374
+ return /* @__PURE__ */ jsx2("div", { className: "px-0.5", children: /* @__PURE__ */ jsx2(Markdown, { className: "tangle-prose text-[15px] leading-7 text-[var(--text-primary)]", children: part.text }) }, key);
417
375
  }
418
376
  return null;
419
377
  }) });
420
378
  }
421
- return /* @__PURE__ */ jsx3(
422
- AssistantRunShell,
423
- {
424
- label: branding.label,
425
- summary: renderSummary(run) || void 0,
426
- collapsedPreview: run.summaryText ?? void 0,
427
- badges: /* @__PURE__ */ jsx3(CategoryBadges, { categories: stats.toolCategories }),
428
- isStreaming,
429
- collapsed,
430
- onToggle,
431
- headerActions,
432
- children: allParts.map(({ part, msgId, index }, partIndex) => {
433
- const key = `${msgId}-${index}`;
434
- const prev = allParts[partIndex - 1]?.part;
435
- const connectedTool = part.type === "tool" && prev?.type === "tool" && !isOpenUITool(part) && !isOpenUITool(prev);
436
- const gapClass = partIndex === 0 ? "" : connectedTool ? "mt-px" : "mt-3";
437
- let node = null;
438
- if (part.type === "tool") {
439
- if (isOpenUITool(part)) {
440
- const toolPart = part;
441
- const schema = extractOpenUISchema(toolPart.state.output);
442
- const summary = getOpenUISummary(toolPart.state.output);
443
- if (toolPart.state.status === "completed" && schema) {
444
- node = /* @__PURE__ */ jsxs3("div", { className: "overflow-hidden rounded-[24px] border border-[var(--border-subtle)] bg-[var(--bg-card)]", children: [
445
- summary ? /* @__PURE__ */ jsxs3("div", { className: "border-b border-[var(--border-subtle)] px-4 py-3", children: [
446
- /* @__PURE__ */ jsx3("div", { className: "text-[11px] font-semibold uppercase tracking-[0.14em] text-muted-foreground", children: "View" }),
447
- /* @__PURE__ */ jsx3("div", { className: "mt-1 text-sm leading-6 text-foreground", children: summary })
448
- ] }) : null,
449
- /* @__PURE__ */ jsx3("div", { className: "p-4", children: /* @__PURE__ */ jsx3(OpenUIArtifactRenderer, { schema }) })
450
- ] });
451
- } else if (toolPart.state.status === "running") {
452
- node = /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3 rounded-[20px] border border-[var(--border-subtle)] bg-[var(--bg-card)] px-4 py-3 text-sm text-muted-foreground", children: [
453
- /* @__PURE__ */ jsx3(Loader22, { className: "h-4 w-4 animate-spin text-primary" }),
454
- "Building view\u2026"
455
- ] });
456
- }
457
- }
458
- if (node === null) {
459
- node = /* @__PURE__ */ jsx3(
460
- InlineToolItem,
461
- {
462
- part,
463
- renderToolDetail,
464
- groupPosition: getToolGroupPosition(partIndex, allParts),
465
- actions: renderToolActions?.(part, {
466
- run,
467
- messageId: msgId,
468
- partIndex: index
469
- })
470
- }
471
- );
379
+ const rows = allParts.filter(({ part }) => {
380
+ if (part.type === "tool" || part.type === "reasoning") return true;
381
+ return part.type === "text" && !part.synthetic && part.text.trim().length > 0;
382
+ });
383
+ const dotAccent = (part) => {
384
+ if (part.type === "reasoning") return "bg-[var(--brand-glow)]";
385
+ if (part.type === "text") return "bg-primary";
386
+ return "bg-[var(--border-hover)]";
387
+ };
388
+ return /* @__PURE__ */ jsx2(Collapsible2.Root, { open: !collapsed, onOpenChange: () => onToggle(), children: /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-1", children: [
389
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-2", children: [
390
+ /* @__PURE__ */ jsx2(Collapsible2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs2(
391
+ "button",
392
+ {
393
+ type: "button",
394
+ className: "group flex min-w-0 flex-1 items-center gap-2 rounded-md px-1 py-0.5 text-left transition-colors hover:bg-[var(--surface-container-high)]/40",
395
+ children: [
396
+ collapsed ? /* @__PURE__ */ jsx2(ChevronRight2, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ jsx2(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
397
+ /* @__PURE__ */ jsx2("span", { className: cn("font-semibold text-sm", branding.textClass), children: branding.label }),
398
+ renderSummary(run) ? /* @__PURE__ */ jsx2("span", { className: "text-[11px] text-muted-foreground", children: renderSummary(run) }) : null,
399
+ collapsed && run.summaryText ? /* @__PURE__ */ jsx2("span", { className: "min-w-0 truncate text-[11px] text-foreground/70", children: run.summaryText }) : null,
400
+ /* @__PURE__ */ jsxs2("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
401
+ /* @__PURE__ */ jsx2(CategoryBadges, { categories: stats.toolCategories }),
402
+ isStreaming ? /* @__PURE__ */ jsxs2("span", { className: "inline-flex items-center gap-1 rounded-full border border-[var(--border-accent)] bg-[var(--accent-surface-soft)] px-2 py-px text-[10px] font-semibold uppercase text-[var(--accent-text)]", children: [
403
+ /* @__PURE__ */ jsx2(Loader2, { className: "h-2.5 w-2.5 animate-spin" }),
404
+ "Running"
405
+ ] }) : /* @__PURE__ */ jsxs2("span", { className: "inline-flex items-center gap-1 rounded-full border border-border px-2 py-px text-[10px] font-semibold uppercase text-muted-foreground", children: [
406
+ /* @__PURE__ */ jsx2(Sparkles, { className: "h-2.5 w-2.5" }),
407
+ "Done"
408
+ ] })
409
+ ] })
410
+ ]
411
+ }
412
+ ) }),
413
+ headerActions ? /* @__PURE__ */ jsx2("div", { className: "flex shrink-0 flex-wrap items-center justify-end gap-1.5 pt-1", children: headerActions }) : null
414
+ ] }),
415
+ collapsed && run.summaryText ? /* @__PURE__ */ jsx2("div", { className: "line-clamp-2 pl-6 text-sm leading-6 text-muted-foreground", children: run.summaryText }) : null,
416
+ /* @__PURE__ */ jsx2(Collapsible2.Content, { className: "overflow-hidden data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp", children: /* @__PURE__ */ jsx2("div", { className: "pt-1.5", children: rows.map(({ part, msgId, index }, rowIndex) => {
417
+ const key = `${msgId}-${index}`;
418
+ const isLast = rowIndex === rows.length - 1;
419
+ let node = null;
420
+ if (part.type === "tool") {
421
+ if (isOpenUITool(part)) {
422
+ const toolPart = part;
423
+ const schema = extractOpenUISchema(toolPart.state.output);
424
+ const summary = getOpenUISummary(toolPart.state.output);
425
+ if (toolPart.state.status === "completed" && schema) {
426
+ node = /* @__PURE__ */ jsxs2("div", { className: "overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--bg-card)]", children: [
427
+ summary ? /* @__PURE__ */ jsx2("div", { className: "border-b border-[var(--border-subtle)] px-4 py-3 text-sm leading-6 text-foreground", children: summary }) : null,
428
+ /* @__PURE__ */ jsx2("div", { className: "p-4", children: /* @__PURE__ */ jsx2(OpenUIArtifactRenderer, { schema }) })
429
+ ] });
430
+ } else if (toolPart.state.status === "running") {
431
+ node = /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3 rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--bg-card)] px-4 py-3 text-sm text-muted-foreground", children: [
432
+ /* @__PURE__ */ jsx2(Loader2, { className: "h-4 w-4 animate-spin text-primary" }),
433
+ "Building view\u2026"
434
+ ] });
472
435
  }
473
- } else if (part.type === "reasoning") {
474
- node = /* @__PURE__ */ jsx3(
475
- InlineThinkingItem,
436
+ }
437
+ if (node === null) {
438
+ node = /* @__PURE__ */ jsx2(
439
+ InlineToolItem,
476
440
  {
477
441
  part,
478
- defaultOpen: isStreaming
442
+ renderToolDetail,
443
+ actions: renderToolActions?.(part, {
444
+ run,
445
+ messageId: msgId,
446
+ partIndex: index
447
+ })
479
448
  }
480
449
  );
481
- } else if (part.type === "text" && !part.synthetic && part.text.trim()) {
482
- node = /* @__PURE__ */ jsx3("div", { className: "px-1 py-1", children: /* @__PURE__ */ jsx3(Markdown, { className: "tangle-prose text-[15px] leading-7", children: part.text }) });
483
450
  }
484
- if (!node) return null;
485
- return /* @__PURE__ */ jsx3("div", { className: gapClass, children: node }, key);
486
- })
487
- }
488
- );
451
+ } else if (part.type === "reasoning") {
452
+ node = /* @__PURE__ */ jsx2(InlineThinkingItem, { part, defaultOpen: isStreaming });
453
+ } else if (part.type === "text" && !part.synthetic && part.text.trim()) {
454
+ node = /* @__PURE__ */ jsx2("div", { className: "px-1 py-0.5", children: /* @__PURE__ */ jsx2(Markdown, { className: "tangle-prose text-[15px] leading-7", children: part.text }) });
455
+ }
456
+ if (!node) return null;
457
+ return /* @__PURE__ */ jsx2(SpineRow, { accentClassName: dotAccent(part), isLast, children: node }, key);
458
+ }) }) })
459
+ ] }) });
489
460
  }
490
461
  );
491
462
  RunGroup.displayName = "RunGroup";
492
463
 
493
464
  export {
494
465
  InlineThinkingItem,
495
- AssistantRunShell,
496
466
  RunGroup
497
467
  };
@@ -318,9 +318,11 @@ function ToolCallStep({
318
318
  output,
319
319
  language,
320
320
  duration,
321
- className
321
+ className,
322
+ actions,
323
+ part
322
324
  }) {
323
- const part = {
325
+ const resolvedPart = part ?? {
324
326
  type: "tool",
325
327
  id: `${type}:${label}`,
326
328
  tool: type,
@@ -335,11 +337,12 @@ function ToolCallStep({
335
337
  return /* @__PURE__ */ jsx4(
336
338
  InlineToolItem,
337
339
  {
338
- part,
340
+ part: resolvedPart,
339
341
  title: label,
340
342
  description: detail,
341
343
  className,
342
- renderToolDetail: output ? () => /* @__PURE__ */ jsx4(
344
+ actions,
345
+ renderToolDetail: part ? void 0 : output ? () => /* @__PURE__ */ jsx4(
343
346
  CodeBlock,
344
347
  {
345
348
  code: output,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ToolCallGroup,
3
3
  ToolCallStep
4
- } from "./chunk-RKQDBRTC.js";
4
+ } from "./chunk-J6RQHBHR.js";
5
5
  import {
6
6
  Markdown
7
7
  } from "./chunk-FJBTCTZM.js";
package/dist/hooks.js CHANGED
@@ -11,15 +11,15 @@ import {
11
11
  useSSEStream,
12
12
  useSdkSession,
13
13
  useToolCallStream
14
- } from "./chunk-DLSGUNRD.js";
14
+ } from "./chunk-A5HKP3NA.js";
15
15
  import "./chunk-OEX7NZE3.js";
16
16
  import {
17
17
  useAutoScroll,
18
18
  useRunCollapseState,
19
19
  useRunGroups
20
20
  } from "./chunk-AZWDI2JG.js";
21
- import "./chunk-IWQZXL6A.js";
22
- import "./chunk-RKQDBRTC.js";
21
+ import "./chunk-N5DJ4TUO.js";
22
+ import "./chunk-J6RQHBHR.js";
23
23
  import "./chunk-ULDNFLIM.js";
24
24
  import "./chunk-AAUNOHVL.js";
25
25
  import "./chunk-ZRVH3WCA.js";
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { Avatar, AvatarFallback, AvatarImage, Badge, BadgeProps, Card, CardConte
3
3
  export { Logo, LogoProps, TangleKnot } from '@tangle-network/brand';
4
4
  export { A as ArtifactPane, a as ArtifactPaneProps } from './artifact-pane-DvJyPWV4.js';
5
5
  export { AgentTimeline, AgentTimelineArtifactItem, AgentTimelineCustomItem, AgentTimelineItem, AgentTimelineMessageItem, AgentTimelineProps, AgentTimelineStatusItem, AgentTimelineTone, AgentTimelineToolGroupItem, AgentTimelineToolItem, ChatContainer, ChatContainerProps, ChatMessage, ChatMessageProps, MessageList, MessageListProps, MessageRole, ThinkingIndicator, ThinkingIndicatorProps, UserMessage, UserMessageProps } from './chat.js';
6
- export { AssistantRunShell, AssistantRunShellProps, ExpandedToolDetail, ExpandedToolDetailProps, InlineThinkingItem, InlineThinkingItemProps, InlineToolItem, InlineToolItemProps, LiveDuration, RunGroup, RunGroupProps } from './run.js';
6
+ export { ExpandedToolDetail, ExpandedToolDetailProps, InlineThinkingItem, InlineThinkingItemProps, InlineToolItem, InlineToolItemProps, LiveDuration, RunGroup, RunGroupProps } from './run.js';
7
7
  export { F as FeedSegment, T as ToolCallData, a as ToolCallFeed, b as ToolCallFeedProps, c as ToolCallStatus, d as ToolCallType, p as parseToolEvent } from './tool-call-feed-D9iofJgW.js';
8
8
  export { OpenUIAction, OpenUIActionsNode, OpenUIArtifactRenderer, OpenUIArtifactRendererProps, OpenUIBadgeNode, OpenUICardNode, OpenUICodeNode, OpenUIComponentNode, OpenUIGridNode, OpenUIHeadingNode, OpenUIKeyValueNode, OpenUIMarkdownNode, OpenUIPrimitive, OpenUISeparatorNode, OpenUIStackNode, OpenUIStatNode, OpenUITableNode, OpenUITextNode } from './openui.js';
9
9
  export { FileArtifactPane, FileArtifactPaneProps, FileFormat, FileNode, FilePreview, FilePreviewProps, FileTabData, FileTabs, FileTabsProps, FileTree, FileTreeProps, FileTreeVisibilityOptions, RichFileTree, RichFileTreeGitEntry, RichFileTreeGitStatus, RichFileTreeProps, RichFileTreeThemeVars, detectFileFormat, fileExtension, filterFileTree, getCodeLanguage, getFormatLabel, getSyntaxLanguage } from './files.js';
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  useSSEStream,
18
18
  useSdkSession,
19
19
  useToolCallStream
20
- } from "./chunk-DLSGUNRD.js";
20
+ } from "./chunk-A5HKP3NA.js";
21
21
  import {
22
22
  addMessage,
23
23
  addParts,
@@ -137,27 +137,26 @@ import {
137
137
  MessageList,
138
138
  ThinkingIndicator,
139
139
  UserMessage
140
- } from "./chunk-QUAU6ZNC.js";
140
+ } from "./chunk-4RDW4GFG.js";
141
141
  import {
142
142
  useAutoScroll,
143
143
  useRunCollapseState,
144
144
  useRunGroups
145
145
  } from "./chunk-AZWDI2JG.js";
146
- import "./chunk-LQS34IGP.js";
146
+ import "./chunk-47XH56SV.js";
147
147
  import {
148
148
  ToolCallFeed,
149
149
  parseToolEvent
150
- } from "./chunk-IWQZXL6A.js";
150
+ } from "./chunk-N5DJ4TUO.js";
151
151
  import {
152
- AssistantRunShell,
153
152
  InlineThinkingItem,
154
153
  RunGroup
155
- } from "./chunk-C3BIVG72.js";
154
+ } from "./chunk-CVXAXVYZ.js";
156
155
  import {
157
156
  ExpandedToolDetail,
158
157
  InlineToolItem,
159
158
  LiveDuration
160
- } from "./chunk-RKQDBRTC.js";
159
+ } from "./chunk-J6RQHBHR.js";
161
160
  import {
162
161
  TOOL_CATEGORY_ICONS,
163
162
  formatBytes,
@@ -339,7 +338,6 @@ function RedactedDocument({
339
338
  export {
340
339
  AgentTimeline,
341
340
  ArtifactPane,
342
- AssistantRunShell,
343
341
  AuthHeader,
344
342
  Avatar,
345
343
  AvatarFallback,
package/dist/run.d.ts CHANGED
@@ -28,34 +28,6 @@ interface RunGroupProps {
28
28
  */
29
29
  declare const RunGroup: React.MemoExoticComponent<({ run, partMap, collapsed, onToggle, branding, renderToolDetail, headerActions, renderToolActions, }: RunGroupProps) => react_jsx_runtime.JSX.Element | null>;
30
30
 
31
- interface AssistantRunShellProps {
32
- /** Header label, e.g. the agent name or "Tools". */
33
- label: string;
34
- /** Terse stat line beside the label, e.g. "3 tools, 2s thinking". */
35
- summary?: string;
36
- /** One-line preview shown next to the label AND below the header when collapsed. */
37
- collapsedPreview?: string;
38
- /** Small trailing glyphs before the status pill (e.g. category badges). */
39
- badges?: ReactNode;
40
- /** Drives the status pill and header spinner. */
41
- isStreaming?: boolean;
42
- collapsed: boolean;
43
- onToggle: () => void;
44
- /** Actions rendered outside the collapse trigger, right of the header. */
45
- headerActions?: ReactNode;
46
- children: ReactNode;
47
- className?: string;
48
- }
49
- /**
50
- * The collapsible "assistant run" container shared by `RunGroup` (session-model
51
- * driven) and `AgentTimeline` (declarative item list). Owns the header
52
- * (label · summary · badges · status pill · chevron), the collapsed preview, and
53
- * the Radix collapse — so both transcripts fold agent activity the same way and
54
- * there is one implementation of a run, not two. It renders only chrome; callers
55
- * pass the run body (tool rows, reasoning, text) as `children`.
56
- */
57
- declare function AssistantRunShell({ label, summary, collapsedPreview, badges, isStreaming, collapsed, onToggle, headerActions, children, className, }: AssistantRunShellProps): react_jsx_runtime.JSX.Element;
58
-
59
31
  interface InlineToolItemProps {
60
32
  part: ToolPart;
61
33
  renderToolDetail?: CustomToolRenderer;
@@ -98,4 +70,4 @@ declare function LiveDuration({ startTime }: {
98
70
  startTime: number;
99
71
  }): react_jsx_runtime.JSX.Element;
100
72
 
101
- export { AssistantRunShell, type AssistantRunShellProps, ExpandedToolDetail, type ExpandedToolDetailProps, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, LiveDuration, RunGroup, type RunGroupProps };
73
+ export { ExpandedToolDetail, type ExpandedToolDetailProps, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, LiveDuration, RunGroup, type RunGroupProps };
package/dist/run.js CHANGED
@@ -1,18 +1,17 @@
1
- import "./chunk-LQS34IGP.js";
1
+ import "./chunk-47XH56SV.js";
2
2
  import {
3
3
  ToolCallFeed,
4
4
  parseToolEvent
5
- } from "./chunk-IWQZXL6A.js";
5
+ } from "./chunk-N5DJ4TUO.js";
6
6
  import {
7
- AssistantRunShell,
8
7
  InlineThinkingItem,
9
8
  RunGroup
10
- } from "./chunk-C3BIVG72.js";
9
+ } from "./chunk-CVXAXVYZ.js";
11
10
  import {
12
11
  ExpandedToolDetail,
13
12
  InlineToolItem,
14
13
  LiveDuration
15
- } from "./chunk-RKQDBRTC.js";
14
+ } from "./chunk-J6RQHBHR.js";
16
15
  import "./chunk-ULDNFLIM.js";
17
16
  import "./chunk-AAUNOHVL.js";
18
17
  import "./chunk-52Y3FMFI.js";
@@ -23,7 +22,6 @@ import "./chunk-FJBTCTZM.js";
23
22
  import "./chunk-WUQDUBJG.js";
24
23
  import "./chunk-RQHJBTEU.js";
25
24
  export {
26
- AssistantRunShell,
27
25
  ExpandedToolDetail,
28
26
  InlineThinkingItem,
29
27
  InlineToolItem,
package/dist/sdk-hooks.js CHANGED
@@ -5,15 +5,15 @@ import {
5
5
  useSSEStream,
6
6
  useSdkSession,
7
7
  useToolCallStream
8
- } from "./chunk-DLSGUNRD.js";
8
+ } from "./chunk-A5HKP3NA.js";
9
9
  import "./chunk-OEX7NZE3.js";
10
10
  import {
11
11
  useAutoScroll,
12
12
  useRunCollapseState,
13
13
  useRunGroups
14
14
  } from "./chunk-AZWDI2JG.js";
15
- import "./chunk-IWQZXL6A.js";
16
- import "./chunk-RKQDBRTC.js";
15
+ import "./chunk-N5DJ4TUO.js";
16
+ import "./chunk-J6RQHBHR.js";
17
17
  import "./chunk-ULDNFLIM.js";
18
18
  import "./chunk-AAUNOHVL.js";
19
19
  import "./chunk-ZRVH3WCA.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/ui",
3
- "version": "8.1.0",
3
+ "version": "9.1.0",
4
4
  "description": "Generic React UI components for Tangle products — primitives, chat, run, files, editor, markdown.",
5
5
  "type": "module",
6
6
  "license": "MIT",