@townco/ui 0.1.0 → 0.1.3

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 (125) hide show
  1. package/dist/core/hooks/use-chat-input.d.ts +17 -17
  2. package/dist/core/hooks/use-chat-input.js +64 -55
  3. package/dist/core/hooks/use-chat-messages.d.ts +11 -11
  4. package/dist/core/hooks/use-chat-messages.js +121 -114
  5. package/dist/core/hooks/use-chat-session.d.ts +5 -5
  6. package/dist/core/hooks/use-chat-session.js +78 -80
  7. package/dist/core/hooks/use-media-query.d.ts +5 -5
  8. package/dist/core/hooks/use-media-query.js +38 -38
  9. package/dist/core/index.d.ts +1 -1
  10. package/dist/core/index.js +1 -1
  11. package/dist/core/schemas/chat.d.ts +83 -56
  12. package/dist/core/schemas/chat.js +27 -25
  13. package/dist/core/store/chat-store.d.ts +28 -22
  14. package/dist/core/store/chat-store.js +59 -50
  15. package/dist/gui/components/Button.d.ts +23 -7
  16. package/dist/gui/components/Button.js +40 -27
  17. package/dist/gui/components/Card.d.ts +26 -7
  18. package/dist/gui/components/Card.js +54 -8
  19. package/dist/gui/components/ChatHeader.d.ts +58 -31
  20. package/dist/gui/components/ChatHeader.js +171 -66
  21. package/dist/gui/components/ChatInput.d.ts +58 -36
  22. package/dist/gui/components/ChatInput.js +191 -121
  23. package/dist/gui/components/ChatInterface.d.ts +9 -6
  24. package/dist/gui/components/ChatInterface.js +162 -90
  25. package/dist/gui/components/ChatLayout.d.ts +71 -41
  26. package/dist/gui/components/ChatLayout.js +214 -87
  27. package/dist/gui/components/ChatPanelTabContent.d.ts +18 -9
  28. package/dist/gui/components/ChatPanelTabContent.js +88 -10
  29. package/dist/gui/components/ChatPreview.d.ts +9 -6
  30. package/dist/gui/components/ChatPreview.js +212 -162
  31. package/dist/gui/components/ChatSecondaryPanel.d.ts +14 -11
  32. package/dist/gui/components/ChatSecondaryPanel.js +115 -38
  33. package/dist/gui/components/ChatSidebar.d.ts +26 -13
  34. package/dist/gui/components/ChatSidebar.js +48 -14
  35. package/dist/gui/components/ChatStatus.d.ts +4 -2
  36. package/dist/gui/components/ChatStatus.js +45 -34
  37. package/dist/gui/components/ChatView.d.ts +5 -3
  38. package/dist/gui/components/ChatView.js +38 -9
  39. package/dist/gui/components/ConfigPanel.d.ts +16 -12
  40. package/dist/gui/components/ConfigPanel.js +218 -41
  41. package/dist/gui/components/Conversation.d.ts +17 -14
  42. package/dist/gui/components/Conversation.js +143 -83
  43. package/dist/gui/components/Dialog.d.ts +57 -11
  44. package/dist/gui/components/Dialog.js +84 -8
  45. package/dist/gui/components/DropdownMenu.d.ts +101 -20
  46. package/dist/gui/components/DropdownMenu.js +161 -14
  47. package/dist/gui/components/HeightTransition.d.ts +12 -7
  48. package/dist/gui/components/HeightTransition.js +88 -77
  49. package/dist/gui/components/Input.d.ts +13 -6
  50. package/dist/gui/components/Input.js +27 -16
  51. package/dist/gui/components/InputBox.d.ts +19 -12
  52. package/dist/gui/components/InputBox.js +86 -14
  53. package/dist/gui/components/Label.d.ts +7 -1
  54. package/dist/gui/components/Label.js +12 -2
  55. package/dist/gui/components/MarkdownRenderer.d.ts +6 -4
  56. package/dist/gui/components/MarkdownRenderer.js +178 -81
  57. package/dist/gui/components/Message.d.ts +25 -18
  58. package/dist/gui/components/Message.js +44 -23
  59. package/dist/gui/components/MessageContent.d.ts +29 -22
  60. package/dist/gui/components/MessageContent.js +157 -85
  61. package/dist/gui/components/PlaygroundLayout.d.ts +9 -5
  62. package/dist/gui/components/PlaygroundLayout.js +43 -12
  63. package/dist/gui/components/Reasoning.d.ts +30 -24
  64. package/dist/gui/components/Reasoning.js +187 -60
  65. package/dist/gui/components/Response.d.ts +11 -9
  66. package/dist/gui/components/Response.js +229 -90
  67. package/dist/gui/components/Select.d.ts +69 -10
  68. package/dist/gui/components/Select.js +118 -12
  69. package/dist/gui/components/Sonner.d.ts +3 -1
  70. package/dist/gui/components/Sonner.js +29 -18
  71. package/dist/gui/components/StatusBar.d.ts +9 -5
  72. package/dist/gui/components/StatusBar.js +56 -9
  73. package/dist/gui/components/Tabs.d.ts +24 -4
  74. package/dist/gui/components/Tabs.js +32 -4
  75. package/dist/gui/components/Task.d.ts +28 -24
  76. package/dist/gui/components/Task.js +164 -31
  77. package/dist/gui/components/Textarea.d.ts +15 -7
  78. package/dist/gui/components/Textarea.js +63 -46
  79. package/dist/gui/components/ThinkingBlock.d.ts +20 -10
  80. package/dist/gui/components/ThinkingBlock.js +134 -35
  81. package/dist/gui/components/TodoList.d.ts +12 -10
  82. package/dist/gui/components/TodoList.js +22 -7
  83. package/dist/gui/components/TodoListItem.d.ts +9 -6
  84. package/dist/gui/components/TodoListItem.js +18 -4
  85. package/dist/gui/components/index.d.ts +59 -8
  86. package/dist/gui/components/index.js +42 -8
  87. package/dist/gui/lib/utils.js +1 -1
  88. package/dist/index.d.ts +1 -1
  89. package/dist/index.js +1 -1
  90. package/dist/index.test.js +0 -1
  91. package/dist/sdk/client/acp-client.d.ts +88 -76
  92. package/dist/sdk/client/acp-client.js +215 -217
  93. package/dist/sdk/index.d.ts +1 -1
  94. package/dist/sdk/index.js +1 -1
  95. package/dist/sdk/schemas/agent.d.ts +111 -64
  96. package/dist/sdk/schemas/agent.js +24 -24
  97. package/dist/sdk/schemas/message.d.ts +245 -147
  98. package/dist/sdk/schemas/message.js +40 -40
  99. package/dist/sdk/schemas/session.d.ts +219 -135
  100. package/dist/sdk/schemas/session.js +27 -27
  101. package/dist/sdk/transports/http.d.ts +55 -55
  102. package/dist/sdk/transports/http.js +472 -469
  103. package/dist/sdk/transports/stdio.d.ts +20 -20
  104. package/dist/sdk/transports/stdio.js +289 -286
  105. package/dist/sdk/transports/types.d.ts +42 -42
  106. package/dist/sdk/transports/websocket.d.ts +12 -12
  107. package/dist/sdk/transports/websocket.js +52 -46
  108. package/dist/tui/components/ChatView.d.ts +4 -2
  109. package/dist/tui/components/ChatView.js +51 -18
  110. package/dist/tui/components/GameOfLife.js +64 -35
  111. package/dist/tui/components/InputBox.d.ts +18 -11
  112. package/dist/tui/components/InputBox.js +70 -10
  113. package/dist/tui/components/MessageList.d.ts +4 -2
  114. package/dist/tui/components/MessageList.js +37 -10
  115. package/dist/tui/components/MultiSelect.d.ts +15 -9
  116. package/dist/tui/components/MultiSelect.js +116 -69
  117. package/dist/tui/components/ReadlineInput.d.ts +12 -6
  118. package/dist/tui/components/ReadlineInput.js +252 -237
  119. package/dist/tui/components/SingleSelect.d.ts +15 -9
  120. package/dist/tui/components/SingleSelect.js +84 -43
  121. package/dist/tui/components/StatusBar.d.ts +11 -6
  122. package/dist/tui/components/StatusBar.js +102 -67
  123. package/dist/tui/index.d.ts +1 -1
  124. package/dist/tui/index.js +1 -1
  125. package/package.json +2 -3
@@ -1,11 +1,16 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
1
  import { cva } from "class-variance-authority";
3
2
  import { Loader2Icon } from "lucide-react";
4
3
  import * as React from "react";
4
+ import {
5
+ Fragment as _Fragment,
6
+ jsx as _jsx,
7
+ jsxs as _jsxs,
8
+ } from "react/jsx-runtime";
5
9
  import { useChatStore } from "../../core/store/chat-store.js";
6
10
  import { cn } from "../lib/utils.js";
7
11
  import { Reasoning } from "./Reasoning.js";
8
12
  import { Response } from "./Response.js";
13
+
9
14
  /**
10
15
  * MessageContent component inspired by shadcn.io/ai
11
16
  * Provides the content container with role-based styling
@@ -13,92 +18,159 @@ import { Response } from "./Response.js";
13
18
  */
14
19
  // Synonyms of "thinking" in multiple languages
15
20
  const THINKING_WORDS = [
16
- "Thinking",
17
- "Pensando",
18
- "Pensant",
19
- "Denkend",
20
- "Pensando",
21
- "考えている",
22
- "생각 중",
23
- "思考中",
24
- "Размышляя",
25
- "Düşünüyor",
26
- "Myślący",
27
- "Tänkande",
28
- "Pensando",
29
- "Ajatellen",
30
- "Σκεπτόμενος",
31
- "חושב",
32
- "सोच रहा है",
33
- "Berpikir",
21
+ "Thinking",
22
+ "Pensando",
23
+ "Pensant",
24
+ "Denkend",
25
+ "Pensando",
26
+ "考えている",
27
+ "생각 중",
28
+ "思考中",
29
+ "Размышляя",
30
+ "Düşünüyor",
31
+ "Myślący",
32
+ "Tänkande",
33
+ "Pensando",
34
+ "Ajatellen",
35
+ "Σκεπτόμενος",
36
+ "חושב",
37
+ "सोच रहा है",
38
+ "Berpikir",
34
39
  ];
35
40
  const DOT_ANIMATIONS = ["...", "·..", ".·.", "..·", ".·.", "·.."];
36
41
  function WaitingElapsedTime({ startTime }) {
37
- const [elapsed, setElapsed] = React.useState(0);
38
- const [thinkingWord, setThinkingWord] = React.useState(() => THINKING_WORDS[Math.floor(Math.random() * THINKING_WORDS.length)]);
39
- const [dotIndex, setDotIndex] = React.useState(0);
40
- React.useEffect(() => {
41
- const interval = setInterval(() => {
42
- const now = Date.now();
43
- const elapsedMs = now - startTime;
44
- setElapsed(elapsedMs);
45
- }, 100);
46
- return () => clearInterval(interval);
47
- }, [startTime]);
48
- React.useEffect(() => {
49
- const wordInterval = setInterval(() => {
50
- const randomIndex = Math.floor(Math.random() * THINKING_WORDS.length);
51
- setThinkingWord(THINKING_WORDS[randomIndex]);
52
- }, 1500);
53
- return () => clearInterval(wordInterval);
54
- }, []);
55
- React.useEffect(() => {
56
- const dotInterval = setInterval(() => {
57
- setDotIndex((prev) => (prev + 1) % DOT_ANIMATIONS.length);
58
- }, 100);
59
- return () => clearInterval(dotInterval);
60
- }, []);
61
- const seconds = (elapsed / 1000).toFixed(1);
62
- const animatedDots = DOT_ANIMATIONS[dotIndex];
63
- return (_jsxs("span", { className: "text-muted-foreground text-sm", children: [thinkingWord, animatedDots, " ", seconds, "s"] }));
42
+ const [elapsed, setElapsed] = React.useState(0);
43
+ const [thinkingWord, setThinkingWord] = React.useState(
44
+ () => THINKING_WORDS[Math.floor(Math.random() * THINKING_WORDS.length)],
45
+ );
46
+ const [dotIndex, setDotIndex] = React.useState(0);
47
+ React.useEffect(() => {
48
+ const interval = setInterval(() => {
49
+ const now = Date.now();
50
+ const elapsedMs = now - startTime;
51
+ setElapsed(elapsedMs);
52
+ }, 100);
53
+ return () => clearInterval(interval);
54
+ }, [startTime]);
55
+ React.useEffect(() => {
56
+ const wordInterval = setInterval(() => {
57
+ const randomIndex = Math.floor(Math.random() * THINKING_WORDS.length);
58
+ setThinkingWord(THINKING_WORDS[randomIndex]);
59
+ }, 1500);
60
+ return () => clearInterval(wordInterval);
61
+ }, []);
62
+ React.useEffect(() => {
63
+ const dotInterval = setInterval(() => {
64
+ setDotIndex((prev) => (prev + 1) % DOT_ANIMATIONS.length);
65
+ }, 100);
66
+ return () => clearInterval(dotInterval);
67
+ }, []);
68
+ const seconds = (elapsed / 1000).toFixed(1);
69
+ const animatedDots = DOT_ANIMATIONS[dotIndex];
70
+ return _jsxs("span", {
71
+ className: "text-muted-foreground text-sm",
72
+ children: [thinkingWord, animatedDots, " ", seconds, "s"],
73
+ });
64
74
  }
65
- const messageContentVariants = cva("w-full px-4 py-3 rounded-xl text-[var(--font-size)] font-[var(--font-family)] leading-relaxed break-words transition-colors", {
66
- variants: {
67
- role: {
68
- user: "bg-primary text-primary-foreground shadow-sm",
69
- assistant: "bg-muted text-foreground",
70
- system: "bg-card border border-border text-foreground opacity-80 text-sm",
71
- },
72
- variant: {
73
- default: "",
74
- outline: "border border-border",
75
- ghost: "bg-transparent",
76
- },
77
- },
78
- defaultVariants: {
79
- role: "assistant",
80
- variant: "default",
81
- },
82
- });
83
- export const MessageContent = React.forwardRef(({ role: roleProp, variant, isStreaming: isStreamingProp, message, thinkingDisplayStyle = "collapsible", className, children, ...props }, ref) => {
84
- // Get streaming start time from store (when using smart rendering)
85
- const streamingStartTime = useChatStore((state) => state.streamingStartTime);
86
- // Use smart rendering if message is provided and no custom children
87
- const useSmartRendering = message && !children;
88
- // Derive props from message if using smart rendering
89
- const role = useSmartRendering ? message.role : roleProp || "assistant";
90
- const isStreaming = useSmartRendering
91
- ? message.isStreaming
92
- : isStreamingProp;
93
- let content = children;
94
- if (useSmartRendering) {
95
- // Extract thinking from metadata
96
- const thinking = message.metadata?.thinking;
97
- const hasThinking = !!thinking;
98
- // Check if waiting (streaming but no content yet)
99
- const isWaiting = message.isStreaming && !message.content && message.role === "assistant";
100
- content = (_jsxs(_Fragment, { children: [message.role === "assistant" && hasThinking && (_jsx(Reasoning, { content: thinking, isStreaming: message.isStreaming, mode: thinkingDisplayStyle, autoCollapse: true })), isWaiting && streamingStartTime && (_jsxs("div", { className: "flex items-center gap-2 opacity-50", children: [_jsx(Loader2Icon, { className: "size-4 animate-spin text-muted-foreground" }), _jsx(WaitingElapsedTime, { startTime: streamingStartTime })] })), message.role === "user" ? (_jsx("div", { className: "whitespace-pre-wrap", children: message.content })) : (_jsx(Response, { content: message.content, isStreaming: message.isStreaming, showEmpty: false }))] }));
101
- }
102
- return (_jsx("div", { ref: ref, className: cn(messageContentVariants({ role, variant }), isStreaming && "animate-pulse-subtle", className), ...props, children: content }));
103
- });
75
+ const messageContentVariants = cva(
76
+ "w-full px-4 py-3 rounded-xl text-[var(--font-size)] font-[var(--font-family)] leading-relaxed break-words transition-colors",
77
+ {
78
+ variants: {
79
+ role: {
80
+ user: "bg-primary text-primary-foreground shadow-sm",
81
+ assistant: "bg-muted text-foreground",
82
+ system:
83
+ "bg-card border border-border text-foreground opacity-80 text-sm",
84
+ },
85
+ variant: {
86
+ default: "",
87
+ outline: "border border-border",
88
+ ghost: "bg-transparent",
89
+ },
90
+ },
91
+ defaultVariants: {
92
+ role: "assistant",
93
+ variant: "default",
94
+ },
95
+ },
96
+ );
97
+ export const MessageContent = React.forwardRef(
98
+ (
99
+ {
100
+ role: roleProp,
101
+ variant,
102
+ isStreaming: isStreamingProp,
103
+ message,
104
+ thinkingDisplayStyle = "collapsible",
105
+ className,
106
+ children,
107
+ ...props
108
+ },
109
+ ref,
110
+ ) => {
111
+ // Get streaming start time from store (when using smart rendering)
112
+ const streamingStartTime = useChatStore(
113
+ (state) => state.streamingStartTime,
114
+ );
115
+ // Use smart rendering if message is provided and no custom children
116
+ const useSmartRendering = message && !children;
117
+ // Derive props from message if using smart rendering
118
+ const role = useSmartRendering ? message.role : roleProp || "assistant";
119
+ const isStreaming = useSmartRendering
120
+ ? message.isStreaming
121
+ : isStreamingProp;
122
+ let content = children;
123
+ if (useSmartRendering) {
124
+ // Extract thinking from metadata
125
+ const thinking = message.metadata?.thinking;
126
+ const hasThinking = !!thinking;
127
+ // Check if waiting (streaming but no content yet)
128
+ const isWaiting =
129
+ message.isStreaming && !message.content && message.role === "assistant";
130
+ content = _jsxs(_Fragment, {
131
+ children: [
132
+ message.role === "assistant" &&
133
+ hasThinking &&
134
+ _jsx(Reasoning, {
135
+ content: thinking,
136
+ isStreaming: message.isStreaming,
137
+ mode: thinkingDisplayStyle,
138
+ autoCollapse: true,
139
+ }),
140
+ isWaiting &&
141
+ streamingStartTime &&
142
+ _jsxs("div", {
143
+ className: "flex items-center gap-2 opacity-50",
144
+ children: [
145
+ _jsx(Loader2Icon, {
146
+ className: "size-4 animate-spin text-muted-foreground",
147
+ }),
148
+ _jsx(WaitingElapsedTime, { startTime: streamingStartTime }),
149
+ ],
150
+ }),
151
+ message.role === "user"
152
+ ? _jsx("div", {
153
+ className: "whitespace-pre-wrap",
154
+ children: message.content,
155
+ })
156
+ : _jsx(Response, {
157
+ content: message.content,
158
+ isStreaming: message.isStreaming,
159
+ showEmpty: false,
160
+ }),
161
+ ],
162
+ });
163
+ }
164
+ return _jsx("div", {
165
+ ref: ref,
166
+ className: cn(
167
+ messageContentVariants({ role, variant }),
168
+ isStreaming && "animate-pulse-subtle",
169
+ className,
170
+ ),
171
+ ...props,
172
+ children: content,
173
+ });
174
+ },
175
+ );
104
176
  MessageContent.displayName = "MessageContent";
@@ -1,10 +1,14 @@
1
1
  import { type ThemeConfig } from "./ConfigPanel.js";
2
2
  declare const DEFAULT_CONFIG: ThemeConfig;
3
3
  interface PlaygroundLayoutProps {
4
- initialConfig?: ThemeConfig;
5
- initialStatus?: string;
6
- iframeSrc?: string;
4
+ initialConfig?: ThemeConfig;
5
+ initialStatus?: string;
6
+ iframeSrc?: string;
7
7
  }
8
- export declare function PlaygroundLayout({ initialConfig, initialStatus, iframeSrc, }: PlaygroundLayoutProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function PlaygroundLayout({
9
+ initialConfig,
10
+ initialStatus,
11
+ iframeSrc,
12
+ }: PlaygroundLayoutProps): import("react/jsx-runtime").JSX.Element;
9
13
  export { DEFAULT_CONFIG };
10
- //# sourceMappingURL=PlaygroundLayout.d.ts.map
14
+ //# sourceMappingURL=PlaygroundLayout.d.ts.map
@@ -1,18 +1,49 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
1
  import { useState } from "react";
3
- import { ConfigPanel } from "./ConfigPanel.js";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
3
  import { ChatPreview } from "./ChatPreview.js";
4
+ import { ConfigPanel } from "./ConfigPanel.js";
5
+
5
6
  const DEFAULT_CONFIG = {
6
- colorScheme: "light",
7
- accentColor: "#646cff",
8
- typography: "Inter",
9
- fontSize: 16,
10
- thinkingDisplayStyle: "collapsible",
7
+ colorScheme: "light",
8
+ accentColor: "#646cff",
9
+ typography: "Inter",
10
+ fontSize: 16,
11
+ thinkingDisplayStyle: "collapsible",
11
12
  };
12
- export function PlaygroundLayout({ initialConfig = DEFAULT_CONFIG, initialStatus = "v0.1.0", iframeSrc, }) {
13
- const [config, setConfig] = useState(initialConfig);
14
- const [status, setStatus] = useState(initialStatus);
15
- return (_jsx("div", { className: "w-full h-screen overflow-hidden", "data-theme": config.colorScheme, children: _jsxs("div", { className: "flex h-full w-full", children: [_jsx("div", { className: "w-[400px] flex-shrink-0 h-full overflow-hidden", children: _jsx(ConfigPanel, { config: config, status: status, onConfigChange: setConfig, onStatusChange: setStatus }) }), _jsx("div", { className: "flex-1 h-full overflow-hidden [background-image:radial-gradient(var(--color-border)_1px,var(--color-bg)_1px)] [background-size:20px_20px] flex items-center justify-center p-5", children: _jsx(ChatPreview, { config: config, status: status, iframeSrc: iframeSrc }) })] }) }));
13
+ export function PlaygroundLayout({
14
+ initialConfig = DEFAULT_CONFIG,
15
+ initialStatus = "v0.1.0",
16
+ iframeSrc,
17
+ }) {
18
+ const [config, setConfig] = useState(initialConfig);
19
+ const [status, setStatus] = useState(initialStatus);
20
+ return _jsx("div", {
21
+ className: "w-full h-screen overflow-hidden",
22
+ "data-theme": config.colorScheme,
23
+ children: _jsxs("div", {
24
+ className: "flex h-full w-full",
25
+ children: [
26
+ _jsx("div", {
27
+ className: "w-[400px] flex-shrink-0 h-full overflow-hidden",
28
+ children: _jsx(ConfigPanel, {
29
+ config: config,
30
+ status: status,
31
+ onConfigChange: setConfig,
32
+ onStatusChange: setStatus,
33
+ }),
34
+ }),
35
+ _jsx("div", {
36
+ className:
37
+ "flex-1 h-full overflow-hidden [background-image:radial-gradient(var(--color-border)_1px,var(--color-bg)_1px)] [background-size:20px_20px] flex items-center justify-center p-5",
38
+ children: _jsx(ChatPreview, {
39
+ config: config,
40
+ status: status,
41
+ iframeSrc: iframeSrc,
42
+ }),
43
+ }),
44
+ ],
45
+ }),
46
+ });
16
47
  }
17
48
  export { DEFAULT_CONFIG };
18
- //# sourceMappingURL=PlaygroundLayout.js.map
49
+ //# sourceMappingURL=PlaygroundLayout.js.map
@@ -4,28 +4,34 @@ import * as React from "react";
4
4
  * Reasoning component inspired by shadcn.io/ai
5
5
  * Displays AI thinking/reasoning process with auto-collapse support
6
6
  */
7
- declare const reasoningContainerVariants: (props?: ({
8
- variant?: "default" | "subtle" | "prominent" | null | undefined;
9
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
- export interface ReasoningProps extends VariantProps<typeof reasoningContainerVariants> {
11
- /** The reasoning/thinking content */
12
- content?: string;
13
- /** Whether the content is currently streaming */
14
- isStreaming?: boolean;
15
- /** Display mode - collapsible or always visible */
16
- mode?: "collapsible" | "inline";
17
- /** Default expanded state (default: false - collapsed by default) */
18
- defaultExpanded?: boolean;
19
- /** Auto-expand when streaming starts (default: false) */
20
- autoExpand?: boolean;
21
- /** Auto-collapse after streaming completes */
22
- autoCollapse?: boolean;
23
- /** Delay before auto-collapsing (ms) */
24
- autoCollapseDelay?: number;
25
- /** Custom label */
26
- label?: string;
27
- /** Additional CSS class */
28
- className?: string;
7
+ declare const reasoningContainerVariants: (
8
+ props?:
9
+ | ({
10
+ variant?: "default" | "subtle" | "prominent" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp)
12
+ | undefined,
13
+ ) => string;
14
+ export interface ReasoningProps
15
+ extends VariantProps<typeof reasoningContainerVariants> {
16
+ /** The reasoning/thinking content */
17
+ content?: string;
18
+ /** Whether the content is currently streaming */
19
+ isStreaming?: boolean;
20
+ /** Display mode - collapsible or always visible */
21
+ mode?: "collapsible" | "inline";
22
+ /** Default expanded state (default: false - collapsed by default) */
23
+ defaultExpanded?: boolean;
24
+ /** Auto-expand when streaming starts (default: false) */
25
+ autoExpand?: boolean;
26
+ /** Auto-collapse after streaming completes */
27
+ autoCollapse?: boolean;
28
+ /** Delay before auto-collapsing (ms) */
29
+ autoCollapseDelay?: number;
30
+ /** Custom label */
31
+ label?: string;
32
+ /** Additional CSS class */
33
+ className?: string;
29
34
  }
30
- export declare const Reasoning: React.ForwardRefExoticComponent<ReasoningProps & React.RefAttributes<HTMLDivElement>>;
31
- export {};
35
+ export declare const Reasoning: React.ForwardRefExoticComponent<
36
+ ReasoningProps & React.RefAttributes<HTMLDivElement>
37
+ >;