@tangle-network/ui 11.11.8 → 11.13.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.
- package/CHANGELOG.md +24 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/auth/auth.d.ts +53 -0
- package/dist/{auth-DOETfnd9.js → auth/auth.js} +7 -37
- package/dist/auth/login-layout.d.ts +20 -0
- package/dist/auth/login-layout.js +36 -0
- package/dist/auth.d.ts +2 -1
- package/dist/auth.js +2 -1
- package/dist/chat/agent-timeline.d.ts +83 -0
- package/dist/chat/agent-timeline.js +236 -0
- package/dist/chat/chat-container.d.ts +51 -0
- package/dist/chat/chat-container.js +309 -0
- package/dist/chat/chat-message.d.ts +22 -0
- package/dist/chat/chat-message.js +38 -0
- package/dist/chat/message-list.d.ts +32 -0
- package/dist/chat/message-list.js +37 -0
- package/dist/chat/thinking-indicator.d.ts +6 -0
- package/dist/chat/thinking-indicator.js +38 -0
- package/dist/chat/user-message.d.ts +21 -0
- package/dist/chat/user-message.js +42 -0
- package/dist/chat.d.ts +6 -1
- package/dist/chat.js +6 -1
- package/dist/editor/document-editor-pane.d.ts +37 -0
- package/dist/editor/document-editor-pane.js +199 -0
- package/dist/editor/editor-lazy.js +37 -0
- package/dist/editor/editor-loading.js +21 -0
- package/dist/editor/editor-peers.d.ts +6 -0
- package/dist/editor/editor-peers.js +155 -0
- package/dist/{document-editor-pane-DHM8DDhb.d.ts → editor/editor-provider.d.ts} +10 -47
- package/dist/editor/editor-provider.js +253 -0
- package/dist/editor/editor-toolbar.d.ts +11 -0
- package/dist/editor/editor-toolbar.js +106 -0
- package/dist/editor/markdown-conversion.js +23 -0
- package/dist/editor/markdown-document-editor.js +103 -0
- package/dist/editor/tiptap-editor.d.ts +45 -0
- package/dist/editor/tiptap-editor.js +271 -0
- package/dist/editor/use-editor.d.ts +67 -0
- package/dist/editor/use-editor.js +158 -0
- package/dist/editor.d.ts +6 -119
- package/dist/editor.js +5 -1
- package/dist/files/file-artifact-pane.d.ts +47 -0
- package/dist/files/file-artifact-pane.js +114 -0
- package/dist/files/file-format.d.ts +51 -0
- package/dist/{file-format-BgXbr-Ib.js → files/file-format.js} +1 -1
- package/dist/files/file-preview.d.ts +27 -0
- package/dist/files/file-preview.js +359 -0
- package/dist/files/file-tabs.d.ts +19 -0
- package/dist/files/file-tabs.js +48 -0
- package/dist/files/file-tree.d.ts +31 -0
- package/dist/files/file-tree.js +135 -0
- package/dist/files/rich-file-tree.d.ts +62 -0
- package/dist/files/rich-file-tree.js +122 -0
- package/dist/files.d.ts +6 -1
- package/dist/files.js +6 -2
- package/dist/hooks/use-auth.d.ts +40 -0
- package/dist/hooks/use-auth.js +91 -0
- package/dist/hooks/use-auto-scroll.d.ts +11 -0
- package/dist/hooks/use-auto-scroll.js +48 -0
- package/dist/hooks/use-dropdown-menu.d.ts +12 -0
- package/dist/hooks/use-dropdown-menu.js +31 -0
- package/dist/hooks/use-live-time.d.ts +7 -0
- package/dist/hooks/use-live-time.js +22 -0
- package/dist/hooks/use-realtime-session.d.ts +32 -0
- package/dist/hooks/use-realtime-session.js +235 -0
- package/dist/hooks/use-run-collapse-state.d.ts +13 -0
- package/dist/hooks/use-run-collapse-state.js +24 -0
- package/dist/hooks/use-run-groups.d.ts +11 -0
- package/dist/hooks/use-run-groups.js +85 -0
- package/dist/hooks/use-sdk-session.d.ts +59 -0
- package/dist/hooks/use-sdk-session.js +322 -0
- package/dist/hooks/use-sse-stream.d.ts +124 -0
- package/dist/hooks/use-sse-stream.js +229 -0
- package/dist/hooks/use-tool-call-stream.d.ts +23 -0
- package/dist/hooks/use-tool-call-stream.js +75 -0
- package/dist/hooks.d.ts +11 -49
- package/dist/hooks.js +10 -110
- package/dist/index.d.ts +99 -25
- package/dist/index.js +86 -36
- package/dist/lib/focus.d.ts +55 -0
- package/dist/{focus-BcE_SHqz.js → lib/focus.js} +1 -1
- package/dist/lib/utils.d.ts +4 -0
- package/dist/{utils-C_uf36nf.js → lib/utils.js} +1 -1
- package/dist/{code-block-B9miUPht.d.ts → markdown/code-block.d.ts} +5 -6
- package/dist/{code-block-B36KVUSN.js → markdown/code-block.js} +22 -47
- package/dist/{markdown-C0atSabr.d.ts → markdown/markdown.d.ts} +4 -5
- package/dist/{markdown-Db08KAYF.js → markdown/markdown.js} +3 -3
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +2 -2
- package/dist/{openui-artifact-renderer-fkBQaoLO.d.ts → openui/openui-artifact-renderer.d.ts} +20 -21
- package/dist/{openui-artifact-renderer-DG_i2lOR.js → openui/openui-artifact-renderer.js} +9 -7
- package/dist/{schema-BpW9rSSG.js → openui/schema-compiled.js} +2 -354
- package/dist/{schema-DAstk-J4.d.ts → openui/schema-data.d.ts} +3 -24
- package/dist/openui/schema-data.js +206 -0
- package/dist/openui-schema.d.ts +22 -3
- package/dist/openui-schema.js +138 -1
- package/dist/openui.d.ts +3 -2
- package/dist/openui.js +3 -2
- package/dist/{artifact-pane-BL_DFWNl.d.ts → primitives/artifact-pane.d.ts} +3 -4
- package/dist/{artifact-pane-DMXT9a8U.js → primitives/artifact-pane.js} +2 -2
- package/dist/primitives/avatar.d.ts +8 -0
- package/dist/primitives/avatar.js +25 -0
- package/dist/primitives/badge.d.ts +22 -0
- package/dist/primitives/badge.js +47 -0
- package/dist/{button-yoIv77e2.d.ts → primitives/button.d.ts} +2 -2
- package/dist/primitives/button.js +113 -0
- package/dist/primitives/card.d.ts +18 -0
- package/dist/primitives/card.js +52 -0
- package/dist/primitives/code-block.d.ts +6 -0
- package/dist/primitives/code-block.js +13 -0
- package/dist/primitives/dialog.d.ts +23 -0
- package/dist/primitives/dialog.js +59 -0
- package/dist/primitives/drop-zone.d.ts +23 -0
- package/dist/primitives/drop-zone.js +104 -0
- package/dist/primitives/dropdown-menu.d.ts +29 -0
- package/dist/{dropdown-menu-BpcLa5vF.js → primitives/dropdown-menu.js} +2 -23
- package/dist/primitives/empty-state.d.ts +11 -0
- package/dist/primitives/empty-state.js +32 -0
- package/dist/primitives/heading.d.ts +23 -0
- package/dist/primitives/heading.js +38 -0
- package/dist/primitives/input.d.ts +23 -0
- package/dist/primitives/input.js +110 -0
- package/dist/primitives/label.d.ts +6 -0
- package/dist/primitives/label.js +16 -0
- package/dist/primitives/metric-strip.d.ts +48 -0
- package/dist/primitives/metric-strip.js +52 -0
- package/dist/primitives/page-header.d.ts +25 -0
- package/dist/primitives/page-header.js +47 -0
- package/dist/primitives/page-shell.d.ts +14 -0
- package/dist/primitives/page-shell.js +17 -0
- package/dist/primitives/progress.d.ts +9 -0
- package/dist/primitives/progress.js +29 -0
- package/dist/primitives/segmented-control.d.ts +40 -0
- package/dist/primitives/segmented-control.js +57 -0
- package/dist/primitives/select.d.ts +15 -0
- package/dist/primitives/select.js +74 -0
- package/dist/primitives/sidebar-drop-zone.d.ts +21 -0
- package/dist/primitives/sidebar-drop-zone.js +88 -0
- package/dist/primitives/skeleton.d.ts +10 -0
- package/dist/primitives/skeleton.js +50 -0
- package/dist/primitives/stat-card.d.ts +16 -0
- package/dist/primitives/stat-card.js +60 -0
- package/dist/primitives/status-pill.d.ts +44 -0
- package/dist/primitives/status-pill.js +119 -0
- package/dist/primitives/switch.d.ts +6 -0
- package/dist/primitives/switch.js +16 -0
- package/dist/primitives/table.d.ts +22 -0
- package/dist/primitives/table.js +63 -0
- package/dist/primitives/tabs.d.ts +13 -0
- package/dist/{tabs-BVHR6NkO.js → primitives/tabs.js} +3 -3
- package/dist/primitives/terminal-display.d.ts +25 -0
- package/dist/primitives/terminal-display.js +109 -0
- package/dist/primitives/text-shimmer.d.ts +16 -0
- package/dist/{text-shimmer-BUUo6I-g.js → primitives/text-shimmer.js} +2 -2
- package/dist/primitives/theme-toggle.d.ts +11 -0
- package/dist/primitives/theme-toggle.js +154 -0
- package/dist/primitives/toast.d.ts +29 -0
- package/dist/primitives/toast.js +142 -0
- package/dist/primitives/toolbar.d.ts +55 -0
- package/dist/primitives/toolbar.js +37 -0
- package/dist/primitives/upload-progress.d.ts +23 -0
- package/dist/primitives/upload-progress.js +72 -0
- package/dist/primitives.d.ts +35 -5
- package/dist/primitives.js +35 -9
- package/dist/{index-COgqsFAQ.d.ts → redaction/redacted-document.d.ts} +6 -7
- package/dist/{redaction-CGGB2ENG.js → redaction/redacted-document.js} +2 -2
- package/dist/redaction.d.ts +1 -1
- package/dist/redaction.js +1 -1
- package/dist/run/expandable-content.js +41 -0
- package/dist/run/expanded-tool-detail.d.ts +12 -0
- package/dist/run/expanded-tool-detail.js +163 -0
- package/dist/run/inline-thinking-item.d.ts +11 -0
- package/dist/run/inline-thinking-item.js +60 -0
- package/dist/run/inline-tool-item.d.ts +25 -0
- package/dist/run/inline-tool-item.js +63 -0
- package/dist/run/run-group.d.ts +26 -0
- package/dist/{run-group-BWGeesgs.js → run/run-group.js} +9 -60
- package/dist/run/run-item-primitives.d.ts +5 -0
- package/dist/{run-ZsIKPA6J.js → run/run-item-primitives.js} +2 -2
- package/dist/run/run-row-shell.d.ts +53 -0
- package/dist/run/run-row-shell.js +114 -0
- package/dist/{tool-call-feed-BeB1_4pX.d.ts → run/tool-call-feed.d.ts} +7 -12
- package/dist/{tool-call-feed-BpmMLpPX.js → run/tool-call-feed.js} +4 -4
- package/dist/run/tool-call-step.d.ts +5 -0
- package/dist/run/tool-call-step.js +82 -0
- package/dist/run.d.ts +8 -2
- package/dist/run.js +7 -4
- package/dist/sdk-hooks.d.ts +8 -1
- package/dist/sdk-hooks.js +8 -2
- package/dist/stores/active-sessions-store.d.ts +83 -0
- package/dist/{active-sessions-store-Gt1R0rFG.js → stores/active-sessions-store.js} +1 -1
- package/dist/stores/chat-store.d.ts +14 -0
- package/dist/stores/chat-store.js +33 -0
- package/dist/stores.d.ts +3 -16
- package/dist/stores.js +2 -33
- package/dist/tool-previews/command-preview.d.ts +11 -0
- package/dist/tool-previews/command-preview.js +91 -0
- package/dist/tool-previews/diff-preview.d.ts +7 -0
- package/dist/tool-previews/diff-preview.js +76 -0
- package/dist/tool-previews/glob-results-preview.d.ts +7 -0
- package/dist/tool-previews/glob-results-preview.js +53 -0
- package/dist/tool-previews/grep-results-preview.d.ts +7 -0
- package/dist/tool-previews/grep-results-preview.js +99 -0
- package/dist/tool-previews/preview-primitives.js +58 -0
- package/dist/tool-previews/question-preview.d.ts +7 -0
- package/dist/tool-previews/question-preview.js +63 -0
- package/dist/tool-previews/web-search-preview.d.ts +7 -0
- package/dist/tool-previews/web-search-preview.js +78 -0
- package/dist/tool-previews/write-file-preview.d.ts +11 -0
- package/dist/tool-previews/write-file-preview.js +52 -0
- package/dist/tool-previews.d.ts +7 -1
- package/dist/tool-previews.js +7 -1
- package/dist/{branding-26d5ARIr.d.ts → types/branding.d.ts} +2 -3
- package/dist/{message-vhUI0c5G.d.ts → types/message.d.ts} +2 -3
- package/dist/{parts-5mhy9yJ3.d.ts → types/parts.d.ts} +8 -9
- package/dist/{run-OyWmIDqu.d.ts → types/run.d.ts} +9 -10
- package/dist/{tool-display-DgmL5rIU.d.ts → types/tool-display.d.ts} +5 -6
- package/dist/types.d.ts +5 -5
- package/dist/utils/copy-text.d.ts +7 -0
- package/dist/{utils-Bl_CZ0Qp.js → utils/copy-text.js} +1 -11
- package/dist/utils/format.d.ts +22 -0
- package/dist/{format-DfcLWqMa.js → utils/format.js} +1 -1
- package/dist/utils/time-ago.d.ts +3 -0
- package/dist/utils/time-ago.js +11 -0
- package/dist/utils/tool-display.d.ts +16 -0
- package/dist/{tool-display-BAuAVa43.js → utils/tool-display.js} +1 -1
- package/dist/utils.d.ts +6 -1
- package/dist/utils.js +6 -5
- package/package.json +2 -2
- package/src/editor/document-editor-pane.tsx +4 -1
- package/src/files/file-artifact-pane.test.tsx +23 -0
- package/src/files/file-artifact-pane.tsx +3 -0
- package/src/files/rich-file-tree.stories.tsx +1 -1
- package/src/files/rich-file-tree.tsx +12 -9
- package/src/markdown/code-block.test.tsx +46 -2
- package/src/markdown/code-block.tsx +23 -60
- package/src/markdown/markdown.test.tsx +3 -2
- package/src/primitives/button.stories.tsx +37 -1
- package/src/primitives/button.test.tsx +230 -0
- package/src/primitives/button.tsx +62 -14
- package/src/primitives/card-anatomy.stories.tsx +51 -0
- package/src/primitives/card.test.tsx +71 -0
- package/src/primitives/card.tsx +25 -13
- package/src/primitives/heading.stories.tsx +35 -0
- package/src/primitives/heading.test.tsx +56 -0
- package/src/primitives/heading.tsx +76 -0
- package/src/primitives/index.ts +8 -0
- package/src/primitives/input.stories.tsx +28 -0
- package/src/primitives/input.test.tsx +161 -0
- package/src/primitives/input.tsx +34 -28
- package/src/primitives/page-header.stories.tsx +51 -0
- package/src/primitives/page-header.test.tsx +48 -0
- package/src/primitives/page-header.tsx +35 -35
- package/src/primitives/page-shell.stories.tsx +89 -0
- package/src/primitives/page-shell.test.tsx +24 -0
- package/src/primitives/page-shell.tsx +26 -0
- package/src/primitives/table-wrapper.stories.tsx +54 -0
- package/src/primitives/table.test.tsx +72 -0
- package/src/primitives/table.tsx +33 -12
- package/src/primitives/theme-toggle.test.tsx +167 -0
- package/src/primitives/theme-toggle.tsx +111 -39
- package/dist/active-sessions-store-nl70ZnMC.d.ts +0 -84
- package/dist/button-C87nEe2R.js +0 -78
- package/dist/chat-DDvF2oGQ.js +0 -672
- package/dist/diff-preview-BcK3nRXb.js +0 -533
- package/dist/document-editor-pane-CsFbH2qo.js +0 -1279
- package/dist/files--Unn___t.js +0 -752
- package/dist/index-2UntyjBb.d.ts +0 -52
- package/dist/index-BgUHilZm.d.ts +0 -108
- package/dist/index-CPDET_s1.d.ts +0 -549
- package/dist/index-Cg6gYAqh.d.ts +0 -73
- package/dist/index-Cs7j8V7l.d.ts +0 -203
- package/dist/index-CyGSLGVF.d.ts +0 -234
- package/dist/index-DjKxO357.d.ts +0 -128
- package/dist/primitives-Bx59fT-U.js +0 -1239
- package/dist/table-Bss73DhB.js +0 -146
- package/dist/tool-call-step-DNebqhmX.js +0 -434
- package/dist/use-auto-scroll-C5Pjeqon.js +0 -153
- package/dist/use-sse-stream-DjqRuDft.js +0 -884
- package/dist/use-sse-stream-Dm6R5YWz.d.ts +0 -282
package/dist/table-Bss73DhB.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { i as focusRing } from "./focus-BcE_SHqz.js";
|
|
2
|
-
import { t as cn } from "./utils-C_uf36nf.js";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
//#region src/primitives/card.tsx
|
|
7
|
-
const Card = React.forwardRef(({ className, variant = "default", hover = false, ...props }, ref) => {
|
|
8
|
-
return /* @__PURE__ */ jsx("div", {
|
|
9
|
-
ref,
|
|
10
|
-
className: cn("rounded-[var(--radius-lg)] border text-card-foreground transition-[border-color,box-shadow]", "duration-[var(--transition-default)]", {
|
|
11
|
-
default: "bg-card border-border",
|
|
12
|
-
elevated: "bg-muted/50 border-border shadow-[var(--shadow-card)]",
|
|
13
|
-
glass: "bg-card/80 backdrop-blur-xl border-border shadow-[var(--shadow-card)]",
|
|
14
|
-
sandbox: "bg-muted/50 border-primary/20 shadow-[var(--shadow-accent)]"
|
|
15
|
-
}[variant], hover && "cursor-pointer hover:border-[var(--border-strong)]", className),
|
|
16
|
-
...props
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
Card.displayName = "Card";
|
|
20
|
-
const CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
21
|
-
ref,
|
|
22
|
-
className: cn("flex flex-col space-y-1 p-4", className),
|
|
23
|
-
...props
|
|
24
|
-
}));
|
|
25
|
-
CardHeader.displayName = "CardHeader";
|
|
26
|
-
const CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("h3", {
|
|
27
|
-
ref,
|
|
28
|
-
className: cn("font-semibold leading-none tracking-tight", className),
|
|
29
|
-
...props
|
|
30
|
-
}));
|
|
31
|
-
CardTitle.displayName = "CardTitle";
|
|
32
|
-
const CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", {
|
|
33
|
-
ref,
|
|
34
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
35
|
-
...props
|
|
36
|
-
}));
|
|
37
|
-
CardDescription.displayName = "CardDescription";
|
|
38
|
-
const CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
39
|
-
ref,
|
|
40
|
-
className: cn("p-4 pt-0", className),
|
|
41
|
-
...props
|
|
42
|
-
}));
|
|
43
|
-
CardContent.displayName = "CardContent";
|
|
44
|
-
const CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
45
|
-
ref,
|
|
46
|
-
className: cn("flex items-center p-6 pt-0", className),
|
|
47
|
-
...props
|
|
48
|
-
}));
|
|
49
|
-
CardFooter.displayName = "CardFooter";
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/primitives/badge.tsx
|
|
52
|
-
const badgeVariants = cva(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 font-medium text-xs transition-colors ${focusRing}`, {
|
|
53
|
-
variants: { variant: {
|
|
54
|
-
default: "border-transparent bg-primary text-primary-foreground",
|
|
55
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
|
56
|
-
destructive: "border-transparent bg-destructive/15 border-destructive/25 text-destructive",
|
|
57
|
-
outline: "text-foreground border-border",
|
|
58
|
-
success: "border-[var(--surface-success-border)] bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]",
|
|
59
|
-
warning: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
60
|
-
error: "border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] text-[var(--surface-danger-text)]",
|
|
61
|
-
info: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
62
|
-
sandbox: "border-border bg-[var(--accent-surface-soft)] text-[var(--accent-text)]",
|
|
63
|
-
running: "border-[var(--surface-teal-border)] bg-[var(--surface-teal-bg)] text-[var(--surface-teal-text)]",
|
|
64
|
-
creating: "border-[var(--surface-violet-border)] bg-[var(--surface-violet-bg)] text-[var(--surface-violet-text)]",
|
|
65
|
-
stopped: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
66
|
-
warm: "border-[var(--surface-orange-border)] bg-[var(--surface-orange-bg)] text-[var(--surface-orange-text)]",
|
|
67
|
-
cold: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
68
|
-
deleted: "border-[var(--surface-neutral-border)] bg-[var(--surface-neutral-bg)] text-[var(--surface-neutral-text)]"
|
|
69
|
-
} },
|
|
70
|
-
defaultVariants: { variant: "default" }
|
|
71
|
-
});
|
|
72
|
-
const statusDotClass = {
|
|
73
|
-
running: "status-dot status-dot-running",
|
|
74
|
-
creating: "status-dot status-dot-creating",
|
|
75
|
-
stopped: "status-dot status-dot-stopped",
|
|
76
|
-
warm: "status-dot status-dot-warm",
|
|
77
|
-
cold: "status-dot status-dot-cold",
|
|
78
|
-
error: "status-dot status-dot-error",
|
|
79
|
-
deleted: "status-dot status-dot-deleted"
|
|
80
|
-
};
|
|
81
|
-
function Badge({ className, variant, dot, children, ...props }) {
|
|
82
|
-
const dotClass = dot && variant ? statusDotClass[variant] : null;
|
|
83
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
84
|
-
className: cn(badgeVariants({ variant }), className),
|
|
85
|
-
...props,
|
|
86
|
-
children: [dotClass && /* @__PURE__ */ jsx("span", {
|
|
87
|
-
className: dotClass,
|
|
88
|
-
"aria-hidden": true
|
|
89
|
-
}), children]
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/primitives/table.tsx
|
|
94
|
-
const Table = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
95
|
-
className: "relative w-full overflow-auto",
|
|
96
|
-
children: /* @__PURE__ */ jsx("table", {
|
|
97
|
-
ref,
|
|
98
|
-
className: cn("w-full caption-bottom text-sm", className),
|
|
99
|
-
...props
|
|
100
|
-
})
|
|
101
|
-
}));
|
|
102
|
-
Table.displayName = "Table";
|
|
103
|
-
const TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", {
|
|
104
|
-
ref,
|
|
105
|
-
className: cn("[&_tr]:border-b", className),
|
|
106
|
-
...props
|
|
107
|
-
}));
|
|
108
|
-
TableHeader.displayName = "TableHeader";
|
|
109
|
-
const TableBody = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", {
|
|
110
|
-
ref,
|
|
111
|
-
className: cn("[&_tr:last-child]:border-0", className),
|
|
112
|
-
...props
|
|
113
|
-
}));
|
|
114
|
-
TableBody.displayName = "TableBody";
|
|
115
|
-
const TableFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tfoot", {
|
|
116
|
-
ref,
|
|
117
|
-
className: cn("border-t bg-card font-medium [&>tr]:last:border-b-0", className),
|
|
118
|
-
...props
|
|
119
|
-
}));
|
|
120
|
-
TableFooter.displayName = "TableFooter";
|
|
121
|
-
const TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", {
|
|
122
|
-
ref,
|
|
123
|
-
className: cn("border-border border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted/50", className),
|
|
124
|
-
...props
|
|
125
|
-
}));
|
|
126
|
-
TableRow.displayName = "TableRow";
|
|
127
|
-
const TableHead = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("th", {
|
|
128
|
-
ref,
|
|
129
|
-
className: cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
130
|
-
...props
|
|
131
|
-
}));
|
|
132
|
-
TableHead.displayName = "TableHead";
|
|
133
|
-
const TableCell = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("td", {
|
|
134
|
-
ref,
|
|
135
|
-
className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
|
|
136
|
-
...props
|
|
137
|
-
}));
|
|
138
|
-
TableCell.displayName = "TableCell";
|
|
139
|
-
const TableCaption = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", {
|
|
140
|
-
ref,
|
|
141
|
-
className: cn("mt-4 text-muted-foreground text-sm", className),
|
|
142
|
-
...props
|
|
143
|
-
}));
|
|
144
|
-
TableCaption.displayName = "TableCaption";
|
|
145
|
-
//#endregion
|
|
146
|
-
export { TableFooter as a, TableRow as c, Card as d, CardContent as f, CardTitle as g, CardHeader as h, TableCell as i, Badge as l, CardFooter as m, TableBody as n, TableHead as o, CardDescription as p, TableCaption as r, TableHeader as s, Table as t, badgeVariants as u };
|
|
@@ -1,434 +0,0 @@
|
|
|
1
|
-
import { t as cn } from "./utils-C_uf36nf.js";
|
|
2
|
-
import { t as TextShimmer } from "./text-shimmer-BUUo6I-g.js";
|
|
3
|
-
import { t as CodeBlock } from "./code-block-B36KVUSN.js";
|
|
4
|
-
import { i as getToolErrorText, n as getToolCategory, r as getToolDisplayMetadata } from "./tool-display-BAuAVa43.js";
|
|
5
|
-
import { n as formatDuration } from "./format-DfcLWqMa.js";
|
|
6
|
-
import { a as GrepResultsPreview, i as GlobResultsPreview, n as QuestionPreview, o as WriteFilePreview, r as WebSearchPreview, s as CommandPreview, t as DiffPreview } from "./diff-preview-BcK3nRXb.js";
|
|
7
|
-
import { memo, useEffect, useRef, useState } from "react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { AlertCircle, ArrowLeft, ArrowRight, Bot, ChevronRight, ClipboardList, FileEdit, FileSearch, FileText, Globe, Loader2, PencilLine, Search, Settings, Terminal } from "lucide-react";
|
|
10
|
-
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
11
|
-
//#region src/run/expandable-content.tsx
|
|
12
|
-
/**
|
|
13
|
-
* Clamps tall content to a fixed height with a bottom fade and a
|
|
14
|
-
* "Show more / Show less" toggle. Content shorter than the cap renders
|
|
15
|
-
* as-is with no toggle.
|
|
16
|
-
*/
|
|
17
|
-
function ExpandableContent({ children, collapsedMaxPx = 180, fadeClassName = "from-muted", className }) {
|
|
18
|
-
const [expanded, setExpanded] = useState(false);
|
|
19
|
-
const [overflowing, setOverflowing] = useState(false);
|
|
20
|
-
const contentRef = useRef(null);
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
const el = contentRef.current;
|
|
23
|
-
if (!el) return;
|
|
24
|
-
const measure = () => setOverflowing(el.scrollHeight > collapsedMaxPx + 4);
|
|
25
|
-
measure();
|
|
26
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
27
|
-
const observer = new ResizeObserver(measure);
|
|
28
|
-
observer.observe(el);
|
|
29
|
-
return () => observer.disconnect();
|
|
30
|
-
}, [collapsedMaxPx]);
|
|
31
|
-
const clamped = overflowing && !expanded;
|
|
32
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
33
|
-
className,
|
|
34
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
35
|
-
ref: contentRef,
|
|
36
|
-
className: "relative overflow-hidden",
|
|
37
|
-
style: clamped ? { maxHeight: collapsedMaxPx } : void 0,
|
|
38
|
-
children: [children, clamped ? /* @__PURE__ */ jsx("div", { className: cn("pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t to-transparent", fadeClassName) }) : null]
|
|
39
|
-
}), overflowing ? /* @__PURE__ */ jsx("button", {
|
|
40
|
-
type: "button",
|
|
41
|
-
onClick: () => setExpanded((value) => !value),
|
|
42
|
-
className: "mt-1 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground",
|
|
43
|
-
children: expanded ? "Show less" : "Show more"
|
|
44
|
-
}) : null]
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/run/expanded-tool-detail.tsx
|
|
49
|
-
const EXT_LANG = {
|
|
50
|
-
ts: "typescript",
|
|
51
|
-
tsx: "tsx",
|
|
52
|
-
js: "javascript",
|
|
53
|
-
jsx: "jsx",
|
|
54
|
-
rs: "rust",
|
|
55
|
-
py: "python",
|
|
56
|
-
go: "go",
|
|
57
|
-
rb: "ruby",
|
|
58
|
-
json: "json",
|
|
59
|
-
yaml: "yaml",
|
|
60
|
-
yml: "yaml",
|
|
61
|
-
toml: "toml",
|
|
62
|
-
md: "markdown",
|
|
63
|
-
css: "css",
|
|
64
|
-
scss: "scss",
|
|
65
|
-
html: "html",
|
|
66
|
-
sh: "bash",
|
|
67
|
-
bash: "bash",
|
|
68
|
-
zsh: "bash",
|
|
69
|
-
sql: "sql",
|
|
70
|
-
sol: "solidity",
|
|
71
|
-
proto: "protobuf"
|
|
72
|
-
};
|
|
73
|
-
function langFromPath(path) {
|
|
74
|
-
if (!path) return void 0;
|
|
75
|
-
const ext = path.split(".").pop()?.toLowerCase();
|
|
76
|
-
return ext ? EXT_LANG[ext] : void 0;
|
|
77
|
-
}
|
|
78
|
-
/** Format an unknown value as a displayable string. */
|
|
79
|
-
function formatOutput(value) {
|
|
80
|
-
if (value == null) return "";
|
|
81
|
-
if (typeof value === "string") return value;
|
|
82
|
-
try {
|
|
83
|
-
return JSON.stringify(value, null, 2);
|
|
84
|
-
} catch {
|
|
85
|
-
return String(value);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Renders full tool details when a tool item is expanded.
|
|
90
|
-
* Dispatches to specialised previews (CommandPreview, WriteFilePreview)
|
|
91
|
-
* or falls back to a generic input/output code view.
|
|
92
|
-
*/
|
|
93
|
-
const ExpandedToolDetail = memo(({ part }) => {
|
|
94
|
-
const meta = getToolDisplayMetadata(part);
|
|
95
|
-
const { status, input, output, error } = part.state;
|
|
96
|
-
if (meta.displayVariant === "command") return /* @__PURE__ */ jsx(CommandPreview, { part });
|
|
97
|
-
if (meta.displayVariant === "write-file") return /* @__PURE__ */ jsx(WriteFilePreview, { part });
|
|
98
|
-
if (meta.displayVariant === "grep") return /* @__PURE__ */ jsx(GrepResultsPreview, { part });
|
|
99
|
-
if (meta.displayVariant === "glob") return /* @__PURE__ */ jsx(GlobResultsPreview, { part });
|
|
100
|
-
if (meta.displayVariant === "web-search") return /* @__PURE__ */ jsx(WebSearchPreview, { part });
|
|
101
|
-
if (meta.displayVariant === "question") return /* @__PURE__ */ jsx(QuestionPreview, { part });
|
|
102
|
-
if (meta.displayVariant === "diff") return /* @__PURE__ */ jsx(DiffPreview, { part });
|
|
103
|
-
if (meta.displayVariant === "read-file") return /* @__PURE__ */ jsxs("div", {
|
|
104
|
-
className: "overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card shadow-[var(--shadow-card)]",
|
|
105
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
106
|
-
className: "flex items-center gap-2.5 border-b border-border bg-card px-3 py-2",
|
|
107
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
108
|
-
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",
|
|
109
|
-
children: /* @__PURE__ */ jsx(FileText, { className: "h-3.5 w-3.5" })
|
|
110
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
111
|
-
className: "min-w-0 flex items-center gap-2",
|
|
112
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
113
|
-
className: "text-xs font-semibold text-foreground",
|
|
114
|
-
children: "Read file"
|
|
115
|
-
}), meta.targetPath ? /* @__PURE__ */ jsx("span", {
|
|
116
|
-
className: "truncate text-xs font-mono text-muted-foreground",
|
|
117
|
-
children: meta.targetPath
|
|
118
|
-
}) : null]
|
|
119
|
-
})]
|
|
120
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
121
|
-
className: "space-y-2 px-3 py-2.5",
|
|
122
|
-
children: [typeof output === "string" ? /* @__PURE__ */ jsx(CodeBlock, {
|
|
123
|
-
code: output,
|
|
124
|
-
language: langFromPath(meta.targetPath) ?? "text",
|
|
125
|
-
className: "rounded-[var(--radius-md)]"
|
|
126
|
-
}) : /* @__PURE__ */ jsx("div", {
|
|
127
|
-
className: "rounded-[var(--radius-md)] border border-dashed border-border bg-muted px-3 py-4 text-sm text-muted-foreground",
|
|
128
|
-
children: "No readable file content was returned."
|
|
129
|
-
}), error ? /* @__PURE__ */ jsx("div", {
|
|
130
|
-
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)]",
|
|
131
|
-
children: error
|
|
132
|
-
}) : null]
|
|
133
|
-
})]
|
|
134
|
-
});
|
|
135
|
-
const inputStr = formatOutput(input);
|
|
136
|
-
const outputStr = formatOutput(output);
|
|
137
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
138
|
-
className: "space-y-3",
|
|
139
|
-
children: [
|
|
140
|
-
inputStr && /* @__PURE__ */ jsxs("div", {
|
|
141
|
-
className: "overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card",
|
|
142
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
143
|
-
className: "flex items-center gap-2 border-b border-border bg-background px-3 py-2",
|
|
144
|
-
children: [/* @__PURE__ */ jsx(ArrowRight, { className: "h-3 w-3 text-primary" }), /* @__PURE__ */ jsx("span", {
|
|
145
|
-
className: "text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",
|
|
146
|
-
children: "Input"
|
|
147
|
-
})]
|
|
148
|
-
}), /* @__PURE__ */ jsx(CodeBlock, {
|
|
149
|
-
code: inputStr,
|
|
150
|
-
language: "json",
|
|
151
|
-
className: "rounded-none border-0"
|
|
152
|
-
})]
|
|
153
|
-
}),
|
|
154
|
-
status === "completed" && outputStr && /* @__PURE__ */ jsxs("div", {
|
|
155
|
-
className: "overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card",
|
|
156
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
157
|
-
className: "flex items-center gap-2 border-b border-border bg-background px-3 py-2",
|
|
158
|
-
children: [/* @__PURE__ */ jsx(ArrowLeft, { className: "h-3 w-3 text-primary" }), /* @__PURE__ */ jsx("span", {
|
|
159
|
-
className: "text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground",
|
|
160
|
-
children: "Output"
|
|
161
|
-
})]
|
|
162
|
-
}), /* @__PURE__ */ jsx(ExpandableContent, {
|
|
163
|
-
fadeClassName: "from-card",
|
|
164
|
-
children: /* @__PURE__ */ jsx(CodeBlock, {
|
|
165
|
-
code: outputStr.length > 2e3 ? outputStr.slice(0, 2e3) + "\n...(truncated)" : outputStr,
|
|
166
|
-
language: "json",
|
|
167
|
-
className: "rounded-none border-0"
|
|
168
|
-
})
|
|
169
|
-
})]
|
|
170
|
-
}),
|
|
171
|
-
error && /* @__PURE__ */ jsxs("div", {
|
|
172
|
-
className: "overflow-hidden rounded-[var(--radius-lg)] border border-[var(--surface-danger-border)]",
|
|
173
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
174
|
-
className: "flex items-center gap-2 border-b border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] px-3 py-2",
|
|
175
|
-
children: [/* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3 text-[var(--surface-danger-text)]" }), /* @__PURE__ */ jsx("span", {
|
|
176
|
-
className: "text-xs font-medium uppercase tracking-[0.08em] text-[var(--surface-danger-text)]",
|
|
177
|
-
children: "Error"
|
|
178
|
-
})]
|
|
179
|
-
}), /* @__PURE__ */ jsx(ExpandableContent, {
|
|
180
|
-
fadeClassName: "from-[var(--surface-danger-bg)]",
|
|
181
|
-
children: /* @__PURE__ */ jsx("pre", {
|
|
182
|
-
className: "bg-[var(--surface-danger-bg)] p-3 text-xs font-mono whitespace-pre-wrap break-all text-[var(--surface-danger-text)]",
|
|
183
|
-
children: error
|
|
184
|
-
})
|
|
185
|
-
})]
|
|
186
|
-
}),
|
|
187
|
-
(status === "pending" || status === "running") && /* @__PURE__ */ jsxs("div", {
|
|
188
|
-
className: "flex items-center gap-2 rounded-[var(--radius-md)] border border-border bg-muted px-3 py-3 text-xs text-muted-foreground",
|
|
189
|
-
children: [/* @__PURE__ */ jsx(Loader2, { className: cn("h-3 w-3 animate-spin text-primary") }), "Running…"]
|
|
190
|
-
})
|
|
191
|
-
]
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
ExpandedToolDetail.displayName = "ExpandedToolDetail";
|
|
195
|
-
//#endregion
|
|
196
|
-
//#region src/run/run-row-shell.tsx
|
|
197
|
-
/**
|
|
198
|
-
* Trailing status indicator shared by every run row. Only `error` draws a
|
|
199
|
-
* mark (a red dot). Success is silence, and a running row carries its state in
|
|
200
|
-
* the title — a `TextShimmer` sweep — so neither renders anything here.
|
|
201
|
-
*/
|
|
202
|
-
function RunRowStatusDot({ status }) {
|
|
203
|
-
if (status !== "error") return null;
|
|
204
|
-
return /* @__PURE__ */ jsx("span", {
|
|
205
|
-
"data-run-row-status": "error",
|
|
206
|
-
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-[var(--surface-danger-text)]"
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
const SHAPE_CLASS = {
|
|
210
|
-
single: "rounded-[var(--radius-lg)]",
|
|
211
|
-
first: "rounded-t-[var(--radius-lg)] rounded-b-[var(--radius-sm)]",
|
|
212
|
-
middle: "rounded-[var(--radius-sm)]",
|
|
213
|
-
last: "rounded-t-[var(--radius-sm)] rounded-b-[var(--radius-lg)]"
|
|
214
|
-
};
|
|
215
|
-
const HEADER_INSET = "px-2 py-1";
|
|
216
|
-
const ERROR_INDENT = "pl-[2.375rem]";
|
|
217
|
-
/**
|
|
218
|
-
* Shared shell for the agent activity rows (reasoning + tool). A quiet
|
|
219
|
-
* one-liner at rest — bare glyph, muted title and description, no fill, no
|
|
220
|
-
* border — that becomes a bordered card only while open. The border is always
|
|
221
|
-
* present (transparent at rest) so hover and expand never shift layout.
|
|
222
|
-
* Both row kinds render through it so they read as one family.
|
|
223
|
-
*/
|
|
224
|
-
function RunRowShell({ icon, title, description, descriptionMono = false, status = "idle", durationMs, groupPosition = "single", collapsedError, actions, open: openProp, onOpenChange, defaultOpen = false, className, contentClassName, children }) {
|
|
225
|
-
const [openState, setOpenState] = useState(defaultOpen);
|
|
226
|
-
const isControlled = openProp !== void 0;
|
|
227
|
-
const open = isControlled ? openProp : openState;
|
|
228
|
-
const setOpen = (next) => {
|
|
229
|
-
if (!isControlled) setOpenState(next);
|
|
230
|
-
onOpenChange?.(next);
|
|
231
|
-
};
|
|
232
|
-
const isRunning = status === "running";
|
|
233
|
-
const expandable = children != null;
|
|
234
|
-
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
235
|
-
open,
|
|
236
|
-
onOpenChange: setOpen,
|
|
237
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
238
|
-
className: "flex items-start gap-2",
|
|
239
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
240
|
-
"data-run-row": "",
|
|
241
|
-
"data-state": open ? "open" : "closed",
|
|
242
|
-
className: cn("group min-w-0 flex-1 overflow-hidden border transition-colors", open ? "border-border bg-[var(--md3-surface-container)]" : "border-transparent bg-transparent", expandable && !open && "hover:bg-[var(--md3-surface-container)]", SHAPE_CLASS[groupPosition], className),
|
|
243
|
-
children: [
|
|
244
|
-
/* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
245
|
-
asChild: true,
|
|
246
|
-
disabled: !expandable,
|
|
247
|
-
children: /* @__PURE__ */ jsxs("button", {
|
|
248
|
-
type: "button",
|
|
249
|
-
className: cn("flex w-full items-center gap-2 text-left", HEADER_INSET, expandable ? "cursor-pointer" : "cursor-default"),
|
|
250
|
-
children: [
|
|
251
|
-
/* @__PURE__ */ jsxs("span", {
|
|
252
|
-
"aria-hidden": true,
|
|
253
|
-
className: "flex h-[1.375rem] w-[1.375rem] shrink-0 items-center justify-center text-muted-foreground",
|
|
254
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
255
|
-
"data-run-row-glyph": "",
|
|
256
|
-
className: cn("flex items-center justify-center", expandable && "group-hover:hidden", open && "hidden"),
|
|
257
|
-
children: icon
|
|
258
|
-
}), expandable ? /* @__PURE__ */ jsx(ChevronRight, {
|
|
259
|
-
"data-run-row-chevron": "",
|
|
260
|
-
className: cn("hidden h-3.5 w-3.5 transition-transform group-hover:block", open && "block rotate-90")
|
|
261
|
-
}) : null]
|
|
262
|
-
}),
|
|
263
|
-
/* @__PURE__ */ jsx("span", {
|
|
264
|
-
className: cn("shrink-0 whitespace-nowrap text-sm font-normal text-muted-foreground transition-colors group-hover:text-foreground", open && "text-foreground"),
|
|
265
|
-
children: title
|
|
266
|
-
}),
|
|
267
|
-
description ? /* @__PURE__ */ jsx("span", {
|
|
268
|
-
className: cn("hidden min-w-0 flex-1 truncate text-sm text-muted-foreground transition-colors group-hover:text-foreground sm:inline", descriptionMono && "font-mono"),
|
|
269
|
-
children: description
|
|
270
|
-
}) : null,
|
|
271
|
-
/* @__PURE__ */ jsxs("span", {
|
|
272
|
-
className: "ml-auto flex shrink-0 items-center gap-1.5",
|
|
273
|
-
children: [!isRunning && durationMs != null ? /* @__PURE__ */ jsx("span", {
|
|
274
|
-
"data-run-row-duration": "",
|
|
275
|
-
className: "font-mono text-[10px] tabular-nums text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100",
|
|
276
|
-
children: formatDuration(durationMs)
|
|
277
|
-
}) : null, /* @__PURE__ */ jsx(RunRowStatusDot, { status })]
|
|
278
|
-
})
|
|
279
|
-
]
|
|
280
|
-
})
|
|
281
|
-
}),
|
|
282
|
-
collapsedError && !open ? /* @__PURE__ */ jsx("div", {
|
|
283
|
-
className: cn("pb-1.5 pr-2 text-xs leading-snug text-[var(--surface-danger-text)]", ERROR_INDENT),
|
|
284
|
-
children: collapsedError
|
|
285
|
-
}) : null,
|
|
286
|
-
expandable ? /* @__PURE__ */ jsx(Collapsible.Content, {
|
|
287
|
-
className: "overflow-hidden data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp",
|
|
288
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
289
|
-
className: cn("border-t border-border", contentClassName),
|
|
290
|
-
children
|
|
291
|
-
})
|
|
292
|
-
}) : null
|
|
293
|
-
]
|
|
294
|
-
}), actions ? /* @__PURE__ */ jsx("div", {
|
|
295
|
-
className: "flex shrink-0 flex-wrap items-center justify-end gap-1.5 pt-1",
|
|
296
|
-
onClick: (event) => event.stopPropagation(),
|
|
297
|
-
children: actions
|
|
298
|
-
}) : null]
|
|
299
|
-
})
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
//#endregion
|
|
303
|
-
//#region src/run/inline-tool-item.tsx
|
|
304
|
-
/** Map tool category to a lucide-react icon component. */
|
|
305
|
-
const TOOL_CATEGORY_ICON_MAP = {
|
|
306
|
-
command: Terminal,
|
|
307
|
-
write: FileEdit,
|
|
308
|
-
read: FileSearch,
|
|
309
|
-
search: Search,
|
|
310
|
-
edit: PencilLine,
|
|
311
|
-
task: Bot,
|
|
312
|
-
web: Globe,
|
|
313
|
-
todo: ClipboardList,
|
|
314
|
-
other: Settings
|
|
315
|
-
};
|
|
316
|
-
/** Map the tool part status onto the shared row status vocabulary. */
|
|
317
|
-
function toRowStatus(status) {
|
|
318
|
-
if (status === "pending" || status === "running") return "running";
|
|
319
|
-
if (status === "error") return "error";
|
|
320
|
-
return "success";
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Compact single-line tool call display: a category glyph, the tool verb, and
|
|
324
|
-
* the path or command it acted on. While the call runs the verb shimmers;
|
|
325
|
-
* once it completes the row goes quiet (duration on hover, a red dot only on
|
|
326
|
-
* error). Expands on click to show ExpandedToolDetail. Rendered through the
|
|
327
|
-
* shared RunRowShell so it stays consistent with the reasoning row.
|
|
328
|
-
*/
|
|
329
|
-
const InlineToolItem = memo(({ part, renderToolDetail, groupPosition = "single", className, contentClassName, actions, title: titleOverride, description: descriptionOverride }) => {
|
|
330
|
-
const meta = getToolDisplayMetadata(part);
|
|
331
|
-
const title = titleOverride ?? meta.title;
|
|
332
|
-
const description = descriptionOverride ?? meta.description;
|
|
333
|
-
const errorText = getToolErrorText(part);
|
|
334
|
-
const startTime = part.state.time?.start;
|
|
335
|
-
const endTime = part.state.time?.end;
|
|
336
|
-
const durationMs = startTime != null && endTime != null ? endTime - startTime : void 0;
|
|
337
|
-
const category = getToolCategory(part.tool);
|
|
338
|
-
const DefaultIcon = TOOL_CATEGORY_ICON_MAP[category] ?? Settings;
|
|
339
|
-
const status = toRowStatus(part.state.status);
|
|
340
|
-
return /* @__PURE__ */ jsx(RunRowShell, {
|
|
341
|
-
icon: /* @__PURE__ */ jsx(DefaultIcon, { className: "h-3.5 w-3.5" }),
|
|
342
|
-
title: status === "running" ? /* @__PURE__ */ jsx(TextShimmer, { children: title }) : title,
|
|
343
|
-
description,
|
|
344
|
-
descriptionMono: true,
|
|
345
|
-
status,
|
|
346
|
-
durationMs,
|
|
347
|
-
groupPosition,
|
|
348
|
-
collapsedError: errorText ?? void 0,
|
|
349
|
-
actions,
|
|
350
|
-
className,
|
|
351
|
-
contentClassName: cn("p-2", contentClassName),
|
|
352
|
-
children: renderToolDetail?.(part) ?? /* @__PURE__ */ jsx(ExpandedToolDetail, { part })
|
|
353
|
-
});
|
|
354
|
-
});
|
|
355
|
-
InlineToolItem.displayName = "InlineToolItem";
|
|
356
|
-
//#endregion
|
|
357
|
-
//#region src/run/tool-call-step.tsx
|
|
358
|
-
const EXT_LANGUAGE = {
|
|
359
|
-
ts: "typescript",
|
|
360
|
-
tsx: "typescript",
|
|
361
|
-
js: "javascript",
|
|
362
|
-
jsx: "javascript",
|
|
363
|
-
mjs: "javascript",
|
|
364
|
-
cjs: "javascript",
|
|
365
|
-
css: "css",
|
|
366
|
-
scss: "scss",
|
|
367
|
-
json: "json",
|
|
368
|
-
jsonc: "json",
|
|
369
|
-
md: "markdown",
|
|
370
|
-
mdx: "markdown",
|
|
371
|
-
py: "python",
|
|
372
|
-
sh: "bash",
|
|
373
|
-
bash: "bash",
|
|
374
|
-
zsh: "bash",
|
|
375
|
-
html: "html",
|
|
376
|
-
htm: "html",
|
|
377
|
-
yaml: "yaml",
|
|
378
|
-
yml: "yaml",
|
|
379
|
-
toml: "toml",
|
|
380
|
-
rs: "rust",
|
|
381
|
-
go: "go",
|
|
382
|
-
sql: "sql",
|
|
383
|
-
xml: "xml"
|
|
384
|
-
};
|
|
385
|
-
function inferLanguage(detail, language) {
|
|
386
|
-
if (language) return language;
|
|
387
|
-
if (!detail) return void 0;
|
|
388
|
-
const ext = detail.split(".").pop()?.toLowerCase();
|
|
389
|
-
return ext ? EXT_LANGUAGE[ext] : void 0;
|
|
390
|
-
}
|
|
391
|
-
const STATUS_MAP = {
|
|
392
|
-
running: "running",
|
|
393
|
-
success: "completed",
|
|
394
|
-
error: "error"
|
|
395
|
-
};
|
|
396
|
-
function ToolCallStep({ type, label, status, detail, output, language, duration, className, actions, part }) {
|
|
397
|
-
const resolvedPart = part ?? {
|
|
398
|
-
type: "tool",
|
|
399
|
-
id: `${type}:${label}`,
|
|
400
|
-
tool: type,
|
|
401
|
-
state: {
|
|
402
|
-
status: STATUS_MAP[status],
|
|
403
|
-
input: detail ? { detail } : void 0,
|
|
404
|
-
output,
|
|
405
|
-
time: duration != null ? {
|
|
406
|
-
start: 0,
|
|
407
|
-
end: duration
|
|
408
|
-
} : void 0
|
|
409
|
-
}
|
|
410
|
-
};
|
|
411
|
-
const lang = inferLanguage(detail, language);
|
|
412
|
-
return /* @__PURE__ */ jsx(InlineToolItem, {
|
|
413
|
-
part: resolvedPart,
|
|
414
|
-
title: label,
|
|
415
|
-
description: detail,
|
|
416
|
-
className,
|
|
417
|
-
actions,
|
|
418
|
-
renderToolDetail: part ? void 0 : output ? () => /* @__PURE__ */ jsx(CodeBlock, {
|
|
419
|
-
code: output,
|
|
420
|
-
language: lang,
|
|
421
|
-
className: "max-h-72 overflow-auto text-xs"
|
|
422
|
-
}) : () => null
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
function ToolCallGroup({ title, children, className }) {
|
|
426
|
-
return /* @__PURE__ */ jsx("div", {
|
|
427
|
-
role: "group",
|
|
428
|
-
"aria-label": title,
|
|
429
|
-
className: cn("flex flex-col gap-1", className),
|
|
430
|
-
children
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
//#endregion
|
|
434
|
-
export { RunRowStatusDot as a, RunRowShell as i, ToolCallStep as n, ExpandedToolDetail as o, InlineToolItem as r, ExpandableContent as s, ToolCallGroup as t };
|