@townco/ui 0.1.7 → 0.1.9

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 (243) hide show
  1. package/dist/core/hooks/index.d.ts +1 -0
  2. package/dist/core/hooks/index.d.ts.map +1 -0
  3. package/dist/core/hooks/index.js +1 -0
  4. package/dist/core/hooks/index.js.map +1 -0
  5. package/dist/core/hooks/use-chat-input.d.ts +17 -17
  6. package/dist/core/hooks/use-chat-input.d.ts.map +1 -0
  7. package/dist/core/hooks/use-chat-input.js +64 -55
  8. package/dist/core/hooks/use-chat-input.js.map +1 -0
  9. package/dist/core/hooks/use-chat-messages.d.ts +11 -11
  10. package/dist/core/hooks/use-chat-messages.d.ts.map +1 -0
  11. package/dist/core/hooks/use-chat-messages.js +121 -114
  12. package/dist/core/hooks/use-chat-messages.js.map +1 -0
  13. package/dist/core/hooks/use-chat-session.d.ts +5 -5
  14. package/dist/core/hooks/use-chat-session.d.ts.map +1 -0
  15. package/dist/core/hooks/use-chat-session.js +78 -80
  16. package/dist/core/hooks/use-chat-session.js.map +1 -0
  17. package/dist/core/hooks/use-media-query.d.ts +39 -0
  18. package/dist/core/hooks/use-media-query.js +84 -0
  19. package/dist/core/index.d.ts.map +1 -0
  20. package/dist/core/index.js.map +1 -0
  21. package/dist/core/schemas/chat.d.ts +83 -56
  22. package/dist/core/schemas/chat.d.ts.map +1 -0
  23. package/dist/core/schemas/chat.js +27 -25
  24. package/dist/core/schemas/chat.js.map +1 -0
  25. package/dist/core/schemas/index.d.ts.map +1 -0
  26. package/dist/core/schemas/index.js.map +1 -0
  27. package/dist/core/store/chat-store.d.ts +28 -22
  28. package/dist/core/store/chat-store.d.ts.map +1 -0
  29. package/dist/core/store/chat-store.js +59 -50
  30. package/dist/core/store/chat-store.js.map +1 -0
  31. package/dist/gui/components/Button.d.ts +23 -7
  32. package/dist/gui/components/Button.d.ts.map +1 -0
  33. package/dist/gui/components/Button.js +40 -27
  34. package/dist/gui/components/Button.js.map +1 -0
  35. package/dist/gui/components/Card.d.ts +26 -7
  36. package/dist/gui/components/Card.d.ts.map +1 -0
  37. package/dist/gui/components/Card.js +54 -8
  38. package/dist/gui/components/Card.js.map +1 -0
  39. package/dist/gui/components/ChatHeader.d.ts +38 -0
  40. package/dist/gui/components/ChatHeader.js +86 -0
  41. package/dist/gui/components/ChatInput.d.ts +19 -1
  42. package/dist/gui/components/ChatInput.d.ts.map +1 -0
  43. package/dist/gui/components/ChatInput.js +94 -11
  44. package/dist/gui/components/ChatInput.js.map +1 -0
  45. package/dist/gui/components/ChatInputCommandMenu.d.ts +20 -0
  46. package/dist/gui/components/ChatInputCommandMenu.js +62 -0
  47. package/dist/gui/components/ChatInterface.d.ts +12 -0
  48. package/dist/gui/components/ChatInterface.d.ts.map +1 -0
  49. package/dist/gui/components/ChatInterface.js +204 -0
  50. package/dist/gui/components/ChatInterface.js.map +1 -0
  51. package/dist/gui/components/ChatLayout.d.ts +52 -0
  52. package/dist/gui/components/ChatLayout.js +105 -0
  53. package/dist/gui/components/ChatPanelTabContent.d.ts +18 -0
  54. package/dist/gui/components/ChatPanelTabContent.js +15 -0
  55. package/dist/gui/components/ChatPreview.d.ts +12 -0
  56. package/dist/gui/components/ChatPreview.d.ts.map +1 -0
  57. package/dist/gui/components/ChatPreview.js +214 -0
  58. package/dist/gui/components/ChatPreview.js.map +1 -0
  59. package/dist/gui/components/ChatSecondaryPanel.d.ts +14 -11
  60. package/dist/gui/components/ChatSecondaryPanel.d.ts.map +1 -0
  61. package/dist/gui/components/ChatSecondaryPanel.js +115 -38
  62. package/dist/gui/components/ChatSecondaryPanel.js.map +1 -0
  63. package/dist/gui/components/ChatSidebar.d.ts +14 -0
  64. package/dist/gui/components/ChatSidebar.js +23 -0
  65. package/dist/gui/components/ChatStatus.d.ts +4 -2
  66. package/dist/gui/components/ChatStatus.d.ts.map +1 -0
  67. package/dist/gui/components/ChatStatus.js +45 -34
  68. package/dist/gui/components/ChatStatus.js.map +1 -0
  69. package/dist/gui/components/ChatView.d.ts +8 -0
  70. package/dist/gui/components/ChatView.d.ts.map +1 -0
  71. package/dist/gui/components/ChatView.js +42 -0
  72. package/dist/gui/components/ChatView.js.map +1 -0
  73. package/dist/gui/components/ConfigPanel.d.ts +20 -0
  74. package/dist/gui/components/ConfigPanel.d.ts.map +1 -0
  75. package/dist/gui/components/ConfigPanel.js +225 -0
  76. package/dist/gui/components/ConfigPanel.js.map +1 -0
  77. package/dist/gui/components/Conversation.d.ts +17 -14
  78. package/dist/gui/components/Conversation.d.ts.map +1 -0
  79. package/dist/gui/components/Conversation.js +143 -83
  80. package/dist/gui/components/Conversation.js.map +1 -0
  81. package/dist/gui/components/Dialog.d.ts +57 -11
  82. package/dist/gui/components/Dialog.d.ts.map +1 -0
  83. package/dist/gui/components/Dialog.js +84 -8
  84. package/dist/gui/components/Dialog.js.map +1 -0
  85. package/dist/gui/components/DropdownMenu.d.ts +27 -0
  86. package/dist/gui/components/DropdownMenu.js +68 -0
  87. package/dist/gui/components/HeightTransition.d.ts +12 -7
  88. package/dist/gui/components/HeightTransition.d.ts.map +1 -0
  89. package/dist/gui/components/HeightTransition.js +88 -77
  90. package/dist/gui/components/HeightTransition.js.map +1 -0
  91. package/dist/gui/components/Input.d.ts +13 -6
  92. package/dist/gui/components/Input.d.ts.map +1 -0
  93. package/dist/gui/components/Input.js +27 -16
  94. package/dist/gui/components/Input.js.map +1 -0
  95. package/dist/gui/components/InputBox.d.ts +21 -0
  96. package/dist/gui/components/InputBox.d.ts.map +1 -0
  97. package/dist/gui/components/InputBox.js +90 -0
  98. package/dist/gui/components/InputBox.js.map +1 -0
  99. package/dist/gui/components/Label.d.ts +7 -1
  100. package/dist/gui/components/Label.d.ts.map +1 -0
  101. package/dist/gui/components/Label.js +12 -2
  102. package/dist/gui/components/Label.js.map +1 -0
  103. package/dist/gui/components/MarkdownRenderer.d.ts +6 -4
  104. package/dist/gui/components/MarkdownRenderer.d.ts.map +1 -0
  105. package/dist/gui/components/MarkdownRenderer.js +178 -81
  106. package/dist/gui/components/MarkdownRenderer.js.map +1 -0
  107. package/dist/gui/components/Message.d.ts +4 -0
  108. package/dist/gui/components/Message.d.ts.map +1 -0
  109. package/dist/gui/components/Message.js +77 -3
  110. package/dist/gui/components/Message.js.map +1 -0
  111. package/dist/gui/components/MessageContent.d.ts +29 -22
  112. package/dist/gui/components/MessageContent.d.ts.map +1 -0
  113. package/dist/gui/components/MessageContent.js +1 -1
  114. package/dist/gui/components/MessageContent.js.map +1 -0
  115. package/dist/gui/components/MessageList.d.ts.map +1 -0
  116. package/dist/gui/components/MessageList.js.map +1 -0
  117. package/dist/gui/components/PlaygroundLayout.d.ts +14 -0
  118. package/dist/gui/components/PlaygroundLayout.d.ts.map +1 -0
  119. package/dist/gui/components/PlaygroundLayout.js +49 -0
  120. package/dist/gui/components/PlaygroundLayout.js.map +1 -0
  121. package/dist/gui/components/Reasoning.d.ts +30 -24
  122. package/dist/gui/components/Reasoning.d.ts.map +1 -0
  123. package/dist/gui/components/Reasoning.js +187 -60
  124. package/dist/gui/components/Reasoning.js.map +1 -0
  125. package/dist/gui/components/Response.d.ts +11 -9
  126. package/dist/gui/components/Response.d.ts.map +1 -0
  127. package/dist/gui/components/Response.js +229 -90
  128. package/dist/gui/components/Response.js.map +1 -0
  129. package/dist/gui/components/Select.d.ts +69 -10
  130. package/dist/gui/components/Select.d.ts.map +1 -0
  131. package/dist/gui/components/Select.js +118 -12
  132. package/dist/gui/components/Select.js.map +1 -0
  133. package/dist/gui/components/Sonner.d.ts +5 -0
  134. package/dist/gui/components/Sonner.js +23 -0
  135. package/dist/gui/components/StatusBar.d.ts +12 -0
  136. package/dist/gui/components/StatusBar.d.ts.map +1 -0
  137. package/dist/gui/components/StatusBar.js +58 -0
  138. package/dist/gui/components/StatusBar.js.map +1 -0
  139. package/dist/gui/components/Tabs.d.ts +24 -4
  140. package/dist/gui/components/Tabs.d.ts.map +1 -0
  141. package/dist/gui/components/Tabs.js +32 -4
  142. package/dist/gui/components/Tabs.js.map +1 -0
  143. package/dist/gui/components/Task.d.ts +28 -24
  144. package/dist/gui/components/Task.d.ts.map +1 -0
  145. package/dist/gui/components/Task.js +164 -31
  146. package/dist/gui/components/Task.js.map +1 -0
  147. package/dist/gui/components/Textarea.d.ts +15 -7
  148. package/dist/gui/components/Textarea.d.ts.map +1 -0
  149. package/dist/gui/components/Textarea.js +63 -46
  150. package/dist/gui/components/Textarea.js.map +1 -0
  151. package/dist/gui/components/ThinkingBlock.d.ts +20 -10
  152. package/dist/gui/components/ThinkingBlock.d.ts.map +1 -0
  153. package/dist/gui/components/ThinkingBlock.js +134 -35
  154. package/dist/gui/components/ThinkingBlock.js.map +1 -0
  155. package/dist/gui/components/TodoList.d.ts +12 -10
  156. package/dist/gui/components/TodoList.d.ts.map +1 -0
  157. package/dist/gui/components/TodoList.js +22 -7
  158. package/dist/gui/components/TodoList.js.map +1 -0
  159. package/dist/gui/components/TodoListItem.d.ts +9 -6
  160. package/dist/gui/components/TodoListItem.d.ts.map +1 -0
  161. package/dist/gui/components/TodoListItem.js +18 -4
  162. package/dist/gui/components/TodoListItem.js.map +1 -0
  163. package/dist/gui/components/index.d.ts +9 -1
  164. package/dist/gui/components/index.d.ts.map +1 -0
  165. package/dist/gui/components/index.js +11 -1
  166. package/dist/gui/components/index.js.map +1 -0
  167. package/dist/gui/index.d.ts.map +1 -0
  168. package/dist/gui/index.js.map +1 -0
  169. package/dist/gui/lib/utils.d.ts.map +1 -0
  170. package/dist/gui/lib/utils.js +1 -1
  171. package/dist/gui/lib/utils.js.map +1 -0
  172. package/dist/index.d.ts.map +1 -0
  173. package/dist/index.js.map +1 -0
  174. package/dist/index.test.js +0 -1
  175. package/dist/sdk/client/acp-client.d.ts +88 -76
  176. package/dist/sdk/client/acp-client.d.ts.map +1 -0
  177. package/dist/sdk/client/acp-client.js +215 -217
  178. package/dist/sdk/client/acp-client.js.map +1 -0
  179. package/dist/sdk/client/index.d.ts.map +1 -0
  180. package/dist/sdk/client/index.js.map +1 -0
  181. package/dist/sdk/index.d.ts.map +1 -0
  182. package/dist/sdk/index.js.map +1 -0
  183. package/dist/sdk/schemas/agent.d.ts +111 -64
  184. package/dist/sdk/schemas/agent.d.ts.map +1 -0
  185. package/dist/sdk/schemas/agent.js +24 -24
  186. package/dist/sdk/schemas/agent.js.map +1 -0
  187. package/dist/sdk/schemas/index.d.ts.map +1 -0
  188. package/dist/sdk/schemas/index.js.map +1 -0
  189. package/dist/sdk/schemas/message.d.ts +245 -147
  190. package/dist/sdk/schemas/message.d.ts.map +1 -0
  191. package/dist/sdk/schemas/message.js +40 -40
  192. package/dist/sdk/schemas/message.js.map +1 -0
  193. package/dist/sdk/schemas/session.d.ts +219 -135
  194. package/dist/sdk/schemas/session.d.ts.map +1 -0
  195. package/dist/sdk/schemas/session.js +27 -27
  196. package/dist/sdk/schemas/session.js.map +1 -0
  197. package/dist/sdk/transports/http.d.ts +55 -55
  198. package/dist/sdk/transports/http.d.ts.map +1 -0
  199. package/dist/sdk/transports/http.js +472 -469
  200. package/dist/sdk/transports/http.js.map +1 -0
  201. package/dist/sdk/transports/index.d.ts.map +1 -0
  202. package/dist/sdk/transports/index.js.map +1 -0
  203. package/dist/sdk/transports/stdio.d.ts +20 -20
  204. package/dist/sdk/transports/stdio.d.ts.map +1 -0
  205. package/dist/sdk/transports/stdio.js.map +1 -0
  206. package/dist/sdk/transports/types.d.ts +42 -42
  207. package/dist/sdk/transports/types.d.ts.map +1 -0
  208. package/dist/sdk/transports/types.js.map +1 -0
  209. package/dist/sdk/transports/websocket.d.ts +12 -12
  210. package/dist/sdk/transports/websocket.d.ts.map +1 -0
  211. package/dist/sdk/transports/websocket.js +52 -46
  212. package/dist/sdk/transports/websocket.js.map +1 -0
  213. package/dist/tui/components/ChatView.d.ts +4 -2
  214. package/dist/tui/components/ChatView.d.ts.map +1 -0
  215. package/dist/tui/components/ChatView.js +51 -18
  216. package/dist/tui/components/ChatView.js.map +1 -0
  217. package/dist/tui/components/GameOfLife.d.ts.map +1 -0
  218. package/dist/tui/components/GameOfLife.js +64 -35
  219. package/dist/tui/components/GameOfLife.js.map +1 -0
  220. package/dist/tui/components/InputBox.d.ts +18 -11
  221. package/dist/tui/components/InputBox.d.ts.map +1 -0
  222. package/dist/tui/components/InputBox.js +70 -10
  223. package/dist/tui/components/InputBox.js.map +1 -0
  224. package/dist/tui/components/MessageList.d.ts +4 -2
  225. package/dist/tui/components/MessageList.d.ts.map +1 -0
  226. package/dist/tui/components/MessageList.js +37 -10
  227. package/dist/tui/components/MessageList.js.map +1 -0
  228. package/dist/tui/components/ReadlineInput.d.ts +12 -6
  229. package/dist/tui/components/ReadlineInput.d.ts.map +1 -0
  230. package/dist/tui/components/ReadlineInput.js +252 -237
  231. package/dist/tui/components/ReadlineInput.js.map +1 -0
  232. package/dist/tui/components/SingleSelect.d.ts +15 -9
  233. package/dist/tui/components/SingleSelect.js +84 -43
  234. package/dist/tui/components/StatusBar.d.ts +11 -6
  235. package/dist/tui/components/StatusBar.d.ts.map +1 -0
  236. package/dist/tui/components/StatusBar.js +102 -67
  237. package/dist/tui/components/StatusBar.js.map +1 -0
  238. package/dist/tui/components/index.d.ts.map +1 -0
  239. package/dist/tui/components/index.js.map +1 -0
  240. package/dist/tui/index.d.ts.map +1 -0
  241. package/dist/tui/index.js.map +1 -0
  242. package/package.json +6 -4
  243. package/src/styles/global.css +2 -0
@@ -5,221 +5,219 @@ import { WebSocketTransport } from "../transports/websocket.js";
5
5
  * Simplified ACP client with explicit transport selection
6
6
  */
7
7
  export class AcpClient {
8
- config;
9
- transport;
10
- sessions = new Map();
11
- currentSessionId = null;
12
- sessionUpdateHandlers = new Set();
13
- errorHandlers = new Set();
14
- constructor(config) {
15
- this.config = config;
16
- this.transport = this.createTransport();
17
- this.setupTransportListeners();
18
- if (config.autoConnect) {
19
- this.connect().catch((error) => {
20
- console.error("Failed to auto-connect:", error);
21
- });
22
- }
23
- }
24
- /**
25
- * Connect to the agent
26
- */
27
- async connect() {
28
- await this.transport.connect();
29
- }
30
- /**
31
- * Disconnect from the agent
32
- */
33
- async disconnect() {
34
- await this.transport.disconnect();
35
- this.currentSessionId = null;
36
- }
37
- /**
38
- * Check if connected
39
- */
40
- isConnected() {
41
- return this.transport.isConnected();
42
- }
43
- /**
44
- * Start a new chat session
45
- */
46
- async startSession(config) {
47
- const sessionId = this.generateSessionId();
48
- const now = new Date().toISOString();
49
- const session = {
50
- id: sessionId,
51
- status: "connecting",
52
- config: config
53
- ? { ...config, agentPath: config.agentPath || "" }
54
- : { agentPath: "" },
55
- messages: [],
56
- metadata: {
57
- startedAt: now,
58
- },
59
- };
60
- this.sessions.set(sessionId, session);
61
- this.currentSessionId = sessionId;
62
- // Update session status
63
- this.updateSessionStatus(sessionId, "connected");
64
- return sessionId;
65
- }
66
- /**
67
- * Send a message in the current session
68
- */
69
- async sendMessage(content, sessionId) {
70
- const targetSessionId = sessionId || this.currentSessionId;
71
- if (!targetSessionId) {
72
- throw new Error("No active session. Start a session first.");
73
- }
74
- if (!this.transport.isConnected()) {
75
- throw new Error("Transport not connected");
76
- }
77
- const session = this.sessions.get(targetSessionId);
78
- if (!session) {
79
- throw new Error(`Session ${targetSessionId} not found`);
80
- }
81
- // Create message
82
- const message = {
83
- id: this.generateMessageId(),
84
- role: "user",
85
- content: [
86
- {
87
- type: "text",
88
- text: content,
89
- },
90
- ],
91
- timestamp: new Date().toISOString(),
92
- };
93
- // Add to session
94
- session.messages.push(message);
95
- this.updateSessionStatus(targetSessionId, "active");
96
- // Send through transport
97
- await this.transport.send(message);
98
- }
99
- /**
100
- * Receive messages from the agent (streaming)
101
- */
102
- async *receiveMessages() {
103
- if (!this.transport.isConnected()) {
104
- throw new Error("Transport not connected");
105
- }
106
- yield* this.transport.receive();
107
- }
108
- /**
109
- * Get a session by ID
110
- */
111
- getSession(sessionId) {
112
- return this.sessions.get(sessionId);
113
- }
114
- /**
115
- * Get current session
116
- */
117
- getCurrentSession() {
118
- return this.currentSessionId
119
- ? this.sessions.get(this.currentSessionId)
120
- : undefined;
121
- }
122
- /**
123
- * Get all sessions
124
- */
125
- getAllSessions() {
126
- return Array.from(this.sessions.values());
127
- }
128
- /**
129
- * Subscribe to session updates
130
- */
131
- onSessionUpdate(handler) {
132
- this.sessionUpdateHandlers.add(handler);
133
- return () => {
134
- this.sessionUpdateHandlers.delete(handler);
135
- };
136
- }
137
- /**
138
- * Subscribe to errors
139
- */
140
- onError(handler) {
141
- this.errorHandlers.add(handler);
142
- return () => {
143
- this.errorHandlers.delete(handler);
144
- };
145
- }
146
- /**
147
- * Create transport based on explicit configuration
148
- */
149
- createTransport() {
150
- switch (this.config.type) {
151
- case "stdio":
152
- return new StdioTransport(this.config.options);
153
- case "http":
154
- return new HttpTransport(this.config.options);
155
- case "websocket":
156
- return new WebSocketTransport(this.config.options);
157
- default:
158
- // biome-ignore lint/suspicious/noExplicitAny: .
159
- throw new Error(`Unknown transport type: ${this.config.type}`);
160
- }
161
- }
162
- setupTransportListeners() {
163
- // Listen to transport session updates
164
- this.transport.onSessionUpdate((update) => {
165
- this.handleSessionUpdate(update);
166
- });
167
- // Listen to transport errors
168
- this.transport.onError((error) => {
169
- this.handleError(error);
170
- });
171
- }
172
- handleSessionUpdate(update) {
173
- // Update local session state
174
- if (update.sessionId) {
175
- const session = this.sessions.get(update.sessionId);
176
- if (session) {
177
- if (update.status) {
178
- session.status = update.status;
179
- }
180
- if (update.message) {
181
- session.messages.push(update.message);
182
- }
183
- if (update.error) {
184
- session.error = update.error;
185
- }
186
- }
187
- }
188
- // Notify handlers
189
- for (const handler of this.sessionUpdateHandlers) {
190
- try {
191
- handler(update);
192
- }
193
- catch (error) {
194
- console.error("Error in session update handler:", error);
195
- }
196
- }
197
- }
198
- handleError(error) {
199
- // Notify error handlers
200
- for (const handler of this.errorHandlers) {
201
- try {
202
- handler(error);
203
- }
204
- catch (err) {
205
- console.error("Error in error handler:", err);
206
- }
207
- }
208
- }
209
- updateSessionStatus(sessionId, status) {
210
- const session = this.sessions.get(sessionId);
211
- if (session) {
212
- session.status = status;
213
- this.handleSessionUpdate({
214
- sessionId,
215
- status,
216
- });
217
- }
218
- }
219
- generateSessionId() {
220
- return `session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
221
- }
222
- generateMessageId() {
223
- return `msg_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
224
- }
8
+ config;
9
+ transport;
10
+ sessions = new Map();
11
+ currentSessionId = null;
12
+ sessionUpdateHandlers = new Set();
13
+ errorHandlers = new Set();
14
+ constructor(config) {
15
+ this.config = config;
16
+ this.transport = this.createTransport();
17
+ this.setupTransportListeners();
18
+ if (config.autoConnect) {
19
+ this.connect().catch((error) => {
20
+ console.error("Failed to auto-connect:", error);
21
+ });
22
+ }
23
+ }
24
+ /**
25
+ * Connect to the agent
26
+ */
27
+ async connect() {
28
+ await this.transport.connect();
29
+ }
30
+ /**
31
+ * Disconnect from the agent
32
+ */
33
+ async disconnect() {
34
+ await this.transport.disconnect();
35
+ this.currentSessionId = null;
36
+ }
37
+ /**
38
+ * Check if connected
39
+ */
40
+ isConnected() {
41
+ return this.transport.isConnected();
42
+ }
43
+ /**
44
+ * Start a new chat session
45
+ */
46
+ async startSession(config) {
47
+ const sessionId = this.generateSessionId();
48
+ const now = new Date().toISOString();
49
+ const session = {
50
+ id: sessionId,
51
+ status: "connecting",
52
+ config: config
53
+ ? { ...config, agentPath: config.agentPath || "" }
54
+ : { agentPath: "" },
55
+ messages: [],
56
+ metadata: {
57
+ startedAt: now,
58
+ },
59
+ };
60
+ this.sessions.set(sessionId, session);
61
+ this.currentSessionId = sessionId;
62
+ // Update session status
63
+ this.updateSessionStatus(sessionId, "connected");
64
+ return sessionId;
65
+ }
66
+ /**
67
+ * Send a message in the current session
68
+ */
69
+ async sendMessage(content, sessionId) {
70
+ const targetSessionId = sessionId || this.currentSessionId;
71
+ if (!targetSessionId) {
72
+ throw new Error("No active session. Start a session first.");
73
+ }
74
+ if (!this.transport.isConnected()) {
75
+ throw new Error("Transport not connected");
76
+ }
77
+ const session = this.sessions.get(targetSessionId);
78
+ if (!session) {
79
+ throw new Error(`Session ${targetSessionId} not found`);
80
+ }
81
+ // Create message
82
+ const message = {
83
+ id: this.generateMessageId(),
84
+ role: "user",
85
+ content: [
86
+ {
87
+ type: "text",
88
+ text: content,
89
+ },
90
+ ],
91
+ timestamp: new Date().toISOString(),
92
+ };
93
+ // Add to session
94
+ session.messages.push(message);
95
+ this.updateSessionStatus(targetSessionId, "active");
96
+ // Send through transport
97
+ await this.transport.send(message);
98
+ }
99
+ /**
100
+ * Receive messages from the agent (streaming)
101
+ */
102
+ async *receiveMessages() {
103
+ if (!this.transport.isConnected()) {
104
+ throw new Error("Transport not connected");
105
+ }
106
+ yield* this.transport.receive();
107
+ }
108
+ /**
109
+ * Get a session by ID
110
+ */
111
+ getSession(sessionId) {
112
+ return this.sessions.get(sessionId);
113
+ }
114
+ /**
115
+ * Get current session
116
+ */
117
+ getCurrentSession() {
118
+ return this.currentSessionId
119
+ ? this.sessions.get(this.currentSessionId)
120
+ : undefined;
121
+ }
122
+ /**
123
+ * Get all sessions
124
+ */
125
+ getAllSessions() {
126
+ return Array.from(this.sessions.values());
127
+ }
128
+ /**
129
+ * Subscribe to session updates
130
+ */
131
+ onSessionUpdate(handler) {
132
+ this.sessionUpdateHandlers.add(handler);
133
+ return () => {
134
+ this.sessionUpdateHandlers.delete(handler);
135
+ };
136
+ }
137
+ /**
138
+ * Subscribe to errors
139
+ */
140
+ onError(handler) {
141
+ this.errorHandlers.add(handler);
142
+ return () => {
143
+ this.errorHandlers.delete(handler);
144
+ };
145
+ }
146
+ /**
147
+ * Create transport based on explicit configuration
148
+ */
149
+ createTransport() {
150
+ switch (this.config.type) {
151
+ case "stdio":
152
+ return new StdioTransport(this.config.options);
153
+ case "http":
154
+ return new HttpTransport(this.config.options);
155
+ case "websocket":
156
+ return new WebSocketTransport(this.config.options);
157
+ default:
158
+ // biome-ignore lint/suspicious/noExplicitAny: .
159
+ throw new Error(`Unknown transport type: ${this.config.type}`);
160
+ }
161
+ }
162
+ setupTransportListeners() {
163
+ // Listen to transport session updates
164
+ this.transport.onSessionUpdate((update) => {
165
+ this.handleSessionUpdate(update);
166
+ });
167
+ // Listen to transport errors
168
+ this.transport.onError((error) => {
169
+ this.handleError(error);
170
+ });
171
+ }
172
+ handleSessionUpdate(update) {
173
+ // Update local session state
174
+ if (update.sessionId) {
175
+ const session = this.sessions.get(update.sessionId);
176
+ if (session) {
177
+ if (update.status) {
178
+ session.status = update.status;
179
+ }
180
+ if (update.message) {
181
+ session.messages.push(update.message);
182
+ }
183
+ if (update.error) {
184
+ session.error = update.error;
185
+ }
186
+ }
187
+ }
188
+ // Notify handlers
189
+ for (const handler of this.sessionUpdateHandlers) {
190
+ try {
191
+ handler(update);
192
+ } catch (error) {
193
+ console.error("Error in session update handler:", error);
194
+ }
195
+ }
196
+ }
197
+ handleError(error) {
198
+ // Notify error handlers
199
+ for (const handler of this.errorHandlers) {
200
+ try {
201
+ handler(error);
202
+ } catch (err) {
203
+ console.error("Error in error handler:", err);
204
+ }
205
+ }
206
+ }
207
+ updateSessionStatus(sessionId, status) {
208
+ const session = this.sessions.get(sessionId);
209
+ if (session) {
210
+ session.status = status;
211
+ this.handleSessionUpdate({
212
+ sessionId,
213
+ status,
214
+ });
215
+ }
216
+ }
217
+ generateSessionId() {
218
+ return `session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
219
+ }
220
+ generateMessageId() {
221
+ return `msg_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
222
+ }
225
223
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp-client.js","sourceRoot":"","sources":["../../../src/sdk/client/acp-client.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAOtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA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C,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAC5E,CAAC;IAEO,iBAAiB;QACvB,OAAO,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACxE,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/client/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sdk/client/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
@@ -2,86 +2,133 @@ import { z } from "zod";
2
2
  /**
3
3
  * Agent capability schema
4
4
  */
5
- export declare const AgentCapability: z.ZodObject<{
6
- name: z.ZodString;
7
- description: z.ZodOptional<z.ZodString>;
8
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
9
- }, z.core.$strip>;
5
+ export declare const AgentCapability: z.ZodObject<
6
+ {
7
+ name: z.ZodString;
8
+ description: z.ZodOptional<z.ZodString>;
9
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
10
+ },
11
+ z.core.$strip
12
+ >;
10
13
  export type AgentCapability = z.infer<typeof AgentCapability>;
11
14
  /**
12
15
  * Agent tool schema
13
16
  */
14
- export declare const AgentTool: z.ZodObject<{
15
- name: z.ZodString;
16
- description: z.ZodString;
17
- parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
18
- required: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
- }, z.core.$strip>;
17
+ export declare const AgentTool: z.ZodObject<
18
+ {
19
+ name: z.ZodString;
20
+ description: z.ZodString;
21
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
22
+ required: z.ZodOptional<z.ZodArray<z.ZodString>>;
23
+ },
24
+ z.core.$strip
25
+ >;
20
26
  export type AgentTool = z.infer<typeof AgentTool>;
21
27
  /**
22
28
  * Agent information schema
23
29
  */
24
- export declare const AgentInfo: z.ZodObject<{
25
- name: z.ZodString;
26
- version: z.ZodOptional<z.ZodString>;
27
- description: z.ZodOptional<z.ZodString>;
28
- author: z.ZodOptional<z.ZodString>;
29
- capabilities: z.ZodOptional<z.ZodArray<z.ZodObject<{
30
- name: z.ZodString;
31
- description: z.ZodOptional<z.ZodString>;
32
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
33
- }, z.core.$strip>>>;
34
- tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
- name: z.ZodString;
36
- description: z.ZodString;
37
- parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
38
- required: z.ZodOptional<z.ZodArray<z.ZodString>>;
39
- }, z.core.$strip>>>;
40
- supportedFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
- }, z.core.$strip>;
30
+ export declare const AgentInfo: z.ZodObject<
31
+ {
32
+ name: z.ZodString;
33
+ version: z.ZodOptional<z.ZodString>;
34
+ description: z.ZodOptional<z.ZodString>;
35
+ author: z.ZodOptional<z.ZodString>;
36
+ capabilities: z.ZodOptional<
37
+ z.ZodArray<
38
+ z.ZodObject<
39
+ {
40
+ name: z.ZodString;
41
+ description: z.ZodOptional<z.ZodString>;
42
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
43
+ },
44
+ z.core.$strip
45
+ >
46
+ >
47
+ >;
48
+ tools: z.ZodOptional<
49
+ z.ZodArray<
50
+ z.ZodObject<
51
+ {
52
+ name: z.ZodString;
53
+ description: z.ZodString;
54
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
55
+ required: z.ZodOptional<z.ZodArray<z.ZodString>>;
56
+ },
57
+ z.core.$strip
58
+ >
59
+ >
60
+ >;
61
+ supportedFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
+ },
63
+ z.core.$strip
64
+ >;
42
65
  export type AgentInfo = z.infer<typeof AgentInfo>;
43
66
  /**
44
67
  * Agent status schema
45
68
  */
46
69
  export declare const AgentStatus: z.ZodEnum<{
47
- initializing: "initializing";
48
- ready: "ready";
49
- busy: "busy";
50
- error: "error";
51
- terminated: "terminated";
70
+ error: "error";
71
+ initializing: "initializing";
72
+ ready: "ready";
73
+ busy: "busy";
74
+ terminated: "terminated";
52
75
  }>;
53
76
  export type AgentStatus = z.infer<typeof AgentStatus>;
54
77
  /**
55
78
  * Agent state schema
56
79
  */
57
- export declare const AgentState: z.ZodObject<{
58
- status: z.ZodEnum<{
59
- initializing: "initializing";
60
- ready: "ready";
61
- busy: "busy";
62
- error: "error";
63
- terminated: "terminated";
64
- }>;
65
- info: z.ZodOptional<z.ZodObject<{
66
- name: z.ZodString;
67
- version: z.ZodOptional<z.ZodString>;
68
- description: z.ZodOptional<z.ZodString>;
69
- author: z.ZodOptional<z.ZodString>;
70
- capabilities: z.ZodOptional<z.ZodArray<z.ZodObject<{
71
- name: z.ZodString;
72
- description: z.ZodOptional<z.ZodString>;
73
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
74
- }, z.core.$strip>>>;
75
- tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
76
- name: z.ZodString;
77
- description: z.ZodString;
78
- parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
79
- required: z.ZodOptional<z.ZodArray<z.ZodString>>;
80
- }, z.core.$strip>>>;
81
- supportedFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
- }, z.core.$strip>>;
83
- pid: z.ZodOptional<z.ZodNumber>;
84
- error: z.ZodOptional<z.ZodString>;
85
- uptime: z.ZodOptional<z.ZodNumber>;
86
- }, z.core.$strip>;
80
+ export declare const AgentState: z.ZodObject<
81
+ {
82
+ status: z.ZodEnum<{
83
+ error: "error";
84
+ initializing: "initializing";
85
+ ready: "ready";
86
+ busy: "busy";
87
+ terminated: "terminated";
88
+ }>;
89
+ info: z.ZodOptional<
90
+ z.ZodObject<
91
+ {
92
+ name: z.ZodString;
93
+ version: z.ZodOptional<z.ZodString>;
94
+ description: z.ZodOptional<z.ZodString>;
95
+ author: z.ZodOptional<z.ZodString>;
96
+ capabilities: z.ZodOptional<
97
+ z.ZodArray<
98
+ z.ZodObject<
99
+ {
100
+ name: z.ZodString;
101
+ description: z.ZodOptional<z.ZodString>;
102
+ parameters: z.ZodOptional<
103
+ z.ZodRecord<z.ZodString, z.ZodUnknown>
104
+ >;
105
+ },
106
+ z.core.$strip
107
+ >
108
+ >
109
+ >;
110
+ tools: z.ZodOptional<
111
+ z.ZodArray<
112
+ z.ZodObject<
113
+ {
114
+ name: z.ZodString;
115
+ description: z.ZodString;
116
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
117
+ required: z.ZodOptional<z.ZodArray<z.ZodString>>;
118
+ },
119
+ z.core.$strip
120
+ >
121
+ >
122
+ >;
123
+ supportedFormats: z.ZodOptional<z.ZodArray<z.ZodString>>;
124
+ },
125
+ z.core.$strip
126
+ >
127
+ >;
128
+ pid: z.ZodOptional<z.ZodNumber>;
129
+ error: z.ZodOptional<z.ZodString>;
130
+ uptime: z.ZodOptional<z.ZodNumber>;
131
+ },
132
+ z.core.$strip
133
+ >;
87
134
  export type AgentState = z.infer<typeof AgentState>;