@method-ai-hq/sdk 0.15.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +1 -1
  2. package/dist/packages/method-document/src/conversion-report.d.ts +2 -2
  3. package/dist/packages/sdk/examples/outbound-management/README.md +1 -1
  4. package/dist/packages/sdk/examples/outbound-management/outbound.method +3 -3
  5. package/dist/packages/sdk/examples/social-briefing/README.md +1 -1
  6. package/dist/packages/sdk/examples/social-briefing/social-briefing.method +1 -1
  7. package/dist/packages/sdk/package.json +2 -2
  8. package/dist/packages/sdk/src/authoring-instructions.d.ts +2 -2
  9. package/dist/packages/sdk/src/authoring-instructions.js +2 -2
  10. package/dist/packages/sdk/src/current-inspection.d.ts +2 -0
  11. package/dist/packages/sdk/src/current-inspection.js +26 -17
  12. package/dist/packages/sdk/src/current-runtime.js +6 -2
  13. package/dist/packages/sdk/src/failure.d.ts +11 -0
  14. package/dist/packages/sdk/src/failure.js +25 -0
  15. package/dist/packages/sdk/src/improve.d.ts +7 -4
  16. package/dist/packages/sdk/src/improve.js +11 -17
  17. package/dist/packages/sdk/src/inspect.js +1 -1
  18. package/dist/packages/sdk/src/judge.d.ts +20 -0
  19. package/dist/packages/sdk/src/judge.js +59 -0
  20. package/dist/packages/sdk/src/method-help.d.ts +1 -1
  21. package/dist/packages/sdk/src/method-help.js +9 -8
  22. package/dist/packages/sdk/src/method-sync.js +3 -4
  23. package/dist/packages/sdk/src/method.d.ts +0 -2
  24. package/dist/packages/sdk/src/method.js +8 -10
  25. package/dist/packages/sdk/src/model-checks.d.ts +18 -1
  26. package/dist/packages/sdk/src/model-checks.js +67 -7
  27. package/dist/packages/sdk/src/production.js +1 -1
  28. package/dist/packages/sdk/src/proposals.d.ts +4 -4
  29. package/dist/packages/sdk/src/proposals.js +29 -50
  30. package/dist/packages/sdk/src/run-saved.d.ts +1 -1
  31. package/dist/packages/sdk/src/run-saved.js +4 -2
  32. package/dist/packages/sdk/src/run-worker.js +10 -1
  33. package/dist/packages/sdk/src/worker.js +4 -3
  34. package/dist/packages/workflow-language/src/inspection.d.ts +272 -138
  35. package/dist/packages/workflow-language/src/inspection.js +30 -10
  36. package/package.json +2 -2
@@ -1,21 +1,79 @@
1
1
  import { z } from "zod";
2
2
  import { type Json, type Step, type Workflow, type Shape } from "./schema.js";
3
+ export declare const FailureOwnerSchema: z.ZodEnum<["method_code", "agent_work", "outside_service", "limit", "setup", "needs_you", "method_platform"]>;
4
+ export type FailureOwner = z.infer<typeof FailureOwnerSchema>;
5
+ /** The runtime's failure record of a run that stopped: whose problem it is, where in the Method, and the next action. */
3
6
  export declare const FailureSchema: z.ZodObject<{
4
- phase: z.ZodEnum<["environment", "input", "action", "check", "change"]>;
5
- expected: z.ZodString;
6
- observed: z.ZodString;
7
- evidence: z.ZodArray<z.ZodString, "many">;
7
+ owner: z.ZodEnum<["method_code", "agent_work", "outside_service", "limit", "setup", "needs_you", "method_platform"]>;
8
+ code: z.ZodString;
9
+ headline: z.ZodString;
10
+ step: z.ZodNullable<z.ZodString>;
11
+ step_name: z.ZodNullable<z.ZodString>;
12
+ iteration: z.ZodNullable<z.ZodNumber>;
13
+ failed_iterations: z.ZodArray<z.ZodNumber, "many">;
14
+ total: z.ZodNullable<z.ZodNumber>;
15
+ phase: z.ZodNullable<z.ZodEnum<["action", "check", "effect", "tool", "setup"]>>;
16
+ check_name: z.ZodNullable<z.ZodString>;
17
+ next: z.ZodObject<{
18
+ action: z.ZodEnum<["fix_method", "run_again", "raise_limit", "fix_setup", "answer", "report_bug"]>;
19
+ text: z.ZodString;
20
+ command: z.ZodOptional<z.ZodString>;
21
+ }, "strict", z.ZodTypeAny, {
22
+ text: string;
23
+ action: "answer" | "fix_method" | "run_again" | "raise_limit" | "fix_setup" | "report_bug";
24
+ command?: string | undefined;
25
+ }, {
26
+ text: string;
27
+ action: "answer" | "fix_method" | "run_again" | "raise_limit" | "fix_setup" | "report_bug";
28
+ command?: string | undefined;
29
+ }>;
30
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
31
+ details: z.ZodOptional<z.ZodString>;
32
+ diagnostics: z.ZodOptional<z.ZodString>;
8
33
  }, "strict", z.ZodTypeAny, {
9
- expected: string;
10
- phase: "check" | "input" | "action" | "environment" | "change";
11
- observed: string;
12
- evidence: string[];
34
+ code: string;
35
+ next: {
36
+ text: string;
37
+ action: "answer" | "fix_method" | "run_again" | "raise_limit" | "fix_setup" | "report_bug";
38
+ command?: string | undefined;
39
+ };
40
+ step: string | null;
41
+ owner: "method_code" | "agent_work" | "outside_service" | "limit" | "setup" | "needs_you" | "method_platform";
42
+ headline: string;
43
+ step_name: string | null;
44
+ iteration: number | null;
45
+ failed_iterations: number[];
46
+ total: number | null;
47
+ phase: "check" | "tool" | "action" | "effect" | "setup" | null;
48
+ check_name: string | null;
49
+ evidence?: string[] | undefined;
50
+ details?: string | undefined;
51
+ diagnostics?: string | undefined;
13
52
  }, {
14
- expected: string;
15
- phase: "check" | "input" | "action" | "environment" | "change";
16
- observed: string;
17
- evidence: string[];
53
+ code: string;
54
+ next: {
55
+ text: string;
56
+ action: "answer" | "fix_method" | "run_again" | "raise_limit" | "fix_setup" | "report_bug";
57
+ command?: string | undefined;
58
+ };
59
+ step: string | null;
60
+ owner: "method_code" | "agent_work" | "outside_service" | "limit" | "setup" | "needs_you" | "method_platform";
61
+ headline: string;
62
+ step_name: string | null;
63
+ iteration: number | null;
64
+ failed_iterations: number[];
65
+ total: number | null;
66
+ phase: "check" | "tool" | "action" | "effect" | "setup" | null;
67
+ check_name: string | null;
68
+ evidence?: string[] | undefined;
69
+ details?: string | undefined;
70
+ diagnostics?: string | undefined;
18
71
  }>;
72
+ export type RunFailure = z.infer<typeof FailureSchema>;
73
+ /** Whose problem a failure is, in a few plain words. */
74
+ export declare function ownerText(owner: FailureOwner): string;
75
+ export declare const RunStatusSchema: z.ZodEnum<["running", "waiting_for_you", "succeeded", "unconfirmed", "failed"]>;
76
+ export type RunStatus = z.infer<typeof RunStatusSchema>;
19
77
  export declare const ObservedEffectsSchema: z.ZodUnion<[z.ZodObject<{
20
78
  network: z.ZodArray<z.ZodString, "many">;
21
79
  reads: z.ZodArray<z.ZodString, "many">;
@@ -26,16 +84,16 @@ export declare const ObservedEffectsSchema: z.ZodUnion<[z.ZodObject<{
26
84
  }, "strict", z.ZodTypeAny, {
27
85
  runs: string[];
28
86
  network: string[];
87
+ env: string[];
29
88
  reads: string[];
30
89
  writes: string[];
31
- env: string[];
32
90
  truncated?: true | undefined;
33
91
  }, {
34
92
  runs: string[];
35
93
  network: string[];
94
+ env: string[];
36
95
  reads: string[];
37
96
  writes: string[];
38
- env: string[];
39
97
  truncated?: true | undefined;
40
98
  }>, z.ZodObject<{
41
99
  unavailable: z.ZodString;
@@ -80,14 +138,21 @@ export declare const RunEventSchema: z.ZodObject<{
80
138
  completed: z.ZodOptional<z.ZodNumber>;
81
139
  total: z.ZodOptional<z.ZodNumber>;
82
140
  unit: z.ZodOptional<z.ZodString>;
141
+ key: z.ZodOptional<z.ZodString>;
142
+ attempt: z.ZodOptional<z.ZodNumber>;
143
+ attempts: z.ZodOptional<z.ZodNumber>;
83
144
  }, "strict", z.ZodTypeAny, {
84
145
  at: string;
85
146
  type: string;
86
147
  tool?: string | undefined;
87
148
  kind?: "classify" | undefined;
149
+ key?: string | undefined;
88
150
  child?: string | undefined;
89
151
  model?: string | undefined;
152
+ total?: number | undefined;
90
153
  phase?: "check" | "action" | undefined;
154
+ command?: string | undefined;
155
+ diagnostics?: string | undefined;
91
156
  provider?: string | undefined;
92
157
  request_id?: string | undefined;
93
158
  operation_id?: string | undefined;
@@ -101,20 +166,23 @@ export declare const RunEventSchema: z.ZodObject<{
101
166
  detail?: string | undefined;
102
167
  sequence?: number | undefined;
103
168
  call_id?: string | undefined;
104
- command?: string | undefined;
105
169
  exit_code?: number | null | undefined;
106
- diagnostics?: string | undefined;
107
170
  completed?: number | undefined;
108
- total?: number | undefined;
109
171
  unit?: string | undefined;
172
+ attempt?: number | undefined;
173
+ attempts?: number | undefined;
110
174
  }, {
111
175
  at: string;
112
176
  type: string;
113
177
  tool?: string | undefined;
114
178
  kind?: "classify" | undefined;
179
+ key?: string | undefined;
115
180
  child?: string | undefined;
116
181
  model?: string | undefined;
182
+ total?: number | undefined;
117
183
  phase?: "check" | "action" | undefined;
184
+ command?: string | undefined;
185
+ diagnostics?: string | undefined;
118
186
  provider?: string | undefined;
119
187
  request_id?: string | undefined;
120
188
  operation_id?: string | undefined;
@@ -128,12 +196,11 @@ export declare const RunEventSchema: z.ZodObject<{
128
196
  detail?: string | undefined;
129
197
  sequence?: number | undefined;
130
198
  call_id?: string | undefined;
131
- command?: string | undefined;
132
199
  exit_code?: number | null | undefined;
133
- diagnostics?: string | undefined;
134
200
  completed?: number | undefined;
135
- total?: number | undefined;
136
201
  unit?: string | undefined;
202
+ attempt?: number | undefined;
203
+ attempts?: number | undefined;
137
204
  }>;
138
205
  export declare const InspectionSchema: z.ZodObject<{
139
206
  started_at: z.ZodOptional<z.ZodString>;
@@ -143,23 +210,72 @@ export declare const InspectionSchema: z.ZodObject<{
143
210
  schema: z.ZodLiteral<"workflow-inspection/2">;
144
211
  workflow: z.ZodType<import("./schema.js").CurrentWorkflow, z.ZodTypeDef, import("./schema.js").CurrentWorkflow>;
145
212
  run_id: z.ZodString;
146
- status: z.ZodString;
147
- error: z.ZodOptional<z.ZodString>;
213
+ status: z.ZodEnum<["running", "waiting_for_you", "succeeded", "unconfirmed", "failed"]>;
148
214
  failure: z.ZodOptional<z.ZodObject<{
149
- phase: z.ZodEnum<["environment", "input", "action", "check", "change"]>;
150
- expected: z.ZodString;
151
- observed: z.ZodString;
152
- evidence: z.ZodArray<z.ZodString, "many">;
215
+ owner: z.ZodEnum<["method_code", "agent_work", "outside_service", "limit", "setup", "needs_you", "method_platform"]>;
216
+ code: z.ZodString;
217
+ headline: z.ZodString;
218
+ step: z.ZodNullable<z.ZodString>;
219
+ step_name: z.ZodNullable<z.ZodString>;
220
+ iteration: z.ZodNullable<z.ZodNumber>;
221
+ failed_iterations: z.ZodArray<z.ZodNumber, "many">;
222
+ total: z.ZodNullable<z.ZodNumber>;
223
+ phase: z.ZodNullable<z.ZodEnum<["action", "check", "effect", "tool", "setup"]>>;
224
+ check_name: z.ZodNullable<z.ZodString>;
225
+ next: z.ZodObject<{
226
+ action: z.ZodEnum<["fix_method", "run_again", "raise_limit", "fix_setup", "answer", "report_bug"]>;
227
+ text: z.ZodString;
228
+ command: z.ZodOptional<z.ZodString>;
229
+ }, "strict", z.ZodTypeAny, {
230
+ text: string;
231
+ action: "answer" | "fix_method" | "run_again" | "raise_limit" | "fix_setup" | "report_bug";
232
+ command?: string | undefined;
233
+ }, {
234
+ text: string;
235
+ action: "answer" | "fix_method" | "run_again" | "raise_limit" | "fix_setup" | "report_bug";
236
+ command?: string | undefined;
237
+ }>;
238
+ evidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
239
+ details: z.ZodOptional<z.ZodString>;
240
+ diagnostics: z.ZodOptional<z.ZodString>;
153
241
  }, "strict", z.ZodTypeAny, {
154
- expected: string;
155
- phase: "check" | "input" | "action" | "environment" | "change";
156
- observed: string;
157
- evidence: string[];
242
+ code: string;
243
+ next: {
244
+ text: string;
245
+ action: "answer" | "fix_method" | "run_again" | "raise_limit" | "fix_setup" | "report_bug";
246
+ command?: string | undefined;
247
+ };
248
+ step: string | null;
249
+ owner: "method_code" | "agent_work" | "outside_service" | "limit" | "setup" | "needs_you" | "method_platform";
250
+ headline: string;
251
+ step_name: string | null;
252
+ iteration: number | null;
253
+ failed_iterations: number[];
254
+ total: number | null;
255
+ phase: "check" | "tool" | "action" | "effect" | "setup" | null;
256
+ check_name: string | null;
257
+ evidence?: string[] | undefined;
258
+ details?: string | undefined;
259
+ diagnostics?: string | undefined;
158
260
  }, {
159
- expected: string;
160
- phase: "check" | "input" | "action" | "environment" | "change";
161
- observed: string;
162
- evidence: string[];
261
+ code: string;
262
+ next: {
263
+ text: string;
264
+ action: "answer" | "fix_method" | "run_again" | "raise_limit" | "fix_setup" | "report_bug";
265
+ command?: string | undefined;
266
+ };
267
+ step: string | null;
268
+ owner: "method_code" | "agent_work" | "outside_service" | "limit" | "setup" | "needs_you" | "method_platform";
269
+ headline: string;
270
+ step_name: string | null;
271
+ iteration: number | null;
272
+ failed_iterations: number[];
273
+ total: number | null;
274
+ phase: "check" | "tool" | "action" | "effect" | "setup" | null;
275
+ check_name: string | null;
276
+ evidence?: string[] | undefined;
277
+ details?: string | undefined;
278
+ diagnostics?: string | undefined;
163
279
  }>>;
164
280
  inputs: z.ZodRecord<z.ZodString, z.ZodType<Json, z.ZodTypeDef, Json>>;
165
281
  state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<Json, z.ZodTypeDef, Json>>>;
@@ -310,14 +426,21 @@ export declare const InspectionSchema: z.ZodObject<{
310
426
  completed: z.ZodOptional<z.ZodNumber>;
311
427
  total: z.ZodOptional<z.ZodNumber>;
312
428
  unit: z.ZodOptional<z.ZodString>;
429
+ key: z.ZodOptional<z.ZodString>;
430
+ attempt: z.ZodOptional<z.ZodNumber>;
431
+ attempts: z.ZodOptional<z.ZodNumber>;
313
432
  }, "strict", z.ZodTypeAny, {
314
433
  at: string;
315
434
  type: string;
316
435
  tool?: string | undefined;
317
436
  kind?: "classify" | undefined;
437
+ key?: string | undefined;
318
438
  child?: string | undefined;
319
439
  model?: string | undefined;
440
+ total?: number | undefined;
320
441
  phase?: "check" | "action" | undefined;
442
+ command?: string | undefined;
443
+ diagnostics?: string | undefined;
321
444
  provider?: string | undefined;
322
445
  request_id?: string | undefined;
323
446
  operation_id?: string | undefined;
@@ -331,20 +454,23 @@ export declare const InspectionSchema: z.ZodObject<{
331
454
  detail?: string | undefined;
332
455
  sequence?: number | undefined;
333
456
  call_id?: string | undefined;
334
- command?: string | undefined;
335
457
  exit_code?: number | null | undefined;
336
- diagnostics?: string | undefined;
337
458
  completed?: number | undefined;
338
- total?: number | undefined;
339
459
  unit?: string | undefined;
460
+ attempt?: number | undefined;
461
+ attempts?: number | undefined;
340
462
  }, {
341
463
  at: string;
342
464
  type: string;
343
465
  tool?: string | undefined;
344
466
  kind?: "classify" | undefined;
467
+ key?: string | undefined;
345
468
  child?: string | undefined;
346
469
  model?: string | undefined;
470
+ total?: number | undefined;
347
471
  phase?: "check" | "action" | undefined;
472
+ command?: string | undefined;
473
+ diagnostics?: string | undefined;
348
474
  provider?: string | undefined;
349
475
  request_id?: string | undefined;
350
476
  operation_id?: string | undefined;
@@ -358,34 +484,16 @@ export declare const InspectionSchema: z.ZodObject<{
358
484
  detail?: string | undefined;
359
485
  sequence?: number | undefined;
360
486
  call_id?: string | undefined;
361
- command?: string | undefined;
362
487
  exit_code?: number | null | undefined;
363
- diagnostics?: string | undefined;
364
488
  completed?: number | undefined;
365
- total?: number | undefined;
366
489
  unit?: string | undefined;
490
+ attempt?: number | undefined;
491
+ attempts?: number | undefined;
367
492
  }>, "many">>;
368
493
  invocations: z.ZodRecord<z.ZodString, z.ZodObject<{
369
494
  step_id: z.ZodString;
370
- status: z.ZodString;
495
+ status: z.ZodEnum<["running", "returned", "passed", "skipped", "waiting_for_you", "failed", "stopped"]>;
371
496
  verification: z.ZodOptional<z.ZodEnum<["checked", "unchecked"]>>;
372
- error: z.ZodOptional<z.ZodString>;
373
- failure: z.ZodOptional<z.ZodObject<{
374
- phase: z.ZodEnum<["environment", "input", "action", "check", "change"]>;
375
- expected: z.ZodString;
376
- observed: z.ZodString;
377
- evidence: z.ZodArray<z.ZodString, "many">;
378
- }, "strict", z.ZodTypeAny, {
379
- expected: string;
380
- phase: "check" | "input" | "action" | "environment" | "change";
381
- observed: string;
382
- evidence: string[];
383
- }, {
384
- expected: string;
385
- phase: "check" | "input" | "action" | "environment" | "change";
386
- observed: string;
387
- evidence: string[];
388
- }>>;
389
497
  inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<Json, z.ZodTypeDef, Json>>>;
390
498
  outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<Json, z.ZodTypeDef, Json>>>;
391
499
  checks: z.ZodArray<z.ZodObject<{
@@ -459,14 +567,21 @@ export declare const InspectionSchema: z.ZodObject<{
459
567
  completed: z.ZodOptional<z.ZodNumber>;
460
568
  total: z.ZodOptional<z.ZodNumber>;
461
569
  unit: z.ZodOptional<z.ZodString>;
570
+ key: z.ZodOptional<z.ZodString>;
571
+ attempt: z.ZodOptional<z.ZodNumber>;
572
+ attempts: z.ZodOptional<z.ZodNumber>;
462
573
  }, "strict", z.ZodTypeAny, {
463
574
  at: string;
464
575
  type: string;
465
576
  tool?: string | undefined;
466
577
  kind?: "classify" | undefined;
578
+ key?: string | undefined;
467
579
  child?: string | undefined;
468
580
  model?: string | undefined;
581
+ total?: number | undefined;
469
582
  phase?: "check" | "action" | undefined;
583
+ command?: string | undefined;
584
+ diagnostics?: string | undefined;
470
585
  provider?: string | undefined;
471
586
  request_id?: string | undefined;
472
587
  operation_id?: string | undefined;
@@ -480,20 +595,23 @@ export declare const InspectionSchema: z.ZodObject<{
480
595
  detail?: string | undefined;
481
596
  sequence?: number | undefined;
482
597
  call_id?: string | undefined;
483
- command?: string | undefined;
484
598
  exit_code?: number | null | undefined;
485
- diagnostics?: string | undefined;
486
599
  completed?: number | undefined;
487
- total?: number | undefined;
488
600
  unit?: string | undefined;
601
+ attempt?: number | undefined;
602
+ attempts?: number | undefined;
489
603
  }, {
490
604
  at: string;
491
605
  type: string;
492
606
  tool?: string | undefined;
493
607
  kind?: "classify" | undefined;
608
+ key?: string | undefined;
494
609
  child?: string | undefined;
495
610
  model?: string | undefined;
611
+ total?: number | undefined;
496
612
  phase?: "check" | "action" | undefined;
613
+ command?: string | undefined;
614
+ diagnostics?: string | undefined;
497
615
  provider?: string | undefined;
498
616
  request_id?: string | undefined;
499
617
  operation_id?: string | undefined;
@@ -507,12 +625,11 @@ export declare const InspectionSchema: z.ZodObject<{
507
625
  detail?: string | undefined;
508
626
  sequence?: number | undefined;
509
627
  call_id?: string | undefined;
510
- command?: string | undefined;
511
628
  exit_code?: number | null | undefined;
512
- diagnostics?: string | undefined;
513
629
  completed?: number | undefined;
514
- total?: number | undefined;
515
630
  unit?: string | undefined;
631
+ attempt?: number | undefined;
632
+ attempts?: number | undefined;
516
633
  }>, "many">;
517
634
  observed_effects: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
518
635
  network: z.ZodArray<z.ZodString, "many">;
@@ -524,16 +641,16 @@ export declare const InspectionSchema: z.ZodObject<{
524
641
  }, "strict", z.ZodTypeAny, {
525
642
  runs: string[];
526
643
  network: string[];
644
+ env: string[];
527
645
  reads: string[];
528
646
  writes: string[];
529
- env: string[];
530
647
  truncated?: true | undefined;
531
648
  }, {
532
649
  runs: string[];
533
650
  network: string[];
651
+ env: string[];
534
652
  reads: string[];
535
653
  writes: string[];
536
- env: string[];
537
654
  truncated?: true | undefined;
538
655
  }>, z.ZodObject<{
539
656
  unavailable: z.ZodString;
@@ -543,7 +660,8 @@ export declare const InspectionSchema: z.ZodObject<{
543
660
  unavailable: string;
544
661
  }>]>>;
545
662
  }, "strict", z.ZodTypeAny, {
546
- status: string;
663
+ status: "running" | "waiting_for_you" | "failed" | "returned" | "passed" | "skipped" | "stopped";
664
+ changes: Record<string, Json>;
547
665
  checks: {
548
666
  method: string;
549
667
  id: string;
@@ -556,9 +674,13 @@ export declare const InspectionSchema: z.ZodObject<{
556
674
  type: string;
557
675
  tool?: string | undefined;
558
676
  kind?: "classify" | undefined;
677
+ key?: string | undefined;
559
678
  child?: string | undefined;
560
679
  model?: string | undefined;
680
+ total?: number | undefined;
561
681
  phase?: "check" | "action" | undefined;
682
+ command?: string | undefined;
683
+ diagnostics?: string | undefined;
562
684
  provider?: string | undefined;
563
685
  request_id?: string | undefined;
564
686
  operation_id?: string | undefined;
@@ -572,23 +694,14 @@ export declare const InspectionSchema: z.ZodObject<{
572
694
  detail?: string | undefined;
573
695
  sequence?: number | undefined;
574
696
  call_id?: string | undefined;
575
- command?: string | undefined;
576
697
  exit_code?: number | null | undefined;
577
- diagnostics?: string | undefined;
578
698
  completed?: number | undefined;
579
- total?: number | undefined;
580
699
  unit?: string | undefined;
700
+ attempt?: number | undefined;
701
+ attempts?: number | undefined;
581
702
  }[];
582
703
  step_id: string;
583
- changes: Record<string, Json>;
584
- error?: string | undefined;
585
704
  inputs?: Record<string, Json> | undefined;
586
- failure?: {
587
- expected: string;
588
- phase: "check" | "input" | "action" | "environment" | "change";
589
- observed: string;
590
- evidence: string[];
591
- } | undefined;
592
705
  verification?: "checked" | "unchecked" | undefined;
593
706
  outputs?: Record<string, Json> | undefined;
594
707
  prompts?: {
@@ -600,15 +713,16 @@ export declare const InspectionSchema: z.ZodObject<{
600
713
  observed_effects?: {
601
714
  runs: string[];
602
715
  network: string[];
716
+ env: string[];
603
717
  reads: string[];
604
718
  writes: string[];
605
- env: string[];
606
719
  truncated?: true | undefined;
607
720
  } | {
608
721
  unavailable: string;
609
722
  } | undefined;
610
723
  }, {
611
- status: string;
724
+ status: "running" | "waiting_for_you" | "failed" | "returned" | "passed" | "skipped" | "stopped";
725
+ changes: Record<string, Json>;
612
726
  checks: {
613
727
  method: string;
614
728
  id: string;
@@ -621,9 +735,13 @@ export declare const InspectionSchema: z.ZodObject<{
621
735
  type: string;
622
736
  tool?: string | undefined;
623
737
  kind?: "classify" | undefined;
738
+ key?: string | undefined;
624
739
  child?: string | undefined;
625
740
  model?: string | undefined;
741
+ total?: number | undefined;
626
742
  phase?: "check" | "action" | undefined;
743
+ command?: string | undefined;
744
+ diagnostics?: string | undefined;
627
745
  provider?: string | undefined;
628
746
  request_id?: string | undefined;
629
747
  operation_id?: string | undefined;
@@ -637,23 +755,14 @@ export declare const InspectionSchema: z.ZodObject<{
637
755
  detail?: string | undefined;
638
756
  sequence?: number | undefined;
639
757
  call_id?: string | undefined;
640
- command?: string | undefined;
641
758
  exit_code?: number | null | undefined;
642
- diagnostics?: string | undefined;
643
759
  completed?: number | undefined;
644
- total?: number | undefined;
645
760
  unit?: string | undefined;
761
+ attempt?: number | undefined;
762
+ attempts?: number | undefined;
646
763
  }[];
647
764
  step_id: string;
648
- changes: Record<string, Json>;
649
- error?: string | undefined;
650
765
  inputs?: Record<string, Json> | undefined;
651
- failure?: {
652
- expected: string;
653
- phase: "check" | "input" | "action" | "environment" | "change";
654
- observed: string;
655
- evidence: string[];
656
- } | undefined;
657
766
  verification?: "checked" | "unchecked" | undefined;
658
767
  outputs?: Record<string, Json> | undefined;
659
768
  prompts?: {
@@ -665,16 +774,16 @@ export declare const InspectionSchema: z.ZodObject<{
665
774
  observed_effects?: {
666
775
  runs: string[];
667
776
  network: string[];
777
+ env: string[];
668
778
  reads: string[];
669
779
  writes: string[];
670
- env: string[];
671
780
  truncated?: true | undefined;
672
781
  } | {
673
782
  unavailable: string;
674
783
  } | undefined;
675
784
  }>>;
676
785
  }, "strict", z.ZodTypeAny, {
677
- status: string;
786
+ status: "running" | "waiting_for_you" | "succeeded" | "unconfirmed" | "failed";
678
787
  inputs: Record<string, Json>;
679
788
  schema: "workflow-inspection/2";
680
789
  workflow: import("./schema.js").CurrentWorkflow;
@@ -685,7 +794,8 @@ export declare const InspectionSchema: z.ZodObject<{
685
794
  setup?: string | undefined;
686
795
  }>;
687
796
  invocations: Record<string, {
688
- status: string;
797
+ status: "running" | "waiting_for_you" | "failed" | "returned" | "passed" | "skipped" | "stopped";
798
+ changes: Record<string, Json>;
689
799
  checks: {
690
800
  method: string;
691
801
  id: string;
@@ -698,9 +808,13 @@ export declare const InspectionSchema: z.ZodObject<{
698
808
  type: string;
699
809
  tool?: string | undefined;
700
810
  kind?: "classify" | undefined;
811
+ key?: string | undefined;
701
812
  child?: string | undefined;
702
813
  model?: string | undefined;
814
+ total?: number | undefined;
703
815
  phase?: "check" | "action" | undefined;
816
+ command?: string | undefined;
817
+ diagnostics?: string | undefined;
704
818
  provider?: string | undefined;
705
819
  request_id?: string | undefined;
706
820
  operation_id?: string | undefined;
@@ -714,23 +828,14 @@ export declare const InspectionSchema: z.ZodObject<{
714
828
  detail?: string | undefined;
715
829
  sequence?: number | undefined;
716
830
  call_id?: string | undefined;
717
- command?: string | undefined;
718
831
  exit_code?: number | null | undefined;
719
- diagnostics?: string | undefined;
720
832
  completed?: number | undefined;
721
- total?: number | undefined;
722
833
  unit?: string | undefined;
834
+ attempt?: number | undefined;
835
+ attempts?: number | undefined;
723
836
  }[];
724
837
  step_id: string;
725
- changes: Record<string, Json>;
726
- error?: string | undefined;
727
838
  inputs?: Record<string, Json> | undefined;
728
- failure?: {
729
- expected: string;
730
- phase: "check" | "input" | "action" | "environment" | "change";
731
- observed: string;
732
- evidence: string[];
733
- } | undefined;
734
839
  verification?: "checked" | "unchecked" | undefined;
735
840
  outputs?: Record<string, Json> | undefined;
736
841
  prompts?: {
@@ -742,9 +847,9 @@ export declare const InspectionSchema: z.ZodObject<{
742
847
  observed_effects?: {
743
848
  runs: string[];
744
849
  network: string[];
850
+ env: string[];
745
851
  reads: string[];
746
852
  writes: string[];
747
- env: string[];
748
853
  truncated?: true | undefined;
749
854
  } | {
750
855
  unavailable: string;
@@ -772,7 +877,6 @@ export declare const InspectionSchema: z.ZodObject<{
772
877
  entrypoint: string;
773
878
  } | undefined;
774
879
  }[] | undefined;
775
- error?: string | undefined;
776
880
  state?: Record<string, Json> | undefined;
777
881
  environment?: Record<string, {
778
882
  evidence: string[];
@@ -784,19 +888,37 @@ export declare const InspectionSchema: z.ZodObject<{
784
888
  local_run_directory?: string | undefined;
785
889
  content?: "device" | undefined;
786
890
  failure?: {
787
- expected: string;
788
- phase: "check" | "input" | "action" | "environment" | "change";
789
- observed: string;
790
- evidence: string[];
891
+ code: string;
892
+ next: {
893
+ text: string;
894
+ action: "answer" | "fix_method" | "run_again" | "raise_limit" | "fix_setup" | "report_bug";
895
+ command?: string | undefined;
896
+ };
897
+ step: string | null;
898
+ owner: "method_code" | "agent_work" | "outside_service" | "limit" | "setup" | "needs_you" | "method_platform";
899
+ headline: string;
900
+ step_name: string | null;
901
+ iteration: number | null;
902
+ failed_iterations: number[];
903
+ total: number | null;
904
+ phase: "check" | "tool" | "action" | "effect" | "setup" | null;
905
+ check_name: string | null;
906
+ evidence?: string[] | undefined;
907
+ details?: string | undefined;
908
+ diagnostics?: string | undefined;
791
909
  } | undefined;
792
910
  events?: {
793
911
  at: string;
794
912
  type: string;
795
913
  tool?: string | undefined;
796
914
  kind?: "classify" | undefined;
915
+ key?: string | undefined;
797
916
  child?: string | undefined;
798
917
  model?: string | undefined;
918
+ total?: number | undefined;
799
919
  phase?: "check" | "action" | undefined;
920
+ command?: string | undefined;
921
+ diagnostics?: string | undefined;
800
922
  provider?: string | undefined;
801
923
  request_id?: string | undefined;
802
924
  operation_id?: string | undefined;
@@ -810,15 +932,14 @@ export declare const InspectionSchema: z.ZodObject<{
810
932
  detail?: string | undefined;
811
933
  sequence?: number | undefined;
812
934
  call_id?: string | undefined;
813
- command?: string | undefined;
814
935
  exit_code?: number | null | undefined;
815
- diagnostics?: string | undefined;
816
936
  completed?: number | undefined;
817
- total?: number | undefined;
818
937
  unit?: string | undefined;
938
+ attempt?: number | undefined;
939
+ attempts?: number | undefined;
819
940
  }[] | undefined;
820
941
  }, {
821
- status: string;
942
+ status: "running" | "waiting_for_you" | "succeeded" | "unconfirmed" | "failed";
822
943
  inputs: Record<string, Json>;
823
944
  schema: "workflow-inspection/2";
824
945
  workflow: import("./schema.js").CurrentWorkflow;
@@ -829,7 +950,8 @@ export declare const InspectionSchema: z.ZodObject<{
829
950
  setup?: string | undefined;
830
951
  }>;
831
952
  invocations: Record<string, {
832
- status: string;
953
+ status: "running" | "waiting_for_you" | "failed" | "returned" | "passed" | "skipped" | "stopped";
954
+ changes: Record<string, Json>;
833
955
  checks: {
834
956
  method: string;
835
957
  id: string;
@@ -842,9 +964,13 @@ export declare const InspectionSchema: z.ZodObject<{
842
964
  type: string;
843
965
  tool?: string | undefined;
844
966
  kind?: "classify" | undefined;
967
+ key?: string | undefined;
845
968
  child?: string | undefined;
846
969
  model?: string | undefined;
970
+ total?: number | undefined;
847
971
  phase?: "check" | "action" | undefined;
972
+ command?: string | undefined;
973
+ diagnostics?: string | undefined;
848
974
  provider?: string | undefined;
849
975
  request_id?: string | undefined;
850
976
  operation_id?: string | undefined;
@@ -858,23 +984,14 @@ export declare const InspectionSchema: z.ZodObject<{
858
984
  detail?: string | undefined;
859
985
  sequence?: number | undefined;
860
986
  call_id?: string | undefined;
861
- command?: string | undefined;
862
987
  exit_code?: number | null | undefined;
863
- diagnostics?: string | undefined;
864
988
  completed?: number | undefined;
865
- total?: number | undefined;
866
989
  unit?: string | undefined;
990
+ attempt?: number | undefined;
991
+ attempts?: number | undefined;
867
992
  }[];
868
993
  step_id: string;
869
- changes: Record<string, Json>;
870
- error?: string | undefined;
871
994
  inputs?: Record<string, Json> | undefined;
872
- failure?: {
873
- expected: string;
874
- phase: "check" | "input" | "action" | "environment" | "change";
875
- observed: string;
876
- evidence: string[];
877
- } | undefined;
878
995
  verification?: "checked" | "unchecked" | undefined;
879
996
  outputs?: Record<string, Json> | undefined;
880
997
  prompts?: {
@@ -886,9 +1003,9 @@ export declare const InspectionSchema: z.ZodObject<{
886
1003
  observed_effects?: {
887
1004
  runs: string[];
888
1005
  network: string[];
1006
+ env: string[];
889
1007
  reads: string[];
890
1008
  writes: string[];
891
- env: string[];
892
1009
  truncated?: true | undefined;
893
1010
  } | {
894
1011
  unavailable: string;
@@ -916,7 +1033,6 @@ export declare const InspectionSchema: z.ZodObject<{
916
1033
  entrypoint: string;
917
1034
  } | undefined;
918
1035
  }[] | undefined;
919
- error?: string | undefined;
920
1036
  state?: Record<string, Json> | undefined;
921
1037
  environment?: Record<string, {
922
1038
  evidence: string[];
@@ -928,19 +1044,37 @@ export declare const InspectionSchema: z.ZodObject<{
928
1044
  local_run_directory?: string | undefined;
929
1045
  content?: "device" | undefined;
930
1046
  failure?: {
931
- expected: string;
932
- phase: "check" | "input" | "action" | "environment" | "change";
933
- observed: string;
934
- evidence: string[];
1047
+ code: string;
1048
+ next: {
1049
+ text: string;
1050
+ action: "answer" | "fix_method" | "run_again" | "raise_limit" | "fix_setup" | "report_bug";
1051
+ command?: string | undefined;
1052
+ };
1053
+ step: string | null;
1054
+ owner: "method_code" | "agent_work" | "outside_service" | "limit" | "setup" | "needs_you" | "method_platform";
1055
+ headline: string;
1056
+ step_name: string | null;
1057
+ iteration: number | null;
1058
+ failed_iterations: number[];
1059
+ total: number | null;
1060
+ phase: "check" | "tool" | "action" | "effect" | "setup" | null;
1061
+ check_name: string | null;
1062
+ evidence?: string[] | undefined;
1063
+ details?: string | undefined;
1064
+ diagnostics?: string | undefined;
935
1065
  } | undefined;
936
1066
  events?: {
937
1067
  at: string;
938
1068
  type: string;
939
1069
  tool?: string | undefined;
940
1070
  kind?: "classify" | undefined;
1071
+ key?: string | undefined;
941
1072
  child?: string | undefined;
942
1073
  model?: string | undefined;
1074
+ total?: number | undefined;
943
1075
  phase?: "check" | "action" | undefined;
1076
+ command?: string | undefined;
1077
+ diagnostics?: string | undefined;
944
1078
  provider?: string | undefined;
945
1079
  request_id?: string | undefined;
946
1080
  operation_id?: string | undefined;
@@ -954,12 +1088,11 @@ export declare const InspectionSchema: z.ZodObject<{
954
1088
  detail?: string | undefined;
955
1089
  sequence?: number | undefined;
956
1090
  call_id?: string | undefined;
957
- command?: string | undefined;
958
1091
  exit_code?: number | null | undefined;
959
- diagnostics?: string | undefined;
960
1092
  completed?: number | undefined;
961
- total?: number | undefined;
962
1093
  unit?: string | undefined;
1094
+ attempt?: number | undefined;
1095
+ attempts?: number | undefined;
963
1096
  }[] | undefined;
964
1097
  }>;
965
1098
  export type RunInspection = z.infer<typeof InspectionSchema>;
@@ -984,7 +1117,8 @@ export declare function inspectCatalog(workflow: Workflow): {
984
1117
  export declare function copyInstructions(step: Step, inputs?: Record<string, Json>, resources?: Record<string, unknown>): string;
985
1118
  export declare function observedValue(item: InspectItem, inspection: RunInspection, invocation?: string): Json | undefined;
986
1119
  /**
987
- * The device form of a run record (run_data: device). Keep step status, kinds, names, timing, and the phase of a failure. Remove inputs, outputs,
988
- * prompts, files, errors, and free text. The server accepts only this form when an organization keeps run content on devices.
1120
+ * The device form of a run record (run_data: device). Keep step status, kinds, names, timing, task counts, and the failure record without its
1121
+ * evidence, details, and diagnostics. Remove inputs, outputs, prompts, files, event text, and other free text. The server accepts only this
1122
+ * form when an organization keeps run content on devices.
989
1123
  */
990
1124
  export declare function deviceOnly(inspection: RunInspection): RunInspection;