@ahmadposten/talos-wire 0.1.0
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/LICENSE +21 -0
- package/README.md +741 -0
- package/dist/index.cjs +371 -0
- package/dist/index.d.cts +910 -0
- package/dist/index.d.mts +910 -0
- package/dist/index.mjs +304 -0
- package/package.json +51 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,910 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const MessageMetaSchema: z.ZodObject<{
|
|
4
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
5
|
+
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
default: "default";
|
|
7
|
+
acceptEdits: "acceptEdits";
|
|
8
|
+
bypassPermissions: "bypassPermissions";
|
|
9
|
+
plan: "plan";
|
|
10
|
+
"read-only": "read-only";
|
|
11
|
+
"safe-yolo": "safe-yolo";
|
|
12
|
+
yolo: "yolo";
|
|
13
|
+
}>>;
|
|
14
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
+
fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
19
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
20
|
+
effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
type MessageMeta = z.infer<typeof MessageMetaSchema>;
|
|
24
|
+
|
|
25
|
+
declare const SessionMessageContentSchema: z.ZodObject<{
|
|
26
|
+
c: z.ZodString;
|
|
27
|
+
t: z.ZodLiteral<"encrypted">;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
type SessionMessageContent = z.infer<typeof SessionMessageContentSchema>;
|
|
30
|
+
declare const SessionMessageSchema: z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
seq: z.ZodNumber;
|
|
33
|
+
localId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
|
+
content: z.ZodObject<{
|
|
35
|
+
c: z.ZodString;
|
|
36
|
+
t: z.ZodLiteral<"encrypted">;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
createdAt: z.ZodNumber;
|
|
39
|
+
updatedAt: z.ZodNumber;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
type SessionMessage = z.infer<typeof SessionMessageSchema>;
|
|
42
|
+
|
|
43
|
+
declare const SessionProtocolMessageSchema: z.ZodObject<{
|
|
44
|
+
role: z.ZodLiteral<"session">;
|
|
45
|
+
content: z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
time: z.ZodNumber;
|
|
48
|
+
role: z.ZodEnum<{
|
|
49
|
+
user: "user";
|
|
50
|
+
agent: "agent";
|
|
51
|
+
}>;
|
|
52
|
+
turn: z.ZodOptional<z.ZodString>;
|
|
53
|
+
subagent: z.ZodOptional<z.ZodString>;
|
|
54
|
+
claudeUuid: z.ZodOptional<z.ZodString>;
|
|
55
|
+
codexItemId: z.ZodOptional<z.ZodString>;
|
|
56
|
+
ev: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
57
|
+
t: z.ZodLiteral<"text">;
|
|
58
|
+
text: z.ZodString;
|
|
59
|
+
thinking: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
61
|
+
t: z.ZodLiteral<"service">;
|
|
62
|
+
text: z.ZodString;
|
|
63
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
64
|
+
t: z.ZodLiteral<"tool-call-start">;
|
|
65
|
+
call: z.ZodString;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
title: z.ZodString;
|
|
68
|
+
description: z.ZodString;
|
|
69
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
70
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
+
t: z.ZodLiteral<"tool-call-end">;
|
|
72
|
+
call: z.ZodString;
|
|
73
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
74
|
+
isError: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
76
|
+
t: z.ZodLiteral<"file">;
|
|
77
|
+
ref: z.ZodString;
|
|
78
|
+
name: z.ZodString;
|
|
79
|
+
size: z.ZodNumber;
|
|
80
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
81
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
width: z.ZodNumber;
|
|
83
|
+
height: z.ZodNumber;
|
|
84
|
+
thumbhash: z.ZodString;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
87
|
+
t: z.ZodLiteral<"turn-start">;
|
|
88
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
+
t: z.ZodLiteral<"start">;
|
|
90
|
+
title: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
92
|
+
t: z.ZodLiteral<"turn-end">;
|
|
93
|
+
status: z.ZodEnum<{
|
|
94
|
+
completed: "completed";
|
|
95
|
+
failed: "failed";
|
|
96
|
+
cancelled: "cancelled";
|
|
97
|
+
}>;
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
t: z.ZodLiteral<"stop">;
|
|
100
|
+
}, z.core.$strip>], "t">;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
104
|
+
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
105
|
+
default: "default";
|
|
106
|
+
acceptEdits: "acceptEdits";
|
|
107
|
+
bypassPermissions: "bypassPermissions";
|
|
108
|
+
plan: "plan";
|
|
109
|
+
"read-only": "read-only";
|
|
110
|
+
"safe-yolo": "safe-yolo";
|
|
111
|
+
yolo: "yolo";
|
|
112
|
+
}>>;
|
|
113
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
118
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
119
|
+
effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
120
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
type SessionProtocolMessage = z.infer<typeof SessionProtocolMessageSchema>;
|
|
124
|
+
declare const MessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
125
|
+
role: z.ZodLiteral<"user">;
|
|
126
|
+
content: z.ZodObject<{
|
|
127
|
+
type: z.ZodLiteral<"text">;
|
|
128
|
+
text: z.ZodString;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
localKey: z.ZodOptional<z.ZodString>;
|
|
131
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
132
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
133
|
+
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
134
|
+
default: "default";
|
|
135
|
+
acceptEdits: "acceptEdits";
|
|
136
|
+
bypassPermissions: "bypassPermissions";
|
|
137
|
+
plan: "plan";
|
|
138
|
+
"read-only": "read-only";
|
|
139
|
+
"safe-yolo": "safe-yolo";
|
|
140
|
+
yolo: "yolo";
|
|
141
|
+
}>>;
|
|
142
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
143
|
+
fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
146
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
147
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
148
|
+
effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
149
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, z.core.$strip>>;
|
|
151
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
152
|
+
role: z.ZodLiteral<"agent">;
|
|
153
|
+
content: z.ZodObject<{
|
|
154
|
+
type: z.ZodString;
|
|
155
|
+
}, z.core.$loose>;
|
|
156
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
158
|
+
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
default: "default";
|
|
160
|
+
acceptEdits: "acceptEdits";
|
|
161
|
+
bypassPermissions: "bypassPermissions";
|
|
162
|
+
plan: "plan";
|
|
163
|
+
"read-only": "read-only";
|
|
164
|
+
"safe-yolo": "safe-yolo";
|
|
165
|
+
yolo: "yolo";
|
|
166
|
+
}>>;
|
|
167
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
168
|
+
fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
169
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
170
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
171
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
172
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
173
|
+
effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
174
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.core.$strip>>;
|
|
176
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
177
|
+
role: z.ZodLiteral<"session">;
|
|
178
|
+
content: z.ZodObject<{
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
time: z.ZodNumber;
|
|
181
|
+
role: z.ZodEnum<{
|
|
182
|
+
user: "user";
|
|
183
|
+
agent: "agent";
|
|
184
|
+
}>;
|
|
185
|
+
turn: z.ZodOptional<z.ZodString>;
|
|
186
|
+
subagent: z.ZodOptional<z.ZodString>;
|
|
187
|
+
claudeUuid: z.ZodOptional<z.ZodString>;
|
|
188
|
+
codexItemId: z.ZodOptional<z.ZodString>;
|
|
189
|
+
ev: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
190
|
+
t: z.ZodLiteral<"text">;
|
|
191
|
+
text: z.ZodString;
|
|
192
|
+
thinking: z.ZodOptional<z.ZodBoolean>;
|
|
193
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
194
|
+
t: z.ZodLiteral<"service">;
|
|
195
|
+
text: z.ZodString;
|
|
196
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
197
|
+
t: z.ZodLiteral<"tool-call-start">;
|
|
198
|
+
call: z.ZodString;
|
|
199
|
+
name: z.ZodString;
|
|
200
|
+
title: z.ZodString;
|
|
201
|
+
description: z.ZodString;
|
|
202
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
203
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
204
|
+
t: z.ZodLiteral<"tool-call-end">;
|
|
205
|
+
call: z.ZodString;
|
|
206
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
207
|
+
isError: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
209
|
+
t: z.ZodLiteral<"file">;
|
|
210
|
+
ref: z.ZodString;
|
|
211
|
+
name: z.ZodString;
|
|
212
|
+
size: z.ZodNumber;
|
|
213
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
214
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
215
|
+
width: z.ZodNumber;
|
|
216
|
+
height: z.ZodNumber;
|
|
217
|
+
thumbhash: z.ZodString;
|
|
218
|
+
}, z.core.$strip>>;
|
|
219
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
220
|
+
t: z.ZodLiteral<"turn-start">;
|
|
221
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
222
|
+
t: z.ZodLiteral<"start">;
|
|
223
|
+
title: z.ZodOptional<z.ZodString>;
|
|
224
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
225
|
+
t: z.ZodLiteral<"turn-end">;
|
|
226
|
+
status: z.ZodEnum<{
|
|
227
|
+
completed: "completed";
|
|
228
|
+
failed: "failed";
|
|
229
|
+
cancelled: "cancelled";
|
|
230
|
+
}>;
|
|
231
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
232
|
+
t: z.ZodLiteral<"stop">;
|
|
233
|
+
}, z.core.$strip>], "t">;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
237
|
+
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
238
|
+
default: "default";
|
|
239
|
+
acceptEdits: "acceptEdits";
|
|
240
|
+
bypassPermissions: "bypassPermissions";
|
|
241
|
+
plan: "plan";
|
|
242
|
+
"read-only": "read-only";
|
|
243
|
+
"safe-yolo": "safe-yolo";
|
|
244
|
+
yolo: "yolo";
|
|
245
|
+
}>>;
|
|
246
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
247
|
+
fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
248
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
249
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
251
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
252
|
+
effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
253
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
254
|
+
}, z.core.$strip>>;
|
|
255
|
+
}, z.core.$strip>], "role">;
|
|
256
|
+
type MessageContent = z.infer<typeof MessageContentSchema>;
|
|
257
|
+
declare const VersionedEncryptedValueSchema: z.ZodObject<{
|
|
258
|
+
version: z.ZodNumber;
|
|
259
|
+
value: z.ZodString;
|
|
260
|
+
}, z.core.$strip>;
|
|
261
|
+
type VersionedEncryptedValue = z.infer<typeof VersionedEncryptedValueSchema>;
|
|
262
|
+
declare const VersionedNullableEncryptedValueSchema: z.ZodObject<{
|
|
263
|
+
version: z.ZodNumber;
|
|
264
|
+
value: z.ZodNullable<z.ZodString>;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
type VersionedNullableEncryptedValue = z.infer<typeof VersionedNullableEncryptedValueSchema>;
|
|
267
|
+
declare const UpdateNewMessageBodySchema: z.ZodObject<{
|
|
268
|
+
t: z.ZodLiteral<"new-message">;
|
|
269
|
+
sid: z.ZodString;
|
|
270
|
+
message: z.ZodObject<{
|
|
271
|
+
id: z.ZodString;
|
|
272
|
+
seq: z.ZodNumber;
|
|
273
|
+
localId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
274
|
+
content: z.ZodObject<{
|
|
275
|
+
c: z.ZodString;
|
|
276
|
+
t: z.ZodLiteral<"encrypted">;
|
|
277
|
+
}, z.core.$strip>;
|
|
278
|
+
createdAt: z.ZodNumber;
|
|
279
|
+
updatedAt: z.ZodNumber;
|
|
280
|
+
}, z.core.$strip>;
|
|
281
|
+
}, z.core.$strip>;
|
|
282
|
+
type UpdateNewMessageBody = z.infer<typeof UpdateNewMessageBodySchema>;
|
|
283
|
+
declare const UpdateSessionBodySchema: z.ZodObject<{
|
|
284
|
+
t: z.ZodLiteral<"update-session">;
|
|
285
|
+
id: z.ZodString;
|
|
286
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
287
|
+
version: z.ZodNumber;
|
|
288
|
+
value: z.ZodString;
|
|
289
|
+
}, z.core.$strip>>>;
|
|
290
|
+
agentState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
291
|
+
version: z.ZodNumber;
|
|
292
|
+
value: z.ZodNullable<z.ZodString>;
|
|
293
|
+
}, z.core.$strip>>>;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
type UpdateSessionBody = z.infer<typeof UpdateSessionBodySchema>;
|
|
296
|
+
declare const VersionedMachineEncryptedValueSchema: z.ZodObject<{
|
|
297
|
+
version: z.ZodNumber;
|
|
298
|
+
value: z.ZodString;
|
|
299
|
+
}, z.core.$strip>;
|
|
300
|
+
type VersionedMachineEncryptedValue = z.infer<typeof VersionedMachineEncryptedValueSchema>;
|
|
301
|
+
declare const UpdateMachineBodySchema: z.ZodObject<{
|
|
302
|
+
t: z.ZodLiteral<"update-machine">;
|
|
303
|
+
machineId: z.ZodString;
|
|
304
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
305
|
+
version: z.ZodNumber;
|
|
306
|
+
value: z.ZodString;
|
|
307
|
+
}, z.core.$strip>>>;
|
|
308
|
+
daemonState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
309
|
+
version: z.ZodNumber;
|
|
310
|
+
value: z.ZodString;
|
|
311
|
+
}, z.core.$strip>>>;
|
|
312
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
313
|
+
activeAt: z.ZodOptional<z.ZodNumber>;
|
|
314
|
+
}, z.core.$strip>;
|
|
315
|
+
type UpdateMachineBody = z.infer<typeof UpdateMachineBodySchema>;
|
|
316
|
+
declare const CoreUpdateBodySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
317
|
+
t: z.ZodLiteral<"new-message">;
|
|
318
|
+
sid: z.ZodString;
|
|
319
|
+
message: z.ZodObject<{
|
|
320
|
+
id: z.ZodString;
|
|
321
|
+
seq: z.ZodNumber;
|
|
322
|
+
localId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
323
|
+
content: z.ZodObject<{
|
|
324
|
+
c: z.ZodString;
|
|
325
|
+
t: z.ZodLiteral<"encrypted">;
|
|
326
|
+
}, z.core.$strip>;
|
|
327
|
+
createdAt: z.ZodNumber;
|
|
328
|
+
updatedAt: z.ZodNumber;
|
|
329
|
+
}, z.core.$strip>;
|
|
330
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
331
|
+
t: z.ZodLiteral<"update-session">;
|
|
332
|
+
id: z.ZodString;
|
|
333
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
334
|
+
version: z.ZodNumber;
|
|
335
|
+
value: z.ZodString;
|
|
336
|
+
}, z.core.$strip>>>;
|
|
337
|
+
agentState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
338
|
+
version: z.ZodNumber;
|
|
339
|
+
value: z.ZodNullable<z.ZodString>;
|
|
340
|
+
}, z.core.$strip>>>;
|
|
341
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
342
|
+
t: z.ZodLiteral<"update-machine">;
|
|
343
|
+
machineId: z.ZodString;
|
|
344
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
345
|
+
version: z.ZodNumber;
|
|
346
|
+
value: z.ZodString;
|
|
347
|
+
}, z.core.$strip>>>;
|
|
348
|
+
daemonState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
349
|
+
version: z.ZodNumber;
|
|
350
|
+
value: z.ZodString;
|
|
351
|
+
}, z.core.$strip>>>;
|
|
352
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
353
|
+
activeAt: z.ZodOptional<z.ZodNumber>;
|
|
354
|
+
}, z.core.$strip>], "t">;
|
|
355
|
+
type CoreUpdateBody = z.infer<typeof CoreUpdateBodySchema>;
|
|
356
|
+
declare const CoreUpdateContainerSchema: z.ZodObject<{
|
|
357
|
+
id: z.ZodString;
|
|
358
|
+
seq: z.ZodNumber;
|
|
359
|
+
body: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
360
|
+
t: z.ZodLiteral<"new-message">;
|
|
361
|
+
sid: z.ZodString;
|
|
362
|
+
message: z.ZodObject<{
|
|
363
|
+
id: z.ZodString;
|
|
364
|
+
seq: z.ZodNumber;
|
|
365
|
+
localId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
366
|
+
content: z.ZodObject<{
|
|
367
|
+
c: z.ZodString;
|
|
368
|
+
t: z.ZodLiteral<"encrypted">;
|
|
369
|
+
}, z.core.$strip>;
|
|
370
|
+
createdAt: z.ZodNumber;
|
|
371
|
+
updatedAt: z.ZodNumber;
|
|
372
|
+
}, z.core.$strip>;
|
|
373
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
374
|
+
t: z.ZodLiteral<"update-session">;
|
|
375
|
+
id: z.ZodString;
|
|
376
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
377
|
+
version: z.ZodNumber;
|
|
378
|
+
value: z.ZodString;
|
|
379
|
+
}, z.core.$strip>>>;
|
|
380
|
+
agentState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
381
|
+
version: z.ZodNumber;
|
|
382
|
+
value: z.ZodNullable<z.ZodString>;
|
|
383
|
+
}, z.core.$strip>>>;
|
|
384
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
385
|
+
t: z.ZodLiteral<"update-machine">;
|
|
386
|
+
machineId: z.ZodString;
|
|
387
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
388
|
+
version: z.ZodNumber;
|
|
389
|
+
value: z.ZodString;
|
|
390
|
+
}, z.core.$strip>>>;
|
|
391
|
+
daemonState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
392
|
+
version: z.ZodNumber;
|
|
393
|
+
value: z.ZodString;
|
|
394
|
+
}, z.core.$strip>>>;
|
|
395
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
396
|
+
activeAt: z.ZodOptional<z.ZodNumber>;
|
|
397
|
+
}, z.core.$strip>], "t">;
|
|
398
|
+
createdAt: z.ZodNumber;
|
|
399
|
+
}, z.core.$strip>;
|
|
400
|
+
type CoreUpdateContainer = z.infer<typeof CoreUpdateContainerSchema>;
|
|
401
|
+
declare const ApiMessageSchema: z.ZodObject<{
|
|
402
|
+
id: z.ZodString;
|
|
403
|
+
seq: z.ZodNumber;
|
|
404
|
+
localId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
405
|
+
content: z.ZodObject<{
|
|
406
|
+
c: z.ZodString;
|
|
407
|
+
t: z.ZodLiteral<"encrypted">;
|
|
408
|
+
}, z.core.$strip>;
|
|
409
|
+
createdAt: z.ZodNumber;
|
|
410
|
+
updatedAt: z.ZodNumber;
|
|
411
|
+
}, z.core.$strip>;
|
|
412
|
+
type ApiMessage = SessionMessage;
|
|
413
|
+
declare const ApiUpdateNewMessageSchema: z.ZodObject<{
|
|
414
|
+
t: z.ZodLiteral<"new-message">;
|
|
415
|
+
sid: z.ZodString;
|
|
416
|
+
message: z.ZodObject<{
|
|
417
|
+
id: z.ZodString;
|
|
418
|
+
seq: z.ZodNumber;
|
|
419
|
+
localId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
420
|
+
content: z.ZodObject<{
|
|
421
|
+
c: z.ZodString;
|
|
422
|
+
t: z.ZodLiteral<"encrypted">;
|
|
423
|
+
}, z.core.$strip>;
|
|
424
|
+
createdAt: z.ZodNumber;
|
|
425
|
+
updatedAt: z.ZodNumber;
|
|
426
|
+
}, z.core.$strip>;
|
|
427
|
+
}, z.core.$strip>;
|
|
428
|
+
type ApiUpdateNewMessage = UpdateNewMessageBody;
|
|
429
|
+
declare const ApiUpdateSessionStateSchema: z.ZodObject<{
|
|
430
|
+
t: z.ZodLiteral<"update-session">;
|
|
431
|
+
id: z.ZodString;
|
|
432
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
433
|
+
version: z.ZodNumber;
|
|
434
|
+
value: z.ZodString;
|
|
435
|
+
}, z.core.$strip>>>;
|
|
436
|
+
agentState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
437
|
+
version: z.ZodNumber;
|
|
438
|
+
value: z.ZodNullable<z.ZodString>;
|
|
439
|
+
}, z.core.$strip>>>;
|
|
440
|
+
}, z.core.$strip>;
|
|
441
|
+
type ApiUpdateSessionState = UpdateSessionBody;
|
|
442
|
+
declare const ApiUpdateMachineStateSchema: z.ZodObject<{
|
|
443
|
+
t: z.ZodLiteral<"update-machine">;
|
|
444
|
+
machineId: z.ZodString;
|
|
445
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
446
|
+
version: z.ZodNumber;
|
|
447
|
+
value: z.ZodString;
|
|
448
|
+
}, z.core.$strip>>>;
|
|
449
|
+
daemonState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
450
|
+
version: z.ZodNumber;
|
|
451
|
+
value: z.ZodString;
|
|
452
|
+
}, z.core.$strip>>>;
|
|
453
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
454
|
+
activeAt: z.ZodOptional<z.ZodNumber>;
|
|
455
|
+
}, z.core.$strip>;
|
|
456
|
+
type ApiUpdateMachineState = UpdateMachineBody;
|
|
457
|
+
declare const UpdateBodySchema: z.ZodObject<{
|
|
458
|
+
t: z.ZodLiteral<"new-message">;
|
|
459
|
+
sid: z.ZodString;
|
|
460
|
+
message: z.ZodObject<{
|
|
461
|
+
id: z.ZodString;
|
|
462
|
+
seq: z.ZodNumber;
|
|
463
|
+
localId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
464
|
+
content: z.ZodObject<{
|
|
465
|
+
c: z.ZodString;
|
|
466
|
+
t: z.ZodLiteral<"encrypted">;
|
|
467
|
+
}, z.core.$strip>;
|
|
468
|
+
createdAt: z.ZodNumber;
|
|
469
|
+
updatedAt: z.ZodNumber;
|
|
470
|
+
}, z.core.$strip>;
|
|
471
|
+
}, z.core.$strip>;
|
|
472
|
+
type UpdateBody = UpdateNewMessageBody;
|
|
473
|
+
declare const UpdateSchema: z.ZodObject<{
|
|
474
|
+
id: z.ZodString;
|
|
475
|
+
seq: z.ZodNumber;
|
|
476
|
+
body: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
477
|
+
t: z.ZodLiteral<"new-message">;
|
|
478
|
+
sid: z.ZodString;
|
|
479
|
+
message: z.ZodObject<{
|
|
480
|
+
id: z.ZodString;
|
|
481
|
+
seq: z.ZodNumber;
|
|
482
|
+
localId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
483
|
+
content: z.ZodObject<{
|
|
484
|
+
c: z.ZodString;
|
|
485
|
+
t: z.ZodLiteral<"encrypted">;
|
|
486
|
+
}, z.core.$strip>;
|
|
487
|
+
createdAt: z.ZodNumber;
|
|
488
|
+
updatedAt: z.ZodNumber;
|
|
489
|
+
}, z.core.$strip>;
|
|
490
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
491
|
+
t: z.ZodLiteral<"update-session">;
|
|
492
|
+
id: z.ZodString;
|
|
493
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
494
|
+
version: z.ZodNumber;
|
|
495
|
+
value: z.ZodString;
|
|
496
|
+
}, z.core.$strip>>>;
|
|
497
|
+
agentState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
498
|
+
version: z.ZodNumber;
|
|
499
|
+
value: z.ZodNullable<z.ZodString>;
|
|
500
|
+
}, z.core.$strip>>>;
|
|
501
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
502
|
+
t: z.ZodLiteral<"update-machine">;
|
|
503
|
+
machineId: z.ZodString;
|
|
504
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
505
|
+
version: z.ZodNumber;
|
|
506
|
+
value: z.ZodString;
|
|
507
|
+
}, z.core.$strip>>>;
|
|
508
|
+
daemonState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
509
|
+
version: z.ZodNumber;
|
|
510
|
+
value: z.ZodString;
|
|
511
|
+
}, z.core.$strip>>>;
|
|
512
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
513
|
+
activeAt: z.ZodOptional<z.ZodNumber>;
|
|
514
|
+
}, z.core.$strip>], "t">;
|
|
515
|
+
createdAt: z.ZodNumber;
|
|
516
|
+
}, z.core.$strip>;
|
|
517
|
+
type Update = CoreUpdateContainer;
|
|
518
|
+
|
|
519
|
+
declare const UserMessageSchema: z.ZodObject<{
|
|
520
|
+
role: z.ZodLiteral<"user">;
|
|
521
|
+
content: z.ZodObject<{
|
|
522
|
+
type: z.ZodLiteral<"text">;
|
|
523
|
+
text: z.ZodString;
|
|
524
|
+
}, z.core.$strip>;
|
|
525
|
+
localKey: z.ZodOptional<z.ZodString>;
|
|
526
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
527
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
528
|
+
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
529
|
+
default: "default";
|
|
530
|
+
acceptEdits: "acceptEdits";
|
|
531
|
+
bypassPermissions: "bypassPermissions";
|
|
532
|
+
plan: "plan";
|
|
533
|
+
"read-only": "read-only";
|
|
534
|
+
"safe-yolo": "safe-yolo";
|
|
535
|
+
yolo: "yolo";
|
|
536
|
+
}>>;
|
|
537
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
538
|
+
fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
539
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
540
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
541
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
542
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
543
|
+
effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
544
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
545
|
+
}, z.core.$strip>>;
|
|
546
|
+
}, z.core.$strip>;
|
|
547
|
+
type UserMessage = z.infer<typeof UserMessageSchema>;
|
|
548
|
+
declare const AgentMessageSchema: z.ZodObject<{
|
|
549
|
+
role: z.ZodLiteral<"agent">;
|
|
550
|
+
content: z.ZodObject<{
|
|
551
|
+
type: z.ZodString;
|
|
552
|
+
}, z.core.$loose>;
|
|
553
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
554
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
555
|
+
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
556
|
+
default: "default";
|
|
557
|
+
acceptEdits: "acceptEdits";
|
|
558
|
+
bypassPermissions: "bypassPermissions";
|
|
559
|
+
plan: "plan";
|
|
560
|
+
"read-only": "read-only";
|
|
561
|
+
"safe-yolo": "safe-yolo";
|
|
562
|
+
yolo: "yolo";
|
|
563
|
+
}>>;
|
|
564
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
565
|
+
fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
566
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
567
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
568
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
569
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
570
|
+
effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
571
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
572
|
+
}, z.core.$strip>>;
|
|
573
|
+
}, z.core.$strip>;
|
|
574
|
+
type AgentMessage = z.infer<typeof AgentMessageSchema>;
|
|
575
|
+
declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
576
|
+
role: z.ZodLiteral<"user">;
|
|
577
|
+
content: z.ZodObject<{
|
|
578
|
+
type: z.ZodLiteral<"text">;
|
|
579
|
+
text: z.ZodString;
|
|
580
|
+
}, z.core.$strip>;
|
|
581
|
+
localKey: z.ZodOptional<z.ZodString>;
|
|
582
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
583
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
584
|
+
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
585
|
+
default: "default";
|
|
586
|
+
acceptEdits: "acceptEdits";
|
|
587
|
+
bypassPermissions: "bypassPermissions";
|
|
588
|
+
plan: "plan";
|
|
589
|
+
"read-only": "read-only";
|
|
590
|
+
"safe-yolo": "safe-yolo";
|
|
591
|
+
yolo: "yolo";
|
|
592
|
+
}>>;
|
|
593
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
594
|
+
fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
595
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
596
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
597
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
598
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
599
|
+
effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
600
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
601
|
+
}, z.core.$strip>>;
|
|
602
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
603
|
+
role: z.ZodLiteral<"agent">;
|
|
604
|
+
content: z.ZodObject<{
|
|
605
|
+
type: z.ZodString;
|
|
606
|
+
}, z.core.$loose>;
|
|
607
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
608
|
+
sentFrom: z.ZodOptional<z.ZodString>;
|
|
609
|
+
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
610
|
+
default: "default";
|
|
611
|
+
acceptEdits: "acceptEdits";
|
|
612
|
+
bypassPermissions: "bypassPermissions";
|
|
613
|
+
plan: "plan";
|
|
614
|
+
"read-only": "read-only";
|
|
615
|
+
"safe-yolo": "safe-yolo";
|
|
616
|
+
yolo: "yolo";
|
|
617
|
+
}>>;
|
|
618
|
+
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
619
|
+
fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
620
|
+
customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
621
|
+
appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
622
|
+
allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
623
|
+
disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
624
|
+
effort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
625
|
+
displayText: z.ZodOptional<z.ZodString>;
|
|
626
|
+
}, z.core.$strip>>;
|
|
627
|
+
}, z.core.$strip>], "role">;
|
|
628
|
+
type LegacyMessageContent = z.infer<typeof LegacyMessageContentSchema>;
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* ⚠️ UNDER REVIEW — LIKELY NEEDS MORE CAREFUL DESIGN
|
|
632
|
+
*
|
|
633
|
+
* This session protocol is not used in production and should NOT be used in dev
|
|
634
|
+
* environments either until we revisit the design. The legacy protocol
|
|
635
|
+
* (role: 'user' / role: 'agent') is the active code path everywhere.
|
|
636
|
+
*
|
|
637
|
+
* Before investing more here, look at how pi.dev standardizes their agent
|
|
638
|
+
* protocol — we may want to align with or build on that approach instead of
|
|
639
|
+
* rolling our own envelope format.
|
|
640
|
+
*
|
|
641
|
+
* Types are kept here for reference but are frozen. Do not add new consumers.
|
|
642
|
+
*/
|
|
643
|
+
|
|
644
|
+
declare const sessionRoleSchema: z.ZodEnum<{
|
|
645
|
+
user: "user";
|
|
646
|
+
agent: "agent";
|
|
647
|
+
}>;
|
|
648
|
+
type SessionRole = z.infer<typeof sessionRoleSchema>;
|
|
649
|
+
declare const sessionTextEventSchema: z.ZodObject<{
|
|
650
|
+
t: z.ZodLiteral<"text">;
|
|
651
|
+
text: z.ZodString;
|
|
652
|
+
thinking: z.ZodOptional<z.ZodBoolean>;
|
|
653
|
+
}, z.core.$strip>;
|
|
654
|
+
declare const sessionServiceMessageEventSchema: z.ZodObject<{
|
|
655
|
+
t: z.ZodLiteral<"service">;
|
|
656
|
+
text: z.ZodString;
|
|
657
|
+
}, z.core.$strip>;
|
|
658
|
+
declare const sessionToolCallStartEventSchema: z.ZodObject<{
|
|
659
|
+
t: z.ZodLiteral<"tool-call-start">;
|
|
660
|
+
call: z.ZodString;
|
|
661
|
+
name: z.ZodString;
|
|
662
|
+
title: z.ZodString;
|
|
663
|
+
description: z.ZodString;
|
|
664
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
665
|
+
}, z.core.$strip>;
|
|
666
|
+
declare const sessionToolCallEndEventSchema: z.ZodObject<{
|
|
667
|
+
t: z.ZodLiteral<"tool-call-end">;
|
|
668
|
+
call: z.ZodString;
|
|
669
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
670
|
+
isError: z.ZodOptional<z.ZodBoolean>;
|
|
671
|
+
}, z.core.$strip>;
|
|
672
|
+
declare const sessionFileEventSchema: z.ZodObject<{
|
|
673
|
+
t: z.ZodLiteral<"file">;
|
|
674
|
+
ref: z.ZodString;
|
|
675
|
+
name: z.ZodString;
|
|
676
|
+
size: z.ZodNumber;
|
|
677
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
678
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
679
|
+
width: z.ZodNumber;
|
|
680
|
+
height: z.ZodNumber;
|
|
681
|
+
thumbhash: z.ZodString;
|
|
682
|
+
}, z.core.$strip>>;
|
|
683
|
+
}, z.core.$strip>;
|
|
684
|
+
declare const sessionTurnStartEventSchema: z.ZodObject<{
|
|
685
|
+
t: z.ZodLiteral<"turn-start">;
|
|
686
|
+
}, z.core.$strip>;
|
|
687
|
+
declare const sessionStartEventSchema: z.ZodObject<{
|
|
688
|
+
t: z.ZodLiteral<"start">;
|
|
689
|
+
title: z.ZodOptional<z.ZodString>;
|
|
690
|
+
}, z.core.$strip>;
|
|
691
|
+
declare const sessionTurnEndStatusSchema: z.ZodEnum<{
|
|
692
|
+
completed: "completed";
|
|
693
|
+
failed: "failed";
|
|
694
|
+
cancelled: "cancelled";
|
|
695
|
+
}>;
|
|
696
|
+
type SessionTurnEndStatus = z.infer<typeof sessionTurnEndStatusSchema>;
|
|
697
|
+
declare const sessionTurnEndEventSchema: z.ZodObject<{
|
|
698
|
+
t: z.ZodLiteral<"turn-end">;
|
|
699
|
+
status: z.ZodEnum<{
|
|
700
|
+
completed: "completed";
|
|
701
|
+
failed: "failed";
|
|
702
|
+
cancelled: "cancelled";
|
|
703
|
+
}>;
|
|
704
|
+
}, z.core.$strip>;
|
|
705
|
+
declare const sessionStopEventSchema: z.ZodObject<{
|
|
706
|
+
t: z.ZodLiteral<"stop">;
|
|
707
|
+
}, z.core.$strip>;
|
|
708
|
+
declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
709
|
+
t: z.ZodLiteral<"text">;
|
|
710
|
+
text: z.ZodString;
|
|
711
|
+
thinking: z.ZodOptional<z.ZodBoolean>;
|
|
712
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
713
|
+
t: z.ZodLiteral<"service">;
|
|
714
|
+
text: z.ZodString;
|
|
715
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
716
|
+
t: z.ZodLiteral<"tool-call-start">;
|
|
717
|
+
call: z.ZodString;
|
|
718
|
+
name: z.ZodString;
|
|
719
|
+
title: z.ZodString;
|
|
720
|
+
description: z.ZodString;
|
|
721
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
722
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
723
|
+
t: z.ZodLiteral<"tool-call-end">;
|
|
724
|
+
call: z.ZodString;
|
|
725
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
726
|
+
isError: z.ZodOptional<z.ZodBoolean>;
|
|
727
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
728
|
+
t: z.ZodLiteral<"file">;
|
|
729
|
+
ref: z.ZodString;
|
|
730
|
+
name: z.ZodString;
|
|
731
|
+
size: z.ZodNumber;
|
|
732
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
733
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
734
|
+
width: z.ZodNumber;
|
|
735
|
+
height: z.ZodNumber;
|
|
736
|
+
thumbhash: z.ZodString;
|
|
737
|
+
}, z.core.$strip>>;
|
|
738
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
739
|
+
t: z.ZodLiteral<"turn-start">;
|
|
740
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
741
|
+
t: z.ZodLiteral<"start">;
|
|
742
|
+
title: z.ZodOptional<z.ZodString>;
|
|
743
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
744
|
+
t: z.ZodLiteral<"turn-end">;
|
|
745
|
+
status: z.ZodEnum<{
|
|
746
|
+
completed: "completed";
|
|
747
|
+
failed: "failed";
|
|
748
|
+
cancelled: "cancelled";
|
|
749
|
+
}>;
|
|
750
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
751
|
+
t: z.ZodLiteral<"stop">;
|
|
752
|
+
}, z.core.$strip>], "t">;
|
|
753
|
+
type SessionEvent = z.infer<typeof sessionEventSchema>;
|
|
754
|
+
declare const sessionEnvelopeSchema: z.ZodObject<{
|
|
755
|
+
id: z.ZodString;
|
|
756
|
+
time: z.ZodNumber;
|
|
757
|
+
role: z.ZodEnum<{
|
|
758
|
+
user: "user";
|
|
759
|
+
agent: "agent";
|
|
760
|
+
}>;
|
|
761
|
+
turn: z.ZodOptional<z.ZodString>;
|
|
762
|
+
subagent: z.ZodOptional<z.ZodString>;
|
|
763
|
+
claudeUuid: z.ZodOptional<z.ZodString>;
|
|
764
|
+
codexItemId: z.ZodOptional<z.ZodString>;
|
|
765
|
+
ev: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
766
|
+
t: z.ZodLiteral<"text">;
|
|
767
|
+
text: z.ZodString;
|
|
768
|
+
thinking: z.ZodOptional<z.ZodBoolean>;
|
|
769
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
770
|
+
t: z.ZodLiteral<"service">;
|
|
771
|
+
text: z.ZodString;
|
|
772
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
773
|
+
t: z.ZodLiteral<"tool-call-start">;
|
|
774
|
+
call: z.ZodString;
|
|
775
|
+
name: z.ZodString;
|
|
776
|
+
title: z.ZodString;
|
|
777
|
+
description: z.ZodString;
|
|
778
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
779
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
780
|
+
t: z.ZodLiteral<"tool-call-end">;
|
|
781
|
+
call: z.ZodString;
|
|
782
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
783
|
+
isError: z.ZodOptional<z.ZodBoolean>;
|
|
784
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
785
|
+
t: z.ZodLiteral<"file">;
|
|
786
|
+
ref: z.ZodString;
|
|
787
|
+
name: z.ZodString;
|
|
788
|
+
size: z.ZodNumber;
|
|
789
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
790
|
+
image: z.ZodOptional<z.ZodObject<{
|
|
791
|
+
width: z.ZodNumber;
|
|
792
|
+
height: z.ZodNumber;
|
|
793
|
+
thumbhash: z.ZodString;
|
|
794
|
+
}, z.core.$strip>>;
|
|
795
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
796
|
+
t: z.ZodLiteral<"turn-start">;
|
|
797
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
798
|
+
t: z.ZodLiteral<"start">;
|
|
799
|
+
title: z.ZodOptional<z.ZodString>;
|
|
800
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
801
|
+
t: z.ZodLiteral<"turn-end">;
|
|
802
|
+
status: z.ZodEnum<{
|
|
803
|
+
completed: "completed";
|
|
804
|
+
failed: "failed";
|
|
805
|
+
cancelled: "cancelled";
|
|
806
|
+
}>;
|
|
807
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
808
|
+
t: z.ZodLiteral<"stop">;
|
|
809
|
+
}, z.core.$strip>], "t">;
|
|
810
|
+
}, z.core.$strip>;
|
|
811
|
+
type SessionEnvelope = z.infer<typeof sessionEnvelopeSchema>;
|
|
812
|
+
type CreateEnvelopeOptions = {
|
|
813
|
+
id?: string;
|
|
814
|
+
time?: number;
|
|
815
|
+
turn?: string;
|
|
816
|
+
subagent?: string;
|
|
817
|
+
claudeUuid?: string;
|
|
818
|
+
codexItemId?: string;
|
|
819
|
+
};
|
|
820
|
+
declare function createEnvelope(role: SessionRole, ev: SessionEvent, opts?: CreateEnvelopeOptions): SessionEnvelope;
|
|
821
|
+
|
|
822
|
+
declare const VoiceConversationGrantedSchema: z.ZodObject<{
|
|
823
|
+
allowed: z.ZodLiteral<true>;
|
|
824
|
+
conversationToken: z.ZodString;
|
|
825
|
+
conversationId: z.ZodString;
|
|
826
|
+
agentId: z.ZodString;
|
|
827
|
+
elevenUserId: z.ZodString;
|
|
828
|
+
usedSeconds: z.ZodNumber;
|
|
829
|
+
limitSeconds: z.ZodNumber;
|
|
830
|
+
}, z.core.$strip>;
|
|
831
|
+
declare const VoiceConversationDeniedSchema: z.ZodObject<{
|
|
832
|
+
allowed: z.ZodLiteral<false>;
|
|
833
|
+
reason: z.ZodEnum<{
|
|
834
|
+
voice_hard_limit_reached: "voice_hard_limit_reached";
|
|
835
|
+
subscription_required: "subscription_required";
|
|
836
|
+
voice_conversation_limit_reached: "voice_conversation_limit_reached";
|
|
837
|
+
}>;
|
|
838
|
+
usedSeconds: z.ZodNumber;
|
|
839
|
+
limitSeconds: z.ZodNumber;
|
|
840
|
+
agentId: z.ZodString;
|
|
841
|
+
}, z.core.$strip>;
|
|
842
|
+
declare const VoiceConversationResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
843
|
+
allowed: z.ZodLiteral<true>;
|
|
844
|
+
conversationToken: z.ZodString;
|
|
845
|
+
conversationId: z.ZodString;
|
|
846
|
+
agentId: z.ZodString;
|
|
847
|
+
elevenUserId: z.ZodString;
|
|
848
|
+
usedSeconds: z.ZodNumber;
|
|
849
|
+
limitSeconds: z.ZodNumber;
|
|
850
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
851
|
+
allowed: z.ZodLiteral<false>;
|
|
852
|
+
reason: z.ZodEnum<{
|
|
853
|
+
voice_hard_limit_reached: "voice_hard_limit_reached";
|
|
854
|
+
subscription_required: "subscription_required";
|
|
855
|
+
voice_conversation_limit_reached: "voice_conversation_limit_reached";
|
|
856
|
+
}>;
|
|
857
|
+
usedSeconds: z.ZodNumber;
|
|
858
|
+
limitSeconds: z.ZodNumber;
|
|
859
|
+
agentId: z.ZodString;
|
|
860
|
+
}, z.core.$strip>], "allowed">;
|
|
861
|
+
type VoiceConversationResponse = z.infer<typeof VoiceConversationResponseSchema>;
|
|
862
|
+
declare const VoiceUsageResponseSchema: z.ZodObject<{
|
|
863
|
+
usedSeconds: z.ZodNumber;
|
|
864
|
+
limitSeconds: z.ZodNumber;
|
|
865
|
+
conversationCount: z.ZodNumber;
|
|
866
|
+
conversationLimit: z.ZodNumber;
|
|
867
|
+
elevenUserId: z.ZodString;
|
|
868
|
+
}, z.core.$strip>;
|
|
869
|
+
type VoiceUsageResponse = z.infer<typeof VoiceUsageResponseSchema>;
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Protocol compatibility only. These values never name the Talos product in UI.
|
|
873
|
+
* Domain separation is part of the encryption format, not a branding setting.
|
|
874
|
+
* Changing any context makes previously encrypted accounts/attachments unreadable.
|
|
875
|
+
*/
|
|
876
|
+
declare const encryptionContexts: {
|
|
877
|
+
readonly content: "Happy EnCoder";
|
|
878
|
+
readonly analytics: "Happy Coder";
|
|
879
|
+
readonly blobs: "Happy Blobs";
|
|
880
|
+
readonly serverTokens: "happy-server-tokens";
|
|
881
|
+
};
|
|
882
|
+
/** Used only when the user explicitly selects a relay that predates the identity endpoint. */
|
|
883
|
+
declare const legacyServerBanner = "Welcome to Happy Server!";
|
|
884
|
+
/** Authentication token domains are also protocol constants, including OAuth state. */
|
|
885
|
+
declare const authenticationContexts: {
|
|
886
|
+
readonly persistent: "handy";
|
|
887
|
+
readonly github: "github-happy";
|
|
888
|
+
};
|
|
889
|
+
/** Machine RPC names are deployed protocol identifiers, independent of product labels. */
|
|
890
|
+
declare const rpcMethods: {
|
|
891
|
+
readonly spawnSession: "spawn-happy-session";
|
|
892
|
+
readonly resumeSession: "resume-happy-session";
|
|
893
|
+
};
|
|
894
|
+
/** Read only when the user explicitly requests a local account migration. */
|
|
895
|
+
declare const legacyInstallation: {
|
|
896
|
+
readonly accountLinkPrefix: "happy:///account?";
|
|
897
|
+
readonly homeDirectory: ".happy";
|
|
898
|
+
readonly homeEnvironment: "HAPPY_HOME_DIR";
|
|
899
|
+
readonly serverEnvironment: "HAPPY_SERVER_URL";
|
|
900
|
+
readonly webappEnvironment: "HAPPY_WEBAPP_URL";
|
|
901
|
+
readonly defaultServerUrl: "https://api.happy.ahposten.com";
|
|
902
|
+
readonly defaultWebappUrl: "https://app.happy.engineering";
|
|
903
|
+
};
|
|
904
|
+
/** Normalize known metadata fields only; never rewrite conversation content or paths. */
|
|
905
|
+
declare function normalizeMetadata<T>(value: T): T;
|
|
906
|
+
/** Include wire aliases so accounts explicitly shared with an earlier client remain usable. */
|
|
907
|
+
declare function toWireMetadata<T>(value: T): T;
|
|
908
|
+
|
|
909
|
+
export { AgentMessageSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, LegacyMessageContentSchema, MessageContentSchema, MessageMetaSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, UpdateBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceConversationDeniedSchema, VoiceConversationGrantedSchema, VoiceConversationResponseSchema, VoiceUsageResponseSchema, authenticationContexts, createEnvelope, encryptionContexts, legacyInstallation, legacyServerBanner, normalizeMetadata, rpcMethods, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStopEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, toWireMetadata };
|
|
910
|
+
export type { AgentMessage, ApiMessage, ApiUpdateMachineState, ApiUpdateNewMessage, ApiUpdateSessionState, CoreUpdateBody, CoreUpdateContainer, CreateEnvelopeOptions, LegacyMessageContent, MessageContent, MessageMeta, SessionEnvelope, SessionEvent, SessionMessage, SessionMessageContent, SessionProtocolMessage, SessionRole, SessionTurnEndStatus, Update, UpdateBody, UpdateMachineBody, UpdateNewMessageBody, UpdateSessionBody, UserMessage, VersionedEncryptedValue, VersionedMachineEncryptedValue, VersionedNullableEncryptedValue, VoiceConversationResponse, VoiceUsageResponse };
|