@aiworker/sdk 1.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/API.md +575 -0
  2. package/DOCUMENTATION.md +120 -0
  3. package/GUEST_SERVICES.md +166 -0
  4. package/LICENSE +21 -0
  5. package/README.md +249 -0
  6. package/dist/api-version.d.ts +6 -0
  7. package/dist/api-version.js +5 -0
  8. package/dist/contract.d.ts +504 -0
  9. package/dist/contract.js +256 -0
  10. package/dist/host-version.d.ts +16 -0
  11. package/dist/host-version.js +50 -0
  12. package/dist/host.d.ts +107 -0
  13. package/dist/host.js +639 -0
  14. package/dist/index.d.ts +13 -0
  15. package/dist/index.js +8 -0
  16. package/dist/manifest.d.ts +303 -0
  17. package/dist/manifest.js +222 -0
  18. package/dist/parse.d.ts +293 -0
  19. package/dist/parse.js +398 -0
  20. package/dist/protocol.d.ts +1148 -0
  21. package/dist/protocol.js +473 -0
  22. package/dist/schemas.d.ts +4 -0
  23. package/dist/schemas.js +6 -0
  24. package/dist/scrollbar-style.d.ts +2 -0
  25. package/dist/scrollbar-style.js +32 -0
  26. package/dist/ui/badge.d.ts +10 -0
  27. package/dist/ui/badge.js +26 -0
  28. package/dist/ui/banner.d.ts +13 -0
  29. package/dist/ui/banner.js +48 -0
  30. package/dist/ui/button.d.ts +14 -0
  31. package/dist/ui/button.js +49 -0
  32. package/dist/ui/checkbox.d.ts +12 -0
  33. package/dist/ui/checkbox.js +45 -0
  34. package/dist/ui/dom.d.ts +15 -0
  35. package/dist/ui/dom.js +60 -0
  36. package/dist/ui/empty.d.ts +11 -0
  37. package/dist/ui/empty.js +44 -0
  38. package/dist/ui/field.d.ts +18 -0
  39. package/dist/ui/field.js +49 -0
  40. package/dist/ui/icons.d.ts +10 -0
  41. package/dist/ui/icons.js +23 -0
  42. package/dist/ui/index.d.ts +35 -0
  43. package/dist/ui/index.js +17 -0
  44. package/dist/ui/list.d.ts +26 -0
  45. package/dist/ui/list.js +90 -0
  46. package/dist/ui/menu.d.ts +20 -0
  47. package/dist/ui/menu.js +115 -0
  48. package/dist/ui/navigation.d.ts +18 -0
  49. package/dist/ui/navigation.js +38 -0
  50. package/dist/ui/option.d.ts +16 -0
  51. package/dist/ui/option.js +35 -0
  52. package/dist/ui/popup.d.ts +5 -0
  53. package/dist/ui/popup.js +43 -0
  54. package/dist/ui/progress.d.ts +11 -0
  55. package/dist/ui/progress.js +44 -0
  56. package/dist/ui/search.d.ts +11 -0
  57. package/dist/ui/search.js +62 -0
  58. package/dist/ui/select.d.ts +22 -0
  59. package/dist/ui/select.js +168 -0
  60. package/dist/ui/separator.d.ts +6 -0
  61. package/dist/ui/separator.js +26 -0
  62. package/dist/ui/spinner.d.ts +8 -0
  63. package/dist/ui/spinner.js +29 -0
  64. package/dist/ui/style.d.ts +1 -0
  65. package/dist/ui/style.js +202 -0
  66. package/dist/ui/tabs.d.ts +15 -0
  67. package/dist/ui/tabs.js +61 -0
  68. package/dist/ui/text.d.ts +23 -0
  69. package/dist/ui/text.js +89 -0
  70. package/dist/ui/theme.d.ts +22 -0
  71. package/dist/ui/theme.js +79 -0
  72. package/dist/workspace-schemas.d.ts +136 -0
  73. package/dist/workspace-schemas.js +44 -0
  74. package/dist/workspace.d.ts +109 -0
  75. package/dist/workspace.js +4 -0
  76. package/package.json +55 -0
  77. package/scripts/bundle-guest.ts +44 -0
@@ -0,0 +1,1148 @@
1
+ import { z } from 'zod';
2
+ import { type GuestMessage, type HostMessage } from './contract.ts';
3
+ export declare const hostMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
4
+ type: z.ZodLiteral<"workspace">;
5
+ payload: z.ZodObject<{
6
+ subscriptionId: z.ZodString;
7
+ snapshot: z.ZodDiscriminatedUnion<[z.ZodObject<{
8
+ kind: z.ZodLiteral<"projects">;
9
+ state: z.ZodEnum<{
10
+ loading: "loading";
11
+ ready: "ready";
12
+ error: "error";
13
+ }>;
14
+ projects: z.ZodArray<z.ZodObject<{
15
+ id: z.ZodString;
16
+ name: z.ZodString;
17
+ directory: z.ZodString;
18
+ }, z.core.$strip>>;
19
+ }, z.core.$strip>, z.ZodObject<{
20
+ kind: z.ZodLiteral<"worktrees">;
21
+ projectId: z.ZodString;
22
+ state: z.ZodEnum<{
23
+ loading: "loading";
24
+ ready: "ready";
25
+ error: "error";
26
+ }>;
27
+ worktrees: z.ZodArray<z.ZodObject<{
28
+ directory: z.ZodString;
29
+ name: z.ZodString;
30
+ branch: z.ZodString;
31
+ status: z.ZodEnum<{
32
+ ready: "ready";
33
+ pending: "pending";
34
+ invalid: "invalid";
35
+ missing: "missing";
36
+ }>;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>, z.ZodObject<{
39
+ kind: z.ZodLiteral<"sessions">;
40
+ projectId: z.ZodString;
41
+ state: z.ZodEnum<{
42
+ loading: "loading";
43
+ ready: "ready";
44
+ error: "error";
45
+ }>;
46
+ coverage: z.ZodArray<z.ZodObject<{
47
+ directory: z.ZodString;
48
+ state: z.ZodEnum<{
49
+ loading: "loading";
50
+ ready: "ready";
51
+ error: "error";
52
+ }>;
53
+ }, z.core.$strip>>;
54
+ sessions: z.ZodArray<z.ZodObject<{
55
+ id: z.ZodString;
56
+ title: z.ZodString;
57
+ projectId: z.ZodString;
58
+ directory: z.ZodString;
59
+ parentId: z.ZodNullable<z.ZodString>;
60
+ createdAt: z.ZodNumber;
61
+ updatedAt: z.ZodNumber;
62
+ archivedAt: z.ZodNullable<z.ZodNumber>;
63
+ worktree: z.ZodNullable<z.ZodObject<{
64
+ directory: z.ZodString;
65
+ name: z.ZodString;
66
+ branch: z.ZodString;
67
+ status: z.ZodEnum<{
68
+ ready: "ready";
69
+ pending: "pending";
70
+ invalid: "invalid";
71
+ missing: "missing";
72
+ }>;
73
+ }, z.core.$strip>>;
74
+ activity: z.ZodEnum<{
75
+ unknown: "unknown";
76
+ idle: "idle";
77
+ running: "running";
78
+ retrying: "retrying";
79
+ "waiting-permission": "waiting-permission";
80
+ "waiting-question": "waiting-question";
81
+ }>;
82
+ outcome: z.ZodNullable<z.ZodEnum<{
83
+ completed: "completed";
84
+ failed: "failed";
85
+ }>>;
86
+ items: z.ZodArray<z.ZodObject<{
87
+ id: z.ZodString;
88
+ data: z.ZodOptional<z.ZodJSONSchema>;
89
+ }, z.core.$strip>>;
90
+ }, z.core.$strip>>;
91
+ }, z.core.$strip>], "kind">;
92
+ }, z.core.$strip>;
93
+ channel: z.ZodLiteral<"aiworker.sdk">;
94
+ v: z.ZodLiteral<1>;
95
+ }, z.core.$strip>, z.ZodObject<{
96
+ type: z.ZodLiteral<"ready">;
97
+ payload: z.ZodObject<{
98
+ theme: z.ZodObject<{
99
+ mode: z.ZodEnum<{
100
+ light: "light";
101
+ dark: "dark";
102
+ }>;
103
+ tokens: z.ZodObject<{
104
+ background: z.ZodString;
105
+ elevated: z.ZodString;
106
+ foreground: z.ZodString;
107
+ muted: z.ZodString;
108
+ subtle: z.ZodString;
109
+ border: z.ZodString;
110
+ hover: z.ZodString;
111
+ selection: z.ZodString;
112
+ focus: z.ZodString;
113
+ primary: z.ZodString;
114
+ mutedSurface: z.ZodString;
115
+ elevatedForeground: z.ZodString;
116
+ active: z.ZodString;
117
+ selectionForeground: z.ZodString;
118
+ primaryForeground: z.ZodString;
119
+ primaryText: z.ZodString;
120
+ successText: z.ZodString;
121
+ warningText: z.ZodString;
122
+ errorText: z.ZodString;
123
+ infoText: z.ZodString;
124
+ success: z.ZodString;
125
+ warning: z.ZodString;
126
+ error: z.ZodString;
127
+ info: z.ZodString;
128
+ font: z.ZodString;
129
+ mono: z.ZodString;
130
+ radius: z.ZodString;
131
+ }, z.core.$strip>;
132
+ }, z.core.$strip>;
133
+ locale: z.ZodString;
134
+ directory: z.ZodNullable<z.ZodString>;
135
+ session: z.ZodNullable<z.ZodObject<{
136
+ id: z.ZodString;
137
+ title: z.ZodString;
138
+ busy: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
139
+ model: z.ZodOptional<z.ZodString>;
140
+ agent: z.ZodOptional<z.ZodString>;
141
+ }, z.core.$strip>>;
142
+ surface: z.ZodEnum<{
143
+ panel: "panel";
144
+ dialog: "dialog";
145
+ page: "page";
146
+ background: "background";
147
+ }>;
148
+ connection: z.ZodObject<{
149
+ connected: z.ZodBoolean;
150
+ account: z.ZodString;
151
+ }, z.core.$strip>;
152
+ settings: z.ZodRecord<z.ZodString, z.ZodString>;
153
+ item: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
154
+ kind: z.ZodLiteral<"message">;
155
+ action: z.ZodString;
156
+ sessionId: z.ZodString;
157
+ sessionTitle: z.ZodString;
158
+ directory: z.ZodNullable<z.ZodString>;
159
+ messageId: z.ZodString;
160
+ role: z.ZodEnum<{
161
+ user: "user";
162
+ assistant: "assistant";
163
+ }>;
164
+ text: z.ZodString;
165
+ }, z.core.$strip>, z.ZodObject<{
166
+ kind: z.ZodLiteral<"session">;
167
+ action: z.ZodString;
168
+ sessionId: z.ZodString;
169
+ sessionTitle: z.ZodString;
170
+ directory: z.ZodNullable<z.ZodString>;
171
+ messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
172
+ id: z.ZodString;
173
+ role: z.ZodEnum<{
174
+ user: "user";
175
+ assistant: "assistant";
176
+ }>;
177
+ text: z.ZodString;
178
+ createdAt: z.ZodNumber;
179
+ }, z.core.$strip>>>;
180
+ truncated: z.ZodOptional<z.ZodBoolean>;
181
+ }, z.core.$strip>, z.ZodObject<{
182
+ providerId: z.ZodString;
183
+ id: z.ZodString;
184
+ title: z.ZodString;
185
+ url: z.ZodString;
186
+ text: z.ZodOptional<z.ZodString>;
187
+ kind: z.ZodOptional<z.ZodEnum<{
188
+ issue: "issue";
189
+ pull: "pull";
190
+ }>>;
191
+ author: z.ZodOptional<z.ZodString>;
192
+ branches: z.ZodOptional<z.ZodObject<{
193
+ head: z.ZodString;
194
+ base: z.ZodString;
195
+ }, z.core.$strip>>;
196
+ data: z.ZodOptional<z.ZodJSONSchema>;
197
+ }, z.core.$strip>]>>;
198
+ }, z.core.$strip>;
199
+ channel: z.ZodLiteral<"aiworker.sdk">;
200
+ v: z.ZodLiteral<1>;
201
+ }, z.core.$strip>, z.ZodObject<{
202
+ type: z.ZodLiteral<"directory">;
203
+ payload: z.ZodObject<{
204
+ directory: z.ZodNullable<z.ZodString>;
205
+ }, z.core.$strip>;
206
+ channel: z.ZodLiteral<"aiworker.sdk">;
207
+ v: z.ZodLiteral<1>;
208
+ }, z.core.$strip>, z.ZodObject<{
209
+ type: z.ZodLiteral<"session">;
210
+ payload: z.ZodObject<{
211
+ session: z.ZodNullable<z.ZodObject<{
212
+ id: z.ZodString;
213
+ title: z.ZodString;
214
+ busy: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
215
+ model: z.ZodOptional<z.ZodString>;
216
+ agent: z.ZodOptional<z.ZodString>;
217
+ }, z.core.$strip>>;
218
+ }, z.core.$strip>;
219
+ channel: z.ZodLiteral<"aiworker.sdk">;
220
+ v: z.ZodLiteral<1>;
221
+ }, z.core.$strip>, z.ZodObject<{
222
+ type: z.ZodLiteral<"connection">;
223
+ payload: z.ZodObject<{
224
+ connection: z.ZodObject<{
225
+ connected: z.ZodBoolean;
226
+ account: z.ZodString;
227
+ }, z.core.$strip>;
228
+ }, z.core.$strip>;
229
+ channel: z.ZodLiteral<"aiworker.sdk">;
230
+ v: z.ZodLiteral<1>;
231
+ }, z.core.$strip>, z.ZodObject<{
232
+ type: z.ZodLiteral<"settings">;
233
+ payload: z.ZodObject<{
234
+ settings: z.ZodRecord<z.ZodString, z.ZodString>;
235
+ }, z.core.$strip>;
236
+ channel: z.ZodLiteral<"aiworker.sdk">;
237
+ v: z.ZodLiteral<1>;
238
+ }, z.core.$strip>, z.ZodObject<{
239
+ type: z.ZodLiteral<"session-lifecycle">;
240
+ payload: z.ZodObject<{
241
+ sessionId: z.ZodString;
242
+ phase: z.ZodEnum<{
243
+ completed: "completed";
244
+ started: "started";
245
+ failure: "failure";
246
+ }>;
247
+ }, z.core.$strip>;
248
+ channel: z.ZodLiteral<"aiworker.sdk">;
249
+ v: z.ZodLiteral<1>;
250
+ }, z.core.$strip>, z.ZodObject<{
251
+ type: z.ZodLiteral<"item">;
252
+ payload: z.ZodObject<{
253
+ item: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
254
+ kind: z.ZodLiteral<"message">;
255
+ action: z.ZodString;
256
+ sessionId: z.ZodString;
257
+ sessionTitle: z.ZodString;
258
+ directory: z.ZodNullable<z.ZodString>;
259
+ messageId: z.ZodString;
260
+ role: z.ZodEnum<{
261
+ user: "user";
262
+ assistant: "assistant";
263
+ }>;
264
+ text: z.ZodString;
265
+ }, z.core.$strip>, z.ZodObject<{
266
+ kind: z.ZodLiteral<"session">;
267
+ action: z.ZodString;
268
+ sessionId: z.ZodString;
269
+ sessionTitle: z.ZodString;
270
+ directory: z.ZodNullable<z.ZodString>;
271
+ messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
272
+ id: z.ZodString;
273
+ role: z.ZodEnum<{
274
+ user: "user";
275
+ assistant: "assistant";
276
+ }>;
277
+ text: z.ZodString;
278
+ createdAt: z.ZodNumber;
279
+ }, z.core.$strip>>>;
280
+ truncated: z.ZodOptional<z.ZodBoolean>;
281
+ }, z.core.$strip>, z.ZodObject<{
282
+ providerId: z.ZodString;
283
+ id: z.ZodString;
284
+ title: z.ZodString;
285
+ url: z.ZodString;
286
+ text: z.ZodOptional<z.ZodString>;
287
+ kind: z.ZodOptional<z.ZodEnum<{
288
+ issue: "issue";
289
+ pull: "pull";
290
+ }>>;
291
+ author: z.ZodOptional<z.ZodString>;
292
+ branches: z.ZodOptional<z.ZodObject<{
293
+ head: z.ZodString;
294
+ base: z.ZodString;
295
+ }, z.core.$strip>>;
296
+ data: z.ZodOptional<z.ZodJSONSchema>;
297
+ }, z.core.$strip>]>>;
298
+ }, z.core.$strip>;
299
+ channel: z.ZodLiteral<"aiworker.sdk">;
300
+ v: z.ZodLiteral<1>;
301
+ }, z.core.$strip>, z.ZodObject<{
302
+ type: z.ZodLiteral<"resolve">;
303
+ id: z.ZodString;
304
+ payload: z.ZodObject<{
305
+ command: z.ZodString;
306
+ args: z.ZodString;
307
+ }, z.core.$strip>;
308
+ channel: z.ZodLiteral<"aiworker.sdk">;
309
+ v: z.ZodLiteral<1>;
310
+ }, z.core.$strip>, z.ZodPipe<z.ZodObject<{
311
+ type: z.ZodLiteral<"result">;
312
+ id: z.ZodString;
313
+ ok: z.ZodBoolean;
314
+ error: z.ZodOptional<z.ZodString>;
315
+ code: z.ZodOptional<z.ZodString>;
316
+ payload: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
317
+ storage: z.ZodLiteral<true>;
318
+ op: z.ZodLiteral<"get">;
319
+ found: z.ZodLiteral<false>;
320
+ }, z.core.$strip>, z.ZodObject<{
321
+ storage: z.ZodLiteral<true>;
322
+ op: z.ZodLiteral<"get">;
323
+ found: z.ZodLiteral<true>;
324
+ value: z.ZodJSONSchema;
325
+ }, z.core.$strip>, z.ZodObject<{
326
+ storage: z.ZodLiteral<true>;
327
+ op: z.ZodEnum<{
328
+ delete: "delete";
329
+ set: "set";
330
+ }>;
331
+ }, z.core.$strip>, z.ZodObject<{
332
+ storage: z.ZodLiteral<true>;
333
+ op: z.ZodLiteral<"keys">;
334
+ keys: z.ZodArray<z.ZodString>;
335
+ }, z.core.$strip>]>, z.ZodDiscriminatedUnion<[z.ZodObject<{
336
+ kind: z.ZodLiteral<"projects">;
337
+ state: z.ZodEnum<{
338
+ loading: "loading";
339
+ ready: "ready";
340
+ error: "error";
341
+ }>;
342
+ projects: z.ZodArray<z.ZodObject<{
343
+ id: z.ZodString;
344
+ name: z.ZodString;
345
+ directory: z.ZodString;
346
+ }, z.core.$strip>>;
347
+ }, z.core.$strip>, z.ZodObject<{
348
+ kind: z.ZodLiteral<"worktrees">;
349
+ projectId: z.ZodString;
350
+ state: z.ZodEnum<{
351
+ loading: "loading";
352
+ ready: "ready";
353
+ error: "error";
354
+ }>;
355
+ worktrees: z.ZodArray<z.ZodObject<{
356
+ directory: z.ZodString;
357
+ name: z.ZodString;
358
+ branch: z.ZodString;
359
+ status: z.ZodEnum<{
360
+ ready: "ready";
361
+ pending: "pending";
362
+ invalid: "invalid";
363
+ missing: "missing";
364
+ }>;
365
+ }, z.core.$strip>>;
366
+ }, z.core.$strip>, z.ZodObject<{
367
+ kind: z.ZodLiteral<"sessions">;
368
+ projectId: z.ZodString;
369
+ state: z.ZodEnum<{
370
+ loading: "loading";
371
+ ready: "ready";
372
+ error: "error";
373
+ }>;
374
+ coverage: z.ZodArray<z.ZodObject<{
375
+ directory: z.ZodString;
376
+ state: z.ZodEnum<{
377
+ loading: "loading";
378
+ ready: "ready";
379
+ error: "error";
380
+ }>;
381
+ }, z.core.$strip>>;
382
+ sessions: z.ZodArray<z.ZodObject<{
383
+ id: z.ZodString;
384
+ title: z.ZodString;
385
+ projectId: z.ZodString;
386
+ directory: z.ZodString;
387
+ parentId: z.ZodNullable<z.ZodString>;
388
+ createdAt: z.ZodNumber;
389
+ updatedAt: z.ZodNumber;
390
+ archivedAt: z.ZodNullable<z.ZodNumber>;
391
+ worktree: z.ZodNullable<z.ZodObject<{
392
+ directory: z.ZodString;
393
+ name: z.ZodString;
394
+ branch: z.ZodString;
395
+ status: z.ZodEnum<{
396
+ ready: "ready";
397
+ pending: "pending";
398
+ invalid: "invalid";
399
+ missing: "missing";
400
+ }>;
401
+ }, z.core.$strip>>;
402
+ activity: z.ZodEnum<{
403
+ unknown: "unknown";
404
+ idle: "idle";
405
+ running: "running";
406
+ retrying: "retrying";
407
+ "waiting-permission": "waiting-permission";
408
+ "waiting-question": "waiting-question";
409
+ }>;
410
+ outcome: z.ZodNullable<z.ZodEnum<{
411
+ completed: "completed";
412
+ failed: "failed";
413
+ }>>;
414
+ items: z.ZodArray<z.ZodObject<{
415
+ id: z.ZodString;
416
+ data: z.ZodOptional<z.ZodJSONSchema>;
417
+ }, z.core.$strip>>;
418
+ }, z.core.$strip>>;
419
+ }, z.core.$strip>], "kind">, z.ZodUnion<readonly [z.ZodObject<{
420
+ sessionId: z.ZodString;
421
+ sent: z.ZodEnum<{
422
+ failed: "failed";
423
+ sent: "sent";
424
+ "no-model": "no-model";
425
+ skipped: "skipped";
426
+ }>;
427
+ directory: z.ZodOptional<z.ZodString>;
428
+ worktree: z.ZodOptional<z.ZodObject<{
429
+ directory: z.ZodString;
430
+ name: z.ZodString;
431
+ branch: z.ZodString;
432
+ status: z.ZodEnum<{
433
+ ready: "ready";
434
+ pending: "pending";
435
+ invalid: "invalid";
436
+ missing: "missing";
437
+ }>;
438
+ }, z.core.$strip>>;
439
+ linked: z.ZodOptional<z.ZodBoolean>;
440
+ }, z.core.$strip>, z.ZodObject<{
441
+ sessionId: z.ZodNull;
442
+ sent: z.ZodLiteral<"skipped">;
443
+ directory: z.ZodString;
444
+ worktree: z.ZodObject<{
445
+ directory: z.ZodString;
446
+ name: z.ZodString;
447
+ branch: z.ZodString;
448
+ status: z.ZodEnum<{
449
+ ready: "ready";
450
+ pending: "pending";
451
+ invalid: "invalid";
452
+ missing: "missing";
453
+ }>;
454
+ }, z.core.$strip>;
455
+ failure: z.ZodEnum<{
456
+ "bootstrap-failed": "bootstrap-failed";
457
+ "session-create-failed": "session-create-failed";
458
+ }>;
459
+ }, z.core.$strip>]>, z.ZodObject<{
460
+ status: z.ZodNumber;
461
+ body: z.ZodString;
462
+ }, z.core.$strip>, z.ZodObject<{
463
+ sent: z.ZodEnum<{
464
+ failed: "failed";
465
+ sent: "sent";
466
+ "no-model": "no-model";
467
+ skipped: "skipped";
468
+ }>;
469
+ }, z.core.$strip>, z.ZodObject<{
470
+ status: z.ZodEnum<{
471
+ ready: "ready";
472
+ failed: "failed";
473
+ stopped: "stopped";
474
+ starting: "starting";
475
+ }>;
476
+ }, z.core.$strip>, z.ZodObject<{
477
+ content: z.ZodString;
478
+ }, z.core.$strip>, z.ZodObject<{
479
+ written: z.ZodLiteral<true>;
480
+ }, z.core.$strip>, z.ZodObject<{
481
+ entries: z.ZodArray<z.ZodObject<{
482
+ name: z.ZodString;
483
+ kind: z.ZodEnum<{
484
+ file: "file";
485
+ directory: "directory";
486
+ other: "other";
487
+ }>;
488
+ }, z.core.$strip>>;
489
+ }, z.core.$strip>, z.ZodObject<{
490
+ kind: z.ZodEnum<{
491
+ missing: "missing";
492
+ file: "file";
493
+ directory: "directory";
494
+ other: "other";
495
+ }>;
496
+ size: z.ZodNumber;
497
+ mtime: z.ZodNumber;
498
+ }, z.core.$strip>, z.ZodObject<{
499
+ text: z.ZodString;
500
+ }, z.core.$strip>]>>;
501
+ channel: z.ZodLiteral<"aiworker.sdk">;
502
+ v: z.ZodLiteral<1>;
503
+ }, z.core.$strip>, z.ZodTransform<{
504
+ channel: "aiworker.sdk";
505
+ v: 1;
506
+ type: "result";
507
+ id: string;
508
+ ok: true;
509
+ payload: {
510
+ kind: "projects";
511
+ state: "loading" | "ready" | "error";
512
+ projects: {
513
+ id: string;
514
+ name: string;
515
+ directory: string;
516
+ }[];
517
+ } | {
518
+ kind: "worktrees";
519
+ projectId: string;
520
+ state: "loading" | "ready" | "error";
521
+ worktrees: {
522
+ directory: string;
523
+ name: string;
524
+ branch: string;
525
+ status: "ready" | "pending" | "invalid" | "missing";
526
+ }[];
527
+ } | {
528
+ kind: "sessions";
529
+ projectId: string;
530
+ state: "loading" | "ready" | "error";
531
+ coverage: {
532
+ directory: string;
533
+ state: "loading" | "ready" | "error";
534
+ }[];
535
+ sessions: {
536
+ id: string;
537
+ title: string;
538
+ projectId: string;
539
+ directory: string;
540
+ parentId: string | null;
541
+ createdAt: number;
542
+ updatedAt: number;
543
+ archivedAt: number | null;
544
+ worktree: {
545
+ directory: string;
546
+ name: string;
547
+ branch: string;
548
+ status: "ready" | "pending" | "invalid" | "missing";
549
+ } | null;
550
+ activity: "unknown" | "idle" | "running" | "retrying" | "waiting-permission" | "waiting-question";
551
+ outcome: "completed" | "failed" | null;
552
+ items: {
553
+ id: string;
554
+ data?: z.core.util.JSONType | undefined;
555
+ }[];
556
+ }[];
557
+ } | {
558
+ storage: true;
559
+ op: "get";
560
+ found: false;
561
+ } | {
562
+ storage: true;
563
+ op: "get";
564
+ found: true;
565
+ value: z.core.util.JSONType;
566
+ } | {
567
+ storage: true;
568
+ op: "delete" | "set";
569
+ } | {
570
+ storage: true;
571
+ op: "keys";
572
+ keys: string[];
573
+ } | {
574
+ status: number;
575
+ body: string;
576
+ } | {
577
+ sessionId: string;
578
+ sent: "failed" | "sent" | "no-model" | "skipped";
579
+ directory?: string | undefined;
580
+ worktree?: {
581
+ directory: string;
582
+ name: string;
583
+ branch: string;
584
+ status: "ready" | "pending" | "invalid" | "missing";
585
+ } | undefined;
586
+ linked?: boolean | undefined;
587
+ } | {
588
+ sessionId: null;
589
+ sent: "skipped";
590
+ directory: string;
591
+ worktree: {
592
+ directory: string;
593
+ name: string;
594
+ branch: string;
595
+ status: "ready" | "pending" | "invalid" | "missing";
596
+ };
597
+ failure: "bootstrap-failed" | "session-create-failed";
598
+ } | {
599
+ sent: "failed" | "sent" | "no-model" | "skipped";
600
+ } | {
601
+ status: "ready" | "failed" | "stopped" | "starting";
602
+ } | {
603
+ content: string;
604
+ } | {
605
+ written: true;
606
+ } | {
607
+ entries: {
608
+ name: string;
609
+ kind: "file" | "directory" | "other";
610
+ }[];
611
+ } | {
612
+ kind: "missing" | "file" | "directory" | "other";
613
+ size: number;
614
+ mtime: number;
615
+ } | {
616
+ text: string;
617
+ };
618
+ error?: undefined;
619
+ code?: undefined;
620
+ } | {
621
+ channel: "aiworker.sdk";
622
+ v: 1;
623
+ type: "result";
624
+ id: string;
625
+ ok: true;
626
+ payload?: undefined;
627
+ error?: undefined;
628
+ code?: undefined;
629
+ } | {
630
+ channel: "aiworker.sdk";
631
+ v: 1;
632
+ type: "result";
633
+ id: string;
634
+ ok: false;
635
+ error: string;
636
+ code: "HOST_UNAVAILABLE" | "HOST_TIMEOUT" | "HOST_REJECTED" | "DISCONNECTED" | "DISABLED" | "BAD_PATH" | "NO_INTEGRATION" | "NO_SERVICE" | "SERVICE_FAILED" | "NO_SESSION" | "SESSION_BUSY" | "NOT_GRANTED" | "NO_DIRECTORY" | "NOT_FOUND" | "FILE_TOO_LARGE" | "DENIED" | "NO_MODEL" | "MODEL_FAILED";
637
+ payload?: undefined;
638
+ }, {
639
+ type: "result";
640
+ id: string;
641
+ ok: boolean;
642
+ channel: "aiworker.sdk";
643
+ v: 1;
644
+ error?: string | undefined;
645
+ code?: string | undefined;
646
+ payload?: {
647
+ kind: "projects";
648
+ state: "loading" | "ready" | "error";
649
+ projects: {
650
+ id: string;
651
+ name: string;
652
+ directory: string;
653
+ }[];
654
+ } | {
655
+ kind: "worktrees";
656
+ projectId: string;
657
+ state: "loading" | "ready" | "error";
658
+ worktrees: {
659
+ directory: string;
660
+ name: string;
661
+ branch: string;
662
+ status: "ready" | "pending" | "invalid" | "missing";
663
+ }[];
664
+ } | {
665
+ kind: "sessions";
666
+ projectId: string;
667
+ state: "loading" | "ready" | "error";
668
+ coverage: {
669
+ directory: string;
670
+ state: "loading" | "ready" | "error";
671
+ }[];
672
+ sessions: {
673
+ id: string;
674
+ title: string;
675
+ projectId: string;
676
+ directory: string;
677
+ parentId: string | null;
678
+ createdAt: number;
679
+ updatedAt: number;
680
+ archivedAt: number | null;
681
+ worktree: {
682
+ directory: string;
683
+ name: string;
684
+ branch: string;
685
+ status: "ready" | "pending" | "invalid" | "missing";
686
+ } | null;
687
+ activity: "unknown" | "idle" | "running" | "retrying" | "waiting-permission" | "waiting-question";
688
+ outcome: "completed" | "failed" | null;
689
+ items: {
690
+ id: string;
691
+ data?: z.core.util.JSONType | undefined;
692
+ }[];
693
+ }[];
694
+ } | {
695
+ storage: true;
696
+ op: "get";
697
+ found: false;
698
+ } | {
699
+ storage: true;
700
+ op: "get";
701
+ found: true;
702
+ value: z.core.util.JSONType;
703
+ } | {
704
+ storage: true;
705
+ op: "delete" | "set";
706
+ } | {
707
+ storage: true;
708
+ op: "keys";
709
+ keys: string[];
710
+ } | {
711
+ status: number;
712
+ body: string;
713
+ } | {
714
+ sessionId: string;
715
+ sent: "failed" | "sent" | "no-model" | "skipped";
716
+ directory?: string | undefined;
717
+ worktree?: {
718
+ directory: string;
719
+ name: string;
720
+ branch: string;
721
+ status: "ready" | "pending" | "invalid" | "missing";
722
+ } | undefined;
723
+ linked?: boolean | undefined;
724
+ } | {
725
+ sessionId: null;
726
+ sent: "skipped";
727
+ directory: string;
728
+ worktree: {
729
+ directory: string;
730
+ name: string;
731
+ branch: string;
732
+ status: "ready" | "pending" | "invalid" | "missing";
733
+ };
734
+ failure: "bootstrap-failed" | "session-create-failed";
735
+ } | {
736
+ sent: "failed" | "sent" | "no-model" | "skipped";
737
+ } | {
738
+ status: "ready" | "failed" | "stopped" | "starting";
739
+ } | {
740
+ content: string;
741
+ } | {
742
+ written: true;
743
+ } | {
744
+ entries: {
745
+ name: string;
746
+ kind: "file" | "directory" | "other";
747
+ }[];
748
+ } | {
749
+ kind: "missing" | "file" | "directory" | "other";
750
+ size: number;
751
+ mtime: number;
752
+ } | {
753
+ text: string;
754
+ } | undefined;
755
+ }>>, z.ZodObject<{
756
+ type: z.ZodLiteral<"action">;
757
+ id: z.ZodString;
758
+ payload: z.ZodUnion<readonly [z.ZodObject<{
759
+ kind: z.ZodLiteral<"message">;
760
+ action: z.ZodString;
761
+ sessionId: z.ZodString;
762
+ sessionTitle: z.ZodString;
763
+ directory: z.ZodNullable<z.ZodString>;
764
+ messageId: z.ZodString;
765
+ role: z.ZodEnum<{
766
+ user: "user";
767
+ assistant: "assistant";
768
+ }>;
769
+ text: z.ZodString;
770
+ }, z.core.$strip>, z.ZodObject<{
771
+ kind: z.ZodLiteral<"session">;
772
+ action: z.ZodString;
773
+ sessionId: z.ZodString;
774
+ sessionTitle: z.ZodString;
775
+ directory: z.ZodNullable<z.ZodString>;
776
+ messages: z.ZodOptional<z.ZodArray<z.ZodObject<{
777
+ id: z.ZodString;
778
+ role: z.ZodEnum<{
779
+ user: "user";
780
+ assistant: "assistant";
781
+ }>;
782
+ text: z.ZodString;
783
+ createdAt: z.ZodNumber;
784
+ }, z.core.$strip>>>;
785
+ truncated: z.ZodOptional<z.ZodBoolean>;
786
+ }, z.core.$strip>]>;
787
+ channel: z.ZodLiteral<"aiworker.sdk">;
788
+ v: z.ZodLiteral<1>;
789
+ }, z.core.$strip>]>;
790
+ export declare const guestMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
791
+ type: z.ZodLiteral<"action-result">;
792
+ id: z.ZodString;
793
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
794
+ ok: z.ZodLiteral<true>;
795
+ }, z.core.$strip>, z.ZodObject<{
796
+ ok: z.ZodLiteral<false>;
797
+ error: z.ZodString;
798
+ }, z.core.$strip>], "ok">;
799
+ channel: z.ZodLiteral<"aiworker.sdk">;
800
+ v: z.ZodLiteral<1>;
801
+ }, z.core.$strip>, z.ZodObject<{
802
+ type: z.ZodLiteral<"workspace-read">;
803
+ id: z.ZodString;
804
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
805
+ kind: z.ZodLiteral<"projects">;
806
+ }, z.core.$strict>, z.ZodObject<{
807
+ kind: z.ZodLiteral<"worktrees">;
808
+ projectId: z.ZodString;
809
+ }, z.core.$strict>, z.ZodObject<{
810
+ kind: z.ZodLiteral<"sessions">;
811
+ projectId: z.ZodString;
812
+ }, z.core.$strict>], "kind">;
813
+ channel: z.ZodLiteral<"aiworker.sdk">;
814
+ v: z.ZodLiteral<1>;
815
+ }, z.core.$strip>, z.ZodObject<{
816
+ type: z.ZodLiteral<"workspace-subscribe">;
817
+ id: z.ZodString;
818
+ payload: z.ZodObject<{
819
+ subscriptionId: z.ZodString;
820
+ query: z.ZodDiscriminatedUnion<[z.ZodObject<{
821
+ kind: z.ZodLiteral<"projects">;
822
+ }, z.core.$strict>, z.ZodObject<{
823
+ kind: z.ZodLiteral<"worktrees">;
824
+ projectId: z.ZodString;
825
+ }, z.core.$strict>, z.ZodObject<{
826
+ kind: z.ZodLiteral<"sessions">;
827
+ projectId: z.ZodString;
828
+ }, z.core.$strict>], "kind">;
829
+ }, z.core.$strip>;
830
+ channel: z.ZodLiteral<"aiworker.sdk">;
831
+ v: z.ZodLiteral<1>;
832
+ }, z.core.$strip>, z.ZodObject<{
833
+ type: z.ZodLiteral<"workspace-unsubscribe">;
834
+ id: z.ZodString;
835
+ payload: z.ZodObject<{
836
+ subscriptionId: z.ZodString;
837
+ }, z.core.$strip>;
838
+ channel: z.ZodLiteral<"aiworker.sdk">;
839
+ v: z.ZodLiteral<1>;
840
+ }, z.core.$strip>, z.ZodObject<{
841
+ type: z.ZodLiteral<"storage">;
842
+ id: z.ZodString;
843
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
844
+ op: z.ZodLiteral<"get">;
845
+ key: z.ZodString;
846
+ }, z.core.$strict>, z.ZodObject<{
847
+ op: z.ZodLiteral<"delete">;
848
+ key: z.ZodString;
849
+ }, z.core.$strict>, z.ZodObject<{
850
+ op: z.ZodLiteral<"set">;
851
+ key: z.ZodString;
852
+ value: z.ZodJSONSchema;
853
+ }, z.core.$strict>, z.ZodObject<{
854
+ op: z.ZodLiteral<"keys">;
855
+ }, z.core.$strict>], "op">;
856
+ channel: z.ZodLiteral<"aiworker.sdk">;
857
+ v: z.ZodLiteral<1>;
858
+ }, z.core.$strip>, z.ZodObject<{
859
+ type: z.ZodLiteral<"open-session">;
860
+ id: z.ZodString;
861
+ payload: z.ZodObject<{
862
+ sessionId: z.ZodString;
863
+ }, z.core.$strip>;
864
+ channel: z.ZodLiteral<"aiworker.sdk">;
865
+ v: z.ZodLiteral<1>;
866
+ }, z.core.$strip>, z.ZodObject<{
867
+ type: z.ZodLiteral<"hello">;
868
+ channel: z.ZodLiteral<"aiworker.sdk">;
869
+ v: z.ZodLiteral<1>;
870
+ }, z.core.$strip>, z.ZodObject<{
871
+ type: z.ZodLiteral<"toast">;
872
+ id: z.ZodString;
873
+ payload: z.ZodObject<{
874
+ kind: z.ZodEnum<{
875
+ error: "error";
876
+ info: "info";
877
+ success: "success";
878
+ }>;
879
+ message: z.ZodString;
880
+ copy: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
881
+ text: z.ZodString;
882
+ }, z.core.$strip>]>>;
883
+ dismiss: z.ZodOptional<z.ZodBoolean>;
884
+ persistent: z.ZodOptional<z.ZodBoolean>;
885
+ }, z.core.$strip>;
886
+ channel: z.ZodLiteral<"aiworker.sdk">;
887
+ v: z.ZodLiteral<1>;
888
+ }, z.core.$strip>, z.ZodObject<{
889
+ type: z.ZodLiteral<"open-url">;
890
+ id: z.ZodString;
891
+ payload: z.ZodObject<{
892
+ url: z.ZodString;
893
+ }, z.core.$strip>;
894
+ channel: z.ZodLiteral<"aiworker.sdk">;
895
+ v: z.ZodLiteral<1>;
896
+ }, z.core.$strip>, z.ZodObject<{
897
+ type: z.ZodLiteral<"open-surface">;
898
+ id: z.ZodString;
899
+ payload: z.ZodObject<{
900
+ surfaceId: z.ZodString;
901
+ }, z.core.$strip>;
902
+ channel: z.ZodLiteral<"aiworker.sdk">;
903
+ v: z.ZodLiteral<1>;
904
+ }, z.core.$strip>, z.ZodObject<{
905
+ type: z.ZodLiteral<"clipboard-write">;
906
+ id: z.ZodString;
907
+ payload: z.ZodObject<{
908
+ text: z.ZodString;
909
+ }, z.core.$strip>;
910
+ channel: z.ZodLiteral<"aiworker.sdk">;
911
+ v: z.ZodLiteral<1>;
912
+ }, z.core.$strip>, z.ZodObject<{
913
+ type: z.ZodLiteral<"compose">;
914
+ id: z.ZodString;
915
+ payload: z.ZodObject<{
916
+ text: z.ZodString;
917
+ mode: z.ZodOptional<z.ZodEnum<{
918
+ replace: "replace";
919
+ append: "append";
920
+ }>>;
921
+ }, z.core.$strip>;
922
+ channel: z.ZodLiteral<"aiworker.sdk">;
923
+ v: z.ZodLiteral<1>;
924
+ }, z.core.$strip>, z.ZodObject<{
925
+ type: z.ZodLiteral<"attach">;
926
+ id: z.ZodString;
927
+ payload: z.ZodObject<{
928
+ providerId: z.ZodString;
929
+ id: z.ZodString;
930
+ title: z.ZodString;
931
+ url: z.ZodString;
932
+ text: z.ZodOptional<z.ZodString>;
933
+ kind: z.ZodOptional<z.ZodEnum<{
934
+ issue: "issue";
935
+ pull: "pull";
936
+ }>>;
937
+ author: z.ZodOptional<z.ZodString>;
938
+ branches: z.ZodOptional<z.ZodObject<{
939
+ head: z.ZodString;
940
+ base: z.ZodString;
941
+ }, z.core.$strip>>;
942
+ data: z.ZodOptional<z.ZodJSONSchema>;
943
+ }, z.core.$strip>;
944
+ channel: z.ZodLiteral<"aiworker.sdk">;
945
+ v: z.ZodLiteral<1>;
946
+ }, z.core.$strip>, z.ZodObject<{
947
+ type: z.ZodLiteral<"start-session">;
948
+ id: z.ZodString;
949
+ payload: z.ZodObject<{
950
+ providerId: z.ZodString;
951
+ id: z.ZodString;
952
+ title: z.ZodString;
953
+ url: z.ZodString;
954
+ text: z.ZodOptional<z.ZodString>;
955
+ kind: z.ZodOptional<z.ZodEnum<{
956
+ issue: "issue";
957
+ pull: "pull";
958
+ }>>;
959
+ author: z.ZodOptional<z.ZodString>;
960
+ branches: z.ZodOptional<z.ZodObject<{
961
+ head: z.ZodString;
962
+ base: z.ZodString;
963
+ }, z.core.$strip>>;
964
+ data: z.ZodOptional<z.ZodJSONSchema>;
965
+ worktree: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
966
+ kind: z.ZodLiteral<"existing">;
967
+ directory: z.ZodString;
968
+ }, z.core.$strict>, z.ZodObject<{
969
+ kind: z.ZodLiteral<"new">;
970
+ name: z.ZodOptional<z.ZodString>;
971
+ baseBranch: z.ZodOptional<z.ZodString>;
972
+ }, z.core.$strict>]>>;
973
+ projectId: z.ZodOptional<z.ZodString>;
974
+ navigation: z.ZodOptional<z.ZodEnum<{
975
+ preserve: "preserve";
976
+ open: "open";
977
+ }>>;
978
+ }, z.core.$strip>;
979
+ channel: z.ZodLiteral<"aiworker.sdk">;
980
+ v: z.ZodLiteral<1>;
981
+ }, z.core.$strip>, z.ZodObject<{
982
+ type: z.ZodLiteral<"prompt">;
983
+ id: z.ZodString;
984
+ payload: z.ZodObject<{
985
+ text: z.ZodString;
986
+ send: z.ZodOptional<z.ZodBoolean>;
987
+ }, z.core.$strip>;
988
+ channel: z.ZodLiteral<"aiworker.sdk">;
989
+ v: z.ZodLiteral<1>;
990
+ }, z.core.$strip>, z.ZodObject<{
991
+ type: z.ZodLiteral<"session-link">;
992
+ id: z.ZodString;
993
+ payload: z.ZodObject<{
994
+ providerId: z.ZodString;
995
+ id: z.ZodString;
996
+ title: z.ZodString;
997
+ url: z.ZodString;
998
+ text: z.ZodOptional<z.ZodString>;
999
+ kind: z.ZodOptional<z.ZodEnum<{
1000
+ issue: "issue";
1001
+ pull: "pull";
1002
+ }>>;
1003
+ author: z.ZodOptional<z.ZodString>;
1004
+ branches: z.ZodOptional<z.ZodObject<{
1005
+ head: z.ZodString;
1006
+ base: z.ZodString;
1007
+ }, z.core.$strip>>;
1008
+ data: z.ZodOptional<z.ZodJSONSchema>;
1009
+ }, z.core.$strip>;
1010
+ channel: z.ZodLiteral<"aiworker.sdk">;
1011
+ v: z.ZodLiteral<1>;
1012
+ }, z.core.$strip>, z.ZodObject<{
1013
+ type: z.ZodLiteral<"close">;
1014
+ id: z.ZodString;
1015
+ channel: z.ZodLiteral<"aiworker.sdk">;
1016
+ v: z.ZodLiteral<1>;
1017
+ }, z.core.$strip>, z.ZodObject<{
1018
+ type: z.ZodLiteral<"oauth-start">;
1019
+ id: z.ZodString;
1020
+ channel: z.ZodLiteral<"aiworker.sdk">;
1021
+ v: z.ZodLiteral<1>;
1022
+ }, z.core.$strip>, z.ZodObject<{
1023
+ type: z.ZodLiteral<"oauth-disconnect">;
1024
+ id: z.ZodString;
1025
+ channel: z.ZodLiteral<"aiworker.sdk">;
1026
+ v: z.ZodLiteral<1>;
1027
+ }, z.core.$strip>, z.ZodObject<{
1028
+ type: z.ZodLiteral<"request">;
1029
+ id: z.ZodString;
1030
+ payload: z.ZodObject<{
1031
+ method: z.ZodEnum<{
1032
+ GET: "GET";
1033
+ POST: "POST";
1034
+ PUT: "PUT";
1035
+ PATCH: "PATCH";
1036
+ DELETE: "DELETE";
1037
+ }>;
1038
+ path: z.ZodString;
1039
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1040
+ body: z.ZodOptional<z.ZodString>;
1041
+ }, z.core.$strip>;
1042
+ channel: z.ZodLiteral<"aiworker.sdk">;
1043
+ v: z.ZodLiteral<1>;
1044
+ }, z.core.$strip>, z.ZodObject<{
1045
+ type: z.ZodLiteral<"service-request">;
1046
+ id: z.ZodString;
1047
+ payload: z.ZodObject<{
1048
+ method: z.ZodEnum<{
1049
+ GET: "GET";
1050
+ POST: "POST";
1051
+ PUT: "PUT";
1052
+ PATCH: "PATCH";
1053
+ DELETE: "DELETE";
1054
+ }>;
1055
+ path: z.ZodString;
1056
+ query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1057
+ body: z.ZodOptional<z.ZodString>;
1058
+ }, z.core.$strip>;
1059
+ channel: z.ZodLiteral<"aiworker.sdk">;
1060
+ v: z.ZodLiteral<1>;
1061
+ }, z.core.$strip>, z.ZodObject<{
1062
+ type: z.ZodLiteral<"service-status">;
1063
+ id: z.ZodString;
1064
+ channel: z.ZodLiteral<"aiworker.sdk">;
1065
+ v: z.ZodLiteral<1>;
1066
+ }, z.core.$strip>, z.ZodObject<{
1067
+ type: z.ZodLiteral<"file-read">;
1068
+ id: z.ZodString;
1069
+ payload: z.ZodObject<{
1070
+ path: z.ZodString;
1071
+ }, z.core.$strip>;
1072
+ channel: z.ZodLiteral<"aiworker.sdk">;
1073
+ v: z.ZodLiteral<1>;
1074
+ }, z.core.$strip>, z.ZodObject<{
1075
+ type: z.ZodLiteral<"file-write">;
1076
+ id: z.ZodString;
1077
+ payload: z.ZodObject<{
1078
+ path: z.ZodString;
1079
+ content: z.ZodString;
1080
+ }, z.core.$strip>;
1081
+ channel: z.ZodLiteral<"aiworker.sdk">;
1082
+ v: z.ZodLiteral<1>;
1083
+ }, z.core.$strip>, z.ZodObject<{
1084
+ type: z.ZodLiteral<"file-list">;
1085
+ id: z.ZodString;
1086
+ payload: z.ZodObject<{
1087
+ path: z.ZodString;
1088
+ }, z.core.$strip>;
1089
+ channel: z.ZodLiteral<"aiworker.sdk">;
1090
+ v: z.ZodLiteral<1>;
1091
+ }, z.core.$strip>, z.ZodObject<{
1092
+ type: z.ZodLiteral<"file-stat">;
1093
+ id: z.ZodString;
1094
+ payload: z.ZodObject<{
1095
+ path: z.ZodString;
1096
+ }, z.core.$strip>;
1097
+ channel: z.ZodLiteral<"aiworker.sdk">;
1098
+ v: z.ZodLiteral<1>;
1099
+ }, z.core.$strip>, z.ZodObject<{
1100
+ type: z.ZodLiteral<"generate">;
1101
+ id: z.ZodString;
1102
+ payload: z.ZodObject<{
1103
+ prompt: z.ZodString;
1104
+ system: z.ZodOptional<z.ZodString>;
1105
+ maxOutputTokens: z.ZodOptional<z.ZodNumber>;
1106
+ }, z.core.$strip>;
1107
+ channel: z.ZodLiteral<"aiworker.sdk">;
1108
+ v: z.ZodLiteral<1>;
1109
+ }, z.core.$strip>, z.ZodObject<{
1110
+ type: z.ZodLiteral<"badge">;
1111
+ id: z.ZodString;
1112
+ payload: z.ZodObject<{
1113
+ count: z.ZodNullable<z.ZodNumber>;
1114
+ }, z.core.$strip>;
1115
+ channel: z.ZodLiteral<"aiworker.sdk">;
1116
+ v: z.ZodLiteral<1>;
1117
+ }, z.core.$strip>, z.ZodObject<{
1118
+ type: z.ZodLiteral<"resolve-result">;
1119
+ id: z.ZodString;
1120
+ payload: z.ZodUnion<readonly [z.ZodObject<{
1121
+ item: z.ZodNullable<z.ZodObject<{
1122
+ providerId: z.ZodString;
1123
+ id: z.ZodString;
1124
+ title: z.ZodString;
1125
+ url: z.ZodString;
1126
+ text: z.ZodOptional<z.ZodString>;
1127
+ kind: z.ZodOptional<z.ZodEnum<{
1128
+ issue: "issue";
1129
+ pull: "pull";
1130
+ }>>;
1131
+ author: z.ZodOptional<z.ZodString>;
1132
+ branches: z.ZodOptional<z.ZodObject<{
1133
+ head: z.ZodString;
1134
+ base: z.ZodString;
1135
+ }, z.core.$strip>>;
1136
+ data: z.ZodOptional<z.ZodJSONSchema>;
1137
+ }, z.core.$strip>>;
1138
+ }, z.core.$strip>, z.ZodObject<{
1139
+ error: z.ZodString;
1140
+ }, z.core.$strip>]>;
1141
+ channel: z.ZodLiteral<"aiworker.sdk">;
1142
+ v: z.ZodLiteral<1>;
1143
+ }, z.core.$strip>], "type">;
1144
+ type HostWire = z.input<typeof hostMessageSchema>;
1145
+ type GuestWire = z.input<typeof guestMessageSchema>;
1146
+ export declare const parseHostMessage: (document: HostWire) => HostMessage | null;
1147
+ export declare const parseGuestMessage: (document: GuestWire) => GuestMessage | null;
1148
+ export {};