@agent-relay/factory 0.1.32 → 0.1.33

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