@fleettools/events 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.
Files changed (48) hide show
  1. package/dist/helpers.d.ts +72 -0
  2. package/dist/index.d.ts +10 -0
  3. package/dist/index.js +4816 -0
  4. package/dist/projections/index.d.ts +16 -0
  5. package/dist/projections/pilots.d.ts +19 -0
  6. package/dist/replay.d.ts +19 -0
  7. package/dist/src/helpers.d.ts +73 -0
  8. package/dist/src/helpers.d.ts.map +1 -0
  9. package/dist/src/index.d.ts +11 -0
  10. package/dist/src/index.d.ts.map +1 -0
  11. package/dist/src/projections/index.d.ts +17 -0
  12. package/dist/src/projections/index.d.ts.map +1 -0
  13. package/dist/src/projections/pilots.d.ts +20 -0
  14. package/dist/src/projections/pilots.d.ts.map +1 -0
  15. package/dist/src/replay.d.ts +20 -0
  16. package/dist/src/replay.d.ts.map +1 -0
  17. package/dist/src/store.d.ts +61 -0
  18. package/dist/src/store.d.ts.map +1 -0
  19. package/dist/src/types/base.d.ts +33 -0
  20. package/dist/src/types/base.d.ts.map +1 -0
  21. package/dist/src/types/checkpoints.d.ts +255 -0
  22. package/dist/src/types/checkpoints.d.ts.map +1 -0
  23. package/dist/src/types/coordination.d.ts +364 -0
  24. package/dist/src/types/coordination.d.ts.map +1 -0
  25. package/dist/src/types/index.d.ts +1692 -0
  26. package/dist/src/types/index.d.ts.map +1 -0
  27. package/dist/src/types/messages.d.ts +295 -0
  28. package/dist/src/types/messages.d.ts.map +1 -0
  29. package/dist/src/types/missions.d.ts +258 -0
  30. package/dist/src/types/missions.d.ts.map +1 -0
  31. package/dist/src/types/pilots.d.ts +153 -0
  32. package/dist/src/types/pilots.d.ts.map +1 -0
  33. package/dist/src/types/reservations.d.ts +173 -0
  34. package/dist/src/types/reservations.d.ts.map +1 -0
  35. package/dist/src/types/sorties.d.ts +372 -0
  36. package/dist/src/types/sorties.d.ts.map +1 -0
  37. package/dist/store.d.ts +56 -0
  38. package/dist/tsconfig.tsbuildinfo +1 -0
  39. package/dist/types/base.d.ts +32 -0
  40. package/dist/types/checkpoints.d.ts +254 -0
  41. package/dist/types/coordination.d.ts +363 -0
  42. package/dist/types/index.d.ts +1691 -0
  43. package/dist/types/messages.d.ts +294 -0
  44. package/dist/types/missions.d.ts +257 -0
  45. package/dist/types/pilots.d.ts +152 -0
  46. package/dist/types/reservations.d.ts +172 -0
  47. package/dist/types/sorties.d.ts +371 -0
  48. package/package.json +37 -0
@@ -0,0 +1,364 @@
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 | undefined;
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 | undefined;
41
+ }>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ id: string;
44
+ type: "coordinator_decision";
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 | undefined;
56
+ };
57
+ }, {
58
+ id: string;
59
+ type: "coordinator_decision";
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 | undefined;
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> | undefined;
95
+ }, {
96
+ callsign: string;
97
+ program: "custom" | "opencode" | "claude-code";
98
+ model: string;
99
+ spawned_by: string;
100
+ config?: Record<string, unknown> | undefined;
101
+ }>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ id: string;
104
+ type: "pilot_spawned";
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> | undefined;
114
+ };
115
+ }, {
116
+ id: string;
117
+ type: "pilot_spawned";
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> | undefined;
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
+ terminated_by: string;
148
+ reason: "completed" | "error" | "timeout" | "manual" | "resource_limit";
149
+ exit_code?: number | undefined;
150
+ final_state?: Record<string, unknown> | undefined;
151
+ }, {
152
+ callsign: string;
153
+ terminated_by: string;
154
+ reason: "completed" | "error" | "timeout" | "manual" | "resource_limit";
155
+ exit_code?: number | undefined;
156
+ final_state?: Record<string, unknown> | undefined;
157
+ }>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ id: string;
160
+ type: "pilot_terminated";
161
+ project_key: string;
162
+ timestamp: string;
163
+ sequence: number;
164
+ data: {
165
+ callsign: string;
166
+ terminated_by: string;
167
+ reason: "completed" | "error" | "timeout" | "manual" | "resource_limit";
168
+ exit_code?: number | undefined;
169
+ final_state?: Record<string, unknown> | undefined;
170
+ };
171
+ }, {
172
+ id: string;
173
+ type: "pilot_terminated";
174
+ project_key: string;
175
+ timestamp: string;
176
+ sequence: number;
177
+ data: {
178
+ callsign: string;
179
+ terminated_by: string;
180
+ reason: "completed" | "error" | "timeout" | "manual" | "resource_limit";
181
+ exit_code?: number | undefined;
182
+ final_state?: Record<string, unknown> | undefined;
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
+ lock_key: string;
203
+ holder_id: string;
204
+ lock_type: "exclusive" | "shared";
205
+ ttl_seconds: number;
206
+ acquired_at: string;
207
+ }, {
208
+ lock_key: string;
209
+ holder_id: string;
210
+ lock_type: "exclusive" | "shared";
211
+ ttl_seconds: number;
212
+ acquired_at: string;
213
+ }>;
214
+ }, "strip", z.ZodTypeAny, {
215
+ id: string;
216
+ type: "lock_acquired";
217
+ project_key: string;
218
+ timestamp: string;
219
+ sequence: number;
220
+ data: {
221
+ lock_key: string;
222
+ holder_id: string;
223
+ lock_type: "exclusive" | "shared";
224
+ ttl_seconds: number;
225
+ acquired_at: string;
226
+ };
227
+ }, {
228
+ id: string;
229
+ type: "lock_acquired";
230
+ project_key: string;
231
+ timestamp: string;
232
+ sequence: number;
233
+ data: {
234
+ lock_key: string;
235
+ holder_id: string;
236
+ lock_type: "exclusive" | "shared";
237
+ ttl_seconds: number;
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
+ lock_key: string;
259
+ holder_id: string;
260
+ released_by: string;
261
+ released_at: string;
262
+ held_duration_ms: number;
263
+ }, {
264
+ lock_key: string;
265
+ holder_id: string;
266
+ released_by: string;
267
+ released_at: string;
268
+ held_duration_ms: number;
269
+ }>;
270
+ }, "strip", z.ZodTypeAny, {
271
+ id: string;
272
+ type: "lock_released";
273
+ project_key: string;
274
+ timestamp: string;
275
+ sequence: number;
276
+ data: {
277
+ lock_key: string;
278
+ holder_id: string;
279
+ released_by: string;
280
+ released_at: string;
281
+ held_duration_ms: number;
282
+ };
283
+ }, {
284
+ id: string;
285
+ type: "lock_released";
286
+ project_key: string;
287
+ timestamp: string;
288
+ sequence: number;
289
+ data: {
290
+ lock_key: string;
291
+ holder_id: string;
292
+ released_by: 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 | undefined;
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 | undefined;
328
+ }>;
329
+ }, "strip", z.ZodTypeAny, {
330
+ id: string;
331
+ type: "cursor_moved";
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 | undefined;
342
+ };
343
+ }, {
344
+ id: string;
345
+ type: "cursor_moved";
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 | undefined;
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>;
364
+ //# sourceMappingURL=coordination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordination.d.ts","sourceRoot":"","sources":["../../../src/types/coordination.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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