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