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        ("app/list/updated", json!({"data": []})),
12        (
13            "command/exec/outputDelta",
14            json!({"capReached": false, "deltaBase64": "x", "processId": "x", "stream": null}),
15        ),
16        ("configWarning", json!({"summary": "x"})),
17        ("deprecationNotice", json!({"summary": "x"})),
18        (
19            "error",
20            json!({"error": {"message": "x"}, "threadId": "x", "turnId": "x", "willRetry": false}),
21        ),
22        ("externalAgentConfig/import/completed", json!({})),
23        ("fs/changed", json!({"changedPaths": [], "watchId": "x"})),
24        (
25            "fuzzyFileSearch/sessionCompleted",
26            json!({"sessionId": "x"}),
27        ),
28        (
29            "fuzzyFileSearch/sessionUpdated",
30            json!({"files": [], "query": "x", "sessionId": "x"}),
31        ),
32        ("guardianWarning", json!({"message": "x", "threadId": "x"})),
33        (
34            "hook/completed",
35            json!({"run": {"displayOrder": 0, "entries": [], "eventName": "preToolUse", "executionMode": "sync", "handlerType": "command", "id": "x", "scope": "thread", "sourcePath": "x", "startedAt": 0, "status": "running"}, "threadId": "x"}),
36        ),
37        (
38            "hook/started",
39            json!({"run": {"displayOrder": 0, "entries": [], "eventName": "preToolUse", "executionMode": "sync", "handlerType": "command", "id": "x", "scope": "thread", "sourcePath": "x", "startedAt": 0, "status": "running"}, "threadId": "x"}),
40        ),
41        (
42            "item/agentMessage/delta",
43            json!({"delta": "x", "itemId": "x", "threadId": "x", "turnId": "x"}),
44        ),
45        (
46            "item/autoApprovalReview/completed",
47            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"}),
48        ),
49        (
50            "item/autoApprovalReview/started",
51            json!({"action": {"command": "x", "cwd": "x", "source": "shell", "type": "command"}, "review": {"status": "inProgress"}, "reviewId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
52        ),
53        (
54            "item/commandExecution/outputDelta",
55            json!({"delta": "x", "itemId": "x", "threadId": "x", "turnId": "x"}),
56        ),
57        (
58            "item/commandExecution/terminalInteraction",
59            json!({"itemId": "x", "processId": "x", "stdin": "x", "threadId": "x", "turnId": "x"}),
60        ),
61        (
62            "item/completed",
63            json!({"completedAtMs": 0, "item": {"content": [], "id": "x", "type": "userMessage"}, "threadId": "x", "turnId": "x"}),
64        ),
65        (
66            "item/fileChange/outputDelta",
67            json!({"delta": "x", "itemId": "x", "threadId": "x", "turnId": "x"}),
68        ),
69        (
70            "item/fileChange/patchUpdated",
71            json!({"changes": [], "itemId": "x", "threadId": "x", "turnId": "x"}),
72        ),
73        (
74            "item/mcpToolCall/progress",
75            json!({"itemId": "x", "message": "x", "threadId": "x", "turnId": "x"}),
76        ),
77        (
78            "item/plan/delta",
79            json!({"delta": "x", "itemId": "x", "threadId": "x", "turnId": "x"}),
80        ),
81        (
82            "item/reasoning/summaryPartAdded",
83            json!({"itemId": "x", "summaryIndex": 0, "threadId": "x", "turnId": "x"}),
84        ),
85        (
86            "item/reasoning/summaryTextDelta",
87            json!({"delta": "x", "itemId": "x", "summaryIndex": 0, "threadId": "x", "turnId": "x"}),
88        ),
89        (
90            "item/reasoning/textDelta",
91            json!({"contentIndex": 0, "delta": "x", "itemId": "x", "threadId": "x", "turnId": "x"}),
92        ),
93        (
94            "item/started",
95            json!({"item": {"content": [], "id": "x", "type": "userMessage"}, "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
96        ),
97        (
98            "mcpServer/oauthLogin/completed",
99            json!({"name": "x", "success": false}),
100        ),
101        (
102            "mcpServer/startupStatus/updated",
103            json!({"name": "x", "status": "starting"}),
104        ),
105        (
106            "model/rerouted",
107            json!({"fromModel": "x", "reason": "highRiskCyberActivity", "threadId": "x", "toModel": "x", "turnId": "x"}),
108        ),
109        (
110            "model/verification",
111            json!({"threadId": "x", "turnId": "x", "verifications": []}),
112        ),
113        (
114            "process/exited",
115            json!({"exitCode": 0, "processHandle": "x", "stderr": "x", "stderrCapReached": false, "stdout": "x", "stdoutCapReached": false}),
116        ),
117        (
118            "process/outputDelta",
119            json!({"capReached": false, "deltaBase64": "x", "processHandle": "x", "stream": null}),
120        ),
121        (
122            "remoteControl/status/changed",
123            json!({"installationId": "x", "serverName": "x", "status": "disabled"}),
124        ),
125        (
126            "serverRequest/resolved",
127            json!({"requestId": "x", "threadId": "x"}),
128        ),
129        ("skills/changed", json!({})),
130        ("thread/archived", json!({"threadId": "x"})),
131        ("thread/closed", json!({"threadId": "x"})),
132        ("thread/compacted", json!({"threadId": "x", "turnId": "x"})),
133        ("thread/goal/cleared", json!({"threadId": "x"})),
134        (
135            "thread/goal/updated",
136            json!({"goal": {"createdAt": 0, "objective": "x", "status": "active", "threadId": "x", "timeUsedSeconds": 0, "tokensUsed": 0, "updatedAt": 0}, "threadId": "x"}),
137        ),
138        ("thread/name/updated", json!({"threadId": "x"})),
139        ("thread/realtime/closed", json!({"threadId": "x"})),
140        (
141            "thread/realtime/error",
142            json!({"message": "x", "threadId": "x"}),
143        ),
144        (
145            "thread/realtime/itemAdded",
146            json!({"item": null, "threadId": "x"}),
147        ),
148        (
149            "thread/realtime/outputAudio/delta",
150            json!({"audio": {"data": "x", "numChannels": 0, "sampleRate": 0}, "threadId": "x"}),
151        ),
152        ("thread/realtime/sdp", json!({"sdp": "x", "threadId": "x"})),
153        (
154            "thread/realtime/started",
155            json!({"threadId": "x", "version": "v1"}),
156        ),
157        (
158            "thread/realtime/transcript/delta",
159            json!({"delta": "x", "role": "x", "threadId": "x"}),
160        ),
161        (
162            "thread/realtime/transcript/done",
163            json!({"role": "x", "text": "x", "threadId": "x"}),
164        ),
165        (
166            "thread/settings/updated",
167            json!({"threadId": "x", "threadSettings": {"approvalPolicy": "untrusted", "approvalsReviewer": "user", "collaborationMode": {"mode": "plan", "settings": {"model": "x"}}, "cwd": "x", "model": "x", "modelProvider": "x", "sandboxPolicy": {"type": "dangerFullAccess"}}}),
168        ),
169        (
170            "thread/started",
171            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}}),
172        ),
173        (
174            "thread/status/changed",
175            json!({"status": {"type": "notLoaded"}, "threadId": "x"}),
176        ),
177        (
178            "thread/tokenUsage/updated",
179            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"}),
180        ),
181        ("thread/unarchived", json!({"threadId": "x"})),
182        (
183            "turn/completed",
184            json!({"threadId": "x", "turn": {"id": "x", "items": [], "status": "completed"}}),
185        ),
186        (
187            "turn/diff/updated",
188            json!({"diff": "x", "threadId": "x", "turnId": "x"}),
189        ),
190        (
191            "turn/moderationMetadata",
192            json!({"metadata": null, "threadId": "x", "turnId": "x"}),
193        ),
194        (
195            "turn/plan/updated",
196            json!({"plan": [], "threadId": "x", "turnId": "x"}),
197        ),
198        (
199            "turn/started",
200            json!({"threadId": "x", "turn": {"id": "x", "items": [], "status": "completed"}}),
201        ),
202        ("warning", json!({"message": "x"})),
203        (
204            "windows/worldWritableWarning",
205            json!({"extraCount": 0, "failedScan": false, "samplePaths": []}),
206        ),
207        (
208            "windowsSandbox/setupCompleted",
209            json!({"mode": "elevated", "success": false}),
210        ),
211    ]
212}
213
214/// Client-request samples keyed by JSON-RPC method.
215pub fn client_request_samples() -> Vec<(&'static str, Value)> {
216    vec![
217        ("account/login/cancel", json!({"loginId": "x"})),
218        (
219            "account/login/start",
220            json!({"apiKey": "x", "type": "apiKey"}),
221        ),
222        ("account/logout", json!({})),
223        ("account/rateLimits/read", json!({})),
224        ("account/read", json!({})),
225        (
226            "account/sendAddCreditsNudgeEmail",
227            json!({"creditType": "credits"}),
228        ),
229        ("account/usage/read", json!({})),
230        ("app/list", json!({})),
231        ("command/exec", json!({"command": []})),
232        (
233            "command/exec/resize",
234            json!({"processId": "x", "size": null}),
235        ),
236        ("command/exec/terminate", json!({"processId": "x"})),
237        ("command/exec/write", json!({"processId": "x"})),
238        ("config/batchWrite", json!({"edits": []})),
239        ("config/mcpServer/reload", json!({})),
240        ("config/read", json!({})),
241        (
242            "config/value/write",
243            json!({"keyPath": "x", "mergeStrategy": "replace", "value": null}),
244        ),
245        ("configRequirements/read", json!({})),
246        (
247            "experimentalFeature/enablement/set",
248            json!({"enablement": {}}),
249        ),
250        ("experimentalFeature/list", json!({})),
251        ("externalAgentConfig/detect", json!({})),
252        ("externalAgentConfig/import", json!({"migrationItems": []})),
253        ("feedback/upload", json!({"classification": "x"})),
254        (
255            "fs/copy",
256            json!({"destinationPath": null, "sourcePath": null}),
257        ),
258        ("fs/createDirectory", json!({"path": null})),
259        ("fs/getMetadata", json!({"path": null})),
260        ("fs/readDirectory", json!({"path": null})),
261        ("fs/readFile", json!({"path": null})),
262        ("fs/remove", json!({"path": null})),
263        ("fs/unwatch", json!({"watchId": "x"})),
264        ("fs/watch", json!({"path": null, "watchId": "x"})),
265        ("fs/writeFile", json!({"dataBase64": "x", "path": null})),
266        ("fuzzyFileSearch", json!({"query": "x", "roots": []})),
267        ("hooks/list", json!({})),
268        (
269            "initialize",
270            json!({"clientInfo": {"name": "x", "version": "x"}}),
271        ),
272        ("marketplace/add", json!({"source": "x"})),
273        ("marketplace/remove", json!({"marketplaceName": "x"})),
274        ("marketplace/upgrade", json!({})),
275        ("mcpServer/oauth/login", json!({"name": "x"})),
276        (
277            "mcpServer/resource/read",
278            json!({"server": "x", "uri": "x"}),
279        ),
280        (
281            "mcpServer/tool/call",
282            json!({"server": "x", "threadId": "x", "tool": "x"}),
283        ),
284        ("mcpServerStatus/list", json!({})),
285        ("model/list", json!({})),
286        ("modelProvider/capabilities/read", json!({})),
287        ("permissionProfile/list", json!({})),
288        ("plugin/install", json!({"pluginName": "x"})),
289        ("plugin/installed", json!({})),
290        ("plugin/list", json!({})),
291        ("plugin/read", json!({"pluginName": "x"})),
292        ("plugin/share/checkout", json!({"remotePluginId": "x"})),
293        ("plugin/share/delete", json!({"remotePluginId": "x"})),
294        ("plugin/share/list", json!({})),
295        ("plugin/share/save", json!({"pluginPath": "x"})),
296        (
297            "plugin/share/updateTargets",
298            json!({"discoverability": "UNLISTED", "remotePluginId": "x", "shareTargets": []}),
299        ),
300        (
301            "plugin/skill/read",
302            json!({"remoteMarketplaceName": "x", "remotePluginId": "x", "skillName": "x"}),
303        ),
304        ("plugin/uninstall", json!({"pluginId": "x"})),
305        (
306            "review/start",
307            json!({"target": {"type": "uncommittedChanges"}, "threadId": "x"}),
308        ),
309        ("skills/config/write", json!({"enabled": false})),
310        ("skills/extraRoots/set", json!({"extraRoots": []})),
311        ("skills/list", json!({})),
312        (
313            "thread/approveGuardianDeniedAction",
314            json!({"event": null, "threadId": "x"}),
315        ),
316        ("thread/archive", json!({"threadId": "x"})),
317        ("thread/compact/start", json!({"threadId": "x"})),
318        ("thread/fork", json!({"threadId": "x"})),
319        ("thread/goal/clear", json!({"threadId": "x"})),
320        ("thread/goal/get", json!({"threadId": "x"})),
321        ("thread/goal/set", json!({"threadId": "x"})),
322        ("thread/inject_items", json!({"items": [], "threadId": "x"})),
323        ("thread/list", json!({})),
324        ("thread/loaded/list", json!({})),
325        ("thread/metadata/update", json!({"threadId": "x"})),
326        ("thread/name/set", json!({"name": "x", "threadId": "x"})),
327        ("thread/read", json!({"threadId": "x"})),
328        ("thread/resume", json!({"threadId": "x"})),
329        ("thread/rollback", json!({"numTurns": 0, "threadId": "x"})),
330        (
331            "thread/shellCommand",
332            json!({"command": "x", "threadId": "x"}),
333        ),
334        ("thread/start", json!({})),
335        ("thread/unarchive", json!({"threadId": "x"})),
336        ("thread/unsubscribe", json!({"threadId": "x"})),
337        ("turn/interrupt", json!({"threadId": "x", "turnId": "x"})),
338        ("turn/start", json!({"input": [], "threadId": "x"})),
339        (
340            "turn/steer",
341            json!({"expectedTurnId": "x", "input": [], "threadId": "x"}),
342        ),
343        ("windowsSandbox/readiness", json!({})),
344        ("windowsSandbox/setupStart", json!({"mode": "elevated"})),
345    ]
346}
347
348/// Server-request (approval flow) samples keyed by JSON-RPC method.
349pub fn server_request_samples() -> Vec<(&'static str, Value)> {
350    vec![
351        (
352            "account/chatgptAuthTokens/refresh",
353            json!({"reason": "unauthorized"}),
354        ),
355        (
356            "applyPatchApproval",
357            json!({"callId": "x", "conversationId": "x", "fileChanges": {}}),
358        ),
359        ("attestation/generate", json!({})),
360        (
361            "execCommandApproval",
362            json!({"callId": "x", "command": [], "conversationId": "x", "cwd": "x", "parsedCmd": []}),
363        ),
364        (
365            "item/commandExecution/requestApproval",
366            json!({"itemId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
367        ),
368        (
369            "item/fileChange/requestApproval",
370            json!({"itemId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
371        ),
372        (
373            "item/permissions/requestApproval",
374            json!({"cwd": "x", "itemId": "x", "permissions": {}, "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
375        ),
376        (
377            "item/tool/call",
378            json!({"arguments": null, "callId": "x", "threadId": "x", "tool": "x", "turnId": "x"}),
379        ),
380        (
381            "item/tool/requestUserInput",
382            json!({"itemId": "x", "questions": [], "threadId": "x", "turnId": "x"}),
383        ),
384        (
385            "mcpServer/elicitation/request",
386            json!({"message": "x", "mode": "form", "requestedSchema": {"properties": {}, "type": "object"}}),
387        ),
388    ]
389}