@townco/ui 0.1.14 → 0.1.16
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/index.d.ts +1 -0
- package/dist/core/hooks/index.js +1 -0
- package/dist/core/hooks/use-chat-messages.d.ts +50 -11
- package/dist/core/hooks/use-chat-session.d.ts +5 -5
- package/dist/core/hooks/use-tool-calls.d.ts +52 -0
- package/dist/core/hooks/use-tool-calls.js +61 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/lib/logger.d.ts +24 -0
- package/dist/core/lib/logger.js +108 -0
- package/dist/core/schemas/chat.d.ts +166 -83
- package/dist/core/schemas/chat.js +27 -27
- package/dist/core/schemas/index.d.ts +1 -0
- package/dist/core/schemas/index.js +1 -0
- package/dist/core/schemas/tool-call.d.ts +174 -0
- package/dist/core/schemas/tool-call.js +130 -0
- package/dist/core/store/chat-store.d.ts +28 -28
- package/dist/core/store/chat-store.js +123 -59
- package/dist/gui/components/ChatLayout.js +11 -10
- package/dist/gui/components/MessageContent.js +4 -1
- package/dist/gui/components/ToolCall.d.ts +8 -0
- package/dist/gui/components/ToolCall.js +100 -0
- package/dist/gui/components/ToolCallList.d.ts +9 -0
- package/dist/gui/components/ToolCallList.js +22 -0
- package/dist/gui/components/index.d.ts +2 -0
- package/dist/gui/components/index.js +2 -0
- package/dist/gui/components/resizable.d.ts +7 -0
- package/dist/gui/components/resizable.js +7 -0
- package/dist/sdk/schemas/session.d.ts +390 -220
- package/dist/sdk/schemas/session.js +74 -29
- package/dist/sdk/transports/http.js +705 -472
- package/dist/sdk/transports/stdio.js +187 -32
- package/dist/tui/components/ChatView.js +19 -51
- package/dist/tui/components/MessageList.d.ts +2 -4
- package/dist/tui/components/MessageList.js +13 -37
- package/dist/tui/components/ToolCall.d.ts +9 -0
- package/dist/tui/components/ToolCall.js +41 -0
- package/dist/tui/components/ToolCallList.d.ts +8 -0
- package/dist/tui/components/ToolCallList.js +17 -0
- package/dist/tui/components/index.d.ts +2 -0
- package/dist/tui/components/index.js +2 -0
- package/package.json +4 -2
|
@@ -3,240 +3,410 @@ import { z } from "zod";
|
|
|
3
3
|
* Session status
|
|
4
4
|
*/
|
|
5
5
|
export declare const SessionStatus: z.ZodEnum<{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
idle: "idle";
|
|
7
|
+
connecting: "connecting";
|
|
8
|
+
connected: "connected";
|
|
9
|
+
active: "active";
|
|
10
|
+
streaming: "streaming";
|
|
11
|
+
error: "error";
|
|
12
|
+
disconnected: "disconnected";
|
|
13
13
|
}>;
|
|
14
14
|
export type SessionStatus = z.infer<typeof SessionStatus>;
|
|
15
15
|
/**
|
|
16
16
|
* Session configuration
|
|
17
17
|
*/
|
|
18
|
-
export declare const SessionConfig: z.ZodObject<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
z.core.$strip
|
|
27
|
-
>;
|
|
18
|
+
export declare const SessionConfig: z.ZodObject<{
|
|
19
|
+
agentPath: z.ZodString;
|
|
20
|
+
agentArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
22
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
23
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
}, z.core.$strip>;
|
|
28
25
|
export type SessionConfig = z.infer<typeof SessionConfig>;
|
|
29
26
|
/**
|
|
30
27
|
* Session metadata
|
|
31
28
|
*/
|
|
32
|
-
export declare const SessionMetadata: z.ZodObject<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
z.core.$strip
|
|
41
|
-
>;
|
|
29
|
+
export declare const SessionMetadata: z.ZodObject<{
|
|
30
|
+
agentName: z.ZodOptional<z.ZodString>;
|
|
31
|
+
agentVersion: z.ZodOptional<z.ZodString>;
|
|
32
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
+
startedAt: z.ZodISODateTime;
|
|
34
|
+
lastActivityAt: z.ZodOptional<z.ZodISODateTime>;
|
|
35
|
+
}, z.core.$strip>;
|
|
42
36
|
export type SessionMetadata = z.infer<typeof SessionMetadata>;
|
|
43
37
|
/**
|
|
44
38
|
* Session schema
|
|
45
39
|
*/
|
|
46
|
-
export declare const Session: z.ZodObject<
|
|
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
|
-
type: z.ZodLiteral<"file">;
|
|
112
|
-
name: z.ZodString;
|
|
113
|
-
path: z.ZodOptional<z.ZodString>;
|
|
114
|
-
url: z.ZodOptional<z.ZodString>;
|
|
115
|
-
mimeType: z.ZodString;
|
|
116
|
-
size: z.ZodOptional<z.ZodNumber>;
|
|
117
|
-
},
|
|
118
|
-
z.core.$strip
|
|
119
|
-
>,
|
|
120
|
-
z.ZodObject<
|
|
121
|
-
{
|
|
122
|
-
type: z.ZodLiteral<"tool_call">;
|
|
123
|
-
id: z.ZodString;
|
|
124
|
-
name: z.ZodString;
|
|
125
|
-
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
126
|
-
},
|
|
127
|
-
z.core.$strip
|
|
128
|
-
>,
|
|
129
|
-
z.ZodObject<
|
|
130
|
-
{
|
|
131
|
-
type: z.ZodLiteral<"tool_result">;
|
|
132
|
-
callId: z.ZodString;
|
|
133
|
-
result: z.ZodUnknown;
|
|
134
|
-
error: z.ZodOptional<z.ZodString>;
|
|
135
|
-
},
|
|
136
|
-
z.core.$strip
|
|
137
|
-
>,
|
|
138
|
-
],
|
|
139
|
-
"type"
|
|
140
|
-
>
|
|
141
|
-
>;
|
|
142
|
-
timestamp: z.ZodISODateTime;
|
|
143
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
144
|
-
},
|
|
145
|
-
z.core.$strip
|
|
146
|
-
>
|
|
147
|
-
>;
|
|
148
|
-
error: z.ZodOptional<z.ZodString>;
|
|
149
|
-
},
|
|
150
|
-
z.core.$strip
|
|
151
|
-
>;
|
|
40
|
+
export declare const Session: z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
status: z.ZodEnum<{
|
|
43
|
+
idle: "idle";
|
|
44
|
+
connecting: "connecting";
|
|
45
|
+
connected: "connected";
|
|
46
|
+
active: "active";
|
|
47
|
+
streaming: "streaming";
|
|
48
|
+
error: "error";
|
|
49
|
+
disconnected: "disconnected";
|
|
50
|
+
}>;
|
|
51
|
+
config: z.ZodObject<{
|
|
52
|
+
agentPath: z.ZodString;
|
|
53
|
+
agentArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
55
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
56
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
agentName: z.ZodOptional<z.ZodString>;
|
|
60
|
+
agentVersion: z.ZodOptional<z.ZodString>;
|
|
61
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
+
startedAt: z.ZodISODateTime;
|
|
63
|
+
lastActivityAt: z.ZodOptional<z.ZodISODateTime>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
role: z.ZodEnum<{
|
|
68
|
+
user: "user";
|
|
69
|
+
assistant: "assistant";
|
|
70
|
+
system: "system";
|
|
71
|
+
tool: "tool";
|
|
72
|
+
}>;
|
|
73
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
74
|
+
type: z.ZodLiteral<"text">;
|
|
75
|
+
text: z.ZodString;
|
|
76
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
77
|
+
type: z.ZodLiteral<"image">;
|
|
78
|
+
url: z.ZodOptional<z.ZodString>;
|
|
79
|
+
data: z.ZodOptional<z.ZodString>;
|
|
80
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
+
type: z.ZodLiteral<"file">;
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
path: z.ZodOptional<z.ZodString>;
|
|
85
|
+
url: z.ZodOptional<z.ZodString>;
|
|
86
|
+
mimeType: z.ZodString;
|
|
87
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
+
type: z.ZodLiteral<"tool_call">;
|
|
90
|
+
id: z.ZodString;
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
93
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
94
|
+
type: z.ZodLiteral<"tool_result">;
|
|
95
|
+
callId: z.ZodString;
|
|
96
|
+
result: z.ZodUnknown;
|
|
97
|
+
error: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strip>], "type">>;
|
|
99
|
+
timestamp: z.ZodISODateTime;
|
|
100
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
101
|
+
}, z.core.$strip>>;
|
|
102
|
+
error: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strip>;
|
|
152
104
|
export type Session = z.infer<typeof Session>;
|
|
153
105
|
/**
|
|
154
|
-
* Session update event
|
|
106
|
+
* Session update event (union type)
|
|
155
107
|
*/
|
|
156
|
-
export declare const SessionUpdate: z.ZodObject<
|
|
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
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
108
|
+
export declare const SessionUpdate: z.ZodUnion<readonly [z.ZodObject<{
|
|
109
|
+
sessionId: z.ZodString;
|
|
110
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
idle: "idle";
|
|
112
|
+
connecting: "connecting";
|
|
113
|
+
connected: "connected";
|
|
114
|
+
active: "active";
|
|
115
|
+
streaming: "streaming";
|
|
116
|
+
error: "error";
|
|
117
|
+
disconnected: "disconnected";
|
|
118
|
+
}>>;
|
|
119
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
id: z.ZodString;
|
|
121
|
+
role: z.ZodEnum<{
|
|
122
|
+
user: "user";
|
|
123
|
+
assistant: "assistant";
|
|
124
|
+
system: "system";
|
|
125
|
+
tool: "tool";
|
|
126
|
+
}>;
|
|
127
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
128
|
+
type: z.ZodLiteral<"text">;
|
|
129
|
+
text: z.ZodString;
|
|
130
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"image">;
|
|
132
|
+
url: z.ZodOptional<z.ZodString>;
|
|
133
|
+
data: z.ZodOptional<z.ZodString>;
|
|
134
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
136
|
+
type: z.ZodLiteral<"file">;
|
|
137
|
+
name: z.ZodString;
|
|
138
|
+
path: z.ZodOptional<z.ZodString>;
|
|
139
|
+
url: z.ZodOptional<z.ZodString>;
|
|
140
|
+
mimeType: z.ZodString;
|
|
141
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
142
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
143
|
+
type: z.ZodLiteral<"tool_call">;
|
|
144
|
+
id: z.ZodString;
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
147
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
148
|
+
type: z.ZodLiteral<"tool_result">;
|
|
149
|
+
callId: z.ZodString;
|
|
150
|
+
result: z.ZodUnknown;
|
|
151
|
+
error: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strip>], "type">>;
|
|
153
|
+
timestamp: z.ZodISODateTime;
|
|
154
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
error: z.ZodOptional<z.ZodString>;
|
|
157
|
+
type: z.ZodLiteral<"tool_call">;
|
|
158
|
+
toolCall: z.ZodObject<{
|
|
159
|
+
id: z.ZodString;
|
|
160
|
+
title: z.ZodString;
|
|
161
|
+
kind: z.ZodEnum<{
|
|
162
|
+
read: "read";
|
|
163
|
+
edit: "edit";
|
|
164
|
+
delete: "delete";
|
|
165
|
+
move: "move";
|
|
166
|
+
search: "search";
|
|
167
|
+
execute: "execute";
|
|
168
|
+
think: "think";
|
|
169
|
+
fetch: "fetch";
|
|
170
|
+
switch_mode: "switch_mode";
|
|
171
|
+
other: "other";
|
|
172
|
+
}>;
|
|
173
|
+
status: z.ZodEnum<{
|
|
174
|
+
pending: "pending";
|
|
175
|
+
in_progress: "in_progress";
|
|
176
|
+
completed: "completed";
|
|
177
|
+
failed: "failed";
|
|
178
|
+
}>;
|
|
179
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
180
|
+
path: z.ZodString;
|
|
181
|
+
line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
182
|
+
}, z.core.$strip>>>;
|
|
183
|
+
rawInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
184
|
+
rawOutput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
185
|
+
content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
186
|
+
type: z.ZodLiteral<"content">;
|
|
187
|
+
content: z.ZodObject<{
|
|
188
|
+
type: z.ZodLiteral<"text">;
|
|
189
|
+
text: z.ZodString;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
192
|
+
type: z.ZodLiteral<"text">;
|
|
193
|
+
text: z.ZodString;
|
|
194
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
195
|
+
type: z.ZodLiteral<"diff">;
|
|
196
|
+
path: z.ZodString;
|
|
197
|
+
oldText: z.ZodString;
|
|
198
|
+
newText: z.ZodString;
|
|
199
|
+
line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
200
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
201
|
+
type: z.ZodLiteral<"terminal">;
|
|
202
|
+
terminalId: z.ZodString;
|
|
203
|
+
}, z.core.$strip>], "type">>>;
|
|
204
|
+
error: z.ZodOptional<z.ZodString>;
|
|
205
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
207
|
+
tokenUsage: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
209
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
}, z.core.$strip>>;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
214
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
215
|
+
sessionId: z.ZodString;
|
|
216
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
217
|
+
idle: "idle";
|
|
218
|
+
connecting: "connecting";
|
|
219
|
+
connected: "connected";
|
|
220
|
+
active: "active";
|
|
221
|
+
streaming: "streaming";
|
|
222
|
+
error: "error";
|
|
223
|
+
disconnected: "disconnected";
|
|
224
|
+
}>>;
|
|
225
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
226
|
+
id: z.ZodString;
|
|
227
|
+
role: z.ZodEnum<{
|
|
228
|
+
user: "user";
|
|
229
|
+
assistant: "assistant";
|
|
230
|
+
system: "system";
|
|
231
|
+
tool: "tool";
|
|
232
|
+
}>;
|
|
233
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
234
|
+
type: z.ZodLiteral<"text">;
|
|
235
|
+
text: z.ZodString;
|
|
236
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
237
|
+
type: z.ZodLiteral<"image">;
|
|
238
|
+
url: z.ZodOptional<z.ZodString>;
|
|
239
|
+
data: z.ZodOptional<z.ZodString>;
|
|
240
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
241
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
242
|
+
type: z.ZodLiteral<"file">;
|
|
243
|
+
name: z.ZodString;
|
|
244
|
+
path: z.ZodOptional<z.ZodString>;
|
|
245
|
+
url: z.ZodOptional<z.ZodString>;
|
|
246
|
+
mimeType: z.ZodString;
|
|
247
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
249
|
+
type: z.ZodLiteral<"tool_call">;
|
|
250
|
+
id: z.ZodString;
|
|
251
|
+
name: z.ZodString;
|
|
252
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
253
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
254
|
+
type: z.ZodLiteral<"tool_result">;
|
|
255
|
+
callId: z.ZodString;
|
|
256
|
+
result: z.ZodUnknown;
|
|
257
|
+
error: z.ZodOptional<z.ZodString>;
|
|
258
|
+
}, z.core.$strip>], "type">>;
|
|
259
|
+
timestamp: z.ZodISODateTime;
|
|
260
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
error: z.ZodOptional<z.ZodString>;
|
|
263
|
+
type: z.ZodLiteral<"tool_call_update">;
|
|
264
|
+
toolCallUpdate: z.ZodObject<{
|
|
265
|
+
id: z.ZodString;
|
|
266
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
267
|
+
pending: "pending";
|
|
268
|
+
in_progress: "in_progress";
|
|
269
|
+
completed: "completed";
|
|
270
|
+
failed: "failed";
|
|
271
|
+
}>>;
|
|
272
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
273
|
+
path: z.ZodString;
|
|
274
|
+
line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
275
|
+
}, z.core.$strip>>>;
|
|
276
|
+
rawOutput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
277
|
+
content: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
278
|
+
type: z.ZodLiteral<"content">;
|
|
279
|
+
content: z.ZodObject<{
|
|
280
|
+
type: z.ZodLiteral<"text">;
|
|
281
|
+
text: z.ZodString;
|
|
282
|
+
}, z.core.$strip>;
|
|
283
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
284
|
+
type: z.ZodLiteral<"text">;
|
|
285
|
+
text: z.ZodString;
|
|
286
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
287
|
+
type: z.ZodLiteral<"diff">;
|
|
288
|
+
path: z.ZodString;
|
|
289
|
+
oldText: z.ZodString;
|
|
290
|
+
newText: z.ZodString;
|
|
291
|
+
line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
292
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
293
|
+
type: z.ZodLiteral<"terminal">;
|
|
294
|
+
terminalId: z.ZodString;
|
|
295
|
+
}, z.core.$strip>], "type">>>;
|
|
296
|
+
error: z.ZodOptional<z.ZodString>;
|
|
297
|
+
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
298
|
+
tokenUsage: z.ZodOptional<z.ZodObject<{
|
|
299
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
300
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
301
|
+
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
302
|
+
}, z.core.$strip>>;
|
|
303
|
+
}, z.core.$strip>;
|
|
304
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
305
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
306
|
+
sessionId: z.ZodString;
|
|
307
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
308
|
+
idle: "idle";
|
|
309
|
+
connecting: "connecting";
|
|
310
|
+
connected: "connected";
|
|
311
|
+
active: "active";
|
|
312
|
+
streaming: "streaming";
|
|
313
|
+
error: "error";
|
|
314
|
+
disconnected: "disconnected";
|
|
315
|
+
}>>;
|
|
316
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
317
|
+
id: z.ZodString;
|
|
318
|
+
role: z.ZodEnum<{
|
|
319
|
+
user: "user";
|
|
320
|
+
assistant: "assistant";
|
|
321
|
+
system: "system";
|
|
322
|
+
tool: "tool";
|
|
323
|
+
}>;
|
|
324
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
325
|
+
type: z.ZodLiteral<"text">;
|
|
326
|
+
text: z.ZodString;
|
|
327
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
328
|
+
type: z.ZodLiteral<"image">;
|
|
329
|
+
url: z.ZodOptional<z.ZodString>;
|
|
330
|
+
data: z.ZodOptional<z.ZodString>;
|
|
331
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
332
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
333
|
+
type: z.ZodLiteral<"file">;
|
|
334
|
+
name: z.ZodString;
|
|
335
|
+
path: z.ZodOptional<z.ZodString>;
|
|
336
|
+
url: z.ZodOptional<z.ZodString>;
|
|
337
|
+
mimeType: z.ZodString;
|
|
338
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
339
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
340
|
+
type: z.ZodLiteral<"tool_call">;
|
|
341
|
+
id: z.ZodString;
|
|
342
|
+
name: z.ZodString;
|
|
343
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
344
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
345
|
+
type: z.ZodLiteral<"tool_result">;
|
|
346
|
+
callId: z.ZodString;
|
|
347
|
+
result: z.ZodUnknown;
|
|
348
|
+
error: z.ZodOptional<z.ZodString>;
|
|
349
|
+
}, z.core.$strip>], "type">>;
|
|
350
|
+
timestamp: z.ZodISODateTime;
|
|
351
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
352
|
+
}, z.core.$strip>>;
|
|
353
|
+
error: z.ZodOptional<z.ZodString>;
|
|
354
|
+
type: z.ZodLiteral<"tool_output">;
|
|
355
|
+
toolOutput: z.ZodObject<{
|
|
356
|
+
id: z.ZodString;
|
|
357
|
+
content: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
358
|
+
rawOutput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
359
|
+
}, z.core.$strip>;
|
|
360
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
361
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
362
|
+
sessionId: z.ZodString;
|
|
363
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
364
|
+
idle: "idle";
|
|
365
|
+
connecting: "connecting";
|
|
366
|
+
connected: "connected";
|
|
367
|
+
active: "active";
|
|
368
|
+
streaming: "streaming";
|
|
369
|
+
error: "error";
|
|
370
|
+
disconnected: "disconnected";
|
|
371
|
+
}>>;
|
|
372
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
373
|
+
id: z.ZodString;
|
|
374
|
+
role: z.ZodEnum<{
|
|
375
|
+
user: "user";
|
|
376
|
+
assistant: "assistant";
|
|
377
|
+
system: "system";
|
|
378
|
+
tool: "tool";
|
|
379
|
+
}>;
|
|
380
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
381
|
+
type: z.ZodLiteral<"text">;
|
|
382
|
+
text: z.ZodString;
|
|
383
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
384
|
+
type: z.ZodLiteral<"image">;
|
|
385
|
+
url: z.ZodOptional<z.ZodString>;
|
|
386
|
+
data: z.ZodOptional<z.ZodString>;
|
|
387
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
388
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
389
|
+
type: z.ZodLiteral<"file">;
|
|
390
|
+
name: z.ZodString;
|
|
391
|
+
path: z.ZodOptional<z.ZodString>;
|
|
392
|
+
url: z.ZodOptional<z.ZodString>;
|
|
393
|
+
mimeType: z.ZodString;
|
|
394
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
395
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
396
|
+
type: z.ZodLiteral<"tool_call">;
|
|
397
|
+
id: z.ZodString;
|
|
398
|
+
name: z.ZodString;
|
|
399
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
400
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
401
|
+
type: z.ZodLiteral<"tool_result">;
|
|
402
|
+
callId: z.ZodString;
|
|
403
|
+
result: z.ZodUnknown;
|
|
404
|
+
error: z.ZodOptional<z.ZodString>;
|
|
405
|
+
}, z.core.$strip>], "type">>;
|
|
406
|
+
timestamp: z.ZodISODateTime;
|
|
407
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
408
|
+
}, z.core.$strip>>;
|
|
409
|
+
error: z.ZodOptional<z.ZodString>;
|
|
410
|
+
type: z.ZodOptional<z.ZodLiteral<"generic">>;
|
|
411
|
+
}, z.core.$strip>]>;
|
|
242
412
|
export type SessionUpdate = z.infer<typeof SessionUpdate>;
|