@jrkropp/codex-js 0.1.1 → 0.1.3

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 (132) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/ClientNotification-B6-FhXQf.d.ts +5 -0
  3. package/dist/{DynamicToolCallResponse-D2OVpa4p.d.ts → DynamicToolCallResponse-82DFjES2.d.ts} +1 -1
  4. package/dist/DynamicToolSpec-CfnhqAYK.d.ts +29 -0
  5. package/dist/PermissionsRequestApprovalResponse-DxzPPDRb.d.ts +55 -0
  6. package/dist/ProviderStatusBanner-BlP6lzwE.d.ts +441 -0
  7. package/dist/ServerRequest-B5cKVJjr.d.ts +2181 -0
  8. package/dist/{session-BO6EZNK7.d.ts → ThreadResumeResponse-DvmE1juU.d.ts} +3 -290
  9. package/dist/ToolRequestUserInputQuestion-CeZa5X1J.d.ts +23 -0
  10. package/dist/{ToolRequestUserInputResponse-Bxjlpgho.d.ts → ToolRequestUserInputResponse-zcPLwbiK.d.ts} +1 -1
  11. package/dist/TurnSteerResponse-0kBCfplh.d.ts +209 -0
  12. package/dist/WebSearchToolConfig-D3ep0625.d.ts +18 -0
  13. package/dist/chat-runtime-B6azJyKo.d.ts +381 -0
  14. package/dist/chunk-2DZRMCI2.js +1258 -0
  15. package/dist/chunk-2DZRMCI2.js.map +1 -0
  16. package/dist/chunk-4DPLJPB5.js +396 -0
  17. package/dist/chunk-4DPLJPB5.js.map +1 -0
  18. package/dist/chunk-5JMJ6OI5.js +3 -0
  19. package/dist/chunk-5JMJ6OI5.js.map +1 -0
  20. package/dist/chunk-6ZMJ34KE.js +1153 -0
  21. package/dist/chunk-6ZMJ34KE.js.map +1 -0
  22. package/dist/chunk-CGBS37IU.js +128 -0
  23. package/dist/chunk-CGBS37IU.js.map +1 -0
  24. package/dist/chunk-DCMKA2A6.js +18 -0
  25. package/dist/chunk-DCMKA2A6.js.map +1 -0
  26. package/dist/chunk-DYLHN3HG.js +937 -0
  27. package/dist/chunk-DYLHN3HG.js.map +1 -0
  28. package/dist/chunk-ILXA6HLX.js +1973 -0
  29. package/dist/chunk-ILXA6HLX.js.map +1 -0
  30. package/dist/{chunk-TZBLUZ2X.js → chunk-LWQNX4LI.js} +7811 -12696
  31. package/dist/chunk-LWQNX4LI.js.map +1 -0
  32. package/dist/{chunk-FFASNDXU.js → chunk-NCI4MAWZ.js} +317 -1967
  33. package/dist/chunk-NCI4MAWZ.js.map +1 -0
  34. package/dist/chunk-O44XP7LH.js +214 -0
  35. package/dist/chunk-O44XP7LH.js.map +1 -0
  36. package/dist/chunk-PST3ZWX2.js +555 -0
  37. package/dist/chunk-PST3ZWX2.js.map +1 -0
  38. package/dist/chunk-SYPHCDRD.js +1133 -0
  39. package/dist/chunk-SYPHCDRD.js.map +1 -0
  40. package/dist/chunk-V4BMZWBM.js +2401 -0
  41. package/dist/chunk-V4BMZWBM.js.map +1 -0
  42. package/dist/chunk-YHVCFD2D.js +117 -0
  43. package/dist/chunk-YHVCFD2D.js.map +1 -0
  44. package/dist/chunk-Z63UPBS3.js +152 -0
  45. package/dist/chunk-Z63UPBS3.js.map +1 -0
  46. package/dist/client/index.d.ts +16 -111
  47. package/dist/client/index.js +13 -1
  48. package/dist/codex-rs/app-server/index.d.ts +161 -0
  49. package/dist/codex-rs/app-server/index.js +13 -0
  50. package/dist/codex-rs/app-server/index.js.map +1 -0
  51. package/dist/codex-rs/app-server-protocol/index.d.ts +1722 -0
  52. package/dist/codex-rs/app-server-protocol/index.js +6 -0
  53. package/dist/codex-rs/app-server-protocol/index.js.map +1 -0
  54. package/dist/codex-rs/app-server-protocol/protocol.d.ts +19 -0
  55. package/dist/codex-rs/app-server-protocol/protocol.js +4 -0
  56. package/dist/codex-rs/app-server-protocol/protocol.js.map +1 -0
  57. package/dist/codex-rs/codex-api/index.d.ts +104 -0
  58. package/dist/codex-rs/codex-api/index.js +11 -0
  59. package/dist/codex-rs/codex-api/index.js.map +1 -0
  60. package/dist/codex-rs/config/index.d.ts +88 -0
  61. package/dist/codex-rs/config/index.js +4 -0
  62. package/dist/codex-rs/config/index.js.map +1 -0
  63. package/dist/codex-rs/core/config/index.d.ts +61 -0
  64. package/dist/codex-rs/core/config/index.js +5 -0
  65. package/dist/codex-rs/core/config/index.js.map +1 -0
  66. package/dist/codex-rs/core/index.d.ts +1393 -0
  67. package/dist/codex-rs/core/index.js +11 -0
  68. package/dist/codex-rs/core/index.js.map +1 -0
  69. package/dist/codex-rs/model-provider/index.d.ts +2 -0
  70. package/dist/codex-rs/model-provider/index.js +4 -0
  71. package/dist/codex-rs/model-provider/index.js.map +1 -0
  72. package/dist/codex-rs/models-manager/index.d.ts +2 -0
  73. package/dist/codex-rs/models-manager/index.js +4 -0
  74. package/dist/codex-rs/models-manager/index.js.map +1 -0
  75. package/dist/codex-rs/parity.d.ts +26 -0
  76. package/dist/codex-rs/parity.js +3 -0
  77. package/dist/codex-rs/parity.js.map +1 -0
  78. package/dist/codex-rs/thread-store/index.d.ts +5 -0
  79. package/dist/codex-rs/thread-store/index.js +4 -0
  80. package/dist/codex-rs/thread-store/index.js.map +1 -0
  81. package/dist/codex-rs/unsupported.d.ts +15 -0
  82. package/dist/codex-rs/unsupported.js +22 -0
  83. package/dist/codex-rs/unsupported.js.map +1 -0
  84. package/dist/codex-rs/utils/output-truncation.d.ts +21 -0
  85. package/dist/codex-rs/utils/output-truncation.js +4 -0
  86. package/dist/codex-rs/utils/output-truncation.js.map +1 -0
  87. package/dist/codex-rs/utils/string.d.ts +7 -0
  88. package/dist/codex-rs/utils/string.js +3 -0
  89. package/dist/codex-rs/utils/string.js.map +1 -0
  90. package/dist/common-CTyph5x8.d.ts +40 -0
  91. package/dist/event-mapping-CbISdQ1D.d.ts +43 -0
  92. package/dist/history-CfM-4V7b.d.ts +1654 -0
  93. package/dist/index-77U_Oc-a.d.ts +63 -0
  94. package/dist/index-CoDZosq0.d.ts +261 -0
  95. package/dist/index.d.ts +18 -8
  96. package/dist/index.js +16 -2
  97. package/dist/lib-nXlaKiS-.d.ts +48 -0
  98. package/dist/live-thread-BMvlflzM.d.ts +30 -0
  99. package/dist/merge-B_AWVmnI.d.ts +24 -0
  100. package/dist/mod-DYVLSWO4.d.ts +91 -0
  101. package/dist/plan-mode-Cv6KWb_S.d.ts +14 -0
  102. package/dist/proposed-plan-DpN1ma0Y.d.ts +53 -0
  103. package/dist/protocol-mpBcYHrm.d.ts +1655 -0
  104. package/dist/react/index.d.ts +20 -53
  105. package/dist/react/index.js +16 -2
  106. package/dist/{remote-DMPfepa9.d.ts → remote-ClZbq9KN.d.ts} +3 -1
  107. package/dist/rendered-thread-AOxw3V5b.d.ts +29 -0
  108. package/dist/responses_websocket-BhxSgCzK.d.ts +183 -0
  109. package/dist/runtime-Cm6ml53h.d.ts +528 -0
  110. package/dist/server/index.d.ts +29 -1999
  111. package/dist/server/index.js +13 -1
  112. package/dist/session-BRYzi8OT.d.ts +46 -0
  113. package/dist/shadcn/index.d.ts +1 -1
  114. package/dist/{sidebar-DT2XoitN.d.ts → sidebar-DMMij22z.d.ts} +1 -1
  115. package/dist/spec_plan_types-CmsJ-Tfn.d.ts +260 -0
  116. package/dist/{store-H2cQxdpe.d.ts → store-AGRxhgQ3.d.ts} +2 -1
  117. package/dist/t3code/apps/web/components/chat.d.ts +508 -0
  118. package/dist/t3code/apps/web/components/chat.js +12 -0
  119. package/dist/t3code/apps/web/components/chat.js.map +1 -0
  120. package/dist/t3code/apps/web/index.d.ts +12 -0
  121. package/dist/t3code/apps/web/index.js +13 -0
  122. package/dist/t3code/apps/web/index.js.map +1 -0
  123. package/dist/testing/index.d.ts +9 -91
  124. package/dist/testing/index.js +13 -1
  125. package/dist/thread-history-builder-zW0zeqcS.d.ts +58 -0
  126. package/dist/thread_event_store-C0zYzukG.d.ts +77 -0
  127. package/dist/types-BTeabLYr.d.ts +126 -0
  128. package/package.json +152 -88
  129. package/dist/chat-runtime-CMli5dzJ.d.ts +0 -748
  130. package/dist/chunk-FFASNDXU.js.map +0 -1
  131. package/dist/chunk-TZBLUZ2X.js.map +0 -1
  132. package/dist/thread_event_store-BIS0qzhi.d.ts +0 -3843
@@ -1,3843 +0,0 @@
1
- /**
2
- * A path that is guaranteed to be absolute and normalized (though it is not
3
- * guaranteed to be canonicalized or exist on the filesystem).
4
- *
5
- * IMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set
6
- * using [AbsolutePathBufGuard::new]. If no base path is set, the
7
- * deserialization will fail unless the path being deserialized is already
8
- * absolute.
9
- */
10
- type AbsolutePathBuf = string;
11
-
12
- type AgentPath = string;
13
-
14
- type FileChange$1 = {
15
- "type": "add";
16
- content: string;
17
- } | {
18
- "type": "delete";
19
- content: string;
20
- } | {
21
- "type": "update";
22
- unified_diff: string;
23
- move_path: string | null;
24
- };
25
-
26
- type ThreadId$1 = string;
27
-
28
- type ApplyPatchApprovalParams = {
29
- conversationId: ThreadId$1;
30
- /**
31
- * Use to correlate this with [codex_protocol::protocol::PatchApplyBeginEvent]
32
- * and [codex_protocol::protocol::PatchApplyEndEvent].
33
- */
34
- callId: string;
35
- fileChanges: {
36
- [key in string]?: FileChange$1;
37
- };
38
- /**
39
- * Optional explanatory reason (e.g. request for extra write access).
40
- */
41
- reason: string | null;
42
- /**
43
- * When set, the agent is asking the user to allow writes under this root
44
- * for the remainder of the session (unclear if this is honored today).
45
- */
46
- grantRoot: string | null;
47
- };
48
-
49
- /**
50
- * Authentication mode for OpenAI-backed providers.
51
- */
52
- type AuthMode = "apikey" | "chatgpt" | "chatgptAuthTokens" | "agentIdentity";
53
-
54
- type RequestId = string | number;
55
-
56
- type JsonValue = number | string | boolean | Array<JsonValue> | {
57
- [key in string]?: JsonValue;
58
- } | null;
59
-
60
- type ThreadSource = "user" | "subagent" | "memory_consolidation";
61
-
62
- /**
63
- * See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning
64
- */
65
- type ReasoningEffort$1 = "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
66
-
67
- type ByteRange$1 = {
68
- start: number;
69
- end: number;
70
- };
71
-
72
- type TextElement$1 = {
73
- /**
74
- * Byte range in the parent `text` buffer that this element occupies.
75
- */
76
- byteRange: ByteRange$1;
77
- /**
78
- * Optional human-readable placeholder for the element, displayed in the UI.
79
- */
80
- placeholder: string | null;
81
- };
82
-
83
- type UserInput$1 = {
84
- "type": "text";
85
- text: string;
86
- /**
87
- * UI-defined spans within `text` used to render or persist special elements.
88
- */
89
- text_elements: Array<TextElement$1>;
90
- } | {
91
- "type": "image";
92
- url: string;
93
- } | {
94
- "type": "localImage";
95
- path: string;
96
- } | {
97
- "type": "skill";
98
- name: string;
99
- path: string;
100
- } | {
101
- "type": "mention";
102
- name: string;
103
- path: string;
104
- };
105
-
106
- type WindowsSandboxSetupMode = "elevated" | "unelevated";
107
-
108
- type ImageDetail = "auto" | "low" | "high" | "original";
109
-
110
- type ContentItem$1 = {
111
- "type": "input_text";
112
- text: string;
113
- } | {
114
- "type": "input_image";
115
- image_url: string;
116
- detail?: ImageDetail;
117
- } | {
118
- "type": "output_text";
119
- text: string;
120
- };
121
-
122
- type SubAgentSource = "review" | "compact" | {
123
- "thread_spawn": {
124
- parent_thread_id: ThreadId$1;
125
- depth: number;
126
- agent_path: AgentPath | null;
127
- agent_nickname: string | null;
128
- agent_role: string | null;
129
- };
130
- } | "memory_consolidation" | {
131
- "other": string;
132
- };
133
-
134
- type ParsedCommand = {
135
- "type": "read";
136
- cmd: string;
137
- name: string;
138
- /**
139
- * (Best effort) Path to the file being read by the command. When
140
- * possible, this is an absolute path, though when relative, it should
141
- * be resolved against the `cwd`` that will be used to run the command
142
- * to derive the absolute path.
143
- */
144
- path: string;
145
- } | {
146
- "type": "list_files";
147
- cmd: string;
148
- path: string | null;
149
- } | {
150
- "type": "search";
151
- cmd: string;
152
- query: string | null;
153
- path: string | null;
154
- } | {
155
- "type": "unknown";
156
- cmd: string;
157
- };
158
-
159
- type ExecCommandApprovalParams = {
160
- conversationId: ThreadId$1;
161
- /**
162
- * Use to correlate this with [codex_protocol::protocol::ExecCommandBeginEvent]
163
- * and [codex_protocol::protocol::ExecCommandEndEvent].
164
- */
165
- callId: string;
166
- /**
167
- * Identifier for this specific approval callback.
168
- */
169
- approvalId: string | null;
170
- command: Array<string>;
171
- cwd: string;
172
- reason: string | null;
173
- parsedCmd: Array<ParsedCommand>;
174
- };
175
-
176
- /**
177
- * Responses API compatible content items that can be returned by a tool call.
178
- * This is a subset of ContentItem with the types we support as function call outputs.
179
- */
180
- type FunctionCallOutputContentItem$1 = {
181
- "type": "input_text";
182
- text: string;
183
- } | {
184
- "type": "input_image";
185
- image_url: string;
186
- detail?: ImageDetail;
187
- };
188
-
189
- type FunctionCallOutputBody$1 = string | Array<FunctionCallOutputContentItem$1>;
190
-
191
- type FuzzyFileSearchMatchType = "file" | "directory";
192
-
193
- /**
194
- * Superset of [`codex_file_search::FileMatch`]
195
- */
196
- type FuzzyFileSearchResult = {
197
- root: string;
198
- path: string;
199
- match_type: FuzzyFileSearchMatchType;
200
- file_name: string;
201
- score: number;
202
- indices: Array<number> | null;
203
- };
204
-
205
- type FuzzyFileSearchSessionCompletedNotification = {
206
- sessionId: string;
207
- };
208
-
209
- type FuzzyFileSearchSessionUpdatedNotification = {
210
- sessionId: string;
211
- query: string;
212
- files: Array<FuzzyFileSearchResult>;
213
- };
214
-
215
- type LocalShellExecAction = {
216
- command: Array<string>;
217
- timeout_ms: bigint | null;
218
- working_directory: string | null;
219
- env: {
220
- [key in string]?: string;
221
- } | null;
222
- user: string | null;
223
- };
224
-
225
- type LocalShellAction = {
226
- "type": "exec";
227
- } & LocalShellExecAction;
228
-
229
- type LocalShellStatus = "completed" | "in_progress" | "incomplete";
230
-
231
- /**
232
- * Classifies an assistant message as interim commentary or final answer text.
233
- *
234
- * Providers do not emit this consistently, so callers must treat `None` as
235
- * "phase unknown" and keep compatibility behavior for legacy models.
236
- */
237
- type MessagePhase$1 = "commentary" | "final_answer";
238
-
239
- type PlanType = "free" | "go" | "plus" | "pro" | "prolite" | "team" | "self_serve_business_usage_based" | "business" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "unknown";
240
-
241
- type RealtimeConversationVersion$1 = "v1" | "v2";
242
-
243
- type ReasoningItemContent$1 = {
244
- "type": "reasoning_text";
245
- text: string;
246
- } | {
247
- "type": "text";
248
- text: string;
249
- };
250
-
251
- type ReasoningItemReasoningSummary$1 = {
252
- "type": "summary_text";
253
- text: string;
254
- };
255
-
256
- type WebSearchAction$2 = {
257
- "type": "search";
258
- query?: string;
259
- queries?: Array<string>;
260
- } | {
261
- "type": "open_page";
262
- url?: string;
263
- } | {
264
- "type": "find_in_page";
265
- url?: string;
266
- pattern?: string;
267
- } | {
268
- "type": "other";
269
- };
270
-
271
- type ResponseItem$1 = {
272
- "type": "message";
273
- role: string;
274
- content: Array<ContentItem$1>;
275
- phase?: MessagePhase$1;
276
- } | {
277
- "type": "reasoning";
278
- summary: Array<ReasoningItemReasoningSummary$1>;
279
- content?: Array<ReasoningItemContent$1>;
280
- encrypted_content: string | null;
281
- } | {
282
- "type": "local_shell_call";
283
- /**
284
- * Set when using the Responses API.
285
- */
286
- call_id: string | null;
287
- status: LocalShellStatus;
288
- action: LocalShellAction;
289
- } | {
290
- "type": "function_call";
291
- name: string;
292
- namespace?: string;
293
- arguments: string;
294
- call_id: string;
295
- } | {
296
- "type": "tool_search_call";
297
- call_id: string | null;
298
- status?: string;
299
- execution: string;
300
- arguments: unknown;
301
- } | {
302
- "type": "function_call_output";
303
- call_id: string;
304
- output: FunctionCallOutputBody$1;
305
- } | {
306
- "type": "custom_tool_call";
307
- status?: string;
308
- call_id: string;
309
- name: string;
310
- input: string;
311
- } | {
312
- "type": "custom_tool_call_output";
313
- call_id: string;
314
- name?: string;
315
- output: FunctionCallOutputBody$1;
316
- } | {
317
- "type": "tool_search_output";
318
- call_id: string | null;
319
- status: string;
320
- execution: string;
321
- tools: unknown[];
322
- } | {
323
- "type": "web_search_call";
324
- status?: string;
325
- action?: WebSearchAction$2;
326
- } | {
327
- "type": "image_generation_call";
328
- id: string;
329
- status: string;
330
- revised_prompt?: string;
331
- result: string;
332
- } | {
333
- "type": "compaction";
334
- encrypted_content: string;
335
- } | {
336
- "type": "context_compaction";
337
- encrypted_content?: string;
338
- } | {
339
- "type": "other";
340
- };
341
-
342
- type AccountLoginCompletedNotification = {
343
- loginId: string | null;
344
- success: boolean;
345
- error: string | null;
346
- };
347
-
348
- type CreditsSnapshot = {
349
- hasCredits: boolean;
350
- unlimited: boolean;
351
- balance: string | null;
352
- };
353
-
354
- type RateLimitReachedType = "rate_limit_reached" | "workspace_owner_credits_depleted" | "workspace_member_credits_depleted" | "workspace_owner_usage_limit_reached" | "workspace_member_usage_limit_reached";
355
-
356
- type RateLimitWindow$1 = {
357
- usedPercent: number;
358
- windowDurationMins: number | null;
359
- resetsAt: number | null;
360
- };
361
-
362
- type RateLimitSnapshot$1 = {
363
- limitId: string | null;
364
- limitName: string | null;
365
- primary: RateLimitWindow$1 | null;
366
- secondary: RateLimitWindow$1 | null;
367
- credits: CreditsSnapshot | null;
368
- planType: PlanType | null;
369
- rateLimitReachedType: RateLimitReachedType | null;
370
- };
371
-
372
- type AccountRateLimitsUpdatedNotification = {
373
- rateLimits: RateLimitSnapshot$1;
374
- };
375
-
376
- type AccountUpdatedNotification = {
377
- authMode: AuthMode | null;
378
- planType: PlanType | null;
379
- };
380
-
381
- type AgentMessageDeltaNotification = {
382
- threadId: string;
383
- turnId: string;
384
- itemId: string;
385
- delta: string;
386
- };
387
-
388
- /**
389
- * EXPERIMENTAL - app metadata returned by app-list APIs.
390
- */
391
- type AppBranding = {
392
- category: string | null;
393
- developer: string | null;
394
- website: string | null;
395
- privacyPolicy: string | null;
396
- termsOfService: string | null;
397
- isDiscoverableApp: boolean;
398
- };
399
-
400
- type AppReview = {
401
- status: string;
402
- };
403
-
404
- type AppScreenshot = {
405
- url: string | null;
406
- fileId: string | null;
407
- userPrompt: string;
408
- };
409
-
410
- type AppMetadata = {
411
- review: AppReview | null;
412
- categories: Array<string> | null;
413
- subCategories: Array<string> | null;
414
- seoDescription: string | null;
415
- screenshots: Array<AppScreenshot> | null;
416
- developer: string | null;
417
- version: string | null;
418
- versionId: string | null;
419
- versionNotes: string | null;
420
- firstPartyType: string | null;
421
- firstPartyRequiresInstall: boolean | null;
422
- showInComposerWhenUnlinked: boolean | null;
423
- };
424
-
425
- /**
426
- * EXPERIMENTAL - app metadata returned by app-list APIs.
427
- */
428
- type AppInfo = {
429
- id: string;
430
- name: string;
431
- description: string | null;
432
- logoUrl: string | null;
433
- logoUrlDark: string | null;
434
- distributionChannel: string | null;
435
- branding: AppBranding | null;
436
- appMetadata: AppMetadata | null;
437
- labels: {
438
- [key in string]?: string;
439
- } | null;
440
- installUrl: string | null;
441
- isAccessible: boolean;
442
- /**
443
- * Whether this app is enabled in config.toml.
444
- * Example:
445
- * ```toml
446
- * [apps.bad_app]
447
- * enabled = false
448
- * ```
449
- */
450
- isEnabled: boolean;
451
- pluginDisplayNames: Array<string>;
452
- };
453
-
454
- /**
455
- * EXPERIMENTAL - notification emitted when the app list changes.
456
- */
457
- type AppListUpdatedNotification = {
458
- data: Array<AppInfo>;
459
- };
460
-
461
- /**
462
- * Stream label for `command/exec/outputDelta` notifications.
463
- */
464
- type CommandExecOutputStream = "stdout" | "stderr";
465
-
466
- /**
467
- * Base64-encoded output chunk emitted for a streaming `command/exec` request.
468
- *
469
- * These notifications are connection-scoped. If the originating connection
470
- * closes, the server terminates the process.
471
- */
472
- type CommandExecOutputDeltaNotification = {
473
- /**
474
- * Client-supplied, connection-scoped `processId` from the original
475
- * `command/exec` request.
476
- */
477
- processId: string;
478
- /**
479
- * Output stream for this chunk.
480
- */
481
- stream: CommandExecOutputStream;
482
- /**
483
- * Base64-encoded output bytes.
484
- */
485
- deltaBase64: string;
486
- /**
487
- * `true` on the final streamed chunk for a stream when `outputBytesCap`
488
- * truncated later output on that stream.
489
- */
490
- capReached: boolean;
491
- };
492
-
493
- type CommandExecutionOutputDeltaNotification = {
494
- threadId: string;
495
- turnId: string;
496
- itemId: string;
497
- delta: string;
498
- };
499
-
500
- type TextPosition = {
501
- /**
502
- * 1-based line number.
503
- */
504
- line: number;
505
- /**
506
- * 1-based column number (in Unicode scalar values).
507
- */
508
- column: number;
509
- };
510
-
511
- type TextRange = {
512
- start: TextPosition;
513
- end: TextPosition;
514
- };
515
-
516
- type ConfigWarningNotification = {
517
- /**
518
- * Concise summary of the warning.
519
- */
520
- summary: string;
521
- /**
522
- * Optional extra guidance or error details.
523
- */
524
- details: string | null;
525
- /**
526
- * Optional path to the config file that triggered the warning.
527
- */
528
- path?: string;
529
- /**
530
- * Optional range for the error location inside the config file.
531
- */
532
- range?: TextRange;
533
- };
534
-
535
- /**
536
- * Deprecated: Use `ContextCompaction` item type instead.
537
- */
538
- type ContextCompactedNotification = {
539
- threadId: string;
540
- turnId: string;
541
- };
542
-
543
- type DeprecationNoticeNotification = {
544
- /**
545
- * Concise summary of what is deprecated.
546
- */
547
- summary: string;
548
- /**
549
- * Optional extra guidance, such as migration steps or rationale.
550
- */
551
- details: string | null;
552
- };
553
-
554
- type NonSteerableTurnKind = "review" | "compact";
555
-
556
- /**
557
- * This translation layer make sure that we expose codex error code in camel case.
558
- *
559
- * When an upstream HTTP status is available (for example, from the Responses API or a provider),
560
- * it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.
561
- */
562
- type CodexErrorInfo = "contextWindowExceeded" | "usageLimitExceeded" | "serverOverloaded" | "cyberPolicy" | {
563
- "httpConnectionFailed": {
564
- httpStatusCode: number | null;
565
- };
566
- } | {
567
- "responseStreamConnectionFailed": {
568
- httpStatusCode: number | null;
569
- };
570
- } | "internalServerError" | "unauthorized" | "badRequest" | "threadRollbackFailed" | "sandboxError" | {
571
- "responseStreamDisconnected": {
572
- httpStatusCode: number | null;
573
- };
574
- } | {
575
- "responseTooManyFailedAttempts": {
576
- httpStatusCode: number | null;
577
- };
578
- } | {
579
- "activeTurnNotSteerable": {
580
- turnKind: NonSteerableTurnKind;
581
- };
582
- } | "other";
583
-
584
- type TurnError$1 = {
585
- message: string;
586
- codexErrorInfo: CodexErrorInfo | null;
587
- additionalDetails: string | null;
588
- };
589
-
590
- type ErrorNotification = {
591
- error: TurnError$1;
592
- willRetry: boolean;
593
- threadId: string;
594
- turnId: string;
595
- };
596
-
597
- type ExternalAgentConfigImportCompletedNotification = Record<string, never>;
598
-
599
- /**
600
- * Deprecated legacy notification for `apply_patch` textual output.
601
- *
602
- * The server no longer emits this notification.
603
- */
604
- type FileChangeOutputDeltaNotification = {
605
- threadId: string;
606
- turnId: string;
607
- itemId: string;
608
- delta: string;
609
- };
610
-
611
- type PatchChangeKind = {
612
- "type": "add";
613
- } | {
614
- "type": "delete";
615
- } | {
616
- "type": "update";
617
- move_path: string | null;
618
- };
619
-
620
- type FileUpdateChange = {
621
- path: string;
622
- kind: PatchChangeKind;
623
- diff: string;
624
- };
625
-
626
- type FileChangePatchUpdatedNotification = {
627
- threadId: string;
628
- turnId: string;
629
- itemId: string;
630
- changes: Array<FileUpdateChange>;
631
- };
632
-
633
- /**
634
- * Filesystem watch notification emitted for `fs/watch` subscribers.
635
- */
636
- type FsChangedNotification = {
637
- /**
638
- * Watch identifier previously provided to `fs/watch`.
639
- */
640
- watchId: string;
641
- /**
642
- * File or directory paths associated with this event.
643
- */
644
- changedPaths: Array<AbsolutePathBuf>;
645
- };
646
-
647
- type GuardianWarningNotification = {
648
- /**
649
- * Thread target for the guardian warning.
650
- */
651
- threadId: string;
652
- /**
653
- * Concise guardian warning message for the user.
654
- */
655
- message: string;
656
- };
657
-
658
- type HookEventName$1 = "preToolUse" | "permissionRequest" | "postToolUse" | "preCompact" | "postCompact" | "sessionStart" | "userPromptSubmit" | "stop";
659
-
660
- type HookExecutionMode$1 = "sync" | "async";
661
-
662
- type HookHandlerType$1 = "command" | "prompt" | "agent";
663
-
664
- type HookOutputEntryKind$1 = "warning" | "stop" | "feedback" | "context" | "error";
665
-
666
- type HookOutputEntry$1 = {
667
- kind: HookOutputEntryKind$1;
668
- text: string;
669
- };
670
-
671
- type HookRunStatus$1 = "running" | "completed" | "failed" | "blocked" | "stopped";
672
-
673
- type HookScope$1 = "thread" | "turn";
674
-
675
- type HookSource$1 = "system" | "user" | "project" | "mdm" | "sessionFlags" | "plugin" | "cloudRequirements" | "legacyManagedConfigFile" | "legacyManagedConfigMdm" | "unknown";
676
-
677
- type HookRunSummary$1 = {
678
- id: string;
679
- eventName: HookEventName$1;
680
- handlerType: HookHandlerType$1;
681
- executionMode: HookExecutionMode$1;
682
- scope: HookScope$1;
683
- sourcePath: AbsolutePathBuf;
684
- source: HookSource$1;
685
- displayOrder: bigint;
686
- status: HookRunStatus$1;
687
- statusMessage: string | null;
688
- startedAt: bigint;
689
- completedAt: bigint | null;
690
- durationMs: bigint | null;
691
- entries: Array<HookOutputEntry$1>;
692
- };
693
-
694
- type HookCompletedNotification = {
695
- threadId: string;
696
- turnId: string | null;
697
- run: HookRunSummary$1;
698
- };
699
-
700
- type HookStartedNotification = {
701
- threadId: string;
702
- turnId: string | null;
703
- run: HookRunSummary$1;
704
- };
705
-
706
- type CollabAgentStatus = "pendingInit" | "running" | "interrupted" | "completed" | "errored" | "shutdown" | "notFound";
707
-
708
- type CollabAgentState = {
709
- status: CollabAgentStatus;
710
- message: string | null;
711
- };
712
-
713
- type CollabAgentTool = "spawnAgent" | "sendInput" | "resumeAgent" | "wait" | "closeAgent";
714
-
715
- type CollabAgentToolCallStatus = "inProgress" | "completed" | "failed";
716
-
717
- type CommandAction = {
718
- "type": "read";
719
- command: string;
720
- name: string;
721
- path: AbsolutePathBuf;
722
- } | {
723
- "type": "listFiles";
724
- command: string;
725
- path: string | null;
726
- } | {
727
- "type": "search";
728
- command: string;
729
- query: string | null;
730
- path: string | null;
731
- } | {
732
- "type": "unknown";
733
- command: string;
734
- };
735
-
736
- type CommandExecutionSource = "agent" | "userShell" | "unifiedExecStartup" | "unifiedExecInteraction";
737
-
738
- type CommandExecutionStatus$1 = "inProgress" | "completed" | "failed" | "declined";
739
-
740
- type DynamicToolCallOutputContentItem$1 = {
741
- "type": "inputText";
742
- text: string;
743
- } | {
744
- "type": "inputImage";
745
- imageUrl: string;
746
- };
747
-
748
- type DynamicToolCallStatus$1 = "inProgress" | "completed" | "failed";
749
-
750
- type HookPromptFragment$1 = {
751
- text: string;
752
- hookRunId: string;
753
- };
754
-
755
- type McpToolCallError$1 = {
756
- message: string;
757
- };
758
-
759
- type McpToolCallResult = {
760
- content: Array<JsonValue>;
761
- structuredContent: JsonValue | null;
762
- _meta: JsonValue | null;
763
- };
764
-
765
- type McpToolCallStatus$1 = "inProgress" | "completed" | "failed";
766
-
767
- type MemoryCitationEntry$1 = {
768
- path: string;
769
- lineStart: number;
770
- lineEnd: number;
771
- note: string;
772
- };
773
-
774
- type MemoryCitation$1 = {
775
- entries: Array<MemoryCitationEntry$1>;
776
- threadIds: Array<string>;
777
- };
778
-
779
- type PatchApplyStatus$1 = "inProgress" | "completed" | "failed" | "declined";
780
-
781
- type WebSearchAction$1 = {
782
- "type": "search";
783
- query: string | null;
784
- queries: Array<string> | null;
785
- } | {
786
- "type": "openPage";
787
- url: string | null;
788
- } | {
789
- "type": "findInPage";
790
- url: string | null;
791
- pattern: string | null;
792
- } | {
793
- "type": "other";
794
- };
795
-
796
- type ThreadItem = {
797
- "type": "userMessage";
798
- id: string;
799
- content: Array<UserInput$1>;
800
- } | {
801
- "type": "hookPrompt";
802
- id: string;
803
- fragments: Array<HookPromptFragment$1>;
804
- } | {
805
- "type": "agentMessage";
806
- id: string;
807
- text: string;
808
- phase: MessagePhase$1 | null;
809
- memoryCitation: MemoryCitation$1 | null;
810
- } | {
811
- "type": "plan";
812
- id: string;
813
- text: string;
814
- } | {
815
- "type": "reasoning";
816
- id: string;
817
- summary: Array<string>;
818
- content: Array<string>;
819
- } | {
820
- "type": "commandExecution";
821
- id: string;
822
- /**
823
- * The command to be executed.
824
- */
825
- command: string;
826
- /**
827
- * The command's working directory.
828
- */
829
- cwd: AbsolutePathBuf;
830
- /**
831
- * Identifier for the underlying PTY process (when available).
832
- */
833
- processId: string | null;
834
- source: CommandExecutionSource;
835
- status: CommandExecutionStatus$1;
836
- /**
837
- * A best-effort parsing of the command to understand the action(s) it will perform.
838
- * This returns a list of CommandAction objects because a single shell command may
839
- * be composed of many commands piped together.
840
- */
841
- commandActions: Array<CommandAction>;
842
- /**
843
- * The command's output, aggregated from stdout and stderr.
844
- */
845
- aggregatedOutput: string | null;
846
- /**
847
- * The command's exit code.
848
- */
849
- exitCode: number | null;
850
- /**
851
- * The duration of the command execution in milliseconds.
852
- */
853
- durationMs: number | null;
854
- } | {
855
- "type": "fileChange";
856
- id: string;
857
- changes: Array<FileUpdateChange>;
858
- status: PatchApplyStatus$1;
859
- } | {
860
- "type": "mcpToolCall";
861
- id: string;
862
- server: string;
863
- tool: string;
864
- status: McpToolCallStatus$1;
865
- arguments: JsonValue;
866
- mcpAppResourceUri?: string;
867
- result: McpToolCallResult | null;
868
- error: McpToolCallError$1 | null;
869
- /**
870
- * The duration of the MCP tool call in milliseconds.
871
- */
872
- durationMs: number | null;
873
- } | {
874
- "type": "dynamicToolCall";
875
- id: string;
876
- namespace: string | null;
877
- tool: string;
878
- arguments: JsonValue;
879
- status: DynamicToolCallStatus$1;
880
- contentItems: Array<DynamicToolCallOutputContentItem$1> | null;
881
- success: boolean | null;
882
- /**
883
- * The duration of the dynamic tool call in milliseconds.
884
- */
885
- durationMs: number | null;
886
- } | {
887
- "type": "collabAgentToolCall";
888
- /**
889
- * Unique identifier for this collab tool call.
890
- */
891
- id: string;
892
- /**
893
- * Name of the collab tool that was invoked.
894
- */
895
- tool: CollabAgentTool;
896
- /**
897
- * Current status of the collab tool call.
898
- */
899
- status: CollabAgentToolCallStatus;
900
- /**
901
- * Thread ID of the agent issuing the collab request.
902
- */
903
- senderThreadId: string;
904
- /**
905
- * Thread ID of the receiving agent, when applicable. In case of spawn operation,
906
- * this corresponds to the newly spawned agent.
907
- */
908
- receiverThreadIds: Array<string>;
909
- /**
910
- * Prompt text sent as part of the collab tool call, when available.
911
- */
912
- prompt: string | null;
913
- /**
914
- * Model requested for the spawned agent, when applicable.
915
- */
916
- model: string | null;
917
- /**
918
- * Reasoning effort requested for the spawned agent, when applicable.
919
- */
920
- reasoningEffort: ReasoningEffort$1 | null;
921
- /**
922
- * Last known status of the target agents, when available.
923
- */
924
- agentsStates: {
925
- [key in string]?: CollabAgentState;
926
- };
927
- } | {
928
- "type": "webSearch";
929
- id: string;
930
- query: string;
931
- action: WebSearchAction$1 | null;
932
- } | {
933
- "type": "imageView";
934
- id: string;
935
- path: AbsolutePathBuf;
936
- } | {
937
- "type": "imageGeneration";
938
- id: string;
939
- status: string;
940
- revisedPrompt: string | null;
941
- result: string;
942
- savedPath?: AbsolutePathBuf;
943
- } | {
944
- "type": "enteredReviewMode";
945
- id: string;
946
- review: string;
947
- } | {
948
- "type": "exitedReviewMode";
949
- id: string;
950
- review: string;
951
- } | {
952
- "type": "contextCompaction";
953
- id: string;
954
- };
955
-
956
- type ItemCompletedNotification = {
957
- item: ThreadItem;
958
- threadId: string;
959
- turnId: string;
960
- /**
961
- * Unix timestamp (in milliseconds) when this item lifecycle completed.
962
- */
963
- completedAtMs: number;
964
- };
965
-
966
- /**
967
- * [UNSTABLE] Source that produced a terminal approval auto-review decision.
968
- */
969
- type AutoReviewDecisionSource = "agent";
970
-
971
- /**
972
- * [UNSTABLE] Lifecycle state for an approval auto-review.
973
- */
974
- type GuardianApprovalReviewStatus = "inProgress" | "approved" | "denied" | "timedOut" | "aborted";
975
-
976
- /**
977
- * [UNSTABLE] Risk level assigned by approval auto-review.
978
- */
979
- type GuardianRiskLevel = "low" | "medium" | "high" | "critical";
980
-
981
- /**
982
- * [UNSTABLE] Authorization level assigned by approval auto-review.
983
- */
984
- type GuardianUserAuthorization = "unknown" | "low" | "medium" | "high";
985
-
986
- /**
987
- * [UNSTABLE] Temporary approval auto-review payload used by
988
- * `item/autoApprovalReview/*` notifications. This shape is expected to change
989
- * soon.
990
- */
991
- type GuardianApprovalReview = {
992
- status: GuardianApprovalReviewStatus;
993
- riskLevel: GuardianRiskLevel | null;
994
- userAuthorization: GuardianUserAuthorization | null;
995
- rationale: string | null;
996
- };
997
-
998
- type GuardianCommandSource = "shell" | "unifiedExec";
999
-
1000
- type NetworkApprovalProtocol = "http" | "https" | "socks5Tcp" | "socks5Udp";
1001
-
1002
- type FileSystemAccessMode = "read" | "write" | "none";
1003
-
1004
- type FileSystemSpecialPath = {
1005
- "kind": "root";
1006
- } | {
1007
- "kind": "minimal";
1008
- } | {
1009
- "kind": "project_roots";
1010
- subpath: string | null;
1011
- } | {
1012
- "kind": "tmpdir";
1013
- } | {
1014
- "kind": "slash_tmp";
1015
- } | {
1016
- "kind": "unknown";
1017
- path: string;
1018
- subpath: string | null;
1019
- };
1020
-
1021
- type FileSystemPath = {
1022
- "type": "path";
1023
- path: AbsolutePathBuf;
1024
- } | {
1025
- "type": "glob_pattern";
1026
- pattern: string;
1027
- } | {
1028
- "type": "special";
1029
- value: FileSystemSpecialPath;
1030
- };
1031
-
1032
- type FileSystemSandboxEntry = {
1033
- path: FileSystemPath;
1034
- access: FileSystemAccessMode;
1035
- };
1036
-
1037
- type AdditionalFileSystemPermissions = {
1038
- /**
1039
- * This will be removed in favor of `entries`.
1040
- */
1041
- read: Array<AbsolutePathBuf> | null;
1042
- /**
1043
- * This will be removed in favor of `entries`.
1044
- */
1045
- write: Array<AbsolutePathBuf> | null;
1046
- globScanMaxDepth?: number;
1047
- entries?: Array<FileSystemSandboxEntry>;
1048
- };
1049
-
1050
- type AdditionalNetworkPermissions = {
1051
- enabled: boolean | null;
1052
- };
1053
-
1054
- type RequestPermissionProfile$1 = {
1055
- network: AdditionalNetworkPermissions | null;
1056
- fileSystem: AdditionalFileSystemPermissions | null;
1057
- };
1058
-
1059
- type GuardianApprovalReviewAction = {
1060
- "type": "command";
1061
- source: GuardianCommandSource;
1062
- command: string;
1063
- cwd: AbsolutePathBuf;
1064
- } | {
1065
- "type": "execve";
1066
- source: GuardianCommandSource;
1067
- program: string;
1068
- argv: Array<string>;
1069
- cwd: AbsolutePathBuf;
1070
- } | {
1071
- "type": "applyPatch";
1072
- cwd: AbsolutePathBuf;
1073
- files: Array<AbsolutePathBuf>;
1074
- } | {
1075
- "type": "networkAccess";
1076
- target: string;
1077
- host: string;
1078
- protocol: NetworkApprovalProtocol;
1079
- port: number;
1080
- } | {
1081
- "type": "mcpToolCall";
1082
- server: string;
1083
- toolName: string;
1084
- connectorId: string | null;
1085
- connectorName: string | null;
1086
- toolTitle: string | null;
1087
- } | {
1088
- "type": "requestPermissions";
1089
- reason: string | null;
1090
- permissions: RequestPermissionProfile$1;
1091
- };
1092
-
1093
- /**
1094
- * [UNSTABLE] Temporary notification payload for approval auto-review. This
1095
- * shape is expected to change soon.
1096
- */
1097
- type ItemGuardianApprovalReviewCompletedNotification = {
1098
- threadId: string;
1099
- turnId: string;
1100
- /**
1101
- * Stable identifier for this review.
1102
- */
1103
- reviewId: string;
1104
- /**
1105
- * Identifier for the reviewed item or tool call when one exists.
1106
- *
1107
- * In most cases, one review maps to one target item. The exceptions are
1108
- * - execve reviews, where a single command may contain multiple execve
1109
- * calls to review (only possible when using the shell_zsh_fork feature)
1110
- * - network policy reviews, where there is no target item
1111
- *
1112
- * A network call is triggered by a CommandExecution item, so having a
1113
- * target_item_id set to the CommandExecution item would be misleading
1114
- * because the review is about the network call, not the command execution.
1115
- * Therefore, target_item_id is set to None for network policy reviews.
1116
- */
1117
- targetItemId: string | null;
1118
- decisionSource: AutoReviewDecisionSource;
1119
- review: GuardianApprovalReview;
1120
- action: GuardianApprovalReviewAction;
1121
- };
1122
-
1123
- /**
1124
- * [UNSTABLE] Temporary notification payload for approval auto-review. This
1125
- * shape is expected to change soon.
1126
- */
1127
- type ItemGuardianApprovalReviewStartedNotification = {
1128
- threadId: string;
1129
- turnId: string;
1130
- /**
1131
- * Stable identifier for this review.
1132
- */
1133
- reviewId: string;
1134
- /**
1135
- * Identifier for the reviewed item or tool call when one exists.
1136
- *
1137
- * In most cases, one review maps to one target item. The exceptions are
1138
- * - execve reviews, where a single command may contain multiple execve
1139
- * calls to review (only possible when using the shell_zsh_fork feature)
1140
- * - network policy reviews, where there is no target item
1141
- *
1142
- * A network call is triggered by a CommandExecution item, so having a
1143
- * target_item_id set to the CommandExecution item would be misleading
1144
- * because the review is about the network call, not the command execution.
1145
- * Therefore, target_item_id is set to None for network policy reviews.
1146
- */
1147
- targetItemId: string | null;
1148
- review: GuardianApprovalReview;
1149
- action: GuardianApprovalReviewAction;
1150
- };
1151
-
1152
- type ItemStartedNotification = {
1153
- item: ThreadItem;
1154
- threadId: string;
1155
- turnId: string;
1156
- /**
1157
- * Unix timestamp (in milliseconds) when this item lifecycle started.
1158
- */
1159
- startedAtMs: number;
1160
- };
1161
-
1162
- type McpServerOauthLoginCompletedNotification = {
1163
- name: string;
1164
- success: boolean;
1165
- error?: string;
1166
- };
1167
-
1168
- type McpServerStartupState$1 = "starting" | "ready" | "failed" | "cancelled";
1169
-
1170
- type McpServerStatusUpdatedNotification = {
1171
- name: string;
1172
- status: McpServerStartupState$1;
1173
- error: string | null;
1174
- };
1175
-
1176
- type McpToolCallProgressNotification = {
1177
- threadId: string;
1178
- turnId: string;
1179
- itemId: string;
1180
- message: string;
1181
- };
1182
-
1183
- type ModelRerouteReason = "highRiskCyberActivity";
1184
-
1185
- type ModelReroutedNotification = {
1186
- threadId: string;
1187
- turnId: string;
1188
- fromModel: string;
1189
- toModel: string;
1190
- reason: ModelRerouteReason;
1191
- };
1192
-
1193
- type ModelVerification = "trustedAccessForCyber";
1194
-
1195
- type ModelVerificationNotification = {
1196
- threadId: string;
1197
- turnId: string;
1198
- verifications: Array<ModelVerification>;
1199
- };
1200
-
1201
- /**
1202
- * EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should
1203
- * not assume concatenated deltas match the completed plan item content.
1204
- */
1205
- type PlanDeltaNotification = {
1206
- threadId: string;
1207
- turnId: string;
1208
- itemId: string;
1209
- delta: string;
1210
- };
1211
-
1212
- /**
1213
- * Final process exit notification for `process/spawn`.
1214
- */
1215
- type ProcessExitedNotification = {
1216
- /**
1217
- * Client-supplied, connection-scoped `processHandle` from `process/spawn`.
1218
- */
1219
- processHandle: string;
1220
- /**
1221
- * Process exit code.
1222
- */
1223
- exitCode: number;
1224
- /**
1225
- * Buffered stdout capture.
1226
- *
1227
- * Empty when stdout was streamed via `process/outputDelta`.
1228
- */
1229
- stdout: string;
1230
- /**
1231
- * Whether stdout reached `outputBytesCap`.
1232
- *
1233
- * In streaming mode, stdout is empty and cap state is also reported on the
1234
- * final stdout `process/outputDelta` notification.
1235
- */
1236
- stdoutCapReached: boolean;
1237
- /**
1238
- * Buffered stderr capture.
1239
- *
1240
- * Empty when stderr was streamed via `process/outputDelta`.
1241
- */
1242
- stderr: string;
1243
- /**
1244
- * Whether stderr reached `outputBytesCap`.
1245
- *
1246
- * In streaming mode, stderr is empty and cap state is also reported on the
1247
- * final stderr `process/outputDelta` notification.
1248
- */
1249
- stderrCapReached: boolean;
1250
- };
1251
-
1252
- /**
1253
- * Stream label for `process/outputDelta` notifications.
1254
- */
1255
- type ProcessOutputStream = "stdout" | "stderr";
1256
-
1257
- /**
1258
- * Base64-encoded output chunk emitted for a streaming `process/spawn` request.
1259
- */
1260
- type ProcessOutputDeltaNotification = {
1261
- /**
1262
- * Client-supplied, connection-scoped `processHandle` from `process/spawn`.
1263
- */
1264
- processHandle: string;
1265
- /**
1266
- * Output stream this chunk belongs to.
1267
- */
1268
- stream: ProcessOutputStream;
1269
- /**
1270
- * Base64-encoded output bytes.
1271
- */
1272
- deltaBase64: string;
1273
- /**
1274
- * True on the final streamed chunk for this stream when output was
1275
- * truncated by `outputBytesCap`.
1276
- */
1277
- capReached: boolean;
1278
- };
1279
-
1280
- type RawResponseItemCompletedNotification = {
1281
- threadId: string;
1282
- turnId: string;
1283
- item: ResponseItem$1;
1284
- };
1285
-
1286
- type ReasoningSummaryPartAddedNotification = {
1287
- threadId: string;
1288
- turnId: string;
1289
- itemId: string;
1290
- summaryIndex: number;
1291
- };
1292
-
1293
- type ReasoningSummaryTextDeltaNotification = {
1294
- threadId: string;
1295
- turnId: string;
1296
- itemId: string;
1297
- delta: string;
1298
- summaryIndex: number;
1299
- };
1300
-
1301
- type ReasoningTextDeltaNotification = {
1302
- threadId: string;
1303
- turnId: string;
1304
- itemId: string;
1305
- delta: string;
1306
- contentIndex: number;
1307
- };
1308
-
1309
- type RemoteControlConnectionStatus = "disabled" | "connecting" | "connected" | "errored";
1310
-
1311
- /**
1312
- * Current remote-control connection status and environment id exposed to clients.
1313
- */
1314
- type RemoteControlStatusChangedNotification = {
1315
- status: RemoteControlConnectionStatus;
1316
- environmentId: string | null;
1317
- };
1318
-
1319
- type ServerRequestResolvedNotification = {
1320
- threadId: string;
1321
- requestId: RequestId;
1322
- };
1323
-
1324
- /**
1325
- * Notification emitted when watched local skill files change.
1326
- *
1327
- * Treat this as an invalidation signal and re-run `skills/list` with the
1328
- * client's current parameters when refreshed skill metadata is needed.
1329
- */
1330
- type SkillsChangedNotification = Record<string, never>;
1331
-
1332
- type TerminalInteractionNotification = {
1333
- threadId: string;
1334
- turnId: string;
1335
- itemId: string;
1336
- processId: string;
1337
- stdin: string;
1338
- };
1339
-
1340
- type ThreadArchivedNotification = {
1341
- threadId: string;
1342
- };
1343
-
1344
- type ThreadClosedNotification = {
1345
- threadId: string;
1346
- };
1347
-
1348
- type ThreadGoalClearedNotification = {
1349
- threadId: string;
1350
- };
1351
-
1352
- type ThreadGoalStatus$1 = "active" | "paused" | "budgetLimited" | "complete";
1353
-
1354
- type ThreadGoal$1 = {
1355
- threadId: string;
1356
- objective: string;
1357
- status: ThreadGoalStatus$1;
1358
- tokenBudget: number | null;
1359
- tokensUsed: number;
1360
- timeUsedSeconds: number;
1361
- createdAt: number;
1362
- updatedAt: number;
1363
- };
1364
-
1365
- type ThreadGoalUpdatedNotification = {
1366
- threadId: string;
1367
- turnId: string | null;
1368
- goal: ThreadGoal$1;
1369
- };
1370
-
1371
- type ThreadNameUpdatedNotification = {
1372
- threadId: string;
1373
- threadName?: string;
1374
- };
1375
-
1376
- /**
1377
- * EXPERIMENTAL - emitted when thread realtime transport closes.
1378
- */
1379
- type ThreadRealtimeClosedNotification = {
1380
- threadId: string;
1381
- reason: string | null;
1382
- };
1383
-
1384
- /**
1385
- * EXPERIMENTAL - emitted when thread realtime encounters an error.
1386
- */
1387
- type ThreadRealtimeErrorNotification = {
1388
- threadId: string;
1389
- message: string;
1390
- };
1391
-
1392
- /**
1393
- * EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.
1394
- */
1395
- type ThreadRealtimeItemAddedNotification = {
1396
- threadId: string;
1397
- item: JsonValue;
1398
- };
1399
-
1400
- /**
1401
- * EXPERIMENTAL - thread realtime audio chunk.
1402
- */
1403
- type ThreadRealtimeAudioChunk = {
1404
- data: string;
1405
- sampleRate: number;
1406
- numChannels: number;
1407
- samplesPerChannel: number | null;
1408
- itemId: string | null;
1409
- };
1410
-
1411
- /**
1412
- * EXPERIMENTAL - streamed output audio emitted by thread realtime.
1413
- */
1414
- type ThreadRealtimeOutputAudioDeltaNotification = {
1415
- threadId: string;
1416
- audio: ThreadRealtimeAudioChunk;
1417
- };
1418
-
1419
- /**
1420
- * EXPERIMENTAL - emitted with the remote SDP for a WebRTC realtime session.
1421
- */
1422
- type ThreadRealtimeSdpNotification = {
1423
- threadId: string;
1424
- sdp: string;
1425
- };
1426
-
1427
- /**
1428
- * EXPERIMENTAL - emitted when thread realtime startup is accepted.
1429
- */
1430
- type ThreadRealtimeStartedNotification = {
1431
- threadId: string;
1432
- realtimeSessionId: string | null;
1433
- version: RealtimeConversationVersion$1;
1434
- };
1435
-
1436
- /**
1437
- * EXPERIMENTAL - flat transcript delta emitted whenever realtime
1438
- * transcript text changes.
1439
- */
1440
- type ThreadRealtimeTranscriptDeltaNotification = {
1441
- threadId: string;
1442
- role: string;
1443
- /**
1444
- * Live transcript delta from the realtime event.
1445
- */
1446
- delta: string;
1447
- };
1448
-
1449
- /**
1450
- * EXPERIMENTAL - final transcript text emitted when realtime completes
1451
- * a transcript part.
1452
- */
1453
- type ThreadRealtimeTranscriptDoneNotification = {
1454
- threadId: string;
1455
- role: string;
1456
- /**
1457
- * Final complete text for the transcript part.
1458
- */
1459
- text: string;
1460
- };
1461
-
1462
- type GitInfo$1 = {
1463
- sha: string | null;
1464
- branch: string | null;
1465
- originUrl: string | null;
1466
- };
1467
-
1468
- type SessionSource$1 = "cli" | "vscode" | "exec" | "appServer" | {
1469
- "custom": string;
1470
- } | {
1471
- "subAgent": SubAgentSource;
1472
- } | "unknown";
1473
-
1474
- type ThreadActiveFlag = "waitingOnApproval" | "waitingOnUserInput";
1475
-
1476
- type ThreadStatus = {
1477
- "type": "notLoaded";
1478
- } | {
1479
- "type": "idle";
1480
- } | {
1481
- "type": "systemError";
1482
- } | {
1483
- "type": "active";
1484
- activeFlags: Array<ThreadActiveFlag>;
1485
- };
1486
-
1487
- type TurnItemsView$1 = "notLoaded" | "summary" | "full";
1488
-
1489
- type TurnStatus$1 = "completed" | "interrupted" | "failed" | "inProgress";
1490
-
1491
- type Turn$1 = {
1492
- id: string;
1493
- /**
1494
- * Thread items currently included in this turn payload.
1495
- */
1496
- items: Array<ThreadItem>;
1497
- /**
1498
- * Describes how much of `items` has been loaded for this turn.
1499
- */
1500
- itemsView: TurnItemsView$1;
1501
- status: TurnStatus$1;
1502
- /**
1503
- * Only populated when the Turn's status is failed.
1504
- */
1505
- error: TurnError$1 | null;
1506
- /**
1507
- * Unix timestamp (in seconds) when the turn started.
1508
- */
1509
- startedAt: number | null;
1510
- /**
1511
- * Unix timestamp (in seconds) when the turn completed.
1512
- */
1513
- completedAt: number | null;
1514
- /**
1515
- * Duration between turn start and completion in milliseconds, if known.
1516
- */
1517
- durationMs: number | null;
1518
- };
1519
-
1520
- type Thread = {
1521
- id: string;
1522
- /**
1523
- * Session id shared by threads that belong to the same session tree.
1524
- */
1525
- sessionId: string;
1526
- /**
1527
- * Source thread id when this thread was created by forking another thread.
1528
- */
1529
- forkedFromId: string | null;
1530
- /**
1531
- * Usually the first user message in the thread, if available.
1532
- */
1533
- preview: string;
1534
- /**
1535
- * Whether the thread is ephemeral and should not be materialized on disk.
1536
- */
1537
- ephemeral: boolean;
1538
- /**
1539
- * Model provider used for this thread (for example, 'openai').
1540
- */
1541
- modelProvider: string;
1542
- /**
1543
- * Unix timestamp (in seconds) when the thread was created.
1544
- */
1545
- createdAt: number;
1546
- /**
1547
- * Unix timestamp (in seconds) when the thread was last updated.
1548
- */
1549
- updatedAt: number;
1550
- /**
1551
- * Current runtime status for the thread.
1552
- */
1553
- status: ThreadStatus;
1554
- /**
1555
- * [UNSTABLE] Path to the thread on disk.
1556
- */
1557
- path: string | null;
1558
- /**
1559
- * Working directory captured for the thread.
1560
- */
1561
- cwd: AbsolutePathBuf;
1562
- /**
1563
- * Version of the CLI that created the thread.
1564
- */
1565
- cliVersion: string;
1566
- /**
1567
- * Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).
1568
- */
1569
- source: SessionSource$1;
1570
- /**
1571
- * Optional analytics source classification for this thread.
1572
- */
1573
- threadSource: ThreadSource | null;
1574
- /**
1575
- * Optional random unique nickname assigned to an AgentControl-spawned sub-agent.
1576
- */
1577
- agentNickname: string | null;
1578
- /**
1579
- * Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.
1580
- */
1581
- agentRole: string | null;
1582
- /**
1583
- * Optional Git metadata captured when the thread was created.
1584
- */
1585
- gitInfo: GitInfo$1 | null;
1586
- /**
1587
- * Optional user-facing thread title.
1588
- */
1589
- name: string | null;
1590
- /**
1591
- * Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read`
1592
- * (when `includeTurns` is true) responses.
1593
- * For all other responses and notifications returning a Thread,
1594
- * the turns field will be an empty list.
1595
- */
1596
- turns: Array<Turn$1>;
1597
- };
1598
-
1599
- type ThreadStartedNotification = {
1600
- thread: Thread;
1601
- };
1602
-
1603
- type ThreadStatusChangedNotification = {
1604
- threadId: string;
1605
- status: ThreadStatus;
1606
- };
1607
-
1608
- type TokenUsageBreakdown = {
1609
- totalTokens: number;
1610
- inputTokens: number;
1611
- cachedInputTokens: number;
1612
- outputTokens: number;
1613
- reasoningOutputTokens: number;
1614
- };
1615
-
1616
- type ThreadTokenUsage = {
1617
- total: TokenUsageBreakdown;
1618
- last: TokenUsageBreakdown;
1619
- modelContextWindow: number | null;
1620
- };
1621
-
1622
- type ThreadTokenUsageUpdatedNotification = {
1623
- threadId: string;
1624
- turnId: string;
1625
- tokenUsage: ThreadTokenUsage;
1626
- };
1627
-
1628
- type ThreadUnarchivedNotification = {
1629
- threadId: string;
1630
- };
1631
-
1632
- type TurnCompletedNotification = {
1633
- threadId: string;
1634
- turn: Turn$1;
1635
- };
1636
-
1637
- /**
1638
- * Notification that the turn-level unified diff has changed.
1639
- * Contains the latest aggregated diff across all file changes in the turn.
1640
- */
1641
- type TurnDiffUpdatedNotification = {
1642
- threadId: string;
1643
- turnId: string;
1644
- diff: string;
1645
- };
1646
-
1647
- type TurnPlanStepStatus = "pending" | "inProgress" | "completed";
1648
-
1649
- type TurnPlanStep = {
1650
- step: string;
1651
- status: TurnPlanStepStatus;
1652
- };
1653
-
1654
- type TurnPlanUpdatedNotification = {
1655
- threadId: string;
1656
- turnId: string;
1657
- explanation: string | null;
1658
- plan: Array<TurnPlanStep>;
1659
- };
1660
-
1661
- type TurnStartedNotification = {
1662
- threadId: string;
1663
- turn: Turn$1;
1664
- };
1665
-
1666
- type WarningNotification = {
1667
- /**
1668
- * Optional thread target when the warning applies to a specific thread.
1669
- */
1670
- threadId: string | null;
1671
- /**
1672
- * Concise warning message for the user.
1673
- */
1674
- message: string;
1675
- };
1676
-
1677
- type WindowsSandboxSetupCompletedNotification = {
1678
- mode: WindowsSandboxSetupMode;
1679
- success: boolean;
1680
- error: string | null;
1681
- };
1682
-
1683
- type WindowsWorldWritableWarningNotification = {
1684
- samplePaths: Array<string>;
1685
- extraCount: number;
1686
- failedScan: boolean;
1687
- };
1688
-
1689
- /**
1690
- * Notification sent from the server to the client.
1691
- */
1692
- type ServerNotification = {
1693
- "method": "error";
1694
- "params": ErrorNotification;
1695
- } | {
1696
- "method": "thread/started";
1697
- "params": ThreadStartedNotification;
1698
- } | {
1699
- "method": "thread/status/changed";
1700
- "params": ThreadStatusChangedNotification;
1701
- } | {
1702
- "method": "thread/archived";
1703
- "params": ThreadArchivedNotification;
1704
- } | {
1705
- "method": "thread/unarchived";
1706
- "params": ThreadUnarchivedNotification;
1707
- } | {
1708
- "method": "thread/closed";
1709
- "params": ThreadClosedNotification;
1710
- } | {
1711
- "method": "skills/changed";
1712
- "params": SkillsChangedNotification;
1713
- } | {
1714
- "method": "thread/name/updated";
1715
- "params": ThreadNameUpdatedNotification;
1716
- } | {
1717
- "method": "thread/goal/updated";
1718
- "params": ThreadGoalUpdatedNotification;
1719
- } | {
1720
- "method": "thread/goal/cleared";
1721
- "params": ThreadGoalClearedNotification;
1722
- } | {
1723
- "method": "thread/tokenUsage/updated";
1724
- "params": ThreadTokenUsageUpdatedNotification;
1725
- } | {
1726
- "method": "turn/started";
1727
- "params": TurnStartedNotification;
1728
- } | {
1729
- "method": "hook/started";
1730
- "params": HookStartedNotification;
1731
- } | {
1732
- "method": "turn/completed";
1733
- "params": TurnCompletedNotification;
1734
- } | {
1735
- "method": "hook/completed";
1736
- "params": HookCompletedNotification;
1737
- } | {
1738
- "method": "turn/diff/updated";
1739
- "params": TurnDiffUpdatedNotification;
1740
- } | {
1741
- "method": "turn/plan/updated";
1742
- "params": TurnPlanUpdatedNotification;
1743
- } | {
1744
- "method": "item/started";
1745
- "params": ItemStartedNotification;
1746
- } | {
1747
- "method": "item/autoApprovalReview/started";
1748
- "params": ItemGuardianApprovalReviewStartedNotification;
1749
- } | {
1750
- "method": "item/autoApprovalReview/completed";
1751
- "params": ItemGuardianApprovalReviewCompletedNotification;
1752
- } | {
1753
- "method": "item/completed";
1754
- "params": ItemCompletedNotification;
1755
- } | {
1756
- "method": "rawResponseItem/completed";
1757
- "params": RawResponseItemCompletedNotification;
1758
- } | {
1759
- "method": "item/agentMessage/delta";
1760
- "params": AgentMessageDeltaNotification;
1761
- } | {
1762
- "method": "item/plan/delta";
1763
- "params": PlanDeltaNotification;
1764
- } | {
1765
- "method": "command/exec/outputDelta";
1766
- "params": CommandExecOutputDeltaNotification;
1767
- } | {
1768
- "method": "process/outputDelta";
1769
- "params": ProcessOutputDeltaNotification;
1770
- } | {
1771
- "method": "process/exited";
1772
- "params": ProcessExitedNotification;
1773
- } | {
1774
- "method": "item/commandExecution/outputDelta";
1775
- "params": CommandExecutionOutputDeltaNotification;
1776
- } | {
1777
- "method": "item/commandExecution/terminalInteraction";
1778
- "params": TerminalInteractionNotification;
1779
- } | {
1780
- "method": "item/fileChange/outputDelta";
1781
- "params": FileChangeOutputDeltaNotification;
1782
- } | {
1783
- "method": "item/fileChange/patchUpdated";
1784
- "params": FileChangePatchUpdatedNotification;
1785
- } | {
1786
- "method": "serverRequest/resolved";
1787
- "params": ServerRequestResolvedNotification;
1788
- } | {
1789
- "method": "item/mcpToolCall/progress";
1790
- "params": McpToolCallProgressNotification;
1791
- } | {
1792
- "method": "mcpServer/oauthLogin/completed";
1793
- "params": McpServerOauthLoginCompletedNotification;
1794
- } | {
1795
- "method": "mcpServer/startupStatus/updated";
1796
- "params": McpServerStatusUpdatedNotification;
1797
- } | {
1798
- "method": "account/updated";
1799
- "params": AccountUpdatedNotification;
1800
- } | {
1801
- "method": "account/rateLimits/updated";
1802
- "params": AccountRateLimitsUpdatedNotification;
1803
- } | {
1804
- "method": "app/list/updated";
1805
- "params": AppListUpdatedNotification;
1806
- } | {
1807
- "method": "remoteControl/status/changed";
1808
- "params": RemoteControlStatusChangedNotification;
1809
- } | {
1810
- "method": "externalAgentConfig/import/completed";
1811
- "params": ExternalAgentConfigImportCompletedNotification;
1812
- } | {
1813
- "method": "fs/changed";
1814
- "params": FsChangedNotification;
1815
- } | {
1816
- "method": "item/reasoning/summaryTextDelta";
1817
- "params": ReasoningSummaryTextDeltaNotification;
1818
- } | {
1819
- "method": "item/reasoning/summaryPartAdded";
1820
- "params": ReasoningSummaryPartAddedNotification;
1821
- } | {
1822
- "method": "item/reasoning/textDelta";
1823
- "params": ReasoningTextDeltaNotification;
1824
- } | {
1825
- "method": "thread/compacted";
1826
- "params": ContextCompactedNotification;
1827
- } | {
1828
- "method": "model/rerouted";
1829
- "params": ModelReroutedNotification;
1830
- } | {
1831
- "method": "model/verification";
1832
- "params": ModelVerificationNotification;
1833
- } | {
1834
- "method": "warning";
1835
- "params": WarningNotification;
1836
- } | {
1837
- "method": "guardianWarning";
1838
- "params": GuardianWarningNotification;
1839
- } | {
1840
- "method": "deprecationNotice";
1841
- "params": DeprecationNoticeNotification;
1842
- } | {
1843
- "method": "configWarning";
1844
- "params": ConfigWarningNotification;
1845
- } | {
1846
- "method": "fuzzyFileSearch/sessionUpdated";
1847
- "params": FuzzyFileSearchSessionUpdatedNotification;
1848
- } | {
1849
- "method": "fuzzyFileSearch/sessionCompleted";
1850
- "params": FuzzyFileSearchSessionCompletedNotification;
1851
- } | {
1852
- "method": "thread/realtime/started";
1853
- "params": ThreadRealtimeStartedNotification;
1854
- } | {
1855
- "method": "thread/realtime/itemAdded";
1856
- "params": ThreadRealtimeItemAddedNotification;
1857
- } | {
1858
- "method": "thread/realtime/transcript/delta";
1859
- "params": ThreadRealtimeTranscriptDeltaNotification;
1860
- } | {
1861
- "method": "thread/realtime/transcript/done";
1862
- "params": ThreadRealtimeTranscriptDoneNotification;
1863
- } | {
1864
- "method": "thread/realtime/outputAudio/delta";
1865
- "params": ThreadRealtimeOutputAudioDeltaNotification;
1866
- } | {
1867
- "method": "thread/realtime/sdp";
1868
- "params": ThreadRealtimeSdpNotification;
1869
- } | {
1870
- "method": "thread/realtime/error";
1871
- "params": ThreadRealtimeErrorNotification;
1872
- } | {
1873
- "method": "thread/realtime/closed";
1874
- "params": ThreadRealtimeClosedNotification;
1875
- } | {
1876
- "method": "windows/worldWritableWarning";
1877
- "params": WindowsWorldWritableWarningNotification;
1878
- } | {
1879
- "method": "windowsSandbox/setupCompleted";
1880
- "params": WindowsSandboxSetupCompletedNotification;
1881
- } | {
1882
- "method": "account/login/completed";
1883
- "params": AccountLoginCompletedNotification;
1884
- };
1885
-
1886
- type ChatgptAuthTokensRefreshReason = "unauthorized";
1887
-
1888
- type ChatgptAuthTokensRefreshParams = {
1889
- reason: ChatgptAuthTokensRefreshReason;
1890
- /**
1891
- * Workspace/account identifier that Codex was previously using.
1892
- *
1893
- * Clients that manage multiple accounts/workspaces can use this as a hint
1894
- * to refresh the token for the correct workspace.
1895
- *
1896
- * This may be `null` when the prior auth state did not include a workspace
1897
- * identifier (`chatgpt_account_id`).
1898
- */
1899
- previousAccountId?: string | null;
1900
- };
1901
-
1902
- type ExecPolicyAmendment = Array<string>;
1903
-
1904
- type NetworkApprovalContext = {
1905
- host: string;
1906
- protocol: NetworkApprovalProtocol;
1907
- };
1908
-
1909
- type NetworkPolicyRuleAction = "allow" | "deny";
1910
-
1911
- type NetworkPolicyAmendment = {
1912
- host: string;
1913
- action: NetworkPolicyRuleAction;
1914
- };
1915
-
1916
- type CommandExecutionRequestApprovalParams = {
1917
- threadId: string;
1918
- turnId: string;
1919
- itemId: string; /**
1920
- * Unique identifier for this specific approval callback.
1921
- *
1922
- * For regular shell/unified_exec approvals, this is null.
1923
- *
1924
- * For zsh-exec-bridge subcommand approvals, multiple callbacks can belong to
1925
- * one parent `itemId`, so `approvalId` is a distinct opaque callback id
1926
- * (a UUID) used to disambiguate routing.
1927
- */
1928
- approvalId?: string | null; /**
1929
- * Optional explanatory reason (e.g. request for network access).
1930
- */
1931
- reason?: string | null; /**
1932
- * Optional context for a managed-network approval prompt.
1933
- */
1934
- networkApprovalContext?: NetworkApprovalContext | null; /**
1935
- * The command to be executed.
1936
- */
1937
- command?: string | null; /**
1938
- * The command's working directory.
1939
- */
1940
- cwd?: AbsolutePathBuf | null; /**
1941
- * Best-effort parsed command actions for friendly display.
1942
- */
1943
- commandActions?: Array<CommandAction> | null; /**
1944
- * Optional proposed execpolicy amendment to allow similar commands without prompting.
1945
- */
1946
- proposedExecpolicyAmendment?: ExecPolicyAmendment | null; /**
1947
- * Optional proposed network policy amendments (allow/deny host) for future requests.
1948
- */
1949
- proposedNetworkPolicyAmendments?: Array<NetworkPolicyAmendment> | null;
1950
- };
1951
-
1952
- type DynamicToolCallParams = {
1953
- threadId: string;
1954
- turnId: string;
1955
- callId: string;
1956
- namespace: string | null;
1957
- tool: string;
1958
- arguments: JsonValue;
1959
- };
1960
-
1961
- type FileChangeRequestApprovalParams = {
1962
- threadId: string;
1963
- turnId: string;
1964
- itemId: string;
1965
- /**
1966
- * Optional explanatory reason (e.g. request for extra write access).
1967
- */
1968
- reason?: string | null;
1969
- /**
1970
- * [UNSTABLE] When set, the agent is asking the user to allow writes under this root
1971
- * for the remainder of the session (unclear if this is honored today).
1972
- */
1973
- grantRoot?: string | null;
1974
- };
1975
-
1976
- type McpElicitationObjectType = "object";
1977
-
1978
- type McpElicitationBooleanType = "boolean";
1979
-
1980
- type McpElicitationBooleanSchema = {
1981
- type: McpElicitationBooleanType;
1982
- title?: string;
1983
- description?: string;
1984
- default?: boolean;
1985
- };
1986
-
1987
- type McpElicitationStringType = "string";
1988
-
1989
- type McpElicitationLegacyTitledEnumSchema = {
1990
- type: McpElicitationStringType;
1991
- title?: string;
1992
- description?: string;
1993
- enum: Array<string>;
1994
- enumNames?: Array<string>;
1995
- default?: string;
1996
- };
1997
-
1998
- type McpElicitationArrayType = "array";
1999
-
2000
- type McpElicitationConstOption = {
2001
- const: string;
2002
- title: string;
2003
- };
2004
-
2005
- type McpElicitationTitledEnumItems = {
2006
- anyOf: Array<McpElicitationConstOption>;
2007
- };
2008
-
2009
- type McpElicitationTitledMultiSelectEnumSchema = {
2010
- type: McpElicitationArrayType;
2011
- title?: string;
2012
- description?: string;
2013
- minItems?: bigint;
2014
- maxItems?: bigint;
2015
- items: McpElicitationTitledEnumItems;
2016
- default?: Array<string>;
2017
- };
2018
-
2019
- type McpElicitationUntitledEnumItems = {
2020
- type: McpElicitationStringType;
2021
- enum: Array<string>;
2022
- };
2023
-
2024
- type McpElicitationUntitledMultiSelectEnumSchema = {
2025
- type: McpElicitationArrayType;
2026
- title?: string;
2027
- description?: string;
2028
- minItems?: bigint;
2029
- maxItems?: bigint;
2030
- items: McpElicitationUntitledEnumItems;
2031
- default?: Array<string>;
2032
- };
2033
-
2034
- type McpElicitationMultiSelectEnumSchema = McpElicitationUntitledMultiSelectEnumSchema | McpElicitationTitledMultiSelectEnumSchema;
2035
-
2036
- type McpElicitationTitledSingleSelectEnumSchema = {
2037
- type: McpElicitationStringType;
2038
- title?: string;
2039
- description?: string;
2040
- oneOf: Array<McpElicitationConstOption>;
2041
- default?: string;
2042
- };
2043
-
2044
- type McpElicitationUntitledSingleSelectEnumSchema = {
2045
- type: McpElicitationStringType;
2046
- title?: string;
2047
- description?: string;
2048
- enum: Array<string>;
2049
- default?: string;
2050
- };
2051
-
2052
- type McpElicitationSingleSelectEnumSchema = McpElicitationUntitledSingleSelectEnumSchema | McpElicitationTitledSingleSelectEnumSchema;
2053
-
2054
- type McpElicitationEnumSchema = McpElicitationSingleSelectEnumSchema | McpElicitationMultiSelectEnumSchema | McpElicitationLegacyTitledEnumSchema;
2055
-
2056
- type McpElicitationNumberType = "number" | "integer";
2057
-
2058
- type McpElicitationNumberSchema = {
2059
- type: McpElicitationNumberType;
2060
- title?: string;
2061
- description?: string;
2062
- minimum?: number;
2063
- maximum?: number;
2064
- default?: number;
2065
- };
2066
-
2067
- type McpElicitationStringFormat = "email" | "uri" | "date" | "date-time";
2068
-
2069
- type McpElicitationStringSchema = {
2070
- type: McpElicitationStringType;
2071
- title?: string;
2072
- description?: string;
2073
- minLength?: number;
2074
- maxLength?: number;
2075
- format?: McpElicitationStringFormat;
2076
- default?: string;
2077
- };
2078
-
2079
- type McpElicitationPrimitiveSchema = McpElicitationEnumSchema | McpElicitationStringSchema | McpElicitationNumberSchema | McpElicitationBooleanSchema;
2080
-
2081
- /**
2082
- * Typed form schema for MCP `elicitation/create` requests.
2083
- *
2084
- * This matches the `requestedSchema` shape from the MCP 2025-11-25
2085
- * `ElicitRequestFormParams` schema.
2086
- */
2087
- type McpElicitationSchema = {
2088
- $schema?: string;
2089
- type: McpElicitationObjectType;
2090
- properties: {
2091
- [key in string]?: McpElicitationPrimitiveSchema;
2092
- };
2093
- required?: Array<string>;
2094
- };
2095
-
2096
- type McpServerElicitationRequestParams = {
2097
- threadId: string;
2098
- /**
2099
- * Active Codex turn when this elicitation was observed, if app-server could correlate one.
2100
- *
2101
- * This is nullable because MCP models elicitation as a standalone server-to-client request
2102
- * identified by the MCP server request id. It may be triggered during a turn, but turn
2103
- * context is app-server correlation rather than part of the protocol identity of the
2104
- * elicitation itself.
2105
- */
2106
- turnId: string | null;
2107
- serverName: string;
2108
- } & ({
2109
- "mode": "form";
2110
- _meta: JsonValue | null;
2111
- message: string;
2112
- requestedSchema: McpElicitationSchema;
2113
- } | {
2114
- "mode": "url";
2115
- _meta: JsonValue | null;
2116
- message: string;
2117
- url: string;
2118
- elicitationId: string;
2119
- });
2120
-
2121
- type PermissionsRequestApprovalParams = {
2122
- threadId: string;
2123
- turnId: string;
2124
- itemId: string;
2125
- cwd: AbsolutePathBuf;
2126
- reason: string | null;
2127
- permissions: RequestPermissionProfile$1;
2128
- };
2129
-
2130
- /**
2131
- * EXPERIMENTAL. Defines a single selectable option for request_user_input.
2132
- */
2133
- type ToolRequestUserInputOption = {
2134
- label: string;
2135
- description: string;
2136
- };
2137
-
2138
- /**
2139
- * EXPERIMENTAL. Represents one request_user_input question and its required options.
2140
- */
2141
- type ToolRequestUserInputQuestion = {
2142
- id: string;
2143
- header: string;
2144
- question: string;
2145
- isOther: boolean;
2146
- isSecret: boolean;
2147
- options: Array<ToolRequestUserInputOption> | null;
2148
- };
2149
-
2150
- /**
2151
- * EXPERIMENTAL. Params sent with a request_user_input event.
2152
- */
2153
- type ToolRequestUserInputParams = {
2154
- threadId: string;
2155
- turnId: string;
2156
- itemId: string;
2157
- questions: Array<ToolRequestUserInputQuestion>;
2158
- };
2159
-
2160
- /**
2161
- * Request initiated from the server and sent to the client.
2162
- */
2163
- type ServerRequest = {
2164
- "method": "item/commandExecution/requestApproval";
2165
- id: RequestId;
2166
- params: CommandExecutionRequestApprovalParams;
2167
- } | {
2168
- "method": "item/fileChange/requestApproval";
2169
- id: RequestId;
2170
- params: FileChangeRequestApprovalParams;
2171
- } | {
2172
- "method": "item/tool/requestUserInput";
2173
- id: RequestId;
2174
- params: ToolRequestUserInputParams;
2175
- } | {
2176
- "method": "mcpServer/elicitation/request";
2177
- id: RequestId;
2178
- params: McpServerElicitationRequestParams;
2179
- } | {
2180
- "method": "item/permissions/requestApproval";
2181
- id: RequestId;
2182
- params: PermissionsRequestApprovalParams;
2183
- } | {
2184
- "method": "item/tool/call";
2185
- id: RequestId;
2186
- params: DynamicToolCallParams;
2187
- } | {
2188
- "method": "account/chatgptAuthTokens/refresh";
2189
- id: RequestId;
2190
- params: ChatgptAuthTokensRefreshParams;
2191
- } | {
2192
- "method": "applyPatchApproval";
2193
- id: RequestId;
2194
- params: ApplyPatchApprovalParams;
2195
- } | {
2196
- "method": "execCommandApproval";
2197
- id: RequestId;
2198
- params: ExecCommandApprovalParams;
2199
- };
2200
-
2201
- type CodexBrand<TValue, TBrand extends string> = TValue & {
2202
- readonly __codexBrand: TBrand;
2203
- };
2204
- type ThreadId = CodexBrand<string, "ThreadId">;
2205
- declare function asThreadId(value: string): ThreadId;
2206
-
2207
- declare const ModeKind: {
2208
- readonly Plan: "plan";
2209
- readonly Default: "default";
2210
- };
2211
- type ModeKind = (typeof ModeKind)[keyof typeof ModeKind];
2212
- type ReasoningEffort = string;
2213
- type CollaborationModeSettings = {
2214
- model: string;
2215
- reasoning_effort: ReasoningEffort | null;
2216
- developer_instructions: string | null;
2217
- };
2218
- type CollaborationMode = {
2219
- mode: ModeKind;
2220
- settings: CollaborationModeSettings;
2221
- };
2222
-
2223
- declare const ThreadMemoryMode: {
2224
- readonly Enabled: "Enabled";
2225
- readonly Disabled: "Disabled";
2226
- };
2227
- type ThreadMemoryMode = (typeof ThreadMemoryMode)[keyof typeof ThreadMemoryMode];
2228
- declare const ThreadMemoryModeSessionMetaValue: {
2229
- readonly Enabled: "enabled";
2230
- readonly Disabled: "disabled";
2231
- };
2232
- type ThreadMemoryModeSessionMetaValue = (typeof ThreadMemoryModeSessionMetaValue)[keyof typeof ThreadMemoryModeSessionMetaValue];
2233
- type MemoryCitation = {
2234
- entries: MemoryCitationEntry[];
2235
- rolloutIds: string[];
2236
- };
2237
- type MemoryCitationEntry = {
2238
- path: string;
2239
- lineStart: number;
2240
- lineEnd: number;
2241
- note: string;
2242
- };
2243
-
2244
- type AgentMessageContent = {
2245
- type: "Text";
2246
- text: string;
2247
- };
2248
- type UserMessageTurnItem = {
2249
- type: "UserMessage";
2250
- id: string;
2251
- content: UserInput[];
2252
- };
2253
- type HookPromptFragment = {
2254
- text: string;
2255
- hookRunId: string;
2256
- };
2257
- type HookPromptTurnItem = {
2258
- type: "HookPrompt";
2259
- id: string;
2260
- fragments: HookPromptFragment[];
2261
- };
2262
- type AgentMessageTurnItem = {
2263
- type: "AgentMessage";
2264
- id: string;
2265
- content: AgentMessageContent[];
2266
- phase?: string | null;
2267
- memory_citation?: MemoryCitation | null;
2268
- };
2269
- type PlanTurnItem = {
2270
- type: "Plan";
2271
- id: string;
2272
- text: string;
2273
- };
2274
- type ReasoningTurnItem = {
2275
- type: "Reasoning";
2276
- id: string;
2277
- summary_text: string[];
2278
- raw_content: string[];
2279
- };
2280
- type WebSearchAction = {
2281
- type: "search";
2282
- query?: string;
2283
- queries?: string[];
2284
- } | {
2285
- type: "open_page";
2286
- url?: string;
2287
- } | {
2288
- type: "find_in_page";
2289
- url?: string;
2290
- pattern?: string;
2291
- } | {
2292
- type: "other";
2293
- };
2294
- type WebSearchTurnItem = {
2295
- type: "WebSearch";
2296
- id: string;
2297
- query: string;
2298
- action: WebSearchAction;
2299
- };
2300
- type ImageViewTurnItem = {
2301
- type: "ImageView";
2302
- id: string;
2303
- path: string;
2304
- };
2305
- type ImageGenerationTurnItem = {
2306
- type: "ImageGeneration";
2307
- id: string;
2308
- status: string;
2309
- revised_prompt?: string;
2310
- result: string;
2311
- saved_path?: string;
2312
- };
2313
- type FileChange = {
2314
- type: "add";
2315
- content: string;
2316
- } | {
2317
- type: "delete";
2318
- content: string;
2319
- } | {
2320
- type: "update";
2321
- unified_diff: string;
2322
- move_path: string | null;
2323
- };
2324
- type PatchApplyStatus = "completed" | "failed" | "declined";
2325
- type FileChangeTurnItem = {
2326
- type: "FileChange";
2327
- id: string;
2328
- changes: Record<string, FileChange>;
2329
- status?: PatchApplyStatus | null;
2330
- auto_approved?: boolean;
2331
- stdout?: string;
2332
- stderr?: string;
2333
- };
2334
- type CommandExecutionStatus = "in_progress" | "completed" | "failed" | "cancelled";
2335
- type CommandExecutionTurnItem = {
2336
- type: "CommandExecution";
2337
- id: string;
2338
- command: string[];
2339
- cwd: string;
2340
- status: CommandExecutionStatus;
2341
- stdout?: string;
2342
- stderr?: string;
2343
- exit_code?: number | null;
2344
- duration_ms?: number | null;
2345
- };
2346
- type McpToolCallStatus = "inProgress" | "completed" | "failed";
2347
- type McpToolCallError = {
2348
- message: string;
2349
- };
2350
- type McpToolCallTurnItem = {
2351
- type: "McpToolCall";
2352
- id: string;
2353
- server: string;
2354
- tool: string;
2355
- arguments: unknown;
2356
- mcpAppResourceUri?: string;
2357
- status: McpToolCallStatus;
2358
- result?: unknown;
2359
- error?: McpToolCallError;
2360
- duration?: string;
2361
- };
2362
- type DynamicToolCallStatus = "inProgress" | "completed" | "failed";
2363
- type DynamicToolCallTurnItem = {
2364
- type: "DynamicToolCall";
2365
- id: string;
2366
- namespace?: string | null;
2367
- tool: string;
2368
- arguments: unknown;
2369
- status: DynamicToolCallStatus;
2370
- content_items?: unknown[] | null;
2371
- success?: boolean | null;
2372
- duration?: string | null;
2373
- };
2374
- type ContextCompactionTurnItem = {
2375
- type: "ContextCompaction";
2376
- id: string;
2377
- };
2378
- type TurnItem = UserMessageTurnItem | HookPromptTurnItem | AgentMessageTurnItem | PlanTurnItem | ReasoningTurnItem | WebSearchTurnItem | ImageViewTurnItem | ImageGenerationTurnItem | CommandExecutionTurnItem | FileChangeTurnItem | McpToolCallTurnItem | DynamicToolCallTurnItem | ContextCompactionTurnItem;
2379
-
2380
- type StreamOutput<T = string> = {
2381
- text: T;
2382
- truncated_after_lines?: number | null;
2383
- };
2384
- type ExecToolCallOutput = {
2385
- exit_code: number;
2386
- stdout: StreamOutput<string>;
2387
- stderr: StreamOutput<string>;
2388
- aggregated_output: StreamOutput<string>;
2389
- duration_ms: number;
2390
- timed_out: boolean;
2391
- };
2392
-
2393
- type DynamicToolSpec = {
2394
- namespace?: string | null;
2395
- name: string;
2396
- description: string;
2397
- input_schema: unknown;
2398
- defer_loading?: boolean;
2399
- };
2400
- type DynamicToolCallRequest = {
2401
- call_id: string;
2402
- turn_id: string;
2403
- started_at_ms?: number;
2404
- namespace?: string | null;
2405
- tool: string;
2406
- arguments: unknown;
2407
- };
2408
- type DynamicToolCallOutputContentItem = {
2409
- type: "inputText";
2410
- text: string;
2411
- } | {
2412
- type: "inputImage";
2413
- imageUrl: string;
2414
- };
2415
- type DynamicToolResponse = {
2416
- content_items: DynamicToolCallOutputContentItem[];
2417
- success: boolean;
2418
- };
2419
- type DynamicToolCallResponseEvent = {
2420
- call_id: string;
2421
- turn_id: string;
2422
- completed_at_ms?: number;
2423
- namespace?: string | null;
2424
- tool: string;
2425
- arguments: unknown;
2426
- content_items: DynamicToolCallOutputContentItem[];
2427
- success: boolean;
2428
- error?: string | null;
2429
- duration: string;
2430
- };
2431
-
2432
- type RequestUserInputQuestionOption = {
2433
- label: string;
2434
- description: string;
2435
- };
2436
- type NormalizedRequestUserInputQuestion = {
2437
- id: string;
2438
- header: string;
2439
- question: string;
2440
- isOther: boolean;
2441
- isSecret: boolean;
2442
- options: RequestUserInputQuestionOption[];
2443
- };
2444
- type NormalizedRequestUserInputArgs = {
2445
- questions: NormalizedRequestUserInputQuestion[];
2446
- };
2447
- type RequestUserInputAnswer = {
2448
- answers: string[];
2449
- };
2450
- type RequestUserInputResponse = {
2451
- answers: Record<string, RequestUserInputAnswer>;
2452
- };
2453
- type RequestUserInputEvent = {
2454
- /** Responses API call id for the associated tool call, if available. */
2455
- call_id: string;
2456
- /** Turn id that this request belongs to. */
2457
- turn_id: string;
2458
- questions: NormalizedRequestUserInputQuestion[];
2459
- };
2460
-
2461
- declare const PermissionGrantScope: {
2462
- readonly Turn: "turn";
2463
- readonly Session: "session";
2464
- };
2465
- type PermissionGrantScope = (typeof PermissionGrantScope)[keyof typeof PermissionGrantScope];
2466
- type NetworkPermissions = {
2467
- enabled?: boolean | null;
2468
- [key: string]: unknown;
2469
- };
2470
- type FileSystemPermissions = {
2471
- entries?: Array<Record<string, unknown>>;
2472
- [key: string]: unknown;
2473
- };
2474
- type RequestPermissionProfile = {
2475
- network?: NetworkPermissions | null;
2476
- file_system?: FileSystemPermissions | null;
2477
- };
2478
- type RequestPermissionsArgs = {
2479
- reason?: string | null;
2480
- permissions: RequestPermissionProfile;
2481
- };
2482
- type RequestPermissionsResponse = {
2483
- permissions: RequestPermissionProfile;
2484
- scope?: PermissionGrantScope;
2485
- strict_auto_review?: boolean;
2486
- };
2487
- type RequestPermissionsEvent = {
2488
- /** Responses API call id for the associated tool call, if available. */
2489
- call_id: string;
2490
- /** Turn id that this request belongs to. */
2491
- turn_id: string;
2492
- reason?: string | null;
2493
- permissions: RequestPermissionProfile;
2494
- cwd?: string | null;
2495
- };
2496
- declare function deniedRequestPermissionsResponse(): RequestPermissionsResponse;
2497
-
2498
- type MessagePhase = "commentary" | "final_answer";
2499
- type ContentItem = {
2500
- type: "input_text";
2501
- text: string;
2502
- } | {
2503
- type: "input_image";
2504
- image_url: string;
2505
- detail?: string | null;
2506
- } | {
2507
- type: "output_text";
2508
- text: string;
2509
- };
2510
- type FunctionCallOutputContentItem = {
2511
- type: "input_text";
2512
- text: string;
2513
- } | {
2514
- type: "input_image";
2515
- image_url: string;
2516
- detail?: string | null;
2517
- };
2518
- type FunctionCallOutputBody = {
2519
- type: "text";
2520
- text: string;
2521
- } | {
2522
- type: "content_items";
2523
- items: FunctionCallOutputContentItem[];
2524
- };
2525
- type FunctionCallOutputPayload = {
2526
- body: FunctionCallOutputBody;
2527
- success?: boolean | null;
2528
- };
2529
- type MessageResponseInputItem = {
2530
- type: "message";
2531
- id?: string;
2532
- role: string;
2533
- content: ContentItem[];
2534
- phase?: MessagePhase | null;
2535
- };
2536
- type FunctionCallOutputResponseInputItem = {
2537
- type: "function_call_output";
2538
- call_id: string;
2539
- output: FunctionCallOutputPayload;
2540
- };
2541
- type CustomToolCallOutputResponseInputItem = {
2542
- type: "custom_tool_call_output";
2543
- call_id: string;
2544
- name?: string | null;
2545
- output: FunctionCallOutputPayload;
2546
- };
2547
- type McpToolCallOutputResponseInputItem = {
2548
- type: "mcp_tool_call_output";
2549
- call_id: string;
2550
- output: unknown;
2551
- };
2552
- type ToolSearchOutputResponseInputItem = {
2553
- type: "tool_search_output";
2554
- call_id: string;
2555
- status: "completed";
2556
- execution: "client";
2557
- tools: unknown[];
2558
- };
2559
- type ResponseInputItem = MessageResponseInputItem | FunctionCallOutputResponseInputItem | CustomToolCallOutputResponseInputItem | McpToolCallOutputResponseInputItem | ToolSearchOutputResponseInputItem;
2560
- type ResponseMessageItem = {
2561
- type: "message";
2562
- id?: string;
2563
- role: string;
2564
- content: ContentItem[];
2565
- phase?: MessagePhase | null;
2566
- };
2567
- type ReasoningItemReasoningSummary = Record<string, unknown>;
2568
- type ReasoningItemContent = Record<string, unknown>;
2569
- type ResponseReasoningItem = {
2570
- type: "reasoning";
2571
- id?: string;
2572
- summary: ReasoningItemReasoningSummary[];
2573
- content?: ReasoningItemContent[] | null;
2574
- encrypted_content?: string | null;
2575
- };
2576
- type ResponseLocalShellCallItem = {
2577
- type: "local_shell_call";
2578
- id?: string | null;
2579
- call_id?: string | null;
2580
- status?: string | null;
2581
- action: Record<string, unknown>;
2582
- };
2583
- type ResponseFunctionCallItem = {
2584
- type: "function_call";
2585
- id?: string | null;
2586
- name: string;
2587
- namespace?: string | null;
2588
- arguments: string;
2589
- call_id: string;
2590
- };
2591
- type ResponseToolSearchCallItem = {
2592
- type: "tool_search_call";
2593
- id?: string | null;
2594
- call_id?: string | null;
2595
- status?: string | null;
2596
- execution: string;
2597
- arguments: unknown;
2598
- };
2599
- type ResponseFunctionCallOutputItem = {
2600
- type: "function_call_output";
2601
- call_id: string;
2602
- output: FunctionCallOutputPayload;
2603
- };
2604
- type ResponseCustomToolCallItem = {
2605
- type: "custom_tool_call";
2606
- id?: string | null;
2607
- status?: string | null;
2608
- call_id: string;
2609
- name: string;
2610
- input: string;
2611
- };
2612
- type ResponseCustomToolCallOutputItem = {
2613
- type: "custom_tool_call_output";
2614
- call_id: string;
2615
- name?: string | null;
2616
- output: FunctionCallOutputPayload;
2617
- };
2618
- type ResponseToolSearchOutputItem = {
2619
- type: "tool_search_output";
2620
- call_id?: string | null;
2621
- status: string;
2622
- execution: string;
2623
- tools: unknown[];
2624
- };
2625
- type ResponseWebSearchCallItem = {
2626
- type: "web_search_call";
2627
- id?: string | null;
2628
- status?: string | null;
2629
- action?: Record<string, unknown> | null;
2630
- };
2631
- type ResponseImageGenerationCallItem = {
2632
- type: "image_generation_call";
2633
- id: string;
2634
- status: string;
2635
- revised_prompt?: string | null;
2636
- result: string;
2637
- saved_path?: string;
2638
- };
2639
- type ResponseCompactionItem = {
2640
- type: "compaction" | "context_compaction";
2641
- encrypted_content?: string | null;
2642
- };
2643
- type ResponseOtherItem = {
2644
- type: "other";
2645
- };
2646
- type ResponseItem = ResponseMessageItem | ResponseReasoningItem | ResponseLocalShellCallItem | ResponseFunctionCallItem | ResponseToolSearchCallItem | ResponseFunctionCallOutputItem | ResponseCustomToolCallItem | ResponseCustomToolCallOutputItem | ResponseToolSearchOutputItem | ResponseWebSearchCallItem | ResponseImageGenerationCallItem | ResponseCompactionItem | ResponseOtherItem;
2647
-
2648
- type McpRequestId = string | number;
2649
- declare const McpServerStartupState: {
2650
- readonly Starting: "starting";
2651
- readonly Ready: "ready";
2652
- readonly Failed: "failed";
2653
- readonly Cancelled: "cancelled";
2654
- };
2655
- type McpServerStartupState = (typeof McpServerStartupState)[keyof typeof McpServerStartupState];
2656
- type McpAuthStatus = "unsupported" | "notLoggedIn" | "bearerToken" | "oAuth";
2657
- type McpServerStatus = {
2658
- name: string;
2659
- startup_state: McpServerStartupState;
2660
- error?: string | null;
2661
- tools?: McpToolInfo[];
2662
- resources?: McpResourceInfo[];
2663
- resource_templates?: McpResourceTemplateInfo[];
2664
- auth_status?: McpAuthStatus;
2665
- authStatus?: McpAuthStatus;
2666
- oauth?: {
2667
- status: "not_required" | "required" | "authenticated" | "failed";
2668
- error?: string | null;
2669
- } | null;
2670
- };
2671
- type McpServerStatusDetail = "full" | "toolsAndAuthOnly";
2672
- type McpServerStatusListOptions = {
2673
- detail?: McpServerStatusDetail | null;
2674
- };
2675
- type McpServerRefreshConfig = {
2676
- mcp_servers: Record<string, unknown>;
2677
- mcp_oauth_credentials_store_mode?: unknown;
2678
- };
2679
- type McpRuntimeEnvironment = {
2680
- cwd: string;
2681
- environment_id?: string | null;
2682
- };
2683
- type McpToolInfo = {
2684
- /** Raw MCP server name used to route protocol calls. */
2685
- server_name: string;
2686
- /** Raw MCP tool name sent back to the MCP server. */
2687
- name: string;
2688
- /** Model-visible namespace. Defaults to Codex's qualified MCP namespace. */
2689
- callable_namespace?: string | null;
2690
- /** Model-visible tool name. Defaults to `name` for simple hosts. */
2691
- callable_name?: string | null;
2692
- namespace_description?: string | null;
2693
- title?: string | null;
2694
- description?: string | null;
2695
- input_schema?: unknown;
2696
- connector_id?: string | null;
2697
- connector_name?: string | null;
2698
- plugin_display_names?: string[];
2699
- source_label?: string | null;
2700
- mcp_app_resource_uri?: string | null;
2701
- };
2702
- type McpResourceInfo = {
2703
- uri: string;
2704
- name?: string | null;
2705
- description?: string | null;
2706
- mime_type?: string | null;
2707
- };
2708
- type McpResourceTemplateInfo = McpResourceInfo & {
2709
- uri_template: string;
2710
- };
2711
- type McpResourceReadParams = {
2712
- thread_id?: ThreadId | null;
2713
- server_name: string;
2714
- uri: string;
2715
- };
2716
- type McpResourceListParams = {
2717
- thread_id?: ThreadId | null;
2718
- server_name?: string | null;
2719
- cursor?: string | null;
2720
- };
2721
- type McpResourceListResponse = {
2722
- server_name?: string | null;
2723
- resources: McpResourceInfo[];
2724
- next_cursor?: string | null;
2725
- };
2726
- type McpResourceTemplateListResponse = {
2727
- server_name?: string | null;
2728
- resource_templates: McpResourceTemplateInfo[];
2729
- next_cursor?: string | null;
2730
- };
2731
- type McpResourceReadResponse = {
2732
- server_name: string;
2733
- uri: string;
2734
- contents: unknown[];
2735
- };
2736
- type McpServerToolCallParams = {
2737
- thread_id: ThreadId;
2738
- call_id?: string | null;
2739
- server_name: string;
2740
- tool_name: string;
2741
- arguments?: unknown;
2742
- meta?: unknown;
2743
- };
2744
- type McpServerToolCallResponse = {
2745
- call_id?: string | null;
2746
- server_name: string;
2747
- tool_name: string;
2748
- output: unknown;
2749
- response_item?: ResponseInputItem | null;
2750
- };
2751
- type McpServerElicitationRequest = {
2752
- type: "form";
2753
- meta?: unknown;
2754
- message: string;
2755
- requested_schema: unknown;
2756
- } | {
2757
- type: "url";
2758
- meta?: unknown;
2759
- message: string;
2760
- url: string;
2761
- elicitation_id?: string | null;
2762
- };
2763
- type McpServerElicitationAction = "accept" | "decline" | "cancel";
2764
- type McpServerElicitationResponse = {
2765
- action: McpServerElicitationAction;
2766
- content?: unknown;
2767
- meta?: unknown;
2768
- };
2769
- type McpServerElicitationRequestEvent = {
2770
- turn_id: string;
2771
- server_name: string;
2772
- id: McpRequestId;
2773
- request: McpServerElicitationRequest;
2774
- };
2775
- type McpServerElicitationResponseOp = {
2776
- type: "mcp_server_elicitation_response";
2777
- server_name: string;
2778
- id: McpRequestId;
2779
- response: McpServerElicitationResponse;
2780
- };
2781
- type McpToolCallProgressEvent = {
2782
- call_id: string;
2783
- turn_id?: string | null;
2784
- server_name: string;
2785
- tool_name: string;
2786
- message?: string | null;
2787
- progress?: unknown;
2788
- };
2789
- type McpServerStatusUpdatedEvent = {
2790
- status: McpServerStatus;
2791
- };
2792
- type McpServerOauthLoginCompletedEvent = {
2793
- name: string;
2794
- status: "completed" | "failed" | "cancelled";
2795
- error?: string | null;
2796
- };
2797
-
2798
- type ByteRange = {
2799
- start: number;
2800
- end: number;
2801
- };
2802
- type TextElement = {
2803
- byte_range: ByteRange;
2804
- placeholder?: string;
2805
- };
2806
- type UserInput = {
2807
- type: "text";
2808
- text: string;
2809
- text_elements?: TextElement[];
2810
- } | {
2811
- type: "image";
2812
- image_url: string;
2813
- } | {
2814
- type: "local_image";
2815
- path: string;
2816
- } | {
2817
- type: "skill";
2818
- name: string;
2819
- path: string;
2820
- } | {
2821
- type: "mention";
2822
- name: string;
2823
- path: string;
2824
- };
2825
-
2826
- type W3cTraceContext = {
2827
- traceparent?: string;
2828
- tracestate?: string;
2829
- };
2830
- type Submission = {
2831
- id: string;
2832
- op: Op;
2833
- trace?: W3cTraceContext;
2834
- };
2835
- type BaseInstructions = {
2836
- text: string;
2837
- };
2838
- declare const BaseInstructions: {
2839
- default(): BaseInstructions;
2840
- };
2841
- type TokenUsage = {
2842
- input_tokens: number;
2843
- cached_input_tokens: number;
2844
- output_tokens: number;
2845
- reasoning_output_tokens: number;
2846
- total_tokens: number;
2847
- };
2848
- type TokenUsageInfo = {
2849
- total_token_usage: TokenUsage;
2850
- last_token_usage: TokenUsage;
2851
- model_context_window?: number | null;
2852
- };
2853
- type RateLimitWindow = {
2854
- remaining?: number | null;
2855
- limit?: number | null;
2856
- reset_seconds?: number | null;
2857
- [key: string]: unknown;
2858
- };
2859
- type RateLimitSnapshot = {
2860
- limit_id?: string | null;
2861
- primary?: RateLimitWindow | null;
2862
- secondary?: RateLimitWindow | null;
2863
- credits?: Record<string, unknown> | null;
2864
- plan_type?: string | null;
2865
- [key: string]: unknown;
2866
- };
2867
- type SessionSource = string;
2868
- type ReasoningEffortConfig = string;
2869
- type ReasoningSummaryConfig = string;
2870
- type AskForApproval = string;
2871
- type ApprovalsReviewer = string;
2872
- type SandboxPolicy = Record<string, unknown>;
2873
- type PermissionProfile = Record<string, unknown>;
2874
- type ActivePermissionProfile = Record<string, unknown>;
2875
- type WindowsSandboxLevel = string;
2876
- type ServiceTier = string;
2877
- type Personality = string;
2878
- type TurnEnvironmentSelection = {
2879
- environment_id: string;
2880
- cwd: string;
2881
- };
2882
- type TurnContextNetworkItem = {
2883
- allowed_domains: string[];
2884
- denied_domains: string[];
2885
- };
2886
- type FileSystemSandboxPolicy = Record<string, unknown>;
2887
- type TruncationPolicy = Record<string, unknown>;
2888
- type GitInfo = Record<string, unknown>;
2889
- type UserTurnOp = {
2890
- type: "user_turn";
2891
- items: UserInput[];
2892
- cwd: string;
2893
- approval_policy: AskForApproval;
2894
- approvals_reviewer?: ApprovalsReviewer | null;
2895
- sandbox_policy: SandboxPolicy;
2896
- permission_profile?: PermissionProfile | null;
2897
- model: string;
2898
- effort?: ReasoningEffortConfig;
2899
- summary?: ReasoningSummaryConfig;
2900
- service_tier?: ServiceTier | null;
2901
- final_output_json_schema?: unknown;
2902
- collaboration_mode?: CollaborationMode;
2903
- personality?: Personality;
2904
- environments?: TurnEnvironmentSelection[];
2905
- };
2906
- type UserInputOp = {
2907
- type: "user_input";
2908
- items: UserInput[];
2909
- environments?: TurnEnvironmentSelection[];
2910
- final_output_json_schema?: unknown;
2911
- responsesapi_client_metadata?: Record<string, string>;
2912
- };
2913
- type UserInputWithTurnContextOp = {
2914
- type: "user_input_with_turn_context";
2915
- items: UserInput[];
2916
- final_output_json_schema?: unknown;
2917
- responsesapi_client_metadata?: Record<string, string>;
2918
- cwd?: string;
2919
- approval_policy?: AskForApproval;
2920
- approvals_reviewer?: ApprovalsReviewer;
2921
- sandbox_policy?: SandboxPolicy;
2922
- permission_profile?: PermissionProfile;
2923
- active_permission_profile?: ActivePermissionProfile;
2924
- windows_sandbox_level?: WindowsSandboxLevel;
2925
- model?: string;
2926
- effort?: ReasoningEffortConfig | null;
2927
- summary?: ReasoningSummaryConfig;
2928
- service_tier?: ServiceTier | null;
2929
- collaboration_mode?: CollaborationMode;
2930
- personality?: Personality;
2931
- environments?: TurnEnvironmentSelection[];
2932
- };
2933
- type OverrideTurnContextOp = {
2934
- type: "override_turn_context";
2935
- cwd?: string;
2936
- approval_policy?: AskForApproval;
2937
- approvals_reviewer?: ApprovalsReviewer | null;
2938
- sandbox_policy?: SandboxPolicy;
2939
- permission_profile?: PermissionProfile | null;
2940
- active_permission_profile?: ActivePermissionProfile | null;
2941
- windows_sandbox_level?: WindowsSandboxLevel;
2942
- model?: string;
2943
- effort?: ReasoningEffortConfig | null;
2944
- summary?: ReasoningSummaryConfig;
2945
- service_tier?: ServiceTier | null;
2946
- collaboration_mode?: CollaborationMode;
2947
- personality?: Personality | null;
2948
- environments?: TurnEnvironmentSelection[];
2949
- };
2950
- type UserInputAnswerOp = {
2951
- type: "user_input_answer";
2952
- id: string;
2953
- response: RequestUserInputResponse;
2954
- };
2955
- type RequestPermissionsResponseOp = {
2956
- type: "request_permissions_response";
2957
- id: string;
2958
- response: RequestPermissionsResponse;
2959
- };
2960
- type DynamicToolResponseOp = {
2961
- type: "dynamic_tool_response";
2962
- id: string;
2963
- response: DynamicToolResponse;
2964
- };
2965
- type RealtimeOutputModality = "text" | "audio";
2966
- type RealtimeVoice = "alloy" | "arbor" | "ash" | "ballad" | "breeze" | "cedar" | "coral" | "cove" | "echo" | "ember" | "juniper" | "maple" | "marin" | "sage" | "shimmer" | "sol" | "spruce" | "vale" | "verse";
2967
- type RealtimeVoicesList = {
2968
- v1: RealtimeVoice[];
2969
- v2: RealtimeVoice[];
2970
- default_v1: RealtimeVoice;
2971
- default_v2: RealtimeVoice;
2972
- };
2973
- declare const RealtimeVoicesList: {
2974
- builtin(): RealtimeVoicesList;
2975
- };
2976
- type ConversationStartTransport = {
2977
- type: "websocket";
2978
- } | {
2979
- type: "webrtc";
2980
- sdp: string;
2981
- };
2982
- type ConversationStartParams = {
2983
- output_modality: RealtimeOutputModality;
2984
- prompt?: string | null;
2985
- realtime_session_id?: string | null;
2986
- transport?: ConversationStartTransport | null;
2987
- voice?: RealtimeVoice | null;
2988
- };
2989
- type RealtimeAudioFrame = {
2990
- data: string;
2991
- sample_rate: number;
2992
- num_channels: number;
2993
- samples_per_channel?: number | null;
2994
- item_id?: string | null;
2995
- };
2996
- type RealtimeTranscriptDelta = {
2997
- delta: string;
2998
- };
2999
- type RealtimeTranscriptDone = {
3000
- text: string;
3001
- };
3002
- type RealtimeTranscriptEntry = {
3003
- role: string;
3004
- text: string;
3005
- };
3006
- type RealtimeHandoffRequested = {
3007
- handoff_id: string;
3008
- item_id: string;
3009
- input_transcript: string;
3010
- active_transcript: RealtimeTranscriptEntry[];
3011
- };
3012
- type RealtimeNoopRequested = {
3013
- call_id: string;
3014
- item_id: string;
3015
- };
3016
- type RealtimeInputAudioSpeechStarted = {
3017
- item_id?: string | null;
3018
- };
3019
- type RealtimeResponseLifecycle = {
3020
- response_id?: string | null;
3021
- };
3022
- type RealtimeEvent = {
3023
- type: "session_updated";
3024
- realtime_session_id: string;
3025
- instructions?: string | null;
3026
- } | ({
3027
- type: "input_audio_speech_started";
3028
- } & RealtimeInputAudioSpeechStarted) | ({
3029
- type: "input_transcript_delta";
3030
- } & RealtimeTranscriptDelta) | ({
3031
- type: "input_transcript_done";
3032
- } & RealtimeTranscriptDone) | ({
3033
- type: "output_transcript_delta";
3034
- } & RealtimeTranscriptDelta) | ({
3035
- type: "output_transcript_done";
3036
- } & RealtimeTranscriptDone) | ({
3037
- type: "audio_out";
3038
- } & RealtimeAudioFrame) | ({
3039
- type: "response_created";
3040
- } & RealtimeResponseLifecycle) | ({
3041
- type: "response_cancelled";
3042
- } & RealtimeResponseLifecycle) | ({
3043
- type: "response_done";
3044
- } & RealtimeResponseLifecycle) | {
3045
- type: "conversation_item_added";
3046
- item: unknown;
3047
- } | {
3048
- type: "conversation_item_done";
3049
- item_id: string;
3050
- } | ({
3051
- type: "handoff_requested";
3052
- } & RealtimeHandoffRequested) | ({
3053
- type: "noop_requested";
3054
- } & RealtimeNoopRequested) | {
3055
- type: "error";
3056
- message: string;
3057
- };
3058
- type ConversationAudioParams = {
3059
- frame: RealtimeAudioFrame;
3060
- };
3061
- type ConversationTextParams = {
3062
- text: string;
3063
- };
3064
- type RealtimeConversationStartOp = {
3065
- type: "realtime_conversation_start";
3066
- } & ConversationStartParams;
3067
- type RealtimeConversationAudioOp = {
3068
- type: "realtime_conversation_audio";
3069
- } & ConversationAudioParams;
3070
- type RealtimeConversationTextOp = {
3071
- type: "realtime_conversation_text";
3072
- } & ConversationTextParams;
3073
- type RealtimeConversationCloseOp = {
3074
- type: "realtime_conversation_close";
3075
- };
3076
- type RealtimeConversationListVoicesOp = {
3077
- type: "realtime_conversation_list_voices";
3078
- };
3079
- type CompactOp = {
3080
- type: "compact";
3081
- };
3082
- type SetThreadNameOp = {
3083
- type: "set_thread_name";
3084
- name: string;
3085
- };
3086
- type SetThreadMemoryModeOp = {
3087
- type: "set_thread_memory_mode";
3088
- mode: ThreadMemoryMode;
3089
- };
3090
- type ThreadRollbackOp = {
3091
- type: "thread_rollback";
3092
- num_turns: number;
3093
- };
3094
- type InterruptOp = {
3095
- type: "interrupt";
3096
- };
3097
- type ShutdownOp = {
3098
- type: "shutdown";
3099
- };
3100
- type Op = UserTurnOp | UserInputOp | UserInputWithTurnContextOp | OverrideTurnContextOp | UserInputAnswerOp | RequestPermissionsResponseOp | DynamicToolResponseOp | McpServerElicitationResponseOp | RealtimeConversationStartOp | RealtimeConversationAudioOp | RealtimeConversationTextOp | RealtimeConversationCloseOp | RealtimeConversationListVoicesOp | CompactOp | SetThreadNameOp | SetThreadMemoryModeOp | ThreadRollbackOp | InterruptOp | ShutdownOp;
3101
- type ErrorEvent = {
3102
- message: string;
3103
- codex_error_info?: unknown;
3104
- };
3105
- type WarningEvent = {
3106
- message: string;
3107
- };
3108
- type TurnStartedEvent = {
3109
- turn_id: string;
3110
- started_at?: number | null;
3111
- model_context_window?: number | null;
3112
- collaboration_mode_kind?: CollaborationMode["mode"];
3113
- };
3114
- type TurnCompleteEvent = {
3115
- turn_id: string;
3116
- last_agent_message?: string | null;
3117
- completed_at?: number | null;
3118
- duration_ms?: number | null;
3119
- time_to_first_token_ms?: number | null;
3120
- };
3121
- type TurnAbortReason = "interrupted";
3122
- type TurnAbortedEvent = {
3123
- turn_id: string;
3124
- reason: TurnAbortReason;
3125
- aborted_at?: number | null;
3126
- completed_at?: number | null;
3127
- duration_ms?: number | null;
3128
- };
3129
- type AgentMessageEvent = {
3130
- message: string;
3131
- phase?: string | null;
3132
- memory_citation?: MemoryCitation | null;
3133
- };
3134
- type UserMessageEvent = {
3135
- message: string;
3136
- images?: string[] | null;
3137
- local_images?: string[];
3138
- text_elements?: TextElement[];
3139
- };
3140
- type RawResponseItemEvent = {
3141
- item: ResponseItem;
3142
- };
3143
- type ItemStartedEvent = {
3144
- turn_id?: string;
3145
- item: TurnItem;
3146
- };
3147
- type ItemCompletedEvent = {
3148
- turn_id?: string;
3149
- item: TurnItem;
3150
- };
3151
- type ExecCommandStatus = "completed" | "failed" | "cancelled";
3152
- type ExecCommandBeginEvent = {
3153
- call_id: string;
3154
- process_id?: string | null;
3155
- turn_id: string;
3156
- started_at_ms: number;
3157
- command: string[];
3158
- cwd: string;
3159
- parsed_cmd?: unknown[] | null;
3160
- source?: string | null;
3161
- interaction_input?: string | null;
3162
- };
3163
- type ExecCommandOutputDeltaEvent = {
3164
- call_id: string;
3165
- turn_id?: string;
3166
- stream: "stdout" | "stderr";
3167
- chunk: string;
3168
- };
3169
- type TerminalInteractionEvent = {
3170
- call_id: string;
3171
- process_id?: string | null;
3172
- stdin: string;
3173
- };
3174
- type ExecCommandEndEvent = {
3175
- call_id: string;
3176
- turn_id?: string;
3177
- process_id?: string | null;
3178
- completed_at_ms: number;
3179
- exit_code: number;
3180
- status: ExecCommandStatus;
3181
- duration_ms?: number | null;
3182
- stdout?: string | null;
3183
- stderr?: string | null;
3184
- output?: ExecToolCallOutput | null;
3185
- };
3186
- type PatchApplyUpdatedEvent = {
3187
- call_id: string;
3188
- turn_id?: string;
3189
- changes: Record<string, FileChange>;
3190
- status?: "completed" | "failed" | "declined" | null;
3191
- stdout?: string | null;
3192
- stderr?: string | null;
3193
- };
3194
- type CommandApprovalRequestEvent = {
3195
- call_id: string;
3196
- command: string[];
3197
- cwd: string;
3198
- reason?: string | null;
3199
- };
3200
- type FileChangeApprovalRequestEvent = {
3201
- call_id: string;
3202
- changes: Record<string, FileChange>;
3203
- reason?: string | null;
3204
- };
3205
- type AgentMessageContentDeltaEvent = {
3206
- thread_id: string;
3207
- turn_id: string;
3208
- item_id: string;
3209
- delta: string;
3210
- };
3211
- type PlanDeltaEvent = {
3212
- thread_id: string;
3213
- turn_id: string;
3214
- item_id: string;
3215
- delta: string;
3216
- };
3217
- type UpdatePlanStepStatus = "pending" | "in_progress" | "completed";
3218
- type UpdatePlanStep = {
3219
- step: string;
3220
- status: UpdatePlanStepStatus;
3221
- };
3222
- type UpdatePlanArgs = {
3223
- explanation?: string | null;
3224
- plan: UpdatePlanStep[];
3225
- };
3226
- type ImageGenerationBeginEvent = {
3227
- call_id: string;
3228
- };
3229
- type ImageGenerationEndEvent = {
3230
- call_id: string;
3231
- status: string;
3232
- revised_prompt?: string;
3233
- result: string;
3234
- saved_path?: string;
3235
- };
3236
- type ContextCompactedEvent = Record<never, never>;
3237
- type ThreadRolledBackEvent = {
3238
- num_turns: number;
3239
- };
3240
- type TokenCountEvent = {
3241
- info?: TokenUsageInfo | null;
3242
- rate_limits?: RateLimitSnapshot | null;
3243
- };
3244
- declare const ThreadGoalStatus: {
3245
- readonly Active: "active";
3246
- readonly Paused: "paused";
3247
- readonly BudgetLimited: "budgetLimited";
3248
- readonly Complete: "complete";
3249
- };
3250
- type ThreadGoalStatus = (typeof ThreadGoalStatus)[keyof typeof ThreadGoalStatus];
3251
- type ThreadGoal = {
3252
- thread_id: ThreadId;
3253
- objective: string;
3254
- status: ThreadGoalStatus;
3255
- token_budget?: number | null;
3256
- tokens_used: number;
3257
- time_used_seconds: number;
3258
- created_at: number;
3259
- updated_at: number;
3260
- };
3261
- type ThreadGoalUpdatedEvent = {
3262
- thread_id: ThreadId;
3263
- turn_id?: string | null;
3264
- goal: ThreadGoal;
3265
- };
3266
- type McpToolCallProgressEventMsg = {
3267
- type: "mcp_tool_call_progress";
3268
- } & McpToolCallProgressEvent;
3269
- type McpServerStatusUpdatedEventMsg = {
3270
- type: "mcp_server_status_updated";
3271
- } & McpServerStatusUpdatedEvent;
3272
- type McpServerOauthLoginCompletedEventMsg = {
3273
- type: "mcp_server_oauth_login_completed";
3274
- } & McpServerOauthLoginCompletedEvent;
3275
- type McpServerElicitationRequestEventMsg = {
3276
- type: "mcp_server_elicitation_request";
3277
- } & McpServerElicitationRequestEvent;
3278
- declare const HookEventName: {
3279
- readonly PreToolUse: "pre_tool_use";
3280
- readonly PermissionRequest: "permission_request";
3281
- readonly PostToolUse: "post_tool_use";
3282
- readonly PreCompact: "pre_compact";
3283
- readonly PostCompact: "post_compact";
3284
- readonly SessionStart: "session_start";
3285
- readonly UserPromptSubmit: "user_prompt_submit";
3286
- readonly Stop: "stop";
3287
- };
3288
- type HookEventName = (typeof HookEventName)[keyof typeof HookEventName];
3289
- declare const HookHandlerType: {
3290
- readonly Command: "command";
3291
- readonly Prompt: "prompt";
3292
- readonly Agent: "agent";
3293
- };
3294
- type HookHandlerType = (typeof HookHandlerType)[keyof typeof HookHandlerType];
3295
- declare const HookExecutionMode: {
3296
- readonly Sync: "sync";
3297
- readonly Async: "async";
3298
- };
3299
- type HookExecutionMode = (typeof HookExecutionMode)[keyof typeof HookExecutionMode];
3300
- declare const HookScope: {
3301
- readonly Thread: "thread";
3302
- readonly Turn: "turn";
3303
- };
3304
- type HookScope = (typeof HookScope)[keyof typeof HookScope];
3305
- declare const HookSource: {
3306
- readonly System: "system";
3307
- readonly User: "user";
3308
- readonly Project: "project";
3309
- readonly Mdm: "mdm";
3310
- readonly SessionFlags: "session_flags";
3311
- readonly Plugin: "plugin";
3312
- readonly CloudRequirements: "cloud_requirements";
3313
- readonly LegacyManagedConfigFile: "legacy_managed_config_file";
3314
- readonly LegacyManagedConfigMdm: "legacy_managed_config_mdm";
3315
- readonly Unknown: "unknown";
3316
- };
3317
- type HookSource = (typeof HookSource)[keyof typeof HookSource];
3318
- declare const HookRunStatus: {
3319
- readonly Running: "running";
3320
- readonly Completed: "completed";
3321
- readonly Failed: "failed";
3322
- readonly Blocked: "blocked";
3323
- readonly Stopped: "stopped";
3324
- };
3325
- type HookRunStatus = (typeof HookRunStatus)[keyof typeof HookRunStatus];
3326
- declare const HookOutputEntryKind: {
3327
- readonly Warning: "warning";
3328
- readonly Stop: "stop";
3329
- readonly Feedback: "feedback";
3330
- readonly Context: "context";
3331
- readonly Error: "error";
3332
- };
3333
- type HookOutputEntryKind = (typeof HookOutputEntryKind)[keyof typeof HookOutputEntryKind];
3334
- type HookOutputEntry = {
3335
- kind: HookOutputEntryKind;
3336
- text: string;
3337
- };
3338
- type HookRunSummary = {
3339
- id: string;
3340
- event_name: HookEventName;
3341
- handler_type: HookHandlerType;
3342
- execution_mode: HookExecutionMode;
3343
- scope: HookScope;
3344
- source_path: string;
3345
- source: HookSource;
3346
- display_order: number;
3347
- status: HookRunStatus;
3348
- status_message?: string | null;
3349
- started_at: number;
3350
- completed_at?: number | null;
3351
- duration_ms?: number | null;
3352
- entries: HookOutputEntry[];
3353
- };
3354
- type HookStartedEvent = {
3355
- turn_id?: string | null;
3356
- run: HookRunSummary;
3357
- };
3358
- type HookCompletedEvent = {
3359
- turn_id?: string | null;
3360
- run: HookRunSummary;
3361
- };
3362
- type RealtimeConversationVersion = "v1" | "v2";
3363
- type RealtimeConversationStartedEvent = {
3364
- realtime_session_id?: string | null;
3365
- version: RealtimeConversationVersion;
3366
- };
3367
- type RealtimeConversationRealtimeEvent = {
3368
- payload: RealtimeEvent;
3369
- };
3370
- type RealtimeConversationClosedEvent = {
3371
- reason?: string | null;
3372
- };
3373
- type RealtimeConversationSdpEvent = {
3374
- sdp: string;
3375
- };
3376
- type RealtimeConversationListVoicesResponseEvent = {
3377
- voices: RealtimeVoicesList;
3378
- };
3379
- /** Codex Rust variant: `TurnStarted`; v1 wire value: `turn_started`. */
3380
- type TurnStartedEventMsg = {
3381
- type: "turn_started";
3382
- } & TurnStartedEvent;
3383
- /** Codex Rust variant: `TurnComplete`; v1 wire value: `turn_complete`. */
3384
- type TurnCompleteEventMsg = {
3385
- type: "turn_complete";
3386
- } & TurnCompleteEvent;
3387
- /** Codex Rust variant: `TurnAborted`; v1 wire value: `turn_aborted`. */
3388
- type TurnAbortedEventMsg = {
3389
- type: "turn_aborted";
3390
- } & TurnAbortedEvent;
3391
- type AgentMessageEventMsg = {
3392
- type: "agent_message";
3393
- } & AgentMessageEvent;
3394
- type UserMessageEventMsg = {
3395
- type: "user_message";
3396
- } & UserMessageEvent;
3397
- type RawResponseItemEventMsg = {
3398
- type: "raw_response_item";
3399
- } & RawResponseItemEvent;
3400
- type ItemStartedEventMsg = {
3401
- type: "item_started";
3402
- } & ItemStartedEvent;
3403
- type ItemCompletedEventMsg = {
3404
- type: "item_completed";
3405
- } & ItemCompletedEvent;
3406
- type ExecCommandBeginEventMsg = {
3407
- type: "exec_command_begin";
3408
- } & ExecCommandBeginEvent;
3409
- type ExecCommandOutputDeltaEventMsg = {
3410
- type: "exec_command_output_delta";
3411
- } & ExecCommandOutputDeltaEvent;
3412
- type TerminalInteractionEventMsg = {
3413
- type: "terminal_interaction";
3414
- } & TerminalInteractionEvent;
3415
- type ExecCommandEndEventMsg = {
3416
- type: "exec_command_end";
3417
- } & ExecCommandEndEvent;
3418
- type PatchApplyUpdatedEventMsg = {
3419
- type: "patch_apply_updated";
3420
- } & PatchApplyUpdatedEvent;
3421
- type CommandApprovalRequestEventMsg = {
3422
- type: "command_approval_request";
3423
- } & CommandApprovalRequestEvent;
3424
- type FileChangeApprovalRequestEventMsg = {
3425
- type: "file_change_approval_request";
3426
- } & FileChangeApprovalRequestEvent;
3427
- type AgentMessageContentDeltaEventMsg = {
3428
- type: "agent_message_content_delta";
3429
- } & AgentMessageContentDeltaEvent;
3430
- /** Codex Rust variant: `PlanDelta`; v1 wire value: `plan_delta`. */
3431
- type PlanDeltaEventMsg = {
3432
- type: "plan_delta";
3433
- } & PlanDeltaEvent;
3434
- type PlanUpdateEventMsg = {
3435
- type: "plan_update";
3436
- } & UpdatePlanArgs;
3437
- type RequestUserInputEventMsg = {
3438
- type: "request_user_input";
3439
- } & RequestUserInputEvent;
3440
- type RequestPermissionsEventMsg = {
3441
- type: "request_permissions";
3442
- } & RequestPermissionsEvent;
3443
- type DynamicToolCallRequestEventMsg = {
3444
- type: "dynamic_tool_call_request";
3445
- } & DynamicToolCallRequest;
3446
- type DynamicToolCallResponseEventMsg = {
3447
- type: "dynamic_tool_call_response";
3448
- } & DynamicToolCallResponseEvent;
3449
- type ImageGenerationBeginEventMsg = {
3450
- type: "image_generation_begin";
3451
- } & ImageGenerationBeginEvent;
3452
- type ImageGenerationEndEventMsg = {
3453
- type: "image_generation_end";
3454
- } & ImageGenerationEndEvent;
3455
- type ContextCompactedEventMsg = {
3456
- type: "context_compacted";
3457
- } & ContextCompactedEvent;
3458
- type ThreadRolledBackEventMsg = {
3459
- type: "thread_rolled_back";
3460
- } & ThreadRolledBackEvent;
3461
- type TokenCountEventMsg = {
3462
- type: "token_count";
3463
- } & TokenCountEvent;
3464
- type ThreadGoalUpdatedEventMsg = {
3465
- type: "thread_goal_updated";
3466
- } & ThreadGoalUpdatedEvent;
3467
- type WarningEventMsg = {
3468
- type: "warning";
3469
- } & WarningEvent;
3470
- type ErrorEventMsg = {
3471
- type: "error";
3472
- } & ErrorEvent;
3473
- type HookStartedEventMsg = {
3474
- type: "hook_started";
3475
- } & HookStartedEvent;
3476
- type HookCompletedEventMsg = {
3477
- type: "hook_completed";
3478
- } & HookCompletedEvent;
3479
- type RealtimeConversationStartedEventMsg = {
3480
- type: "realtime_conversation_started";
3481
- } & RealtimeConversationStartedEvent;
3482
- type RealtimeConversationRealtimeEventMsg = {
3483
- type: "realtime_conversation_realtime";
3484
- } & RealtimeConversationRealtimeEvent;
3485
- type RealtimeConversationClosedEventMsg = {
3486
- type: "realtime_conversation_closed";
3487
- } & RealtimeConversationClosedEvent;
3488
- type RealtimeConversationSdpEventMsg = {
3489
- type: "realtime_conversation_sdp";
3490
- } & RealtimeConversationSdpEvent;
3491
- type RealtimeConversationListVoicesResponseEventMsg = {
3492
- type: "realtime_conversation_list_voices_response";
3493
- } & RealtimeConversationListVoicesResponseEvent;
3494
- type SessionConfiguredEvent = {
3495
- session_id: string;
3496
- thread_id: ThreadId;
3497
- forked_from_id?: ThreadId | null;
3498
- thread_source?: string | null;
3499
- thread_name?: string | null;
3500
- model: string;
3501
- model_provider_id: string;
3502
- service_tier?: ServiceTier | null;
3503
- approval_policy: AskForApproval;
3504
- approvals_reviewer?: ApprovalsReviewer | null;
3505
- permission_profile: PermissionProfile;
3506
- active_permission_profile?: ActivePermissionProfile | null;
3507
- cwd: string;
3508
- reasoning_effort?: ReasoningEffortConfig | null;
3509
- initial_messages?: EventMsg[] | null;
3510
- network_proxy?: unknown | null;
3511
- rollout_path?: string | null;
3512
- };
3513
- type SessionConfiguredEventMsg = {
3514
- type: "session_configured";
3515
- } & SessionConfiguredEvent;
3516
- 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;
3517
- type SessionMeta = {
3518
- id: ThreadId;
3519
- forked_from_id?: ThreadId | null;
3520
- timestamp: string;
3521
- cwd: string;
3522
- originator: string;
3523
- cli_version: string;
3524
- source: SessionSource;
3525
- agent_nickname?: string | null;
3526
- agent_role?: string | null;
3527
- agent_path?: string | null;
3528
- model_provider: string | null;
3529
- base_instructions: BaseInstructions | null;
3530
- dynamic_tools?: DynamicToolSpec[] | null;
3531
- memory_mode?: ThreadMemoryModeSessionMetaValue | null;
3532
- };
3533
- type SessionMetaLine = SessionMeta & {
3534
- git?: GitInfo | null;
3535
- };
3536
- type CompactedItem = {
3537
- message: string;
3538
- replacement_history?: ResponseItem[];
3539
- };
3540
- type TurnContextItem = {
3541
- turn_id?: string;
3542
- trace_id?: string;
3543
- cwd: string;
3544
- current_date?: string;
3545
- timezone?: string;
3546
- approval_policy: AskForApproval;
3547
- sandbox_policy: SandboxPolicy;
3548
- permission_profile?: PermissionProfile | null;
3549
- windows_sandbox_level?: WindowsSandboxLevel | null;
3550
- network?: TurnContextNetworkItem | null;
3551
- file_system_sandbox_policy?: FileSystemSandboxPolicy | null;
3552
- model: string;
3553
- personality?: Personality | null;
3554
- collaboration_mode?: CollaborationMode | null;
3555
- realtime_active?: boolean | null;
3556
- effort?: ReasoningEffortConfig | null;
3557
- summary: ReasoningSummaryConfig;
3558
- user_instructions?: string | null;
3559
- developer_instructions?: string | null;
3560
- final_output_json_schema?: unknown;
3561
- truncation_policy?: TruncationPolicy | null;
3562
- };
3563
- type SessionMetaRolloutItem = {
3564
- type: "session_meta";
3565
- payload: SessionMetaLine;
3566
- };
3567
- type ResponseRolloutItem = {
3568
- type: "response_item";
3569
- payload: ResponseItem;
3570
- };
3571
- type CompactedRolloutItem = {
3572
- type: "compacted";
3573
- payload: CompactedItem;
3574
- };
3575
- type TurnContextRolloutItem = {
3576
- type: "turn_context";
3577
- payload: TurnContextItem;
3578
- };
3579
- type EventMsgRolloutItem = {
3580
- type: "event_msg";
3581
- payload: EventMsg;
3582
- };
3583
- type RolloutItem = SessionMetaRolloutItem | ResponseRolloutItem | CompactedRolloutItem | TurnContextRolloutItem | EventMsgRolloutItem;
3584
-
3585
- declare const ThreadEventPersistenceMode: {
3586
- readonly Limited: "Limited";
3587
- readonly Extended: "Extended";
3588
- };
3589
- type ThreadEventPersistenceMode = (typeof ThreadEventPersistenceMode)[keyof typeof ThreadEventPersistenceMode];
3590
- declare const ThreadSortKey: {
3591
- readonly CreatedAt: "CreatedAt";
3592
- readonly UpdatedAt: "UpdatedAt";
3593
- };
3594
- type ThreadSortKey = (typeof ThreadSortKey)[keyof typeof ThreadSortKey];
3595
- declare const SortDirection: {
3596
- readonly Asc: "Asc";
3597
- readonly Desc: "Desc";
3598
- };
3599
- type SortDirection = (typeof SortDirection)[keyof typeof SortDirection];
3600
- type ThreadPersistenceMetadata = {
3601
- cwd?: string | null;
3602
- model_provider: string;
3603
- memory_mode: ThreadMemoryMode;
3604
- [key: string]: unknown;
3605
- };
3606
- type CreateThreadParams = {
3607
- thread_id: ThreadId;
3608
- forked_from_id?: ThreadId | null;
3609
- source: string;
3610
- thread_source?: string | null;
3611
- base_instructions: BaseInstructions;
3612
- dynamic_tools: DynamicToolSpec[];
3613
- metadata: ThreadPersistenceMetadata;
3614
- event_persistence_mode: ThreadEventPersistenceMode;
3615
- };
3616
- type ResumeThreadParams = {
3617
- thread_id: ThreadId;
3618
- rollout_path?: string | null;
3619
- history?: RolloutItem[] | null;
3620
- include_archived: boolean;
3621
- metadata: ThreadPersistenceMetadata;
3622
- event_persistence_mode: ThreadEventPersistenceMode;
3623
- };
3624
- type AppendThreadItemsParams = {
3625
- thread_id: ThreadId;
3626
- items: RolloutItem[];
3627
- };
3628
- type LoadThreadHistoryParams = {
3629
- thread_id: ThreadId;
3630
- include_archived: boolean;
3631
- };
3632
- type StoredThreadHistory = {
3633
- thread_id: ThreadId;
3634
- items: RolloutItem[];
3635
- };
3636
- type ReadThreadParams = {
3637
- thread_id: ThreadId;
3638
- include_archived: boolean;
3639
- include_history: boolean;
3640
- };
3641
- type ReadThreadByRolloutPathParams = {
3642
- rollout_path: string;
3643
- include_archived: boolean;
3644
- include_history: boolean;
3645
- };
3646
- type ListThreadsParams = {
3647
- page_size: number;
3648
- cursor?: string | null;
3649
- sort_key: ThreadSortKey;
3650
- sort_direction: SortDirection;
3651
- allowed_sources: string[];
3652
- model_providers?: string[] | null;
3653
- cwd_filters?: string[] | null;
3654
- archived: boolean;
3655
- search_term?: string | null;
3656
- use_state_db_only: boolean;
3657
- };
3658
- type ThreadPage = {
3659
- items: StoredThread[];
3660
- next_cursor?: string | null;
3661
- };
3662
- type StoredThread = {
3663
- thread_id: ThreadId;
3664
- rollout_path?: string | null;
3665
- forked_from_id?: ThreadId | null;
3666
- preview: string;
3667
- name?: string | null;
3668
- model_provider: string;
3669
- model?: string | null;
3670
- reasoning_effort?: string | null;
3671
- created_at: string;
3672
- updated_at: string;
3673
- archived_at?: string | null;
3674
- cwd: string;
3675
- cli_version?: string;
3676
- source: string;
3677
- thread_source?: string | null;
3678
- agent_nickname?: string | null;
3679
- agent_role?: string | null;
3680
- agent_path?: string | null;
3681
- git_info?: unknown;
3682
- approval_mode?: string;
3683
- sandbox_policy?: unknown;
3684
- token_usage?: unknown;
3685
- first_user_message?: string | null;
3686
- history?: StoredThreadHistory | null;
3687
- };
3688
- type OptionalStringPatch = string | null | undefined;
3689
- type GitInfoPatch = {
3690
- sha?: OptionalStringPatch;
3691
- branch?: OptionalStringPatch;
3692
- origin_url?: OptionalStringPatch;
3693
- };
3694
- type ThreadMetadataPatch = {
3695
- name?: string;
3696
- memory_mode?: ThreadMemoryMode;
3697
- git_info?: GitInfoPatch;
3698
- };
3699
- type UpdateThreadMetadataParams = {
3700
- thread_id: ThreadId;
3701
- patch: ThreadMetadataPatch;
3702
- include_archived: boolean;
3703
- };
3704
- type ArchiveThreadParams = {
3705
- thread_id: ThreadId;
3706
- };
3707
-
3708
- type TurnStatus = "completed" | "interrupted" | "failed" | "in_progress";
3709
- type TurnItemsView = "not_loaded" | "summary" | "full";
3710
- type TurnError = {
3711
- message: string;
3712
- codex_error_info?: unknown | null;
3713
- additional_details?: string | null;
3714
- };
3715
- type Turn = {
3716
- id: string;
3717
- items: TurnItem[];
3718
- items_view: TurnItemsView;
3719
- status: TurnStatus;
3720
- error: TurnError | null;
3721
- started_at: number | null;
3722
- completed_at: number | null;
3723
- duration_ms: number | null;
3724
- };
3725
- declare class ThreadHistoryBuilder {
3726
- private turns;
3727
- private next_item_index;
3728
- static fromTurns(turns: readonly Turn[]): ThreadHistoryBuilder;
3729
- handle_rollout_item(item: RolloutItem, index?: number): void;
3730
- handle_event(event: EventMsg, eventId?: string): void;
3731
- handle_response_item(item: ResponseItem, id: string): void;
3732
- active_turn_snapshot(): Turn | null;
3733
- active_turn_position(): number | null;
3734
- finish(): Turn[];
3735
- has_active_turn(): boolean;
3736
- reset(): void;
3737
- private open_explicit_turn;
3738
- private complete_turn;
3739
- private append_user_message;
3740
- private upsert_agent_message;
3741
- private upsert_item_in_turn;
3742
- private upsert_item_in_current_or_existing_turn;
3743
- private append_to_current_turn;
3744
- private apply_agent_message_delta;
3745
- private apply_plan_delta;
3746
- private apply_exec_command_output_delta;
3747
- private apply_exec_command_end;
3748
- private ensure_turn;
3749
- private active_turn;
3750
- private turn_by_id;
3751
- private find_item;
3752
- }
3753
-
3754
- type RenderedThreadConnectionStatus = "idle" | "connecting" | "connected" | "reconnecting" | "closed" | "error";
3755
- type RenderedThreadState = {
3756
- thread_id: ThreadId;
3757
- turns: Turn[];
3758
- items: TurnItem[];
3759
- pending_request_user_input: RequestUserInputEvent | null;
3760
- pending_request_permissions: RequestPermissionsEvent | null;
3761
- pending_dynamic_tool_call_requests: DynamicToolCallRequest[];
3762
- running_turn_ids: string[];
3763
- warnings: string[];
3764
- errors: string[];
3765
- last_history_fingerprint: string | null;
3766
- connection_status: RenderedThreadConnectionStatus;
3767
- };
3768
- declare function createRenderedThreadState(threadId: ThreadId): RenderedThreadState;
3769
- declare function renderThreadFromHistory(history: StoredThreadHistory): RenderedThreadState;
3770
-
3771
- type ThreadBufferedEvent = {
3772
- notification: ServerNotification;
3773
- type: "notification";
3774
- } | {
3775
- request: ServerRequest;
3776
- type: "request";
3777
- };
3778
- type ServerNotificationThreadTarget = {
3779
- threadId: string;
3780
- type: "thread";
3781
- } | {
3782
- threadId: string;
3783
- type: "invalid_thread_id";
3784
- } | {
3785
- type: "global";
3786
- };
3787
- type ThreadEventSnapshot = {
3788
- activeTurnIds: string[];
3789
- accountRateLimits: RateLimitSnapshot$1 | null;
3790
- bufferedEvents: ThreadBufferedEvent[];
3791
- connectionStatus: RenderedThreadConnectionStatus;
3792
- errors: string[];
3793
- pendingRequests: ServerRequest[];
3794
- resolvedRequestIds: RequestId[];
3795
- thread: Thread | null;
3796
- tokenUsage: ThreadTokenUsageSnapshot | null;
3797
- turns: Turn$1[];
3798
- warnings: string[];
3799
- };
3800
- type ThreadTokenUsageSnapshot = {
3801
- threadId: string;
3802
- tokenUsage: ThreadTokenUsage;
3803
- turnId: string;
3804
- updatedAt: string;
3805
- };
3806
- declare class ThreadEventStore {
3807
- private accountRateLimits;
3808
- private activeTurnIds;
3809
- private bufferedEvents;
3810
- private connectionStatus;
3811
- private errors;
3812
- private pendingRequests;
3813
- private resolvedRequestIds;
3814
- private thread;
3815
- private tokenUsage;
3816
- private turns;
3817
- private warnings;
3818
- static fromThread(thread: Thread): ThreadEventStore;
3819
- applyNotification(notification: ServerNotification): ThreadEventSnapshot;
3820
- applyRequest(request: ServerRequest): ThreadEventSnapshot;
3821
- setConnectionStatus(status: RenderedThreadConnectionStatus): ThreadEventSnapshot;
3822
- setThread(thread: Thread): ThreadEventSnapshot;
3823
- snapshot(): ThreadEventSnapshot;
3824
- noteNotification(notification: ServerNotification): void;
3825
- noteRequest(request: ServerRequest): void;
3826
- private upsertTurn;
3827
- private upsertItem;
3828
- private applyAgentMessageDelta;
3829
- private applyPlanDelta;
3830
- private applyReasoningSummaryPartAdded;
3831
- private applyReasoningSummaryTextDelta;
3832
- private applyReasoningTextDelta;
3833
- private applyCommandOutputDelta;
3834
- private applyFileChangePatchUpdated;
3835
- private reasoningItem;
3836
- private ensureTurn;
3837
- private replaceTurn;
3838
- }
3839
- declare function serverRequestThreadId(request: ServerRequest): string | null;
3840
- declare function serverNotificationThreadTarget(notification: ServerNotification): ServerNotificationThreadTarget;
3841
- declare function threadEventSnapshotHasStarted(snapshot: ThreadEventSnapshot | null): boolean;
3842
-
3843
- export { type RolloutItem as $, type AppendThreadItemsParams as A, type McpRuntimeEnvironment as B, type CreateThreadParams as C, type DynamicToolCallOutputContentItem$1 as D, type ExecPolicyAmendment as E, type McpServerStatusListOptions as F, type McpServerStatus as G, type McpResourceListParams as H, type McpResourceListResponse as I, type JsonValue as J, type McpResourceTemplateListResponse as K, type LoadThreadHistoryParams as L, type McpServerRefreshConfig as M, type NetworkPolicyAmendment as N, type McpResourceReadParams as O, type McpResourceReadResponse as P, type McpServerToolCallParams as Q, type ResumeThreadParams as R, type ServerNotification as S, type ThreadId as T, type UpdateThreadMetadataParams as U, type McpServerToolCallResponse as V, type McpToolInfo as W, type McpRequestId as X, type McpServerElicitationResponse as Y, type McpResourceInfo as Z, type McpResourceTemplateInfo as _, type ServerRequest as a, ThreadMemoryMode as a0, type ThreadMetadataPatch as a1, type ServiceTier as a2, type ReasoningEffortConfig as a3, type ReasoningSummaryConfig as a4, type Personality as a5, type AskForApproval as a6, type ApprovalsReviewer as a7, type SandboxPolicy as a8, type PermissionProfile as a9, type CompactedItem as aA, type ResponseItem as aB, type RateLimitSnapshot as aC, type TokenUsageInfo as aD, type TurnContextItem as aE, ModeKind as aF, type W3cTraceContext as aG, ThreadEventPersistenceMode as aH, ThreadHistoryBuilder as aI, asThreadId as aJ, deniedRequestPermissionsResponse as aK, type ThreadId$1 as aL, type AbsolutePathBuf as aM, type ThreadSource as aN, type UserInput$1 as aO, type ReasoningEffort$1 as aP, type WindowsSandboxSetupMode as aQ, type Thread as aR, type Turn$1 as aS, type RenderedThreadState as aT, createRenderedThreadState as aU, renderThreadFromHistory as aV, type ActivePermissionProfile as aa, type WindowsSandboxLevel as ab, BaseInstructions as ac, type SessionSource as ad, type TurnEnvironmentSelection as ae, type DynamicToolSpec as af, type TruncationPolicy as ag, type ThreadGoal as ah, ThreadGoalStatus as ai, HookEventName as aj, HookSource as ak, HookRunStatus as al, type HookOutputEntry as am, type HookRunSummary as an, type HookCompletedEvent as ao, type TokenUsage as ap, type RequestUserInputResponse as aq, type DynamicToolResponse as ar, type RequestPermissionsResponse as as, type RequestPermissionProfile as at, type EventMsg as au, type Op as av, type Submission as aw, type NormalizedRequestUserInputArgs as ax, type RequestPermissionsArgs as ay, type McpServerElicitationRequest as az, type StoredThreadHistory as b, type ReadThreadParams as c, type StoredThread as d, type ReadThreadByRolloutPathParams as e, type ListThreadsParams as f, type ThreadPage as g, type ArchiveThreadParams as h, type TextElement as i, type AdditionalNetworkPermissions as j, type AdditionalFileSystemPermissions as k, type RequestId as l, type ThreadEventSnapshot as m, ThreadEventStore as n, type ThreadTokenUsageSnapshot as o, serverRequestThreadId as p, type ToolRequestUserInputQuestion as q, type UserInput as r, serverNotificationThreadTarget as s, threadEventSnapshotHasStarted as t, type UserMessageTurnItem as u, type Turn as v, type CollaborationMode as w, type DynamicToolCallRequest as x, type RequestPermissionsEvent as y, type TurnItem as z };