@cospacehq/shared 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1133 @@
1
+ import { z } from "zod";
2
+ export declare const SenderRoleSchema: z.ZodEnum<["human", "agent"]>;
3
+ export type SenderRole = z.infer<typeof SenderRoleSchema>;
4
+ export declare const TunnelProviderSchema: z.ZodEnum<["none", "cloudflare", "ngrok"]>;
5
+ export type TunnelProvider = z.infer<typeof TunnelProviderSchema>;
6
+ export declare const CoSpaceConfigSchema: z.ZodObject<{
7
+ version: z.ZodLiteral<1>;
8
+ projectName: z.ZodString;
9
+ port: z.ZodNumber;
10
+ workspaceRoot: z.ZodString;
11
+ dataDir: z.ZodString;
12
+ auth: z.ZodObject<{
13
+ token: z.ZodString;
14
+ encryptionSecret: z.ZodOptional<z.ZodString>;
15
+ passcodeHash: z.ZodOptional<z.ZodString>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ token: string;
18
+ encryptionSecret?: string | undefined;
19
+ passcodeHash?: string | undefined;
20
+ }, {
21
+ token: string;
22
+ encryptionSecret?: string | undefined;
23
+ passcodeHash?: string | undefined;
24
+ }>;
25
+ tunnel: z.ZodObject<{
26
+ provider: z.ZodEnum<["none", "cloudflare", "ngrok"]>;
27
+ apiKey: z.ZodOptional<z.ZodString>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ provider: "none" | "cloudflare" | "ngrok";
30
+ apiKey?: string | undefined;
31
+ }, {
32
+ provider: "none" | "cloudflare" | "ngrok";
33
+ apiKey?: string | undefined;
34
+ }>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ version: 1;
37
+ projectName: string;
38
+ port: number;
39
+ workspaceRoot: string;
40
+ dataDir: string;
41
+ auth: {
42
+ token: string;
43
+ encryptionSecret?: string | undefined;
44
+ passcodeHash?: string | undefined;
45
+ };
46
+ tunnel: {
47
+ provider: "none" | "cloudflare" | "ngrok";
48
+ apiKey?: string | undefined;
49
+ };
50
+ }, {
51
+ version: 1;
52
+ projectName: string;
53
+ port: number;
54
+ workspaceRoot: string;
55
+ dataDir: string;
56
+ auth: {
57
+ token: string;
58
+ encryptionSecret?: string | undefined;
59
+ passcodeHash?: string | undefined;
60
+ };
61
+ tunnel: {
62
+ provider: "none" | "cloudflare" | "ngrok";
63
+ apiKey?: string | undefined;
64
+ };
65
+ }>;
66
+ export type CoSpaceConfig = z.infer<typeof CoSpaceConfigSchema>;
67
+ export declare const ProviderKindSchema: z.ZodEnum<["openai-compatible"]>;
68
+ export type ProviderKind = z.infer<typeof ProviderKindSchema>;
69
+ export declare const ProviderConfigSchema: z.ZodObject<{
70
+ id: z.ZodString;
71
+ providerKey: z.ZodString;
72
+ label: z.ZodString;
73
+ kind: z.ZodEnum<["openai-compatible"]>;
74
+ baseUrl: z.ZodString;
75
+ defaultModel: z.ZodString;
76
+ hasApiKey: z.ZodBoolean;
77
+ createdAt: z.ZodString;
78
+ updatedAt: z.ZodString;
79
+ }, "strip", z.ZodTypeAny, {
80
+ id: string;
81
+ providerKey: string;
82
+ label: string;
83
+ kind: "openai-compatible";
84
+ baseUrl: string;
85
+ defaultModel: string;
86
+ hasApiKey: boolean;
87
+ createdAt: string;
88
+ updatedAt: string;
89
+ }, {
90
+ id: string;
91
+ providerKey: string;
92
+ label: string;
93
+ kind: "openai-compatible";
94
+ baseUrl: string;
95
+ defaultModel: string;
96
+ hasApiKey: boolean;
97
+ createdAt: string;
98
+ updatedAt: string;
99
+ }>;
100
+ export type ProviderConfig = z.infer<typeof ProviderConfigSchema>;
101
+ export declare const ProviderUpsertInputSchema: z.ZodObject<{
102
+ label: z.ZodString;
103
+ kind: z.ZodDefault<z.ZodEnum<["openai-compatible"]>>;
104
+ baseUrl: z.ZodString;
105
+ defaultModel: z.ZodString;
106
+ apiKey: z.ZodOptional<z.ZodString>;
107
+ clearApiKey: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
108
+ }, "strip", z.ZodTypeAny, {
109
+ label: string;
110
+ kind: "openai-compatible";
111
+ baseUrl: string;
112
+ defaultModel: string;
113
+ clearApiKey: boolean;
114
+ apiKey?: string | undefined;
115
+ }, {
116
+ label: string;
117
+ baseUrl: string;
118
+ defaultModel: string;
119
+ apiKey?: string | undefined;
120
+ kind?: "openai-compatible" | undefined;
121
+ clearApiKey?: boolean | undefined;
122
+ }>;
123
+ export type ProviderUpsertInput = z.infer<typeof ProviderUpsertInputSchema>;
124
+ export declare const ProviderConnectionTestInputSchema: z.ZodEffects<z.ZodObject<{
125
+ providerKey: z.ZodOptional<z.ZodString>;
126
+ baseUrl: z.ZodOptional<z.ZodString>;
127
+ apiKey: z.ZodOptional<z.ZodString>;
128
+ model: z.ZodString;
129
+ kind: z.ZodDefault<z.ZodEnum<["openai-compatible"]>>;
130
+ }, "strip", z.ZodTypeAny, {
131
+ kind: "openai-compatible";
132
+ model: string;
133
+ apiKey?: string | undefined;
134
+ providerKey?: string | undefined;
135
+ baseUrl?: string | undefined;
136
+ }, {
137
+ model: string;
138
+ apiKey?: string | undefined;
139
+ providerKey?: string | undefined;
140
+ kind?: "openai-compatible" | undefined;
141
+ baseUrl?: string | undefined;
142
+ }>, {
143
+ kind: "openai-compatible";
144
+ model: string;
145
+ apiKey?: string | undefined;
146
+ providerKey?: string | undefined;
147
+ baseUrl?: string | undefined;
148
+ }, {
149
+ model: string;
150
+ apiKey?: string | undefined;
151
+ providerKey?: string | undefined;
152
+ kind?: "openai-compatible" | undefined;
153
+ baseUrl?: string | undefined;
154
+ }>;
155
+ export type ProviderConnectionTestInput = z.infer<typeof ProviderConnectionTestInputSchema>;
156
+ export declare const AgentBindingUpdateInputSchema: z.ZodObject<{
157
+ providerKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
158
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
159
+ seenEnabled: z.ZodOptional<z.ZodBoolean>;
160
+ traceEnabled: z.ZodOptional<z.ZodBoolean>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ providerKey?: string | null | undefined;
163
+ model?: string | null | undefined;
164
+ seenEnabled?: boolean | undefined;
165
+ traceEnabled?: boolean | undefined;
166
+ }, {
167
+ providerKey?: string | null | undefined;
168
+ model?: string | null | undefined;
169
+ seenEnabled?: boolean | undefined;
170
+ traceEnabled?: boolean | undefined;
171
+ }>;
172
+ export type AgentBindingUpdateInput = z.infer<typeof AgentBindingUpdateInputSchema>;
173
+ export declare const AgentCreateInputSchema: z.ZodObject<{
174
+ name: z.ZodString;
175
+ title: z.ZodString;
176
+ model: z.ZodString;
177
+ providerKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
178
+ systemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
+ projectId: z.ZodOptional<z.ZodString>;
180
+ seenEnabled: z.ZodDefault<z.ZodBoolean>;
181
+ traceEnabled: z.ZodDefault<z.ZodBoolean>;
182
+ }, "strip", z.ZodTypeAny, {
183
+ model: string;
184
+ seenEnabled: boolean;
185
+ traceEnabled: boolean;
186
+ name: string;
187
+ title: string;
188
+ providerKey?: string | null | undefined;
189
+ systemPrompt?: string | null | undefined;
190
+ projectId?: string | undefined;
191
+ }, {
192
+ model: string;
193
+ name: string;
194
+ title: string;
195
+ providerKey?: string | null | undefined;
196
+ seenEnabled?: boolean | undefined;
197
+ traceEnabled?: boolean | undefined;
198
+ systemPrompt?: string | null | undefined;
199
+ projectId?: string | undefined;
200
+ }>;
201
+ export type AgentCreateInput = z.infer<typeof AgentCreateInputSchema>;
202
+ export declare const AgentStatusSchema: z.ZodEnum<["idle", "thinking", "typing"]>;
203
+ export type AgentStatus = z.infer<typeof AgentStatusSchema>;
204
+ export declare const MessageSchema: z.ZodObject<{
205
+ id: z.ZodString;
206
+ projectId: z.ZodString;
207
+ senderId: z.ZodString;
208
+ senderName: z.ZodString;
209
+ senderRole: z.ZodEnum<["human", "agent"]>;
210
+ body: z.ZodString;
211
+ internalTrace: z.ZodNullable<z.ZodString>;
212
+ createdAt: z.ZodString;
213
+ }, "strip", z.ZodTypeAny, {
214
+ id: string;
215
+ createdAt: string;
216
+ projectId: string;
217
+ senderId: string;
218
+ senderName: string;
219
+ senderRole: "human" | "agent";
220
+ body: string;
221
+ internalTrace: string | null;
222
+ }, {
223
+ id: string;
224
+ createdAt: string;
225
+ projectId: string;
226
+ senderId: string;
227
+ senderName: string;
228
+ senderRole: "human" | "agent";
229
+ body: string;
230
+ internalTrace: string | null;
231
+ }>;
232
+ export type Message = z.infer<typeof MessageSchema>;
233
+ export declare const AgentSchema: z.ZodObject<{
234
+ id: z.ZodString;
235
+ name: z.ZodString;
236
+ title: z.ZodString;
237
+ model: z.ZodString;
238
+ providerKey: z.ZodDefault<z.ZodNullable<z.ZodString>>;
239
+ systemPrompt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
240
+ seenEnabled: z.ZodDefault<z.ZodBoolean>;
241
+ traceEnabled: z.ZodDefault<z.ZodBoolean>;
242
+ status: z.ZodEnum<["idle", "thinking", "typing"]>;
243
+ createdAt: z.ZodString;
244
+ }, "strip", z.ZodTypeAny, {
245
+ status: "idle" | "thinking" | "typing";
246
+ id: string;
247
+ providerKey: string | null;
248
+ createdAt: string;
249
+ model: string;
250
+ seenEnabled: boolean;
251
+ traceEnabled: boolean;
252
+ name: string;
253
+ title: string;
254
+ systemPrompt: string | null;
255
+ }, {
256
+ status: "idle" | "thinking" | "typing";
257
+ id: string;
258
+ createdAt: string;
259
+ model: string;
260
+ name: string;
261
+ title: string;
262
+ providerKey?: string | null | undefined;
263
+ seenEnabled?: boolean | undefined;
264
+ traceEnabled?: boolean | undefined;
265
+ systemPrompt?: string | null | undefined;
266
+ }>;
267
+ export type Agent = z.infer<typeof AgentSchema>;
268
+ export declare const ProjectSchema: z.ZodObject<{
269
+ id: z.ZodString;
270
+ name: z.ZodString;
271
+ createdAt: z.ZodString;
272
+ }, "strip", z.ZodTypeAny, {
273
+ id: string;
274
+ createdAt: string;
275
+ name: string;
276
+ }, {
277
+ id: string;
278
+ createdAt: string;
279
+ name: string;
280
+ }>;
281
+ export type Project = z.infer<typeof ProjectSchema>;
282
+ export declare const ProjectMessagePreviewSchema: z.ZodObject<{
283
+ messageId: z.ZodString;
284
+ senderRole: z.ZodEnum<["human", "agent"]>;
285
+ senderName: z.ZodString;
286
+ body: z.ZodString;
287
+ createdAt: z.ZodString;
288
+ }, "strip", z.ZodTypeAny, {
289
+ createdAt: string;
290
+ senderName: string;
291
+ senderRole: "human" | "agent";
292
+ body: string;
293
+ messageId: string;
294
+ }, {
295
+ createdAt: string;
296
+ senderName: string;
297
+ senderRole: "human" | "agent";
298
+ body: string;
299
+ messageId: string;
300
+ }>;
301
+ export type ProjectMessagePreview = z.infer<typeof ProjectMessagePreviewSchema>;
302
+ export declare const ProjectThreadSchema: z.ZodObject<{
303
+ id: z.ZodString;
304
+ name: z.ZodString;
305
+ createdAt: z.ZodString;
306
+ assignedAgentCount: z.ZodNumber;
307
+ lastSeenByCount: z.ZodNumber;
308
+ lastMessage: z.ZodNullable<z.ZodObject<{
309
+ messageId: z.ZodString;
310
+ senderRole: z.ZodEnum<["human", "agent"]>;
311
+ senderName: z.ZodString;
312
+ body: z.ZodString;
313
+ createdAt: z.ZodString;
314
+ }, "strip", z.ZodTypeAny, {
315
+ createdAt: string;
316
+ senderName: string;
317
+ senderRole: "human" | "agent";
318
+ body: string;
319
+ messageId: string;
320
+ }, {
321
+ createdAt: string;
322
+ senderName: string;
323
+ senderRole: "human" | "agent";
324
+ body: string;
325
+ messageId: string;
326
+ }>>;
327
+ }, "strip", z.ZodTypeAny, {
328
+ id: string;
329
+ createdAt: string;
330
+ name: string;
331
+ assignedAgentCount: number;
332
+ lastSeenByCount: number;
333
+ lastMessage: {
334
+ createdAt: string;
335
+ senderName: string;
336
+ senderRole: "human" | "agent";
337
+ body: string;
338
+ messageId: string;
339
+ } | null;
340
+ }, {
341
+ id: string;
342
+ createdAt: string;
343
+ name: string;
344
+ assignedAgentCount: number;
345
+ lastSeenByCount: number;
346
+ lastMessage: {
347
+ createdAt: string;
348
+ senderName: string;
349
+ senderRole: "human" | "agent";
350
+ body: string;
351
+ messageId: string;
352
+ } | null;
353
+ }>;
354
+ export type ProjectThread = z.infer<typeof ProjectThreadSchema>;
355
+ export declare const ProjectCreateInputSchema: z.ZodObject<{
356
+ name: z.ZodString;
357
+ }, "strip", z.ZodTypeAny, {
358
+ name: string;
359
+ }, {
360
+ name: string;
361
+ }>;
362
+ export type ProjectCreateInput = z.infer<typeof ProjectCreateInputSchema>;
363
+ export declare const ProjectAgentAssignmentInputSchema: z.ZodObject<{
364
+ agentIds: z.ZodArray<z.ZodString, "many">;
365
+ }, "strip", z.ZodTypeAny, {
366
+ agentIds: string[];
367
+ }, {
368
+ agentIds: string[];
369
+ }>;
370
+ export type ProjectAgentAssignmentInput = z.infer<typeof ProjectAgentAssignmentInputSchema>;
371
+ export declare const SeenReceiptSchema: z.ZodObject<{
372
+ id: z.ZodString;
373
+ messageId: z.ZodString;
374
+ agentId: z.ZodString;
375
+ agentName: z.ZodString;
376
+ model: z.ZodString;
377
+ seenAt: z.ZodString;
378
+ }, "strip", z.ZodTypeAny, {
379
+ id: string;
380
+ model: string;
381
+ messageId: string;
382
+ agentId: string;
383
+ agentName: string;
384
+ seenAt: string;
385
+ }, {
386
+ id: string;
387
+ model: string;
388
+ messageId: string;
389
+ agentId: string;
390
+ agentName: string;
391
+ seenAt: string;
392
+ }>;
393
+ export type SeenReceipt = z.infer<typeof SeenReceiptSchema>;
394
+ export declare const TaskStatusSchema: z.ZodEnum<["queued", "in_progress", "blocked", "done", "cancelled"]>;
395
+ export type TaskStatus = z.infer<typeof TaskStatusSchema>;
396
+ export declare const TaskApprovalStatusSchema: z.ZodEnum<["not_required", "pending", "approved", "rejected"]>;
397
+ export type TaskApprovalStatus = z.infer<typeof TaskApprovalStatusSchema>;
398
+ export declare const TaskActionTypeSchema: z.ZodEnum<["none", "file_write", "file_mkdir", "file_rename", "file_delete"]>;
399
+ export type TaskActionType = z.infer<typeof TaskActionTypeSchema>;
400
+ export declare const TaskActionPayloadSchema: z.ZodObject<{
401
+ path: z.ZodOptional<z.ZodString>;
402
+ nextPath: z.ZodOptional<z.ZodString>;
403
+ content: z.ZodOptional<z.ZodString>;
404
+ }, "strict", z.ZodTypeAny, {
405
+ path?: string | undefined;
406
+ nextPath?: string | undefined;
407
+ content?: string | undefined;
408
+ }, {
409
+ path?: string | undefined;
410
+ nextPath?: string | undefined;
411
+ content?: string | undefined;
412
+ }>;
413
+ export type TaskActionPayload = z.infer<typeof TaskActionPayloadSchema>;
414
+ export declare const TaskSchema: z.ZodObject<{
415
+ id: z.ZodString;
416
+ projectId: z.ZodString;
417
+ title: z.ZodString;
418
+ description: z.ZodNullable<z.ZodString>;
419
+ status: z.ZodEnum<["queued", "in_progress", "blocked", "done", "cancelled"]>;
420
+ approvalStatus: z.ZodEnum<["not_required", "pending", "approved", "rejected"]>;
421
+ actionType: z.ZodEnum<["none", "file_write", "file_mkdir", "file_rename", "file_delete"]>;
422
+ actionPayload: z.ZodNullable<z.ZodObject<{
423
+ path: z.ZodOptional<z.ZodString>;
424
+ nextPath: z.ZodOptional<z.ZodString>;
425
+ content: z.ZodOptional<z.ZodString>;
426
+ }, "strict", z.ZodTypeAny, {
427
+ path?: string | undefined;
428
+ nextPath?: string | undefined;
429
+ content?: string | undefined;
430
+ }, {
431
+ path?: string | undefined;
432
+ nextPath?: string | undefined;
433
+ content?: string | undefined;
434
+ }>>;
435
+ assigneeAgentId: z.ZodNullable<z.ZodString>;
436
+ assigneeAgentName: z.ZodNullable<z.ZodString>;
437
+ delegatedByMessageId: z.ZodNullable<z.ZodString>;
438
+ createdBy: z.ZodString;
439
+ createdAt: z.ZodString;
440
+ updatedAt: z.ZodString;
441
+ completedAt: z.ZodNullable<z.ZodString>;
442
+ errorMessage: z.ZodNullable<z.ZodString>;
443
+ }, "strip", z.ZodTypeAny, {
444
+ status: "queued" | "in_progress" | "blocked" | "done" | "cancelled";
445
+ id: string;
446
+ createdAt: string;
447
+ updatedAt: string;
448
+ title: string;
449
+ projectId: string;
450
+ description: string | null;
451
+ approvalStatus: "not_required" | "pending" | "approved" | "rejected";
452
+ actionType: "none" | "file_write" | "file_mkdir" | "file_rename" | "file_delete";
453
+ actionPayload: {
454
+ path?: string | undefined;
455
+ nextPath?: string | undefined;
456
+ content?: string | undefined;
457
+ } | null;
458
+ assigneeAgentId: string | null;
459
+ assigneeAgentName: string | null;
460
+ delegatedByMessageId: string | null;
461
+ createdBy: string;
462
+ completedAt: string | null;
463
+ errorMessage: string | null;
464
+ }, {
465
+ status: "queued" | "in_progress" | "blocked" | "done" | "cancelled";
466
+ id: string;
467
+ createdAt: string;
468
+ updatedAt: string;
469
+ title: string;
470
+ projectId: string;
471
+ description: string | null;
472
+ approvalStatus: "not_required" | "pending" | "approved" | "rejected";
473
+ actionType: "none" | "file_write" | "file_mkdir" | "file_rename" | "file_delete";
474
+ actionPayload: {
475
+ path?: string | undefined;
476
+ nextPath?: string | undefined;
477
+ content?: string | undefined;
478
+ } | null;
479
+ assigneeAgentId: string | null;
480
+ assigneeAgentName: string | null;
481
+ delegatedByMessageId: string | null;
482
+ createdBy: string;
483
+ completedAt: string | null;
484
+ errorMessage: string | null;
485
+ }>;
486
+ export type Task = z.infer<typeof TaskSchema>;
487
+ export declare const TaskEventTypeSchema: z.ZodEnum<["created", "policy_applied", "approved", "rejected", "retry_requested", "cancelled", "execution_started", "execution_succeeded", "execution_failed", "status_changed"]>;
488
+ export type TaskEventType = z.infer<typeof TaskEventTypeSchema>;
489
+ export declare const TaskEventSchema: z.ZodObject<{
490
+ id: z.ZodString;
491
+ taskId: z.ZodString;
492
+ projectId: z.ZodString;
493
+ eventType: z.ZodEnum<["created", "policy_applied", "approved", "rejected", "retry_requested", "cancelled", "execution_started", "execution_succeeded", "execution_failed", "status_changed"]>;
494
+ actorId: z.ZodString;
495
+ detail: z.ZodNullable<z.ZodString>;
496
+ createdAt: z.ZodString;
497
+ }, "strip", z.ZodTypeAny, {
498
+ id: string;
499
+ createdAt: string;
500
+ projectId: string;
501
+ taskId: string;
502
+ eventType: "cancelled" | "approved" | "rejected" | "created" | "policy_applied" | "retry_requested" | "execution_started" | "execution_succeeded" | "execution_failed" | "status_changed";
503
+ actorId: string;
504
+ detail: string | null;
505
+ }, {
506
+ id: string;
507
+ createdAt: string;
508
+ projectId: string;
509
+ taskId: string;
510
+ eventType: "cancelled" | "approved" | "rejected" | "created" | "policy_applied" | "retry_requested" | "execution_started" | "execution_succeeded" | "execution_failed" | "status_changed";
511
+ actorId: string;
512
+ detail: string | null;
513
+ }>;
514
+ export type TaskEvent = z.infer<typeof TaskEventSchema>;
515
+ export declare const BootstrapPayloadSchema: z.ZodObject<{
516
+ project: z.ZodObject<{
517
+ id: z.ZodString;
518
+ name: z.ZodString;
519
+ createdAt: z.ZodString;
520
+ }, "strip", z.ZodTypeAny, {
521
+ id: string;
522
+ createdAt: string;
523
+ name: string;
524
+ }, {
525
+ id: string;
526
+ createdAt: string;
527
+ name: string;
528
+ }>;
529
+ projects: z.ZodArray<z.ZodObject<{
530
+ id: z.ZodString;
531
+ name: z.ZodString;
532
+ createdAt: z.ZodString;
533
+ assignedAgentCount: z.ZodNumber;
534
+ lastSeenByCount: z.ZodNumber;
535
+ lastMessage: z.ZodNullable<z.ZodObject<{
536
+ messageId: z.ZodString;
537
+ senderRole: z.ZodEnum<["human", "agent"]>;
538
+ senderName: z.ZodString;
539
+ body: z.ZodString;
540
+ createdAt: z.ZodString;
541
+ }, "strip", z.ZodTypeAny, {
542
+ createdAt: string;
543
+ senderName: string;
544
+ senderRole: "human" | "agent";
545
+ body: string;
546
+ messageId: string;
547
+ }, {
548
+ createdAt: string;
549
+ senderName: string;
550
+ senderRole: "human" | "agent";
551
+ body: string;
552
+ messageId: string;
553
+ }>>;
554
+ }, "strip", z.ZodTypeAny, {
555
+ id: string;
556
+ createdAt: string;
557
+ name: string;
558
+ assignedAgentCount: number;
559
+ lastSeenByCount: number;
560
+ lastMessage: {
561
+ createdAt: string;
562
+ senderName: string;
563
+ senderRole: "human" | "agent";
564
+ body: string;
565
+ messageId: string;
566
+ } | null;
567
+ }, {
568
+ id: string;
569
+ createdAt: string;
570
+ name: string;
571
+ assignedAgentCount: number;
572
+ lastSeenByCount: number;
573
+ lastMessage: {
574
+ createdAt: string;
575
+ senderName: string;
576
+ senderRole: "human" | "agent";
577
+ body: string;
578
+ messageId: string;
579
+ } | null;
580
+ }>, "many">;
581
+ projectAgentIds: z.ZodArray<z.ZodString, "many">;
582
+ projectAgentIdsByProject: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
583
+ agents: z.ZodArray<z.ZodObject<{
584
+ id: z.ZodString;
585
+ name: z.ZodString;
586
+ title: z.ZodString;
587
+ model: z.ZodString;
588
+ providerKey: z.ZodDefault<z.ZodNullable<z.ZodString>>;
589
+ systemPrompt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
590
+ seenEnabled: z.ZodDefault<z.ZodBoolean>;
591
+ traceEnabled: z.ZodDefault<z.ZodBoolean>;
592
+ status: z.ZodEnum<["idle", "thinking", "typing"]>;
593
+ createdAt: z.ZodString;
594
+ }, "strip", z.ZodTypeAny, {
595
+ status: "idle" | "thinking" | "typing";
596
+ id: string;
597
+ providerKey: string | null;
598
+ createdAt: string;
599
+ model: string;
600
+ seenEnabled: boolean;
601
+ traceEnabled: boolean;
602
+ name: string;
603
+ title: string;
604
+ systemPrompt: string | null;
605
+ }, {
606
+ status: "idle" | "thinking" | "typing";
607
+ id: string;
608
+ createdAt: string;
609
+ model: string;
610
+ name: string;
611
+ title: string;
612
+ providerKey?: string | null | undefined;
613
+ seenEnabled?: boolean | undefined;
614
+ traceEnabled?: boolean | undefined;
615
+ systemPrompt?: string | null | undefined;
616
+ }>, "many">;
617
+ providers: z.ZodArray<z.ZodObject<{
618
+ id: z.ZodString;
619
+ providerKey: z.ZodString;
620
+ label: z.ZodString;
621
+ kind: z.ZodEnum<["openai-compatible"]>;
622
+ baseUrl: z.ZodString;
623
+ defaultModel: z.ZodString;
624
+ hasApiKey: z.ZodBoolean;
625
+ createdAt: z.ZodString;
626
+ updatedAt: z.ZodString;
627
+ }, "strip", z.ZodTypeAny, {
628
+ id: string;
629
+ providerKey: string;
630
+ label: string;
631
+ kind: "openai-compatible";
632
+ baseUrl: string;
633
+ defaultModel: string;
634
+ hasApiKey: boolean;
635
+ createdAt: string;
636
+ updatedAt: string;
637
+ }, {
638
+ id: string;
639
+ providerKey: string;
640
+ label: string;
641
+ kind: "openai-compatible";
642
+ baseUrl: string;
643
+ defaultModel: string;
644
+ hasApiKey: boolean;
645
+ createdAt: string;
646
+ updatedAt: string;
647
+ }>, "many">;
648
+ messages: z.ZodArray<z.ZodObject<{
649
+ id: z.ZodString;
650
+ projectId: z.ZodString;
651
+ senderId: z.ZodString;
652
+ senderName: z.ZodString;
653
+ senderRole: z.ZodEnum<["human", "agent"]>;
654
+ body: z.ZodString;
655
+ internalTrace: z.ZodNullable<z.ZodString>;
656
+ createdAt: z.ZodString;
657
+ }, "strip", z.ZodTypeAny, {
658
+ id: string;
659
+ createdAt: string;
660
+ projectId: string;
661
+ senderId: string;
662
+ senderName: string;
663
+ senderRole: "human" | "agent";
664
+ body: string;
665
+ internalTrace: string | null;
666
+ }, {
667
+ id: string;
668
+ createdAt: string;
669
+ projectId: string;
670
+ senderId: string;
671
+ senderName: string;
672
+ senderRole: "human" | "agent";
673
+ body: string;
674
+ internalTrace: string | null;
675
+ }>, "many">;
676
+ receiptsByMessage: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
677
+ id: z.ZodString;
678
+ messageId: z.ZodString;
679
+ agentId: z.ZodString;
680
+ agentName: z.ZodString;
681
+ model: z.ZodString;
682
+ seenAt: z.ZodString;
683
+ }, "strip", z.ZodTypeAny, {
684
+ id: string;
685
+ model: string;
686
+ messageId: string;
687
+ agentId: string;
688
+ agentName: string;
689
+ seenAt: string;
690
+ }, {
691
+ id: string;
692
+ model: string;
693
+ messageId: string;
694
+ agentId: string;
695
+ agentName: string;
696
+ seenAt: string;
697
+ }>, "many">>;
698
+ tasks: z.ZodArray<z.ZodObject<{
699
+ id: z.ZodString;
700
+ projectId: z.ZodString;
701
+ title: z.ZodString;
702
+ description: z.ZodNullable<z.ZodString>;
703
+ status: z.ZodEnum<["queued", "in_progress", "blocked", "done", "cancelled"]>;
704
+ approvalStatus: z.ZodEnum<["not_required", "pending", "approved", "rejected"]>;
705
+ actionType: z.ZodEnum<["none", "file_write", "file_mkdir", "file_rename", "file_delete"]>;
706
+ actionPayload: z.ZodNullable<z.ZodObject<{
707
+ path: z.ZodOptional<z.ZodString>;
708
+ nextPath: z.ZodOptional<z.ZodString>;
709
+ content: z.ZodOptional<z.ZodString>;
710
+ }, "strict", z.ZodTypeAny, {
711
+ path?: string | undefined;
712
+ nextPath?: string | undefined;
713
+ content?: string | undefined;
714
+ }, {
715
+ path?: string | undefined;
716
+ nextPath?: string | undefined;
717
+ content?: string | undefined;
718
+ }>>;
719
+ assigneeAgentId: z.ZodNullable<z.ZodString>;
720
+ assigneeAgentName: z.ZodNullable<z.ZodString>;
721
+ delegatedByMessageId: z.ZodNullable<z.ZodString>;
722
+ createdBy: z.ZodString;
723
+ createdAt: z.ZodString;
724
+ updatedAt: z.ZodString;
725
+ completedAt: z.ZodNullable<z.ZodString>;
726
+ errorMessage: z.ZodNullable<z.ZodString>;
727
+ }, "strip", z.ZodTypeAny, {
728
+ status: "queued" | "in_progress" | "blocked" | "done" | "cancelled";
729
+ id: string;
730
+ createdAt: string;
731
+ updatedAt: string;
732
+ title: string;
733
+ projectId: string;
734
+ description: string | null;
735
+ approvalStatus: "not_required" | "pending" | "approved" | "rejected";
736
+ actionType: "none" | "file_write" | "file_mkdir" | "file_rename" | "file_delete";
737
+ actionPayload: {
738
+ path?: string | undefined;
739
+ nextPath?: string | undefined;
740
+ content?: string | undefined;
741
+ } | null;
742
+ assigneeAgentId: string | null;
743
+ assigneeAgentName: string | null;
744
+ delegatedByMessageId: string | null;
745
+ createdBy: string;
746
+ completedAt: string | null;
747
+ errorMessage: string | null;
748
+ }, {
749
+ status: "queued" | "in_progress" | "blocked" | "done" | "cancelled";
750
+ id: string;
751
+ createdAt: string;
752
+ updatedAt: string;
753
+ title: string;
754
+ projectId: string;
755
+ description: string | null;
756
+ approvalStatus: "not_required" | "pending" | "approved" | "rejected";
757
+ actionType: "none" | "file_write" | "file_mkdir" | "file_rename" | "file_delete";
758
+ actionPayload: {
759
+ path?: string | undefined;
760
+ nextPath?: string | undefined;
761
+ content?: string | undefined;
762
+ } | null;
763
+ assigneeAgentId: string | null;
764
+ assigneeAgentName: string | null;
765
+ delegatedByMessageId: string | null;
766
+ createdBy: string;
767
+ completedAt: string | null;
768
+ errorMessage: string | null;
769
+ }>, "many">;
770
+ taskEventsByTask: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
771
+ id: z.ZodString;
772
+ taskId: z.ZodString;
773
+ projectId: z.ZodString;
774
+ eventType: z.ZodEnum<["created", "policy_applied", "approved", "rejected", "retry_requested", "cancelled", "execution_started", "execution_succeeded", "execution_failed", "status_changed"]>;
775
+ actorId: z.ZodString;
776
+ detail: z.ZodNullable<z.ZodString>;
777
+ createdAt: z.ZodString;
778
+ }, "strip", z.ZodTypeAny, {
779
+ id: string;
780
+ createdAt: string;
781
+ projectId: string;
782
+ taskId: string;
783
+ eventType: "cancelled" | "approved" | "rejected" | "created" | "policy_applied" | "retry_requested" | "execution_started" | "execution_succeeded" | "execution_failed" | "status_changed";
784
+ actorId: string;
785
+ detail: string | null;
786
+ }, {
787
+ id: string;
788
+ createdAt: string;
789
+ projectId: string;
790
+ taskId: string;
791
+ eventType: "cancelled" | "approved" | "rejected" | "created" | "policy_applied" | "retry_requested" | "execution_started" | "execution_succeeded" | "execution_failed" | "status_changed";
792
+ actorId: string;
793
+ detail: string | null;
794
+ }>, "many">>;
795
+ }, "strip", z.ZodTypeAny, {
796
+ project: {
797
+ id: string;
798
+ createdAt: string;
799
+ name: string;
800
+ };
801
+ projects: {
802
+ id: string;
803
+ createdAt: string;
804
+ name: string;
805
+ assignedAgentCount: number;
806
+ lastSeenByCount: number;
807
+ lastMessage: {
808
+ createdAt: string;
809
+ senderName: string;
810
+ senderRole: "human" | "agent";
811
+ body: string;
812
+ messageId: string;
813
+ } | null;
814
+ }[];
815
+ projectAgentIds: string[];
816
+ projectAgentIdsByProject: Record<string, string[]>;
817
+ agents: {
818
+ status: "idle" | "thinking" | "typing";
819
+ id: string;
820
+ providerKey: string | null;
821
+ createdAt: string;
822
+ model: string;
823
+ seenEnabled: boolean;
824
+ traceEnabled: boolean;
825
+ name: string;
826
+ title: string;
827
+ systemPrompt: string | null;
828
+ }[];
829
+ providers: {
830
+ id: string;
831
+ providerKey: string;
832
+ label: string;
833
+ kind: "openai-compatible";
834
+ baseUrl: string;
835
+ defaultModel: string;
836
+ hasApiKey: boolean;
837
+ createdAt: string;
838
+ updatedAt: string;
839
+ }[];
840
+ messages: {
841
+ id: string;
842
+ createdAt: string;
843
+ projectId: string;
844
+ senderId: string;
845
+ senderName: string;
846
+ senderRole: "human" | "agent";
847
+ body: string;
848
+ internalTrace: string | null;
849
+ }[];
850
+ receiptsByMessage: Record<string, {
851
+ id: string;
852
+ model: string;
853
+ messageId: string;
854
+ agentId: string;
855
+ agentName: string;
856
+ seenAt: string;
857
+ }[]>;
858
+ tasks: {
859
+ status: "queued" | "in_progress" | "blocked" | "done" | "cancelled";
860
+ id: string;
861
+ createdAt: string;
862
+ updatedAt: string;
863
+ title: string;
864
+ projectId: string;
865
+ description: string | null;
866
+ approvalStatus: "not_required" | "pending" | "approved" | "rejected";
867
+ actionType: "none" | "file_write" | "file_mkdir" | "file_rename" | "file_delete";
868
+ actionPayload: {
869
+ path?: string | undefined;
870
+ nextPath?: string | undefined;
871
+ content?: string | undefined;
872
+ } | null;
873
+ assigneeAgentId: string | null;
874
+ assigneeAgentName: string | null;
875
+ delegatedByMessageId: string | null;
876
+ createdBy: string;
877
+ completedAt: string | null;
878
+ errorMessage: string | null;
879
+ }[];
880
+ taskEventsByTask: Record<string, {
881
+ id: string;
882
+ createdAt: string;
883
+ projectId: string;
884
+ taskId: string;
885
+ eventType: "cancelled" | "approved" | "rejected" | "created" | "policy_applied" | "retry_requested" | "execution_started" | "execution_succeeded" | "execution_failed" | "status_changed";
886
+ actorId: string;
887
+ detail: string | null;
888
+ }[]>;
889
+ }, {
890
+ project: {
891
+ id: string;
892
+ createdAt: string;
893
+ name: string;
894
+ };
895
+ projects: {
896
+ id: string;
897
+ createdAt: string;
898
+ name: string;
899
+ assignedAgentCount: number;
900
+ lastSeenByCount: number;
901
+ lastMessage: {
902
+ createdAt: string;
903
+ senderName: string;
904
+ senderRole: "human" | "agent";
905
+ body: string;
906
+ messageId: string;
907
+ } | null;
908
+ }[];
909
+ projectAgentIds: string[];
910
+ projectAgentIdsByProject: Record<string, string[]>;
911
+ agents: {
912
+ status: "idle" | "thinking" | "typing";
913
+ id: string;
914
+ createdAt: string;
915
+ model: string;
916
+ name: string;
917
+ title: string;
918
+ providerKey?: string | null | undefined;
919
+ seenEnabled?: boolean | undefined;
920
+ traceEnabled?: boolean | undefined;
921
+ systemPrompt?: string | null | undefined;
922
+ }[];
923
+ providers: {
924
+ id: string;
925
+ providerKey: string;
926
+ label: string;
927
+ kind: "openai-compatible";
928
+ baseUrl: string;
929
+ defaultModel: string;
930
+ hasApiKey: boolean;
931
+ createdAt: string;
932
+ updatedAt: string;
933
+ }[];
934
+ messages: {
935
+ id: string;
936
+ createdAt: string;
937
+ projectId: string;
938
+ senderId: string;
939
+ senderName: string;
940
+ senderRole: "human" | "agent";
941
+ body: string;
942
+ internalTrace: string | null;
943
+ }[];
944
+ receiptsByMessage: Record<string, {
945
+ id: string;
946
+ model: string;
947
+ messageId: string;
948
+ agentId: string;
949
+ agentName: string;
950
+ seenAt: string;
951
+ }[]>;
952
+ tasks: {
953
+ status: "queued" | "in_progress" | "blocked" | "done" | "cancelled";
954
+ id: string;
955
+ createdAt: string;
956
+ updatedAt: string;
957
+ title: string;
958
+ projectId: string;
959
+ description: string | null;
960
+ approvalStatus: "not_required" | "pending" | "approved" | "rejected";
961
+ actionType: "none" | "file_write" | "file_mkdir" | "file_rename" | "file_delete";
962
+ actionPayload: {
963
+ path?: string | undefined;
964
+ nextPath?: string | undefined;
965
+ content?: string | undefined;
966
+ } | null;
967
+ assigneeAgentId: string | null;
968
+ assigneeAgentName: string | null;
969
+ delegatedByMessageId: string | null;
970
+ createdBy: string;
971
+ completedAt: string | null;
972
+ errorMessage: string | null;
973
+ }[];
974
+ taskEventsByTask: Record<string, {
975
+ id: string;
976
+ createdAt: string;
977
+ projectId: string;
978
+ taskId: string;
979
+ eventType: "cancelled" | "approved" | "rejected" | "created" | "policy_applied" | "retry_requested" | "execution_started" | "execution_succeeded" | "execution_failed" | "status_changed";
980
+ actorId: string;
981
+ detail: string | null;
982
+ }[]>;
983
+ }>;
984
+ export type BootstrapPayload = z.infer<typeof BootstrapPayloadSchema>;
985
+ export declare const TypingEventSchema: z.ZodObject<{
986
+ projectId: z.ZodString;
987
+ agentId: z.ZodString;
988
+ agentName: z.ZodString;
989
+ model: z.ZodString;
990
+ state: z.ZodEnum<["idle", "thinking", "typing"]>;
991
+ }, "strip", z.ZodTypeAny, {
992
+ model: string;
993
+ projectId: string;
994
+ agentId: string;
995
+ agentName: string;
996
+ state: "idle" | "thinking" | "typing";
997
+ }, {
998
+ model: string;
999
+ projectId: string;
1000
+ agentId: string;
1001
+ agentName: string;
1002
+ state: "idle" | "thinking" | "typing";
1003
+ }>;
1004
+ export type TypingEvent = z.infer<typeof TypingEventSchema>;
1005
+ export declare const ClientMessageInputSchema: z.ZodObject<{
1006
+ body: z.ZodString;
1007
+ senderName: z.ZodDefault<z.ZodString>;
1008
+ }, "strip", z.ZodTypeAny, {
1009
+ senderName: string;
1010
+ body: string;
1011
+ }, {
1012
+ body: string;
1013
+ senderName?: string | undefined;
1014
+ }>;
1015
+ export type ClientMessageInput = z.infer<typeof ClientMessageInputSchema>;
1016
+ export declare const FileReadInputSchema: z.ZodObject<{
1017
+ path: z.ZodString;
1018
+ actorId: z.ZodOptional<z.ZodString>;
1019
+ }, "strip", z.ZodTypeAny, {
1020
+ path: string;
1021
+ actorId?: string | undefined;
1022
+ }, {
1023
+ path: string;
1024
+ actorId?: string | undefined;
1025
+ }>;
1026
+ export declare const FileWriteInputSchema: z.ZodObject<{
1027
+ path: z.ZodString;
1028
+ content: z.ZodString;
1029
+ actorId: z.ZodOptional<z.ZodString>;
1030
+ }, "strip", z.ZodTypeAny, {
1031
+ path: string;
1032
+ content: string;
1033
+ actorId?: string | undefined;
1034
+ }, {
1035
+ path: string;
1036
+ content: string;
1037
+ actorId?: string | undefined;
1038
+ }>;
1039
+ export declare const FileMkdirInputSchema: z.ZodObject<{
1040
+ path: z.ZodString;
1041
+ actorId: z.ZodOptional<z.ZodString>;
1042
+ }, "strip", z.ZodTypeAny, {
1043
+ path: string;
1044
+ actorId?: string | undefined;
1045
+ }, {
1046
+ path: string;
1047
+ actorId?: string | undefined;
1048
+ }>;
1049
+ export declare const FileRenameInputSchema: z.ZodObject<{
1050
+ path: z.ZodString;
1051
+ nextPath: z.ZodString;
1052
+ actorId: z.ZodOptional<z.ZodString>;
1053
+ }, "strip", z.ZodTypeAny, {
1054
+ path: string;
1055
+ nextPath: string;
1056
+ actorId?: string | undefined;
1057
+ }, {
1058
+ path: string;
1059
+ nextPath: string;
1060
+ actorId?: string | undefined;
1061
+ }>;
1062
+ export declare const FileDeleteInputSchema: z.ZodObject<{
1063
+ path: z.ZodString;
1064
+ actorId: z.ZodOptional<z.ZodString>;
1065
+ }, "strip", z.ZodTypeAny, {
1066
+ path: string;
1067
+ actorId?: string | undefined;
1068
+ }, {
1069
+ path: string;
1070
+ actorId?: string | undefined;
1071
+ }>;
1072
+ export declare const FileListInputSchema: z.ZodObject<{
1073
+ path: z.ZodDefault<z.ZodString>;
1074
+ actorId: z.ZodOptional<z.ZodString>;
1075
+ }, "strip", z.ZodTypeAny, {
1076
+ path: string;
1077
+ actorId?: string | undefined;
1078
+ }, {
1079
+ path?: string | undefined;
1080
+ actorId?: string | undefined;
1081
+ }>;
1082
+ export declare const TaskCreateInputSchema: z.ZodObject<{
1083
+ title: z.ZodString;
1084
+ description: z.ZodOptional<z.ZodString>;
1085
+ assigneeAgentId: z.ZodOptional<z.ZodString>;
1086
+ actionType: z.ZodDefault<z.ZodEnum<["none", "file_write", "file_mkdir", "file_rename", "file_delete"]>>;
1087
+ actionPayload: z.ZodOptional<z.ZodObject<{
1088
+ path: z.ZodOptional<z.ZodString>;
1089
+ nextPath: z.ZodOptional<z.ZodString>;
1090
+ content: z.ZodOptional<z.ZodString>;
1091
+ }, "strict", z.ZodTypeAny, {
1092
+ path?: string | undefined;
1093
+ nextPath?: string | undefined;
1094
+ content?: string | undefined;
1095
+ }, {
1096
+ path?: string | undefined;
1097
+ nextPath?: string | undefined;
1098
+ content?: string | undefined;
1099
+ }>>;
1100
+ approvalStatus: z.ZodOptional<z.ZodEnum<["not_required", "pending", "approved", "rejected"]>>;
1101
+ }, "strip", z.ZodTypeAny, {
1102
+ title: string;
1103
+ actionType: "none" | "file_write" | "file_mkdir" | "file_rename" | "file_delete";
1104
+ description?: string | undefined;
1105
+ approvalStatus?: "not_required" | "pending" | "approved" | "rejected" | undefined;
1106
+ actionPayload?: {
1107
+ path?: string | undefined;
1108
+ nextPath?: string | undefined;
1109
+ content?: string | undefined;
1110
+ } | undefined;
1111
+ assigneeAgentId?: string | undefined;
1112
+ }, {
1113
+ title: string;
1114
+ description?: string | undefined;
1115
+ approvalStatus?: "not_required" | "pending" | "approved" | "rejected" | undefined;
1116
+ actionType?: "none" | "file_write" | "file_mkdir" | "file_rename" | "file_delete" | undefined;
1117
+ actionPayload?: {
1118
+ path?: string | undefined;
1119
+ nextPath?: string | undefined;
1120
+ content?: string | undefined;
1121
+ } | undefined;
1122
+ assigneeAgentId?: string | undefined;
1123
+ }>;
1124
+ export type TaskCreateInput = z.infer<typeof TaskCreateInputSchema>;
1125
+ export declare const TaskStatusUpdateInputSchema: z.ZodObject<{
1126
+ status: z.ZodEnum<["queued", "in_progress", "blocked", "done", "cancelled"]>;
1127
+ }, "strip", z.ZodTypeAny, {
1128
+ status: "queued" | "in_progress" | "blocked" | "done" | "cancelled";
1129
+ }, {
1130
+ status: "queued" | "in_progress" | "blocked" | "done" | "cancelled";
1131
+ }>;
1132
+ export type TaskStatusUpdateInput = z.infer<typeof TaskStatusUpdateInputSchema>;
1133
+ //# sourceMappingURL=index.d.ts.map