@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.
- 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
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
}
|
package/dist/sdk/index.d.ts
CHANGED
package/dist/sdk/index.js
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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>;
|