@openai/agents-core 0.3.7 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/errors.d.ts +40 -0
  2. package/dist/errors.js +39 -1
  3. package/dist/errors.js.map +1 -1
  4. package/dist/errors.mjs +35 -0
  5. package/dist/errors.mjs.map +1 -1
  6. package/dist/index.d.ts +6 -2
  7. package/dist/index.js +13 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +3 -1
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/metadata.js +2 -2
  12. package/dist/metadata.mjs +2 -2
  13. package/dist/result.d.ts +17 -0
  14. package/dist/result.js +71 -24
  15. package/dist/result.js.map +1 -1
  16. package/dist/result.mjs +69 -22
  17. package/dist/result.mjs.map +1 -1
  18. package/dist/run.d.ts +14 -47
  19. package/dist/run.js +421 -994
  20. package/dist/run.js.map +1 -1
  21. package/dist/run.mjs +405 -978
  22. package/dist/run.mjs.map +1 -1
  23. package/dist/runState.d.ts +1286 -172
  24. package/dist/runState.js +146 -16
  25. package/dist/runState.js.map +1 -1
  26. package/dist/runState.mjs +142 -12
  27. package/dist/runState.mjs.map +1 -1
  28. package/dist/runner/constants.d.ts +1 -0
  29. package/dist/runner/constants.js +6 -0
  30. package/dist/runner/constants.js.map +1 -0
  31. package/dist/runner/constants.mjs +3 -0
  32. package/dist/runner/constants.mjs.map +1 -0
  33. package/dist/runner/conversation.d.ts +85 -0
  34. package/dist/runner/conversation.js +275 -0
  35. package/dist/runner/conversation.js.map +1 -0
  36. package/dist/runner/conversation.mjs +269 -0
  37. package/dist/runner/conversation.mjs.map +1 -0
  38. package/dist/runner/guardrails.d.ts +23 -0
  39. package/dist/runner/guardrails.js +174 -0
  40. package/dist/runner/guardrails.js.map +1 -0
  41. package/dist/runner/guardrails.mjs +166 -0
  42. package/dist/runner/guardrails.mjs.map +1 -0
  43. package/dist/runner/items.d.ts +18 -0
  44. package/dist/runner/items.js +89 -0
  45. package/dist/runner/items.js.map +1 -0
  46. package/dist/runner/items.mjs +79 -0
  47. package/dist/runner/items.mjs.map +1 -0
  48. package/dist/runner/mcpApprovals.d.ts +25 -0
  49. package/dist/runner/mcpApprovals.js +66 -0
  50. package/dist/runner/mcpApprovals.js.map +1 -0
  51. package/dist/runner/mcpApprovals.mjs +63 -0
  52. package/dist/runner/mcpApprovals.mjs.map +1 -0
  53. package/dist/runner/modelOutputs.d.ts +10 -0
  54. package/dist/runner/modelOutputs.js +206 -0
  55. package/dist/runner/modelOutputs.js.map +1 -0
  56. package/dist/runner/modelOutputs.mjs +203 -0
  57. package/dist/runner/modelOutputs.mjs.map +1 -0
  58. package/dist/runner/modelPreparation.d.ts +8 -0
  59. package/dist/runner/modelPreparation.js +41 -0
  60. package/dist/runner/modelPreparation.js.map +1 -0
  61. package/dist/runner/modelPreparation.mjs +38 -0
  62. package/dist/runner/modelPreparation.mjs.map +1 -0
  63. package/dist/runner/modelSettings.d.ts +20 -0
  64. package/dist/runner/modelSettings.js +97 -0
  65. package/dist/runner/modelSettings.js.map +1 -0
  66. package/dist/runner/modelSettings.mjs +92 -0
  67. package/dist/runner/modelSettings.mjs.map +1 -0
  68. package/dist/runner/runLoop.d.ts +32 -0
  69. package/dist/runner/runLoop.js +62 -0
  70. package/dist/runner/runLoop.js.map +1 -0
  71. package/dist/runner/runLoop.mjs +57 -0
  72. package/dist/runner/runLoop.mjs.map +1 -0
  73. package/dist/runner/sessionPersistence.d.ts +26 -0
  74. package/dist/runner/sessionPersistence.js +441 -0
  75. package/dist/runner/sessionPersistence.js.map +1 -0
  76. package/dist/runner/sessionPersistence.mjs +431 -0
  77. package/dist/runner/sessionPersistence.mjs.map +1 -0
  78. package/dist/runner/steps.d.ts +48 -0
  79. package/dist/runner/steps.js +40 -0
  80. package/dist/runner/steps.js.map +1 -0
  81. package/dist/runner/steps.mjs +36 -0
  82. package/dist/runner/steps.mjs.map +1 -0
  83. package/dist/runner/streaming.d.ts +9 -0
  84. package/dist/runner/streaming.js +74 -0
  85. package/dist/runner/streaming.js.map +1 -0
  86. package/dist/runner/streaming.mjs +65 -0
  87. package/dist/runner/streaming.mjs.map +1 -0
  88. package/dist/runner/toolExecution.d.ts +15 -0
  89. package/dist/runner/toolExecution.js +997 -0
  90. package/dist/runner/toolExecution.js.map +1 -0
  91. package/dist/runner/toolExecution.mjs +984 -0
  92. package/dist/runner/toolExecution.mjs.map +1 -0
  93. package/dist/runner/toolUseTracker.d.ts +9 -0
  94. package/dist/runner/toolUseTracker.js +34 -0
  95. package/dist/runner/toolUseTracker.js.map +1 -0
  96. package/dist/runner/toolUseTracker.mjs +30 -0
  97. package/dist/runner/toolUseTracker.mjs.map +1 -0
  98. package/dist/runner/tracing.d.ts +23 -0
  99. package/dist/runner/tracing.js +45 -0
  100. package/dist/runner/tracing.js.map +1 -0
  101. package/dist/runner/tracing.mjs +41 -0
  102. package/dist/runner/tracing.mjs.map +1 -0
  103. package/dist/runner/turnPreparation.d.ts +30 -0
  104. package/dist/runner/turnPreparation.js +80 -0
  105. package/dist/runner/turnPreparation.js.map +1 -0
  106. package/dist/runner/turnPreparation.mjs +74 -0
  107. package/dist/runner/turnPreparation.mjs.map +1 -0
  108. package/dist/runner/turnResolution.d.ts +3 -0
  109. package/dist/runner/turnResolution.js +531 -0
  110. package/dist/runner/turnResolution.js.map +1 -0
  111. package/dist/runner/turnResolution.mjs +526 -0
  112. package/dist/runner/turnResolution.mjs.map +1 -0
  113. package/dist/runner/types.d.ts +66 -0
  114. package/dist/runner/types.js +3 -0
  115. package/dist/runner/types.js.map +1 -0
  116. package/dist/runner/types.mjs +2 -0
  117. package/dist/runner/types.mjs.map +1 -0
  118. package/dist/shims/mcp-server/node.js +51 -6
  119. package/dist/shims/mcp-server/node.js.map +1 -1
  120. package/dist/shims/mcp-server/node.mjs +51 -6
  121. package/dist/shims/mcp-server/node.mjs.map +1 -1
  122. package/dist/tool.d.ts +28 -2
  123. package/dist/tool.js +7 -1
  124. package/dist/tool.js.map +1 -1
  125. package/dist/tool.mjs +8 -2
  126. package/dist/tool.mjs.map +1 -1
  127. package/dist/toolGuardrail.d.ts +101 -0
  128. package/dist/toolGuardrail.js +58 -0
  129. package/dist/toolGuardrail.js.map +1 -0
  130. package/dist/toolGuardrail.mjs +51 -0
  131. package/dist/toolGuardrail.mjs.map +1 -0
  132. package/dist/tracing/config.d.ts +3 -0
  133. package/dist/tracing/config.js +3 -0
  134. package/dist/tracing/config.js.map +1 -0
  135. package/dist/tracing/config.mjs +2 -0
  136. package/dist/tracing/config.mjs.map +1 -0
  137. package/dist/tracing/context.d.ts +2 -0
  138. package/dist/tracing/context.js +95 -24
  139. package/dist/tracing/context.js.map +1 -1
  140. package/dist/tracing/context.mjs +95 -24
  141. package/dist/tracing/context.mjs.map +1 -1
  142. package/dist/tracing/createSpans.d.ts +11 -11
  143. package/dist/tracing/index.d.ts +2 -0
  144. package/dist/tracing/index.js.map +1 -1
  145. package/dist/tracing/index.mjs.map +1 -1
  146. package/dist/tracing/provider.js +54 -4
  147. package/dist/tracing/provider.js.map +1 -1
  148. package/dist/tracing/provider.mjs +54 -4
  149. package/dist/tracing/provider.mjs.map +1 -1
  150. package/dist/tracing/spans.d.ts +2 -0
  151. package/dist/tracing/spans.js +6 -0
  152. package/dist/tracing/spans.js.map +1 -1
  153. package/dist/tracing/spans.mjs +6 -0
  154. package/dist/tracing/spans.mjs.map +1 -1
  155. package/dist/tracing/traces.d.ts +11 -1
  156. package/dist/tracing/traces.js +15 -2
  157. package/dist/tracing/traces.js.map +1 -1
  158. package/dist/tracing/traces.mjs +15 -2
  159. package/dist/tracing/traces.mjs.map +1 -1
  160. package/dist/types/protocol.d.ts +11 -0
  161. package/dist/types/protocol.js +1 -0
  162. package/dist/types/protocol.js.map +1 -1
  163. package/dist/types/protocol.mjs +1 -0
  164. package/dist/types/protocol.mjs.map +1 -1
  165. package/dist/utils/binary.d.ts +6 -0
  166. package/dist/utils/binary.js +53 -0
  167. package/dist/utils/binary.js.map +1 -0
  168. package/dist/utils/binary.mjs +49 -0
  169. package/dist/utils/binary.mjs.map +1 -0
  170. package/dist/utils/toolGuardrails.d.ts +24 -0
  171. package/dist/utils/toolGuardrails.js +58 -0
  172. package/dist/utils/toolGuardrails.js.map +1 -0
  173. package/dist/utils/toolGuardrails.mjs +54 -0
  174. package/dist/utils/toolGuardrails.mjs.map +1 -0
  175. package/package.json +4 -3
  176. package/dist/runImplementation.d.ts +0 -161
  177. package/dist/runImplementation.js +0 -2054
  178. package/dist/runImplementation.js.map +0 -1
  179. package/dist/runImplementation.mjs +0 -2028
  180. package/dist/runImplementation.mjs.map +0 -1
@@ -3,19 +3,27 @@ import { Agent } from './agent';
3
3
  import { RunItem, RunToolApprovalItem } from './items';
4
4
  import type { ModelResponse } from './model';
5
5
  import { RunContext } from './runContext';
6
- import { AgentToolUseTracker, NextStep, ProcessedResponse } from './runImplementation';
7
- import type { AgentSpanData } from './tracing/spans';
8
- import type { Span } from './tracing/spans';
6
+ import { AgentToolUseTracker } from './runner/toolUseTracker';
7
+ import { NextStep } from './runner/steps';
8
+ import type { ProcessedResponse } from './runner/types';
9
+ import type { AgentSpanData, Span } from './tracing/spans';
9
10
  import { Usage } from './usage';
10
11
  import { Trace } from './tracing/traces';
11
12
  import { AgentInputItem } from './types';
12
13
  import type { InputGuardrailResult, OutputGuardrailResult } from './guardrail';
14
+ import type { ToolInputGuardrailResult, ToolOutputGuardrailResult } from './toolGuardrail';
13
15
  /**
14
16
  * The schema version of the serialized run state. This is used to ensure that the serialized
15
17
  * run state is compatible with the current version of the SDK.
16
18
  * If anything in this schema changes, the version will have to be incremented.
19
+ *
20
+ * Version history.
21
+ * - 1.0: Initial serialized RunState schema.
22
+ * - 1.1: Adds optional currentTurnInProgress, conversationId, and previousResponseId fields,
23
+ * plus broader tool_call_output_item rawItem variants for non-function tools. Older 1.0
24
+ * payloads remain readable but resumes may lack mid-turn or server-managed context precision.
17
25
  */
18
- export declare const CURRENT_SCHEMA_VERSION: "1.0";
26
+ export declare const CURRENT_SCHEMA_VERSION: "1.1";
19
27
  declare const serializedSpanBase: z.ZodObject<{
20
28
  object: z.ZodLiteral<"trace.span">;
21
29
  id: z.ZodString;
@@ -41,11 +49,11 @@ declare const serializedSpanBase: z.ZodObject<{
41
49
  parent_id: string | null;
42
50
  started_at: string | null;
43
51
  ended_at: string | null;
52
+ span_data: Record<string, any>;
44
53
  error: {
45
54
  message: string;
46
55
  data?: Record<string, any> | undefined;
47
56
  } | null;
48
- span_data: Record<string, any>;
49
57
  }, {
50
58
  object: "trace.span";
51
59
  id: string;
@@ -53,17 +61,17 @@ declare const serializedSpanBase: z.ZodObject<{
53
61
  parent_id: string | null;
54
62
  started_at: string | null;
55
63
  ended_at: string | null;
64
+ span_data: Record<string, any>;
56
65
  error: {
57
66
  message: string;
58
67
  data?: Record<string, any> | undefined;
59
68
  } | null;
60
- span_data: Record<string, any>;
61
69
  }>;
62
70
  type SerializedSpanType = z.infer<typeof serializedSpanBase> & {
63
71
  previous_span?: SerializedSpanType;
64
72
  };
65
73
  export declare const SerializedRunState: z.ZodObject<{
66
- $schemaVersion: z.ZodLiteral<"1.0">;
74
+ $schemaVersion: z.ZodEnum<["1.0", "1.1"]>;
67
75
  currentTurn: z.ZodNumber;
68
76
  currentAgent: z.ZodObject<{
69
77
  name: z.ZodString;
@@ -3218,28 +3226,209 @@ export declare const SerializedRunState: z.ZodObject<{
3218
3226
  tripwireTriggered: boolean;
3219
3227
  outputInfo?: any;
3220
3228
  };
3229
+ agent: {
3230
+ name: string;
3231
+ };
3221
3232
  guardrail: {
3222
3233
  type: "output";
3223
3234
  name: string;
3224
3235
  };
3236
+ agentOutput?: any;
3237
+ }, {
3238
+ output: {
3239
+ tripwireTriggered: boolean;
3240
+ outputInfo?: any;
3241
+ };
3225
3242
  agent: {
3226
3243
  name: string;
3227
3244
  };
3245
+ guardrail: {
3246
+ type: "output";
3247
+ name: string;
3248
+ };
3228
3249
  agentOutput?: any;
3250
+ }>, "many">;
3251
+ toolInputGuardrailResults: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
3252
+ guardrail: z.ZodObject<{
3253
+ name: z.ZodString;
3254
+ } & {
3255
+ type: z.ZodLiteral<"tool_input">;
3256
+ }, "strip", z.ZodTypeAny, {
3257
+ type: "tool_input";
3258
+ name: string;
3259
+ }, {
3260
+ type: "tool_input";
3261
+ name: string;
3262
+ }>;
3263
+ output: z.ZodObject<{
3264
+ outputInfo: z.ZodOptional<z.ZodAny>;
3265
+ behavior: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3266
+ type: z.ZodLiteral<"allow">;
3267
+ }, "strip", z.ZodTypeAny, {
3268
+ type: "allow";
3269
+ }, {
3270
+ type: "allow";
3271
+ }>, z.ZodObject<{
3272
+ type: z.ZodLiteral<"rejectContent">;
3273
+ message: z.ZodString;
3274
+ }, "strip", z.ZodTypeAny, {
3275
+ message: string;
3276
+ type: "rejectContent";
3277
+ }, {
3278
+ message: string;
3279
+ type: "rejectContent";
3280
+ }>, z.ZodObject<{
3281
+ type: z.ZodLiteral<"throwException">;
3282
+ }, "strip", z.ZodTypeAny, {
3283
+ type: "throwException";
3284
+ }, {
3285
+ type: "throwException";
3286
+ }>]>;
3287
+ }, "strip", z.ZodTypeAny, {
3288
+ behavior: {
3289
+ type: "allow";
3290
+ } | {
3291
+ message: string;
3292
+ type: "rejectContent";
3293
+ } | {
3294
+ type: "throwException";
3295
+ };
3296
+ outputInfo?: any;
3297
+ }, {
3298
+ behavior: {
3299
+ type: "allow";
3300
+ } | {
3301
+ message: string;
3302
+ type: "rejectContent";
3303
+ } | {
3304
+ type: "throwException";
3305
+ };
3306
+ outputInfo?: any;
3307
+ }>;
3308
+ }, "strip", z.ZodTypeAny, {
3309
+ output: {
3310
+ behavior: {
3311
+ type: "allow";
3312
+ } | {
3313
+ message: string;
3314
+ type: "rejectContent";
3315
+ } | {
3316
+ type: "throwException";
3317
+ };
3318
+ outputInfo?: any;
3319
+ };
3320
+ guardrail: {
3321
+ type: "tool_input";
3322
+ name: string;
3323
+ };
3229
3324
  }, {
3230
3325
  output: {
3231
- tripwireTriggered: boolean;
3326
+ behavior: {
3327
+ type: "allow";
3328
+ } | {
3329
+ message: string;
3330
+ type: "rejectContent";
3331
+ } | {
3332
+ type: "throwException";
3333
+ };
3232
3334
  outputInfo?: any;
3233
3335
  };
3234
3336
  guardrail: {
3235
- type: "output";
3337
+ type: "tool_input";
3236
3338
  name: string;
3237
3339
  };
3238
- agent: {
3340
+ }>, "many">>>;
3341
+ toolOutputGuardrailResults: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
3342
+ guardrail: z.ZodObject<{
3343
+ name: z.ZodString;
3344
+ } & {
3345
+ type: z.ZodLiteral<"tool_output">;
3346
+ }, "strip", z.ZodTypeAny, {
3347
+ type: "tool_output";
3348
+ name: string;
3349
+ }, {
3350
+ type: "tool_output";
3351
+ name: string;
3352
+ }>;
3353
+ output: z.ZodObject<{
3354
+ outputInfo: z.ZodOptional<z.ZodAny>;
3355
+ behavior: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3356
+ type: z.ZodLiteral<"allow">;
3357
+ }, "strip", z.ZodTypeAny, {
3358
+ type: "allow";
3359
+ }, {
3360
+ type: "allow";
3361
+ }>, z.ZodObject<{
3362
+ type: z.ZodLiteral<"rejectContent">;
3363
+ message: z.ZodString;
3364
+ }, "strip", z.ZodTypeAny, {
3365
+ message: string;
3366
+ type: "rejectContent";
3367
+ }, {
3368
+ message: string;
3369
+ type: "rejectContent";
3370
+ }>, z.ZodObject<{
3371
+ type: z.ZodLiteral<"throwException">;
3372
+ }, "strip", z.ZodTypeAny, {
3373
+ type: "throwException";
3374
+ }, {
3375
+ type: "throwException";
3376
+ }>]>;
3377
+ }, "strip", z.ZodTypeAny, {
3378
+ behavior: {
3379
+ type: "allow";
3380
+ } | {
3381
+ message: string;
3382
+ type: "rejectContent";
3383
+ } | {
3384
+ type: "throwException";
3385
+ };
3386
+ outputInfo?: any;
3387
+ }, {
3388
+ behavior: {
3389
+ type: "allow";
3390
+ } | {
3391
+ message: string;
3392
+ type: "rejectContent";
3393
+ } | {
3394
+ type: "throwException";
3395
+ };
3396
+ outputInfo?: any;
3397
+ }>;
3398
+ }, "strip", z.ZodTypeAny, {
3399
+ output: {
3400
+ behavior: {
3401
+ type: "allow";
3402
+ } | {
3403
+ message: string;
3404
+ type: "rejectContent";
3405
+ } | {
3406
+ type: "throwException";
3407
+ };
3408
+ outputInfo?: any;
3409
+ };
3410
+ guardrail: {
3411
+ type: "tool_output";
3239
3412
  name: string;
3240
3413
  };
3241
- agentOutput?: any;
3242
- }>, "many">;
3414
+ }, {
3415
+ output: {
3416
+ behavior: {
3417
+ type: "allow";
3418
+ } | {
3419
+ message: string;
3420
+ type: "rejectContent";
3421
+ } | {
3422
+ type: "throwException";
3423
+ };
3424
+ outputInfo?: any;
3425
+ };
3426
+ guardrail: {
3427
+ type: "tool_output";
3428
+ name: string;
3429
+ };
3430
+ }>, "many">>>;
3431
+ currentTurnInProgress: z.ZodOptional<z.ZodBoolean>;
3243
3432
  currentStep: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3244
3433
  type: z.ZodLiteral<"next_step_handoff">;
3245
3434
  newAgent: z.ZodAny;
@@ -5718,7 +5907,7 @@ export declare const SerializedRunState: z.ZodObject<{
5718
5907
  };
5719
5908
  }>, z.ZodObject<{
5720
5909
  type: z.ZodLiteral<"tool_call_output_item">;
5721
- rawItem: z.ZodObject<{
5910
+ rawItem: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5722
5911
  providerData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
5723
5912
  } & {
5724
5913
  id: z.ZodOptional<z.ZodString>;
@@ -6046,144 +6235,412 @@ export declare const SerializedRunState: z.ZodObject<{
6046
6235
  callId: string;
6047
6236
  providerData?: Record<string, any> | undefined;
6048
6237
  id?: string | undefined;
6049
- }>;
6050
- agent: z.ZodObject<{
6051
- name: z.ZodString;
6052
- }, "strip", z.ZodTypeAny, {
6053
- name: string;
6054
- }, {
6055
- name: string;
6056
- }>;
6057
- output: z.ZodString;
6058
- }, "strip", z.ZodTypeAny, {
6059
- type: "tool_call_output_item";
6060
- output: string;
6061
- agent: {
6062
- name: string;
6063
- };
6064
- rawItem: {
6065
- type: "function_call_result";
6066
- status: "in_progress" | "completed" | "incomplete";
6067
- name: string;
6068
- output: string | {
6069
- type: "text";
6070
- text: string;
6071
- providerData?: Record<string, any> | undefined;
6072
- } | {
6073
- type: "image";
6074
- providerData?: Record<string, any> | undefined;
6075
- image?: string | {
6076
- data: string | Uint8Array<ArrayBuffer>;
6077
- mediaType?: string | undefined;
6078
- } | {
6079
- url: string;
6080
- } | {
6081
- fileId: string;
6082
- } | undefined;
6083
- detail?: "low" | "high" | "auto" | (string & {}) | undefined;
6084
- } | {
6085
- type: "file";
6086
- file: string | {
6087
- filename: string;
6088
- data: string | Uint8Array<ArrayBuffer>;
6089
- mediaType: string;
6090
- } | {
6091
- url: string;
6092
- filename?: string | undefined;
6093
- } | {
6094
- id: string;
6095
- filename?: string | undefined;
6096
- };
6097
- providerData?: Record<string, any> | undefined;
6098
- } | ({
6099
- type: "input_text";
6100
- text: string;
6238
+ }>, z.ZodObject<{
6239
+ providerData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6240
+ } & {
6241
+ id: z.ZodOptional<z.ZodString>;
6242
+ } & {
6243
+ type: z.ZodLiteral<"computer_call_result">;
6244
+ callId: z.ZodString;
6245
+ output: z.ZodObject<{
6246
+ providerData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6247
+ } & {
6248
+ type: z.ZodLiteral<"computer_screenshot">;
6249
+ data: z.ZodString;
6250
+ }, "strip", z.ZodTypeAny, {
6251
+ type: "computer_screenshot";
6252
+ data: string;
6101
6253
  providerData?: Record<string, any> | undefined;
6102
- } | {
6103
- type: "input_image";
6254
+ }, {
6255
+ type: "computer_screenshot";
6256
+ data: string;
6104
6257
  providerData?: Record<string, any> | undefined;
6105
- image?: string | {
6106
- id: string;
6107
- } | undefined;
6108
- detail?: string | undefined;
6109
- } | {
6110
- type: "input_file";
6258
+ }>;
6259
+ }, "strip", z.ZodTypeAny, {
6260
+ type: "computer_call_result";
6261
+ output: {
6262
+ type: "computer_screenshot";
6263
+ data: string;
6111
6264
  providerData?: Record<string, any> | undefined;
6112
- file?: string | {
6113
- id: string;
6114
- } | {
6115
- url: string;
6116
- } | undefined;
6117
- filename?: string | undefined;
6118
- })[];
6265
+ };
6119
6266
  callId: string;
6120
6267
  providerData?: Record<string, any> | undefined;
6121
6268
  id?: string | undefined;
6122
- };
6123
- }, {
6124
- type: "tool_call_output_item";
6125
- output: string;
6126
- agent: {
6127
- name: string;
6128
- };
6129
- rawItem: {
6130
- type: "function_call_result";
6131
- status: "in_progress" | "completed" | "incomplete";
6132
- name: string;
6133
- output: string | {
6134
- type: "text";
6135
- text: string;
6136
- providerData?: Record<string, any> | undefined;
6137
- } | {
6138
- type: "image";
6139
- providerData?: Record<string, any> | undefined;
6140
- image?: string | {
6141
- data: string | Uint8Array<ArrayBuffer>;
6142
- mediaType?: string | undefined;
6143
- } | {
6144
- url: string;
6145
- } | {
6146
- fileId: string;
6147
- } | undefined;
6148
- detail?: "low" | "high" | "auto" | (string & {}) | undefined;
6149
- } | {
6150
- type: "file";
6151
- file: string | {
6152
- filename: string;
6153
- data: string | Uint8Array<ArrayBuffer>;
6154
- mediaType: string;
6155
- } | {
6156
- url: string;
6157
- filename?: string | undefined;
6158
- } | {
6159
- id: string;
6160
- filename?: string | undefined;
6161
- };
6162
- providerData?: Record<string, any> | undefined;
6163
- } | ({
6164
- type: "input_text";
6165
- text: string;
6166
- providerData?: Record<string, any> | undefined;
6167
- } | {
6168
- type: "input_image";
6169
- providerData?: Record<string, any> | undefined;
6170
- image?: string | {
6171
- id: string;
6172
- } | undefined;
6173
- detail?: string | undefined;
6174
- } | {
6175
- type: "input_file";
6269
+ }, {
6270
+ type: "computer_call_result";
6271
+ output: {
6272
+ type: "computer_screenshot";
6273
+ data: string;
6176
6274
  providerData?: Record<string, any> | undefined;
6177
- file?: string | {
6178
- id: string;
6179
- } | {
6180
- url: string;
6181
- } | undefined;
6182
- filename?: string | undefined;
6275
+ };
6276
+ callId: string;
6277
+ providerData?: Record<string, any> | undefined;
6278
+ id?: string | undefined;
6279
+ }>]>, z.ZodObject<{
6280
+ providerData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6281
+ } & {
6282
+ id: z.ZodOptional<z.ZodString>;
6283
+ } & {
6284
+ type: z.ZodLiteral<"shell_call_output">;
6285
+ callId: z.ZodString;
6286
+ maxOutputLength: z.ZodOptional<z.ZodNumber>;
6287
+ output: z.ZodArray<z.ZodObject<{
6288
+ stdout: z.ZodString;
6289
+ stderr: z.ZodString;
6290
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6291
+ type: z.ZodLiteral<"timeout">;
6292
+ }, "strip", z.ZodTypeAny, {
6293
+ type: "timeout";
6294
+ }, {
6295
+ type: "timeout";
6296
+ }>, z.ZodObject<{
6297
+ type: z.ZodLiteral<"exit">;
6298
+ exitCode: z.ZodNullable<z.ZodNumber>;
6299
+ }, "strip", z.ZodTypeAny, {
6300
+ type: "exit";
6301
+ exitCode: number | null;
6302
+ }, {
6303
+ type: "exit";
6304
+ exitCode: number | null;
6305
+ }>]>;
6306
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
6307
+ stdout: z.ZodString;
6308
+ stderr: z.ZodString;
6309
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6310
+ type: z.ZodLiteral<"timeout">;
6311
+ }, "strip", z.ZodTypeAny, {
6312
+ type: "timeout";
6313
+ }, {
6314
+ type: "timeout";
6315
+ }>, z.ZodObject<{
6316
+ type: z.ZodLiteral<"exit">;
6317
+ exitCode: z.ZodNullable<z.ZodNumber>;
6318
+ }, "strip", z.ZodTypeAny, {
6319
+ type: "exit";
6320
+ exitCode: number | null;
6321
+ }, {
6322
+ type: "exit";
6323
+ exitCode: number | null;
6324
+ }>]>;
6325
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
6326
+ stdout: z.ZodString;
6327
+ stderr: z.ZodString;
6328
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6329
+ type: z.ZodLiteral<"timeout">;
6330
+ }, "strip", z.ZodTypeAny, {
6331
+ type: "timeout";
6332
+ }, {
6333
+ type: "timeout";
6334
+ }>, z.ZodObject<{
6335
+ type: z.ZodLiteral<"exit">;
6336
+ exitCode: z.ZodNullable<z.ZodNumber>;
6337
+ }, "strip", z.ZodTypeAny, {
6338
+ type: "exit";
6339
+ exitCode: number | null;
6340
+ }, {
6341
+ type: "exit";
6342
+ exitCode: number | null;
6343
+ }>]>;
6344
+ }, z.ZodTypeAny, "passthrough">>, "many">;
6345
+ }, "strip", z.ZodTypeAny, {
6346
+ type: "shell_call_output";
6347
+ output: z.objectOutputType<{
6348
+ stdout: z.ZodString;
6349
+ stderr: z.ZodString;
6350
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6351
+ type: z.ZodLiteral<"timeout">;
6352
+ }, "strip", z.ZodTypeAny, {
6353
+ type: "timeout";
6354
+ }, {
6355
+ type: "timeout";
6356
+ }>, z.ZodObject<{
6357
+ type: z.ZodLiteral<"exit">;
6358
+ exitCode: z.ZodNullable<z.ZodNumber>;
6359
+ }, "strip", z.ZodTypeAny, {
6360
+ type: "exit";
6361
+ exitCode: number | null;
6362
+ }, {
6363
+ type: "exit";
6364
+ exitCode: number | null;
6365
+ }>]>;
6366
+ }, z.ZodTypeAny, "passthrough">[];
6367
+ callId: string;
6368
+ providerData?: Record<string, any> | undefined;
6369
+ id?: string | undefined;
6370
+ maxOutputLength?: number | undefined;
6371
+ }, {
6372
+ type: "shell_call_output";
6373
+ output: z.objectInputType<{
6374
+ stdout: z.ZodString;
6375
+ stderr: z.ZodString;
6376
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6377
+ type: z.ZodLiteral<"timeout">;
6378
+ }, "strip", z.ZodTypeAny, {
6379
+ type: "timeout";
6380
+ }, {
6381
+ type: "timeout";
6382
+ }>, z.ZodObject<{
6383
+ type: z.ZodLiteral<"exit">;
6384
+ exitCode: z.ZodNullable<z.ZodNumber>;
6385
+ }, "strip", z.ZodTypeAny, {
6386
+ type: "exit";
6387
+ exitCode: number | null;
6388
+ }, {
6389
+ type: "exit";
6390
+ exitCode: number | null;
6391
+ }>]>;
6392
+ }, z.ZodTypeAny, "passthrough">[];
6393
+ callId: string;
6394
+ providerData?: Record<string, any> | undefined;
6395
+ id?: string | undefined;
6396
+ maxOutputLength?: number | undefined;
6397
+ }>]>, z.ZodObject<{
6398
+ providerData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
6399
+ } & {
6400
+ id: z.ZodOptional<z.ZodString>;
6401
+ } & {
6402
+ type: z.ZodLiteral<"apply_patch_call_output">;
6403
+ callId: z.ZodString;
6404
+ status: z.ZodEnum<["completed", "failed"]>;
6405
+ output: z.ZodOptional<z.ZodString>;
6406
+ }, "strip", z.ZodTypeAny, {
6407
+ type: "apply_patch_call_output";
6408
+ status: "completed" | "failed";
6409
+ callId: string;
6410
+ providerData?: Record<string, any> | undefined;
6411
+ id?: string | undefined;
6412
+ output?: string | undefined;
6413
+ }, {
6414
+ type: "apply_patch_call_output";
6415
+ status: "completed" | "failed";
6416
+ callId: string;
6417
+ providerData?: Record<string, any> | undefined;
6418
+ id?: string | undefined;
6419
+ output?: string | undefined;
6420
+ }>]>;
6421
+ agent: z.ZodObject<{
6422
+ name: z.ZodString;
6423
+ }, "strip", z.ZodTypeAny, {
6424
+ name: string;
6425
+ }, {
6426
+ name: string;
6427
+ }>;
6428
+ output: z.ZodString;
6429
+ }, "strip", z.ZodTypeAny, {
6430
+ type: "tool_call_output_item";
6431
+ output: string;
6432
+ agent: {
6433
+ name: string;
6434
+ };
6435
+ rawItem: {
6436
+ type: "function_call_result";
6437
+ status: "in_progress" | "completed" | "incomplete";
6438
+ name: string;
6439
+ output: string | {
6440
+ type: "text";
6441
+ text: string;
6442
+ providerData?: Record<string, any> | undefined;
6443
+ } | {
6444
+ type: "image";
6445
+ providerData?: Record<string, any> | undefined;
6446
+ image?: string | {
6447
+ data: string | Uint8Array<ArrayBuffer>;
6448
+ mediaType?: string | undefined;
6449
+ } | {
6450
+ url: string;
6451
+ } | {
6452
+ fileId: string;
6453
+ } | undefined;
6454
+ detail?: "low" | "high" | "auto" | (string & {}) | undefined;
6455
+ } | {
6456
+ type: "file";
6457
+ file: string | {
6458
+ filename: string;
6459
+ data: string | Uint8Array<ArrayBuffer>;
6460
+ mediaType: string;
6461
+ } | {
6462
+ url: string;
6463
+ filename?: string | undefined;
6464
+ } | {
6465
+ id: string;
6466
+ filename?: string | undefined;
6467
+ };
6468
+ providerData?: Record<string, any> | undefined;
6469
+ } | ({
6470
+ type: "input_text";
6471
+ text: string;
6472
+ providerData?: Record<string, any> | undefined;
6473
+ } | {
6474
+ type: "input_image";
6475
+ providerData?: Record<string, any> | undefined;
6476
+ image?: string | {
6477
+ id: string;
6478
+ } | undefined;
6479
+ detail?: string | undefined;
6480
+ } | {
6481
+ type: "input_file";
6482
+ providerData?: Record<string, any> | undefined;
6483
+ file?: string | {
6484
+ id: string;
6485
+ } | {
6486
+ url: string;
6487
+ } | undefined;
6488
+ filename?: string | undefined;
6489
+ })[];
6490
+ callId: string;
6491
+ providerData?: Record<string, any> | undefined;
6492
+ id?: string | undefined;
6493
+ } | {
6494
+ type: "computer_call_result";
6495
+ output: {
6496
+ type: "computer_screenshot";
6497
+ data: string;
6498
+ providerData?: Record<string, any> | undefined;
6499
+ };
6500
+ callId: string;
6501
+ providerData?: Record<string, any> | undefined;
6502
+ id?: string | undefined;
6503
+ } | {
6504
+ type: "shell_call_output";
6505
+ output: z.objectOutputType<{
6506
+ stdout: z.ZodString;
6507
+ stderr: z.ZodString;
6508
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6509
+ type: z.ZodLiteral<"timeout">;
6510
+ }, "strip", z.ZodTypeAny, {
6511
+ type: "timeout";
6512
+ }, {
6513
+ type: "timeout";
6514
+ }>, z.ZodObject<{
6515
+ type: z.ZodLiteral<"exit">;
6516
+ exitCode: z.ZodNullable<z.ZodNumber>;
6517
+ }, "strip", z.ZodTypeAny, {
6518
+ type: "exit";
6519
+ exitCode: number | null;
6520
+ }, {
6521
+ type: "exit";
6522
+ exitCode: number | null;
6523
+ }>]>;
6524
+ }, z.ZodTypeAny, "passthrough">[];
6525
+ callId: string;
6526
+ providerData?: Record<string, any> | undefined;
6527
+ id?: string | undefined;
6528
+ maxOutputLength?: number | undefined;
6529
+ } | {
6530
+ type: "apply_patch_call_output";
6531
+ status: "completed" | "failed";
6532
+ callId: string;
6533
+ providerData?: Record<string, any> | undefined;
6534
+ id?: string | undefined;
6535
+ output?: string | undefined;
6536
+ };
6537
+ }, {
6538
+ type: "tool_call_output_item";
6539
+ output: string;
6540
+ agent: {
6541
+ name: string;
6542
+ };
6543
+ rawItem: {
6544
+ type: "function_call_result";
6545
+ status: "in_progress" | "completed" | "incomplete";
6546
+ name: string;
6547
+ output: string | {
6548
+ type: "text";
6549
+ text: string;
6550
+ providerData?: Record<string, any> | undefined;
6551
+ } | {
6552
+ type: "image";
6553
+ providerData?: Record<string, any> | undefined;
6554
+ image?: string | {
6555
+ data: string | Uint8Array<ArrayBuffer>;
6556
+ mediaType?: string | undefined;
6557
+ } | {
6558
+ url: string;
6559
+ } | {
6560
+ fileId: string;
6561
+ } | undefined;
6562
+ detail?: "low" | "high" | "auto" | (string & {}) | undefined;
6563
+ } | {
6564
+ type: "file";
6565
+ file: string | {
6566
+ filename: string;
6567
+ data: string | Uint8Array<ArrayBuffer>;
6568
+ mediaType: string;
6569
+ } | {
6570
+ url: string;
6571
+ filename?: string | undefined;
6572
+ } | {
6573
+ id: string;
6574
+ filename?: string | undefined;
6575
+ };
6576
+ providerData?: Record<string, any> | undefined;
6577
+ } | ({
6578
+ type: "input_text";
6579
+ text: string;
6580
+ providerData?: Record<string, any> | undefined;
6581
+ } | {
6582
+ type: "input_image";
6583
+ providerData?: Record<string, any> | undefined;
6584
+ image?: string | {
6585
+ id: string;
6586
+ } | undefined;
6587
+ detail?: string | undefined;
6588
+ } | {
6589
+ type: "input_file";
6590
+ providerData?: Record<string, any> | undefined;
6591
+ file?: string | {
6592
+ id: string;
6593
+ } | {
6594
+ url: string;
6595
+ } | undefined;
6596
+ filename?: string | undefined;
6183
6597
  })[];
6184
6598
  callId: string;
6185
6599
  providerData?: Record<string, any> | undefined;
6186
6600
  id?: string | undefined;
6601
+ } | {
6602
+ type: "computer_call_result";
6603
+ output: {
6604
+ type: "computer_screenshot";
6605
+ data: string;
6606
+ providerData?: Record<string, any> | undefined;
6607
+ };
6608
+ callId: string;
6609
+ providerData?: Record<string, any> | undefined;
6610
+ id?: string | undefined;
6611
+ } | {
6612
+ type: "shell_call_output";
6613
+ output: z.objectInputType<{
6614
+ stdout: z.ZodString;
6615
+ stderr: z.ZodString;
6616
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
6617
+ type: z.ZodLiteral<"timeout">;
6618
+ }, "strip", z.ZodTypeAny, {
6619
+ type: "timeout";
6620
+ }, {
6621
+ type: "timeout";
6622
+ }>, z.ZodObject<{
6623
+ type: z.ZodLiteral<"exit">;
6624
+ exitCode: z.ZodNullable<z.ZodNumber>;
6625
+ }, "strip", z.ZodTypeAny, {
6626
+ type: "exit";
6627
+ exitCode: number | null;
6628
+ }, {
6629
+ type: "exit";
6630
+ exitCode: number | null;
6631
+ }>]>;
6632
+ }, z.ZodTypeAny, "passthrough">[];
6633
+ callId: string;
6634
+ providerData?: Record<string, any> | undefined;
6635
+ id?: string | undefined;
6636
+ maxOutputLength?: number | undefined;
6637
+ } | {
6638
+ type: "apply_patch_call_output";
6639
+ status: "completed" | "failed";
6640
+ callId: string;
6641
+ providerData?: Record<string, any> | undefined;
6642
+ id?: string | undefined;
6643
+ output?: string | undefined;
6187
6644
  };
6188
6645
  }>, z.ZodObject<{
6189
6646
  type: z.ZodLiteral<"reasoning_item">;
@@ -7938,7 +8395,7 @@ export declare const SerializedRunState: z.ZodObject<{
7938
8395
  };
7939
8396
  }>, z.ZodObject<{
7940
8397
  type: z.ZodLiteral<"tool_call_output_item">;
7941
- rawItem: z.ZodObject<{
8398
+ rawItem: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
7942
8399
  providerData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
7943
8400
  } & {
7944
8401
  id: z.ZodOptional<z.ZodString>;
@@ -8266,7 +8723,189 @@ export declare const SerializedRunState: z.ZodObject<{
8266
8723
  callId: string;
8267
8724
  providerData?: Record<string, any> | undefined;
8268
8725
  id?: string | undefined;
8269
- }>;
8726
+ }>, z.ZodObject<{
8727
+ providerData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8728
+ } & {
8729
+ id: z.ZodOptional<z.ZodString>;
8730
+ } & {
8731
+ type: z.ZodLiteral<"computer_call_result">;
8732
+ callId: z.ZodString;
8733
+ output: z.ZodObject<{
8734
+ providerData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8735
+ } & {
8736
+ type: z.ZodLiteral<"computer_screenshot">;
8737
+ data: z.ZodString;
8738
+ }, "strip", z.ZodTypeAny, {
8739
+ type: "computer_screenshot";
8740
+ data: string;
8741
+ providerData?: Record<string, any> | undefined;
8742
+ }, {
8743
+ type: "computer_screenshot";
8744
+ data: string;
8745
+ providerData?: Record<string, any> | undefined;
8746
+ }>;
8747
+ }, "strip", z.ZodTypeAny, {
8748
+ type: "computer_call_result";
8749
+ output: {
8750
+ type: "computer_screenshot";
8751
+ data: string;
8752
+ providerData?: Record<string, any> | undefined;
8753
+ };
8754
+ callId: string;
8755
+ providerData?: Record<string, any> | undefined;
8756
+ id?: string | undefined;
8757
+ }, {
8758
+ type: "computer_call_result";
8759
+ output: {
8760
+ type: "computer_screenshot";
8761
+ data: string;
8762
+ providerData?: Record<string, any> | undefined;
8763
+ };
8764
+ callId: string;
8765
+ providerData?: Record<string, any> | undefined;
8766
+ id?: string | undefined;
8767
+ }>]>, z.ZodObject<{
8768
+ providerData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8769
+ } & {
8770
+ id: z.ZodOptional<z.ZodString>;
8771
+ } & {
8772
+ type: z.ZodLiteral<"shell_call_output">;
8773
+ callId: z.ZodString;
8774
+ maxOutputLength: z.ZodOptional<z.ZodNumber>;
8775
+ output: z.ZodArray<z.ZodObject<{
8776
+ stdout: z.ZodString;
8777
+ stderr: z.ZodString;
8778
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
8779
+ type: z.ZodLiteral<"timeout">;
8780
+ }, "strip", z.ZodTypeAny, {
8781
+ type: "timeout";
8782
+ }, {
8783
+ type: "timeout";
8784
+ }>, z.ZodObject<{
8785
+ type: z.ZodLiteral<"exit">;
8786
+ exitCode: z.ZodNullable<z.ZodNumber>;
8787
+ }, "strip", z.ZodTypeAny, {
8788
+ type: "exit";
8789
+ exitCode: number | null;
8790
+ }, {
8791
+ type: "exit";
8792
+ exitCode: number | null;
8793
+ }>]>;
8794
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
8795
+ stdout: z.ZodString;
8796
+ stderr: z.ZodString;
8797
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
8798
+ type: z.ZodLiteral<"timeout">;
8799
+ }, "strip", z.ZodTypeAny, {
8800
+ type: "timeout";
8801
+ }, {
8802
+ type: "timeout";
8803
+ }>, z.ZodObject<{
8804
+ type: z.ZodLiteral<"exit">;
8805
+ exitCode: z.ZodNullable<z.ZodNumber>;
8806
+ }, "strip", z.ZodTypeAny, {
8807
+ type: "exit";
8808
+ exitCode: number | null;
8809
+ }, {
8810
+ type: "exit";
8811
+ exitCode: number | null;
8812
+ }>]>;
8813
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
8814
+ stdout: z.ZodString;
8815
+ stderr: z.ZodString;
8816
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
8817
+ type: z.ZodLiteral<"timeout">;
8818
+ }, "strip", z.ZodTypeAny, {
8819
+ type: "timeout";
8820
+ }, {
8821
+ type: "timeout";
8822
+ }>, z.ZodObject<{
8823
+ type: z.ZodLiteral<"exit">;
8824
+ exitCode: z.ZodNullable<z.ZodNumber>;
8825
+ }, "strip", z.ZodTypeAny, {
8826
+ type: "exit";
8827
+ exitCode: number | null;
8828
+ }, {
8829
+ type: "exit";
8830
+ exitCode: number | null;
8831
+ }>]>;
8832
+ }, z.ZodTypeAny, "passthrough">>, "many">;
8833
+ }, "strip", z.ZodTypeAny, {
8834
+ type: "shell_call_output";
8835
+ output: z.objectOutputType<{
8836
+ stdout: z.ZodString;
8837
+ stderr: z.ZodString;
8838
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
8839
+ type: z.ZodLiteral<"timeout">;
8840
+ }, "strip", z.ZodTypeAny, {
8841
+ type: "timeout";
8842
+ }, {
8843
+ type: "timeout";
8844
+ }>, z.ZodObject<{
8845
+ type: z.ZodLiteral<"exit">;
8846
+ exitCode: z.ZodNullable<z.ZodNumber>;
8847
+ }, "strip", z.ZodTypeAny, {
8848
+ type: "exit";
8849
+ exitCode: number | null;
8850
+ }, {
8851
+ type: "exit";
8852
+ exitCode: number | null;
8853
+ }>]>;
8854
+ }, z.ZodTypeAny, "passthrough">[];
8855
+ callId: string;
8856
+ providerData?: Record<string, any> | undefined;
8857
+ id?: string | undefined;
8858
+ maxOutputLength?: number | undefined;
8859
+ }, {
8860
+ type: "shell_call_output";
8861
+ output: z.objectInputType<{
8862
+ stdout: z.ZodString;
8863
+ stderr: z.ZodString;
8864
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
8865
+ type: z.ZodLiteral<"timeout">;
8866
+ }, "strip", z.ZodTypeAny, {
8867
+ type: "timeout";
8868
+ }, {
8869
+ type: "timeout";
8870
+ }>, z.ZodObject<{
8871
+ type: z.ZodLiteral<"exit">;
8872
+ exitCode: z.ZodNullable<z.ZodNumber>;
8873
+ }, "strip", z.ZodTypeAny, {
8874
+ type: "exit";
8875
+ exitCode: number | null;
8876
+ }, {
8877
+ type: "exit";
8878
+ exitCode: number | null;
8879
+ }>]>;
8880
+ }, z.ZodTypeAny, "passthrough">[];
8881
+ callId: string;
8882
+ providerData?: Record<string, any> | undefined;
8883
+ id?: string | undefined;
8884
+ maxOutputLength?: number | undefined;
8885
+ }>]>, z.ZodObject<{
8886
+ providerData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8887
+ } & {
8888
+ id: z.ZodOptional<z.ZodString>;
8889
+ } & {
8890
+ type: z.ZodLiteral<"apply_patch_call_output">;
8891
+ callId: z.ZodString;
8892
+ status: z.ZodEnum<["completed", "failed"]>;
8893
+ output: z.ZodOptional<z.ZodString>;
8894
+ }, "strip", z.ZodTypeAny, {
8895
+ type: "apply_patch_call_output";
8896
+ status: "completed" | "failed";
8897
+ callId: string;
8898
+ providerData?: Record<string, any> | undefined;
8899
+ id?: string | undefined;
8900
+ output?: string | undefined;
8901
+ }, {
8902
+ type: "apply_patch_call_output";
8903
+ status: "completed" | "failed";
8904
+ callId: string;
8905
+ providerData?: Record<string, any> | undefined;
8906
+ id?: string | undefined;
8907
+ output?: string | undefined;
8908
+ }>]>;
8270
8909
  agent: z.ZodObject<{
8271
8910
  name: z.ZodString;
8272
8911
  }, "strip", z.ZodTypeAny, {
@@ -8339,6 +8978,49 @@ export declare const SerializedRunState: z.ZodObject<{
8339
8978
  callId: string;
8340
8979
  providerData?: Record<string, any> | undefined;
8341
8980
  id?: string | undefined;
8981
+ } | {
8982
+ type: "computer_call_result";
8983
+ output: {
8984
+ type: "computer_screenshot";
8985
+ data: string;
8986
+ providerData?: Record<string, any> | undefined;
8987
+ };
8988
+ callId: string;
8989
+ providerData?: Record<string, any> | undefined;
8990
+ id?: string | undefined;
8991
+ } | {
8992
+ type: "shell_call_output";
8993
+ output: z.objectOutputType<{
8994
+ stdout: z.ZodString;
8995
+ stderr: z.ZodString;
8996
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
8997
+ type: z.ZodLiteral<"timeout">;
8998
+ }, "strip", z.ZodTypeAny, {
8999
+ type: "timeout";
9000
+ }, {
9001
+ type: "timeout";
9002
+ }>, z.ZodObject<{
9003
+ type: z.ZodLiteral<"exit">;
9004
+ exitCode: z.ZodNullable<z.ZodNumber>;
9005
+ }, "strip", z.ZodTypeAny, {
9006
+ type: "exit";
9007
+ exitCode: number | null;
9008
+ }, {
9009
+ type: "exit";
9010
+ exitCode: number | null;
9011
+ }>]>;
9012
+ }, z.ZodTypeAny, "passthrough">[];
9013
+ callId: string;
9014
+ providerData?: Record<string, any> | undefined;
9015
+ id?: string | undefined;
9016
+ maxOutputLength?: number | undefined;
9017
+ } | {
9018
+ type: "apply_patch_call_output";
9019
+ status: "completed" | "failed";
9020
+ callId: string;
9021
+ providerData?: Record<string, any> | undefined;
9022
+ id?: string | undefined;
9023
+ output?: string | undefined;
8342
9024
  };
8343
9025
  }, {
8344
9026
  type: "tool_call_output_item";
@@ -8404,6 +9086,49 @@ export declare const SerializedRunState: z.ZodObject<{
8404
9086
  callId: string;
8405
9087
  providerData?: Record<string, any> | undefined;
8406
9088
  id?: string | undefined;
9089
+ } | {
9090
+ type: "computer_call_result";
9091
+ output: {
9092
+ type: "computer_screenshot";
9093
+ data: string;
9094
+ providerData?: Record<string, any> | undefined;
9095
+ };
9096
+ callId: string;
9097
+ providerData?: Record<string, any> | undefined;
9098
+ id?: string | undefined;
9099
+ } | {
9100
+ type: "shell_call_output";
9101
+ output: z.objectInputType<{
9102
+ stdout: z.ZodString;
9103
+ stderr: z.ZodString;
9104
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
9105
+ type: z.ZodLiteral<"timeout">;
9106
+ }, "strip", z.ZodTypeAny, {
9107
+ type: "timeout";
9108
+ }, {
9109
+ type: "timeout";
9110
+ }>, z.ZodObject<{
9111
+ type: z.ZodLiteral<"exit">;
9112
+ exitCode: z.ZodNullable<z.ZodNumber>;
9113
+ }, "strip", z.ZodTypeAny, {
9114
+ type: "exit";
9115
+ exitCode: number | null;
9116
+ }, {
9117
+ type: "exit";
9118
+ exitCode: number | null;
9119
+ }>]>;
9120
+ }, z.ZodTypeAny, "passthrough">[];
9121
+ callId: string;
9122
+ providerData?: Record<string, any> | undefined;
9123
+ id?: string | undefined;
9124
+ maxOutputLength?: number | undefined;
9125
+ } | {
9126
+ type: "apply_patch_call_output";
9127
+ status: "completed" | "failed";
9128
+ callId: string;
9129
+ providerData?: Record<string, any> | undefined;
9130
+ id?: string | undefined;
9131
+ output?: string | undefined;
8407
9132
  };
8408
9133
  }>, z.ZodObject<{
8409
9134
  type: z.ZodLiteral<"reasoning_item">;
@@ -9353,11 +10078,11 @@ export declare const SerializedRunState: z.ZodObject<{
9353
10078
  toolCall: z.ZodAny;
9354
10079
  handoff: z.ZodAny;
9355
10080
  }, "strip", z.ZodTypeAny, {
9356
- toolCall?: any;
9357
10081
  handoff?: any;
9358
- }, {
9359
10082
  toolCall?: any;
10083
+ }, {
9360
10084
  handoff?: any;
10085
+ toolCall?: any;
9361
10086
  }>, "many">;
9362
10087
  functions: z.ZodArray<z.ZodObject<{
9363
10088
  toolCall: z.ZodAny;
@@ -9490,8 +10215,8 @@ export declare const SerializedRunState: z.ZodObject<{
9490
10215
  }>, "many">>;
9491
10216
  }, "strip", z.ZodTypeAny, {
9492
10217
  handoffs: {
9493
- toolCall?: any;
9494
10218
  handoff?: any;
10219
+ toolCall?: any;
9495
10220
  }[];
9496
10221
  newItems: ({
9497
10222
  type: "message_output_item";
@@ -9683,6 +10408,49 @@ export declare const SerializedRunState: z.ZodObject<{
9683
10408
  callId: string;
9684
10409
  providerData?: Record<string, any> | undefined;
9685
10410
  id?: string | undefined;
10411
+ } | {
10412
+ type: "computer_call_result";
10413
+ output: {
10414
+ type: "computer_screenshot";
10415
+ data: string;
10416
+ providerData?: Record<string, any> | undefined;
10417
+ };
10418
+ callId: string;
10419
+ providerData?: Record<string, any> | undefined;
10420
+ id?: string | undefined;
10421
+ } | {
10422
+ type: "shell_call_output";
10423
+ output: z.objectOutputType<{
10424
+ stdout: z.ZodString;
10425
+ stderr: z.ZodString;
10426
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
10427
+ type: z.ZodLiteral<"timeout">;
10428
+ }, "strip", z.ZodTypeAny, {
10429
+ type: "timeout";
10430
+ }, {
10431
+ type: "timeout";
10432
+ }>, z.ZodObject<{
10433
+ type: z.ZodLiteral<"exit">;
10434
+ exitCode: z.ZodNullable<z.ZodNumber>;
10435
+ }, "strip", z.ZodTypeAny, {
10436
+ type: "exit";
10437
+ exitCode: number | null;
10438
+ }, {
10439
+ type: "exit";
10440
+ exitCode: number | null;
10441
+ }>]>;
10442
+ }, z.ZodTypeAny, "passthrough">[];
10443
+ callId: string;
10444
+ providerData?: Record<string, any> | undefined;
10445
+ id?: string | undefined;
10446
+ maxOutputLength?: number | undefined;
10447
+ } | {
10448
+ type: "apply_patch_call_output";
10449
+ status: "completed" | "failed";
10450
+ callId: string;
10451
+ providerData?: Record<string, any> | undefined;
10452
+ id?: string | undefined;
10453
+ output?: string | undefined;
9686
10454
  };
9687
10455
  } | {
9688
10456
  type: "reasoning_item";
@@ -9874,8 +10642,8 @@ export declare const SerializedRunState: z.ZodObject<{
9874
10642
  }[] | undefined;
9875
10643
  }, {
9876
10644
  handoffs: {
9877
- toolCall?: any;
9878
10645
  handoff?: any;
10646
+ toolCall?: any;
9879
10647
  }[];
9880
10648
  newItems: ({
9881
10649
  type: "message_output_item";
@@ -10067,6 +10835,49 @@ export declare const SerializedRunState: z.ZodObject<{
10067
10835
  callId: string;
10068
10836
  providerData?: Record<string, any> | undefined;
10069
10837
  id?: string | undefined;
10838
+ } | {
10839
+ type: "computer_call_result";
10840
+ output: {
10841
+ type: "computer_screenshot";
10842
+ data: string;
10843
+ providerData?: Record<string, any> | undefined;
10844
+ };
10845
+ callId: string;
10846
+ providerData?: Record<string, any> | undefined;
10847
+ id?: string | undefined;
10848
+ } | {
10849
+ type: "shell_call_output";
10850
+ output: z.objectInputType<{
10851
+ stdout: z.ZodString;
10852
+ stderr: z.ZodString;
10853
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
10854
+ type: z.ZodLiteral<"timeout">;
10855
+ }, "strip", z.ZodTypeAny, {
10856
+ type: "timeout";
10857
+ }, {
10858
+ type: "timeout";
10859
+ }>, z.ZodObject<{
10860
+ type: z.ZodLiteral<"exit">;
10861
+ exitCode: z.ZodNullable<z.ZodNumber>;
10862
+ }, "strip", z.ZodTypeAny, {
10863
+ type: "exit";
10864
+ exitCode: number | null;
10865
+ }, {
10866
+ type: "exit";
10867
+ exitCode: number | null;
10868
+ }>]>;
10869
+ }, z.ZodTypeAny, "passthrough">[];
10870
+ callId: string;
10871
+ providerData?: Record<string, any> | undefined;
10872
+ id?: string | undefined;
10873
+ maxOutputLength?: number | undefined;
10874
+ } | {
10875
+ type: "apply_patch_call_output";
10876
+ status: "completed" | "failed";
10877
+ callId: string;
10878
+ providerData?: Record<string, any> | undefined;
10879
+ id?: string | undefined;
10880
+ output?: string | undefined;
10070
10881
  };
10071
10882
  } | {
10072
10883
  type: "reasoning_item";
@@ -10258,27 +11069,40 @@ export declare const SerializedRunState: z.ZodObject<{
10258
11069
  }[] | undefined;
10259
11070
  }>>;
10260
11071
  currentTurnPersistedItemCount: z.ZodOptional<z.ZodNumber>;
11072
+ conversationId: z.ZodOptional<z.ZodString>;
11073
+ previousResponseId: z.ZodOptional<z.ZodString>;
10261
11074
  trace: z.ZodNullable<z.ZodObject<{
10262
11075
  object: z.ZodLiteral<"trace">;
10263
11076
  id: z.ZodString;
10264
11077
  workflow_name: z.ZodString;
10265
11078
  group_id: z.ZodNullable<z.ZodString>;
10266
11079
  metadata: z.ZodRecord<z.ZodString, z.ZodAny>;
11080
+ tracing_api_key: z.ZodNullable<z.ZodOptional<z.ZodString>>;
10267
11081
  }, "strip", z.ZodTypeAny, {
10268
11082
  object: "trace";
10269
11083
  id: string;
10270
11084
  workflow_name: string;
10271
11085
  group_id: string | null;
10272
11086
  metadata: Record<string, any>;
11087
+ tracing_api_key?: string | null | undefined;
10273
11088
  }, {
10274
11089
  object: "trace";
10275
11090
  id: string;
10276
11091
  workflow_name: string;
10277
11092
  group_id: string | null;
10278
11093
  metadata: Record<string, any>;
11094
+ tracing_api_key?: string | null | undefined;
10279
11095
  }>>;
10280
11096
  }, "strip", z.ZodTypeAny, {
10281
- $schemaVersion: "1.0";
11097
+ trace: {
11098
+ object: "trace";
11099
+ id: string;
11100
+ workflow_name: string;
11101
+ group_id: string | null;
11102
+ metadata: Record<string, any>;
11103
+ tracing_api_key?: string | null | undefined;
11104
+ } | null;
11105
+ $schemaVersion: "1.0" | "1.1";
10282
11106
  currentTurn: number;
10283
11107
  currentAgent: {
10284
11108
  name: string;
@@ -10854,14 +11678,48 @@ export declare const SerializedRunState: z.ZodObject<{
10854
11678
  tripwireTriggered: boolean;
10855
11679
  outputInfo?: any;
10856
11680
  };
11681
+ agent: {
11682
+ name: string;
11683
+ };
10857
11684
  guardrail: {
10858
11685
  type: "output";
10859
11686
  name: string;
10860
11687
  };
10861
- agent: {
11688
+ agentOutput?: any;
11689
+ }[];
11690
+ toolInputGuardrailResults: {
11691
+ output: {
11692
+ behavior: {
11693
+ type: "allow";
11694
+ } | {
11695
+ message: string;
11696
+ type: "rejectContent";
11697
+ } | {
11698
+ type: "throwException";
11699
+ };
11700
+ outputInfo?: any;
11701
+ };
11702
+ guardrail: {
11703
+ type: "tool_input";
11704
+ name: string;
11705
+ };
11706
+ }[];
11707
+ toolOutputGuardrailResults: {
11708
+ output: {
11709
+ behavior: {
11710
+ type: "allow";
11711
+ } | {
11712
+ message: string;
11713
+ type: "rejectContent";
11714
+ } | {
11715
+ type: "throwException";
11716
+ };
11717
+ outputInfo?: any;
11718
+ };
11719
+ guardrail: {
11720
+ type: "tool_output";
10862
11721
  name: string;
10863
11722
  };
10864
- agentOutput?: any;
10865
11723
  }[];
10866
11724
  generatedItems: ({
10867
11725
  type: "message_output_item";
@@ -11053,6 +11911,49 @@ export declare const SerializedRunState: z.ZodObject<{
11053
11911
  callId: string;
11054
11912
  providerData?: Record<string, any> | undefined;
11055
11913
  id?: string | undefined;
11914
+ } | {
11915
+ type: "computer_call_result";
11916
+ output: {
11917
+ type: "computer_screenshot";
11918
+ data: string;
11919
+ providerData?: Record<string, any> | undefined;
11920
+ };
11921
+ callId: string;
11922
+ providerData?: Record<string, any> | undefined;
11923
+ id?: string | undefined;
11924
+ } | {
11925
+ type: "shell_call_output";
11926
+ output: z.objectOutputType<{
11927
+ stdout: z.ZodString;
11928
+ stderr: z.ZodString;
11929
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
11930
+ type: z.ZodLiteral<"timeout">;
11931
+ }, "strip", z.ZodTypeAny, {
11932
+ type: "timeout";
11933
+ }, {
11934
+ type: "timeout";
11935
+ }>, z.ZodObject<{
11936
+ type: z.ZodLiteral<"exit">;
11937
+ exitCode: z.ZodNullable<z.ZodNumber>;
11938
+ }, "strip", z.ZodTypeAny, {
11939
+ type: "exit";
11940
+ exitCode: number | null;
11941
+ }, {
11942
+ type: "exit";
11943
+ exitCode: number | null;
11944
+ }>]>;
11945
+ }, z.ZodTypeAny, "passthrough">[];
11946
+ callId: string;
11947
+ providerData?: Record<string, any> | undefined;
11948
+ id?: string | undefined;
11949
+ maxOutputLength?: number | undefined;
11950
+ } | {
11951
+ type: "apply_patch_call_output";
11952
+ status: "completed" | "failed";
11953
+ callId: string;
11954
+ providerData?: Record<string, any> | undefined;
11955
+ id?: string | undefined;
11956
+ output?: string | undefined;
11056
11957
  };
11057
11958
  } | {
11058
11959
  type: "reasoning_item";
@@ -11208,14 +12109,8 @@ export declare const SerializedRunState: z.ZodObject<{
11208
12109
  };
11209
12110
  toolName?: string | undefined;
11210
12111
  })[];
11211
- trace: {
11212
- object: "trace";
11213
- id: string;
11214
- workflow_name: string;
11215
- group_id: string | null;
11216
- metadata: Record<string, any>;
11217
- } | null;
11218
12112
  currentAgentSpan?: SerializedSpanType | null | undefined;
12113
+ currentTurnInProgress?: boolean | undefined;
11219
12114
  currentStep?: {
11220
12115
  type: "next_step_handoff";
11221
12116
  newAgent?: any;
@@ -11480,8 +12375,8 @@ export declare const SerializedRunState: z.ZodObject<{
11480
12375
  } | undefined;
11481
12376
  lastProcessedResponse?: {
11482
12377
  handoffs: {
11483
- toolCall?: any;
11484
12378
  handoff?: any;
12379
+ toolCall?: any;
11485
12380
  }[];
11486
12381
  newItems: ({
11487
12382
  type: "message_output_item";
@@ -11673,6 +12568,49 @@ export declare const SerializedRunState: z.ZodObject<{
11673
12568
  callId: string;
11674
12569
  providerData?: Record<string, any> | undefined;
11675
12570
  id?: string | undefined;
12571
+ } | {
12572
+ type: "computer_call_result";
12573
+ output: {
12574
+ type: "computer_screenshot";
12575
+ data: string;
12576
+ providerData?: Record<string, any> | undefined;
12577
+ };
12578
+ callId: string;
12579
+ providerData?: Record<string, any> | undefined;
12580
+ id?: string | undefined;
12581
+ } | {
12582
+ type: "shell_call_output";
12583
+ output: z.objectOutputType<{
12584
+ stdout: z.ZodString;
12585
+ stderr: z.ZodString;
12586
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
12587
+ type: z.ZodLiteral<"timeout">;
12588
+ }, "strip", z.ZodTypeAny, {
12589
+ type: "timeout";
12590
+ }, {
12591
+ type: "timeout";
12592
+ }>, z.ZodObject<{
12593
+ type: z.ZodLiteral<"exit">;
12594
+ exitCode: z.ZodNullable<z.ZodNumber>;
12595
+ }, "strip", z.ZodTypeAny, {
12596
+ type: "exit";
12597
+ exitCode: number | null;
12598
+ }, {
12599
+ type: "exit";
12600
+ exitCode: number | null;
12601
+ }>]>;
12602
+ }, z.ZodTypeAny, "passthrough">[];
12603
+ callId: string;
12604
+ providerData?: Record<string, any> | undefined;
12605
+ id?: string | undefined;
12606
+ maxOutputLength?: number | undefined;
12607
+ } | {
12608
+ type: "apply_patch_call_output";
12609
+ status: "completed" | "failed";
12610
+ callId: string;
12611
+ providerData?: Record<string, any> | undefined;
12612
+ id?: string | undefined;
12613
+ output?: string | undefined;
11676
12614
  };
11677
12615
  } | {
11678
12616
  type: "reasoning_item";
@@ -11864,8 +12802,18 @@ export declare const SerializedRunState: z.ZodObject<{
11864
12802
  }[] | undefined;
11865
12803
  } | undefined;
11866
12804
  currentTurnPersistedItemCount?: number | undefined;
12805
+ conversationId?: string | undefined;
12806
+ previousResponseId?: string | undefined;
11867
12807
  }, {
11868
- $schemaVersion: "1.0";
12808
+ trace: {
12809
+ object: "trace";
12810
+ id: string;
12811
+ workflow_name: string;
12812
+ group_id: string | null;
12813
+ metadata: Record<string, any>;
12814
+ tracing_api_key?: string | null | undefined;
12815
+ } | null;
12816
+ $schemaVersion: "1.0" | "1.1";
11869
12817
  currentTurn: number;
11870
12818
  currentAgent: {
11871
12819
  name: string;
@@ -12441,11 +13389,11 @@ export declare const SerializedRunState: z.ZodObject<{
12441
13389
  tripwireTriggered: boolean;
12442
13390
  outputInfo?: any;
12443
13391
  };
12444
- guardrail: {
12445
- type: "output";
13392
+ agent: {
12446
13393
  name: string;
12447
13394
  };
12448
- agent: {
13395
+ guardrail: {
13396
+ type: "output";
12449
13397
  name: string;
12450
13398
  };
12451
13399
  agentOutput?: any;
@@ -12640,6 +13588,49 @@ export declare const SerializedRunState: z.ZodObject<{
12640
13588
  callId: string;
12641
13589
  providerData?: Record<string, any> | undefined;
12642
13590
  id?: string | undefined;
13591
+ } | {
13592
+ type: "computer_call_result";
13593
+ output: {
13594
+ type: "computer_screenshot";
13595
+ data: string;
13596
+ providerData?: Record<string, any> | undefined;
13597
+ };
13598
+ callId: string;
13599
+ providerData?: Record<string, any> | undefined;
13600
+ id?: string | undefined;
13601
+ } | {
13602
+ type: "shell_call_output";
13603
+ output: z.objectInputType<{
13604
+ stdout: z.ZodString;
13605
+ stderr: z.ZodString;
13606
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
13607
+ type: z.ZodLiteral<"timeout">;
13608
+ }, "strip", z.ZodTypeAny, {
13609
+ type: "timeout";
13610
+ }, {
13611
+ type: "timeout";
13612
+ }>, z.ZodObject<{
13613
+ type: z.ZodLiteral<"exit">;
13614
+ exitCode: z.ZodNullable<z.ZodNumber>;
13615
+ }, "strip", z.ZodTypeAny, {
13616
+ type: "exit";
13617
+ exitCode: number | null;
13618
+ }, {
13619
+ type: "exit";
13620
+ exitCode: number | null;
13621
+ }>]>;
13622
+ }, z.ZodTypeAny, "passthrough">[];
13623
+ callId: string;
13624
+ providerData?: Record<string, any> | undefined;
13625
+ id?: string | undefined;
13626
+ maxOutputLength?: number | undefined;
13627
+ } | {
13628
+ type: "apply_patch_call_output";
13629
+ status: "completed" | "failed";
13630
+ callId: string;
13631
+ providerData?: Record<string, any> | undefined;
13632
+ id?: string | undefined;
13633
+ output?: string | undefined;
12643
13634
  };
12644
13635
  } | {
12645
13636
  type: "reasoning_item";
@@ -12795,14 +13786,42 @@ export declare const SerializedRunState: z.ZodObject<{
12795
13786
  };
12796
13787
  toolName?: string | undefined;
12797
13788
  })[];
12798
- trace: {
12799
- object: "trace";
12800
- id: string;
12801
- workflow_name: string;
12802
- group_id: string | null;
12803
- metadata: Record<string, any>;
12804
- } | null;
12805
13789
  currentAgentSpan?: SerializedSpanType | null | undefined;
13790
+ toolInputGuardrailResults?: {
13791
+ output: {
13792
+ behavior: {
13793
+ type: "allow";
13794
+ } | {
13795
+ message: string;
13796
+ type: "rejectContent";
13797
+ } | {
13798
+ type: "throwException";
13799
+ };
13800
+ outputInfo?: any;
13801
+ };
13802
+ guardrail: {
13803
+ type: "tool_input";
13804
+ name: string;
13805
+ };
13806
+ }[] | undefined;
13807
+ toolOutputGuardrailResults?: {
13808
+ output: {
13809
+ behavior: {
13810
+ type: "allow";
13811
+ } | {
13812
+ message: string;
13813
+ type: "rejectContent";
13814
+ } | {
13815
+ type: "throwException";
13816
+ };
13817
+ outputInfo?: any;
13818
+ };
13819
+ guardrail: {
13820
+ type: "tool_output";
13821
+ name: string;
13822
+ };
13823
+ }[] | undefined;
13824
+ currentTurnInProgress?: boolean | undefined;
12806
13825
  currentStep?: {
12807
13826
  type: "next_step_handoff";
12808
13827
  newAgent?: any;
@@ -13067,8 +14086,8 @@ export declare const SerializedRunState: z.ZodObject<{
13067
14086
  } | undefined;
13068
14087
  lastProcessedResponse?: {
13069
14088
  handoffs: {
13070
- toolCall?: any;
13071
14089
  handoff?: any;
14090
+ toolCall?: any;
13072
14091
  }[];
13073
14092
  newItems: ({
13074
14093
  type: "message_output_item";
@@ -13260,6 +14279,49 @@ export declare const SerializedRunState: z.ZodObject<{
13260
14279
  callId: string;
13261
14280
  providerData?: Record<string, any> | undefined;
13262
14281
  id?: string | undefined;
14282
+ } | {
14283
+ type: "computer_call_result";
14284
+ output: {
14285
+ type: "computer_screenshot";
14286
+ data: string;
14287
+ providerData?: Record<string, any> | undefined;
14288
+ };
14289
+ callId: string;
14290
+ providerData?: Record<string, any> | undefined;
14291
+ id?: string | undefined;
14292
+ } | {
14293
+ type: "shell_call_output";
14294
+ output: z.objectInputType<{
14295
+ stdout: z.ZodString;
14296
+ stderr: z.ZodString;
14297
+ outcome: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
14298
+ type: z.ZodLiteral<"timeout">;
14299
+ }, "strip", z.ZodTypeAny, {
14300
+ type: "timeout";
14301
+ }, {
14302
+ type: "timeout";
14303
+ }>, z.ZodObject<{
14304
+ type: z.ZodLiteral<"exit">;
14305
+ exitCode: z.ZodNullable<z.ZodNumber>;
14306
+ }, "strip", z.ZodTypeAny, {
14307
+ type: "exit";
14308
+ exitCode: number | null;
14309
+ }, {
14310
+ type: "exit";
14311
+ exitCode: number | null;
14312
+ }>]>;
14313
+ }, z.ZodTypeAny, "passthrough">[];
14314
+ callId: string;
14315
+ providerData?: Record<string, any> | undefined;
14316
+ id?: string | undefined;
14317
+ maxOutputLength?: number | undefined;
14318
+ } | {
14319
+ type: "apply_patch_call_output";
14320
+ status: "completed" | "failed";
14321
+ callId: string;
14322
+ providerData?: Record<string, any> | undefined;
14323
+ id?: string | undefined;
14324
+ output?: string | undefined;
13263
14325
  };
13264
14326
  } | {
13265
14327
  type: "reasoning_item";
@@ -13451,6 +14513,8 @@ export declare const SerializedRunState: z.ZodObject<{
13451
14513
  }[] | undefined;
13452
14514
  } | undefined;
13453
14515
  currentTurnPersistedItemCount?: number | undefined;
14516
+ conversationId?: string | undefined;
14517
+ previousResponseId?: string | undefined;
13454
14518
  }>;
13455
14519
  /**
13456
14520
  * Serializable snapshot of an agent's run, including context, usage and trace.
@@ -13465,6 +14529,10 @@ export declare class RunState<TContext, TAgent extends Agent<any, any>> {
13465
14529
  * Current turn number in the conversation.
13466
14530
  */
13467
14531
  _currentTurn: number;
14532
+ /**
14533
+ * Whether the current turn has already been counted (useful when resuming mid-turn).
14534
+ */
14535
+ _currentTurnInProgress: boolean;
13468
14536
  /**
13469
14537
  * The agent currently handling the conversation.
13470
14538
  */
@@ -13477,6 +14545,14 @@ export declare class RunState<TContext, TAgent extends Agent<any, any>> {
13477
14545
  * Responses from the model so far.
13478
14546
  */
13479
14547
  _modelResponses: ModelResponse[];
14548
+ /**
14549
+ * Conversation identifier when the server manages conversation history.
14550
+ */
14551
+ _conversationId: string | undefined;
14552
+ /**
14553
+ * Latest response identifier returned by the server for server-managed conversations.
14554
+ */
14555
+ _previousResponseId: string | undefined;
13480
14556
  /**
13481
14557
  * Active tracing span for the current agent if tracing is enabled.
13482
14558
  */
@@ -13527,7 +14603,15 @@ export declare class RunState<TContext, TAgent extends Agent<any, any>> {
13527
14603
  /**
13528
14604
  * Results from output guardrails applied to the run.
13529
14605
  */
13530
- _outputGuardrailResults: OutputGuardrailResult[];
14606
+ _outputGuardrailResults: OutputGuardrailResult<any, any>[];
14607
+ /**
14608
+ * Results from tool input guardrails applied during tool execution.
14609
+ */
14610
+ _toolInputGuardrailResults: ToolInputGuardrailResult[];
14611
+ /**
14612
+ * Results from tool output guardrails applied during tool execution.
14613
+ */
14614
+ _toolOutputGuardrailResults: ToolOutputGuardrailResult[];
13531
14615
  /**
13532
14616
  * Next step computed for the agent to take.
13533
14617
  */
@@ -13541,6 +14625,26 @@ export declare class RunState<TContext, TAgent extends Agent<any, any>> {
13541
14625
  */
13542
14626
  _trace: Trace | null;
13543
14627
  constructor(context: RunContext<TContext>, originalInput: string | AgentInputItem[], startingAgent: TAgent, maxTurns: number);
14628
+ /**
14629
+ * Updates server-managed conversation identifiers as a single operation.
14630
+ */
14631
+ setConversationContext(conversationId?: string, previousResponseId?: string): void;
14632
+ /**
14633
+ * Updates the agent span associated with the current run.
14634
+ */
14635
+ setCurrentAgentSpan(span?: Span<AgentSpanData>): void;
14636
+ /**
14637
+ * Switches the active agent handling the run.
14638
+ */
14639
+ setCurrentAgent(agent: TAgent): void;
14640
+ /**
14641
+ * Resets the counter that tracks how many items were persisted for the current turn.
14642
+ */
14643
+ resetTurnPersistence(): void;
14644
+ /**
14645
+ * Rewinds the persisted item counter when pending approvals require re-writing outputs.
14646
+ */
14647
+ rewindTurnPersistence(count: number): void;
13544
14648
  /**
13545
14649
  * The history of the agent run. This includes the input items and the new items generated during the run.
13546
14650
  *
@@ -13589,7 +14693,15 @@ export declare class RunState<TContext, TAgent extends Agent<any, any>> {
13589
14693
  *
13590
14694
  * @returns The serialized run state.
13591
14695
  */
13592
- toJSON(): z.infer<typeof SerializedRunState>;
14696
+ /**
14697
+ * Serializes the run state. By default, tracing API keys are omitted to prevent
14698
+ * accidental persistence of secrets. Pass `includeTracingApiKey: true` only when you
14699
+ * intentionally need to migrate a run along with its tracing credentials (e.g., to
14700
+ * rehydrate in a separate process that lacks the original environment variables).
14701
+ */
14702
+ toJSON(options?: {
14703
+ includeTracingApiKey?: boolean;
14704
+ }): z.infer<typeof SerializedRunState>;
13593
14705
  /**
13594
14706
  * Serializes the run state to a string.
13595
14707
  *
@@ -13598,7 +14710,9 @@ export declare class RunState<TContext, TAgent extends Agent<any, any>> {
13598
14710
  *
13599
14711
  * @returns The serialized run state.
13600
14712
  */
13601
- toString(): string;
14713
+ toString(options?: {
14714
+ includeTracingApiKey?: boolean;
14715
+ }): string;
13602
14716
  /**
13603
14717
  * Deserializes a run state from a string.
13604
14718
  *