@agentuity/core 2.0.9 → 2.0.11

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 (62) hide show
  1. package/dist/services/coder/agents.d.ts +170 -0
  2. package/dist/services/coder/agents.d.ts.map +1 -0
  3. package/dist/services/coder/agents.js +77 -0
  4. package/dist/services/coder/agents.js.map +1 -0
  5. package/dist/services/coder/api-reference.d.ts.map +1 -1
  6. package/dist/services/coder/api-reference.js +393 -41
  7. package/dist/services/coder/api-reference.js.map +1 -1
  8. package/dist/services/coder/client.d.ts +44 -2
  9. package/dist/services/coder/client.d.ts.map +1 -1
  10. package/dist/services/coder/client.js +89 -3
  11. package/dist/services/coder/client.js.map +1 -1
  12. package/dist/services/coder/close-codes.d.ts +76 -0
  13. package/dist/services/coder/close-codes.d.ts.map +1 -0
  14. package/dist/services/coder/close-codes.js +77 -0
  15. package/dist/services/coder/close-codes.js.map +1 -0
  16. package/dist/services/coder/discover.d.ts +1 -1
  17. package/dist/services/coder/discover.js +2 -2
  18. package/dist/services/coder/discover.js.map +1 -1
  19. package/dist/services/coder/index.d.ts +9 -2
  20. package/dist/services/coder/index.d.ts.map +1 -1
  21. package/dist/services/coder/index.js +6 -1
  22. package/dist/services/coder/index.js.map +1 -1
  23. package/dist/services/coder/protocol.d.ts +1855 -0
  24. package/dist/services/coder/protocol.d.ts.map +1 -0
  25. package/dist/services/coder/protocol.js +976 -0
  26. package/dist/services/coder/protocol.js.map +1 -0
  27. package/dist/services/coder/sessions.d.ts +9 -0
  28. package/dist/services/coder/sessions.d.ts.map +1 -1
  29. package/dist/services/coder/sessions.js +30 -6
  30. package/dist/services/coder/sessions.js.map +1 -1
  31. package/dist/services/coder/sse.d.ts +255 -0
  32. package/dist/services/coder/sse.d.ts.map +1 -0
  33. package/dist/services/coder/sse.js +676 -0
  34. package/dist/services/coder/sse.js.map +1 -0
  35. package/dist/services/coder/types.d.ts +1013 -0
  36. package/dist/services/coder/types.d.ts.map +1 -1
  37. package/dist/services/coder/types.js +215 -1
  38. package/dist/services/coder/types.js.map +1 -1
  39. package/dist/services/coder/websocket.d.ts +346 -0
  40. package/dist/services/coder/websocket.d.ts.map +1 -0
  41. package/dist/services/coder/websocket.js +791 -0
  42. package/dist/services/coder/websocket.js.map +1 -0
  43. package/dist/services/oauth/types.d.ts +10 -0
  44. package/dist/services/oauth/types.d.ts.map +1 -1
  45. package/dist/services/oauth/types.js +3 -0
  46. package/dist/services/oauth/types.js.map +1 -1
  47. package/dist/services/project/deploy.d.ts +1 -1
  48. package/dist/services/sandbox/run.d.ts +2 -2
  49. package/dist/services/sandbox/types.d.ts +2 -2
  50. package/package.json +2 -2
  51. package/src/services/coder/agents.ts +148 -0
  52. package/src/services/coder/api-reference.ts +411 -45
  53. package/src/services/coder/client.ts +133 -2
  54. package/src/services/coder/close-codes.ts +83 -0
  55. package/src/services/coder/discover.ts +2 -2
  56. package/src/services/coder/index.ts +29 -1
  57. package/src/services/coder/protocol.ts +1200 -0
  58. package/src/services/coder/sessions.ts +40 -10
  59. package/src/services/coder/sse.ts +796 -0
  60. package/src/services/coder/types.ts +249 -1
  61. package/src/services/coder/websocket.ts +943 -0
  62. package/src/services/oauth/types.ts +3 -0
@@ -0,0 +1,1855 @@
1
+ /**
2
+ * Protocol message types for Coder Hub WebSocket and SSE communication.
3
+ *
4
+ * This module defines all message types exchanged between clients and the
5
+ * Coder Hub server. Messages are validated using Zod schemas for type safety.
6
+ *
7
+ * @module coder/protocol
8
+ *
9
+ * @example Parsing server messages
10
+ * ```typescript
11
+ * import { parseServerMessage, type ServerMessage } from '@agentuity/core/coder';
12
+ *
13
+ * const raw = JSON.parse(websocketData);
14
+ * const message = parseServerMessage(raw);
15
+ * if (message?.type === 'broadcast') {
16
+ * console.log('Event:', message.event);
17
+ * }
18
+ * ```
19
+ */
20
+ import { z } from 'zod/v4';
21
+ /** Connection role assigned by the server in the init message */
22
+ export declare const CoderHubInitRoleSchema: z.ZodEnum<{
23
+ lead: "lead";
24
+ sub_agent: "sub_agent";
25
+ controller: "controller";
26
+ }>;
27
+ export type CoderHubInitRole = z.infer<typeof CoderHubInitRoleSchema>;
28
+ /** Tool definition provided by the server to clients */
29
+ export declare const CoderHubToolDefinitionSchema: z.ZodObject<{
30
+ name: z.ZodString;
31
+ label: z.ZodString;
32
+ description: z.ZodString;
33
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
34
+ promptSnippet: z.ZodOptional<z.ZodString>;
35
+ promptGuidelines: z.ZodOptional<z.ZodString>;
36
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
37
+ }, z.core.$strip>;
38
+ export type CoderHubToolDefinition = z.infer<typeof CoderHubToolDefinitionSchema>;
39
+ export declare const CoderHubCommandDefinitionSchema: z.ZodObject<{
40
+ name: z.ZodString;
41
+ description: z.ZodString;
42
+ }, z.core.$strip>;
43
+ export type CoderHubCommandDefinition = z.infer<typeof CoderHubCommandDefinitionSchema>;
44
+ export declare const AgentDefinitionSchema: z.ZodObject<{
45
+ name: z.ZodString;
46
+ displayName: z.ZodOptional<z.ZodString>;
47
+ description: z.ZodString;
48
+ systemPrompt: z.ZodString;
49
+ model: z.ZodOptional<z.ZodString>;
50
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
51
+ temperature: z.ZodOptional<z.ZodNumber>;
52
+ thinkingLevel: z.ZodOptional<z.ZodString>;
53
+ readOnly: z.ZodOptional<z.ZodBoolean>;
54
+ hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
55
+ name: z.ZodString;
56
+ label: z.ZodString;
57
+ description: z.ZodString;
58
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
59
+ promptSnippet: z.ZodOptional<z.ZodString>;
60
+ promptGuidelines: z.ZodOptional<z.ZodString>;
61
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
62
+ }, z.core.$strip>>>;
63
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ status: z.ZodOptional<z.ZodEnum<{
65
+ available: "available";
66
+ busy: "busy";
67
+ offline: "offline";
68
+ }>>;
69
+ }, z.core.$strip>;
70
+ export type AgentDefinition = z.infer<typeof AgentDefinitionSchema>;
71
+ export declare const CoderHubConfigSchema: z.ZodObject<{
72
+ systemPromptPrefix: z.ZodOptional<z.ZodString>;
73
+ systemPromptSuffix: z.ZodOptional<z.ZodString>;
74
+ }, z.core.$strip>;
75
+ export type CoderHubConfig = z.infer<typeof CoderHubConfigSchema>;
76
+ export declare const CoderHubLeadResumeDescriptorSchema: z.ZodObject<{
77
+ sessionFile: z.ZodString;
78
+ piSessionId: z.ZodOptional<z.ZodString>;
79
+ cwd: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strip>;
81
+ export type CoderHubLeadResumeDescriptor = z.infer<typeof CoderHubLeadResumeDescriptorSchema>;
82
+ export declare const CoderHubLeadInitMessageSchema: z.ZodObject<{
83
+ type: z.ZodLiteral<"init">;
84
+ sessionId: z.ZodOptional<z.ZodString>;
85
+ resume: z.ZodOptional<z.ZodObject<{
86
+ sessionFile: z.ZodString;
87
+ piSessionId: z.ZodOptional<z.ZodString>;
88
+ cwd: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strip>>;
90
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
91
+ name: z.ZodString;
92
+ label: z.ZodString;
93
+ description: z.ZodString;
94
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
95
+ promptSnippet: z.ZodOptional<z.ZodString>;
96
+ promptGuidelines: z.ZodOptional<z.ZodString>;
97
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
98
+ }, z.core.$strip>>>;
99
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
100
+ name: z.ZodString;
101
+ description: z.ZodString;
102
+ }, z.core.$strip>>>;
103
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
104
+ name: z.ZodString;
105
+ displayName: z.ZodOptional<z.ZodString>;
106
+ description: z.ZodString;
107
+ systemPrompt: z.ZodString;
108
+ model: z.ZodOptional<z.ZodString>;
109
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
110
+ temperature: z.ZodOptional<z.ZodNumber>;
111
+ thinkingLevel: z.ZodOptional<z.ZodString>;
112
+ readOnly: z.ZodOptional<z.ZodBoolean>;
113
+ hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
114
+ name: z.ZodString;
115
+ label: z.ZodString;
116
+ description: z.ZodString;
117
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
118
+ promptSnippet: z.ZodOptional<z.ZodString>;
119
+ promptGuidelines: z.ZodOptional<z.ZodString>;
120
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
121
+ }, z.core.$strip>>>;
122
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
+ status: z.ZodOptional<z.ZodEnum<{
124
+ available: "available";
125
+ busy: "busy";
126
+ offline: "offline";
127
+ }>>;
128
+ }, z.core.$strip>>>;
129
+ config: z.ZodOptional<z.ZodObject<{
130
+ systemPromptPrefix: z.ZodOptional<z.ZodString>;
131
+ systemPromptSuffix: z.ZodOptional<z.ZodString>;
132
+ }, z.core.$strip>>;
133
+ model: z.ZodOptional<z.ZodObject<{
134
+ provider: z.ZodString;
135
+ id: z.ZodString;
136
+ }, z.core.$strip>>;
137
+ thinkingLevel: z.ZodOptional<z.ZodString>;
138
+ task: z.ZodOptional<z.ZodString>;
139
+ agentRole: z.ZodOptional<z.ZodString>;
140
+ role: z.ZodLiteral<"lead">;
141
+ }, z.core.$strip>;
142
+ export type CoderHubLeadInitMessage = z.infer<typeof CoderHubLeadInitMessageSchema>;
143
+ export declare const CoderHubSubAgentInitMessageSchema: z.ZodObject<{
144
+ type: z.ZodLiteral<"init">;
145
+ sessionId: z.ZodOptional<z.ZodString>;
146
+ resume: z.ZodOptional<z.ZodObject<{
147
+ sessionFile: z.ZodString;
148
+ piSessionId: z.ZodOptional<z.ZodString>;
149
+ cwd: z.ZodOptional<z.ZodString>;
150
+ }, z.core.$strip>>;
151
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
152
+ name: z.ZodString;
153
+ label: z.ZodString;
154
+ description: z.ZodString;
155
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
156
+ promptSnippet: z.ZodOptional<z.ZodString>;
157
+ promptGuidelines: z.ZodOptional<z.ZodString>;
158
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
159
+ }, z.core.$strip>>>;
160
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
161
+ name: z.ZodString;
162
+ description: z.ZodString;
163
+ }, z.core.$strip>>>;
164
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
165
+ name: z.ZodString;
166
+ displayName: z.ZodOptional<z.ZodString>;
167
+ description: z.ZodString;
168
+ systemPrompt: z.ZodString;
169
+ model: z.ZodOptional<z.ZodString>;
170
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
171
+ temperature: z.ZodOptional<z.ZodNumber>;
172
+ thinkingLevel: z.ZodOptional<z.ZodString>;
173
+ readOnly: z.ZodOptional<z.ZodBoolean>;
174
+ hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
175
+ name: z.ZodString;
176
+ label: z.ZodString;
177
+ description: z.ZodString;
178
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
179
+ promptSnippet: z.ZodOptional<z.ZodString>;
180
+ promptGuidelines: z.ZodOptional<z.ZodString>;
181
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
182
+ }, z.core.$strip>>>;
183
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
184
+ status: z.ZodOptional<z.ZodEnum<{
185
+ available: "available";
186
+ busy: "busy";
187
+ offline: "offline";
188
+ }>>;
189
+ }, z.core.$strip>>>;
190
+ config: z.ZodOptional<z.ZodObject<{
191
+ systemPromptPrefix: z.ZodOptional<z.ZodString>;
192
+ systemPromptSuffix: z.ZodOptional<z.ZodString>;
193
+ }, z.core.$strip>>;
194
+ model: z.ZodOptional<z.ZodObject<{
195
+ provider: z.ZodString;
196
+ id: z.ZodString;
197
+ }, z.core.$strip>>;
198
+ thinkingLevel: z.ZodOptional<z.ZodString>;
199
+ task: z.ZodOptional<z.ZodString>;
200
+ agentRole: z.ZodOptional<z.ZodString>;
201
+ role: z.ZodLiteral<"sub_agent">;
202
+ }, z.core.$strip>;
203
+ export type CoderHubSubAgentInitMessage = z.infer<typeof CoderHubSubAgentInitMessageSchema>;
204
+ export declare const CoderHubControllerInitMessageSchema: z.ZodObject<{
205
+ type: z.ZodLiteral<"init">;
206
+ sessionId: z.ZodOptional<z.ZodString>;
207
+ resume: z.ZodOptional<z.ZodObject<{
208
+ sessionFile: z.ZodString;
209
+ piSessionId: z.ZodOptional<z.ZodString>;
210
+ cwd: z.ZodOptional<z.ZodString>;
211
+ }, z.core.$strip>>;
212
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
213
+ name: z.ZodString;
214
+ label: z.ZodString;
215
+ description: z.ZodString;
216
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
217
+ promptSnippet: z.ZodOptional<z.ZodString>;
218
+ promptGuidelines: z.ZodOptional<z.ZodString>;
219
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
220
+ }, z.core.$strip>>>;
221
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
222
+ name: z.ZodString;
223
+ description: z.ZodString;
224
+ }, z.core.$strip>>>;
225
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
226
+ name: z.ZodString;
227
+ displayName: z.ZodOptional<z.ZodString>;
228
+ description: z.ZodString;
229
+ systemPrompt: z.ZodString;
230
+ model: z.ZodOptional<z.ZodString>;
231
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
232
+ temperature: z.ZodOptional<z.ZodNumber>;
233
+ thinkingLevel: z.ZodOptional<z.ZodString>;
234
+ readOnly: z.ZodOptional<z.ZodBoolean>;
235
+ hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
236
+ name: z.ZodString;
237
+ label: z.ZodString;
238
+ description: z.ZodString;
239
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
240
+ promptSnippet: z.ZodOptional<z.ZodString>;
241
+ promptGuidelines: z.ZodOptional<z.ZodString>;
242
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
243
+ }, z.core.$strip>>>;
244
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
245
+ status: z.ZodOptional<z.ZodEnum<{
246
+ available: "available";
247
+ busy: "busy";
248
+ offline: "offline";
249
+ }>>;
250
+ }, z.core.$strip>>>;
251
+ config: z.ZodOptional<z.ZodObject<{
252
+ systemPromptPrefix: z.ZodOptional<z.ZodString>;
253
+ systemPromptSuffix: z.ZodOptional<z.ZodString>;
254
+ }, z.core.$strip>>;
255
+ model: z.ZodOptional<z.ZodObject<{
256
+ provider: z.ZodString;
257
+ id: z.ZodString;
258
+ }, z.core.$strip>>;
259
+ thinkingLevel: z.ZodOptional<z.ZodString>;
260
+ task: z.ZodOptional<z.ZodString>;
261
+ agentRole: z.ZodOptional<z.ZodString>;
262
+ role: z.ZodLiteral<"controller">;
263
+ }, z.core.$strip>;
264
+ export type CoderHubControllerInitMessage = z.infer<typeof CoderHubControllerInitMessageSchema>;
265
+ export declare const CoderHubInitMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
266
+ type: z.ZodLiteral<"init">;
267
+ sessionId: z.ZodOptional<z.ZodString>;
268
+ resume: z.ZodOptional<z.ZodObject<{
269
+ sessionFile: z.ZodString;
270
+ piSessionId: z.ZodOptional<z.ZodString>;
271
+ cwd: z.ZodOptional<z.ZodString>;
272
+ }, z.core.$strip>>;
273
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
274
+ name: z.ZodString;
275
+ label: z.ZodString;
276
+ description: z.ZodString;
277
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
278
+ promptSnippet: z.ZodOptional<z.ZodString>;
279
+ promptGuidelines: z.ZodOptional<z.ZodString>;
280
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
281
+ }, z.core.$strip>>>;
282
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
283
+ name: z.ZodString;
284
+ description: z.ZodString;
285
+ }, z.core.$strip>>>;
286
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
287
+ name: z.ZodString;
288
+ displayName: z.ZodOptional<z.ZodString>;
289
+ description: z.ZodString;
290
+ systemPrompt: z.ZodString;
291
+ model: z.ZodOptional<z.ZodString>;
292
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
293
+ temperature: z.ZodOptional<z.ZodNumber>;
294
+ thinkingLevel: z.ZodOptional<z.ZodString>;
295
+ readOnly: z.ZodOptional<z.ZodBoolean>;
296
+ hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
297
+ name: z.ZodString;
298
+ label: z.ZodString;
299
+ description: z.ZodString;
300
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
301
+ promptSnippet: z.ZodOptional<z.ZodString>;
302
+ promptGuidelines: z.ZodOptional<z.ZodString>;
303
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
304
+ }, z.core.$strip>>>;
305
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
306
+ status: z.ZodOptional<z.ZodEnum<{
307
+ available: "available";
308
+ busy: "busy";
309
+ offline: "offline";
310
+ }>>;
311
+ }, z.core.$strip>>>;
312
+ config: z.ZodOptional<z.ZodObject<{
313
+ systemPromptPrefix: z.ZodOptional<z.ZodString>;
314
+ systemPromptSuffix: z.ZodOptional<z.ZodString>;
315
+ }, z.core.$strip>>;
316
+ model: z.ZodOptional<z.ZodObject<{
317
+ provider: z.ZodString;
318
+ id: z.ZodString;
319
+ }, z.core.$strip>>;
320
+ thinkingLevel: z.ZodOptional<z.ZodString>;
321
+ task: z.ZodOptional<z.ZodString>;
322
+ agentRole: z.ZodOptional<z.ZodString>;
323
+ role: z.ZodLiteral<"lead">;
324
+ }, z.core.$strip>, z.ZodObject<{
325
+ type: z.ZodLiteral<"init">;
326
+ sessionId: z.ZodOptional<z.ZodString>;
327
+ resume: z.ZodOptional<z.ZodObject<{
328
+ sessionFile: z.ZodString;
329
+ piSessionId: z.ZodOptional<z.ZodString>;
330
+ cwd: z.ZodOptional<z.ZodString>;
331
+ }, z.core.$strip>>;
332
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
333
+ name: z.ZodString;
334
+ label: z.ZodString;
335
+ description: z.ZodString;
336
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
337
+ promptSnippet: z.ZodOptional<z.ZodString>;
338
+ promptGuidelines: z.ZodOptional<z.ZodString>;
339
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
340
+ }, z.core.$strip>>>;
341
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
342
+ name: z.ZodString;
343
+ description: z.ZodString;
344
+ }, z.core.$strip>>>;
345
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
346
+ name: z.ZodString;
347
+ displayName: z.ZodOptional<z.ZodString>;
348
+ description: z.ZodString;
349
+ systemPrompt: z.ZodString;
350
+ model: z.ZodOptional<z.ZodString>;
351
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
352
+ temperature: z.ZodOptional<z.ZodNumber>;
353
+ thinkingLevel: z.ZodOptional<z.ZodString>;
354
+ readOnly: z.ZodOptional<z.ZodBoolean>;
355
+ hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
356
+ name: z.ZodString;
357
+ label: z.ZodString;
358
+ description: z.ZodString;
359
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
360
+ promptSnippet: z.ZodOptional<z.ZodString>;
361
+ promptGuidelines: z.ZodOptional<z.ZodString>;
362
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
363
+ }, z.core.$strip>>>;
364
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
365
+ status: z.ZodOptional<z.ZodEnum<{
366
+ available: "available";
367
+ busy: "busy";
368
+ offline: "offline";
369
+ }>>;
370
+ }, z.core.$strip>>>;
371
+ config: z.ZodOptional<z.ZodObject<{
372
+ systemPromptPrefix: z.ZodOptional<z.ZodString>;
373
+ systemPromptSuffix: z.ZodOptional<z.ZodString>;
374
+ }, z.core.$strip>>;
375
+ model: z.ZodOptional<z.ZodObject<{
376
+ provider: z.ZodString;
377
+ id: z.ZodString;
378
+ }, z.core.$strip>>;
379
+ thinkingLevel: z.ZodOptional<z.ZodString>;
380
+ task: z.ZodOptional<z.ZodString>;
381
+ agentRole: z.ZodOptional<z.ZodString>;
382
+ role: z.ZodLiteral<"sub_agent">;
383
+ }, z.core.$strip>, z.ZodObject<{
384
+ type: z.ZodLiteral<"init">;
385
+ sessionId: z.ZodOptional<z.ZodString>;
386
+ resume: z.ZodOptional<z.ZodObject<{
387
+ sessionFile: z.ZodString;
388
+ piSessionId: z.ZodOptional<z.ZodString>;
389
+ cwd: z.ZodOptional<z.ZodString>;
390
+ }, z.core.$strip>>;
391
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
392
+ name: z.ZodString;
393
+ label: z.ZodString;
394
+ description: z.ZodString;
395
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
396
+ promptSnippet: z.ZodOptional<z.ZodString>;
397
+ promptGuidelines: z.ZodOptional<z.ZodString>;
398
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
399
+ }, z.core.$strip>>>;
400
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
401
+ name: z.ZodString;
402
+ description: z.ZodString;
403
+ }, z.core.$strip>>>;
404
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
405
+ name: z.ZodString;
406
+ displayName: z.ZodOptional<z.ZodString>;
407
+ description: z.ZodString;
408
+ systemPrompt: z.ZodString;
409
+ model: z.ZodOptional<z.ZodString>;
410
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
411
+ temperature: z.ZodOptional<z.ZodNumber>;
412
+ thinkingLevel: z.ZodOptional<z.ZodString>;
413
+ readOnly: z.ZodOptional<z.ZodBoolean>;
414
+ hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
415
+ name: z.ZodString;
416
+ label: z.ZodString;
417
+ description: z.ZodString;
418
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
419
+ promptSnippet: z.ZodOptional<z.ZodString>;
420
+ promptGuidelines: z.ZodOptional<z.ZodString>;
421
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
422
+ }, z.core.$strip>>>;
423
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
424
+ status: z.ZodOptional<z.ZodEnum<{
425
+ available: "available";
426
+ busy: "busy";
427
+ offline: "offline";
428
+ }>>;
429
+ }, z.core.$strip>>>;
430
+ config: z.ZodOptional<z.ZodObject<{
431
+ systemPromptPrefix: z.ZodOptional<z.ZodString>;
432
+ systemPromptSuffix: z.ZodOptional<z.ZodString>;
433
+ }, z.core.$strip>>;
434
+ model: z.ZodOptional<z.ZodObject<{
435
+ provider: z.ZodString;
436
+ id: z.ZodString;
437
+ }, z.core.$strip>>;
438
+ thinkingLevel: z.ZodOptional<z.ZodString>;
439
+ task: z.ZodOptional<z.ZodString>;
440
+ agentRole: z.ZodOptional<z.ZodString>;
441
+ role: z.ZodLiteral<"controller">;
442
+ }, z.core.$strip>], "role">;
443
+ export type CoderHubInitMessage = z.infer<typeof CoderHubInitMessageSchema>;
444
+ export declare const CoderHubStreamReadyMessageSchema: z.ZodObject<{
445
+ type: z.ZodLiteral<"session_stream_ready">;
446
+ streamId: z.ZodString;
447
+ streamUrl: z.ZodString;
448
+ }, z.core.$strip>;
449
+ export type CoderHubStreamReadyMessage = z.infer<typeof CoderHubStreamReadyMessageSchema>;
450
+ export declare const CoderHubSessionResumeMessageSchema: z.ZodObject<{
451
+ type: z.ZodLiteral<"session_resume">;
452
+ streamUrl: z.ZodString;
453
+ streamId: z.ZodString;
454
+ activePrdKey: z.ZodOptional<z.ZodString>;
455
+ }, z.core.$strip>;
456
+ export type CoderHubSessionResumeMessage = z.infer<typeof CoderHubSessionResumeMessageSchema>;
457
+ export declare const ConnectionRejectedMessageSchema: z.ZodObject<{
458
+ type: z.ZodLiteral<"connection_rejected">;
459
+ code: z.ZodString;
460
+ message: z.ZodString;
461
+ sessionId: z.ZodOptional<z.ZodString>;
462
+ reconnectState: z.ZodOptional<z.ZodString>;
463
+ expiredAt: z.ZodOptional<z.ZodNumber>;
464
+ timestamp: z.ZodNumber;
465
+ }, z.core.$strip>;
466
+ export type ConnectionRejectedMessage = z.infer<typeof ConnectionRejectedMessageSchema>;
467
+ export declare const ProtocolErrorMessageSchema: z.ZodObject<{
468
+ type: z.ZodLiteral<"protocol_error">;
469
+ code: z.ZodString;
470
+ message: z.ZodString;
471
+ sessionId: z.ZodOptional<z.ZodString>;
472
+ timestamp: z.ZodNumber;
473
+ }, z.core.$strip>;
474
+ export type ProtocolErrorMessage = z.infer<typeof ProtocolErrorMessageSchema>;
475
+ export declare const AckActionSchema: z.ZodObject<{
476
+ action: z.ZodLiteral<"ACK">;
477
+ }, z.core.$strip>;
478
+ export type AckAction = z.infer<typeof AckActionSchema>;
479
+ export declare const BlockActionSchema: z.ZodObject<{
480
+ action: z.ZodLiteral<"BLOCK">;
481
+ reason: z.ZodString;
482
+ }, z.core.$strip>;
483
+ export type BlockAction = z.infer<typeof BlockActionSchema>;
484
+ export declare const ConfirmActionSchema: z.ZodObject<{
485
+ action: z.ZodLiteral<"CONFIRM">;
486
+ title: z.ZodString;
487
+ message: z.ZodString;
488
+ deny_reason: z.ZodOptional<z.ZodString>;
489
+ }, z.core.$strip>;
490
+ export type ConfirmAction = z.infer<typeof ConfirmActionSchema>;
491
+ export declare const NotifyActionSchema: z.ZodObject<{
492
+ action: z.ZodLiteral<"NOTIFY">;
493
+ message: z.ZodString;
494
+ level: z.ZodOptional<z.ZodEnum<{
495
+ info: "info";
496
+ error: "error";
497
+ warning: "warning";
498
+ }>>;
499
+ }, z.core.$strip>;
500
+ export type NotifyAction = z.infer<typeof NotifyActionSchema>;
501
+ export declare const ReturnActionSchema: z.ZodObject<{
502
+ action: z.ZodLiteral<"RETURN">;
503
+ result: z.ZodUnknown;
504
+ }, z.core.$strip>;
505
+ export type ReturnAction = z.infer<typeof ReturnActionSchema>;
506
+ export declare const StatusActionSchema: z.ZodObject<{
507
+ action: z.ZodLiteral<"STATUS">;
508
+ key: z.ZodString;
509
+ text: z.ZodOptional<z.ZodString>;
510
+ }, z.core.$strip>;
511
+ export type StatusAction = z.infer<typeof StatusActionSchema>;
512
+ export declare const SystemPromptActionSchema: z.ZodObject<{
513
+ action: z.ZodLiteral<"SYSTEM_PROMPT">;
514
+ systemPrompt: z.ZodString;
515
+ mode: z.ZodOptional<z.ZodEnum<{
516
+ replace: "replace";
517
+ prefix: "prefix";
518
+ suffix: "suffix";
519
+ }>>;
520
+ }, z.core.$strip>;
521
+ export type SystemPromptAction = z.infer<typeof SystemPromptActionSchema>;
522
+ export declare const InjectMessageActionSchema: z.ZodObject<{
523
+ action: z.ZodLiteral<"INJECT_MESSAGE">;
524
+ message: z.ZodObject<{
525
+ role: z.ZodEnum<{
526
+ user: "user";
527
+ assistant: "assistant";
528
+ }>;
529
+ content: z.ZodString;
530
+ }, z.core.$strip>;
531
+ }, z.core.$strip>;
532
+ export type InjectMessageAction = z.infer<typeof InjectMessageActionSchema>;
533
+ export declare const CoderHubActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
534
+ action: z.ZodLiteral<"ACK">;
535
+ }, z.core.$strip>, z.ZodObject<{
536
+ action: z.ZodLiteral<"BLOCK">;
537
+ reason: z.ZodString;
538
+ }, z.core.$strip>, z.ZodObject<{
539
+ action: z.ZodLiteral<"CONFIRM">;
540
+ title: z.ZodString;
541
+ message: z.ZodString;
542
+ deny_reason: z.ZodOptional<z.ZodString>;
543
+ }, z.core.$strip>, z.ZodObject<{
544
+ action: z.ZodLiteral<"NOTIFY">;
545
+ message: z.ZodString;
546
+ level: z.ZodOptional<z.ZodEnum<{
547
+ info: "info";
548
+ error: "error";
549
+ warning: "warning";
550
+ }>>;
551
+ }, z.core.$strip>, z.ZodObject<{
552
+ action: z.ZodLiteral<"RETURN">;
553
+ result: z.ZodUnknown;
554
+ }, z.core.$strip>, z.ZodObject<{
555
+ action: z.ZodLiteral<"STATUS">;
556
+ key: z.ZodString;
557
+ text: z.ZodOptional<z.ZodString>;
558
+ }, z.core.$strip>, z.ZodObject<{
559
+ action: z.ZodLiteral<"SYSTEM_PROMPT">;
560
+ systemPrompt: z.ZodString;
561
+ mode: z.ZodOptional<z.ZodEnum<{
562
+ replace: "replace";
563
+ prefix: "prefix";
564
+ suffix: "suffix";
565
+ }>>;
566
+ }, z.core.$strip>, z.ZodObject<{
567
+ action: z.ZodLiteral<"INJECT_MESSAGE">;
568
+ message: z.ZodObject<{
569
+ role: z.ZodEnum<{
570
+ user: "user";
571
+ assistant: "assistant";
572
+ }>;
573
+ content: z.ZodString;
574
+ }, z.core.$strip>;
575
+ }, z.core.$strip>], "action">;
576
+ export type CoderHubAction = z.infer<typeof CoderHubActionSchema>;
577
+ export declare const CoderHubResponseSchema: z.ZodObject<{
578
+ id: z.ZodString;
579
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
580
+ action: z.ZodLiteral<"ACK">;
581
+ }, z.core.$strip>, z.ZodObject<{
582
+ action: z.ZodLiteral<"BLOCK">;
583
+ reason: z.ZodString;
584
+ }, z.core.$strip>, z.ZodObject<{
585
+ action: z.ZodLiteral<"CONFIRM">;
586
+ title: z.ZodString;
587
+ message: z.ZodString;
588
+ deny_reason: z.ZodOptional<z.ZodString>;
589
+ }, z.core.$strip>, z.ZodObject<{
590
+ action: z.ZodLiteral<"NOTIFY">;
591
+ message: z.ZodString;
592
+ level: z.ZodOptional<z.ZodEnum<{
593
+ info: "info";
594
+ error: "error";
595
+ warning: "warning";
596
+ }>>;
597
+ }, z.core.$strip>, z.ZodObject<{
598
+ action: z.ZodLiteral<"RETURN">;
599
+ result: z.ZodUnknown;
600
+ }, z.core.$strip>, z.ZodObject<{
601
+ action: z.ZodLiteral<"STATUS">;
602
+ key: z.ZodString;
603
+ text: z.ZodOptional<z.ZodString>;
604
+ }, z.core.$strip>, z.ZodObject<{
605
+ action: z.ZodLiteral<"SYSTEM_PROMPT">;
606
+ systemPrompt: z.ZodString;
607
+ mode: z.ZodOptional<z.ZodEnum<{
608
+ replace: "replace";
609
+ prefix: "prefix";
610
+ suffix: "suffix";
611
+ }>>;
612
+ }, z.core.$strip>, z.ZodObject<{
613
+ action: z.ZodLiteral<"INJECT_MESSAGE">;
614
+ message: z.ZodObject<{
615
+ role: z.ZodEnum<{
616
+ user: "user";
617
+ assistant: "assistant";
618
+ }>;
619
+ content: z.ZodString;
620
+ }, z.core.$strip>;
621
+ }, z.core.$strip>], "action">>;
622
+ }, z.core.$strip>;
623
+ export type CoderHubResponse = z.infer<typeof CoderHubResponseSchema>;
624
+ export declare const ConversationAuthorSchema: z.ZodObject<{
625
+ userId: z.ZodOptional<z.ZodString>;
626
+ displayName: z.ZodOptional<z.ZodString>;
627
+ email: z.ZodOptional<z.ZodString>;
628
+ avatarUrl: z.ZodOptional<z.ZodString>;
629
+ actorType: z.ZodOptional<z.ZodEnum<{
630
+ user: "user";
631
+ api_key: "api_key";
632
+ service: "service";
633
+ }>>;
634
+ apiKeyLabel: z.ZodOptional<z.ZodString>;
635
+ }, z.core.$strip>;
636
+ export type ConversationAuthor = z.infer<typeof ConversationAuthorSchema>;
637
+ export declare const RuntimeProcessDescriptorSchema: z.ZodObject<{
638
+ pid: z.ZodOptional<z.ZodNumber>;
639
+ command: z.ZodOptional<z.ZodString>;
640
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
641
+ cwd: z.ZodOptional<z.ZodString>;
642
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
643
+ status: z.ZodOptional<z.ZodString>;
644
+ exitCode: z.ZodOptional<z.ZodNumber>;
645
+ signal: z.ZodOptional<z.ZodString>;
646
+ }, z.core.$strip>;
647
+ export type RuntimeProcessDescriptor = z.infer<typeof RuntimeProcessDescriptorSchema>;
648
+ export declare const RuntimePreviewDescriptorSchema: z.ZodObject<{
649
+ url: z.ZodOptional<z.ZodString>;
650
+ port: z.ZodOptional<z.ZodNumber>;
651
+ protocol: z.ZodOptional<z.ZodString>;
652
+ path: z.ZodOptional<z.ZodString>;
653
+ status: z.ZodOptional<z.ZodString>;
654
+ }, z.core.$strip>;
655
+ export type RuntimePreviewDescriptor = z.infer<typeof RuntimePreviewDescriptorSchema>;
656
+ export declare const PromptAttachmentDescriptorSchema: z.ZodObject<{
657
+ type: z.ZodString;
658
+ name: z.ZodOptional<z.ZodString>;
659
+ url: z.ZodOptional<z.ZodString>;
660
+ content: z.ZodOptional<z.ZodString>;
661
+ mimeType: z.ZodOptional<z.ZodString>;
662
+ size: z.ZodOptional<z.ZodNumber>;
663
+ }, z.core.$strip>;
664
+ export type PromptAttachmentDescriptor = z.infer<typeof PromptAttachmentDescriptorSchema>;
665
+ export declare const ConversationEntrySchema: z.ZodObject<{
666
+ type: z.ZodEnum<{
667
+ message: "message";
668
+ thinking: "thinking";
669
+ tool_call: "tool_call";
670
+ tool_result: "tool_result";
671
+ task_result: "task_result";
672
+ runtime_status: "runtime_status";
673
+ runtime_output: "runtime_output";
674
+ runtime_preview: "runtime_preview";
675
+ turn: "turn";
676
+ user_prompt: "user_prompt";
677
+ }>;
678
+ agent: z.ZodOptional<z.ZodString>;
679
+ content: z.ZodOptional<z.ZodString>;
680
+ thinking: z.ZodOptional<z.ZodString>;
681
+ toolName: z.ZodOptional<z.ZodString>;
682
+ toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
683
+ toolCallId: z.ZodOptional<z.ZodString>;
684
+ runtime: z.ZodOptional<z.ZodObject<{
685
+ pid: z.ZodOptional<z.ZodNumber>;
686
+ command: z.ZodOptional<z.ZodString>;
687
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
688
+ cwd: z.ZodOptional<z.ZodString>;
689
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
690
+ status: z.ZodOptional<z.ZodString>;
691
+ exitCode: z.ZodOptional<z.ZodNumber>;
692
+ signal: z.ZodOptional<z.ZodString>;
693
+ }, z.core.$strip>>;
694
+ preview: z.ZodOptional<z.ZodObject<{
695
+ url: z.ZodOptional<z.ZodString>;
696
+ port: z.ZodOptional<z.ZodNumber>;
697
+ protocol: z.ZodOptional<z.ZodString>;
698
+ path: z.ZodOptional<z.ZodString>;
699
+ status: z.ZodOptional<z.ZodString>;
700
+ }, z.core.$strip>>;
701
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
702
+ type: z.ZodString;
703
+ name: z.ZodOptional<z.ZodString>;
704
+ url: z.ZodOptional<z.ZodString>;
705
+ content: z.ZodOptional<z.ZodString>;
706
+ mimeType: z.ZodOptional<z.ZodString>;
707
+ size: z.ZodOptional<z.ZodNumber>;
708
+ }, z.core.$strip>>>;
709
+ author: z.ZodOptional<z.ZodObject<{
710
+ userId: z.ZodOptional<z.ZodString>;
711
+ displayName: z.ZodOptional<z.ZodString>;
712
+ email: z.ZodOptional<z.ZodString>;
713
+ avatarUrl: z.ZodOptional<z.ZodString>;
714
+ actorType: z.ZodOptional<z.ZodEnum<{
715
+ user: "user";
716
+ api_key: "api_key";
717
+ service: "service";
718
+ }>>;
719
+ apiKeyLabel: z.ZodOptional<z.ZodString>;
720
+ }, z.core.$strip>>;
721
+ isError: z.ZodOptional<z.ZodBoolean>;
722
+ taskId: z.ZodOptional<z.ZodString>;
723
+ turnId: z.ZodOptional<z.ZodString>;
724
+ replyId: z.ZodOptional<z.ZodString>;
725
+ sequence: z.ZodOptional<z.ZodNumber>;
726
+ elapsedMs: z.ZodOptional<z.ZodNumber>;
727
+ timestamp: z.ZodNumber;
728
+ }, z.core.$strip>;
729
+ export type ConversationEntry = z.infer<typeof ConversationEntrySchema>;
730
+ export declare const SessionTaskStateSchema: z.ZodObject<{
731
+ taskId: z.ZodString;
732
+ agent: z.ZodString;
733
+ status: z.ZodEnum<{
734
+ failed: "failed";
735
+ completed: "completed";
736
+ running: "running";
737
+ }>;
738
+ prompt: z.ZodString;
739
+ startedAt: z.ZodOptional<z.ZodString>;
740
+ completedAt: z.ZodOptional<z.ZodString>;
741
+ duration: z.ZodOptional<z.ZodNumber>;
742
+ result: z.ZodOptional<z.ZodString>;
743
+ error: z.ZodOptional<z.ZodString>;
744
+ }, z.core.$strip>;
745
+ export type SessionTaskState = z.infer<typeof SessionTaskStateSchema>;
746
+ export declare const SessionStreamBlockSchema: z.ZodObject<{
747
+ output: z.ZodString;
748
+ thinking: z.ZodString;
749
+ }, z.core.$strip>;
750
+ export type SessionStreamBlock = z.infer<typeof SessionStreamBlockSchema>;
751
+ export declare const SessionStreamProjectionSchema: z.ZodObject<{
752
+ output: z.ZodString;
753
+ thinking: z.ZodString;
754
+ tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
755
+ output: z.ZodString;
756
+ thinking: z.ZodString;
757
+ }, z.core.$strip>>;
758
+ }, z.core.$strip>;
759
+ export type SessionStreamProjection = z.infer<typeof SessionStreamProjectionSchema>;
760
+ export declare const SessionAgentActivitySchema: z.ZodObject<{
761
+ name: z.ZodOptional<z.ZodString>;
762
+ status: z.ZodString;
763
+ currentTool: z.ZodOptional<z.ZodString>;
764
+ currentToolArgs: z.ZodOptional<z.ZodString>;
765
+ toolCallCount: z.ZodNumber;
766
+ lastActivity: z.ZodNumber;
767
+ totalElapsed: z.ZodOptional<z.ZodNumber>;
768
+ }, z.core.$strip>;
769
+ export type SessionAgentActivity = z.infer<typeof SessionAgentActivitySchema>;
770
+ export declare const CoderHubHydrationMessageSchema: z.ZodObject<{
771
+ type: z.ZodLiteral<"session_hydration">;
772
+ sessionId: z.ZodString;
773
+ label: z.ZodOptional<z.ZodString>;
774
+ resumedAt: z.ZodNumber;
775
+ entries: z.ZodArray<z.ZodObject<{
776
+ type: z.ZodEnum<{
777
+ message: "message";
778
+ thinking: "thinking";
779
+ tool_call: "tool_call";
780
+ tool_result: "tool_result";
781
+ task_result: "task_result";
782
+ runtime_status: "runtime_status";
783
+ runtime_output: "runtime_output";
784
+ runtime_preview: "runtime_preview";
785
+ turn: "turn";
786
+ user_prompt: "user_prompt";
787
+ }>;
788
+ agent: z.ZodOptional<z.ZodString>;
789
+ content: z.ZodOptional<z.ZodString>;
790
+ thinking: z.ZodOptional<z.ZodString>;
791
+ toolName: z.ZodOptional<z.ZodString>;
792
+ toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
793
+ toolCallId: z.ZodOptional<z.ZodString>;
794
+ runtime: z.ZodOptional<z.ZodObject<{
795
+ pid: z.ZodOptional<z.ZodNumber>;
796
+ command: z.ZodOptional<z.ZodString>;
797
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
798
+ cwd: z.ZodOptional<z.ZodString>;
799
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
800
+ status: z.ZodOptional<z.ZodString>;
801
+ exitCode: z.ZodOptional<z.ZodNumber>;
802
+ signal: z.ZodOptional<z.ZodString>;
803
+ }, z.core.$strip>>;
804
+ preview: z.ZodOptional<z.ZodObject<{
805
+ url: z.ZodOptional<z.ZodString>;
806
+ port: z.ZodOptional<z.ZodNumber>;
807
+ protocol: z.ZodOptional<z.ZodString>;
808
+ path: z.ZodOptional<z.ZodString>;
809
+ status: z.ZodOptional<z.ZodString>;
810
+ }, z.core.$strip>>;
811
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
812
+ type: z.ZodString;
813
+ name: z.ZodOptional<z.ZodString>;
814
+ url: z.ZodOptional<z.ZodString>;
815
+ content: z.ZodOptional<z.ZodString>;
816
+ mimeType: z.ZodOptional<z.ZodString>;
817
+ size: z.ZodOptional<z.ZodNumber>;
818
+ }, z.core.$strip>>>;
819
+ author: z.ZodOptional<z.ZodObject<{
820
+ userId: z.ZodOptional<z.ZodString>;
821
+ displayName: z.ZodOptional<z.ZodString>;
822
+ email: z.ZodOptional<z.ZodString>;
823
+ avatarUrl: z.ZodOptional<z.ZodString>;
824
+ actorType: z.ZodOptional<z.ZodEnum<{
825
+ user: "user";
826
+ api_key: "api_key";
827
+ service: "service";
828
+ }>>;
829
+ apiKeyLabel: z.ZodOptional<z.ZodString>;
830
+ }, z.core.$strip>>;
831
+ isError: z.ZodOptional<z.ZodBoolean>;
832
+ taskId: z.ZodOptional<z.ZodString>;
833
+ turnId: z.ZodOptional<z.ZodString>;
834
+ replyId: z.ZodOptional<z.ZodString>;
835
+ sequence: z.ZodOptional<z.ZodNumber>;
836
+ elapsedMs: z.ZodOptional<z.ZodNumber>;
837
+ timestamp: z.ZodNumber;
838
+ }, z.core.$strip>>;
839
+ task: z.ZodOptional<z.ZodString>;
840
+ leadConnected: z.ZodOptional<z.ZodBoolean>;
841
+ stream: z.ZodOptional<z.ZodObject<{
842
+ output: z.ZodString;
843
+ thinking: z.ZodString;
844
+ tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
845
+ output: z.ZodString;
846
+ thinking: z.ZodString;
847
+ }, z.core.$strip>>;
848
+ }, z.core.$strip>>;
849
+ tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
850
+ taskId: z.ZodString;
851
+ agent: z.ZodString;
852
+ status: z.ZodEnum<{
853
+ failed: "failed";
854
+ completed: "completed";
855
+ running: "running";
856
+ }>;
857
+ prompt: z.ZodString;
858
+ startedAt: z.ZodOptional<z.ZodString>;
859
+ completedAt: z.ZodOptional<z.ZodString>;
860
+ duration: z.ZodOptional<z.ZodNumber>;
861
+ result: z.ZodOptional<z.ZodString>;
862
+ error: z.ZodOptional<z.ZodString>;
863
+ }, z.core.$strip>>>;
864
+ streamingState: z.ZodOptional<z.ZodObject<{
865
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
866
+ activeTasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
867
+ taskId: z.ZodString;
868
+ agent: z.ZodString;
869
+ }, z.core.$strip>>>;
870
+ }, z.core.$strip>>;
871
+ }, z.core.$strip>;
872
+ export type CoderHubHydrationMessage = z.infer<typeof CoderHubHydrationMessageSchema>;
873
+ export declare const BootstrapReadyMessageSchema: z.ZodObject<{
874
+ type: z.ZodLiteral<"bootstrap_ready">;
875
+ }, z.core.$strip>;
876
+ export type BootstrapReadyMessage = z.infer<typeof BootstrapReadyMessageSchema>;
877
+ export declare const SessionEntryMessageSchema: z.ZodObject<{
878
+ type: z.ZodLiteral<"session_entry">;
879
+ path: z.ZodString;
880
+ line: z.ZodString;
881
+ }, z.core.$strip>;
882
+ export type SessionEntryMessage = z.infer<typeof SessionEntryMessageSchema>;
883
+ export declare const SessionWriteMessageSchema: z.ZodObject<{
884
+ type: z.ZodLiteral<"session_write">;
885
+ path: z.ZodString;
886
+ content: z.ZodString;
887
+ }, z.core.$strip>;
888
+ export type SessionWriteMessage = z.infer<typeof SessionWriteMessageSchema>;
889
+ export declare const SessionParticipantSchema: z.ZodObject<{
890
+ id: z.ZodString;
891
+ role: z.ZodEnum<{
892
+ lead: "lead";
893
+ controller: "controller";
894
+ observer: "observer";
895
+ }>;
896
+ transport: z.ZodEnum<{
897
+ ws: "ws";
898
+ sse: "sse";
899
+ }>;
900
+ subscriptions: z.ZodArray<z.ZodString>;
901
+ connectedAt: z.ZodNumber;
902
+ lastActivity: z.ZodNumber;
903
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
904
+ }, z.core.$strip>;
905
+ export type SessionParticipant = z.infer<typeof SessionParticipantSchema>;
906
+ export declare const PresenceEventMessageSchema: z.ZodObject<{
907
+ type: z.ZodLiteral<"presence">;
908
+ event: z.ZodEnum<{
909
+ session_join: "session_join";
910
+ session_leave: "session_leave";
911
+ presence_update: "presence_update";
912
+ }>;
913
+ participant: z.ZodOptional<z.ZodObject<{
914
+ id: z.ZodString;
915
+ role: z.ZodEnum<{
916
+ lead: "lead";
917
+ controller: "controller";
918
+ observer: "observer";
919
+ }>;
920
+ transport: z.ZodEnum<{
921
+ ws: "ws";
922
+ sse: "sse";
923
+ }>;
924
+ subscriptions: z.ZodArray<z.ZodString>;
925
+ connectedAt: z.ZodNumber;
926
+ lastActivity: z.ZodNumber;
927
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
928
+ }, z.core.$strip>>;
929
+ participants: z.ZodOptional<z.ZodArray<z.ZodObject<{
930
+ id: z.ZodString;
931
+ role: z.ZodEnum<{
932
+ lead: "lead";
933
+ controller: "controller";
934
+ observer: "observer";
935
+ }>;
936
+ transport: z.ZodEnum<{
937
+ ws: "ws";
938
+ sse: "sse";
939
+ }>;
940
+ subscriptions: z.ZodArray<z.ZodString>;
941
+ connectedAt: z.ZodNumber;
942
+ lastActivity: z.ZodNumber;
943
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
944
+ }, z.core.$strip>>>;
945
+ sessionId: z.ZodString;
946
+ timestamp: z.ZodNumber;
947
+ }, z.core.$strip>;
948
+ export type PresenceEventMessage = z.infer<typeof PresenceEventMessageSchema>;
949
+ export declare const BroadcastEventMessageSchema: z.ZodObject<{
950
+ type: z.ZodLiteral<"broadcast">;
951
+ event: z.ZodString;
952
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
953
+ category: z.ZodString;
954
+ sessionId: z.ZodString;
955
+ timestamp: z.ZodNumber;
956
+ }, z.core.$strip>;
957
+ export type BroadcastEventMessage = z.infer<typeof BroadcastEventMessageSchema>;
958
+ export declare const RpcCommandMessageSchema: z.ZodObject<{
959
+ type: z.ZodLiteral<"rpc_command">;
960
+ command: z.ZodRecord<z.ZodString, z.ZodUnknown>;
961
+ }, z.core.$strip>;
962
+ export type RpcCommandMessage = z.infer<typeof RpcCommandMessageSchema>;
963
+ export declare const RpcEventMessageSchema: z.ZodObject<{
964
+ type: z.ZodLiteral<"rpc_event">;
965
+ event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
966
+ timestamp: z.ZodNumber;
967
+ }, z.core.$strip>;
968
+ export type RpcEventMessage = z.infer<typeof RpcEventMessageSchema>;
969
+ export declare const RpcResponseMessageSchema: z.ZodObject<{
970
+ type: z.ZodLiteral<"rpc_response">;
971
+ response: z.ZodRecord<z.ZodString, z.ZodUnknown>;
972
+ }, z.core.$strip>;
973
+ export type RpcResponseMessage = z.infer<typeof RpcResponseMessageSchema>;
974
+ export declare const RpcUiRequestMessageSchema: z.ZodObject<{
975
+ type: z.ZodLiteral<"rpc_ui_request">;
976
+ id: z.ZodString;
977
+ method: z.ZodString;
978
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
979
+ }, z.core.$strip>;
980
+ export type RpcUiRequestMessage = z.infer<typeof RpcUiRequestMessageSchema>;
981
+ export declare const RpcUiResponseMessageSchema: z.ZodObject<{
982
+ type: z.ZodLiteral<"rpc_ui_response">;
983
+ id: z.ZodString;
984
+ result: z.ZodUnknown;
985
+ }, z.core.$strip>;
986
+ export type RpcUiResponseMessage = z.infer<typeof RpcUiResponseMessageSchema>;
987
+ export declare const PingMessageSchema: z.ZodObject<{
988
+ type: z.ZodLiteral<"ping">;
989
+ timestamp: z.ZodNumber;
990
+ }, z.core.$strip>;
991
+ export type PingMessage = z.infer<typeof PingMessageSchema>;
992
+ export declare const PongMessageSchema: z.ZodObject<{
993
+ type: z.ZodLiteral<"pong">;
994
+ timestamp: z.ZodNumber;
995
+ echoedTimestamp: z.ZodOptional<z.ZodNumber>;
996
+ }, z.core.$strip>;
997
+ export type PongMessage = z.infer<typeof PongMessageSchema>;
998
+ export declare const EventRequestSchema: z.ZodObject<{
999
+ id: z.ZodString;
1000
+ type: z.ZodLiteral<"event">;
1001
+ event: z.ZodString;
1002
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1003
+ }, z.core.$strip>;
1004
+ export type EventRequest = z.infer<typeof EventRequestSchema>;
1005
+ export declare const ToolRequestSchema: z.ZodObject<{
1006
+ id: z.ZodString;
1007
+ type: z.ZodLiteral<"tool">;
1008
+ name: z.ZodString;
1009
+ toolCallId: z.ZodString;
1010
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1011
+ }, z.core.$strip>;
1012
+ export type ToolRequest = z.infer<typeof ToolRequestSchema>;
1013
+ export declare const CommandRequestSchema: z.ZodObject<{
1014
+ id: z.ZodString;
1015
+ type: z.ZodLiteral<"command">;
1016
+ name: z.ZodString;
1017
+ args: z.ZodString;
1018
+ }, z.core.$strip>;
1019
+ export type CommandRequest = z.infer<typeof CommandRequestSchema>;
1020
+ /**
1021
+ * All possible client-to-server message types.
1022
+ *
1023
+ * Messages the client can send to the Coder Hub server.
1024
+ */
1025
+ export declare const ClientMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1026
+ id: z.ZodString;
1027
+ type: z.ZodLiteral<"event">;
1028
+ event: z.ZodString;
1029
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1030
+ }, z.core.$strip>, z.ZodObject<{
1031
+ id: z.ZodString;
1032
+ type: z.ZodLiteral<"tool">;
1033
+ name: z.ZodString;
1034
+ toolCallId: z.ZodString;
1035
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1036
+ }, z.core.$strip>, z.ZodObject<{
1037
+ id: z.ZodString;
1038
+ type: z.ZodLiteral<"command">;
1039
+ name: z.ZodString;
1040
+ args: z.ZodString;
1041
+ }, z.core.$strip>, z.ZodObject<{
1042
+ type: z.ZodLiteral<"session_entry">;
1043
+ path: z.ZodString;
1044
+ line: z.ZodString;
1045
+ }, z.core.$strip>, z.ZodObject<{
1046
+ type: z.ZodLiteral<"session_write">;
1047
+ path: z.ZodString;
1048
+ content: z.ZodString;
1049
+ }, z.core.$strip>, z.ZodObject<{
1050
+ type: z.ZodLiteral<"bootstrap_ready">;
1051
+ }, z.core.$strip>, z.ZodObject<{
1052
+ type: z.ZodLiteral<"rpc_command">;
1053
+ command: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1054
+ }, z.core.$strip>, z.ZodObject<{
1055
+ type: z.ZodLiteral<"rpc_ui_response">;
1056
+ id: z.ZodString;
1057
+ result: z.ZodUnknown;
1058
+ }, z.core.$strip>, z.ZodObject<{
1059
+ type: z.ZodLiteral<"ping">;
1060
+ timestamp: z.ZodNumber;
1061
+ }, z.core.$strip>], "type">;
1062
+ export type ClientMessage = z.infer<typeof ClientMessageSchema>;
1063
+ /**
1064
+ * All possible server-to-client message types.
1065
+ *
1066
+ * Messages the Coder Hub server can send to connected clients.
1067
+ */
1068
+ export declare const ServerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
1069
+ type: z.ZodLiteral<"init">;
1070
+ sessionId: z.ZodOptional<z.ZodString>;
1071
+ resume: z.ZodOptional<z.ZodObject<{
1072
+ sessionFile: z.ZodString;
1073
+ piSessionId: z.ZodOptional<z.ZodString>;
1074
+ cwd: z.ZodOptional<z.ZodString>;
1075
+ }, z.core.$strip>>;
1076
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1077
+ name: z.ZodString;
1078
+ label: z.ZodString;
1079
+ description: z.ZodString;
1080
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1081
+ promptSnippet: z.ZodOptional<z.ZodString>;
1082
+ promptGuidelines: z.ZodOptional<z.ZodString>;
1083
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1084
+ }, z.core.$strip>>>;
1085
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
1086
+ name: z.ZodString;
1087
+ description: z.ZodString;
1088
+ }, z.core.$strip>>>;
1089
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
1090
+ name: z.ZodString;
1091
+ displayName: z.ZodOptional<z.ZodString>;
1092
+ description: z.ZodString;
1093
+ systemPrompt: z.ZodString;
1094
+ model: z.ZodOptional<z.ZodString>;
1095
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1096
+ temperature: z.ZodOptional<z.ZodNumber>;
1097
+ thinkingLevel: z.ZodOptional<z.ZodString>;
1098
+ readOnly: z.ZodOptional<z.ZodBoolean>;
1099
+ hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1100
+ name: z.ZodString;
1101
+ label: z.ZodString;
1102
+ description: z.ZodString;
1103
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1104
+ promptSnippet: z.ZodOptional<z.ZodString>;
1105
+ promptGuidelines: z.ZodOptional<z.ZodString>;
1106
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1107
+ }, z.core.$strip>>>;
1108
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
1109
+ status: z.ZodOptional<z.ZodEnum<{
1110
+ available: "available";
1111
+ busy: "busy";
1112
+ offline: "offline";
1113
+ }>>;
1114
+ }, z.core.$strip>>>;
1115
+ config: z.ZodOptional<z.ZodObject<{
1116
+ systemPromptPrefix: z.ZodOptional<z.ZodString>;
1117
+ systemPromptSuffix: z.ZodOptional<z.ZodString>;
1118
+ }, z.core.$strip>>;
1119
+ model: z.ZodOptional<z.ZodObject<{
1120
+ provider: z.ZodString;
1121
+ id: z.ZodString;
1122
+ }, z.core.$strip>>;
1123
+ thinkingLevel: z.ZodOptional<z.ZodString>;
1124
+ task: z.ZodOptional<z.ZodString>;
1125
+ agentRole: z.ZodOptional<z.ZodString>;
1126
+ role: z.ZodLiteral<"lead">;
1127
+ }, z.core.$strip>, z.ZodObject<{
1128
+ type: z.ZodLiteral<"init">;
1129
+ sessionId: z.ZodOptional<z.ZodString>;
1130
+ resume: z.ZodOptional<z.ZodObject<{
1131
+ sessionFile: z.ZodString;
1132
+ piSessionId: z.ZodOptional<z.ZodString>;
1133
+ cwd: z.ZodOptional<z.ZodString>;
1134
+ }, z.core.$strip>>;
1135
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1136
+ name: z.ZodString;
1137
+ label: z.ZodString;
1138
+ description: z.ZodString;
1139
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1140
+ promptSnippet: z.ZodOptional<z.ZodString>;
1141
+ promptGuidelines: z.ZodOptional<z.ZodString>;
1142
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1143
+ }, z.core.$strip>>>;
1144
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
1145
+ name: z.ZodString;
1146
+ description: z.ZodString;
1147
+ }, z.core.$strip>>>;
1148
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
1149
+ name: z.ZodString;
1150
+ displayName: z.ZodOptional<z.ZodString>;
1151
+ description: z.ZodString;
1152
+ systemPrompt: z.ZodString;
1153
+ model: z.ZodOptional<z.ZodString>;
1154
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1155
+ temperature: z.ZodOptional<z.ZodNumber>;
1156
+ thinkingLevel: z.ZodOptional<z.ZodString>;
1157
+ readOnly: z.ZodOptional<z.ZodBoolean>;
1158
+ hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1159
+ name: z.ZodString;
1160
+ label: z.ZodString;
1161
+ description: z.ZodString;
1162
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1163
+ promptSnippet: z.ZodOptional<z.ZodString>;
1164
+ promptGuidelines: z.ZodOptional<z.ZodString>;
1165
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1166
+ }, z.core.$strip>>>;
1167
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
1168
+ status: z.ZodOptional<z.ZodEnum<{
1169
+ available: "available";
1170
+ busy: "busy";
1171
+ offline: "offline";
1172
+ }>>;
1173
+ }, z.core.$strip>>>;
1174
+ config: z.ZodOptional<z.ZodObject<{
1175
+ systemPromptPrefix: z.ZodOptional<z.ZodString>;
1176
+ systemPromptSuffix: z.ZodOptional<z.ZodString>;
1177
+ }, z.core.$strip>>;
1178
+ model: z.ZodOptional<z.ZodObject<{
1179
+ provider: z.ZodString;
1180
+ id: z.ZodString;
1181
+ }, z.core.$strip>>;
1182
+ thinkingLevel: z.ZodOptional<z.ZodString>;
1183
+ task: z.ZodOptional<z.ZodString>;
1184
+ agentRole: z.ZodOptional<z.ZodString>;
1185
+ role: z.ZodLiteral<"sub_agent">;
1186
+ }, z.core.$strip>, z.ZodObject<{
1187
+ type: z.ZodLiteral<"init">;
1188
+ sessionId: z.ZodOptional<z.ZodString>;
1189
+ resume: z.ZodOptional<z.ZodObject<{
1190
+ sessionFile: z.ZodString;
1191
+ piSessionId: z.ZodOptional<z.ZodString>;
1192
+ cwd: z.ZodOptional<z.ZodString>;
1193
+ }, z.core.$strip>>;
1194
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1195
+ name: z.ZodString;
1196
+ label: z.ZodString;
1197
+ description: z.ZodString;
1198
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1199
+ promptSnippet: z.ZodOptional<z.ZodString>;
1200
+ promptGuidelines: z.ZodOptional<z.ZodString>;
1201
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1202
+ }, z.core.$strip>>>;
1203
+ commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
1204
+ name: z.ZodString;
1205
+ description: z.ZodString;
1206
+ }, z.core.$strip>>>;
1207
+ agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
1208
+ name: z.ZodString;
1209
+ displayName: z.ZodOptional<z.ZodString>;
1210
+ description: z.ZodString;
1211
+ systemPrompt: z.ZodString;
1212
+ model: z.ZodOptional<z.ZodString>;
1213
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
1214
+ temperature: z.ZodOptional<z.ZodNumber>;
1215
+ thinkingLevel: z.ZodOptional<z.ZodString>;
1216
+ readOnly: z.ZodOptional<z.ZodBoolean>;
1217
+ hubTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
1218
+ name: z.ZodString;
1219
+ label: z.ZodString;
1220
+ description: z.ZodString;
1221
+ parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1222
+ promptSnippet: z.ZodOptional<z.ZodString>;
1223
+ promptGuidelines: z.ZodOptional<z.ZodString>;
1224
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
1225
+ }, z.core.$strip>>>;
1226
+ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
1227
+ status: z.ZodOptional<z.ZodEnum<{
1228
+ available: "available";
1229
+ busy: "busy";
1230
+ offline: "offline";
1231
+ }>>;
1232
+ }, z.core.$strip>>>;
1233
+ config: z.ZodOptional<z.ZodObject<{
1234
+ systemPromptPrefix: z.ZodOptional<z.ZodString>;
1235
+ systemPromptSuffix: z.ZodOptional<z.ZodString>;
1236
+ }, z.core.$strip>>;
1237
+ model: z.ZodOptional<z.ZodObject<{
1238
+ provider: z.ZodString;
1239
+ id: z.ZodString;
1240
+ }, z.core.$strip>>;
1241
+ thinkingLevel: z.ZodOptional<z.ZodString>;
1242
+ task: z.ZodOptional<z.ZodString>;
1243
+ agentRole: z.ZodOptional<z.ZodString>;
1244
+ role: z.ZodLiteral<"controller">;
1245
+ }, z.core.$strip>], "role">, z.ZodObject<{
1246
+ id: z.ZodString;
1247
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1248
+ action: z.ZodLiteral<"ACK">;
1249
+ }, z.core.$strip>, z.ZodObject<{
1250
+ action: z.ZodLiteral<"BLOCK">;
1251
+ reason: z.ZodString;
1252
+ }, z.core.$strip>, z.ZodObject<{
1253
+ action: z.ZodLiteral<"CONFIRM">;
1254
+ title: z.ZodString;
1255
+ message: z.ZodString;
1256
+ deny_reason: z.ZodOptional<z.ZodString>;
1257
+ }, z.core.$strip>, z.ZodObject<{
1258
+ action: z.ZodLiteral<"NOTIFY">;
1259
+ message: z.ZodString;
1260
+ level: z.ZodOptional<z.ZodEnum<{
1261
+ info: "info";
1262
+ error: "error";
1263
+ warning: "warning";
1264
+ }>>;
1265
+ }, z.core.$strip>, z.ZodObject<{
1266
+ action: z.ZodLiteral<"RETURN">;
1267
+ result: z.ZodUnknown;
1268
+ }, z.core.$strip>, z.ZodObject<{
1269
+ action: z.ZodLiteral<"STATUS">;
1270
+ key: z.ZodString;
1271
+ text: z.ZodOptional<z.ZodString>;
1272
+ }, z.core.$strip>, z.ZodObject<{
1273
+ action: z.ZodLiteral<"SYSTEM_PROMPT">;
1274
+ systemPrompt: z.ZodString;
1275
+ mode: z.ZodOptional<z.ZodEnum<{
1276
+ replace: "replace";
1277
+ prefix: "prefix";
1278
+ suffix: "suffix";
1279
+ }>>;
1280
+ }, z.core.$strip>, z.ZodObject<{
1281
+ action: z.ZodLiteral<"INJECT_MESSAGE">;
1282
+ message: z.ZodObject<{
1283
+ role: z.ZodEnum<{
1284
+ user: "user";
1285
+ assistant: "assistant";
1286
+ }>;
1287
+ content: z.ZodString;
1288
+ }, z.core.$strip>;
1289
+ }, z.core.$strip>], "action">>;
1290
+ }, z.core.$strip>, z.ZodObject<{
1291
+ type: z.ZodLiteral<"session_hydration">;
1292
+ sessionId: z.ZodString;
1293
+ label: z.ZodOptional<z.ZodString>;
1294
+ resumedAt: z.ZodNumber;
1295
+ entries: z.ZodArray<z.ZodObject<{
1296
+ type: z.ZodEnum<{
1297
+ message: "message";
1298
+ thinking: "thinking";
1299
+ tool_call: "tool_call";
1300
+ tool_result: "tool_result";
1301
+ task_result: "task_result";
1302
+ runtime_status: "runtime_status";
1303
+ runtime_output: "runtime_output";
1304
+ runtime_preview: "runtime_preview";
1305
+ turn: "turn";
1306
+ user_prompt: "user_prompt";
1307
+ }>;
1308
+ agent: z.ZodOptional<z.ZodString>;
1309
+ content: z.ZodOptional<z.ZodString>;
1310
+ thinking: z.ZodOptional<z.ZodString>;
1311
+ toolName: z.ZodOptional<z.ZodString>;
1312
+ toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1313
+ toolCallId: z.ZodOptional<z.ZodString>;
1314
+ runtime: z.ZodOptional<z.ZodObject<{
1315
+ pid: z.ZodOptional<z.ZodNumber>;
1316
+ command: z.ZodOptional<z.ZodString>;
1317
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1318
+ cwd: z.ZodOptional<z.ZodString>;
1319
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1320
+ status: z.ZodOptional<z.ZodString>;
1321
+ exitCode: z.ZodOptional<z.ZodNumber>;
1322
+ signal: z.ZodOptional<z.ZodString>;
1323
+ }, z.core.$strip>>;
1324
+ preview: z.ZodOptional<z.ZodObject<{
1325
+ url: z.ZodOptional<z.ZodString>;
1326
+ port: z.ZodOptional<z.ZodNumber>;
1327
+ protocol: z.ZodOptional<z.ZodString>;
1328
+ path: z.ZodOptional<z.ZodString>;
1329
+ status: z.ZodOptional<z.ZodString>;
1330
+ }, z.core.$strip>>;
1331
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1332
+ type: z.ZodString;
1333
+ name: z.ZodOptional<z.ZodString>;
1334
+ url: z.ZodOptional<z.ZodString>;
1335
+ content: z.ZodOptional<z.ZodString>;
1336
+ mimeType: z.ZodOptional<z.ZodString>;
1337
+ size: z.ZodOptional<z.ZodNumber>;
1338
+ }, z.core.$strip>>>;
1339
+ author: z.ZodOptional<z.ZodObject<{
1340
+ userId: z.ZodOptional<z.ZodString>;
1341
+ displayName: z.ZodOptional<z.ZodString>;
1342
+ email: z.ZodOptional<z.ZodString>;
1343
+ avatarUrl: z.ZodOptional<z.ZodString>;
1344
+ actorType: z.ZodOptional<z.ZodEnum<{
1345
+ user: "user";
1346
+ api_key: "api_key";
1347
+ service: "service";
1348
+ }>>;
1349
+ apiKeyLabel: z.ZodOptional<z.ZodString>;
1350
+ }, z.core.$strip>>;
1351
+ isError: z.ZodOptional<z.ZodBoolean>;
1352
+ taskId: z.ZodOptional<z.ZodString>;
1353
+ turnId: z.ZodOptional<z.ZodString>;
1354
+ replyId: z.ZodOptional<z.ZodString>;
1355
+ sequence: z.ZodOptional<z.ZodNumber>;
1356
+ elapsedMs: z.ZodOptional<z.ZodNumber>;
1357
+ timestamp: z.ZodNumber;
1358
+ }, z.core.$strip>>;
1359
+ task: z.ZodOptional<z.ZodString>;
1360
+ leadConnected: z.ZodOptional<z.ZodBoolean>;
1361
+ stream: z.ZodOptional<z.ZodObject<{
1362
+ output: z.ZodString;
1363
+ thinking: z.ZodString;
1364
+ tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
1365
+ output: z.ZodString;
1366
+ thinking: z.ZodString;
1367
+ }, z.core.$strip>>;
1368
+ }, z.core.$strip>>;
1369
+ tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1370
+ taskId: z.ZodString;
1371
+ agent: z.ZodString;
1372
+ status: z.ZodEnum<{
1373
+ failed: "failed";
1374
+ completed: "completed";
1375
+ running: "running";
1376
+ }>;
1377
+ prompt: z.ZodString;
1378
+ startedAt: z.ZodOptional<z.ZodString>;
1379
+ completedAt: z.ZodOptional<z.ZodString>;
1380
+ duration: z.ZodOptional<z.ZodNumber>;
1381
+ result: z.ZodOptional<z.ZodString>;
1382
+ error: z.ZodOptional<z.ZodString>;
1383
+ }, z.core.$strip>>>;
1384
+ streamingState: z.ZodOptional<z.ZodObject<{
1385
+ isStreaming: z.ZodOptional<z.ZodBoolean>;
1386
+ activeTasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1387
+ taskId: z.ZodString;
1388
+ agent: z.ZodString;
1389
+ }, z.core.$strip>>>;
1390
+ }, z.core.$strip>>;
1391
+ }, z.core.$strip>, z.ZodObject<{
1392
+ type: z.ZodLiteral<"session_stream_ready">;
1393
+ streamId: z.ZodString;
1394
+ streamUrl: z.ZodString;
1395
+ }, z.core.$strip>, z.ZodObject<{
1396
+ type: z.ZodLiteral<"session_resume">;
1397
+ streamUrl: z.ZodString;
1398
+ streamId: z.ZodString;
1399
+ activePrdKey: z.ZodOptional<z.ZodString>;
1400
+ }, z.core.$strip>, z.ZodObject<{
1401
+ type: z.ZodLiteral<"pong">;
1402
+ timestamp: z.ZodNumber;
1403
+ echoedTimestamp: z.ZodOptional<z.ZodNumber>;
1404
+ }, z.core.$strip>, z.ZodObject<{
1405
+ type: z.ZodLiteral<"connection_rejected">;
1406
+ code: z.ZodString;
1407
+ message: z.ZodString;
1408
+ sessionId: z.ZodOptional<z.ZodString>;
1409
+ reconnectState: z.ZodOptional<z.ZodString>;
1410
+ expiredAt: z.ZodOptional<z.ZodNumber>;
1411
+ timestamp: z.ZodNumber;
1412
+ }, z.core.$strip>, z.ZodObject<{
1413
+ type: z.ZodLiteral<"protocol_error">;
1414
+ code: z.ZodString;
1415
+ message: z.ZodString;
1416
+ sessionId: z.ZodOptional<z.ZodString>;
1417
+ timestamp: z.ZodNumber;
1418
+ }, z.core.$strip>, z.ZodObject<{
1419
+ type: z.ZodLiteral<"presence">;
1420
+ event: z.ZodEnum<{
1421
+ session_join: "session_join";
1422
+ session_leave: "session_leave";
1423
+ presence_update: "presence_update";
1424
+ }>;
1425
+ participant: z.ZodOptional<z.ZodObject<{
1426
+ id: z.ZodString;
1427
+ role: z.ZodEnum<{
1428
+ lead: "lead";
1429
+ controller: "controller";
1430
+ observer: "observer";
1431
+ }>;
1432
+ transport: z.ZodEnum<{
1433
+ ws: "ws";
1434
+ sse: "sse";
1435
+ }>;
1436
+ subscriptions: z.ZodArray<z.ZodString>;
1437
+ connectedAt: z.ZodNumber;
1438
+ lastActivity: z.ZodNumber;
1439
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1440
+ }, z.core.$strip>>;
1441
+ participants: z.ZodOptional<z.ZodArray<z.ZodObject<{
1442
+ id: z.ZodString;
1443
+ role: z.ZodEnum<{
1444
+ lead: "lead";
1445
+ controller: "controller";
1446
+ observer: "observer";
1447
+ }>;
1448
+ transport: z.ZodEnum<{
1449
+ ws: "ws";
1450
+ sse: "sse";
1451
+ }>;
1452
+ subscriptions: z.ZodArray<z.ZodString>;
1453
+ connectedAt: z.ZodNumber;
1454
+ lastActivity: z.ZodNumber;
1455
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1456
+ }, z.core.$strip>>>;
1457
+ sessionId: z.ZodString;
1458
+ timestamp: z.ZodNumber;
1459
+ }, z.core.$strip>, z.ZodObject<{
1460
+ type: z.ZodLiteral<"broadcast">;
1461
+ event: z.ZodString;
1462
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1463
+ category: z.ZodString;
1464
+ sessionId: z.ZodString;
1465
+ timestamp: z.ZodNumber;
1466
+ }, z.core.$strip>, z.ZodObject<{
1467
+ type: z.ZodLiteral<"rpc_event">;
1468
+ event: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1469
+ timestamp: z.ZodNumber;
1470
+ }, z.core.$strip>, z.ZodObject<{
1471
+ type: z.ZodLiteral<"rpc_response">;
1472
+ response: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1473
+ }, z.core.$strip>, z.ZodObject<{
1474
+ type: z.ZodLiteral<"rpc_ui_request">;
1475
+ id: z.ZodString;
1476
+ method: z.ZodString;
1477
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1478
+ }, z.core.$strip>], "type">;
1479
+ export type ServerMessage = z.infer<typeof ServerMessageSchema>;
1480
+ /**
1481
+ * Initial session snapshot sent via SSE after connection.
1482
+ *
1483
+ * Contains the current session state, participants, and agent activity.
1484
+ */
1485
+ export declare const SseSessionSnapshotMessageSchema: z.ZodObject<{
1486
+ type: z.ZodLiteral<"snapshot">;
1487
+ sessionId: z.ZodString;
1488
+ label: z.ZodString;
1489
+ status: z.ZodString;
1490
+ createdAt: z.ZodString;
1491
+ mode: z.ZodEnum<{
1492
+ sandbox: "sandbox";
1493
+ tui: "tui";
1494
+ }>;
1495
+ participants: z.ZodArray<z.ZodObject<{
1496
+ id: z.ZodString;
1497
+ role: z.ZodString;
1498
+ transport: z.ZodString;
1499
+ connectedAt: z.ZodString;
1500
+ idle: z.ZodOptional<z.ZodBoolean>;
1501
+ }, z.core.$strip>>;
1502
+ taskCount: z.ZodNumber;
1503
+ agentActivity: z.ZodRecord<z.ZodString, z.ZodObject<{
1504
+ name: z.ZodOptional<z.ZodString>;
1505
+ status: z.ZodString;
1506
+ currentTool: z.ZodOptional<z.ZodString>;
1507
+ currentToolArgs: z.ZodOptional<z.ZodString>;
1508
+ toolCallCount: z.ZodNumber;
1509
+ lastActivity: z.ZodNumber;
1510
+ totalElapsed: z.ZodOptional<z.ZodNumber>;
1511
+ }, z.core.$strip>>;
1512
+ stream: z.ZodOptional<z.ZodObject<{
1513
+ output: z.ZodString;
1514
+ thinking: z.ZodString;
1515
+ tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
1516
+ output: z.ZodString;
1517
+ thinking: z.ZodString;
1518
+ }, z.core.$strip>>;
1519
+ }, z.core.$strip>>;
1520
+ }, z.core.$strip>;
1521
+ export type SseSessionSnapshotMessage = z.infer<typeof SseSessionSnapshotMessageSchema>;
1522
+ export declare const SseHydrationMessageSchema: z.ZodObject<{
1523
+ type: z.ZodLiteral<"hydration">;
1524
+ sessionId: z.ZodString;
1525
+ entries: z.ZodArray<z.ZodObject<{
1526
+ type: z.ZodEnum<{
1527
+ message: "message";
1528
+ thinking: "thinking";
1529
+ tool_call: "tool_call";
1530
+ tool_result: "tool_result";
1531
+ task_result: "task_result";
1532
+ runtime_status: "runtime_status";
1533
+ runtime_output: "runtime_output";
1534
+ runtime_preview: "runtime_preview";
1535
+ turn: "turn";
1536
+ user_prompt: "user_prompt";
1537
+ }>;
1538
+ agent: z.ZodOptional<z.ZodString>;
1539
+ content: z.ZodOptional<z.ZodString>;
1540
+ thinking: z.ZodOptional<z.ZodString>;
1541
+ toolName: z.ZodOptional<z.ZodString>;
1542
+ toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1543
+ toolCallId: z.ZodOptional<z.ZodString>;
1544
+ runtime: z.ZodOptional<z.ZodObject<{
1545
+ pid: z.ZodOptional<z.ZodNumber>;
1546
+ command: z.ZodOptional<z.ZodString>;
1547
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1548
+ cwd: z.ZodOptional<z.ZodString>;
1549
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1550
+ status: z.ZodOptional<z.ZodString>;
1551
+ exitCode: z.ZodOptional<z.ZodNumber>;
1552
+ signal: z.ZodOptional<z.ZodString>;
1553
+ }, z.core.$strip>>;
1554
+ preview: z.ZodOptional<z.ZodObject<{
1555
+ url: z.ZodOptional<z.ZodString>;
1556
+ port: z.ZodOptional<z.ZodNumber>;
1557
+ protocol: z.ZodOptional<z.ZodString>;
1558
+ path: z.ZodOptional<z.ZodString>;
1559
+ status: z.ZodOptional<z.ZodString>;
1560
+ }, z.core.$strip>>;
1561
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1562
+ type: z.ZodString;
1563
+ name: z.ZodOptional<z.ZodString>;
1564
+ url: z.ZodOptional<z.ZodString>;
1565
+ content: z.ZodOptional<z.ZodString>;
1566
+ mimeType: z.ZodOptional<z.ZodString>;
1567
+ size: z.ZodOptional<z.ZodNumber>;
1568
+ }, z.core.$strip>>>;
1569
+ author: z.ZodOptional<z.ZodObject<{
1570
+ userId: z.ZodOptional<z.ZodString>;
1571
+ displayName: z.ZodOptional<z.ZodString>;
1572
+ email: z.ZodOptional<z.ZodString>;
1573
+ avatarUrl: z.ZodOptional<z.ZodString>;
1574
+ actorType: z.ZodOptional<z.ZodEnum<{
1575
+ user: "user";
1576
+ api_key: "api_key";
1577
+ service: "service";
1578
+ }>>;
1579
+ apiKeyLabel: z.ZodOptional<z.ZodString>;
1580
+ }, z.core.$strip>>;
1581
+ isError: z.ZodOptional<z.ZodBoolean>;
1582
+ taskId: z.ZodOptional<z.ZodString>;
1583
+ turnId: z.ZodOptional<z.ZodString>;
1584
+ replyId: z.ZodOptional<z.ZodString>;
1585
+ sequence: z.ZodOptional<z.ZodNumber>;
1586
+ elapsedMs: z.ZodOptional<z.ZodNumber>;
1587
+ timestamp: z.ZodNumber;
1588
+ }, z.core.$strip>>;
1589
+ task: z.ZodOptional<z.ZodString>;
1590
+ stream: z.ZodOptional<z.ZodObject<{
1591
+ output: z.ZodString;
1592
+ thinking: z.ZodString;
1593
+ tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
1594
+ output: z.ZodString;
1595
+ thinking: z.ZodString;
1596
+ }, z.core.$strip>>;
1597
+ }, z.core.$strip>>;
1598
+ tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1599
+ taskId: z.ZodString;
1600
+ agent: z.ZodString;
1601
+ status: z.ZodEnum<{
1602
+ failed: "failed";
1603
+ completed: "completed";
1604
+ running: "running";
1605
+ }>;
1606
+ prompt: z.ZodString;
1607
+ startedAt: z.ZodOptional<z.ZodString>;
1608
+ completedAt: z.ZodOptional<z.ZodString>;
1609
+ duration: z.ZodOptional<z.ZodNumber>;
1610
+ result: z.ZodOptional<z.ZodString>;
1611
+ error: z.ZodOptional<z.ZodString>;
1612
+ }, z.core.$strip>>>;
1613
+ }, z.core.$strip>;
1614
+ export type SseHydrationMessage = z.infer<typeof SseHydrationMessageSchema>;
1615
+ /**
1616
+ * All possible SSE message types sent to observers.
1617
+ *
1618
+ * SSE connections receive a subset of server messages suitable for
1619
+ * read-only observation (snapshots, broadcasts, presence).
1620
+ */
1621
+ export declare const ObserverSseMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1622
+ type: z.ZodLiteral<"snapshot">;
1623
+ sessionId: z.ZodString;
1624
+ label: z.ZodString;
1625
+ status: z.ZodString;
1626
+ createdAt: z.ZodString;
1627
+ mode: z.ZodEnum<{
1628
+ sandbox: "sandbox";
1629
+ tui: "tui";
1630
+ }>;
1631
+ participants: z.ZodArray<z.ZodObject<{
1632
+ id: z.ZodString;
1633
+ role: z.ZodString;
1634
+ transport: z.ZodString;
1635
+ connectedAt: z.ZodString;
1636
+ idle: z.ZodOptional<z.ZodBoolean>;
1637
+ }, z.core.$strip>>;
1638
+ taskCount: z.ZodNumber;
1639
+ agentActivity: z.ZodRecord<z.ZodString, z.ZodObject<{
1640
+ name: z.ZodOptional<z.ZodString>;
1641
+ status: z.ZodString;
1642
+ currentTool: z.ZodOptional<z.ZodString>;
1643
+ currentToolArgs: z.ZodOptional<z.ZodString>;
1644
+ toolCallCount: z.ZodNumber;
1645
+ lastActivity: z.ZodNumber;
1646
+ totalElapsed: z.ZodOptional<z.ZodNumber>;
1647
+ }, z.core.$strip>>;
1648
+ stream: z.ZodOptional<z.ZodObject<{
1649
+ output: z.ZodString;
1650
+ thinking: z.ZodString;
1651
+ tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
1652
+ output: z.ZodString;
1653
+ thinking: z.ZodString;
1654
+ }, z.core.$strip>>;
1655
+ }, z.core.$strip>>;
1656
+ }, z.core.$strip>, z.ZodObject<{
1657
+ type: z.ZodLiteral<"hydration">;
1658
+ sessionId: z.ZodString;
1659
+ entries: z.ZodArray<z.ZodObject<{
1660
+ type: z.ZodEnum<{
1661
+ message: "message";
1662
+ thinking: "thinking";
1663
+ tool_call: "tool_call";
1664
+ tool_result: "tool_result";
1665
+ task_result: "task_result";
1666
+ runtime_status: "runtime_status";
1667
+ runtime_output: "runtime_output";
1668
+ runtime_preview: "runtime_preview";
1669
+ turn: "turn";
1670
+ user_prompt: "user_prompt";
1671
+ }>;
1672
+ agent: z.ZodOptional<z.ZodString>;
1673
+ content: z.ZodOptional<z.ZodString>;
1674
+ thinking: z.ZodOptional<z.ZodString>;
1675
+ toolName: z.ZodOptional<z.ZodString>;
1676
+ toolArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1677
+ toolCallId: z.ZodOptional<z.ZodString>;
1678
+ runtime: z.ZodOptional<z.ZodObject<{
1679
+ pid: z.ZodOptional<z.ZodNumber>;
1680
+ command: z.ZodOptional<z.ZodString>;
1681
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
1682
+ cwd: z.ZodOptional<z.ZodString>;
1683
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1684
+ status: z.ZodOptional<z.ZodString>;
1685
+ exitCode: z.ZodOptional<z.ZodNumber>;
1686
+ signal: z.ZodOptional<z.ZodString>;
1687
+ }, z.core.$strip>>;
1688
+ preview: z.ZodOptional<z.ZodObject<{
1689
+ url: z.ZodOptional<z.ZodString>;
1690
+ port: z.ZodOptional<z.ZodNumber>;
1691
+ protocol: z.ZodOptional<z.ZodString>;
1692
+ path: z.ZodOptional<z.ZodString>;
1693
+ status: z.ZodOptional<z.ZodString>;
1694
+ }, z.core.$strip>>;
1695
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1696
+ type: z.ZodString;
1697
+ name: z.ZodOptional<z.ZodString>;
1698
+ url: z.ZodOptional<z.ZodString>;
1699
+ content: z.ZodOptional<z.ZodString>;
1700
+ mimeType: z.ZodOptional<z.ZodString>;
1701
+ size: z.ZodOptional<z.ZodNumber>;
1702
+ }, z.core.$strip>>>;
1703
+ author: z.ZodOptional<z.ZodObject<{
1704
+ userId: z.ZodOptional<z.ZodString>;
1705
+ displayName: z.ZodOptional<z.ZodString>;
1706
+ email: z.ZodOptional<z.ZodString>;
1707
+ avatarUrl: z.ZodOptional<z.ZodString>;
1708
+ actorType: z.ZodOptional<z.ZodEnum<{
1709
+ user: "user";
1710
+ api_key: "api_key";
1711
+ service: "service";
1712
+ }>>;
1713
+ apiKeyLabel: z.ZodOptional<z.ZodString>;
1714
+ }, z.core.$strip>>;
1715
+ isError: z.ZodOptional<z.ZodBoolean>;
1716
+ taskId: z.ZodOptional<z.ZodString>;
1717
+ turnId: z.ZodOptional<z.ZodString>;
1718
+ replyId: z.ZodOptional<z.ZodString>;
1719
+ sequence: z.ZodOptional<z.ZodNumber>;
1720
+ elapsedMs: z.ZodOptional<z.ZodNumber>;
1721
+ timestamp: z.ZodNumber;
1722
+ }, z.core.$strip>>;
1723
+ task: z.ZodOptional<z.ZodString>;
1724
+ stream: z.ZodOptional<z.ZodObject<{
1725
+ output: z.ZodString;
1726
+ thinking: z.ZodString;
1727
+ tasks: z.ZodRecord<z.ZodString, z.ZodObject<{
1728
+ output: z.ZodString;
1729
+ thinking: z.ZodString;
1730
+ }, z.core.$strip>>;
1731
+ }, z.core.$strip>>;
1732
+ tasks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1733
+ taskId: z.ZodString;
1734
+ agent: z.ZodString;
1735
+ status: z.ZodEnum<{
1736
+ failed: "failed";
1737
+ completed: "completed";
1738
+ running: "running";
1739
+ }>;
1740
+ prompt: z.ZodString;
1741
+ startedAt: z.ZodOptional<z.ZodString>;
1742
+ completedAt: z.ZodOptional<z.ZodString>;
1743
+ duration: z.ZodOptional<z.ZodNumber>;
1744
+ result: z.ZodOptional<z.ZodString>;
1745
+ error: z.ZodOptional<z.ZodString>;
1746
+ }, z.core.$strip>>>;
1747
+ }, z.core.$strip>, z.ZodObject<{
1748
+ type: z.ZodLiteral<"presence">;
1749
+ event: z.ZodEnum<{
1750
+ session_join: "session_join";
1751
+ session_leave: "session_leave";
1752
+ presence_update: "presence_update";
1753
+ }>;
1754
+ participant: z.ZodOptional<z.ZodObject<{
1755
+ id: z.ZodString;
1756
+ role: z.ZodEnum<{
1757
+ lead: "lead";
1758
+ controller: "controller";
1759
+ observer: "observer";
1760
+ }>;
1761
+ transport: z.ZodEnum<{
1762
+ ws: "ws";
1763
+ sse: "sse";
1764
+ }>;
1765
+ subscriptions: z.ZodArray<z.ZodString>;
1766
+ connectedAt: z.ZodNumber;
1767
+ lastActivity: z.ZodNumber;
1768
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1769
+ }, z.core.$strip>>;
1770
+ participants: z.ZodOptional<z.ZodArray<z.ZodObject<{
1771
+ id: z.ZodString;
1772
+ role: z.ZodEnum<{
1773
+ lead: "lead";
1774
+ controller: "controller";
1775
+ observer: "observer";
1776
+ }>;
1777
+ transport: z.ZodEnum<{
1778
+ ws: "ws";
1779
+ sse: "sse";
1780
+ }>;
1781
+ subscriptions: z.ZodArray<z.ZodString>;
1782
+ connectedAt: z.ZodNumber;
1783
+ lastActivity: z.ZodNumber;
1784
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1785
+ }, z.core.$strip>>>;
1786
+ sessionId: z.ZodString;
1787
+ timestamp: z.ZodNumber;
1788
+ }, z.core.$strip>, z.ZodObject<{
1789
+ type: z.ZodLiteral<"broadcast">;
1790
+ event: z.ZodString;
1791
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1792
+ category: z.ZodString;
1793
+ sessionId: z.ZodString;
1794
+ timestamp: z.ZodNumber;
1795
+ }, z.core.$strip>], "type">;
1796
+ export type ObserverSseMessage = z.infer<typeof ObserverSseMessageSchema>;
1797
+ export declare const ConnectionParamsSchema: z.ZodObject<{
1798
+ agent: z.ZodOptional<z.ZodString>;
1799
+ parent: z.ZodOptional<z.ZodString>;
1800
+ sessionId: z.ZodOptional<z.ZodString>;
1801
+ task: z.ZodOptional<z.ZodString>;
1802
+ label: z.ZodOptional<z.ZodString>;
1803
+ orgId: z.ZodOptional<z.ZodString>;
1804
+ userId: z.ZodOptional<z.ZodString>;
1805
+ origin: z.ZodOptional<z.ZodEnum<{
1806
+ tui: "tui";
1807
+ web: "web";
1808
+ desktop: "desktop";
1809
+ sdk: "sdk";
1810
+ }>>;
1811
+ role: z.ZodOptional<z.ZodEnum<{
1812
+ lead: "lead";
1813
+ controller: "controller";
1814
+ observer: "observer";
1815
+ }>>;
1816
+ coordJobId: z.ZodOptional<z.ZodString>;
1817
+ coordRole: z.ZodOptional<z.ZodString>;
1818
+ driverMode: z.ZodOptional<z.ZodEnum<{
1819
+ rpc: "rpc";
1820
+ }>>;
1821
+ driverInstanceId: z.ZodOptional<z.ZodString>;
1822
+ driverVersion: z.ZodOptional<z.ZodString>;
1823
+ }, z.core.$strip>;
1824
+ export type ConnectionParams = z.infer<typeof ConnectionParamsSchema>;
1825
+ /**
1826
+ * Parse unknown data as a server message.
1827
+ *
1828
+ * @param data - The raw data to parse (typically from JSON.parse)
1829
+ * @returns The parsed server message, or null if invalid
1830
+ *
1831
+ * @example
1832
+ * ```typescript
1833
+ * const raw = JSON.parse(event.data);
1834
+ * const message = parseServerMessage(raw);
1835
+ * if (message?.type === 'init') {
1836
+ * console.log('Connected to session:', message.sessionId);
1837
+ * }
1838
+ * ```
1839
+ */
1840
+ export declare function parseServerMessage(data: unknown): ServerMessage | null;
1841
+ /**
1842
+ * Parse unknown data as a client message.
1843
+ *
1844
+ * @param data - The raw data to parse (typically from JSON.parse)
1845
+ * @returns The parsed client message, or null if invalid
1846
+ */
1847
+ export declare function parseClientMessage(data: unknown): ClientMessage | null;
1848
+ /**
1849
+ * Parse unknown data as an SSE observer message.
1850
+ *
1851
+ * @param data - The raw data to parse (typically from SSE event data)
1852
+ * @returns The parsed SSE message, or null if invalid
1853
+ */
1854
+ export declare function parseObserverSseMessage(data: unknown): ObserverSseMessage | null;
1855
+ //# sourceMappingURL=protocol.d.ts.map