@townco/ui 0.1.6 → 0.1.7

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 (250) hide show
  1. package/README.md +11 -11
  2. package/dist/core/hooks/use-chat-input.d.ts +17 -17
  3. package/dist/core/hooks/use-chat-input.js +55 -64
  4. package/dist/core/hooks/use-chat-messages.d.ts +11 -11
  5. package/dist/core/hooks/use-chat-messages.js +114 -121
  6. package/dist/core/hooks/use-chat-session.d.ts +5 -5
  7. package/dist/core/hooks/use-chat-session.js +80 -78
  8. package/dist/core/index.d.ts +1 -1
  9. package/dist/core/index.js +1 -1
  10. package/dist/core/schemas/chat.d.ts +56 -83
  11. package/dist/core/schemas/chat.js +25 -27
  12. package/dist/core/store/chat-store.d.ts +22 -28
  13. package/dist/core/store/chat-store.js +50 -59
  14. package/dist/gui/components/Button.d.ts +7 -23
  15. package/dist/gui/components/Button.js +27 -40
  16. package/dist/gui/components/Card.d.ts +7 -26
  17. package/dist/gui/components/Card.js +8 -54
  18. package/dist/gui/components/ChatInput.d.ts +36 -58
  19. package/dist/gui/components/ChatInput.js +121 -191
  20. package/dist/gui/components/ChatSecondaryPanel.d.ts +11 -14
  21. package/dist/gui/components/ChatSecondaryPanel.js +38 -115
  22. package/dist/gui/components/ChatStatus.d.ts +2 -4
  23. package/dist/gui/components/ChatStatus.js +34 -45
  24. package/dist/gui/components/Conversation.d.ts +14 -17
  25. package/dist/gui/components/Conversation.js +83 -143
  26. package/dist/gui/components/Dialog.d.ts +11 -57
  27. package/dist/gui/components/Dialog.js +8 -84
  28. package/dist/gui/components/HeightTransition.d.ts +7 -12
  29. package/dist/gui/components/HeightTransition.js +77 -88
  30. package/dist/gui/components/Input.d.ts +6 -13
  31. package/dist/gui/components/Input.js +16 -27
  32. package/dist/gui/components/Label.d.ts +1 -7
  33. package/dist/gui/components/Label.js +2 -12
  34. package/dist/gui/components/MarkdownRenderer.d.ts +4 -6
  35. package/dist/gui/components/MarkdownRenderer.js +81 -178
  36. package/dist/gui/components/Message.d.ts +18 -25
  37. package/dist/gui/components/Message.js +23 -44
  38. package/dist/gui/components/MessageContent.d.ts +22 -29
  39. package/dist/gui/components/MessageContent.js +85 -157
  40. package/dist/gui/components/Reasoning.d.ts +24 -30
  41. package/dist/gui/components/Reasoning.js +60 -187
  42. package/dist/gui/components/Response.d.ts +9 -11
  43. package/dist/gui/components/Response.js +90 -229
  44. package/dist/gui/components/Select.d.ts +10 -69
  45. package/dist/gui/components/Select.js +12 -118
  46. package/dist/gui/components/Tabs.d.ts +4 -24
  47. package/dist/gui/components/Tabs.js +4 -32
  48. package/dist/gui/components/Task.d.ts +24 -28
  49. package/dist/gui/components/Task.js +31 -164
  50. package/dist/gui/components/Textarea.d.ts +7 -15
  51. package/dist/gui/components/Textarea.js +46 -63
  52. package/dist/gui/components/ThinkingBlock.d.ts +10 -20
  53. package/dist/gui/components/ThinkingBlock.js +35 -134
  54. package/dist/gui/components/TodoList.d.ts +10 -12
  55. package/dist/gui/components/TodoList.js +7 -22
  56. package/dist/gui/components/TodoListItem.d.ts +6 -9
  57. package/dist/gui/components/TodoListItem.js +4 -18
  58. package/dist/gui/components/index.d.ts +8 -59
  59. package/dist/gui/components/index.js +8 -42
  60. package/dist/gui/lib/utils.js +1 -1
  61. package/dist/index.d.ts +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/index.test.js +1 -0
  64. package/dist/sdk/client/acp-client.d.ts +76 -88
  65. package/dist/sdk/client/acp-client.js +217 -215
  66. package/dist/sdk/index.d.ts +1 -1
  67. package/dist/sdk/index.js +1 -1
  68. package/dist/sdk/schemas/agent.d.ts +64 -111
  69. package/dist/sdk/schemas/agent.js +24 -24
  70. package/dist/sdk/schemas/message.d.ts +147 -245
  71. package/dist/sdk/schemas/message.js +40 -40
  72. package/dist/sdk/schemas/session.d.ts +135 -219
  73. package/dist/sdk/schemas/session.js +27 -27
  74. package/dist/sdk/transports/http.d.ts +55 -55
  75. package/dist/sdk/transports/http.js +469 -472
  76. package/dist/sdk/transports/stdio.d.ts +20 -20
  77. package/dist/sdk/transports/stdio.js +286 -289
  78. package/dist/sdk/transports/types.d.ts +42 -42
  79. package/dist/sdk/transports/websocket.d.ts +12 -12
  80. package/dist/sdk/transports/websocket.js +46 -52
  81. package/dist/tui/components/ChatView.d.ts +2 -4
  82. package/dist/tui/components/ChatView.js +18 -51
  83. package/dist/tui/components/GameOfLife.js +35 -64
  84. package/dist/tui/components/InputBox.d.ts +11 -18
  85. package/dist/tui/components/InputBox.js +10 -70
  86. package/dist/tui/components/MessageList.d.ts +2 -4
  87. package/dist/tui/components/MessageList.js +10 -37
  88. package/dist/tui/components/MultiSelect.d.ts +10 -15
  89. package/dist/tui/components/MultiSelect.js +73 -116
  90. package/dist/tui/components/ReadlineInput.d.ts +6 -12
  91. package/dist/tui/components/ReadlineInput.js +237 -252
  92. package/dist/tui/components/SingleSelect.d.ts +9 -15
  93. package/dist/tui/components/SingleSelect.js +43 -84
  94. package/dist/tui/components/StatusBar.d.ts +6 -11
  95. package/dist/tui/components/StatusBar.js +67 -102
  96. package/dist/tui/index.d.ts +1 -1
  97. package/dist/tui/index.js +1 -1
  98. package/package.json +2 -2
  99. package/dist/core/hooks/index.d.ts.map +0 -1
  100. package/dist/core/hooks/index.js.map +0 -1
  101. package/dist/core/hooks/use-chat-input.d.ts.map +0 -1
  102. package/dist/core/hooks/use-chat-input.js.map +0 -1
  103. package/dist/core/hooks/use-chat-messages.d.ts.map +0 -1
  104. package/dist/core/hooks/use-chat-messages.js.map +0 -1
  105. package/dist/core/hooks/use-chat-session.d.ts.map +0 -1
  106. package/dist/core/hooks/use-chat-session.js.map +0 -1
  107. package/dist/core/hooks/use-media-query.d.ts +0 -39
  108. package/dist/core/hooks/use-media-query.js +0 -80
  109. package/dist/core/index.d.ts.map +0 -1
  110. package/dist/core/index.js.map +0 -1
  111. package/dist/core/schemas/chat.d.ts.map +0 -1
  112. package/dist/core/schemas/chat.js.map +0 -1
  113. package/dist/core/schemas/index.d.ts.map +0 -1
  114. package/dist/core/schemas/index.js.map +0 -1
  115. package/dist/core/store/chat-store.d.ts.map +0 -1
  116. package/dist/core/store/chat-store.js.map +0 -1
  117. package/dist/gui/components/Button.d.ts.map +0 -1
  118. package/dist/gui/components/Button.js.map +0 -1
  119. package/dist/gui/components/Card.d.ts.map +0 -1
  120. package/dist/gui/components/Card.js.map +0 -1
  121. package/dist/gui/components/ChatHeader.d.ts +0 -65
  122. package/dist/gui/components/ChatHeader.js +0 -189
  123. package/dist/gui/components/ChatInput.d.ts.map +0 -1
  124. package/dist/gui/components/ChatInput.js.map +0 -1
  125. package/dist/gui/components/ChatInterface.d.ts +0 -12
  126. package/dist/gui/components/ChatInterface.d.ts.map +0 -1
  127. package/dist/gui/components/ChatInterface.js +0 -204
  128. package/dist/gui/components/ChatInterface.js.map +0 -1
  129. package/dist/gui/components/ChatLayout.d.ts +0 -82
  130. package/dist/gui/components/ChatLayout.js +0 -232
  131. package/dist/gui/components/ChatPanelTabContent.d.ts +0 -27
  132. package/dist/gui/components/ChatPanelTabContent.js +0 -93
  133. package/dist/gui/components/ChatPreview.d.ts +0 -12
  134. package/dist/gui/components/ChatPreview.d.ts.map +0 -1
  135. package/dist/gui/components/ChatPreview.js +0 -214
  136. package/dist/gui/components/ChatPreview.js.map +0 -1
  137. package/dist/gui/components/ChatSecondaryPanel.d.ts.map +0 -1
  138. package/dist/gui/components/ChatSecondaryPanel.js.map +0 -1
  139. package/dist/gui/components/ChatSidebar.d.ts +0 -27
  140. package/dist/gui/components/ChatSidebar.js +0 -57
  141. package/dist/gui/components/ChatStatus.d.ts.map +0 -1
  142. package/dist/gui/components/ChatStatus.js.map +0 -1
  143. package/dist/gui/components/ChatView.d.ts +0 -8
  144. package/dist/gui/components/ChatView.d.ts.map +0 -1
  145. package/dist/gui/components/ChatView.js +0 -42
  146. package/dist/gui/components/ChatView.js.map +0 -1
  147. package/dist/gui/components/ConfigPanel.d.ts +0 -20
  148. package/dist/gui/components/ConfigPanel.d.ts.map +0 -1
  149. package/dist/gui/components/ConfigPanel.js +0 -225
  150. package/dist/gui/components/ConfigPanel.js.map +0 -1
  151. package/dist/gui/components/Conversation.d.ts.map +0 -1
  152. package/dist/gui/components/Conversation.js.map +0 -1
  153. package/dist/gui/components/Dialog.d.ts.map +0 -1
  154. package/dist/gui/components/Dialog.js.map +0 -1
  155. package/dist/gui/components/DropdownMenu.d.ts +0 -108
  156. package/dist/gui/components/DropdownMenu.js +0 -215
  157. package/dist/gui/components/HeightTransition.d.ts.map +0 -1
  158. package/dist/gui/components/HeightTransition.js.map +0 -1
  159. package/dist/gui/components/Input.d.ts.map +0 -1
  160. package/dist/gui/components/Input.js.map +0 -1
  161. package/dist/gui/components/InputBox.d.ts +0 -21
  162. package/dist/gui/components/InputBox.d.ts.map +0 -1
  163. package/dist/gui/components/InputBox.js +0 -90
  164. package/dist/gui/components/InputBox.js.map +0 -1
  165. package/dist/gui/components/Label.d.ts.map +0 -1
  166. package/dist/gui/components/Label.js.map +0 -1
  167. package/dist/gui/components/MarkdownRenderer.d.ts.map +0 -1
  168. package/dist/gui/components/MarkdownRenderer.js.map +0 -1
  169. package/dist/gui/components/Message.d.ts.map +0 -1
  170. package/dist/gui/components/Message.js.map +0 -1
  171. package/dist/gui/components/MessageContent.d.ts.map +0 -1
  172. package/dist/gui/components/MessageContent.js.map +0 -1
  173. package/dist/gui/components/MessageList.d.ts.map +0 -1
  174. package/dist/gui/components/MessageList.js.map +0 -1
  175. package/dist/gui/components/PlaygroundLayout.d.ts +0 -14
  176. package/dist/gui/components/PlaygroundLayout.d.ts.map +0 -1
  177. package/dist/gui/components/PlaygroundLayout.js +0 -49
  178. package/dist/gui/components/PlaygroundLayout.js.map +0 -1
  179. package/dist/gui/components/Reasoning.d.ts.map +0 -1
  180. package/dist/gui/components/Reasoning.js.map +0 -1
  181. package/dist/gui/components/Response.d.ts.map +0 -1
  182. package/dist/gui/components/Response.js.map +0 -1
  183. package/dist/gui/components/Select.d.ts.map +0 -1
  184. package/dist/gui/components/Select.js.map +0 -1
  185. package/dist/gui/components/Sonner.d.ts +0 -7
  186. package/dist/gui/components/Sonner.js +0 -34
  187. package/dist/gui/components/StatusBar.d.ts +0 -12
  188. package/dist/gui/components/StatusBar.d.ts.map +0 -1
  189. package/dist/gui/components/StatusBar.js +0 -58
  190. package/dist/gui/components/StatusBar.js.map +0 -1
  191. package/dist/gui/components/Tabs.d.ts.map +0 -1
  192. package/dist/gui/components/Tabs.js.map +0 -1
  193. package/dist/gui/components/Task.d.ts.map +0 -1
  194. package/dist/gui/components/Task.js.map +0 -1
  195. package/dist/gui/components/Textarea.d.ts.map +0 -1
  196. package/dist/gui/components/Textarea.js.map +0 -1
  197. package/dist/gui/components/ThinkingBlock.d.ts.map +0 -1
  198. package/dist/gui/components/ThinkingBlock.js.map +0 -1
  199. package/dist/gui/components/TodoList.d.ts.map +0 -1
  200. package/dist/gui/components/TodoList.js.map +0 -1
  201. package/dist/gui/components/TodoListItem.d.ts.map +0 -1
  202. package/dist/gui/components/TodoListItem.js.map +0 -1
  203. package/dist/gui/components/index.d.ts.map +0 -1
  204. package/dist/gui/components/index.js.map +0 -1
  205. package/dist/gui/index.d.ts.map +0 -1
  206. package/dist/gui/index.js.map +0 -1
  207. package/dist/gui/lib/utils.d.ts.map +0 -1
  208. package/dist/gui/lib/utils.js.map +0 -1
  209. package/dist/index.d.ts.map +0 -1
  210. package/dist/index.js.map +0 -1
  211. package/dist/sdk/client/acp-client.d.ts.map +0 -1
  212. package/dist/sdk/client/acp-client.js.map +0 -1
  213. package/dist/sdk/client/index.d.ts.map +0 -1
  214. package/dist/sdk/client/index.js.map +0 -1
  215. package/dist/sdk/index.d.ts.map +0 -1
  216. package/dist/sdk/index.js.map +0 -1
  217. package/dist/sdk/schemas/agent.d.ts.map +0 -1
  218. package/dist/sdk/schemas/agent.js.map +0 -1
  219. package/dist/sdk/schemas/index.d.ts.map +0 -1
  220. package/dist/sdk/schemas/index.js.map +0 -1
  221. package/dist/sdk/schemas/message.d.ts.map +0 -1
  222. package/dist/sdk/schemas/message.js.map +0 -1
  223. package/dist/sdk/schemas/session.d.ts.map +0 -1
  224. package/dist/sdk/schemas/session.js.map +0 -1
  225. package/dist/sdk/transports/http.d.ts.map +0 -1
  226. package/dist/sdk/transports/http.js.map +0 -1
  227. package/dist/sdk/transports/index.d.ts.map +0 -1
  228. package/dist/sdk/transports/index.js.map +0 -1
  229. package/dist/sdk/transports/stdio.d.ts.map +0 -1
  230. package/dist/sdk/transports/stdio.js.map +0 -1
  231. package/dist/sdk/transports/types.d.ts.map +0 -1
  232. package/dist/sdk/transports/types.js.map +0 -1
  233. package/dist/sdk/transports/websocket.d.ts.map +0 -1
  234. package/dist/sdk/transports/websocket.js.map +0 -1
  235. package/dist/tui/components/ChatView.d.ts.map +0 -1
  236. package/dist/tui/components/ChatView.js.map +0 -1
  237. package/dist/tui/components/GameOfLife.d.ts.map +0 -1
  238. package/dist/tui/components/GameOfLife.js.map +0 -1
  239. package/dist/tui/components/InputBox.d.ts.map +0 -1
  240. package/dist/tui/components/InputBox.js.map +0 -1
  241. package/dist/tui/components/MessageList.d.ts.map +0 -1
  242. package/dist/tui/components/MessageList.js.map +0 -1
  243. package/dist/tui/components/ReadlineInput.d.ts.map +0 -1
  244. package/dist/tui/components/ReadlineInput.js.map +0 -1
  245. package/dist/tui/components/StatusBar.d.ts.map +0 -1
  246. package/dist/tui/components/StatusBar.js.map +0 -1
  247. package/dist/tui/components/index.d.ts.map +0 -1
  248. package/dist/tui/components/index.js.map +0 -1
  249. package/dist/tui/index.d.ts.map +0 -1
  250. package/dist/tui/index.js.map +0 -1
@@ -1,46 +1,33 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { Slot } from "@radix-ui/react-slot";
2
3
  import { cva } from "class-variance-authority";
3
4
  import * as React from "react";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
5
  import { cn } from "../lib/utils.js";
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
9
- {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
- destructive:
14
- "bg-destructive text-destructive-foreground hover:bg-destructive/90",
15
- outline:
16
- "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
17
- secondary:
18
- "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
- ghost: "hover:bg-accent hover:text-accent-foreground",
20
- link: "text-primary underline-offset-4 hover:underline",
21
- },
22
- size: {
23
- default: "h-10 px-4 py-2",
24
- sm: "h-9 rounded-md px-3",
25
- lg: "h-11 rounded-md px-8",
26
- icon: "h-10 w-10",
27
- },
28
- },
29
- defaultVariants: {
30
- variant: "default",
31
- size: "default",
32
- },
33
- },
34
- );
35
- const Button = React.forwardRef(
36
- ({ className, variant, size, asChild = false, ...props }, ref) => {
37
- const Comp = asChild ? Slot : "button";
38
- return _jsx(Comp, {
39
- className: cn(buttonVariants({ variant, size, className })),
40
- ref: ref,
41
- ...props,
42
- });
43
- },
44
- );
6
+ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
7
+ variants: {
8
+ variant: {
9
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
10
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
11
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
12
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
13
+ ghost: "hover:bg-accent hover:text-accent-foreground",
14
+ link: "text-primary underline-offset-4 hover:underline",
15
+ },
16
+ size: {
17
+ default: "h-10 px-4 py-2",
18
+ sm: "h-9 rounded-md px-3",
19
+ lg: "h-11 rounded-md px-8",
20
+ icon: "h-10 w-10",
21
+ },
22
+ },
23
+ defaultVariants: {
24
+ variant: "default",
25
+ size: "default",
26
+ },
27
+ });
28
+ const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
29
+ const Comp = asChild ? Slot : "button";
30
+ return (_jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props }));
31
+ });
45
32
  Button.displayName = "Button";
46
33
  export { Button, buttonVariants };
@@ -1,27 +1,8 @@
1
1
  import * as React from "react";
2
- declare const Card: React.ForwardRefExoticComponent<
3
- React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
4
- >;
5
- declare const CardHeader: React.ForwardRefExoticComponent<
6
- React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
7
- >;
8
- declare const CardTitle: React.ForwardRefExoticComponent<
9
- React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
10
- >;
11
- declare const CardDescription: React.ForwardRefExoticComponent<
12
- React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
13
- >;
14
- declare const CardContent: React.ForwardRefExoticComponent<
15
- React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
16
- >;
17
- declare const CardFooter: React.ForwardRefExoticComponent<
18
- React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>
19
- >;
20
- export {
21
- Card,
22
- CardHeader,
23
- CardFooter,
24
- CardTitle,
25
- CardDescription,
26
- CardContent,
27
- };
2
+ declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
3
+ declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
6
+ declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
7
+ declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
8
+ export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
@@ -1,62 +1,16 @@
1
- import * as React from "react";
2
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
3
  import { cn } from "../lib/utils.js";
4
-
5
- const Card = React.forwardRef(({ className, ...props }, ref) =>
6
- _jsx("div", {
7
- ref: ref,
8
- className: cn(
9
- "rounded-lg border bg-card text-card-foreground shadow-sm",
10
- className,
11
- ),
12
- ...props,
13
- }),
14
- );
4
+ const Card = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className), ...props })));
15
5
  Card.displayName = "Card";
16
- const CardHeader = React.forwardRef(({ className, ...props }, ref) =>
17
- _jsx("div", {
18
- ref: ref,
19
- className: cn("flex flex-col space-y-1.5 p-6", className),
20
- ...props,
21
- }),
22
- );
6
+ const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })));
23
7
  CardHeader.displayName = "CardHeader";
24
- const CardTitle = React.forwardRef(({ className, ...props }, ref) =>
25
- _jsx("div", {
26
- ref: ref,
27
- className: cn(
28
- "text-2xl font-semibold leading-none tracking-tight",
29
- className,
30
- ),
31
- ...props,
32
- }),
33
- );
8
+ const CardTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("text-2xl font-semibold leading-none tracking-tight", className), ...props })));
34
9
  CardTitle.displayName = "CardTitle";
35
- const CardDescription = React.forwardRef(({ className, ...props }, ref) =>
36
- _jsx("div", {
37
- ref: ref,
38
- className: cn("text-sm text-muted-foreground", className),
39
- ...props,
40
- }),
41
- );
10
+ const CardDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
42
11
  CardDescription.displayName = "CardDescription";
43
- const CardContent = React.forwardRef(({ className, ...props }, ref) =>
44
- _jsx("div", { ref: ref, className: cn("p-6 pt-0", className), ...props }),
45
- );
12
+ const CardContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("p-6 pt-0", className), ...props })));
46
13
  CardContent.displayName = "CardContent";
47
- const CardFooter = React.forwardRef(({ className, ...props }, ref) =>
48
- _jsx("div", {
49
- ref: ref,
50
- className: cn("flex items-center p-6 pt-0", className),
51
- ...props,
52
- }),
53
- );
14
+ const CardFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center p-6 pt-0", className), ...props })));
54
15
  CardFooter.displayName = "CardFooter";
55
- export {
56
- Card,
57
- CardHeader,
58
- CardFooter,
59
- CardTitle,
60
- CardDescription,
61
- CardContent,
62
- };
16
+ export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, };
@@ -1,64 +1,42 @@
1
1
  import * as React from "react";
2
2
  import type { AcpClient } from "../../sdk/client/index.js";
3
3
  import type { Textarea } from "./Textarea.js";
4
- export interface ChatInputRootProps
5
- extends Omit<
6
- React.FormHTMLAttributes<HTMLFormElement>,
7
- "onChange" | "onSubmit"
8
- > {
9
- /**
10
- * ACP Client for hook-based input management (recommended pattern)
11
- * Either client or value/onChange/onSubmit must be provided
12
- */
13
- client?: AcpClient | null;
14
- /**
15
- * Input value (legacy prop-based pattern)
16
- * Either client or value/onChange/onSubmit must be provided
17
- */
18
- value?: string;
19
- /**
20
- * Input change handler (legacy prop-based pattern)
21
- */
22
- onChange?: (value: string) => void;
23
- /**
24
- * Submit handler (legacy prop-based pattern)
25
- */
26
- onSubmit?: () => void | Promise<void>;
27
- /** Whether input is disabled */
28
- disabled?: boolean;
29
- /** Whether input is currently submitting */
30
- isSubmitting?: boolean;
31
- /** Whether to submit on Enter key (default: true) */
32
- submitOnEnter?: boolean;
4
+ export interface ChatInputRootProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, "onChange" | "onSubmit"> {
5
+ /**
6
+ * ACP Client for hook-based input management (recommended pattern)
7
+ * Either client or value/onChange/onSubmit must be provided
8
+ */
9
+ client?: AcpClient | null;
10
+ /**
11
+ * Input value (legacy prop-based pattern)
12
+ * Either client or value/onChange/onSubmit must be provided
13
+ */
14
+ value?: string;
15
+ /**
16
+ * Input change handler (legacy prop-based pattern)
17
+ */
18
+ onChange?: (value: string) => void;
19
+ /**
20
+ * Submit handler (legacy prop-based pattern)
21
+ */
22
+ onSubmit?: () => void | Promise<void>;
23
+ /** Whether input is disabled */
24
+ disabled?: boolean;
25
+ /** Whether input is currently submitting */
26
+ isSubmitting?: boolean;
27
+ /** Whether to submit on Enter key (default: true) */
28
+ submitOnEnter?: boolean;
33
29
  }
34
- declare const ChatInputRoot: React.ForwardRefExoticComponent<
35
- ChatInputRootProps & React.RefAttributes<HTMLFormElement>
36
- >;
37
- export interface ChatInputFieldProps
38
- extends Omit<
39
- React.ComponentPropsWithoutRef<typeof Textarea>,
40
- "value" | "onChange"
41
- > {
42
- asChild?: boolean;
30
+ declare const ChatInputRoot: React.ForwardRefExoticComponent<ChatInputRootProps & React.RefAttributes<HTMLFormElement>>;
31
+ export interface ChatInputFieldProps extends Omit<React.ComponentPropsWithoutRef<typeof Textarea>, "value" | "onChange"> {
32
+ asChild?: boolean;
43
33
  }
44
- declare const ChatInputField: React.ForwardRefExoticComponent<
45
- ChatInputFieldProps & React.RefAttributes<HTMLTextAreaElement>
46
- >;
47
- export interface ChatInputSubmitProps
48
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
49
- asChild?: boolean;
34
+ declare const ChatInputField: React.ForwardRefExoticComponent<ChatInputFieldProps & React.RefAttributes<HTMLTextAreaElement>>;
35
+ export interface ChatInputSubmitProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
36
+ asChild?: boolean;
50
37
  }
51
- declare const ChatInputSubmit: React.ForwardRefExoticComponent<
52
- ChatInputSubmitProps & React.RefAttributes<HTMLButtonElement>
53
- >;
54
- export interface ChatInputToolbarProps
55
- extends React.HTMLAttributes<HTMLDivElement> {}
56
- declare const ChatInputToolbar: React.ForwardRefExoticComponent<
57
- ChatInputToolbarProps & React.RefAttributes<HTMLDivElement>
58
- >;
59
- export {
60
- ChatInputRoot as Root,
61
- ChatInputField as Field,
62
- ChatInputSubmit as Submit,
63
- ChatInputToolbar as Toolbar,
64
- };
38
+ declare const ChatInputSubmit: React.ForwardRefExoticComponent<ChatInputSubmitProps & React.RefAttributes<HTMLButtonElement>>;
39
+ export interface ChatInputToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
40
+ }
41
+ declare const ChatInputToolbar: React.ForwardRefExoticComponent<ChatInputToolbarProps & React.RefAttributes<HTMLDivElement>>;
42
+ export { ChatInputRoot as Root, ChatInputField as Field, ChatInputSubmit as Submit, ChatInputToolbar as Toolbar, };
@@ -1,207 +1,137 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { Slot } from "@radix-ui/react-slot";
2
3
  import * as React from "react";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { useChatInput as useCoreChatInput } from "../../core/hooks/use-chat-input.js";
5
5
  import { useChatStore } from "../../core/store/chat-store.js";
6
6
  import { cn } from "../lib/utils.js";
7
7
  import { Button } from "./Button.js";
8
-
9
8
  const ChatInputContext = React.createContext(undefined);
10
9
  const useChatInputContext = () => {
11
- const context = React.useContext(ChatInputContext);
12
- if (!context) {
13
- throw new Error("ChatInput components must be used within ChatInput.Root");
14
- }
15
- return context;
10
+ const context = React.useContext(ChatInputContext);
11
+ if (!context) {
12
+ throw new Error("ChatInput components must be used within ChatInput.Root");
13
+ }
14
+ return context;
16
15
  };
17
- const ChatInputRoot = React.forwardRef(
18
- (
19
- {
20
- client,
21
- value: valueProp,
22
- onChange: onChangeProp,
23
- onSubmit: onSubmitProp,
24
- disabled = false,
25
- isSubmitting: isSubmittingProp,
26
- submitOnEnter = true,
27
- className,
28
- children,
29
- ...props
30
- },
31
- ref,
32
- ) => {
33
- const textareaRef = React.useRef(null);
34
- // Always call hooks unconditionally (React rules)
35
- const hookData = useCoreChatInput(client ?? null);
36
- const storeIsStreaming = useChatStore((state) => state.isStreaming);
37
- // Choose data source based on whether client is provided
38
- const value = hookData ? hookData.value : valueProp || "";
39
- const onChange = hookData ? hookData.onChange : onChangeProp || (() => {});
40
- const onSubmit = hookData
41
- ? hookData.onSubmit
42
- : onSubmitProp || (async () => {});
43
- const isSubmitting = hookData
44
- ? hookData.isSubmitting || storeIsStreaming
45
- : isSubmittingProp || false;
46
- const handleSubmit = async (e) => {
47
- e.preventDefault();
48
- if (value.trim() && !isSubmitting && !disabled) {
49
- await onSubmit();
50
- // Restore focus to textarea after submit
51
- setTimeout(() => {
52
- textareaRef.current?.focus();
53
- }, 0);
54
- }
55
- };
56
- // Expose textarea ref to children via context
57
- React.useEffect(() => {
58
- const textarea = document.querySelector('textarea[name="chat-input"]');
59
- if (textarea && textareaRef.current !== textarea) {
60
- textareaRef.current = textarea;
61
- }
62
- }, []);
63
- // Reset textarea height when value becomes empty (after submit)
64
- React.useEffect(() => {
65
- if (!value && textareaRef.current) {
66
- textareaRef.current.style.height = "auto";
67
- textareaRef.current.style.overflowY = "hidden";
68
- }
69
- }, [value]);
70
- return _jsx(ChatInputContext.Provider, {
71
- value: {
72
- value,
73
- onChange,
74
- onSubmit,
75
- disabled,
76
- isSubmitting,
77
- submitOnEnter,
78
- },
79
- children: _jsx("form", {
80
- ref: ref,
81
- onSubmit: handleSubmit,
82
- className: cn(
83
- "w-full divide-y overflow-hidden rounded-xl border bg-background shadow-sm",
84
- className,
85
- ),
86
- ...props,
87
- children: children,
88
- }),
89
- });
90
- },
91
- );
16
+ const ChatInputRoot = React.forwardRef(({ client, value: valueProp, onChange: onChangeProp, onSubmit: onSubmitProp, disabled = false, isSubmitting: isSubmittingProp, submitOnEnter = true, className, children, ...props }, ref) => {
17
+ const textareaRef = React.useRef(null);
18
+ // Always call hooks unconditionally (React rules)
19
+ const hookData = useCoreChatInput(client ?? null);
20
+ const storeIsStreaming = useChatStore((state) => state.isStreaming);
21
+ // Choose data source based on whether client is provided
22
+ const value = hookData ? hookData.value : valueProp || "";
23
+ const onChange = hookData ? hookData.onChange : onChangeProp || (() => { });
24
+ const onSubmit = hookData
25
+ ? hookData.onSubmit
26
+ : onSubmitProp || (async () => { });
27
+ const isSubmitting = hookData
28
+ ? hookData.isSubmitting || storeIsStreaming
29
+ : isSubmittingProp || false;
30
+ const handleSubmit = async (e) => {
31
+ e.preventDefault();
32
+ if (value.trim() && !isSubmitting && !disabled) {
33
+ await onSubmit();
34
+ // Restore focus to textarea after submit
35
+ setTimeout(() => {
36
+ textareaRef.current?.focus();
37
+ }, 0);
38
+ }
39
+ };
40
+ // Expose textarea ref to children via context
41
+ React.useEffect(() => {
42
+ const textarea = document.querySelector('textarea[name="chat-input"]');
43
+ if (textarea && textareaRef.current !== textarea) {
44
+ textareaRef.current = textarea;
45
+ }
46
+ }, []);
47
+ // Reset textarea height when value becomes empty (after submit)
48
+ React.useEffect(() => {
49
+ if (!value && textareaRef.current) {
50
+ textareaRef.current.style.height = "auto";
51
+ textareaRef.current.style.overflowY = "hidden";
52
+ }
53
+ }, [value]);
54
+ return (_jsx(ChatInputContext.Provider, { value: {
55
+ value,
56
+ onChange,
57
+ onSubmit,
58
+ disabled,
59
+ isSubmitting,
60
+ submitOnEnter,
61
+ }, children: _jsx("form", { ref: ref, onSubmit: handleSubmit, className: cn("w-full divide-y overflow-hidden rounded-xl border bg-background shadow-sm", className), ...props, children: children }) }));
62
+ });
92
63
  ChatInputRoot.displayName = "ChatInput.Root";
93
- const ChatInputField = React.forwardRef(
94
- ({ asChild = false, className, onKeyDown, children, ...props }, ref) => {
95
- const { value, onChange, onSubmit, disabled, isSubmitting, submitOnEnter } =
96
- useChatInputContext();
97
- const textareaRef = React.useRef(null);
98
- const handleRef = React.useCallback(
99
- (node) => {
100
- textareaRef.current = node;
101
- if (typeof ref === "function") {
102
- ref(node);
103
- } else if (ref) {
104
- ref.current = node;
105
- }
106
- },
107
- [ref],
108
- );
109
- const handleKeyDown = (e) => {
110
- // Handle Enter without Shift - only submit if not already submitting
111
- if (submitOnEnter && e.key === "Enter" && !e.shiftKey) {
112
- // Only prevent default and submit if conditions are met
113
- if (value.trim() && !isSubmitting && !disabled) {
114
- e.preventDefault();
115
- onSubmit();
116
- } else if (isSubmitting || disabled) {
117
- // Block Enter when submitting or disabled - don't add newline
118
- e.preventDefault();
119
- }
120
- }
121
- onKeyDown?.(e);
122
- };
123
- const handleChange = (e) => {
124
- onChange(e.target.value);
125
- // Auto-resize
126
- const textarea = textareaRef.current;
127
- if (!textarea) return;
128
- textarea.style.height = "auto";
129
- const newHeight = Math.min(textarea.scrollHeight, 164);
130
- textarea.style.height = `${newHeight}px`;
131
- if (textarea.scrollHeight > 164) {
132
- textarea.style.overflowY = "auto";
133
- } else {
134
- textarea.style.overflowY = "hidden";
135
- }
136
- };
137
- const fieldProps = {
138
- ref: handleRef,
139
- name: "chat-input",
140
- value,
141
- onChange: handleChange,
142
- onKeyDown: handleKeyDown,
143
- disabled: disabled,
144
- ...props,
145
- };
146
- if (asChild && React.isValidElement(children)) {
147
- return React.cloneElement(children, fieldProps);
148
- }
149
- return _jsx("textarea", {
150
- ...fieldProps,
151
- className: cn(
152
- "w-full resize-none rounded-none border-none p-3 shadow-none",
153
- "outline-none ring-0 field-sizing-content max-h-[6lh]",
154
- "bg-transparent dark:bg-transparent focus-visible:ring-0",
155
- "text-sm placeholder:text-muted-foreground",
156
- "disabled:cursor-not-allowed disabled:opacity-50",
157
- className,
158
- ),
159
- });
160
- },
161
- );
64
+ const ChatInputField = React.forwardRef(({ asChild = false, className, onKeyDown, children, ...props }, ref) => {
65
+ const { value, onChange, onSubmit, disabled, isSubmitting, submitOnEnter } = useChatInputContext();
66
+ const textareaRef = React.useRef(null);
67
+ const handleRef = React.useCallback((node) => {
68
+ textareaRef.current = node;
69
+ if (typeof ref === "function") {
70
+ ref(node);
71
+ }
72
+ else if (ref) {
73
+ ref.current = node;
74
+ }
75
+ }, [ref]);
76
+ const handleKeyDown = (e) => {
77
+ // Handle Enter without Shift - only submit if not already submitting
78
+ if (submitOnEnter && e.key === "Enter" && !e.shiftKey) {
79
+ // Only prevent default and submit if conditions are met
80
+ if (value.trim() && !isSubmitting && !disabled) {
81
+ e.preventDefault();
82
+ onSubmit();
83
+ }
84
+ else if (isSubmitting || disabled) {
85
+ // Block Enter when submitting or disabled - don't add newline
86
+ e.preventDefault();
87
+ }
88
+ }
89
+ onKeyDown?.(e);
90
+ };
91
+ const handleChange = (e) => {
92
+ onChange(e.target.value);
93
+ // Auto-resize
94
+ const textarea = textareaRef.current;
95
+ if (!textarea)
96
+ return;
97
+ textarea.style.height = "auto";
98
+ const newHeight = Math.min(textarea.scrollHeight, 164);
99
+ textarea.style.height = `${newHeight}px`;
100
+ if (textarea.scrollHeight > 164) {
101
+ textarea.style.overflowY = "auto";
102
+ }
103
+ else {
104
+ textarea.style.overflowY = "hidden";
105
+ }
106
+ };
107
+ const fieldProps = {
108
+ ref: handleRef,
109
+ name: "chat-input",
110
+ value,
111
+ onChange: handleChange,
112
+ onKeyDown: handleKeyDown,
113
+ disabled: disabled,
114
+ ...props,
115
+ };
116
+ if (asChild && React.isValidElement(children)) {
117
+ return React.cloneElement(children, fieldProps);
118
+ }
119
+ return (_jsx("textarea", { ...fieldProps, className: cn("w-full resize-none rounded-none border-none p-3 shadow-none", "outline-none ring-0 field-sizing-content max-h-[6lh]", "bg-transparent dark:bg-transparent focus-visible:ring-0", "text-sm placeholder:text-muted-foreground", "disabled:cursor-not-allowed disabled:opacity-50", className) }));
120
+ });
162
121
  ChatInputField.displayName = "ChatInput.Field";
163
- const ChatInputSubmit = React.forwardRef(
164
- (
165
- { asChild = false, className, disabled: disabledProp, children, ...props },
166
- ref,
167
- ) => {
168
- const { value, disabled, isSubmitting } = useChatInputContext();
169
- const isDisabled =
170
- disabledProp || disabled || isSubmitting || !value.trim();
171
- const Comp = asChild ? Slot : Button;
172
- return _jsx(Comp, {
173
- ref: ref,
174
- type: "submit",
175
- disabled: isDisabled,
176
- size: "icon",
177
- className: cn(
178
- !asChild &&
179
- "gap-1.5 rounded-lg bg-transparent text-foreground hover:bg-transparent",
180
- className,
181
- ),
182
- ...props,
183
- children: children,
184
- });
185
- },
186
- );
122
+ const ChatInputSubmit = React.forwardRef(({ asChild = false, className, disabled: disabledProp, children, ...props }, ref) => {
123
+ const { value, disabled, isSubmitting } = useChatInputContext();
124
+ const isDisabled = disabledProp || disabled || isSubmitting || !value.trim();
125
+ const Comp = asChild ? Slot : Button;
126
+ return (_jsx(Comp, { ref: ref, type: "submit", disabled: isDisabled, size: "icon", className: cn(!asChild &&
127
+ "gap-1.5 rounded-lg bg-transparent text-foreground hover:bg-transparent", className), ...props, children: children }));
128
+ });
187
129
  ChatInputSubmit.displayName = "ChatInput.Submit";
188
- const ChatInputToolbar = React.forwardRef(
189
- ({ className, children, ...props }, ref) => {
190
- return _jsx("div", {
191
- ref: ref,
192
- className: cn("flex items-center justify-between p-1", className),
193
- ...props,
194
- children: children,
195
- });
196
- },
197
- );
130
+ const ChatInputToolbar = React.forwardRef(({ className, children, ...props }, ref) => {
131
+ return (_jsx("div", { ref: ref, className: cn("flex items-center justify-between p-1", className), ...props, children: children }));
132
+ });
198
133
  ChatInputToolbar.displayName = "ChatInput.Toolbar";
199
134
  /* -------------------------------------------------------------------------------------------------
200
135
  * Exports
201
136
  * -----------------------------------------------------------------------------------------------*/
202
- export {
203
- ChatInputRoot as Root,
204
- ChatInputField as Field,
205
- ChatInputSubmit as Submit,
206
- ChatInputToolbar as Toolbar,
207
- };
137
+ export { ChatInputRoot as Root, ChatInputField as Field, ChatInputSubmit as Submit, ChatInputToolbar as Toolbar, };
@@ -6,18 +6,15 @@ import type { TodoItem } from "./TodoListItem.js";
6
6
  * 1. Hook-based: Pass `client` prop (future support when todos are in store)
7
7
  * 2. Prop-based: Pass `todos` prop directly
8
8
  */
9
- export interface ChatSecondaryPanelProps
10
- extends React.HTMLAttributes<HTMLDivElement> {
11
- /**
12
- * ACP Client for hook-based todo fetching (future support)
13
- */
14
- client?: AcpClient | null;
15
- /**
16
- * Todos to display (prop-based pattern)
17
- * Either client or todos should be provided
18
- */
19
- todos?: TodoItem[];
9
+ export interface ChatSecondaryPanelProps 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[];
20
19
  }
21
- export declare const ChatSecondaryPanel: React.ForwardRefExoticComponent<
22
- ChatSecondaryPanelProps & React.RefAttributes<HTMLDivElement>
23
- >;
20
+ export declare const ChatSecondaryPanel: React.ForwardRefExoticComponent<ChatSecondaryPanelProps & React.RefAttributes<HTMLDivElement>>;