@ai-dev-orchestrator/schemas 0.1.3 → 0.1.5

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.
@@ -2,6 +2,18 @@ import { z } from 'zod/v4';
2
2
  import { artifactRefSchema } from '../artifacts/artifact-system';
3
3
  import { runIdSchema } from '../shared/shared';
4
4
  import { liveRequestKindSchema, sessionTransportSchema } from '../shared/string-enums';
5
+ export const entryActionContinuationSchema = z.object({
6
+ stateId: z.string(),
7
+ completedResults: z.array(z.custom()).readonly(),
8
+ nextActionIndex: z.number().int().nonnegative(),
9
+ waitRequestingState: z.string().optional(),
10
+ completedExitResults: z.array(z.custom()).readonly().optional(),
11
+ humanFeedback: z.string().optional(),
12
+ previousReviewContent: z.string().optional(),
13
+ iterationCount: z.number().optional(),
14
+ resumeInput: z.custom().optional(),
15
+ resumeWaitingContext: z.custom().optional(),
16
+ });
5
17
  export const budgetExhaustionContextSchema = z.object({
6
18
  limitType: z.literal('token'),
7
19
  current: z.number(),
@@ -44,6 +56,10 @@ export const persistedStateSchema = z.object({
44
56
  cumulativeInputTokens: z.number().optional(),
45
57
  cumulativeOutputTokens: z.number().optional(),
46
58
  hasReceivedUsage: z.boolean().optional(),
59
+ budgetApproved: z.boolean().optional(),
60
+ executionPaused: z.boolean().optional(),
61
+ pendingTerminalState: z.string().optional(),
62
+ terminalRecoveryState: z.string().optional(),
47
63
  governanceDecisionCount: z.number().optional(),
48
64
  escalationCount: z.number().optional(),
49
65
  workerMetricsByRole: z
@@ -58,6 +74,14 @@ export const persistedStateSchema = z.object({
58
74
  dispatchCounter: z.number().optional(),
59
75
  firedThresholdIndex: z.number().optional(),
60
76
  lastHumanFeedback: z.string().optional(),
77
+ lastHumanAnswer: z
78
+ .object({
79
+ stateId: z.string(),
80
+ requestingState: z.string(),
81
+ waitingSince: z.string(),
82
+ content: z.string(),
83
+ })
84
+ .optional(),
61
85
  lastReviewContent: z.string().optional(),
62
86
  lastTrigger: z.string().optional(),
63
87
  stateTimestamps: z
@@ -70,6 +94,7 @@ export const persistedStateSchema = z.object({
70
94
  .optional(),
71
95
  /** Action results completed before a post-action budget pause. */
72
96
  interruptedActionResults: z.array(z.custom()).readonly().optional(),
97
+ entryActionContinuation: entryActionContinuationSchema.optional(),
73
98
  });
74
99
  export const stateValidationResultSchema = z.object({
75
100
  valid: z.boolean(),
@@ -82,4 +107,5 @@ export const lockHandleSchema = z.object({
82
107
  acquiredAt: z.string(),
83
108
  lockPath: z.string(),
84
109
  hostname: z.string(),
110
+ ownershipToken: z.uuid().optional(),
85
111
  });
@@ -4,6 +4,7 @@ export declare const BUILT_IN_CODING_RUNNER_ID: {
4
4
  readonly CODEX: "codex";
5
5
  readonly CURSOR: "cursor";
6
6
  readonly OPENCODE: "opencode";
7
+ readonly PI: "pi";
7
8
  };
8
9
  export type BuiltInCodingRunnerId = (typeof BUILT_IN_CODING_RUNNER_ID)[keyof typeof BUILT_IN_CODING_RUNNER_ID];
9
10
  export declare const BUILT_IN_CODING_RUNNER_IDS: readonly BuiltInCodingRunnerId[];
@@ -4,10 +4,12 @@ export const BUILT_IN_CODING_RUNNER_ID = {
4
4
  CODEX: 'codex',
5
5
  CURSOR: 'cursor',
6
6
  OPENCODE: 'opencode',
7
+ PI: 'pi',
7
8
  };
8
9
  export const BUILT_IN_CODING_RUNNER_IDS = [
9
10
  BUILT_IN_CODING_RUNNER_ID.CLAUDE_CODE,
10
11
  BUILT_IN_CODING_RUNNER_ID.CODEX,
11
12
  BUILT_IN_CODING_RUNNER_ID.CURSOR,
12
13
  BUILT_IN_CODING_RUNNER_ID.OPENCODE,
14
+ BUILT_IN_CODING_RUNNER_ID.PI,
13
15
  ];
@@ -134,6 +134,11 @@ export declare const reconnectMetaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
134
134
  authHeader: z.ZodOptional<z.ZodString>;
135
135
  }, z.core.$strip>], "type">;
136
136
  export type ReconnectMeta = z.infer<typeof reconnectMetaSchema>;
137
+ export declare const agentTokenUsageSchema: z.ZodObject<{
138
+ inputTokens: z.ZodNumber;
139
+ outputTokens: z.ZodNumber;
140
+ }, z.core.$strip>;
141
+ export type AgentTokenUsage = z.infer<typeof agentTokenUsageSchema>;
137
142
  export declare const agentSessionSnapshotSchema: z.ZodObject<{
138
143
  ref: z.ZodObject<{
139
144
  sessionId: z.ZodString;
@@ -231,6 +236,14 @@ export declare const agentSessionSnapshotSchema: z.ZodObject<{
231
236
  expiresAt: z.ZodOptional<z.ZodString>;
232
237
  workerId: z.ZodOptional<z.ZodString>;
233
238
  error: z.ZodOptional<z.ZodString>;
239
+ completion: z.ZodOptional<z.ZodObject<{
240
+ artifactContent: z.ZodString;
241
+ durationMs: z.ZodNumber;
242
+ tokenUsage: z.ZodOptional<z.ZodObject<{
243
+ inputTokens: z.ZodNumber;
244
+ outputTokens: z.ZodNumber;
245
+ }, z.core.$strip>>;
246
+ }, z.core.$strip>>;
234
247
  }, z.core.$strip>;
235
248
  export type AgentSessionSnapshot = z.infer<typeof agentSessionSnapshotSchema>;
236
249
  export declare const agentSessionHandleSchema: z.ZodObject<{
@@ -1661,11 +1674,6 @@ export declare const agentTaskSchema: z.ZodObject<{
1661
1674
  iterationCount: z.ZodOptional<z.ZodNumber>;
1662
1675
  }, z.core.$strip>;
1663
1676
  export type AgentTask = z.infer<typeof agentTaskSchema>;
1664
- export declare const agentTokenUsageSchema: z.ZodObject<{
1665
- inputTokens: z.ZodNumber;
1666
- outputTokens: z.ZodNumber;
1667
- }, z.core.$strip>;
1668
- export type AgentTokenUsage = z.infer<typeof agentTokenUsageSchema>;
1669
1677
  export declare const agentResultSchema: z.ZodObject<{
1670
1678
  taskId: z.ZodString;
1671
1679
  status: z.ZodEnum<{
@@ -78,6 +78,10 @@ export const reconnectMetaSchema = z.discriminatedUnion('type', [
78
78
  stdioReconnectMetaSchema,
79
79
  remoteReconnectMetaSchema,
80
80
  ]);
81
+ export const agentTokenUsageSchema = z.object({
82
+ inputTokens: z.number(),
83
+ outputTokens: z.number(),
84
+ });
81
85
  export const agentSessionSnapshotSchema = z.object({
82
86
  ref: agentSessionRefSchema,
83
87
  state: agentSessionStateSchema,
@@ -89,6 +93,13 @@ export const agentSessionSnapshotSchema = z.object({
89
93
  expiresAt: z.string().optional(),
90
94
  workerId: z.string().optional(),
91
95
  error: z.string().optional(),
96
+ completion: z
97
+ .object({
98
+ artifactContent: z.string(),
99
+ durationMs: z.number().nonnegative(),
100
+ tokenUsage: agentTokenUsageSchema.optional(),
101
+ })
102
+ .optional(),
92
103
  });
93
104
  export const agentSessionHandleSchema = z.object({
94
105
  ref: agentSessionRefSchema,
@@ -229,10 +240,6 @@ export const agentTaskSchema = z.object({
229
240
  previousFindings: z.string().optional(),
230
241
  iterationCount: z.number().optional(),
231
242
  });
232
- export const agentTokenUsageSchema = z.object({
233
- inputTokens: z.number(),
234
- outputTokens: z.number(),
235
- });
236
243
  export const agentResultSchema = z.object({
237
244
  taskId: z.string(),
238
245
  status: z.enum(['success', 'failure', 'timeout']),
@@ -12,8 +12,8 @@ export type StateType = z.infer<typeof stateTypeSchema>;
12
12
  export declare const TRANSITION_TRIGGERS: readonly ["completion", "failure", "review_approved", "review_rejected", "iteration_exhausted", "judge_approved", "judge_rejected", "escalation", "human_input", "human_approved", "human_rejected", "timeout"];
13
13
  export declare const transitionTriggerSchema: z.ZodEnum<{
14
14
  timeout: "timeout";
15
- failure: "failure";
16
15
  completion: "completion";
16
+ failure: "failure";
17
17
  review_approved: "review_approved";
18
18
  review_rejected: "review_rejected";
19
19
  iteration_exhausted: "iteration_exhausted";
@@ -975,8 +975,8 @@ export declare const transitionDefinitionSchema: z.ZodObject<{
975
975
  target: z.ZodString;
976
976
  trigger: z.ZodEnum<{
977
977
  timeout: "timeout";
978
- failure: "failure";
979
978
  completion: "completion";
979
+ failure: "failure";
980
980
  review_approved: "review_approved";
981
981
  review_rejected: "review_rejected";
982
982
  iteration_exhausted: "iteration_exhausted";
@@ -1688,8 +1688,8 @@ export declare const stateDefinitionSchema: z.ZodObject<{
1688
1688
  target: z.ZodString;
1689
1689
  trigger: z.ZodEnum<{
1690
1690
  timeout: "timeout";
1691
- failure: "failure";
1692
1691
  completion: "completion";
1692
+ failure: "failure";
1693
1693
  review_approved: "review_approved";
1694
1694
  review_rejected: "review_rejected";
1695
1695
  iteration_exhausted: "iteration_exhausted";
@@ -2410,8 +2410,8 @@ export declare const workflowDefinitionSchema: z.ZodObject<{
2410
2410
  target: z.ZodString;
2411
2411
  trigger: z.ZodEnum<{
2412
2412
  timeout: "timeout";
2413
- failure: "failure";
2414
2413
  completion: "completion";
2414
+ failure: "failure";
2415
2415
  review_approved: "review_approved";
2416
2416
  review_rejected: "review_rejected";
2417
2417
  iteration_exhausted: "iteration_exhausted";
@@ -2949,6 +2949,7 @@ export declare const runResultSchema: z.ZodObject<{
2949
2949
  }, z.core.$strip>>;
2950
2950
  reportPath: z.ZodOptional<z.ZodString>;
2951
2951
  }, z.core.$strip>;
2952
+ answerAccepted: z.ZodOptional<z.ZodBoolean>;
2952
2953
  }, z.core.$strip>;
2953
2954
  export type RunResult = z.infer<typeof runResultSchema>;
2954
2955
  export declare const humanInputSchema: z.ZodObject<{
@@ -2999,6 +3000,13 @@ export declare const humanInputSchema: z.ZodObject<{
2999
3000
  version: z.ZodNumber;
3000
3001
  checksum: z.ZodString;
3001
3002
  }, z.core.$strip>>;
3003
+ sessionId: z.ZodOptional<z.ZodString>;
3004
+ requestId: z.ZodOptional<z.ZodString>;
3005
+ waitIdentity: z.ZodOptional<z.ZodObject<{
3006
+ stateId: z.ZodString;
3007
+ requestingState: z.ZodString;
3008
+ waitingSince: z.ZodString;
3009
+ }, z.core.$strip>>;
3002
3010
  }, z.core.$strip>;
3003
3011
  export type HumanInput = z.infer<typeof humanInputSchema>;
3004
3012
  export declare const workflowRunConfigSchema: z.ZodObject<{
@@ -3505,8 +3513,8 @@ export declare const workflowRunConfigSchema: z.ZodObject<{
3505
3513
  target: z.ZodString;
3506
3514
  trigger: z.ZodEnum<{
3507
3515
  timeout: "timeout";
3508
- failure: "failure";
3509
3516
  completion: "completion";
3517
+ failure: "failure";
3510
3518
  review_approved: "review_approved";
3511
3519
  review_rejected: "review_rejected";
3512
3520
  iteration_exhausted: "iteration_exhausted";
@@ -4054,8 +4062,8 @@ export declare const evaluatedTransitionSchema: z.ZodObject<{
4054
4062
  target: z.ZodString;
4055
4063
  trigger: z.ZodEnum<{
4056
4064
  timeout: "timeout";
4057
- failure: "failure";
4058
4065
  completion: "completion";
4066
+ failure: "failure";
4059
4067
  review_approved: "review_approved";
4060
4068
  review_rejected: "review_rejected";
4061
4069
  iteration_exhausted: "iteration_exhausted";
@@ -4483,8 +4491,8 @@ export declare const transitionRecordSchema: z.ZodObject<{
4483
4491
  to: z.ZodString;
4484
4492
  trigger: z.ZodEnum<{
4485
4493
  timeout: "timeout";
4486
- failure: "failure";
4487
4494
  completion: "completion";
4495
+ failure: "failure";
4488
4496
  review_approved: "review_approved";
4489
4497
  review_rejected: "review_rejected";
4490
4498
  iteration_exhausted: "iteration_exhausted";
@@ -5091,6 +5099,79 @@ export declare const transitionRecordSchema: z.ZodObject<{
5091
5099
  checksum: z.ZodString;
5092
5100
  }, z.core.$strip>>;
5093
5101
  model: z.ZodOptional<z.ZodString>;
5102
+ taskId: z.ZodOptional<z.ZodString>;
5103
+ sessionOutcome: z.ZodOptional<z.ZodEnum<{
5104
+ completed: "completed";
5105
+ awaiting_human: "awaiting_human";
5106
+ session_active: "session_active";
5107
+ }>>;
5108
+ sessionRef: z.ZodOptional<z.ZodObject<{
5109
+ sessionId: z.ZodString;
5110
+ runId: z.ZodString;
5111
+ stateId: z.ZodString;
5112
+ role: z.ZodEnum<{
5113
+ judge: "judge";
5114
+ requirements_analyst: "requirements_analyst";
5115
+ context_analyst: "context_analyst";
5116
+ codebase_analyst: "codebase_analyst";
5117
+ planner: "planner";
5118
+ plan_reviewer: "plan_reviewer";
5119
+ implementer: "implementer";
5120
+ test_engineer: "test_engineer";
5121
+ static_reviewer: "static_reviewer";
5122
+ security_reviewer: "security_reviewer";
5123
+ performance_reviewer: "performance_reviewer";
5124
+ adversarial_reviewer: "adversarial_reviewer";
5125
+ design_reviewer: "design_reviewer";
5126
+ docs_reviewer: "docs_reviewer";
5127
+ ux_reviewer: "ux_reviewer";
5128
+ report_synthesizer: "report_synthesizer";
5129
+ remediation_triage: "remediation_triage";
5130
+ verifier: "verifier";
5131
+ summary_writer: "summary_writer";
5132
+ review_findings_writer: "review_findings_writer";
5133
+ acceptance_validator: "acceptance_validator";
5134
+ breakdown_analyst: "breakdown_analyst";
5135
+ decomposer: "decomposer";
5136
+ decomposition_reviewer: "decomposition_reviewer";
5137
+ task_spec_writer: "task_spec_writer";
5138
+ }>;
5139
+ transport: z.ZodEnum<{
5140
+ stdio: "stdio";
5141
+ remote: "remote";
5142
+ }>;
5143
+ }, z.core.$strip>>;
5144
+ pendingRequest: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
5145
+ requestId: z.ZodString;
5146
+ kind: z.ZodLiteral<"permission">;
5147
+ createdAt: z.ZodString;
5148
+ payload: z.ZodObject<{
5149
+ action: z.ZodString;
5150
+ resource: z.ZodString;
5151
+ detail: z.ZodOptional<z.ZodString>;
5152
+ riskLevel: z.ZodOptional<z.ZodEnum<{
5153
+ high: "high";
5154
+ medium: "medium";
5155
+ low: "low";
5156
+ }>>;
5157
+ externalRequestId: z.ZodOptional<z.ZodString>;
5158
+ toolInput: z.ZodOptional<z.ZodString>;
5159
+ granted: z.ZodOptional<z.ZodBoolean>;
5160
+ reason: z.ZodOptional<z.ZodString>;
5161
+ timedOut: z.ZodOptional<z.ZodBoolean>;
5162
+ aborted: z.ZodOptional<z.ZodBoolean>;
5163
+ }, z.core.$catchall<z.ZodUnknown>>;
5164
+ }, z.core.$strip>, z.ZodObject<{
5165
+ requestId: z.ZodString;
5166
+ kind: z.ZodLiteral<"clarification">;
5167
+ createdAt: z.ZodString;
5168
+ payload: z.ZodObject<{
5169
+ question: z.ZodString;
5170
+ context: z.ZodOptional<z.ZodString>;
5171
+ options: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
5172
+ answer: z.ZodOptional<z.ZodString>;
5173
+ }, z.core.$catchall<z.ZodUnknown>>;
5174
+ }, z.core.$strip>], "kind">>;
5094
5175
  }, z.core.$strip>>>>;
5095
5176
  usageSnapshot: z.ZodOptional<z.ZodObject<{
5096
5177
  totalInputTokens: z.ZodNumber;
@@ -5252,6 +5333,79 @@ export declare const workerResultSchema: z.ZodObject<{
5252
5333
  checksum: z.ZodString;
5253
5334
  }, z.core.$strip>>;
5254
5335
  model: z.ZodOptional<z.ZodString>;
5336
+ taskId: z.ZodOptional<z.ZodString>;
5337
+ sessionOutcome: z.ZodOptional<z.ZodEnum<{
5338
+ completed: "completed";
5339
+ awaiting_human: "awaiting_human";
5340
+ session_active: "session_active";
5341
+ }>>;
5342
+ sessionRef: z.ZodOptional<z.ZodObject<{
5343
+ sessionId: z.ZodString;
5344
+ runId: z.ZodString;
5345
+ stateId: z.ZodString;
5346
+ role: z.ZodEnum<{
5347
+ judge: "judge";
5348
+ requirements_analyst: "requirements_analyst";
5349
+ context_analyst: "context_analyst";
5350
+ codebase_analyst: "codebase_analyst";
5351
+ planner: "planner";
5352
+ plan_reviewer: "plan_reviewer";
5353
+ implementer: "implementer";
5354
+ test_engineer: "test_engineer";
5355
+ static_reviewer: "static_reviewer";
5356
+ security_reviewer: "security_reviewer";
5357
+ performance_reviewer: "performance_reviewer";
5358
+ adversarial_reviewer: "adversarial_reviewer";
5359
+ design_reviewer: "design_reviewer";
5360
+ docs_reviewer: "docs_reviewer";
5361
+ ux_reviewer: "ux_reviewer";
5362
+ report_synthesizer: "report_synthesizer";
5363
+ remediation_triage: "remediation_triage";
5364
+ verifier: "verifier";
5365
+ summary_writer: "summary_writer";
5366
+ review_findings_writer: "review_findings_writer";
5367
+ acceptance_validator: "acceptance_validator";
5368
+ breakdown_analyst: "breakdown_analyst";
5369
+ decomposer: "decomposer";
5370
+ decomposition_reviewer: "decomposition_reviewer";
5371
+ task_spec_writer: "task_spec_writer";
5372
+ }>;
5373
+ transport: z.ZodEnum<{
5374
+ stdio: "stdio";
5375
+ remote: "remote";
5376
+ }>;
5377
+ }, z.core.$strip>>;
5378
+ pendingRequest: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
5379
+ requestId: z.ZodString;
5380
+ kind: z.ZodLiteral<"permission">;
5381
+ createdAt: z.ZodString;
5382
+ payload: z.ZodObject<{
5383
+ action: z.ZodString;
5384
+ resource: z.ZodString;
5385
+ detail: z.ZodOptional<z.ZodString>;
5386
+ riskLevel: z.ZodOptional<z.ZodEnum<{
5387
+ high: "high";
5388
+ medium: "medium";
5389
+ low: "low";
5390
+ }>>;
5391
+ externalRequestId: z.ZodOptional<z.ZodString>;
5392
+ toolInput: z.ZodOptional<z.ZodString>;
5393
+ granted: z.ZodOptional<z.ZodBoolean>;
5394
+ reason: z.ZodOptional<z.ZodString>;
5395
+ timedOut: z.ZodOptional<z.ZodBoolean>;
5396
+ aborted: z.ZodOptional<z.ZodBoolean>;
5397
+ }, z.core.$catchall<z.ZodUnknown>>;
5398
+ }, z.core.$strip>, z.ZodObject<{
5399
+ requestId: z.ZodString;
5400
+ kind: z.ZodLiteral<"clarification">;
5401
+ createdAt: z.ZodString;
5402
+ payload: z.ZodObject<{
5403
+ question: z.ZodString;
5404
+ context: z.ZodOptional<z.ZodString>;
5405
+ options: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
5406
+ answer: z.ZodOptional<z.ZodString>;
5407
+ }, z.core.$catchall<z.ZodUnknown>>;
5408
+ }, z.core.$strip>], "kind">>;
5255
5409
  }, z.core.$strip>;
5256
5410
  export type WorkerResult = z.infer<typeof workerResultSchema>;
5257
5411
  export declare const actionUsageSnapshotSchema: z.ZodObject<{
@@ -5681,6 +5835,79 @@ export declare const actionResultSchema: z.ZodObject<{
5681
5835
  checksum: z.ZodString;
5682
5836
  }, z.core.$strip>>;
5683
5837
  model: z.ZodOptional<z.ZodString>;
5838
+ taskId: z.ZodOptional<z.ZodString>;
5839
+ sessionOutcome: z.ZodOptional<z.ZodEnum<{
5840
+ completed: "completed";
5841
+ awaiting_human: "awaiting_human";
5842
+ session_active: "session_active";
5843
+ }>>;
5844
+ sessionRef: z.ZodOptional<z.ZodObject<{
5845
+ sessionId: z.ZodString;
5846
+ runId: z.ZodString;
5847
+ stateId: z.ZodString;
5848
+ role: z.ZodEnum<{
5849
+ judge: "judge";
5850
+ requirements_analyst: "requirements_analyst";
5851
+ context_analyst: "context_analyst";
5852
+ codebase_analyst: "codebase_analyst";
5853
+ planner: "planner";
5854
+ plan_reviewer: "plan_reviewer";
5855
+ implementer: "implementer";
5856
+ test_engineer: "test_engineer";
5857
+ static_reviewer: "static_reviewer";
5858
+ security_reviewer: "security_reviewer";
5859
+ performance_reviewer: "performance_reviewer";
5860
+ adversarial_reviewer: "adversarial_reviewer";
5861
+ design_reviewer: "design_reviewer";
5862
+ docs_reviewer: "docs_reviewer";
5863
+ ux_reviewer: "ux_reviewer";
5864
+ report_synthesizer: "report_synthesizer";
5865
+ remediation_triage: "remediation_triage";
5866
+ verifier: "verifier";
5867
+ summary_writer: "summary_writer";
5868
+ review_findings_writer: "review_findings_writer";
5869
+ acceptance_validator: "acceptance_validator";
5870
+ breakdown_analyst: "breakdown_analyst";
5871
+ decomposer: "decomposer";
5872
+ decomposition_reviewer: "decomposition_reviewer";
5873
+ task_spec_writer: "task_spec_writer";
5874
+ }>;
5875
+ transport: z.ZodEnum<{
5876
+ stdio: "stdio";
5877
+ remote: "remote";
5878
+ }>;
5879
+ }, z.core.$strip>>;
5880
+ pendingRequest: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
5881
+ requestId: z.ZodString;
5882
+ kind: z.ZodLiteral<"permission">;
5883
+ createdAt: z.ZodString;
5884
+ payload: z.ZodObject<{
5885
+ action: z.ZodString;
5886
+ resource: z.ZodString;
5887
+ detail: z.ZodOptional<z.ZodString>;
5888
+ riskLevel: z.ZodOptional<z.ZodEnum<{
5889
+ high: "high";
5890
+ medium: "medium";
5891
+ low: "low";
5892
+ }>>;
5893
+ externalRequestId: z.ZodOptional<z.ZodString>;
5894
+ toolInput: z.ZodOptional<z.ZodString>;
5895
+ granted: z.ZodOptional<z.ZodBoolean>;
5896
+ reason: z.ZodOptional<z.ZodString>;
5897
+ timedOut: z.ZodOptional<z.ZodBoolean>;
5898
+ aborted: z.ZodOptional<z.ZodBoolean>;
5899
+ }, z.core.$catchall<z.ZodUnknown>>;
5900
+ }, z.core.$strip>, z.ZodObject<{
5901
+ requestId: z.ZodString;
5902
+ kind: z.ZodLiteral<"clarification">;
5903
+ createdAt: z.ZodString;
5904
+ payload: z.ZodObject<{
5905
+ question: z.ZodString;
5906
+ context: z.ZodOptional<z.ZodString>;
5907
+ options: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
5908
+ answer: z.ZodOptional<z.ZodString>;
5909
+ }, z.core.$catchall<z.ZodUnknown>>;
5910
+ }, z.core.$strip>], "kind">>;
5684
5911
  }, z.core.$strip>>>>;
5685
5912
  usageSnapshot: z.ZodOptional<z.ZodObject<{
5686
5913
  totalInputTokens: z.ZodNumber;
@@ -303,11 +303,21 @@ export const runResultSchema = z.object({
303
303
  finalState: z.string(),
304
304
  artifactInventory: z.array(artifactRefSchema).readonly(),
305
305
  manifest: runManifestSchema,
306
+ answerAccepted: z.boolean().optional(),
306
307
  });
307
308
  export const humanInputSchema = z.object({
308
309
  type: z.enum(['text', 'approval', 'rejection']),
309
310
  content: z.string(),
310
311
  artifactRef: artifactRefSchema.optional(),
312
+ sessionId: z.string().min(1).optional(),
313
+ requestId: z.string().min(1).optional(),
314
+ waitIdentity: z
315
+ .object({
316
+ stateId: z.string(),
317
+ requestingState: z.string(),
318
+ waitingSince: z.string(),
319
+ })
320
+ .optional(),
311
321
  });
312
322
  export const workflowRunConfigSchema = z.object({
313
323
  runId: z.string(),
@@ -369,6 +379,10 @@ export const workerResultSchema = z.object({
369
379
  errorType: workerErrorTypeSchema.optional(),
370
380
  artifactRef: artifactRefSchema.optional(),
371
381
  model: z.string().optional(),
382
+ taskId: z.string().optional(),
383
+ sessionOutcome: sessionDispatchOutcomeSchema.optional(),
384
+ sessionRef: agentSessionRefSchema.optional(),
385
+ pendingRequest: sessionPendingRequestSchema.optional(),
372
386
  });
373
387
  export const actionUsageSnapshotSchema = z.object({
374
388
  totalInputTokens: z.number(),
@@ -167,8 +167,8 @@ export declare const workflowSchema: z.ZodObject<{
167
167
  target: z.ZodString;
168
168
  trigger: z.ZodEnum<{
169
169
  timeout: "timeout";
170
- failure: "failure";
171
170
  completion: "completion";
171
+ failure: "failure";
172
172
  review_approved: "review_approved";
173
173
  review_rejected: "review_rejected";
174
174
  iteration_exhausted: "iteration_exhausted";