@agentuity/core 2.0.10 → 2.0.12

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