@jrkropp/codex-js 0.1.2 → 0.1.4

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 (134) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/dist/ClientNotification-B6-FhXQf.d.ts +5 -0
  4. package/dist/DynamicToolCallResponse-82DFjES2.d.ts +8 -0
  5. package/dist/DynamicToolSpec-CfnhqAYK.d.ts +29 -0
  6. package/dist/PermissionsRequestApprovalResponse-DxzPPDRb.d.ts +55 -0
  7. package/dist/ProviderStatusBanner-BlP6lzwE.d.ts +441 -0
  8. package/dist/ServerRequest-B5cKVJjr.d.ts +2181 -0
  9. package/dist/{session-DPhHN7RZ.d.ts → ThreadResumeResponse-DvmE1juU.d.ts} +3 -306
  10. package/dist/ToolRequestUserInputQuestion-CeZa5X1J.d.ts +23 -0
  11. package/dist/ToolRequestUserInputResponse-zcPLwbiK.d.ts +17 -0
  12. package/dist/TurnSteerResponse-0kBCfplh.d.ts +209 -0
  13. package/dist/WebSearchToolConfig-D3ep0625.d.ts +18 -0
  14. package/dist/chat-runtime-9RkXHC_w.d.ts +382 -0
  15. package/dist/chunk-2DZRMCI2.js +1258 -0
  16. package/dist/chunk-2DZRMCI2.js.map +1 -0
  17. package/dist/chunk-4DPLJPB5.js +396 -0
  18. package/dist/chunk-4DPLJPB5.js.map +1 -0
  19. package/dist/chunk-5JMJ6OI5.js +3 -0
  20. package/dist/chunk-5JMJ6OI5.js.map +1 -0
  21. package/dist/chunk-6ZMJ34KE.js +1153 -0
  22. package/dist/chunk-6ZMJ34KE.js.map +1 -0
  23. package/dist/chunk-CGBS37IU.js +128 -0
  24. package/dist/chunk-CGBS37IU.js.map +1 -0
  25. package/dist/chunk-DCMKA2A6.js +18 -0
  26. package/dist/chunk-DCMKA2A6.js.map +1 -0
  27. package/dist/chunk-DYLHN3HG.js +937 -0
  28. package/dist/chunk-DYLHN3HG.js.map +1 -0
  29. package/dist/{chunk-SVK6PLGO.js → chunk-LWQNX4LI.js} +12009 -18768
  30. package/dist/chunk-LWQNX4LI.js.map +1 -0
  31. package/dist/{chunk-JLDH4U5L.js → chunk-NCI4MAWZ.js} +317 -1967
  32. package/dist/chunk-NCI4MAWZ.js.map +1 -0
  33. package/dist/chunk-O44XP7LH.js +214 -0
  34. package/dist/chunk-O44XP7LH.js.map +1 -0
  35. package/dist/chunk-PST3ZWX2.js +555 -0
  36. package/dist/chunk-PST3ZWX2.js.map +1 -0
  37. package/dist/chunk-SYPHCDRD.js +1133 -0
  38. package/dist/chunk-SYPHCDRD.js.map +1 -0
  39. package/dist/chunk-V4BMZWBM.js +2401 -0
  40. package/dist/chunk-V4BMZWBM.js.map +1 -0
  41. package/dist/chunk-W7S6HFCQ.js +1983 -0
  42. package/dist/chunk-W7S6HFCQ.js.map +1 -0
  43. package/dist/chunk-YHVCFD2D.js +117 -0
  44. package/dist/chunk-YHVCFD2D.js.map +1 -0
  45. package/dist/chunk-Z63UPBS3.js +152 -0
  46. package/dist/chunk-Z63UPBS3.js.map +1 -0
  47. package/dist/client/index.d.ts +16 -4
  48. package/dist/client/index.js +13 -1
  49. package/dist/codex-rs/app-server/index.d.ts +161 -0
  50. package/dist/codex-rs/app-server/index.js +13 -0
  51. package/dist/codex-rs/app-server/index.js.map +1 -0
  52. package/dist/codex-rs/app-server-protocol/index.d.ts +1722 -0
  53. package/dist/codex-rs/app-server-protocol/index.js +6 -0
  54. package/dist/codex-rs/app-server-protocol/index.js.map +1 -0
  55. package/dist/codex-rs/app-server-protocol/protocol.d.ts +19 -0
  56. package/dist/codex-rs/app-server-protocol/protocol.js +4 -0
  57. package/dist/codex-rs/app-server-protocol/protocol.js.map +1 -0
  58. package/dist/codex-rs/codex-api/index.d.ts +104 -0
  59. package/dist/codex-rs/codex-api/index.js +11 -0
  60. package/dist/codex-rs/codex-api/index.js.map +1 -0
  61. package/dist/codex-rs/config/index.d.ts +88 -0
  62. package/dist/codex-rs/config/index.js +4 -0
  63. package/dist/codex-rs/config/index.js.map +1 -0
  64. package/dist/codex-rs/core/config/index.d.ts +61 -0
  65. package/dist/codex-rs/core/config/index.js +5 -0
  66. package/dist/codex-rs/core/config/index.js.map +1 -0
  67. package/dist/codex-rs/core/index.d.ts +1393 -0
  68. package/dist/codex-rs/core/index.js +11 -0
  69. package/dist/codex-rs/core/index.js.map +1 -0
  70. package/dist/codex-rs/model-provider/index.d.ts +2 -0
  71. package/dist/codex-rs/model-provider/index.js +4 -0
  72. package/dist/codex-rs/model-provider/index.js.map +1 -0
  73. package/dist/codex-rs/models-manager/index.d.ts +2 -0
  74. package/dist/codex-rs/models-manager/index.js +4 -0
  75. package/dist/codex-rs/models-manager/index.js.map +1 -0
  76. package/dist/codex-rs/parity.d.ts +26 -0
  77. package/dist/codex-rs/parity.js +3 -0
  78. package/dist/codex-rs/parity.js.map +1 -0
  79. package/dist/codex-rs/thread-store/index.d.ts +5 -0
  80. package/dist/codex-rs/thread-store/index.js +4 -0
  81. package/dist/codex-rs/thread-store/index.js.map +1 -0
  82. package/dist/codex-rs/unsupported.d.ts +15 -0
  83. package/dist/codex-rs/unsupported.js +22 -0
  84. package/dist/codex-rs/unsupported.js.map +1 -0
  85. package/dist/codex-rs/utils/output-truncation.d.ts +21 -0
  86. package/dist/codex-rs/utils/output-truncation.js +4 -0
  87. package/dist/codex-rs/utils/output-truncation.js.map +1 -0
  88. package/dist/codex-rs/utils/string.d.ts +7 -0
  89. package/dist/codex-rs/utils/string.js +3 -0
  90. package/dist/codex-rs/utils/string.js.map +1 -0
  91. package/dist/common-CTyph5x8.d.ts +40 -0
  92. package/dist/event-mapping-CbISdQ1D.d.ts +43 -0
  93. package/dist/history-CfM-4V7b.d.ts +1654 -0
  94. package/dist/index-77U_Oc-a.d.ts +63 -0
  95. package/dist/index-CoDZosq0.d.ts +261 -0
  96. package/dist/index.d.ts +18 -7
  97. package/dist/index.js +16 -2
  98. package/dist/lib-nXlaKiS-.d.ts +48 -0
  99. package/dist/live-thread-BMvlflzM.d.ts +30 -0
  100. package/dist/merge-B_AWVmnI.d.ts +24 -0
  101. package/dist/mod-DYVLSWO4.d.ts +91 -0
  102. package/dist/plan-mode-Cv6KWb_S.d.ts +14 -0
  103. package/dist/proposed-plan-DpN1ma0Y.d.ts +53 -0
  104. package/dist/protocol-mpBcYHrm.d.ts +1655 -0
  105. package/dist/react/index.d.ts +56 -48
  106. package/dist/react/index.js +16 -2
  107. package/dist/{remote-_6TDvg-g.d.ts → remote-ClZbq9KN.d.ts} +3 -1
  108. package/dist/rendered-thread-AOxw3V5b.d.ts +29 -0
  109. package/dist/responses_websocket-BhxSgCzK.d.ts +183 -0
  110. package/dist/runtime-Cm6ml53h.d.ts +528 -0
  111. package/dist/server/index.d.ts +29 -2416
  112. package/dist/server/index.js +13 -1
  113. package/dist/session-BRYzi8OT.d.ts +46 -0
  114. package/dist/shadcn/index.d.ts +1 -1
  115. package/dist/{sidebar-DT2XoitN.d.ts → sidebar-DMMij22z.d.ts} +1 -1
  116. package/dist/spec_plan_types-CmsJ-Tfn.d.ts +260 -0
  117. package/dist/{store-GYldc9EJ.d.ts → store-AGRxhgQ3.d.ts} +2 -1
  118. package/dist/t3code/apps/web/components/chat.d.ts +508 -0
  119. package/dist/t3code/apps/web/components/chat.js +12 -0
  120. package/dist/t3code/apps/web/components/chat.js.map +1 -0
  121. package/dist/t3code/apps/web/index.d.ts +12 -0
  122. package/dist/t3code/apps/web/index.js +13 -0
  123. package/dist/t3code/apps/web/index.js.map +1 -0
  124. package/dist/testing/index.d.ts +9 -91
  125. package/dist/testing/index.js +13 -1
  126. package/dist/thread-history-builder-zW0zeqcS.d.ts +58 -0
  127. package/dist/thread_event_store-C0zYzukG.d.ts +77 -0
  128. package/dist/types-BTeabLYr.d.ts +126 -0
  129. package/package.json +152 -88
  130. package/dist/chat-runtime-D7wu_KbX.d.ts +0 -747
  131. package/dist/chunk-JLDH4U5L.js.map +0 -1
  132. package/dist/chunk-SVK6PLGO.js.map +0 -1
  133. package/dist/index-CB9la6xE.d.ts +0 -112
  134. package/dist/thread_event_store-B9CoQUIA.d.ts +0 -3868
@@ -0,0 +1,1655 @@
1
+ type CodexBrand<TValue, TBrand extends string> = TValue & {
2
+ readonly __codexBrand: TBrand;
3
+ };
4
+ type ThreadId = CodexBrand<string, "ThreadId">;
5
+ declare function asThreadId(value: string): ThreadId;
6
+
7
+ declare const ModeKind: {
8
+ readonly Plan: "plan";
9
+ readonly Default: "default";
10
+ };
11
+ type ModeKind = (typeof ModeKind)[keyof typeof ModeKind];
12
+ type ReasoningEffort = string;
13
+ type CollaborationModeSettings = {
14
+ model: string;
15
+ reasoning_effort: ReasoningEffort | null;
16
+ developer_instructions: string | null;
17
+ };
18
+ type CollaborationMode = {
19
+ mode: ModeKind;
20
+ settings: CollaborationModeSettings;
21
+ };
22
+ type CollaborationModeMask = {
23
+ name: string;
24
+ mode?: ModeKind | null;
25
+ model?: string | null;
26
+ reasoning_effort?: ReasoningEffort | null | undefined;
27
+ developer_instructions?: string | null | undefined;
28
+ };
29
+ declare const TUI_VISIBLE_COLLABORATION_MODES: readonly ["default", "plan"];
30
+ declare function allowsRequestUserInput(mode: ModeKind): boolean;
31
+ declare function modeDisplayName(mode: ModeKind): string;
32
+ declare function collaborationModeWithUpdates(collaborationMode: CollaborationMode, model?: string | null, effort?: ReasoningEffort | null | undefined, developerInstructions?: string | null | undefined): CollaborationMode;
33
+ declare function applyCollaborationModeMask(collaborationMode: CollaborationMode, mask: CollaborationModeMask): CollaborationMode;
34
+ declare function collaborationModeForModel(model: string, effort?: ReasoningEffort | null, mode?: ModeKind, developerInstructions?: string | null): CollaborationMode;
35
+
36
+ declare const ThreadMemoryMode: {
37
+ readonly Enabled: "Enabled";
38
+ readonly Disabled: "Disabled";
39
+ };
40
+ type ThreadMemoryMode = (typeof ThreadMemoryMode)[keyof typeof ThreadMemoryMode];
41
+ declare const ThreadMemoryModeSessionMetaValue: {
42
+ readonly Enabled: "enabled";
43
+ readonly Disabled: "disabled";
44
+ };
45
+ type ThreadMemoryModeSessionMetaValue = (typeof ThreadMemoryModeSessionMetaValue)[keyof typeof ThreadMemoryModeSessionMetaValue];
46
+ declare function threadMemoryModeToSessionMetaValue(mode: ThreadMemoryMode): ThreadMemoryModeSessionMetaValue;
47
+ type MemoryCitation = {
48
+ entries: MemoryCitationEntry[];
49
+ rolloutIds: string[];
50
+ };
51
+ type MemoryCitationEntry = {
52
+ path: string;
53
+ lineStart: number;
54
+ lineEnd: number;
55
+ note: string;
56
+ };
57
+
58
+ type AgentMessageContent = {
59
+ type: "Text";
60
+ text: string;
61
+ };
62
+ type UserMessageTurnItem = {
63
+ type: "UserMessage";
64
+ id: string;
65
+ content: UserInput[];
66
+ };
67
+ type HookPromptFragment = {
68
+ text: string;
69
+ hookRunId: string;
70
+ };
71
+ type HookPromptTurnItem = {
72
+ type: "HookPrompt";
73
+ id: string;
74
+ fragments: HookPromptFragment[];
75
+ };
76
+ type AgentMessageTurnItem = {
77
+ type: "AgentMessage";
78
+ id: string;
79
+ content: AgentMessageContent[];
80
+ phase?: string | null;
81
+ memory_citation?: MemoryCitation | null;
82
+ };
83
+ type PlanTurnItem = {
84
+ type: "Plan";
85
+ id: string;
86
+ text: string;
87
+ };
88
+ type ReasoningTurnItem = {
89
+ type: "Reasoning";
90
+ id: string;
91
+ summary_text: string[];
92
+ raw_content: string[];
93
+ };
94
+ type WebSearchAction = {
95
+ type: "search";
96
+ query?: string;
97
+ queries?: string[];
98
+ } | {
99
+ type: "open_page";
100
+ url?: string;
101
+ } | {
102
+ type: "find_in_page";
103
+ url?: string;
104
+ pattern?: string;
105
+ } | {
106
+ type: "other";
107
+ };
108
+ type WebSearchTurnItem = {
109
+ type: "WebSearch";
110
+ id: string;
111
+ query: string;
112
+ action: WebSearchAction;
113
+ };
114
+ type ImageViewTurnItem = {
115
+ type: "ImageView";
116
+ id: string;
117
+ path: string;
118
+ };
119
+ type ImageGenerationTurnItem = {
120
+ type: "ImageGeneration";
121
+ id: string;
122
+ status: string;
123
+ revised_prompt?: string;
124
+ result: string;
125
+ saved_path?: string;
126
+ };
127
+ type FileChange = {
128
+ type: "add";
129
+ content: string;
130
+ } | {
131
+ type: "delete";
132
+ content: string;
133
+ } | {
134
+ type: "update";
135
+ unified_diff: string;
136
+ move_path: string | null;
137
+ };
138
+ type PatchApplyStatus = "completed" | "failed" | "declined";
139
+ type FileChangeTurnItem = {
140
+ type: "FileChange";
141
+ id: string;
142
+ changes: Record<string, FileChange>;
143
+ status?: PatchApplyStatus | null;
144
+ auto_approved?: boolean;
145
+ stdout?: string;
146
+ stderr?: string;
147
+ };
148
+ type CommandExecutionStatus = "in_progress" | "completed" | "failed" | "cancelled";
149
+ type CommandExecutionTurnItem = {
150
+ type: "CommandExecution";
151
+ id: string;
152
+ command: string[];
153
+ cwd: string;
154
+ status: CommandExecutionStatus;
155
+ stdout?: string;
156
+ stderr?: string;
157
+ exit_code?: number | null;
158
+ duration_ms?: number | null;
159
+ };
160
+ type McpToolCallStatus = "inProgress" | "completed" | "failed";
161
+ type McpToolCallError = {
162
+ message: string;
163
+ };
164
+ type McpToolCallTurnItem = {
165
+ type: "McpToolCall";
166
+ id: string;
167
+ server: string;
168
+ tool: string;
169
+ arguments: unknown;
170
+ mcpAppResourceUri?: string;
171
+ status: McpToolCallStatus;
172
+ result?: unknown;
173
+ error?: McpToolCallError;
174
+ duration?: string;
175
+ };
176
+ type DynamicToolCallStatus = "inProgress" | "completed" | "failed";
177
+ type DynamicToolCallTurnItem = {
178
+ type: "DynamicToolCall";
179
+ id: string;
180
+ namespace?: string | null;
181
+ tool: string;
182
+ arguments: unknown;
183
+ status: DynamicToolCallStatus;
184
+ content_items?: unknown[] | null;
185
+ success?: boolean | null;
186
+ duration?: string | null;
187
+ };
188
+ type ContextCompactionTurnItem = {
189
+ type: "ContextCompaction";
190
+ id: string;
191
+ };
192
+ type TurnItem = UserMessageTurnItem | HookPromptTurnItem | AgentMessageTurnItem | PlanTurnItem | ReasoningTurnItem | WebSearchTurnItem | ImageViewTurnItem | ImageGenerationTurnItem | CommandExecutionTurnItem | FileChangeTurnItem | McpToolCallTurnItem | DynamicToolCallTurnItem | ContextCompactionTurnItem;
193
+
194
+ type StreamOutput<T = string> = {
195
+ text: T;
196
+ truncated_after_lines?: number | null;
197
+ };
198
+ type ExecToolCallOutput = {
199
+ exit_code: number;
200
+ stdout: StreamOutput<string>;
201
+ stderr: StreamOutput<string>;
202
+ aggregated_output: StreamOutput<string>;
203
+ duration_ms: number;
204
+ timed_out: boolean;
205
+ };
206
+ declare function streamOutput(text: string): StreamOutput<string>;
207
+ declare function execToolCallOutput(input: {
208
+ exit_code: number;
209
+ stdout?: string;
210
+ stderr?: string;
211
+ duration_ms?: number;
212
+ timed_out?: boolean;
213
+ }): ExecToolCallOutput;
214
+
215
+ type DynamicToolSpec = {
216
+ namespace?: string | null;
217
+ name: string;
218
+ description: string;
219
+ input_schema: unknown;
220
+ defer_loading?: boolean;
221
+ };
222
+ type DynamicToolCallRequest = {
223
+ call_id: string;
224
+ turn_id: string;
225
+ started_at_ms?: number;
226
+ namespace?: string | null;
227
+ tool: string;
228
+ arguments: unknown;
229
+ };
230
+ type DynamicToolCallOutputContentItem = {
231
+ type: "inputText";
232
+ text: string;
233
+ } | {
234
+ type: "inputImage";
235
+ imageUrl: string;
236
+ };
237
+ type DynamicToolResponse = {
238
+ content_items: DynamicToolCallOutputContentItem[];
239
+ success: boolean;
240
+ };
241
+ type DynamicToolCallResponseEvent = {
242
+ call_id: string;
243
+ turn_id: string;
244
+ completed_at_ms?: number;
245
+ namespace?: string | null;
246
+ tool: string;
247
+ arguments: unknown;
248
+ content_items: DynamicToolCallOutputContentItem[];
249
+ success: boolean;
250
+ error?: string | null;
251
+ duration: string;
252
+ };
253
+ type DynamicToolSpecWire = {
254
+ namespace?: string | null;
255
+ name: string;
256
+ description: string;
257
+ inputSchema: unknown;
258
+ deferLoading?: boolean;
259
+ exposeToContext?: boolean;
260
+ };
261
+ declare function dynamicToolSpecToWire(spec: DynamicToolSpec): DynamicToolSpecWire;
262
+ declare function dynamicToolSpecFromWire(spec: DynamicToolSpecWire): DynamicToolSpec;
263
+
264
+ type FreeformTool = {
265
+ name: string;
266
+ description: string;
267
+ format: {
268
+ type: string;
269
+ syntax: string;
270
+ definition: string;
271
+ };
272
+ };
273
+ type ResponsesApiTool = {
274
+ name: string;
275
+ description: string;
276
+ strict: boolean;
277
+ defer_loading?: boolean;
278
+ parameters: JsonSchema;
279
+ };
280
+ type ResponsesApiFunctionTool = ResponsesApiTool & {
281
+ type: "function";
282
+ };
283
+ type LoadableToolSpec = ResponsesApiFunctionTool | (ResponsesApiNamespace & {
284
+ type: "namespace";
285
+ });
286
+ type ResponsesApiNamespace = {
287
+ name: string;
288
+ description: string;
289
+ tools: ResponsesApiNamespaceTool[];
290
+ };
291
+ type ResponsesApiNamespaceTool = ResponsesApiFunctionTool;
292
+ declare function default_namespace_description(namespaceName: string): string;
293
+ declare function dynamic_tool_to_responses_api_tool(tool: DynamicToolSpec): ResponsesApiTool;
294
+ declare function dynamic_tool_to_loadable_tool_spec(tool: DynamicToolSpec): LoadableToolSpec;
295
+ declare function coalesce_loadable_tool_specs(specs: Iterable<LoadableToolSpec>): LoadableToolSpec[];
296
+
297
+ type JsonSchema = unknown;
298
+ type ToolSpec = LoadableToolSpec | {
299
+ type: "tool_search";
300
+ execution: string;
301
+ description: string;
302
+ parameters: JsonSchema;
303
+ } | {
304
+ type: "local_shell";
305
+ } | {
306
+ type: "image_generation";
307
+ output_format: string;
308
+ } | {
309
+ type: "web_search";
310
+ external_web_access?: boolean;
311
+ filters?: unknown;
312
+ user_location?: unknown;
313
+ search_context_size?: unknown;
314
+ search_content_types?: string[];
315
+ } | (FreeformTool & {
316
+ type: "custom";
317
+ });
318
+ type ConfiguredToolSpec = {
319
+ spec: ToolSpec;
320
+ supports_parallel_tool_calls: boolean;
321
+ };
322
+ declare function toolSpecName(spec: ToolSpec): string;
323
+ declare function create_tools_json_for_responses_api(tools: readonly ToolSpec[]): ToolSpec[];
324
+ declare function assertValidResponsesToolSpecs(specs: readonly ToolSpec[]): asserts specs is ToolSpec[];
325
+
326
+ declare const REQUEST_USER_INPUT_TOOL_NAME = "request_user_input";
327
+ type RequestUserInputQuestionOption = {
328
+ label: string;
329
+ description: string;
330
+ };
331
+ type RequestUserInputQuestion = {
332
+ id: string;
333
+ header: string;
334
+ question: string;
335
+ isOther?: boolean;
336
+ isSecret?: boolean;
337
+ options?: RequestUserInputQuestionOption[];
338
+ };
339
+ type NormalizedRequestUserInputQuestion = {
340
+ id: string;
341
+ header: string;
342
+ question: string;
343
+ isOther: boolean;
344
+ isSecret: boolean;
345
+ options: RequestUserInputQuestionOption[];
346
+ };
347
+ type RequestUserInputArgs = {
348
+ questions: RequestUserInputQuestion[];
349
+ };
350
+ type NormalizedRequestUserInputArgs = {
351
+ questions: NormalizedRequestUserInputQuestion[];
352
+ };
353
+ type RequestUserInputAnswer = {
354
+ answers: string[];
355
+ };
356
+ type RequestUserInputResponse = {
357
+ answers: Record<string, RequestUserInputAnswer>;
358
+ };
359
+ type RequestUserInputEvent = {
360
+ /** Responses API call id for the associated tool call, if available. */
361
+ call_id: string;
362
+ /** Turn id that this request belongs to. */
363
+ turn_id: string;
364
+ questions: NormalizedRequestUserInputQuestion[];
365
+ };
366
+ declare function normalizeRequestUserInputArgs(args: RequestUserInputArgs): NormalizedRequestUserInputArgs;
367
+ declare function requestUserInputAvailableModes(): ModeKind[];
368
+ declare function createRequestUserInputTool(description: string): ToolSpec;
369
+ declare function requestUserInputUnavailableMessage(mode: CollaborationMode["mode"], availableModes: readonly ModeKind[]): string | null;
370
+ declare function requestUserInputToolDescription(availableModes: readonly ModeKind[]): string;
371
+
372
+ declare const REQUEST_PERMISSIONS_TOOL_NAME = "request_permissions";
373
+ declare const PermissionGrantScope: {
374
+ readonly Turn: "turn";
375
+ readonly Session: "session";
376
+ };
377
+ type PermissionGrantScope = (typeof PermissionGrantScope)[keyof typeof PermissionGrantScope];
378
+ declare const ReviewDecision: {
379
+ readonly Approved: "approved";
380
+ readonly ApprovedForSession: "approved_for_session";
381
+ readonly Denied: "denied";
382
+ readonly Abort: "abort";
383
+ readonly TimedOut: "timed_out";
384
+ };
385
+ type ReviewDecision = (typeof ReviewDecision)[keyof typeof ReviewDecision];
386
+ type NetworkPermissions = {
387
+ enabled?: boolean | null;
388
+ [key: string]: unknown;
389
+ };
390
+ type FileSystemPermissions = {
391
+ entries?: Array<Record<string, unknown>>;
392
+ [key: string]: unknown;
393
+ };
394
+ type RequestPermissionProfile = {
395
+ network?: NetworkPermissions | null;
396
+ file_system?: FileSystemPermissions | null;
397
+ };
398
+ type RequestPermissionsArgs = {
399
+ reason?: string | null;
400
+ permissions: RequestPermissionProfile;
401
+ };
402
+ type RequestPermissionsResponse = {
403
+ permissions: RequestPermissionProfile;
404
+ scope?: PermissionGrantScope;
405
+ strict_auto_review?: boolean;
406
+ };
407
+ type RequestPermissionsEvent = {
408
+ /** Responses API call id for the associated tool call, if available. */
409
+ call_id: string;
410
+ /** Turn id that this request belongs to. */
411
+ turn_id: string;
412
+ reason?: string | null;
413
+ permissions: RequestPermissionProfile;
414
+ cwd?: string | null;
415
+ };
416
+ declare function createRequestPermissionsTool(description: string): ToolSpec;
417
+ declare function requestPermissionsToolDescription(): string;
418
+ declare function normalizeRequestPermissionsArgs(args: RequestPermissionsArgs): RequestPermissionsArgs;
419
+ declare function emptyRequestPermissionsResponse(): RequestPermissionsResponse;
420
+ declare function deniedRequestPermissionsResponse(): RequestPermissionsResponse;
421
+ declare function isEmptyRequestPermissionProfile(permissions: RequestPermissionProfile | null | undefined): boolean;
422
+ declare function cloneRequestPermissionProfile(permissions: RequestPermissionProfile): RequestPermissionProfile;
423
+
424
+ type MessagePhase = "commentary" | "final_answer";
425
+ type ContentItem = {
426
+ type: "input_text";
427
+ text: string;
428
+ } | {
429
+ type: "input_image";
430
+ image_url: string;
431
+ detail?: string | null;
432
+ } | {
433
+ type: "output_text";
434
+ text: string;
435
+ };
436
+ type FunctionCallOutputContentItem = {
437
+ type: "input_text";
438
+ text: string;
439
+ } | {
440
+ type: "input_image";
441
+ image_url: string;
442
+ detail?: string | null;
443
+ };
444
+ type FunctionCallOutputBody = {
445
+ type: "text";
446
+ text: string;
447
+ } | {
448
+ type: "content_items";
449
+ items: FunctionCallOutputContentItem[];
450
+ };
451
+ type FunctionCallOutputPayload = {
452
+ body: FunctionCallOutputBody;
453
+ success?: boolean | null;
454
+ };
455
+ type MessageResponseInputItem = {
456
+ type: "message";
457
+ id?: string;
458
+ role: string;
459
+ content: ContentItem[];
460
+ phase?: MessagePhase | null;
461
+ };
462
+ type FunctionCallOutputResponseInputItem = {
463
+ type: "function_call_output";
464
+ call_id: string;
465
+ output: FunctionCallOutputPayload;
466
+ };
467
+ type CustomToolCallOutputResponseInputItem = {
468
+ type: "custom_tool_call_output";
469
+ call_id: string;
470
+ name?: string | null;
471
+ output: FunctionCallOutputPayload;
472
+ };
473
+ type McpToolCallOutputResponseInputItem = {
474
+ type: "mcp_tool_call_output";
475
+ call_id: string;
476
+ output: unknown;
477
+ };
478
+ type ToolSearchOutputResponseInputItem = {
479
+ type: "tool_search_output";
480
+ call_id: string;
481
+ status: "completed";
482
+ execution: "client";
483
+ tools: unknown[];
484
+ };
485
+ type ResponseInputItem = MessageResponseInputItem | FunctionCallOutputResponseInputItem | CustomToolCallOutputResponseInputItem | McpToolCallOutputResponseInputItem | ToolSearchOutputResponseInputItem;
486
+ type ResponseMessageItem = {
487
+ type: "message";
488
+ id?: string;
489
+ role: string;
490
+ content: ContentItem[];
491
+ phase?: MessagePhase | null;
492
+ };
493
+ type ReasoningItemReasoningSummary = Record<string, unknown>;
494
+ type ReasoningItemContent = Record<string, unknown>;
495
+ type ResponseReasoningItem = {
496
+ type: "reasoning";
497
+ id?: string;
498
+ summary: ReasoningItemReasoningSummary[];
499
+ content?: ReasoningItemContent[] | null;
500
+ encrypted_content?: string | null;
501
+ };
502
+ type ResponseLocalShellCallItem = {
503
+ type: "local_shell_call";
504
+ id?: string | null;
505
+ call_id?: string | null;
506
+ status?: string | null;
507
+ action: Record<string, unknown>;
508
+ };
509
+ type ResponseFunctionCallItem = {
510
+ type: "function_call";
511
+ id?: string | null;
512
+ name: string;
513
+ namespace?: string | null;
514
+ arguments: string;
515
+ call_id: string;
516
+ };
517
+ type ResponseToolSearchCallItem = {
518
+ type: "tool_search_call";
519
+ id?: string | null;
520
+ call_id?: string | null;
521
+ status?: string | null;
522
+ execution: string;
523
+ arguments: unknown;
524
+ };
525
+ type ResponseFunctionCallOutputItem = {
526
+ type: "function_call_output";
527
+ call_id: string;
528
+ output: FunctionCallOutputPayload;
529
+ };
530
+ type ResponseCustomToolCallItem = {
531
+ type: "custom_tool_call";
532
+ id?: string | null;
533
+ status?: string | null;
534
+ call_id: string;
535
+ name: string;
536
+ input: string;
537
+ };
538
+ type ResponseCustomToolCallOutputItem = {
539
+ type: "custom_tool_call_output";
540
+ call_id: string;
541
+ name?: string | null;
542
+ output: FunctionCallOutputPayload;
543
+ };
544
+ type ResponseToolSearchOutputItem = {
545
+ type: "tool_search_output";
546
+ call_id?: string | null;
547
+ status: string;
548
+ execution: string;
549
+ tools: unknown[];
550
+ };
551
+ type ResponseWebSearchCallItem = {
552
+ type: "web_search_call";
553
+ id?: string | null;
554
+ status?: string | null;
555
+ action?: Record<string, unknown> | null;
556
+ };
557
+ type ResponseImageGenerationCallItem = {
558
+ type: "image_generation_call";
559
+ id: string;
560
+ status: string;
561
+ revised_prompt?: string | null;
562
+ result: string;
563
+ saved_path?: string;
564
+ };
565
+ type ResponseCompactionItem = {
566
+ type: "compaction" | "context_compaction";
567
+ encrypted_content?: string | null;
568
+ };
569
+ type ResponseOtherItem = {
570
+ type: "other";
571
+ };
572
+ type ResponseItem = ResponseMessageItem | ResponseReasoningItem | ResponseLocalShellCallItem | ResponseFunctionCallItem | ResponseToolSearchCallItem | ResponseFunctionCallOutputItem | ResponseCustomToolCallItem | ResponseCustomToolCallOutputItem | ResponseToolSearchOutputItem | ResponseWebSearchCallItem | ResponseImageGenerationCallItem | ResponseCompactionItem | ResponseOtherItem;
573
+ type ResponseItemWire = (Omit<ResponseMessageItem, "phase"> & {
574
+ phase?: MessagePhase | null;
575
+ }) | ResponseReasoningItem | ResponseLocalShellCallItem | ResponseFunctionCallItem | ResponseToolSearchCallItem | (Omit<ResponseFunctionCallOutputItem, "output"> & {
576
+ output: string | FunctionCallOutputContentItem[];
577
+ }) | ResponseCustomToolCallItem | (Omit<ResponseCustomToolCallOutputItem, "output"> & {
578
+ output: string | FunctionCallOutputContentItem[];
579
+ }) | ResponseToolSearchOutputItem | ResponseWebSearchCallItem | ResponseImageGenerationCallItem | ResponseCompactionItem | ResponseOtherItem;
580
+ declare function responseInputToResponseItem(item: ResponseInputItem): ResponseItem;
581
+ declare function functionCallOutputPayloadToWire(output: FunctionCallOutputPayload): string | FunctionCallOutputContentItem[];
582
+
583
+ type McpRequestId = string | number;
584
+ declare const McpServerStartupState: {
585
+ readonly Starting: "starting";
586
+ readonly Ready: "ready";
587
+ readonly Failed: "failed";
588
+ readonly Cancelled: "cancelled";
589
+ };
590
+ type McpServerStartupState = (typeof McpServerStartupState)[keyof typeof McpServerStartupState];
591
+ type McpAuthStatus = "unsupported" | "notLoggedIn" | "bearerToken" | "oAuth";
592
+ type McpServerStatus = {
593
+ name: string;
594
+ startup_state: McpServerStartupState;
595
+ error?: string | null;
596
+ tools?: McpToolInfo[];
597
+ resources?: McpResourceInfo[];
598
+ resource_templates?: McpResourceTemplateInfo[];
599
+ auth_status?: McpAuthStatus;
600
+ authStatus?: McpAuthStatus;
601
+ oauth?: {
602
+ status: "not_required" | "required" | "authenticated" | "failed";
603
+ error?: string | null;
604
+ } | null;
605
+ };
606
+ type McpServerStatusDetail = "full" | "toolsAndAuthOnly";
607
+ type McpServerStatusListOptions = {
608
+ detail?: McpServerStatusDetail | null;
609
+ };
610
+ type McpServerRegistry = {
611
+ servers: Record<string, unknown>;
612
+ };
613
+ type McpServerRefreshConfig = {
614
+ mcp_servers: Record<string, unknown>;
615
+ mcp_oauth_credentials_store_mode?: unknown;
616
+ };
617
+ type McpRuntimeEnvironment = {
618
+ cwd: string;
619
+ environment_id?: string | null;
620
+ };
621
+ type McpToolInfo = {
622
+ /** Raw MCP server name used to route protocol calls. */
623
+ server_name: string;
624
+ /** Raw MCP tool name sent back to the MCP server. */
625
+ name: string;
626
+ /** Model-visible namespace. Defaults to Codex's qualified MCP namespace. */
627
+ callable_namespace?: string | null;
628
+ /** Model-visible tool name. Defaults to `name` for simple hosts. */
629
+ callable_name?: string | null;
630
+ namespace_description?: string | null;
631
+ title?: string | null;
632
+ description?: string | null;
633
+ input_schema?: unknown;
634
+ connector_id?: string | null;
635
+ connector_name?: string | null;
636
+ plugin_display_names?: string[];
637
+ source_label?: string | null;
638
+ mcp_app_resource_uri?: string | null;
639
+ };
640
+ type McpResourceInfo = {
641
+ uri: string;
642
+ name?: string | null;
643
+ description?: string | null;
644
+ mime_type?: string | null;
645
+ };
646
+ type McpResourceTemplateInfo = McpResourceInfo & {
647
+ uri_template: string;
648
+ };
649
+ type McpResourceReadParams = {
650
+ thread_id?: ThreadId | null;
651
+ server_name: string;
652
+ uri: string;
653
+ };
654
+ type McpResourceListParams = {
655
+ thread_id?: ThreadId | null;
656
+ server_name?: string | null;
657
+ cursor?: string | null;
658
+ };
659
+ type McpResourceListResponse = {
660
+ server_name?: string | null;
661
+ resources: McpResourceInfo[];
662
+ next_cursor?: string | null;
663
+ };
664
+ type McpResourceTemplateListResponse = {
665
+ server_name?: string | null;
666
+ resource_templates: McpResourceTemplateInfo[];
667
+ next_cursor?: string | null;
668
+ };
669
+ type McpResourceReadResponse = {
670
+ server_name: string;
671
+ uri: string;
672
+ contents: unknown[];
673
+ };
674
+ type McpServerToolCallParams = {
675
+ thread_id: ThreadId;
676
+ call_id?: string | null;
677
+ server_name: string;
678
+ tool_name: string;
679
+ arguments?: unknown;
680
+ meta?: unknown;
681
+ };
682
+ type McpServerToolCallResponse = {
683
+ call_id?: string | null;
684
+ server_name: string;
685
+ tool_name: string;
686
+ output: unknown;
687
+ response_item?: ResponseInputItem | null;
688
+ };
689
+ type McpServerOauthLoginParams = {
690
+ name: string;
691
+ };
692
+ type McpServerOauthLoginResponse = {
693
+ status: "unsupported" | "started";
694
+ name: string;
695
+ message?: string | null;
696
+ };
697
+ type McpServerElicitationRequest = {
698
+ type: "form";
699
+ meta?: unknown;
700
+ message: string;
701
+ requested_schema: unknown;
702
+ } | {
703
+ type: "url";
704
+ meta?: unknown;
705
+ message: string;
706
+ url: string;
707
+ elicitation_id?: string | null;
708
+ };
709
+ type McpServerElicitationAction = "accept" | "decline" | "cancel";
710
+ type McpServerElicitationResponse = {
711
+ action: McpServerElicitationAction;
712
+ content?: unknown;
713
+ meta?: unknown;
714
+ };
715
+ type McpServerElicitationRequestEvent = {
716
+ turn_id: string;
717
+ server_name: string;
718
+ id: McpRequestId;
719
+ request: McpServerElicitationRequest;
720
+ };
721
+ type McpServerElicitationResponseOp = {
722
+ type: "mcp_server_elicitation_response";
723
+ server_name: string;
724
+ id: McpRequestId;
725
+ response: McpServerElicitationResponse;
726
+ };
727
+ type McpToolCallProgressEvent = {
728
+ call_id: string;
729
+ turn_id?: string | null;
730
+ server_name: string;
731
+ tool_name: string;
732
+ message?: string | null;
733
+ progress?: unknown;
734
+ };
735
+ type McpServerStatusUpdatedEvent = {
736
+ status: McpServerStatus;
737
+ };
738
+ type McpServerOauthLoginCompletedEvent = {
739
+ name: string;
740
+ status: "completed" | "failed" | "cancelled";
741
+ error?: string | null;
742
+ };
743
+ declare function mcpToolDisplayName(tool: McpToolInfo): string;
744
+ declare function mcpToolCallableNamespace(tool: McpToolInfo): string;
745
+ declare function mcpToolCallableName(tool: McpToolInfo): string;
746
+
747
+ type ByteRange = {
748
+ start: number;
749
+ end: number;
750
+ };
751
+ type TextElement = {
752
+ byte_range: ByteRange;
753
+ placeholder?: string;
754
+ };
755
+ type UserInput = {
756
+ type: "text";
757
+ text: string;
758
+ text_elements?: TextElement[];
759
+ } | {
760
+ type: "image";
761
+ image_url: string;
762
+ } | {
763
+ type: "local_image";
764
+ path: string;
765
+ } | {
766
+ type: "skill";
767
+ name: string;
768
+ path: string;
769
+ } | {
770
+ type: "mention";
771
+ name: string;
772
+ path: string;
773
+ };
774
+ type MentionInput = Extract<UserInput, {
775
+ type: "mention";
776
+ }>;
777
+
778
+ type W3cTraceContext = {
779
+ traceparent?: string;
780
+ tracestate?: string;
781
+ };
782
+ type Submission = {
783
+ id: string;
784
+ op: Op;
785
+ trace?: W3cTraceContext;
786
+ };
787
+ declare const BASE_INSTRUCTIONS_DEFAULT = "You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer.\n\n## General\n\n- Prefer to be concise, direct, and useful.\n- When asked to modify code, inspect the repository first and follow existing patterns.\n- Do not make unrelated changes.\n- If you run commands or edit files, summarize what changed and how you verified it.";
788
+ type BaseInstructions = {
789
+ text: string;
790
+ };
791
+ declare const BaseInstructions: {
792
+ default(): BaseInstructions;
793
+ };
794
+ type TokenUsage = {
795
+ input_tokens: number;
796
+ cached_input_tokens: number;
797
+ output_tokens: number;
798
+ reasoning_output_tokens: number;
799
+ total_tokens: number;
800
+ };
801
+ type TokenUsageInfo = {
802
+ total_token_usage: TokenUsage;
803
+ last_token_usage: TokenUsage;
804
+ model_context_window?: number | null;
805
+ };
806
+ type RateLimitWindow = {
807
+ remaining?: number | null;
808
+ limit?: number | null;
809
+ reset_seconds?: number | null;
810
+ [key: string]: unknown;
811
+ };
812
+ type RateLimitSnapshot = {
813
+ limit_id?: string | null;
814
+ primary?: RateLimitWindow | null;
815
+ secondary?: RateLimitWindow | null;
816
+ credits?: Record<string, unknown> | null;
817
+ plan_type?: string | null;
818
+ [key: string]: unknown;
819
+ };
820
+ type SessionSource = string;
821
+ type ReasoningEffortConfig = string;
822
+ type ReasoningSummaryConfig = string;
823
+ type AskForApproval = string;
824
+ type ApprovalsReviewer = string;
825
+ type SandboxPolicy = Record<string, unknown>;
826
+ type PermissionProfile = Record<string, unknown>;
827
+ type ActivePermissionProfile = Record<string, unknown>;
828
+ type PermissionProfileBuiltinName = ":read-only" | ":workspace" | ":danger-no-sandbox";
829
+ type WindowsSandboxLevel = string;
830
+ type ServiceTier = string;
831
+ type Personality = string;
832
+ type TurnEnvironmentSelection = {
833
+ environment_id: string;
834
+ cwd: string;
835
+ };
836
+ type TurnContextNetworkItem = {
837
+ allowed_domains: string[];
838
+ denied_domains: string[];
839
+ };
840
+ type FileSystemSandboxPolicy = Record<string, unknown>;
841
+ type TruncationPolicy = Record<string, unknown>;
842
+ type GitInfo = Record<string, unknown>;
843
+ type McpInvocation = Record<string, unknown>;
844
+ type UserTurnOp = {
845
+ type: "user_turn";
846
+ items: UserInput[];
847
+ cwd: string;
848
+ approval_policy: AskForApproval;
849
+ approvals_reviewer?: ApprovalsReviewer | null;
850
+ sandbox_policy: SandboxPolicy;
851
+ permission_profile?: PermissionProfile | null;
852
+ model: string;
853
+ effort?: ReasoningEffortConfig;
854
+ summary?: ReasoningSummaryConfig;
855
+ service_tier?: ServiceTier | null;
856
+ final_output_json_schema?: unknown;
857
+ collaboration_mode?: CollaborationMode;
858
+ personality?: Personality;
859
+ environments?: TurnEnvironmentSelection[];
860
+ };
861
+ type UserInputOp = {
862
+ type: "user_input";
863
+ items: UserInput[];
864
+ environments?: TurnEnvironmentSelection[];
865
+ final_output_json_schema?: unknown;
866
+ responsesapi_client_metadata?: Record<string, string>;
867
+ };
868
+ type UserInputWithTurnContextOp = {
869
+ type: "user_input_with_turn_context";
870
+ items: UserInput[];
871
+ final_output_json_schema?: unknown;
872
+ responsesapi_client_metadata?: Record<string, string>;
873
+ cwd?: string;
874
+ approval_policy?: AskForApproval;
875
+ approvals_reviewer?: ApprovalsReviewer;
876
+ sandbox_policy?: SandboxPolicy;
877
+ permission_profile?: PermissionProfile;
878
+ active_permission_profile?: ActivePermissionProfile;
879
+ windows_sandbox_level?: WindowsSandboxLevel;
880
+ model?: string;
881
+ effort?: ReasoningEffortConfig | null;
882
+ summary?: ReasoningSummaryConfig;
883
+ service_tier?: ServiceTier | null;
884
+ collaboration_mode?: CollaborationMode;
885
+ personality?: Personality;
886
+ environments?: TurnEnvironmentSelection[];
887
+ };
888
+ type OverrideTurnContextOp = {
889
+ type: "override_turn_context";
890
+ cwd?: string;
891
+ approval_policy?: AskForApproval;
892
+ approvals_reviewer?: ApprovalsReviewer | null;
893
+ sandbox_policy?: SandboxPolicy;
894
+ permission_profile?: PermissionProfile | null;
895
+ active_permission_profile?: ActivePermissionProfile | null;
896
+ windows_sandbox_level?: WindowsSandboxLevel;
897
+ model?: string;
898
+ effort?: ReasoningEffortConfig | null;
899
+ summary?: ReasoningSummaryConfig;
900
+ service_tier?: ServiceTier | null;
901
+ collaboration_mode?: CollaborationMode;
902
+ personality?: Personality | null;
903
+ environments?: TurnEnvironmentSelection[];
904
+ };
905
+ type UserInputAnswerOp = {
906
+ type: "user_input_answer";
907
+ id: string;
908
+ response: RequestUserInputResponse;
909
+ };
910
+ type RequestPermissionsResponseOp = {
911
+ type: "request_permissions_response";
912
+ id: string;
913
+ response: RequestPermissionsResponse;
914
+ };
915
+ type DynamicToolResponseOp = {
916
+ type: "dynamic_tool_response";
917
+ id: string;
918
+ response: DynamicToolResponse;
919
+ };
920
+ type RealtimeOutputModality = "text" | "audio";
921
+ type RealtimeVoice = "alloy" | "arbor" | "ash" | "ballad" | "breeze" | "cedar" | "coral" | "cove" | "echo" | "ember" | "juniper" | "maple" | "marin" | "sage" | "shimmer" | "sol" | "spruce" | "vale" | "verse";
922
+ type RealtimeVoicesList = {
923
+ v1: RealtimeVoice[];
924
+ v2: RealtimeVoice[];
925
+ default_v1: RealtimeVoice;
926
+ default_v2: RealtimeVoice;
927
+ };
928
+ declare const RealtimeVoicesList: {
929
+ builtin(): RealtimeVoicesList;
930
+ };
931
+ type ConversationStartTransport = {
932
+ type: "websocket";
933
+ } | {
934
+ type: "webrtc";
935
+ sdp: string;
936
+ };
937
+ type ConversationStartParams = {
938
+ output_modality: RealtimeOutputModality;
939
+ prompt?: string | null;
940
+ realtime_session_id?: string | null;
941
+ transport?: ConversationStartTransport | null;
942
+ voice?: RealtimeVoice | null;
943
+ };
944
+ type RealtimeAudioFrame = {
945
+ data: string;
946
+ sample_rate: number;
947
+ num_channels: number;
948
+ samples_per_channel?: number | null;
949
+ item_id?: string | null;
950
+ };
951
+ type RealtimeTranscriptDelta = {
952
+ delta: string;
953
+ };
954
+ type RealtimeTranscriptDone = {
955
+ text: string;
956
+ };
957
+ type RealtimeTranscriptEntry = {
958
+ role: string;
959
+ text: string;
960
+ };
961
+ type RealtimeHandoffRequested = {
962
+ handoff_id: string;
963
+ item_id: string;
964
+ input_transcript: string;
965
+ active_transcript: RealtimeTranscriptEntry[];
966
+ };
967
+ type RealtimeNoopRequested = {
968
+ call_id: string;
969
+ item_id: string;
970
+ };
971
+ type RealtimeInputAudioSpeechStarted = {
972
+ item_id?: string | null;
973
+ };
974
+ type RealtimeResponseLifecycle = {
975
+ response_id?: string | null;
976
+ };
977
+ type RealtimeEvent = {
978
+ type: "session_updated";
979
+ realtime_session_id: string;
980
+ instructions?: string | null;
981
+ } | ({
982
+ type: "input_audio_speech_started";
983
+ } & RealtimeInputAudioSpeechStarted) | ({
984
+ type: "input_transcript_delta";
985
+ } & RealtimeTranscriptDelta) | ({
986
+ type: "input_transcript_done";
987
+ } & RealtimeTranscriptDone) | ({
988
+ type: "output_transcript_delta";
989
+ } & RealtimeTranscriptDelta) | ({
990
+ type: "output_transcript_done";
991
+ } & RealtimeTranscriptDone) | ({
992
+ type: "audio_out";
993
+ } & RealtimeAudioFrame) | ({
994
+ type: "response_created";
995
+ } & RealtimeResponseLifecycle) | ({
996
+ type: "response_cancelled";
997
+ } & RealtimeResponseLifecycle) | ({
998
+ type: "response_done";
999
+ } & RealtimeResponseLifecycle) | {
1000
+ type: "conversation_item_added";
1001
+ item: unknown;
1002
+ } | {
1003
+ type: "conversation_item_done";
1004
+ item_id: string;
1005
+ } | ({
1006
+ type: "handoff_requested";
1007
+ } & RealtimeHandoffRequested) | ({
1008
+ type: "noop_requested";
1009
+ } & RealtimeNoopRequested) | {
1010
+ type: "error";
1011
+ message: string;
1012
+ };
1013
+ type ConversationAudioParams = {
1014
+ frame: RealtimeAudioFrame;
1015
+ };
1016
+ type ConversationTextParams = {
1017
+ text: string;
1018
+ };
1019
+ type ThreadRealtimeStartParams = ConversationStartParams & {
1020
+ thread_id: ThreadId;
1021
+ };
1022
+ type ThreadRealtimeStartResponse = Record<never, never>;
1023
+ type ThreadRealtimeAppendAudioParams = ConversationAudioParams & {
1024
+ thread_id: ThreadId;
1025
+ };
1026
+ type ThreadRealtimeAppendAudioResponse = Record<never, never>;
1027
+ type ThreadRealtimeAppendTextParams = ConversationTextParams & {
1028
+ thread_id: ThreadId;
1029
+ };
1030
+ type ThreadRealtimeAppendTextResponse = Record<never, never>;
1031
+ type ThreadRealtimeStopParams = {
1032
+ thread_id: ThreadId;
1033
+ };
1034
+ type ThreadRealtimeStopResponse = Record<never, never>;
1035
+ type ThreadRealtimeListVoicesParams = Record<never, never>;
1036
+ type ThreadRealtimeListVoicesResponse = {
1037
+ voices: RealtimeVoicesList;
1038
+ };
1039
+ type RealtimeConversationStartOp = {
1040
+ type: "realtime_conversation_start";
1041
+ } & ConversationStartParams;
1042
+ type RealtimeConversationAudioOp = {
1043
+ type: "realtime_conversation_audio";
1044
+ } & ConversationAudioParams;
1045
+ type RealtimeConversationTextOp = {
1046
+ type: "realtime_conversation_text";
1047
+ } & ConversationTextParams;
1048
+ type RealtimeConversationCloseOp = {
1049
+ type: "realtime_conversation_close";
1050
+ };
1051
+ type RealtimeConversationListVoicesOp = {
1052
+ type: "realtime_conversation_list_voices";
1053
+ };
1054
+ type AgentPathWire = string;
1055
+ declare const AgentStatusWire: {
1056
+ readonly Running: "running";
1057
+ readonly Completed: "completed";
1058
+ readonly Failed: "failed";
1059
+ readonly Closed: "closed";
1060
+ readonly Cancelled: "cancelled";
1061
+ };
1062
+ type AgentStatusWire = (typeof AgentStatusWire)[keyof typeof AgentStatusWire];
1063
+ type SubAgentSource = {
1064
+ type: "thread_spawn";
1065
+ parent_thread_id: ThreadId;
1066
+ depth: number;
1067
+ agent_path?: AgentPathWire | null;
1068
+ agent_role?: string | null;
1069
+ } | {
1070
+ type: "other";
1071
+ value: string;
1072
+ };
1073
+ type InterAgentCommunicationWire = {
1074
+ author: AgentPathWire;
1075
+ recipient: AgentPathWire;
1076
+ items?: unknown[];
1077
+ content: string;
1078
+ trigger_turn: boolean;
1079
+ seq?: number;
1080
+ };
1081
+ type CollabAgentRef = {
1082
+ thread_id?: ThreadId | null;
1083
+ agent_path?: AgentPathWire | null;
1084
+ agent_nickname?: string | null;
1085
+ agent_role?: string | null;
1086
+ };
1087
+ type CollabAgentSpawnBeginEvent = {
1088
+ turn_id: string;
1089
+ call_id: string;
1090
+ task?: string | null;
1091
+ };
1092
+ type CollabAgentSpawnEndEvent = {
1093
+ turn_id: string;
1094
+ call_id: string;
1095
+ agent?: CollabAgentRef | null;
1096
+ error?: string | null;
1097
+ };
1098
+ type CollabAgentInteractionBeginEvent = {
1099
+ turn_id: string;
1100
+ call_id: string;
1101
+ target: CollabAgentRef;
1102
+ };
1103
+ type CollabAgentInteractionEndEvent = {
1104
+ turn_id: string;
1105
+ call_id: string;
1106
+ target: CollabAgentRef;
1107
+ error?: string | null;
1108
+ };
1109
+ type CollabWaitingBeginEvent = {
1110
+ turn_id: string;
1111
+ call_id: string;
1112
+ targets: CollabAgentRef[];
1113
+ };
1114
+ type CollabWaitingEndEvent = {
1115
+ turn_id: string;
1116
+ call_id: string;
1117
+ statuses?: Record<string, AgentStatusWire>;
1118
+ error?: string | null;
1119
+ };
1120
+ type CollabResumeBeginEvent = {
1121
+ turn_id: string;
1122
+ call_id: string;
1123
+ target: CollabAgentRef;
1124
+ };
1125
+ type CollabResumeEndEvent = CollabAgentInteractionEndEvent;
1126
+ type CollabCloseBeginEvent = CollabAgentInteractionBeginEvent;
1127
+ type CollabCloseEndEvent = CollabAgentInteractionEndEvent;
1128
+ type CompactOp = {
1129
+ type: "compact";
1130
+ };
1131
+ type SetThreadNameOp = {
1132
+ type: "set_thread_name";
1133
+ name: string;
1134
+ };
1135
+ type SetThreadMemoryModeOp = {
1136
+ type: "set_thread_memory_mode";
1137
+ mode: ThreadMemoryMode;
1138
+ };
1139
+ type ThreadRollbackOp = {
1140
+ type: "thread_rollback";
1141
+ num_turns: number;
1142
+ };
1143
+ type InterruptOp = {
1144
+ type: "interrupt";
1145
+ };
1146
+ type ShutdownOp = {
1147
+ type: "shutdown";
1148
+ };
1149
+ type Op = UserTurnOp | UserInputOp | UserInputWithTurnContextOp | OverrideTurnContextOp | UserInputAnswerOp | RequestPermissionsResponseOp | DynamicToolResponseOp | McpServerElicitationResponseOp | RealtimeConversationStartOp | RealtimeConversationAudioOp | RealtimeConversationTextOp | RealtimeConversationCloseOp | RealtimeConversationListVoicesOp | CompactOp | SetThreadNameOp | SetThreadMemoryModeOp | ThreadRollbackOp | InterruptOp | ShutdownOp;
1150
+ type ErrorEvent = {
1151
+ message: string;
1152
+ codex_error_info?: unknown;
1153
+ };
1154
+ type WarningEvent = {
1155
+ message: string;
1156
+ };
1157
+ type TurnStartedEvent = {
1158
+ turn_id: string;
1159
+ started_at?: number | null;
1160
+ model_context_window?: number | null;
1161
+ collaboration_mode_kind?: CollaborationMode["mode"];
1162
+ };
1163
+ type TurnCompleteEvent = {
1164
+ turn_id: string;
1165
+ last_agent_message?: string | null;
1166
+ completed_at?: number | null;
1167
+ duration_ms?: number | null;
1168
+ time_to_first_token_ms?: number | null;
1169
+ };
1170
+ type TurnAbortReason = "interrupted";
1171
+ type TurnAbortedEvent = {
1172
+ turn_id: string;
1173
+ reason: TurnAbortReason;
1174
+ aborted_at?: number | null;
1175
+ completed_at?: number | null;
1176
+ duration_ms?: number | null;
1177
+ };
1178
+ type AgentMessageEvent = {
1179
+ message: string;
1180
+ phase?: string | null;
1181
+ memory_citation?: MemoryCitation | null;
1182
+ };
1183
+ type UserMessageEvent = {
1184
+ message: string;
1185
+ images?: string[] | null;
1186
+ local_images?: string[];
1187
+ text_elements?: TextElement[];
1188
+ };
1189
+ type RawResponseItemEvent = {
1190
+ item: ResponseItem;
1191
+ };
1192
+ type ItemStartedEvent = {
1193
+ turn_id?: string;
1194
+ item: TurnItem;
1195
+ };
1196
+ type ItemCompletedEvent = {
1197
+ turn_id?: string;
1198
+ item: TurnItem;
1199
+ };
1200
+ type ExecCommandStatus = "completed" | "failed" | "cancelled";
1201
+ type ExecCommandBeginEvent = {
1202
+ call_id: string;
1203
+ process_id?: string | null;
1204
+ turn_id: string;
1205
+ started_at_ms: number;
1206
+ command: string[];
1207
+ cwd: string;
1208
+ parsed_cmd?: unknown[] | null;
1209
+ source?: string | null;
1210
+ interaction_input?: string | null;
1211
+ };
1212
+ type ExecCommandOutputDeltaEvent = {
1213
+ call_id: string;
1214
+ turn_id?: string;
1215
+ stream: "stdout" | "stderr";
1216
+ chunk: string;
1217
+ };
1218
+ type TerminalInteractionEvent = {
1219
+ call_id: string;
1220
+ process_id?: string | null;
1221
+ stdin: string;
1222
+ };
1223
+ type ExecCommandEndEvent = {
1224
+ call_id: string;
1225
+ turn_id?: string;
1226
+ process_id?: string | null;
1227
+ completed_at_ms: number;
1228
+ exit_code: number;
1229
+ status: ExecCommandStatus;
1230
+ duration_ms?: number | null;
1231
+ stdout?: string | null;
1232
+ stderr?: string | null;
1233
+ output?: ExecToolCallOutput | null;
1234
+ };
1235
+ type PatchApplyUpdatedEvent = {
1236
+ call_id: string;
1237
+ turn_id?: string;
1238
+ changes: Record<string, FileChange>;
1239
+ status?: "completed" | "failed" | "declined" | null;
1240
+ stdout?: string | null;
1241
+ stderr?: string | null;
1242
+ };
1243
+ type CommandApprovalRequestEvent = {
1244
+ call_id: string;
1245
+ command: string[];
1246
+ cwd: string;
1247
+ reason?: string | null;
1248
+ };
1249
+ type FileChangeApprovalRequestEvent = {
1250
+ call_id: string;
1251
+ changes: Record<string, FileChange>;
1252
+ reason?: string | null;
1253
+ };
1254
+ type AgentMessageContentDeltaEvent = {
1255
+ thread_id: string;
1256
+ turn_id: string;
1257
+ item_id: string;
1258
+ delta: string;
1259
+ };
1260
+ type PlanDeltaEvent = {
1261
+ thread_id: string;
1262
+ turn_id: string;
1263
+ item_id: string;
1264
+ delta: string;
1265
+ };
1266
+ type UpdatePlanStepStatus = "pending" | "in_progress" | "completed";
1267
+ type UpdatePlanStep = {
1268
+ step: string;
1269
+ status: UpdatePlanStepStatus;
1270
+ };
1271
+ type UpdatePlanArgs = {
1272
+ explanation?: string | null;
1273
+ plan: UpdatePlanStep[];
1274
+ };
1275
+ type ImageGenerationBeginEvent = {
1276
+ call_id: string;
1277
+ };
1278
+ type ImageGenerationEndEvent = {
1279
+ call_id: string;
1280
+ status: string;
1281
+ revised_prompt?: string;
1282
+ result: string;
1283
+ saved_path?: string;
1284
+ };
1285
+ type ContextCompactedEvent = Record<never, never>;
1286
+ type ThreadRolledBackEvent = {
1287
+ num_turns: number;
1288
+ };
1289
+ type TokenCountEvent = {
1290
+ info?: TokenUsageInfo | null;
1291
+ rate_limits?: RateLimitSnapshot | null;
1292
+ };
1293
+ declare const ThreadGoalStatus: {
1294
+ readonly Active: "active";
1295
+ readonly Paused: "paused";
1296
+ readonly BudgetLimited: "budgetLimited";
1297
+ readonly Complete: "complete";
1298
+ };
1299
+ type ThreadGoalStatus = (typeof ThreadGoalStatus)[keyof typeof ThreadGoalStatus];
1300
+ declare const MAX_THREAD_GOAL_OBJECTIVE_CHARS = 4000;
1301
+ declare function validateThreadGoalObjective(value: string): void;
1302
+ type ThreadGoal = {
1303
+ thread_id: ThreadId;
1304
+ objective: string;
1305
+ status: ThreadGoalStatus;
1306
+ token_budget?: number | null;
1307
+ tokens_used: number;
1308
+ time_used_seconds: number;
1309
+ created_at: number;
1310
+ updated_at: number;
1311
+ };
1312
+ type ThreadGoalUpdatedEvent = {
1313
+ thread_id: ThreadId;
1314
+ turn_id?: string | null;
1315
+ goal: ThreadGoal;
1316
+ };
1317
+ type McpToolCallBeginEvent = {
1318
+ call_id: string;
1319
+ invocation: McpInvocation;
1320
+ mcp_app_resource_uri?: string;
1321
+ };
1322
+ type McpToolCallEndEvent = {
1323
+ call_id: string;
1324
+ invocation: McpInvocation;
1325
+ mcp_app_resource_uri?: string;
1326
+ duration: string;
1327
+ result: unknown;
1328
+ };
1329
+ type McpToolCallProgressEventMsg = {
1330
+ type: "mcp_tool_call_progress";
1331
+ } & McpToolCallProgressEvent;
1332
+ type McpServerStatusUpdatedEventMsg = {
1333
+ type: "mcp_server_status_updated";
1334
+ } & McpServerStatusUpdatedEvent;
1335
+ type McpServerOauthLoginCompletedEventMsg = {
1336
+ type: "mcp_server_oauth_login_completed";
1337
+ } & McpServerOauthLoginCompletedEvent;
1338
+ type McpServerElicitationRequestEventMsg = {
1339
+ type: "mcp_server_elicitation_request";
1340
+ } & McpServerElicitationRequestEvent;
1341
+ declare const HookEventName: {
1342
+ readonly PreToolUse: "pre_tool_use";
1343
+ readonly PermissionRequest: "permission_request";
1344
+ readonly PostToolUse: "post_tool_use";
1345
+ readonly PreCompact: "pre_compact";
1346
+ readonly PostCompact: "post_compact";
1347
+ readonly SessionStart: "session_start";
1348
+ readonly UserPromptSubmit: "user_prompt_submit";
1349
+ readonly Stop: "stop";
1350
+ };
1351
+ type HookEventName = (typeof HookEventName)[keyof typeof HookEventName];
1352
+ declare const HookHandlerType: {
1353
+ readonly Command: "command";
1354
+ readonly Prompt: "prompt";
1355
+ readonly Agent: "agent";
1356
+ };
1357
+ type HookHandlerType = (typeof HookHandlerType)[keyof typeof HookHandlerType];
1358
+ declare const HookExecutionMode: {
1359
+ readonly Sync: "sync";
1360
+ readonly Async: "async";
1361
+ };
1362
+ type HookExecutionMode = (typeof HookExecutionMode)[keyof typeof HookExecutionMode];
1363
+ declare const HookScope: {
1364
+ readonly Thread: "thread";
1365
+ readonly Turn: "turn";
1366
+ };
1367
+ type HookScope = (typeof HookScope)[keyof typeof HookScope];
1368
+ declare const HookSource: {
1369
+ readonly System: "system";
1370
+ readonly User: "user";
1371
+ readonly Project: "project";
1372
+ readonly Mdm: "mdm";
1373
+ readonly SessionFlags: "session_flags";
1374
+ readonly Plugin: "plugin";
1375
+ readonly CloudRequirements: "cloud_requirements";
1376
+ readonly LegacyManagedConfigFile: "legacy_managed_config_file";
1377
+ readonly LegacyManagedConfigMdm: "legacy_managed_config_mdm";
1378
+ readonly Unknown: "unknown";
1379
+ };
1380
+ type HookSource = (typeof HookSource)[keyof typeof HookSource];
1381
+ declare const HookTrustStatus: {
1382
+ readonly Managed: "managed";
1383
+ readonly Untrusted: "untrusted";
1384
+ readonly Trusted: "trusted";
1385
+ readonly Modified: "modified";
1386
+ };
1387
+ type HookTrustStatus = (typeof HookTrustStatus)[keyof typeof HookTrustStatus];
1388
+ declare const HookRunStatus: {
1389
+ readonly Running: "running";
1390
+ readonly Completed: "completed";
1391
+ readonly Failed: "failed";
1392
+ readonly Blocked: "blocked";
1393
+ readonly Stopped: "stopped";
1394
+ };
1395
+ type HookRunStatus = (typeof HookRunStatus)[keyof typeof HookRunStatus];
1396
+ declare const HookOutputEntryKind: {
1397
+ readonly Warning: "warning";
1398
+ readonly Stop: "stop";
1399
+ readonly Feedback: "feedback";
1400
+ readonly Context: "context";
1401
+ readonly Error: "error";
1402
+ };
1403
+ type HookOutputEntryKind = (typeof HookOutputEntryKind)[keyof typeof HookOutputEntryKind];
1404
+ type HookOutputEntry = {
1405
+ kind: HookOutputEntryKind;
1406
+ text: string;
1407
+ };
1408
+ type HookRunSummary = {
1409
+ id: string;
1410
+ event_name: HookEventName;
1411
+ handler_type: HookHandlerType;
1412
+ execution_mode: HookExecutionMode;
1413
+ scope: HookScope;
1414
+ source_path: string;
1415
+ source: HookSource;
1416
+ display_order: number;
1417
+ status: HookRunStatus;
1418
+ status_message?: string | null;
1419
+ started_at: number;
1420
+ completed_at?: number | null;
1421
+ duration_ms?: number | null;
1422
+ entries: HookOutputEntry[];
1423
+ };
1424
+ type HookStartedEvent = {
1425
+ turn_id?: string | null;
1426
+ run: HookRunSummary;
1427
+ };
1428
+ type HookCompletedEvent = {
1429
+ turn_id?: string | null;
1430
+ run: HookRunSummary;
1431
+ };
1432
+ type RealtimeConversationVersion = "v1" | "v2";
1433
+ type RealtimeConversationStartedEvent = {
1434
+ realtime_session_id?: string | null;
1435
+ version: RealtimeConversationVersion;
1436
+ };
1437
+ type RealtimeConversationRealtimeEvent = {
1438
+ payload: RealtimeEvent;
1439
+ };
1440
+ type RealtimeConversationClosedEvent = {
1441
+ reason?: string | null;
1442
+ };
1443
+ type RealtimeConversationSdpEvent = {
1444
+ sdp: string;
1445
+ };
1446
+ type RealtimeConversationListVoicesResponseEvent = {
1447
+ voices: RealtimeVoicesList;
1448
+ };
1449
+ /** Codex Rust variant: `TurnStarted`; v1 wire value: `turn_started`. */
1450
+ type TurnStartedEventMsg = {
1451
+ type: "turn_started";
1452
+ } & TurnStartedEvent;
1453
+ /** Codex Rust variant: `TurnComplete`; v1 wire value: `turn_complete`. */
1454
+ type TurnCompleteEventMsg = {
1455
+ type: "turn_complete";
1456
+ } & TurnCompleteEvent;
1457
+ /** Codex Rust variant: `TurnAborted`; v1 wire value: `turn_aborted`. */
1458
+ type TurnAbortedEventMsg = {
1459
+ type: "turn_aborted";
1460
+ } & TurnAbortedEvent;
1461
+ type AgentMessageEventMsg = {
1462
+ type: "agent_message";
1463
+ } & AgentMessageEvent;
1464
+ type UserMessageEventMsg = {
1465
+ type: "user_message";
1466
+ } & UserMessageEvent;
1467
+ type RawResponseItemEventMsg = {
1468
+ type: "raw_response_item";
1469
+ } & RawResponseItemEvent;
1470
+ type ItemStartedEventMsg = {
1471
+ type: "item_started";
1472
+ } & ItemStartedEvent;
1473
+ type ItemCompletedEventMsg = {
1474
+ type: "item_completed";
1475
+ } & ItemCompletedEvent;
1476
+ type ExecCommandBeginEventMsg = {
1477
+ type: "exec_command_begin";
1478
+ } & ExecCommandBeginEvent;
1479
+ type ExecCommandOutputDeltaEventMsg = {
1480
+ type: "exec_command_output_delta";
1481
+ } & ExecCommandOutputDeltaEvent;
1482
+ type TerminalInteractionEventMsg = {
1483
+ type: "terminal_interaction";
1484
+ } & TerminalInteractionEvent;
1485
+ type ExecCommandEndEventMsg = {
1486
+ type: "exec_command_end";
1487
+ } & ExecCommandEndEvent;
1488
+ type PatchApplyUpdatedEventMsg = {
1489
+ type: "patch_apply_updated";
1490
+ } & PatchApplyUpdatedEvent;
1491
+ type CommandApprovalRequestEventMsg = {
1492
+ type: "command_approval_request";
1493
+ } & CommandApprovalRequestEvent;
1494
+ type FileChangeApprovalRequestEventMsg = {
1495
+ type: "file_change_approval_request";
1496
+ } & FileChangeApprovalRequestEvent;
1497
+ type AgentMessageContentDeltaEventMsg = {
1498
+ type: "agent_message_content_delta";
1499
+ } & AgentMessageContentDeltaEvent;
1500
+ /** Codex Rust variant: `PlanDelta`; v1 wire value: `plan_delta`. */
1501
+ type PlanDeltaEventMsg = {
1502
+ type: "plan_delta";
1503
+ } & PlanDeltaEvent;
1504
+ type PlanUpdateEventMsg = {
1505
+ type: "plan_update";
1506
+ } & UpdatePlanArgs;
1507
+ type RequestUserInputEventMsg = {
1508
+ type: "request_user_input";
1509
+ } & RequestUserInputEvent;
1510
+ type RequestPermissionsEventMsg = {
1511
+ type: "request_permissions";
1512
+ } & RequestPermissionsEvent;
1513
+ type DynamicToolCallRequestEventMsg = {
1514
+ type: "dynamic_tool_call_request";
1515
+ } & DynamicToolCallRequest;
1516
+ type DynamicToolCallResponseEventMsg = {
1517
+ type: "dynamic_tool_call_response";
1518
+ } & DynamicToolCallResponseEvent;
1519
+ type ImageGenerationBeginEventMsg = {
1520
+ type: "image_generation_begin";
1521
+ } & ImageGenerationBeginEvent;
1522
+ type ImageGenerationEndEventMsg = {
1523
+ type: "image_generation_end";
1524
+ } & ImageGenerationEndEvent;
1525
+ type ContextCompactedEventMsg = {
1526
+ type: "context_compacted";
1527
+ } & ContextCompactedEvent;
1528
+ type ThreadRolledBackEventMsg = {
1529
+ type: "thread_rolled_back";
1530
+ } & ThreadRolledBackEvent;
1531
+ type TokenCountEventMsg = {
1532
+ type: "token_count";
1533
+ } & TokenCountEvent;
1534
+ type ThreadGoalUpdatedEventMsg = {
1535
+ type: "thread_goal_updated";
1536
+ } & ThreadGoalUpdatedEvent;
1537
+ type WarningEventMsg = {
1538
+ type: "warning";
1539
+ } & WarningEvent;
1540
+ type ErrorEventMsg = {
1541
+ type: "error";
1542
+ } & ErrorEvent;
1543
+ type HookStartedEventMsg = {
1544
+ type: "hook_started";
1545
+ } & HookStartedEvent;
1546
+ type HookCompletedEventMsg = {
1547
+ type: "hook_completed";
1548
+ } & HookCompletedEvent;
1549
+ type RealtimeConversationStartedEventMsg = {
1550
+ type: "realtime_conversation_started";
1551
+ } & RealtimeConversationStartedEvent;
1552
+ type RealtimeConversationRealtimeEventMsg = {
1553
+ type: "realtime_conversation_realtime";
1554
+ } & RealtimeConversationRealtimeEvent;
1555
+ type RealtimeConversationClosedEventMsg = {
1556
+ type: "realtime_conversation_closed";
1557
+ } & RealtimeConversationClosedEvent;
1558
+ type RealtimeConversationSdpEventMsg = {
1559
+ type: "realtime_conversation_sdp";
1560
+ } & RealtimeConversationSdpEvent;
1561
+ type RealtimeConversationListVoicesResponseEventMsg = {
1562
+ type: "realtime_conversation_list_voices_response";
1563
+ } & RealtimeConversationListVoicesResponseEvent;
1564
+ type SessionConfiguredEvent = {
1565
+ session_id: string;
1566
+ thread_id: ThreadId;
1567
+ forked_from_id?: ThreadId | null;
1568
+ thread_source?: string | null;
1569
+ thread_name?: string | null;
1570
+ model: string;
1571
+ model_provider_id: string;
1572
+ service_tier?: ServiceTier | null;
1573
+ approval_policy: AskForApproval;
1574
+ approvals_reviewer?: ApprovalsReviewer | null;
1575
+ permission_profile: PermissionProfile;
1576
+ active_permission_profile?: ActivePermissionProfile | null;
1577
+ cwd: string;
1578
+ reasoning_effort?: ReasoningEffortConfig | null;
1579
+ initial_messages?: EventMsg[] | null;
1580
+ network_proxy?: unknown | null;
1581
+ rollout_path?: string | null;
1582
+ };
1583
+ type SessionConfiguredEventMsg = {
1584
+ type: "session_configured";
1585
+ } & SessionConfiguredEvent;
1586
+ type EventMsg = SessionConfiguredEventMsg | TurnStartedEventMsg | TurnCompleteEventMsg | TurnAbortedEventMsg | AgentMessageEventMsg | UserMessageEventMsg | RawResponseItemEventMsg | ItemStartedEventMsg | ItemCompletedEventMsg | ExecCommandBeginEventMsg | ExecCommandOutputDeltaEventMsg | TerminalInteractionEventMsg | ExecCommandEndEventMsg | PatchApplyUpdatedEventMsg | CommandApprovalRequestEventMsg | FileChangeApprovalRequestEventMsg | AgentMessageContentDeltaEventMsg | PlanDeltaEventMsg | PlanUpdateEventMsg | RequestUserInputEventMsg | RequestPermissionsEventMsg | DynamicToolCallRequestEventMsg | DynamicToolCallResponseEventMsg | McpToolCallProgressEventMsg | McpServerStatusUpdatedEventMsg | McpServerOauthLoginCompletedEventMsg | McpServerElicitationRequestEventMsg | ImageGenerationBeginEventMsg | ImageGenerationEndEventMsg | ContextCompactedEventMsg | ThreadRolledBackEventMsg | TokenCountEventMsg | ThreadGoalUpdatedEventMsg | WarningEventMsg | HookStartedEventMsg | HookCompletedEventMsg | RealtimeConversationStartedEventMsg | RealtimeConversationRealtimeEventMsg | RealtimeConversationClosedEventMsg | RealtimeConversationSdpEventMsg | RealtimeConversationListVoicesResponseEventMsg | ErrorEventMsg;
1587
+ type SessionMeta = {
1588
+ id: ThreadId;
1589
+ forked_from_id?: ThreadId | null;
1590
+ timestamp: string;
1591
+ cwd: string;
1592
+ originator: string;
1593
+ cli_version: string;
1594
+ source: SessionSource;
1595
+ agent_nickname?: string | null;
1596
+ agent_role?: string | null;
1597
+ agent_path?: string | null;
1598
+ model_provider: string | null;
1599
+ base_instructions: BaseInstructions | null;
1600
+ dynamic_tools?: DynamicToolSpec[] | null;
1601
+ memory_mode?: ThreadMemoryModeSessionMetaValue | null;
1602
+ };
1603
+ type SessionMetaLine = SessionMeta & {
1604
+ git?: GitInfo | null;
1605
+ };
1606
+ type CompactedItem = {
1607
+ message: string;
1608
+ replacement_history?: ResponseItem[];
1609
+ };
1610
+ type TurnContextItem = {
1611
+ turn_id?: string;
1612
+ trace_id?: string;
1613
+ cwd: string;
1614
+ current_date?: string;
1615
+ timezone?: string;
1616
+ approval_policy: AskForApproval;
1617
+ sandbox_policy: SandboxPolicy;
1618
+ permission_profile?: PermissionProfile | null;
1619
+ windows_sandbox_level?: WindowsSandboxLevel | null;
1620
+ network?: TurnContextNetworkItem | null;
1621
+ file_system_sandbox_policy?: FileSystemSandboxPolicy | null;
1622
+ model: string;
1623
+ personality?: Personality | null;
1624
+ collaboration_mode?: CollaborationMode | null;
1625
+ realtime_active?: boolean | null;
1626
+ effort?: ReasoningEffortConfig | null;
1627
+ summary: ReasoningSummaryConfig;
1628
+ user_instructions?: string | null;
1629
+ developer_instructions?: string | null;
1630
+ final_output_json_schema?: unknown;
1631
+ truncation_policy?: TruncationPolicy | null;
1632
+ };
1633
+ type SessionMetaRolloutItem = {
1634
+ type: "session_meta";
1635
+ payload: SessionMetaLine;
1636
+ };
1637
+ type ResponseRolloutItem = {
1638
+ type: "response_item";
1639
+ payload: ResponseItem;
1640
+ };
1641
+ type CompactedRolloutItem = {
1642
+ type: "compacted";
1643
+ payload: CompactedItem;
1644
+ };
1645
+ type TurnContextRolloutItem = {
1646
+ type: "turn_context";
1647
+ payload: TurnContextItem;
1648
+ };
1649
+ type EventMsgRolloutItem = {
1650
+ type: "event_msg";
1651
+ payload: EventMsg;
1652
+ };
1653
+ type RolloutItem = SessionMetaRolloutItem | ResponseRolloutItem | CompactedRolloutItem | TurnContextRolloutItem | EventMsgRolloutItem;
1654
+
1655
+ export { type LoadableToolSpec as $, type ResponseItem as A, BaseInstructions as B, type CollaborationMode as C, type DynamicToolSpec as D, type EventMsg as E, type FunctionCallOutputContentItem as F, type ToolSpec as G, type TokenUsage as H, type RateLimitSnapshot as I, type SessionSource as J, type TextElement as K, type ActivePermissionProfile as L, type McpResourceInfo as M, type ServiceTier as N, type Op as O, type PermissionProfile as P, type ReasoningEffortConfig as Q, type RealtimeEvent as R, type SandboxPolicy as S, TUI_VISIBLE_COLLABORATION_MODES as T, type UserInput as U, type ReasoningSummaryConfig as V, type Personality as W, type AskForApproval as X, type ApprovalsReviewer as Y, type WindowsSandboxLevel as Z, type TurnEnvironmentSelection as _, type CollaborationModeMask as a, type CollabWaitingEndEvent as a$, type ConfiguredToolSpec as a0, type PermissionProfileBuiltinName as a1, type ResponseItemWire as a2, responseInputToResponseItem as a3, type UserMessageTurnItem as a4, type DynamicToolResponse as a5, type McpResourceListParams as a6, type McpResourceListResponse as a7, type McpResourceTemplateListResponse as a8, type McpResourceReadParams as a9, type W3cTraceContext as aA, type ResponseInputItem as aB, type ContentItem as aC, type AgentMessageTurnItem as aD, type HookPromptTurnItem as aE, type FileChange as aF, type ExecToolCallOutput as aG, type AgentMessageContent as aH, type AgentMessageContentDeltaEvent as aI, type AgentMessageContentDeltaEventMsg as aJ, type AgentMessageEvent as aK, type AgentMessageEventMsg as aL, type AgentPathWire as aM, AgentStatusWire as aN, BASE_INSTRUCTIONS_DEFAULT as aO, type ByteRange as aP, type CodexBrand as aQ, type CollabAgentInteractionBeginEvent as aR, type CollabAgentInteractionEndEvent as aS, type CollabAgentRef as aT, type CollabAgentSpawnBeginEvent as aU, type CollabAgentSpawnEndEvent as aV, type CollabCloseBeginEvent as aW, type CollabCloseEndEvent as aX, type CollabResumeBeginEvent as aY, type CollabResumeEndEvent as aZ, type CollabWaitingBeginEvent as a_, type McpResourceReadResponse as aa, type McpServerToolCallParams as ab, type McpServerToolCallResponse as ac, type McpRequestId as ad, type McpServerElicitationResponse as ae, type ThreadGoal as af, ThreadGoalStatus as ag, HookEventName as ah, HookSource as ai, HookRunStatus as aj, type HookOutputEntry as ak, type HookRunSummary as al, HookScope as am, type HookCompletedEvent as an, type RequestPermissionsResponse as ao, type RequestUserInputResponse as ap, type RequestPermissionProfile as aq, type OverrideTurnContextOp as ar, type UserInputOp as as, type UserInputWithTurnContextOp as at, type UserTurnOp as au, type NormalizedRequestUserInputArgs as av, type RequestPermissionsArgs as aw, type McpServerElicitationRequest as ax, type CompactedItem as ay, type TurnContextItem as az, type DynamicToolSpecWire as b, type McpServerElicitationRequestEvent as b$, type CollaborationModeSettings as b0, type CommandApprovalRequestEvent as b1, type CommandApprovalRequestEventMsg as b2, type CommandExecutionStatus as b3, type CommandExecutionTurnItem as b4, type CompactOp as b5, type CompactedRolloutItem as b6, type ContextCompactedEvent as b7, type ContextCompactedEventMsg as b8, type ContextCompactionTurnItem as b9, type FreeformTool as bA, type FunctionCallOutputBody as bB, type GitInfo as bC, type HookCompletedEventMsg as bD, HookExecutionMode as bE, HookHandlerType as bF, HookOutputEntryKind as bG, type HookPromptFragment as bH, type HookStartedEvent as bI, type HookStartedEventMsg as bJ, HookTrustStatus as bK, type ImageGenerationBeginEvent as bL, type ImageGenerationBeginEventMsg as bM, type ImageGenerationEndEvent as bN, type ImageGenerationEndEventMsg as bO, type ImageGenerationTurnItem as bP, type ImageViewTurnItem as bQ, type InterAgentCommunicationWire as bR, type InterruptOp as bS, type ItemCompletedEvent as bT, type ItemCompletedEventMsg as bU, type ItemStartedEvent as bV, type ItemStartedEventMsg as bW, type JsonSchema as bX, MAX_THREAD_GOAL_OBJECTIVE_CHARS as bY, type McpInvocation as bZ, type McpServerElicitationAction as b_, type ConversationAudioParams as ba, type ConversationStartParams as bb, type ConversationStartTransport as bc, type ConversationTextParams as bd, type DynamicToolCallOutputContentItem as be, type DynamicToolCallRequestEventMsg as bf, type DynamicToolCallResponseEvent as bg, type DynamicToolCallResponseEventMsg as bh, type DynamicToolCallStatus as bi, type DynamicToolCallTurnItem as bj, type DynamicToolResponseOp as bk, type ErrorEvent as bl, type ErrorEventMsg as bm, type EventMsgRolloutItem as bn, type ExecCommandBeginEvent as bo, type ExecCommandBeginEventMsg as bp, type ExecCommandEndEvent as bq, type ExecCommandEndEventMsg as br, type ExecCommandOutputDeltaEvent as bs, type ExecCommandOutputDeltaEventMsg as bt, type ExecCommandStatus as bu, type FileChangeApprovalRequestEvent as bv, type FileChangeApprovalRequestEventMsg as bw, type FileChangeTurnItem as bx, type FileSystemPermissions as by, type FileSystemSandboxPolicy as bz, type McpResourceTemplateInfo as c, RealtimeVoicesList as c$, type McpServerElicitationRequestEventMsg as c0, type McpServerElicitationResponseOp as c1, type McpServerOauthLoginCompletedEvent as c2, type McpServerOauthLoginCompletedEventMsg as c3, type McpServerOauthLoginParams as c4, type McpServerOauthLoginResponse as c5, type McpServerRegistry as c6, McpServerStartupState as c7, type McpServerStatusDetail as c8, type McpServerStatusUpdatedEvent as c9, type RawResponseItemEventMsg as cA, type RealtimeAudioFrame as cB, type RealtimeConversationAudioOp as cC, type RealtimeConversationCloseOp as cD, type RealtimeConversationClosedEvent as cE, type RealtimeConversationClosedEventMsg as cF, type RealtimeConversationListVoicesOp as cG, type RealtimeConversationListVoicesResponseEvent as cH, type RealtimeConversationListVoicesResponseEventMsg as cI, type RealtimeConversationRealtimeEvent as cJ, type RealtimeConversationRealtimeEventMsg as cK, type RealtimeConversationSdpEvent as cL, type RealtimeConversationSdpEventMsg as cM, type RealtimeConversationStartOp as cN, type RealtimeConversationStartedEvent as cO, type RealtimeConversationStartedEventMsg as cP, type RealtimeConversationTextOp as cQ, type RealtimeConversationVersion as cR, type RealtimeHandoffRequested as cS, type RealtimeInputAudioSpeechStarted as cT, type RealtimeNoopRequested as cU, type RealtimeOutputModality as cV, type RealtimeResponseLifecycle as cW, type RealtimeTranscriptDelta as cX, type RealtimeTranscriptDone as cY, type RealtimeTranscriptEntry as cZ, type RealtimeVoice as c_, type McpServerStatusUpdatedEventMsg as ca, type McpToolCallBeginEvent as cb, type McpToolCallEndEvent as cc, type McpToolCallError as cd, type McpToolCallProgressEvent as ce, type McpToolCallProgressEventMsg as cf, type McpToolCallStatus as cg, type McpToolCallTurnItem as ch, type MemoryCitation as ci, type MemoryCitationEntry as cj, type MentionInput as ck, type MessagePhase as cl, type NetworkPermissions as cm, type NormalizedRequestUserInputQuestion as cn, type PatchApplyStatus as co, type PatchApplyUpdatedEvent as cp, type PatchApplyUpdatedEventMsg as cq, PermissionGrantScope as cr, type PlanDeltaEvent as cs, type PlanDeltaEventMsg as ct, type PlanTurnItem as cu, type PlanUpdateEventMsg as cv, REQUEST_PERMISSIONS_TOOL_NAME as cw, REQUEST_USER_INPUT_TOOL_NAME as cx, type RateLimitWindow as cy, type RawResponseItemEvent as cz, type McpRuntimeEnvironment as d, type WebSearchAction as d$, type ReasoningEffort as d0, type ReasoningTurnItem as d1, type RequestPermissionsEventMsg as d2, type RequestPermissionsResponseOp as d3, type RequestUserInputAnswer as d4, type RequestUserInputArgs as d5, type RequestUserInputEventMsg as d6, type RequestUserInputQuestion as d7, type RequestUserInputQuestionOption as d8, type ResponseRolloutItem as d9, type ThreadRealtimeListVoicesResponse as dA, type ThreadRealtimeStartParams as dB, type ThreadRealtimeStartResponse as dC, type ThreadRealtimeStopParams as dD, type ThreadRealtimeStopResponse as dE, type ThreadRollbackOp as dF, type ThreadRolledBackEvent as dG, type ThreadRolledBackEventMsg as dH, type TokenCountEvent as dI, type TokenCountEventMsg as dJ, type TurnAbortReason as dK, type TurnAbortedEvent as dL, type TurnAbortedEventMsg as dM, type TurnCompleteEvent as dN, type TurnCompleteEventMsg as dO, type TurnContextNetworkItem as dP, type TurnContextRolloutItem as dQ, type TurnStartedEvent as dR, type TurnStartedEventMsg as dS, type UpdatePlanArgs as dT, type UpdatePlanStep as dU, type UpdatePlanStepStatus as dV, type UserInputAnswerOp as dW, type UserMessageEvent as dX, type UserMessageEventMsg as dY, type WarningEvent as dZ, type WarningEventMsg as d_, type ResponsesApiFunctionTool as da, type ResponsesApiNamespace as db, type ResponsesApiNamespaceTool as dc, type ResponsesApiTool as dd, ReviewDecision as de, type SessionConfiguredEvent as df, type SessionConfiguredEventMsg as dg, type SessionMeta as dh, type SessionMetaLine as di, type SessionMetaRolloutItem as dj, type SetThreadMemoryModeOp as dk, type SetThreadNameOp as dl, type ShutdownOp as dm, type StreamOutput as dn, type SubAgentSource as dp, type TerminalInteractionEvent as dq, type TerminalInteractionEventMsg as dr, type ThreadGoalUpdatedEvent as ds, type ThreadGoalUpdatedEventMsg as dt, ThreadMemoryModeSessionMetaValue as du, type ThreadRealtimeAppendAudioParams as dv, type ThreadRealtimeAppendAudioResponse as dw, type ThreadRealtimeAppendTextParams as dx, type ThreadRealtimeAppendTextResponse as dy, type ThreadRealtimeListVoicesParams as dz, type McpServerRefreshConfig as e, type WebSearchTurnItem as e0, assertValidResponsesToolSpecs as e1, cloneRequestPermissionProfile as e2, coalesce_loadable_tool_specs as e3, createRequestPermissionsTool as e4, createRequestUserInputTool as e5, create_tools_json_for_responses_api as e6, default_namespace_description as e7, dynamicToolSpecFromWire as e8, dynamicToolSpecToWire as e9, dynamic_tool_to_loadable_tool_spec as ea, dynamic_tool_to_responses_api_tool as eb, emptyRequestPermissionsResponse as ec, execToolCallOutput as ed, functionCallOutputPayloadToWire as ee, isEmptyRequestPermissionProfile as ef, mcpToolCallableName as eg, mcpToolCallableNamespace as eh, mcpToolDisplayName as ei, modeDisplayName as ej, normalizeRequestPermissionsArgs as ek, normalizeRequestUserInputArgs as el, requestPermissionsToolDescription as em, requestUserInputAvailableModes as en, requestUserInputToolDescription as eo, requestUserInputUnavailableMessage as ep, streamOutput as eq, threadMemoryModeToSessionMetaValue as er, toolSpecName as es, validateThreadGoalObjective as et, type McpServerStatus as f, type McpServerStatusListOptions as g, type McpToolInfo as h, ModeKind as i, type RolloutItem as j, type Submission as k, type ThreadId as l, ThreadMemoryMode as m, allowsRequestUserInput as n, applyCollaborationModeMask as o, asThreadId as p, collaborationModeForModel as q, collaborationModeWithUpdates as r, deniedRequestPermissionsResponse as s, type TurnItem as t, type RequestUserInputEvent as u, type RequestPermissionsEvent as v, type DynamicToolCallRequest as w, type TokenUsageInfo as x, type TruncationPolicy as y, type FunctionCallOutputPayload as z };