@iloveagents/foundry-web-ui 0.3.0 → 0.4.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/README.md +14 -5
- package/dist/components/ag-ui-runtime-provider.d.ts +64 -0
- package/dist/components/ag-ui-runtime-provider.js +71 -0
- package/dist/components/app-brand.d.ts +6 -0
- package/dist/components/app-brand.js +13 -0
- package/dist/components/assistant-chat.d.ts +26 -0
- package/dist/components/assistant-chat.js +93 -0
- package/dist/components/chat-attachments.d.ts +25 -0
- package/dist/components/chat-attachments.js +20 -0
- package/dist/components/chat-bubble.d.ts +1 -0
- package/dist/components/chat-bubble.js +103 -0
- package/dist/components/chat-header.d.ts +2 -0
- package/dist/components/chat-header.js +16 -0
- package/dist/components/client-tool-executor.d.ts +12 -0
- package/dist/components/client-tool-executor.js +108 -0
- package/dist/components/collection-empty-state.d.ts +9 -0
- package/dist/components/collection-empty-state.js +6 -0
- package/dist/components/collection-filter-bar.d.ts +19 -0
- package/dist/components/collection-filter-bar.js +28 -0
- package/dist/components/collection-search-input.d.ts +6 -0
- package/dist/components/collection-search-input.js +8 -0
- package/dist/components/collection-skeleton.d.ts +6 -0
- package/dist/components/collection-skeleton.js +10 -0
- package/dist/components/collection-sort-menu.d.ts +10 -0
- package/dist/components/collection-sort-menu.js +9 -0
- package/dist/components/collection-surface.d.ts +8 -0
- package/dist/components/collection-surface.js +5 -0
- package/dist/components/collection-toolbar.d.ts +9 -0
- package/dist/components/collection-toolbar.js +5 -0
- package/dist/components/collection-view-toggle.d.ts +7 -0
- package/dist/components/collection-view-toggle.js +17 -0
- package/dist/components/composer-submit-bridge.d.ts +1 -0
- package/dist/components/composer-submit-bridge.js +15 -0
- package/dist/components/confirm-dialog.d.ts +11 -0
- package/dist/components/confirm-dialog.js +6 -0
- package/dist/components/confirmation-card.d.ts +14 -0
- package/dist/components/confirmation-card.js +12 -0
- package/dist/components/context-badges.d.ts +16 -0
- package/dist/components/context-badges.js +56 -0
- package/dist/components/context-bar.d.ts +41 -0
- package/dist/components/context-bar.js +123 -0
- package/dist/components/form-dialog.d.ts +12 -0
- package/dist/components/form-dialog.js +13 -0
- package/dist/components/global-selection-popover.d.ts +7 -0
- package/dist/components/global-selection-popover.js +167 -0
- package/dist/components/infinite-scroll-sentinel.d.ts +6 -0
- package/dist/components/infinite-scroll-sentinel.js +25 -0
- package/dist/components/json-viewer.d.ts +10 -0
- package/dist/components/json-viewer.js +80 -0
- package/dist/components/loading-indicator.d.ts +4 -0
- package/dist/components/loading-indicator.js +22 -0
- package/dist/components/markdown-text.d.ts +13 -0
- package/dist/components/markdown-text.js +221 -0
- package/dist/components/name-dialog.d.ts +16 -0
- package/dist/components/name-dialog.js +23 -0
- package/dist/components/selection-popover.d.ts +12 -0
- package/dist/components/selection-popover.js +111 -0
- package/dist/components/show-document-tool-ui.d.ts +1 -0
- package/dist/components/show-document-tool-ui.js +53 -0
- package/dist/components/sidebar.d.ts +4 -0
- package/dist/components/sidebar.js +904 -0
- package/dist/components/surface-card.d.ts +9 -0
- package/dist/components/surface-card.js +33 -0
- package/dist/components/theme-runtime-provider.d.ts +15 -0
- package/dist/components/theme-runtime-provider.js +48 -0
- package/dist/components/theme-toggle.d.ts +2 -0
- package/dist/components/theme-toggle.js +19 -0
- package/dist/components/tool-call-card.d.ts +27 -0
- package/dist/components/tool-call-card.js +13 -0
- package/dist/components/tool-fallback.d.ts +26 -0
- package/dist/components/tool-fallback.js +129 -0
- package/dist/components/tool-panel-layout.d.ts +10 -0
- package/dist/components/tool-panel-layout.js +12 -0
- package/dist/components/tool-panel.d.ts +1 -0
- package/dist/components/tool-panel.js +89 -0
- package/dist/components/tooltip-icon-button.d.ts +7 -0
- package/dist/components/tooltip-icon-button.js +9 -0
- package/dist/components/user-menu.d.ts +2 -0
- package/dist/components/user-menu.js +14 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +83 -0
- package/dist/lib/ag-ui-adapter.d.ts +29 -0
- package/dist/lib/ag-ui-adapter.js +373 -0
- package/dist/lib/app-store.d.ts +115 -0
- package/dist/lib/app-store.js +199 -0
- package/dist/lib/attachment-adapter.d.ts +20 -0
- package/dist/lib/attachment-adapter.js +99 -0
- package/dist/lib/auth-provider.d.ts +16 -0
- package/dist/lib/auth-provider.js +88 -0
- package/dist/lib/chat-bubble-store.d.ts +30 -0
- package/dist/lib/chat-bubble-store.js +23 -0
- package/dist/lib/chat-lifecycle-store.d.ts +10 -0
- package/{src/lib/chat-lifecycle-store.ts → dist/lib/chat-lifecycle-store.js} +3 -13
- package/dist/lib/client-tools.d.ts +11 -0
- package/dist/lib/client-tools.js +274 -0
- package/dist/lib/composer-submit-store.d.ts +12 -0
- package/dist/lib/composer-submit-store.js +17 -0
- package/dist/lib/dev-store.d.ts +38 -0
- package/dist/lib/dev-store.js +32 -0
- package/dist/lib/nav-config.d.ts +159 -0
- package/dist/lib/nav-config.js +162 -0
- package/dist/lib/nav-dnd.d.ts +8 -0
- package/dist/lib/nav-dnd.js +9 -0
- package/dist/lib/nav-store.d.ts +45 -0
- package/dist/lib/nav-store.js +49 -0
- package/dist/lib/selection-context.d.ts +21 -0
- package/dist/lib/selection-context.js +34 -0
- package/dist/lib/sidebar-store.d.ts +23 -0
- package/dist/lib/sidebar-store.js +98 -0
- package/dist/lib/theme-runtime.d.ts +130 -0
- package/dist/lib/theme-runtime.js +479 -0
- package/dist/lib/theme-store.d.ts +15 -0
- package/dist/lib/theme-store.js +53 -0
- package/dist/lib/tool-panel-store.d.ts +48 -0
- package/dist/lib/tool-panel-store.js +69 -0
- package/dist/lib/use-new-conversation.d.ts +8 -0
- package/dist/lib/use-new-conversation.js +62 -0
- package/dist/lib/use-page-tools.d.ts +27 -0
- package/{src/lib/use-page-tools.ts → dist/lib/use-page-tools.js} +11 -13
- package/dist/styles.css +142 -0
- package/dist/ui/collapsible.d.ts +5 -0
- package/{src/ui/collapsible.tsx → dist/ui/collapsible.js} +0 -2
- package/dist/ui/dialog.d.ts +15 -0
- package/dist/ui/dialog.js +25 -0
- package/dist/ui/dropdown-menu.d.ts +7 -0
- package/dist/ui/dropdown-menu.js +19 -0
- package/dist/ui/popover.d.ts +7 -0
- package/dist/ui/popover.js +10 -0
- package/dist/ui/select.d.ts +4 -0
- package/dist/ui/select.js +9 -0
- package/dist/ui/tooltip.d.ts +7 -0
- package/dist/ui/tooltip.js +10 -0
- package/package.json +31 -12
- package/AGENTS.md +0 -59
- package/CHANGELOG.md +0 -203
- package/CLAUDE.md +0 -1
- package/src/__tests__/no-spaces-imports.test.ts +0 -59
- package/src/__tests__/open-core-guards.test.ts +0 -307
- package/src/__tests__/theme-runtime.test.ts +0 -81
- package/src/__tests__/tool-fallback.test.tsx +0 -109
- package/src/components/__tests__/context-bar.test.ts +0 -112
- package/src/components/ag-ui-runtime-provider.tsx +0 -170
- package/src/components/app-brand.tsx +0 -38
- package/src/components/assistant-chat.tsx +0 -461
- package/src/components/chat-attachments.tsx +0 -68
- package/src/components/chat-bubble.tsx +0 -373
- package/src/components/chat-header.tsx +0 -44
- package/src/components/client-tool-executor.tsx +0 -230
- package/src/components/collection-empty-state.tsx +0 -37
- package/src/components/collection-filter-bar.tsx +0 -168
- package/src/components/collection-search-input.tsx +0 -41
- package/src/components/collection-skeleton.tsx +0 -55
- package/src/components/collection-sort-menu.tsx +0 -62
- package/src/components/collection-surface.tsx +0 -46
- package/src/components/collection-toolbar.tsx +0 -33
- package/src/components/collection-view-toggle.tsx +0 -61
- package/src/components/composer-submit-bridge.tsx +0 -19
- package/src/components/confirm-dialog.tsx +0 -49
- package/src/components/confirmation-card.tsx +0 -32
- package/src/components/context-badges.tsx +0 -136
- package/src/components/context-bar.tsx +0 -238
- package/src/components/form-dialog.tsx +0 -56
- package/src/components/global-selection-popover.tsx +0 -266
- package/src/components/infinite-scroll-sentinel.tsx +0 -48
- package/src/components/json-viewer.tsx +0 -232
- package/src/components/loading-indicator.tsx +0 -40
- package/src/components/markdown-text-citations.test.tsx +0 -108
- package/src/components/markdown-text.tsx +0 -508
- package/src/components/name-dialog.tsx +0 -87
- package/src/components/selection-popover.tsx +0 -156
- package/src/components/show-document-tool-ui.tsx +0 -90
- package/src/components/sidebar.test.tsx +0 -611
- package/src/components/sidebar.tsx +0 -1689
- package/src/components/surface-card.tsx +0 -45
- package/src/components/theme-runtime-provider.tsx +0 -93
- package/src/components/theme-toggle.tsx +0 -27
- package/src/components/tool-call-card.tsx +0 -126
- package/src/components/tool-fallback.tsx +0 -169
- package/src/components/tool-panel-layout.tsx +0 -36
- package/src/components/tool-panel.tsx +0 -233
- package/src/components/tooltip-icon-button.tsx +0 -28
- package/src/components/user-menu.tsx +0 -60
- package/src/index.ts +0 -185
- package/src/lib/__tests__/ag-ui-adapter.test.ts +0 -273
- package/src/lib/__tests__/app-store.test.ts +0 -405
- package/src/lib/__tests__/attachment-adapter.test.ts +0 -48
- package/src/lib/__tests__/chat-bubble-store.test.ts +0 -67
- package/src/lib/__tests__/client-tools.test.ts +0 -124
- package/src/lib/__tests__/dev-store.test.ts +0 -78
- package/src/lib/__tests__/nav-config.test.ts +0 -135
- package/src/lib/__tests__/nav-dnd.test.ts +0 -24
- package/src/lib/__tests__/nav-store.test.ts +0 -59
- package/src/lib/__tests__/selection-context.test.ts +0 -114
- package/src/lib/__tests__/sidebar-store.test.ts +0 -144
- package/src/lib/__tests__/theme-store.test.ts +0 -83
- package/src/lib/__tests__/tool-panel-store.test.ts +0 -61
- package/src/lib/__tests__/use-page-context.test.ts +0 -58
- package/src/lib/ag-ui-adapter.ts +0 -412
- package/src/lib/app-store.ts +0 -361
- package/src/lib/attachment-adapter.ts +0 -92
- package/src/lib/auth-provider.tsx +0 -144
- package/src/lib/chat-bubble-store.ts +0 -46
- package/src/lib/client-tools.ts +0 -293
- package/src/lib/composer-submit-store.ts +0 -32
- package/src/lib/dev-store.ts +0 -69
- package/src/lib/nav-config.ts +0 -329
- package/src/lib/nav-dnd.ts +0 -14
- package/src/lib/nav-store.ts +0 -89
- package/src/lib/selection-context.ts +0 -65
- package/src/lib/sidebar-store.ts +0 -113
- package/src/lib/theme-runtime.ts +0 -660
- package/src/lib/theme-store.ts +0 -67
- package/src/lib/tool-panel-store.ts +0 -121
- package/src/lib/use-new-conversation.test.tsx +0 -168
- package/src/lib/use-new-conversation.ts +0 -64
- package/src/ui/dialog.tsx +0 -109
- package/src/ui/dropdown-menu.tsx +0 -75
- package/src/ui/popover.tsx +0 -34
- package/src/ui/select.tsx +0 -15
- package/src/ui/tooltip.tsx +0 -30
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -16
- package/vitest.config.ts +0 -8
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Floating "Add to chat" button for text selection in the tool panel.
|
|
3
|
-
*
|
|
4
|
-
* Appears near the selected text when the user makes a selection within
|
|
5
|
-
* the panel content area. Clicking adds the selection to the context store.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { type RefObject, useState, useEffect, useCallback, useRef } from "react";
|
|
9
|
-
import { TextSelect } from "lucide-react";
|
|
10
|
-
import { cn } from "@iloveagents/foundry-web-primitives";
|
|
11
|
-
import { useAppStore } from "../lib/app-store.ts";
|
|
12
|
-
import { useToolPanelStore } from "../lib/tool-panel-store.ts";
|
|
13
|
-
|
|
14
|
-
interface SelectionPopoverProps {
|
|
15
|
-
containerRef: RefObject<HTMLDivElement | null>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface PopoverPosition {
|
|
19
|
-
top: number;
|
|
20
|
-
left: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const POPOVER_HEIGHT = 36;
|
|
24
|
-
const POPOVER_WIDTH = 126;
|
|
25
|
-
const OFFSET = 8;
|
|
26
|
-
|
|
27
|
-
export function SelectionPopover({ containerRef }: SelectionPopoverProps) {
|
|
28
|
-
const [position, setPosition] = useState<PopoverPosition | null>(null);
|
|
29
|
-
const [selectedText, setSelectedText] = useState("");
|
|
30
|
-
const addContextItem = useAppStore((s) => s.addContextItem);
|
|
31
|
-
const buttonRef = useRef<HTMLButtonElement>(null);
|
|
32
|
-
|
|
33
|
-
const hidePopover = useCallback(() => {
|
|
34
|
-
setPosition(null);
|
|
35
|
-
setSelectedText("");
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
const handleMouseUp = useCallback(() => {
|
|
39
|
-
// Small delay to let the selection finalize
|
|
40
|
-
requestAnimationFrame(() => {
|
|
41
|
-
const selection = window.getSelection();
|
|
42
|
-
if (!selection || selection.isCollapsed || !selection.toString().trim()) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Ensure selection is within the container
|
|
47
|
-
const container = containerRef.current;
|
|
48
|
-
if (!container) return;
|
|
49
|
-
|
|
50
|
-
const anchorNode = selection.anchorNode;
|
|
51
|
-
if (!anchorNode || !container.contains(anchorNode)) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const text = selection.toString().trim();
|
|
56
|
-
if (!text) return;
|
|
57
|
-
|
|
58
|
-
const range = selection.getRangeAt(0);
|
|
59
|
-
const rect = range.getBoundingClientRect();
|
|
60
|
-
|
|
61
|
-
// The tool panel uses CSS transforms (translate-x), which creates
|
|
62
|
-
// a new containing block -- `position: fixed` becomes relative to
|
|
63
|
-
// the nearest transformed ancestor, not the viewport. Convert
|
|
64
|
-
// viewport coords to container-relative coords.
|
|
65
|
-
const containerRect = container.getBoundingClientRect();
|
|
66
|
-
|
|
67
|
-
// Position above selection
|
|
68
|
-
let top = rect.top - containerRect.top + container.scrollTop - POPOVER_HEIGHT - OFFSET;
|
|
69
|
-
let left = rect.left - containerRect.left + rect.width / 2 - POPOVER_WIDTH / 2;
|
|
70
|
-
|
|
71
|
-
// If would go above visible area, place below instead
|
|
72
|
-
if (rect.top - containerRect.top - POPOVER_HEIGHT - OFFSET < 0) {
|
|
73
|
-
top = rect.bottom - containerRect.top + container.scrollTop + OFFSET;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Clamp horizontal within container
|
|
77
|
-
const maxLeft = containerRect.width - POPOVER_WIDTH - OFFSET;
|
|
78
|
-
left = Math.max(OFFSET, Math.min(left, maxLeft));
|
|
79
|
-
|
|
80
|
-
setSelectedText(text);
|
|
81
|
-
setPosition({ top, left });
|
|
82
|
-
});
|
|
83
|
-
}, [containerRef]);
|
|
84
|
-
|
|
85
|
-
const handleAddToContext = useCallback(() => {
|
|
86
|
-
if (!selectedText) return;
|
|
87
|
-
|
|
88
|
-
const source = useToolPanelStore.getState().content?.title ?? "Document";
|
|
89
|
-
|
|
90
|
-
addContextItem({
|
|
91
|
-
type: "selection",
|
|
92
|
-
label: selectedText,
|
|
93
|
-
payload: { kind: "text", text: selectedText },
|
|
94
|
-
sourcePage: source,
|
|
95
|
-
persistence: "ephemeral",
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
// Clear selection and hide popover
|
|
99
|
-
window.getSelection()?.removeAllRanges();
|
|
100
|
-
hidePopover();
|
|
101
|
-
}, [selectedText, addContextItem, hidePopover]);
|
|
102
|
-
|
|
103
|
-
useEffect(() => {
|
|
104
|
-
const container = containerRef.current;
|
|
105
|
-
if (!container) return;
|
|
106
|
-
|
|
107
|
-
container.addEventListener("mouseup", handleMouseUp);
|
|
108
|
-
|
|
109
|
-
// Hide on mousedown (new selection starting), scroll, or Escape.
|
|
110
|
-
// Skip if the mousedown is on the popover button itself -- React's
|
|
111
|
-
// synthetic onMouseDown fires after native listeners, so we can't
|
|
112
|
-
// rely on stopPropagation there.
|
|
113
|
-
const handleMouseDown = (e: MouseEvent) => {
|
|
114
|
-
if (buttonRef.current?.contains(e.target as Node)) return;
|
|
115
|
-
hidePopover();
|
|
116
|
-
};
|
|
117
|
-
const handleScroll = () => hidePopover();
|
|
118
|
-
const handleKeyDown = (e: KeyboardEvent) => {
|
|
119
|
-
if (e.key === "Escape") hidePopover();
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
container.addEventListener("mousedown", handleMouseDown);
|
|
123
|
-
container.addEventListener("scroll", handleScroll, true);
|
|
124
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
125
|
-
|
|
126
|
-
return () => {
|
|
127
|
-
container.removeEventListener("mouseup", handleMouseUp);
|
|
128
|
-
container.removeEventListener("mousedown", handleMouseDown);
|
|
129
|
-
container.removeEventListener("scroll", handleScroll, true);
|
|
130
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
131
|
-
};
|
|
132
|
-
}, [containerRef, handleMouseUp, hidePopover]);
|
|
133
|
-
|
|
134
|
-
if (!position) return null;
|
|
135
|
-
|
|
136
|
-
return (
|
|
137
|
-
<button
|
|
138
|
-
ref={buttonRef}
|
|
139
|
-
type="button"
|
|
140
|
-
className={cn(
|
|
141
|
-
"absolute z-50",
|
|
142
|
-
"flex items-center gap-1.5",
|
|
143
|
-
"rounded-lg border border-border bg-background shadow-lg",
|
|
144
|
-
"px-3 py-1.5 text-xs font-medium text-foreground",
|
|
145
|
-
"hover:bg-muted transition-colors",
|
|
146
|
-
"animate-in fade-in-0 zoom-in-95 duration-150",
|
|
147
|
-
)}
|
|
148
|
-
style={{ top: position.top, left: position.left }}
|
|
149
|
-
onMouseDown={(e) => e.preventDefault()}
|
|
150
|
-
onClick={handleAddToContext}
|
|
151
|
-
>
|
|
152
|
-
<TextSelect className="size-3.5 text-primary" />
|
|
153
|
-
Add to chat
|
|
154
|
-
</button>
|
|
155
|
-
);
|
|
156
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { makeAssistantToolUI } from "@assistant-ui/react";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import { FileText } from "lucide-react";
|
|
4
|
-
import { useToolPanelStore } from "../lib/tool-panel-store.ts";
|
|
5
|
-
import { ToolCallCard } from "./tool-call-card.tsx";
|
|
6
|
-
|
|
7
|
-
interface ShowDocumentArgs {
|
|
8
|
-
title: string;
|
|
9
|
-
content: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface ShowDocumentResult {
|
|
14
|
-
status?: "success" | "error";
|
|
15
|
-
message?: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const ShowDocumentToolUI = makeAssistantToolUI<ShowDocumentArgs, ShowDocumentResult>({
|
|
19
|
-
toolName: "show_document",
|
|
20
|
-
render: ({ args, result, status, toolCallId }) => {
|
|
21
|
-
const openPanel = useToolPanelStore((state) => state.openPanel);
|
|
22
|
-
const openedToolCallsRef = useRef(new Set<string>());
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
status.type === "complete" &&
|
|
26
|
-
result?.status === "success" &&
|
|
27
|
-
args &&
|
|
28
|
-
!openedToolCallsRef.current.has(toolCallId)
|
|
29
|
-
) {
|
|
30
|
-
openedToolCallsRef.current.add(toolCallId);
|
|
31
|
-
queueMicrotask(() => {
|
|
32
|
-
openPanel({
|
|
33
|
-
title: args.title,
|
|
34
|
-
content: args.content,
|
|
35
|
-
type: (args.type as "markdown" | "text" | "page" | "pdf") || "markdown",
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
let description = "";
|
|
41
|
-
if (status.type === "running") {
|
|
42
|
-
description = "Opening document...";
|
|
43
|
-
} else if (status.type === "complete" && result) {
|
|
44
|
-
description =
|
|
45
|
-
result.message ||
|
|
46
|
-
(result.status === "success" ? "Document ready" : "Failed to open document");
|
|
47
|
-
} else if (status.type === "requires-action") {
|
|
48
|
-
description = "Action required to display document";
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const handleViewDocument = () => {
|
|
52
|
-
if (args) {
|
|
53
|
-
openPanel({
|
|
54
|
-
title: args.title,
|
|
55
|
-
content: args.content,
|
|
56
|
-
type: (args.type as "markdown" | "text" | "page" | "pdf") || "markdown",
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<ToolCallCard
|
|
63
|
-
icon={<FileText className="size-3.5" />}
|
|
64
|
-
title="Document Display"
|
|
65
|
-
description={description}
|
|
66
|
-
status={status}
|
|
67
|
-
className="w-full"
|
|
68
|
-
action={
|
|
69
|
-
status.type === "complete" && result?.status === "success" && args
|
|
70
|
-
? {
|
|
71
|
-
label: "View Document",
|
|
72
|
-
onClick: handleViewDocument,
|
|
73
|
-
}
|
|
74
|
-
: undefined
|
|
75
|
-
}
|
|
76
|
-
>
|
|
77
|
-
{args && (
|
|
78
|
-
<div className="text-muted-foreground text-xs">
|
|
79
|
-
<span className="font-medium">Title:</span> {args.title}
|
|
80
|
-
{args.type && (
|
|
81
|
-
<span className="ml-2">
|
|
82
|
-
<span className="font-medium">Type:</span> {args.type}
|
|
83
|
-
</span>
|
|
84
|
-
)}
|
|
85
|
-
</div>
|
|
86
|
-
)}
|
|
87
|
-
</ToolCallCard>
|
|
88
|
-
);
|
|
89
|
-
},
|
|
90
|
-
});
|