Skip to main content

codex_codes/protocol_generated/
samples.rs

1// AUTO-GENERATED by scripts/codegen_protocol.py — DO NOT EDIT BY HAND.
2
3use serde_json::{json, Value};
4
5/// Notification samples keyed by JSON-RPC method.
6pub fn server_notification_samples() -> Vec<(&'static str, Value)> {
7    vec![
8        ("account/login/completed", json!({"success": false})),
9        ("account/rateLimits/updated", json!({"rateLimits": {}})),
10        ("account/updated", json!({})),
11        (
12            "account/gatewayOAuth/changed",
13            json!({"providerId": "openai", "status": "started"}),
14        ),
15        ("app/list/updated", json!({"data": []})),
16        (
17            "autoApprovalReview/strictReviewRequired",
18            json!({"startedAtMs": 0, "threadId": "x", "turnId": "x"}),
19        ),
20        (
21            "command/exec/outputDelta",
22            json!({"capReached": false, "deltaBase64": "x", "processId": "x", "stream": null}),
23        ),
24        ("configWarning", json!({"summary": "x"})),
25        ("deprecationNotice", json!({"summary": "x"})),
26        (
27            "error",
28            json!({"error": {"message": "x"}, "threadId": "x", "turnId": "x", "willRetry": false}),
29        ),
30        (
31            "externalAgentConfig/import/completed",
32            json!({"importId": "x", "itemTypeResults": []}),
33        ),
34        (
35            "externalAgentConfig/import/progress",
36            json!({"importId": "x", "itemTypeResults": []}),
37        ),
38        ("fs/changed", json!({"changedPaths": [], "watchId": "x"})),
39        (
40            "fuzzyFileSearch/sessionCompleted",
41            json!({"sessionId": "x"}),
42        ),
43        (
44            "fuzzyFileSearch/sessionUpdated",
45            json!({"files": [], "query": "x", "sessionId": "x"}),
46        ),
47        ("guardianWarning", json!({"message": "x", "threadId": "x"})),
48        (
49            "hook/completed",
50            json!({"run": {"displayOrder": 0, "entries": [], "eventName": "preToolUse", "executionMode": "sync", "handlerType": "command", "id": "x", "scope": "thread", "sourcePath": "x", "startedAt": 0, "status": "running"}, "threadId": "x"}),
51        ),
52        (
53            "hook/started",
54            json!({"run": {"displayOrder": 0, "entries": [], "eventName": "preToolUse", "executionMode": "sync", "handlerType": "command", "id": "x", "scope": "thread", "sourcePath": "x", "startedAt": 0, "status": "running"}, "threadId": "x"}),
55        ),
56        (
57            "item/agentMessage/delta",
58            json!({"delta": "x", "itemId": "x", "threadId": "x", "turnId": "x"}),
59        ),
60        (
61            "item/autoApprovalReview/completed",
62            json!({"action": {"command": "x", "cwd": "x", "source": "shell", "type": "command"}, "completedAtMs": 0, "decisionSource": "agent", "review": {"status": "inProgress"}, "reviewId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
63        ),
64        (
65            "item/autoApprovalReview/started",
66            json!({"action": {"command": "x", "cwd": "x", "source": "shell", "type": "command"}, "review": {"status": "inProgress"}, "reviewId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
67        ),
68        (
69            "item/commandExecution/outputDelta",
70            json!({"delta": "x", "itemId": "x", "threadId": "x", "turnId": "x"}),
71        ),
72        (
73            "item/commandExecution/terminalInteraction",
74            json!({"itemId": "x", "processId": "x", "stdin": "x", "threadId": "x", "turnId": "x"}),
75        ),
76        (
77            "item/completed",
78            json!({"completedAtMs": 0, "item": {"content": [], "id": "x", "type": "userMessage"}, "threadId": "x", "turnId": "x"}),
79        ),
80        (
81            "item/fileChange/outputDelta",
82            json!({"delta": "x", "itemId": "x", "threadId": "x", "turnId": "x"}),
83        ),
84        (
85            "item/fileChange/patchUpdated",
86            json!({"changes": [], "itemId": "x", "threadId": "x", "turnId": "x"}),
87        ),
88        (
89            "item/mcpToolCall/progress",
90            json!({"itemId": "x", "message": "x", "threadId": "x", "turnId": "x"}),
91        ),
92        (
93            "item/plan/delta",
94            json!({"delta": "x", "itemId": "x", "threadId": "x", "turnId": "x"}),
95        ),
96        (
97            "item/reasoning/summaryPartAdded",
98            json!({"itemId": "x", "summaryIndex": 0, "threadId": "x", "turnId": "x"}),
99        ),
100        (
101            "item/reasoning/summaryTextDelta",
102            json!({"delta": "x", "itemId": "x", "summaryIndex": 0, "threadId": "x", "turnId": "x"}),
103        ),
104        (
105            "item/reasoning/textDelta",
106            json!({"contentIndex": 0, "delta": "x", "itemId": "x", "threadId": "x", "turnId": "x"}),
107        ),
108        (
109            "item/started",
110            json!({"item": {"content": [], "id": "x", "type": "userMessage"}, "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
111        ),
112        (
113            "mcpServer/event/stream/notification",
114            json!({"notification": {"method": "x", "params": null}, "subscriptionId": "x"}),
115        ),
116        (
117            "mcpServer/oauthLogin/completed",
118            json!({"name": "x", "success": false}),
119        ),
120        (
121            "mcpServer/startupStatus/updated",
122            json!({"name": "x", "status": "starting"}),
123        ),
124        (
125            "model/rerouted",
126            json!({"fromModel": "x", "reason": "highRiskCyberActivity", "threadId": "x", "toModel": "x", "turnId": "x"}),
127        ),
128        (
129            "model/safetyBuffering/updated",
130            json!({"model": "x", "reasons": [], "showBufferingUi": false, "threadId": "x", "turnId": "x", "useCases": []}),
131        ),
132        (
133            "model/verification",
134            json!({"threadId": "x", "turnId": "x", "verifications": []}),
135        ),
136        (
137            "modelProvider/authRecoveryCompleted",
138            json!({"message": "x", "provider": "x", "threadId": "x", "turnId": "x"}),
139        ),
140        (
141            "modelProvider/authRecoveryStarted",
142            json!({"message": "x", "provider": "x", "threadId": "x", "turnId": "x"}),
143        ),
144        (
145            "process/exited",
146            json!({"exitCode": 0, "processHandle": "x", "stderr": "x", "stderrCapReached": false, "stdout": "x", "stdoutCapReached": false}),
147        ),
148        (
149            "process/outputDelta",
150            json!({"capReached": false, "deltaBase64": "x", "processHandle": "x", "stream": null}),
151        ),
152        (
153            "project/changed",
154            json!({"changeType": "created", "projectId": "x"}),
155        ),
156        (
157            "remoteControl/status/changed",
158            json!({"installationId": "x", "serverName": "x", "status": "disabled"}),
159        ),
160        (
161            "serverRequest/resolved",
162            json!({"requestId": "x", "threadId": "x"}),
163        ),
164        ("skills/changed", json!({})),
165        ("thread/archived", json!({"threadId": "x"})),
166        (
167            "thread/attachment/updated",
168            json!({"attachmentId": "x", "attachmentType": "x", "identityKey": "x", "operation": "created", "threadId": "x"}),
169        ),
170        ("thread/closed", json!({"threadId": "x"})),
171        ("thread/compacted", json!({"threadId": "x", "turnId": "x"})),
172        ("thread/deleted", json!({"threadId": "x"})),
173        (
174            "thread/environment/connected",
175            json!({"environmentId": "x", "threadId": "x"}),
176        ),
177        (
178            "thread/environment/disconnected",
179            json!({"environmentId": "x", "threadId": "x"}),
180        ),
181        ("thread/goal/cleared", json!({"threadId": "x"})),
182        (
183            "thread/goal/updated",
184            json!({"goal": {"createdAt": 0, "objective": "x", "status": "active", "threadId": "x", "timeUsedSeconds": 0, "tokensUsed": 0, "updatedAt": 0}, "threadId": "x"}),
185        ),
186        ("thread/name/updated", json!({"threadId": "x"})),
187        (
188            "thread/prediction/updated",
189            json!({"result": {"type": "completed"}, "sourceTurnId": "x", "threadId": "x"}),
190        ),
191        (
192            "thread/project/updated",
193            json!({"projectId": "x", "threadId": "x"}),
194        ),
195        ("thread/queue/changed", json!({"threadId": "x"})),
196        ("thread/realtime/closed", json!({"threadId": "x"})),
197        (
198            "thread/realtime/error",
199            json!({"message": "x", "threadId": "x"}),
200        ),
201        (
202            "thread/realtime/item/completed",
203            json!({"item": {"type": "realtimeSessionStarted"}, "threadId": "x"}),
204        ),
205        (
206            "thread/realtime/item/started",
207            json!({"item": {"type": "realtimeSessionStarted"}, "threadId": "x"}),
208        ),
209        (
210            "thread/realtime/item/transcript/delta",
211            json!({"delta": "x", "itemId": "x", "threadId": "x"}),
212        ),
213        (
214            "thread/realtime/itemAdded",
215            json!({"item": null, "threadId": "x"}),
216        ),
217        (
218            "thread/realtime/outputAudio/delta",
219            json!({"audio": {"data": "x", "numChannels": 0, "sampleRate": 0}, "threadId": "x"}),
220        ),
221        ("thread/realtime/sdp", json!({"sdp": "x", "threadId": "x"})),
222        (
223            "thread/realtime/started",
224            json!({"threadId": "x", "version": "v1"}),
225        ),
226        (
227            "thread/realtime/transcript/delta",
228            json!({"delta": "x", "role": "x", "threadId": "x"}),
229        ),
230        (
231            "thread/realtime/transcript/done",
232            json!({"role": "x", "text": "x", "threadId": "x"}),
233        ),
234        ("thread/reverted", json!({"threadId": "x"})),
235        (
236            "thread/settings/updated",
237            json!({"threadId": "x", "threadSettings": {"approvalPolicy": "untrusted", "approvalsReviewer": "user", "collaborationMode": {"mode": "plan", "settings": {"model": "x"}}, "cwd": "x", "model": "x", "modelProvider": "x", "sandboxPolicy": {"type": "dangerFullAccess"}}}),
238        ),
239        (
240            "thread/started",
241            json!({"thread": {"cliVersion": "x", "createdAt": 0, "cwd": null, "ephemeral": false, "id": "x", "modelProvider": "x", "preview": "x", "sessionId": "x", "source": null, "status": null, "turns": [], "updatedAt": 0}}),
242        ),
243        (
244            "thread/status/changed",
245            json!({"status": {"type": "notLoaded"}, "threadId": "x"}),
246        ),
247        (
248            "thread/readState/changed",
249            json!({"readState": {"firstUnread": {"type": "turn", "turnId": "x"}, "revision": "x"}, "threadId": "x"}),
250        ),
251        (
252            "thread/section/changed",
253            json!({"sectionId": null, "threadId": "x"}),
254        ),
255        (
256            "thread/tokenUsage/updated",
257            json!({"threadId": "x", "tokenUsage": {"last": {"cachedInputTokens": 0, "inputTokens": 0, "outputTokens": 0, "reasoningOutputTokens": 0, "totalTokens": 0}, "total": {"cachedInputTokens": 0, "inputTokens": 0, "outputTokens": 0, "reasoningOutputTokens": 0, "totalTokens": 0}}, "turnId": "x"}),
258        ),
259        ("thread/unarchived", json!({"threadId": "x"})),
260        (
261            "turn/completed",
262            json!({"threadId": "x", "turn": {"id": "x", "items": [], "status": "completed"}}),
263        ),
264        (
265            "turn/diff/updated",
266            json!({"diff": "x", "threadId": "x", "turnId": "x"}),
267        ),
268        (
269            "turn/moderationMetadata",
270            json!({"metadata": null, "threadId": "x", "turnId": "x"}),
271        ),
272        (
273            "turn/plan/updated",
274            json!({"plan": [], "threadId": "x", "turnId": "x"}),
275        ),
276        (
277            "turn/started",
278            json!({"threadId": "x", "turn": {"id": "x", "items": [], "status": "completed"}}),
279        ),
280        ("warning", json!({"message": "x"})),
281        (
282            "windows/worldWritableWarning",
283            json!({"extraCount": 0, "failedScan": false, "samplePaths": []}),
284        ),
285        (
286            "windowsSandbox/setupCompleted",
287            json!({"mode": "elevated", "success": false}),
288        ),
289    ]
290}
291
292/// Client-request samples keyed by JSON-RPC method.
293pub fn client_request_samples() -> Vec<(&'static str, Value)> {
294    vec![
295        ("account/login/cancel", json!({"loginId": "x"})),
296        (
297            "account/login/start",
298            json!({"apiKey": "x", "type": "apiKey"}),
299        ),
300        ("account/logout", json!({})),
301        (
302            "account/rateLimitResetCredit/consume",
303            json!({"idempotencyKey": "x"}),
304        ),
305        ("account/rateLimits/read", json!({})),
306        ("account/read", json!({})),
307        ("account/securitySetup/read", json!({})),
308        (
309            "account/sendAddCreditsNudgeEmail",
310            json!({"creditType": "credits"}),
311        ),
312        ("account/usage/read", json!({})),
313        ("account/workspaceMessages/read", json!({})),
314        ("app/installed", json!({})),
315        ("app/list", json!({})),
316        ("app/read", json!({"appIds": []})),
317        ("command/exec", json!({"command": []})),
318        (
319            "command/exec/resize",
320            json!({"processId": "x", "size": null}),
321        ),
322        ("command/exec/terminate", json!({"processId": "x"})),
323        ("command/exec/write", json!({"processId": "x"})),
324        ("config/batchWrite", json!({"edits": []})),
325        ("config/mcpServer/reload", json!({})),
326        ("config/read", json!({})),
327        (
328            "config/value/write",
329            json!({"keyPath": "x", "mergeStrategy": "replace", "value": null}),
330        ),
331        ("configRequirements/read", json!({})),
332        (
333            "experimentalFeature/enablement/set",
334            json!({"enablement": {}}),
335        ),
336        ("experimentalFeature/list", json!({})),
337        ("externalAgentConfig/detect", json!({})),
338        ("externalAgentConfig/import", json!({"migrationItems": []})),
339        ("externalAgentConfig/import/readHistories", json!({})),
340        (
341            "externalAgentConfig/import/recordHistory",
342            json!({"itemTypeResults": [], "providerId": "x"}),
343        ),
344        (
345            "feedback/save",
346            json!({"classification": "x", "savePath": "/tmp/feedback.zip"}),
347        ),
348        ("feedback/upload", json!({"classification": "x"})),
349        (
350            "fs/copy",
351            json!({"destinationPath": null, "sourcePath": null}),
352        ),
353        ("fs/createDirectory", json!({"path": null})),
354        ("fs/getMetadata", json!({"path": null})),
355        ("fs/readDirectory", json!({"path": null})),
356        ("fs/readFile", json!({"path": null})),
357        ("fs/remove", json!({"path": null})),
358        ("fs/unwatch", json!({"watchId": "x"})),
359        ("fs/watch", json!({"path": null, "watchId": "x"})),
360        ("fs/writeFile", json!({"dataBase64": "x", "path": null})),
361        ("fuzzyFileSearch", json!({"query": "x", "roots": []})),
362        ("hooks/list", json!({})),
363        (
364            "initialize",
365            json!({"clientInfo": {"name": "x", "version": "x"}}),
366        ),
367        ("marketplace/add", json!({"source": "x"})),
368        ("marketplace/remove", json!({"marketplaceName": "x"})),
369        ("marketplace/upgrade", json!({})),
370        ("mcpServer/oauth/login", json!({"name": "x"})),
371        (
372            "mcpServer/resource/read",
373            json!({"server": "x", "uri": "x"}),
374        ),
375        (
376            "mcpServer/tool/call",
377            json!({"server": "x", "threadId": "x", "tool": "x"}),
378        ),
379        ("mcpServerStatus/list", json!({})),
380        ("model/list", json!({})),
381        ("modelProvider/capabilities/read", json!({})),
382        (
383            "modelProvider/config/write",
384            json!({"settings": {"type": "customGateway"}}),
385        ),
386        ("modelProvider/default/set", json!({"providerId": "openai"})),
387        ("modelProvider/list", json!({})),
388        ("permissionProfile/list", json!({})),
389        ("plugin/install", json!({"pluginName": "x"})),
390        ("plugin/installed", json!({})),
391        ("plugin/list", json!({})),
392        ("plugin/read", json!({"pluginName": "x"})),
393        ("plugin/reconcile", json!({})),
394        ("plugin/share/checkout", json!({"remotePluginId": "x"})),
395        ("plugin/share/delete", json!({"remotePluginId": "x"})),
396        ("plugin/share/list", json!({})),
397        ("plugin/share/save", json!({"pluginPath": "x"})),
398        (
399            "plugin/share/updateTargets",
400            json!({"discoverability": "UNLISTED", "remotePluginId": "x", "shareTargets": []}),
401        ),
402        (
403            "plugin/skill/read",
404            json!({"remoteMarketplaceName": "x", "remotePluginId": "x", "skillName": "x"}),
405        ),
406        ("plugin/uninstall", json!({"pluginId": "x"})),
407        (
408            "review/start",
409            json!({"target": {"type": "uncommittedChanges"}, "threadId": "x"}),
410        ),
411        ("skills/config/write", json!({"enabled": false})),
412        ("skills/extraRoots/set", json!({"extraRoots": []})),
413        ("skills/list", json!({})),
414        (
415            "thread/approveGuardianDeniedAction",
416            json!({"event": null, "threadId": "x"}),
417        ),
418        ("thread/archive", json!({"threadId": "x"})),
419        (
420            "thread/attachment/add",
421            json!({"attachmentType": "x", "identityKey": "x", "payload": null, "threadId": "x"}),
422        ),
423        ("thread/attachment/list", json!({"threadId": "x"})),
424        (
425            "thread/attachment/remove",
426            json!({"attachmentType": "x", "identityKey": "x", "threadId": "x"}),
427        ),
428        (
429            "thread/attachmentOwner/list",
430            json!({"attachmentType": "x", "identityKey": "x"}),
431        ),
432        ("thread/compact/start", json!({"threadId": "x"})),
433        ("thread/delete", json!({"threadId": "x"})),
434        ("thread/fork", json!({"threadId": "x"})),
435        ("thread/goal/clear", json!({"threadId": "x"})),
436        ("thread/goal/get", json!({"threadId": "x"})),
437        ("thread/goal/set", json!({"threadId": "x"})),
438        ("thread/inject_items", json!({"items": [], "threadId": "x"})),
439        ("thread/list", json!({})),
440        ("thread/loaded/list", json!({})),
441        ("thread/metadata/update", json!({"threadId": "x"})),
442        ("thread/name/set", json!({"name": "x", "threadId": "x"})),
443        ("thread/read", json!({"threadId": "x"})),
444        ("thread/resume", json!({"threadId": "x"})),
445        (
446            "thread/section/move",
447            json!({"sectionId": "x", "threadId": "x"}),
448        ),
449        (
450            "thread/shellCommand",
451            json!({"command": "x", "threadId": "x"}),
452        ),
453        ("thread/start", json!({})),
454        ("thread/unarchive", json!({"threadId": "x"})),
455        ("thread/unsubscribe", json!({"threadId": "x"})),
456        ("threadSection/create", json!({"name": "x"})),
457        ("threadSection/delete", json!({"sectionId": "x"})),
458        ("threadSection/list", json!({})),
459        (
460            "threadSection/update",
461            json!({"name": "x", "sectionId": "x"}),
462        ),
463        ("turn/interrupt", json!({"threadId": "x", "turnId": "x"})),
464        ("turn/start", json!({"input": [], "threadId": "x"})),
465        (
466            "turn/steer",
467            json!({"expectedTurnId": "x", "input": [], "threadId": "x"}),
468        ),
469        ("windowsSandbox/readiness", json!({})),
470        ("windowsSandbox/setupStart", json!({"mode": "elevated"})),
471    ]
472}
473
474/// Server-request (approval flow) samples keyed by JSON-RPC method.
475pub fn server_request_samples() -> Vec<(&'static str, Value)> {
476    vec![
477        (
478            "account/chatgptAuthTokens/refresh",
479            json!({"reason": "unauthorized"}),
480        ),
481        (
482            "applyPatchApproval",
483            json!({"callId": "x", "conversationId": "x", "fileChanges": {}}),
484        ),
485        ("attestation/generate", json!({})),
486        (
487            "execCommandApproval",
488            json!({"callId": "x", "command": [], "conversationId": "x", "cwd": "x", "parsedCmd": []}),
489        ),
490        (
491            "item/commandExecution/requestApproval",
492            json!({"itemId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
493        ),
494        (
495            "item/fileChange/requestApproval",
496            json!({"itemId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
497        ),
498        (
499            "item/permissions/requestApproval",
500            json!({"cwd": "x", "itemId": "x", "permissions": {}, "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
501        ),
502        (
503            "item/tool/call",
504            json!({"arguments": null, "callId": "x", "threadId": "x", "tool": "x", "turnId": "x"}),
505        ),
506        (
507            "item/tool/requestUserInput",
508            json!({"isBlocking": false, "itemId": "x", "questions": [], "threadId": "x", "turnId": "x"}),
509        ),
510        (
511            "mcpServer/elicitation/request",
512            json!({"message": "x", "mode": "form", "requestedSchema": {"properties": {}, "type": "object"}}),
513        ),
514    ]
515}