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