@selleragent/api-contract 0.7.0 → 0.9.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.
package/dist/runtime.d.ts CHANGED
@@ -1,3 +1,22 @@
1
+ /**
2
+ * Canonical runtime contracts for strategies, analysis, structured decisions,
3
+ * traces, media discovery and review outputs.
4
+ *
5
+ * @epic EP-005
6
+ * @epic EP-013
7
+ * @feature FT-005-01
8
+ * @feature FT-005-07
9
+ * @feature FT-013-04
10
+ * @feature FT-013-05
11
+ * @spec SPEC-001
12
+ * @spec SPEC-007
13
+ * @spec SPEC-015
14
+ * @docs .memory-bank/spec/runtime/decision-envelope.md
15
+ * @docs .memory-bank/spec/runtime/strategy-runtime-system.md
16
+ * @docs .memory-bank/spec/runtime/turn-analysis-contract.md
17
+ * @docs .memory-bank/plans/protocols/PRT-005-runtime-decision-contract-simplification-and-fail-safe-customer-reply.md
18
+ * @docs .memory-bank/plans/protocols/PRT-006-multi-strategy-scoring-bounded-runtime-step-loop-and-cacheable-context.md
19
+ */
1
20
  import { z } from 'zod';
2
21
  export declare const runtimeDocKindSchema: z.ZodEnum<{
3
22
  strategy: "strategy";
@@ -26,6 +45,7 @@ export declare const runtimeGenerationModeSchema: z.ZodEnum<{
26
45
  export declare const runtimeGenerationStageSchema: z.ZodEnum<{
27
46
  turn_analyze: "turn_analyze";
28
47
  turn_decide: "turn_decide";
48
+ verify_outcome: "verify_outcome";
29
49
  review_artifact: "review_artifact";
30
50
  review_message: "review_message";
31
51
  }>;
@@ -37,6 +57,17 @@ export declare const runtimeGenerationAttemptStatusSchema: z.ZodEnum<{
37
57
  succeeded: "succeeded";
38
58
  failed: "failed";
39
59
  }>;
60
+ export declare const runtimeValidationLayerSchema: z.ZodEnum<{
61
+ configuration: "configuration";
62
+ provider: "provider";
63
+ schema_parse: "schema_parse";
64
+ protocol_validation: "protocol_validation";
65
+ verifier: "verifier";
66
+ }>;
67
+ export declare const runtimeProviderAttemptStatusSchema: z.ZodEnum<{
68
+ succeeded: "succeeded";
69
+ failed: "failed";
70
+ }>;
40
71
  export declare const runtimeReplyToneSchema: z.ZodEnum<{
41
72
  concise: "concise";
42
73
  standard: "standard";
@@ -87,21 +118,19 @@ export declare const cartPatchOperationTypeSchema: z.ZodEnum<{
87
118
  export declare const strategyCardSchema: z.ZodObject<{
88
119
  id: z.ZodString;
89
120
  title: z.ZodString;
90
- intentTags: z.ZodDefault<z.ZodArray<z.ZodString>>;
91
- whenToUse: z.ZodDefault<z.ZodArray<z.ZodString>>;
92
- whenNotToUse: z.ZodDefault<z.ZodArray<z.ZodString>>;
93
- forbiddenMoves: z.ZodDefault<z.ZodArray<z.ZodString>>;
94
- expectedOutcome: z.ZodString;
121
+ summary: z.ZodString;
95
122
  }, z.core.$strip>;
96
123
  export type StrategyCard = z.infer<typeof strategyCardSchema>;
97
124
  export declare const strategyDocumentSchema: z.ZodObject<{
98
125
  id: z.ZodString;
99
126
  title: z.ZodString;
127
+ summary: z.ZodString;
128
+ body: z.ZodString;
129
+ forbiddenMoves: z.ZodDefault<z.ZodArray<z.ZodString>>;
100
130
  intentTags: z.ZodDefault<z.ZodArray<z.ZodString>>;
101
131
  whenToUse: z.ZodDefault<z.ZodArray<z.ZodString>>;
102
132
  whenNotToUse: z.ZodDefault<z.ZodArray<z.ZodString>>;
103
- forbiddenMoves: z.ZodDefault<z.ZodArray<z.ZodString>>;
104
- expectedOutcome: z.ZodString;
133
+ expectedOutcome: z.ZodDefault<z.ZodString>;
105
134
  walkthrough: z.ZodDefault<z.ZodArray<z.ZodString>>;
106
135
  phrasingGuidance: z.ZodDefault<z.ZodArray<z.ZodString>>;
107
136
  exits: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -111,6 +140,12 @@ export declare const strategyDocumentSchema: z.ZodObject<{
111
140
  metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
112
141
  }, z.core.$strip>;
113
142
  export type StrategyDocument = z.infer<typeof strategyDocumentSchema>;
143
+ export declare const policyDocumentSchema: z.ZodObject<{
144
+ id: z.ZodString;
145
+ title: z.ZodString;
146
+ body: z.ZodString;
147
+ }, z.core.$strip>;
148
+ export type PolicyDocument = z.infer<typeof policyDocumentSchema>;
114
149
  export declare const retrievedDocRefSchema: z.ZodObject<{
115
150
  docId: z.ZodString;
116
151
  kind: z.ZodEnum<{
@@ -136,6 +171,12 @@ export declare const decisionClassificationSchema: z.ZodObject<{
136
171
  riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
137
172
  }, z.core.$strip>;
138
173
  export type DecisionClassification = z.infer<typeof decisionClassificationSchema>;
174
+ export declare const strategyMatchSchema: z.ZodObject<{
175
+ strategyId: z.ZodString;
176
+ score: z.ZodNumber;
177
+ reason: z.ZodString;
178
+ }, z.core.$strip>;
179
+ export type StrategyMatch = z.infer<typeof strategyMatchSchema>;
139
180
  export declare const runtimePromptMetaSchema: z.ZodObject<{
140
181
  promptId: z.ZodString;
141
182
  family: z.ZodString;
@@ -144,16 +185,45 @@ export declare const runtimePromptMetaSchema: z.ZodObject<{
144
185
  renderedHash: z.ZodString;
145
186
  }, z.core.$strip>;
146
187
  export type RuntimePromptMeta = z.infer<typeof runtimePromptMetaSchema>;
188
+ export declare const runtimePromptDebugPayloadSchema: z.ZodObject<{
189
+ system: z.ZodString;
190
+ user: z.ZodString;
191
+ context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
192
+ templateRefs: z.ZodDefault<z.ZodNullable<z.ZodObject<{
193
+ systemTemplate: z.ZodString;
194
+ userTemplate: z.ZodString;
195
+ partials: z.ZodDefault<z.ZodArray<z.ZodString>>;
196
+ }, z.core.$strip>>>;
197
+ }, z.core.$strip>;
198
+ export type RuntimePromptDebugPayload = z.infer<typeof runtimePromptDebugPayloadSchema>;
147
199
  export declare const runtimeUsageSchema: z.ZodObject<{
148
200
  inputTokens: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
149
201
  outputTokens: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
150
202
  totalTokens: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
151
203
  }, z.core.$strip>;
152
204
  export type RuntimeUsage = z.infer<typeof runtimeUsageSchema>;
205
+ export declare const runtimeProviderAttemptSchema: z.ZodObject<{
206
+ provider: z.ZodString;
207
+ modelId: z.ZodString;
208
+ attemptNumber: z.ZodNumber;
209
+ status: z.ZodEnum<{
210
+ succeeded: "succeeded";
211
+ failed: "failed";
212
+ }>;
213
+ startedAt: z.ZodString;
214
+ finishedAt: z.ZodString;
215
+ latencyMs: z.ZodNumber;
216
+ retryable: z.ZodDefault<z.ZodBoolean>;
217
+ failureCategory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
218
+ errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
219
+ backoffMs: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
220
+ }, z.core.$strip>;
221
+ export type RuntimeProviderAttempt = z.infer<typeof runtimeProviderAttemptSchema>;
153
222
  export declare const runtimeGenerationAttemptSchema: z.ZodObject<{
154
223
  stage: z.ZodEnum<{
155
224
  turn_analyze: "turn_analyze";
156
225
  turn_decide: "turn_decide";
226
+ verify_outcome: "verify_outcome";
157
227
  review_artifact: "review_artifact";
158
228
  review_message: "review_message";
159
229
  }>;
@@ -173,6 +243,16 @@ export declare const runtimeGenerationAttemptSchema: z.ZodObject<{
173
243
  semanticVersion: z.ZodString;
174
244
  renderedHash: z.ZodString;
175
245
  }, z.core.$strip>;
246
+ promptDebug: z.ZodDefault<z.ZodNullable<z.ZodObject<{
247
+ system: z.ZodString;
248
+ user: z.ZodString;
249
+ context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
250
+ templateRefs: z.ZodDefault<z.ZodNullable<z.ZodObject<{
251
+ systemTemplate: z.ZodString;
252
+ userTemplate: z.ZodString;
253
+ partials: z.ZodDefault<z.ZodArray<z.ZodString>>;
254
+ }, z.core.$strip>>>;
255
+ }, z.core.$strip>>>;
176
256
  provider: z.ZodString;
177
257
  modelId: z.ZodString;
178
258
  finishReason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -182,15 +262,61 @@ export declare const runtimeGenerationAttemptSchema: z.ZodObject<{
182
262
  totalTokens: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
183
263
  }, z.core.$strip>>>;
184
264
  latencyMs: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
265
+ providerAttemptCount: z.ZodDefault<z.ZodNumber>;
266
+ providerRetryCount: z.ZodDefault<z.ZodNumber>;
267
+ providerAttempts: z.ZodDefault<z.ZodArray<z.ZodObject<{
268
+ provider: z.ZodString;
269
+ modelId: z.ZodString;
270
+ attemptNumber: z.ZodNumber;
271
+ status: z.ZodEnum<{
272
+ succeeded: "succeeded";
273
+ failed: "failed";
274
+ }>;
275
+ startedAt: z.ZodString;
276
+ finishedAt: z.ZodString;
277
+ latencyMs: z.ZodNumber;
278
+ retryable: z.ZodDefault<z.ZodBoolean>;
279
+ failureCategory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
280
+ errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
281
+ backoffMs: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
282
+ }, z.core.$strip>>>;
283
+ validationLayer: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
284
+ configuration: "configuration";
285
+ provider: "provider";
286
+ schema_parse: "schema_parse";
287
+ protocol_validation: "protocol_validation";
288
+ verifier: "verifier";
289
+ }>>>;
185
290
  retryContext: z.ZodDefault<z.ZodNullable<z.ZodObject<{
186
291
  priorAttemptNumber: z.ZodNumber;
187
292
  errorSummary: z.ZodString;
188
293
  validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
294
+ priorFailures: z.ZodDefault<z.ZodArray<z.ZodObject<{
295
+ attemptNumber: z.ZodNumber;
296
+ errorSummary: z.ZodString;
297
+ validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
298
+ }, z.core.$strip>>>;
189
299
  }, z.core.$strip>>>;
190
300
  validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
191
301
  errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
302
+ rawOutput: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
192
303
  }, z.core.$strip>;
193
304
  export type RuntimeGenerationAttempt = z.infer<typeof runtimeGenerationAttemptSchema>;
305
+ export declare const runtimeExecutionProfileSchema: z.ZodObject<{
306
+ totalRuntimeMs: z.ZodDefault<z.ZodNumber>;
307
+ analysisMs: z.ZodDefault<z.ZodNumber>;
308
+ decisionMs: z.ZodDefault<z.ZodNumber>;
309
+ reviewMs: z.ZodDefault<z.ZodNumber>;
310
+ generationAttemptCount: z.ZodDefault<z.ZodNumber>;
311
+ correctiveRetryCount: z.ZodDefault<z.ZodNumber>;
312
+ failedAttemptCount: z.ZodDefault<z.ZodNumber>;
313
+ providerAttemptCount: z.ZodDefault<z.ZodNumber>;
314
+ providerRetryCount: z.ZodDefault<z.ZodNumber>;
315
+ validationIssueCount: z.ZodDefault<z.ZodNumber>;
316
+ slowestStage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
317
+ slowestAttemptLatencyMs: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
318
+ }, z.core.$strip>;
319
+ export type RuntimeExecutionProfile = z.infer<typeof runtimeExecutionProfileSchema>;
194
320
  export declare const runtimePackedTranscriptMessageSchema: z.ZodObject<{
195
321
  messageId: z.ZodString;
196
322
  authorKind: z.ZodEnum<{
@@ -354,8 +480,50 @@ export declare const messageReviewOutputSchema: z.ZodObject<{
354
480
  notes: z.ZodDefault<z.ZodArray<z.ZodString>>;
355
481
  }, z.core.$strip>;
356
482
  export type MessageReviewOutput = z.infer<typeof messageReviewOutputSchema>;
483
+ export declare const runtimeVerificationIssueTypeSchema: z.ZodEnum<{
484
+ policy_violation: "policy_violation";
485
+ asset_reference_invalid: "asset_reference_invalid";
486
+ cart_state_mismatch: "cart_state_mismatch";
487
+ arithmetic_error: "arithmetic_error";
488
+ required_step_missing: "required_step_missing";
489
+ }>;
490
+ export type RuntimeVerificationIssueType = z.infer<typeof runtimeVerificationIssueTypeSchema>;
491
+ export declare const runtimeVerificationIssueSchema: z.ZodObject<{
492
+ type: z.ZodEnum<{
493
+ policy_violation: "policy_violation";
494
+ asset_reference_invalid: "asset_reference_invalid";
495
+ cart_state_mismatch: "cart_state_mismatch";
496
+ arithmetic_error: "arithmetic_error";
497
+ required_step_missing: "required_step_missing";
498
+ }>;
499
+ message: z.ZodString;
500
+ }, z.core.$strip>;
501
+ export type RuntimeVerificationIssue = z.infer<typeof runtimeVerificationIssueSchema>;
502
+ export declare const runtimeVerificationOutputSchema: z.ZodObject<{
503
+ status: z.ZodEnum<{
504
+ failed: "failed";
505
+ passed: "passed";
506
+ }>;
507
+ blockingIssues: z.ZodDefault<z.ZodArray<z.ZodObject<{
508
+ type: z.ZodEnum<{
509
+ policy_violation: "policy_violation";
510
+ asset_reference_invalid: "asset_reference_invalid";
511
+ cart_state_mismatch: "cart_state_mismatch";
512
+ arithmetic_error: "arithmetic_error";
513
+ required_step_missing: "required_step_missing";
514
+ }>;
515
+ message: z.ZodString;
516
+ }, z.core.$strip>>>;
517
+ remarks: z.ZodDefault<z.ZodArray<z.ZodString>>;
518
+ }, z.core.$strip>;
519
+ export type RuntimeVerificationOutput = z.infer<typeof runtimeVerificationOutputSchema>;
357
520
  export declare const turnAnalysisSchema: z.ZodObject<{
358
- classification: z.ZodObject<{
521
+ strategyMatches: z.ZodArray<z.ZodObject<{
522
+ strategyId: z.ZodString;
523
+ score: z.ZodNumber;
524
+ reason: z.ZodString;
525
+ }, z.core.$strip>>;
526
+ classification: z.ZodOptional<z.ZodObject<{
359
527
  primaryIntent: z.ZodString;
360
528
  secondaryIntents: z.ZodDefault<z.ZodArray<z.ZodString>>;
361
529
  readiness: z.ZodEnum<{
@@ -366,25 +534,8 @@ export declare const turnAnalysisSchema: z.ZodObject<{
366
534
  emotion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
367
535
  confidence: z.ZodNumber;
368
536
  riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
369
- }, z.core.$strip>;
370
- strategy: z.ZodObject<{
371
- selectedId: z.ZodString;
372
- candidateIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
373
- rationaleSummary: z.ZodString;
374
- }, z.core.$strip>;
375
- customerGoal: z.ZodString;
376
- relevantProductCodes: z.ZodDefault<z.ZodArray<z.ZodString>>;
377
- relevantPolicyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
378
- missingFacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
379
- handoffSuggested: z.ZodObject<{
380
- needed: z.ZodBoolean;
381
- reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
382
- priority: z.ZodDefault<z.ZodEnum<{
383
- normal: "normal";
384
- urgent: "urgent";
385
- }>>;
386
- }, z.core.$strip>;
387
- replyGoal: z.ZodString;
537
+ }, z.core.$strip>>;
538
+ relevantProductCodes: z.ZodOptional<z.ZodArray<z.ZodString>>;
388
539
  }, z.core.$strip>;
389
540
  export type TurnAnalysis = z.infer<typeof turnAnalysisSchema>;
390
541
  export declare const runtimeOutboundSendTextStepSchema: z.ZodObject<{
@@ -561,6 +712,208 @@ export declare const cartPatchOperationSchema: z.ZodObject<{
561
712
  payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
562
713
  }, z.core.$strip>;
563
714
  export type CartPatchOperation = z.infer<typeof cartPatchOperationSchema>;
715
+ export declare const runtimeNextStepTypeSchema: z.ZodEnum<{
716
+ request_media_folders: "request_media_folders";
717
+ request_media_folder_contents: "request_media_folder_contents";
718
+ "handoff.request": "handoff.request";
719
+ "state.cart.apply_operations": "state.cart.apply_operations";
720
+ "channel.send_messages": "channel.send_messages";
721
+ }>;
722
+ export type RuntimeNextStepType = z.infer<typeof runtimeNextStepTypeSchema>;
723
+ export declare const runtimeNextStepRequestMediaFoldersSchema: z.ZodObject<{
724
+ stepType: z.ZodLiteral<"request_media_folders">;
725
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
726
+ desiredKinds: z.ZodDefault<z.ZodArray<z.ZodEnum<{
727
+ image: "image";
728
+ document: "document";
729
+ link: "link";
730
+ deck: "deck";
731
+ }>>>;
732
+ topicHint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
733
+ }, z.core.$strip>;
734
+ export declare const runtimeNextStepRequestMediaFolderContentsSchema: z.ZodObject<{
735
+ stepType: z.ZodLiteral<"request_media_folder_contents">;
736
+ folderKey: z.ZodString;
737
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
738
+ limit: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
739
+ }, z.core.$strip>;
740
+ export declare const runtimeNextStepUpdateCartSchema: z.ZodObject<{
741
+ stepType: z.ZodLiteral<"state.cart.apply_operations">;
742
+ operations: z.ZodArray<z.ZodObject<{
743
+ type: z.ZodEnum<{
744
+ ensure_base_product: "ensure_base_product";
745
+ attach_product: "attach_product";
746
+ }>;
747
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
748
+ }, z.core.$strip>>;
749
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
750
+ }, z.core.$strip>;
751
+ export declare const runtimeNextStepHandoffSchema: z.ZodObject<{
752
+ stepType: z.ZodLiteral<"handoff.request">;
753
+ operatorSummary: z.ZodString;
754
+ customerMessage: z.ZodString;
755
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
756
+ priority: z.ZodDefault<z.ZodEnum<{
757
+ normal: "normal";
758
+ urgent: "urgent";
759
+ }>>;
760
+ }, z.core.$strip>;
761
+ export declare const runtimeChannelSendTextMessageSchema: z.ZodObject<{
762
+ kind: z.ZodLiteral<"text">;
763
+ text: z.ZodString;
764
+ }, z.core.$strip>;
765
+ export declare const runtimeChannelSendMediaMessageSchema: z.ZodObject<{
766
+ kind: z.ZodLiteral<"media">;
767
+ assetId: z.ZodString;
768
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
769
+ }, z.core.$strip>;
770
+ export declare const runtimeChannelSendMediaGroupMessageSchema: z.ZodObject<{
771
+ kind: z.ZodLiteral<"media_group">;
772
+ assetIds: z.ZodArray<z.ZodString>;
773
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
774
+ }, z.core.$strip>;
775
+ export declare const runtimeChannelSendDocumentMessageSchema: z.ZodObject<{
776
+ kind: z.ZodLiteral<"document">;
777
+ assetId: z.ZodString;
778
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
779
+ }, z.core.$strip>;
780
+ export declare const runtimeChannelSendLinkMessageSchema: z.ZodObject<{
781
+ kind: z.ZodLiteral<"link">;
782
+ assetId: z.ZodString;
783
+ text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
784
+ }, z.core.$strip>;
785
+ export declare const runtimeChannelSendMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
786
+ kind: z.ZodLiteral<"text">;
787
+ text: z.ZodString;
788
+ }, z.core.$strip>, z.ZodObject<{
789
+ kind: z.ZodLiteral<"media">;
790
+ assetId: z.ZodString;
791
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
792
+ }, z.core.$strip>, z.ZodObject<{
793
+ kind: z.ZodLiteral<"media_group">;
794
+ assetIds: z.ZodArray<z.ZodString>;
795
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
796
+ }, z.core.$strip>, z.ZodObject<{
797
+ kind: z.ZodLiteral<"document">;
798
+ assetId: z.ZodString;
799
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
800
+ }, z.core.$strip>, z.ZodObject<{
801
+ kind: z.ZodLiteral<"link">;
802
+ assetId: z.ZodString;
803
+ text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
804
+ }, z.core.$strip>], "kind">;
805
+ export type RuntimeChannelSendMessage = z.infer<typeof runtimeChannelSendMessageSchema>;
806
+ export declare const runtimeNextStepChannelSendMessagesSchema: z.ZodObject<{
807
+ stepType: z.ZodLiteral<"channel.send_messages">;
808
+ messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
809
+ kind: z.ZodLiteral<"text">;
810
+ text: z.ZodString;
811
+ }, z.core.$strip>, z.ZodObject<{
812
+ kind: z.ZodLiteral<"media">;
813
+ assetId: z.ZodString;
814
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
815
+ }, z.core.$strip>, z.ZodObject<{
816
+ kind: z.ZodLiteral<"media_group">;
817
+ assetIds: z.ZodArray<z.ZodString>;
818
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
819
+ }, z.core.$strip>, z.ZodObject<{
820
+ kind: z.ZodLiteral<"document">;
821
+ assetId: z.ZodString;
822
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
823
+ }, z.core.$strip>, z.ZodObject<{
824
+ kind: z.ZodLiteral<"link">;
825
+ assetId: z.ZodString;
826
+ text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
827
+ }, z.core.$strip>], "kind">>;
828
+ }, z.core.$strip>;
829
+ export declare const runtimeNextStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
830
+ stepType: z.ZodLiteral<"request_media_folders">;
831
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
832
+ desiredKinds: z.ZodDefault<z.ZodArray<z.ZodEnum<{
833
+ image: "image";
834
+ document: "document";
835
+ link: "link";
836
+ deck: "deck";
837
+ }>>>;
838
+ topicHint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
839
+ }, z.core.$strip>, z.ZodObject<{
840
+ stepType: z.ZodLiteral<"request_media_folder_contents">;
841
+ folderKey: z.ZodString;
842
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
843
+ limit: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
844
+ }, z.core.$strip>, z.ZodObject<{
845
+ stepType: z.ZodLiteral<"state.cart.apply_operations">;
846
+ operations: z.ZodArray<z.ZodObject<{
847
+ type: z.ZodEnum<{
848
+ ensure_base_product: "ensure_base_product";
849
+ attach_product: "attach_product";
850
+ }>;
851
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
852
+ }, z.core.$strip>>;
853
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
854
+ }, z.core.$strip>, z.ZodObject<{
855
+ stepType: z.ZodLiteral<"handoff.request">;
856
+ operatorSummary: z.ZodString;
857
+ customerMessage: z.ZodString;
858
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
859
+ priority: z.ZodDefault<z.ZodEnum<{
860
+ normal: "normal";
861
+ urgent: "urgent";
862
+ }>>;
863
+ }, z.core.$strip>, z.ZodObject<{
864
+ stepType: z.ZodLiteral<"channel.send_messages">;
865
+ messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
866
+ kind: z.ZodLiteral<"text">;
867
+ text: z.ZodString;
868
+ }, z.core.$strip>, z.ZodObject<{
869
+ kind: z.ZodLiteral<"media">;
870
+ assetId: z.ZodString;
871
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
872
+ }, z.core.$strip>, z.ZodObject<{
873
+ kind: z.ZodLiteral<"media_group">;
874
+ assetIds: z.ZodArray<z.ZodString>;
875
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
876
+ }, z.core.$strip>, z.ZodObject<{
877
+ kind: z.ZodLiteral<"document">;
878
+ assetId: z.ZodString;
879
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
880
+ }, z.core.$strip>, z.ZodObject<{
881
+ kind: z.ZodLiteral<"link">;
882
+ assetId: z.ZodString;
883
+ text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
884
+ }, z.core.$strip>], "kind">>;
885
+ }, z.core.$strip>], "stepType">;
886
+ export type RuntimeNextStep = z.infer<typeof runtimeNextStepSchema>;
887
+ export declare const runtimeStepHistoryEntrySchema: z.ZodObject<{
888
+ stepId: z.ZodString;
889
+ stepType: z.ZodEnum<{
890
+ request_media_folders: "request_media_folders";
891
+ request_media_folder_contents: "request_media_folder_contents";
892
+ "handoff.request": "handoff.request";
893
+ "state.cart.apply_operations": "state.cart.apply_operations";
894
+ "channel.send_messages": "channel.send_messages";
895
+ }>;
896
+ status: z.ZodEnum<{
897
+ failed: "failed";
898
+ served: "served";
899
+ executed: "executed";
900
+ rejected: "rejected";
901
+ }>;
902
+ inputSummary: z.ZodString;
903
+ resultSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
904
+ errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
905
+ changedStateSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
906
+ startedAt: z.ZodString;
907
+ finishedAt: z.ZodString;
908
+ }, z.core.$strip>;
909
+ export type RuntimeStepHistoryEntry = z.infer<typeof runtimeStepHistoryEntrySchema>;
910
+ export declare const runtimePromptCacheMetadataSchema: z.ZodObject<{
911
+ cacheablePrefixHash: z.ZodString;
912
+ volatileTailHash: z.ZodString;
913
+ cacheKey: z.ZodString;
914
+ cacheHit: z.ZodDefault<z.ZodBoolean>;
915
+ }, z.core.$strip>;
916
+ export type RuntimePromptCacheMetadata = z.infer<typeof runtimePromptCacheMetadataSchema>;
564
917
  export declare const decisionEnvelopeSchema: z.ZodObject<{
565
918
  reply: z.ZodObject<{
566
919
  text: z.ZodString;
@@ -609,7 +962,7 @@ export declare const decisionEnvelopeSchema: z.ZodObject<{
609
962
  text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
610
963
  }, z.core.$strip>], "type">>;
611
964
  }, z.core.$strip>>>;
612
- classification: z.ZodObject<{
965
+ classification: z.ZodOptional<z.ZodObject<{
613
966
  primaryIntent: z.ZodString;
614
967
  secondaryIntents: z.ZodDefault<z.ZodArray<z.ZodString>>;
615
968
  readiness: z.ZodEnum<{
@@ -620,7 +973,7 @@ export declare const decisionEnvelopeSchema: z.ZodObject<{
620
973
  emotion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
621
974
  confidence: z.ZodNumber;
622
975
  riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
623
- }, z.core.$strip>;
976
+ }, z.core.$strip>>;
624
977
  strategy: z.ZodObject<{
625
978
  selectedId: z.ZodString;
626
979
  candidateIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -667,238 +1020,265 @@ export declare const decisionEnvelopeSchema: z.ZodObject<{
667
1020
  }, z.core.$strip>>>;
668
1021
  }, z.core.$strip>;
669
1022
  export type DecisionEnvelope = z.infer<typeof decisionEnvelopeSchema>;
670
- export declare const runtimeDecisionRequestMediaFoldersSchema: z.ZodObject<{
671
- kind: z.ZodLiteral<"request_media_folders">;
672
- reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
673
- desiredKinds: z.ZodDefault<z.ZodArray<z.ZodEnum<{
674
- image: "image";
675
- document: "document";
676
- link: "link";
677
- deck: "deck";
678
- }>>>;
679
- topicHint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
680
- }, z.core.$strip>;
681
- export declare const runtimeDecisionRequestMediaFolderContentsSchema: z.ZodObject<{
682
- kind: z.ZodLiteral<"request_media_folder_contents">;
683
- folderKey: z.ZodString;
684
- reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
685
- limit: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
686
- }, z.core.$strip>;
687
- export declare const runtimeDecisionDraftOutboundPlanResponseSchema: z.ZodObject<{
688
- kind: z.ZodLiteral<"draft_outbound_plan">;
689
- decisionEnvelope: z.ZodObject<{
690
- reply: z.ZodObject<{
1023
+ export declare const runtimeDecisionExecutionPayloadSchema: z.ZodObject<{
1024
+ replyText: z.ZodString;
1025
+ outboundPlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1026
+ planId: z.ZodString;
1027
+ conversationId: z.ZodString;
1028
+ basedOnCustomerMessageId: z.ZodString;
1029
+ kind: z.ZodEnum<{
1030
+ draft_outbound_plan: "draft_outbound_plan";
1031
+ final_outbound_plan: "final_outbound_plan";
1032
+ }>;
1033
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1034
+ stepId: z.ZodString;
1035
+ sequence: z.ZodNumber;
1036
+ type: z.ZodLiteral<"send_text">;
691
1037
  text: z.ZodString;
692
- tone: z.ZodDefault<z.ZodEnum<{
693
- concise: "concise";
694
- standard: "standard";
695
- }>>;
696
- channelHints: z.ZodDefault<z.ZodArray<z.ZodString>>;
697
- }, z.core.$strip>;
698
- outboundPlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
699
- planId: z.ZodString;
700
- conversationId: z.ZodString;
701
- basedOnCustomerMessageId: z.ZodString;
702
- kind: z.ZodEnum<{
703
- draft_outbound_plan: "draft_outbound_plan";
704
- final_outbound_plan: "final_outbound_plan";
705
- }>;
706
- steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
707
- stepId: z.ZodString;
708
- sequence: z.ZodNumber;
709
- type: z.ZodLiteral<"send_text">;
710
- text: z.ZodString;
711
- }, z.core.$strip>, z.ZodObject<{
712
- stepId: z.ZodString;
713
- sequence: z.ZodNumber;
714
- type: z.ZodLiteral<"send_media">;
715
- assetId: z.ZodString;
716
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
717
- }, z.core.$strip>, z.ZodObject<{
718
- stepId: z.ZodString;
719
- sequence: z.ZodNumber;
720
- type: z.ZodLiteral<"send_media_group">;
721
- assetIds: z.ZodArray<z.ZodString>;
722
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
723
- }, z.core.$strip>, z.ZodObject<{
724
- stepId: z.ZodString;
725
- sequence: z.ZodNumber;
726
- type: z.ZodLiteral<"send_document">;
727
- assetId: z.ZodString;
728
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
729
- }, z.core.$strip>, z.ZodObject<{
730
- stepId: z.ZodString;
731
- sequence: z.ZodNumber;
732
- type: z.ZodLiteral<"send_link">;
733
- assetId: z.ZodString;
734
- text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
735
- }, z.core.$strip>], "type">>;
736
- }, z.core.$strip>>>;
737
- classification: z.ZodObject<{
738
- primaryIntent: z.ZodString;
739
- secondaryIntents: z.ZodDefault<z.ZodArray<z.ZodString>>;
740
- readiness: z.ZodEnum<{
741
- low: "low";
742
- medium: "medium";
743
- high: "high";
744
- }>;
745
- emotion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
746
- confidence: z.ZodNumber;
747
- riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
748
- }, z.core.$strip>;
749
- strategy: z.ZodObject<{
750
- selectedId: z.ZodString;
751
- candidateIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
752
- rationaleSummary: z.ZodString;
753
- forbiddenMoves: z.ZodDefault<z.ZodArray<z.ZodString>>;
754
- }, z.core.$strip>;
755
- statePatch: z.ZodDefault<z.ZodObject<{
756
- conversation: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
757
- commercial: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
758
- memory: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
759
- }, z.core.$strip>>;
760
- cartPatch: z.ZodOptional<z.ZodObject<{
761
- operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
762
- type: z.ZodEnum<{
763
- ensure_base_product: "ensure_base_product";
764
- attach_product: "attach_product";
765
- }>;
766
- payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
767
- }, z.core.$strip>>>;
768
- }, z.core.$strip>>;
769
- actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1038
+ }, z.core.$strip>, z.ZodObject<{
1039
+ stepId: z.ZodString;
1040
+ sequence: z.ZodNumber;
1041
+ type: z.ZodLiteral<"send_media">;
1042
+ assetId: z.ZodString;
1043
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1044
+ }, z.core.$strip>, z.ZodObject<{
1045
+ stepId: z.ZodString;
1046
+ sequence: z.ZodNumber;
1047
+ type: z.ZodLiteral<"send_media_group">;
1048
+ assetIds: z.ZodArray<z.ZodString>;
1049
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1050
+ }, z.core.$strip>, z.ZodObject<{
1051
+ stepId: z.ZodString;
1052
+ sequence: z.ZodNumber;
1053
+ type: z.ZodLiteral<"send_document">;
1054
+ assetId: z.ZodString;
1055
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1056
+ }, z.core.$strip>, z.ZodObject<{
1057
+ stepId: z.ZodString;
1058
+ sequence: z.ZodNumber;
1059
+ type: z.ZodLiteral<"send_link">;
1060
+ assetId: z.ZodString;
1061
+ text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1062
+ }, z.core.$strip>], "type">>;
1063
+ }, z.core.$strip>>>;
1064
+ statePatch: z.ZodDefault<z.ZodObject<{
1065
+ conversation: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1066
+ commercial: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1067
+ memory: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1068
+ }, z.core.$strip>>;
1069
+ cartPatch: z.ZodOptional<z.ZodObject<{
1070
+ operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
770
1071
  type: z.ZodEnum<{
771
- none: "none";
772
- "commerce.create_cart": "commerce.create_cart";
773
- "commerce.sync_cart": "commerce.sync_cart";
774
- "commerce.quote_deal": "commerce.quote_deal";
775
- "handoff.request": "handoff.request";
776
- "followup.schedule": "followup.schedule";
1072
+ ensure_base_product: "ensure_base_product";
1073
+ attach_product: "attach_product";
777
1074
  }>;
778
1075
  payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
779
1076
  }, z.core.$strip>>>;
780
- followUp: z.ZodDefault<z.ZodNullable<z.ZodObject<{
781
- needed: z.ZodBoolean;
782
- class: z.ZodDefault<z.ZodNullable<z.ZodString>>;
783
- suggestedDelayMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
784
- }, z.core.$strip>>>;
785
- handoff: z.ZodDefault<z.ZodNullable<z.ZodObject<{
786
- needed: z.ZodBoolean;
787
- reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
788
- priority: z.ZodDefault<z.ZodEnum<{
789
- normal: "normal";
790
- urgent: "urgent";
791
- }>>;
792
- }, z.core.$strip>>>;
793
- }, z.core.$strip>;
1077
+ }, z.core.$strip>>;
1078
+ actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1079
+ type: z.ZodEnum<{
1080
+ none: "none";
1081
+ "commerce.create_cart": "commerce.create_cart";
1082
+ "commerce.sync_cart": "commerce.sync_cart";
1083
+ "commerce.quote_deal": "commerce.quote_deal";
1084
+ "handoff.request": "handoff.request";
1085
+ "followup.schedule": "followup.schedule";
1086
+ }>;
1087
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1088
+ }, z.core.$strip>>>;
1089
+ followUp: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1090
+ needed: z.ZodBoolean;
1091
+ class: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1092
+ suggestedDelayMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1093
+ }, z.core.$strip>>>;
1094
+ handoff: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1095
+ needed: z.ZodBoolean;
1096
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1097
+ priority: z.ZodDefault<z.ZodEnum<{
1098
+ normal: "normal";
1099
+ urgent: "urgent";
1100
+ }>>;
1101
+ }, z.core.$strip>>>;
794
1102
  }, z.core.$strip>;
795
- export declare const runtimeDecisionFinalOutboundPlanResponseSchema: z.ZodObject<{
796
- kind: z.ZodLiteral<"final_outbound_plan">;
797
- decisionEnvelope: z.ZodObject<{
798
- reply: z.ZodObject<{
1103
+ export type RuntimeDecisionExecutionPayload = z.infer<typeof runtimeDecisionExecutionPayloadSchema>;
1104
+ export declare const runtimeDecisionRequestMediaFoldersSchema: z.ZodObject<{
1105
+ kind: z.ZodLiteral<"request_media_folders">;
1106
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1107
+ desiredKinds: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1108
+ image: "image";
1109
+ document: "document";
1110
+ link: "link";
1111
+ deck: "deck";
1112
+ }>>>;
1113
+ topicHint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1114
+ }, z.core.$strip>;
1115
+ export declare const runtimeDecisionRequestMediaFolderContentsSchema: z.ZodObject<{
1116
+ kind: z.ZodLiteral<"request_media_folder_contents">;
1117
+ folderKey: z.ZodString;
1118
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1119
+ limit: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1120
+ }, z.core.$strip>;
1121
+ export declare const runtimeDecisionDraftOutboundPlanResponseSchema: z.ZodObject<{
1122
+ replyText: z.ZodString;
1123
+ outboundPlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1124
+ planId: z.ZodString;
1125
+ conversationId: z.ZodString;
1126
+ basedOnCustomerMessageId: z.ZodString;
1127
+ kind: z.ZodEnum<{
1128
+ draft_outbound_plan: "draft_outbound_plan";
1129
+ final_outbound_plan: "final_outbound_plan";
1130
+ }>;
1131
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1132
+ stepId: z.ZodString;
1133
+ sequence: z.ZodNumber;
1134
+ type: z.ZodLiteral<"send_text">;
799
1135
  text: z.ZodString;
800
- tone: z.ZodDefault<z.ZodEnum<{
801
- concise: "concise";
802
- standard: "standard";
803
- }>>;
804
- channelHints: z.ZodDefault<z.ZodArray<z.ZodString>>;
805
- }, z.core.$strip>;
806
- outboundPlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
807
- planId: z.ZodString;
808
- conversationId: z.ZodString;
809
- basedOnCustomerMessageId: z.ZodString;
810
- kind: z.ZodEnum<{
811
- draft_outbound_plan: "draft_outbound_plan";
812
- final_outbound_plan: "final_outbound_plan";
1136
+ }, z.core.$strip>, z.ZodObject<{
1137
+ stepId: z.ZodString;
1138
+ sequence: z.ZodNumber;
1139
+ type: z.ZodLiteral<"send_media">;
1140
+ assetId: z.ZodString;
1141
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1142
+ }, z.core.$strip>, z.ZodObject<{
1143
+ stepId: z.ZodString;
1144
+ sequence: z.ZodNumber;
1145
+ type: z.ZodLiteral<"send_media_group">;
1146
+ assetIds: z.ZodArray<z.ZodString>;
1147
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1148
+ }, z.core.$strip>, z.ZodObject<{
1149
+ stepId: z.ZodString;
1150
+ sequence: z.ZodNumber;
1151
+ type: z.ZodLiteral<"send_document">;
1152
+ assetId: z.ZodString;
1153
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1154
+ }, z.core.$strip>, z.ZodObject<{
1155
+ stepId: z.ZodString;
1156
+ sequence: z.ZodNumber;
1157
+ type: z.ZodLiteral<"send_link">;
1158
+ assetId: z.ZodString;
1159
+ text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1160
+ }, z.core.$strip>], "type">>;
1161
+ }, z.core.$strip>>>;
1162
+ statePatch: z.ZodDefault<z.ZodObject<{
1163
+ conversation: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1164
+ commercial: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1165
+ memory: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1166
+ }, z.core.$strip>>;
1167
+ cartPatch: z.ZodOptional<z.ZodObject<{
1168
+ operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
1169
+ type: z.ZodEnum<{
1170
+ ensure_base_product: "ensure_base_product";
1171
+ attach_product: "attach_product";
813
1172
  }>;
814
- steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
815
- stepId: z.ZodString;
816
- sequence: z.ZodNumber;
817
- type: z.ZodLiteral<"send_text">;
818
- text: z.ZodString;
819
- }, z.core.$strip>, z.ZodObject<{
820
- stepId: z.ZodString;
821
- sequence: z.ZodNumber;
822
- type: z.ZodLiteral<"send_media">;
823
- assetId: z.ZodString;
824
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
825
- }, z.core.$strip>, z.ZodObject<{
826
- stepId: z.ZodString;
827
- sequence: z.ZodNumber;
828
- type: z.ZodLiteral<"send_media_group">;
829
- assetIds: z.ZodArray<z.ZodString>;
830
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
831
- }, z.core.$strip>, z.ZodObject<{
832
- stepId: z.ZodString;
833
- sequence: z.ZodNumber;
834
- type: z.ZodLiteral<"send_document">;
835
- assetId: z.ZodString;
836
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
837
- }, z.core.$strip>, z.ZodObject<{
838
- stepId: z.ZodString;
839
- sequence: z.ZodNumber;
840
- type: z.ZodLiteral<"send_link">;
841
- assetId: z.ZodString;
842
- text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
843
- }, z.core.$strip>], "type">>;
1173
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
844
1174
  }, z.core.$strip>>>;
845
- classification: z.ZodObject<{
846
- primaryIntent: z.ZodString;
847
- secondaryIntents: z.ZodDefault<z.ZodArray<z.ZodString>>;
848
- readiness: z.ZodEnum<{
849
- low: "low";
850
- medium: "medium";
851
- high: "high";
852
- }>;
853
- emotion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
854
- confidence: z.ZodNumber;
855
- riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
856
- }, z.core.$strip>;
857
- strategy: z.ZodObject<{
858
- selectedId: z.ZodString;
859
- candidateIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
860
- rationaleSummary: z.ZodString;
861
- forbiddenMoves: z.ZodDefault<z.ZodArray<z.ZodString>>;
862
- }, z.core.$strip>;
863
- statePatch: z.ZodDefault<z.ZodObject<{
864
- conversation: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
865
- commercial: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
866
- memory: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
867
- }, z.core.$strip>>;
868
- cartPatch: z.ZodOptional<z.ZodObject<{
869
- operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
870
- type: z.ZodEnum<{
871
- ensure_base_product: "ensure_base_product";
872
- attach_product: "attach_product";
873
- }>;
874
- payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
875
- }, z.core.$strip>>>;
876
- }, z.core.$strip>>;
877
- actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1175
+ }, z.core.$strip>>;
1176
+ actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1177
+ type: z.ZodEnum<{
1178
+ none: "none";
1179
+ "commerce.create_cart": "commerce.create_cart";
1180
+ "commerce.sync_cart": "commerce.sync_cart";
1181
+ "commerce.quote_deal": "commerce.quote_deal";
1182
+ "handoff.request": "handoff.request";
1183
+ "followup.schedule": "followup.schedule";
1184
+ }>;
1185
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1186
+ }, z.core.$strip>>>;
1187
+ followUp: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1188
+ needed: z.ZodBoolean;
1189
+ class: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1190
+ suggestedDelayMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1191
+ }, z.core.$strip>>>;
1192
+ handoff: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1193
+ needed: z.ZodBoolean;
1194
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1195
+ priority: z.ZodDefault<z.ZodEnum<{
1196
+ normal: "normal";
1197
+ urgent: "urgent";
1198
+ }>>;
1199
+ }, z.core.$strip>>>;
1200
+ kind: z.ZodLiteral<"draft_outbound_plan">;
1201
+ }, z.core.$strip>;
1202
+ export declare const runtimeDecisionFinalOutboundPlanResponseSchema: z.ZodObject<{
1203
+ replyText: z.ZodString;
1204
+ outboundPlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1205
+ planId: z.ZodString;
1206
+ conversationId: z.ZodString;
1207
+ basedOnCustomerMessageId: z.ZodString;
1208
+ kind: z.ZodEnum<{
1209
+ draft_outbound_plan: "draft_outbound_plan";
1210
+ final_outbound_plan: "final_outbound_plan";
1211
+ }>;
1212
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1213
+ stepId: z.ZodString;
1214
+ sequence: z.ZodNumber;
1215
+ type: z.ZodLiteral<"send_text">;
1216
+ text: z.ZodString;
1217
+ }, z.core.$strip>, z.ZodObject<{
1218
+ stepId: z.ZodString;
1219
+ sequence: z.ZodNumber;
1220
+ type: z.ZodLiteral<"send_media">;
1221
+ assetId: z.ZodString;
1222
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1223
+ }, z.core.$strip>, z.ZodObject<{
1224
+ stepId: z.ZodString;
1225
+ sequence: z.ZodNumber;
1226
+ type: z.ZodLiteral<"send_media_group">;
1227
+ assetIds: z.ZodArray<z.ZodString>;
1228
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1229
+ }, z.core.$strip>, z.ZodObject<{
1230
+ stepId: z.ZodString;
1231
+ sequence: z.ZodNumber;
1232
+ type: z.ZodLiteral<"send_document">;
1233
+ assetId: z.ZodString;
1234
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1235
+ }, z.core.$strip>, z.ZodObject<{
1236
+ stepId: z.ZodString;
1237
+ sequence: z.ZodNumber;
1238
+ type: z.ZodLiteral<"send_link">;
1239
+ assetId: z.ZodString;
1240
+ text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1241
+ }, z.core.$strip>], "type">>;
1242
+ }, z.core.$strip>>>;
1243
+ statePatch: z.ZodDefault<z.ZodObject<{
1244
+ conversation: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1245
+ commercial: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1246
+ memory: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1247
+ }, z.core.$strip>>;
1248
+ cartPatch: z.ZodOptional<z.ZodObject<{
1249
+ operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
878
1250
  type: z.ZodEnum<{
879
- none: "none";
880
- "commerce.create_cart": "commerce.create_cart";
881
- "commerce.sync_cart": "commerce.sync_cart";
882
- "commerce.quote_deal": "commerce.quote_deal";
883
- "handoff.request": "handoff.request";
884
- "followup.schedule": "followup.schedule";
1251
+ ensure_base_product: "ensure_base_product";
1252
+ attach_product: "attach_product";
885
1253
  }>;
886
1254
  payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
887
1255
  }, z.core.$strip>>>;
888
- followUp: z.ZodDefault<z.ZodNullable<z.ZodObject<{
889
- needed: z.ZodBoolean;
890
- class: z.ZodDefault<z.ZodNullable<z.ZodString>>;
891
- suggestedDelayMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
892
- }, z.core.$strip>>>;
893
- handoff: z.ZodDefault<z.ZodNullable<z.ZodObject<{
894
- needed: z.ZodBoolean;
895
- reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
896
- priority: z.ZodDefault<z.ZodEnum<{
897
- normal: "normal";
898
- urgent: "urgent";
899
- }>>;
900
- }, z.core.$strip>>>;
901
- }, z.core.$strip>;
1256
+ }, z.core.$strip>>;
1257
+ actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1258
+ type: z.ZodEnum<{
1259
+ none: "none";
1260
+ "commerce.create_cart": "commerce.create_cart";
1261
+ "commerce.sync_cart": "commerce.sync_cart";
1262
+ "commerce.quote_deal": "commerce.quote_deal";
1263
+ "handoff.request": "handoff.request";
1264
+ "followup.schedule": "followup.schedule";
1265
+ }>;
1266
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1267
+ }, z.core.$strip>>>;
1268
+ followUp: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1269
+ needed: z.ZodBoolean;
1270
+ class: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1271
+ suggestedDelayMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1272
+ }, z.core.$strip>>>;
1273
+ handoff: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1274
+ needed: z.ZodBoolean;
1275
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1276
+ priority: z.ZodDefault<z.ZodEnum<{
1277
+ normal: "normal";
1278
+ urgent: "urgent";
1279
+ }>>;
1280
+ }, z.core.$strip>>>;
1281
+ kind: z.ZodLiteral<"final_outbound_plan">;
902
1282
  }, z.core.$strip>;
903
1283
  export declare const runtimeStructuredDecisionResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
904
1284
  kind: z.ZodLiteral<"request_media_folders">;
@@ -916,219 +1296,165 @@ export declare const runtimeStructuredDecisionResponseSchema: z.ZodDiscriminated
916
1296
  reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
917
1297
  limit: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
918
1298
  }, z.core.$strip>, z.ZodObject<{
919
- kind: z.ZodLiteral<"draft_outbound_plan">;
920
- decisionEnvelope: z.ZodObject<{
921
- reply: z.ZodObject<{
1299
+ replyText: z.ZodString;
1300
+ outboundPlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1301
+ planId: z.ZodString;
1302
+ conversationId: z.ZodString;
1303
+ basedOnCustomerMessageId: z.ZodString;
1304
+ kind: z.ZodEnum<{
1305
+ draft_outbound_plan: "draft_outbound_plan";
1306
+ final_outbound_plan: "final_outbound_plan";
1307
+ }>;
1308
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1309
+ stepId: z.ZodString;
1310
+ sequence: z.ZodNumber;
1311
+ type: z.ZodLiteral<"send_text">;
922
1312
  text: z.ZodString;
923
- tone: z.ZodDefault<z.ZodEnum<{
924
- concise: "concise";
925
- standard: "standard";
926
- }>>;
927
- channelHints: z.ZodDefault<z.ZodArray<z.ZodString>>;
928
- }, z.core.$strip>;
929
- outboundPlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
930
- planId: z.ZodString;
931
- conversationId: z.ZodString;
932
- basedOnCustomerMessageId: z.ZodString;
933
- kind: z.ZodEnum<{
934
- draft_outbound_plan: "draft_outbound_plan";
935
- final_outbound_plan: "final_outbound_plan";
936
- }>;
937
- steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
938
- stepId: z.ZodString;
939
- sequence: z.ZodNumber;
940
- type: z.ZodLiteral<"send_text">;
941
- text: z.ZodString;
942
- }, z.core.$strip>, z.ZodObject<{
943
- stepId: z.ZodString;
944
- sequence: z.ZodNumber;
945
- type: z.ZodLiteral<"send_media">;
946
- assetId: z.ZodString;
947
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
948
- }, z.core.$strip>, z.ZodObject<{
949
- stepId: z.ZodString;
950
- sequence: z.ZodNumber;
951
- type: z.ZodLiteral<"send_media_group">;
952
- assetIds: z.ZodArray<z.ZodString>;
953
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
954
- }, z.core.$strip>, z.ZodObject<{
955
- stepId: z.ZodString;
956
- sequence: z.ZodNumber;
957
- type: z.ZodLiteral<"send_document">;
958
- assetId: z.ZodString;
959
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
960
- }, z.core.$strip>, z.ZodObject<{
961
- stepId: z.ZodString;
962
- sequence: z.ZodNumber;
963
- type: z.ZodLiteral<"send_link">;
964
- assetId: z.ZodString;
965
- text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
966
- }, z.core.$strip>], "type">>;
967
- }, z.core.$strip>>>;
968
- classification: z.ZodObject<{
969
- primaryIntent: z.ZodString;
970
- secondaryIntents: z.ZodDefault<z.ZodArray<z.ZodString>>;
971
- readiness: z.ZodEnum<{
972
- low: "low";
973
- medium: "medium";
974
- high: "high";
975
- }>;
976
- emotion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
977
- confidence: z.ZodNumber;
978
- riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
979
- }, z.core.$strip>;
980
- strategy: z.ZodObject<{
981
- selectedId: z.ZodString;
982
- candidateIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
983
- rationaleSummary: z.ZodString;
984
- forbiddenMoves: z.ZodDefault<z.ZodArray<z.ZodString>>;
985
- }, z.core.$strip>;
986
- statePatch: z.ZodDefault<z.ZodObject<{
987
- conversation: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
988
- commercial: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
989
- memory: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
990
- }, z.core.$strip>>;
991
- cartPatch: z.ZodOptional<z.ZodObject<{
992
- operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
993
- type: z.ZodEnum<{
994
- ensure_base_product: "ensure_base_product";
995
- attach_product: "attach_product";
996
- }>;
997
- payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
998
- }, z.core.$strip>>>;
999
- }, z.core.$strip>>;
1000
- actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1313
+ }, z.core.$strip>, z.ZodObject<{
1314
+ stepId: z.ZodString;
1315
+ sequence: z.ZodNumber;
1316
+ type: z.ZodLiteral<"send_media">;
1317
+ assetId: z.ZodString;
1318
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1319
+ }, z.core.$strip>, z.ZodObject<{
1320
+ stepId: z.ZodString;
1321
+ sequence: z.ZodNumber;
1322
+ type: z.ZodLiteral<"send_media_group">;
1323
+ assetIds: z.ZodArray<z.ZodString>;
1324
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1325
+ }, z.core.$strip>, z.ZodObject<{
1326
+ stepId: z.ZodString;
1327
+ sequence: z.ZodNumber;
1328
+ type: z.ZodLiteral<"send_document">;
1329
+ assetId: z.ZodString;
1330
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1331
+ }, z.core.$strip>, z.ZodObject<{
1332
+ stepId: z.ZodString;
1333
+ sequence: z.ZodNumber;
1334
+ type: z.ZodLiteral<"send_link">;
1335
+ assetId: z.ZodString;
1336
+ text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1337
+ }, z.core.$strip>], "type">>;
1338
+ }, z.core.$strip>>>;
1339
+ statePatch: z.ZodDefault<z.ZodObject<{
1340
+ conversation: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1341
+ commercial: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1342
+ memory: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1343
+ }, z.core.$strip>>;
1344
+ cartPatch: z.ZodOptional<z.ZodObject<{
1345
+ operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
1001
1346
  type: z.ZodEnum<{
1002
- none: "none";
1003
- "commerce.create_cart": "commerce.create_cart";
1004
- "commerce.sync_cart": "commerce.sync_cart";
1005
- "commerce.quote_deal": "commerce.quote_deal";
1006
- "handoff.request": "handoff.request";
1007
- "followup.schedule": "followup.schedule";
1347
+ ensure_base_product: "ensure_base_product";
1348
+ attach_product: "attach_product";
1008
1349
  }>;
1009
1350
  payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1010
1351
  }, z.core.$strip>>>;
1011
- followUp: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1012
- needed: z.ZodBoolean;
1013
- class: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1014
- suggestedDelayMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1015
- }, z.core.$strip>>>;
1016
- handoff: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1017
- needed: z.ZodBoolean;
1018
- reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1019
- priority: z.ZodDefault<z.ZodEnum<{
1020
- normal: "normal";
1021
- urgent: "urgent";
1022
- }>>;
1023
- }, z.core.$strip>>>;
1024
- }, z.core.$strip>;
1352
+ }, z.core.$strip>>;
1353
+ actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1354
+ type: z.ZodEnum<{
1355
+ none: "none";
1356
+ "commerce.create_cart": "commerce.create_cart";
1357
+ "commerce.sync_cart": "commerce.sync_cart";
1358
+ "commerce.quote_deal": "commerce.quote_deal";
1359
+ "handoff.request": "handoff.request";
1360
+ "followup.schedule": "followup.schedule";
1361
+ }>;
1362
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1363
+ }, z.core.$strip>>>;
1364
+ followUp: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1365
+ needed: z.ZodBoolean;
1366
+ class: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1367
+ suggestedDelayMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1368
+ }, z.core.$strip>>>;
1369
+ handoff: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1370
+ needed: z.ZodBoolean;
1371
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1372
+ priority: z.ZodDefault<z.ZodEnum<{
1373
+ normal: "normal";
1374
+ urgent: "urgent";
1375
+ }>>;
1376
+ }, z.core.$strip>>>;
1377
+ kind: z.ZodLiteral<"draft_outbound_plan">;
1025
1378
  }, z.core.$strip>, z.ZodObject<{
1026
- kind: z.ZodLiteral<"final_outbound_plan">;
1027
- decisionEnvelope: z.ZodObject<{
1028
- reply: z.ZodObject<{
1379
+ replyText: z.ZodString;
1380
+ outboundPlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1381
+ planId: z.ZodString;
1382
+ conversationId: z.ZodString;
1383
+ basedOnCustomerMessageId: z.ZodString;
1384
+ kind: z.ZodEnum<{
1385
+ draft_outbound_plan: "draft_outbound_plan";
1386
+ final_outbound_plan: "final_outbound_plan";
1387
+ }>;
1388
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1389
+ stepId: z.ZodString;
1390
+ sequence: z.ZodNumber;
1391
+ type: z.ZodLiteral<"send_text">;
1029
1392
  text: z.ZodString;
1030
- tone: z.ZodDefault<z.ZodEnum<{
1031
- concise: "concise";
1032
- standard: "standard";
1033
- }>>;
1034
- channelHints: z.ZodDefault<z.ZodArray<z.ZodString>>;
1035
- }, z.core.$strip>;
1036
- outboundPlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1037
- planId: z.ZodString;
1038
- conversationId: z.ZodString;
1039
- basedOnCustomerMessageId: z.ZodString;
1040
- kind: z.ZodEnum<{
1041
- draft_outbound_plan: "draft_outbound_plan";
1042
- final_outbound_plan: "final_outbound_plan";
1043
- }>;
1044
- steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1045
- stepId: z.ZodString;
1046
- sequence: z.ZodNumber;
1047
- type: z.ZodLiteral<"send_text">;
1048
- text: z.ZodString;
1049
- }, z.core.$strip>, z.ZodObject<{
1050
- stepId: z.ZodString;
1051
- sequence: z.ZodNumber;
1052
- type: z.ZodLiteral<"send_media">;
1053
- assetId: z.ZodString;
1054
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1055
- }, z.core.$strip>, z.ZodObject<{
1056
- stepId: z.ZodString;
1057
- sequence: z.ZodNumber;
1058
- type: z.ZodLiteral<"send_media_group">;
1059
- assetIds: z.ZodArray<z.ZodString>;
1060
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1061
- }, z.core.$strip>, z.ZodObject<{
1062
- stepId: z.ZodString;
1063
- sequence: z.ZodNumber;
1064
- type: z.ZodLiteral<"send_document">;
1065
- assetId: z.ZodString;
1066
- caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1067
- }, z.core.$strip>, z.ZodObject<{
1068
- stepId: z.ZodString;
1069
- sequence: z.ZodNumber;
1070
- type: z.ZodLiteral<"send_link">;
1071
- assetId: z.ZodString;
1072
- text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1073
- }, z.core.$strip>], "type">>;
1074
- }, z.core.$strip>>>;
1075
- classification: z.ZodObject<{
1076
- primaryIntent: z.ZodString;
1077
- secondaryIntents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1078
- readiness: z.ZodEnum<{
1079
- low: "low";
1080
- medium: "medium";
1081
- high: "high";
1082
- }>;
1083
- emotion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1084
- confidence: z.ZodNumber;
1085
- riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
1086
- }, z.core.$strip>;
1087
- strategy: z.ZodObject<{
1088
- selectedId: z.ZodString;
1089
- candidateIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
1090
- rationaleSummary: z.ZodString;
1091
- forbiddenMoves: z.ZodDefault<z.ZodArray<z.ZodString>>;
1092
- }, z.core.$strip>;
1093
- statePatch: z.ZodDefault<z.ZodObject<{
1094
- conversation: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1095
- commercial: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1096
- memory: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1097
- }, z.core.$strip>>;
1098
- cartPatch: z.ZodOptional<z.ZodObject<{
1099
- operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
1100
- type: z.ZodEnum<{
1101
- ensure_base_product: "ensure_base_product";
1102
- attach_product: "attach_product";
1103
- }>;
1104
- payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1105
- }, z.core.$strip>>>;
1106
- }, z.core.$strip>>;
1107
- actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1393
+ }, z.core.$strip>, z.ZodObject<{
1394
+ stepId: z.ZodString;
1395
+ sequence: z.ZodNumber;
1396
+ type: z.ZodLiteral<"send_media">;
1397
+ assetId: z.ZodString;
1398
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1399
+ }, z.core.$strip>, z.ZodObject<{
1400
+ stepId: z.ZodString;
1401
+ sequence: z.ZodNumber;
1402
+ type: z.ZodLiteral<"send_media_group">;
1403
+ assetIds: z.ZodArray<z.ZodString>;
1404
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1405
+ }, z.core.$strip>, z.ZodObject<{
1406
+ stepId: z.ZodString;
1407
+ sequence: z.ZodNumber;
1408
+ type: z.ZodLiteral<"send_document">;
1409
+ assetId: z.ZodString;
1410
+ caption: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1411
+ }, z.core.$strip>, z.ZodObject<{
1412
+ stepId: z.ZodString;
1413
+ sequence: z.ZodNumber;
1414
+ type: z.ZodLiteral<"send_link">;
1415
+ assetId: z.ZodString;
1416
+ text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1417
+ }, z.core.$strip>], "type">>;
1418
+ }, z.core.$strip>>>;
1419
+ statePatch: z.ZodDefault<z.ZodObject<{
1420
+ conversation: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1421
+ commercial: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1422
+ memory: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1423
+ }, z.core.$strip>>;
1424
+ cartPatch: z.ZodOptional<z.ZodObject<{
1425
+ operations: z.ZodDefault<z.ZodArray<z.ZodObject<{
1108
1426
  type: z.ZodEnum<{
1109
- none: "none";
1110
- "commerce.create_cart": "commerce.create_cart";
1111
- "commerce.sync_cart": "commerce.sync_cart";
1112
- "commerce.quote_deal": "commerce.quote_deal";
1113
- "handoff.request": "handoff.request";
1114
- "followup.schedule": "followup.schedule";
1427
+ ensure_base_product: "ensure_base_product";
1428
+ attach_product: "attach_product";
1115
1429
  }>;
1116
1430
  payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1117
1431
  }, z.core.$strip>>>;
1118
- followUp: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1119
- needed: z.ZodBoolean;
1120
- class: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1121
- suggestedDelayMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1122
- }, z.core.$strip>>>;
1123
- handoff: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1124
- needed: z.ZodBoolean;
1125
- reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1126
- priority: z.ZodDefault<z.ZodEnum<{
1127
- normal: "normal";
1128
- urgent: "urgent";
1129
- }>>;
1130
- }, z.core.$strip>>>;
1131
- }, z.core.$strip>;
1432
+ }, z.core.$strip>>;
1433
+ actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1434
+ type: z.ZodEnum<{
1435
+ none: "none";
1436
+ "commerce.create_cart": "commerce.create_cart";
1437
+ "commerce.sync_cart": "commerce.sync_cart";
1438
+ "commerce.quote_deal": "commerce.quote_deal";
1439
+ "handoff.request": "handoff.request";
1440
+ "followup.schedule": "followup.schedule";
1441
+ }>;
1442
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1443
+ }, z.core.$strip>>>;
1444
+ followUp: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1445
+ needed: z.ZodBoolean;
1446
+ class: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1447
+ suggestedDelayMinutes: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1448
+ }, z.core.$strip>>>;
1449
+ handoff: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1450
+ needed: z.ZodBoolean;
1451
+ reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1452
+ priority: z.ZodDefault<z.ZodEnum<{
1453
+ normal: "normal";
1454
+ urgent: "urgent";
1455
+ }>>;
1456
+ }, z.core.$strip>>>;
1457
+ kind: z.ZodLiteral<"final_outbound_plan">;
1132
1458
  }, z.core.$strip>], "kind">;
1133
1459
  export type RuntimeStructuredDecisionResponse = z.infer<typeof runtimeStructuredDecisionResponseSchema>;
1134
1460
  export declare const runtimeMediaDiscoveryTraceEntrySchema: z.ZodObject<{
@@ -1267,7 +1593,7 @@ export declare const decisionTraceSchema: z.ZodObject<{
1267
1593
  text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1268
1594
  }, z.core.$strip>], "type">>;
1269
1595
  }, z.core.$strip>>>;
1270
- classification: z.ZodObject<{
1596
+ classification: z.ZodOptional<z.ZodObject<{
1271
1597
  primaryIntent: z.ZodString;
1272
1598
  secondaryIntents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1273
1599
  readiness: z.ZodEnum<{
@@ -1278,7 +1604,7 @@ export declare const decisionTraceSchema: z.ZodObject<{
1278
1604
  emotion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1279
1605
  confidence: z.ZodNumber;
1280
1606
  riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
1281
- }, z.core.$strip>;
1607
+ }, z.core.$strip>>;
1282
1608
  strategy: z.ZodObject<{
1283
1609
  selectedId: z.ZodString;
1284
1610
  candidateIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -1326,7 +1652,12 @@ export declare const decisionTraceSchema: z.ZodObject<{
1326
1652
  }, z.core.$strip>>>;
1327
1653
  turnAnalysis: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1328
1654
  output: z.ZodObject<{
1329
- classification: z.ZodObject<{
1655
+ strategyMatches: z.ZodArray<z.ZodObject<{
1656
+ strategyId: z.ZodString;
1657
+ score: z.ZodNumber;
1658
+ reason: z.ZodString;
1659
+ }, z.core.$strip>>;
1660
+ classification: z.ZodOptional<z.ZodObject<{
1330
1661
  primaryIntent: z.ZodString;
1331
1662
  secondaryIntents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1332
1663
  readiness: z.ZodEnum<{
@@ -1337,25 +1668,8 @@ export declare const decisionTraceSchema: z.ZodObject<{
1337
1668
  emotion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1338
1669
  confidence: z.ZodNumber;
1339
1670
  riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
1340
- }, z.core.$strip>;
1341
- strategy: z.ZodObject<{
1342
- selectedId: z.ZodString;
1343
- candidateIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
1344
- rationaleSummary: z.ZodString;
1345
- }, z.core.$strip>;
1346
- customerGoal: z.ZodString;
1347
- relevantProductCodes: z.ZodDefault<z.ZodArray<z.ZodString>>;
1348
- relevantPolicyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
1349
- missingFacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
1350
- handoffSuggested: z.ZodObject<{
1351
- needed: z.ZodBoolean;
1352
- reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1353
- priority: z.ZodDefault<z.ZodEnum<{
1354
- normal: "normal";
1355
- urgent: "urgent";
1356
- }>>;
1357
- }, z.core.$strip>;
1358
- replyGoal: z.ZodString;
1671
+ }, z.core.$strip>>;
1672
+ relevantProductCodes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1359
1673
  }, z.core.$strip>;
1360
1674
  promptMeta: z.ZodObject<{
1361
1675
  promptId: z.ZodString;
@@ -1384,6 +1698,38 @@ export declare const decisionTraceSchema: z.ZodObject<{
1384
1698
  model: "model";
1385
1699
  }>;
1386
1700
  protocolResponseKind: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1701
+ stepHistory: z.ZodDefault<z.ZodArray<z.ZodObject<{
1702
+ stepId: z.ZodString;
1703
+ stepType: z.ZodEnum<{
1704
+ request_media_folders: "request_media_folders";
1705
+ request_media_folder_contents: "request_media_folder_contents";
1706
+ "handoff.request": "handoff.request";
1707
+ "state.cart.apply_operations": "state.cart.apply_operations";
1708
+ "channel.send_messages": "channel.send_messages";
1709
+ }>;
1710
+ status: z.ZodEnum<{
1711
+ failed: "failed";
1712
+ served: "served";
1713
+ executed: "executed";
1714
+ rejected: "rejected";
1715
+ }>;
1716
+ inputSummary: z.ZodString;
1717
+ resultSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1718
+ errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1719
+ changedStateSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1720
+ startedAt: z.ZodString;
1721
+ finishedAt: z.ZodString;
1722
+ }, z.core.$strip>>>;
1723
+ promptCache: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1724
+ cacheablePrefixHash: z.ZodString;
1725
+ volatileTailHash: z.ZodString;
1726
+ cacheKey: z.ZodString;
1727
+ cacheHit: z.ZodDefault<z.ZodBoolean>;
1728
+ }, z.core.$strip>>>;
1729
+ fallbackApplied: z.ZodDefault<z.ZodBoolean>;
1730
+ fallbackKind: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1731
+ fallbackStage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1732
+ fallbackSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1387
1733
  mediaProfileVersionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1388
1734
  mediaProfileVersionNumber: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1389
1735
  mediaDiscovery: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1412,10 +1758,28 @@ export declare const decisionTraceSchema: z.ZodObject<{
1412
1758
  errorMessage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1413
1759
  }, z.core.$strip>>>;
1414
1760
  }, z.core.$strip>>>;
1761
+ verificationOutput: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1762
+ status: z.ZodEnum<{
1763
+ failed: "failed";
1764
+ passed: "passed";
1765
+ }>;
1766
+ blockingIssues: z.ZodDefault<z.ZodArray<z.ZodObject<{
1767
+ type: z.ZodEnum<{
1768
+ policy_violation: "policy_violation";
1769
+ asset_reference_invalid: "asset_reference_invalid";
1770
+ cart_state_mismatch: "cart_state_mismatch";
1771
+ arithmetic_error: "arithmetic_error";
1772
+ required_step_missing: "required_step_missing";
1773
+ }>;
1774
+ message: z.ZodString;
1775
+ }, z.core.$strip>>>;
1776
+ remarks: z.ZodDefault<z.ZodArray<z.ZodString>>;
1777
+ }, z.core.$strip>>>;
1415
1778
  generationAttempts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1416
1779
  stage: z.ZodEnum<{
1417
1780
  turn_analyze: "turn_analyze";
1418
1781
  turn_decide: "turn_decide";
1782
+ verify_outcome: "verify_outcome";
1419
1783
  review_artifact: "review_artifact";
1420
1784
  review_message: "review_message";
1421
1785
  }>;
@@ -1435,6 +1799,16 @@ export declare const decisionTraceSchema: z.ZodObject<{
1435
1799
  semanticVersion: z.ZodString;
1436
1800
  renderedHash: z.ZodString;
1437
1801
  }, z.core.$strip>;
1802
+ promptDebug: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1803
+ system: z.ZodString;
1804
+ user: z.ZodString;
1805
+ context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1806
+ templateRefs: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1807
+ systemTemplate: z.ZodString;
1808
+ userTemplate: z.ZodString;
1809
+ partials: z.ZodDefault<z.ZodArray<z.ZodString>>;
1810
+ }, z.core.$strip>>>;
1811
+ }, z.core.$strip>>>;
1438
1812
  provider: z.ZodString;
1439
1813
  modelId: z.ZodString;
1440
1814
  finishReason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -1444,13 +1818,58 @@ export declare const decisionTraceSchema: z.ZodObject<{
1444
1818
  totalTokens: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1445
1819
  }, z.core.$strip>>>;
1446
1820
  latencyMs: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1821
+ providerAttemptCount: z.ZodDefault<z.ZodNumber>;
1822
+ providerRetryCount: z.ZodDefault<z.ZodNumber>;
1823
+ providerAttempts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1824
+ provider: z.ZodString;
1825
+ modelId: z.ZodString;
1826
+ attemptNumber: z.ZodNumber;
1827
+ status: z.ZodEnum<{
1828
+ succeeded: "succeeded";
1829
+ failed: "failed";
1830
+ }>;
1831
+ startedAt: z.ZodString;
1832
+ finishedAt: z.ZodString;
1833
+ latencyMs: z.ZodNumber;
1834
+ retryable: z.ZodDefault<z.ZodBoolean>;
1835
+ failureCategory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1836
+ errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1837
+ backoffMs: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1838
+ }, z.core.$strip>>>;
1839
+ validationLayer: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
1840
+ configuration: "configuration";
1841
+ provider: "provider";
1842
+ schema_parse: "schema_parse";
1843
+ protocol_validation: "protocol_validation";
1844
+ verifier: "verifier";
1845
+ }>>>;
1447
1846
  retryContext: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1448
1847
  priorAttemptNumber: z.ZodNumber;
1449
1848
  errorSummary: z.ZodString;
1450
1849
  validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
1850
+ priorFailures: z.ZodDefault<z.ZodArray<z.ZodObject<{
1851
+ attemptNumber: z.ZodNumber;
1852
+ errorSummary: z.ZodString;
1853
+ validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
1854
+ }, z.core.$strip>>>;
1451
1855
  }, z.core.$strip>>>;
1452
1856
  validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
1453
1857
  errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1858
+ rawOutput: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
1859
+ }, z.core.$strip>>>;
1860
+ executionProfile: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1861
+ totalRuntimeMs: z.ZodDefault<z.ZodNumber>;
1862
+ analysisMs: z.ZodDefault<z.ZodNumber>;
1863
+ decisionMs: z.ZodDefault<z.ZodNumber>;
1864
+ reviewMs: z.ZodDefault<z.ZodNumber>;
1865
+ generationAttemptCount: z.ZodDefault<z.ZodNumber>;
1866
+ correctiveRetryCount: z.ZodDefault<z.ZodNumber>;
1867
+ failedAttemptCount: z.ZodDefault<z.ZodNumber>;
1868
+ providerAttemptCount: z.ZodDefault<z.ZodNumber>;
1869
+ providerRetryCount: z.ZodDefault<z.ZodNumber>;
1870
+ validationIssueCount: z.ZodDefault<z.ZodNumber>;
1871
+ slowestStage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1872
+ slowestAttemptLatencyMs: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1454
1873
  }, z.core.$strip>>>;
1455
1874
  historyPacking: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1456
1875
  rawCharacterBudget: z.ZodNumber;
@@ -1461,6 +1880,10 @@ export declare const decisionTraceSchema: z.ZodObject<{
1461
1880
  }, z.core.$strip>>>;
1462
1881
  reviewOutput: z.ZodDefault<z.ZodNullable<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
1463
1882
  validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
1883
+ fallbackApplied: z.ZodDefault<z.ZodBoolean>;
1884
+ fallbackKind: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1885
+ fallbackStage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1886
+ fallbackSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1464
1887
  actionOutcomes: z.ZodDefault<z.ZodArray<z.ZodObject<{
1465
1888
  actionType: z.ZodEnum<{
1466
1889
  none: "none";
@@ -1578,7 +2001,7 @@ export declare const runtimeListDecisionTracesResponseSchema: z.ZodObject<{
1578
2001
  text: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1579
2002
  }, z.core.$strip>], "type">>;
1580
2003
  }, z.core.$strip>>>;
1581
- classification: z.ZodObject<{
2004
+ classification: z.ZodOptional<z.ZodObject<{
1582
2005
  primaryIntent: z.ZodString;
1583
2006
  secondaryIntents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1584
2007
  readiness: z.ZodEnum<{
@@ -1589,7 +2012,7 @@ export declare const runtimeListDecisionTracesResponseSchema: z.ZodObject<{
1589
2012
  emotion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1590
2013
  confidence: z.ZodNumber;
1591
2014
  riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
1592
- }, z.core.$strip>;
2015
+ }, z.core.$strip>>;
1593
2016
  strategy: z.ZodObject<{
1594
2017
  selectedId: z.ZodString;
1595
2018
  candidateIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
@@ -1637,7 +2060,12 @@ export declare const runtimeListDecisionTracesResponseSchema: z.ZodObject<{
1637
2060
  }, z.core.$strip>>>;
1638
2061
  turnAnalysis: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1639
2062
  output: z.ZodObject<{
1640
- classification: z.ZodObject<{
2063
+ strategyMatches: z.ZodArray<z.ZodObject<{
2064
+ strategyId: z.ZodString;
2065
+ score: z.ZodNumber;
2066
+ reason: z.ZodString;
2067
+ }, z.core.$strip>>;
2068
+ classification: z.ZodOptional<z.ZodObject<{
1641
2069
  primaryIntent: z.ZodString;
1642
2070
  secondaryIntents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1643
2071
  readiness: z.ZodEnum<{
@@ -1648,25 +2076,8 @@ export declare const runtimeListDecisionTracesResponseSchema: z.ZodObject<{
1648
2076
  emotion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1649
2077
  confidence: z.ZodNumber;
1650
2078
  riskFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
1651
- }, z.core.$strip>;
1652
- strategy: z.ZodObject<{
1653
- selectedId: z.ZodString;
1654
- candidateIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
1655
- rationaleSummary: z.ZodString;
1656
- }, z.core.$strip>;
1657
- customerGoal: z.ZodString;
1658
- relevantProductCodes: z.ZodDefault<z.ZodArray<z.ZodString>>;
1659
- relevantPolicyIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
1660
- missingFacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
1661
- handoffSuggested: z.ZodObject<{
1662
- needed: z.ZodBoolean;
1663
- reason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1664
- priority: z.ZodDefault<z.ZodEnum<{
1665
- normal: "normal";
1666
- urgent: "urgent";
1667
- }>>;
1668
- }, z.core.$strip>;
1669
- replyGoal: z.ZodString;
2079
+ }, z.core.$strip>>;
2080
+ relevantProductCodes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1670
2081
  }, z.core.$strip>;
1671
2082
  promptMeta: z.ZodObject<{
1672
2083
  promptId: z.ZodString;
@@ -1695,6 +2106,38 @@ export declare const runtimeListDecisionTracesResponseSchema: z.ZodObject<{
1695
2106
  model: "model";
1696
2107
  }>;
1697
2108
  protocolResponseKind: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2109
+ stepHistory: z.ZodDefault<z.ZodArray<z.ZodObject<{
2110
+ stepId: z.ZodString;
2111
+ stepType: z.ZodEnum<{
2112
+ request_media_folders: "request_media_folders";
2113
+ request_media_folder_contents: "request_media_folder_contents";
2114
+ "handoff.request": "handoff.request";
2115
+ "state.cart.apply_operations": "state.cart.apply_operations";
2116
+ "channel.send_messages": "channel.send_messages";
2117
+ }>;
2118
+ status: z.ZodEnum<{
2119
+ failed: "failed";
2120
+ served: "served";
2121
+ executed: "executed";
2122
+ rejected: "rejected";
2123
+ }>;
2124
+ inputSummary: z.ZodString;
2125
+ resultSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2126
+ errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2127
+ changedStateSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2128
+ startedAt: z.ZodString;
2129
+ finishedAt: z.ZodString;
2130
+ }, z.core.$strip>>>;
2131
+ promptCache: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2132
+ cacheablePrefixHash: z.ZodString;
2133
+ volatileTailHash: z.ZodString;
2134
+ cacheKey: z.ZodString;
2135
+ cacheHit: z.ZodDefault<z.ZodBoolean>;
2136
+ }, z.core.$strip>>>;
2137
+ fallbackApplied: z.ZodDefault<z.ZodBoolean>;
2138
+ fallbackKind: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2139
+ fallbackStage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2140
+ fallbackSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1698
2141
  mediaProfileVersionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1699
2142
  mediaProfileVersionNumber: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1700
2143
  mediaDiscovery: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -1723,10 +2166,28 @@ export declare const runtimeListDecisionTracesResponseSchema: z.ZodObject<{
1723
2166
  errorMessage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1724
2167
  }, z.core.$strip>>>;
1725
2168
  }, z.core.$strip>>>;
2169
+ verificationOutput: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2170
+ status: z.ZodEnum<{
2171
+ failed: "failed";
2172
+ passed: "passed";
2173
+ }>;
2174
+ blockingIssues: z.ZodDefault<z.ZodArray<z.ZodObject<{
2175
+ type: z.ZodEnum<{
2176
+ policy_violation: "policy_violation";
2177
+ asset_reference_invalid: "asset_reference_invalid";
2178
+ cart_state_mismatch: "cart_state_mismatch";
2179
+ arithmetic_error: "arithmetic_error";
2180
+ required_step_missing: "required_step_missing";
2181
+ }>;
2182
+ message: z.ZodString;
2183
+ }, z.core.$strip>>>;
2184
+ remarks: z.ZodDefault<z.ZodArray<z.ZodString>>;
2185
+ }, z.core.$strip>>>;
1726
2186
  generationAttempts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1727
2187
  stage: z.ZodEnum<{
1728
2188
  turn_analyze: "turn_analyze";
1729
2189
  turn_decide: "turn_decide";
2190
+ verify_outcome: "verify_outcome";
1730
2191
  review_artifact: "review_artifact";
1731
2192
  review_message: "review_message";
1732
2193
  }>;
@@ -1746,6 +2207,16 @@ export declare const runtimeListDecisionTracesResponseSchema: z.ZodObject<{
1746
2207
  semanticVersion: z.ZodString;
1747
2208
  renderedHash: z.ZodString;
1748
2209
  }, z.core.$strip>;
2210
+ promptDebug: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2211
+ system: z.ZodString;
2212
+ user: z.ZodString;
2213
+ context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2214
+ templateRefs: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2215
+ systemTemplate: z.ZodString;
2216
+ userTemplate: z.ZodString;
2217
+ partials: z.ZodDefault<z.ZodArray<z.ZodString>>;
2218
+ }, z.core.$strip>>>;
2219
+ }, z.core.$strip>>>;
1749
2220
  provider: z.ZodString;
1750
2221
  modelId: z.ZodString;
1751
2222
  finishReason: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -1755,13 +2226,58 @@ export declare const runtimeListDecisionTracesResponseSchema: z.ZodObject<{
1755
2226
  totalTokens: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1756
2227
  }, z.core.$strip>>>;
1757
2228
  latencyMs: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
2229
+ providerAttemptCount: z.ZodDefault<z.ZodNumber>;
2230
+ providerRetryCount: z.ZodDefault<z.ZodNumber>;
2231
+ providerAttempts: z.ZodDefault<z.ZodArray<z.ZodObject<{
2232
+ provider: z.ZodString;
2233
+ modelId: z.ZodString;
2234
+ attemptNumber: z.ZodNumber;
2235
+ status: z.ZodEnum<{
2236
+ succeeded: "succeeded";
2237
+ failed: "failed";
2238
+ }>;
2239
+ startedAt: z.ZodString;
2240
+ finishedAt: z.ZodString;
2241
+ latencyMs: z.ZodNumber;
2242
+ retryable: z.ZodDefault<z.ZodBoolean>;
2243
+ failureCategory: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2244
+ errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2245
+ backoffMs: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
2246
+ }, z.core.$strip>>>;
2247
+ validationLayer: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
2248
+ configuration: "configuration";
2249
+ provider: "provider";
2250
+ schema_parse: "schema_parse";
2251
+ protocol_validation: "protocol_validation";
2252
+ verifier: "verifier";
2253
+ }>>>;
1758
2254
  retryContext: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1759
2255
  priorAttemptNumber: z.ZodNumber;
1760
2256
  errorSummary: z.ZodString;
1761
2257
  validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
2258
+ priorFailures: z.ZodDefault<z.ZodArray<z.ZodObject<{
2259
+ attemptNumber: z.ZodNumber;
2260
+ errorSummary: z.ZodString;
2261
+ validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
2262
+ }, z.core.$strip>>>;
1762
2263
  }, z.core.$strip>>>;
1763
2264
  validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
1764
2265
  errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2266
+ rawOutput: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
2267
+ }, z.core.$strip>>>;
2268
+ executionProfile: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2269
+ totalRuntimeMs: z.ZodDefault<z.ZodNumber>;
2270
+ analysisMs: z.ZodDefault<z.ZodNumber>;
2271
+ decisionMs: z.ZodDefault<z.ZodNumber>;
2272
+ reviewMs: z.ZodDefault<z.ZodNumber>;
2273
+ generationAttemptCount: z.ZodDefault<z.ZodNumber>;
2274
+ correctiveRetryCount: z.ZodDefault<z.ZodNumber>;
2275
+ failedAttemptCount: z.ZodDefault<z.ZodNumber>;
2276
+ providerAttemptCount: z.ZodDefault<z.ZodNumber>;
2277
+ providerRetryCount: z.ZodDefault<z.ZodNumber>;
2278
+ validationIssueCount: z.ZodDefault<z.ZodNumber>;
2279
+ slowestStage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2280
+ slowestAttemptLatencyMs: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1765
2281
  }, z.core.$strip>>>;
1766
2282
  historyPacking: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1767
2283
  rawCharacterBudget: z.ZodNumber;
@@ -1772,6 +2288,10 @@ export declare const runtimeListDecisionTracesResponseSchema: z.ZodObject<{
1772
2288
  }, z.core.$strip>>>;
1773
2289
  reviewOutput: z.ZodDefault<z.ZodNullable<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
1774
2290
  validationIssues: z.ZodDefault<z.ZodArray<z.ZodString>>;
2291
+ fallbackApplied: z.ZodDefault<z.ZodBoolean>;
2292
+ fallbackKind: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2293
+ fallbackStage: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2294
+ fallbackSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1775
2295
  actionOutcomes: z.ZodDefault<z.ZodArray<z.ZodObject<{
1776
2296
  actionType: z.ZodEnum<{
1777
2297
  none: "none";