@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 909 lines 56 KB
Raw
1 import * as CodexSchema from "./schema.gen.ts";
2
3 export const CLIENT_REQUEST_METHODS = {
4 initialize: "initialize",
5 "thread/start": "thread/start",
6 "thread/resume": "thread/resume",
7 "thread/fork": "thread/fork",
8 "thread/archive": "thread/archive",
9 "thread/delete": "thread/delete",
10 "thread/unsubscribe": "thread/unsubscribe",
11 "thread/name/set": "thread/name/set",
12 "thread/goal/set": "thread/goal/set",
13 "thread/goal/get": "thread/goal/get",
14 "thread/goal/clear": "thread/goal/clear",
15 "thread/metadata/update": "thread/metadata/update",
16 "thread/attachment/add": "thread/attachment/add",
17 "thread/attachment/list": "thread/attachment/list",
18 "thread/attachment/remove": "thread/attachment/remove",
19 "thread/section/move": "thread/section/move",
20 "thread/unarchive": "thread/unarchive",
21 "thread/compact/start": "thread/compact/start",
22 "thread/shellCommand": "thread/shellCommand",
23 "thread/approveGuardianDeniedAction": "thread/approveGuardianDeniedAction",
24 "thread/revert": "thread/revert",
25 "thread/list": "thread/list",
26 "threadSection/list": "threadSection/list",
27 "threadSection/create": "threadSection/create",
28 "threadSection/update": "threadSection/update",
29 "threadSection/delete": "threadSection/delete",
30 "thread/loaded/list": "thread/loaded/list",
31 "thread/read": "thread/read",
32 "thread/turns/list": "thread/turns/list",
33 "thread/items/list": "thread/items/list",
34 "thread/inject_items": "thread/inject_items",
35 "skills/list": "skills/list",
36 "skills/extraRoots/set": "skills/extraRoots/set",
37 "hooks/list": "hooks/list",
38 "marketplace/add": "marketplace/add",
39 "marketplace/remove": "marketplace/remove",
40 "marketplace/upgrade": "marketplace/upgrade",
41 "plugin/list": "plugin/list",
42 "plugin/installed": "plugin/installed",
43 "plugin/reconcile": "plugin/reconcile",
44 "plugin/read": "plugin/read",
45 "plugin/skill/read": "plugin/skill/read",
46 "plugin/share/save": "plugin/share/save",
47 "plugin/share/updateTargets": "plugin/share/updateTargets",
48 "plugin/share/list": "plugin/share/list",
49 "plugin/share/checkout": "plugin/share/checkout",
50 "plugin/share/delete": "plugin/share/delete",
51 "app/read": "app/read",
52 "app/list": "app/list",
53 "app/installed": "app/installed",
54 "fs/readFile": "fs/readFile",
55 "fs/writeFile": "fs/writeFile",
56 "fs/createDirectory": "fs/createDirectory",
57 "fs/getMetadata": "fs/getMetadata",
58 "fs/readDirectory": "fs/readDirectory",
59 "fs/remove": "fs/remove",
60 "fs/copy": "fs/copy",
61 "fs/watch": "fs/watch",
62 "fs/unwatch": "fs/unwatch",
63 "skills/config/write": "skills/config/write",
64 "plugin/install": "plugin/install",
65 "plugin/uninstall": "plugin/uninstall",
66 "turn/start": "turn/start",
67 "turn/steer": "turn/steer",
68 "turn/interrupt": "turn/interrupt",
69 "review/start": "review/start",
70 "model/list": "model/list",
71 "account/gatewayOAuth/read": "account/gatewayOAuth/read",
72 "account/gatewayOAuth/login": "account/gatewayOAuth/login",
73 "account/gatewayOAuth/cancel": "account/gatewayOAuth/cancel",
74 "modelProvider/capabilities/read": "modelProvider/capabilities/read",
75 "experimentalFeature/list": "experimentalFeature/list",
76 "permissionProfile/list": "permissionProfile/list",
77 "experimentalFeature/enablement/set": "experimentalFeature/enablement/set",
78 "mcpServer/oauth/login": "mcpServer/oauth/login",
79 "config/mcpServer/reload": "config/mcpServer/reload",
80 "mcpServerStatus/list": "mcpServerStatus/list",
81 "mcpServer/resource/read": "mcpServer/resource/read",
82 "mcpServer/tool/call": "mcpServer/tool/call",
83 "windowsSandbox/setupStart": "windowsSandbox/setupStart",
84 "windowsSandbox/readiness": "windowsSandbox/readiness",
85 "account/login/start": "account/login/start",
86 "account/login/cancel": "account/login/cancel",
87 "account/logout": "account/logout",
88 "account/rateLimits/read": "account/rateLimits/read",
89 "account/rateLimitResetCredit/consume": "account/rateLimitResetCredit/consume",
90 "account/usage/read": "account/usage/read",
91 "account/workspaceMessages/read": "account/workspaceMessages/read",
92 "account/sendAddCreditsNudgeEmail": "account/sendAddCreditsNudgeEmail",
93 "feedback/upload": "feedback/upload",
94 "command/exec": "command/exec",
95 "command/exec/write": "command/exec/write",
96 "command/exec/terminate": "command/exec/terminate",
97 "command/exec/resize": "command/exec/resize",
98 "config/read": "config/read",
99 "externalAgentConfig/detect": "externalAgentConfig/detect",
100 "externalAgentConfig/import": "externalAgentConfig/import",
101 "externalAgentConfig/import/recordHistory": "externalAgentConfig/import/recordHistory",
102 "externalAgentConfig/import/readHistories": "externalAgentConfig/import/readHistories",
103 "config/value/write": "config/value/write",
104 "config/batchWrite": "config/batchWrite",
105 "configRequirements/read": "configRequirements/read",
106 "account/read": "account/read",
107 getConversationSummary: "getConversationSummary",
108 gitDiffToRemote: "gitDiffToRemote",
109 getAuthStatus: "getAuthStatus",
110 fuzzyFileSearch: "fuzzyFileSearch",
111 "thread/settings/update": "thread/settings/update",
112 } as const;
113
114 export const CLIENT_NOTIFICATION_METHODS = {
115 initialized: "initialized",
116 } as const;
117
118 export const SERVER_REQUEST_METHODS = {
119 "item/commandExecution/requestApproval": "item/commandExecution/requestApproval",
120 "item/fileChange/requestApproval": "item/fileChange/requestApproval",
121 "item/tool/requestUserInput": "item/tool/requestUserInput",
122 "mcpServer/elicitation/request": "mcpServer/elicitation/request",
123 "item/permissions/requestApproval": "item/permissions/requestApproval",
124 "item/tool/call": "item/tool/call",
125 "account/chatgptAuthTokens/refresh": "account/chatgptAuthTokens/refresh",
126 "attestation/generate": "attestation/generate",
127 applyPatchApproval: "applyPatchApproval",
128 execCommandApproval: "execCommandApproval",
129 } as const;
130
131 export const SERVER_NOTIFICATION_METHODS = {
132 error: "error",
133 "thread/started": "thread/started",
134 "thread/status/changed": "thread/status/changed",
135 "thread/archived": "thread/archived",
136 "thread/deleted": "thread/deleted",
137 "thread/unarchived": "thread/unarchived",
138 "thread/closed": "thread/closed",
139 "thread/reverted": "thread/reverted",
140 "skills/changed": "skills/changed",
141 "thread/name/updated": "thread/name/updated",
142 "thread/attachment/updated": "thread/attachment/updated",
143 "thread/goal/updated": "thread/goal/updated",
144 "thread/goal/cleared": "thread/goal/cleared",
145 "thread/queue/changed": "thread/queue/changed",
146 "project/changed": "project/changed",
147 "thread/project/updated": "thread/project/updated",
148 "thread/environment/connected": "thread/environment/connected",
149 "thread/environment/disconnected": "thread/environment/disconnected",
150 "thread/settings/updated": "thread/settings/updated",
151 "thread/tokenUsage/updated": "thread/tokenUsage/updated",
152 "turn/started": "turn/started",
153 "hook/started": "hook/started",
154 "turn/completed": "turn/completed",
155 "hook/completed": "hook/completed",
156 "turn/diff/updated": "turn/diff/updated",
157 "turn/plan/updated": "turn/plan/updated",
158 "item/started": "item/started",
159 "item/autoApprovalReview/started": "item/autoApprovalReview/started",
160 "item/autoApprovalReview/completed": "item/autoApprovalReview/completed",
161 "autoApprovalReview/strictReviewRequired": "autoApprovalReview/strictReviewRequired",
162 "item/completed": "item/completed",
163 "rawResponseItem/completed": "rawResponseItem/completed",
164 "rawResponse/completed": "rawResponse/completed",
165 "item/agentMessage/delta": "item/agentMessage/delta",
166 "item/plan/delta": "item/plan/delta",
167 "command/exec/outputDelta": "command/exec/outputDelta",
168 "process/outputDelta": "process/outputDelta",
169 "process/exited": "process/exited",
170 "item/commandExecution/outputDelta": "item/commandExecution/outputDelta",
171 "item/commandExecution/terminalInteraction": "item/commandExecution/terminalInteraction",
172 "item/fileChange/outputDelta": "item/fileChange/outputDelta",
173 "item/fileChange/patchUpdated": "item/fileChange/patchUpdated",
174 "serverRequest/resolved": "serverRequest/resolved",
175 "item/mcpToolCall/progress": "item/mcpToolCall/progress",
176 "mcpServer/oauthLogin/completed": "mcpServer/oauthLogin/completed",
177 "mcpServer/startupStatus/updated": "mcpServer/startupStatus/updated",
178 "mcpServer/event/stream/notification": "mcpServer/event/stream/notification",
179 "account/updated": "account/updated",
180 "account/gatewayOAuth/changed": "account/gatewayOAuth/changed",
181 "account/rateLimits/updated": "account/rateLimits/updated",
182 "app/list/updated": "app/list/updated",
183 "remoteControl/status/changed": "remoteControl/status/changed",
184 "externalAgentConfig/import/progress": "externalAgentConfig/import/progress",
185 "externalAgentConfig/import/completed": "externalAgentConfig/import/completed",
186 "fs/changed": "fs/changed",
187 "item/reasoning/summaryTextDelta": "item/reasoning/summaryTextDelta",
188 "item/reasoning/summaryPartAdded": "item/reasoning/summaryPartAdded",
189 "item/reasoning/textDelta": "item/reasoning/textDelta",
190 "thread/compacted": "thread/compacted",
191 "model/rerouted": "model/rerouted",
192 "model/verification": "model/verification",
193 "modelProvider/authRecoveryStarted": "modelProvider/authRecoveryStarted",
194 "modelProvider/authRecoveryCompleted": "modelProvider/authRecoveryCompleted",
195 "turn/moderationMetadata": "turn/moderationMetadata",
196 "model/safetyBuffering/updated": "model/safetyBuffering/updated",
197 warning: "warning",
198 guardianWarning: "guardianWarning",
199 deprecationNotice: "deprecationNotice",
200 configWarning: "configWarning",
201 "fuzzyFileSearch/sessionUpdated": "fuzzyFileSearch/sessionUpdated",
202 "fuzzyFileSearch/sessionCompleted": "fuzzyFileSearch/sessionCompleted",
203 "thread/realtime/started": "thread/realtime/started",
204 "thread/realtime/itemAdded": "thread/realtime/itemAdded",
205 "thread/realtime/item/started": "thread/realtime/item/started",
206 "thread/realtime/item/transcript/delta": "thread/realtime/item/transcript/delta",
207 "thread/realtime/item/completed": "thread/realtime/item/completed",
208 "thread/realtime/transcript/delta": "thread/realtime/transcript/delta",
209 "thread/realtime/transcript/done": "thread/realtime/transcript/done",
210 "thread/realtime/outputAudio/delta": "thread/realtime/outputAudio/delta",
211 "thread/realtime/sdp": "thread/realtime/sdp",
212 "thread/realtime/error": "thread/realtime/error",
213 "thread/realtime/closed": "thread/realtime/closed",
214 "windows/worldWritableWarning": "windows/worldWritableWarning",
215 "windowsSandbox/setupCompleted": "windowsSandbox/setupCompleted",
216 "account/login/completed": "account/login/completed",
217 } as const;
218
219 export type ClientRequestMethod = keyof typeof CLIENT_REQUEST_METHODS;
220 export type ClientNotificationMethod = keyof typeof CLIENT_NOTIFICATION_METHODS;
221 export type ServerRequestMethod = keyof typeof SERVER_REQUEST_METHODS;
222 export type ServerNotificationMethod = keyof typeof SERVER_NOTIFICATION_METHODS;
223
224 export interface ClientRequestParamsByMethod {
225 readonly initialize: CodexSchema.V1InitializeParams;
226 readonly "thread/start": CodexSchema.V2ThreadStartParams;
227 readonly "thread/resume": CodexSchema.V2ThreadResumeParams;
228 readonly "thread/fork": CodexSchema.V2ThreadForkParams;
229 readonly "thread/archive": CodexSchema.V2ThreadArchiveParams;
230 readonly "thread/delete": CodexSchema.V2ThreadDeleteParams;
231 readonly "thread/unsubscribe": CodexSchema.V2ThreadUnsubscribeParams;
232 readonly "thread/name/set": CodexSchema.V2ThreadSetNameParams;
233 readonly "thread/goal/set": CodexSchema.V2ThreadGoalSetParams;
234 readonly "thread/goal/get": CodexSchema.V2ThreadGoalGetParams;
235 readonly "thread/goal/clear": CodexSchema.V2ThreadGoalClearParams;
236 readonly "thread/metadata/update": CodexSchema.V2ThreadMetadataUpdateParams;
237 readonly "thread/attachment/add": CodexSchema.V2ThreadAttachmentAddParams;
238 readonly "thread/attachment/list": CodexSchema.V2ThreadAttachmentListParams;
239 readonly "thread/attachment/remove": CodexSchema.V2ThreadAttachmentRemoveParams;
240 readonly "thread/section/move": CodexSchema.V2ThreadSectionMoveParams;
241 readonly "thread/unarchive": CodexSchema.V2ThreadUnarchiveParams;
242 readonly "thread/compact/start": CodexSchema.V2ThreadCompactStartParams;
243 readonly "thread/shellCommand": CodexSchema.V2ThreadShellCommandParams;
244 readonly "thread/approveGuardianDeniedAction": CodexSchema.V2ThreadApproveGuardianDeniedActionParams;
245 readonly "thread/revert": CodexSchema.V2ThreadRevertParams;
246 readonly "thread/list": CodexSchema.V2ThreadListParams;
247 readonly "threadSection/list": CodexSchema.V2ThreadSectionListParams;
248 readonly "threadSection/create": CodexSchema.V2ThreadSectionCreateParams;
249 readonly "threadSection/update": CodexSchema.V2ThreadSectionUpdateParams;
250 readonly "threadSection/delete": CodexSchema.V2ThreadSectionDeleteParams;
251 readonly "thread/loaded/list": CodexSchema.V2ThreadLoadedListParams;
252 readonly "thread/read": CodexSchema.V2ThreadReadParams;
253 readonly "thread/turns/list": CodexSchema.V2ThreadTurnsListParams;
254 readonly "thread/items/list": CodexSchema.V2ThreadItemsListParams;
255 readonly "thread/inject_items": CodexSchema.V2ThreadInjectItemsParams;
256 readonly "skills/list": CodexSchema.V2SkillsListParams;
257 readonly "skills/extraRoots/set": CodexSchema.V2SkillsExtraRootsSetParams;
258 readonly "hooks/list": CodexSchema.V2HooksListParams;
259 readonly "marketplace/add": CodexSchema.V2MarketplaceAddParams;
260 readonly "marketplace/remove": CodexSchema.V2MarketplaceRemoveParams;
261 readonly "marketplace/upgrade": CodexSchema.V2MarketplaceUpgradeParams;
262 readonly "plugin/list": CodexSchema.V2PluginListParams;
263 readonly "plugin/installed": CodexSchema.V2PluginInstalledParams;
264 readonly "plugin/reconcile": CodexSchema.V2PluginReconcileParams;
265 readonly "plugin/read": CodexSchema.V2PluginReadParams;
266 readonly "plugin/skill/read": CodexSchema.V2PluginSkillReadParams;
267 readonly "plugin/share/save": CodexSchema.V2PluginShareSaveParams;
268 readonly "plugin/share/updateTargets": CodexSchema.V2PluginShareUpdateTargetsParams;
269 readonly "plugin/share/list": CodexSchema.V2PluginShareListParams;
270 readonly "plugin/share/checkout": CodexSchema.V2PluginShareCheckoutParams;
271 readonly "plugin/share/delete": CodexSchema.V2PluginShareDeleteParams;
272 readonly "app/read": CodexSchema.V2AppsReadParams;
273 readonly "app/list": CodexSchema.V2AppsListParams;
274 readonly "app/installed": CodexSchema.V2AppsInstalledParams;
275 readonly "fs/readFile": CodexSchema.V2FsReadFileParams;
276 readonly "fs/writeFile": CodexSchema.V2FsWriteFileParams;
277 readonly "fs/createDirectory": CodexSchema.V2FsCreateDirectoryParams;
278 readonly "fs/getMetadata": CodexSchema.V2FsGetMetadataParams;
279 readonly "fs/readDirectory": CodexSchema.V2FsReadDirectoryParams;
280 readonly "fs/remove": CodexSchema.V2FsRemoveParams;
281 readonly "fs/copy": CodexSchema.V2FsCopyParams;
282 readonly "fs/watch": CodexSchema.V2FsWatchParams;
283 readonly "fs/unwatch": CodexSchema.V2FsUnwatchParams;
284 readonly "skills/config/write": CodexSchema.V2SkillsConfigWriteParams;
285 readonly "plugin/install": CodexSchema.V2PluginInstallParams;
286 readonly "plugin/uninstall": CodexSchema.V2PluginUninstallParams;
287 readonly "turn/start": CodexSchema.V2TurnStartParams;
288 readonly "turn/steer": CodexSchema.V2TurnSteerParams;
289 readonly "turn/interrupt": CodexSchema.V2TurnInterruptParams;
290 readonly "review/start": CodexSchema.V2ReviewStartParams;
291 readonly "model/list": CodexSchema.V2ModelListParams;
292 readonly "account/gatewayOAuth/read": undefined;
293 readonly "account/gatewayOAuth/login": undefined;
294 readonly "account/gatewayOAuth/cancel": undefined;
295 readonly "modelProvider/capabilities/read": CodexSchema.V2ModelProviderCapabilitiesReadParams;
296 readonly "experimentalFeature/list": CodexSchema.V2ExperimentalFeatureListParams;
297 readonly "permissionProfile/list": CodexSchema.V2PermissionProfileListParams;
298 readonly "experimentalFeature/enablement/set": CodexSchema.V2ExperimentalFeatureEnablementSetParams;
299 readonly "mcpServer/oauth/login": CodexSchema.V2McpServerOauthLoginParams;
300 readonly "config/mcpServer/reload": undefined;
301 readonly "mcpServerStatus/list": CodexSchema.V2ListMcpServerStatusParams;
302 readonly "mcpServer/resource/read": CodexSchema.V2McpResourceReadParams;
303 readonly "mcpServer/tool/call": CodexSchema.V2McpServerToolCallParams;
304 readonly "windowsSandbox/setupStart": CodexSchema.V2WindowsSandboxSetupStartParams;
305 readonly "windowsSandbox/readiness": undefined;
306 readonly "account/login/start": CodexSchema.V2LoginAccountParams;
307 readonly "account/login/cancel": CodexSchema.V2CancelLoginAccountParams;
308 readonly "account/logout": undefined;
309 readonly "account/rateLimits/read": CodexSchema.V2NullableGetAccountRateLimitsParams;
310 readonly "account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditParams;
311 readonly "account/usage/read": CodexSchema.V2NullableGetAccountTokenUsageParams;
312 readonly "account/workspaceMessages/read": undefined;
313 readonly "account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailParams;
314 readonly "feedback/upload": CodexSchema.V2FeedbackUploadParams;
315 readonly "command/exec": CodexSchema.V2CommandExecParams;
316 readonly "command/exec/write": CodexSchema.V2CommandExecWriteParams;
317 readonly "command/exec/terminate": CodexSchema.V2CommandExecTerminateParams;
318 readonly "command/exec/resize": CodexSchema.V2CommandExecResizeParams;
319 readonly "config/read": CodexSchema.V2ConfigReadParams;
320 readonly "externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectParams;
321 readonly "externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportParams;
322 readonly "externalAgentConfig/import/recordHistory": CodexSchema.V2ExternalAgentConfigImportHistoryRecordParams;
323 readonly "externalAgentConfig/import/readHistories": undefined;
324 readonly "config/value/write": CodexSchema.V2ConfigValueWriteParams;
325 readonly "config/batchWrite": CodexSchema.V2ConfigBatchWriteParams;
326 readonly "configRequirements/read": undefined;
327 readonly "account/read": CodexSchema.V2GetAccountParams;
328 readonly getConversationSummary: CodexSchema.GetConversationSummaryParams;
329 readonly gitDiffToRemote: CodexSchema.GitDiffToRemoteParams;
330 readonly getAuthStatus: CodexSchema.GetAuthStatusParams;
331 readonly fuzzyFileSearch: CodexSchema.FuzzyFileSearchParams;
332 readonly "thread/settings/update": CodexSchema.ThreadSettingsUpdateParams;
333 }
334
335 export interface ClientRequestResponsesByMethod {
336 readonly initialize: CodexSchema.V1InitializeResponse;
337 readonly "thread/start": CodexSchema.V2ThreadStartResponse;
338 readonly "thread/resume": CodexSchema.V2ThreadResumeResponse;
339 readonly "thread/fork": CodexSchema.V2ThreadForkResponse;
340 readonly "thread/archive": CodexSchema.V2ThreadArchiveResponse;
341 readonly "thread/delete": CodexSchema.V2ThreadDeleteResponse;
342 readonly "thread/unsubscribe": CodexSchema.V2ThreadUnsubscribeResponse;
343 readonly "thread/name/set": CodexSchema.V2ThreadSetNameResponse;
344 readonly "thread/goal/set": CodexSchema.V2ThreadGoalSetResponse;
345 readonly "thread/goal/get": CodexSchema.V2ThreadGoalGetResponse;
346 readonly "thread/goal/clear": CodexSchema.V2ThreadGoalClearResponse;
347 readonly "thread/metadata/update": CodexSchema.V2ThreadMetadataUpdateResponse;
348 readonly "thread/attachment/add": CodexSchema.V2ThreadAttachmentAddResponse;
349 readonly "thread/attachment/list": CodexSchema.V2ThreadAttachmentListResponse;
350 readonly "thread/attachment/remove": CodexSchema.V2ThreadAttachmentRemoveResponse;
351 readonly "thread/section/move": CodexSchema.V2ThreadSectionMoveResponse;
352 readonly "thread/unarchive": CodexSchema.V2ThreadUnarchiveResponse;
353 readonly "thread/compact/start": CodexSchema.V2ThreadCompactStartResponse;
354 readonly "thread/shellCommand": CodexSchema.V2ThreadShellCommandResponse;
355 readonly "thread/approveGuardianDeniedAction": CodexSchema.V2ThreadApproveGuardianDeniedActionResponse;
356 readonly "thread/revert": CodexSchema.V2ThreadRevertResponse;
357 readonly "thread/list": CodexSchema.V2ThreadListResponse;
358 readonly "threadSection/list": CodexSchema.V2ThreadSectionListResponse;
359 readonly "threadSection/create": CodexSchema.V2ThreadSectionCreateResponse;
360 readonly "threadSection/update": CodexSchema.V2ThreadSectionUpdateResponse;
361 readonly "threadSection/delete": CodexSchema.V2ThreadSectionDeleteResponse;
362 readonly "thread/loaded/list": CodexSchema.V2ThreadLoadedListResponse;
363 readonly "thread/read": CodexSchema.V2ThreadReadResponse;
364 readonly "thread/turns/list": CodexSchema.V2ThreadTurnsListResponse;
365 readonly "thread/items/list": CodexSchema.V2ThreadItemsListResponse;
366 readonly "thread/inject_items": CodexSchema.V2ThreadInjectItemsResponse;
367 readonly "skills/list": CodexSchema.V2SkillsListResponse;
368 readonly "skills/extraRoots/set": CodexSchema.V2SkillsExtraRootsSetResponse;
369 readonly "hooks/list": CodexSchema.V2HooksListResponse;
370 readonly "marketplace/add": CodexSchema.V2MarketplaceAddResponse;
371 readonly "marketplace/remove": CodexSchema.V2MarketplaceRemoveResponse;
372 readonly "marketplace/upgrade": CodexSchema.V2MarketplaceUpgradeResponse;
373 readonly "plugin/list": CodexSchema.V2PluginListResponse;
374 readonly "plugin/installed": CodexSchema.V2PluginInstalledResponse;
375 readonly "plugin/reconcile": CodexSchema.V2PluginReconcileResponse;
376 readonly "plugin/read": CodexSchema.V2PluginReadResponse;
377 readonly "plugin/skill/read": CodexSchema.V2PluginSkillReadResponse;
378 readonly "plugin/share/save": CodexSchema.V2PluginShareSaveResponse;
379 readonly "plugin/share/updateTargets": CodexSchema.V2PluginShareUpdateTargetsResponse;
380 readonly "plugin/share/list": CodexSchema.V2PluginShareListResponse;
381 readonly "plugin/share/checkout": CodexSchema.V2PluginShareCheckoutResponse;
382 readonly "plugin/share/delete": CodexSchema.V2PluginShareDeleteResponse;
383 readonly "app/read": CodexSchema.V2AppsReadResponse;
384 readonly "app/list": CodexSchema.V2AppsListResponse;
385 readonly "app/installed": CodexSchema.V2AppsInstalledResponse;
386 readonly "fs/readFile": CodexSchema.V2FsReadFileResponse;
387 readonly "fs/writeFile": CodexSchema.V2FsWriteFileResponse;
388 readonly "fs/createDirectory": CodexSchema.V2FsCreateDirectoryResponse;
389 readonly "fs/getMetadata": CodexSchema.V2FsGetMetadataResponse;
390 readonly "fs/readDirectory": CodexSchema.V2FsReadDirectoryResponse;
391 readonly "fs/remove": CodexSchema.V2FsRemoveResponse;
392 readonly "fs/copy": CodexSchema.V2FsCopyResponse;
393 readonly "fs/watch": CodexSchema.V2FsWatchResponse;
394 readonly "fs/unwatch": CodexSchema.V2FsUnwatchResponse;
395 readonly "skills/config/write": CodexSchema.V2SkillsConfigWriteResponse;
396 readonly "plugin/install": CodexSchema.V2PluginInstallResponse;
397 readonly "plugin/uninstall": CodexSchema.V2PluginUninstallResponse;
398 readonly "turn/start": CodexSchema.V2TurnStartResponse;
399 readonly "turn/steer": CodexSchema.V2TurnSteerResponse;
400 readonly "turn/interrupt": CodexSchema.V2TurnInterruptResponse;
401 readonly "review/start": CodexSchema.V2ReviewStartResponse;
402 readonly "model/list": CodexSchema.V2ModelListResponse;
403 readonly "account/gatewayOAuth/read": CodexSchema.V2GatewayOAuthReadResponse;
404 readonly "account/gatewayOAuth/login": CodexSchema.V2GatewayOAuthLoginResponse;
405 readonly "account/gatewayOAuth/cancel": CodexSchema.V2GatewayOAuthCancelResponse;
406 readonly "modelProvider/capabilities/read": CodexSchema.V2ModelProviderCapabilitiesReadResponse;
407 readonly "experimentalFeature/list": CodexSchema.V2ExperimentalFeatureListResponse;
408 readonly "permissionProfile/list": CodexSchema.V2PermissionProfileListResponse;
409 readonly "experimentalFeature/enablement/set": CodexSchema.V2ExperimentalFeatureEnablementSetResponse;
410 readonly "mcpServer/oauth/login": CodexSchema.V2McpServerOauthLoginResponse;
411 readonly "config/mcpServer/reload": CodexSchema.V2McpServerRefreshResponse;
412 readonly "mcpServerStatus/list": CodexSchema.V2ListMcpServerStatusResponse;
413 readonly "mcpServer/resource/read": CodexSchema.V2McpResourceReadResponse;
414 readonly "mcpServer/tool/call": CodexSchema.V2McpServerToolCallResponse;
415 readonly "windowsSandbox/setupStart": CodexSchema.V2WindowsSandboxSetupStartResponse;
416 readonly "windowsSandbox/readiness": CodexSchema.V2WindowsSandboxReadinessResponse;
417 readonly "account/login/start": CodexSchema.V2LoginAccountResponse;
418 readonly "account/login/cancel": CodexSchema.V2CancelLoginAccountResponse;
419 readonly "account/logout": CodexSchema.V2LogoutAccountResponse;
420 readonly "account/rateLimits/read": CodexSchema.V2GetAccountRateLimitsResponse;
421 readonly "account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditResponse;
422 readonly "account/usage/read": CodexSchema.V2GetAccountTokenUsageResponse;
423 readonly "account/workspaceMessages/read": CodexSchema.V2GetWorkspaceMessagesResponse;
424 readonly "account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailResponse;
425 readonly "feedback/upload": CodexSchema.V2FeedbackUploadResponse;
426 readonly "command/exec": CodexSchema.V2CommandExecResponse;
427 readonly "command/exec/write": CodexSchema.V2CommandExecWriteResponse;
428 readonly "command/exec/terminate": CodexSchema.V2CommandExecTerminateResponse;
429 readonly "command/exec/resize": CodexSchema.V2CommandExecResizeResponse;
430 readonly "config/read": CodexSchema.V2ConfigReadResponse;
431 readonly "externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectResponse;
432 readonly "externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportResponse;
433 readonly "externalAgentConfig/import/recordHistory": CodexSchema.V2ExternalAgentConfigImportHistoryRecordResponse;
434 readonly "externalAgentConfig/import/readHistories": CodexSchema.V2ExternalAgentConfigImportHistoriesReadResponse;
435 readonly "config/value/write": CodexSchema.V2ConfigWriteResponse;
436 readonly "config/batchWrite": CodexSchema.V2ConfigWriteResponse;
437 readonly "configRequirements/read": CodexSchema.V2ConfigRequirementsReadResponse;
438 readonly "account/read": CodexSchema.V2GetAccountResponse;
439 readonly getConversationSummary: CodexSchema.GetConversationSummaryResponse;
440 readonly gitDiffToRemote: CodexSchema.GitDiffToRemoteResponse;
441 readonly getAuthStatus: CodexSchema.GetAuthStatusResponse;
442 readonly fuzzyFileSearch: CodexSchema.FuzzyFileSearchResponse;
443 readonly "thread/settings/update": CodexSchema.ThreadSettingsUpdateResponse;
444 }
445
446 export interface ClientNotificationParamsByMethod {
447 readonly initialized: undefined;
448 }
449
450 export interface ServerRequestParamsByMethod {
451 readonly "item/commandExecution/requestApproval": CodexSchema.CommandExecutionRequestApprovalParams;
452 readonly "item/fileChange/requestApproval": CodexSchema.FileChangeRequestApprovalParams;
453 readonly "item/tool/requestUserInput": CodexSchema.ToolRequestUserInputParams;
454 readonly "mcpServer/elicitation/request": CodexSchema.McpServerElicitationRequestParams;
455 readonly "item/permissions/requestApproval": CodexSchema.PermissionsRequestApprovalParams;
456 readonly "item/tool/call": CodexSchema.DynamicToolCallParams;
457 readonly "account/chatgptAuthTokens/refresh": CodexSchema.ChatgptAuthTokensRefreshParams;
458 readonly "attestation/generate": CodexSchema.AttestationGenerateParams;
459 readonly applyPatchApproval: CodexSchema.ApplyPatchApprovalParams;
460 readonly execCommandApproval: CodexSchema.ExecCommandApprovalParams;
461 }
462
463 export interface ServerRequestResponsesByMethod {
464 readonly "item/commandExecution/requestApproval": CodexSchema.CommandExecutionRequestApprovalResponse;
465 readonly "item/fileChange/requestApproval": CodexSchema.FileChangeRequestApprovalResponse;
466 readonly "item/tool/requestUserInput": CodexSchema.ToolRequestUserInputResponse;
467 readonly "mcpServer/elicitation/request": CodexSchema.McpServerElicitationRequestResponse;
468 readonly "item/permissions/requestApproval": CodexSchema.PermissionsRequestApprovalResponse;
469 readonly "item/tool/call": CodexSchema.DynamicToolCallResponse;
470 readonly "account/chatgptAuthTokens/refresh": CodexSchema.ChatgptAuthTokensRefreshResponse;
471 readonly "attestation/generate": CodexSchema.AttestationGenerateResponse;
472 readonly applyPatchApproval: CodexSchema.ApplyPatchApprovalResponse;
473 readonly execCommandApproval: CodexSchema.ExecCommandApprovalResponse;
474 }
475
476 export interface ServerNotificationParamsByMethod {
477 readonly error: CodexSchema.V2ErrorNotification;
478 readonly "thread/started": CodexSchema.V2ThreadStartedNotification;
479 readonly "thread/status/changed": CodexSchema.V2ThreadStatusChangedNotification;
480 readonly "thread/archived": CodexSchema.V2ThreadArchivedNotification;
481 readonly "thread/deleted": CodexSchema.V2ThreadDeletedNotification;
482 readonly "thread/unarchived": CodexSchema.V2ThreadUnarchivedNotification;
483 readonly "thread/closed": CodexSchema.V2ThreadClosedNotification;
484 readonly "thread/reverted": CodexSchema.V2ThreadRevertedNotification;
485 readonly "skills/changed": CodexSchema.V2SkillsChangedNotification;
486 readonly "thread/name/updated": CodexSchema.V2ThreadNameUpdatedNotification;
487 readonly "thread/attachment/updated": CodexSchema.V2ThreadAttachmentUpdatedNotification;
488 readonly "thread/goal/updated": CodexSchema.V2ThreadGoalUpdatedNotification;
489 readonly "thread/goal/cleared": CodexSchema.V2ThreadGoalClearedNotification;
490 readonly "thread/queue/changed": CodexSchema.V2ThreadQueueChangedNotification;
491 readonly "project/changed": CodexSchema.V2ProjectChangedNotification;
492 readonly "thread/project/updated": CodexSchema.V2ThreadProjectUpdatedNotification;
493 readonly "thread/environment/connected": CodexSchema.V2EnvironmentConnectionNotification;
494 readonly "thread/environment/disconnected": CodexSchema.V2EnvironmentConnectionNotification;
495 readonly "thread/settings/updated": CodexSchema.V2ThreadSettingsUpdatedNotification;
496 readonly "thread/tokenUsage/updated": CodexSchema.V2ThreadTokenUsageUpdatedNotification;
497 readonly "turn/started": CodexSchema.V2TurnStartedNotification;
498 readonly "hook/started": CodexSchema.V2HookStartedNotification;
499 readonly "turn/completed": CodexSchema.V2TurnCompletedNotification;
500 readonly "hook/completed": CodexSchema.V2HookCompletedNotification;
501 readonly "turn/diff/updated": CodexSchema.V2TurnDiffUpdatedNotification;
502 readonly "turn/plan/updated": CodexSchema.V2TurnPlanUpdatedNotification;
503 readonly "item/started": CodexSchema.V2ItemStartedNotification;
504 readonly "item/autoApprovalReview/started": CodexSchema.V2ItemGuardianApprovalReviewStartedNotification;
505 readonly "item/autoApprovalReview/completed": CodexSchema.V2ItemGuardianApprovalReviewCompletedNotification;
506 readonly "autoApprovalReview/strictReviewRequired": CodexSchema.V2StrictReviewRequiredNotification;
507 readonly "item/completed": CodexSchema.V2ItemCompletedNotification;
508 readonly "rawResponseItem/completed": CodexSchema.V2RawResponseItemCompletedNotification;
509 readonly "rawResponse/completed": CodexSchema.V2RawResponseCompletedNotification;
510 readonly "item/agentMessage/delta": CodexSchema.V2AgentMessageDeltaNotification;
511 readonly "item/plan/delta": CodexSchema.V2PlanDeltaNotification;
512 readonly "command/exec/outputDelta": CodexSchema.V2CommandExecOutputDeltaNotification;
513 readonly "process/outputDelta": CodexSchema.V2ProcessOutputDeltaNotification;
514 readonly "process/exited": CodexSchema.V2ProcessExitedNotification;
515 readonly "item/commandExecution/outputDelta": CodexSchema.V2CommandExecutionOutputDeltaNotification;
516 readonly "item/commandExecution/terminalInteraction": CodexSchema.V2TerminalInteractionNotification;
517 readonly "item/fileChange/outputDelta": CodexSchema.V2FileChangeOutputDeltaNotification;
518 readonly "item/fileChange/patchUpdated": CodexSchema.V2FileChangePatchUpdatedNotification;
519 readonly "serverRequest/resolved": CodexSchema.V2ServerRequestResolvedNotification;
520 readonly "item/mcpToolCall/progress": CodexSchema.V2McpToolCallProgressNotification;
521 readonly "mcpServer/oauthLogin/completed": CodexSchema.V2McpServerOauthLoginCompletedNotification;
522 readonly "mcpServer/startupStatus/updated": CodexSchema.V2McpServerStatusUpdatedNotification;
523 readonly "mcpServer/event/stream/notification": CodexSchema.V2McpServerEventStreamNotification;
524 readonly "account/updated": CodexSchema.V2AccountUpdatedNotification;
525 readonly "account/gatewayOAuth/changed": CodexSchema.V2GatewayOAuthChangedNotification;
526 readonly "account/rateLimits/updated": CodexSchema.V2AccountRateLimitsUpdatedNotification;
527 readonly "app/list/updated": CodexSchema.V2AppListUpdatedNotification;
528 readonly "remoteControl/status/changed": CodexSchema.V2RemoteControlStatusChangedNotification;
529 readonly "externalAgentConfig/import/progress": CodexSchema.V2ExternalAgentConfigImportProgressNotification;
530 readonly "externalAgentConfig/import/completed": CodexSchema.V2ExternalAgentConfigImportCompletedNotification;
531 readonly "fs/changed": CodexSchema.V2FsChangedNotification;
532 readonly "item/reasoning/summaryTextDelta": CodexSchema.V2ReasoningSummaryTextDeltaNotification;
533 readonly "item/reasoning/summaryPartAdded": CodexSchema.V2ReasoningSummaryPartAddedNotification;
534 readonly "item/reasoning/textDelta": CodexSchema.V2ReasoningTextDeltaNotification;
535 readonly "thread/compacted": CodexSchema.V2ContextCompactedNotification;
536 readonly "model/rerouted": CodexSchema.V2ModelReroutedNotification;
537 readonly "model/verification": CodexSchema.V2ModelVerificationNotification;
538 readonly "modelProvider/authRecoveryStarted": CodexSchema.V2AuthRecoveryNotification;
539 readonly "modelProvider/authRecoveryCompleted": CodexSchema.V2AuthRecoveryNotification;
540 readonly "turn/moderationMetadata": CodexSchema.V2TurnModerationMetadataNotification;
541 readonly "model/safetyBuffering/updated": CodexSchema.V2ModelSafetyBufferingUpdatedNotification;
542 readonly warning: CodexSchema.V2WarningNotification;
543 readonly guardianWarning: CodexSchema.V2GuardianWarningNotification;
544 readonly deprecationNotice: CodexSchema.V2DeprecationNoticeNotification;
545 readonly configWarning: CodexSchema.V2ConfigWarningNotification;
546 readonly "fuzzyFileSearch/sessionUpdated": CodexSchema.FuzzyFileSearchSessionUpdatedNotification;
547 readonly "fuzzyFileSearch/sessionCompleted": CodexSchema.FuzzyFileSearchSessionCompletedNotification;
548 readonly "thread/realtime/started": CodexSchema.V2ThreadRealtimeStartedNotification;
549 readonly "thread/realtime/itemAdded": CodexSchema.V2ThreadRealtimeItemAddedNotification;
550 readonly "thread/realtime/item/started": CodexSchema.V2ThreadRealtimeItemStartedNotification;
551 readonly "thread/realtime/item/transcript/delta": CodexSchema.V2ThreadRealtimeItemTranscriptDeltaNotification;
552 readonly "thread/realtime/item/completed": CodexSchema.V2ThreadRealtimeItemCompletedNotification;
553 readonly "thread/realtime/transcript/delta": CodexSchema.V2ThreadRealtimeTranscriptDeltaNotification;
554 readonly "thread/realtime/transcript/done": CodexSchema.V2ThreadRealtimeTranscriptDoneNotification;
555 readonly "thread/realtime/outputAudio/delta": CodexSchema.V2ThreadRealtimeOutputAudioDeltaNotification;
556 readonly "thread/realtime/sdp": CodexSchema.V2ThreadRealtimeSdpNotification;
557 readonly "thread/realtime/error": CodexSchema.V2ThreadRealtimeErrorNotification;
558 readonly "thread/realtime/closed": CodexSchema.V2ThreadRealtimeClosedNotification;
559 readonly "windows/worldWritableWarning": CodexSchema.V2WindowsWorldWritableWarningNotification;
560 readonly "windowsSandbox/setupCompleted": CodexSchema.V2WindowsSandboxSetupCompletedNotification;
561 readonly "account/login/completed": CodexSchema.V2AccountLoginCompletedNotification;
562 }
563
564 export const CLIENT_REQUEST_PARAMS = {
565 initialize: CodexSchema.V1InitializeParams,
566 "thread/start": CodexSchema.V2ThreadStartParams,
567 "thread/resume": CodexSchema.V2ThreadResumeParams,
568 "thread/fork": CodexSchema.V2ThreadForkParams,
569 "thread/archive": CodexSchema.V2ThreadArchiveParams,
570 "thread/delete": CodexSchema.V2ThreadDeleteParams,
571 "thread/unsubscribe": CodexSchema.V2ThreadUnsubscribeParams,
572 "thread/name/set": CodexSchema.V2ThreadSetNameParams,
573 "thread/goal/set": CodexSchema.V2ThreadGoalSetParams,
574 "thread/goal/get": CodexSchema.V2ThreadGoalGetParams,
575 "thread/goal/clear": CodexSchema.V2ThreadGoalClearParams,
576 "thread/metadata/update": CodexSchema.V2ThreadMetadataUpdateParams,
577 "thread/attachment/add": CodexSchema.V2ThreadAttachmentAddParams,
578 "thread/attachment/list": CodexSchema.V2ThreadAttachmentListParams,
579 "thread/attachment/remove": CodexSchema.V2ThreadAttachmentRemoveParams,
580 "thread/section/move": CodexSchema.V2ThreadSectionMoveParams,
581 "thread/unarchive": CodexSchema.V2ThreadUnarchiveParams,
582 "thread/compact/start": CodexSchema.V2ThreadCompactStartParams,
583 "thread/shellCommand": CodexSchema.V2ThreadShellCommandParams,
584 "thread/approveGuardianDeniedAction": CodexSchema.V2ThreadApproveGuardianDeniedActionParams,
585 "thread/revert": CodexSchema.V2ThreadRevertParams,
586 "thread/list": CodexSchema.V2ThreadListParams,
587 "threadSection/list": CodexSchema.V2ThreadSectionListParams,
588 "threadSection/create": CodexSchema.V2ThreadSectionCreateParams,
589 "threadSection/update": CodexSchema.V2ThreadSectionUpdateParams,
590 "threadSection/delete": CodexSchema.V2ThreadSectionDeleteParams,
591 "thread/loaded/list": CodexSchema.V2ThreadLoadedListParams,
592 "thread/read": CodexSchema.V2ThreadReadParams,
593 "thread/turns/list": CodexSchema.V2ThreadTurnsListParams,
594 "thread/items/list": CodexSchema.V2ThreadItemsListParams,
595 "thread/inject_items": CodexSchema.V2ThreadInjectItemsParams,
596 "skills/list": CodexSchema.V2SkillsListParams,
597 "skills/extraRoots/set": CodexSchema.V2SkillsExtraRootsSetParams,
598 "hooks/list": CodexSchema.V2HooksListParams,
599 "marketplace/add": CodexSchema.V2MarketplaceAddParams,
600 "marketplace/remove": CodexSchema.V2MarketplaceRemoveParams,
601 "marketplace/upgrade": CodexSchema.V2MarketplaceUpgradeParams,
602 "plugin/list": CodexSchema.V2PluginListParams,
603 "plugin/installed": CodexSchema.V2PluginInstalledParams,
604 "plugin/reconcile": CodexSchema.V2PluginReconcileParams,
605 "plugin/read": CodexSchema.V2PluginReadParams,
606 "plugin/skill/read": CodexSchema.V2PluginSkillReadParams,
607 "plugin/share/save": CodexSchema.V2PluginShareSaveParams,
608 "plugin/share/updateTargets": CodexSchema.V2PluginShareUpdateTargetsParams,
609 "plugin/share/list": CodexSchema.V2PluginShareListParams,
610 "plugin/share/checkout": CodexSchema.V2PluginShareCheckoutParams,
611 "plugin/share/delete": CodexSchema.V2PluginShareDeleteParams,
612 "app/read": CodexSchema.V2AppsReadParams,
613 "app/list": CodexSchema.V2AppsListParams,
614 "app/installed": CodexSchema.V2AppsInstalledParams,
615 "fs/readFile": CodexSchema.V2FsReadFileParams,
616 "fs/writeFile": CodexSchema.V2FsWriteFileParams,
617 "fs/createDirectory": CodexSchema.V2FsCreateDirectoryParams,
618 "fs/getMetadata": CodexSchema.V2FsGetMetadataParams,
619 "fs/readDirectory": CodexSchema.V2FsReadDirectoryParams,
620 "fs/remove": CodexSchema.V2FsRemoveParams,
621 "fs/copy": CodexSchema.V2FsCopyParams,
622 "fs/watch": CodexSchema.V2FsWatchParams,
623 "fs/unwatch": CodexSchema.V2FsUnwatchParams,
624 "skills/config/write": CodexSchema.V2SkillsConfigWriteParams,
625 "plugin/install": CodexSchema.V2PluginInstallParams,
626 "plugin/uninstall": CodexSchema.V2PluginUninstallParams,
627 "turn/start": CodexSchema.V2TurnStartParams,
628 "turn/steer": CodexSchema.V2TurnSteerParams,
629 "turn/interrupt": CodexSchema.V2TurnInterruptParams,
630 "review/start": CodexSchema.V2ReviewStartParams,
631 "model/list": CodexSchema.V2ModelListParams,
632 "account/gatewayOAuth/read": undefined,
633 "account/gatewayOAuth/login": undefined,
634 "account/gatewayOAuth/cancel": undefined,
635 "modelProvider/capabilities/read": CodexSchema.V2ModelProviderCapabilitiesReadParams,
636 "experimentalFeature/list": CodexSchema.V2ExperimentalFeatureListParams,
637 "permissionProfile/list": CodexSchema.V2PermissionProfileListParams,
638 "experimentalFeature/enablement/set": CodexSchema.V2ExperimentalFeatureEnablementSetParams,
639 "mcpServer/oauth/login": CodexSchema.V2McpServerOauthLoginParams,
640 "config/mcpServer/reload": undefined,
641 "mcpServerStatus/list": CodexSchema.V2ListMcpServerStatusParams,
642 "mcpServer/resource/read": CodexSchema.V2McpResourceReadParams,
643 "mcpServer/tool/call": CodexSchema.V2McpServerToolCallParams,
644 "windowsSandbox/setupStart": CodexSchema.V2WindowsSandboxSetupStartParams,
645 "windowsSandbox/readiness": undefined,
646 "account/login/start": CodexSchema.V2LoginAccountParams,
647 "account/login/cancel": CodexSchema.V2CancelLoginAccountParams,
648 "account/logout": undefined,
649 "account/rateLimits/read": CodexSchema.V2NullableGetAccountRateLimitsParams,
650 "account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditParams,
651 "account/usage/read": CodexSchema.V2NullableGetAccountTokenUsageParams,
652 "account/workspaceMessages/read": undefined,
653 "account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailParams,
654 "feedback/upload": CodexSchema.V2FeedbackUploadParams,
655 "command/exec": CodexSchema.V2CommandExecParams,
656 "command/exec/write": CodexSchema.V2CommandExecWriteParams,
657 "command/exec/terminate": CodexSchema.V2CommandExecTerminateParams,
658 "command/exec/resize": CodexSchema.V2CommandExecResizeParams,
659 "config/read": CodexSchema.V2ConfigReadParams,
660 "externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectParams,
661 "externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportParams,
662 "externalAgentConfig/import/recordHistory":
663 CodexSchema.V2ExternalAgentConfigImportHistoryRecordParams,
664 "externalAgentConfig/import/readHistories": undefined,
665 "config/value/write": CodexSchema.V2ConfigValueWriteParams,
666 "config/batchWrite": CodexSchema.V2ConfigBatchWriteParams,
667 "configRequirements/read": undefined,
668 "account/read": CodexSchema.V2GetAccountParams,
669 getConversationSummary: CodexSchema.GetConversationSummaryParams,
670 gitDiffToRemote: CodexSchema.GitDiffToRemoteParams,
671 getAuthStatus: CodexSchema.GetAuthStatusParams,
672 fuzzyFileSearch: CodexSchema.FuzzyFileSearchParams,
673 "thread/settings/update": CodexSchema.ThreadSettingsUpdateParams,
674 } as const;
675
676 export const CLIENT_REQUEST_RESPONSES = {
677 initialize: CodexSchema.V1InitializeResponse,
678 "thread/start": CodexSchema.V2ThreadStartResponse,
679 "thread/resume": CodexSchema.V2ThreadResumeResponse,
680 "thread/fork": CodexSchema.V2ThreadForkResponse,
681 "thread/archive": CodexSchema.V2ThreadArchiveResponse,
682 "thread/delete": CodexSchema.V2ThreadDeleteResponse,
683 "thread/unsubscribe": CodexSchema.V2ThreadUnsubscribeResponse,
684 "thread/name/set": CodexSchema.V2ThreadSetNameResponse,
685 "thread/goal/set": CodexSchema.V2ThreadGoalSetResponse,
686 "thread/goal/get": CodexSchema.V2ThreadGoalGetResponse,
687 "thread/goal/clear": CodexSchema.V2ThreadGoalClearResponse,
688 "thread/metadata/update": CodexSchema.V2ThreadMetadataUpdateResponse,
689 "thread/attachment/add": CodexSchema.V2ThreadAttachmentAddResponse,
690 "thread/attachment/list": CodexSchema.V2ThreadAttachmentListResponse,
691 "thread/attachment/remove": CodexSchema.V2ThreadAttachmentRemoveResponse,
692 "thread/section/move": CodexSchema.V2ThreadSectionMoveResponse,
693 "thread/unarchive": CodexSchema.V2ThreadUnarchiveResponse,
694 "thread/compact/start": CodexSchema.V2ThreadCompactStartResponse,
695 "thread/shellCommand": CodexSchema.V2ThreadShellCommandResponse,
696 "thread/approveGuardianDeniedAction": CodexSchema.V2ThreadApproveGuardianDeniedActionResponse,
697 "thread/revert": CodexSchema.V2ThreadRevertResponse,
698 "thread/list": CodexSchema.V2ThreadListResponse,
699 "threadSection/list": CodexSchema.V2ThreadSectionListResponse,
700 "threadSection/create": CodexSchema.V2ThreadSectionCreateResponse,
701 "threadSection/update": CodexSchema.V2ThreadSectionUpdateResponse,
702 "threadSection/delete": CodexSchema.V2ThreadSectionDeleteResponse,
703 "thread/loaded/list": CodexSchema.V2ThreadLoadedListResponse,
704 "thread/read": CodexSchema.V2ThreadReadResponse,
705 "thread/turns/list": CodexSchema.V2ThreadTurnsListResponse,
706 "thread/items/list": CodexSchema.V2ThreadItemsListResponse,
707 "thread/inject_items": CodexSchema.V2ThreadInjectItemsResponse,
708 "skills/list": CodexSchema.V2SkillsListResponse,
709 "skills/extraRoots/set": CodexSchema.V2SkillsExtraRootsSetResponse,
710 "hooks/list": CodexSchema.V2HooksListResponse,
711 "marketplace/add": CodexSchema.V2MarketplaceAddResponse,
712 "marketplace/remove": CodexSchema.V2MarketplaceRemoveResponse,
713 "marketplace/upgrade": CodexSchema.V2MarketplaceUpgradeResponse,
714 "plugin/list": CodexSchema.V2PluginListResponse,
715 "plugin/installed": CodexSchema.V2PluginInstalledResponse,
716 "plugin/reconcile": CodexSchema.V2PluginReconcileResponse,
717 "plugin/read": CodexSchema.V2PluginReadResponse,
718 "plugin/skill/read": CodexSchema.V2PluginSkillReadResponse,
719 "plugin/share/save": CodexSchema.V2PluginShareSaveResponse,
720 "plugin/share/updateTargets": CodexSchema.V2PluginShareUpdateTargetsResponse,
721 "plugin/share/list": CodexSchema.V2PluginShareListResponse,
722 "plugin/share/checkout": CodexSchema.V2PluginShareCheckoutResponse,
723 "plugin/share/delete": CodexSchema.V2PluginShareDeleteResponse,
724 "app/read": CodexSchema.V2AppsReadResponse,
725 "app/list": CodexSchema.V2AppsListResponse,
726 "app/installed": CodexSchema.V2AppsInstalledResponse,
727 "fs/readFile": CodexSchema.V2FsReadFileResponse,
728 "fs/writeFile": CodexSchema.V2FsWriteFileResponse,
729 "fs/createDirectory": CodexSchema.V2FsCreateDirectoryResponse,
730 "fs/getMetadata": CodexSchema.V2FsGetMetadataResponse,
731 "fs/readDirectory": CodexSchema.V2FsReadDirectoryResponse,
732 "fs/remove": CodexSchema.V2FsRemoveResponse,
733 "fs/copy": CodexSchema.V2FsCopyResponse,
734 "fs/watch": CodexSchema.V2FsWatchResponse,
735 "fs/unwatch": CodexSchema.V2FsUnwatchResponse,
736 "skills/config/write": CodexSchema.V2SkillsConfigWriteResponse,
737 "plugin/install": CodexSchema.V2PluginInstallResponse,
738 "plugin/uninstall": CodexSchema.V2PluginUninstallResponse,
739 "turn/start": CodexSchema.V2TurnStartResponse,
740 "turn/steer": CodexSchema.V2TurnSteerResponse,
741 "turn/interrupt": CodexSchema.V2TurnInterruptResponse,
742 "review/start": CodexSchema.V2ReviewStartResponse,
743 "model/list": CodexSchema.V2ModelListResponse,
744 "account/gatewayOAuth/read": CodexSchema.V2GatewayOAuthReadResponse,
745 "account/gatewayOAuth/login": CodexSchema.V2GatewayOAuthLoginResponse,
746 "account/gatewayOAuth/cancel": CodexSchema.V2GatewayOAuthCancelResponse,
747 "modelProvider/capabilities/read": CodexSchema.V2ModelProviderCapabilitiesReadResponse,
748 "experimentalFeature/list": CodexSchema.V2ExperimentalFeatureListResponse,
749 "permissionProfile/list": CodexSchema.V2PermissionProfileListResponse,
750 "experimentalFeature/enablement/set": CodexSchema.V2ExperimentalFeatureEnablementSetResponse,
751 "mcpServer/oauth/login": CodexSchema.V2McpServerOauthLoginResponse,
752 "config/mcpServer/reload": CodexSchema.V2McpServerRefreshResponse,
753 "mcpServerStatus/list": CodexSchema.V2ListMcpServerStatusResponse,
754 "mcpServer/resource/read": CodexSchema.V2McpResourceReadResponse,
755 "mcpServer/tool/call": CodexSchema.V2McpServerToolCallResponse,
756 "windowsSandbox/setupStart": CodexSchema.V2WindowsSandboxSetupStartResponse,
757 "windowsSandbox/readiness": CodexSchema.V2WindowsSandboxReadinessResponse,
758 "account/login/start": CodexSchema.V2LoginAccountResponse,
759 "account/login/cancel": CodexSchema.V2CancelLoginAccountResponse,
760 "account/logout": CodexSchema.V2LogoutAccountResponse,
761 "account/rateLimits/read": CodexSchema.V2GetAccountRateLimitsResponse,
762 "account/rateLimitResetCredit/consume": CodexSchema.V2ConsumeAccountRateLimitResetCreditResponse,
763 "account/usage/read": CodexSchema.V2GetAccountTokenUsageResponse,
764 "account/workspaceMessages/read": CodexSchema.V2GetWorkspaceMessagesResponse,
765 "account/sendAddCreditsNudgeEmail": CodexSchema.V2SendAddCreditsNudgeEmailResponse,
766 "feedback/upload": CodexSchema.V2FeedbackUploadResponse,
767 "command/exec": CodexSchema.V2CommandExecResponse,
768 "command/exec/write": CodexSchema.V2CommandExecWriteResponse,
769 "command/exec/terminate": CodexSchema.V2CommandExecTerminateResponse,
770 "command/exec/resize": CodexSchema.V2CommandExecResizeResponse,
771 "config/read": CodexSchema.V2ConfigReadResponse,
772 "externalAgentConfig/detect": CodexSchema.V2ExternalAgentConfigDetectResponse,
773 "externalAgentConfig/import": CodexSchema.V2ExternalAgentConfigImportResponse,
774 "externalAgentConfig/import/recordHistory":
775 CodexSchema.V2ExternalAgentConfigImportHistoryRecordResponse,
776 "externalAgentConfig/import/readHistories":
777 CodexSchema.V2ExternalAgentConfigImportHistoriesReadResponse,
778 "config/value/write": CodexSchema.V2ConfigWriteResponse,
779 "config/batchWrite": CodexSchema.V2ConfigWriteResponse,
780 "configRequirements/read": CodexSchema.V2ConfigRequirementsReadResponse,
781 "account/read": CodexSchema.V2GetAccountResponse,
782 getConversationSummary: CodexSchema.GetConversationSummaryResponse,
783 gitDiffToRemote: CodexSchema.GitDiffToRemoteResponse,
784 getAuthStatus: CodexSchema.GetAuthStatusResponse,
785 fuzzyFileSearch: CodexSchema.FuzzyFileSearchResponse,
786 "thread/settings/update": CodexSchema.ThreadSettingsUpdateResponse,
787 } as const;
788
789 export const CLIENT_NOTIFICATION_PARAMS = {
790 initialized: undefined,
791 } as const;
792
793 export const SERVER_REQUEST_PARAMS = {
794 "item/commandExecution/requestApproval": CodexSchema.CommandExecutionRequestApprovalParams,
795 "item/fileChange/requestApproval": CodexSchema.FileChangeRequestApprovalParams,
796 "item/tool/requestUserInput": CodexSchema.ToolRequestUserInputParams,
797 "mcpServer/elicitation/request": CodexSchema.McpServerElicitationRequestParams,
798 "item/permissions/requestApproval": CodexSchema.PermissionsRequestApprovalParams,
799 "item/tool/call": CodexSchema.DynamicToolCallParams,
800 "account/chatgptAuthTokens/refresh": CodexSchema.ChatgptAuthTokensRefreshParams,
801 "attestation/generate": CodexSchema.AttestationGenerateParams,
802 applyPatchApproval: CodexSchema.ApplyPatchApprovalParams,
803 execCommandApproval: CodexSchema.ExecCommandApprovalParams,
804 } as const;
805
806 export const SERVER_REQUEST_RESPONSES = {
807 "item/commandExecution/requestApproval": CodexSchema.CommandExecutionRequestApprovalResponse,
808 "item/fileChange/requestApproval": CodexSchema.FileChangeRequestApprovalResponse,
809 "item/tool/requestUserInput": CodexSchema.ToolRequestUserInputResponse,
810 "mcpServer/elicitation/request": CodexSchema.McpServerElicitationRequestResponse,
811 "item/permissions/requestApproval": CodexSchema.PermissionsRequestApprovalResponse,
812 "item/tool/call": CodexSchema.DynamicToolCallResponse,
813 "account/chatgptAuthTokens/refresh": CodexSchema.ChatgptAuthTokensRefreshResponse,
814 "attestation/generate": CodexSchema.AttestationGenerateResponse,
815 applyPatchApproval: CodexSchema.ApplyPatchApprovalResponse,
816 execCommandApproval: CodexSchema.ExecCommandApprovalResponse,
817 } as const;
818
819 export const SERVER_NOTIFICATION_PARAMS = {
820 error: CodexSchema.V2ErrorNotification,
821 "thread/started": CodexSchema.V2ThreadStartedNotification,
822 "thread/status/changed": CodexSchema.V2ThreadStatusChangedNotification,
823 "thread/archived": CodexSchema.V2ThreadArchivedNotification,
824 "thread/deleted": CodexSchema.V2ThreadDeletedNotification,
825 "thread/unarchived": CodexSchema.V2ThreadUnarchivedNotification,
826 "thread/closed": CodexSchema.V2ThreadClosedNotification,
827 "thread/reverted": CodexSchema.V2ThreadRevertedNotification,
828 "skills/changed": CodexSchema.V2SkillsChangedNotification,
829 "thread/name/updated": CodexSchema.V2ThreadNameUpdatedNotification,
830 "thread/attachment/updated": CodexSchema.V2ThreadAttachmentUpdatedNotification,
831 "thread/goal/updated": CodexSchema.V2ThreadGoalUpdatedNotification,
832 "thread/goal/cleared": CodexSchema.V2ThreadGoalClearedNotification,
833 "thread/queue/changed": CodexSchema.V2ThreadQueueChangedNotification,
834 "project/changed": CodexSchema.V2ProjectChangedNotification,
835 "thread/project/updated": CodexSchema.V2ThreadProjectUpdatedNotification,
836 "thread/environment/connected": CodexSchema.V2EnvironmentConnectionNotification,
837 "thread/environment/disconnected": CodexSchema.V2EnvironmentConnectionNotification,
838 "thread/settings/updated": CodexSchema.V2ThreadSettingsUpdatedNotification,
839 "thread/tokenUsage/updated": CodexSchema.V2ThreadTokenUsageUpdatedNotification,
840 "turn/started": CodexSchema.V2TurnStartedNotification,
841 "hook/started": CodexSchema.V2HookStartedNotification,
842 "turn/completed": CodexSchema.V2TurnCompletedNotification,
843 "hook/completed": CodexSchema.V2HookCompletedNotification,
844 "turn/diff/updated": CodexSchema.V2TurnDiffUpdatedNotification,
845 "turn/plan/updated": CodexSchema.V2TurnPlanUpdatedNotification,
846 "item/started": CodexSchema.V2ItemStartedNotification,
847 "item/autoApprovalReview/started": CodexSchema.V2ItemGuardianApprovalReviewStartedNotification,
848 "item/autoApprovalReview/completed":
849 CodexSchema.V2ItemGuardianApprovalReviewCompletedNotification,
850 "autoApprovalReview/strictReviewRequired": CodexSchema.V2StrictReviewRequiredNotification,
851 "item/completed": CodexSchema.V2ItemCompletedNotification,
852 "rawResponseItem/completed": CodexSchema.V2RawResponseItemCompletedNotification,
853 "rawResponse/completed": CodexSchema.V2RawResponseCompletedNotification,
854 "item/agentMessage/delta": CodexSchema.V2AgentMessageDeltaNotification,
855 "item/plan/delta": CodexSchema.V2PlanDeltaNotification,
856 "command/exec/outputDelta": CodexSchema.V2CommandExecOutputDeltaNotification,
857 "process/outputDelta": CodexSchema.V2ProcessOutputDeltaNotification,
858 "process/exited": CodexSchema.V2ProcessExitedNotification,
859 "item/commandExecution/outputDelta": CodexSchema.V2CommandExecutionOutputDeltaNotification,
860 "item/commandExecution/terminalInteraction": CodexSchema.V2TerminalInteractionNotification,
861 "item/fileChange/outputDelta": CodexSchema.V2FileChangeOutputDeltaNotification,
862 "item/fileChange/patchUpdated": CodexSchema.V2FileChangePatchUpdatedNotification,
863 "serverRequest/resolved": CodexSchema.V2ServerRequestResolvedNotification,
864 "item/mcpToolCall/progress": CodexSchema.V2McpToolCallProgressNotification,
865 "mcpServer/oauthLogin/completed": CodexSchema.V2McpServerOauthLoginCompletedNotification,
866 "mcpServer/startupStatus/updated": CodexSchema.V2McpServerStatusUpdatedNotification,
867 "mcpServer/event/stream/notification": CodexSchema.V2McpServerEventStreamNotification,
868 "account/updated": CodexSchema.V2AccountUpdatedNotification,
869 "account/gatewayOAuth/changed": CodexSchema.V2GatewayOAuthChangedNotification,
870 "account/rateLimits/updated": CodexSchema.V2AccountRateLimitsUpdatedNotification,
871 "app/list/updated": CodexSchema.V2AppListUpdatedNotification,
872 "remoteControl/status/changed": CodexSchema.V2RemoteControlStatusChangedNotification,
873 "externalAgentConfig/import/progress":
874 CodexSchema.V2ExternalAgentConfigImportProgressNotification,
875 "externalAgentConfig/import/completed":
876 CodexSchema.V2ExternalAgentConfigImportCompletedNotification,
877 "fs/changed": CodexSchema.V2FsChangedNotification,
878 "item/reasoning/summaryTextDelta": CodexSchema.V2ReasoningSummaryTextDeltaNotification,
879 "item/reasoning/summaryPartAdded": CodexSchema.V2ReasoningSummaryPartAddedNotification,
880 "item/reasoning/textDelta": CodexSchema.V2ReasoningTextDeltaNotification,
881 "thread/compacted": CodexSchema.V2ContextCompactedNotification,
882 "model/rerouted": CodexSchema.V2ModelReroutedNotification,
883 "model/verification": CodexSchema.V2ModelVerificationNotification,
884 "modelProvider/authRecoveryStarted": CodexSchema.V2AuthRecoveryNotification,
885 "modelProvider/authRecoveryCompleted": CodexSchema.V2AuthRecoveryNotification,
886 "turn/moderationMetadata": CodexSchema.V2TurnModerationMetadataNotification,
887 "model/safetyBuffering/updated": CodexSchema.V2ModelSafetyBufferingUpdatedNotification,
888 warning: CodexSchema.V2WarningNotification,
889 guardianWarning: CodexSchema.V2GuardianWarningNotification,
890 deprecationNotice: CodexSchema.V2DeprecationNoticeNotification,
891 configWarning: CodexSchema.V2ConfigWarningNotification,
892 "fuzzyFileSearch/sessionUpdated": CodexSchema.FuzzyFileSearchSessionUpdatedNotification,
893 "fuzzyFileSearch/sessionCompleted": CodexSchema.FuzzyFileSearchSessionCompletedNotification,
894 "thread/realtime/started": CodexSchema.V2ThreadRealtimeStartedNotification,
895 "thread/realtime/itemAdded": CodexSchema.V2ThreadRealtimeItemAddedNotification,
896 "thread/realtime/item/started": CodexSchema.V2ThreadRealtimeItemStartedNotification,
897 "thread/realtime/item/transcript/delta":
898 CodexSchema.V2ThreadRealtimeItemTranscriptDeltaNotification,
899 "thread/realtime/item/completed": CodexSchema.V2ThreadRealtimeItemCompletedNotification,
900 "thread/realtime/transcript/delta": CodexSchema.V2ThreadRealtimeTranscriptDeltaNotification,
901 "thread/realtime/transcript/done": CodexSchema.V2ThreadRealtimeTranscriptDoneNotification,
902 "thread/realtime/outputAudio/delta": CodexSchema.V2ThreadRealtimeOutputAudioDeltaNotification,
903 "thread/realtime/sdp": CodexSchema.V2ThreadRealtimeSdpNotification,
904 "thread/realtime/error": CodexSchema.V2ThreadRealtimeErrorNotification,
905 "thread/realtime/closed": CodexSchema.V2ThreadRealtimeClosedNotification,
906 "windows/worldWritableWarning": CodexSchema.V2WindowsWorldWritableWarningNotification,
907 "windowsSandbox/setupCompleted": CodexSchema.V2WindowsSandboxSetupCompletedNotification,
908 "account/login/completed": CodexSchema.V2AccountLoginCompletedNotification,
909 } as const;