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 (
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/project/updated",
189 json!({"projectId": "x", "threadId": "x"}),
190 ),
191 ("thread/queue/changed", json!({"threadId": "x"})),
192 ("thread/realtime/closed", json!({"threadId": "x"})),
193 (
194 "thread/realtime/error",
195 json!({"message": "x", "threadId": "x"}),
196 ),
197 (
198 "thread/realtime/item/completed",
199 json!({"item": {"type": "realtimeSessionStarted"}, "threadId": "x"}),
200 ),
201 (
202 "thread/realtime/item/started",
203 json!({"item": {"type": "realtimeSessionStarted"}, "threadId": "x"}),
204 ),
205 (
206 "thread/realtime/item/transcript/delta",
207 json!({"delta": "x", "itemId": "x", "threadId": "x"}),
208 ),
209 (
210 "thread/realtime/itemAdded",
211 json!({"item": null, "threadId": "x"}),
212 ),
213 (
214 "thread/realtime/outputAudio/delta",
215 json!({"audio": {"data": "x", "numChannels": 0, "sampleRate": 0}, "threadId": "x"}),
216 ),
217 ("thread/realtime/sdp", json!({"sdp": "x", "threadId": "x"})),
218 (
219 "thread/realtime/started",
220 json!({"threadId": "x", "version": "v1"}),
221 ),
222 (
223 "thread/realtime/transcript/delta",
224 json!({"delta": "x", "role": "x", "threadId": "x"}),
225 ),
226 (
227 "thread/realtime/transcript/done",
228 json!({"role": "x", "text": "x", "threadId": "x"}),
229 ),
230 ("thread/reverted", json!({"threadId": "x"})),
231 (
232 "thread/settings/updated",
233 json!({"threadId": "x", "threadSettings": {"approvalPolicy": "untrusted", "approvalsReviewer": "user", "collaborationMode": {"mode": "plan", "settings": {"model": "x"}}, "cwd": "x", "model": "x", "modelProvider": "x", "sandboxPolicy": {"type": "dangerFullAccess"}}}),
234 ),
235 (
236 "thread/started",
237 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}}),
238 ),
239 (
240 "thread/status/changed",
241 json!({"status": {"type": "notLoaded"}, "threadId": "x"}),
242 ),
243 (
244 "thread/tokenUsage/updated",
245 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"}),
246 ),
247 ("thread/unarchived", json!({"threadId": "x"})),
248 (
249 "turn/completed",
250 json!({"threadId": "x", "turn": {"id": "x", "items": [], "status": "completed"}}),
251 ),
252 (
253 "turn/diff/updated",
254 json!({"diff": "x", "threadId": "x", "turnId": "x"}),
255 ),
256 (
257 "turn/moderationMetadata",
258 json!({"metadata": null, "threadId": "x", "turnId": "x"}),
259 ),
260 (
261 "turn/plan/updated",
262 json!({"plan": [], "threadId": "x", "turnId": "x"}),
263 ),
264 (
265 "turn/started",
266 json!({"threadId": "x", "turn": {"id": "x", "items": [], "status": "completed"}}),
267 ),
268 ("warning", json!({"message": "x"})),
269 (
270 "windows/worldWritableWarning",
271 json!({"extraCount": 0, "failedScan": false, "samplePaths": []}),
272 ),
273 (
274 "windowsSandbox/setupCompleted",
275 json!({"mode": "elevated", "success": false}),
276 ),
277 ]
278}
279
280pub fn client_request_samples() -> Vec<(&'static str, Value)> {
282 vec![
283 ("account/login/cancel", json!({"loginId": "x"})),
284 (
285 "account/login/start",
286 json!({"apiKey": "x", "type": "apiKey"}),
287 ),
288 ("account/logout", json!({})),
289 (
290 "account/rateLimitResetCredit/consume",
291 json!({"idempotencyKey": "x"}),
292 ),
293 ("account/rateLimits/read", json!({})),
294 ("account/read", json!({})),
295 (
296 "account/sendAddCreditsNudgeEmail",
297 json!({"creditType": "credits"}),
298 ),
299 ("account/usage/read", json!({})),
300 ("account/workspaceMessages/read", json!({})),
301 ("app/installed", json!({})),
302 ("app/list", json!({})),
303 ("app/read", json!({"appIds": []})),
304 ("command/exec", json!({"command": []})),
305 (
306 "command/exec/resize",
307 json!({"processId": "x", "size": null}),
308 ),
309 ("command/exec/terminate", json!({"processId": "x"})),
310 ("command/exec/write", json!({"processId": "x"})),
311 ("config/batchWrite", json!({"edits": []})),
312 ("config/mcpServer/reload", json!({})),
313 ("config/read", json!({})),
314 (
315 "config/value/write",
316 json!({"keyPath": "x", "mergeStrategy": "replace", "value": null}),
317 ),
318 ("configRequirements/read", json!({})),
319 (
320 "experimentalFeature/enablement/set",
321 json!({"enablement": {}}),
322 ),
323 ("experimentalFeature/list", json!({})),
324 ("externalAgentConfig/detect", json!({})),
325 ("externalAgentConfig/import", json!({"migrationItems": []})),
326 ("externalAgentConfig/import/readHistories", json!({})),
327 (
328 "externalAgentConfig/import/recordHistory",
329 json!({"itemTypeResults": [], "providerId": "x"}),
330 ),
331 ("feedback/upload", json!({"classification": "x"})),
332 (
333 "fs/copy",
334 json!({"destinationPath": null, "sourcePath": null}),
335 ),
336 ("fs/createDirectory", json!({"path": null})),
337 ("fs/getMetadata", json!({"path": null})),
338 ("fs/readDirectory", json!({"path": null})),
339 ("fs/readFile", json!({"path": null})),
340 ("fs/remove", json!({"path": null})),
341 ("fs/unwatch", json!({"watchId": "x"})),
342 ("fs/watch", json!({"path": null, "watchId": "x"})),
343 ("fs/writeFile", json!({"dataBase64": "x", "path": null})),
344 ("fuzzyFileSearch", json!({"query": "x", "roots": []})),
345 ("hooks/list", json!({})),
346 (
347 "initialize",
348 json!({"clientInfo": {"name": "x", "version": "x"}}),
349 ),
350 ("marketplace/add", json!({"source": "x"})),
351 ("marketplace/remove", json!({"marketplaceName": "x"})),
352 ("marketplace/upgrade", json!({})),
353 ("mcpServer/oauth/login", json!({"name": "x"})),
354 (
355 "mcpServer/resource/read",
356 json!({"server": "x", "uri": "x"}),
357 ),
358 (
359 "mcpServer/tool/call",
360 json!({"server": "x", "threadId": "x", "tool": "x"}),
361 ),
362 ("mcpServerStatus/list", json!({})),
363 ("model/list", json!({})),
364 ("modelProvider/capabilities/read", json!({})),
365 ("permissionProfile/list", json!({})),
366 ("plugin/install", json!({"pluginName": "x"})),
367 ("plugin/installed", json!({})),
368 ("plugin/list", json!({})),
369 ("plugin/read", json!({"pluginName": "x"})),
370 ("plugin/reconcile", json!({})),
371 ("plugin/share/checkout", json!({"remotePluginId": "x"})),
372 ("plugin/share/delete", json!({"remotePluginId": "x"})),
373 ("plugin/share/list", json!({})),
374 ("plugin/share/save", json!({"pluginPath": "x"})),
375 (
376 "plugin/share/updateTargets",
377 json!({"discoverability": "UNLISTED", "remotePluginId": "x", "shareTargets": []}),
378 ),
379 (
380 "plugin/skill/read",
381 json!({"remoteMarketplaceName": "x", "remotePluginId": "x", "skillName": "x"}),
382 ),
383 ("plugin/uninstall", json!({"pluginId": "x"})),
384 (
385 "review/start",
386 json!({"target": {"type": "uncommittedChanges"}, "threadId": "x"}),
387 ),
388 ("skills/config/write", json!({"enabled": false})),
389 ("skills/extraRoots/set", json!({"extraRoots": []})),
390 ("skills/list", json!({})),
391 (
392 "thread/approveGuardianDeniedAction",
393 json!({"event": null, "threadId": "x"}),
394 ),
395 ("thread/archive", json!({"threadId": "x"})),
396 (
397 "thread/attachment/add",
398 json!({"attachmentType": "x", "identityKey": "x", "payload": null, "threadId": "x"}),
399 ),
400 ("thread/attachment/list", json!({"threadId": "x"})),
401 (
402 "thread/attachment/remove",
403 json!({"attachmentType": "x", "identityKey": "x", "threadId": "x"}),
404 ),
405 ("thread/compact/start", json!({"threadId": "x"})),
406 ("thread/delete", json!({"threadId": "x"})),
407 ("thread/fork", json!({"threadId": "x"})),
408 ("thread/goal/clear", json!({"threadId": "x"})),
409 ("thread/goal/get", json!({"threadId": "x"})),
410 ("thread/goal/set", json!({"threadId": "x"})),
411 ("thread/inject_items", json!({"items": [], "threadId": "x"})),
412 ("thread/list", json!({})),
413 ("thread/loaded/list", json!({})),
414 ("thread/metadata/update", json!({"threadId": "x"})),
415 ("thread/name/set", json!({"name": "x", "threadId": "x"})),
416 ("thread/read", json!({"threadId": "x"})),
417 ("thread/resume", json!({"threadId": "x"})),
418 (
419 "thread/section/move",
420 json!({"sectionId": "x", "threadId": "x"}),
421 ),
422 (
423 "thread/shellCommand",
424 json!({"command": "x", "threadId": "x"}),
425 ),
426 ("thread/start", json!({})),
427 ("thread/unarchive", json!({"threadId": "x"})),
428 ("thread/unsubscribe", json!({"threadId": "x"})),
429 ("threadSection/create", json!({"name": "x"})),
430 ("threadSection/delete", json!({"sectionId": "x"})),
431 ("threadSection/list", json!({})),
432 (
433 "threadSection/update",
434 json!({"name": "x", "sectionId": "x"}),
435 ),
436 ("turn/interrupt", json!({"threadId": "x", "turnId": "x"})),
437 ("turn/start", json!({"input": [], "threadId": "x"})),
438 (
439 "turn/steer",
440 json!({"expectedTurnId": "x", "input": [], "threadId": "x"}),
441 ),
442 ("windowsSandbox/readiness", json!({})),
443 ("windowsSandbox/setupStart", json!({"mode": "elevated"})),
444 ]
445}
446
447pub fn server_request_samples() -> Vec<(&'static str, Value)> {
449 vec![
450 (
451 "account/chatgptAuthTokens/refresh",
452 json!({"reason": "unauthorized"}),
453 ),
454 (
455 "applyPatchApproval",
456 json!({"callId": "x", "conversationId": "x", "fileChanges": {}}),
457 ),
458 ("attestation/generate", json!({})),
459 (
460 "execCommandApproval",
461 json!({"callId": "x", "command": [], "conversationId": "x", "cwd": "x", "parsedCmd": []}),
462 ),
463 (
464 "item/commandExecution/requestApproval",
465 json!({"itemId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
466 ),
467 (
468 "item/fileChange/requestApproval",
469 json!({"itemId": "x", "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
470 ),
471 (
472 "item/permissions/requestApproval",
473 json!({"cwd": "x", "itemId": "x", "permissions": {}, "startedAtMs": 0, "threadId": "x", "turnId": "x"}),
474 ),
475 (
476 "item/tool/call",
477 json!({"arguments": null, "callId": "x", "threadId": "x", "tool": "x", "turnId": "x"}),
478 ),
479 (
480 "item/tool/requestUserInput",
481 json!({"isBlocking": false, "itemId": "x", "questions": [], "threadId": "x", "turnId": "x"}),
482 ),
483 (
484 "mcpServer/elicitation/request",
485 json!({"message": "x", "mode": "form", "requestedSchema": {"properties": {}, "type": "object"}}),
486 ),
487 ]
488}