@agent-relay/factory 0.1.32 → 0.1.34

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 (56) hide show
  1. package/README.md +36 -0
  2. package/dist/cli/fleet.d.ts +4 -1
  3. package/dist/cli/fleet.d.ts.map +1 -1
  4. package/dist/cli/fleet.js +115 -6
  5. package/dist/cli/fleet.js.map +1 -1
  6. package/dist/config/schema.d.ts +103 -8
  7. package/dist/config/schema.d.ts.map +1 -1
  8. package/dist/config/schema.js +12 -0
  9. package/dist/config/schema.js.map +1 -1
  10. package/dist/fleet/internal-fleet-client.d.ts +9 -2
  11. package/dist/fleet/internal-fleet-client.d.ts.map +1 -1
  12. package/dist/fleet/internal-fleet-client.js +39 -1
  13. package/dist/fleet/internal-fleet-client.js.map +1 -1
  14. package/dist/fleet/relay-fleet-client.d.ts +1 -0
  15. package/dist/fleet/relay-fleet-client.d.ts.map +1 -1
  16. package/dist/fleet/relay-fleet-client.js +1 -0
  17. package/dist/fleet/relay-fleet-client.js.map +1 -1
  18. package/dist/index.d.ts +7 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +3 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/observability/cloud-reporter.d.ts +46 -0
  23. package/dist/observability/cloud-reporter.d.ts.map +1 -0
  24. package/dist/observability/cloud-reporter.js +371 -0
  25. package/dist/observability/cloud-reporter.js.map +1 -0
  26. package/dist/observability/events.d.ts +1315 -0
  27. package/dist/observability/events.d.ts.map +1 -0
  28. package/dist/observability/events.js +242 -0
  29. package/dist/observability/events.js.map +1 -0
  30. package/dist/observability/index.d.ts +5 -0
  31. package/dist/observability/index.d.ts.map +1 -0
  32. package/dist/observability/index.js +5 -0
  33. package/dist/observability/index.js.map +1 -0
  34. package/dist/observability/instance-identity.d.ts +21 -0
  35. package/dist/observability/instance-identity.d.ts.map +1 -0
  36. package/dist/observability/instance-identity.js +77 -0
  37. package/dist/observability/instance-identity.js.map +1 -0
  38. package/dist/observability/outbox.d.ts +42 -0
  39. package/dist/observability/outbox.d.ts.map +1 -0
  40. package/dist/observability/outbox.js +305 -0
  41. package/dist/observability/outbox.js.map +1 -0
  42. package/dist/orchestrator/factory.d.ts.map +1 -1
  43. package/dist/orchestrator/factory.js +495 -60
  44. package/dist/orchestrator/factory.js.map +1 -1
  45. package/dist/ports/fleet.d.ts +3 -4
  46. package/dist/ports/fleet.d.ts.map +1 -1
  47. package/dist/ports/index.d.ts +1 -0
  48. package/dist/ports/index.d.ts.map +1 -1
  49. package/dist/ports/observability.d.ts +19 -0
  50. package/dist/ports/observability.d.ts.map +1 -0
  51. package/dist/ports/observability.js +2 -0
  52. package/dist/ports/observability.js.map +1 -0
  53. package/dist/triage/schema.d.ts +14 -14
  54. package/dist/types.d.ts +3 -0
  55. package/dist/types.d.ts.map +1 -1
  56. package/package.json +5 -1
@@ -0,0 +1,1315 @@
1
+ import { z } from 'zod';
2
+ export declare const FACTORY_CLOUD_EVENT_CONTRACT_V1: "factory.telemetry.v1";
3
+ export declare const FACTORY_CLOUD_EVENT_MAX_BATCH_SIZE = 100;
4
+ /** Leave headroom below Cloud's 256 KiB request-body limit. */
5
+ export declare const FACTORY_CLOUD_EVENT_MAX_PAYLOAD_BYTES: number;
6
+ export declare const FACTORY_CLOUD_RELEASE_REASONS_V1: readonly ["completed", "human_review", "factory_stopped", "waiting_for_human", "exited", "offline", "node_offline", "crashed", "reconciled_missing", "delivery_failed", "dispatch_failed", "source_state_changed", "other"];
7
+ export type FactoryCloudReleaseReasonV1 = (typeof FACTORY_CLOUD_RELEASE_REASONS_V1)[number];
8
+ export declare const FACTORY_CLOUD_CANCELLATION_REASONS_V1: readonly ["source_state_changed", "agent_spawn_failed", "agent_delivery_failed", "dispatch_failed"];
9
+ export type FactoryCloudCancellationReasonV1 = (typeof FACTORY_CLOUD_CANCELLATION_REASONS_V1)[number];
10
+ export declare const FACTORY_CLOUD_EVENT_TYPES: readonly ["instance.started", "instance.heartbeat", "instance.stopping", "instance.stopped", "run.queued", "run.started", "run.phase_changed", "run.waiting", "run.blocked", "run.succeeded", "run.failed", "run.cancelled", "agent.planned", "agent.spawned", "agent.adopted", "agent.resumed", "agent.exited", "agent.released", "clarification.requested", "clarification.delivered", "clarification.waiting", "clarification.answered", "clarification.woken", "clarification.escalated", "pull_request.discovered", "pull_request.published", "pull_request.ready", "pull_request.merged", "writeback.applied", "factory.failure", "factory.anomaly", "factory.snapshot"];
11
+ export type FactoryCloudEventType = (typeof FACTORY_CLOUD_EVENT_TYPES)[number] | (string & {});
12
+ export declare const FactoryCloudTraceIdV1Schema: z.ZodEffects<z.ZodString, string, string>;
13
+ export declare const FactoryCloudSpanIdV1Schema: z.ZodEffects<z.ZodString, string, string>;
14
+ /**
15
+ * Deliberately narrow operational attributes. This is not a general log bag:
16
+ * task text, prompts, issue descriptions, messages, paths, URLs, command lines,
17
+ * stack traces, and raw error messages have no representable field.
18
+ */
19
+ export declare const FactoryCloudEventAttributesV1Schema: z.ZodObject<{
20
+ backend: z.ZodOptional<z.ZodString>;
21
+ mode: z.ZodOptional<z.ZodString>;
22
+ component: z.ZodOptional<z.ZodString>;
23
+ operation: z.ZodOptional<z.ZodString>;
24
+ errorClass: z.ZodOptional<z.ZodString>;
25
+ errorCode: z.ZodOptional<z.ZodString>;
26
+ errorFingerprint: z.ZodOptional<z.ZodString>;
27
+ retryable: z.ZodOptional<z.ZodBoolean>;
28
+ attempt: z.ZodOptional<z.ZodNumber>;
29
+ durationMs: z.ZodOptional<z.ZodNumber>;
30
+ agentRole: z.ZodOptional<z.ZodString>;
31
+ invocationId: z.ZodOptional<z.ZodString>;
32
+ nodeId: z.ZodOptional<z.ZodString>;
33
+ previousPhase: z.ZodOptional<z.ZodString>;
34
+ releaseReason: z.ZodOptional<z.ZodEnum<["completed", "human_review", "factory_stopped", "waiting_for_human", "exited", "offline", "node_offline", "crashed", "reconciled_missing", "delivery_failed", "dispatch_failed", "source_state_changed", "other"]>>;
35
+ cancellationReason: z.ZodOptional<z.ZodEnum<["source_state_changed", "agent_spawn_failed", "agent_delivery_failed", "dispatch_failed"]>>;
36
+ dryRun: z.ZodOptional<z.ZodBoolean>;
37
+ count: z.ZodOptional<z.ZodNumber>;
38
+ activeRuns: z.ZodOptional<z.ZodNumber>;
39
+ queuedRuns: z.ZodOptional<z.ZodNumber>;
40
+ trackedAgents: z.ZodOptional<z.ZodNumber>;
41
+ unownedAgents: z.ZodOptional<z.ZodNumber>;
42
+ outboxDepth: z.ZodOptional<z.ZodNumber>;
43
+ outboxOldestAgeMs: z.ZodOptional<z.ZodNumber>;
44
+ droppedEvents: z.ZodOptional<z.ZodNumber>;
45
+ transport: z.ZodOptional<z.ZodString>;
46
+ locality: z.ZodOptional<z.ZodString>;
47
+ }, "strict", z.ZodTypeAny, {
48
+ transport?: string | undefined;
49
+ dryRun?: boolean | undefined;
50
+ backend?: string | undefined;
51
+ mode?: string | undefined;
52
+ component?: string | undefined;
53
+ operation?: string | undefined;
54
+ errorClass?: string | undefined;
55
+ errorCode?: string | undefined;
56
+ errorFingerprint?: string | undefined;
57
+ retryable?: boolean | undefined;
58
+ attempt?: number | undefined;
59
+ durationMs?: number | undefined;
60
+ agentRole?: string | undefined;
61
+ invocationId?: string | undefined;
62
+ nodeId?: string | undefined;
63
+ previousPhase?: string | undefined;
64
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
65
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
66
+ count?: number | undefined;
67
+ activeRuns?: number | undefined;
68
+ queuedRuns?: number | undefined;
69
+ trackedAgents?: number | undefined;
70
+ unownedAgents?: number | undefined;
71
+ outboxDepth?: number | undefined;
72
+ outboxOldestAgeMs?: number | undefined;
73
+ droppedEvents?: number | undefined;
74
+ locality?: string | undefined;
75
+ }, {
76
+ transport?: string | undefined;
77
+ dryRun?: boolean | undefined;
78
+ backend?: string | undefined;
79
+ mode?: string | undefined;
80
+ component?: string | undefined;
81
+ operation?: string | undefined;
82
+ errorClass?: string | undefined;
83
+ errorCode?: string | undefined;
84
+ errorFingerprint?: string | undefined;
85
+ retryable?: boolean | undefined;
86
+ attempt?: number | undefined;
87
+ durationMs?: number | undefined;
88
+ agentRole?: string | undefined;
89
+ invocationId?: string | undefined;
90
+ nodeId?: string | undefined;
91
+ previousPhase?: string | undefined;
92
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
93
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
94
+ count?: number | undefined;
95
+ activeRuns?: number | undefined;
96
+ queuedRuns?: number | undefined;
97
+ trackedAgents?: number | undefined;
98
+ unownedAgents?: number | undefined;
99
+ outboxDepth?: number | undefined;
100
+ outboxOldestAgeMs?: number | undefined;
101
+ droppedEvents?: number | undefined;
102
+ locality?: string | undefined;
103
+ }>;
104
+ export type FactoryCloudEventAttributesV1 = z.infer<typeof FactoryCloudEventAttributesV1Schema>;
105
+ export declare const FactoryCloudInstanceV1Schema: z.ZodObject<{
106
+ id: z.ZodString;
107
+ bootId: z.ZodString;
108
+ version: z.ZodString;
109
+ metadata: z.ZodOptional<z.ZodObject<{
110
+ name: z.ZodOptional<z.ZodString>;
111
+ backend: z.ZodOptional<z.ZodString>;
112
+ mode: z.ZodOptional<z.ZodString>;
113
+ platform: z.ZodOptional<z.ZodString>;
114
+ arch: z.ZodOptional<z.ZodString>;
115
+ runtime: z.ZodOptional<z.ZodString>;
116
+ }, "strict", z.ZodTypeAny, {
117
+ name?: string | undefined;
118
+ backend?: string | undefined;
119
+ mode?: string | undefined;
120
+ platform?: string | undefined;
121
+ arch?: string | undefined;
122
+ runtime?: string | undefined;
123
+ }, {
124
+ name?: string | undefined;
125
+ backend?: string | undefined;
126
+ mode?: string | undefined;
127
+ platform?: string | undefined;
128
+ arch?: string | undefined;
129
+ runtime?: string | undefined;
130
+ }>>;
131
+ }, "strict", z.ZodTypeAny, {
132
+ id: string;
133
+ bootId: string;
134
+ version: string;
135
+ metadata?: {
136
+ name?: string | undefined;
137
+ backend?: string | undefined;
138
+ mode?: string | undefined;
139
+ platform?: string | undefined;
140
+ arch?: string | undefined;
141
+ runtime?: string | undefined;
142
+ } | undefined;
143
+ }, {
144
+ id: string;
145
+ bootId: string;
146
+ version: string;
147
+ metadata?: {
148
+ name?: string | undefined;
149
+ backend?: string | undefined;
150
+ mode?: string | undefined;
151
+ platform?: string | undefined;
152
+ arch?: string | undefined;
153
+ runtime?: string | undefined;
154
+ } | undefined;
155
+ }>;
156
+ export type FactoryCloudInstanceV1 = z.infer<typeof FactoryCloudInstanceV1Schema>;
157
+ export declare const FactoryCloudEventInputV1Schema: z.ZodEffects<z.ZodObject<{
158
+ readonly id: z.ZodString;
159
+ readonly occurredAt: z.ZodString;
160
+ readonly type: z.ZodString;
161
+ readonly level: z.ZodOptional<z.ZodEnum<["debug", "info", "warn", "error"]>>;
162
+ readonly runId: z.ZodOptional<z.ZodString>;
163
+ readonly phase: z.ZodOptional<z.ZodString>;
164
+ readonly status: z.ZodOptional<z.ZodEnum<["queued", "running", "waiting", "blocked", "succeeded", "failed", "cancelled"]>>;
165
+ readonly run: z.ZodOptional<z.ZodObject<{
166
+ source: z.ZodOptional<z.ZodString>;
167
+ repository: z.ZodOptional<z.ZodString>;
168
+ issueKey: z.ZodOptional<z.ZodString>;
169
+ recipe: z.ZodOptional<z.ZodString>;
170
+ }, "strict", z.ZodTypeAny, {
171
+ source?: string | undefined;
172
+ repository?: string | undefined;
173
+ issueKey?: string | undefined;
174
+ recipe?: string | undefined;
175
+ }, {
176
+ source?: string | undefined;
177
+ repository?: string | undefined;
178
+ issueKey?: string | undefined;
179
+ recipe?: string | undefined;
180
+ }>>;
181
+ readonly attributes: z.ZodOptional<z.ZodObject<{
182
+ backend: z.ZodOptional<z.ZodString>;
183
+ mode: z.ZodOptional<z.ZodString>;
184
+ component: z.ZodOptional<z.ZodString>;
185
+ operation: z.ZodOptional<z.ZodString>;
186
+ errorClass: z.ZodOptional<z.ZodString>;
187
+ errorCode: z.ZodOptional<z.ZodString>;
188
+ errorFingerprint: z.ZodOptional<z.ZodString>;
189
+ retryable: z.ZodOptional<z.ZodBoolean>;
190
+ attempt: z.ZodOptional<z.ZodNumber>;
191
+ durationMs: z.ZodOptional<z.ZodNumber>;
192
+ agentRole: z.ZodOptional<z.ZodString>;
193
+ invocationId: z.ZodOptional<z.ZodString>;
194
+ nodeId: z.ZodOptional<z.ZodString>;
195
+ previousPhase: z.ZodOptional<z.ZodString>;
196
+ releaseReason: z.ZodOptional<z.ZodEnum<["completed", "human_review", "factory_stopped", "waiting_for_human", "exited", "offline", "node_offline", "crashed", "reconciled_missing", "delivery_failed", "dispatch_failed", "source_state_changed", "other"]>>;
197
+ cancellationReason: z.ZodOptional<z.ZodEnum<["source_state_changed", "agent_spawn_failed", "agent_delivery_failed", "dispatch_failed"]>>;
198
+ dryRun: z.ZodOptional<z.ZodBoolean>;
199
+ count: z.ZodOptional<z.ZodNumber>;
200
+ activeRuns: z.ZodOptional<z.ZodNumber>;
201
+ queuedRuns: z.ZodOptional<z.ZodNumber>;
202
+ trackedAgents: z.ZodOptional<z.ZodNumber>;
203
+ unownedAgents: z.ZodOptional<z.ZodNumber>;
204
+ outboxDepth: z.ZodOptional<z.ZodNumber>;
205
+ outboxOldestAgeMs: z.ZodOptional<z.ZodNumber>;
206
+ droppedEvents: z.ZodOptional<z.ZodNumber>;
207
+ transport: z.ZodOptional<z.ZodString>;
208
+ locality: z.ZodOptional<z.ZodString>;
209
+ }, "strict", z.ZodTypeAny, {
210
+ transport?: string | undefined;
211
+ dryRun?: boolean | undefined;
212
+ backend?: string | undefined;
213
+ mode?: string | undefined;
214
+ component?: string | undefined;
215
+ operation?: string | undefined;
216
+ errorClass?: string | undefined;
217
+ errorCode?: string | undefined;
218
+ errorFingerprint?: string | undefined;
219
+ retryable?: boolean | undefined;
220
+ attempt?: number | undefined;
221
+ durationMs?: number | undefined;
222
+ agentRole?: string | undefined;
223
+ invocationId?: string | undefined;
224
+ nodeId?: string | undefined;
225
+ previousPhase?: string | undefined;
226
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
227
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
228
+ count?: number | undefined;
229
+ activeRuns?: number | undefined;
230
+ queuedRuns?: number | undefined;
231
+ trackedAgents?: number | undefined;
232
+ unownedAgents?: number | undefined;
233
+ outboxDepth?: number | undefined;
234
+ outboxOldestAgeMs?: number | undefined;
235
+ droppedEvents?: number | undefined;
236
+ locality?: string | undefined;
237
+ }, {
238
+ transport?: string | undefined;
239
+ dryRun?: boolean | undefined;
240
+ backend?: string | undefined;
241
+ mode?: string | undefined;
242
+ component?: string | undefined;
243
+ operation?: string | undefined;
244
+ errorClass?: string | undefined;
245
+ errorCode?: string | undefined;
246
+ errorFingerprint?: string | undefined;
247
+ retryable?: boolean | undefined;
248
+ attempt?: number | undefined;
249
+ durationMs?: number | undefined;
250
+ agentRole?: string | undefined;
251
+ invocationId?: string | undefined;
252
+ nodeId?: string | undefined;
253
+ previousPhase?: string | undefined;
254
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
255
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
256
+ count?: number | undefined;
257
+ activeRuns?: number | undefined;
258
+ queuedRuns?: number | undefined;
259
+ trackedAgents?: number | undefined;
260
+ unownedAgents?: number | undefined;
261
+ outboxDepth?: number | undefined;
262
+ outboxOldestAgeMs?: number | undefined;
263
+ droppedEvents?: number | undefined;
264
+ locality?: string | undefined;
265
+ }>>;
266
+ readonly trace: z.ZodOptional<z.ZodObject<{
267
+ traceId: z.ZodEffects<z.ZodString, string, string>;
268
+ spanId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
269
+ parentSpanId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
270
+ }, "strict", z.ZodTypeAny, {
271
+ traceId: string;
272
+ spanId?: string | undefined;
273
+ parentSpanId?: string | undefined;
274
+ }, {
275
+ traceId: string;
276
+ spanId?: string | undefined;
277
+ parentSpanId?: string | undefined;
278
+ }>>;
279
+ }, "strict", z.ZodTypeAny, {
280
+ type: string;
281
+ id: string;
282
+ occurredAt: string;
283
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
284
+ level?: "debug" | "info" | "warn" | "error" | undefined;
285
+ runId?: string | undefined;
286
+ phase?: string | undefined;
287
+ run?: {
288
+ source?: string | undefined;
289
+ repository?: string | undefined;
290
+ issueKey?: string | undefined;
291
+ recipe?: string | undefined;
292
+ } | undefined;
293
+ attributes?: {
294
+ transport?: string | undefined;
295
+ dryRun?: boolean | undefined;
296
+ backend?: string | undefined;
297
+ mode?: string | undefined;
298
+ component?: string | undefined;
299
+ operation?: string | undefined;
300
+ errorClass?: string | undefined;
301
+ errorCode?: string | undefined;
302
+ errorFingerprint?: string | undefined;
303
+ retryable?: boolean | undefined;
304
+ attempt?: number | undefined;
305
+ durationMs?: number | undefined;
306
+ agentRole?: string | undefined;
307
+ invocationId?: string | undefined;
308
+ nodeId?: string | undefined;
309
+ previousPhase?: string | undefined;
310
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
311
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
312
+ count?: number | undefined;
313
+ activeRuns?: number | undefined;
314
+ queuedRuns?: number | undefined;
315
+ trackedAgents?: number | undefined;
316
+ unownedAgents?: number | undefined;
317
+ outboxDepth?: number | undefined;
318
+ outboxOldestAgeMs?: number | undefined;
319
+ droppedEvents?: number | undefined;
320
+ locality?: string | undefined;
321
+ } | undefined;
322
+ trace?: {
323
+ traceId: string;
324
+ spanId?: string | undefined;
325
+ parentSpanId?: string | undefined;
326
+ } | undefined;
327
+ }, {
328
+ type: string;
329
+ id: string;
330
+ occurredAt: string;
331
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
332
+ level?: "debug" | "info" | "warn" | "error" | undefined;
333
+ runId?: string | undefined;
334
+ phase?: string | undefined;
335
+ run?: {
336
+ source?: string | undefined;
337
+ repository?: string | undefined;
338
+ issueKey?: string | undefined;
339
+ recipe?: string | undefined;
340
+ } | undefined;
341
+ attributes?: {
342
+ transport?: string | undefined;
343
+ dryRun?: boolean | undefined;
344
+ backend?: string | undefined;
345
+ mode?: string | undefined;
346
+ component?: string | undefined;
347
+ operation?: string | undefined;
348
+ errorClass?: string | undefined;
349
+ errorCode?: string | undefined;
350
+ errorFingerprint?: string | undefined;
351
+ retryable?: boolean | undefined;
352
+ attempt?: number | undefined;
353
+ durationMs?: number | undefined;
354
+ agentRole?: string | undefined;
355
+ invocationId?: string | undefined;
356
+ nodeId?: string | undefined;
357
+ previousPhase?: string | undefined;
358
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
359
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
360
+ count?: number | undefined;
361
+ activeRuns?: number | undefined;
362
+ queuedRuns?: number | undefined;
363
+ trackedAgents?: number | undefined;
364
+ unownedAgents?: number | undefined;
365
+ outboxDepth?: number | undefined;
366
+ outboxOldestAgeMs?: number | undefined;
367
+ droppedEvents?: number | undefined;
368
+ locality?: string | undefined;
369
+ } | undefined;
370
+ trace?: {
371
+ traceId: string;
372
+ spanId?: string | undefined;
373
+ parentSpanId?: string | undefined;
374
+ } | undefined;
375
+ }>, {
376
+ type: string;
377
+ id: string;
378
+ occurredAt: string;
379
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
380
+ level?: "debug" | "info" | "warn" | "error" | undefined;
381
+ runId?: string | undefined;
382
+ phase?: string | undefined;
383
+ run?: {
384
+ source?: string | undefined;
385
+ repository?: string | undefined;
386
+ issueKey?: string | undefined;
387
+ recipe?: string | undefined;
388
+ } | undefined;
389
+ attributes?: {
390
+ transport?: string | undefined;
391
+ dryRun?: boolean | undefined;
392
+ backend?: string | undefined;
393
+ mode?: string | undefined;
394
+ component?: string | undefined;
395
+ operation?: string | undefined;
396
+ errorClass?: string | undefined;
397
+ errorCode?: string | undefined;
398
+ errorFingerprint?: string | undefined;
399
+ retryable?: boolean | undefined;
400
+ attempt?: number | undefined;
401
+ durationMs?: number | undefined;
402
+ agentRole?: string | undefined;
403
+ invocationId?: string | undefined;
404
+ nodeId?: string | undefined;
405
+ previousPhase?: string | undefined;
406
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
407
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
408
+ count?: number | undefined;
409
+ activeRuns?: number | undefined;
410
+ queuedRuns?: number | undefined;
411
+ trackedAgents?: number | undefined;
412
+ unownedAgents?: number | undefined;
413
+ outboxDepth?: number | undefined;
414
+ outboxOldestAgeMs?: number | undefined;
415
+ droppedEvents?: number | undefined;
416
+ locality?: string | undefined;
417
+ } | undefined;
418
+ trace?: {
419
+ traceId: string;
420
+ spanId?: string | undefined;
421
+ parentSpanId?: string | undefined;
422
+ } | undefined;
423
+ }, {
424
+ type: string;
425
+ id: string;
426
+ occurredAt: string;
427
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
428
+ level?: "debug" | "info" | "warn" | "error" | undefined;
429
+ runId?: string | undefined;
430
+ phase?: string | undefined;
431
+ run?: {
432
+ source?: string | undefined;
433
+ repository?: string | undefined;
434
+ issueKey?: string | undefined;
435
+ recipe?: string | undefined;
436
+ } | undefined;
437
+ attributes?: {
438
+ transport?: string | undefined;
439
+ dryRun?: boolean | undefined;
440
+ backend?: string | undefined;
441
+ mode?: string | undefined;
442
+ component?: string | undefined;
443
+ operation?: string | undefined;
444
+ errorClass?: string | undefined;
445
+ errorCode?: string | undefined;
446
+ errorFingerprint?: string | undefined;
447
+ retryable?: boolean | undefined;
448
+ attempt?: number | undefined;
449
+ durationMs?: number | undefined;
450
+ agentRole?: string | undefined;
451
+ invocationId?: string | undefined;
452
+ nodeId?: string | undefined;
453
+ previousPhase?: string | undefined;
454
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
455
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
456
+ count?: number | undefined;
457
+ activeRuns?: number | undefined;
458
+ queuedRuns?: number | undefined;
459
+ trackedAgents?: number | undefined;
460
+ unownedAgents?: number | undefined;
461
+ outboxDepth?: number | undefined;
462
+ outboxOldestAgeMs?: number | undefined;
463
+ droppedEvents?: number | undefined;
464
+ locality?: string | undefined;
465
+ } | undefined;
466
+ trace?: {
467
+ traceId: string;
468
+ spanId?: string | undefined;
469
+ parentSpanId?: string | undefined;
470
+ } | undefined;
471
+ }>;
472
+ export declare const FactoryCloudEventV1Schema: z.ZodEffects<z.ZodObject<{
473
+ sequence: z.ZodNumber;
474
+ id: z.ZodString;
475
+ occurredAt: z.ZodString;
476
+ type: z.ZodString;
477
+ level: z.ZodOptional<z.ZodEnum<["debug", "info", "warn", "error"]>>;
478
+ runId: z.ZodOptional<z.ZodString>;
479
+ phase: z.ZodOptional<z.ZodString>;
480
+ status: z.ZodOptional<z.ZodEnum<["queued", "running", "waiting", "blocked", "succeeded", "failed", "cancelled"]>>;
481
+ run: z.ZodOptional<z.ZodObject<{
482
+ source: z.ZodOptional<z.ZodString>;
483
+ repository: z.ZodOptional<z.ZodString>;
484
+ issueKey: z.ZodOptional<z.ZodString>;
485
+ recipe: z.ZodOptional<z.ZodString>;
486
+ }, "strict", z.ZodTypeAny, {
487
+ source?: string | undefined;
488
+ repository?: string | undefined;
489
+ issueKey?: string | undefined;
490
+ recipe?: string | undefined;
491
+ }, {
492
+ source?: string | undefined;
493
+ repository?: string | undefined;
494
+ issueKey?: string | undefined;
495
+ recipe?: string | undefined;
496
+ }>>;
497
+ attributes: z.ZodOptional<z.ZodObject<{
498
+ backend: z.ZodOptional<z.ZodString>;
499
+ mode: z.ZodOptional<z.ZodString>;
500
+ component: z.ZodOptional<z.ZodString>;
501
+ operation: z.ZodOptional<z.ZodString>;
502
+ errorClass: z.ZodOptional<z.ZodString>;
503
+ errorCode: z.ZodOptional<z.ZodString>;
504
+ errorFingerprint: z.ZodOptional<z.ZodString>;
505
+ retryable: z.ZodOptional<z.ZodBoolean>;
506
+ attempt: z.ZodOptional<z.ZodNumber>;
507
+ durationMs: z.ZodOptional<z.ZodNumber>;
508
+ agentRole: z.ZodOptional<z.ZodString>;
509
+ invocationId: z.ZodOptional<z.ZodString>;
510
+ nodeId: z.ZodOptional<z.ZodString>;
511
+ previousPhase: z.ZodOptional<z.ZodString>;
512
+ releaseReason: z.ZodOptional<z.ZodEnum<["completed", "human_review", "factory_stopped", "waiting_for_human", "exited", "offline", "node_offline", "crashed", "reconciled_missing", "delivery_failed", "dispatch_failed", "source_state_changed", "other"]>>;
513
+ cancellationReason: z.ZodOptional<z.ZodEnum<["source_state_changed", "agent_spawn_failed", "agent_delivery_failed", "dispatch_failed"]>>;
514
+ dryRun: z.ZodOptional<z.ZodBoolean>;
515
+ count: z.ZodOptional<z.ZodNumber>;
516
+ activeRuns: z.ZodOptional<z.ZodNumber>;
517
+ queuedRuns: z.ZodOptional<z.ZodNumber>;
518
+ trackedAgents: z.ZodOptional<z.ZodNumber>;
519
+ unownedAgents: z.ZodOptional<z.ZodNumber>;
520
+ outboxDepth: z.ZodOptional<z.ZodNumber>;
521
+ outboxOldestAgeMs: z.ZodOptional<z.ZodNumber>;
522
+ droppedEvents: z.ZodOptional<z.ZodNumber>;
523
+ transport: z.ZodOptional<z.ZodString>;
524
+ locality: z.ZodOptional<z.ZodString>;
525
+ }, "strict", z.ZodTypeAny, {
526
+ transport?: string | undefined;
527
+ dryRun?: boolean | undefined;
528
+ backend?: string | undefined;
529
+ mode?: string | undefined;
530
+ component?: string | undefined;
531
+ operation?: string | undefined;
532
+ errorClass?: string | undefined;
533
+ errorCode?: string | undefined;
534
+ errorFingerprint?: string | undefined;
535
+ retryable?: boolean | undefined;
536
+ attempt?: number | undefined;
537
+ durationMs?: number | undefined;
538
+ agentRole?: string | undefined;
539
+ invocationId?: string | undefined;
540
+ nodeId?: string | undefined;
541
+ previousPhase?: string | undefined;
542
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
543
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
544
+ count?: number | undefined;
545
+ activeRuns?: number | undefined;
546
+ queuedRuns?: number | undefined;
547
+ trackedAgents?: number | undefined;
548
+ unownedAgents?: number | undefined;
549
+ outboxDepth?: number | undefined;
550
+ outboxOldestAgeMs?: number | undefined;
551
+ droppedEvents?: number | undefined;
552
+ locality?: string | undefined;
553
+ }, {
554
+ transport?: string | undefined;
555
+ dryRun?: boolean | undefined;
556
+ backend?: string | undefined;
557
+ mode?: string | undefined;
558
+ component?: string | undefined;
559
+ operation?: string | undefined;
560
+ errorClass?: string | undefined;
561
+ errorCode?: string | undefined;
562
+ errorFingerprint?: string | undefined;
563
+ retryable?: boolean | undefined;
564
+ attempt?: number | undefined;
565
+ durationMs?: number | undefined;
566
+ agentRole?: string | undefined;
567
+ invocationId?: string | undefined;
568
+ nodeId?: string | undefined;
569
+ previousPhase?: string | undefined;
570
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
571
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
572
+ count?: number | undefined;
573
+ activeRuns?: number | undefined;
574
+ queuedRuns?: number | undefined;
575
+ trackedAgents?: number | undefined;
576
+ unownedAgents?: number | undefined;
577
+ outboxDepth?: number | undefined;
578
+ outboxOldestAgeMs?: number | undefined;
579
+ droppedEvents?: number | undefined;
580
+ locality?: string | undefined;
581
+ }>>;
582
+ trace: z.ZodOptional<z.ZodObject<{
583
+ traceId: z.ZodEffects<z.ZodString, string, string>;
584
+ spanId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
585
+ parentSpanId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
586
+ }, "strict", z.ZodTypeAny, {
587
+ traceId: string;
588
+ spanId?: string | undefined;
589
+ parentSpanId?: string | undefined;
590
+ }, {
591
+ traceId: string;
592
+ spanId?: string | undefined;
593
+ parentSpanId?: string | undefined;
594
+ }>>;
595
+ }, "strict", z.ZodTypeAny, {
596
+ type: string;
597
+ id: string;
598
+ occurredAt: string;
599
+ sequence: number;
600
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
601
+ level?: "debug" | "info" | "warn" | "error" | undefined;
602
+ runId?: string | undefined;
603
+ phase?: string | undefined;
604
+ run?: {
605
+ source?: string | undefined;
606
+ repository?: string | undefined;
607
+ issueKey?: string | undefined;
608
+ recipe?: string | undefined;
609
+ } | undefined;
610
+ attributes?: {
611
+ transport?: string | undefined;
612
+ dryRun?: boolean | undefined;
613
+ backend?: string | undefined;
614
+ mode?: string | undefined;
615
+ component?: string | undefined;
616
+ operation?: string | undefined;
617
+ errorClass?: string | undefined;
618
+ errorCode?: string | undefined;
619
+ errorFingerprint?: string | undefined;
620
+ retryable?: boolean | undefined;
621
+ attempt?: number | undefined;
622
+ durationMs?: number | undefined;
623
+ agentRole?: string | undefined;
624
+ invocationId?: string | undefined;
625
+ nodeId?: string | undefined;
626
+ previousPhase?: string | undefined;
627
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
628
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
629
+ count?: number | undefined;
630
+ activeRuns?: number | undefined;
631
+ queuedRuns?: number | undefined;
632
+ trackedAgents?: number | undefined;
633
+ unownedAgents?: number | undefined;
634
+ outboxDepth?: number | undefined;
635
+ outboxOldestAgeMs?: number | undefined;
636
+ droppedEvents?: number | undefined;
637
+ locality?: string | undefined;
638
+ } | undefined;
639
+ trace?: {
640
+ traceId: string;
641
+ spanId?: string | undefined;
642
+ parentSpanId?: string | undefined;
643
+ } | undefined;
644
+ }, {
645
+ type: string;
646
+ id: string;
647
+ occurredAt: string;
648
+ sequence: number;
649
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
650
+ level?: "debug" | "info" | "warn" | "error" | undefined;
651
+ runId?: string | undefined;
652
+ phase?: string | undefined;
653
+ run?: {
654
+ source?: string | undefined;
655
+ repository?: string | undefined;
656
+ issueKey?: string | undefined;
657
+ recipe?: string | undefined;
658
+ } | undefined;
659
+ attributes?: {
660
+ transport?: string | undefined;
661
+ dryRun?: boolean | undefined;
662
+ backend?: string | undefined;
663
+ mode?: string | undefined;
664
+ component?: string | undefined;
665
+ operation?: string | undefined;
666
+ errorClass?: string | undefined;
667
+ errorCode?: string | undefined;
668
+ errorFingerprint?: string | undefined;
669
+ retryable?: boolean | undefined;
670
+ attempt?: number | undefined;
671
+ durationMs?: number | undefined;
672
+ agentRole?: string | undefined;
673
+ invocationId?: string | undefined;
674
+ nodeId?: string | undefined;
675
+ previousPhase?: string | undefined;
676
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
677
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
678
+ count?: number | undefined;
679
+ activeRuns?: number | undefined;
680
+ queuedRuns?: number | undefined;
681
+ trackedAgents?: number | undefined;
682
+ unownedAgents?: number | undefined;
683
+ outboxDepth?: number | undefined;
684
+ outboxOldestAgeMs?: number | undefined;
685
+ droppedEvents?: number | undefined;
686
+ locality?: string | undefined;
687
+ } | undefined;
688
+ trace?: {
689
+ traceId: string;
690
+ spanId?: string | undefined;
691
+ parentSpanId?: string | undefined;
692
+ } | undefined;
693
+ }>, {
694
+ type: string;
695
+ id: string;
696
+ occurredAt: string;
697
+ sequence: number;
698
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
699
+ level?: "debug" | "info" | "warn" | "error" | undefined;
700
+ runId?: string | undefined;
701
+ phase?: string | undefined;
702
+ run?: {
703
+ source?: string | undefined;
704
+ repository?: string | undefined;
705
+ issueKey?: string | undefined;
706
+ recipe?: string | undefined;
707
+ } | undefined;
708
+ attributes?: {
709
+ transport?: string | undefined;
710
+ dryRun?: boolean | undefined;
711
+ backend?: string | undefined;
712
+ mode?: string | undefined;
713
+ component?: string | undefined;
714
+ operation?: string | undefined;
715
+ errorClass?: string | undefined;
716
+ errorCode?: string | undefined;
717
+ errorFingerprint?: string | undefined;
718
+ retryable?: boolean | undefined;
719
+ attempt?: number | undefined;
720
+ durationMs?: number | undefined;
721
+ agentRole?: string | undefined;
722
+ invocationId?: string | undefined;
723
+ nodeId?: string | undefined;
724
+ previousPhase?: string | undefined;
725
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
726
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
727
+ count?: number | undefined;
728
+ activeRuns?: number | undefined;
729
+ queuedRuns?: number | undefined;
730
+ trackedAgents?: number | undefined;
731
+ unownedAgents?: number | undefined;
732
+ outboxDepth?: number | undefined;
733
+ outboxOldestAgeMs?: number | undefined;
734
+ droppedEvents?: number | undefined;
735
+ locality?: string | undefined;
736
+ } | undefined;
737
+ trace?: {
738
+ traceId: string;
739
+ spanId?: string | undefined;
740
+ parentSpanId?: string | undefined;
741
+ } | undefined;
742
+ }, {
743
+ type: string;
744
+ id: string;
745
+ occurredAt: string;
746
+ sequence: number;
747
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
748
+ level?: "debug" | "info" | "warn" | "error" | undefined;
749
+ runId?: string | undefined;
750
+ phase?: string | undefined;
751
+ run?: {
752
+ source?: string | undefined;
753
+ repository?: string | undefined;
754
+ issueKey?: string | undefined;
755
+ recipe?: string | undefined;
756
+ } | undefined;
757
+ attributes?: {
758
+ transport?: string | undefined;
759
+ dryRun?: boolean | undefined;
760
+ backend?: string | undefined;
761
+ mode?: string | undefined;
762
+ component?: string | undefined;
763
+ operation?: string | undefined;
764
+ errorClass?: string | undefined;
765
+ errorCode?: string | undefined;
766
+ errorFingerprint?: string | undefined;
767
+ retryable?: boolean | undefined;
768
+ attempt?: number | undefined;
769
+ durationMs?: number | undefined;
770
+ agentRole?: string | undefined;
771
+ invocationId?: string | undefined;
772
+ nodeId?: string | undefined;
773
+ previousPhase?: string | undefined;
774
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
775
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
776
+ count?: number | undefined;
777
+ activeRuns?: number | undefined;
778
+ queuedRuns?: number | undefined;
779
+ trackedAgents?: number | undefined;
780
+ unownedAgents?: number | undefined;
781
+ outboxDepth?: number | undefined;
782
+ outboxOldestAgeMs?: number | undefined;
783
+ droppedEvents?: number | undefined;
784
+ locality?: string | undefined;
785
+ } | undefined;
786
+ trace?: {
787
+ traceId: string;
788
+ spanId?: string | undefined;
789
+ parentSpanId?: string | undefined;
790
+ } | undefined;
791
+ }>;
792
+ export type FactoryCloudEventInputV1 = z.infer<typeof FactoryCloudEventInputV1Schema>;
793
+ export type FactoryCloudEventV1 = z.infer<typeof FactoryCloudEventV1Schema>;
794
+ export declare const FactoryCloudEventBatchV1Schema: z.ZodObject<{
795
+ contract: z.ZodLiteral<"factory.telemetry.v1">;
796
+ instance: z.ZodObject<{
797
+ id: z.ZodString;
798
+ bootId: z.ZodString;
799
+ version: z.ZodString;
800
+ metadata: z.ZodOptional<z.ZodObject<{
801
+ name: z.ZodOptional<z.ZodString>;
802
+ backend: z.ZodOptional<z.ZodString>;
803
+ mode: z.ZodOptional<z.ZodString>;
804
+ platform: z.ZodOptional<z.ZodString>;
805
+ arch: z.ZodOptional<z.ZodString>;
806
+ runtime: z.ZodOptional<z.ZodString>;
807
+ }, "strict", z.ZodTypeAny, {
808
+ name?: string | undefined;
809
+ backend?: string | undefined;
810
+ mode?: string | undefined;
811
+ platform?: string | undefined;
812
+ arch?: string | undefined;
813
+ runtime?: string | undefined;
814
+ }, {
815
+ name?: string | undefined;
816
+ backend?: string | undefined;
817
+ mode?: string | undefined;
818
+ platform?: string | undefined;
819
+ arch?: string | undefined;
820
+ runtime?: string | undefined;
821
+ }>>;
822
+ }, "strict", z.ZodTypeAny, {
823
+ id: string;
824
+ bootId: string;
825
+ version: string;
826
+ metadata?: {
827
+ name?: string | undefined;
828
+ backend?: string | undefined;
829
+ mode?: string | undefined;
830
+ platform?: string | undefined;
831
+ arch?: string | undefined;
832
+ runtime?: string | undefined;
833
+ } | undefined;
834
+ }, {
835
+ id: string;
836
+ bootId: string;
837
+ version: string;
838
+ metadata?: {
839
+ name?: string | undefined;
840
+ backend?: string | undefined;
841
+ mode?: string | undefined;
842
+ platform?: string | undefined;
843
+ arch?: string | undefined;
844
+ runtime?: string | undefined;
845
+ } | undefined;
846
+ }>;
847
+ events: z.ZodArray<z.ZodEffects<z.ZodObject<{
848
+ sequence: z.ZodNumber;
849
+ id: z.ZodString;
850
+ occurredAt: z.ZodString;
851
+ type: z.ZodString;
852
+ level: z.ZodOptional<z.ZodEnum<["debug", "info", "warn", "error"]>>;
853
+ runId: z.ZodOptional<z.ZodString>;
854
+ phase: z.ZodOptional<z.ZodString>;
855
+ status: z.ZodOptional<z.ZodEnum<["queued", "running", "waiting", "blocked", "succeeded", "failed", "cancelled"]>>;
856
+ run: z.ZodOptional<z.ZodObject<{
857
+ source: z.ZodOptional<z.ZodString>;
858
+ repository: z.ZodOptional<z.ZodString>;
859
+ issueKey: z.ZodOptional<z.ZodString>;
860
+ recipe: z.ZodOptional<z.ZodString>;
861
+ }, "strict", z.ZodTypeAny, {
862
+ source?: string | undefined;
863
+ repository?: string | undefined;
864
+ issueKey?: string | undefined;
865
+ recipe?: string | undefined;
866
+ }, {
867
+ source?: string | undefined;
868
+ repository?: string | undefined;
869
+ issueKey?: string | undefined;
870
+ recipe?: string | undefined;
871
+ }>>;
872
+ attributes: z.ZodOptional<z.ZodObject<{
873
+ backend: z.ZodOptional<z.ZodString>;
874
+ mode: z.ZodOptional<z.ZodString>;
875
+ component: z.ZodOptional<z.ZodString>;
876
+ operation: z.ZodOptional<z.ZodString>;
877
+ errorClass: z.ZodOptional<z.ZodString>;
878
+ errorCode: z.ZodOptional<z.ZodString>;
879
+ errorFingerprint: z.ZodOptional<z.ZodString>;
880
+ retryable: z.ZodOptional<z.ZodBoolean>;
881
+ attempt: z.ZodOptional<z.ZodNumber>;
882
+ durationMs: z.ZodOptional<z.ZodNumber>;
883
+ agentRole: z.ZodOptional<z.ZodString>;
884
+ invocationId: z.ZodOptional<z.ZodString>;
885
+ nodeId: z.ZodOptional<z.ZodString>;
886
+ previousPhase: z.ZodOptional<z.ZodString>;
887
+ releaseReason: z.ZodOptional<z.ZodEnum<["completed", "human_review", "factory_stopped", "waiting_for_human", "exited", "offline", "node_offline", "crashed", "reconciled_missing", "delivery_failed", "dispatch_failed", "source_state_changed", "other"]>>;
888
+ cancellationReason: z.ZodOptional<z.ZodEnum<["source_state_changed", "agent_spawn_failed", "agent_delivery_failed", "dispatch_failed"]>>;
889
+ dryRun: z.ZodOptional<z.ZodBoolean>;
890
+ count: z.ZodOptional<z.ZodNumber>;
891
+ activeRuns: z.ZodOptional<z.ZodNumber>;
892
+ queuedRuns: z.ZodOptional<z.ZodNumber>;
893
+ trackedAgents: z.ZodOptional<z.ZodNumber>;
894
+ unownedAgents: z.ZodOptional<z.ZodNumber>;
895
+ outboxDepth: z.ZodOptional<z.ZodNumber>;
896
+ outboxOldestAgeMs: z.ZodOptional<z.ZodNumber>;
897
+ droppedEvents: z.ZodOptional<z.ZodNumber>;
898
+ transport: z.ZodOptional<z.ZodString>;
899
+ locality: z.ZodOptional<z.ZodString>;
900
+ }, "strict", z.ZodTypeAny, {
901
+ transport?: string | undefined;
902
+ dryRun?: boolean | undefined;
903
+ backend?: string | undefined;
904
+ mode?: string | undefined;
905
+ component?: string | undefined;
906
+ operation?: string | undefined;
907
+ errorClass?: string | undefined;
908
+ errorCode?: string | undefined;
909
+ errorFingerprint?: string | undefined;
910
+ retryable?: boolean | undefined;
911
+ attempt?: number | undefined;
912
+ durationMs?: number | undefined;
913
+ agentRole?: string | undefined;
914
+ invocationId?: string | undefined;
915
+ nodeId?: string | undefined;
916
+ previousPhase?: string | undefined;
917
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
918
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
919
+ count?: number | undefined;
920
+ activeRuns?: number | undefined;
921
+ queuedRuns?: number | undefined;
922
+ trackedAgents?: number | undefined;
923
+ unownedAgents?: number | undefined;
924
+ outboxDepth?: number | undefined;
925
+ outboxOldestAgeMs?: number | undefined;
926
+ droppedEvents?: number | undefined;
927
+ locality?: string | undefined;
928
+ }, {
929
+ transport?: string | undefined;
930
+ dryRun?: boolean | undefined;
931
+ backend?: string | undefined;
932
+ mode?: string | undefined;
933
+ component?: string | undefined;
934
+ operation?: string | undefined;
935
+ errorClass?: string | undefined;
936
+ errorCode?: string | undefined;
937
+ errorFingerprint?: string | undefined;
938
+ retryable?: boolean | undefined;
939
+ attempt?: number | undefined;
940
+ durationMs?: number | undefined;
941
+ agentRole?: string | undefined;
942
+ invocationId?: string | undefined;
943
+ nodeId?: string | undefined;
944
+ previousPhase?: string | undefined;
945
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
946
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
947
+ count?: number | undefined;
948
+ activeRuns?: number | undefined;
949
+ queuedRuns?: number | undefined;
950
+ trackedAgents?: number | undefined;
951
+ unownedAgents?: number | undefined;
952
+ outboxDepth?: number | undefined;
953
+ outboxOldestAgeMs?: number | undefined;
954
+ droppedEvents?: number | undefined;
955
+ locality?: string | undefined;
956
+ }>>;
957
+ trace: z.ZodOptional<z.ZodObject<{
958
+ traceId: z.ZodEffects<z.ZodString, string, string>;
959
+ spanId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
960
+ parentSpanId: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
961
+ }, "strict", z.ZodTypeAny, {
962
+ traceId: string;
963
+ spanId?: string | undefined;
964
+ parentSpanId?: string | undefined;
965
+ }, {
966
+ traceId: string;
967
+ spanId?: string | undefined;
968
+ parentSpanId?: string | undefined;
969
+ }>>;
970
+ }, "strict", z.ZodTypeAny, {
971
+ type: string;
972
+ id: string;
973
+ occurredAt: string;
974
+ sequence: number;
975
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
976
+ level?: "debug" | "info" | "warn" | "error" | undefined;
977
+ runId?: string | undefined;
978
+ phase?: string | undefined;
979
+ run?: {
980
+ source?: string | undefined;
981
+ repository?: string | undefined;
982
+ issueKey?: string | undefined;
983
+ recipe?: string | undefined;
984
+ } | undefined;
985
+ attributes?: {
986
+ transport?: string | undefined;
987
+ dryRun?: boolean | undefined;
988
+ backend?: string | undefined;
989
+ mode?: string | undefined;
990
+ component?: string | undefined;
991
+ operation?: string | undefined;
992
+ errorClass?: string | undefined;
993
+ errorCode?: string | undefined;
994
+ errorFingerprint?: string | undefined;
995
+ retryable?: boolean | undefined;
996
+ attempt?: number | undefined;
997
+ durationMs?: number | undefined;
998
+ agentRole?: string | undefined;
999
+ invocationId?: string | undefined;
1000
+ nodeId?: string | undefined;
1001
+ previousPhase?: string | undefined;
1002
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
1003
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
1004
+ count?: number | undefined;
1005
+ activeRuns?: number | undefined;
1006
+ queuedRuns?: number | undefined;
1007
+ trackedAgents?: number | undefined;
1008
+ unownedAgents?: number | undefined;
1009
+ outboxDepth?: number | undefined;
1010
+ outboxOldestAgeMs?: number | undefined;
1011
+ droppedEvents?: number | undefined;
1012
+ locality?: string | undefined;
1013
+ } | undefined;
1014
+ trace?: {
1015
+ traceId: string;
1016
+ spanId?: string | undefined;
1017
+ parentSpanId?: string | undefined;
1018
+ } | undefined;
1019
+ }, {
1020
+ type: string;
1021
+ id: string;
1022
+ occurredAt: string;
1023
+ sequence: number;
1024
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
1025
+ level?: "debug" | "info" | "warn" | "error" | undefined;
1026
+ runId?: string | undefined;
1027
+ phase?: string | undefined;
1028
+ run?: {
1029
+ source?: string | undefined;
1030
+ repository?: string | undefined;
1031
+ issueKey?: string | undefined;
1032
+ recipe?: string | undefined;
1033
+ } | undefined;
1034
+ attributes?: {
1035
+ transport?: string | undefined;
1036
+ dryRun?: boolean | undefined;
1037
+ backend?: string | undefined;
1038
+ mode?: string | undefined;
1039
+ component?: string | undefined;
1040
+ operation?: string | undefined;
1041
+ errorClass?: string | undefined;
1042
+ errorCode?: string | undefined;
1043
+ errorFingerprint?: string | undefined;
1044
+ retryable?: boolean | undefined;
1045
+ attempt?: number | undefined;
1046
+ durationMs?: number | undefined;
1047
+ agentRole?: string | undefined;
1048
+ invocationId?: string | undefined;
1049
+ nodeId?: string | undefined;
1050
+ previousPhase?: string | undefined;
1051
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
1052
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
1053
+ count?: number | undefined;
1054
+ activeRuns?: number | undefined;
1055
+ queuedRuns?: number | undefined;
1056
+ trackedAgents?: number | undefined;
1057
+ unownedAgents?: number | undefined;
1058
+ outboxDepth?: number | undefined;
1059
+ outboxOldestAgeMs?: number | undefined;
1060
+ droppedEvents?: number | undefined;
1061
+ locality?: string | undefined;
1062
+ } | undefined;
1063
+ trace?: {
1064
+ traceId: string;
1065
+ spanId?: string | undefined;
1066
+ parentSpanId?: string | undefined;
1067
+ } | undefined;
1068
+ }>, {
1069
+ type: string;
1070
+ id: string;
1071
+ occurredAt: string;
1072
+ sequence: number;
1073
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
1074
+ level?: "debug" | "info" | "warn" | "error" | undefined;
1075
+ runId?: string | undefined;
1076
+ phase?: string | undefined;
1077
+ run?: {
1078
+ source?: string | undefined;
1079
+ repository?: string | undefined;
1080
+ issueKey?: string | undefined;
1081
+ recipe?: string | undefined;
1082
+ } | undefined;
1083
+ attributes?: {
1084
+ transport?: string | undefined;
1085
+ dryRun?: boolean | undefined;
1086
+ backend?: string | undefined;
1087
+ mode?: string | undefined;
1088
+ component?: string | undefined;
1089
+ operation?: string | undefined;
1090
+ errorClass?: string | undefined;
1091
+ errorCode?: string | undefined;
1092
+ errorFingerprint?: string | undefined;
1093
+ retryable?: boolean | undefined;
1094
+ attempt?: number | undefined;
1095
+ durationMs?: number | undefined;
1096
+ agentRole?: string | undefined;
1097
+ invocationId?: string | undefined;
1098
+ nodeId?: string | undefined;
1099
+ previousPhase?: string | undefined;
1100
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
1101
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
1102
+ count?: number | undefined;
1103
+ activeRuns?: number | undefined;
1104
+ queuedRuns?: number | undefined;
1105
+ trackedAgents?: number | undefined;
1106
+ unownedAgents?: number | undefined;
1107
+ outboxDepth?: number | undefined;
1108
+ outboxOldestAgeMs?: number | undefined;
1109
+ droppedEvents?: number | undefined;
1110
+ locality?: string | undefined;
1111
+ } | undefined;
1112
+ trace?: {
1113
+ traceId: string;
1114
+ spanId?: string | undefined;
1115
+ parentSpanId?: string | undefined;
1116
+ } | undefined;
1117
+ }, {
1118
+ type: string;
1119
+ id: string;
1120
+ occurredAt: string;
1121
+ sequence: number;
1122
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
1123
+ level?: "debug" | "info" | "warn" | "error" | undefined;
1124
+ runId?: string | undefined;
1125
+ phase?: string | undefined;
1126
+ run?: {
1127
+ source?: string | undefined;
1128
+ repository?: string | undefined;
1129
+ issueKey?: string | undefined;
1130
+ recipe?: string | undefined;
1131
+ } | undefined;
1132
+ attributes?: {
1133
+ transport?: string | undefined;
1134
+ dryRun?: boolean | undefined;
1135
+ backend?: string | undefined;
1136
+ mode?: string | undefined;
1137
+ component?: string | undefined;
1138
+ operation?: string | undefined;
1139
+ errorClass?: string | undefined;
1140
+ errorCode?: string | undefined;
1141
+ errorFingerprint?: string | undefined;
1142
+ retryable?: boolean | undefined;
1143
+ attempt?: number | undefined;
1144
+ durationMs?: number | undefined;
1145
+ agentRole?: string | undefined;
1146
+ invocationId?: string | undefined;
1147
+ nodeId?: string | undefined;
1148
+ previousPhase?: string | undefined;
1149
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
1150
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
1151
+ count?: number | undefined;
1152
+ activeRuns?: number | undefined;
1153
+ queuedRuns?: number | undefined;
1154
+ trackedAgents?: number | undefined;
1155
+ unownedAgents?: number | undefined;
1156
+ outboxDepth?: number | undefined;
1157
+ outboxOldestAgeMs?: number | undefined;
1158
+ droppedEvents?: number | undefined;
1159
+ locality?: string | undefined;
1160
+ } | undefined;
1161
+ trace?: {
1162
+ traceId: string;
1163
+ spanId?: string | undefined;
1164
+ parentSpanId?: string | undefined;
1165
+ } | undefined;
1166
+ }>, "many">;
1167
+ }, "strict", z.ZodTypeAny, {
1168
+ contract: "factory.telemetry.v1";
1169
+ instance: {
1170
+ id: string;
1171
+ bootId: string;
1172
+ version: string;
1173
+ metadata?: {
1174
+ name?: string | undefined;
1175
+ backend?: string | undefined;
1176
+ mode?: string | undefined;
1177
+ platform?: string | undefined;
1178
+ arch?: string | undefined;
1179
+ runtime?: string | undefined;
1180
+ } | undefined;
1181
+ };
1182
+ events: {
1183
+ type: string;
1184
+ id: string;
1185
+ occurredAt: string;
1186
+ sequence: number;
1187
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
1188
+ level?: "debug" | "info" | "warn" | "error" | undefined;
1189
+ runId?: string | undefined;
1190
+ phase?: string | undefined;
1191
+ run?: {
1192
+ source?: string | undefined;
1193
+ repository?: string | undefined;
1194
+ issueKey?: string | undefined;
1195
+ recipe?: string | undefined;
1196
+ } | undefined;
1197
+ attributes?: {
1198
+ transport?: string | undefined;
1199
+ dryRun?: boolean | undefined;
1200
+ backend?: string | undefined;
1201
+ mode?: string | undefined;
1202
+ component?: string | undefined;
1203
+ operation?: string | undefined;
1204
+ errorClass?: string | undefined;
1205
+ errorCode?: string | undefined;
1206
+ errorFingerprint?: string | undefined;
1207
+ retryable?: boolean | undefined;
1208
+ attempt?: number | undefined;
1209
+ durationMs?: number | undefined;
1210
+ agentRole?: string | undefined;
1211
+ invocationId?: string | undefined;
1212
+ nodeId?: string | undefined;
1213
+ previousPhase?: string | undefined;
1214
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
1215
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
1216
+ count?: number | undefined;
1217
+ activeRuns?: number | undefined;
1218
+ queuedRuns?: number | undefined;
1219
+ trackedAgents?: number | undefined;
1220
+ unownedAgents?: number | undefined;
1221
+ outboxDepth?: number | undefined;
1222
+ outboxOldestAgeMs?: number | undefined;
1223
+ droppedEvents?: number | undefined;
1224
+ locality?: string | undefined;
1225
+ } | undefined;
1226
+ trace?: {
1227
+ traceId: string;
1228
+ spanId?: string | undefined;
1229
+ parentSpanId?: string | undefined;
1230
+ } | undefined;
1231
+ }[];
1232
+ }, {
1233
+ contract: "factory.telemetry.v1";
1234
+ instance: {
1235
+ id: string;
1236
+ bootId: string;
1237
+ version: string;
1238
+ metadata?: {
1239
+ name?: string | undefined;
1240
+ backend?: string | undefined;
1241
+ mode?: string | undefined;
1242
+ platform?: string | undefined;
1243
+ arch?: string | undefined;
1244
+ runtime?: string | undefined;
1245
+ } | undefined;
1246
+ };
1247
+ events: {
1248
+ type: string;
1249
+ id: string;
1250
+ occurredAt: string;
1251
+ sequence: number;
1252
+ status?: "blocked" | "failed" | "queued" | "running" | "waiting" | "succeeded" | "cancelled" | undefined;
1253
+ level?: "debug" | "info" | "warn" | "error" | undefined;
1254
+ runId?: string | undefined;
1255
+ phase?: string | undefined;
1256
+ run?: {
1257
+ source?: string | undefined;
1258
+ repository?: string | undefined;
1259
+ issueKey?: string | undefined;
1260
+ recipe?: string | undefined;
1261
+ } | undefined;
1262
+ attributes?: {
1263
+ transport?: string | undefined;
1264
+ dryRun?: boolean | undefined;
1265
+ backend?: string | undefined;
1266
+ mode?: string | undefined;
1267
+ component?: string | undefined;
1268
+ operation?: string | undefined;
1269
+ errorClass?: string | undefined;
1270
+ errorCode?: string | undefined;
1271
+ errorFingerprint?: string | undefined;
1272
+ retryable?: boolean | undefined;
1273
+ attempt?: number | undefined;
1274
+ durationMs?: number | undefined;
1275
+ agentRole?: string | undefined;
1276
+ invocationId?: string | undefined;
1277
+ nodeId?: string | undefined;
1278
+ previousPhase?: string | undefined;
1279
+ releaseReason?: "completed" | "human_review" | "factory_stopped" | "waiting_for_human" | "exited" | "offline" | "node_offline" | "crashed" | "reconciled_missing" | "delivery_failed" | "dispatch_failed" | "source_state_changed" | "other" | undefined;
1280
+ cancellationReason?: "dispatch_failed" | "source_state_changed" | "agent_spawn_failed" | "agent_delivery_failed" | undefined;
1281
+ count?: number | undefined;
1282
+ activeRuns?: number | undefined;
1283
+ queuedRuns?: number | undefined;
1284
+ trackedAgents?: number | undefined;
1285
+ unownedAgents?: number | undefined;
1286
+ outboxDepth?: number | undefined;
1287
+ outboxOldestAgeMs?: number | undefined;
1288
+ droppedEvents?: number | undefined;
1289
+ locality?: string | undefined;
1290
+ } | undefined;
1291
+ trace?: {
1292
+ traceId: string;
1293
+ spanId?: string | undefined;
1294
+ parentSpanId?: string | undefined;
1295
+ } | undefined;
1296
+ }[];
1297
+ }>;
1298
+ export type FactoryCloudEventBatchV1 = z.infer<typeof FactoryCloudEventBatchV1Schema>;
1299
+ export interface CreateFactoryCloudEventV1Options {
1300
+ id?: () => string;
1301
+ now?: () => Date;
1302
+ }
1303
+ /**
1304
+ * Stable correlation ID for the durable run. It has W3C trace-id shape but is
1305
+ * not evidence that an OpenTelemetry span was created or exported.
1306
+ */
1307
+ export declare function factoryRunTraceIdV1(runId: string): string;
1308
+ export declare function createFactoryCloudEventV1(input: Omit<FactoryCloudEventInputV1, 'id' | 'occurredAt'> & Partial<Pick<FactoryCloudEventInputV1, 'id' | 'occurredAt'>>, options?: CreateFactoryCloudEventV1Options): FactoryCloudEventInputV1;
1309
+ /**
1310
+ * Converts provider-owned exit/release text into a closed operational category.
1311
+ * Unknown text is never forwarded because it can contain task or error details.
1312
+ */
1313
+ export declare function factoryCloudReleaseReasonV1(value: string | undefined): FactoryCloudReleaseReasonV1 | undefined;
1314
+ export declare function isCriticalFactoryCloudEvent(event: Pick<FactoryCloudEventInputV1, 'type' | 'level' | 'status'>): boolean;
1315
+ //# sourceMappingURL=events.d.ts.map