1use serde_json::{json, Value};
4
5pub 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", "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/started",
167 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}}),
168 ),
169 (
170 "thread/status/changed",
171 json!({"status": {"type": "notLoaded"}, "threadId": "x"}),
172 ),
173 (
174 "thread/tokenUsage/updated",
175 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"}),
176 ),
177 ("thread/unarchived", json!({"threadId": "x"})),
178 (
179 "turn/completed",
180 json!({"threadId": "x", "turn": {"id": "x", "items": [], "status": "completed"}}),
181 ),
182 (
183 "turn/diff/updated",
184 json!({"diff": "x", "threadId": "x", "turnId": "x"}),
185 ),
186 (
187 "turn/plan/updated",
188 json!({"plan": [], "threadId": "x", "turnId": "x"}),
189 ),
190 (
191 "turn/started",
192 json!({"threadId": "x", "turn": {"id": "x", "items": [], "status": "completed"}}),
193 ),
194 ("warning", json!({"message": "x"})),
195 (
196 "windows/worldWritableWarning",
197 json!({"extraCount": 0, "failedScan": false, "samplePaths": []}),
198 ),
199 (
200 "windowsSandbox/setupCompleted",
201 json!({"mode": "elevated", "success": false}),
202 ),
203 ]
204}
205
206pub fn client_request_samples() -> Vec<(&'static str, Value)> {
208 vec![
209 ("account/login/cancel", json!({"loginId": "x"})),
210 (
211 "account/login/start",
212 json!({"apiKey": "x", "type": "apiKey"}),
213 ),
214 ("account/logout", json!({})),
215 ("account/rateLimits/read", json!({})),
216 ("account/read", json!({})),
217 (
218 "account/sendAddCreditsNudgeEmail",
219 json!({"creditType": "credits"}),
220 ),
221 ("app/list", json!({})),
222 ("command/exec", json!({"command": []})),
223 (
224 "command/exec/resize",
225 json!({"processId": "x", "size": null}),
226 ),
227 ("command/exec/terminate", json!({"processId": "x"})),
228 ("command/exec/write", json!({"processId": "x"})),
229 ("config/batchWrite", json!({"edits": []})),
230 ("config/mcpServer/reload", json!({})),
231 ("config/read", json!({})),
232 (
233 "config/value/write",
234 json!({"keyPath": "x", "mergeStrategy": "replace", "value": null}),
235 ),
236 ("configRequirements/read", json!({})),
237 (
238 "experimentalFeature/enablement/set",
239 json!({"enablement": {}}),
240 ),
241 ("experimentalFeature/list", json!({})),
242 ("externalAgentConfig/detect", json!({})),
243 ("externalAgentConfig/import", json!({"migrationItems": []})),
244 (
245 "feedback/upload",
246 json!({"classification": "x", "includeLogs": false}),
247 ),
248 (
249 "fs/copy",
250 json!({"destinationPath": null, "sourcePath": null}),
251 ),
252 ("fs/createDirectory", json!({"path": null})),
253 ("fs/getMetadata", json!({"path": null})),
254 ("fs/readDirectory", json!({"path": null})),
255 ("fs/readFile", json!({"path": null})),
256 ("fs/remove", json!({"path": null})),
257 ("fs/unwatch", json!({"watchId": "x"})),
258 ("fs/watch", json!({"path": null, "watchId": "x"})),
259 ("fs/writeFile", json!({"dataBase64": "x", "path": null})),
260 ("fuzzyFileSearch", json!({"query": "x", "roots": []})),
261 ("hooks/list", json!({})),
262 (
263 "initialize",
264 json!({"clientInfo": {"name": "x", "version": "x"}}),
265 ),
266 ("marketplace/add", json!({"source": "x"})),
267 ("marketplace/remove", json!({"marketplaceName": "x"})),
268 ("marketplace/upgrade", json!({})),
269 ("mcpServer/oauth/login", json!({"name": "x"})),
270 (
271 "mcpServer/resource/read",
272 json!({"server": "x", "uri": "x"}),
273 ),
274 (
275 "mcpServer/tool/call",
276 json!({"server": "x", "threadId": "x", "tool": "x"}),
277 ),
278 ("mcpServerStatus/list", json!({})),
279 ("model/list", json!({})),
280 ("modelProvider/capabilities/read", json!({})),
281 ("plugin/install", json!({"pluginName": "x"})),
282 ("plugin/list", json!({})),
283 ("plugin/read", json!({"pluginName": "x"})),
284 ("plugin/share/checkout", json!({"remotePluginId": "x"})),
285 ("plugin/share/delete", json!({"remotePluginId": "x"})),
286 ("plugin/share/list", json!({})),
287 ("plugin/share/save", json!({"pluginPath": "x"})),
288 (
289 "plugin/share/updateTargets",
290 json!({"discoverability": "UNLISTED", "remotePluginId": "x", "shareTargets": []}),
291 ),
292 (
293 "plugin/skill/read",
294 json!({"remoteMarketplaceName": "x", "remotePluginId": "x", "skillName": "x"}),
295 ),
296 ("plugin/uninstall", json!({"pluginId": "x"})),
297 (
298 "review/start",
299 json!({"target": {"type": "uncommittedChanges"}, "threadId": "x"}),
300 ),
301 ("skills/config/write", json!({"enabled": false})),
302 ("skills/list", json!({})),
303 (
304 "thread/approveGuardianDeniedAction",
305 json!({"event": null, "threadId": "x"}),
306 ),
307 ("thread/archive", json!({"threadId": "x"})),
308 ("thread/compact/start", json!({"threadId": "x"})),
309 ("thread/fork", json!({"threadId": "x"})),
310 ("thread/inject_items", json!({"items": [], "threadId": "x"})),
311 ("thread/list", json!({})),
312 ("thread/loaded/list", json!({})),
313 ("thread/metadata/update", json!({"threadId": "x"})),
314 ("thread/name/set", json!({"name": "x", "threadId": "x"})),
315 ("thread/read", json!({"threadId": "x"})),
316 ("thread/resume", json!({"threadId": "x"})),
317 ("thread/rollback", json!({"numTurns": 0, "threadId": "x"})),
318 (
319 "thread/shellCommand",
320 json!({"command": "x", "threadId": "x"}),
321 ),
322 ("thread/start", json!({})),
323 ("thread/unarchive", json!({"threadId": "x"})),
324 ("thread/unsubscribe", json!({"threadId": "x"})),
325 ("turn/interrupt", json!({"threadId": "x", "turnId": "x"})),
326 ("turn/start", json!({"input": [], "threadId": "x"})),
327 (
328 "turn/steer",
329 json!({"expectedTurnId": "x", "input": [], "threadId": "x"}),
330 ),
331 ("windowsSandbox/readiness", json!({})),
332 ("windowsSandbox/setupStart", json!({"mode": "elevated"})),
333 ]
334}
335
336pub fn server_request_samples() -> Vec<(&'static str, Value)> {
338 vec![
339 (
340 "account/chatgptAuthTokens/refresh",
341 json!({"reason": "unauthorized"}),
342 ),
343 (
344 "applyPatchApproval",
345 json!({"callId": "x", "conversationId": "x", "fileChanges": {}}),
346 ),
347 ("attestation/generate", json!({})),
348 (
349 "execCommandApproval",
350 json!({"callId": "x", "command": [], "conversationId": "x", "cwd": "x", "parsedCmd": []}),
351 ),
352 (
353 "item/commandExecution/requestApproval",
354 json!({"itemId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
355 ),
356 (
357 "item/fileChange/requestApproval",
358 json!({"itemId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
359 ),
360 (
361 "item/permissions/requestApproval",
362 json!({"cwd": "x", "itemId": "x", "permissions": {}, "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
363 ),
364 (
365 "item/tool/call",
366 json!({"arguments": null, "callId": "x", "threadId": "x", "tool": "x", "turnId": "x"}),
367 ),
368 (
369 "item/tool/requestUserInput",
370 json!({"itemId": "x", "questions": [], "threadId": "x", "turnId": "x"}),
371 ),
372 (
373 "mcpServer/elicitation/request",
374 json!({"message": "x", "mode": "form", "requestedSchema": {"properties": {}, "type": "object"}}),
375 ),
376 ]
377}