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