@townco/ui 0.1.0 → 0.1.6
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.
- package/dist/core/hooks/use-chat-input.d.ts +17 -17
- package/dist/core/hooks/use-chat-input.js +64 -55
- package/dist/core/hooks/use-chat-messages.d.ts +11 -11
- package/dist/core/hooks/use-chat-messages.js +121 -114
- package/dist/core/hooks/use-chat-session.d.ts +5 -5
- package/dist/core/hooks/use-chat-session.js +78 -80
- package/dist/core/hooks/use-media-query.d.ts +5 -5
- package/dist/core/hooks/use-media-query.js +38 -38
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/schemas/chat.d.ts +83 -56
- package/dist/core/schemas/chat.js +27 -25
- package/dist/core/store/chat-store.d.ts +28 -22
- package/dist/core/store/chat-store.js +59 -50
- package/dist/gui/components/Button.d.ts +23 -7
- package/dist/gui/components/Button.js +40 -27
- package/dist/gui/components/Card.d.ts +26 -7
- package/dist/gui/components/Card.js +54 -8
- package/dist/gui/components/ChatHeader.d.ts +58 -31
- package/dist/gui/components/ChatHeader.js +171 -66
- package/dist/gui/components/ChatInput.d.ts +58 -36
- package/dist/gui/components/ChatInput.js +191 -121
- package/dist/gui/components/ChatInterface.d.ts +9 -6
- package/dist/gui/components/ChatInterface.js +162 -90
- package/dist/gui/components/ChatLayout.d.ts +71 -41
- package/dist/gui/components/ChatLayout.js +214 -87
- package/dist/gui/components/ChatPanelTabContent.d.ts +18 -9
- package/dist/gui/components/ChatPanelTabContent.js +88 -10
- package/dist/gui/components/ChatPreview.d.ts +9 -6
- package/dist/gui/components/ChatPreview.js +212 -162
- package/dist/gui/components/ChatSecondaryPanel.d.ts +14 -11
- package/dist/gui/components/ChatSecondaryPanel.js +115 -38
- package/dist/gui/components/ChatSidebar.d.ts +26 -13
- package/dist/gui/components/ChatSidebar.js +48 -14
- package/dist/gui/components/ChatStatus.d.ts +4 -2
- package/dist/gui/components/ChatStatus.js +45 -34
- package/dist/gui/components/ChatView.d.ts +5 -3
- package/dist/gui/components/ChatView.js +38 -9
- package/dist/gui/components/ConfigPanel.d.ts +16 -12
- package/dist/gui/components/ConfigPanel.js +218 -41
- package/dist/gui/components/Conversation.d.ts +17 -14
- package/dist/gui/components/Conversation.js +143 -83
- package/dist/gui/components/Dialog.d.ts +57 -11
- package/dist/gui/components/Dialog.js +84 -8
- package/dist/gui/components/DropdownMenu.d.ts +101 -20
- package/dist/gui/components/DropdownMenu.js +161 -14
- package/dist/gui/components/HeightTransition.d.ts +12 -7
- package/dist/gui/components/HeightTransition.js +88 -77
- package/dist/gui/components/Input.d.ts +13 -6
- package/dist/gui/components/Input.js +27 -16
- package/dist/gui/components/InputBox.d.ts +19 -12
- package/dist/gui/components/InputBox.js +86 -14
- package/dist/gui/components/Label.d.ts +7 -1
- package/dist/gui/components/Label.js +12 -2
- package/dist/gui/components/MarkdownRenderer.d.ts +6 -4
- package/dist/gui/components/MarkdownRenderer.js +178 -81
- package/dist/gui/components/Message.d.ts +25 -18
- package/dist/gui/components/Message.js +44 -23
- package/dist/gui/components/MessageContent.d.ts +29 -22
- package/dist/gui/components/MessageContent.js +157 -85
- package/dist/gui/components/PlaygroundLayout.d.ts +9 -5
- package/dist/gui/components/PlaygroundLayout.js +43 -12
- package/dist/gui/components/Reasoning.d.ts +30 -24
- package/dist/gui/components/Reasoning.js +187 -60
- package/dist/gui/components/Response.d.ts +11 -9
- package/dist/gui/components/Response.js +229 -90
- package/dist/gui/components/Select.d.ts +69 -10
- package/dist/gui/components/Select.js +118 -12
- package/dist/gui/components/Sonner.d.ts +3 -1
- package/dist/gui/components/Sonner.js +29 -18
- package/dist/gui/components/StatusBar.d.ts +9 -5
- package/dist/gui/components/StatusBar.js +56 -9
- package/dist/gui/components/Tabs.d.ts +24 -4
- package/dist/gui/components/Tabs.js +32 -4
- package/dist/gui/components/Task.d.ts +28 -24
- package/dist/gui/components/Task.js +164 -31
- package/dist/gui/components/Textarea.d.ts +15 -7
- package/dist/gui/components/Textarea.js +63 -46
- package/dist/gui/components/ThinkingBlock.d.ts +20 -10
- package/dist/gui/components/ThinkingBlock.js +134 -35
- package/dist/gui/components/TodoList.d.ts +12 -10
- package/dist/gui/components/TodoList.js +22 -7
- package/dist/gui/components/TodoListItem.d.ts +9 -6
- package/dist/gui/components/TodoListItem.js +18 -4
- package/dist/gui/components/index.d.ts +59 -8
- package/dist/gui/components/index.js +42 -8
- package/dist/gui/lib/utils.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.test.js +0 -1
- package/dist/sdk/client/acp-client.d.ts +88 -76
- package/dist/sdk/client/acp-client.js +215 -217
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/schemas/agent.d.ts +111 -64
- package/dist/sdk/schemas/agent.js +24 -24
- package/dist/sdk/schemas/message.d.ts +245 -147
- package/dist/sdk/schemas/message.js +40 -40
- package/dist/sdk/schemas/session.d.ts +219 -135
- package/dist/sdk/schemas/session.js +27 -27
- package/dist/sdk/transports/http.d.ts +55 -55
- package/dist/sdk/transports/http.js +472 -469
- package/dist/sdk/transports/stdio.d.ts +20 -20
- package/dist/sdk/transports/stdio.js +289 -286
- package/dist/sdk/transports/types.d.ts +42 -42
- package/dist/sdk/transports/websocket.d.ts +12 -12
- package/dist/sdk/transports/websocket.js +52 -46
- package/dist/tui/components/ChatView.d.ts +4 -2
- package/dist/tui/components/ChatView.js +51 -18
- package/dist/tui/components/GameOfLife.js +64 -35
- package/dist/tui/components/InputBox.d.ts +18 -11
- package/dist/tui/components/InputBox.js +70 -10
- package/dist/tui/components/MessageList.d.ts +4 -2
- package/dist/tui/components/MessageList.js +37 -10
- package/dist/tui/components/MultiSelect.d.ts +15 -9
- package/dist/tui/components/MultiSelect.js +116 -69
- package/dist/tui/components/ReadlineInput.d.ts +12 -6
- package/dist/tui/components/ReadlineInput.js +252 -237
- package/dist/tui/components/SingleSelect.d.ts +15 -9
- package/dist/tui/components/SingleSelect.js +84 -43
- package/dist/tui/components/StatusBar.d.ts +11 -6
- package/dist/tui/components/StatusBar.js +102 -67
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/package.json +2 -3
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
|
-
export const TodoListItem = React.forwardRef(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export const TodoListItem = React.forwardRef(
|
|
5
|
+
({ todo, className, ...props }, ref) => {
|
|
6
|
+
return _jsx("div", {
|
|
7
|
+
ref: ref,
|
|
8
|
+
className: cn("flex items-center gap-3 px-3 py-2 rounded-lg", className),
|
|
9
|
+
...props,
|
|
10
|
+
children: _jsx("span", {
|
|
11
|
+
className: cn(
|
|
12
|
+
"flex-1 text-[var(--font-size)] font-[var(--font-family)]",
|
|
13
|
+
todo.status === "completed" && "line-through opacity-60",
|
|
14
|
+
todo.status === "in_progress" && "shimmer-animation",
|
|
15
|
+
),
|
|
16
|
+
children: todo.text,
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
);
|
|
7
21
|
TodoListItem.displayName = "TodoListItem";
|
|
@@ -1,10 +1,40 @@
|
|
|
1
1
|
export { Button, type ButtonProps, buttonVariants } from "./Button.js";
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export {
|
|
3
|
+
Card,
|
|
4
|
+
CardContent,
|
|
5
|
+
CardDescription,
|
|
6
|
+
CardFooter,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardTitle,
|
|
9
|
+
} from "./Card.js";
|
|
10
|
+
export {
|
|
11
|
+
type ChatInputFieldProps,
|
|
12
|
+
type ChatInputRootProps,
|
|
13
|
+
type ChatInputSubmitProps,
|
|
14
|
+
type ChatInputToolbarProps,
|
|
15
|
+
Field as ChatInputField,
|
|
16
|
+
Root as ChatInputRoot,
|
|
17
|
+
Submit as ChatInputSubmit,
|
|
18
|
+
Toolbar as ChatInputToolbar,
|
|
19
|
+
} from "./ChatInput.js";
|
|
20
|
+
export {
|
|
21
|
+
ChatSecondaryPanel,
|
|
22
|
+
type ChatSecondaryPanelProps,
|
|
23
|
+
} from "./ChatSecondaryPanel.js";
|
|
5
24
|
export { ChatStatus, type ChatStatusProps } from "./ChatStatus.js";
|
|
6
25
|
export { Conversation, type ConversationProps } from "./Conversation.js";
|
|
7
|
-
export {
|
|
26
|
+
export {
|
|
27
|
+
Dialog,
|
|
28
|
+
DialogClose,
|
|
29
|
+
DialogContent,
|
|
30
|
+
DialogDescription,
|
|
31
|
+
DialogFooter,
|
|
32
|
+
DialogHeader,
|
|
33
|
+
DialogOverlay,
|
|
34
|
+
DialogPortal,
|
|
35
|
+
DialogTitle,
|
|
36
|
+
DialogTrigger,
|
|
37
|
+
} from "./Dialog.js";
|
|
8
38
|
export { HeightTransition } from "./HeightTransition.js";
|
|
9
39
|
export { Input, type InputProps, inputVariants } from "./Input.js";
|
|
10
40
|
export { Label } from "./Label.js";
|
|
@@ -14,10 +44,31 @@ export { MessageContent, type MessageContentProps } from "./MessageContent.js";
|
|
|
14
44
|
export type { DisplayMessage } from "./MessageList.js";
|
|
15
45
|
export { Reasoning, type ReasoningProps } from "./Reasoning.js";
|
|
16
46
|
export { Response, type ResponseProps } from "./Response.js";
|
|
17
|
-
export {
|
|
47
|
+
export {
|
|
48
|
+
Select,
|
|
49
|
+
SelectContent,
|
|
50
|
+
SelectGroup,
|
|
51
|
+
SelectItem,
|
|
52
|
+
SelectLabel,
|
|
53
|
+
SelectScrollDownButton,
|
|
54
|
+
SelectScrollUpButton,
|
|
55
|
+
SelectSeparator,
|
|
56
|
+
SelectTrigger,
|
|
57
|
+
SelectValue,
|
|
58
|
+
} from "./Select.js";
|
|
18
59
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./Tabs.js";
|
|
19
|
-
export {
|
|
60
|
+
export {
|
|
61
|
+
Task,
|
|
62
|
+
type TaskItem,
|
|
63
|
+
TaskList,
|
|
64
|
+
type TaskListProps,
|
|
65
|
+
type TaskProps,
|
|
66
|
+
} from "./Task.js";
|
|
20
67
|
export { Textarea, type TextareaProps, textareaVariants } from "./Textarea.js";
|
|
21
|
-
export { ThinkingBlock, type ThinkingBlockProps
|
|
68
|
+
export { ThinkingBlock, type ThinkingBlockProps } from "./ThinkingBlock.js";
|
|
22
69
|
export { TodoList, type TodoListProps } from "./TodoList.js";
|
|
23
|
-
export {
|
|
70
|
+
export {
|
|
71
|
+
type TodoItem,
|
|
72
|
+
TodoListItem,
|
|
73
|
+
type TodoListItemProps,
|
|
74
|
+
} from "./TodoListItem.js";
|
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
// Base UI components
|
|
2
2
|
export { Button, buttonVariants } from "./Button.js";
|
|
3
|
-
export {
|
|
3
|
+
export {
|
|
4
|
+
Card,
|
|
5
|
+
CardContent,
|
|
6
|
+
CardDescription,
|
|
7
|
+
CardFooter,
|
|
8
|
+
CardHeader,
|
|
9
|
+
CardTitle,
|
|
10
|
+
} from "./Card.js";
|
|
4
11
|
// Chat components - composable primitives
|
|
5
|
-
export {
|
|
6
|
-
|
|
12
|
+
export {
|
|
13
|
+
Field as ChatInputField,
|
|
14
|
+
Root as ChatInputRoot,
|
|
15
|
+
Submit as ChatInputSubmit,
|
|
16
|
+
Toolbar as ChatInputToolbar,
|
|
17
|
+
} from "./ChatInput.js";
|
|
18
|
+
export { ChatSecondaryPanel } from "./ChatSecondaryPanel.js";
|
|
7
19
|
export { ChatStatus } from "./ChatStatus.js";
|
|
8
20
|
// Chat components - shadcn.io/ai inspired primitives
|
|
9
21
|
export { Conversation } from "./Conversation.js";
|
|
10
22
|
// Dialog components
|
|
11
|
-
export {
|
|
23
|
+
export {
|
|
24
|
+
Dialog,
|
|
25
|
+
DialogClose,
|
|
26
|
+
DialogContent,
|
|
27
|
+
DialogDescription,
|
|
28
|
+
DialogFooter,
|
|
29
|
+
DialogHeader,
|
|
30
|
+
DialogOverlay,
|
|
31
|
+
DialogPortal,
|
|
32
|
+
DialogTitle,
|
|
33
|
+
DialogTrigger,
|
|
34
|
+
} from "./Dialog.js";
|
|
12
35
|
// Utility components
|
|
13
36
|
export { HeightTransition } from "./HeightTransition.js";
|
|
14
37
|
export { Input, inputVariants } from "./Input.js";
|
|
@@ -18,11 +41,22 @@ export { Message } from "./Message.js";
|
|
|
18
41
|
export { MessageContent } from "./MessageContent.js";
|
|
19
42
|
export { Reasoning } from "./Reasoning.js";
|
|
20
43
|
export { Response } from "./Response.js";
|
|
21
|
-
export {
|
|
44
|
+
export {
|
|
45
|
+
Select,
|
|
46
|
+
SelectContent,
|
|
47
|
+
SelectGroup,
|
|
48
|
+
SelectItem,
|
|
49
|
+
SelectLabel,
|
|
50
|
+
SelectScrollDownButton,
|
|
51
|
+
SelectScrollUpButton,
|
|
52
|
+
SelectSeparator,
|
|
53
|
+
SelectTrigger,
|
|
54
|
+
SelectValue,
|
|
55
|
+
} from "./Select.js";
|
|
22
56
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from "./Tabs.js";
|
|
23
57
|
// Task/Todo components
|
|
24
|
-
export { Task, TaskList
|
|
58
|
+
export { Task, TaskList } from "./Task.js";
|
|
25
59
|
export { Textarea, textareaVariants } from "./Textarea.js";
|
|
26
|
-
export { ThinkingBlock
|
|
60
|
+
export { ThinkingBlock } from "./ThinkingBlock.js";
|
|
27
61
|
export { TodoList } from "./TodoList.js";
|
|
28
|
-
export { TodoListItem
|
|
62
|
+
export { TodoListItem } from "./TodoListItem.js";
|
package/dist/gui/lib/utils.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.test.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,84 +1,96 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
MessageChunk,
|
|
3
|
+
Session,
|
|
4
|
+
SessionConfig,
|
|
5
|
+
SessionUpdate,
|
|
6
|
+
} from "../schemas/index.js";
|
|
7
|
+
import type {
|
|
8
|
+
HttpTransportOptions,
|
|
9
|
+
StdioTransportOptions,
|
|
10
|
+
WebSocketTransportOptions,
|
|
11
|
+
} from "../transports/index.js";
|
|
3
12
|
/**
|
|
4
13
|
* Client configuration with explicit transport selection
|
|
5
14
|
*/
|
|
6
|
-
export type AcpClientConfig =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
export type AcpClientConfig =
|
|
16
|
+
| {
|
|
17
|
+
type: "stdio";
|
|
18
|
+
options: StdioTransportOptions;
|
|
19
|
+
autoConnect?: boolean;
|
|
20
|
+
}
|
|
21
|
+
| {
|
|
22
|
+
type: "http";
|
|
23
|
+
options: HttpTransportOptions;
|
|
24
|
+
autoConnect?: boolean;
|
|
25
|
+
}
|
|
26
|
+
| {
|
|
27
|
+
type: "websocket";
|
|
28
|
+
options: WebSocketTransportOptions;
|
|
29
|
+
autoConnect?: boolean;
|
|
30
|
+
};
|
|
19
31
|
/**
|
|
20
32
|
* Simplified ACP client with explicit transport selection
|
|
21
33
|
*/
|
|
22
34
|
export declare class AcpClient {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
35
|
+
private config;
|
|
36
|
+
private transport;
|
|
37
|
+
private sessions;
|
|
38
|
+
private currentSessionId;
|
|
39
|
+
private sessionUpdateHandlers;
|
|
40
|
+
private errorHandlers;
|
|
41
|
+
constructor(config: AcpClientConfig);
|
|
42
|
+
/**
|
|
43
|
+
* Connect to the agent
|
|
44
|
+
*/
|
|
45
|
+
connect(): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Disconnect from the agent
|
|
48
|
+
*/
|
|
49
|
+
disconnect(): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Check if connected
|
|
52
|
+
*/
|
|
53
|
+
isConnected(): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Start a new chat session
|
|
56
|
+
*/
|
|
57
|
+
startSession(config?: Partial<SessionConfig>): Promise<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Send a message in the current session
|
|
60
|
+
*/
|
|
61
|
+
sendMessage(content: string, sessionId?: string): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Receive messages from the agent (streaming)
|
|
64
|
+
*/
|
|
65
|
+
receiveMessages(): AsyncIterableIterator<MessageChunk>;
|
|
66
|
+
/**
|
|
67
|
+
* Get a session by ID
|
|
68
|
+
*/
|
|
69
|
+
getSession(sessionId: string): Session | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Get current session
|
|
72
|
+
*/
|
|
73
|
+
getCurrentSession(): Session | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Get all sessions
|
|
76
|
+
*/
|
|
77
|
+
getAllSessions(): Session[];
|
|
78
|
+
/**
|
|
79
|
+
* Subscribe to session updates
|
|
80
|
+
*/
|
|
81
|
+
onSessionUpdate(handler: (update: SessionUpdate) => void): () => void;
|
|
82
|
+
/**
|
|
83
|
+
* Subscribe to errors
|
|
84
|
+
*/
|
|
85
|
+
onError(handler: (error: Error) => void): () => void;
|
|
86
|
+
/**
|
|
87
|
+
* Create transport based on explicit configuration
|
|
88
|
+
*/
|
|
89
|
+
private createTransport;
|
|
90
|
+
private setupTransportListeners;
|
|
91
|
+
private handleSessionUpdate;
|
|
92
|
+
private handleError;
|
|
93
|
+
private updateSessionStatus;
|
|
94
|
+
private generateSessionId;
|
|
95
|
+
private generateMessageId;
|
|
84
96
|
}
|