@ash-ai/ui 0.0.2

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.
@@ -0,0 +1,322 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { AshClient, Session, Agent, FileEntry } from '@ash-ai/sdk';
3
+ import { ClassValue } from 'clsx';
4
+
5
+ interface PlaygroundProps {
6
+ client: AshClient;
7
+ defaultAgent?: string;
8
+ className?: string;
9
+ }
10
+ declare function Playground({ client, defaultAgent, className }: PlaygroundProps): react_jsx_runtime.JSX.Element;
11
+
12
+ interface ToolCall {
13
+ id: string;
14
+ name: string;
15
+ input: unknown;
16
+ output?: unknown;
17
+ isError?: boolean;
18
+ state: 'pending' | 'running' | 'completed' | 'error';
19
+ }
20
+ interface ChatMessage$1 {
21
+ id: string;
22
+ role: 'user' | 'assistant' | 'system';
23
+ content: string;
24
+ toolCalls?: ToolCall[];
25
+ timestamp?: string;
26
+ isStreaming?: boolean;
27
+ }
28
+ interface AttachedFile {
29
+ id: string;
30
+ filename: string;
31
+ url: string;
32
+ uploading?: boolean;
33
+ }
34
+ interface TreeNode {
35
+ name: string;
36
+ path: string;
37
+ isDir: boolean;
38
+ size?: number;
39
+ modifiedAt?: string;
40
+ children: TreeNode[];
41
+ }
42
+ interface LogEntry {
43
+ index: number;
44
+ level: 'stdout' | 'stderr' | 'system';
45
+ text: string;
46
+ ts: string;
47
+ }
48
+
49
+ interface ChatProps {
50
+ messages: ChatMessage$1[];
51
+ input: string;
52
+ onInputChange: (value: string) => void;
53
+ onSend: () => void;
54
+ sending: boolean;
55
+ loading?: boolean;
56
+ error?: string | null;
57
+ /** Whether an active session exists */
58
+ isActive: boolean;
59
+ agentName?: string;
60
+ attachedFiles?: AttachedFile[];
61
+ onFileSelect?: (e: React.ChangeEvent<HTMLInputElement>) => void;
62
+ onRemoveFile?: (fileId: string) => void;
63
+ className?: string;
64
+ }
65
+ declare function Chat({ messages, input, onInputChange, onSend, sending, loading, error, isActive, agentName, attachedFiles, onFileSelect, onRemoveFile, className, }: ChatProps): react_jsx_runtime.JSX.Element;
66
+
67
+ interface ChatMessagesProps {
68
+ messages: ChatMessage$1[];
69
+ className?: string;
70
+ }
71
+ declare function ChatMessages({ messages, className }: ChatMessagesProps): react_jsx_runtime.JSX.Element;
72
+
73
+ interface ChatInputProps {
74
+ input: string;
75
+ onInputChange: (value: string) => void;
76
+ onSend: () => void;
77
+ sending: boolean;
78
+ disabled?: boolean;
79
+ placeholder?: string;
80
+ attachedFiles?: AttachedFile[];
81
+ onFileSelect?: (e: React.ChangeEvent<HTMLInputElement>) => void;
82
+ onRemoveFile?: (fileId: string) => void;
83
+ className?: string;
84
+ }
85
+ declare function ChatInput({ input, onInputChange, onSend, sending, disabled, placeholder, attachedFiles, onFileSelect, onRemoveFile, className, }: ChatInputProps): react_jsx_runtime.JSX.Element;
86
+
87
+ interface ChatMessageProps {
88
+ message: ChatMessage$1;
89
+ }
90
+ declare function ChatMessage({ message: msg }: ChatMessageProps): react_jsx_runtime.JSX.Element;
91
+
92
+ declare function ToolCallBlock({ tool }: {
93
+ tool: ToolCall;
94
+ }): react_jsx_runtime.JSX.Element;
95
+
96
+ interface TerminalProps {
97
+ logs: LogEntry[];
98
+ connected: boolean | null;
99
+ onClear?: () => void;
100
+ className?: string;
101
+ }
102
+ declare function Terminal({ logs, connected, onClear, className }: TerminalProps): react_jsx_runtime.JSX.Element;
103
+
104
+ interface FileBrowserProps {
105
+ files: Array<{
106
+ path: string;
107
+ size: number;
108
+ modifiedAt: string;
109
+ }>;
110
+ source?: string | null;
111
+ loading: boolean;
112
+ selectedPath: string | null;
113
+ fileContent: string | null;
114
+ fileLoading: boolean;
115
+ fileError: string | null;
116
+ expandedDirs: Set<string>;
117
+ filter: string;
118
+ onFilterChange: (filter: string) => void;
119
+ onSelectFile: (path: string) => void;
120
+ onToggleDir: (path: string) => void;
121
+ onRefresh: () => void;
122
+ /** Base URL for file downloads/images. Will append `/${path}` */
123
+ fileBaseUrl?: string;
124
+ className?: string;
125
+ }
126
+ declare function FileBrowser({ files, source, loading, selectedPath, fileContent, fileLoading, fileError, expandedDirs, filter, onFilterChange, onSelectFile, onToggleDir, onRefresh, fileBaseUrl, className, }: FileBrowserProps): react_jsx_runtime.JSX.Element;
127
+
128
+ interface FileTreeProps {
129
+ nodes: TreeNode[];
130
+ selectedPath: string | null;
131
+ expandedDirs: Set<string>;
132
+ onSelectFile: (path: string) => void;
133
+ onToggleDir: (path: string) => void;
134
+ }
135
+ declare function FileTree({ nodes, selectedPath, expandedDirs, onSelectFile, onToggleDir }: FileTreeProps): react_jsx_runtime.JSX.Element;
136
+
137
+ interface SessionHistoryProps {
138
+ sessions: Session[];
139
+ activeSessionId: string | null;
140
+ onSelectSession: (session: Session) => void;
141
+ className?: string;
142
+ }
143
+ declare function SessionHistory({ sessions, activeSessionId, onSelectSession, className }: SessionHistoryProps): react_jsx_runtime.JSX.Element;
144
+
145
+ interface StatusIndicatorProps {
146
+ connected: boolean | null;
147
+ className?: string;
148
+ }
149
+ declare function StatusIndicator({ connected, className }: StatusIndicatorProps): react_jsx_runtime.JSX.Element | null;
150
+
151
+ interface PlaygroundHeaderProps {
152
+ agents: Agent[];
153
+ selectedAgent: string;
154
+ onAgentChange: (slug: string) => void;
155
+ runtimeConnected: boolean | null;
156
+ showHistory: boolean;
157
+ onToggleHistory: () => void;
158
+ sessionId: string | null;
159
+ onNewChat: () => void;
160
+ className?: string;
161
+ }
162
+ declare function PlaygroundHeader({ agents, selectedAgent, onAgentChange, runtimeConnected, showHistory, onToggleHistory, sessionId, onNewChat, className, }: PlaygroundHeaderProps): react_jsx_runtime.JSX.Element;
163
+
164
+ interface BottomPanelsProps {
165
+ terminalOpen: boolean;
166
+ onToggleTerminal: () => void;
167
+ filesOpen: boolean;
168
+ onToggleFiles: () => void;
169
+ className?: string;
170
+ }
171
+ declare function BottomPanels({ terminalOpen, onToggleTerminal, filesOpen, onToggleFiles, className, }: BottomPanelsProps): react_jsx_runtime.JSX.Element;
172
+
173
+ interface UsePlaygroundChatOptions {
174
+ client: AshClient;
175
+ agentSlug: string;
176
+ initialSessionId?: string;
177
+ onSessionStart?: (sessionId: string) => void;
178
+ onError?: (error: string) => void;
179
+ }
180
+ interface UsePlaygroundChatReturn {
181
+ messages: ChatMessage$1[];
182
+ input: string;
183
+ setInput: (input: string) => void;
184
+ sending: boolean;
185
+ loading: boolean;
186
+ error: string | null;
187
+ sessionId: string | null;
188
+ attachedFiles: AttachedFile[];
189
+ setAttachedFiles: React.Dispatch<React.SetStateAction<AttachedFile[]>>;
190
+ send: () => Promise<void>;
191
+ loadSession: (sessionId: string) => Promise<void>;
192
+ startNewChat: () => void;
193
+ setMessages: React.Dispatch<React.SetStateAction<ChatMessage$1[]>>;
194
+ }
195
+ declare function usePlaygroundChat({ client, agentSlug, initialSessionId, onSessionStart, onError, }: UsePlaygroundChatOptions): UsePlaygroundChatReturn;
196
+
197
+ interface UseAgentsOptions {
198
+ client: AshClient;
199
+ }
200
+ interface UseAgentsReturn {
201
+ agents: Agent[];
202
+ loading: boolean;
203
+ error: string | null;
204
+ refresh: () => void;
205
+ }
206
+ declare function useAgents({ client }: UseAgentsOptions): UseAgentsReturn;
207
+
208
+ interface UseSessionsOptions {
209
+ client: AshClient;
210
+ agent?: string;
211
+ limit?: number;
212
+ /** If false, don't auto-fetch on mount. */
213
+ enabled?: boolean;
214
+ }
215
+ interface UseSessionsReturn {
216
+ sessions: Session[];
217
+ loading: boolean;
218
+ error: string | null;
219
+ refresh: () => void;
220
+ }
221
+ declare function useSessions({ client, agent, limit, enabled, }: UseSessionsOptions): UseSessionsReturn;
222
+
223
+ interface UseHealthCheckOptions {
224
+ client: AshClient;
225
+ }
226
+ interface UseHealthCheckReturn {
227
+ connected: boolean | null;
228
+ refresh: () => void;
229
+ }
230
+ declare function useHealthCheck({ client }: UseHealthCheckOptions): UseHealthCheckReturn;
231
+
232
+ interface UseFileUploadOptions {
233
+ client: AshClient;
234
+ onFilesChange: React.Dispatch<React.SetStateAction<AttachedFile[]>>;
235
+ onError?: (error: string) => void;
236
+ }
237
+ interface UseFileUploadReturn {
238
+ handleFileSelect: (e: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
239
+ removeFile: (fileId: string) => void;
240
+ }
241
+ declare function useFileUpload({ client, onFilesChange, onError, }: UseFileUploadOptions): UseFileUploadReturn;
242
+
243
+ interface PlaygroundContextValue {
244
+ client: AshClient;
245
+ chat: UsePlaygroundChatReturn;
246
+ agents: UseAgentsReturn;
247
+ sessions: UseSessionsReturn;
248
+ health: UseHealthCheckReturn;
249
+ fileUpload: UseFileUploadReturn;
250
+ selectedAgent: string;
251
+ setSelectedAgent: (slug: string) => void;
252
+ showHistory: boolean;
253
+ setShowHistory: (show: boolean) => void;
254
+ terminalOpen: boolean;
255
+ setTerminalOpen: (open: boolean) => void;
256
+ filesOpen: boolean;
257
+ setFilesOpen: (open: boolean) => void;
258
+ }
259
+ declare function usePlaygroundContext(): PlaygroundContextValue;
260
+ interface PlaygroundProviderProps {
261
+ client: AshClient;
262
+ defaultAgent?: string;
263
+ children: React.ReactNode;
264
+ }
265
+ declare function PlaygroundProvider({ client, defaultAgent, children }: PlaygroundProviderProps): react_jsx_runtime.JSX.Element;
266
+
267
+ interface UseTerminalOptions {
268
+ client: AshClient;
269
+ sessionId: string;
270
+ /** If true, fetch all logs once (no polling). Used for ended sessions. */
271
+ historical?: boolean;
272
+ /** Polling interval in ms. Defaults to 500. */
273
+ pollInterval?: number;
274
+ }
275
+ interface UseTerminalReturn {
276
+ logs: LogEntry[];
277
+ connected: boolean | null;
278
+ clearLogs: () => void;
279
+ }
280
+ declare function useTerminal({ client, sessionId, historical, pollInterval, }: UseTerminalOptions): UseTerminalReturn;
281
+
282
+ interface UseFileBrowserOptions {
283
+ client: AshClient;
284
+ sessionId: string;
285
+ }
286
+ interface UseFileBrowserReturn {
287
+ files: FileEntry[];
288
+ source: string | null;
289
+ loading: boolean;
290
+ selectedPath: string | null;
291
+ fileContent: string | null;
292
+ fileLoading: boolean;
293
+ fileError: string | null;
294
+ expandedDirs: Set<string>;
295
+ filter: string;
296
+ setFilter: (filter: string) => void;
297
+ selectFile: (path: string) => void;
298
+ toggleDir: (path: string) => void;
299
+ refresh: () => void;
300
+ }
301
+ declare function useFileBrowser({ client, sessionId, }: UseFileBrowserOptions): UseFileBrowserReturn;
302
+
303
+ declare function cn(...inputs: ClassValue[]): string;
304
+ declare function formatBytes(bytes: number): string;
305
+ declare function formatTime(ts: string): string;
306
+ declare function buildFileTree(files: Array<{
307
+ path: string;
308
+ size: number;
309
+ modifiedAt: string;
310
+ }>): TreeNode[];
311
+ /**
312
+ * Parse content blocks (from Anthropic SDK format) into text + tool calls.
313
+ * Handles both JSON string content and pre-parsed arrays.
314
+ */
315
+ declare function parseContentBlocks(content: unknown): {
316
+ text: string;
317
+ toolCalls: ToolCall[];
318
+ };
319
+ declare function isImageFile(name: string): boolean;
320
+ declare function getFileLanguage(name: string): string;
321
+
322
+ export { type AttachedFile, BottomPanels, type BottomPanelsProps, Chat, ChatInput, type ChatInputProps, ChatMessage, type ChatMessageProps, type ChatMessage$1 as ChatMessageType, ChatMessages, type ChatMessagesProps, type ChatProps, FileBrowser, type FileBrowserProps, FileTree, type FileTreeProps, type LogEntry, Playground, type PlaygroundContextValue, PlaygroundHeader, type PlaygroundHeaderProps, type PlaygroundProps, PlaygroundProvider, type PlaygroundProviderProps, SessionHistory, type SessionHistoryProps, StatusIndicator, type StatusIndicatorProps, Terminal, type TerminalProps, type ToolCall, ToolCallBlock, type TreeNode, type UseAgentsOptions, type UseAgentsReturn, type UseFileBrowserOptions, type UseFileBrowserReturn, type UseFileUploadOptions, type UseFileUploadReturn, type UseHealthCheckOptions, type UseHealthCheckReturn, type UsePlaygroundChatOptions, type UsePlaygroundChatReturn, type UseSessionsOptions, type UseSessionsReturn, type UseTerminalOptions, type UseTerminalReturn, buildFileTree, cn, formatBytes, formatTime, getFileLanguage, isImageFile, parseContentBlocks, useAgents, useFileBrowser, useFileUpload, useHealthCheck, usePlaygroundChat, usePlaygroundContext, useSessions, useTerminal };
@@ -0,0 +1,322 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { AshClient, Session, Agent, FileEntry } from '@ash-ai/sdk';
3
+ import { ClassValue } from 'clsx';
4
+
5
+ interface PlaygroundProps {
6
+ client: AshClient;
7
+ defaultAgent?: string;
8
+ className?: string;
9
+ }
10
+ declare function Playground({ client, defaultAgent, className }: PlaygroundProps): react_jsx_runtime.JSX.Element;
11
+
12
+ interface ToolCall {
13
+ id: string;
14
+ name: string;
15
+ input: unknown;
16
+ output?: unknown;
17
+ isError?: boolean;
18
+ state: 'pending' | 'running' | 'completed' | 'error';
19
+ }
20
+ interface ChatMessage$1 {
21
+ id: string;
22
+ role: 'user' | 'assistant' | 'system';
23
+ content: string;
24
+ toolCalls?: ToolCall[];
25
+ timestamp?: string;
26
+ isStreaming?: boolean;
27
+ }
28
+ interface AttachedFile {
29
+ id: string;
30
+ filename: string;
31
+ url: string;
32
+ uploading?: boolean;
33
+ }
34
+ interface TreeNode {
35
+ name: string;
36
+ path: string;
37
+ isDir: boolean;
38
+ size?: number;
39
+ modifiedAt?: string;
40
+ children: TreeNode[];
41
+ }
42
+ interface LogEntry {
43
+ index: number;
44
+ level: 'stdout' | 'stderr' | 'system';
45
+ text: string;
46
+ ts: string;
47
+ }
48
+
49
+ interface ChatProps {
50
+ messages: ChatMessage$1[];
51
+ input: string;
52
+ onInputChange: (value: string) => void;
53
+ onSend: () => void;
54
+ sending: boolean;
55
+ loading?: boolean;
56
+ error?: string | null;
57
+ /** Whether an active session exists */
58
+ isActive: boolean;
59
+ agentName?: string;
60
+ attachedFiles?: AttachedFile[];
61
+ onFileSelect?: (e: React.ChangeEvent<HTMLInputElement>) => void;
62
+ onRemoveFile?: (fileId: string) => void;
63
+ className?: string;
64
+ }
65
+ declare function Chat({ messages, input, onInputChange, onSend, sending, loading, error, isActive, agentName, attachedFiles, onFileSelect, onRemoveFile, className, }: ChatProps): react_jsx_runtime.JSX.Element;
66
+
67
+ interface ChatMessagesProps {
68
+ messages: ChatMessage$1[];
69
+ className?: string;
70
+ }
71
+ declare function ChatMessages({ messages, className }: ChatMessagesProps): react_jsx_runtime.JSX.Element;
72
+
73
+ interface ChatInputProps {
74
+ input: string;
75
+ onInputChange: (value: string) => void;
76
+ onSend: () => void;
77
+ sending: boolean;
78
+ disabled?: boolean;
79
+ placeholder?: string;
80
+ attachedFiles?: AttachedFile[];
81
+ onFileSelect?: (e: React.ChangeEvent<HTMLInputElement>) => void;
82
+ onRemoveFile?: (fileId: string) => void;
83
+ className?: string;
84
+ }
85
+ declare function ChatInput({ input, onInputChange, onSend, sending, disabled, placeholder, attachedFiles, onFileSelect, onRemoveFile, className, }: ChatInputProps): react_jsx_runtime.JSX.Element;
86
+
87
+ interface ChatMessageProps {
88
+ message: ChatMessage$1;
89
+ }
90
+ declare function ChatMessage({ message: msg }: ChatMessageProps): react_jsx_runtime.JSX.Element;
91
+
92
+ declare function ToolCallBlock({ tool }: {
93
+ tool: ToolCall;
94
+ }): react_jsx_runtime.JSX.Element;
95
+
96
+ interface TerminalProps {
97
+ logs: LogEntry[];
98
+ connected: boolean | null;
99
+ onClear?: () => void;
100
+ className?: string;
101
+ }
102
+ declare function Terminal({ logs, connected, onClear, className }: TerminalProps): react_jsx_runtime.JSX.Element;
103
+
104
+ interface FileBrowserProps {
105
+ files: Array<{
106
+ path: string;
107
+ size: number;
108
+ modifiedAt: string;
109
+ }>;
110
+ source?: string | null;
111
+ loading: boolean;
112
+ selectedPath: string | null;
113
+ fileContent: string | null;
114
+ fileLoading: boolean;
115
+ fileError: string | null;
116
+ expandedDirs: Set<string>;
117
+ filter: string;
118
+ onFilterChange: (filter: string) => void;
119
+ onSelectFile: (path: string) => void;
120
+ onToggleDir: (path: string) => void;
121
+ onRefresh: () => void;
122
+ /** Base URL for file downloads/images. Will append `/${path}` */
123
+ fileBaseUrl?: string;
124
+ className?: string;
125
+ }
126
+ declare function FileBrowser({ files, source, loading, selectedPath, fileContent, fileLoading, fileError, expandedDirs, filter, onFilterChange, onSelectFile, onToggleDir, onRefresh, fileBaseUrl, className, }: FileBrowserProps): react_jsx_runtime.JSX.Element;
127
+
128
+ interface FileTreeProps {
129
+ nodes: TreeNode[];
130
+ selectedPath: string | null;
131
+ expandedDirs: Set<string>;
132
+ onSelectFile: (path: string) => void;
133
+ onToggleDir: (path: string) => void;
134
+ }
135
+ declare function FileTree({ nodes, selectedPath, expandedDirs, onSelectFile, onToggleDir }: FileTreeProps): react_jsx_runtime.JSX.Element;
136
+
137
+ interface SessionHistoryProps {
138
+ sessions: Session[];
139
+ activeSessionId: string | null;
140
+ onSelectSession: (session: Session) => void;
141
+ className?: string;
142
+ }
143
+ declare function SessionHistory({ sessions, activeSessionId, onSelectSession, className }: SessionHistoryProps): react_jsx_runtime.JSX.Element;
144
+
145
+ interface StatusIndicatorProps {
146
+ connected: boolean | null;
147
+ className?: string;
148
+ }
149
+ declare function StatusIndicator({ connected, className }: StatusIndicatorProps): react_jsx_runtime.JSX.Element | null;
150
+
151
+ interface PlaygroundHeaderProps {
152
+ agents: Agent[];
153
+ selectedAgent: string;
154
+ onAgentChange: (slug: string) => void;
155
+ runtimeConnected: boolean | null;
156
+ showHistory: boolean;
157
+ onToggleHistory: () => void;
158
+ sessionId: string | null;
159
+ onNewChat: () => void;
160
+ className?: string;
161
+ }
162
+ declare function PlaygroundHeader({ agents, selectedAgent, onAgentChange, runtimeConnected, showHistory, onToggleHistory, sessionId, onNewChat, className, }: PlaygroundHeaderProps): react_jsx_runtime.JSX.Element;
163
+
164
+ interface BottomPanelsProps {
165
+ terminalOpen: boolean;
166
+ onToggleTerminal: () => void;
167
+ filesOpen: boolean;
168
+ onToggleFiles: () => void;
169
+ className?: string;
170
+ }
171
+ declare function BottomPanels({ terminalOpen, onToggleTerminal, filesOpen, onToggleFiles, className, }: BottomPanelsProps): react_jsx_runtime.JSX.Element;
172
+
173
+ interface UsePlaygroundChatOptions {
174
+ client: AshClient;
175
+ agentSlug: string;
176
+ initialSessionId?: string;
177
+ onSessionStart?: (sessionId: string) => void;
178
+ onError?: (error: string) => void;
179
+ }
180
+ interface UsePlaygroundChatReturn {
181
+ messages: ChatMessage$1[];
182
+ input: string;
183
+ setInput: (input: string) => void;
184
+ sending: boolean;
185
+ loading: boolean;
186
+ error: string | null;
187
+ sessionId: string | null;
188
+ attachedFiles: AttachedFile[];
189
+ setAttachedFiles: React.Dispatch<React.SetStateAction<AttachedFile[]>>;
190
+ send: () => Promise<void>;
191
+ loadSession: (sessionId: string) => Promise<void>;
192
+ startNewChat: () => void;
193
+ setMessages: React.Dispatch<React.SetStateAction<ChatMessage$1[]>>;
194
+ }
195
+ declare function usePlaygroundChat({ client, agentSlug, initialSessionId, onSessionStart, onError, }: UsePlaygroundChatOptions): UsePlaygroundChatReturn;
196
+
197
+ interface UseAgentsOptions {
198
+ client: AshClient;
199
+ }
200
+ interface UseAgentsReturn {
201
+ agents: Agent[];
202
+ loading: boolean;
203
+ error: string | null;
204
+ refresh: () => void;
205
+ }
206
+ declare function useAgents({ client }: UseAgentsOptions): UseAgentsReturn;
207
+
208
+ interface UseSessionsOptions {
209
+ client: AshClient;
210
+ agent?: string;
211
+ limit?: number;
212
+ /** If false, don't auto-fetch on mount. */
213
+ enabled?: boolean;
214
+ }
215
+ interface UseSessionsReturn {
216
+ sessions: Session[];
217
+ loading: boolean;
218
+ error: string | null;
219
+ refresh: () => void;
220
+ }
221
+ declare function useSessions({ client, agent, limit, enabled, }: UseSessionsOptions): UseSessionsReturn;
222
+
223
+ interface UseHealthCheckOptions {
224
+ client: AshClient;
225
+ }
226
+ interface UseHealthCheckReturn {
227
+ connected: boolean | null;
228
+ refresh: () => void;
229
+ }
230
+ declare function useHealthCheck({ client }: UseHealthCheckOptions): UseHealthCheckReturn;
231
+
232
+ interface UseFileUploadOptions {
233
+ client: AshClient;
234
+ onFilesChange: React.Dispatch<React.SetStateAction<AttachedFile[]>>;
235
+ onError?: (error: string) => void;
236
+ }
237
+ interface UseFileUploadReturn {
238
+ handleFileSelect: (e: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
239
+ removeFile: (fileId: string) => void;
240
+ }
241
+ declare function useFileUpload({ client, onFilesChange, onError, }: UseFileUploadOptions): UseFileUploadReturn;
242
+
243
+ interface PlaygroundContextValue {
244
+ client: AshClient;
245
+ chat: UsePlaygroundChatReturn;
246
+ agents: UseAgentsReturn;
247
+ sessions: UseSessionsReturn;
248
+ health: UseHealthCheckReturn;
249
+ fileUpload: UseFileUploadReturn;
250
+ selectedAgent: string;
251
+ setSelectedAgent: (slug: string) => void;
252
+ showHistory: boolean;
253
+ setShowHistory: (show: boolean) => void;
254
+ terminalOpen: boolean;
255
+ setTerminalOpen: (open: boolean) => void;
256
+ filesOpen: boolean;
257
+ setFilesOpen: (open: boolean) => void;
258
+ }
259
+ declare function usePlaygroundContext(): PlaygroundContextValue;
260
+ interface PlaygroundProviderProps {
261
+ client: AshClient;
262
+ defaultAgent?: string;
263
+ children: React.ReactNode;
264
+ }
265
+ declare function PlaygroundProvider({ client, defaultAgent, children }: PlaygroundProviderProps): react_jsx_runtime.JSX.Element;
266
+
267
+ interface UseTerminalOptions {
268
+ client: AshClient;
269
+ sessionId: string;
270
+ /** If true, fetch all logs once (no polling). Used for ended sessions. */
271
+ historical?: boolean;
272
+ /** Polling interval in ms. Defaults to 500. */
273
+ pollInterval?: number;
274
+ }
275
+ interface UseTerminalReturn {
276
+ logs: LogEntry[];
277
+ connected: boolean | null;
278
+ clearLogs: () => void;
279
+ }
280
+ declare function useTerminal({ client, sessionId, historical, pollInterval, }: UseTerminalOptions): UseTerminalReturn;
281
+
282
+ interface UseFileBrowserOptions {
283
+ client: AshClient;
284
+ sessionId: string;
285
+ }
286
+ interface UseFileBrowserReturn {
287
+ files: FileEntry[];
288
+ source: string | null;
289
+ loading: boolean;
290
+ selectedPath: string | null;
291
+ fileContent: string | null;
292
+ fileLoading: boolean;
293
+ fileError: string | null;
294
+ expandedDirs: Set<string>;
295
+ filter: string;
296
+ setFilter: (filter: string) => void;
297
+ selectFile: (path: string) => void;
298
+ toggleDir: (path: string) => void;
299
+ refresh: () => void;
300
+ }
301
+ declare function useFileBrowser({ client, sessionId, }: UseFileBrowserOptions): UseFileBrowserReturn;
302
+
303
+ declare function cn(...inputs: ClassValue[]): string;
304
+ declare function formatBytes(bytes: number): string;
305
+ declare function formatTime(ts: string): string;
306
+ declare function buildFileTree(files: Array<{
307
+ path: string;
308
+ size: number;
309
+ modifiedAt: string;
310
+ }>): TreeNode[];
311
+ /**
312
+ * Parse content blocks (from Anthropic SDK format) into text + tool calls.
313
+ * Handles both JSON string content and pre-parsed arrays.
314
+ */
315
+ declare function parseContentBlocks(content: unknown): {
316
+ text: string;
317
+ toolCalls: ToolCall[];
318
+ };
319
+ declare function isImageFile(name: string): boolean;
320
+ declare function getFileLanguage(name: string): string;
321
+
322
+ export { type AttachedFile, BottomPanels, type BottomPanelsProps, Chat, ChatInput, type ChatInputProps, ChatMessage, type ChatMessageProps, type ChatMessage$1 as ChatMessageType, ChatMessages, type ChatMessagesProps, type ChatProps, FileBrowser, type FileBrowserProps, FileTree, type FileTreeProps, type LogEntry, Playground, type PlaygroundContextValue, PlaygroundHeader, type PlaygroundHeaderProps, type PlaygroundProps, PlaygroundProvider, type PlaygroundProviderProps, SessionHistory, type SessionHistoryProps, StatusIndicator, type StatusIndicatorProps, Terminal, type TerminalProps, type ToolCall, ToolCallBlock, type TreeNode, type UseAgentsOptions, type UseAgentsReturn, type UseFileBrowserOptions, type UseFileBrowserReturn, type UseFileUploadOptions, type UseFileUploadReturn, type UseHealthCheckOptions, type UseHealthCheckReturn, type UsePlaygroundChatOptions, type UsePlaygroundChatReturn, type UseSessionsOptions, type UseSessionsReturn, type UseTerminalOptions, type UseTerminalReturn, buildFileTree, cn, formatBytes, formatTime, getFileLanguage, isImageFile, parseContentBlocks, useAgents, useFileBrowser, useFileUpload, useHealthCheck, usePlaygroundChat, usePlaygroundContext, useSessions, useTerminal };