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