@townco/ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/README.md +175 -0
  2. package/dist/core/hooks/index.d.ts +6 -0
  3. package/dist/core/hooks/index.d.ts.map +1 -0
  4. package/dist/core/hooks/index.js +6 -0
  5. package/dist/core/hooks/index.js.map +1 -0
  6. package/dist/core/hooks/use-chat-input.d.ts +23 -0
  7. package/dist/core/hooks/use-chat-input.d.ts.map +1 -0
  8. package/dist/core/hooks/use-chat-input.js +63 -0
  9. package/dist/core/hooks/use-chat-input.js.map +1 -0
  10. package/dist/core/hooks/use-chat-messages.d.ts +17 -0
  11. package/dist/core/hooks/use-chat-messages.d.ts.map +1 -0
  12. package/dist/core/hooks/use-chat-messages.js +121 -0
  13. package/dist/core/hooks/use-chat-messages.js.map +1 -0
  14. package/dist/core/hooks/use-chat-session.d.ts +11 -0
  15. package/dist/core/hooks/use-chat-session.d.ts.map +1 -0
  16. package/dist/core/hooks/use-chat-session.js +87 -0
  17. package/dist/core/hooks/use-chat-session.js.map +1 -0
  18. package/dist/core/hooks/use-media-query.d.ts +39 -0
  19. package/dist/core/hooks/use-media-query.js +80 -0
  20. package/dist/core/index.d.ts +9 -0
  21. package/dist/core/index.d.ts.map +1 -0
  22. package/dist/core/index.js +9 -0
  23. package/dist/core/index.js.map +1 -0
  24. package/dist/core/schemas/chat.d.ts +78 -0
  25. package/dist/core/schemas/chat.d.ts.map +1 -0
  26. package/dist/core/schemas/chat.js +49 -0
  27. package/dist/core/schemas/chat.js.map +1 -0
  28. package/dist/core/schemas/index.d.ts +4 -0
  29. package/dist/core/schemas/index.d.ts.map +1 -0
  30. package/dist/core/schemas/index.js +4 -0
  31. package/dist/core/schemas/index.js.map +1 -0
  32. package/dist/core/store/chat-store.d.ts +30 -0
  33. package/dist/core/store/chat-store.d.ts.map +1 -0
  34. package/dist/core/store/chat-store.js +56 -0
  35. package/dist/core/store/chat-store.js.map +1 -0
  36. package/dist/gui/components/Button.d.ts +11 -0
  37. package/dist/gui/components/Button.d.ts.map +1 -0
  38. package/dist/gui/components/Button.js +33 -0
  39. package/dist/gui/components/Button.js.map +1 -0
  40. package/dist/gui/components/Card.d.ts +8 -0
  41. package/dist/gui/components/Card.d.ts.map +1 -0
  42. package/dist/gui/components/Card.js +16 -0
  43. package/dist/gui/components/Card.js.map +1 -0
  44. package/dist/gui/components/ChatHeader.d.ts +38 -0
  45. package/dist/gui/components/ChatHeader.js +84 -0
  46. package/dist/gui/components/ChatInput.d.ts +42 -0
  47. package/dist/gui/components/ChatInput.d.ts.map +1 -0
  48. package/dist/gui/components/ChatInput.js +137 -0
  49. package/dist/gui/components/ChatInput.js.map +1 -0
  50. package/dist/gui/components/ChatInterface.d.ts +9 -0
  51. package/dist/gui/components/ChatInterface.d.ts.map +1 -0
  52. package/dist/gui/components/ChatInterface.js +132 -0
  53. package/dist/gui/components/ChatInterface.js.map +1 -0
  54. package/dist/gui/components/ChatLayout.d.ts +52 -0
  55. package/dist/gui/components/ChatLayout.js +105 -0
  56. package/dist/gui/components/ChatPanelTabContent.d.ts +18 -0
  57. package/dist/gui/components/ChatPanelTabContent.js +15 -0
  58. package/dist/gui/components/ChatPreview.d.ts +9 -0
  59. package/dist/gui/components/ChatPreview.d.ts.map +1 -0
  60. package/dist/gui/components/ChatPreview.js +164 -0
  61. package/dist/gui/components/ChatPreview.js.map +1 -0
  62. package/dist/gui/components/ChatSecondaryPanel.d.ts +20 -0
  63. package/dist/gui/components/ChatSecondaryPanel.d.ts.map +1 -0
  64. package/dist/gui/components/ChatSecondaryPanel.js +44 -0
  65. package/dist/gui/components/ChatSecondaryPanel.js.map +1 -0
  66. package/dist/gui/components/ChatSidebar.d.ts +14 -0
  67. package/dist/gui/components/ChatSidebar.js +23 -0
  68. package/dist/gui/components/ChatStatus.d.ts +6 -0
  69. package/dist/gui/components/ChatStatus.d.ts.map +1 -0
  70. package/dist/gui/components/ChatStatus.js +38 -0
  71. package/dist/gui/components/ChatStatus.js.map +1 -0
  72. package/dist/gui/components/ChatView.d.ts +6 -0
  73. package/dist/gui/components/ChatView.d.ts.map +1 -0
  74. package/dist/gui/components/ChatView.js +13 -0
  75. package/dist/gui/components/ChatView.js.map +1 -0
  76. package/dist/gui/components/ConfigPanel.d.ts +16 -0
  77. package/dist/gui/components/ConfigPanel.d.ts.map +1 -0
  78. package/dist/gui/components/ConfigPanel.js +48 -0
  79. package/dist/gui/components/ConfigPanel.js.map +1 -0
  80. package/dist/gui/components/Conversation.d.ts +20 -0
  81. package/dist/gui/components/Conversation.d.ts.map +1 -0
  82. package/dist/gui/components/Conversation.js +87 -0
  83. package/dist/gui/components/Conversation.js.map +1 -0
  84. package/dist/gui/components/Dialog.d.ts +19 -0
  85. package/dist/gui/components/Dialog.d.ts.map +1 -0
  86. package/dist/gui/components/Dialog.js +22 -0
  87. package/dist/gui/components/Dialog.js.map +1 -0
  88. package/dist/gui/components/DropdownMenu.d.ts +27 -0
  89. package/dist/gui/components/DropdownMenu.js +68 -0
  90. package/dist/gui/components/HeightTransition.d.ts +10 -0
  91. package/dist/gui/components/HeightTransition.d.ts.map +1 -0
  92. package/dist/gui/components/HeightTransition.js +80 -0
  93. package/dist/gui/components/HeightTransition.js.map +1 -0
  94. package/dist/gui/components/Input.d.ts +9 -0
  95. package/dist/gui/components/Input.d.ts.map +1 -0
  96. package/dist/gui/components/Input.js +21 -0
  97. package/dist/gui/components/Input.js.map +1 -0
  98. package/dist/gui/components/InputBox.d.ts +14 -0
  99. package/dist/gui/components/InputBox.d.ts.map +1 -0
  100. package/dist/gui/components/InputBox.js +18 -0
  101. package/dist/gui/components/InputBox.js.map +1 -0
  102. package/dist/gui/components/Label.d.ts +4 -0
  103. package/dist/gui/components/Label.d.ts.map +1 -0
  104. package/dist/gui/components/Label.js +7 -0
  105. package/dist/gui/components/Label.js.map +1 -0
  106. package/dist/gui/components/MarkdownRenderer.d.ts +6 -0
  107. package/dist/gui/components/MarkdownRenderer.d.ts.map +1 -0
  108. package/dist/gui/components/MarkdownRenderer.js +86 -0
  109. package/dist/gui/components/MarkdownRenderer.js.map +1 -0
  110. package/dist/gui/components/Message.d.ts +26 -0
  111. package/dist/gui/components/Message.d.ts.map +1 -0
  112. package/dist/gui/components/Message.js +33 -0
  113. package/dist/gui/components/Message.js.map +1 -0
  114. package/dist/gui/components/MessageContent.d.ts +26 -0
  115. package/dist/gui/components/MessageContent.d.ts.map +1 -0
  116. package/dist/gui/components/MessageContent.js +104 -0
  117. package/dist/gui/components/MessageContent.js.map +1 -0
  118. package/dist/gui/components/MessageList.d.ts +6 -0
  119. package/dist/gui/components/MessageList.d.ts.map +1 -0
  120. package/dist/gui/components/MessageList.js +1 -0
  121. package/dist/gui/components/MessageList.js.map +1 -0
  122. package/dist/gui/components/PlaygroundLayout.d.ts +10 -0
  123. package/dist/gui/components/PlaygroundLayout.d.ts.map +1 -0
  124. package/dist/gui/components/PlaygroundLayout.js +18 -0
  125. package/dist/gui/components/PlaygroundLayout.js.map +1 -0
  126. package/dist/gui/components/Reasoning.d.ts +31 -0
  127. package/dist/gui/components/Reasoning.d.ts.map +1 -0
  128. package/dist/gui/components/Reasoning.js +70 -0
  129. package/dist/gui/components/Reasoning.js.map +1 -0
  130. package/dist/gui/components/Response.d.ts +16 -0
  131. package/dist/gui/components/Response.d.ts.map +1 -0
  132. package/dist/gui/components/Response.js +95 -0
  133. package/dist/gui/components/Response.js.map +1 -0
  134. package/dist/gui/components/Select.d.ts +13 -0
  135. package/dist/gui/components/Select.d.ts.map +1 -0
  136. package/dist/gui/components/Select.js +26 -0
  137. package/dist/gui/components/Select.js.map +1 -0
  138. package/dist/gui/components/Sonner.d.ts +5 -0
  139. package/dist/gui/components/Sonner.js +23 -0
  140. package/dist/gui/components/StatusBar.d.ts +8 -0
  141. package/dist/gui/components/StatusBar.d.ts.map +1 -0
  142. package/dist/gui/components/StatusBar.js +11 -0
  143. package/dist/gui/components/StatusBar.js.map +1 -0
  144. package/dist/gui/components/Tabs.d.ts +7 -0
  145. package/dist/gui/components/Tabs.d.ts.map +1 -0
  146. package/dist/gui/components/Tabs.js +12 -0
  147. package/dist/gui/components/Tabs.js.map +1 -0
  148. package/dist/gui/components/Task.d.ts +35 -0
  149. package/dist/gui/components/Task.d.ts.map +1 -0
  150. package/dist/gui/components/Task.js +37 -0
  151. package/dist/gui/components/Task.js.map +1 -0
  152. package/dist/gui/components/Textarea.d.ts +11 -0
  153. package/dist/gui/components/Textarea.d.ts.map +1 -0
  154. package/dist/gui/components/Textarea.js +51 -0
  155. package/dist/gui/components/Textarea.js.map +1 -0
  156. package/dist/gui/components/ThinkingBlock.d.ts +12 -0
  157. package/dist/gui/components/ThinkingBlock.d.ts.map +1 -0
  158. package/dist/gui/components/ThinkingBlock.js +40 -0
  159. package/dist/gui/components/ThinkingBlock.js.map +1 -0
  160. package/dist/gui/components/TodoList.d.ts +20 -0
  161. package/dist/gui/components/TodoList.d.ts.map +1 -0
  162. package/dist/gui/components/TodoList.js +11 -0
  163. package/dist/gui/components/TodoList.js.map +1 -0
  164. package/dist/gui/components/TodoListItem.d.ts +10 -0
  165. package/dist/gui/components/TodoListItem.d.ts.map +1 -0
  166. package/dist/gui/components/TodoListItem.js +7 -0
  167. package/dist/gui/components/TodoListItem.js.map +1 -0
  168. package/dist/gui/components/index.d.ts +23 -0
  169. package/dist/gui/components/index.d.ts.map +1 -0
  170. package/dist/gui/components/index.js +28 -0
  171. package/dist/gui/components/index.js.map +1 -0
  172. package/dist/gui/index.d.ts +2 -0
  173. package/dist/gui/index.d.ts.map +1 -0
  174. package/dist/gui/index.js +4 -0
  175. package/dist/gui/index.js.map +1 -0
  176. package/dist/gui/lib/utils.d.ts +2 -0
  177. package/dist/gui/lib/utils.d.ts.map +1 -0
  178. package/dist/gui/lib/utils.js +5 -0
  179. package/dist/gui/lib/utils.js.map +1 -0
  180. package/dist/index.d.ts +11 -0
  181. package/dist/index.d.ts.map +1 -0
  182. package/dist/index.js +12 -0
  183. package/dist/index.js.map +1 -0
  184. package/dist/index.test.d.ts +0 -0
  185. package/dist/index.test.js +1 -0
  186. package/dist/sdk/client/acp-client.d.ts +84 -0
  187. package/dist/sdk/client/acp-client.d.ts.map +1 -0
  188. package/dist/sdk/client/acp-client.js +225 -0
  189. package/dist/sdk/client/acp-client.js.map +1 -0
  190. package/dist/sdk/client/index.d.ts +4 -0
  191. package/dist/sdk/client/index.d.ts.map +1 -0
  192. package/dist/sdk/client/index.js +4 -0
  193. package/dist/sdk/client/index.js.map +1 -0
  194. package/dist/sdk/index.d.ts +9 -0
  195. package/dist/sdk/index.d.ts.map +1 -0
  196. package/dist/sdk/index.js +9 -0
  197. package/dist/sdk/index.js.map +1 -0
  198. package/dist/sdk/schemas/agent.d.ts +87 -0
  199. package/dist/sdk/schemas/agent.d.ts.map +1 -0
  200. package/dist/sdk/schemas/agent.js +50 -0
  201. package/dist/sdk/schemas/agent.js.map +1 -0
  202. package/dist/sdk/schemas/index.d.ts +6 -0
  203. package/dist/sdk/schemas/index.d.ts.map +1 -0
  204. package/dist/sdk/schemas/index.js +6 -0
  205. package/dist/sdk/schemas/index.js.map +1 -0
  206. package/dist/sdk/schemas/message.d.ts +195 -0
  207. package/dist/sdk/schemas/message.d.ts.map +1 -0
  208. package/dist/sdk/schemas/message.js +95 -0
  209. package/dist/sdk/schemas/message.js.map +1 -0
  210. package/dist/sdk/schemas/session.d.ts +158 -0
  211. package/dist/sdk/schemas/session.d.ts.map +1 -0
  212. package/dist/sdk/schemas/session.js +54 -0
  213. package/dist/sdk/schemas/session.js.map +1 -0
  214. package/dist/sdk/transports/http.d.ts +63 -0
  215. package/dist/sdk/transports/http.d.ts.map +1 -0
  216. package/dist/sdk/transports/http.js +476 -0
  217. package/dist/sdk/transports/http.js.map +1 -0
  218. package/dist/sdk/transports/index.d.ts +7 -0
  219. package/dist/sdk/transports/index.d.ts.map +1 -0
  220. package/dist/sdk/transports/index.js +7 -0
  221. package/dist/sdk/transports/index.js.map +1 -0
  222. package/dist/sdk/transports/stdio.d.ts +28 -0
  223. package/dist/sdk/transports/stdio.d.ts.map +1 -0
  224. package/dist/sdk/transports/stdio.js +294 -0
  225. package/dist/sdk/transports/stdio.js.map +1 -0
  226. package/dist/sdk/transports/types.d.ts +63 -0
  227. package/dist/sdk/transports/types.d.ts.map +1 -0
  228. package/dist/sdk/transports/types.js +1 -0
  229. package/dist/sdk/transports/types.js.map +1 -0
  230. package/dist/sdk/transports/websocket.d.ts +20 -0
  231. package/dist/sdk/transports/websocket.d.ts.map +1 -0
  232. package/dist/sdk/transports/websocket.js +52 -0
  233. package/dist/sdk/transports/websocket.js.map +1 -0
  234. package/dist/tui/components/ChatView.d.ts +5 -0
  235. package/dist/tui/components/ChatView.d.ts.map +1 -0
  236. package/dist/tui/components/ChatView.js +24 -0
  237. package/dist/tui/components/ChatView.js.map +1 -0
  238. package/dist/tui/components/GameOfLife.d.ts +1 -0
  239. package/dist/tui/components/GameOfLife.d.ts.map +1 -0
  240. package/dist/tui/components/GameOfLife.js +50 -0
  241. package/dist/tui/components/GameOfLife.js.map +1 -0
  242. package/dist/tui/components/InputBox.d.ts +13 -0
  243. package/dist/tui/components/InputBox.d.ts.map +1 -0
  244. package/dist/tui/components/InputBox.js +15 -0
  245. package/dist/tui/components/InputBox.js.map +1 -0
  246. package/dist/tui/components/MessageList.d.ts +5 -0
  247. package/dist/tui/components/MessageList.d.ts.map +1 -0
  248. package/dist/tui/components/MessageList.js +16 -0
  249. package/dist/tui/components/MessageList.js.map +1 -0
  250. package/dist/tui/components/MultiSelect.d.ts +13 -0
  251. package/dist/tui/components/MultiSelect.js +72 -0
  252. package/dist/tui/components/ReadlineInput.d.ts +8 -0
  253. package/dist/tui/components/ReadlineInput.d.ts.map +1 -0
  254. package/dist/tui/components/ReadlineInput.js +240 -0
  255. package/dist/tui/components/ReadlineInput.js.map +1 -0
  256. package/dist/tui/components/SingleSelect.d.ts +13 -0
  257. package/dist/tui/components/SingleSelect.js +46 -0
  258. package/dist/tui/components/StatusBar.d.ts +9 -0
  259. package/dist/tui/components/StatusBar.d.ts.map +1 -0
  260. package/dist/tui/components/StatusBar.js +82 -0
  261. package/dist/tui/components/StatusBar.js.map +1 -0
  262. package/dist/tui/components/index.d.ts +11 -0
  263. package/dist/tui/components/index.d.ts.map +1 -0
  264. package/dist/tui/components/index.js +11 -0
  265. package/dist/tui/components/index.js.map +1 -0
  266. package/dist/tui/index.d.ts +7 -0
  267. package/dist/tui/index.d.ts.map +1 -0
  268. package/dist/tui/index.js +7 -0
  269. package/dist/tui/index.js.map +1 -0
  270. package/package.json +86 -0
  271. package/src/styles/global.css +152 -0
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Task component inspired by shadcn.io/ai
4
+ * Enhanced todo/task display with collapsible details and file references
5
+ */
6
+ export interface TaskItem {
7
+ id: string;
8
+ text: string;
9
+ status: "pending" | "in_progress" | "completed";
10
+ /** Optional file references */
11
+ files?: string[];
12
+ /** Optional additional details */
13
+ details?: string;
14
+ }
15
+ export interface TaskProps extends React.HTMLAttributes<HTMLDivElement> {
16
+ /** Task item data */
17
+ task: TaskItem;
18
+ /** Show collapsible details */
19
+ collapsible?: boolean;
20
+ /** Default expanded state */
21
+ defaultExpanded?: boolean;
22
+ /** Callback when task is clicked */
23
+ onTaskClick?: (task: TaskItem) => void;
24
+ }
25
+ export declare const Task: React.ForwardRefExoticComponent<TaskProps & React.RefAttributes<HTMLDivElement>>;
26
+ export interface TaskListProps extends React.HTMLAttributes<HTMLDivElement> {
27
+ tasks: TaskItem[];
28
+ /** Show collapsible details */
29
+ collapsible?: boolean;
30
+ /** Callback when task is clicked */
31
+ onTaskClick?: (task: TaskItem) => void;
32
+ /** Empty state message */
33
+ emptyMessage?: string;
34
+ }
35
+ export declare const TaskList: React.ForwardRefExoticComponent<TaskListProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../../src/gui/components/Task.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;GAGG;AAEH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;IAChD,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE,qBAAqB;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,+BAA+B;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6BAA6B;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oCAAoC;IACpC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,IAAI,kFAkHhB,CAAC;AAQF,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oCAAoC;IACpC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,QAAQ,sFAmCpB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CheckCircle2, ChevronDown, Circle, Loader2 } from "lucide-react";
3
+ import * as React from "react";
4
+ import { useState } from "react";
5
+ import { cn } from "../lib/utils.js";
6
+ export const Task = React.forwardRef(({ task, collapsible = true, defaultExpanded = false, onTaskClick, className, ...props }, ref) => {
7
+ const [isExpanded, setIsExpanded] = useState(defaultExpanded);
8
+ const hasDetails = !!(task.details ||
9
+ (task.files && task.files.length > 0));
10
+ const StatusIcon = {
11
+ pending: Circle,
12
+ in_progress: Loader2,
13
+ completed: CheckCircle2,
14
+ }[task.status];
15
+ const getStatusColor = () => {
16
+ switch (task.status) {
17
+ case "completed":
18
+ return "text-green-500";
19
+ case "in_progress":
20
+ return "text-primary";
21
+ default:
22
+ return "text-foreground opacity-40";
23
+ }
24
+ };
25
+ const handleClick = () => {
26
+ if (hasDetails && collapsible) {
27
+ setIsExpanded(!isExpanded);
28
+ }
29
+ onTaskClick?.(task);
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: [_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: [_jsx(StatusIcon, { className: cn("w-4 h-4 shrink-0", getStatusColor(), task.status === "in_progress" && "animate-spin") }), _jsx("span", { className: cn("flex-1 text-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-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: [_jsx("span", { className: "text-xs 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-xs font-mono text-foreground opacity-70 bg-background px-2 py-1 rounded border border-border/50", children: file }, file))) })] }))] }))] }));
32
+ });
33
+ Task.displayName = "Task";
34
+ export const TaskList = React.forwardRef(({ tasks, collapsible = true, onTaskClick, emptyMessage = "No tasks yet.", className, ...props }, ref) => {
35
+ return (_jsx("div", { ref: ref, className: cn("space-y-2 max-h-96 overflow-y-auto", className), ...props, children: tasks.length === 0 ? (_jsx("p", { className: "text-sm text-foreground opacity-60 italic py-4 text-center", children: emptyMessage })) : (tasks.map((task) => (_jsx(Task, { task: task, collapsible: collapsible, ...(onTaskClick ? { onTaskClick } : {}) }, task.id)))) }));
36
+ });
37
+ TaskList.displayName = "TaskList";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Task.js","sourceRoot":"","sources":["../../../src/gui/components/Task.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA4B1E,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EACE,IAAI,EACJ,WAAW,GAAG,IAAI,EAClB,eAAe,GAAG,KAAK,EACvB,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAE7E,MAAM,UAAU,GAAG;QACjB,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,OAAO;QACpB,SAAS,E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F,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ declare const textareaVariants: (props?: ({
4
+ variant?: "default" | "error" | "success" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, VariantProps<typeof textareaVariants> {
7
+ autoResize?: boolean;
8
+ maxHeight?: number;
9
+ }
10
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
11
+ export { Textarea, textareaVariants };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/gui/components/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,gBAAgB;;8EAcrB,CAAC;AAEF,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EACvD,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,2FAmDb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import * as React from "react";
4
+ import { cn } from "../lib/utils.js";
5
+ const textareaVariants = cva("flex min-h-[80px] w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 resize-none", {
6
+ variants: {
7
+ variant: {
8
+ default: "border-input focus-visible:ring-ring",
9
+ error: "border-destructive focus-visible:ring-destructive",
10
+ success: "border-green-500 focus-visible:ring-green-500",
11
+ },
12
+ },
13
+ defaultVariants: {
14
+ variant: "default",
15
+ },
16
+ });
17
+ const Textarea = React.forwardRef(({ className, autoResize = false, maxHeight = 200, variant, ...props }, ref) => {
18
+ const textareaRef = React.useRef(null);
19
+ const handleRef = React.useCallback((node) => {
20
+ textareaRef.current = node;
21
+ if (typeof ref === "function") {
22
+ ref(node);
23
+ }
24
+ else if (ref) {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+ const adjustHeight = React.useCallback(() => {
29
+ const textarea = textareaRef.current;
30
+ if (!textarea || !autoResize)
31
+ return;
32
+ // Reset height to auto to get the correct scrollHeight
33
+ textarea.style.height = "auto";
34
+ // Set new height based on content, respecting maxHeight
35
+ const newHeight = Math.min(textarea.scrollHeight, maxHeight);
36
+ textarea.style.height = `${newHeight}px`;
37
+ // Enable scrollbar if content exceeds maxHeight
38
+ if (textarea.scrollHeight > maxHeight) {
39
+ textarea.style.overflowY = "auto";
40
+ }
41
+ else {
42
+ textarea.style.overflowY = "hidden";
43
+ }
44
+ }, [autoResize, maxHeight]);
45
+ React.useEffect(() => {
46
+ adjustHeight();
47
+ }, [adjustHeight]);
48
+ return (_jsx("textarea", { className: cn(textareaVariants({ variant }), autoResize && "overflow-y-hidden", className), ref: handleRef, ...props }));
49
+ });
50
+ Textarea.displayName = "Textarea";
51
+ export { Textarea, textareaVariants };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../src/gui/components/Textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,MAAM,gBAAgB,GAAG,GAAG,CAC1B,6Q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AQ,CAAC,YAAY,GAAG,SAAS,EAAE,CAAC;YACtC,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,QAAQ,CAAC;QACtC,CAAC;IACH,CAAC,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IAE5B,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,YAAY,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IAEhC,OAAO,CACL,mBACE,SAAS,EAAE,EAAE,CACX,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC,EAC7B,UAAU,IAAI,mBAAmB,EACjC,SAAS,CACV,EACD,GAAG,EAAE,SAAS,KACV,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ declare const thinkingBlockVariants: (props?: ({
3
+ variant?: "default" | "subtle" | "prominent" | null | undefined;
4
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
+ export interface ThinkingBlockProps extends VariantProps<typeof thinkingBlockVariants> {
6
+ thinking?: string;
7
+ isStreaming?: boolean;
8
+ displayMode?: "collapsible" | "inline";
9
+ className?: string;
10
+ }
11
+ export declare function ThinkingBlock({ thinking, isStreaming, displayMode, variant, className, }: ThinkingBlockProps): import("react/jsx-runtime").JSX.Element | null;
12
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThinkingBlock.d.ts","sourceRoot":"","sources":["../../../src/gui/components/ThinkingBlock.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,qBAAqB;;8EAc1B,CAAC;AAiBF,MAAM,WAAW,kBACf,SAAQ,YAAY,CAAC,OAAO,qBAAqB,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,WAAW,EACX,WAA2B,EAC3B,OAAO,EACP,SAAS,GACV,EAAE,kBAAkB,kDA+DpB"}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { ChevronDown } from "lucide-react";
4
+ import { useState } from "react";
5
+ import { cn } from "../lib/utils.js";
6
+ const thinkingBlockVariants = cva("mb-3 p-3 rounded-lg bg-card border border-border", {
7
+ variants: {
8
+ variant: {
9
+ default: "opacity-70",
10
+ subtle: "opacity-50",
11
+ prominent: "opacity-90",
12
+ },
13
+ },
14
+ defaultVariants: {
15
+ variant: "default",
16
+ },
17
+ });
18
+ const thinkingIconVariants = cva("w-4 h-4 text-foreground opacity-60 transition-transform", {
19
+ variants: {
20
+ expanded: {
21
+ true: "rotate-180",
22
+ false: "",
23
+ },
24
+ },
25
+ defaultVariants: {
26
+ expanded: false,
27
+ },
28
+ });
29
+ export function ThinkingBlock({ thinking, isStreaming, displayMode = "collapsible", variant, className, }) {
30
+ const [isExpanded, setIsExpanded] = useState(false);
31
+ if (!thinking && !isStreaming) {
32
+ return null;
33
+ }
34
+ // Inline mode - always visible
35
+ if (displayMode === "inline") {
36
+ return (_jsxs("div", { className: cn(thinkingBlockVariants({ variant }), className), children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsx("span", { className: "text-xs 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-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap", children: [thinking, isStreaming && thinking && (_jsx("span", { className: "inline-block animate-typing", children: "..." }))] })] }));
37
+ }
38
+ // Collapsible mode
39
+ return (_jsxs("div", { className: cn("mb-3", className), children: [_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: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-xs 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-xs text-foreground opacity-50 truncate max-w-[200px]", children: [thinking.substring(0, 50), "..."] }))] }), _jsx(ChevronDown, { className: thinkingIconVariants({ expanded: isExpanded }) })] }), isExpanded && (_jsx("div", { className: cn(thinkingBlockVariants({ variant }), "mt-2"), children: _jsxs("div", { className: "text-sm italic text-foreground opacity-80 leading-relaxed whitespace-pre-wrap", children: [thinking, isStreaming && thinking && (_jsx("span", { className: "inline-block animate-typing", children: "..." }))] }) }))] }));
40
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThinkingBlock.js","sourceRoot":"","sources":["../../../src/gui/components/ThinkingBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,MAAM,qBAAqB,GAAG,GAAG,CAC/B,mFAAmF,EACnF;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,YAAY;YACrB,MAAM,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AmL,aAE7L,eAAK,SAAS,EAAC,yBAAyB,aACtC,eAAM,SAAS,EAAC,iFAAiF,yBAE1F,EACN,WAAW,IAAI,CACd,eAAM,SAAS,EAAC,0EAA0E,GAAG,CAC9F,EACA,CAAC,UAAU,IAAI,QAAQ,IAAI,CAC1B,gBAAM,SAAS,EAAC,oEAAoE,aACjF,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,WACrB,CACR,IACG,EACN,KAAC,WAAW,IAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,GAAI,IACnE,EACR,UAAU,IAAI,CACb,cAAK,SAAS,EAAE,EAAE,CAAC,qBAAqB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,YAC5D,eAAK,SAAS,EAAC,wFAAwF,aACpG,QAAQ,EACR,WAAW,IAAI,QAAQ,IAAI,CAC1B,eAAM,SAAS,EAAC,6BAA6B,oBAAW,CACzD,IACG,GACF,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import type { AcpClient } from "../../sdk/client/index.js";
3
+ import { type TodoItem } from "./TodoListItem.js";
4
+ /**
5
+ * Supports two usage patterns:
6
+ * 1. Hook-based: Pass `client` prop (future support when todos are in store)
7
+ * 2. Prop-based: Pass `todos` prop directly
8
+ */
9
+ export interface TodoListProps extends React.HTMLAttributes<HTMLDivElement> {
10
+ /**
11
+ * ACP Client for hook-based todo fetching (future support)
12
+ */
13
+ client?: AcpClient | null;
14
+ /**
15
+ * Todos to display (prop-based pattern)
16
+ * Either client or todos should be provided
17
+ */
18
+ todos?: TodoItem[];
19
+ }
20
+ export declare const TodoList: React.ForwardRefExoticComponent<TodoListProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TodoList.d.ts","sourceRoot":"","sources":["../../../src/gui/components/TodoList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAgB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,QAAQ,sFAsBpB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../lib/utils.js";
4
+ import { TodoListItem } from "./TodoListItem.js";
5
+ export const TodoList = React.forwardRef(({ client, todos, className, ...props }, ref) => {
6
+ // For now, just use prop-based todos
7
+ // Future: Add hook to get todos from store when available
8
+ const todosToDisplay = todos || [];
9
+ return (_jsx("div", { ref: ref, className: cn("space-y-2 max-h-64 overflow-y-auto", className), ...props, children: todosToDisplay.length === 0 ? (_jsx("p", { className: "text-sm text-foreground opacity-60 italic", children: "No tasks yet." })) : (todosToDisplay.map((todo) => (_jsx(TodoListItem, { todo: todo }, todo.id)))) }));
10
+ });
11
+ TodoList.displayName = "TodoList";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TodoList.js","sourceRoot":"","sources":["../../../src/gui/components/TodoList.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAiB,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAoBrC,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CACtC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC9C,qCAAqC;IACrC,0DAA0D;IAC1D,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE,CAAC;IAEnC,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC,KAC1D,KAAK,YAER,cAAc,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAC7B,YAAG,SAAS,EAAC,oDAAoD,8BAE7D,CACL,CAAC,CAAC,CAAC,CACF,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAC,YAAY,IAAe,IAAI,EAAE,IAAI,IAAnB,IAAI,CAAC,EAAE,CAAgB,CAAC,CACzE,GACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ export interface TodoItem {
3
+ id: string;
4
+ text: string;
5
+ status: "pending" | "in_progress" | "completed";
6
+ }
7
+ export interface TodoListItemProps extends React.HTMLAttributes<HTMLDivElement> {
8
+ todo: TodoItem;
9
+ }
10
+ export declare const TodoListItem: React.ForwardRefExoticComponent<TodoListItemProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TodoListItem.d.ts","sourceRoot":"","sources":["../../../src/gui/components/TodoListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;CACjD;AAED,MAAM,WAAW,iBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,eAAO,MAAM,YAAY,0FAoBxB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../lib/utils.js";
4
+ export const TodoListItem = React.forwardRef(({ todo, className, ...props }, ref) => {
5
+ return (_jsx("div", { ref: ref, className: cn("flex items-center gap-3 px-3 py-2 rounded-lg", className), ...props, children: _jsx("span", { className: cn("flex-1 text-[var(--font-size)] font-[var(--font-family)]", todo.status === "completed" && "line-through opacity-60", todo.status === "in_progress" && "shimmer-animation"), children: todo.text }) }));
6
+ });
7
+ TodoListItem.displayName = "TodoListItem";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TodoListItem.js","sourceRoot":"","sources":["../../../src/gui/components/TodoListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAarC,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAC1C,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACrC,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,8CAA8C,EAAE,SAAS,CAAC,KACpE,KAAK,YAET,eACE,SAAS,EAAE,EAAE,CACX,0DAA0D,EAC1D,IAAI,CAAC,MAAM,KAAK,WAAW,IAAI,yBAAyB,EACxD,IAAI,CAAC,MAAM,KAAK,aAAa,IAAI,mBAAmB,CACrD,YAEA,IAAI,CAAC,IAAI,GACL,GACH,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
@@ -0,0 +1,23 @@
1
+ export { Button, type ButtonProps, buttonVariants } from "./Button.js";
2
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "./Card.js";
3
+ export { type ChatInputFieldProps, type ChatInputRootProps, type ChatInputSubmitProps, type ChatInputToolbarProps, Field as ChatInputField, Root as ChatInputRoot, Submit as ChatInputSubmit, Toolbar as ChatInputToolbar, } from "./ChatInput.js";
4
+ export { ChatSecondaryPanel, type ChatSecondaryPanelProps, } from "./ChatSecondaryPanel.js";
5
+ export { ChatStatus, type ChatStatusProps } from "./ChatStatus.js";
6
+ export { Conversation, type ConversationProps } from "./Conversation.js";
7
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./Dialog.js";
8
+ export { HeightTransition } from "./HeightTransition.js";
9
+ export { Input, type InputProps, inputVariants } from "./Input.js";
10
+ export { Label } from "./Label.js";
11
+ export { MarkdownRenderer } from "./MarkdownRenderer.js";
12
+ export { Message, type MessageProps } from "./Message.js";
13
+ export { MessageContent, type MessageContentProps } from "./MessageContent.js";
14
+ export type { DisplayMessage } from "./MessageList.js";
15
+ export { Reasoning, type ReasoningProps } from "./Reasoning.js";
16
+ export { Response, type ResponseProps } from "./Response.js";
17
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from "./Select.js";
18
+ export { Tabs, TabsContent, TabsList, TabsTrigger } from "./Tabs.js";
19
+ export { Task, type TaskItem, TaskList, type TaskListProps, type TaskProps, } from "./Task.js";
20
+ export { Textarea, type TextareaProps, textareaVariants } from "./Textarea.js";
21
+ export { ThinkingBlock, type ThinkingBlockProps, } from "./ThinkingBlock.js";
22
+ export { TodoList, type TodoListProps } from "./TodoList.js";
23
+ export { type TodoItem, TodoListItem, type TodoListItemProps, } from "./TodoListItem.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gui/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,IAAI,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EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAErE,OAAO,EACL,IAAI,EACJ,KAAK,QAAQ,EACb,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EACL,KAAK,QAAQ,EACb,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,28 @@
1
+ // Base UI components
2
+ export { Button, buttonVariants } from "./Button.js";
3
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "./Card.js";
4
+ // Chat components - composable primitives
5
+ export { Field as ChatInputField, Root as ChatInputRoot, Submit as ChatInputSubmit, Toolbar as ChatInputToolbar, } from "./ChatInput.js";
6
+ export { ChatSecondaryPanel, } from "./ChatSecondaryPanel.js";
7
+ export { ChatStatus } from "./ChatStatus.js";
8
+ // Chat components - shadcn.io/ai inspired primitives
9
+ export { Conversation } from "./Conversation.js";
10
+ // Dialog components
11
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./Dialog.js";
12
+ // Utility components
13
+ export { HeightTransition } from "./HeightTransition.js";
14
+ export { Input, inputVariants } from "./Input.js";
15
+ export { Label } from "./Label.js";
16
+ export { MarkdownRenderer } from "./MarkdownRenderer.js";
17
+ export { Message } from "./Message.js";
18
+ export { MessageContent } from "./MessageContent.js";
19
+ export { Reasoning } from "./Reasoning.js";
20
+ export { Response } from "./Response.js";
21
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from "./Select.js";
22
+ export { Tabs, TabsContent, TabsList, TabsTrigger } from "./Tabs.js";
23
+ // Task/Todo components
24
+ export { Task, TaskList, } from "./Task.js";
25
+ export { Textarea, textareaVariants } from "./Textarea.js";
26
+ export { ThinkingBlock, } from "./ThinkingBlock.js";
27
+ export { TodoList } from "./TodoList.js";
28
+ export { TodoListItem, } from "./TodoListItem.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gui/components/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EAAE,MAAM,EAAoB,cAAc,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,0CAA0C;AAC1C,OAAO,EAIL,KAAK,IAAI,cAAc,EACvB,IAAI,IAAI,aAAa,EACrB,MAAM,IAAI,eAAe,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kBAAkB,GAEnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAwB,MAAM,iBAAiB,CAAC;AACnE,qDAAqD;AACrD,OAAO,EAAE,YAAY,EAA0B,MAAM,mBAAmB,CAAC;AACzE,oBAAoB;AACpB,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,qBAAqB;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAmB,aAAa,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAqB,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,cAAc,EAA4B,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAuB,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAsB,MAAM,eAAe,CAAC;AAC7D,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrE,uBAAuB;AACvB,OAAO,EACL,IAAI,EAEJ,QAAQ,GAGT,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAsB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,aAAa,GAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAsB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAEL,YAAY,GAEb,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./components/index.js";
2
+ export { cn } from "./lib/utils.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gui/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAC;AAGtC,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Re-export all components
2
+ export * from "./components/index.js";
3
+ // Re-export utilities
4
+ export { cn } from "./lib/utils.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gui/index.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,cAAc,uBAAuB,CAAC;AAEtC,sBAAsB;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/gui/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
@@ -0,0 +1,5 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/gui/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @townco/ui
3
+ *
4
+ * Unified UI package with composable components
5
+ *
6
+ * - core: Headless components (business logic, hooks, state)
7
+ * - tui: Terminal UI with Ink
8
+ * - sdk: ACP Client SDK
9
+ */
10
+ export * from "./core/index.js";
11
+ export * from "./sdk/index.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @townco/ui
3
+ *
4
+ * Unified UI package with composable components
5
+ *
6
+ * - core: Headless components (business logic, hooks, state)
7
+ * - tui: Terminal UI with Ink
8
+ * - sdk: ACP Client SDK
9
+ */
10
+ // Re-export core and SDK for convenience
11
+ export * from "./core/index.js";
12
+ export * from "./sdk/index.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,yCAAyC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,84 @@
1
+ import type { MessageChunk, Session, SessionConfig, SessionUpdate } from "../schemas/index.js";
2
+ import type { HttpTransportOptions, StdioTransportOptions, WebSocketTransportOptions } from "../transports/index.js";
3
+ /**
4
+ * Client configuration with explicit transport selection
5
+ */
6
+ export type AcpClientConfig = {
7
+ type: "stdio";
8
+ options: StdioTransportOptions;
9
+ autoConnect?: boolean;
10
+ } | {
11
+ type: "http";
12
+ options: HttpTransportOptions;
13
+ autoConnect?: boolean;
14
+ } | {
15
+ type: "websocket";
16
+ options: WebSocketTransportOptions;
17
+ autoConnect?: boolean;
18
+ };
19
+ /**
20
+ * Simplified ACP client with explicit transport selection
21
+ */
22
+ export declare class AcpClient {
23
+ private config;
24
+ private transport;
25
+ private sessions;
26
+ private currentSessionId;
27
+ private sessionUpdateHandlers;
28
+ private errorHandlers;
29
+ constructor(config: AcpClientConfig);
30
+ /**
31
+ * Connect to the agent
32
+ */
33
+ connect(): Promise<void>;
34
+ /**
35
+ * Disconnect from the agent
36
+ */
37
+ disconnect(): Promise<void>;
38
+ /**
39
+ * Check if connected
40
+ */
41
+ isConnected(): boolean;
42
+ /**
43
+ * Start a new chat session
44
+ */
45
+ startSession(config?: Partial<SessionConfig>): Promise<string>;
46
+ /**
47
+ * Send a message in the current session
48
+ */
49
+ sendMessage(content: string, sessionId?: string): Promise<void>;
50
+ /**
51
+ * Receive messages from the agent (streaming)
52
+ */
53
+ receiveMessages(): AsyncIterableIterator<MessageChunk>;
54
+ /**
55
+ * Get a session by ID
56
+ */
57
+ getSession(sessionId: string): Session | undefined;
58
+ /**
59
+ * Get current session
60
+ */
61
+ getCurrentSession(): Session | undefined;
62
+ /**
63
+ * Get all sessions
64
+ */
65
+ getAllSessions(): Session[];
66
+ /**
67
+ * Subscribe to session updates
68
+ */
69
+ onSessionUpdate(handler: (update: SessionUpdate) => void): () => void;
70
+ /**
71
+ * Subscribe to errors
72
+ */
73
+ onError(handler: (error: Error) => void): () => void;
74
+ /**
75
+ * Create transport based on explicit configuration
76
+ */
77
+ private createTransport;
78
+ private setupTransportListeners;
79
+ private handleSessionUpdate;
80
+ private handleError;
81
+ private updateSessionStatus;
82
+ private generateSessionId;
83
+ private generateMessageId;
84
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp-client.d.ts","sourceRoot":"","sources":["../../../src/sdk/client/acp-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,YAAY,EACZ,OAAO,EACP,aAAa,EAEb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EAErB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAIhC;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GACxE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,oBAAoB,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GACtE;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,yBAAyB,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC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