flavor-code 1.2.10 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,526 @@
1
+ import { z } from "zod";
2
+ export declare const PROTOCOL_VERSION: 1;
3
+ export declare const MAX_ALIAS_LENGTH = 64;
4
+ export declare const MAX_MESSAGE_BYTES: number;
5
+ export declare const MAX_CONTROL_FRAME_BYTES: number;
6
+ export declare const MAX_PARTICIPANTS = 16;
7
+ export declare const MAX_ACTIVE_PALS = 16;
8
+ export declare const MAX_PLAN_TASKS = 32;
9
+ export declare const MAX_PROJECT_PATH_BYTES = 1024;
10
+ export declare const MAX_PLAN_ENCODED_BYTES: number;
11
+ export declare const MAX_SNAPSHOT_ENCODED_BYTES: number;
12
+ export declare const MAX_COMPLETION_DETAIL_BYTES: number;
13
+ export declare const MAX_COMPLETION_ASSERTIONS_BYTES: number;
14
+ export declare const MIN_UUID_PREFIX_LENGTH = 8;
15
+ export declare function normalizePalIdentity(value: string): string;
16
+ export declare const PalAliasSchema: z.ZodString;
17
+ export declare const PalTargetSchema: z.ZodString;
18
+ export declare const PalPresenceSchema: z.ZodObject<{
19
+ version: z.ZodLiteral<1>;
20
+ id: z.ZodUUID;
21
+ alias: z.ZodString;
22
+ projectPath: z.ZodString;
23
+ connectedAt: z.ZodISODateTime;
24
+ lastSeenAt: z.ZodISODateTime;
25
+ }, z.core.$strict>;
26
+ export type PalPresence = z.infer<typeof PalPresenceSchema>;
27
+ export declare const PalPresenceListSchema: z.ZodArray<z.ZodObject<{
28
+ version: z.ZodLiteral<1>;
29
+ id: z.ZodUUID;
30
+ alias: z.ZodString;
31
+ projectPath: z.ZodString;
32
+ connectedAt: z.ZodISODateTime;
33
+ lastSeenAt: z.ZodISODateTime;
34
+ }, z.core.$strict>>;
35
+ export declare const PalTaskMessageSchema: z.ZodObject<{
36
+ version: z.ZodLiteral<1>;
37
+ type: z.ZodLiteral<"task">;
38
+ messageId: z.ZodUUID;
39
+ target: z.ZodString;
40
+ goal: z.ZodString;
41
+ }, z.core.$strict>;
42
+ export type PalTaskMessage = z.infer<typeof PalTaskMessageSchema>;
43
+ export declare const PalTaskEventSchema: z.ZodObject<{
44
+ version: z.ZodLiteral<1>;
45
+ type: z.ZodLiteral<"task-event">;
46
+ messageId: z.ZodUUID;
47
+ taskId: z.ZodUUID;
48
+ senderId: z.ZodUUID;
49
+ recipientId: z.ZodUUID;
50
+ status: z.ZodEnum<{
51
+ accepted: "accepted";
52
+ cancelled: "cancelled";
53
+ completed: "completed";
54
+ failed: "failed";
55
+ progress: "progress";
56
+ started: "started";
57
+ }>;
58
+ detail: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$strict>;
60
+ export type PalTaskEvent = z.infer<typeof PalTaskEventSchema>;
61
+ export declare const DeliveryReceiptSchema: z.ZodObject<{
62
+ version: z.ZodLiteral<1>;
63
+ type: z.ZodLiteral<"delivery-receipt">;
64
+ messageId: z.ZodUUID;
65
+ status: z.ZodEnum<{
66
+ delivered: "delivered";
67
+ duplicate: "duplicate";
68
+ rejected: "rejected";
69
+ }>;
70
+ recipientIds: z.ZodArray<z.ZodUUID>;
71
+ error: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strict>;
73
+ export type DeliveryReceipt = z.infer<typeof DeliveryReceiptSchema>;
74
+ export declare const CoWorkParticipantSchema: z.ZodObject<{
75
+ palId: z.ZodUUID;
76
+ required: z.ZodBoolean;
77
+ }, z.core.$strict>;
78
+ export type CoWorkParticipant = z.infer<typeof CoWorkParticipantSchema>;
79
+ export declare const CoWorkProposalParticipantsSchema: z.ZodArray<z.ZodObject<{
80
+ palId: z.ZodUUID;
81
+ required: z.ZodBoolean;
82
+ }, z.core.$strict>>;
83
+ export declare const CoWorkPlanTaskSchema: z.ZodObject<{
84
+ id: z.ZodString;
85
+ assigneeId: z.ZodUUID;
86
+ description: z.ZodString;
87
+ dependsOn: z.ZodArray<z.ZodString>;
88
+ }, z.core.$strict>;
89
+ export type CoWorkPlanTask = z.infer<typeof CoWorkPlanTaskSchema>;
90
+ export declare const CoWorkPlanSchema: z.ZodObject<{
91
+ version: z.ZodLiteral<1>;
92
+ coWorkId: z.ZodUUID;
93
+ epoch: z.ZodNumber;
94
+ goal: z.ZodString;
95
+ participants: z.ZodArray<z.ZodObject<{
96
+ palId: z.ZodUUID;
97
+ required: z.ZodBoolean;
98
+ }, z.core.$strict>>;
99
+ tasks: z.ZodArray<z.ZodObject<{
100
+ id: z.ZodString;
101
+ assigneeId: z.ZodUUID;
102
+ description: z.ZodString;
103
+ dependsOn: z.ZodArray<z.ZodString>;
104
+ }, z.core.$strict>>;
105
+ }, z.core.$strict>;
106
+ export type CoWorkPlan = z.infer<typeof CoWorkPlanSchema>;
107
+ export declare const CoWorkPhaseSchema: z.ZodEnum<{
108
+ cancelled: "cancelled";
109
+ completed: "completed";
110
+ failed: "failed";
111
+ planning: "planning";
112
+ prepared: "prepared";
113
+ proposed: "proposed";
114
+ running: "running";
115
+ verifying: "verifying";
116
+ }>;
117
+ export type CoWorkPhase = z.infer<typeof CoWorkPhaseSchema>;
118
+ export declare const CoWorkCompletionAssertionSchema: z.ZodObject<{
119
+ participantId: z.ZodUUID;
120
+ passed: z.ZodBoolean;
121
+ detail: z.ZodOptional<z.ZodString>;
122
+ }, z.core.$strict>;
123
+ export type CoWorkCompletionAssertion = z.infer<typeof CoWorkCompletionAssertionSchema>;
124
+ export declare const CoWorkSnapshotSchema: z.ZodObject<{
125
+ version: z.ZodLiteral<1>;
126
+ coWorkId: z.ZodUUID;
127
+ epoch: z.ZodNumber;
128
+ phase: z.ZodEnum<{
129
+ cancelled: "cancelled";
130
+ completed: "completed";
131
+ failed: "failed";
132
+ planning: "planning";
133
+ prepared: "prepared";
134
+ proposed: "proposed";
135
+ running: "running";
136
+ verifying: "verifying";
137
+ }>;
138
+ goal: z.ZodString;
139
+ participants: z.ZodArray<z.ZodObject<{
140
+ palId: z.ZodUUID;
141
+ required: z.ZodBoolean;
142
+ }, z.core.$strict>>;
143
+ integrationOwnerId: z.ZodUUID;
144
+ acceptedParticipantIds: z.ZodArray<z.ZodUUID>;
145
+ planHash: z.ZodNullable<z.ZodString>;
146
+ plan: z.ZodNullable<z.ZodObject<{
147
+ version: z.ZodLiteral<1>;
148
+ coWorkId: z.ZodUUID;
149
+ epoch: z.ZodNumber;
150
+ goal: z.ZodString;
151
+ participants: z.ZodArray<z.ZodObject<{
152
+ palId: z.ZodUUID;
153
+ required: z.ZodBoolean;
154
+ }, z.core.$strict>>;
155
+ tasks: z.ZodArray<z.ZodObject<{
156
+ id: z.ZodString;
157
+ assigneeId: z.ZodUUID;
158
+ description: z.ZodString;
159
+ dependsOn: z.ZodArray<z.ZodString>;
160
+ }, z.core.$strict>>;
161
+ }, z.core.$strict>>;
162
+ planAcceptedParticipantIds: z.ZodArray<z.ZodUUID>;
163
+ readyParticipantIds: z.ZodArray<z.ZodUUID>;
164
+ completedParticipantIds: z.ZodArray<z.ZodUUID>;
165
+ completionAssertions: z.ZodArray<z.ZodObject<{
166
+ participantId: z.ZodUUID;
167
+ passed: z.ZodBoolean;
168
+ detail: z.ZodOptional<z.ZodString>;
169
+ }, z.core.$strict>>;
170
+ integration: z.ZodNullable<z.ZodObject<{
171
+ passed: z.ZodBoolean;
172
+ evidence: z.ZodString;
173
+ }, z.core.$strict>>;
174
+ }, z.core.$strict>;
175
+ export type CoWorkSnapshot = z.infer<typeof CoWorkSnapshotSchema>;
176
+ export declare const BrokerRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
177
+ version: z.ZodLiteral<1>;
178
+ requestId: z.ZodUUID;
179
+ type: z.ZodLiteral<"register">;
180
+ authToken: z.ZodOptional<z.ZodString>;
181
+ presence: z.ZodObject<{
182
+ version: z.ZodLiteral<1>;
183
+ id: z.ZodUUID;
184
+ alias: z.ZodString;
185
+ projectPath: z.ZodString;
186
+ connectedAt: z.ZodISODateTime;
187
+ lastSeenAt: z.ZodISODateTime;
188
+ }, z.core.$strict>;
189
+ }, z.core.$strict>, z.ZodObject<{
190
+ version: z.ZodLiteral<1>;
191
+ requestId: z.ZodUUID;
192
+ type: z.ZodLiteral<"heartbeat">;
193
+ }, z.core.$strict>, z.ZodObject<{
194
+ version: z.ZodLiteral<1>;
195
+ requestId: z.ZodUUID;
196
+ type: z.ZodLiteral<"list">;
197
+ }, z.core.$strict>, z.ZodObject<{
198
+ version: z.ZodLiteral<1>;
199
+ requestId: z.ZodUUID;
200
+ type: z.ZodLiteral<"disconnect">;
201
+ }, z.core.$strict>, z.ZodObject<{
202
+ version: z.ZodLiteral<1>;
203
+ requestId: z.ZodUUID;
204
+ type: z.ZodLiteral<"chat">;
205
+ messageId: z.ZodUUID;
206
+ target: z.ZodString;
207
+ message: z.ZodString;
208
+ }, z.core.$strict>, z.ZodObject<{
209
+ version: z.ZodLiteral<1>;
210
+ requestId: z.ZodUUID;
211
+ type: z.ZodLiteral<"task">;
212
+ messageId: z.ZodUUID;
213
+ target: z.ZodString;
214
+ goal: z.ZodString;
215
+ }, z.core.$strict>, z.ZodObject<{
216
+ version: z.ZodLiteral<1>;
217
+ requestId: z.ZodUUID;
218
+ type: z.ZodLiteral<"cowork-propose">;
219
+ coWorkId: z.ZodUUID;
220
+ goal: z.ZodString;
221
+ participants: z.ZodArray<z.ZodObject<{
222
+ palId: z.ZodUUID;
223
+ required: z.ZodBoolean;
224
+ }, z.core.$strict>>;
225
+ }, z.core.$strict>, z.ZodObject<{
226
+ version: z.ZodLiteral<1>;
227
+ requestId: z.ZodUUID;
228
+ type: z.ZodLiteral<"cowork-accept">;
229
+ coWorkId: z.ZodUUID;
230
+ epoch: z.ZodNumber;
231
+ }, z.core.$strict>, z.ZodObject<{
232
+ version: z.ZodLiteral<1>;
233
+ requestId: z.ZodUUID;
234
+ type: z.ZodLiteral<"cowork-plan">;
235
+ plan: z.ZodObject<{
236
+ version: z.ZodLiteral<1>;
237
+ coWorkId: z.ZodUUID;
238
+ epoch: z.ZodNumber;
239
+ goal: z.ZodString;
240
+ participants: z.ZodArray<z.ZodObject<{
241
+ palId: z.ZodUUID;
242
+ required: z.ZodBoolean;
243
+ }, z.core.$strict>>;
244
+ tasks: z.ZodArray<z.ZodObject<{
245
+ id: z.ZodString;
246
+ assigneeId: z.ZodUUID;
247
+ description: z.ZodString;
248
+ dependsOn: z.ZodArray<z.ZodString>;
249
+ }, z.core.$strict>>;
250
+ }, z.core.$strict>;
251
+ }, z.core.$strict>, z.ZodObject<{
252
+ version: z.ZodLiteral<1>;
253
+ requestId: z.ZodUUID;
254
+ type: z.ZodLiteral<"cowork-plan-accept">;
255
+ coWorkId: z.ZodUUID;
256
+ epoch: z.ZodNumber;
257
+ planHash: z.ZodString;
258
+ }, z.core.$strict>, z.ZodObject<{
259
+ version: z.ZodLiteral<1>;
260
+ requestId: z.ZodUUID;
261
+ type: z.ZodLiteral<"cowork-ready">;
262
+ coWorkId: z.ZodUUID;
263
+ epoch: z.ZodNumber;
264
+ planHash: z.ZodString;
265
+ }, z.core.$strict>, z.ZodObject<{
266
+ version: z.ZodLiteral<1>;
267
+ requestId: z.ZodUUID;
268
+ type: z.ZodLiteral<"cowork-complete">;
269
+ coWorkId: z.ZodUUID;
270
+ epoch: z.ZodNumber;
271
+ planHash: z.ZodString;
272
+ passed: z.ZodBoolean;
273
+ detail: z.ZodOptional<z.ZodString>;
274
+ }, z.core.$strict>, z.ZodObject<{
275
+ version: z.ZodLiteral<1>;
276
+ requestId: z.ZodUUID;
277
+ type: z.ZodLiteral<"cowork-integration">;
278
+ coWorkId: z.ZodUUID;
279
+ epoch: z.ZodNumber;
280
+ planHash: z.ZodString;
281
+ passed: z.ZodBoolean;
282
+ evidence: z.ZodString;
283
+ }, z.core.$strict>, z.ZodObject<{
284
+ version: z.ZodLiteral<1>;
285
+ requestId: z.ZodUUID;
286
+ type: z.ZodLiteral<"cowork-get">;
287
+ coWorkId: z.ZodUUID;
288
+ }, z.core.$strict>, z.ZodObject<{
289
+ version: z.ZodLiteral<1>;
290
+ requestId: z.ZodUUID;
291
+ type: z.ZodLiteral<"cowork-cancel">;
292
+ coWorkId: z.ZodUUID;
293
+ reason: z.ZodString;
294
+ }, z.core.$strict>], "type">;
295
+ export type BrokerRequest = z.infer<typeof BrokerRequestSchema>;
296
+ export declare const BrokerEventSchema: z.ZodUnion<readonly [z.ZodObject<{
297
+ version: z.ZodLiteral<1>;
298
+ type: z.ZodLiteral<"chat-event">;
299
+ messageId: z.ZodUUID;
300
+ senderId: z.ZodUUID;
301
+ recipientId: z.ZodUUID;
302
+ message: z.ZodString;
303
+ }, z.core.$strict>, z.ZodObject<{
304
+ version: z.ZodLiteral<1>;
305
+ type: z.ZodLiteral<"task-event">;
306
+ messageId: z.ZodUUID;
307
+ taskId: z.ZodUUID;
308
+ senderId: z.ZodUUID;
309
+ recipientId: z.ZodUUID;
310
+ status: z.ZodEnum<{
311
+ accepted: "accepted";
312
+ cancelled: "cancelled";
313
+ completed: "completed";
314
+ failed: "failed";
315
+ progress: "progress";
316
+ started: "started";
317
+ }>;
318
+ detail: z.ZodOptional<z.ZodString>;
319
+ }, z.core.$strict>, z.ZodObject<{
320
+ version: z.ZodLiteral<1>;
321
+ type: z.ZodLiteral<"delivery-receipt">;
322
+ messageId: z.ZodUUID;
323
+ status: z.ZodEnum<{
324
+ delivered: "delivered";
325
+ duplicate: "duplicate";
326
+ rejected: "rejected";
327
+ }>;
328
+ recipientIds: z.ZodArray<z.ZodUUID>;
329
+ error: z.ZodOptional<z.ZodString>;
330
+ }, z.core.$strict>, z.ZodObject<{
331
+ version: z.ZodLiteral<1>;
332
+ type: z.ZodLiteral<"cowork-event">;
333
+ action: z.ZodEnum<{
334
+ CANCEL: "CANCEL";
335
+ END: "END";
336
+ FAIL: "FAIL";
337
+ PLAN: "PLAN";
338
+ PROPOSE: "PROPOSE";
339
+ START: "START";
340
+ }>;
341
+ actorId: z.ZodUUID;
342
+ coWorkId: z.ZodUUID;
343
+ epoch: z.ZodNumber;
344
+ planHash: z.ZodNullable<z.ZodString>;
345
+ snapshot: z.ZodObject<{
346
+ version: z.ZodLiteral<1>;
347
+ coWorkId: z.ZodUUID;
348
+ epoch: z.ZodNumber;
349
+ phase: z.ZodEnum<{
350
+ cancelled: "cancelled";
351
+ completed: "completed";
352
+ failed: "failed";
353
+ planning: "planning";
354
+ prepared: "prepared";
355
+ proposed: "proposed";
356
+ running: "running";
357
+ verifying: "verifying";
358
+ }>;
359
+ goal: z.ZodString;
360
+ participants: z.ZodArray<z.ZodObject<{
361
+ palId: z.ZodUUID;
362
+ required: z.ZodBoolean;
363
+ }, z.core.$strict>>;
364
+ integrationOwnerId: z.ZodUUID;
365
+ acceptedParticipantIds: z.ZodArray<z.ZodUUID>;
366
+ planHash: z.ZodNullable<z.ZodString>;
367
+ plan: z.ZodNullable<z.ZodObject<{
368
+ version: z.ZodLiteral<1>;
369
+ coWorkId: z.ZodUUID;
370
+ epoch: z.ZodNumber;
371
+ goal: z.ZodString;
372
+ participants: z.ZodArray<z.ZodObject<{
373
+ palId: z.ZodUUID;
374
+ required: z.ZodBoolean;
375
+ }, z.core.$strict>>;
376
+ tasks: z.ZodArray<z.ZodObject<{
377
+ id: z.ZodString;
378
+ assigneeId: z.ZodUUID;
379
+ description: z.ZodString;
380
+ dependsOn: z.ZodArray<z.ZodString>;
381
+ }, z.core.$strict>>;
382
+ }, z.core.$strict>>;
383
+ planAcceptedParticipantIds: z.ZodArray<z.ZodUUID>;
384
+ readyParticipantIds: z.ZodArray<z.ZodUUID>;
385
+ completedParticipantIds: z.ZodArray<z.ZodUUID>;
386
+ completionAssertions: z.ZodArray<z.ZodObject<{
387
+ participantId: z.ZodUUID;
388
+ passed: z.ZodBoolean;
389
+ detail: z.ZodOptional<z.ZodString>;
390
+ }, z.core.$strict>>;
391
+ integration: z.ZodNullable<z.ZodObject<{
392
+ passed: z.ZodBoolean;
393
+ evidence: z.ZodString;
394
+ }, z.core.$strict>>;
395
+ }, z.core.$strict>;
396
+ }, z.core.$strict>]>;
397
+ export type BrokerEvent = z.infer<typeof BrokerEventSchema>;
398
+ export declare const BrokerResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
399
+ version: z.ZodLiteral<1>;
400
+ type: z.ZodLiteral<"ok">;
401
+ requestId: z.ZodUUID;
402
+ data: z.ZodUnknown;
403
+ }, z.core.$strict>, z.ZodObject<{
404
+ version: z.ZodLiteral<1>;
405
+ type: z.ZodLiteral<"error">;
406
+ requestId: z.ZodUUID;
407
+ code: z.ZodEnum<{
408
+ "alias-conflict": "alias-conflict";
409
+ "ambiguous-target": "ambiguous-target";
410
+ "authentication-failed": "authentication-failed";
411
+ duplicate: "duplicate";
412
+ "invalid-request": "invalid-request";
413
+ "invalid-transition": "invalid-transition";
414
+ "not-found": "not-found";
415
+ "stale-epoch": "stale-epoch";
416
+ }>;
417
+ message: z.ZodString;
418
+ }, z.core.$strict>, z.ZodObject<{
419
+ version: z.ZodLiteral<1>;
420
+ type: z.ZodLiteral<"event">;
421
+ event: z.ZodUnion<readonly [z.ZodObject<{
422
+ version: z.ZodLiteral<1>;
423
+ type: z.ZodLiteral<"chat-event">;
424
+ messageId: z.ZodUUID;
425
+ senderId: z.ZodUUID;
426
+ recipientId: z.ZodUUID;
427
+ message: z.ZodString;
428
+ }, z.core.$strict>, z.ZodObject<{
429
+ version: z.ZodLiteral<1>;
430
+ type: z.ZodLiteral<"task-event">;
431
+ messageId: z.ZodUUID;
432
+ taskId: z.ZodUUID;
433
+ senderId: z.ZodUUID;
434
+ recipientId: z.ZodUUID;
435
+ status: z.ZodEnum<{
436
+ accepted: "accepted";
437
+ cancelled: "cancelled";
438
+ completed: "completed";
439
+ failed: "failed";
440
+ progress: "progress";
441
+ started: "started";
442
+ }>;
443
+ detail: z.ZodOptional<z.ZodString>;
444
+ }, z.core.$strict>, z.ZodObject<{
445
+ version: z.ZodLiteral<1>;
446
+ type: z.ZodLiteral<"delivery-receipt">;
447
+ messageId: z.ZodUUID;
448
+ status: z.ZodEnum<{
449
+ delivered: "delivered";
450
+ duplicate: "duplicate";
451
+ rejected: "rejected";
452
+ }>;
453
+ recipientIds: z.ZodArray<z.ZodUUID>;
454
+ error: z.ZodOptional<z.ZodString>;
455
+ }, z.core.$strict>, z.ZodObject<{
456
+ version: z.ZodLiteral<1>;
457
+ type: z.ZodLiteral<"cowork-event">;
458
+ action: z.ZodEnum<{
459
+ CANCEL: "CANCEL";
460
+ END: "END";
461
+ FAIL: "FAIL";
462
+ PLAN: "PLAN";
463
+ PROPOSE: "PROPOSE";
464
+ START: "START";
465
+ }>;
466
+ actorId: z.ZodUUID;
467
+ coWorkId: z.ZodUUID;
468
+ epoch: z.ZodNumber;
469
+ planHash: z.ZodNullable<z.ZodString>;
470
+ snapshot: z.ZodObject<{
471
+ version: z.ZodLiteral<1>;
472
+ coWorkId: z.ZodUUID;
473
+ epoch: z.ZodNumber;
474
+ phase: z.ZodEnum<{
475
+ cancelled: "cancelled";
476
+ completed: "completed";
477
+ failed: "failed";
478
+ planning: "planning";
479
+ prepared: "prepared";
480
+ proposed: "proposed";
481
+ running: "running";
482
+ verifying: "verifying";
483
+ }>;
484
+ goal: z.ZodString;
485
+ participants: z.ZodArray<z.ZodObject<{
486
+ palId: z.ZodUUID;
487
+ required: z.ZodBoolean;
488
+ }, z.core.$strict>>;
489
+ integrationOwnerId: z.ZodUUID;
490
+ acceptedParticipantIds: z.ZodArray<z.ZodUUID>;
491
+ planHash: z.ZodNullable<z.ZodString>;
492
+ plan: z.ZodNullable<z.ZodObject<{
493
+ version: z.ZodLiteral<1>;
494
+ coWorkId: z.ZodUUID;
495
+ epoch: z.ZodNumber;
496
+ goal: z.ZodString;
497
+ participants: z.ZodArray<z.ZodObject<{
498
+ palId: z.ZodUUID;
499
+ required: z.ZodBoolean;
500
+ }, z.core.$strict>>;
501
+ tasks: z.ZodArray<z.ZodObject<{
502
+ id: z.ZodString;
503
+ assigneeId: z.ZodUUID;
504
+ description: z.ZodString;
505
+ dependsOn: z.ZodArray<z.ZodString>;
506
+ }, z.core.$strict>>;
507
+ }, z.core.$strict>>;
508
+ planAcceptedParticipantIds: z.ZodArray<z.ZodUUID>;
509
+ readyParticipantIds: z.ZodArray<z.ZodUUID>;
510
+ completedParticipantIds: z.ZodArray<z.ZodUUID>;
511
+ completionAssertions: z.ZodArray<z.ZodObject<{
512
+ participantId: z.ZodUUID;
513
+ passed: z.ZodBoolean;
514
+ detail: z.ZodOptional<z.ZodString>;
515
+ }, z.core.$strict>>;
516
+ integration: z.ZodNullable<z.ZodObject<{
517
+ passed: z.ZodBoolean;
518
+ evidence: z.ZodString;
519
+ }, z.core.$strict>>;
520
+ }, z.core.$strict>;
521
+ }, z.core.$strict>]>;
522
+ }, z.core.$strict>], "type">;
523
+ export type BrokerResponse = z.infer<typeof BrokerResponseSchema>;
524
+ export declare const ControlFrameSchema: z.ZodString;
525
+ export type ControlFrame = z.infer<typeof ControlFrameSchema>;
526
+ export declare function encodeControlFrame(value: unknown): string;
@@ -0,0 +1,44 @@
1
+ import type { ToolDefinition } from "../tools/types.js";
2
+ import { type BrokerEvent, type CoWorkParticipant, type CoWorkSnapshot, type DeliveryReceipt, type PalPresence } from "./protocol.js";
3
+ import type { CoWorkAction } from "./client.js";
4
+ export interface PalClientLike {
5
+ start(): Promise<PalPresence>;
6
+ list(): Promise<PalPresence[]>;
7
+ rename(alias: string): Promise<PalPresence>;
8
+ sendTask(target: string, message: string): Promise<DeliveryReceipt>;
9
+ sendChat(target: string, message: string): Promise<DeliveryReceipt>;
10
+ startCoWork(input: {
11
+ coWorkId?: string;
12
+ goal: string;
13
+ participants: CoWorkParticipant[];
14
+ }): Promise<CoWorkSnapshot>;
15
+ coWorkAction(action: CoWorkAction): Promise<CoWorkSnapshot>;
16
+ coWorkStatus(coWorkId: string): Promise<CoWorkSnapshot>;
17
+ integrateCoWork(input: {
18
+ coWorkId: string;
19
+ epoch: number;
20
+ planHash: string;
21
+ passed: boolean;
22
+ evidence: string;
23
+ }): Promise<CoWorkSnapshot>;
24
+ cancelCoWork(coWorkId: string, reason: string): Promise<CoWorkSnapshot>;
25
+ subscribe(listener: (event: BrokerEvent) => void): () => void;
26
+ close(): Promise<void>;
27
+ }
28
+ export interface PalsToolOptions {
29
+ selfId: string;
30
+ shareGuard?: CollaborationShareGuard;
31
+ }
32
+ export interface CollaborationShareGuardOptions {
33
+ redact: (value: string) => string;
34
+ maxBytes?: number;
35
+ }
36
+ /** Runtime-scoped guard for content emitted by model-facing collaboration tools. */
37
+ export declare class CollaborationShareGuard {
38
+ private readonly redact;
39
+ private readonly maxBytes;
40
+ private sharedBytes;
41
+ constructor(options: CollaborationShareGuardOptions);
42
+ protect(value: string): string;
43
+ }
44
+ export declare function createPalsTools(client: PalClientLike, options: PalsToolOptions): ToolDefinition<unknown>[];
@@ -10,6 +10,7 @@ import { FlavorSession, type SessionOutput, type SessionServices } from "./ui/se
10
10
  import { type TranscriptState } from "./ui/transcript.js";
11
11
  import { MemoryReviewBridge } from "./memory/review.js";
12
12
  import { type JobSnapshot } from "./jobs/registry.js";
13
+ import { type PalClientLike } from "./pals/tools.js";
13
14
  export interface ProductionRuntimeOptions {
14
15
  workspace?: string;
15
16
  home?: string;
@@ -28,6 +29,17 @@ export interface ProductionRuntimeOptions {
28
29
  mcpClientFactory?: McpClientFactory;
29
30
  /** Additional tools provided by embedders (e.g. desktop-only D2C tools). */
30
31
  extraTools?: readonly ToolDefinition<unknown>[];
32
+ /** Explicitly opt into CLI-local collaboration. Omit for print/RPC/eval callers. */
33
+ collaboration?: {
34
+ instanceId: string;
35
+ alias?: string;
36
+ client?: PalClientLike;
37
+ createClient?: (input: {
38
+ instanceId: string;
39
+ alias: string;
40
+ projectPath: string;
41
+ }) => PalClientLike;
42
+ };
31
43
  }
32
44
  export interface ProductionRuntime {
33
45
  session: FlavorSession;
package/dist/sdk/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  FlavorRpcServer,
5
5
  TraceRecordSchema,
6
6
  TraceRecorder
7
- } from "../chunk-G32MCAZA.js";
7
+ } from "../chunk-EY6KE7L2.js";
8
8
  import {
9
9
  AgentMessageQueue,
10
10
  DockerExecutionEnvironment,
@@ -13,7 +13,7 @@ import {
13
13
  WorkspaceCheckpointStore,
14
14
  buildDockerInvocation,
15
15
  createProductionRuntime
16
- } from "../chunk-WGYNTR4Q.js";
16
+ } from "../chunk-OT5XIN6G.js";
17
17
  import "../chunk-XFCJXRJ2.js";
18
18
  import "../chunk-RQTYHUMK.js";
19
19
  import "../chunk-S32JRDZK.js";
@@ -102,6 +102,8 @@ export interface ToolDefinition<T, O = unknown> {
102
102
  /** Renderer-neutral presentation of a completed call. */
103
103
  presentResult?(output: O, input: T): ToolPresentation | undefined;
104
104
  permissions?(input: T): ToolPermissionMetadata;
105
+ /** Sanitized input shown to PermissionRequest hooks; omit raw secrets/content. */
106
+ permissionInput?(input: T): unknown;
105
107
  execute(input: T, signal: AbortSignal, context?: ToolContext): Promise<O>;
106
108
  }
107
109
  export interface ToolCall {
@@ -1,4 +1,4 @@
1
- export declare const MVP_COMMANDS: readonly ["model", "init", "config", "login", "permissions", "skills", "plugins", "hooks", "tasks", "finish", "compact", "clear", "help", "exit", "audit", "usage", "loop", "goal", "mcp", "ide", "memory", "remember", "forget", "forget-cold", "checkpoint", "tree", "rewind", "unrevert", "fork"];
1
+ export declare const MVP_COMMANDS: readonly ["model", "init", "config", "login", "permissions", "skills", "plugins", "hooks", "tasks", "finish", "compact", "clear", "help", "exit", "audit", "usage", "loop", "goal", "mcp", "ide", "memory", "remember", "forget", "forget-cold", "checkpoint", "tree", "rewind", "unrevert", "fork", "pals", "chat", "co-work"];
2
2
  export declare const COMMAND_DESCRIPTIONS: Record<(typeof MVP_COMMANDS)[number], string>;
3
3
  export type PermissionCommandMode = PermissionMode;
4
4
  export type ModelRole = "main" | "subagent";
@@ -14,6 +14,34 @@ export type McpSlashCommand = {
14
14
  action: "enable" | "disable";
15
15
  target: string;
16
16
  };
17
+ export type PalsSlashCommand = {
18
+ name: "pals";
19
+ action: "list";
20
+ verbose: boolean;
21
+ } | {
22
+ name: "pals";
23
+ action: "rename";
24
+ alias: string;
25
+ } | {
26
+ name: "pals";
27
+ action: "info";
28
+ target: string;
29
+ };
30
+ export type CoWorkSlashCommand = {
31
+ name: "co-work";
32
+ action: "start";
33
+ target: string;
34
+ goal: string;
35
+ } | {
36
+ name: "co-work";
37
+ action: "status";
38
+ coWorkId?: string;
39
+ } | {
40
+ name: "co-work";
41
+ action: "cancel";
42
+ coWorkId: string;
43
+ reason?: string;
44
+ };
17
45
  export type SlashCommand = {
18
46
  name: "model";
19
47
  role: ModelRole;
@@ -48,8 +76,12 @@ export type SlashCommand = {
48
76
  } | {
49
77
  name: "rewind" | "fork";
50
78
  nodeId: string;
51
- } | McpSlashCommand | {
52
- name: Exclude<(typeof MVP_COMMANDS)[number], "model" | "permissions" | "audit" | "loop" | "goal" | "mcp" | "remember" | "forget" | "checkpoint" | "rewind" | "fork">;
79
+ } | McpSlashCommand | PalsSlashCommand | {
80
+ name: "chat";
81
+ target: string;
82
+ goal: string;
83
+ } | CoWorkSlashCommand | {
84
+ name: Exclude<(typeof MVP_COMMANDS)[number], "model" | "permissions" | "audit" | "loop" | "goal" | "mcp" | "remember" | "forget" | "checkpoint" | "rewind" | "fork" | "pals" | "chat" | "co-work">;
53
85
  } | {
54
86
  name: "audit";
55
87
  toolFilter?: string | undefined;