@jrkropp/codex-js 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/dist/ClientNotification-B6-FhXQf.d.ts +5 -0
  4. package/dist/DynamicToolCallResponse-82DFjES2.d.ts +8 -0
  5. package/dist/DynamicToolSpec-CfnhqAYK.d.ts +29 -0
  6. package/dist/PermissionsRequestApprovalResponse-DxzPPDRb.d.ts +55 -0
  7. package/dist/ProviderStatusBanner-BlP6lzwE.d.ts +441 -0
  8. package/dist/ServerRequest-B5cKVJjr.d.ts +2181 -0
  9. package/dist/{session-DPhHN7RZ.d.ts → ThreadResumeResponse-DvmE1juU.d.ts} +3 -306
  10. package/dist/ToolRequestUserInputQuestion-CeZa5X1J.d.ts +23 -0
  11. package/dist/ToolRequestUserInputResponse-zcPLwbiK.d.ts +17 -0
  12. package/dist/TurnSteerResponse-0kBCfplh.d.ts +209 -0
  13. package/dist/WebSearchToolConfig-D3ep0625.d.ts +18 -0
  14. package/dist/chat-runtime-9RkXHC_w.d.ts +382 -0
  15. package/dist/chunk-2DZRMCI2.js +1258 -0
  16. package/dist/chunk-2DZRMCI2.js.map +1 -0
  17. package/dist/chunk-4DPLJPB5.js +396 -0
  18. package/dist/chunk-4DPLJPB5.js.map +1 -0
  19. package/dist/chunk-5JMJ6OI5.js +3 -0
  20. package/dist/chunk-5JMJ6OI5.js.map +1 -0
  21. package/dist/chunk-6ZMJ34KE.js +1153 -0
  22. package/dist/chunk-6ZMJ34KE.js.map +1 -0
  23. package/dist/chunk-CGBS37IU.js +128 -0
  24. package/dist/chunk-CGBS37IU.js.map +1 -0
  25. package/dist/chunk-DCMKA2A6.js +18 -0
  26. package/dist/chunk-DCMKA2A6.js.map +1 -0
  27. package/dist/chunk-DYLHN3HG.js +937 -0
  28. package/dist/chunk-DYLHN3HG.js.map +1 -0
  29. package/dist/{chunk-SVK6PLGO.js → chunk-LWQNX4LI.js} +12009 -18768
  30. package/dist/chunk-LWQNX4LI.js.map +1 -0
  31. package/dist/{chunk-JLDH4U5L.js → chunk-NCI4MAWZ.js} +317 -1967
  32. package/dist/chunk-NCI4MAWZ.js.map +1 -0
  33. package/dist/chunk-O44XP7LH.js +214 -0
  34. package/dist/chunk-O44XP7LH.js.map +1 -0
  35. package/dist/chunk-PST3ZWX2.js +555 -0
  36. package/dist/chunk-PST3ZWX2.js.map +1 -0
  37. package/dist/chunk-SYPHCDRD.js +1133 -0
  38. package/dist/chunk-SYPHCDRD.js.map +1 -0
  39. package/dist/chunk-V4BMZWBM.js +2401 -0
  40. package/dist/chunk-V4BMZWBM.js.map +1 -0
  41. package/dist/chunk-W7S6HFCQ.js +1983 -0
  42. package/dist/chunk-W7S6HFCQ.js.map +1 -0
  43. package/dist/chunk-YHVCFD2D.js +117 -0
  44. package/dist/chunk-YHVCFD2D.js.map +1 -0
  45. package/dist/chunk-Z63UPBS3.js +152 -0
  46. package/dist/chunk-Z63UPBS3.js.map +1 -0
  47. package/dist/client/index.d.ts +16 -4
  48. package/dist/client/index.js +13 -1
  49. package/dist/codex-rs/app-server/index.d.ts +161 -0
  50. package/dist/codex-rs/app-server/index.js +13 -0
  51. package/dist/codex-rs/app-server/index.js.map +1 -0
  52. package/dist/codex-rs/app-server-protocol/index.d.ts +1722 -0
  53. package/dist/codex-rs/app-server-protocol/index.js +6 -0
  54. package/dist/codex-rs/app-server-protocol/index.js.map +1 -0
  55. package/dist/codex-rs/app-server-protocol/protocol.d.ts +19 -0
  56. package/dist/codex-rs/app-server-protocol/protocol.js +4 -0
  57. package/dist/codex-rs/app-server-protocol/protocol.js.map +1 -0
  58. package/dist/codex-rs/codex-api/index.d.ts +104 -0
  59. package/dist/codex-rs/codex-api/index.js +11 -0
  60. package/dist/codex-rs/codex-api/index.js.map +1 -0
  61. package/dist/codex-rs/config/index.d.ts +88 -0
  62. package/dist/codex-rs/config/index.js +4 -0
  63. package/dist/codex-rs/config/index.js.map +1 -0
  64. package/dist/codex-rs/core/config/index.d.ts +61 -0
  65. package/dist/codex-rs/core/config/index.js +5 -0
  66. package/dist/codex-rs/core/config/index.js.map +1 -0
  67. package/dist/codex-rs/core/index.d.ts +1393 -0
  68. package/dist/codex-rs/core/index.js +11 -0
  69. package/dist/codex-rs/core/index.js.map +1 -0
  70. package/dist/codex-rs/model-provider/index.d.ts +2 -0
  71. package/dist/codex-rs/model-provider/index.js +4 -0
  72. package/dist/codex-rs/model-provider/index.js.map +1 -0
  73. package/dist/codex-rs/models-manager/index.d.ts +2 -0
  74. package/dist/codex-rs/models-manager/index.js +4 -0
  75. package/dist/codex-rs/models-manager/index.js.map +1 -0
  76. package/dist/codex-rs/parity.d.ts +26 -0
  77. package/dist/codex-rs/parity.js +3 -0
  78. package/dist/codex-rs/parity.js.map +1 -0
  79. package/dist/codex-rs/thread-store/index.d.ts +5 -0
  80. package/dist/codex-rs/thread-store/index.js +4 -0
  81. package/dist/codex-rs/thread-store/index.js.map +1 -0
  82. package/dist/codex-rs/unsupported.d.ts +15 -0
  83. package/dist/codex-rs/unsupported.js +22 -0
  84. package/dist/codex-rs/unsupported.js.map +1 -0
  85. package/dist/codex-rs/utils/output-truncation.d.ts +21 -0
  86. package/dist/codex-rs/utils/output-truncation.js +4 -0
  87. package/dist/codex-rs/utils/output-truncation.js.map +1 -0
  88. package/dist/codex-rs/utils/string.d.ts +7 -0
  89. package/dist/codex-rs/utils/string.js +3 -0
  90. package/dist/codex-rs/utils/string.js.map +1 -0
  91. package/dist/common-CTyph5x8.d.ts +40 -0
  92. package/dist/event-mapping-CbISdQ1D.d.ts +43 -0
  93. package/dist/history-CfM-4V7b.d.ts +1654 -0
  94. package/dist/index-77U_Oc-a.d.ts +63 -0
  95. package/dist/index-CoDZosq0.d.ts +261 -0
  96. package/dist/index.d.ts +18 -7
  97. package/dist/index.js +16 -2
  98. package/dist/lib-nXlaKiS-.d.ts +48 -0
  99. package/dist/live-thread-BMvlflzM.d.ts +30 -0
  100. package/dist/merge-B_AWVmnI.d.ts +24 -0
  101. package/dist/mod-DYVLSWO4.d.ts +91 -0
  102. package/dist/plan-mode-Cv6KWb_S.d.ts +14 -0
  103. package/dist/proposed-plan-DpN1ma0Y.d.ts +53 -0
  104. package/dist/protocol-mpBcYHrm.d.ts +1655 -0
  105. package/dist/react/index.d.ts +56 -48
  106. package/dist/react/index.js +16 -2
  107. package/dist/{remote-_6TDvg-g.d.ts → remote-ClZbq9KN.d.ts} +3 -1
  108. package/dist/rendered-thread-AOxw3V5b.d.ts +29 -0
  109. package/dist/responses_websocket-BhxSgCzK.d.ts +183 -0
  110. package/dist/runtime-Cm6ml53h.d.ts +528 -0
  111. package/dist/server/index.d.ts +29 -2416
  112. package/dist/server/index.js +13 -1
  113. package/dist/session-BRYzi8OT.d.ts +46 -0
  114. package/dist/shadcn/index.d.ts +1 -1
  115. package/dist/{sidebar-DT2XoitN.d.ts → sidebar-DMMij22z.d.ts} +1 -1
  116. package/dist/spec_plan_types-CmsJ-Tfn.d.ts +260 -0
  117. package/dist/{store-GYldc9EJ.d.ts → store-AGRxhgQ3.d.ts} +2 -1
  118. package/dist/t3code/apps/web/components/chat.d.ts +508 -0
  119. package/dist/t3code/apps/web/components/chat.js +12 -0
  120. package/dist/t3code/apps/web/components/chat.js.map +1 -0
  121. package/dist/t3code/apps/web/index.d.ts +12 -0
  122. package/dist/t3code/apps/web/index.js +13 -0
  123. package/dist/t3code/apps/web/index.js.map +1 -0
  124. package/dist/testing/index.d.ts +9 -91
  125. package/dist/testing/index.js +13 -1
  126. package/dist/thread-history-builder-zW0zeqcS.d.ts +58 -0
  127. package/dist/thread_event_store-C0zYzukG.d.ts +77 -0
  128. package/dist/types-BTeabLYr.d.ts +126 -0
  129. package/package.json +152 -88
  130. package/dist/chat-runtime-D7wu_KbX.d.ts +0 -747
  131. package/dist/chunk-JLDH4U5L.js.map +0 -1
  132. package/dist/chunk-SVK6PLGO.js.map +0 -1
  133. package/dist/index-CB9la6xE.d.ts +0 -112
  134. package/dist/thread_event_store-B9CoQUIA.d.ts +0 -3868
@@ -0,0 +1,214 @@
1
+ // src/upstream/codex-rs/core/src/protocol/dynamic_tools.ts
2
+ function dynamicToolSpecToWire(spec) {
3
+ return {
4
+ namespace: spec.namespace ?? null,
5
+ name: spec.name,
6
+ description: spec.description,
7
+ inputSchema: spec.input_schema,
8
+ deferLoading: spec.defer_loading ?? false
9
+ };
10
+ }
11
+ function dynamicToolSpecFromWire(spec) {
12
+ const deferLoading = spec.deferLoading !== void 0 ? spec.deferLoading : spec.exposeToContext === void 0 ? false : !spec.exposeToContext;
13
+ return {
14
+ namespace: spec.namespace ?? null,
15
+ name: spec.name,
16
+ description: spec.description,
17
+ input_schema: spec.inputSchema,
18
+ defer_loading: deferLoading
19
+ };
20
+ }
21
+
22
+ // src/upstream/codex-rs/core/src/models.ts
23
+ function responseInputToResponseItem(item) {
24
+ switch (item.type) {
25
+ case "message":
26
+ return {
27
+ type: "message",
28
+ ...item.id ? { id: item.id } : {},
29
+ role: item.role,
30
+ content: item.content,
31
+ ...item.phase ? { phase: item.phase } : {}
32
+ };
33
+ case "function_call_output":
34
+ return {
35
+ type: "function_call_output",
36
+ call_id: item.call_id,
37
+ output: item.output
38
+ };
39
+ case "custom_tool_call_output":
40
+ return {
41
+ type: "custom_tool_call_output",
42
+ call_id: item.call_id,
43
+ ...item.name ? { name: item.name } : {},
44
+ output: item.output
45
+ };
46
+ case "tool_search_output":
47
+ return {
48
+ type: "tool_search_output",
49
+ call_id: item.call_id,
50
+ status: item.status,
51
+ execution: item.execution,
52
+ tools: item.tools
53
+ };
54
+ case "mcp_tool_call_output":
55
+ return {
56
+ type: "function_call_output",
57
+ call_id: item.call_id,
58
+ output: mcpOutputAsFunctionCallOutputPayload(item.output)
59
+ };
60
+ }
61
+ }
62
+ function functionCallOutputPayloadToWire(output) {
63
+ if (output.body.type === "text") {
64
+ return output.body.text;
65
+ }
66
+ return output.body.items;
67
+ }
68
+ function mcpOutputAsFunctionCallOutputPayload(output) {
69
+ if (typeof output === "string") {
70
+ return {
71
+ body: {
72
+ type: "text",
73
+ text: output
74
+ },
75
+ success: null
76
+ };
77
+ }
78
+ return {
79
+ body: {
80
+ type: "text",
81
+ text: JSON.stringify(output) ?? String(output)
82
+ },
83
+ success: null
84
+ };
85
+ }
86
+
87
+ // src/upstream/codex-rs/core/src/protocol.ts
88
+ var BASE_INSTRUCTIONS_DEFAULT = `You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer.
89
+
90
+ ## General
91
+
92
+ - Prefer to be concise, direct, and useful.
93
+ - When asked to modify code, inspect the repository first and follow existing patterns.
94
+ - Do not make unrelated changes.
95
+ - If you run commands or edit files, summarize what changed and how you verified it.`;
96
+ var BaseInstructions = {
97
+ default() {
98
+ return { text: BASE_INSTRUCTIONS_DEFAULT };
99
+ }
100
+ };
101
+ var RealtimeVoicesList = {
102
+ builtin() {
103
+ return {
104
+ v1: [
105
+ "juniper",
106
+ "maple",
107
+ "spruce",
108
+ "ember",
109
+ "vale",
110
+ "breeze",
111
+ "arbor",
112
+ "sol",
113
+ "cove"
114
+ ],
115
+ v2: [
116
+ "alloy",
117
+ "ash",
118
+ "ballad",
119
+ "coral",
120
+ "echo",
121
+ "sage",
122
+ "shimmer",
123
+ "verse",
124
+ "marin",
125
+ "cedar"
126
+ ],
127
+ default_v1: "cove",
128
+ default_v2: "marin"
129
+ };
130
+ }
131
+ };
132
+ var AgentStatusWire = {
133
+ Running: "running",
134
+ Completed: "completed",
135
+ Failed: "failed",
136
+ Closed: "closed",
137
+ Cancelled: "cancelled"
138
+ };
139
+ var ThreadGoalStatus = {
140
+ Active: "active",
141
+ Paused: "paused",
142
+ BudgetLimited: "budgetLimited",
143
+ Complete: "complete"
144
+ };
145
+ var MAX_THREAD_GOAL_OBJECTIVE_CHARS = 4e3;
146
+ function validateThreadGoalObjective(value) {
147
+ if (value.length === 0) {
148
+ throw new Error("goal objective must not be empty");
149
+ }
150
+ if ([...value].length > MAX_THREAD_GOAL_OBJECTIVE_CHARS) {
151
+ throw new Error(
152
+ `goal objective must be at most ${MAX_THREAD_GOAL_OBJECTIVE_CHARS} characters`
153
+ );
154
+ }
155
+ }
156
+ var HookEventName = {
157
+ PreToolUse: "pre_tool_use",
158
+ PermissionRequest: "permission_request",
159
+ PostToolUse: "post_tool_use",
160
+ PreCompact: "pre_compact",
161
+ PostCompact: "post_compact",
162
+ SessionStart: "session_start",
163
+ UserPromptSubmit: "user_prompt_submit",
164
+ Stop: "stop"
165
+ };
166
+ var HookHandlerType = {
167
+ Command: "command",
168
+ Prompt: "prompt",
169
+ Agent: "agent"
170
+ };
171
+ var HookExecutionMode = {
172
+ Sync: "sync",
173
+ Async: "async"
174
+ };
175
+ var HookScope = {
176
+ Thread: "thread",
177
+ Turn: "turn"
178
+ };
179
+ var HookSource = {
180
+ System: "system",
181
+ User: "user",
182
+ Project: "project",
183
+ Mdm: "mdm",
184
+ SessionFlags: "session_flags",
185
+ Plugin: "plugin",
186
+ CloudRequirements: "cloud_requirements",
187
+ LegacyManagedConfigFile: "legacy_managed_config_file",
188
+ LegacyManagedConfigMdm: "legacy_managed_config_mdm",
189
+ Unknown: "unknown"
190
+ };
191
+ var HookTrustStatus = {
192
+ Managed: "managed",
193
+ Untrusted: "untrusted",
194
+ Trusted: "trusted",
195
+ Modified: "modified"
196
+ };
197
+ var HookRunStatus = {
198
+ Running: "running",
199
+ Completed: "completed",
200
+ Failed: "failed",
201
+ Blocked: "blocked",
202
+ Stopped: "stopped"
203
+ };
204
+ var HookOutputEntryKind = {
205
+ Warning: "warning",
206
+ Stop: "stop",
207
+ Feedback: "feedback",
208
+ Context: "context",
209
+ Error: "error"
210
+ };
211
+
212
+ export { AgentStatusWire, BASE_INSTRUCTIONS_DEFAULT, BaseInstructions, HookEventName, HookExecutionMode, HookHandlerType, HookOutputEntryKind, HookRunStatus, HookScope, HookSource, HookTrustStatus, MAX_THREAD_GOAL_OBJECTIVE_CHARS, RealtimeVoicesList, ThreadGoalStatus, dynamicToolSpecFromWire, dynamicToolSpecToWire, functionCallOutputPayloadToWire, responseInputToResponseItem, validateThreadGoalObjective };
213
+ //# sourceMappingURL=chunk-O44XP7LH.js.map
214
+ //# sourceMappingURL=chunk-O44XP7LH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/upstream/codex-rs/core/src/protocol/dynamic_tools.ts","../src/upstream/codex-rs/core/src/models.ts","../src/upstream/codex-rs/core/src/protocol.ts"],"names":[],"mappings":"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","file":"chunk-O44XP7LH.js","sourcesContent":["export type DynamicToolSpec = {\n\tnamespace?: string | null;\n\tname: string;\n\tdescription: string;\n\tinput_schema: unknown;\n\tdefer_loading?: boolean;\n};\n\nexport type DynamicToolCallRequest = {\n\tcall_id: string;\n\tturn_id: string;\n\tstarted_at_ms?: number;\n\tnamespace?: string | null;\n\ttool: string;\n\targuments: unknown;\n};\n\nexport type DynamicToolCallOutputContentItem =\n\t| { type: \"inputText\"; text: string }\n\t| { type: \"inputImage\"; imageUrl: string };\n\nexport type DynamicToolResponse = {\n\tcontent_items: DynamicToolCallOutputContentItem[];\n\tsuccess: boolean;\n};\n\nexport type DynamicToolCallResponseEvent = {\n\tcall_id: string;\n\tturn_id: string;\n\tcompleted_at_ms?: number;\n\tnamespace?: string | null;\n\ttool: string;\n\targuments: unknown;\n\tcontent_items: DynamicToolCallOutputContentItem[];\n\tsuccess: boolean;\n\terror?: string | null;\n\tduration: string;\n};\n\nexport type DynamicToolSpecWire = {\n\tnamespace?: string | null;\n\tname: string;\n\tdescription: string;\n\tinputSchema: unknown;\n\tdeferLoading?: boolean;\n\texposeToContext?: boolean;\n};\n\nexport function dynamicToolSpecToWire(\n\tspec: DynamicToolSpec,\n): DynamicToolSpecWire {\n\treturn {\n\t\tnamespace: spec.namespace ?? null,\n\t\tname: spec.name,\n\t\tdescription: spec.description,\n\t\tinputSchema: spec.input_schema,\n\t\tdeferLoading: spec.defer_loading ?? false,\n\t};\n}\n\nexport function dynamicToolSpecFromWire(\n\tspec: DynamicToolSpecWire,\n): DynamicToolSpec {\n\tconst deferLoading =\n\t\tspec.deferLoading !== undefined\n\t\t\t? spec.deferLoading\n\t\t\t: spec.exposeToContext === undefined\n\t\t\t\t? false\n\t\t\t\t: !spec.exposeToContext;\n\n\treturn {\n\t\tnamespace: spec.namespace ?? null,\n\t\tname: spec.name,\n\t\tdescription: spec.description,\n\t\tinput_schema: spec.inputSchema,\n\t\tdefer_loading: deferLoading,\n\t};\n}\n","export type MessagePhase = \"commentary\" | \"final_answer\";\n\nexport type ContentItem =\n\t| { type: \"input_text\"; text: string }\n\t| { type: \"input_image\"; image_url: string; detail?: string | null }\n\t| { type: \"output_text\"; text: string };\n\nexport type FunctionCallOutputContentItem =\n\t| { type: \"input_text\"; text: string }\n\t| { type: \"input_image\"; image_url: string; detail?: string | null };\n\nexport type FunctionCallOutputBody =\n\t| { type: \"text\"; text: string }\n\t| { type: \"content_items\"; items: FunctionCallOutputContentItem[] };\n\nexport type FunctionCallOutputPayload = {\n\tbody: FunctionCallOutputBody;\n\tsuccess?: boolean | null;\n};\n\nexport type MessageResponseInputItem = {\n\ttype: \"message\";\n\tid?: string;\n\trole: string;\n\tcontent: ContentItem[];\n\tphase?: MessagePhase | null;\n};\n\nexport type FunctionCallOutputResponseInputItem = {\n\ttype: \"function_call_output\";\n\tcall_id: string;\n\toutput: FunctionCallOutputPayload;\n};\n\nexport type CustomToolCallOutputResponseInputItem = {\n\ttype: \"custom_tool_call_output\";\n\tcall_id: string;\n\tname?: string | null;\n\toutput: FunctionCallOutputPayload;\n};\n\nexport type McpToolCallOutputResponseInputItem = {\n\ttype: \"mcp_tool_call_output\";\n\tcall_id: string;\n\toutput: unknown;\n};\n\nexport type ToolSearchOutputResponseInputItem = {\n\ttype: \"tool_search_output\";\n\tcall_id: string;\n\tstatus: \"completed\";\n\texecution: \"client\";\n\ttools: unknown[];\n};\n\nexport type ResponseInputItem =\n\t| MessageResponseInputItem\n\t| FunctionCallOutputResponseInputItem\n\t| CustomToolCallOutputResponseInputItem\n\t| McpToolCallOutputResponseInputItem\n\t| ToolSearchOutputResponseInputItem;\n\nexport type ResponseMessageItem = {\n\ttype: \"message\";\n\tid?: string;\n\trole: string;\n\tcontent: ContentItem[];\n\tphase?: MessagePhase | null;\n};\n\nexport type ReasoningItemReasoningSummary = Record<string, unknown>;\nexport type ReasoningItemContent = Record<string, unknown>;\n\nexport type ResponseReasoningItem = {\n\ttype: \"reasoning\";\n\tid?: string;\n\tsummary: ReasoningItemReasoningSummary[];\n\tcontent?: ReasoningItemContent[] | null;\n\tencrypted_content?: string | null;\n};\n\nexport type ResponseLocalShellCallItem = {\n\ttype: \"local_shell_call\";\n\tid?: string | null;\n\tcall_id?: string | null;\n\tstatus?: string | null;\n\taction: Record<string, unknown>;\n};\n\nexport type ResponseFunctionCallItem = {\n\ttype: \"function_call\";\n\tid?: string | null;\n\tname: string;\n\tnamespace?: string | null;\n\targuments: string;\n\tcall_id: string;\n};\n\nexport type ResponseToolSearchCallItem = {\n\ttype: \"tool_search_call\";\n\tid?: string | null;\n\tcall_id?: string | null;\n\tstatus?: string | null;\n\texecution: string;\n\targuments: unknown;\n};\n\nexport type ResponseFunctionCallOutputItem = {\n\ttype: \"function_call_output\";\n\tcall_id: string;\n\toutput: FunctionCallOutputPayload;\n};\n\nexport type ResponseCustomToolCallItem = {\n\ttype: \"custom_tool_call\";\n\tid?: string | null;\n\tstatus?: string | null;\n\tcall_id: string;\n\tname: string;\n\tinput: string;\n};\n\nexport type ResponseCustomToolCallOutputItem = {\n\ttype: \"custom_tool_call_output\";\n\tcall_id: string;\n\tname?: string | null;\n\toutput: FunctionCallOutputPayload;\n};\n\nexport type ResponseToolSearchOutputItem = {\n\ttype: \"tool_search_output\";\n\tcall_id?: string | null;\n\tstatus: string;\n\texecution: string;\n\ttools: unknown[];\n};\n\nexport type ResponseWebSearchCallItem = {\n\ttype: \"web_search_call\";\n\tid?: string | null;\n\tstatus?: string | null;\n\taction?: Record<string, unknown> | null;\n};\n\nexport type ResponseImageGenerationCallItem = {\n\ttype: \"image_generation_call\";\n\tid: string;\n\tstatus: string;\n\trevised_prompt?: string | null;\n\tresult: string;\n\tsaved_path?: string;\n};\n\nexport type ResponseCompactionItem = {\n\ttype: \"compaction\" | \"context_compaction\";\n\tencrypted_content?: string | null;\n};\n\nexport type ResponseOtherItem = {\n\ttype: \"other\";\n};\n\nexport type ResponseItem =\n\t| ResponseMessageItem\n\t| ResponseReasoningItem\n\t| ResponseLocalShellCallItem\n\t| ResponseFunctionCallItem\n\t| ResponseToolSearchCallItem\n\t| ResponseFunctionCallOutputItem\n\t| ResponseCustomToolCallItem\n\t| ResponseCustomToolCallOutputItem\n\t| ResponseToolSearchOutputItem\n\t| ResponseWebSearchCallItem\n\t| ResponseImageGenerationCallItem\n\t| ResponseCompactionItem\n\t| ResponseOtherItem;\n\nexport type ResponseItemWire =\n\t| (Omit<ResponseMessageItem, \"phase\"> & { phase?: MessagePhase | null })\n\t| ResponseReasoningItem\n\t| ResponseLocalShellCallItem\n\t| ResponseFunctionCallItem\n\t| ResponseToolSearchCallItem\n\t| (Omit<ResponseFunctionCallOutputItem, \"output\"> & {\n\t\t\toutput: string | FunctionCallOutputContentItem[];\n\t })\n\t| ResponseCustomToolCallItem\n\t| (Omit<ResponseCustomToolCallOutputItem, \"output\"> & {\n\t\t\toutput: string | FunctionCallOutputContentItem[];\n\t })\n\t| ResponseToolSearchOutputItem\n\t| ResponseWebSearchCallItem\n\t| ResponseImageGenerationCallItem\n\t| ResponseCompactionItem\n\t| ResponseOtherItem;\n\nexport function responseInputToResponseItem(\n\titem: ResponseInputItem,\n): ResponseItem {\n\tswitch (item.type) {\n\t\tcase \"message\":\n\t\t\treturn {\n\t\t\t\ttype: \"message\",\n\t\t\t\t...(item.id ? { id: item.id } : {}),\n\t\t\t\trole: item.role,\n\t\t\t\tcontent: item.content,\n\t\t\t\t...(item.phase ? { phase: item.phase } : {}),\n\t\t\t};\n\t\tcase \"function_call_output\":\n\t\t\treturn {\n\t\t\t\ttype: \"function_call_output\",\n\t\t\t\tcall_id: item.call_id,\n\t\t\t\toutput: item.output,\n\t\t\t};\n\t\tcase \"custom_tool_call_output\":\n\t\t\treturn {\n\t\t\t\ttype: \"custom_tool_call_output\",\n\t\t\t\tcall_id: item.call_id,\n\t\t\t\t...(item.name ? { name: item.name } : {}),\n\t\t\t\toutput: item.output,\n\t\t\t};\n\t\tcase \"tool_search_output\":\n\t\t\treturn {\n\t\t\t\ttype: \"tool_search_output\",\n\t\t\t\tcall_id: item.call_id,\n\t\t\t\tstatus: item.status,\n\t\t\t\texecution: item.execution,\n\t\t\t\ttools: item.tools,\n\t\t\t};\n\t\tcase \"mcp_tool_call_output\":\n\t\t\treturn {\n\t\t\t\ttype: \"function_call_output\",\n\t\t\t\tcall_id: item.call_id,\n\t\t\t\toutput: mcpOutputAsFunctionCallOutputPayload(item.output),\n\t\t\t};\n\t}\n}\n\nexport function functionCallOutputPayloadToWire(\n\toutput: FunctionCallOutputPayload,\n): string | FunctionCallOutputContentItem[] {\n\tif (output.body.type === \"text\") {\n\t\treturn output.body.text;\n\t}\n\n\treturn output.body.items;\n}\n\nfunction mcpOutputAsFunctionCallOutputPayload(output: unknown): FunctionCallOutputPayload {\n\tif (typeof output === \"string\") {\n\t\treturn {\n\t\t\tbody: {\n\t\t\t\ttype: \"text\",\n\t\t\t\ttext: output,\n\t\t\t},\n\t\t\tsuccess: null,\n\t\t};\n\t}\n\n\treturn {\n\t\tbody: {\n\t\t\ttype: \"text\",\n\t\t\ttext: JSON.stringify(output) ?? String(output),\n\t\t},\n\t\tsuccess: null,\n\t};\n}\n","import type { CollaborationMode } from \"./config-types\";\nimport type { ThreadId } from \"./ids\";\nimport type { TurnItem } from \"./items\";\nimport type { FileChange } from \"./items\";\nimport type { ExecToolCallOutput } from \"./exec-output\";\nimport type {\n\tMemoryCitation,\n\tThreadMemoryMode,\n\tThreadMemoryModeSessionMetaValue,\n} from \"./memory\";\nimport type {\n\tRequestUserInputEvent,\n\tRequestUserInputResponse,\n} from \"./request_user_input\";\nimport type {\n\tRequestPermissionsEvent,\n\tRequestPermissionsResponse,\n} from \"./request_permissions\";\nimport type {\n\tMcpServerElicitationRequestEvent,\n\tMcpServerElicitationResponseOp,\n\tMcpServerOauthLoginCompletedEvent,\n\tMcpServerStatusUpdatedEvent,\n\tMcpToolCallProgressEvent,\n} from \"./mcp\";\nimport type {\n\tDynamicToolCallRequest,\n\tDynamicToolCallResponseEvent,\n\tDynamicToolResponse,\n\tDynamicToolSpec,\n} from \"./protocol/dynamic_tools\";\nimport type { TextElement, UserInput } from \"./protocol/user_input\";\nimport type { ResponseItem } from \"./models\";\n\nexport type {\n\tDynamicToolCallOutputContentItem,\n\tDynamicToolCallRequest,\n\tDynamicToolCallResponseEvent,\n\tDynamicToolResponse,\n\tDynamicToolSpec,\n} from \"./protocol/dynamic_tools\";\nexport {\n\tdynamicToolSpecFromWire,\n\tdynamicToolSpecToWire,\n} from \"./protocol/dynamic_tools\";\nexport type {\n\tByteRange,\n\tMentionInput,\n\tTextElement,\n\tUserInput,\n} from \"./protocol/user_input\";\nexport type {\n\tContentItem,\n\tFunctionCallOutputBody,\n\tFunctionCallOutputContentItem,\n\tFunctionCallOutputPayload,\n\tMessagePhase,\n\tResponseInputItem,\n\tResponseItem,\n\tResponseItemWire,\n} from \"./models\";\nexport {\n\tfunctionCallOutputPayloadToWire,\n\tresponseInputToResponseItem,\n} from \"./models\";\n\nexport type W3cTraceContext = {\n\ttraceparent?: string;\n\ttracestate?: string;\n};\n\nexport type Submission = {\n\tid: string;\n\top: Op;\n\ttrace?: W3cTraceContext;\n};\n\nexport type BaseInstructions = {\n\ttext: string;\n};\n\nexport const BASE_INSTRUCTIONS_DEFAULT = `You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer.\n\n## General\n\n- Prefer to be concise, direct, and useful.\n- When asked to modify code, inspect the repository first and follow existing patterns.\n- Do not make unrelated changes.\n- If you run commands or edit files, summarize what changed and how you verified it.`;\n\nexport const BaseInstructions = {\n\tdefault(): BaseInstructions {\n\t\treturn { text: BASE_INSTRUCTIONS_DEFAULT };\n\t},\n};\nexport type TokenUsage = {\n\tinput_tokens: number;\n\tcached_input_tokens: number;\n\toutput_tokens: number;\n\treasoning_output_tokens: number;\n\ttotal_tokens: number;\n};\n\nexport type TokenUsageInfo = {\n\ttotal_token_usage: TokenUsage;\n\tlast_token_usage: TokenUsage;\n\tmodel_context_window?: number | null;\n};\n\nexport type RateLimitWindow = {\n\tremaining?: number | null;\n\tlimit?: number | null;\n\treset_seconds?: number | null;\n\t[key: string]: unknown;\n};\n\nexport type RateLimitSnapshot = {\n\tlimit_id?: string | null;\n\tprimary?: RateLimitWindow | null;\n\tsecondary?: RateLimitWindow | null;\n\tcredits?: Record<string, unknown> | null;\n\tplan_type?: string | null;\n\t[key: string]: unknown;\n};\nexport type SessionSource = string;\nexport type ReasoningEffortConfig = string;\nexport type ReasoningSummaryConfig = string;\nexport type AskForApproval = string;\nexport type ApprovalsReviewer = string;\nexport type SandboxPolicy = Record<string, unknown>;\nexport type PermissionProfile = Record<string, unknown>;\nexport type ActivePermissionProfile = Record<string, unknown>;\nexport type PermissionProfileBuiltinName =\n\t| \":read-only\"\n\t| \":workspace\"\n\t| \":danger-no-sandbox\";\nexport type WindowsSandboxLevel = string;\nexport type ServiceTier = string;\nexport type Personality = string;\nexport type TurnEnvironmentSelection = {\n\tenvironment_id: string;\n\tcwd: string;\n};\nexport type TurnContextNetworkItem = {\n\tallowed_domains: string[];\n\tdenied_domains: string[];\n};\nexport type FileSystemSandboxPolicy = Record<string, unknown>;\nexport type TruncationPolicy = Record<string, unknown>;\nexport type GitInfo = Record<string, unknown>;\nexport type McpInvocation = Record<string, unknown>;\n\nexport type UserTurnOp = {\n\ttype: \"user_turn\";\n\titems: UserInput[];\n\tcwd: string;\n\tapproval_policy: AskForApproval;\n\tapprovals_reviewer?: ApprovalsReviewer | null;\n\tsandbox_policy: SandboxPolicy;\n\tpermission_profile?: PermissionProfile | null;\n\tmodel: string;\n\teffort?: ReasoningEffortConfig;\n\tsummary?: ReasoningSummaryConfig;\n\tservice_tier?: ServiceTier | null;\n\tfinal_output_json_schema?: unknown;\n\tcollaboration_mode?: CollaborationMode;\n\tpersonality?: Personality;\n\tenvironments?: TurnEnvironmentSelection[];\n};\n\nexport type UserInputOp = {\n\ttype: \"user_input\";\n\titems: UserInput[];\n\tenvironments?: TurnEnvironmentSelection[];\n\tfinal_output_json_schema?: unknown;\n\tresponsesapi_client_metadata?: Record<string, string>;\n};\n\nexport type UserInputWithTurnContextOp = {\n\ttype: \"user_input_with_turn_context\";\n\titems: UserInput[];\n\tfinal_output_json_schema?: unknown;\n\tresponsesapi_client_metadata?: Record<string, string>;\n\tcwd?: string;\n\tapproval_policy?: AskForApproval;\n\tapprovals_reviewer?: ApprovalsReviewer;\n\tsandbox_policy?: SandboxPolicy;\n\tpermission_profile?: PermissionProfile;\n\tactive_permission_profile?: ActivePermissionProfile;\n\twindows_sandbox_level?: WindowsSandboxLevel;\n\tmodel?: string;\n\teffort?: ReasoningEffortConfig | null;\n\tsummary?: ReasoningSummaryConfig;\n\tservice_tier?: ServiceTier | null;\n\tcollaboration_mode?: CollaborationMode;\n\tpersonality?: Personality;\n\tenvironments?: TurnEnvironmentSelection[];\n};\n\nexport type OverrideTurnContextOp = {\n\ttype: \"override_turn_context\";\n\tcwd?: string;\n\tapproval_policy?: AskForApproval;\n\tapprovals_reviewer?: ApprovalsReviewer | null;\n\tsandbox_policy?: SandboxPolicy;\n\tpermission_profile?: PermissionProfile | null;\n\tactive_permission_profile?: ActivePermissionProfile | null;\n\twindows_sandbox_level?: WindowsSandboxLevel;\n\tmodel?: string;\n\teffort?: ReasoningEffortConfig | null;\n\tsummary?: ReasoningSummaryConfig;\n\tservice_tier?: ServiceTier | null;\n\tcollaboration_mode?: CollaborationMode;\n\tpersonality?: Personality | null;\n\tenvironments?: TurnEnvironmentSelection[];\n};\n\nexport type UserInputAnswerOp = {\n\ttype: \"user_input_answer\";\n\tid: string;\n\tresponse: RequestUserInputResponse;\n};\n\nexport type RequestPermissionsResponseOp = {\n\ttype: \"request_permissions_response\";\n\tid: string;\n\tresponse: RequestPermissionsResponse;\n};\n\nexport type DynamicToolResponseOp = {\n\ttype: \"dynamic_tool_response\";\n\tid: string;\n\tresponse: DynamicToolResponse;\n};\n\nexport type RealtimeOutputModality = \"text\" | \"audio\";\n\nexport type RealtimeVoice =\n\t| \"alloy\"\n\t| \"arbor\"\n\t| \"ash\"\n\t| \"ballad\"\n\t| \"breeze\"\n\t| \"cedar\"\n\t| \"coral\"\n\t| \"cove\"\n\t| \"echo\"\n\t| \"ember\"\n\t| \"juniper\"\n\t| \"maple\"\n\t| \"marin\"\n\t| \"sage\"\n\t| \"shimmer\"\n\t| \"sol\"\n\t| \"spruce\"\n\t| \"vale\"\n\t| \"verse\";\n\nexport type RealtimeVoicesList = {\n\tv1: RealtimeVoice[];\n\tv2: RealtimeVoice[];\n\tdefault_v1: RealtimeVoice;\n\tdefault_v2: RealtimeVoice;\n};\n\nexport const RealtimeVoicesList = {\n\tbuiltin(): RealtimeVoicesList {\n\t\treturn {\n\t\t\tv1: [\n\t\t\t\t\"juniper\",\n\t\t\t\t\"maple\",\n\t\t\t\t\"spruce\",\n\t\t\t\t\"ember\",\n\t\t\t\t\"vale\",\n\t\t\t\t\"breeze\",\n\t\t\t\t\"arbor\",\n\t\t\t\t\"sol\",\n\t\t\t\t\"cove\",\n\t\t\t],\n\t\t\tv2: [\n\t\t\t\t\"alloy\",\n\t\t\t\t\"ash\",\n\t\t\t\t\"ballad\",\n\t\t\t\t\"coral\",\n\t\t\t\t\"echo\",\n\t\t\t\t\"sage\",\n\t\t\t\t\"shimmer\",\n\t\t\t\t\"verse\",\n\t\t\t\t\"marin\",\n\t\t\t\t\"cedar\",\n\t\t\t],\n\t\t\tdefault_v1: \"cove\",\n\t\t\tdefault_v2: \"marin\",\n\t\t};\n\t},\n};\n\nexport type ConversationStartTransport =\n\t| {\n\t\t\ttype: \"websocket\";\n\t }\n\t| {\n\t\t\ttype: \"webrtc\";\n\t\t\tsdp: string;\n\t };\n\nexport type ConversationStartParams = {\n\toutput_modality: RealtimeOutputModality;\n\tprompt?: string | null;\n\trealtime_session_id?: string | null;\n\ttransport?: ConversationStartTransport | null;\n\tvoice?: RealtimeVoice | null;\n};\n\nexport type RealtimeAudioFrame = {\n\tdata: string;\n\tsample_rate: number;\n\tnum_channels: number;\n\tsamples_per_channel?: number | null;\n\titem_id?: string | null;\n};\n\nexport type RealtimeTranscriptDelta = {\n\tdelta: string;\n};\n\nexport type RealtimeTranscriptDone = {\n\ttext: string;\n};\n\nexport type RealtimeTranscriptEntry = {\n\trole: string;\n\ttext: string;\n};\n\nexport type RealtimeHandoffRequested = {\n\thandoff_id: string;\n\titem_id: string;\n\tinput_transcript: string;\n\tactive_transcript: RealtimeTranscriptEntry[];\n};\n\nexport type RealtimeNoopRequested = {\n\tcall_id: string;\n\titem_id: string;\n};\n\nexport type RealtimeInputAudioSpeechStarted = {\n\titem_id?: string | null;\n};\n\nexport type RealtimeResponseLifecycle = {\n\tresponse_id?: string | null;\n};\n\nexport type RealtimeEvent =\n\t| {\n\t\t\ttype: \"session_updated\";\n\t\t\trealtime_session_id: string;\n\t\t\tinstructions?: string | null;\n\t }\n\t| ({\n\t\t\ttype: \"input_audio_speech_started\";\n\t } & RealtimeInputAudioSpeechStarted)\n\t| ({\n\t\t\ttype: \"input_transcript_delta\";\n\t } & RealtimeTranscriptDelta)\n\t| ({\n\t\t\ttype: \"input_transcript_done\";\n\t } & RealtimeTranscriptDone)\n\t| ({\n\t\t\ttype: \"output_transcript_delta\";\n\t } & RealtimeTranscriptDelta)\n\t| ({\n\t\t\ttype: \"output_transcript_done\";\n\t } & RealtimeTranscriptDone)\n\t| ({\n\t\t\ttype: \"audio_out\";\n\t } & RealtimeAudioFrame)\n\t| ({\n\t\t\ttype: \"response_created\";\n\t } & RealtimeResponseLifecycle)\n\t| ({\n\t\t\ttype: \"response_cancelled\";\n\t } & RealtimeResponseLifecycle)\n\t| ({\n\t\t\ttype: \"response_done\";\n\t } & RealtimeResponseLifecycle)\n\t| {\n\t\t\ttype: \"conversation_item_added\";\n\t\t\titem: unknown;\n\t }\n\t| {\n\t\t\ttype: \"conversation_item_done\";\n\t\t\titem_id: string;\n\t }\n\t| ({\n\t\t\ttype: \"handoff_requested\";\n\t } & RealtimeHandoffRequested)\n\t| ({\n\t\t\ttype: \"noop_requested\";\n\t } & RealtimeNoopRequested)\n\t| {\n\t\t\ttype: \"error\";\n\t\t\tmessage: string;\n\t };\n\nexport type ConversationAudioParams = {\n\tframe: RealtimeAudioFrame;\n};\n\nexport type ConversationTextParams = {\n\ttext: string;\n};\n\nexport type ThreadRealtimeStartParams = ConversationStartParams & {\n\tthread_id: ThreadId;\n};\n\nexport type ThreadRealtimeStartResponse = Record<never, never>;\n\nexport type ThreadRealtimeAppendAudioParams = ConversationAudioParams & {\n\tthread_id: ThreadId;\n};\n\nexport type ThreadRealtimeAppendAudioResponse = Record<never, never>;\n\nexport type ThreadRealtimeAppendTextParams = ConversationTextParams & {\n\tthread_id: ThreadId;\n};\n\nexport type ThreadRealtimeAppendTextResponse = Record<never, never>;\n\nexport type ThreadRealtimeStopParams = {\n\tthread_id: ThreadId;\n};\n\nexport type ThreadRealtimeStopResponse = Record<never, never>;\n\nexport type ThreadRealtimeListVoicesParams = Record<never, never>;\n\nexport type ThreadRealtimeListVoicesResponse = {\n\tvoices: RealtimeVoicesList;\n};\n\nexport type RealtimeConversationStartOp = {\n\ttype: \"realtime_conversation_start\";\n} & ConversationStartParams;\n\nexport type RealtimeConversationAudioOp = {\n\ttype: \"realtime_conversation_audio\";\n} & ConversationAudioParams;\n\nexport type RealtimeConversationTextOp = {\n\ttype: \"realtime_conversation_text\";\n} & ConversationTextParams;\n\nexport type RealtimeConversationCloseOp = {\n\ttype: \"realtime_conversation_close\";\n};\n\nexport type RealtimeConversationListVoicesOp = {\n\ttype: \"realtime_conversation_list_voices\";\n};\n\nexport type AgentPathWire = string;\n\nexport const AgentStatusWire = {\n\tRunning: \"running\",\n\tCompleted: \"completed\",\n\tFailed: \"failed\",\n\tClosed: \"closed\",\n\tCancelled: \"cancelled\",\n} as const;\n\nexport type AgentStatusWire =\n\t(typeof AgentStatusWire)[keyof typeof AgentStatusWire];\n\nexport type SubAgentSource =\n\t| {\n\t\t\ttype: \"thread_spawn\";\n\t\t\tparent_thread_id: ThreadId;\n\t\t\tdepth: number;\n\t\t\tagent_path?: AgentPathWire | null;\n\t\t\tagent_role?: string | null;\n\t }\n\t| {\n\t\t\ttype: \"other\";\n\t\t\tvalue: string;\n\t };\n\nexport type InterAgentCommunicationWire = {\n\tauthor: AgentPathWire;\n\trecipient: AgentPathWire;\n\titems?: unknown[];\n\tcontent: string;\n\ttrigger_turn: boolean;\n\tseq?: number;\n};\n\nexport type CollabAgentRef = {\n\tthread_id?: ThreadId | null;\n\tagent_path?: AgentPathWire | null;\n\tagent_nickname?: string | null;\n\tagent_role?: string | null;\n};\n\nexport type CollabAgentSpawnBeginEvent = {\n\tturn_id: string;\n\tcall_id: string;\n\ttask?: string | null;\n};\n\nexport type CollabAgentSpawnEndEvent = {\n\tturn_id: string;\n\tcall_id: string;\n\tagent?: CollabAgentRef | null;\n\terror?: string | null;\n};\n\nexport type CollabAgentInteractionBeginEvent = {\n\tturn_id: string;\n\tcall_id: string;\n\ttarget: CollabAgentRef;\n};\n\nexport type CollabAgentInteractionEndEvent = {\n\tturn_id: string;\n\tcall_id: string;\n\ttarget: CollabAgentRef;\n\terror?: string | null;\n};\n\nexport type CollabWaitingBeginEvent = {\n\tturn_id: string;\n\tcall_id: string;\n\ttargets: CollabAgentRef[];\n};\n\nexport type CollabWaitingEndEvent = {\n\tturn_id: string;\n\tcall_id: string;\n\tstatuses?: Record<string, AgentStatusWire>;\n\terror?: string | null;\n};\n\nexport type CollabResumeBeginEvent = {\n\tturn_id: string;\n\tcall_id: string;\n\ttarget: CollabAgentRef;\n};\n\nexport type CollabResumeEndEvent = CollabAgentInteractionEndEvent;\n\nexport type CollabCloseBeginEvent = CollabAgentInteractionBeginEvent;\n\nexport type CollabCloseEndEvent = CollabAgentInteractionEndEvent;\n\nexport type CompactOp = {\n\ttype: \"compact\";\n};\n\nexport type SetThreadNameOp = {\n\ttype: \"set_thread_name\";\n\tname: string;\n};\n\nexport type SetThreadMemoryModeOp = {\n\ttype: \"set_thread_memory_mode\";\n\tmode: ThreadMemoryMode;\n};\n\nexport type ThreadRollbackOp = {\n\ttype: \"thread_rollback\";\n\tnum_turns: number;\n};\n\nexport type InterruptOp = {\n\ttype: \"interrupt\";\n};\n\nexport type ShutdownOp = {\n\ttype: \"shutdown\";\n};\n\nexport type Op =\n\t| UserTurnOp\n\t| UserInputOp\n\t| UserInputWithTurnContextOp\n\t| OverrideTurnContextOp\n\t| UserInputAnswerOp\n\t| RequestPermissionsResponseOp\n\t| DynamicToolResponseOp\n\t| McpServerElicitationResponseOp\n\t| RealtimeConversationStartOp\n\t| RealtimeConversationAudioOp\n\t| RealtimeConversationTextOp\n\t| RealtimeConversationCloseOp\n\t| RealtimeConversationListVoicesOp\n\t| CompactOp\n\t| SetThreadNameOp\n\t| SetThreadMemoryModeOp\n\t| ThreadRollbackOp\n\t| InterruptOp\n\t| ShutdownOp;\n\nexport type ErrorEvent = {\n\tmessage: string;\n\tcodex_error_info?: unknown;\n};\n\nexport type WarningEvent = {\n\tmessage: string;\n};\n\nexport type TurnStartedEvent = {\n\tturn_id: string;\n\tstarted_at?: number | null;\n\tmodel_context_window?: number | null;\n\tcollaboration_mode_kind?: CollaborationMode[\"mode\"];\n};\n\nexport type TurnCompleteEvent = {\n\tturn_id: string;\n\tlast_agent_message?: string | null;\n\tcompleted_at?: number | null;\n\tduration_ms?: number | null;\n\ttime_to_first_token_ms?: number | null;\n};\n\nexport type TurnAbortReason = \"interrupted\";\n\nexport type TurnAbortedEvent = {\n\tturn_id: string;\n\treason: TurnAbortReason;\n\taborted_at?: number | null;\n\tcompleted_at?: number | null;\n\tduration_ms?: number | null;\n};\n\nexport type AgentMessageEvent = {\n\tmessage: string;\n\tphase?: string | null;\n\tmemory_citation?: MemoryCitation | null;\n};\n\nexport type UserMessageEvent = {\n\tmessage: string;\n\timages?: string[] | null;\n\tlocal_images?: string[];\n\ttext_elements?: TextElement[];\n};\n\nexport type RawResponseItemEvent = {\n\titem: ResponseItem;\n};\n\nexport type ItemStartedEvent = {\n\tturn_id?: string;\n\titem: TurnItem;\n};\n\nexport type ItemCompletedEvent = {\n\tturn_id?: string;\n\titem: TurnItem;\n};\n\nexport type ExecCommandStatus = \"completed\" | \"failed\" | \"cancelled\";\n\nexport type ExecCommandBeginEvent = {\n\tcall_id: string;\n\tprocess_id?: string | null;\n\tturn_id: string;\n\tstarted_at_ms: number;\n\tcommand: string[];\n\tcwd: string;\n\tparsed_cmd?: unknown[] | null;\n\tsource?: string | null;\n\tinteraction_input?: string | null;\n};\n\nexport type ExecCommandOutputDeltaEvent = {\n\tcall_id: string;\n\tturn_id?: string;\n\tstream: \"stdout\" | \"stderr\";\n\tchunk: string;\n};\n\nexport type TerminalInteractionEvent = {\n\tcall_id: string;\n\tprocess_id?: string | null;\n\tstdin: string;\n};\n\nexport type ExecCommandEndEvent = {\n\tcall_id: string;\n\tturn_id?: string;\n\tprocess_id?: string | null;\n\tcompleted_at_ms: number;\n\texit_code: number;\n\tstatus: ExecCommandStatus;\n\tduration_ms?: number | null;\n\tstdout?: string | null;\n\tstderr?: string | null;\n\toutput?: ExecToolCallOutput | null;\n};\n\nexport type PatchApplyUpdatedEvent = {\n\tcall_id: string;\n\tturn_id?: string;\n\tchanges: Record<string, FileChange>;\n\tstatus?: \"completed\" | \"failed\" | \"declined\" | null;\n\tstdout?: string | null;\n\tstderr?: string | null;\n};\n\nexport type CommandApprovalRequestEvent = {\n\tcall_id: string;\n\tcommand: string[];\n\tcwd: string;\n\treason?: string | null;\n};\n\nexport type FileChangeApprovalRequestEvent = {\n\tcall_id: string;\n\tchanges: Record<string, FileChange>;\n\treason?: string | null;\n};\n\nexport type AgentMessageContentDeltaEvent = {\n\tthread_id: string;\n\tturn_id: string;\n\titem_id: string;\n\tdelta: string;\n};\n\nexport type PlanDeltaEvent = {\n\tthread_id: string;\n\tturn_id: string;\n\titem_id: string;\n\tdelta: string;\n};\n\nexport type UpdatePlanStepStatus = \"pending\" | \"in_progress\" | \"completed\";\n\nexport type UpdatePlanStep = {\n\tstep: string;\n\tstatus: UpdatePlanStepStatus;\n};\n\nexport type UpdatePlanArgs = {\n\texplanation?: string | null;\n\tplan: UpdatePlanStep[];\n};\n\nexport type ImageGenerationBeginEvent = {\n\tcall_id: string;\n};\n\nexport type ImageGenerationEndEvent = {\n\tcall_id: string;\n\tstatus: string;\n\trevised_prompt?: string;\n\tresult: string;\n\tsaved_path?: string;\n};\n\nexport type ContextCompactedEvent = Record<never, never>;\n\nexport type ThreadRolledBackEvent = {\n\tnum_turns: number;\n};\n\nexport type TokenCountEvent = {\n\tinfo?: TokenUsageInfo | null;\n\trate_limits?: RateLimitSnapshot | null;\n};\n\nexport const ThreadGoalStatus = {\n\tActive: \"active\",\n\tPaused: \"paused\",\n\tBudgetLimited: \"budgetLimited\",\n\tComplete: \"complete\",\n} as const;\n\nexport type ThreadGoalStatus =\n\t(typeof ThreadGoalStatus)[keyof typeof ThreadGoalStatus];\n\nexport const MAX_THREAD_GOAL_OBJECTIVE_CHARS = 4_000;\n\nexport function validateThreadGoalObjective(value: string): void {\n\tif (value.length === 0) {\n\t\tthrow new Error(\"goal objective must not be empty\");\n\t}\n\tif ([...value].length > MAX_THREAD_GOAL_OBJECTIVE_CHARS) {\n\t\tthrow new Error(\n\t\t\t`goal objective must be at most ${MAX_THREAD_GOAL_OBJECTIVE_CHARS} characters`,\n\t\t);\n\t}\n}\n\nexport type ThreadGoal = {\n\tthread_id: ThreadId;\n\tobjective: string;\n\tstatus: ThreadGoalStatus;\n\ttoken_budget?: number | null;\n\ttokens_used: number;\n\ttime_used_seconds: number;\n\tcreated_at: number;\n\tupdated_at: number;\n};\n\nexport type ThreadGoalUpdatedEvent = {\n\tthread_id: ThreadId;\n\tturn_id?: string | null;\n\tgoal: ThreadGoal;\n};\n\nexport type McpToolCallBeginEvent = {\n\tcall_id: string;\n\tinvocation: McpInvocation;\n\tmcp_app_resource_uri?: string;\n};\n\nexport type McpToolCallEndEvent = {\n\tcall_id: string;\n\tinvocation: McpInvocation;\n\tmcp_app_resource_uri?: string;\n\tduration: string;\n\tresult: unknown;\n};\n\nexport type McpToolCallProgressEventMsg = {\n\ttype: \"mcp_tool_call_progress\";\n} & McpToolCallProgressEvent;\n\nexport type McpServerStatusUpdatedEventMsg = {\n\ttype: \"mcp_server_status_updated\";\n} & McpServerStatusUpdatedEvent;\n\nexport type McpServerOauthLoginCompletedEventMsg = {\n\ttype: \"mcp_server_oauth_login_completed\";\n} & McpServerOauthLoginCompletedEvent;\n\nexport type McpServerElicitationRequestEventMsg = {\n\ttype: \"mcp_server_elicitation_request\";\n} & McpServerElicitationRequestEvent;\n\nexport const HookEventName = {\n\tPreToolUse: \"pre_tool_use\",\n\tPermissionRequest: \"permission_request\",\n\tPostToolUse: \"post_tool_use\",\n\tPreCompact: \"pre_compact\",\n\tPostCompact: \"post_compact\",\n\tSessionStart: \"session_start\",\n\tUserPromptSubmit: \"user_prompt_submit\",\n\tStop: \"stop\",\n} as const;\n\nexport type HookEventName = (typeof HookEventName)[keyof typeof HookEventName];\n\nexport const HookHandlerType = {\n\tCommand: \"command\",\n\tPrompt: \"prompt\",\n\tAgent: \"agent\",\n} as const;\n\nexport type HookHandlerType =\n\t(typeof HookHandlerType)[keyof typeof HookHandlerType];\n\nexport const HookExecutionMode = {\n\tSync: \"sync\",\n\tAsync: \"async\",\n} as const;\n\nexport type HookExecutionMode =\n\t(typeof HookExecutionMode)[keyof typeof HookExecutionMode];\n\nexport const HookScope = {\n\tThread: \"thread\",\n\tTurn: \"turn\",\n} as const;\n\nexport type HookScope = (typeof HookScope)[keyof typeof HookScope];\n\nexport const HookSource = {\n\tSystem: \"system\",\n\tUser: \"user\",\n\tProject: \"project\",\n\tMdm: \"mdm\",\n\tSessionFlags: \"session_flags\",\n\tPlugin: \"plugin\",\n\tCloudRequirements: \"cloud_requirements\",\n\tLegacyManagedConfigFile: \"legacy_managed_config_file\",\n\tLegacyManagedConfigMdm: \"legacy_managed_config_mdm\",\n\tUnknown: \"unknown\",\n} as const;\n\nexport type HookSource = (typeof HookSource)[keyof typeof HookSource];\n\nexport const HookTrustStatus = {\n\tManaged: \"managed\",\n\tUntrusted: \"untrusted\",\n\tTrusted: \"trusted\",\n\tModified: \"modified\",\n} as const;\n\nexport type HookTrustStatus =\n\t(typeof HookTrustStatus)[keyof typeof HookTrustStatus];\n\nexport const HookRunStatus = {\n\tRunning: \"running\",\n\tCompleted: \"completed\",\n\tFailed: \"failed\",\n\tBlocked: \"blocked\",\n\tStopped: \"stopped\",\n} as const;\n\nexport type HookRunStatus = (typeof HookRunStatus)[keyof typeof HookRunStatus];\n\nexport const HookOutputEntryKind = {\n\tWarning: \"warning\",\n\tStop: \"stop\",\n\tFeedback: \"feedback\",\n\tContext: \"context\",\n\tError: \"error\",\n} as const;\n\nexport type HookOutputEntryKind =\n\t(typeof HookOutputEntryKind)[keyof typeof HookOutputEntryKind];\n\nexport type HookOutputEntry = {\n\tkind: HookOutputEntryKind;\n\ttext: string;\n};\n\nexport type HookRunSummary = {\n\tid: string;\n\tevent_name: HookEventName;\n\thandler_type: HookHandlerType;\n\texecution_mode: HookExecutionMode;\n\tscope: HookScope;\n\tsource_path: string;\n\tsource: HookSource;\n\tdisplay_order: number;\n\tstatus: HookRunStatus;\n\tstatus_message?: string | null;\n\tstarted_at: number;\n\tcompleted_at?: number | null;\n\tduration_ms?: number | null;\n\tentries: HookOutputEntry[];\n};\n\nexport type HookStartedEvent = {\n\tturn_id?: string | null;\n\trun: HookRunSummary;\n};\n\nexport type HookCompletedEvent = {\n\tturn_id?: string | null;\n\trun: HookRunSummary;\n};\n\nexport type RealtimeConversationVersion = \"v1\" | \"v2\";\n\nexport type RealtimeConversationStartedEvent = {\n\trealtime_session_id?: string | null;\n\tversion: RealtimeConversationVersion;\n};\n\nexport type RealtimeConversationRealtimeEvent = {\n\tpayload: RealtimeEvent;\n};\n\nexport type RealtimeConversationClosedEvent = {\n\treason?: string | null;\n};\n\nexport type RealtimeConversationSdpEvent = {\n\tsdp: string;\n};\n\nexport type RealtimeConversationListVoicesResponseEvent = {\n\tvoices: RealtimeVoicesList;\n};\n\n/** Codex Rust variant: `TurnStarted`; v1 wire value: `turn_started`. */\nexport type TurnStartedEventMsg = {\n\ttype: \"turn_started\";\n} & TurnStartedEvent;\n\n/** Codex Rust variant: `TurnComplete`; v1 wire value: `turn_complete`. */\nexport type TurnCompleteEventMsg = {\n\ttype: \"turn_complete\";\n} & TurnCompleteEvent;\n\n/** Codex Rust variant: `TurnAborted`; v1 wire value: `turn_aborted`. */\nexport type TurnAbortedEventMsg = {\n\ttype: \"turn_aborted\";\n} & TurnAbortedEvent;\n\nexport type AgentMessageEventMsg = {\n\ttype: \"agent_message\";\n} & AgentMessageEvent;\n\nexport type UserMessageEventMsg = {\n\ttype: \"user_message\";\n} & UserMessageEvent;\n\nexport type RawResponseItemEventMsg = {\n\ttype: \"raw_response_item\";\n} & RawResponseItemEvent;\n\nexport type ItemStartedEventMsg = {\n\ttype: \"item_started\";\n} & ItemStartedEvent;\n\nexport type ItemCompletedEventMsg = {\n\ttype: \"item_completed\";\n} & ItemCompletedEvent;\n\nexport type ExecCommandBeginEventMsg = {\n\ttype: \"exec_command_begin\";\n} & ExecCommandBeginEvent;\n\nexport type ExecCommandOutputDeltaEventMsg = {\n\ttype: \"exec_command_output_delta\";\n} & ExecCommandOutputDeltaEvent;\n\nexport type TerminalInteractionEventMsg = {\n\ttype: \"terminal_interaction\";\n} & TerminalInteractionEvent;\n\nexport type ExecCommandEndEventMsg = {\n\ttype: \"exec_command_end\";\n} & ExecCommandEndEvent;\n\nexport type PatchApplyUpdatedEventMsg = {\n\ttype: \"patch_apply_updated\";\n} & PatchApplyUpdatedEvent;\n\nexport type CommandApprovalRequestEventMsg = {\n\ttype: \"command_approval_request\";\n} & CommandApprovalRequestEvent;\n\nexport type FileChangeApprovalRequestEventMsg = {\n\ttype: \"file_change_approval_request\";\n} & FileChangeApprovalRequestEvent;\n\nexport type AgentMessageContentDeltaEventMsg = {\n\ttype: \"agent_message_content_delta\";\n} & AgentMessageContentDeltaEvent;\n\n/** Codex Rust variant: `PlanDelta`; v1 wire value: `plan_delta`. */\nexport type PlanDeltaEventMsg = {\n\ttype: \"plan_delta\";\n} & PlanDeltaEvent;\n\nexport type PlanUpdateEventMsg = {\n\ttype: \"plan_update\";\n} & UpdatePlanArgs;\n\nexport type RequestUserInputEventMsg = {\n\ttype: \"request_user_input\";\n} & RequestUserInputEvent;\n\nexport type RequestPermissionsEventMsg = {\n\ttype: \"request_permissions\";\n} & RequestPermissionsEvent;\n\nexport type DynamicToolCallRequestEventMsg = {\n\ttype: \"dynamic_tool_call_request\";\n} & DynamicToolCallRequest;\n\nexport type DynamicToolCallResponseEventMsg = {\n\ttype: \"dynamic_tool_call_response\";\n} & DynamicToolCallResponseEvent;\n\nexport type ImageGenerationBeginEventMsg = {\n\ttype: \"image_generation_begin\";\n} & ImageGenerationBeginEvent;\n\nexport type ImageGenerationEndEventMsg = {\n\ttype: \"image_generation_end\";\n} & ImageGenerationEndEvent;\n\nexport type ContextCompactedEventMsg = {\n\ttype: \"context_compacted\";\n} & ContextCompactedEvent;\n\nexport type ThreadRolledBackEventMsg = {\n\ttype: \"thread_rolled_back\";\n} & ThreadRolledBackEvent;\n\nexport type TokenCountEventMsg = {\n\ttype: \"token_count\";\n} & TokenCountEvent;\n\nexport type ThreadGoalUpdatedEventMsg = {\n\ttype: \"thread_goal_updated\";\n} & ThreadGoalUpdatedEvent;\n\nexport type WarningEventMsg = {\n\ttype: \"warning\";\n} & WarningEvent;\n\nexport type ErrorEventMsg = {\n\ttype: \"error\";\n} & ErrorEvent;\n\nexport type HookStartedEventMsg = {\n\ttype: \"hook_started\";\n} & HookStartedEvent;\n\nexport type HookCompletedEventMsg = {\n\ttype: \"hook_completed\";\n} & HookCompletedEvent;\n\nexport type RealtimeConversationStartedEventMsg = {\n\ttype: \"realtime_conversation_started\";\n} & RealtimeConversationStartedEvent;\n\nexport type RealtimeConversationRealtimeEventMsg = {\n\ttype: \"realtime_conversation_realtime\";\n} & RealtimeConversationRealtimeEvent;\n\nexport type RealtimeConversationClosedEventMsg = {\n\ttype: \"realtime_conversation_closed\";\n} & RealtimeConversationClosedEvent;\n\nexport type RealtimeConversationSdpEventMsg = {\n\ttype: \"realtime_conversation_sdp\";\n} & RealtimeConversationSdpEvent;\n\nexport type RealtimeConversationListVoicesResponseEventMsg = {\n\ttype: \"realtime_conversation_list_voices_response\";\n} & RealtimeConversationListVoicesResponseEvent;\n\nexport type SessionConfiguredEvent = {\n\tsession_id: string;\n\tthread_id: ThreadId;\n\tforked_from_id?: ThreadId | null;\n\tthread_source?: string | null;\n\tthread_name?: string | null;\n\tmodel: string;\n\tmodel_provider_id: string;\n\tservice_tier?: ServiceTier | null;\n\tapproval_policy: AskForApproval;\n\tapprovals_reviewer?: ApprovalsReviewer | null;\n\tpermission_profile: PermissionProfile;\n\tactive_permission_profile?: ActivePermissionProfile | null;\n\tcwd: string;\n\treasoning_effort?: ReasoningEffortConfig | null;\n\tinitial_messages?: EventMsg[] | null;\n\tnetwork_proxy?: unknown | null;\n\trollout_path?: string | null;\n};\n\nexport type SessionConfiguredEventMsg = {\n\ttype: \"session_configured\";\n} & SessionConfiguredEvent;\n\nexport type EventMsg =\n\t| SessionConfiguredEventMsg\n\t| TurnStartedEventMsg\n\t| TurnCompleteEventMsg\n\t| TurnAbortedEventMsg\n\t| AgentMessageEventMsg\n\t| UserMessageEventMsg\n\t| RawResponseItemEventMsg\n\t| ItemStartedEventMsg\n\t| ItemCompletedEventMsg\n\t| ExecCommandBeginEventMsg\n\t| ExecCommandOutputDeltaEventMsg\n\t| TerminalInteractionEventMsg\n\t| ExecCommandEndEventMsg\n\t| PatchApplyUpdatedEventMsg\n\t| CommandApprovalRequestEventMsg\n\t| FileChangeApprovalRequestEventMsg\n\t| AgentMessageContentDeltaEventMsg\n\t| PlanDeltaEventMsg\n\t| PlanUpdateEventMsg\n\t| RequestUserInputEventMsg\n\t| RequestPermissionsEventMsg\n\t| DynamicToolCallRequestEventMsg\n\t| DynamicToolCallResponseEventMsg\n\t| McpToolCallProgressEventMsg\n\t| McpServerStatusUpdatedEventMsg\n\t| McpServerOauthLoginCompletedEventMsg\n\t| McpServerElicitationRequestEventMsg\n\t| ImageGenerationBeginEventMsg\n\t| ImageGenerationEndEventMsg\n\t| ContextCompactedEventMsg\n\t| ThreadRolledBackEventMsg\n\t| TokenCountEventMsg\n\t| ThreadGoalUpdatedEventMsg\n\t| WarningEventMsg\n\t| HookStartedEventMsg\n\t| HookCompletedEventMsg\n\t| RealtimeConversationStartedEventMsg\n\t| RealtimeConversationRealtimeEventMsg\n\t| RealtimeConversationClosedEventMsg\n\t| RealtimeConversationSdpEventMsg\n\t| RealtimeConversationListVoicesResponseEventMsg\n\t| ErrorEventMsg;\n\nexport type SessionMeta = {\n\tid: ThreadId;\n\tforked_from_id?: ThreadId | null;\n\ttimestamp: string;\n\tcwd: string;\n\toriginator: string;\n\tcli_version: string;\n\tsource: SessionSource;\n\tagent_nickname?: string | null;\n\tagent_role?: string | null;\n\tagent_path?: string | null;\n\tmodel_provider: string | null;\n\tbase_instructions: BaseInstructions | null;\n\tdynamic_tools?: DynamicToolSpec[] | null;\n\tmemory_mode?: ThreadMemoryModeSessionMetaValue | null;\n};\n\nexport type SessionMetaLine = SessionMeta & {\n\tgit?: GitInfo | null;\n};\n\nexport type CompactedItem = {\n\tmessage: string;\n\treplacement_history?: ResponseItem[];\n};\n\nexport type TurnContextItem = {\n\tturn_id?: string;\n\ttrace_id?: string;\n\tcwd: string;\n\tcurrent_date?: string;\n\ttimezone?: string;\n\tapproval_policy: AskForApproval;\n\tsandbox_policy: SandboxPolicy;\n\tpermission_profile?: PermissionProfile | null;\n\twindows_sandbox_level?: WindowsSandboxLevel | null;\n\tnetwork?: TurnContextNetworkItem | null;\n\tfile_system_sandbox_policy?: FileSystemSandboxPolicy | null;\n\tmodel: string;\n\tpersonality?: Personality | null;\n\tcollaboration_mode?: CollaborationMode | null;\n\trealtime_active?: boolean | null;\n\teffort?: ReasoningEffortConfig | null;\n\tsummary: ReasoningSummaryConfig;\n\tuser_instructions?: string | null;\n\tdeveloper_instructions?: string | null;\n\tfinal_output_json_schema?: unknown;\n\ttruncation_policy?: TruncationPolicy | null;\n};\n\nexport type SessionMetaRolloutItem = {\n\ttype: \"session_meta\";\n\tpayload: SessionMetaLine;\n};\n\nexport type ResponseRolloutItem = {\n\ttype: \"response_item\";\n\tpayload: ResponseItem;\n};\n\nexport type CompactedRolloutItem = {\n\ttype: \"compacted\";\n\tpayload: CompactedItem;\n};\n\nexport type TurnContextRolloutItem = {\n\ttype: \"turn_context\";\n\tpayload: TurnContextItem;\n};\n\nexport type EventMsgRolloutItem = {\n\ttype: \"event_msg\";\n\tpayload: EventMsg;\n};\n\nexport type RolloutItem =\n\t| SessionMetaRolloutItem\n\t| ResponseRolloutItem\n\t| CompactedRolloutItem\n\t| TurnContextRolloutItem\n\t| EventMsgRolloutItem;\n"]}