@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.
Files changed (93) hide show
  1. package/dist/core/hooks/use-chat-messages.d.ts +8 -8
  2. package/dist/core/hooks/use-chat-session.d.ts +1 -1
  3. package/dist/core/hooks/use-tool-calls.d.ts +155 -7
  4. package/dist/core/schemas/chat.d.ts +28 -28
  5. package/dist/core/schemas/tool-call.d.ts +34 -34
  6. package/dist/gui/components/AppSidebar.d.ts +1 -1
  7. package/dist/gui/components/AppSidebar.js +7 -1
  8. package/dist/gui/components/Button.d.ts +2 -2
  9. package/dist/gui/components/ChatEmptyState.js +9 -1
  10. package/dist/gui/components/ChatInput.js +4 -2
  11. package/dist/gui/components/ChatInputCommandMenu.js +5 -1
  12. package/dist/gui/components/ChatLayout.js +13 -6
  13. package/dist/gui/components/ChatPanelTabContent.js +17 -2
  14. package/dist/gui/components/ChatSecondaryPanel.js +5 -2
  15. package/dist/gui/components/ChatView.d.ts +1 -1
  16. package/dist/gui/components/ChatView.js +38 -6
  17. package/dist/gui/components/ContextUsageButton.js +41 -3
  18. package/dist/gui/components/Conversation.js +4 -1
  19. package/dist/gui/components/Dialog.d.ts +8 -8
  20. package/dist/gui/components/Dialog.js +6 -1
  21. package/dist/gui/components/DropdownMenu.d.ts +4 -4
  22. package/dist/gui/components/DropdownMenu.js +6 -3
  23. package/dist/gui/components/FileSystemItem.d.ts +1 -1
  24. package/dist/gui/components/FileSystemItem.js +7 -3
  25. package/dist/gui/components/FileSystemView.d.ts +1 -1
  26. package/dist/gui/components/HeightTransition.d.ts +1 -1
  27. package/dist/gui/components/HookNotification.js +39 -3
  28. package/dist/gui/components/Input.d.ts +1 -1
  29. package/dist/gui/components/MarkdownRenderer.d.ts +1 -1
  30. package/dist/gui/components/Message.d.ts +2 -2
  31. package/dist/gui/components/MessageContent.d.ts +2 -2
  32. package/dist/gui/components/MessageContent.js +3 -2
  33. package/dist/gui/components/Reasoning.d.ts +1 -1
  34. package/dist/gui/components/Reasoning.js +10 -3
  35. package/dist/gui/components/Select.js +9 -4
  36. package/dist/gui/components/SessionHistory.d.ts +1 -1
  37. package/dist/gui/components/SessionHistory.js +10 -3
  38. package/dist/gui/components/SessionHistoryItem.js +10 -2
  39. package/dist/gui/components/Sheet.d.ts +9 -9
  40. package/dist/gui/components/Sheet.js +6 -1
  41. package/dist/gui/components/Sidebar.d.ts +5 -6
  42. package/dist/gui/components/Sidebar.js +12 -5
  43. package/dist/gui/components/SidebarToggle.d.ts +1 -1
  44. package/dist/gui/components/Sonner.d.ts +1 -3
  45. package/dist/gui/components/SourceListItem.js +7 -1
  46. package/dist/gui/components/SubAgentDetails.d.ts +1 -1
  47. package/dist/gui/components/SubAgentDetails.js +15 -3
  48. package/dist/gui/components/Task.js +5 -1
  49. package/dist/gui/components/Textarea.d.ts +1 -1
  50. package/dist/gui/components/ThemeProvider.d.ts +1 -1
  51. package/dist/gui/components/ThemeToggle.js +7 -1
  52. package/dist/gui/components/ThinkingBlock.d.ts +2 -2
  53. package/dist/gui/components/ThinkingBlock.js +9 -2
  54. package/dist/gui/components/TodoList.js +5 -1
  55. package/dist/gui/components/TodoListItem.js +4 -2
  56. package/dist/gui/components/TodoSubline.js +2 -1
  57. package/dist/gui/components/ToolCallList.d.ts +1 -1
  58. package/dist/gui/components/ToolCallList.js +5 -1
  59. package/dist/gui/components/ToolOperation.d.ts +1 -1
  60. package/dist/gui/components/ToolOperation.js +75 -17
  61. package/dist/gui/components/WorkProgress.d.ts +1 -1
  62. package/dist/gui/components/resizable.d.ts +34 -2
  63. package/dist/gui/components/resizable.js +3 -1
  64. package/dist/sdk/schemas/agent.d.ts +4 -4
  65. package/dist/sdk/schemas/message.d.ts +13 -13
  66. package/dist/sdk/schemas/session.d.ts +46 -46
  67. package/dist/sdk/transports/http.d.ts +0 -10
  68. package/dist/tui/components/ChatView.js +3 -1
  69. package/dist/tui/components/GameOfLife.js +4 -2
  70. package/dist/tui/components/InputBox.d.ts +1 -1
  71. package/dist/tui/components/InputBox.js +8 -1
  72. package/dist/tui/components/MessageList.js +3 -1
  73. package/dist/tui/components/MultiSelect.d.ts +1 -1
  74. package/dist/tui/components/MultiSelect.js +5 -3
  75. package/dist/tui/components/ReadlineInput.d.ts +1 -1
  76. package/dist/tui/components/ReadlineInput.js +4 -2
  77. package/dist/tui/components/SimpleTextInput.d.ts +1 -1
  78. package/dist/tui/components/SimpleTextInput.js +4 -2
  79. package/dist/tui/components/SingleSelect.d.ts +1 -1
  80. package/dist/tui/components/SingleSelect.js +5 -3
  81. package/dist/tui/components/StatusBar.d.ts +1 -1
  82. package/dist/tui/components/StatusBar.js +8 -3
  83. package/dist/tui/components/ToolCall.js +3 -1
  84. package/dist/tui/components/ToolCallList.js +5 -1
  85. package/package.json +7 -7
  86. package/dist/gui/components/InvokingGroup.d.ts +0 -9
  87. package/dist/gui/components/InvokingGroup.js +0 -16
  88. package/dist/gui/components/SubagentStream.d.ts +0 -23
  89. package/dist/gui/components/SubagentStream.js +0 -98
  90. package/dist/gui/components/ToolCall.d.ts +0 -8
  91. package/dist/gui/components/ToolCall.js +0 -234
  92. package/dist/gui/components/ToolCallGroup.d.ts +0 -8
  93. package/dist/gui/components/ToolCallGroup.js +0 -29
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Slot } from "@radix-ui/react-slot";
3
3
  import { Mic, Paperclip, SquareSlash } from "lucide-react";
4
4
  import * as React from "react";
@@ -414,7 +414,9 @@ const ChatInputAttachment = React.forwardRef(({ asChild = false, className, chil
414
414
  fileInputRef.current?.click();
415
415
  };
416
416
  const Comp = asChild ? Slot : Button;
417
- return (_jsxs(_Fragment, { children: [_jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", multiple: true, style: { display: "none" }, onChange: handleFileChange }), _jsx(Comp, { ref: ref, type: "button", variant: "ghost", size: "icon", className: cn("rounded-full", className), onClick: handleClick, ...props, children: children || _jsx(Paperclip, { className: "size-4" }) })] }));
417
+ return (_jsxs(_Fragment, { children: [
418
+ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", multiple: true, style: { display: "none" }, onChange: handleFileChange }), _jsx(Comp, { ref: ref, type: "button", variant: "ghost", size: "icon", className: cn("rounded-full", className), onClick: handleClick, ...props, children: children || _jsx(Paperclip, { className: "size-4" }) })
419
+ ] }));
418
420
  });
419
421
  ChatInputAttachment.displayName = "ChatInput.Attachment";
420
422
  const ChatInputVoiceInput = React.forwardRef(({ asChild = false, className, children, ...props }, ref) => {
@@ -57,6 +57,10 @@ export const ChatInputCommandMenu = React.forwardRef(({ commands = [], showComma
57
57
  if (!showCommandMenu || filteredCommands.length === 0) {
58
58
  return null;
59
59
  }
60
- return (_jsxs("div", { ref: ref, className: cn("absolute bottom-full left-0 z-50 mb-2 w-full max-w-md", "rounded-md border border-border bg-card p-2 shadow-lg", className), ...props, children: [_jsx("div", { className: "text-caption font-semibold text-muted-foreground px-2 py-1", children: "Commands" }), _jsx("div", { className: "max-h-64 overflow-y-auto", children: filteredCommands.map((command, index) => (_jsxs("button", { type: "button", onClick: () => command.onSelect(), className: cn("w-full rounded-sm px-2 py-2 text-left text-paragraph-sm transition-colors", "flex items-start gap-2", "hover:bg-muted", index === selectedMenuIndex && "bg-muted"), children: [command.icon && (_jsx("span", { className: "shrink-0 mt-0.5", children: command.icon })), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "font-medium", children: command.label }), command.description && (_jsx("div", { className: "text-caption text-muted-foreground truncate", children: command.description }))] })] }, command.id))) })] }));
60
+ return (_jsxs("div", { ref: ref, className: cn("absolute bottom-full left-0 z-50 mb-2 w-full max-w-md", "rounded-md border border-border bg-card p-2 shadow-lg", className), ...props, children: [
61
+ _jsx("div", { className: "text-caption font-semibold text-muted-foreground px-2 py-1", children: "Commands" }), _jsx("div", { className: "max-h-64 overflow-y-auto", children: filteredCommands.map((command, index) => (_jsxs("button", { type: "button", onClick: () => command.onSelect(), className: cn("w-full rounded-sm px-2 py-2 text-left text-paragraph-sm transition-colors", "flex items-start gap-2", "hover:bg-muted", index === selectedMenuIndex && "bg-muted"), children: [command.icon && (_jsx("span", { className: "shrink-0 mt-0.5", children: command.icon })), _jsxs("div", { className: "flex-1 min-w-0", children: [
62
+ _jsx("div", { className: "font-medium", children: command.label }), command.description && (_jsx("div", { className: "text-caption text-muted-foreground truncate", children: command.description }))] })
63
+ ] }, command.id))) })
64
+ ] }));
61
65
  });
62
66
  ChatInputCommandMenu.displayName = "ChatInputCommandMenu";
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AnimatePresence, motion, useMotionValue } from "framer-motion";
3
3
  import { ArrowDown, X } from "lucide-react";
4
4
  import * as React from "react";
@@ -114,7 +114,10 @@ const ChatLayoutMessages = React.forwardRef(({ className, children, onScrollChan
114
114
  }, [initialScrollToBottom, containerRef]);
115
115
  // Show scroll button when not at bottom
116
116
  const showScrollButton = !isAtBottom && showScrollToBottom;
117
- return (_jsxs("div", { className: "relative flex-1 overflow-hidden", children: [_jsxs("div", { ref: containerRef, className: cn("h-full overflow-y-auto flex flex-col", className), ...props, children: [_jsx("div", { className: "mx-auto max-w-chat flex-1 w-full flex flex-col", children: children }), _jsx("div", { ref: endRef, className: "shrink-0" })] }), showScrollButton && (_jsx("button", { type: "button", onClick: () => scrollToBottom("smooth"), className: cn("absolute bottom-4 left-1/2 -translate-x-1/2 z-10", "flex items-center justify-center p-2 rounded-full", "bg-card border border-border shadow-lg", "text-foreground", "hover:bg-accent hover:text-accent-foreground", "transition-all duration-200 ease-in-out", "animate-in fade-in slide-in-from-bottom-2"), "aria-label": "Scroll to bottom", children: _jsx(ArrowDown, { className: "size-4" }) }))] }));
117
+ return (_jsxs("div", { className: "relative flex-1 overflow-hidden", children: [
118
+ _jsxs("div", { ref: containerRef, className: cn("h-full overflow-y-auto flex flex-col", className), ...props, children: [
119
+ _jsx("div", { className: "mx-auto max-w-chat flex-1 w-full flex flex-col", children: children }), _jsx("div", { ref: endRef, className: "shrink-0" })
120
+ ] }), showScrollButton && (_jsx("button", { type: "button", onClick: () => scrollToBottom("smooth"), className: cn("absolute bottom-4 left-1/2 -translate-x-1/2 z-10", "flex items-center justify-center p-2 rounded-full", "bg-card border border-border shadow-lg", "text-foreground", "hover:bg-accent hover:text-accent-foreground", "transition-all duration-200 ease-in-out", "animate-in fade-in slide-in-from-bottom-2"), "aria-label": "Scroll to bottom", children: _jsx(ArrowDown, { className: "size-4" }) }))] }));
118
121
  });
119
122
  ChatLayoutMessages.displayName = "ChatLayout.Messages";
120
123
  const ChatLayoutFooter = React.forwardRef(({ className, children, ...props }, ref) => {
@@ -182,10 +185,12 @@ const ChatLayoutAside = React.forwardRef(({ breakpoint = "md", onClose, classNam
182
185
  }, [isDragging, widthMotionValue, setIsDraggingAside]);
183
186
  return (_jsx(AnimatePresence, { initial: false, mode: "wait", children: isVisible && (_jsxs(_Fragment, { children: [isMobile && (_jsx(motion.aside, { variants: asideMobileVariants, initial: "initial", animate: "animate", exit: "exit", transition: asideMobileTransition, className: cn("fixed inset-0 z-50 bg-card", "flex flex-col",
184
187
  // Only visible on mobile (< 768px)
185
- "block md:hidden", className), "data-aside": "aside", "data-mobile": "true", children: _jsxs(motion.div, { className: "flex flex-col h-full", variants: asideContentVariants, initial: "initial", animate: "animate", transition: asideContentTransition, children: [_jsx("div", { className: "flex justify-end px-4 pt-3 shrink-0", children: _jsx(IconButton, { onClick: () => {
188
+ "block md:hidden", className), "data-aside": "aside", "data-mobile": "true", children: _jsxs(motion.div, { className: "flex flex-col h-full", variants: asideContentVariants, initial: "initial", animate: "animate", transition: asideContentTransition, children: [
189
+ _jsx("div", { className: "flex justify-end px-4 pt-3 shrink-0", children: _jsx(IconButton, { onClick: () => {
186
190
  onClose?.();
187
191
  togglePanel();
188
- }, "aria-label": "Close panel", children: _jsx(X, { className: "size-4" }) }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: children })] }) }, "aside-mobile")), !isMobile && (_jsx(motion.aside, { ref: ref, initial: { width: 0, opacity: 0 }, animate: {
192
+ }, "aria-label": "Close panel", children: _jsx(X, { className: "size-4" }) }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: children })
193
+ ] }) }, "aside-mobile")), !isMobile && (_jsx(motion.aside, { ref: ref, initial: { width: 0, opacity: 0 }, animate: {
189
194
  width: committedWidth,
190
195
  opacity: 1,
191
196
  }, exit: { width: 0, opacity: 0 }, style: {
@@ -204,11 +209,13 @@ const ChatLayoutAside = React.forwardRef(({ breakpoint = "md", onClose, classNam
204
209
  // Hidden by default, visible at breakpoint
205
210
  "hidden h-full border-l border-border bg-card overflow-hidden relative",
206
211
  // Breakpoint visibility
207
- breakpoint === "sm" && "sm:block", breakpoint === "md" && "md:block", breakpoint === "lg" && "lg:block", breakpoint === "xl" && "xl:block", breakpoint === "2xl" && "2xl:block", className), "data-aside": "aside", children: _jsxs(motion.div, { className: "flex flex-col h-full", variants: asideContentVariants, initial: "initial", animate: "animate", transition: asideContentTransition, children: [_jsx("div", { onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp, className: cn("absolute left-0 inset-y-0 w-2 -ml-1 cursor-col-resize z-10", "group flex items-center justify-center", "hover:bg-primary/5 transition-colors delay-300", isDragging && "bg-primary/10") }), _jsx("div", { className: cn("h-full overflow-y-auto", isDragging ? "w-full" : undefined), style: !isDragging
212
+ breakpoint === "sm" && "sm:block", breakpoint === "md" && "md:block", breakpoint === "lg" && "lg:block", breakpoint === "xl" && "xl:block", breakpoint === "2xl" && "2xl:block", className), "data-aside": "aside", children: _jsxs(motion.div, { className: "flex flex-col h-full", variants: asideContentVariants, initial: "initial", animate: "animate", transition: asideContentTransition, children: [
213
+ _jsx("div", { onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp, className: cn("absolute left-0 inset-y-0 w-2 -ml-1 cursor-col-resize z-10", "group flex items-center justify-center", "hover:bg-primary/5 transition-colors delay-300", isDragging && "bg-primary/10") }), _jsx("div", { className: cn("h-full overflow-y-auto", isDragging ? "w-full" : undefined), style: !isDragging
208
214
  ? {
209
215
  width: `${committedWidth}px`,
210
216
  }
211
- : undefined, children: children })] }) }, "aside-desktop"))] })) }));
217
+ : undefined, children: children })
218
+ ] }) }, "aside-desktop"))] })) }));
212
219
  });
213
220
  ChatLayoutAside.displayName = "ChatLayout.Aside";
214
221
  /* -------------------------------------------------------------------------------------------------
@@ -38,10 +38,25 @@ export const SourcesTabContent = React.forwardRef(({ sources, className, ...prop
38
38
  });
39
39
  SourcesTabContent.displayName = "SourcesTabContent";
40
40
  export const DatabaseTabContent = React.forwardRef(({ data, className, ...props }, ref) => {
41
- return (_jsxs("div", { ref: ref, className: cn("space-y-4", className), ...props, children: [_jsx("h3", { className: "font-semibold text-subheading", children: "Database" }), _jsxs("div", { className: "text-paragraph-sm text-muted-foreground", children: [_jsx("p", { children: "Database viewer - panel automatically expanded to large size" }), _jsxs("div", { className: "mt-4 p-4 border border-border rounded", children: [_jsx("p", { children: "Your large data table would go here" }), data && typeof data === "object" ? (_jsx("pre", { className: "mt-2 text-caption overflow-auto", children: JSON.stringify(data, null, 2) })) : null] })] })] }));
41
+ return (_jsxs("div", { ref: ref, className: cn("space-y-4", className), ...props, children: [
42
+ _jsx("h3", { className: "font-semibold text-subheading", children: "Database" }), _jsxs("div", { className: "text-paragraph-sm text-muted-foreground", children: [
43
+ _jsx("p", { children: "Database viewer - panel automatically expanded to large size" }), _jsxs("div", { className: "mt-4 p-4 border border-border rounded", children: [
44
+ _jsx("p", { children: "Your large data table would go here" }), data && typeof data === "object" ? (_jsx("pre", { className: "mt-2 text-caption overflow-auto", children: JSON.stringify(data, null, 2) })) : null] })
45
+ ] })
46
+ ] }));
42
47
  });
43
48
  DatabaseTabContent.displayName = "DatabaseTabContent";
44
49
  export const SettingsTabContent = React.forwardRef(({ tools = [], mcps = [], subagents = [], className, ...props }, ref) => {
45
- return (_jsxs("div", { ref: ref, className: cn("space-y-6", className), ...props, children: [_jsxs("div", { className: "space-y-3 p-2", children: [_jsx("h3", { className: "font-semibold text-subheading", children: "Tools" }), tools.length > 0 ? (_jsx("div", { className: "space-y-2", children: tools.map((tool) => (_jsxs("div", { className: "p-3 border border-border rounded-lg bg-muted/30", children: [_jsx("div", { className: "font-medium text-paragraph-sm", children: tool.prettyName || tool.name }), tool.description && (_jsx("div", { className: "text-caption text-muted-foreground mt-1 line-clamp-1", children: tool.description }))] }, tool.name))) })) : (_jsx("p", { className: "text-paragraph-sm text-muted-foreground", children: "No tools available" }))] }), _jsxs("div", { className: "space-y-3 p-2", children: [_jsx("h3", { className: "font-semibold text-subheading", children: "MCP Servers" }), mcps.length > 0 ? (_jsx("div", { className: "space-y-2", children: mcps.map((mcp) => (_jsxs("div", { className: "p-3 border border-border rounded-lg bg-muted/30", children: [_jsx("div", { className: "font-medium text-paragraph-sm", children: mcp.name }), _jsxs("div", { className: "text-caption text-muted-foreground mt-1", children: ["Transport: ", mcp.transport] })] }, mcp.name))) })) : (_jsx("p", { className: "text-paragraph-sm text-muted-foreground", children: "No MCP servers connected" }))] }), _jsxs("div", { className: "space-y-3 p-2", children: [_jsx("h3", { className: "font-semibold text-subheading", children: "Subagents" }), subagents.length > 0 ? (_jsx("div", { className: "space-y-2", children: subagents.map((subagent) => (_jsxs("div", { className: "p-3 border border-border rounded-lg bg-muted/30", children: [_jsx("div", { className: "font-medium text-paragraph-sm", children: subagent.name }), _jsx("div", { className: "text-caption text-muted-foreground mt-1 line-clamp-2", children: subagent.description })] }, subagent.name))) })) : (_jsx("p", { className: "text-paragraph-sm text-muted-foreground", children: "No subagents available" }))] })] }));
50
+ return (_jsxs("div", { ref: ref, className: cn("space-y-6", className), ...props, children: [
51
+ _jsxs("div", { className: "space-y-3 p-2", children: [
52
+ _jsx("h3", { className: "font-semibold text-subheading", children: "Tools" }), tools.length > 0 ? (_jsx("div", { className: "space-y-2", children: tools.map((tool) => (_jsxs("div", { className: "p-3 border border-border rounded-lg bg-muted/30", children: [
53
+ _jsx("div", { className: "font-medium text-paragraph-sm", children: tool.prettyName || tool.name }), tool.description && (_jsx("div", { className: "text-caption text-muted-foreground mt-1 line-clamp-1", children: tool.description }))] }, tool.name))) })) : (_jsx("p", { className: "text-paragraph-sm text-muted-foreground", children: "No tools available" }))] }), _jsxs("div", { className: "space-y-3 p-2", children: [
54
+ _jsx("h3", { className: "font-semibold text-subheading", children: "MCP Servers" }), mcps.length > 0 ? (_jsx("div", { className: "space-y-2", children: mcps.map((mcp) => (_jsxs("div", { className: "p-3 border border-border rounded-lg bg-muted/30", children: [
55
+ _jsx("div", { className: "font-medium text-paragraph-sm", children: mcp.name }), _jsxs("div", { className: "text-caption text-muted-foreground mt-1", children: ["Transport: ", mcp.transport] })
56
+ ] }, mcp.name))) })) : (_jsx("p", { className: "text-paragraph-sm text-muted-foreground", children: "No MCP servers connected" }))] }), _jsxs("div", { className: "space-y-3 p-2", children: [
57
+ _jsx("h3", { className: "font-semibold text-subheading", children: "Subagents" }), subagents.length > 0 ? (_jsx("div", { className: "space-y-2", children: subagents.map((subagent) => (_jsxs("div", { className: "p-3 border border-border rounded-lg bg-muted/30", children: [
58
+ _jsx("div", { className: "font-medium text-paragraph-sm", children: subagent.name }), _jsx("div", { className: "text-caption text-muted-foreground mt-1 line-clamp-2", children: subagent.description })
59
+ ] }, subagent.name))) })) : (_jsx("p", { className: "text-paragraph-sm text-muted-foreground", children: "No subagents available" }))] })
60
+ ] }));
46
61
  });
47
62
  SettingsTabContent.displayName = "SettingsTabContent";
@@ -63,9 +63,12 @@ export const ChatSecondaryPanel = React.forwardRef(({ client, todos, variant = "
63
63
  return (_jsxs(TabsTrigger, { value: tab.id, className: cn("gap-2 px-3 py-1.5 rounded-lg text-paragraph-sm font-medium", "data-[state=active]:bg-accent data-[state=active]:text-foreground", "data-[state=inactive]:text-muted-foreground"), children: [showIcons && Icon && _jsx(Icon, { className: "size-4" }), tab.label] }, tab.id));
64
64
  }) })) : (
65
65
  // Animated variant - Clip-path animation (original style)
66
- _jsxs("div", { className: "relative mb-4 border-border", children: [_jsx(TabsList, { className: "bg-transparent p-0 h-auto rounded-none w-full border-none", children: tabs.map((tab) => (_jsx(TabsTrigger, { value: tab.id, className: "px-3 py-1 text-paragraph-sm font-medium rounded-none text-foreground opacity-60 data-[state=active]:opacity-100 data-[state=active]:bg-transparent data-[state=active]:shadow-none", children: tab.label }, tab.id))) }), _jsx("div", { ref: containerRef, className: "absolute top-0 left-0 w-full overflow-hidden z-10 pointer-events-none", style: {
66
+ _jsxs("div", { className: "relative mb-4 border-border", children: [
67
+ _jsx(TabsList, { className: "bg-transparent p-0 h-auto rounded-none w-full border-none", children: tabs.map((tab) => (_jsx(TabsTrigger, { value: tab.id, className: "px-3 py-1 text-paragraph-sm font-medium rounded-none text-foreground opacity-60 data-[state=active]:opacity-100 data-[state=active]:bg-transparent data-[state=active]:shadow-none", children: tab.label }, tab.id))) }), _jsx("div", { ref: containerRef, className: "absolute top-0 left-0 w-full overflow-hidden z-10 pointer-events-none", style: {
67
68
  clipPath: "inset(0 100% 0 0% round 999px)",
68
69
  transition: "clip-path 0.25s ease-out",
69
- }, children: _jsx(TabsList, { className: "bg-secondary p-0 h-auto rounded-none w-full border-none", children: tabs.map((tab) => (_jsx(TabsTrigger, { value: tab.id, ref: activeTab === tab.id ? activeTabElementRef : null, className: "px-3 py-1 text-paragraph-sm font-medium rounded-none text-primary bg-transparent data-[state=active]:shadow-none shadow-none", tabIndex: -1, children: tab.label }, tab.id))) }) })] })), _jsx(TabsContent, { value: "todo", className: variant === "pills" ? "mt-0" : "", children: variant === "pills" ? (_jsx(TodoTabContent, { todos: todosToDisplay })) : (_jsx(TodoList, { todos: todosToDisplay })) }), _jsx(TabsContent, { value: "files", className: variant === "pills" ? "mt-0" : "", children: _jsx(FilesTabContent, {}) }), _jsx(TabsContent, { value: "database", className: variant === "pills" ? "mt-0" : "", children: _jsx("div", { className: "text-paragraph-sm text-foreground opacity-60 italic", children: "Database tab coming soon..." }) }), _jsx(TabsContent, { value: "sources", className: variant === "pills" ? "mt-0" : "", children: _jsx(SourcesTabContent, {}) })] }) }));
70
+ }, children: _jsx(TabsList, { className: "bg-secondary p-0 h-auto rounded-none w-full border-none", children: tabs.map((tab) => (_jsx(TabsTrigger, { value: tab.id, ref: activeTab === tab.id ? activeTabElementRef : null, className: "px-3 py-1 text-paragraph-sm font-medium rounded-none text-primary bg-transparent data-[state=active]:shadow-none shadow-none", tabIndex: -1, children: tab.label }, tab.id))) }) })
71
+ ] })), _jsx(TabsContent, { value: "todo", className: variant === "pills" ? "mt-0" : "", children: variant === "pills" ? (_jsx(TodoTabContent, { todos: todosToDisplay })) : (_jsx(TodoList, { todos: todosToDisplay })) }), _jsx(TabsContent, { value: "files", className: variant === "pills" ? "mt-0" : "", children: _jsx(FilesTabContent, {}) }), _jsx(TabsContent, { value: "database", className: variant === "pills" ? "mt-0" : "", children: _jsx("div", { className: "text-paragraph-sm text-foreground opacity-60 italic", children: "Database tab coming soon..." }) }), _jsx(TabsContent, { value: "sources", className: variant === "pills" ? "mt-0" : "", children: _jsx(SourcesTabContent, {}) })
72
+ ] }) }));
70
73
  });
71
74
  ChatSecondaryPanel.displayName = "ChatSecondaryPanel";
@@ -6,4 +6,4 @@ export interface ChatViewProps {
6
6
  /** Optional debugger URL for viewing sessions */
7
7
  debuggerUrl?: string;
8
8
  }
9
- export declare function ChatView({ client, initialSessionId, error: initError, debuggerUrl, }: ChatViewProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function ChatView({ client, initialSessionId, error: initError, debuggerUrl }: ChatViewProps): import("react/jsx-runtime").JSX.Element;
@@ -42,12 +42,24 @@ function ChatInputWithAttachments({ client, startSession, placeholder, commandMe
42
42
  addFileAttachment(file);
43
43
  }
44
44
  };
45
- return (_jsxs(ChatInputRoot, { client: client, startSession: startSession, children: [_jsx(ChatInputCommandMenu, { commands: commandMenuItems }), attachedFiles.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 p-3 border-b border-border", children: attachedFiles.map((file, index) => (_jsxs("div", { className: "relative group rounded-md overflow-hidden border border-border", children: [_jsx("img", { src: `data:${file.mimeType};base64,${file.data}`, alt: file.name, className: "h-20 w-20 object-cover" }), _jsx("button", { type: "button", onClick: () => removeFileAttachment(index), className: "absolute top-1 right-1 p-1 rounded-full bg-background/80 hover:bg-background opacity-0 group-hover:opacity-100 transition-opacity", children: _jsx(X, { className: "size-3" }) })] }, `attached-${file.name}-${file.data.slice(0, 20)}`))) })), _jsx(ChatInputField, { placeholder: placeholder, autoFocus: true, onFilesDropped: handleFilesSelected }), _jsxs(ChatInputToolbar, { children: [_jsxs("div", { className: "flex items-baseline gap-1", children: [_jsx(ChatInputActions, {}), _jsx(ChatInputAttachment, { onFilesSelected: handleFilesSelected })] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(ChatInputVoiceInput, {}), _jsx(ChatInputSubmit, { children: _jsx(ArrowUp, { className: "size-4" }) })] })] })] }));
45
+ return (_jsxs(ChatInputRoot, { client: client, startSession: startSession, children: [
46
+ _jsx(ChatInputCommandMenu, { commands: commandMenuItems }), attachedFiles.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 p-3 border-b border-border", children: attachedFiles.map((file, index) => (_jsxs("div", { className: "relative group rounded-md overflow-hidden border border-border", children: [
47
+ _jsx("img", { src: `data:${file.mimeType};base64,${file.data}`, alt: file.name, className: "h-20 w-20 object-cover" }), _jsx("button", { type: "button", onClick: () => removeFileAttachment(index), className: "absolute top-1 right-1 p-1 rounded-full bg-background/80 hover:bg-background opacity-0 group-hover:opacity-100 transition-opacity", children: _jsx(X, { className: "size-3" }) })
48
+ ] }, `attached-${file.name}-${file.data.slice(0, 20)}`))) })), _jsx(ChatInputField, { placeholder: placeholder, autoFocus: true, onFilesDropped: handleFilesSelected }), _jsxs(ChatInputToolbar, { children: [
49
+ _jsxs("div", { className: "flex items-baseline gap-1", children: [
50
+ _jsx(ChatInputActions, {}), _jsx(ChatInputAttachment, { onFilesSelected: handleFilesSelected })
51
+ ] }), _jsxs("div", { className: "flex items-center gap-1", children: [
52
+ _jsx(ChatInputVoiceInput, {}), _jsx(ChatInputSubmit, { children: _jsx(ArrowUp, { className: "size-4" }) })
53
+ ] })
54
+ ] })
55
+ ] }));
46
56
  }
47
57
  // Controlled Tabs component for the aside panel
48
58
  function AsideTabs({ todos, tools, mcps, subagents, }) {
49
59
  const { activeTab, setActiveTab } = ChatLayout.useChatLayoutContext();
50
- return (_jsxs(Tabs, { value: activeTab, onValueChange: (value) => setActiveTab(value), className: "flex flex-col h-full", children: [_jsx("div", { className: cn("border-b border-border bg-card", "px-4 py-2 h-16", "flex items-center"), children: _jsx(PanelTabsHeader, { showIcons: true, visibleTabs: ["todo", "files", "sources", "settings"], variant: "compact" }) }), _jsx(TabsContent, { value: "todo", className: "flex-1 p-4 mt-0", children: _jsx(TodoTabContent, { todos: todos }) }), _jsx(TabsContent, { value: "files", className: "flex-1 p-4 mt-0", children: _jsx(FilesTabContent, {}) }), _jsx(TabsContent, { value: "sources", className: "flex-1 p-4 mt-0", children: _jsx(SourcesTabContent, {}) }), _jsx(TabsContent, { value: "settings", className: "flex-1 p-4 mt-0 overflow-y-auto", children: _jsx(SettingsTabContent, { tools: tools ?? [], mcps: mcps ?? [], subagents: subagents ?? [] }) })] }));
60
+ return (_jsxs(Tabs, { value: activeTab, onValueChange: (value) => setActiveTab(value), className: "flex flex-col h-full", children: [
61
+ _jsx("div", { className: cn("border-b border-border bg-card", "px-4 py-2 h-16", "flex items-center"), children: _jsx(PanelTabsHeader, { showIcons: true, visibleTabs: ["todo", "files", "sources", "settings"], variant: "compact" }) }), _jsx(TabsContent, { value: "todo", className: "flex-1 p-4 mt-0", children: _jsx(TodoTabContent, { todos: todos }) }), _jsx(TabsContent, { value: "files", className: "flex-1 p-4 mt-0", children: _jsx(FilesTabContent, {}) }), _jsx(TabsContent, { value: "sources", className: "flex-1 p-4 mt-0", children: _jsx(SourcesTabContent, {}) }), _jsx(TabsContent, { value: "settings", className: "flex-1 p-4 mt-0 overflow-y-auto", children: _jsx(SettingsTabContent, { tools: tools ?? [], mcps: mcps ?? [], subagents: subagents ?? [] }) })
62
+ ] }));
51
63
  }
52
64
  // Header component that uses ChatLayout context (must be inside ChatLayout.Root)
53
65
  function AppChatHeader({ agentName, showHeader, sessionId, debuggerUrl, }) {
@@ -57,7 +69,14 @@ function AppChatHeader({ agentName, showHeader, sessionId, debuggerUrl, }) {
57
69
  ? `${debuggerUrl}/sessions/${sessionId}`
58
70
  : debuggerUrl
59
71
  : null;
60
- return (_jsx(ChatHeader.Root, { className: cn("border-b border-border bg-card h-16"), children: _jsxs("div", { className: "flex items-center w-full py-5 px-4 lg:px-4", children: [_jsxs("div", { className: "flex items-center gap-2 flex-1", children: [_jsx(SidebarToggle, {}), showHeader && agentName && (_jsx("span", { className: "text-heading-4 text-foreground", children: agentName }))] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(ContextUsageButton, {}), debuggerUrl && (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(IconButton, { "aria-label": "View session in debugger", disabled: !debuggerLink, asChild: !!debuggerLink, children: debuggerLink ? (_jsx("a", { href: debuggerLink, target: "_blank", rel: "noopener noreferrer", children: _jsx(Bug, { className: "size-4 text-muted-foreground" }) })) : (_jsx(Bug, { className: "size-4 text-muted-foreground" })) }) }), _jsx(TooltipContent, { children: _jsx("p", { children: sessionId ? "View session in debugger" : "Open debugger" }) })] }) })), _jsx(IconButton, { "aria-label": "Toggle panel", onClick: togglePanel, "data-state": panelOpen ? "open" : "closed", children: _jsx(PanelRight, { className: "size-4 text-muted-foreground" }) })] })] }) }));
72
+ return (_jsx(ChatHeader.Root, { className: cn("border-b border-border bg-card h-16"), children: _jsxs("div", { className: "flex items-center w-full py-5 px-4 lg:px-4", children: [
73
+ _jsxs("div", { className: "flex items-center gap-2 flex-1", children: [
74
+ _jsx(SidebarToggle, {}), showHeader && agentName && (_jsx("span", { className: "text-heading-4 text-foreground", children: agentName }))] }), _jsxs("div", { className: "flex items-center gap-1", children: [
75
+ _jsx(ContextUsageButton, {}), debuggerUrl && (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [
76
+ _jsx(TooltipTrigger, { asChild: true, children: _jsx(IconButton, { "aria-label": "View session in debugger", disabled: !debuggerLink, asChild: !!debuggerLink, children: debuggerLink ? (_jsx("a", { href: debuggerLink, target: "_blank", rel: "noopener noreferrer", children: _jsx(Bug, { className: "size-4 text-muted-foreground" }) })) : (_jsx(Bug, { className: "size-4 text-muted-foreground" })) }) }), _jsx(TooltipContent, { children: _jsx("p", { children: sessionId ? "View session in debugger" : "Open debugger" }) })
77
+ ] }) })), _jsx(IconButton, { "aria-label": "Toggle panel", onClick: togglePanel, "data-state": panelOpen ? "open" : "closed", children: _jsx(PanelRight, { className: "size-4 text-muted-foreground" }) })
78
+ ] })
79
+ ] }) }));
61
80
  }
62
81
  export function ChatView({ client, initialSessionId, error: initError, debuggerUrl, }) {
63
82
  // Use shared hooks from @townco/ui/core - MUST be called before any early returns
@@ -141,7 +160,9 @@ export function ChatView({ client, initialSessionId, error: initError, debuggerU
141
160
  };
142
161
  // If there's an initialization error, show error UI (after all hooks have been called)
143
162
  if (initError) {
144
- return (_jsx("div", { className: "flex items-center justify-center h-screen bg-background", children: _jsxs("div", { className: "text-center p-8 max-w-md", children: [_jsx("h1", { className: "text-2xl font-bold text-destructive mb-4", children: "Initialization Error" }), _jsx("p", { className: "text-foreground mb-4", children: initError }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Failed to initialize the ACP client. Check the console for details." })] }) }));
163
+ return (_jsx("div", { className: "flex items-center justify-center h-screen bg-background", children: _jsxs("div", { className: "text-center p-8 max-w-md", children: [
164
+ _jsx("h1", { className: "text-2xl font-bold text-destructive mb-4", children: "Initialization Error" }), _jsx("p", { className: "text-foreground mb-4", children: initError }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Failed to initialize the ACP client. Check the console for details." })
165
+ ] }) }));
145
166
  }
146
167
  // Dummy sources data based on Figma design
147
168
  const _sources = [
@@ -191,7 +212,14 @@ export function ChatView({ client, initialSessionId, error: initError, debuggerU
191
212
  },
192
213
  },
193
214
  ];
194
- return (_jsxs(SidebarProvider, { defaultOpen: false, children: [_jsx(AppSidebar, { client: client, currentSessionId: sessionId }), _jsx(SidebarInset, { children: _jsxs(ChatLayout.Root, { defaultPanelSize: "hidden", defaultActiveTab: "todo", children: [_jsxs(ChatLayout.Main, { children: [!hideTopBar && (_jsx(AppChatHeader, { agentName: agentName, showHeader: messages.length > 0, sessionId: sessionId, ...(debuggerUrl && { debuggerUrl }) })), connectionStatus === "error" && error && (_jsx("div", { className: "border-b border-destructive/20 bg-destructive/10 px-6 py-4", children: _jsxs("div", { className: "flex items-start justify-between gap-4", children: [_jsxs("div", { className: "flex-1", children: [_jsx("h3", { className: "mb-1 text-paragraph-sm font-semibold text-destructive", children: "Connection Error" }), _jsx("p", { className: "whitespace-pre-line text-paragraph-sm text-foreground", children: error })] }), _jsx("button", { type: "button", onClick: connect, className: "rounded-lg bg-destructive px-4 py-2 text-paragraph-sm font-medium text-destructive-foreground transition-colors hover:bg-destructive-hover", children: "Retry" })] }) })), _jsxs(ChatLayout.Body, { children: [_jsx(ChatLayout.Messages, { children: messages.length === 0 ? (
215
+ return (_jsxs(SidebarProvider, { defaultOpen: false, children: [
216
+ _jsx(AppSidebar, { client: client, currentSessionId: sessionId }), _jsx(SidebarInset, { children: _jsxs(ChatLayout.Root, { defaultPanelSize: "hidden", defaultActiveTab: "todo", children: [
217
+ _jsxs(ChatLayout.Main, { children: [!hideTopBar && (_jsx(AppChatHeader, { agentName: agentName, showHeader: messages.length > 0, sessionId: sessionId, ...(debuggerUrl && { debuggerUrl }) })), connectionStatus === "error" && error && (_jsx("div", { className: "border-b border-destructive/20 bg-destructive/10 px-6 py-4", children: _jsxs("div", { className: "flex items-start justify-between gap-4", children: [
218
+ _jsxs("div", { className: "flex-1", children: [
219
+ _jsx("h3", { className: "mb-1 text-paragraph-sm font-semibold text-destructive", children: "Connection Error" }), _jsx("p", { className: "whitespace-pre-line text-paragraph-sm text-foreground", children: error })
220
+ ] }), _jsx("button", { type: "button", onClick: connect, className: "rounded-lg bg-destructive px-4 py-2 text-paragraph-sm font-medium text-destructive-foreground transition-colors hover:bg-destructive-hover", children: "Retry" })
221
+ ] }) })), _jsxs(ChatLayout.Body, { children: [
222
+ _jsx(ChatLayout.Messages, { children: messages.length === 0 ? (
195
223
  // Only render empty state once agent info is loaded
196
224
  agentName !== undefined ? (_jsx(OpenFilesButton, { children: ({ openFiles, openSettings }) => (_jsx("div", { className: "flex flex-1 items-center px-4", children: _jsx(ChatEmptyState, { title: agentName, description: agentDescription ?? "", suggestedPrompts: suggestedPrompts ?? [], onPromptClick: (prompt) => {
197
225
  sendMessage(prompt);
@@ -224,5 +252,9 @@ export function ChatView({ client, initialSessionId, error: initError, debuggerU
224
252
  : "mt-6";
225
253
  }
226
254
  return (_jsx(Message, { message: message, className: spacingClass, isLastMessage: index === messages.length - 1, children: _jsx(MessageContent, { message: message, thinkingDisplayStyle: "collapsible" }) }, message.id));
227
- }) })) }), _jsx(ChatLayout.Footer, { children: _jsx(ChatInputWithAttachments, { client: client, startSession: startSession, placeholder: placeholder, commandMenuItems: commandMenuItems }) })] })] }), _jsx(ChatLayout.Aside, { breakpoint: "md", children: _jsx(AsideTabs, { todos: todos, tools: agentTools, mcps: agentMcps, subagents: agentSubagents }) })] }) })] }));
255
+ }) })) }), _jsx(ChatLayout.Footer, { children: _jsx(ChatInputWithAttachments, { client: client, startSession: startSession, placeholder: placeholder, commandMenuItems: commandMenuItems }) })
256
+ ] })
257
+ ] }), _jsx(ChatLayout.Aside, { breakpoint: "md", children: _jsx(AsideTabs, { todos: todos, tools: agentTools, mcps: agentMcps, subagents: agentSubagents }) })
258
+ ] }) })
259
+ ] }));
228
260
  }
@@ -43,8 +43,46 @@ export const ContextUsageButton = React.forwardRef(({ className, ...props }, ref
43
43
  const center = size / 2;
44
44
  const circumference = 2 * Math.PI * radius;
45
45
  const offset = circumference - (clampedPercentage / 100) * circumference;
46
- return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { ref: ref, type: "button", variant: "ghost", size: "icon", className: cn("rounded-full cursor-default", colorClass, className), ...props, children: _jsxs("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, className: "transform -rotate-90", children: [_jsx("title", { children: "Context usage indicator" }), _jsx("circle", { cx: center, cy: center, r: radius, stroke: "currentColor", strokeWidth: strokeWidth, fill: "transparent", className: "opacity-20" }), _jsx("circle", { cx: center, cy: center, r: radius, stroke: "currentColor", strokeWidth: strokeWidth, fill: "transparent", strokeDasharray: circumference, strokeDashoffset: offset, strokeLinecap: "round", className: "transition-all duration-300 ease-in-out" })] }) }) }), _jsx(TooltipContent, { side: "top", align: "center", className: "p-3", children: _jsxs("div", { className: "space-y-2 font-mono text-xs", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex justify-between gap-6", children: [_jsx("span", { className: "text-muted-foreground", children: "System Prompt:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [_jsx("span", { children: contextSize.systemPromptTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.systemPromptTokens), ")"] })] })] }), contextSize.toolOverheadTokens !== undefined &&
47
- contextSize.toolOverheadTokens > 0 && (_jsxs("div", { className: "flex justify-between gap-6", children: [_jsx("span", { className: "text-muted-foreground", children: "Tools Definition:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [_jsx("span", { children: contextSize.toolOverheadTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.toolOverheadTokens), ")"] })] })] })), contextSize.mcpOverheadTokens !== undefined &&
48
- contextSize.mcpOverheadTokens > 0 && (_jsxs("div", { className: "flex justify-between gap-6", children: [_jsx("span", { className: "text-muted-foreground", children: "MCPs Definition:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [_jsx("span", { children: contextSize.mcpOverheadTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.mcpOverheadTokens), ")"] })] })] })), _jsxs("div", { className: "flex justify-between gap-6", children: [_jsx("span", { className: "text-muted-foreground", children: "User Messages:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [_jsx("span", { children: contextSize.userMessagesTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.userMessagesTokens), ")"] })] })] }), _jsxs("div", { className: "flex justify-between gap-6", children: [_jsx("span", { className: "text-muted-foreground", children: "Assistant Messages:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [_jsx("span", { children: contextSize.assistantMessagesTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.assistantMessagesTokens), ")"] })] })] }), _jsxs("div", { className: "flex justify-between gap-6", children: [_jsx("span", { className: "text-muted-foreground", children: "Tool Inputs:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [_jsx("span", { children: contextSize.toolInputTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.toolInputTokens), ")"] })] })] }), _jsxs("div", { className: "flex justify-between gap-6", children: [_jsx("span", { className: "text-muted-foreground", children: "Tool Results:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [_jsx("span", { children: contextSize.toolResultsTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.toolResultsTokens), ")"] })] })] })] }), _jsx("div", { className: "border-t border-border pt-2", children: _jsxs("div", { className: cn("flex justify-end gap-2 font-semibold", colorClass), children: [_jsx("span", { children: actualTokens.toLocaleString() }), _jsxs("span", { children: ["(", formattedPercentage, ")"] })] }) })] }) })] }) }));
46
+ return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [
47
+ _jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { ref: ref, type: "button", variant: "ghost", size: "icon", className: cn("rounded-full cursor-default", colorClass, className), ...props, children: _jsxs("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, className: "transform -rotate-90", children: [
48
+ _jsx("title", { children: "Context usage indicator" }), _jsx("circle", { cx: center, cy: center, r: radius, stroke: "currentColor", strokeWidth: strokeWidth, fill: "transparent", className: "opacity-20" }), _jsx("circle", { cx: center, cy: center, r: radius, stroke: "currentColor", strokeWidth: strokeWidth, fill: "transparent", strokeDasharray: circumference, strokeDashoffset: offset, strokeLinecap: "round", className: "transition-all duration-300 ease-in-out" })
49
+ ] }) }) }), _jsx(TooltipContent, { side: "top", align: "center", className: "p-3", children: _jsxs("div", { className: "space-y-2 font-mono text-xs", children: [
50
+ _jsxs("div", { className: "space-y-1", children: [
51
+ _jsxs("div", { className: "flex justify-between gap-6", children: [
52
+ _jsx("span", { className: "text-muted-foreground", children: "System Prompt:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [
53
+ _jsx("span", { children: contextSize.systemPromptTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.systemPromptTokens), ")"] })
54
+ ] })
55
+ ] }), contextSize.toolOverheadTokens !== undefined &&
56
+ contextSize.toolOverheadTokens > 0 && (_jsxs("div", { className: "flex justify-between gap-6", children: [
57
+ _jsx("span", { className: "text-muted-foreground", children: "Tools Definition:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [
58
+ _jsx("span", { children: contextSize.toolOverheadTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.toolOverheadTokens), ")"] })
59
+ ] })
60
+ ] })), contextSize.mcpOverheadTokens !== undefined &&
61
+ contextSize.mcpOverheadTokens > 0 && (_jsxs("div", { className: "flex justify-between gap-6", children: [
62
+ _jsx("span", { className: "text-muted-foreground", children: "MCPs Definition:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [
63
+ _jsx("span", { children: contextSize.mcpOverheadTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.mcpOverheadTokens), ")"] })
64
+ ] })
65
+ ] })), _jsxs("div", { className: "flex justify-between gap-6", children: [
66
+ _jsx("span", { className: "text-muted-foreground", children: "User Messages:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [
67
+ _jsx("span", { children: contextSize.userMessagesTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.userMessagesTokens), ")"] })
68
+ ] })
69
+ ] }), _jsxs("div", { className: "flex justify-between gap-6", children: [
70
+ _jsx("span", { className: "text-muted-foreground", children: "Assistant Messages:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [
71
+ _jsx("span", { children: contextSize.assistantMessagesTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.assistantMessagesTokens), ")"] })
72
+ ] })
73
+ ] }), _jsxs("div", { className: "flex justify-between gap-6", children: [
74
+ _jsx("span", { className: "text-muted-foreground", children: "Tool Inputs:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [
75
+ _jsx("span", { children: contextSize.toolInputTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.toolInputTokens), ")"] })
76
+ ] })
77
+ ] }), _jsxs("div", { className: "flex justify-between gap-6", children: [
78
+ _jsx("span", { className: "text-muted-foreground", children: "Tool Results:" }), _jsxs("div", { className: "flex gap-1 items-baseline", children: [
79
+ _jsx("span", { children: contextSize.toolResultsTokens.toLocaleString() }), _jsxs("span", { className: "text-muted-foreground text-[10px]", children: ["(", calculatePercentage(contextSize.toolResultsTokens), ")"] })
80
+ ] })
81
+ ] })
82
+ ] }), _jsx("div", { className: "border-t border-border pt-2", children: _jsxs("div", { className: cn("flex justify-end gap-2 font-semibold", colorClass), children: [
83
+ _jsx("span", { children: actualTokens.toLocaleString() }), _jsxs("span", { children: ["(", formattedPercentage, ")"] })
84
+ ] }) })
85
+ ] }) })
86
+ ] }) }));
49
87
  });
50
88
  ContextUsageButton.displayName = "ContextUsageButton";
@@ -82,6 +82,9 @@ export const Conversation = React.forwardRef(({ autoScroll = true, isStreaming =
82
82
  resizeObserver.disconnect();
83
83
  };
84
84
  }, [isNearBottom, autoScroll, scrollToBottom]);
85
- return (_jsxs("div", { className: "relative flex-1", children: [_jsx("div", { ref: containerRef, className: cn("h-full overflow-y-auto overflow-x-hidden", "scrollbar-thin scrollbar-thumb-[border] scrollbar-track-transparent", className), ...props, children: _jsx("div", { className: "flex flex-col gap-4 px-4 py-4", children: children }) }), showButton && (_jsx("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 z-10", children: scrollButton || (_jsxs("button", { type: "button", onClick: () => scrollToBottom(), className: "px-4 py-2 rounded-full bg-card border border-border shadow-lg hover:shadow-xl hover:bg-card/90 transition-all text-sm font-medium text-foreground flex items-center gap-2", "aria-label": "Scroll to bottom", children: [_jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": "Down arrow", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }), "Scroll to bottom"] })) }))] }));
85
+ return (_jsxs("div", { className: "relative flex-1", children: [
86
+ _jsx("div", { ref: containerRef, className: cn("h-full overflow-y-auto overflow-x-hidden", "scrollbar-thin scrollbar-thumb-[border] scrollbar-track-transparent", className), ...props, children: _jsx("div", { className: "flex flex-col gap-4 px-4 py-4", children: children }) }), showButton && (_jsx("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 z-10", children: scrollButton || (_jsxs("button", { type: "button", onClick: () => scrollToBottom(), className: "px-4 py-2 rounded-full bg-card border border-border shadow-lg hover:shadow-xl hover:bg-card/90 transition-all text-sm font-medium text-foreground flex items-center gap-2", "aria-label": "Scroll to bottom", children: [
87
+ _jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": "Down arrow", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }),
88
+ "Scroll to bottom"] })) }))] }));
86
89
  });
87
90
  Conversation.displayName = "Conversation";
@@ -6,14 +6,14 @@ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
6
  declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
7
  declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
8
  declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
- declare const DialogHeader: {
10
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
11
- displayName: string;
12
- };
13
- declare const DialogFooter: {
14
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
15
- displayName: string;
16
- };
9
+ declare function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
10
+ declare namespace DialogHeader {
11
+ var displayName: string;
12
+ }
13
+ declare function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
14
+ declare namespace DialogFooter {
15
+ var displayName: string;
16
+ }
17
17
  declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
18
18
  declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
19
  export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -9,7 +9,12 @@ const DialogPortal = DialogPrimitive.Portal;
9
9
  const DialogClose = DialogPrimitive.Close;
10
10
  const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
11
11
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
12
- const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", 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-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
12
+ const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [
13
+ _jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", 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-accent data-[state=open]:text-muted-foreground", children: [
14
+ _jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })
15
+ ] })
16
+ ] })
17
+ ] })));
13
18
  DialogContent.displayName = DialogPrimitive.Content.displayName;
14
19
  const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
15
20
  DialogHeader.displayName = "DialogHeader";
@@ -20,8 +20,8 @@ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMe
20
20
  inset?: boolean;
21
21
  } & React.RefAttributes<HTMLDivElement>>;
22
22
  declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
- declare const DropdownMenuShortcut: {
24
- ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
25
- displayName: string;
26
- };
23
+ declare function DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
24
+ declare namespace DropdownMenuShortcut {
25
+ var displayName: string;
26
+ }
27
27
  export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
@@ -15,7 +15,8 @@ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
15
15
  /* -------------------------------------------------------------------------------------------------
16
16
  * DropdownMenuSubTrigger
17
17
  * -----------------------------------------------------------------------------------------------*/
18
- const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-paragraph-sm outline-none", "focus:bg-muted data-[state=open]:bg-muted", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] })));
18
+ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-paragraph-sm outline-none", "focus:bg-muted data-[state=open]:bg-muted", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })
19
+ ] })));
19
20
  DropdownMenuSubTrigger.displayName =
20
21
  DropdownMenuPrimitive.SubTrigger.displayName;
21
22
  /* -------------------------------------------------------------------------------------------------
@@ -37,13 +38,15 @@ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
37
38
  /* -------------------------------------------------------------------------------------------------
38
39
  * DropdownMenuCheckboxItem
39
40
  * -----------------------------------------------------------------------------------------------*/
40
- const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none transition-colors", "focus:bg-muted focus:text-foreground", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
41
+ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none transition-colors", "focus:bg-muted focus:text-foreground", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [
42
+ _jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
41
43
  DropdownMenuCheckboxItem.displayName =
42
44
  DropdownMenuPrimitive.CheckboxItem.displayName;
43
45
  /* -------------------------------------------------------------------------------------------------
44
46
  * DropdownMenuRadioItem
45
47
  * -----------------------------------------------------------------------------------------------*/
46
- const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none transition-colors", "focus:bg-muted focus:text-foreground", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
48
+ const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-paragraph-sm outline-none transition-colors", "focus:bg-muted focus:text-foreground", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [
49
+ _jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
47
50
  DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
48
51
  /* -------------------------------------------------------------------------------------------------
49
52
  * DropdownMenuLabel
@@ -14,4 +14,4 @@ export interface FileSystemItemProps {
14
14
  onRename?: (item: FileSystemItemType) => void;
15
15
  onDelete?: (item: FileSystemItemType) => void;
16
16
  }
17
- export declare function FileSystemItem({ item, level, onSelect, selectedId, isDropTarget, onDownload, onRename, onDelete, }: FileSystemItemProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function FileSystemItem({ item, level, onSelect, selectedId, isDropTarget, onDownload, onRename, onDelete }: FileSystemItemProps): import("react/jsx-runtime").JSX.Element;
@@ -46,7 +46,8 @@ export function FileSystemItem({ item, level = 0, onSelect, selectedId, isDropTa
46
46
  return "pl-8 pr-2 py-2";
47
47
  return "pl-16 pr-2 py-2"; // level 2+
48
48
  };
49
- return (_jsxs("div", { className: "flex flex-col w-full", children: [_jsxs("div", { role: "button", tabIndex: 0, "aria-expanded": item.type === "folder" ? isExpanded : undefined, className: cn(
49
+ return (_jsxs("div", { className: "flex flex-col w-full", children: [
50
+ _jsxs("div", { role: "button", tabIndex: 0, "aria-expanded": item.type === "folder" ? isExpanded : undefined, className: cn(
50
51
  // Base styles with semantic typography
51
52
  "group/item flex items-center gap-2 rounded-md cursor-pointer transition-colors text-paragraph-sm", getPaddingClass(),
52
53
  // State styles using semantic colors
@@ -61,7 +62,9 @@ export function FileSystemItem({ item, level = 0, onSelect, selectedId, isDropTa
61
62
  isDropTarget && [
62
63
  "bg-accent",
63
64
  "border border-dashed border-border-dark",
64
- ]), onClick: handleClick, onKeyDown: handleKeyDown, children: [_jsx("div", { className: "shrink-0 size-4 flex items-center justify-center text-foreground", children: item.type === "folder" ? (isExpanded ? (_jsx(FolderOpen, { className: "size-4" })) : (_jsx(Folder, { className: "size-4" }))) : (_jsx(FileCode, { className: "size-4" })) }), _jsx("p", { className: "flex-1 text-foreground whitespace-nowrap overflow-hidden text-ellipsis", children: item.name }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: cn("shrink-0 size-4 transition-opacity text-muted-foreground hover:text-foreground",
65
+ ]), onClick: handleClick, onKeyDown: handleKeyDown, children: [
66
+ _jsx("div", { className: "shrink-0 size-4 flex items-center justify-center text-foreground", children: item.type === "folder" ? (isExpanded ? (_jsx(FolderOpen, { className: "size-4" })) : (_jsx(Folder, { className: "size-4" }))) : (_jsx(FileCode, { className: "size-4" })) }), _jsx("p", { className: "flex-1 text-foreground whitespace-nowrap overflow-hidden text-ellipsis", children: item.name }), _jsxs(DropdownMenu, { children: [
67
+ _jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: cn("shrink-0 size-4 transition-opacity text-muted-foreground hover:text-foreground",
65
68
  // Hidden by default, shown on group hover only
66
69
  "opacity-0 group-hover/item:opacity-100",
67
70
  // Force visible when menu is open
@@ -76,5 +79,6 @@ export function FileSystemItem({ item, level = 0, onSelect, selectedId, isDropTa
76
79
  }, children: "Rename" })), (onDownload || onRename) && onDelete && _jsx(DropdownMenuSeparator, {}), onDelete && (_jsx(DropdownMenuItem, { className: "text-destructive focus:text-destructive focus:bg-muted", onClick: (e) => {
77
80
  e.stopPropagation();
78
81
  onDelete(item);
79
- }, children: _jsx("span", { className: "text-paragraph-sm", children: "Delete" }) }))] })] }), item.type === "folder" && (_jsx("div", { className: "shrink-0 size-4 flex items-center justify-center text-muted-foreground", children: _jsx(ChevronDown, { className: cn("size-4 transition-transform", !isExpanded && "-rotate-90") }) }))] }), item.type === "folder" && isExpanded && item.children && (_jsx("div", { className: "flex flex-col", children: item.children.map((child) => (_jsx(FileSystemItem, { item: child, level: level + 1, ...(onSelect && { onSelect }), ...(selectedId && { selectedId }), ...(onDownload && { onDownload }), ...(onRename && { onRename }), ...(onDelete && { onDelete }) }, child.id))) }))] }));
82
+ }, children: _jsx("span", { className: "text-paragraph-sm", children: "Delete" }) }))] })
83
+ ] }), item.type === "folder" && (_jsx("div", { className: "shrink-0 size-4 flex items-center justify-center text-muted-foreground", children: _jsx(ChevronDown, { className: cn("size-4 transition-transform", !isExpanded && "-rotate-90") }) }))] }), item.type === "folder" && isExpanded && item.children && (_jsx("div", { className: "flex flex-col", children: item.children.map((child) => (_jsx(FileSystemItem, { item: child, level: level + 1, ...(onSelect && { onSelect }), ...(selectedId && { selectedId }), ...(onDownload && { onDownload }), ...(onRename && { onRename }), ...(onDelete && { onDelete }) }, child.id))) }))] }));
80
84
  }
@@ -11,4 +11,4 @@ export interface FileSystemViewProps {
11
11
  onRename?: (item: FileSystemItemType) => void;
12
12
  onDelete?: (item: FileSystemItemType) => void;
13
13
  }
14
- export declare function FileSystemView({ className, provider, onItemSelect, onDownload, onRename, onDelete, }: FileSystemViewProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function FileSystemView({ className, provider, onItemSelect, onDownload, onRename, onDelete }: FileSystemViewProps): import("react/jsx-runtime").JSX.Element;
@@ -6,5 +6,5 @@ interface HeightTransitionProps {
6
6
  pinContentTo?: "top" | "bottom";
7
7
  className?: string;
8
8
  }
9
- export declare function HeightTransition({ children, durationMs, easing, pinContentTo, className, }: HeightTransitionProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function HeightTransition({ children, durationMs, easing, pinContentTo, className }: HeightTransitionProps): import("react/jsx-runtime").JSX.Element;
10
10
  export {};
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AlertCircle, AlertTriangle, Archive, CheckCircle2, ChevronDown, Loader2, Scissors, } from "lucide-react";
3
3
  import { useEffect, useState } from "react";
4
4
  /**
@@ -100,6 +100,42 @@ export function HookNotification({ notification }) {
100
100
  }
101
101
  // Check for truncation warning in metadata
102
102
  const truncationWarning = notification.metadata?.truncationWarning;
103
- return (_jsxs("div", { className: "flex flex-col my-3", children: [_jsxs("button", { type: "button", className: "flex flex-col items-start gap-0.5 cursor-pointer bg-transparent border-none p-0 text-left group w-fit", onClick: () => setIsExpanded(!isExpanded), "aria-expanded": isExpanded, children: [_jsxs("div", { className: "flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground", children: [_jsx("div", { className: isError ? "text-destructive" : "text-muted-foreground", children: _jsx(IconComponent, { className: "h-3 w-3" }) }), _jsx("span", { className: "text-paragraph-sm text-muted-foreground", children: title }), isTriggered && (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "h-3 w-3 text-muted-foreground animate-spin" }), _jsxs("span", { className: "text-muted-foreground/70 tabular-nums", children: [elapsedTime.toFixed(1), "s"] })] })), isCompleted && _jsx(CheckCircle2, { className: "h-3 w-3 text-green-500" }), isError && _jsx(AlertCircle, { className: "h-3 w-3 text-destructive" }), !isTriggered && (_jsx(ChevronDown, { className: `h-3 w-3 text-muted-foreground/70 transition-transform duration-200 ${isExpanded ? "rotate-180" : ""}` }))] }), subtitle && (_jsx("span", { className: `text-paragraph-sm pl-4.5 ${isError ? "text-destructive/70" : "text-muted-foreground/70"}`, children: subtitle }))] }), isExpanded && !isTriggered && (_jsxs("div", { className: "mt-2 text-sm border border-border rounded-lg bg-card overflow-hidden w-full", children: [_jsxs("div", { className: "p-3 border-b border-border", children: [_jsx("div", { className: "text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans", children: "Hook Details" }), _jsxs("div", { className: "space-y-1 text-[11px]", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "Type:" }), _jsx("span", { className: "text-foreground font-mono", children: notification.hookType })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "Callback:" }), _jsx("span", { className: "text-foreground font-mono", children: notification.callback })] }), notification.threshold !== undefined && (_jsxs("div", { className: "flex gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "Threshold:" }), _jsxs("span", { className: "text-foreground", children: [notification.threshold, "%"] })] })), notification.currentPercentage !== undefined && (_jsxs("div", { className: "flex gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "Context Usage:" }), _jsxs("span", { className: "text-foreground", children: [notification.currentPercentage.toFixed(1), "%"] })] }))] })] }), notification.metadata && (_jsxs("div", { className: "p-3 border-b border-border last:border-0", children: [_jsx("div", { className: "text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans", children: "Result" }), _jsxs("div", { className: "space-y-1 text-[11px]", children: [notification.metadata.action && (_jsxs("div", { className: "flex gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "Action:" }), _jsx("span", { className: "text-foreground", children: notification.metadata.action })] })), notification.metadata.messagesRemoved !== undefined && (_jsxs("div", { className: "flex gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "Messages Removed:" }), _jsx("span", { className: "text-foreground", children: formatNumber(notification.metadata.messagesRemoved) })] })), notification.metadata.tokensSaved !== undefined && (_jsxs("div", { className: "flex gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "Tokens Saved:" }), _jsx("span", { className: "text-green-500 font-medium", children: formatNumber(notification.metadata.tokensSaved) })] })), notification.metadata.originalTokens !== undefined && (_jsxs("div", { className: "flex gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "Original Size:" }), _jsxs("span", { className: "text-foreground", children: [formatNumber(notification.metadata.originalTokens), " ", "tokens"] })] })), notification.metadata.finalTokens !== undefined && (_jsxs("div", { className: "flex gap-2", children: [_jsx("span", { className: "text-muted-foreground", children: "Final Size:" }), _jsxs("span", { className: "text-foreground", children: [formatNumber(notification.metadata.finalTokens), " tokens"] })] }))] })] })), truncationWarning && (_jsxs("div", { className: "p-3 border-b border-border last:border-0 bg-yellow-500/5", children: [_jsxs("div", { className: "flex items-center gap-1.5 text-[10px] font-bold text-yellow-600 dark:text-yellow-500 uppercase tracking-wider mb-1.5 font-sans", children: [_jsx(AlertTriangle, { className: "h-3 w-3" }), "Warning"] }), _jsx("div", { className: "text-[11px] text-yellow-700 dark:text-yellow-400", children: truncationWarning })] })), notification.error && (_jsxs("div", { className: "p-3 border-b border-border last:border-0", children: [_jsx("div", { className: "text-[10px] font-bold text-destructive uppercase tracking-wider mb-1.5 font-sans", children: "Error" }), _jsx("div", { className: "text-[11px] text-destructive font-mono", children: notification.error })] })), _jsxs("div", { className: "p-2 bg-muted/50 border-t border-border text-[10px] text-muted-foreground font-sans space-y-0.5", children: [notification.triggeredAt && (_jsxs("div", { children: ["Started:", " ", new Date(notification.triggeredAt).toLocaleTimeString()] })), notification.completedAt && (_jsxs("div", { children: ["Completed:", " ", new Date(notification.completedAt).toLocaleTimeString()] })), notification.triggeredAt && notification.completedAt && (_jsxs("div", { children: ["Duration:", " ", ((notification.completedAt - notification.triggeredAt) /
104
- 1000).toFixed(1), "s"] }))] })] }))] }));
103
+ return (_jsxs("div", { className: "flex flex-col my-3", children: [
104
+ _jsxs("button", { type: "button", className: "flex flex-col items-start gap-0.5 cursor-pointer bg-transparent border-none p-0 text-left group w-fit", onClick: () => setIsExpanded(!isExpanded), "aria-expanded": isExpanded, children: [
105
+ _jsxs("div", { className: "flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground", children: [
106
+ _jsx("div", { className: isError ? "text-destructive" : "text-muted-foreground", children: _jsx(IconComponent, { className: "h-3 w-3" }) }), _jsx("span", { className: "text-paragraph-sm text-muted-foreground", children: title }), isTriggered && (_jsxs(_Fragment, { children: [
107
+ _jsx(Loader2, { className: "h-3 w-3 text-muted-foreground animate-spin" }), _jsxs("span", { className: "text-muted-foreground/70 tabular-nums", children: [elapsedTime.toFixed(1), "s"] })
108
+ ] })), isCompleted && _jsx(CheckCircle2, { className: "h-3 w-3 text-green-500" }), isError && _jsx(AlertCircle, { className: "h-3 w-3 text-destructive" }), !isTriggered && (_jsx(ChevronDown, { className: `h-3 w-3 text-muted-foreground/70 transition-transform duration-200 ${isExpanded ? "rotate-180" : ""}` }))] }), subtitle && (_jsx("span", { className: `text-paragraph-sm pl-4.5 ${isError ? "text-destructive/70" : "text-muted-foreground/70"}`, children: subtitle }))] }), isExpanded && !isTriggered && (_jsxs("div", { className: "mt-2 text-sm border border-border rounded-lg bg-card overflow-hidden w-full", children: [
109
+ _jsxs("div", { className: "p-3 border-b border-border", children: [
110
+ _jsx("div", { className: "text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans", children: "Hook Details" }), _jsxs("div", { className: "space-y-1 text-[11px]", children: [
111
+ _jsxs("div", { className: "flex gap-2", children: [
112
+ _jsx("span", { className: "text-muted-foreground", children: "Type:" }), _jsx("span", { className: "text-foreground font-mono", children: notification.hookType })
113
+ ] }), _jsxs("div", { className: "flex gap-2", children: [
114
+ _jsx("span", { className: "text-muted-foreground", children: "Callback:" }), _jsx("span", { className: "text-foreground font-mono", children: notification.callback })
115
+ ] }), notification.threshold !== undefined && (_jsxs("div", { className: "flex gap-2", children: [
116
+ _jsx("span", { className: "text-muted-foreground", children: "Threshold:" }), _jsxs("span", { className: "text-foreground", children: [notification.threshold, "%"] })
117
+ ] })), notification.currentPercentage !== undefined && (_jsxs("div", { className: "flex gap-2", children: [
118
+ _jsx("span", { className: "text-muted-foreground", children: "Context Usage:" }), _jsxs("span", { className: "text-foreground", children: [notification.currentPercentage.toFixed(1), "%"] })
119
+ ] }))] })
120
+ ] }), notification.metadata && (_jsxs("div", { className: "p-3 border-b border-border last:border-0", children: [
121
+ _jsx("div", { className: "text-[10px] font-bold text-muted-foreground uppercase tracking-wider mb-1.5 font-sans", children: "Result" }), _jsxs("div", { className: "space-y-1 text-[11px]", children: [notification.metadata.action && (_jsxs("div", { className: "flex gap-2", children: [
122
+ _jsx("span", { className: "text-muted-foreground", children: "Action:" }), _jsx("span", { className: "text-foreground", children: notification.metadata.action })
123
+ ] })), notification.metadata.messagesRemoved !== undefined && (_jsxs("div", { className: "flex gap-2", children: [
124
+ _jsx("span", { className: "text-muted-foreground", children: "Messages Removed:" }), _jsx("span", { className: "text-foreground", children: formatNumber(notification.metadata.messagesRemoved) })
125
+ ] })), notification.metadata.tokensSaved !== undefined && (_jsxs("div", { className: "flex gap-2", children: [
126
+ _jsx("span", { className: "text-muted-foreground", children: "Tokens Saved:" }), _jsx("span", { className: "text-green-500 font-medium", children: formatNumber(notification.metadata.tokensSaved) })
127
+ ] })), notification.metadata.originalTokens !== undefined && (_jsxs("div", { className: "flex gap-2", children: [
128
+ _jsx("span", { className: "text-muted-foreground", children: "Original Size:" }), _jsxs("span", { className: "text-foreground", children: [formatNumber(notification.metadata.originalTokens), " ", "tokens"] })
129
+ ] })), notification.metadata.finalTokens !== undefined && (_jsxs("div", { className: "flex gap-2", children: [
130
+ _jsx("span", { className: "text-muted-foreground", children: "Final Size:" }), _jsxs("span", { className: "text-foreground", children: [formatNumber(notification.metadata.finalTokens), " tokens"] })
131
+ ] }))] })
132
+ ] })), truncationWarning && (_jsxs("div", { className: "p-3 border-b border-border last:border-0 bg-yellow-500/5", children: [
133
+ _jsxs("div", { className: "flex items-center gap-1.5 text-[10px] font-bold text-yellow-600 dark:text-yellow-500 uppercase tracking-wider mb-1.5 font-sans", children: [
134
+ _jsx(AlertTriangle, { className: "h-3 w-3" }),
135
+ "Warning"] }), _jsx("div", { className: "text-[11px] text-yellow-700 dark:text-yellow-400", children: truncationWarning })
136
+ ] })), notification.error && (_jsxs("div", { className: "p-3 border-b border-border last:border-0", children: [
137
+ _jsx("div", { className: "text-[10px] font-bold text-destructive uppercase tracking-wider mb-1.5 font-sans", children: "Error" }), _jsx("div", { className: "text-[11px] text-destructive font-mono", children: notification.error })
138
+ ] })), _jsxs("div", { className: "p-2 bg-muted/50 border-t border-border text-[10px] text-muted-foreground font-sans space-y-0.5", children: [notification.triggeredAt && (_jsxs("div", { children: ["Started:", " ", new Date(notification.triggeredAt).toLocaleTimeString()] })), notification.completedAt && (_jsxs("div", { children: ["Completed:", " ", new Date(notification.completedAt).toLocaleTimeString()] })), notification.triggeredAt && notification.completedAt && (_jsxs("div", { children: ["Duration:", " ", ((notification.completedAt - notification.triggeredAt) /
139
+ 1000).toFixed(1), "s"] }))] })
140
+ ] }))] }));
105
141
  }