@townco/ui 0.1.79 → 0.1.82
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/dist/core/hooks/use-chat-messages.d.ts +8 -8
- package/dist/core/hooks/use-chat-session.d.ts +1 -1
- package/dist/core/hooks/use-tool-calls.d.ts +155 -7
- package/dist/core/schemas/chat.d.ts +28 -28
- package/dist/core/schemas/tool-call.d.ts +34 -34
- package/dist/gui/components/AppSidebar.d.ts +1 -1
- package/dist/gui/components/AppSidebar.js +7 -1
- package/dist/gui/components/Button.d.ts +2 -2
- package/dist/gui/components/ChatEmptyState.js +9 -1
- package/dist/gui/components/ChatInput.js +4 -2
- package/dist/gui/components/ChatInputCommandMenu.js +5 -1
- package/dist/gui/components/ChatLayout.js +13 -6
- package/dist/gui/components/ChatPanelTabContent.js +17 -2
- package/dist/gui/components/ChatSecondaryPanel.js +5 -2
- package/dist/gui/components/ChatView.d.ts +1 -1
- package/dist/gui/components/ChatView.js +38 -6
- package/dist/gui/components/ContextUsageButton.js +41 -3
- package/dist/gui/components/Conversation.js +4 -1
- package/dist/gui/components/Dialog.d.ts +8 -8
- package/dist/gui/components/Dialog.js +6 -1
- package/dist/gui/components/DropdownMenu.d.ts +4 -4
- package/dist/gui/components/DropdownMenu.js +6 -3
- package/dist/gui/components/FileSystemItem.d.ts +1 -1
- package/dist/gui/components/FileSystemItem.js +7 -3
- package/dist/gui/components/FileSystemView.d.ts +1 -1
- package/dist/gui/components/HeightTransition.d.ts +1 -1
- package/dist/gui/components/HookNotification.js +39 -3
- package/dist/gui/components/Input.d.ts +1 -1
- package/dist/gui/components/MarkdownRenderer.d.ts +1 -1
- package/dist/gui/components/Message.d.ts +2 -2
- package/dist/gui/components/MessageContent.d.ts +2 -2
- package/dist/gui/components/MessageContent.js +3 -2
- package/dist/gui/components/Reasoning.d.ts +1 -1
- package/dist/gui/components/Reasoning.js +10 -3
- package/dist/gui/components/Select.js +9 -4
- package/dist/gui/components/SessionHistory.d.ts +1 -1
- package/dist/gui/components/SessionHistory.js +10 -3
- package/dist/gui/components/SessionHistoryItem.js +10 -2
- package/dist/gui/components/Sheet.d.ts +9 -9
- package/dist/gui/components/Sheet.js +6 -1
- package/dist/gui/components/Sidebar.d.ts +5 -6
- package/dist/gui/components/Sidebar.js +12 -5
- package/dist/gui/components/SidebarToggle.d.ts +1 -1
- package/dist/gui/components/Sonner.d.ts +1 -3
- package/dist/gui/components/SourceListItem.js +7 -1
- package/dist/gui/components/SubAgentDetails.d.ts +1 -1
- package/dist/gui/components/SubAgentDetails.js +15 -3
- package/dist/gui/components/Task.js +5 -1
- package/dist/gui/components/Textarea.d.ts +1 -1
- package/dist/gui/components/ThemeProvider.d.ts +1 -1
- package/dist/gui/components/ThemeToggle.js +7 -1
- package/dist/gui/components/ThinkingBlock.d.ts +2 -2
- package/dist/gui/components/ThinkingBlock.js +9 -2
- package/dist/gui/components/TodoList.js +5 -1
- package/dist/gui/components/TodoListItem.js +4 -2
- package/dist/gui/components/TodoSubline.js +2 -1
- package/dist/gui/components/ToolCallList.d.ts +1 -1
- package/dist/gui/components/ToolCallList.js +5 -1
- package/dist/gui/components/ToolOperation.d.ts +1 -1
- package/dist/gui/components/ToolOperation.js +75 -17
- package/dist/gui/components/WorkProgress.d.ts +1 -1
- package/dist/gui/components/resizable.d.ts +34 -2
- package/dist/gui/components/resizable.js +3 -1
- package/dist/sdk/schemas/agent.d.ts +4 -4
- package/dist/sdk/schemas/message.d.ts +13 -13
- package/dist/sdk/schemas/session.d.ts +46 -46
- package/dist/sdk/transports/http.d.ts +0 -10
- package/dist/tui/components/ChatView.js +3 -1
- package/dist/tui/components/GameOfLife.js +4 -2
- package/dist/tui/components/InputBox.d.ts +1 -1
- package/dist/tui/components/InputBox.js +8 -1
- package/dist/tui/components/MessageList.js +3 -1
- package/dist/tui/components/MultiSelect.d.ts +1 -1
- package/dist/tui/components/MultiSelect.js +5 -3
- package/dist/tui/components/ReadlineInput.d.ts +1 -1
- package/dist/tui/components/ReadlineInput.js +4 -2
- package/dist/tui/components/SimpleTextInput.d.ts +1 -1
- package/dist/tui/components/SimpleTextInput.js +4 -2
- package/dist/tui/components/SingleSelect.d.ts +1 -1
- package/dist/tui/components/SingleSelect.js +5 -3
- package/dist/tui/components/StatusBar.d.ts +1 -1
- package/dist/tui/components/StatusBar.js +8 -3
- package/dist/tui/components/ToolCall.js +3 -1
- package/dist/tui/components/ToolCallList.js +5 -1
- package/package.json +7 -7
- package/dist/gui/components/InvokingGroup.d.ts +0 -9
- package/dist/gui/components/InvokingGroup.js +0 -16
- package/dist/gui/components/SubagentStream.d.ts +0 -23
- package/dist/gui/components/SubagentStream.js +0 -98
- package/dist/gui/components/ToolCall.d.ts +0 -8
- package/dist/gui/components/ToolCall.js +0 -234
- package/dist/gui/components/ToolCallGroup.d.ts +0 -8
- package/dist/gui/components/ToolCallGroup.js +0 -29
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const inputVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "default" | "error" | "success" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
|
7
7
|
}
|
|
@@ -2,5 +2,5 @@ interface MarkdownRendererProps {
|
|
|
2
2
|
content: string;
|
|
3
3
|
className?: string;
|
|
4
4
|
}
|
|
5
|
-
export declare function MarkdownRenderer({ content, className
|
|
5
|
+
export declare function MarkdownRenderer({ content, className }: MarkdownRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
6
|
export {};
|
|
@@ -6,8 +6,8 @@ import type { DisplayMessage } from "./MessageList.js";
|
|
|
6
6
|
* Provides role-based layout and styling for chat messages
|
|
7
7
|
*/
|
|
8
8
|
declare const messageVariants: (props?: ({
|
|
9
|
-
role?: "
|
|
10
|
-
layout?: "
|
|
9
|
+
role?: "assistant" | "system" | "user" | null | undefined;
|
|
10
|
+
layout?: "compact" | "default" | "full" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
export interface MessageProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof messageVariants> {
|
|
13
13
|
/**
|
|
@@ -7,8 +7,8 @@ import type { DisplayMessage } from "./MessageList.js";
|
|
|
7
7
|
* Handles automatic rendering of thinking, waiting states, and content
|
|
8
8
|
*/
|
|
9
9
|
declare const messageContentVariants: (props?: ({
|
|
10
|
-
role?: "
|
|
11
|
-
variant?: "default" | "
|
|
10
|
+
role?: "assistant" | "system" | "user" | null | undefined;
|
|
11
|
+
variant?: "default" | "ghost" | "outline" | null | undefined;
|
|
12
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
13
|
export interface MessageContentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children">, VariantProps<typeof messageContentVariants> {
|
|
14
14
|
/** Message role - determines styling */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { useChatStore } from "../../core/store/chat-store.js";
|
|
@@ -168,7 +168,8 @@ export const MessageContent = React.forwardRef(({ role: roleProp, variant, isStr
|
|
|
168
168
|
const hasHookPositions = hookNotifications.some((n) => n.contentPosition !== undefined);
|
|
169
169
|
if (!hasHookPositions) {
|
|
170
170
|
// No positions - render hooks at top, then tool calls, then content
|
|
171
|
-
return (_jsxs(_Fragment, { children: [hookNotifications.length > 0 && (_jsx("div", { className: "flex flex-col gap-2 mb-1", children: hookNotifications.map((notification) => (_jsx(HookNotification, { notification: notification }, notification.id))) })), groupedToolCalls.length > 0 && (_jsx("div", { className: "flex flex-col gap-2 mb-1", children: groupedToolCalls.map((item, index) => renderToolCallOrGroup(item, index)) })), _jsx("div", { children: _jsx(Response, { content: message.content, isStreaming: message.isStreaming, showEmpty: false }) })
|
|
171
|
+
return (_jsxs(_Fragment, { children: [hookNotifications.length > 0 && (_jsx("div", { className: "flex flex-col gap-2 mb-1", children: hookNotifications.map((notification) => (_jsx(HookNotification, { notification: notification }, notification.id))) })), groupedToolCalls.length > 0 && (_jsx("div", { className: "flex flex-col gap-2 mb-1", children: groupedToolCalls.map((item, index) => renderToolCallOrGroup(item, index)) })), _jsx("div", { children: _jsx(Response, { content: message.content, isStreaming: message.isStreaming, showEmpty: false }) })
|
|
172
|
+
] }));
|
|
172
173
|
}
|
|
173
174
|
// Hooks have positions - render them inline with content
|
|
174
175
|
const elements = [];
|
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
* Displays AI thinking/reasoning process with auto-collapse support
|
|
6
6
|
*/
|
|
7
7
|
declare const reasoningContainerVariants: (props?: ({
|
|
8
|
-
variant?: "default" | "
|
|
8
|
+
variant?: "default" | "prominent" | "subtle" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
export interface ReasoningProps extends VariantProps<typeof reasoningContainerVariants> {
|
|
11
11
|
/** The reasoning/thinking content */
|
|
@@ -59,12 +59,19 @@ export const Reasoning = React.forwardRef(({ content, isStreaming = false, mode
|
|
|
59
59
|
}
|
|
60
60
|
// Inline mode - always visible
|
|
61
61
|
if (mode === "inline") {
|
|
62
|
-
return (_jsxs("div", { ref: ref, className: cn(reasoningContainerVariants({ variant }), "p-3", className), children: [
|
|
62
|
+
return (_jsxs("div", { ref: ref, className: cn(reasoningContainerVariants({ variant }), "p-3", className), children: [
|
|
63
|
+
_jsxs("div", { className: "flex items-start gap-2 mb-2", children: [
|
|
64
|
+
_jsx("span", { className: "text-caption font-medium text-foreground opacity-60 uppercase tracking-wide", children: label }), isStreaming && (_jsx("span", { className: "inline-block w-2 h-2 bg-primary rounded-full animate-pulse" }))] }), _jsxs("div", { className: "text-paragraph-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap", children: [content, isStreaming && content && (_jsx("span", { className: "inline-block animate-typing text-primary", children: "..." }))] })
|
|
65
|
+
] }));
|
|
63
66
|
}
|
|
64
67
|
// Collapsible mode
|
|
65
|
-
return (_jsxs("div", { ref: ref, className: cn("mb-3", className), children: [
|
|
68
|
+
return (_jsxs("div", { ref: ref, className: cn("mb-3", className), children: [
|
|
69
|
+
_jsxs("button", { type: "button", onClick: () => {
|
|
66
70
|
setIsExpanded(!isExpanded);
|
|
67
71
|
setShouldAutoCollapse(false); // Disable auto-collapse on manual interaction
|
|
68
|
-
}, className: "w-full flex items-center justify-between p-2.5 rounded-lg bg-card border border-border hover:bg-card/80 hover:shadow-sm transition-all text-left", "aria-expanded": isExpanded, "aria-label": `${isExpanded ? "Collapse" : "Expand"} reasoning`, children: [
|
|
72
|
+
}, className: "w-full flex items-center justify-between p-2.5 rounded-lg bg-card border border-border hover:bg-card/80 hover:shadow-sm transition-all text-left", "aria-expanded": isExpanded, "aria-label": `${isExpanded ? "Collapse" : "Expand"} reasoning`, children: [
|
|
73
|
+
_jsxs("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
|
|
74
|
+
_jsx("span", { className: "text-caption font-medium text-foreground opacity-60 uppercase tracking-wide shrink-0", children: label }), isStreaming && (_jsx("span", { className: "inline-block w-2 h-2 bg-primary rounded-full animate-pulse shrink-0" })), !isExpanded && content && (_jsxs("span", { className: "text-caption text-foreground opacity-50 truncate", children: [content.substring(0, 60), content.length > 60 && "..."] }))] }), _jsx(ChevronDown, { className: reasoningIconVariants({ expanded: isExpanded }), "aria-hidden": "true" })
|
|
75
|
+
] }), isExpanded && (_jsx("div", { className: cn(reasoningContainerVariants({ variant }), "mt-2 p-3 animate-fadeIn"), children: _jsxs("div", { className: "text-paragraph-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap", children: [content, isStreaming && content && (_jsx("span", { className: "inline-block animate-typing text-primary", children: "..." }))] }) }))] }));
|
|
69
76
|
});
|
|
70
77
|
Reasoning.displayName = "Reasoning";
|
|
@@ -6,7 +6,8 @@ import { cn } from "../lib/utils.js";
|
|
|
6
6
|
const Select = SelectPrimitive.Root;
|
|
7
7
|
const SelectGroup = SelectPrimitive.Group;
|
|
8
8
|
const SelectValue = SelectPrimitive.Value;
|
|
9
|
-
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-paragraph-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronsUpDown, { className: "h-4 w-4 opacity-50" }) })
|
|
9
|
+
const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-paragraph-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronsUpDown, { className: "h-4 w-4 opacity-50" }) })
|
|
10
|
+
] })));
|
|
10
11
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
11
12
|
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(ChevronUp, { className: "h-4 w-4" }) })));
|
|
12
13
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
@@ -14,12 +15,16 @@ const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) =
|
|
|
14
15
|
SelectScrollDownButton.displayName =
|
|
15
16
|
SelectPrimitive.ScrollDownButton.displayName;
|
|
16
17
|
const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", position === "popper" &&
|
|
17
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, ...props, children: [
|
|
18
|
-
|
|
18
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, ...props, children: [
|
|
19
|
+
_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn("p-1", position === "popper" &&
|
|
20
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"), children: children }), _jsx(SelectScrollDownButton, {})
|
|
21
|
+
] }) })));
|
|
19
22
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
20
23
|
const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Label, { ref: ref, className: cn("py-1.5 pl-8 pr-2 text-paragraph-sm font-semibold", className), ...props })));
|
|
21
24
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
22
|
-
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [
|
|
25
|
+
const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [
|
|
26
|
+
_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })
|
|
27
|
+
] })));
|
|
23
28
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
24
29
|
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })));
|
|
25
30
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
@@ -7,4 +7,4 @@ export interface SessionHistoryProps {
|
|
|
7
7
|
onArchiveSession?: ((sessionId: string) => void) | undefined;
|
|
8
8
|
onDeleteSession?: ((sessionId: string) => void) | undefined;
|
|
9
9
|
}
|
|
10
|
-
export declare function SessionHistory({ client, currentSessionId, onSessionSelect, onRenameSession, onArchiveSession, onDeleteSession
|
|
10
|
+
export declare function SessionHistory({ client, currentSessionId, onSessionSelect, onRenameSession, onArchiveSession, onDeleteSession }: SessionHistoryProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -88,13 +88,20 @@ export function SessionHistory({ client, currentSessionId, onSessionSelect, onRe
|
|
|
88
88
|
return (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx("div", { className: "flex w-full flex-row items-center justify-center gap-2 px-2 text-sm text-muted-foreground", children: "Connect to an agent to see session history" }) }) }));
|
|
89
89
|
}
|
|
90
90
|
if (isLoading) {
|
|
91
|
-
return (_jsxs(SidebarGroup, { children: [
|
|
91
|
+
return (_jsxs(SidebarGroup, { children: [
|
|
92
|
+
_jsx(SidebarGroupLabel, { children: "Today" }), _jsx(SidebarGroupContent, { children: _jsx("div", { className: "flex flex-col", children: [44, 32, 28, 64, 52].map((item) => (_jsx("div", { className: "flex h-8 items-center gap-2 rounded-md px-2", children: _jsx("div", { className: "h-4 flex-1 rounded-md bg-sidebar-accent-foreground/10 animate-pulse", style: {
|
|
92
93
|
maxWidth: `${item}%`,
|
|
93
|
-
} }) }, item))) }) })
|
|
94
|
+
} }) }, item))) }) })
|
|
95
|
+
] }));
|
|
94
96
|
}
|
|
95
97
|
if (sessions.length === 0) {
|
|
96
98
|
return (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx("div", { className: "flex w-full flex-row items-center justify-center gap-2 px-2 py-4 text-sm text-muted-foreground", children: "Your sessions will appear here once you start chatting!" }) }) }));
|
|
97
99
|
}
|
|
98
100
|
const groupedSessions = groupSessionsByDate(sessions);
|
|
99
|
-
return (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: _jsxs("div", { className: "flex flex-col gap-6", children: [groupedSessions.today.length > 0 && (_jsxs("div", { className: "flex flex-col", children: [
|
|
101
|
+
return (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: _jsxs("div", { className: "flex flex-col gap-6", children: [groupedSessions.today.length > 0 && (_jsxs("div", { className: "flex flex-col", children: [
|
|
102
|
+
_jsx("div", { className: "px-2 py-1 text-muted-foreground text-sm font-medium", children: "Today" }), groupedSessions.today.map((session) => (_jsx(SessionHistoryItem, { session: session, isActive: session.sessionId === currentSessionId, onSelect: handleSessionSelect, onRename: onRenameSession, onArchive: onArchiveSession, onDelete: onDeleteSession, setOpenMobile: setOpenMobile }, session.sessionId)))] })), groupedSessions.yesterday.length > 0 && (_jsxs("div", { className: "flex flex-col", children: [
|
|
103
|
+
_jsx("div", { className: "px-2 py-1 text-muted-foreground text-sm font-medium", children: "Yesterday" }), groupedSessions.yesterday.map((session) => (_jsx(SessionHistoryItem, { session: session, isActive: session.sessionId === currentSessionId, onSelect: handleSessionSelect, onRename: onRenameSession, onArchive: onArchiveSession, onDelete: onDeleteSession, setOpenMobile: setOpenMobile }, session.sessionId)))] })), groupedSessions.lastWeek.length > 0 && (_jsxs("div", { className: "flex flex-col", children: [
|
|
104
|
+
_jsx("div", { className: "px-2 py-1 text-muted-foreground text-sm font-medium", children: "Last 7 days" }), groupedSessions.lastWeek.map((session) => (_jsx(SessionHistoryItem, { session: session, isActive: session.sessionId === currentSessionId, onSelect: handleSessionSelect, onRename: onRenameSession, onArchive: onArchiveSession, onDelete: onDeleteSession, setOpenMobile: setOpenMobile }, session.sessionId)))] })), groupedSessions.lastMonth.length > 0 && (_jsxs("div", { className: "flex flex-col", children: [
|
|
105
|
+
_jsx("div", { className: "px-2 py-1 text-muted-foreground text-sm font-medium", children: "Last 30 days" }), groupedSessions.lastMonth.map((session) => (_jsx(SessionHistoryItem, { session: session, isActive: session.sessionId === currentSessionId, onSelect: handleSessionSelect, onRename: onRenameSession, onArchive: onArchiveSession, onDelete: onDeleteSession, setOpenMobile: setOpenMobile }, session.sessionId)))] })), groupedSessions.older.length > 0 && (_jsxs("div", { className: "flex flex-col", children: [
|
|
106
|
+
_jsx("div", { className: "px-2 py-1 text-muted-foreground text-sm font-medium", children: "Older" }), groupedSessions.older.map((session) => (_jsx(SessionHistoryItem, { session: session, isActive: session.sessionId === currentSessionId, onSelect: handleSessionSelect, onRename: onRenameSession, onArchive: onArchiveSession, onDelete: onDeleteSession, setOpenMobile: setOpenMobile }, session.sessionId)))] }))] }) }) }) }));
|
|
100
107
|
}
|
|
@@ -5,10 +5,18 @@ import { cn } from "../lib/utils.js";
|
|
|
5
5
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "./DropdownMenu.js";
|
|
6
6
|
import { SidebarMenuAction, SidebarMenuButton, SidebarMenuItem, } from "./Sidebar.js";
|
|
7
7
|
const PureSessionHistoryItem = ({ session, isActive, onSelect, onRename, onArchive, onDelete, setOpenMobile, }) => {
|
|
8
|
-
return (_jsxs(SidebarMenuItem, { children: [
|
|
8
|
+
return (_jsxs(SidebarMenuItem, { children: [
|
|
9
|
+
_jsx(SidebarMenuButton, { asChild: true, isActive: isActive, onClick: () => {
|
|
9
10
|
onSelect(session.sessionId);
|
|
10
11
|
setOpenMobile(false);
|
|
11
|
-
}, className: "h-10 px-2 py-3", children: _jsx("button", { type: "button", className: "w-full text-base", children: _jsx("span", { className: "truncate", children: session.firstUserMessage || "Empty session" }) }) }), _jsxs(DropdownMenu, { modal: true, children: [
|
|
12
|
+
}, className: "h-10 px-2 py-3", children: _jsx("button", { type: "button", className: "w-full text-base", children: _jsx("span", { className: "truncate", children: session.firstUserMessage || "Empty session" }) }) }), _jsxs(DropdownMenu, { modal: true, children: [
|
|
13
|
+
_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(SidebarMenuAction, { className: "mr-0.5 data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground", showOnHover: !isActive, children: [
|
|
14
|
+
_jsx(MoreHorizontal, {}), _jsx("span", { className: "sr-only", children: "More" })
|
|
15
|
+
] }) }), _jsxs(DropdownMenuContent, { align: "end", side: "bottom", children: [
|
|
16
|
+
_jsx(DropdownMenuItem, { className: "cursor-pointer", disabled: !onRename, onSelect: () => onRename?.(session.sessionId), children: "Rename" }), _jsx(DropdownMenuItem, { className: "cursor-pointer", disabled: !onArchive, onSelect: () => onArchive?.(session.sessionId), children: "Archive" }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { className: cn("cursor-pointer text-destructive focus:bg-destructive/15 focus:text-destructive"), disabled: !onDelete, onSelect: () => onDelete?.(session.sessionId), children: "Delete" })
|
|
17
|
+
] })
|
|
18
|
+
] })
|
|
19
|
+
] }));
|
|
12
20
|
};
|
|
13
21
|
export const SessionHistoryItem = memo(PureSessionHistoryItem, (prevProps, nextProps) => {
|
|
14
22
|
if (prevProps.isActive !== nextProps.isActive) {
|
|
@@ -7,19 +7,19 @@ declare const SheetClose: React.ForwardRefExoticComponent<DialogPrimitive.Dialog
|
|
|
7
7
|
declare const SheetPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
8
8
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
declare const sheetVariants: (props?: ({
|
|
10
|
-
side?: "
|
|
10
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
13
13
|
}
|
|
14
14
|
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
-
declare
|
|
16
|
-
|
|
17
|
-
displayName: string;
|
|
18
|
-
}
|
|
19
|
-
declare
|
|
20
|
-
|
|
21
|
-
displayName: string;
|
|
22
|
-
}
|
|
15
|
+
declare function SheetHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare namespace SheetHeader {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
declare function SheetFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare namespace SheetFooter {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
23
|
declare const SheetTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
24
24
|
declare const SheetDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
25
25
|
export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -23,7 +23,12 @@ const sheetVariants = cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transiti
|
|
|
23
23
|
side: "right",
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
|
-
const SheetContent = React.forwardRef(({ side = "right", className, children, ...props }, ref) => (_jsxs(SheetPortal, { children: [
|
|
26
|
+
const SheetContent = React.forwardRef(({ side = "right", className, children, ...props }, ref) => (_jsxs(SheetPortal, { children: [
|
|
27
|
+
_jsx(SheetOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn(sheetVariants({ side }), className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
28
|
+
_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })
|
|
29
|
+
] })
|
|
30
|
+
] })
|
|
31
|
+
] })));
|
|
27
32
|
SheetContent.displayName = DialogPrimitive.Content.displayName;
|
|
28
33
|
const SheetHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props }));
|
|
29
34
|
SheetHeader.displayName = "SheetHeader";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { TooltipContent } from "./Tooltip.js";
|
|
4
3
|
type SidebarContextProps = {
|
|
5
4
|
state: "expanded" | "collapsed";
|
|
6
5
|
open: boolean;
|
|
@@ -18,8 +17,8 @@ declare const SidebarProvider: React.ForwardRefExoticComponent<Omit<React.ClassA
|
|
|
18
17
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
18
|
declare const Sidebar: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
20
19
|
side?: "left" | "right";
|
|
21
|
-
variant?: "
|
|
22
|
-
collapsible?: "
|
|
20
|
+
variant?: "floating" | "inset" | "sidebar";
|
|
21
|
+
collapsible?: "icon" | "none" | "offcanvas";
|
|
23
22
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
23
|
declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<import("./Button.js").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
25
24
|
declare const SidebarRail: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -42,10 +41,10 @@ declare const SidebarMenuItem: React.ForwardRefExoticComponent<Omit<React.Detail
|
|
|
42
41
|
declare const SidebarMenuButton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
43
42
|
asChild?: boolean;
|
|
44
43
|
isActive?: boolean;
|
|
45
|
-
tooltip?: string | React.
|
|
44
|
+
tooltip?: string | (Omit<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>);
|
|
46
45
|
} & VariantProps<(props?: ({
|
|
47
46
|
variant?: "default" | "outline" | null | undefined;
|
|
48
|
-
size?: "default" | "
|
|
47
|
+
size?: "default" | "lg" | "sm" | null | undefined;
|
|
49
48
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
50
49
|
declare const SidebarMenuAction: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
51
50
|
asChild?: boolean;
|
|
@@ -59,7 +58,7 @@ declare const SidebarMenuSub: React.ForwardRefExoticComponent<Omit<React.Detaile
|
|
|
59
58
|
declare const SidebarMenuSubItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
60
59
|
declare const SidebarMenuSubButton: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
61
60
|
asChild?: boolean;
|
|
62
|
-
size?: "
|
|
61
|
+
size?: "md" | "sm";
|
|
63
62
|
isActive?: boolean;
|
|
64
63
|
}, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
65
64
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Slot as SlotPrimitive } from "@radix-ui/react-slot";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { AnimatePresence, motion } from "framer-motion";
|
|
@@ -82,7 +82,9 @@ const Sidebar = React.forwardRef(({ className, children }, ref) => {
|
|
|
82
82
|
useLockBodyScroll(isMobile && openMobile);
|
|
83
83
|
// Mobile: Sidebar with white overlay
|
|
84
84
|
if (isMobile) {
|
|
85
|
-
return (_jsx(AnimatePresence, { initial: false, children: openMobile && (_jsxs(_Fragment, { children: [
|
|
85
|
+
return (_jsx(AnimatePresence, { initial: false, children: openMobile && (_jsxs(_Fragment, { children: [
|
|
86
|
+
_jsx(motion.div, { className: "fixed inset-0 z-40 bg-background/80", variants: backdropVariants, initial: "initial", animate: "animate", exit: "exit", transition: sidebarMobileTransition, onClick: () => setOpenMobile(false), "aria-label": "Close sidebar" }), _jsx(motion.aside, { ref: ref, className: cn("fixed inset-y-0 left-0 z-50", "bg-sidebar text-sidebar-foreground", "flex flex-col", "border-r border-sidebar-border", "max-h-screen overflow-hidden", className), style: { width: SIDEBAR_WIDTH_MOBILE }, variants: sidebarMobileVariants, initial: "initial", animate: "animate", exit: "exit", transition: sidebarMobileTransition, "data-sidebar": "sidebar", "data-mobile": "true", children: _jsx(motion.div, { className: "flex flex-col h-full overflow-y-auto", variants: sidebarContentVariants, initial: "initial", animate: "animate", transition: sidebarContentTransition, children: children }) })
|
|
87
|
+
] })) }));
|
|
86
88
|
}
|
|
87
89
|
// Desktop: Fixed width sidebar with slide animation
|
|
88
90
|
return (_jsx("div", { className: "group peer hidden md:block", "data-state": open ? "expanded" : "collapsed", "data-side": "left", ref: ref, children: _jsx(AnimatePresence, { initial: false, mode: "wait", children: open && (_jsx(motion.aside, { className: cn("fixed inset-y-0 left-0 z-40", "bg-sidebar text-sidebar-foreground", "border-r border-sidebar-border", "flex flex-col", "max-h-screen overflow-hidden", className), style: { width: SIDEBAR_WIDTH_DESKTOP }, variants: sidebarDesktopVariants, initial: "initial", animate: "animate", exit: "exit", transition: sidebarTransition, "data-sidebar": "sidebar", children: _jsx(motion.div, { className: "flex flex-col h-full overflow-y-auto", variants: sidebarContentVariants, initial: "initial", animate: "animate", transition: sidebarContentTransition, children: children }) })) }) }));
|
|
@@ -93,7 +95,9 @@ const SidebarTrigger = React.forwardRef(({ className, onClick, ...props }, ref)
|
|
|
93
95
|
return (_jsxs(Button, { className: cn("h-7 w-7", className), "data-sidebar": "trigger", onClick: (event) => {
|
|
94
96
|
onClick?.(event);
|
|
95
97
|
toggleSidebar();
|
|
96
|
-
}, ref: ref, size: "icon", variant: "ghost", ...props, children: [
|
|
98
|
+
}, ref: ref, size: "icon", variant: "ghost", ...props, children: [
|
|
99
|
+
_jsx(PanelLeft, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
100
|
+
] }));
|
|
97
101
|
});
|
|
98
102
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
99
103
|
const SidebarRail = React.forwardRef(({ className, ...props }, ref) => {
|
|
@@ -181,7 +185,9 @@ const SidebarMenuButton = React.forwardRef(({ asChild = false, isActive = false,
|
|
|
181
185
|
children: tooltip,
|
|
182
186
|
};
|
|
183
187
|
}
|
|
184
|
-
return (_jsxs(Tooltip, { children: [
|
|
188
|
+
return (_jsxs(Tooltip, { children: [
|
|
189
|
+
_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { align: "center", hidden: state !== "collapsed" || isMobile, side: "right", ...tooltip })
|
|
190
|
+
] }));
|
|
185
191
|
});
|
|
186
192
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
187
193
|
const SidebarMenuAction = React.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
@@ -201,7 +207,8 @@ const SidebarMenuSkeleton = React.forwardRef(({ className, showIcon = false, ...
|
|
|
201
207
|
}, []);
|
|
202
208
|
return (_jsxs("div", { className: cn("flex h-8 items-center gap-2 rounded-md px-2", className), "data-sidebar": "menu-skeleton", ref: ref, ...props, children: [showIcon && (_jsx("div", { className: "size-4 rounded-md bg-sidebar-accent-foreground/10 animate-pulse", "data-sidebar": "menu-skeleton-icon" })), _jsx("div", { className: "h-4 flex-1 rounded-md bg-sidebar-accent-foreground/10 animate-pulse", "data-sidebar": "menu-skeleton-text", style: {
|
|
203
209
|
maxWidth: width,
|
|
204
|
-
} })
|
|
210
|
+
} })
|
|
211
|
+
] }));
|
|
205
212
|
});
|
|
206
213
|
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
207
214
|
const SidebarMenuSub = React.forwardRef(({ className, ...props }, ref) => (_jsx("ul", { className: cn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-sidebar-border border-l px-2.5 py-0.5", "group-data-[collapsible=icon]:hidden", className), "data-sidebar": "menu-sub", ref: ref, ...props })));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ComponentProps } from "react";
|
|
2
2
|
import { type SidebarTrigger } from "./Sidebar.js";
|
|
3
|
-
export declare function SidebarToggle({ className
|
|
3
|
+
export declare function SidebarToggle({ className }: ComponentProps<typeof SidebarTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
-
|
|
3
|
-
type ToasterProps = React.ComponentProps<typeof Sonner>;
|
|
4
|
-
declare const Toaster: ({ ...props }: ToasterProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Toaster: ({ ...props }: import("sonner").ToasterProps & React.RefAttributes<HTMLElement>) => import("react/jsx-runtime").JSX.Element;
|
|
5
3
|
export { Toaster };
|
|
@@ -10,6 +10,12 @@ export const SourceListItem = React.forwardRef(({ source, isSelected, className,
|
|
|
10
10
|
// Focus state - matching FileSystemItem
|
|
11
11
|
"focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",
|
|
12
12
|
// Selected state - matching FileSystemItem
|
|
13
|
-
isSelected && "bg-accent", className), onClick: () => window.open(source.url, "_blank"), ...props, children: [
|
|
13
|
+
isSelected && "bg-accent", className), onClick: () => window.open(source.url, "_blank"), ...props, children: [
|
|
14
|
+
_jsx("div", { className: "shrink-0 flex items-center h-5", children: _jsx("div", { className: "relative rounded-[3px] size-4 overflow-hidden bg-muted", children: source.favicon ? (_jsx("img", { alt: source.sourceName, className: "size-full object-cover", src: source.favicon })) : (_jsx("div", { className: "size-full bg-muted" })) }) }), _jsxs("div", { className: "flex flex-1 flex-col gap-1 min-w-0", children: [
|
|
15
|
+
_jsxs("div", { className: "text-paragraph-sm text-foreground", children: [
|
|
16
|
+
_jsx("span", { className: "font-medium", children: source.sourceName }), _jsxs("span", { className: "text-muted-foreground", children: [" \u00B7 ", source.title] })
|
|
17
|
+
] }), _jsx("p", { className: "text-paragraph-sm text-muted-foreground line-clamp-3", children: source.snippet })
|
|
18
|
+
] })
|
|
19
|
+
] }));
|
|
14
20
|
});
|
|
15
21
|
SourceListItem.displayName = "SourceListItem";
|
|
@@ -31,4 +31,4 @@ export interface SubAgentDetailsProps {
|
|
|
31
31
|
* - Renders content as markdown
|
|
32
32
|
* - Renders in a collapsible section (collapsed by default)
|
|
33
33
|
*/
|
|
34
|
-
export declare function SubAgentDetails({ port, sessionId, host, parentStatus, agentName, query, isExpanded: controlledIsExpanded, onExpandChange, storedMessages, isReplay
|
|
34
|
+
export declare function SubAgentDetails({ port, sessionId, host, parentStatus, agentName, query, isExpanded: controlledIsExpanded, onExpandChange, storedMessages, isReplay }: SubAgentDetailsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -116,12 +116,23 @@ export function SubAgentDetails({ port, sessionId, host, parentStatus, agentName
|
|
|
116
116
|
? (query.split("\n")[0] ?? "").slice(0, 100) +
|
|
117
117
|
(query.length > 100 ? "..." : "")
|
|
118
118
|
: "";
|
|
119
|
-
return (_jsxs("div", { children: [!isExpanded && (_jsx("div", { className: "w-full max-w-md", children: previewText ? (_jsx("p", { className: "text-paragraph-sm text-muted-foreground/70 truncate", children: previewText })) : queryFirstLine ? (_jsx("p", { className: "text-paragraph-sm text-muted-foreground/50 truncate", children: queryFirstLine })) : null })), isExpanded && (_jsxs("div", { className: "space-y-3", children: [(agentName || query) && (_jsxs("div", { children: [
|
|
119
|
+
return (_jsxs("div", { children: [!isExpanded && (_jsx("div", { className: "w-full max-w-md", children: previewText ? (_jsx("p", { className: "text-paragraph-sm text-muted-foreground/70 truncate", children: previewText })) : queryFirstLine ? (_jsx("p", { className: "text-paragraph-sm text-muted-foreground/50 truncate", children: queryFirstLine })) : null })), isExpanded && (_jsxs("div", { className: "space-y-3", children: [(agentName || query) && (_jsxs("div", { children: [
|
|
120
|
+
_jsx("div", { className: "text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans", children: "Input" }), _jsxs("div", { className: "text-[11px] font-mono space-y-1", children: [agentName && (_jsxs("div", { children: [
|
|
121
|
+
_jsx("span", { className: "text-muted-foreground", children: "agentName: " }), _jsx("span", { className: "text-foreground", children: agentName })
|
|
122
|
+
] })), query && (_jsxs("div", { children: [
|
|
123
|
+
_jsx("span", { className: "text-muted-foreground", children: "query: " }), _jsx("span", { className: "text-foreground", children: query })
|
|
124
|
+
] }))] })
|
|
125
|
+
] })), _jsxs("div", { children: [
|
|
126
|
+
_jsxs("button", { type: "button", onClick: () => setIsThinkingExpanded(!isThinkingExpanded), className: "flex items-center gap-2 cursor-pointer bg-transparent border-none p-0 text-left group", children: [
|
|
127
|
+
_jsx("div", { className: "text-[10px] font-bold text-muted-foreground uppercase tracking-wider font-sans", children: "Stream" }), _jsx(ChevronDown, { className: `h-3 w-3 text-muted-foreground/70 transition-transform duration-200 ${isThinkingExpanded ? "rotate-180" : ""}` })
|
|
128
|
+
] }), isThinkingExpanded && (_jsxs("div", { ref: thinkingContainerRef, className: "mt-2 rounded-md overflow-hidden bg-muted/30 border border-border/50 max-h-[200px] overflow-y-auto", children: [error && (_jsxs("div", { className: "px-2 py-2 text-[11px] text-destructive", children: ["Error: ", error] })), !error && !hasContent && isRunning && (_jsx("div", { className: "px-2 py-2 text-[11px] text-muted-foreground", children: "Waiting for sub-agent response..." })), currentMessage && (_jsxs("div", { className: "px-2 py-2 space-y-2", children: [currentMessage.contentBlocks &&
|
|
120
129
|
currentMessage.contentBlocks.length > 0
|
|
121
130
|
? // Render interleaved content blocks
|
|
122
131
|
currentMessage.contentBlocks.map((block, blockIdx) => block.type === "text" ? (_jsx("div", { className: "text-[11px] text-foreground prose prose-sm dark:prose-invert max-w-none prose-p:my-1 prose-pre:my-1 prose-code:text-[10px]", children: _jsx(MarkdownRenderer, { content: block.text }) }, `text-${block.text.slice(0, 30)}-${blockIdx}`)) : (_jsx(SubagentToolCallItem, { toolCall: block.toolCall }, block.toolCall.id)))
|
|
123
132
|
: // Fallback to legacy content with markdown
|
|
124
|
-
currentMessage.content && (_jsx("div", { className: "text-[11px] text-foreground prose prose-sm dark:prose-invert max-w-none prose-p:my-1 prose-pre:my-1 prose-code:text-[10px]", children: _jsx(MarkdownRenderer, { content: currentMessage.content }) })), currentMessage.isStreaming && (_jsx("span", { className: "inline-block w-1.5 h-3 bg-primary/70 ml-0.5 animate-pulse" }))] }))] }))] }), !isRunning && currentMessage?.content && (_jsxs("div", { children: [
|
|
133
|
+
currentMessage.content && (_jsx("div", { className: "text-[11px] text-foreground prose prose-sm dark:prose-invert max-w-none prose-p:my-1 prose-pre:my-1 prose-code:text-[10px]", children: _jsx(MarkdownRenderer, { content: currentMessage.content }) })), currentMessage.isStreaming && (_jsx("span", { className: "inline-block w-1.5 h-3 bg-primary/70 ml-0.5 animate-pulse" }))] }))] }))] }), !isRunning && currentMessage?.content && (_jsxs("div", { children: [
|
|
134
|
+
_jsx("div", { className: "text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans", children: "Output" }), _jsx("div", { className: "text-[11px] text-foreground max-h-[200px] overflow-y-auto rounded-md bg-muted/30 border border-border/50 px-2 py-2 prose prose-sm dark:prose-invert max-w-none prose-p:my-1 prose-pre:my-1 prose-code:text-[10px]", children: _jsx(MarkdownRenderer, { content: currentMessage.content }) })
|
|
135
|
+
] }))] }))] }));
|
|
125
136
|
}
|
|
126
137
|
/**
|
|
127
138
|
* Simple tool call display for sub-agent tool calls
|
|
@@ -139,5 +150,6 @@ function SubagentToolCallItem({ toolCall }) {
|
|
|
139
150
|
completed: "text-green-500",
|
|
140
151
|
failed: "text-destructive",
|
|
141
152
|
}[toolCall.status];
|
|
142
|
-
return (_jsxs("div", { className: "flex items-center gap-2 text-[10px] text-muted-foreground", children: [
|
|
153
|
+
return (_jsxs("div", { className: "flex items-center gap-2 text-[10px] text-muted-foreground", children: [
|
|
154
|
+
_jsx("span", { className: statusColor, children: statusIcon }), _jsx("span", { className: "font-medium", children: toolCall.prettyName || toolCall.title }), toolCall.status === "in_progress" && (_jsx(Loader2, { className: "h-2.5 w-2.5 animate-spin" }))] }));
|
|
143
155
|
}
|
|
@@ -28,7 +28,11 @@ export const Task = React.forwardRef(({ task, collapsible = true, defaultExpande
|
|
|
28
28
|
}
|
|
29
29
|
onTaskClick?.(task);
|
|
30
30
|
};
|
|
31
|
-
return (_jsxs("div", { ref: ref, className: cn("rounded-lg border border-border bg-card transition-all", "hover:shadow-sm hover:border-border/80", className), ...props, children: [
|
|
31
|
+
return (_jsxs("div", { ref: ref, className: cn("rounded-lg border border-border bg-card transition-all", "hover:shadow-sm hover:border-border/80", className), ...props, children: [
|
|
32
|
+
_jsxs("button", { type: "button", onClick: handleClick, className: cn("w-full flex items-center gap-3 px-3 py-2.5 text-left", hasDetails && collapsible && "cursor-pointer"), disabled: !hasDetails && !collapsible, children: [
|
|
33
|
+
_jsx(StatusIcon, { className: cn("w-4 h-4 shrink-0", getStatusColor(), task.status === "in_progress" && "animate-spin") }), _jsx("span", { className: cn("flex-1 text-paragraph-sm font-[var(--font-family)]", task.status === "completed" && "line-through opacity-60", task.status === "in_progress" && "font-medium"), children: task.text }), hasDetails && collapsible && (_jsx(ChevronDown, { className: cn("w-4 h-4 text-foreground opacity-50 transition-transform duration-200 shrink-0", isExpanded && "rotate-180"), "aria-hidden": "true" }))] }), hasDetails && isExpanded && (_jsxs("div", { className: "px-3 pb-3 pt-1 border-t border-border/50 animate-fadeIn", children: [task.details && (_jsx("p", { className: "text-paragraph-sm text-foreground opacity-80 leading-relaxed mb-2", children: task.details })), task.files && task.files.length > 0 && (_jsxs("div", { className: "space-y-1", children: [
|
|
34
|
+
_jsx("span", { className: "text-caption font-medium text-foreground opacity-60 uppercase tracking-wide", children: "Files:" }), _jsx("div", { className: "space-y-1", children: task.files.map((file) => (_jsx("div", { className: "text-caption font-mono text-foreground opacity-70 bg-background px-2 py-1 rounded border border-border/50", children: file }, file))) })
|
|
35
|
+
] }))] }))] }));
|
|
32
36
|
});
|
|
33
37
|
Task.displayName = "Subagent";
|
|
34
38
|
export const TaskList = React.forwardRef(({ tasks, collapsible = true, onTaskClick, emptyMessage = "No subagents yet.", className, ...props }, ref) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const textareaVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "default" | "error" | "success" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, VariantProps<typeof textareaVariants> {
|
|
7
7
|
autoResize?: boolean;
|
|
@@ -9,6 +9,6 @@ type ThemeProviderState = {
|
|
|
9
9
|
setTheme: (theme: Theme) => void;
|
|
10
10
|
resolvedTheme: "dark" | "light";
|
|
11
11
|
};
|
|
12
|
-
export declare function ThemeProvider({ children, defaultTheme, storageKey
|
|
12
|
+
export declare function ThemeProvider({ children, defaultTheme, storageKey }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare const useTheme: () => ThemeProviderState;
|
|
14
14
|
export {};
|
|
@@ -5,5 +5,11 @@ import { IconButton } from "./IconButton.js";
|
|
|
5
5
|
import { useTheme } from "./ThemeProvider.js";
|
|
6
6
|
export function ThemeToggle() {
|
|
7
7
|
const { setTheme } = useTheme();
|
|
8
|
-
return (_jsxs(DropdownMenu, { children: [
|
|
8
|
+
return (_jsxs(DropdownMenu, { children: [
|
|
9
|
+
_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(IconButton, { children: [
|
|
10
|
+
_jsx(Sun, { className: "size-4 text-muted-foreground rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }), _jsx(Moon, { className: "absolute size-4 text-muted-foreground rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" }), _jsx("span", { className: "sr-only", children: "Toggle theme" })
|
|
11
|
+
] }) }), _jsxs(DropdownMenuContent, { align: "end", children: [
|
|
12
|
+
_jsx(DropdownMenuItem, { onClick: () => setTheme("light"), children: "Light" }), _jsx(DropdownMenuItem, { onClick: () => setTheme("dark"), children: "Dark" }), _jsx(DropdownMenuItem, { onClick: () => setTheme("system"), children: "System" })
|
|
13
|
+
] })
|
|
14
|
+
] }));
|
|
9
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
declare const thinkingBlockVariants: (props?: ({
|
|
3
|
-
variant?: "default" | "
|
|
3
|
+
variant?: "default" | "prominent" | "subtle" | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
5
|
export interface ThinkingBlockProps extends VariantProps<typeof thinkingBlockVariants> {
|
|
6
6
|
thinking?: string;
|
|
@@ -8,5 +8,5 @@ export interface ThinkingBlockProps extends VariantProps<typeof thinkingBlockVar
|
|
|
8
8
|
displayMode?: "collapsible" | "inline";
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare function ThinkingBlock({ thinking, isStreaming, displayMode, variant, className
|
|
11
|
+
export declare function ThinkingBlock({ thinking, isStreaming, displayMode, variant, className }: ThinkingBlockProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
12
|
export {};
|
|
@@ -33,8 +33,15 @@ export function ThinkingBlock({ thinking, isStreaming, displayMode = "collapsibl
|
|
|
33
33
|
}
|
|
34
34
|
// Inline mode - always visible
|
|
35
35
|
if (displayMode === "inline") {
|
|
36
|
-
return (_jsxs("div", { className: cn(thinkingBlockVariants({ variant }), className), children: [
|
|
36
|
+
return (_jsxs("div", { className: cn(thinkingBlockVariants({ variant }), className), children: [
|
|
37
|
+
_jsxs("div", { className: "flex items-start gap-2", children: [
|
|
38
|
+
_jsx("span", { className: "text-caption font-medium text-foreground opacity-60 uppercase tracking-wide", children: "Thinking" }), isStreaming && (_jsx("span", { className: "inline-block w-2 h-2 bg-primary rounded-full animate-pulse" }))] }), _jsxs("div", { className: "mt-2 text-paragraph-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap", children: [thinking, isStreaming && thinking && (_jsx("span", { className: "inline-block animate-typing", children: "..." }))] })
|
|
39
|
+
] }));
|
|
37
40
|
}
|
|
38
41
|
// Collapsible mode
|
|
39
|
-
return (_jsxs("div", { className: cn("mb-3", className), children: [
|
|
42
|
+
return (_jsxs("div", { className: cn("mb-3", className), children: [
|
|
43
|
+
_jsxs("button", { type: "button", onClick: () => setIsExpanded(!isExpanded), className: "w-full flex items-center justify-between p-2 rounded-lg bg-card border border-border hover:bg-card transition-colors text-left", children: [
|
|
44
|
+
_jsxs("div", { className: "flex items-center gap-2", children: [
|
|
45
|
+
_jsx("span", { className: "text-caption font-medium text-foreground opacity-60 uppercase tracking-wide", children: "Thinking" }), isStreaming && (_jsx("span", { className: "inline-block w-2 h-2 bg-primary rounded-full animate-pulse" })), !isExpanded && thinking && (_jsxs("span", { className: "text-caption text-foreground opacity-50 truncate max-w-[200px]", children: [thinking.substring(0, 50), "..."] }))] }), _jsx(ChevronDown, { className: thinkingIconVariants({ expanded: isExpanded }) })
|
|
46
|
+
] }), isExpanded && (_jsx("div", { className: cn(thinkingBlockVariants({ variant }), "mt-2"), children: _jsxs("div", { className: "text-paragraph-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap", children: [thinking, isStreaming && thinking && (_jsx("span", { className: "inline-block animate-typing", children: "..." }))] }) }))] }));
|
|
40
47
|
}
|
|
@@ -7,7 +7,11 @@ import { TodoListItem } from "./TodoListItem.js";
|
|
|
7
7
|
* Empty state component for the todo list
|
|
8
8
|
*/
|
|
9
9
|
function TodoListEmptyState() {
|
|
10
|
-
return (_jsxs("div", { className: "flex flex-col items-center justify-center h-full gap-3", children: [
|
|
10
|
+
return (_jsxs("div", { className: "flex flex-col items-center justify-center h-full gap-3", children: [
|
|
11
|
+
_jsx(SquareCheckBig, { className: "size-8 text-neutral-300" }), _jsxs("p", { className: "text-base leading-6 text-neutral-400 text-center", children: ["There's nothing on the",
|
|
12
|
+
_jsx("br", {}),
|
|
13
|
+
"to-do list yet."] })
|
|
14
|
+
] }));
|
|
11
15
|
}
|
|
12
16
|
export const TodoList = React.forwardRef(({ client, todos, className, ...props }, ref) => {
|
|
13
17
|
// For now, just use prop-based todos
|
|
@@ -15,10 +15,12 @@ export const TodoListItem = React.forwardRef(({ todo, className, ...props }, ref
|
|
|
15
15
|
// Focus state - matching FileSystemItem
|
|
16
16
|
"focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-border-dark",
|
|
17
17
|
// Selected state (if needed later)
|
|
18
|
-
isSelected && "bg-accent", className), role: "button", tabIndex: 0, ...props, children: [
|
|
18
|
+
isSelected && "bg-accent", className), role: "button", tabIndex: 0, ...props, children: [
|
|
19
|
+
_jsx("div", { className: "shrink-0 size-4 flex items-center justify-center text-foreground", children: todo.status === "completed" ? (_jsx(CircleCheck, { className: "size-4 text-muted-foreground" })) : todo.status === "in_progress" ? (_jsx("div", { className: "size-2.5 rounded-full bg-foreground animate-pulse-scale" })) : (_jsx(Circle, { className: "size-4 text-foreground" })) }), _jsx("p", { className: cn("flex-1 text-foreground",
|
|
19
20
|
// Completed state: strikethrough + muted color
|
|
20
21
|
isCompleted && "line-through text-muted-foreground",
|
|
21
22
|
// In-progress state: medium weight for emphasis
|
|
22
|
-
todo.status === "in_progress" && "font-medium"), children: todo.text })
|
|
23
|
+
todo.status === "in_progress" && "font-medium"), children: todo.text })
|
|
24
|
+
] }));
|
|
23
25
|
});
|
|
24
26
|
TodoListItem.displayName = "TodoListItem";
|