@fleettools/events 0.1.1 → 0.2.1

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.
@@ -1,363 +0,0 @@
1
- /**
2
- * FleetTools Coordination Event Schemas
3
- *
4
- * Zod schemas for coordination-related events.
5
- */
6
- import { z } from 'zod';
7
- /**
8
- * Coordinator decision event
9
- */
10
- export declare const CoordinatorDecisionSchema: z.ZodObject<{
11
- id: z.ZodString;
12
- project_key: z.ZodString;
13
- timestamp: z.ZodString;
14
- sequence: z.ZodNumber;
15
- } & {
16
- type: z.ZodLiteral<"coordinator_decision">;
17
- data: z.ZodObject<{
18
- decision_id: z.ZodString;
19
- coordinator: z.ZodString;
20
- decision_type: z.ZodEnum<["pilot_assignment", "task_priority", "resource_allocation", "conflict_resolution"]>;
21
- context: z.ZodRecord<z.ZodString, z.ZodUnknown>;
22
- decision: z.ZodRecord<z.ZodString, z.ZodUnknown>;
23
- confidence: z.ZodNumber;
24
- reasoning: z.ZodOptional<z.ZodString>;
25
- }, "strip", z.ZodTypeAny, {
26
- decision_id?: string;
27
- coordinator?: string;
28
- decision_type?: "pilot_assignment" | "task_priority" | "resource_allocation" | "conflict_resolution";
29
- context?: Record<string, unknown>;
30
- decision?: Record<string, unknown>;
31
- confidence?: number;
32
- reasoning?: string;
33
- }, {
34
- decision_id?: string;
35
- coordinator?: string;
36
- decision_type?: "pilot_assignment" | "task_priority" | "resource_allocation" | "conflict_resolution";
37
- context?: Record<string, unknown>;
38
- decision?: Record<string, unknown>;
39
- confidence?: number;
40
- reasoning?: string;
41
- }>;
42
- }, "strip", z.ZodTypeAny, {
43
- type?: "coordinator_decision";
44
- id?: string;
45
- project_key?: string;
46
- timestamp?: string;
47
- sequence?: number;
48
- data?: {
49
- decision_id?: string;
50
- coordinator?: string;
51
- decision_type?: "pilot_assignment" | "task_priority" | "resource_allocation" | "conflict_resolution";
52
- context?: Record<string, unknown>;
53
- decision?: Record<string, unknown>;
54
- confidence?: number;
55
- reasoning?: string;
56
- };
57
- }, {
58
- type?: "coordinator_decision";
59
- id?: string;
60
- project_key?: string;
61
- timestamp?: string;
62
- sequence?: number;
63
- data?: {
64
- decision_id?: string;
65
- coordinator?: string;
66
- decision_type?: "pilot_assignment" | "task_priority" | "resource_allocation" | "conflict_resolution";
67
- context?: Record<string, unknown>;
68
- decision?: Record<string, unknown>;
69
- confidence?: number;
70
- reasoning?: string;
71
- };
72
- }>;
73
- /**
74
- * Pilot spawned event
75
- */
76
- export declare const PilotSpawnedSchema: z.ZodObject<{
77
- id: z.ZodString;
78
- project_key: z.ZodString;
79
- timestamp: z.ZodString;
80
- sequence: z.ZodNumber;
81
- } & {
82
- type: z.ZodLiteral<"pilot_spawned">;
83
- data: z.ZodObject<{
84
- callsign: z.ZodString;
85
- program: z.ZodEnum<["opencode", "claude-code", "custom"]>;
86
- model: z.ZodString;
87
- spawned_by: z.ZodString;
88
- config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
89
- }, "strip", z.ZodTypeAny, {
90
- callsign?: string;
91
- program?: "custom" | "opencode" | "claude-code";
92
- model?: string;
93
- spawned_by?: string;
94
- config?: Record<string, unknown>;
95
- }, {
96
- callsign?: string;
97
- program?: "custom" | "opencode" | "claude-code";
98
- model?: string;
99
- spawned_by?: string;
100
- config?: Record<string, unknown>;
101
- }>;
102
- }, "strip", z.ZodTypeAny, {
103
- type?: "pilot_spawned";
104
- id?: string;
105
- project_key?: string;
106
- timestamp?: string;
107
- sequence?: number;
108
- data?: {
109
- callsign?: string;
110
- program?: "custom" | "opencode" | "claude-code";
111
- model?: string;
112
- spawned_by?: string;
113
- config?: Record<string, unknown>;
114
- };
115
- }, {
116
- type?: "pilot_spawned";
117
- id?: string;
118
- project_key?: string;
119
- timestamp?: string;
120
- sequence?: number;
121
- data?: {
122
- callsign?: string;
123
- program?: "custom" | "opencode" | "claude-code";
124
- model?: string;
125
- spawned_by?: string;
126
- config?: Record<string, unknown>;
127
- };
128
- }>;
129
- /**
130
- * Pilot terminated event
131
- */
132
- export declare const PilotTerminatedSchema: z.ZodObject<{
133
- id: z.ZodString;
134
- project_key: z.ZodString;
135
- timestamp: z.ZodString;
136
- sequence: z.ZodNumber;
137
- } & {
138
- type: z.ZodLiteral<"pilot_terminated">;
139
- data: z.ZodObject<{
140
- callsign: z.ZodString;
141
- terminated_by: z.ZodString;
142
- reason: z.ZodEnum<["completed", "error", "timeout", "manual", "resource_limit"]>;
143
- exit_code: z.ZodOptional<z.ZodNumber>;
144
- final_state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
145
- }, "strip", z.ZodTypeAny, {
146
- callsign?: string;
147
- reason?: "completed" | "error" | "timeout" | "manual" | "resource_limit";
148
- terminated_by?: string;
149
- exit_code?: number;
150
- final_state?: Record<string, unknown>;
151
- }, {
152
- callsign?: string;
153
- reason?: "completed" | "error" | "timeout" | "manual" | "resource_limit";
154
- terminated_by?: string;
155
- exit_code?: number;
156
- final_state?: Record<string, unknown>;
157
- }>;
158
- }, "strip", z.ZodTypeAny, {
159
- type?: "pilot_terminated";
160
- id?: string;
161
- project_key?: string;
162
- timestamp?: string;
163
- sequence?: number;
164
- data?: {
165
- callsign?: string;
166
- reason?: "completed" | "error" | "timeout" | "manual" | "resource_limit";
167
- terminated_by?: string;
168
- exit_code?: number;
169
- final_state?: Record<string, unknown>;
170
- };
171
- }, {
172
- type?: "pilot_terminated";
173
- id?: string;
174
- project_key?: string;
175
- timestamp?: string;
176
- sequence?: number;
177
- data?: {
178
- callsign?: string;
179
- reason?: "completed" | "error" | "timeout" | "manual" | "resource_limit";
180
- terminated_by?: string;
181
- exit_code?: number;
182
- final_state?: Record<string, unknown>;
183
- };
184
- }>;
185
- /**
186
- * Lock acquired event
187
- */
188
- export declare const LockAcquiredSchema: z.ZodObject<{
189
- id: z.ZodString;
190
- project_key: z.ZodString;
191
- timestamp: z.ZodString;
192
- sequence: z.ZodNumber;
193
- } & {
194
- type: z.ZodLiteral<"lock_acquired">;
195
- data: z.ZodObject<{
196
- lock_key: z.ZodString;
197
- holder_id: z.ZodString;
198
- lock_type: z.ZodEnum<["exclusive", "shared"]>;
199
- ttl_seconds: z.ZodNumber;
200
- acquired_at: z.ZodString;
201
- }, "strip", z.ZodTypeAny, {
202
- ttl_seconds?: number;
203
- lock_key?: string;
204
- holder_id?: string;
205
- lock_type?: "exclusive" | "shared";
206
- acquired_at?: string;
207
- }, {
208
- ttl_seconds?: number;
209
- lock_key?: string;
210
- holder_id?: string;
211
- lock_type?: "exclusive" | "shared";
212
- acquired_at?: string;
213
- }>;
214
- }, "strip", z.ZodTypeAny, {
215
- type?: "lock_acquired";
216
- id?: string;
217
- project_key?: string;
218
- timestamp?: string;
219
- sequence?: number;
220
- data?: {
221
- ttl_seconds?: number;
222
- lock_key?: string;
223
- holder_id?: string;
224
- lock_type?: "exclusive" | "shared";
225
- acquired_at?: string;
226
- };
227
- }, {
228
- type?: "lock_acquired";
229
- id?: string;
230
- project_key?: string;
231
- timestamp?: string;
232
- sequence?: number;
233
- data?: {
234
- ttl_seconds?: number;
235
- lock_key?: string;
236
- holder_id?: string;
237
- lock_type?: "exclusive" | "shared";
238
- acquired_at?: string;
239
- };
240
- }>;
241
- /**
242
- * Lock released event
243
- */
244
- export declare const LockReleasedSchema: z.ZodObject<{
245
- id: z.ZodString;
246
- project_key: z.ZodString;
247
- timestamp: z.ZodString;
248
- sequence: z.ZodNumber;
249
- } & {
250
- type: z.ZodLiteral<"lock_released">;
251
- data: z.ZodObject<{
252
- lock_key: z.ZodString;
253
- holder_id: z.ZodString;
254
- released_by: z.ZodString;
255
- released_at: z.ZodString;
256
- held_duration_ms: z.ZodNumber;
257
- }, "strip", z.ZodTypeAny, {
258
- released_by?: string;
259
- lock_key?: string;
260
- holder_id?: string;
261
- released_at?: string;
262
- held_duration_ms?: number;
263
- }, {
264
- released_by?: string;
265
- lock_key?: string;
266
- holder_id?: string;
267
- released_at?: string;
268
- held_duration_ms?: number;
269
- }>;
270
- }, "strip", z.ZodTypeAny, {
271
- type?: "lock_released";
272
- id?: string;
273
- project_key?: string;
274
- timestamp?: string;
275
- sequence?: number;
276
- data?: {
277
- released_by?: string;
278
- lock_key?: string;
279
- holder_id?: string;
280
- released_at?: string;
281
- held_duration_ms?: number;
282
- };
283
- }, {
284
- type?: "lock_released";
285
- id?: string;
286
- project_key?: string;
287
- timestamp?: string;
288
- sequence?: number;
289
- data?: {
290
- released_by?: string;
291
- lock_key?: string;
292
- holder_id?: string;
293
- released_at?: string;
294
- held_duration_ms?: number;
295
- };
296
- }>;
297
- /**
298
- * Cursor moved event
299
- */
300
- export declare const CursorMovedSchema: z.ZodObject<{
301
- id: z.ZodString;
302
- project_key: z.ZodString;
303
- timestamp: z.ZodString;
304
- sequence: z.ZodNumber;
305
- } & {
306
- type: z.ZodLiteral<"cursor_moved">;
307
- data: z.ZodObject<{
308
- consumer_id: z.ZodString;
309
- stream_type: z.ZodString;
310
- old_position: z.ZodNumber;
311
- new_position: z.ZodNumber;
312
- moved_at: z.ZodString;
313
- batch_size: z.ZodOptional<z.ZodNumber>;
314
- }, "strip", z.ZodTypeAny, {
315
- consumer_id?: string;
316
- stream_type?: string;
317
- old_position?: number;
318
- new_position?: number;
319
- moved_at?: string;
320
- batch_size?: number;
321
- }, {
322
- consumer_id?: string;
323
- stream_type?: string;
324
- old_position?: number;
325
- new_position?: number;
326
- moved_at?: string;
327
- batch_size?: number;
328
- }>;
329
- }, "strip", z.ZodTypeAny, {
330
- type?: "cursor_moved";
331
- id?: string;
332
- project_key?: string;
333
- timestamp?: string;
334
- sequence?: number;
335
- data?: {
336
- consumer_id?: string;
337
- stream_type?: string;
338
- old_position?: number;
339
- new_position?: number;
340
- moved_at?: string;
341
- batch_size?: number;
342
- };
343
- }, {
344
- type?: "cursor_moved";
345
- id?: string;
346
- project_key?: string;
347
- timestamp?: string;
348
- sequence?: number;
349
- data?: {
350
- consumer_id?: string;
351
- stream_type?: string;
352
- old_position?: number;
353
- new_position?: number;
354
- moved_at?: string;
355
- batch_size?: number;
356
- };
357
- }>;
358
- export type CoordinatorDecisionEvent = z.infer<typeof CoordinatorDecisionSchema>;
359
- export type PilotSpawnedEvent = z.infer<typeof PilotSpawnedSchema>;
360
- export type PilotTerminatedEvent = z.infer<typeof PilotTerminatedSchema>;
361
- export type LockAcquiredEvent = z.infer<typeof LockAcquiredSchema>;
362
- export type LockReleasedEvent = z.infer<typeof LockReleasedSchema>;
363
- export type CursorMovedEvent = z.infer<typeof CursorMovedSchema>;