kennel 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (872) hide show
  1. package/README.md +18 -5
  2. package/dist/cli/dispatch.js +9 -0
  3. package/dist/cli/src/automations/notifications.d.ts +40 -0
  4. package/dist/cli/src/automations/notifications.js +220 -0
  5. package/dist/cli/src/cli/dispatch.d.ts +1 -0
  6. package/dist/cli/src/cli/dispatch.js +125 -0
  7. package/dist/cli/src/cli/usage.d.ts +1 -0
  8. package/dist/cli/src/cli/usage.js +25 -0
  9. package/dist/cli/src/core/api-client.d.ts +13 -0
  10. package/dist/cli/src/core/api-client.js +1 -0
  11. package/dist/cli/src/core/command.d.ts +1 -0
  12. package/dist/cli/src/core/command.js +69 -0
  13. package/dist/cli/src/core/core-folders.d.ts +1 -0
  14. package/dist/cli/src/core/core-folders.js +42 -0
  15. package/dist/cli/src/core/init.d.ts +1 -0
  16. package/dist/cli/src/core/init.js +141 -0
  17. package/dist/cli/src/core/runtime.d.ts +14 -0
  18. package/dist/cli/src/core/runtime.js +1 -0
  19. package/dist/cli/src/deploy/cloudflare.d.ts +6 -0
  20. package/dist/cli/src/deploy/cloudflare.js +100 -0
  21. package/dist/cli/src/deploy/environment.d.ts +2 -0
  22. package/dist/cli/src/deploy/environment.js +47 -0
  23. package/dist/cli/src/deploy/smoke-tests.d.ts +4 -0
  24. package/dist/cli/src/deploy/smoke-tests.js +92 -0
  25. package/dist/cli/src/deploy/trigger-dev.d.ts +2 -0
  26. package/dist/cli/src/deploy/trigger-dev.js +255 -0
  27. package/dist/cli/src/deploy/vercel.d.ts +3 -0
  28. package/dist/cli/src/deploy/vercel.js +67 -0
  29. package/dist/cli/src/main.d.ts +1 -0
  30. package/dist/cli/src/main.js +9 -0
  31. package/dist/cli/src/mcp/agent-tools.d.ts +8 -0
  32. package/dist/cli/src/mcp/agent-tools.js +247 -0
  33. package/dist/cli/src/mcp/config.d.ts +25 -0
  34. package/dist/cli/src/mcp/config.js +185 -0
  35. package/dist/cli/src/mcp/function-source.d.ts +7 -0
  36. package/dist/cli/src/mcp/function-source.js +42 -0
  37. package/dist/cli/src/mcp/generate.d.ts +1 -0
  38. package/dist/cli/src/mcp/generate.js +47 -0
  39. package/dist/cli/src/mcp/install-page.d.ts +12 -0
  40. package/dist/cli/src/mcp/install-page.js +5 -0
  41. package/dist/cli/src/notifications/email-worker.d.ts +8 -0
  42. package/dist/cli/src/notifications/email-worker.js +137 -0
  43. package/dist/cli/src/package/mcp-data.d.ts +1 -0
  44. package/dist/cli/src/package/mcp-data.js +1 -0
  45. package/dist/cli/src/package/mcp-email-worker.d.ts +1 -0
  46. package/dist/cli/src/package/mcp-email-worker.js +1 -0
  47. package/dist/cli/src/package/mcp-http.d.ts +1 -0
  48. package/dist/cli/src/package/mcp-http.js +1 -0
  49. package/dist/cli/src/package/mcp-stdio.d.ts +1 -0
  50. package/dist/cli/src/package/mcp-stdio.js +1 -0
  51. package/dist/cli/src/package/mcp.d.ts +1 -0
  52. package/dist/cli/src/package/mcp.js +1 -0
  53. package/dist/cli/src/package/preview.d.ts +9 -0
  54. package/dist/cli/src/package/preview.js +1 -0
  55. package/dist/cli/src/plugins/external.d.ts +36 -0
  56. package/dist/cli/src/plugins/external.js +503 -0
  57. package/dist/cli/src/publish/cloudflare-init.d.ts +12 -0
  58. package/dist/cli/src/publish/cloudflare-init.js +101 -0
  59. package/dist/cli/src/publish/config.d.ts +28 -0
  60. package/dist/cli/src/publish/config.js +178 -0
  61. package/dist/cli/src/publish/options.d.ts +13 -0
  62. package/dist/cli/src/publish/options.js +78 -0
  63. package/dist/cli/src/publish/vercel-init.d.ts +9 -0
  64. package/dist/cli/src/publish/vercel-init.js +52 -0
  65. package/dist/cli/src/shared/json.d.ts +4 -0
  66. package/dist/cli/src/shared/json.js +56 -0
  67. package/dist/cli/src/shared/object.d.ts +2 -0
  68. package/dist/cli/src/shared/object.js +3 -0
  69. package/dist/cli/src/shared/package-manager.d.ts +11 -0
  70. package/dist/cli/src/shared/package-manager.js +39 -0
  71. package/dist/cli/src/shared/path.d.ts +4 -0
  72. package/dist/cli/src/shared/path.js +40 -0
  73. package/dist/cli/src/shared/process.d.ts +7 -0
  74. package/dist/cli/src/shared/process.js +12 -0
  75. package/dist/cli/src/shared/project-config.d.ts +2 -0
  76. package/dist/cli/src/shared/project-config.js +26 -0
  77. package/dist/cli/src/site/dev.d.ts +10 -0
  78. package/dist/cli/src/site/dev.js +126 -0
  79. package/dist/cli/src/site/extension.d.ts +8 -0
  80. package/dist/cli/src/site/extension.js +113 -0
  81. package/dist/cli/src/site/folder-icons.d.ts +46 -0
  82. package/dist/cli/src/site/folder-icons.js +86 -0
  83. package/dist/cli/src/site/hot-viewer.d.ts +2 -0
  84. package/dist/cli/src/site/hot-viewer.js +231 -0
  85. package/dist/cli/src/site/kinds.d.ts +1 -0
  86. package/dist/cli/src/site/kinds.js +1 -0
  87. package/dist/cli/src/site/mail.d.ts +1 -0
  88. package/dist/cli/src/site/mail.js +10 -0
  89. package/dist/cli/src/site/renderers.d.ts +61 -0
  90. package/dist/cli/src/site/renderers.js +219 -0
  91. package/dist/cli/src/site/server-plugins.d.ts +54 -0
  92. package/dist/cli/src/site/server-plugins.js +1 -0
  93. package/dist/cli/src/site/viewer.d.ts +36 -0
  94. package/dist/cli/src/site/viewer.js +352 -0
  95. package/dist/cli/src/site/vitepress.d.ts +1 -0
  96. package/dist/cli/src/site/vitepress.js +1 -0
  97. package/dist/cli/usage.js +1 -0
  98. package/dist/core/api-client.js +75 -44
  99. package/dist/core/command.js +6 -3
  100. package/dist/core/core-folders.js +38280 -33
  101. package/dist/core/init.js +59 -4
  102. package/dist/core/runtime.js +57163 -41853
  103. package/dist/package/preview.js +40589 -17894
  104. package/dist/plugins/external.d.ts +36 -0
  105. package/dist/plugins/external.js +503 -0
  106. package/dist/site/server-plugins.js +394 -59
  107. package/dist/site/viewer.js +18 -5
  108. package/kernel/apps/web/.env.example +11 -0
  109. package/kernel/apps/web/components.json +20 -0
  110. package/kernel/apps/web/eslint.config.mjs +60 -0
  111. package/kernel/apps/web/index.html +17 -0
  112. package/kernel/apps/web/package.json +79 -0
  113. package/kernel/apps/web/public/favicon.svg +6 -0
  114. package/kernel/apps/web/public/providers/claude.svg +1 -0
  115. package/kernel/apps/web/public/providers/codex.svg +1 -0
  116. package/kernel/apps/web/public/providers/cursor.svg +1 -0
  117. package/kernel/apps/web/public/providers/opencode.svg +1 -0
  118. package/kernel/apps/web/public/providers/pi.svg +1 -0
  119. package/kernel/apps/web/server/acp/index.ts +1 -0
  120. package/kernel/apps/web/server/acp/live-agent-connection.ts +1 -0
  121. package/kernel/apps/web/server/acp/process-manager.ts +1 -0
  122. package/kernel/apps/web/server/acp/registry.ts +1 -0
  123. package/kernel/apps/web/server/acp/sdk.ts +1 -0
  124. package/kernel/apps/web/server/acp/transport.ts +1 -0
  125. package/kernel/apps/web/server/acp/types.ts +1 -0
  126. package/kernel/apps/web/server/acp-live-plugin.ts +30 -0
  127. package/kernel/apps/web/server/api/document-edit.ts +1 -0
  128. package/kernel/apps/web/server/api/open-path.ts +1 -0
  129. package/kernel/apps/web/server/core-plugin.ts +49 -0
  130. package/kernel/apps/web/server/folder-favicon.ts +1 -0
  131. package/kernel/apps/web/server/folder-icons.ts +1 -0
  132. package/kernel/apps/web/server/folder-metadata-plugin.ts +31 -0
  133. package/kernel/apps/web/server/plugins.ts +1 -0
  134. package/kernel/apps/web/server/preview-kinds.ts +1 -0
  135. package/kernel/apps/web/src/ai-input.tsx +62 -0
  136. package/kernel/apps/web/src/annotations.tsx +430 -0
  137. package/kernel/apps/web/src/api/client.ts +3 -0
  138. package/kernel/apps/web/src/api/errors.ts +1 -0
  139. package/kernel/apps/web/src/api/events.ts +42 -0
  140. package/kernel/apps/web/src/app.css +332 -0
  141. package/kernel/apps/web/src/app.tsx +667 -0
  142. package/kernel/apps/web/src/ask-draft.ts +164 -0
  143. package/kernel/apps/web/src/ask-tray.tsx +256 -0
  144. package/kernel/apps/web/src/comment-editor.tsx +93 -0
  145. package/kernel/apps/web/src/comment-form.tsx +162 -0
  146. package/kernel/apps/web/src/copy-path.ts +18 -0
  147. package/kernel/apps/web/src/deferred-ask-tray.tsx +20 -0
  148. package/kernel/apps/web/src/document-url.ts +46 -0
  149. package/kernel/apps/web/src/documents-url.ts +23 -0
  150. package/kernel/apps/web/src/dropped-folder.ts +64 -0
  151. package/kernel/apps/web/src/external-plugins.ts +3 -0
  152. package/kernel/apps/web/src/file-viewer.tsx +171 -0
  153. package/kernel/apps/web/src/folder-filter-icons.tsx +39 -0
  154. package/kernel/apps/web/src/folder-metadata.ts +76 -0
  155. package/kernel/apps/web/src/folder-plugin-view.tsx +87 -0
  156. package/kernel/apps/web/src/folder-query-cache.ts +66 -0
  157. package/kernel/apps/web/src/host-adapters.ts +209 -0
  158. package/kernel/apps/web/src/host-bridge.ts +214 -0
  159. package/kernel/apps/web/src/lib/entity-folder.ts +2 -0
  160. package/kernel/apps/web/src/linked-session-header.tsx +43 -0
  161. package/kernel/apps/web/src/live-session-controls.tsx +326 -0
  162. package/kernel/apps/web/src/local-source.ts +32 -0
  163. package/kernel/apps/web/src/main.tsx +24 -0
  164. package/kernel/apps/web/src/markdown-page.tsx +444 -0
  165. package/kernel/apps/web/src/notes-page.tsx +103 -0
  166. package/kernel/apps/web/src/plugins.ts +53 -0
  167. package/kernel/apps/web/src/project-search-dialog.tsx +257 -0
  168. package/kernel/apps/web/src/project-search.ts +18 -0
  169. package/kernel/apps/web/src/query-client.ts +4 -0
  170. package/kernel/apps/web/src/rehype-source-lines.ts +22 -0
  171. package/kernel/apps/web/src/routes/document.tsx +1 -0
  172. package/kernel/apps/web/src/routes/entities.tsx +277 -0
  173. package/kernel/apps/web/src/routes/search.tsx +60 -0
  174. package/kernel/apps/web/src/selection-context.ts +68 -0
  175. package/kernel/apps/web/src/selection-input.tsx +58 -0
  176. package/kernel/apps/web/src/selection-popup.tsx +155 -0
  177. package/kernel/apps/web/src/session-transcript-page.tsx +152 -0
  178. package/kernel/apps/web/src/use-annotations.ts +162 -0
  179. package/kernel/apps/web/src/use-ask-ai.ts +26 -0
  180. package/kernel/apps/web/src/use-ask-draft.ts +27 -0
  181. package/kernel/apps/web/src/use-document.ts +37 -0
  182. package/kernel/apps/web/src/use-folder-notes.ts +49 -0
  183. package/kernel/apps/web/src/use-linked-session.ts +33 -0
  184. package/kernel/apps/web/src/view-context.tsx +69 -0
  185. package/kernel/apps/web/src/view-header.tsx +66 -0
  186. package/kernel/apps/web/src/viewer-capabilities.ts +33 -0
  187. package/kernel/apps/web/src/viewer-route.ts +1 -0
  188. package/kernel/apps/web/src/viewport-height.ts +33 -0
  189. package/kernel/apps/web/tsconfig.json +24 -0
  190. package/kernel/apps/web/vite.config.ts +252 -0
  191. package/kernel/packages/agents/eslint.config.js +10 -0
  192. package/kernel/packages/agents/package.json +75 -0
  193. package/kernel/packages/agents/src/agent-card.tsx +334 -0
  194. package/kernel/packages/agents/src/client.tsx +13 -0
  195. package/kernel/packages/agents/src/index.ts +18 -0
  196. package/kernel/packages/agents/src/manifest.ts +7 -0
  197. package/kernel/packages/agents/src/node.ts +447 -0
  198. package/kernel/packages/agents/src/profiles.ts +137 -0
  199. package/kernel/packages/agents/src/resolve.ts +69 -0
  200. package/kernel/packages/agents/src/server.ts +60 -0
  201. package/kernel/packages/agents/src/types.ts +82 -0
  202. package/kernel/packages/agents/src/viewer.tsx +370 -0
  203. package/kernel/packages/agents/test/profiles.test.mjs +88 -0
  204. package/kernel/packages/agents/test/resolve.test.mjs +729 -0
  205. package/kernel/packages/agents/tsconfig.json +17 -0
  206. package/kernel/packages/api/README.md +73 -0
  207. package/kernel/packages/api/openapi.json +3368 -0
  208. package/kernel/packages/api/package.json +41 -0
  209. package/kernel/packages/api/src/client/errors.ts +1 -0
  210. package/kernel/packages/api/src/client/index.ts +2 -0
  211. package/kernel/packages/api/src/contracts/schemas.ts +277 -0
  212. package/kernel/packages/api/src/contracts.ts +20 -0
  213. package/kernel/packages/api/src/index.ts +34 -0
  214. package/kernel/packages/api/src/server/acp/index.ts +35 -0
  215. package/kernel/packages/api/src/server/acp/live-agent-connection.ts +44 -0
  216. package/kernel/packages/api/src/server/acp/process-manager.ts +291 -0
  217. package/kernel/packages/api/src/server/acp/registry.ts +140 -0
  218. package/kernel/packages/api/src/server/acp/sdk.ts +15 -0
  219. package/kernel/packages/api/src/server/acp/transport.ts +115 -0
  220. package/kernel/packages/api/src/server/acp/types.ts +89 -0
  221. package/kernel/packages/api/src/server/acp-live-plugin.ts +423 -0
  222. package/kernel/packages/api/src/server/api/create-agent-file.ts +46 -0
  223. package/kernel/packages/api/src/server/api/document-edit.ts +125 -0
  224. package/kernel/packages/api/src/server/api/open-path.ts +40 -0
  225. package/kernel/packages/api/src/server/contracts.ts +85 -0
  226. package/kernel/packages/api/src/server/entity-folder.ts +353 -0
  227. package/kernel/packages/api/src/server/folder-favicon.ts +17 -0
  228. package/kernel/packages/api/src/server/folder-icons.ts +113 -0
  229. package/kernel/packages/api/src/server/folder-metadata-plugin.ts +1758 -0
  230. package/kernel/packages/api/src/server/host.ts +21 -0
  231. package/kernel/packages/api/src/server/index.ts +197 -0
  232. package/kernel/packages/api/src/server/linked-folder-discovery.ts +158 -0
  233. package/kernel/packages/api/src/server/plugins.ts +205 -0
  234. package/kernel/packages/api/src/server/project-discovery.ts +69 -0
  235. package/kernel/packages/api/src/server/watcher.ts +46 -0
  236. package/kernel/packages/api/src/shared/selection.ts +16 -0
  237. package/kernel/packages/api/src/shared/viewer-route.ts +200 -0
  238. package/kernel/packages/api/test/agents-loading.test.ts +94 -0
  239. package/kernel/packages/api/test/core.test.ts +364 -0
  240. package/kernel/packages/api/test/entity-folder.test.ts +131 -0
  241. package/kernel/packages/api/test/linked-folder-discovery.test.ts +78 -0
  242. package/kernel/packages/api/test/media-endpoint.test.ts +83 -0
  243. package/kernel/packages/api/test/partial-loading.test.ts +43 -0
  244. package/kernel/packages/api/test/project-discovery.test.ts +44 -0
  245. package/kernel/packages/api/tsconfig.json +11 -0
  246. package/kernel/packages/api-client/README.md +72 -0
  247. package/kernel/packages/api-client/package.json +26 -0
  248. package/kernel/packages/api-client/scripts/generate.ts +68 -0
  249. package/kernel/packages/api-client/src/errors.ts +59 -0
  250. package/kernel/packages/api-client/src/generated.d.ts +1248 -0
  251. package/kernel/packages/api-client/src/index.ts +206 -0
  252. package/kernel/packages/api-client/src/responses.ts +19 -0
  253. package/kernel/packages/api-client/test/client.test.ts +143 -0
  254. package/kernel/packages/api-client/tsconfig.json +12 -0
  255. package/kernel/packages/folder-plugin/eslint.config.js +10 -0
  256. package/kernel/packages/folder-plugin/package.json +50 -0
  257. package/kernel/packages/folder-plugin/src/client.ts +73 -0
  258. package/kernel/packages/folder-plugin/src/endpoint.ts +273 -0
  259. package/kernel/packages/folder-plugin/src/index.ts +15 -0
  260. package/kernel/packages/folder-plugin/src/server.ts +78 -0
  261. package/kernel/packages/folder-plugin/src/subpath.ts +34 -0
  262. package/kernel/packages/folder-plugin/src/types.ts +86 -0
  263. package/kernel/packages/folder-plugin/src/validation.ts +56 -0
  264. package/kernel/packages/folder-plugin/test/contract.test.mjs +133 -0
  265. package/kernel/packages/folder-plugin/tsconfig.json +17 -0
  266. package/kernel/packages/kinds/package.json +24 -0
  267. package/kernel/packages/kinds/src/kinds.ts +172 -0
  268. package/kernel/packages/markdown/README.md +40 -0
  269. package/kernel/packages/markdown/explorer.css +1 -0
  270. package/kernel/packages/markdown/package.json +30 -0
  271. package/kernel/packages/markdown/src/documents.ts +1 -0
  272. package/kernel/packages/markdown/src/explorer.ts +1 -0
  273. package/kernel/packages/markdown/src/index.ts +2 -0
  274. package/kernel/packages/markdown/src/metadata.ts +63 -0
  275. package/kernel/packages/markdown/src/node.ts +1 -0
  276. package/kernel/packages/markdown/styles.css +1 -0
  277. package/kernel/packages/notes/SKILL.md +19 -0
  278. package/kernel/packages/notes/eslint.config.js +10 -0
  279. package/kernel/packages/notes/package.json +72 -0
  280. package/kernel/packages/notes/src/client.tsx +12 -0
  281. package/kernel/packages/notes/src/data/ai-input.ts +58 -0
  282. package/kernel/packages/notes/src/data/api.ts +40 -0
  283. package/kernel/packages/notes/src/data/parse.ts +15 -0
  284. package/kernel/packages/notes/src/data/routing.ts +33 -0
  285. package/kernel/packages/notes/src/data/use-folder-notes.ts +49 -0
  286. package/kernel/packages/notes/src/index.ts +2 -0
  287. package/kernel/packages/notes/src/manifest.ts +6 -0
  288. package/kernel/packages/notes/src/pages/notes-page.tsx +79 -0
  289. package/kernel/packages/notes/src/pages/single-note-page.tsx +57 -0
  290. package/kernel/packages/notes/src/server.ts +88 -0
  291. package/kernel/packages/notes/src/ui/ai-composer-controls.tsx +70 -0
  292. package/kernel/packages/notes/src/ui/folder-notes-list.tsx +140 -0
  293. package/kernel/packages/notes/tsconfig.json +16 -0
  294. package/kernel/packages/schemas/ICON-POLICY.md +43 -0
  295. package/kernel/packages/schemas/SKILL.md +185 -0
  296. package/kernel/packages/schemas/eslint.config.js +10 -0
  297. package/kernel/packages/schemas/package.json +81 -0
  298. package/kernel/packages/schemas/src/client.tsx +137 -0
  299. package/kernel/packages/schemas/src/data/config-file.ts +37 -0
  300. package/kernel/packages/schemas/src/data/contract.ts +174 -0
  301. package/kernel/packages/schemas/src/data/favicon.ts +218 -0
  302. package/kernel/packages/schemas/src/data/fields.ts +96 -0
  303. package/kernel/packages/schemas/src/data/icon-image.ts +53 -0
  304. package/kernel/packages/schemas/src/data/icon.ts +97 -0
  305. package/kernel/packages/schemas/src/data/load.ts +161 -0
  306. package/kernel/packages/schemas/src/data/params.ts +103 -0
  307. package/kernel/packages/schemas/src/data/query.ts +33 -0
  308. package/kernel/packages/schemas/src/data/sort.ts +50 -0
  309. package/kernel/packages/schemas/src/data/workspace.ts +101 -0
  310. package/kernel/packages/schemas/src/index.ts +22 -0
  311. package/kernel/packages/schemas/src/manifest.ts +4 -0
  312. package/kernel/packages/schemas/src/node.ts +384 -0
  313. package/kernel/packages/schemas/src/pages/collection.tsx +252 -0
  314. package/kernel/packages/schemas/src/server.ts +208 -0
  315. package/kernel/packages/schemas/src/ui/schema-entity-list.tsx +124 -0
  316. package/kernel/packages/schemas/src/ui/schema-filters.tsx +186 -0
  317. package/kernel/packages/schemas/src/ui/schema-search.tsx +35 -0
  318. package/kernel/packages/schemas/src/ui/use-query-param-filter-setting.tsx +15 -0
  319. package/kernel/packages/schemas/test/contract.test.mjs +26 -0
  320. package/kernel/packages/schemas/test/fields.test.mjs +187 -0
  321. package/kernel/packages/schemas/test/load.test.mjs +12 -0
  322. package/kernel/packages/schemas/test/node.test.mjs +412 -0
  323. package/kernel/packages/schemas/test/query.test.mjs +134 -0
  324. package/kernel/packages/schemas/test/workspace.test.mjs +86 -0
  325. package/kernel/packages/schemas/tsconfig.json +17 -0
  326. package/kernel/packages/session-finding/package.json +33 -0
  327. package/kernel/packages/session-finding/src/index.ts +120 -0
  328. package/kernel/packages/session-finding/test/list-sessions.test.mjs +139 -0
  329. package/kernel/packages/session-finding/tsconfig.json +12 -0
  330. package/kernel/packages/ui/LICENSE +21 -0
  331. package/kernel/packages/ui/components.json +20 -0
  332. package/kernel/packages/ui/eslint.config.js +8 -0
  333. package/kernel/packages/ui/package.json +106 -0
  334. package/kernel/packages/ui/src/chat/file-link.ts +178 -0
  335. package/kernel/packages/ui/src/chat/index.ts +18 -0
  336. package/kernel/packages/ui/src/chat/transcript.tsx +348 -0
  337. package/kernel/packages/ui/src/chat/turns.ts +76 -0
  338. package/kernel/packages/ui/src/chat/types.ts +23 -0
  339. package/kernel/packages/ui/src/chat/use-overflowing.ts +56 -0
  340. package/kernel/packages/ui/src/components/accordion.tsx +74 -0
  341. package/kernel/packages/ui/src/components/alert-dialog.tsx +164 -0
  342. package/kernel/packages/ui/src/components/alert.tsx +68 -0
  343. package/kernel/packages/ui/src/components/app-breadcrumbs.tsx +170 -0
  344. package/kernel/packages/ui/src/components/app-header.tsx +125 -0
  345. package/kernel/packages/ui/src/components/app-options.tsx +87 -0
  346. package/kernel/packages/ui/src/components/app-view-header.tsx +34 -0
  347. package/kernel/packages/ui/src/components/aspect-ratio.tsx +11 -0
  348. package/kernel/packages/ui/src/components/avatar.tsx +53 -0
  349. package/kernel/packages/ui/src/components/badge.tsx +47 -0
  350. package/kernel/packages/ui/src/components/base-dialog.tsx +3 -0
  351. package/kernel/packages/ui/src/components/base-tabs.tsx +63 -0
  352. package/kernel/packages/ui/src/components/breadcrumb.tsx +110 -0
  353. package/kernel/packages/ui/src/components/button-group.tsx +86 -0
  354. package/kernel/packages/ui/src/components/button.tsx +65 -0
  355. package/kernel/packages/ui/src/components/calendar.tsx +240 -0
  356. package/kernel/packages/ui/src/components/card.tsx +95 -0
  357. package/kernel/packages/ui/src/components/carousel.tsx +240 -0
  358. package/kernel/packages/ui/src/components/chart.tsx +375 -0
  359. package/kernel/packages/ui/src/components/checkbox.tsx +39 -0
  360. package/kernel/packages/ui/src/components/collapsible.tsx +33 -0
  361. package/kernel/packages/ui/src/components/collection-icon.tsx +28 -0
  362. package/kernel/packages/ui/src/components/command.tsx +205 -0
  363. package/kernel/packages/ui/src/components/content-issues.tsx +63 -0
  364. package/kernel/packages/ui/src/components/context-menu.tsx +298 -0
  365. package/kernel/packages/ui/src/components/copy-context.tsx +134 -0
  366. package/kernel/packages/ui/src/components/dialog.tsx +157 -0
  367. package/kernel/packages/ui/src/components/drawer.tsx +162 -0
  368. package/kernel/packages/ui/src/components/dropdown-menu.tsx +303 -0
  369. package/kernel/packages/ui/src/components/empty.tsx +108 -0
  370. package/kernel/packages/ui/src/components/field.tsx +260 -0
  371. package/kernel/packages/ui/src/components/file-preview.tsx +152 -0
  372. package/kernel/packages/ui/src/components/file-renderer.tsx +466 -0
  373. package/kernel/packages/ui/src/components/filter-chip-panel.tsx +157 -0
  374. package/kernel/packages/ui/src/components/filter-select.tsx +127 -0
  375. package/kernel/packages/ui/src/components/folder-activity.tsx +646 -0
  376. package/kernel/packages/ui/src/components/folder-file-list.tsx +58 -0
  377. package/kernel/packages/ui/src/components/folder-filter-bar.tsx +191 -0
  378. package/kernel/packages/ui/src/components/folder-image.tsx +18 -0
  379. package/kernel/packages/ui/src/components/folder-landing.tsx +70 -0
  380. package/kernel/packages/ui/src/components/folder-list.tsx +140 -0
  381. package/kernel/packages/ui/src/components/folder-metadata.tsx +107 -0
  382. package/kernel/packages/ui/src/components/folder-mobile-bar.tsx +60 -0
  383. package/kernel/packages/ui/src/components/folder-project-list.tsx +133 -0
  384. package/kernel/packages/ui/src/components/folder-session-list.tsx +113 -0
  385. package/kernel/packages/ui/src/components/folder-session-page.tsx +126 -0
  386. package/kernel/packages/ui/src/components/folder-sidebar.tsx +52 -0
  387. package/kernel/packages/ui/src/components/folder-skill-list.tsx +62 -0
  388. package/kernel/packages/ui/src/components/folder-tabs.tsx +156 -0
  389. package/kernel/packages/ui/src/components/form.tsx +167 -0
  390. package/kernel/packages/ui/src/components/hover-card.tsx +52 -0
  391. package/kernel/packages/ui/src/components/icons.tsx +34 -0
  392. package/kernel/packages/ui/src/components/input-group.tsx +184 -0
  393. package/kernel/packages/ui/src/components/input-otp.tsx +90 -0
  394. package/kernel/packages/ui/src/components/input.tsx +29 -0
  395. package/kernel/packages/ui/src/components/item.tsx +195 -0
  396. package/kernel/packages/ui/src/components/kbd.tsx +32 -0
  397. package/kernel/packages/ui/src/components/label.tsx +27 -0
  398. package/kernel/packages/ui/src/components/link.tsx +45 -0
  399. package/kernel/packages/ui/src/components/live-tool-call.tsx +193 -0
  400. package/kernel/packages/ui/src/components/menubar.tsx +323 -0
  401. package/kernel/packages/ui/src/components/navigation-menu.tsx +210 -0
  402. package/kernel/packages/ui/src/components/note-card.tsx +149 -0
  403. package/kernel/packages/ui/src/components/pagination.tsx +128 -0
  404. package/kernel/packages/ui/src/components/popover.tsx +56 -0
  405. package/kernel/packages/ui/src/components/progress.tsx +31 -0
  406. package/kernel/packages/ui/src/components/radio-group.tsx +54 -0
  407. package/kernel/packages/ui/src/components/scroll-area.tsx +61 -0
  408. package/kernel/packages/ui/src/components/select.tsx +219 -0
  409. package/kernel/packages/ui/src/components/separator.tsx +30 -0
  410. package/kernel/packages/ui/src/components/session-icon.tsx +124 -0
  411. package/kernel/packages/ui/src/components/sheet.tsx +157 -0
  412. package/kernel/packages/ui/src/components/sidebar.tsx +789 -0
  413. package/kernel/packages/ui/src/components/skeleton.tsx +13 -0
  414. package/kernel/packages/ui/src/components/slider.tsx +73 -0
  415. package/kernel/packages/ui/src/components/sonner.tsx +41 -0
  416. package/kernel/packages/ui/src/components/spinner.tsx +16 -0
  417. package/kernel/packages/ui/src/components/switch.tsx +40 -0
  418. package/kernel/packages/ui/src/components/table.tsx +120 -0
  419. package/kernel/packages/ui/src/components/tabs.tsx +78 -0
  420. package/kernel/packages/ui/src/components/textarea.tsx +25 -0
  421. package/kernel/packages/ui/src/components/toggle-group.tsx +87 -0
  422. package/kernel/packages/ui/src/components/toggle.tsx +48 -0
  423. package/kernel/packages/ui/src/components/tooltip.tsx +71 -0
  424. package/kernel/packages/ui/src/components/viewer-options.tsx +166 -0
  425. package/kernel/packages/ui/src/hooks/use-folder-filter.ts +103 -0
  426. package/kernel/packages/ui/src/hooks/use-mobile.ts +19 -0
  427. package/kernel/packages/ui/src/index.ts +13 -0
  428. package/kernel/packages/ui/src/lib/document-extensions.ts +83 -0
  429. package/kernel/packages/ui/src/lib/folder-activity.ts +143 -0
  430. package/kernel/packages/ui/src/lib/folder-filter.ts +284 -0
  431. package/kernel/packages/ui/src/lib/live-tool-call.tsx +109 -0
  432. package/kernel/packages/ui/src/lib/media-urls.ts +176 -0
  433. package/kernel/packages/ui/src/lib/obsidian-links.ts +120 -0
  434. package/kernel/packages/ui/src/lib/source-components.tsx +65 -0
  435. package/kernel/packages/ui/src/lib/utils.tsx +7 -0
  436. package/kernel/packages/ui/src/pages/entity-detail-page.tsx +82 -0
  437. package/kernel/packages/ui/src/pages/entity-list-page.tsx +50 -0
  438. package/kernel/packages/ui/src/pages/entity-page.tsx +69 -0
  439. package/kernel/packages/ui/src/styles/folder-activity.css +2151 -0
  440. package/kernel/packages/ui/test/copy-context.test.mjs +48 -0
  441. package/kernel/packages/ui/test/folder-filter.test.mjs +484 -0
  442. package/kernel/packages/ui/tsconfig.json +15 -0
  443. package/kernel/plugins/calendar/SKILL.md +173 -0
  444. package/kernel/plugins/calendar/eslint.config.js +10 -0
  445. package/kernel/plugins/calendar/package.json +73 -0
  446. package/kernel/plugins/calendar/schema.json +137 -0
  447. package/kernel/plugins/calendar/src/calendar.tsx +328 -0
  448. package/kernel/plugins/calendar/src/client.tsx +139 -0
  449. package/kernel/plugins/calendar/src/context.ts +48 -0
  450. package/kernel/plugins/calendar/src/copy-button.tsx +66 -0
  451. package/kernel/plugins/calendar/src/event-dialog.tsx +270 -0
  452. package/kernel/plugins/calendar/src/index.ts +4 -0
  453. package/kernel/plugins/calendar/src/manifest.ts +7 -0
  454. package/kernel/plugins/calendar/src/parse.ts +610 -0
  455. package/kernel/plugins/calendar/src/server.ts +160 -0
  456. package/kernel/plugins/calendar/src/utils.ts +80 -0
  457. package/kernel/plugins/calendar/src/views.tsx +418 -0
  458. package/kernel/plugins/calendar/test/context.test.mjs +60 -0
  459. package/kernel/plugins/calendar/test/package.test.mjs +43 -0
  460. package/kernel/plugins/calendar/test/parse.test.mjs +392 -0
  461. package/kernel/plugins/calendar/test/server.test.mjs +126 -0
  462. package/kernel/plugins/calendar/tsconfig.json +17 -0
  463. package/kernel/plugins/mail/SKILL.md +97 -0
  464. package/kernel/plugins/mail/eslint.config.js +10 -0
  465. package/kernel/plugins/mail/package.json +79 -0
  466. package/kernel/plugins/mail/src/api.ts +359 -0
  467. package/kernel/plugins/mail/src/bun-ffi.d.ts +14 -0
  468. package/kernel/plugins/mail/src/client.tsx +14 -0
  469. package/kernel/plugins/mail/src/flock.ts +137 -0
  470. package/kernel/plugins/mail/src/folders.ts +37 -0
  471. package/kernel/plugins/mail/src/history.ts +485 -0
  472. package/kernel/plugins/mail/src/index.ts +3 -0
  473. package/kernel/plugins/mail/src/mail-card.tsx +123 -0
  474. package/kernel/plugins/mail/src/mail-conversation.tsx +153 -0
  475. package/kernel/plugins/mail/src/mail-detail-page.tsx +467 -0
  476. package/kernel/plugins/mail/src/mail-hooks.ts +252 -0
  477. package/kernel/plugins/mail/src/mail-page.tsx +109 -0
  478. package/kernel/plugins/mail/src/mail-request.ts +78 -0
  479. package/kernel/plugins/mail/src/mail-send-box.tsx +175 -0
  480. package/kernel/plugins/mail/src/mailos.ts +723 -0
  481. package/kernel/plugins/mail/src/manifest.ts +7 -0
  482. package/kernel/plugins/mail/src/node.ts +171 -0
  483. package/kernel/plugins/mail/src/parse.ts +139 -0
  484. package/kernel/plugins/mail/src/server.ts +125 -0
  485. package/kernel/plugins/mail/src/types.ts +10 -0
  486. package/kernel/plugins/mail/src/viewer.tsx +147 -0
  487. package/kernel/plugins/mail/test/flock.test.mjs +156 -0
  488. package/kernel/plugins/mail/test/folders.test.mjs +138 -0
  489. package/kernel/plugins/mail/test/history.test.mjs +460 -0
  490. package/kernel/plugins/mail/test/mailos.test.mjs +752 -0
  491. package/kernel/plugins/mail/test/node.test.mjs +207 -0
  492. package/kernel/plugins/mail/test/package.test.mjs +54 -0
  493. package/kernel/plugins/mail/test/parse.test.mjs +32 -0
  494. package/kernel/plugins/mail/test/server.test.mjs +116 -0
  495. package/kernel/plugins/mail/test/viewer.test.mjs +192 -0
  496. package/kernel/plugins/mail/tsconfig.json +17 -0
  497. package/kernel/plugins/projects/SKILL.md +73 -0
  498. package/kernel/plugins/projects/eslint.config.js +10 -0
  499. package/kernel/plugins/projects/package.json +70 -0
  500. package/kernel/plugins/projects/src/client.tsx +17 -0
  501. package/kernel/plugins/projects/src/data/model.ts +129 -0
  502. package/kernel/plugins/projects/src/index.ts +17 -0
  503. package/kernel/plugins/projects/src/manifest.ts +7 -0
  504. package/kernel/plugins/projects/src/project-context.ts +41 -0
  505. package/kernel/plugins/projects/src/server.ts +276 -0
  506. package/kernel/plugins/projects/src/ui/project-card.tsx +61 -0
  507. package/kernel/plugins/projects/src/ui/projects-page.tsx +102 -0
  508. package/kernel/plugins/projects/test/package.test.mjs +51 -0
  509. package/kernel/plugins/projects/tsconfig.json +17 -0
  510. package/kernel/plugins/tasks/SKILL.md +341 -0
  511. package/kernel/plugins/tasks/eslint.config.js +10 -0
  512. package/kernel/plugins/tasks/package.json +74 -0
  513. package/kernel/plugins/tasks/schema.json +939 -0
  514. package/kernel/plugins/tasks/src/api.ts +212 -0
  515. package/kernel/plugins/tasks/src/client.tsx +23 -0
  516. package/kernel/plugins/tasks/src/data/parse.ts +544 -0
  517. package/kernel/plugins/tasks/src/data/task-id.ts +56 -0
  518. package/kernel/plugins/tasks/src/data/todo-model.ts +795 -0
  519. package/kernel/plugins/tasks/src/index.ts +34 -0
  520. package/kernel/plugins/tasks/src/manifest.ts +7 -0
  521. package/kernel/plugins/tasks/src/pages/task-detail.tsx +48 -0
  522. package/kernel/plugins/tasks/src/pages/task-list.tsx +88 -0
  523. package/kernel/plugins/tasks/src/server.ts +447 -0
  524. package/kernel/plugins/tasks/src/styles.css +9 -0
  525. package/kernel/plugins/tasks/src/ui/compact-todo-list.tsx +372 -0
  526. package/kernel/plugins/tasks/src/ui/error-details.tsx +78 -0
  527. package/kernel/plugins/tasks/src/ui/task-page.tsx +392 -0
  528. package/kernel/plugins/tasks/src/ui/todo-agent-filter.tsx +36 -0
  529. package/kernel/plugins/tasks/src/ui/todo-filter-bar.tsx +66 -0
  530. package/kernel/plugins/tasks/src/ui/todo-item.tsx +494 -0
  531. package/kernel/plugins/tasks/src/ui/todo-status-filter.tsx +60 -0
  532. package/kernel/plugins/tasks/src/ui/todo-tag-filter.tsx +48 -0
  533. package/kernel/plugins/tasks/src/ui/todo-warnings.tsx +106 -0
  534. package/kernel/plugins/tasks/test/api.test.mjs +99 -0
  535. package/kernel/plugins/tasks/test/folder-sources.test.mjs +46 -0
  536. package/kernel/plugins/tasks/test/package.test.mjs +54 -0
  537. package/kernel/plugins/tasks/test/parse.test.mjs +225 -0
  538. package/kernel/plugins/tasks/test/server.test.mjs +386 -0
  539. package/kernel/plugins/tasks/tsconfig.json +17 -0
  540. package/node_modules/@agentclientprotocol/sdk/LICENSE +191 -0
  541. package/node_modules/@agentclientprotocol/sdk/README.md +70 -0
  542. package/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +1835 -0
  543. package/node_modules/@agentclientprotocol/sdk/dist/acp.js +1885 -0
  544. package/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
  545. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.d.ts +1 -0
  546. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +5036 -0
  547. package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -0
  548. package/node_modules/@agentclientprotocol/sdk/dist/connection.d.ts +82 -0
  549. package/node_modules/@agentclientprotocol/sdk/dist/connection.js +428 -0
  550. package/node_modules/@agentclientprotocol/sdk/dist/connection.js.map +1 -0
  551. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.d.ts +1 -0
  552. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js +470 -0
  553. package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js.map +1 -0
  554. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.d.ts +26 -0
  555. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js +96 -0
  556. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js.map +1 -0
  557. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.d.ts +1 -0
  558. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js +77 -0
  559. package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js.map +1 -0
  560. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.d.ts +2 -0
  561. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js +232 -0
  562. package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js.map +1 -0
  563. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.d.ts +2 -0
  564. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js +132 -0
  565. package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js.map +1 -0
  566. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.d.ts +9 -0
  567. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +221 -0
  568. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js.map +1 -0
  569. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.d.ts +2 -0
  570. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js +86 -0
  571. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js.map +1 -0
  572. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.d.ts +2 -0
  573. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js +112 -0
  574. package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js.map +1 -0
  575. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.d.ts +2 -0
  576. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js +88 -0
  577. package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js.map +1 -0
  578. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.d.ts +33 -0
  579. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js +435 -0
  580. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js.map +1 -0
  581. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.d.ts +1 -0
  582. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js +1380 -0
  583. package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js.map +1 -0
  584. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +603 -0
  585. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +1064 -0
  586. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js.map +1 -0
  587. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.d.ts +1 -0
  588. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js +851 -0
  589. package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js.map +1 -0
  590. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.d.ts +22 -0
  591. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js +64 -0
  592. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js.map +1 -0
  593. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.d.ts +1 -0
  594. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js +45 -0
  595. package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js.map +1 -0
  596. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.d.ts +17 -0
  597. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js +426 -0
  598. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js.map +1 -0
  599. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.d.ts +1 -0
  600. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js +499 -0
  601. package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js.map +1 -0
  602. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +37 -0
  603. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js +474 -0
  604. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js.map +1 -0
  605. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.d.ts +1 -0
  606. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js +535 -0
  607. package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js.map +1 -0
  608. package/node_modules/@agentclientprotocol/sdk/dist/protocol.d.ts +11 -0
  609. package/node_modules/@agentclientprotocol/sdk/dist/protocol.js +57 -0
  610. package/node_modules/@agentclientprotocol/sdk/dist/protocol.js.map +1 -0
  611. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.d.ts +1 -0
  612. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js +73 -0
  613. package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js.map +1 -0
  614. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.d.ts +199 -0
  615. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js +211 -0
  616. package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js.map +1 -0
  617. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +51 -0
  618. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +52 -0
  619. package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -0
  620. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +6118 -0
  621. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js +3 -0
  622. package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js.map +1 -0
  623. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +14160 -0
  624. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +3066 -0
  625. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -0
  626. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.d.ts +30 -0
  627. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js +98 -0
  628. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js.map +1 -0
  629. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.d.ts +1 -0
  630. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js +93 -0
  631. package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js.map +1 -0
  632. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.d.ts +1 -0
  633. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js +261 -0
  634. package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js.map +1 -0
  635. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.d.ts +1 -0
  636. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js +490 -0
  637. package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js.map +1 -0
  638. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.d.ts +2 -0
  639. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js +104 -0
  640. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js.map +1 -0
  641. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.d.ts +1 -0
  642. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js +52 -0
  643. package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js.map +1 -0
  644. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.d.ts +1 -0
  645. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js +946 -0
  646. package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js.map +1 -0
  647. package/node_modules/@agentclientprotocol/sdk/dist/server.d.ts +81 -0
  648. package/node_modules/@agentclientprotocol/sdk/dist/server.js +380 -0
  649. package/node_modules/@agentclientprotocol/sdk/dist/server.js.map +1 -0
  650. package/node_modules/@agentclientprotocol/sdk/dist/server.test.d.ts +1 -0
  651. package/node_modules/@agentclientprotocol/sdk/dist/server.test.js +1082 -0
  652. package/node_modules/@agentclientprotocol/sdk/dist/server.test.js.map +1 -0
  653. package/node_modules/@agentclientprotocol/sdk/dist/sse.d.ts +4 -0
  654. package/node_modules/@agentclientprotocol/sdk/dist/sse.js +91 -0
  655. package/node_modules/@agentclientprotocol/sdk/dist/sse.js.map +1 -0
  656. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.d.ts +1 -0
  657. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js +126 -0
  658. package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js.map +1 -0
  659. package/node_modules/@agentclientprotocol/sdk/dist/stream.d.ts +35 -0
  660. package/node_modules/@agentclientprotocol/sdk/dist/stream.js +106 -0
  661. package/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
  662. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.d.ts +1 -0
  663. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js +206 -0
  664. package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js.map +1 -0
  665. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.d.ts +8 -0
  666. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js +51 -0
  667. package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js.map +1 -0
  668. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.d.ts +24 -0
  669. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js +163 -0
  670. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js.map +1 -0
  671. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.d.ts +9 -0
  672. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js +74 -0
  673. package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js.map +1 -0
  674. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +806 -0
  675. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +1183 -0
  676. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js.map +1 -0
  677. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.d.ts +1 -0
  678. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +512 -0
  679. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js.map +1 -0
  680. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.d.ts +954 -0
  681. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +1035 -0
  682. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js.map +1 -0
  683. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.d.ts +42 -0
  684. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +43 -0
  685. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js.map +1 -0
  686. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.d.ts +6146 -0
  687. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js +3 -0
  688. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js.map +1 -0
  689. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +30552 -0
  690. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +3204 -0
  691. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js.map +1 -0
  692. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.d.ts +14 -0
  693. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js +358 -0
  694. package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js.map +1 -0
  695. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.d.ts +54 -0
  696. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js +246 -0
  697. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js.map +1 -0
  698. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.d.ts +1 -0
  699. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js +833 -0
  700. package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js.map +1 -0
  701. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.d.ts +13 -0
  702. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js +78 -0
  703. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js.map +1 -0
  704. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.d.ts +1 -0
  705. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js +42 -0
  706. package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js.map +1 -0
  707. package/node_modules/@agentclientprotocol/sdk/package.json +105 -0
  708. package/node_modules/@agentclientprotocol/sdk/schema/schema.json +8819 -0
  709. package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +10098 -0
  710. package/package.json +52 -6
  711. package/web/assets/{abnfDiagram-VRR7QNED-Nfq-O04D.js → abnfDiagram-VRR7QNED-Bgfb1nEB.js} +1 -1
  712. package/web/assets/app-DoGr2Zi7.js +2 -0
  713. package/web/assets/app-options-D-RJiQ-X.js +25 -0
  714. package/web/assets/app-view-header-BLvLq02T.js +1 -0
  715. package/web/assets/arc-Dk_KI36B.js +1 -0
  716. package/web/assets/{architectureDiagram-ZJ3FMSHR-qhRwPNcQ.js → architectureDiagram-ZJ3FMSHR-NR_KhRCf.js} +1 -1
  717. package/web/assets/ask-tray-TzeTcO6-.js +14 -0
  718. package/web/assets/{blockDiagram-677ZJIJ3-C56P3bGu.js → blockDiagram-677ZJIJ3-CkLkwx9C.js} +1 -1
  719. package/web/assets/button-C6arH7zt.js +1 -0
  720. package/web/assets/{c4Diagram-LMCZKHZV-Ey1M72zD.js → c4Diagram-LMCZKHZV-CFCUH8e_.js} +1 -1
  721. package/web/assets/channel-uMEjV8qc.js +1 -0
  722. package/web/assets/{chunk-2Q5K7J3B-a6isk9VU.js → chunk-2Q5K7J3B-B_BPLWsW.js} +1 -1
  723. package/web/assets/{chunk-32BRIVSS-uy4kdSLL.js → chunk-32BRIVSS-B1VB1hOy.js} +1 -1
  724. package/web/assets/{chunk-5VM5RSS4-oj2sBFd7.js → chunk-5VM5RSS4-KFcYr8Co.js} +1 -1
  725. package/web/assets/{chunk-EX3LRPZG-Bzl1ukAi.js → chunk-EX3LRPZG-CpBX3kuK.js} +3 -3
  726. package/web/assets/{chunk-JWPE2WC7-sUph7I_t.js → chunk-JWPE2WC7-BPSl40wG.js} +1 -1
  727. package/web/assets/{chunk-MOJQB5TN-C0ERSuVK.js → chunk-MOJQB5TN-D2RcYmoU.js} +1 -1
  728. package/web/assets/{chunk-RYQCIY6F-Dyw1Hfwp.js → chunk-RYQCIY6F-m7Gyn-t3.js} +1 -1
  729. package/web/assets/{chunk-V7JOEXUC-DnSz22rb.js → chunk-V7JOEXUC-TDvdopxS.js} +1 -1
  730. package/web/assets/{chunk-VR4S4FIN-Bp2SNel7.js → chunk-VR4S4FIN-DZTsG51a.js} +1 -1
  731. package/web/assets/{chunk-XXDRQBXY-Dqtar746.js → chunk-XXDRQBXY-Dp0--RE2.js} +1 -1
  732. package/web/assets/classDiagram-OUVF2IWQ-fbZocVor.js +1 -0
  733. package/web/assets/classDiagram-v2-EOCWNBFH-fbZocVor.js +1 -0
  734. package/web/assets/client-C6Nxdfif.js +2 -0
  735. package/web/assets/client-CXYfBko5.js +17 -0
  736. package/web/assets/client-CoKtOq-X.js +7 -0
  737. package/web/assets/client-DyRQz5RU.js +53 -0
  738. package/web/assets/client-OY6HUzuD.js +98 -0
  739. package/web/assets/client-YOYWZIFi.js +34 -0
  740. package/web/assets/client-j2kQmxsO.js +22 -0
  741. package/web/assets/command-BugZBGXE.js +38 -0
  742. package/web/assets/copy-context-C0Uqsp-3.js +1 -0
  743. package/web/assets/{cose-bilkent-JH36ORCC-Dx1VqMjj.js → cose-bilkent-JH36ORCC-CPu3PI8h.js} +1 -1
  744. package/web/assets/{cynefin-VYW2F7L2-SjhCWmIV.js → cynefin-VYW2F7L2-DWxftYAm.js} +1 -1
  745. package/web/assets/{cynefinDiagram-TSTJHNR4-Dvqz2594.js → cynefinDiagram-TSTJHNR4-DsmN2V-p.js} +1 -1
  746. package/web/assets/{dagre-VKFMJZFB-Ju2m2qXt.js → dagre-VKFMJZFB-COEbApyY.js} +1 -1
  747. package/web/assets/{diagram-FQU43EPY-DsHKTt0k.js → diagram-FQU43EPY-0O9WGWKB.js} +1 -1
  748. package/web/assets/{diagram-G47NLZAW-DWHAcLkJ.js → diagram-G47NLZAW-CutEdMVh.js} +1 -1
  749. package/web/assets/{diagram-NH7WQ7WH-uUMz46ZD.js → diagram-NH7WQ7WH-C9KZc3B2.js} +1 -1
  750. package/web/assets/{diagram-OA4YK3LP-BRjVzjdp.js → diagram-OA4YK3LP-D8kkPXbY.js} +1 -1
  751. package/web/assets/{diagram-WEI45ONY-Cb-FhBpQ.js → diagram-WEI45ONY-_YqiTaGP.js} +1 -1
  752. package/web/assets/document-Dgt5eZFj.js +19 -0
  753. package/web/assets/{ebnfDiagram-CCIWWBDH-IhhxX3IB.js → ebnfDiagram-CCIWWBDH-JO-zQh6g.js} +1 -1
  754. package/web/assets/{entities-DUnx74kH.js → entities-C3wz7FCx.js} +12 -12
  755. package/web/assets/{erDiagram-Q63AITRT-D1frgeWf.js → erDiagram-Q63AITRT-9UjQwJ4P.js} +1 -1
  756. package/web/assets/file-viewer-DZJ8nYnl.js +1 -0
  757. package/web/assets/{flowDiagram-23GEKE2U-BiPPM-FY.js → flowDiagram-23GEKE2U-Ca08tnYM.js} +5 -5
  758. package/web/assets/folder-image-BfGgxo7i.js +1 -0
  759. package/web/assets/folder-landing-qUKBCnG-.js +54 -0
  760. package/web/assets/folder-list-BfFjv7rR.js +1 -0
  761. package/web/assets/folder-metadata-DCw8xzHk.js +2 -0
  762. package/web/assets/folder-mobile-bar-Ubz4babf.js +1 -0
  763. package/web/assets/folder-plugin-view-DsWR1zmQ.js +6 -0
  764. package/web/assets/{ganttDiagram-NO4QXBWP-CmEOlHD7.js → ganttDiagram-NO4QXBWP-KnHzX5W3.js} +1 -1
  765. package/web/assets/{gitGraphDiagram-IHSO6WYX-tTjcpZpU.js → gitGraphDiagram-IHSO6WYX-Cm8woNtK.js} +1 -1
  766. package/web/assets/index-BaRnbYRw.js +1 -0
  767. package/web/assets/index-BexmLxIP.css +1 -0
  768. package/web/assets/index-Bp9DidgD.js +1 -0
  769. package/web/assets/{index-eL1k96k8.js → index-CCXE8zc9.js} +1 -1
  770. package/web/assets/index-CNyy98F8.js +2 -0
  771. package/web/assets/{index-DmrKjrlM.js → index-CXhBn-ar.js} +1 -1
  772. package/web/assets/index-DDirZMgx.js +1 -0
  773. package/web/assets/{infoDiagram-FWYZ7A6U-Ok2sdbc1.js → infoDiagram-FWYZ7A6U-yyqmUtIb.js} +1 -1
  774. package/web/assets/{ishikawaDiagram-FXEZZL3T-kPnM5psX.js → ishikawaDiagram-FXEZZL3T-BfvR_Zy4.js} +4 -4
  775. package/web/assets/{journeyDiagram-5HDEW3XC-BkoT0-45.js → journeyDiagram-5HDEW3XC-BKuw06HM.js} +1 -1
  776. package/web/assets/{kanban-definition-HUTT4EX6-xnm_eFoU.js → kanban-definition-HUTT4EX6-n0010rmQ.js} +8 -8
  777. package/web/assets/{linear-CLZpgLH-.js → linear-C0d0lT8O.js} +1 -1
  778. package/web/assets/linked-session-header-BkEweU0Z.js +3 -0
  779. package/web/assets/{markdown-njUwQKsR.js → markdown-Bw9RgUGR.js} +9 -9
  780. package/web/assets/{mermaid.core-Bvxj3RoN.js → mermaid.core-BDVbShyO.js} +6 -6
  781. package/web/assets/metadata-KV0dpp4G.js +1 -0
  782. package/web/assets/{mindmap-definition-LN4V7U3C-42Uoox79.js → mindmap-definition-LN4V7U3C--_0ks3GF.js} +1 -1
  783. package/web/assets/note-card-DBfX6gW1.js +6 -0
  784. package/web/assets/{pegDiagram-2B236MQR-B-GZCw3w.js → pegDiagram-2B236MQR-CBoNIpKR.js} +1 -1
  785. package/web/assets/{pieDiagram-ENE6RG2P-DRmmssIB.js → pieDiagram-ENE6RG2P-MA5tkYh5.js} +3 -3
  786. package/web/assets/popover-DBD7FF-W.js +9 -0
  787. package/web/assets/{project-search-dialog-B730oZ1S.js → project-search-dialog-DM1IkSZu.js} +6 -6
  788. package/web/assets/{quadrantDiagram-ABIIQ3AL-BfhVQ7V9.js → quadrantDiagram-ABIIQ3AL-CWT1ryqF.js} +1 -1
  789. package/web/assets/{railroadDiagram-RFXS5EU6-DxKx7XRp.js → railroadDiagram-RFXS5EU6-ZiLB5FGi.js} +1 -1
  790. package/web/assets/{react-DZzLHL-l.js → react-B9jn2M18.js} +2 -2
  791. package/web/assets/{requirementDiagram-TGXJPOKE-NUzj9fw1.js → requirementDiagram-TGXJPOKE-CQq9uneq.js} +1 -1
  792. package/web/assets/{sankeyDiagram-HTMAVEWB-Cy9OMnl-.js → sankeyDiagram-HTMAVEWB-qDG-0JqI.js} +1 -1
  793. package/web/assets/search-DNrQA5fF.js +2 -0
  794. package/web/assets/select-D8cqNgcp.js +30 -0
  795. package/web/assets/selection-popup-DmtTeRs2.js +7 -0
  796. package/web/assets/{sequenceDiagram-DBY2YBRQ-CBNE9mzn.js → sequenceDiagram-DBY2YBRQ-CiApurLO.js} +1 -1
  797. package/web/assets/{sizeCapture-X5ZJPWSS-S4HhfX0n.js → sizeCapture-X5ZJPWSS-DZSR5QXm.js} +1 -1
  798. package/web/assets/stateDiagram-2N3HPSRC-CjJJR9_z.js +1 -0
  799. package/web/assets/stateDiagram-v2-6OUMAXLB-BpeGSCu9.js +1 -0
  800. package/web/assets/{swimlanes-5IMT3BWC-DJ2aLWal.js → swimlanes-5IMT3BWC-CKmo1sg6.js} +2 -2
  801. package/web/assets/swimlanesDiagram-G3AALYLV-D9RjLKb9.js +8 -0
  802. package/web/assets/tanstack-YzX_Mi37.js +3 -0
  803. package/web/assets/{timeline-definition-FHXFAJF6-vFDUVPCX.js → timeline-definition-FHXFAJF6-D-NMwS3y.js} +1 -1
  804. package/web/assets/{use-folder-filter-BbTUlXgG.js → use-folder-filter-LQyXns5Q.js} +1 -1
  805. package/web/assets/{utils-CwHGE3BB.js → utils-DCaHk0Gm.js} +1 -1
  806. package/web/assets/{vennDiagram-L72KCM5P-AsnhK2zW.js → vennDiagram-L72KCM5P-CfL6LBWw.js} +1 -1
  807. package/web/assets/view-context-gyDl_p2V.js +229 -0
  808. package/web/assets/viewer-capabilities-Bpp8Uvcg.js +1 -0
  809. package/web/assets/{wardleyDiagram-EHGQE667-Cj1wFbNV.js → wardleyDiagram-EHGQE667-DgldMxaj.js} +1 -1
  810. package/web/assets/{xychartDiagram-FW5EYKEG-Bbvnutsm.js → xychartDiagram-FW5EYKEG-CIoAIFX8.js} +1 -1
  811. package/web/favicon.svg +6 -0
  812. package/web/index.html +5 -4
  813. package/web/assets/app-CPSmsokP.js +0 -2
  814. package/web/assets/app-options-XEWvevsz.js +0 -25
  815. package/web/assets/app-view-header-BKZ90ToF.js +0 -1
  816. package/web/assets/arc-DbpbZvCt.js +0 -1
  817. package/web/assets/arrow-left-CFeHb-Z1.js +0 -1
  818. package/web/assets/ask-tray-D2YHtbPj.js +0 -14
  819. package/web/assets/button-BJ7z-ZA7.js +0 -1
  820. package/web/assets/calendar-days-DWh2XMO2.js +0 -1
  821. package/web/assets/channel-dSRp_qTo.js +0 -1
  822. package/web/assets/chevron-down-C5oRtqbX.js +0 -1
  823. package/web/assets/chevron-right-CsPtvh8C.js +0 -1
  824. package/web/assets/chevron-up-DjpU6Pyv.js +0 -1
  825. package/web/assets/classDiagram-OUVF2IWQ-B7B2zLzM.js +0 -1
  826. package/web/assets/classDiagram-v2-EOCWNBFH-B7B2zLzM.js +0 -1
  827. package/web/assets/client-CAudjYV9.js +0 -34
  828. package/web/assets/client-Dn9-_Gm_.js +0 -14
  829. package/web/assets/client-Dxrf2tyq.js +0 -102
  830. package/web/assets/client-aFI2M4pE.js +0 -53
  831. package/web/assets/collection-icon-TbOVyORG.js +0 -1
  832. package/web/assets/collection-page-Du6FKkuU.js +0 -10
  833. package/web/assets/command-C_g5E1Wx.js +0 -38
  834. package/web/assets/copy-Ikmr6Iq2.js +0 -1
  835. package/web/assets/copy-context-Cl1TE2PJ.js +0 -1
  836. package/web/assets/document-DcjNSJCk.js +0 -2
  837. package/web/assets/external-link-BXmSXqqF.js +0 -1
  838. package/web/assets/file-renderer-BRZTrYx8.js +0 -19
  839. package/web/assets/file-text-CiiSsCDq.js +0 -1
  840. package/web/assets/file-viewer-C1wAeVDK.js +0 -1
  841. package/web/assets/folder-image-AXBrHUcU.js +0 -1
  842. package/web/assets/folder-landing-BhRg7hwn.js +0 -54
  843. package/web/assets/folder-list-rIdszVde.js +0 -1
  844. package/web/assets/folder-metadata-puTC5QqJ.js +0 -2
  845. package/web/assets/folder-mobile-bar-DjjRQo3T.js +0 -1
  846. package/web/assets/folder-plugin-view-BU_kzR8j.js +0 -6
  847. package/web/assets/index-DS2Wmd9I.css +0 -1
  848. package/web/assets/index-DgqzSeIR.js +0 -1
  849. package/web/assets/index-DnlTDqaa.js +0 -1
  850. package/web/assets/index-DztTMDFz.js +0 -2
  851. package/web/assets/index-kY75qc96.js +0 -1
  852. package/web/assets/index-p38i_yyY.js +0 -1
  853. package/web/assets/link-2-BWKA6t--.js +0 -1
  854. package/web/assets/link-DC_1Z6Yy.js +0 -11
  855. package/web/assets/linked-session-header-DJYWZ_-q.js +0 -3
  856. package/web/assets/mail-2rCdIFul.js +0 -1
  857. package/web/assets/markdown-title-dncAYYiP.js +0 -131
  858. package/web/assets/notes-page-DIW6rgJp.js +0 -10
  859. package/web/assets/pencil-8cobiSSq.js +0 -1
  860. package/web/assets/plus-BHV2wJr7.js +0 -1
  861. package/web/assets/popover-Cmmgj-MJ.js +0 -9
  862. package/web/assets/search-CvlYUkN6.js +0 -2
  863. package/web/assets/select-1SvaKQsS.js +0 -30
  864. package/web/assets/selection-popup-ntjycEVh.js +0 -7
  865. package/web/assets/sparkles-CBhGREdc.js +0 -1
  866. package/web/assets/stateDiagram-2N3HPSRC-BEw1Mheu.js +0 -1
  867. package/web/assets/stateDiagram-v2-6OUMAXLB-BHtjl1iD.js +0 -1
  868. package/web/assets/swimlanesDiagram-G3AALYLV-Z362aroZ.js +0 -8
  869. package/web/assets/tanstack-CD46mJkU.js +0 -1
  870. package/web/assets/view-context-D-fh9AbH.js +0 -81
  871. package/web/assets/viewer-capabilities-CROIaoqh.js +0 -1
  872. package/web/assets/x-BUeE--I4.js +0 -1
@@ -0,0 +1,3066 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { defaultOnError, excludeKnownTags, preserveCustomPayload, requiredDefaultOnError, vecSkipError, } from "../schema-deserialize.js";
3
+ import * as z from "zod/v4";
4
+ /**
5
+ * JSON RPC Request Id
6
+ *
7
+ * An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null \[1\] and Numbers SHOULD NOT contain fractional parts \[2\]
8
+ *
9
+ * The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.
10
+ *
11
+ * \[1\] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.
12
+ *
13
+ * \[2\] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.
14
+ */
15
+ export const zRequestId = z.union([z.number(), z.string()]).nullable();
16
+ /**
17
+ * A unique identifier for a conversation session between a client and agent.
18
+ *
19
+ * Sessions maintain their own context, conversation history, and state,
20
+ * allowing multiple independent interactions with the same agent.
21
+ *
22
+ * See protocol docs: [Session ID](https://agentclientprotocol.com/protocol/session-setup#session-id)
23
+ */
24
+ export const zSessionId = z.string();
25
+ /**
26
+ * Request to write content to a text file.
27
+ *
28
+ * Only available if the client supports the `fs.writeTextFile` capability.
29
+ */
30
+ export const zWriteTextFileRequest = z.object({
31
+ sessionId: zSessionId,
32
+ path: z.string(),
33
+ content: z.string(),
34
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
35
+ });
36
+ /**
37
+ * Request to read content from a text file.
38
+ *
39
+ * Only available if the client supports the `fs.readTextFile` capability.
40
+ */
41
+ export const zReadTextFileRequest = z.object({
42
+ sessionId: zSessionId,
43
+ path: z.string(),
44
+ line: defaultOnError(z
45
+ .int()
46
+ .gte(0)
47
+ .max(4294967295, {
48
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
49
+ })
50
+ .nullish(), () => undefined),
51
+ limit: defaultOnError(z
52
+ .int()
53
+ .gte(0)
54
+ .max(4294967295, {
55
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
56
+ })
57
+ .nullish(), () => undefined),
58
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
59
+ });
60
+ /**
61
+ * Unique identifier for a tool call within a session.
62
+ */
63
+ export const zToolCallId = z.string();
64
+ /**
65
+ * Categories of tools that can be invoked.
66
+ *
67
+ * Tool kinds help clients choose appropriate icons and optimize how they
68
+ * display tool execution progress.
69
+ *
70
+ * See protocol docs: [Creating](https://agentclientprotocol.com/protocol/tool-calls#creating)
71
+ */
72
+ export const zToolKind = z.union([
73
+ z.literal("read"),
74
+ z.literal("edit"),
75
+ z.literal("delete"),
76
+ z.literal("move"),
77
+ z.literal("search"),
78
+ z.literal("execute"),
79
+ z.literal("think"),
80
+ z.literal("fetch"),
81
+ z.literal("switch_mode"),
82
+ z.literal("other"),
83
+ ]);
84
+ /**
85
+ * Execution status of a tool call.
86
+ *
87
+ * Tool calls progress through different statuses during their lifecycle.
88
+ *
89
+ * See protocol docs: [Status](https://agentclientprotocol.com/protocol/tool-calls#status)
90
+ */
91
+ export const zToolCallStatus = z.union([
92
+ z.literal("pending"),
93
+ z.literal("in_progress"),
94
+ z.literal("completed"),
95
+ z.literal("failed"),
96
+ ]);
97
+ /**
98
+ * The sender or recipient of messages and data in a conversation.
99
+ */
100
+ export const zRole = z.union([z.literal("assistant"), z.literal("user")]);
101
+ /**
102
+ * Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
103
+ */
104
+ export const zAnnotations = z.object({
105
+ audience: defaultOnError(vecSkipError(zRole).nullish(), () => undefined),
106
+ lastModified: defaultOnError(z.string().nullish(), () => undefined),
107
+ priority: defaultOnError(z.number().nullish(), () => undefined),
108
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
109
+ });
110
+ /**
111
+ * Text provided to or from an LLM.
112
+ */
113
+ export const zTextContent = z.object({
114
+ annotations: defaultOnError(zAnnotations.nullish(), () => undefined),
115
+ text: z.string(),
116
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
117
+ });
118
+ /**
119
+ * An image provided to or from an LLM.
120
+ */
121
+ export const zImageContent = z.object({
122
+ annotations: defaultOnError(zAnnotations.nullish(), () => undefined),
123
+ data: z.string(),
124
+ mimeType: z.string(),
125
+ uri: defaultOnError(z.string().nullish(), () => undefined),
126
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
127
+ });
128
+ /**
129
+ * Audio provided to or from an LLM.
130
+ */
131
+ export const zAudioContent = z.object({
132
+ annotations: defaultOnError(zAnnotations.nullish(), () => undefined),
133
+ data: z.string(),
134
+ mimeType: z.string(),
135
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
136
+ });
137
+ /**
138
+ * A resource that the server is capable of reading, included in a prompt or tool call result.
139
+ */
140
+ export const zResourceLink = z.object({
141
+ annotations: defaultOnError(zAnnotations.nullish(), () => undefined),
142
+ description: defaultOnError(z.string().nullish(), () => undefined),
143
+ mimeType: defaultOnError(z.string().nullish(), () => undefined),
144
+ name: z.string(),
145
+ size: defaultOnError(z.number().nullish(), () => undefined),
146
+ title: defaultOnError(z.string().nullish(), () => undefined),
147
+ uri: z.string(),
148
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
149
+ });
150
+ /**
151
+ * Text-based resource contents.
152
+ */
153
+ export const zTextResourceContents = z.object({
154
+ mimeType: defaultOnError(z.string().nullish(), () => undefined),
155
+ text: z.string(),
156
+ uri: z.string(),
157
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
158
+ });
159
+ /**
160
+ * Binary resource contents.
161
+ */
162
+ export const zBlobResourceContents = z.object({
163
+ blob: z.string(),
164
+ mimeType: defaultOnError(z.string().nullish(), () => undefined),
165
+ uri: z.string(),
166
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
167
+ });
168
+ /**
169
+ * Resource content that can be embedded in a message.
170
+ */
171
+ export const zEmbeddedResourceResource = z.union([
172
+ zTextResourceContents,
173
+ zBlobResourceContents,
174
+ ]);
175
+ /**
176
+ * The contents of a resource, embedded into a prompt or tool call result.
177
+ */
178
+ export const zEmbeddedResource = z.object({
179
+ annotations: defaultOnError(zAnnotations.nullish(), () => undefined),
180
+ resource: zEmbeddedResourceResource,
181
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
182
+ });
183
+ /**
184
+ * Content blocks represent displayable information in the Agent Client Protocol.
185
+ *
186
+ * They provide a structured way to handle various types of user-facing content—whether
187
+ * it's text from language models, images for analysis, or embedded resources for context.
188
+ *
189
+ * Content blocks appear in:
190
+ * - User prompts sent via `session/prompt`
191
+ * - Language model output streamed through `session/update` notifications
192
+ * - Progress updates and results from tool calls
193
+ *
194
+ * This structure is compatible with the Model Context Protocol (MCP), enabling
195
+ * agents to seamlessly forward content from MCP tool outputs without transformation.
196
+ *
197
+ * See protocol docs: [Content](https://agentclientprotocol.com/protocol/content)
198
+ */
199
+ export const zContentBlock = z.union([
200
+ zTextContent.and(z.object({
201
+ type: z.literal("text"),
202
+ })),
203
+ zImageContent.and(z.object({
204
+ type: z.literal("image"),
205
+ })),
206
+ zAudioContent.and(z.object({
207
+ type: z.literal("audio"),
208
+ })),
209
+ zResourceLink.and(z.object({
210
+ type: z.literal("resource_link"),
211
+ })),
212
+ zEmbeddedResource.and(z.object({
213
+ type: z.literal("resource"),
214
+ })),
215
+ ]);
216
+ /**
217
+ * Standard content block (text, images, resources).
218
+ */
219
+ export const zContent = z.object({
220
+ content: zContentBlock,
221
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
222
+ });
223
+ /**
224
+ * A diff representing file modifications.
225
+ *
226
+ * Shows changes to files in a format suitable for display in the client UI.
227
+ *
228
+ * See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)
229
+ */
230
+ export const zDiff = z.object({
231
+ path: z.string(),
232
+ oldText: defaultOnError(z.string().nullish(), () => undefined),
233
+ newText: z.string(),
234
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
235
+ });
236
+ /**
237
+ * Typed identifier used for terminal values on the wire.
238
+ */
239
+ export const zTerminalId = z.string();
240
+ /**
241
+ * Embed a terminal created with `terminal/create` by its id.
242
+ *
243
+ * The terminal must be added before calling `terminal/release`.
244
+ *
245
+ * See protocol docs: [Terminal](https://agentclientprotocol.com/protocol/terminals)
246
+ */
247
+ export const zTerminal = z.object({
248
+ terminalId: zTerminalId,
249
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
250
+ });
251
+ /**
252
+ * Content produced by a tool call.
253
+ *
254
+ * Tool calls can produce different types of content including
255
+ * standard content blocks (text, images) or file diffs.
256
+ *
257
+ * See protocol docs: [Content](https://agentclientprotocol.com/protocol/tool-calls#content)
258
+ */
259
+ export const zToolCallContent = z.union([
260
+ zContent.and(z.object({
261
+ type: z.literal("content"),
262
+ })),
263
+ zDiff.and(z.object({
264
+ type: z.literal("diff"),
265
+ })),
266
+ zTerminal.and(z.object({
267
+ type: z.literal("terminal"),
268
+ })),
269
+ ]);
270
+ /**
271
+ * A file location being accessed or modified by a tool.
272
+ *
273
+ * Enables clients to implement "follow-along" features that track
274
+ * which files the agent is working with in real-time.
275
+ *
276
+ * See protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/tool-calls#following-the-agent)
277
+ */
278
+ export const zToolCallLocation = z.object({
279
+ path: z.string(),
280
+ line: defaultOnError(z
281
+ .int()
282
+ .gte(0)
283
+ .max(4294967295, {
284
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
285
+ })
286
+ .nullish(), () => undefined),
287
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
288
+ });
289
+ /**
290
+ * An update to an existing tool call.
291
+ *
292
+ * Used to report progress and results as tools execute. All fields except
293
+ * the tool call ID are optional - only changed fields need to be included.
294
+ *
295
+ * See protocol docs: [Updating](https://agentclientprotocol.com/protocol/tool-calls#updating)
296
+ */
297
+ export const zToolCallUpdate = z.object({
298
+ toolCallId: zToolCallId,
299
+ kind: defaultOnError(zToolKind.nullish(), () => undefined),
300
+ status: defaultOnError(zToolCallStatus.nullish(), () => undefined),
301
+ title: defaultOnError(z.string().nullish(), () => undefined),
302
+ name: defaultOnError(z.string().nullish(), () => undefined),
303
+ content: defaultOnError(vecSkipError(zToolCallContent).nullish(), () => undefined),
304
+ locations: defaultOnError(vecSkipError(zToolCallLocation).nullish(), () => undefined),
305
+ rawInput: defaultOnError(z.unknown().optional(), () => undefined),
306
+ rawOutput: defaultOnError(z.unknown().optional(), () => undefined),
307
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
308
+ });
309
+ /**
310
+ * Unique identifier for a permission option.
311
+ */
312
+ export const zPermissionOptionId = z.string();
313
+ /**
314
+ * The type of permission option being presented to the user.
315
+ *
316
+ * Helps clients choose appropriate icons and UI treatment.
317
+ */
318
+ export const zPermissionOptionKind = z.union([
319
+ z.literal("allow_once"),
320
+ z.literal("allow_always"),
321
+ z.literal("reject_once"),
322
+ z.literal("reject_always"),
323
+ ]);
324
+ /**
325
+ * An option presented to the user when requesting permission.
326
+ */
327
+ export const zPermissionOption = z.object({
328
+ optionId: zPermissionOptionId,
329
+ name: z.string(),
330
+ kind: zPermissionOptionKind,
331
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
332
+ });
333
+ /**
334
+ * Request for user permission to execute a tool call.
335
+ *
336
+ * Sent when the agent needs authorization before performing a sensitive operation.
337
+ *
338
+ * See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/tool-calls#requesting-permission)
339
+ */
340
+ export const zRequestPermissionRequest = z.object({
341
+ sessionId: zSessionId,
342
+ toolCall: zToolCallUpdate,
343
+ options: z.array(zPermissionOption),
344
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
345
+ });
346
+ /**
347
+ * An environment variable to set when launching an MCP server.
348
+ */
349
+ export const zEnvVariable = z.object({
350
+ name: z.string(),
351
+ value: z.string(),
352
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
353
+ });
354
+ /**
355
+ * Request to create a new terminal and execute a command.
356
+ */
357
+ export const zCreateTerminalRequest = z.object({
358
+ sessionId: zSessionId,
359
+ command: z.string(),
360
+ args: defaultOnError(vecSkipError(z.string()).optional(), () => []),
361
+ env: defaultOnError(vecSkipError(zEnvVariable).optional(), () => []),
362
+ cwd: defaultOnError(z.string().nullish(), () => undefined),
363
+ outputByteLimit: defaultOnError(z.number().nullish(), () => undefined),
364
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
365
+ });
366
+ /**
367
+ * Request to get the current output and status of a terminal.
368
+ */
369
+ export const zTerminalOutputRequest = z.object({
370
+ sessionId: zSessionId,
371
+ terminalId: zTerminalId,
372
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
373
+ });
374
+ /**
375
+ * Request to release a terminal and free its resources.
376
+ */
377
+ export const zReleaseTerminalRequest = z.object({
378
+ sessionId: zSessionId,
379
+ terminalId: zTerminalId,
380
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
381
+ });
382
+ /**
383
+ * Request to wait for a terminal command to exit.
384
+ */
385
+ export const zWaitForTerminalExitRequest = z.object({
386
+ sessionId: zSessionId,
387
+ terminalId: zTerminalId,
388
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
389
+ });
390
+ /**
391
+ * Request to kill a terminal without releasing it.
392
+ */
393
+ export const zKillTerminalRequest = z.object({
394
+ sessionId: zSessionId,
395
+ terminalId: zTerminalId,
396
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
397
+ });
398
+ /**
399
+ * **UNSTABLE**
400
+ *
401
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
402
+ *
403
+ * Session-scoped elicitation, optionally tied to a specific tool call.
404
+ *
405
+ * When `tool_call_id` is set, the elicitation is tied to a specific tool call.
406
+ * This is useful when an agent receives an elicitation from an MCP server
407
+ * during a tool call and needs to redirect it to the user.
408
+ *
409
+ * @experimental
410
+ */
411
+ export const zElicitationSessionScope = z.object({
412
+ sessionId: zSessionId,
413
+ toolCallId: defaultOnError(zToolCallId.nullish(), () => undefined),
414
+ });
415
+ /**
416
+ * **UNSTABLE**
417
+ *
418
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
419
+ *
420
+ * Request-scoped elicitation, tied to a specific JSON-RPC request outside of a session
421
+ * (e.g., during auth/configuration phases before any session is started).
422
+ *
423
+ * @experimental
424
+ */
425
+ export const zElicitationRequestScope = z.object({
426
+ requestId: zRequestId,
427
+ });
428
+ /**
429
+ * Object schema type.
430
+ */
431
+ export const zElicitationSchemaType = z.literal("object");
432
+ /**
433
+ * String format types for string properties in elicitation schemas.
434
+ */
435
+ export const zStringFormat = z.union([
436
+ z.literal("email"),
437
+ z.literal("uri"),
438
+ z.literal("date"),
439
+ z.literal("date-time"),
440
+ ]);
441
+ /**
442
+ * A titled enum option with a const value, human-readable title, and optional description.
443
+ */
444
+ export const zEnumOption = z.object({
445
+ const: z.string(),
446
+ title: z.string(),
447
+ description: defaultOnError(z.string().nullish(), () => undefined),
448
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
449
+ });
450
+ /**
451
+ * Schema for string properties in an elicitation form.
452
+ *
453
+ * When `enum` or `oneOf` is set, this represents a single-select enum
454
+ * with `"type": "string"`.
455
+ */
456
+ export const zStringPropertySchema = z.object({
457
+ title: defaultOnError(z.string().nullish(), () => undefined),
458
+ description: defaultOnError(z.string().nullish(), () => undefined),
459
+ minLength: z
460
+ .int()
461
+ .gte(0)
462
+ .max(4294967295, {
463
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
464
+ })
465
+ .nullish(),
466
+ maxLength: z
467
+ .int()
468
+ .gte(0)
469
+ .max(4294967295, {
470
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
471
+ })
472
+ .nullish(),
473
+ pattern: z.string().nullish(),
474
+ format: zStringFormat.nullish(),
475
+ default: defaultOnError(z.string().nullish(), () => undefined),
476
+ enum: z.array(z.string()).nullish(),
477
+ oneOf: z.array(zEnumOption).nullish(),
478
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
479
+ });
480
+ /**
481
+ * Schema for number (floating-point) properties in an elicitation form.
482
+ */
483
+ export const zNumberPropertySchema = z.object({
484
+ title: defaultOnError(z.string().nullish(), () => undefined),
485
+ description: defaultOnError(z.string().nullish(), () => undefined),
486
+ minimum: z.number().nullish(),
487
+ maximum: z.number().nullish(),
488
+ default: defaultOnError(z.number().nullish(), () => undefined),
489
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
490
+ });
491
+ /**
492
+ * Schema for integer properties in an elicitation form.
493
+ */
494
+ export const zIntegerPropertySchema = z.object({
495
+ title: defaultOnError(z.string().nullish(), () => undefined),
496
+ description: defaultOnError(z.string().nullish(), () => undefined),
497
+ minimum: z.number().nullish(),
498
+ maximum: z.number().nullish(),
499
+ default: defaultOnError(z.number().nullish(), () => undefined),
500
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
501
+ });
502
+ /**
503
+ * Schema for boolean properties in an elicitation form.
504
+ */
505
+ export const zBooleanPropertySchema = z.object({
506
+ title: defaultOnError(z.string().nullish(), () => undefined),
507
+ description: defaultOnError(z.string().nullish(), () => undefined),
508
+ default: defaultOnError(z.boolean().nullish(), () => undefined),
509
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
510
+ });
511
+ /**
512
+ * String item schema for multi-select enum properties.
513
+ */
514
+ export const zStringMultiSelectItems = z.object({
515
+ enum: z.array(z.string()),
516
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
517
+ });
518
+ /**
519
+ * Items definition for titled multi-select enum properties.
520
+ */
521
+ export const zTitledMultiSelectItems = z.object({
522
+ anyOf: z.array(zEnumOption),
523
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
524
+ });
525
+ /**
526
+ * Items for a multi-select (array) property schema.
527
+ *
528
+ * Custom variants (unknown `type` values) keep their extra
529
+ * properties exactly as received; unlike known variants, those keys
530
+ * bypass lenient-field salvage and arrive unvalidated.
531
+ */
532
+ export const zMultiSelectItems = preserveCustomPayload(z.union([
533
+ zStringMultiSelectItems.and(z.object({
534
+ type: z.literal("string"),
535
+ })),
536
+ excludeKnownTags(z.object({
537
+ type: z.string(),
538
+ }), "type", ["string"]),
539
+ zTitledMultiSelectItems,
540
+ ]), "type", ["string"]);
541
+ /**
542
+ * Schema for multi-select (array) properties in an elicitation form.
543
+ */
544
+ export const zMultiSelectPropertySchema = z.object({
545
+ title: defaultOnError(z.string().nullish(), () => undefined),
546
+ description: defaultOnError(z.string().nullish(), () => undefined),
547
+ minItems: z.number().nullish(),
548
+ maxItems: z.number().nullish(),
549
+ items: zMultiSelectItems,
550
+ default: defaultOnError(vecSkipError(z.string()).nullish(), () => undefined),
551
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
552
+ });
553
+ /**
554
+ * Property schema for elicitation form fields.
555
+ *
556
+ * Each variant corresponds to a JSON Schema `"type"` value.
557
+ * Single-select enums use the `String` variant with `enum` or `oneOf` set.
558
+ * Multi-select enums use the `Array` variant.
559
+ *
560
+ * Custom variants (unknown `type` values) keep their extra
561
+ * properties exactly as received; unlike known variants, those keys
562
+ * bypass lenient-field salvage and arrive unvalidated.
563
+ */
564
+ export const zElicitationPropertySchema = preserveCustomPayload(z.union([
565
+ zStringPropertySchema.and(z.object({
566
+ type: z.literal("string"),
567
+ })),
568
+ zNumberPropertySchema.and(z.object({
569
+ type: z.literal("number"),
570
+ })),
571
+ zIntegerPropertySchema.and(z.object({
572
+ type: z.literal("integer"),
573
+ })),
574
+ zBooleanPropertySchema.and(z.object({
575
+ type: z.literal("boolean"),
576
+ })),
577
+ zMultiSelectPropertySchema.and(z.object({
578
+ type: z.literal("array"),
579
+ })),
580
+ excludeKnownTags(z.object({
581
+ type: z.string(),
582
+ }), "type", ["array", "boolean", "integer", "number", "string"]),
583
+ ]), "type", ["array", "boolean", "integer", "number", "string"]);
584
+ /**
585
+ * Type-safe elicitation schema for requesting structured user input.
586
+ *
587
+ * This represents a JSON Schema object with primitive-typed properties,
588
+ * as required by the elicitation specification.
589
+ */
590
+ export const zElicitationSchema = z.object({
591
+ type: defaultOnError(zElicitationSchemaType.optional().default("object"), () => "object"),
592
+ title: defaultOnError(z.string().nullish(), () => undefined),
593
+ properties: z
594
+ .record(z.string(), zElicitationPropertySchema)
595
+ .optional()
596
+ .default({}),
597
+ required: z.array(z.string()).nullish(),
598
+ description: defaultOnError(z.string().nullish(), () => undefined),
599
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
600
+ });
601
+ /**
602
+ * **UNSTABLE**
603
+ *
604
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
605
+ *
606
+ * Form-based elicitation mode where the client renders a form from the provided schema.
607
+ *
608
+ * @experimental
609
+ */
610
+ export const zElicitationFormMode = z.intersection(z.union([zElicitationSessionScope, zElicitationRequestScope]), z.object({
611
+ requestedSchema: zElicitationSchema,
612
+ }));
613
+ /**
614
+ * **UNSTABLE**
615
+ *
616
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
617
+ *
618
+ * Unique identifier for an elicitation.
619
+ *
620
+ * @experimental
621
+ */
622
+ export const zElicitationId = z.string();
623
+ /**
624
+ * **UNSTABLE**
625
+ *
626
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
627
+ *
628
+ * URL-based elicitation mode where the client directs the user to a URL.
629
+ *
630
+ * @experimental
631
+ */
632
+ export const zElicitationUrlMode = z.intersection(z.union([zElicitationSessionScope, zElicitationRequestScope]), z.object({
633
+ elicitationId: zElicitationId,
634
+ url: z.url(),
635
+ }));
636
+ /**
637
+ * **UNSTABLE**
638
+ *
639
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
640
+ *
641
+ * Request from the agent to elicit structured user input.
642
+ *
643
+ * The agent sends this to the client to request information from the user,
644
+ * either via a form or by directing them to a URL.
645
+ * Elicitations are tied to a session (optionally a tool call) or a request.
646
+ *
647
+ * @experimental
648
+ *
649
+ * Custom variants (unknown `mode` values) keep their extra
650
+ * properties exactly as received; unlike known variants, those keys
651
+ * bypass lenient-field salvage and arrive unvalidated.
652
+ */
653
+ export const zCreateElicitationRequest = preserveCustomPayload(z.intersection(z.union([
654
+ zElicitationFormMode.and(z.object({
655
+ mode: z.literal("form"),
656
+ })),
657
+ zElicitationUrlMode.and(z.object({
658
+ mode: z.literal("url"),
659
+ })),
660
+ excludeKnownTags(z.intersection(z.union([zElicitationSessionScope, zElicitationRequestScope]), z.object({
661
+ mode: z.string(),
662
+ })), "mode", ["form", "url"]),
663
+ ]), z.object({
664
+ message: z.string(),
665
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
666
+ })), "mode", ["form", "url"]);
667
+ /**
668
+ * **UNSTABLE**
669
+ *
670
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
671
+ *
672
+ * Unique identifier for an MCP server using the ACP transport.
673
+ *
674
+ * The value is opaque and generated by the ACP component providing the MCP server. It is
675
+ * used by `mcp/connect` to route connection requests back to the component that declared the
676
+ * server.
677
+ *
678
+ * @experimental
679
+ */
680
+ export const zMcpServerAcpId = z.string();
681
+ /**
682
+ * **UNSTABLE**
683
+ *
684
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
685
+ *
686
+ * Request parameters for `mcp/connect`.
687
+ *
688
+ * @experimental
689
+ */
690
+ export const zConnectMcpRequest = z.object({
691
+ serverId: zMcpServerAcpId,
692
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
693
+ });
694
+ /**
695
+ * **UNSTABLE**
696
+ *
697
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
698
+ *
699
+ * A unique identifier for an active MCP-over-ACP connection.
700
+ *
701
+ * @experimental
702
+ */
703
+ export const zMcpConnectionId = z.string();
704
+ /**
705
+ * **UNSTABLE**
706
+ *
707
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
708
+ *
709
+ * Request parameters for `mcp/message`.
710
+ *
711
+ * @experimental
712
+ */
713
+ export const zMessageMcpRequest = z.object({
714
+ connectionId: zMcpConnectionId,
715
+ method: z.string(),
716
+ params: z.record(z.string(), z.unknown()).nullish(),
717
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
718
+ });
719
+ /**
720
+ * **UNSTABLE**
721
+ *
722
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
723
+ *
724
+ * Request parameters for `mcp/disconnect`.
725
+ *
726
+ * @experimental
727
+ */
728
+ export const zDisconnectMcpRequest = z.object({
729
+ connectionId: zMcpConnectionId,
730
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
731
+ });
732
+ /**
733
+ * Allows for sending an arbitrary request that is not part of the ACP spec.
734
+ * Extension methods provide a way to add custom functionality while maintaining
735
+ * protocol compatibility.
736
+ *
737
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
738
+ */
739
+ export const zExtRequest = z.unknown();
740
+ /**
741
+ * A JSON-RPC request object.
742
+ */
743
+ export const zAgentRequest = z.object({
744
+ id: zRequestId,
745
+ method: z.string(),
746
+ params: z
747
+ .union([
748
+ zWriteTextFileRequest,
749
+ zReadTextFileRequest,
750
+ zRequestPermissionRequest,
751
+ zCreateTerminalRequest,
752
+ zTerminalOutputRequest,
753
+ zReleaseTerminalRequest,
754
+ zWaitForTerminalExitRequest,
755
+ zKillTerminalRequest,
756
+ zCreateElicitationRequest,
757
+ zConnectMcpRequest,
758
+ zMessageMcpRequest,
759
+ zDisconnectMcpRequest,
760
+ zExtRequest,
761
+ ])
762
+ .nullish(),
763
+ });
764
+ /**
765
+ * Protocol version identifier.
766
+ *
767
+ * This version is only bumped for breaking changes.
768
+ * Non-breaking changes should be introduced via capabilities.
769
+ */
770
+ export const zProtocolVersion = z.int().gte(0).lte(65535);
771
+ /**
772
+ * Prompt capabilities supported by the agent in `session/prompt` requests.
773
+ *
774
+ * Baseline agent functionality requires support for [`ContentBlock::Text`]
775
+ * and [`ContentBlock::ResourceLink`] in prompt requests.
776
+ *
777
+ * Other variants must be explicitly opted in to.
778
+ * Capabilities for different types of content in prompt requests.
779
+ *
780
+ * Indicates which content types beyond the baseline (text and resource links)
781
+ * the agent can process.
782
+ *
783
+ * See protocol docs: [Prompt Capabilities](https://agentclientprotocol.com/protocol/initialization#prompt-capabilities)
784
+ */
785
+ export const zPromptCapabilities = z.object({
786
+ image: defaultOnError(z.boolean().optional().default(false), () => false),
787
+ audio: defaultOnError(z.boolean().optional().default(false), () => false),
788
+ embeddedContext: defaultOnError(z.boolean().optional().default(false), () => false),
789
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
790
+ });
791
+ /**
792
+ * MCP capabilities supported by the agent
793
+ */
794
+ export const zMcpCapabilities = z.object({
795
+ http: defaultOnError(z.boolean().optional().default(false), () => false),
796
+ sse: defaultOnError(z.boolean().optional().default(false), () => false),
797
+ acp: defaultOnError(z.boolean().optional().default(false), () => false),
798
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
799
+ });
800
+ /**
801
+ * Capabilities for the `session/list` method.
802
+ *
803
+ * Supplying `{}` means the agent supports listing sessions.
804
+ */
805
+ export const zSessionListCapabilities = z.object({
806
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
807
+ });
808
+ /**
809
+ * Capabilities for the `session/delete` method.
810
+ *
811
+ * Supplying `{}` means the agent supports deleting sessions from `session/list`.
812
+ */
813
+ export const zSessionDeleteCapabilities = z.object({
814
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
815
+ });
816
+ /**
817
+ * Capabilities for additional session directories support.
818
+ *
819
+ * Supplying `{}` means the agent supports the `additionalDirectories` field on
820
+ * supported session lifecycle requests. Agents that also support
821
+ * `session/list` may return `SessionInfo.additionalDirectories` to report the
822
+ * complete ordered additional-root list associated with a listed session.
823
+ */
824
+ export const zSessionAdditionalDirectoriesCapabilities = z.object({
825
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
826
+ });
827
+ /**
828
+ * **UNSTABLE**
829
+ *
830
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
831
+ *
832
+ * Capabilities for the `session/fork` method.
833
+ *
834
+ * Supplying `{}` means the agent supports forking sessions.
835
+ *
836
+ * @experimental
837
+ */
838
+ export const zSessionForkCapabilities = z.object({
839
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
840
+ });
841
+ /**
842
+ * Capabilities for the `session/resume` method.
843
+ *
844
+ * Supplying `{}` means the agent supports resuming sessions.
845
+ */
846
+ export const zSessionResumeCapabilities = z.object({
847
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
848
+ });
849
+ /**
850
+ * Capabilities for the `session/close` method.
851
+ *
852
+ * Supplying `{}` means the agent supports closing sessions.
853
+ */
854
+ export const zSessionCloseCapabilities = z.object({
855
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
856
+ });
857
+ /**
858
+ * Session capabilities supported by the agent.
859
+ *
860
+ * As a baseline, all Agents **MUST** support `session/new`, `session/prompt`, `session/cancel`, and `session/update`.
861
+ *
862
+ * Optionally, they **MAY** support other session methods and notifications by specifying additional capabilities.
863
+ *
864
+ * Note: `session/load` is still handled by the top-level `load_session` capability. This will be unified in future versions of the protocol.
865
+ *
866
+ * See protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/initialization#session-capabilities)
867
+ */
868
+ export const zSessionCapabilities = z.object({
869
+ list: defaultOnError(zSessionListCapabilities.nullish(), () => undefined),
870
+ delete: defaultOnError(zSessionDeleteCapabilities.nullish(), () => undefined),
871
+ additionalDirectories: defaultOnError(zSessionAdditionalDirectoriesCapabilities.nullish(), () => undefined),
872
+ fork: defaultOnError(zSessionForkCapabilities.nullish(), () => undefined),
873
+ resume: defaultOnError(zSessionResumeCapabilities.nullish(), () => undefined),
874
+ close: defaultOnError(zSessionCloseCapabilities.nullish(), () => undefined),
875
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
876
+ });
877
+ /**
878
+ * Logout capabilities supported by the agent.
879
+ *
880
+ * Supplying `{}` means the agent supports the logout method.
881
+ */
882
+ export const zLogoutCapabilities = z.object({
883
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
884
+ });
885
+ /**
886
+ * Authentication-related capabilities supported by the agent.
887
+ */
888
+ export const zAgentAuthCapabilities = z.object({
889
+ logout: defaultOnError(zLogoutCapabilities.nullish(), () => undefined),
890
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
891
+ });
892
+ /**
893
+ * **UNSTABLE**
894
+ *
895
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
896
+ *
897
+ * Provider configuration capabilities supported by the agent.
898
+ *
899
+ * Supplying `{}` means the agent supports provider configuration methods.
900
+ *
901
+ * @experimental
902
+ */
903
+ export const zProvidersCapabilities = z.object({
904
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
905
+ });
906
+ /**
907
+ * Marker for `document/didOpen` capability support.
908
+ */
909
+ export const zNesDocumentDidOpenCapabilities = z.object({
910
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
911
+ });
912
+ /**
913
+ * How the agent wants document changes delivered.
914
+ */
915
+ export const zTextDocumentSyncKind = z.union([
916
+ z.literal("full"),
917
+ z.literal("incremental"),
918
+ ]);
919
+ /**
920
+ * Capabilities for `document/didChange` events.
921
+ */
922
+ export const zNesDocumentDidChangeCapabilities = z.object({
923
+ syncKind: zTextDocumentSyncKind,
924
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
925
+ });
926
+ /**
927
+ * Marker for `document/didClose` capability support.
928
+ */
929
+ export const zNesDocumentDidCloseCapabilities = z.object({
930
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
931
+ });
932
+ /**
933
+ * Marker for `document/didSave` capability support.
934
+ */
935
+ export const zNesDocumentDidSaveCapabilities = z.object({
936
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
937
+ });
938
+ /**
939
+ * Marker for `document/didFocus` capability support.
940
+ */
941
+ export const zNesDocumentDidFocusCapabilities = z.object({
942
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
943
+ });
944
+ /**
945
+ * Document event capabilities the agent wants to receive.
946
+ */
947
+ export const zNesDocumentEventCapabilities = z.object({
948
+ didOpen: defaultOnError(zNesDocumentDidOpenCapabilities.nullish(), () => undefined),
949
+ didChange: defaultOnError(zNesDocumentDidChangeCapabilities.nullish(), () => undefined),
950
+ didClose: defaultOnError(zNesDocumentDidCloseCapabilities.nullish(), () => undefined),
951
+ didSave: defaultOnError(zNesDocumentDidSaveCapabilities.nullish(), () => undefined),
952
+ didFocus: defaultOnError(zNesDocumentDidFocusCapabilities.nullish(), () => undefined),
953
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
954
+ });
955
+ /**
956
+ * Event capabilities the agent can consume.
957
+ */
958
+ export const zNesEventCapabilities = z.object({
959
+ document: defaultOnError(zNesDocumentEventCapabilities.nullish(), () => undefined),
960
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
961
+ });
962
+ /**
963
+ * Capabilities for recent files context.
964
+ */
965
+ export const zNesRecentFilesCapabilities = z.object({
966
+ maxCount: defaultOnError(z
967
+ .int()
968
+ .gte(0)
969
+ .max(4294967295, {
970
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
971
+ })
972
+ .nullish(), () => undefined),
973
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
974
+ });
975
+ /**
976
+ * Capabilities for related snippets context.
977
+ */
978
+ export const zNesRelatedSnippetsCapabilities = z.object({
979
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
980
+ });
981
+ /**
982
+ * Capabilities for edit history context.
983
+ */
984
+ export const zNesEditHistoryCapabilities = z.object({
985
+ maxCount: defaultOnError(z
986
+ .int()
987
+ .gte(0)
988
+ .max(4294967295, {
989
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
990
+ })
991
+ .nullish(), () => undefined),
992
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
993
+ });
994
+ /**
995
+ * Capabilities for user actions context.
996
+ */
997
+ export const zNesUserActionsCapabilities = z.object({
998
+ maxCount: defaultOnError(z
999
+ .int()
1000
+ .gte(0)
1001
+ .max(4294967295, {
1002
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
1003
+ })
1004
+ .nullish(), () => undefined),
1005
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1006
+ });
1007
+ /**
1008
+ * Capabilities for open files context.
1009
+ */
1010
+ export const zNesOpenFilesCapabilities = z.object({
1011
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1012
+ });
1013
+ /**
1014
+ * Capabilities for diagnostics context.
1015
+ */
1016
+ export const zNesDiagnosticsCapabilities = z.object({
1017
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1018
+ });
1019
+ /**
1020
+ * Context capabilities the agent wants attached to each suggestion request.
1021
+ */
1022
+ export const zNesContextCapabilities = z.object({
1023
+ recentFiles: defaultOnError(zNesRecentFilesCapabilities.nullish(), () => undefined),
1024
+ relatedSnippets: defaultOnError(zNesRelatedSnippetsCapabilities.nullish(), () => undefined),
1025
+ editHistory: defaultOnError(zNesEditHistoryCapabilities.nullish(), () => undefined),
1026
+ userActions: defaultOnError(zNesUserActionsCapabilities.nullish(), () => undefined),
1027
+ openFiles: defaultOnError(zNesOpenFilesCapabilities.nullish(), () => undefined),
1028
+ diagnostics: defaultOnError(zNesDiagnosticsCapabilities.nullish(), () => undefined),
1029
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1030
+ });
1031
+ /**
1032
+ * NES capabilities advertised by the agent during initialization.
1033
+ */
1034
+ export const zNesCapabilities = z.object({
1035
+ events: defaultOnError(zNesEventCapabilities.nullish(), () => undefined),
1036
+ context: defaultOnError(zNesContextCapabilities.nullish(), () => undefined),
1037
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1038
+ });
1039
+ /**
1040
+ * The encoding used for character offsets in positions.
1041
+ *
1042
+ * Follows the same conventions as LSP 3.17. The default is UTF-16.
1043
+ */
1044
+ export const zPositionEncodingKind = z.union([
1045
+ z.literal("utf-16"),
1046
+ z.literal("utf-32"),
1047
+ z.literal("utf-8"),
1048
+ ]);
1049
+ /**
1050
+ * Capabilities supported by the agent.
1051
+ *
1052
+ * Advertised during initialization to inform the client about
1053
+ * available features and content types.
1054
+ *
1055
+ * See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/initialization#agent-capabilities)
1056
+ */
1057
+ export const zAgentCapabilities = z.object({
1058
+ loadSession: defaultOnError(z.boolean().optional().default(false), () => false),
1059
+ promptCapabilities: defaultOnError(zPromptCapabilities.optional().default({
1060
+ image: false,
1061
+ audio: false,
1062
+ embeddedContext: false,
1063
+ }), () => ({
1064
+ image: false,
1065
+ audio: false,
1066
+ embeddedContext: false,
1067
+ })),
1068
+ mcpCapabilities: defaultOnError(zMcpCapabilities.optional().default({
1069
+ http: false,
1070
+ sse: false,
1071
+ acp: false,
1072
+ }), () => ({
1073
+ http: false,
1074
+ sse: false,
1075
+ acp: false,
1076
+ })),
1077
+ sessionCapabilities: defaultOnError(zSessionCapabilities.optional().default({}), () => ({})),
1078
+ auth: defaultOnError(zAgentAuthCapabilities.optional().default({}), () => ({})),
1079
+ providers: defaultOnError(zProvidersCapabilities.nullish(), () => undefined),
1080
+ nes: defaultOnError(zNesCapabilities.nullish(), () => undefined),
1081
+ positionEncoding: defaultOnError(zPositionEncodingKind.nullish(), () => undefined),
1082
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1083
+ });
1084
+ /**
1085
+ * Typed identifier used for auth method values on the wire.
1086
+ */
1087
+ export const zAuthMethodId = z.string();
1088
+ /**
1089
+ * **UNSTABLE**
1090
+ *
1091
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1092
+ *
1093
+ * Describes a single environment variable for an [`AuthMethodEnvVar`] authentication method.
1094
+ *
1095
+ * @experimental
1096
+ */
1097
+ export const zAuthEnvVar = z.object({
1098
+ name: z.string(),
1099
+ label: defaultOnError(z.string().nullish(), () => undefined),
1100
+ secret: defaultOnError(z.boolean().optional().default(true), () => true),
1101
+ optional: defaultOnError(z.boolean().optional().default(false), () => false),
1102
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1103
+ });
1104
+ /**
1105
+ * **UNSTABLE**
1106
+ *
1107
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1108
+ *
1109
+ * Environment variable authentication method.
1110
+ *
1111
+ * The user provides credentials that the client passes to the agent as environment variables.
1112
+ *
1113
+ * @experimental
1114
+ */
1115
+ export const zAuthMethodEnvVar = z.object({
1116
+ id: zAuthMethodId,
1117
+ name: z.string(),
1118
+ description: defaultOnError(z.string().nullish(), () => undefined),
1119
+ vars: requiredDefaultOnError(vecSkipError(zAuthEnvVar), () => []),
1120
+ link: defaultOnError(z.string().nullish(), () => undefined),
1121
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1122
+ });
1123
+ /**
1124
+ * **UNSTABLE**
1125
+ *
1126
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1127
+ *
1128
+ * Terminal-based authentication method.
1129
+ *
1130
+ * The client runs an interactive terminal for the user to authenticate via a TUI.
1131
+ *
1132
+ * @experimental
1133
+ */
1134
+ export const zAuthMethodTerminal = z.object({
1135
+ id: zAuthMethodId,
1136
+ name: z.string(),
1137
+ description: defaultOnError(z.string().nullish(), () => undefined),
1138
+ args: defaultOnError(vecSkipError(z.string()).optional(), () => []),
1139
+ env: defaultOnError(z.record(z.string(), z.string()).optional(), () => undefined),
1140
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1141
+ });
1142
+ /**
1143
+ * Agent handles authentication itself.
1144
+ *
1145
+ * This is the default authentication method type.
1146
+ */
1147
+ export const zAuthMethodAgent = z.object({
1148
+ id: zAuthMethodId,
1149
+ name: z.string(),
1150
+ description: defaultOnError(z.string().nullish(), () => undefined),
1151
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1152
+ });
1153
+ /**
1154
+ * Describes an available authentication method.
1155
+ *
1156
+ * The `type` field acts as the discriminator in the serialized JSON form.
1157
+ * When no `type` is present, the method is treated as `agent`.
1158
+ */
1159
+ export const zAuthMethod = z.union([
1160
+ zAuthMethodEnvVar.and(z.object({
1161
+ type: z.literal("env_var"),
1162
+ })),
1163
+ zAuthMethodTerminal.and(z.object({
1164
+ type: z.literal("terminal"),
1165
+ })),
1166
+ zAuthMethodAgent,
1167
+ ]);
1168
+ /**
1169
+ * Metadata about the implementation of the client or agent.
1170
+ * Describes the name and version of an ACP implementation, with an optional
1171
+ * title for UI representation.
1172
+ */
1173
+ export const zImplementation = z.object({
1174
+ name: z.string(),
1175
+ title: defaultOnError(z.string().nullish(), () => undefined),
1176
+ version: z.string(),
1177
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1178
+ });
1179
+ /**
1180
+ * Response to the `initialize` method.
1181
+ *
1182
+ * Contains the negotiated protocol version and agent capabilities.
1183
+ *
1184
+ * See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
1185
+ */
1186
+ export const zInitializeResponse = z.object({
1187
+ protocolVersion: zProtocolVersion,
1188
+ agentCapabilities: defaultOnError(zAgentCapabilities.optional().default({
1189
+ loadSession: false,
1190
+ promptCapabilities: {
1191
+ image: false,
1192
+ audio: false,
1193
+ embeddedContext: false,
1194
+ },
1195
+ mcpCapabilities: {
1196
+ http: false,
1197
+ sse: false,
1198
+ acp: false,
1199
+ },
1200
+ sessionCapabilities: {},
1201
+ auth: {},
1202
+ }), () => ({
1203
+ loadSession: false,
1204
+ promptCapabilities: {
1205
+ image: false,
1206
+ audio: false,
1207
+ embeddedContext: false,
1208
+ },
1209
+ mcpCapabilities: {
1210
+ http: false,
1211
+ sse: false,
1212
+ acp: false,
1213
+ },
1214
+ sessionCapabilities: {},
1215
+ auth: {},
1216
+ })),
1217
+ authMethods: defaultOnError(vecSkipError(zAuthMethod).optional().default([]), () => []),
1218
+ agentInfo: defaultOnError(zImplementation.nullish(), () => undefined),
1219
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1220
+ });
1221
+ /**
1222
+ * Response to the `authenticate` method.
1223
+ */
1224
+ export const zAuthenticateResponse = z.object({
1225
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1226
+ });
1227
+ /**
1228
+ * **UNSTABLE**
1229
+ *
1230
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1231
+ *
1232
+ * Unique identifier for a configurable LLM provider.
1233
+ *
1234
+ * @experimental
1235
+ */
1236
+ export const zProviderId = z.string();
1237
+ /**
1238
+ * **UNSTABLE**
1239
+ *
1240
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1241
+ *
1242
+ * Well-known API protocol identifiers for LLM providers.
1243
+ *
1244
+ * Agents and clients MUST handle unknown protocol identifiers gracefully.
1245
+ *
1246
+ * Protocol names beginning with `_` are free for custom use, like other ACP extension methods.
1247
+ * Protocol names that do not begin with `_` are reserved for the ACP spec.
1248
+ *
1249
+ * @experimental
1250
+ */
1251
+ export const zLlmProtocol = z.union([
1252
+ z.literal("anthropic"),
1253
+ z.literal("openai"),
1254
+ z.literal("azure"),
1255
+ z.literal("vertex"),
1256
+ z.literal("bedrock"),
1257
+ z.string(),
1258
+ ]);
1259
+ /**
1260
+ * **UNSTABLE**
1261
+ *
1262
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1263
+ *
1264
+ * Current effective non-secret routing configuration for a provider.
1265
+ *
1266
+ * @experimental
1267
+ */
1268
+ export const zProviderCurrentConfig = z.object({
1269
+ apiType: zLlmProtocol,
1270
+ baseUrl: z.string(),
1271
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1272
+ });
1273
+ /**
1274
+ * **UNSTABLE**
1275
+ *
1276
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1277
+ *
1278
+ * Information about a configurable LLM provider.
1279
+ *
1280
+ * @experimental
1281
+ */
1282
+ export const zProviderInfo = z.object({
1283
+ providerId: zProviderId,
1284
+ supported: requiredDefaultOnError(vecSkipError(zLlmProtocol), () => []),
1285
+ required: z.boolean(),
1286
+ current: zProviderCurrentConfig.nullish(),
1287
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1288
+ });
1289
+ /**
1290
+ * **UNSTABLE**
1291
+ *
1292
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1293
+ *
1294
+ * Response to `providers/list`.
1295
+ *
1296
+ * @experimental
1297
+ */
1298
+ export const zListProvidersResponse = z.object({
1299
+ providers: z.array(zProviderInfo),
1300
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1301
+ });
1302
+ /**
1303
+ * **UNSTABLE**
1304
+ *
1305
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1306
+ *
1307
+ * Response to `providers/set`.
1308
+ *
1309
+ * @experimental
1310
+ */
1311
+ export const zSetProviderResponse = z.object({
1312
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1313
+ });
1314
+ /**
1315
+ * **UNSTABLE**
1316
+ *
1317
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1318
+ *
1319
+ * Response to `providers/disable`.
1320
+ *
1321
+ * @experimental
1322
+ */
1323
+ export const zDisableProviderResponse = z.object({
1324
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1325
+ });
1326
+ /**
1327
+ * Response to the `logout` method.
1328
+ */
1329
+ export const zLogoutResponse = z.object({
1330
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1331
+ });
1332
+ /**
1333
+ * Unique identifier for a Session Mode.
1334
+ */
1335
+ export const zSessionModeId = z.string();
1336
+ /**
1337
+ * A mode the agent can operate in.
1338
+ *
1339
+ * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
1340
+ */
1341
+ export const zSessionMode = z.object({
1342
+ id: zSessionModeId,
1343
+ name: z.string(),
1344
+ description: defaultOnError(z.string().nullish(), () => undefined),
1345
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1346
+ });
1347
+ /**
1348
+ * The set of modes and the one currently active.
1349
+ */
1350
+ export const zSessionModeState = z.object({
1351
+ currentModeId: zSessionModeId,
1352
+ availableModes: requiredDefaultOnError(vecSkipError(zSessionMode), () => []),
1353
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1354
+ });
1355
+ /**
1356
+ * Unique identifier for a session configuration option.
1357
+ */
1358
+ export const zSessionConfigId = z.string();
1359
+ /**
1360
+ * Semantic category for a session configuration option.
1361
+ *
1362
+ * This is intended to help Clients distinguish broadly common selectors (e.g. model selector vs
1363
+ * session mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons,
1364
+ * placement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown
1365
+ * categories gracefully.
1366
+ *
1367
+ * Category names beginning with `_` are free for custom use, like other ACP extension methods.
1368
+ * Category names that do not begin with `_` are reserved for the ACP spec.
1369
+ */
1370
+ export const zSessionConfigOptionCategory = z.union([
1371
+ z.literal("mode"),
1372
+ z.literal("model"),
1373
+ z.literal("model_config"),
1374
+ z.literal("thought_level"),
1375
+ z.string(),
1376
+ ]);
1377
+ /**
1378
+ * Unique identifier for a session configuration option value.
1379
+ */
1380
+ export const zSessionConfigValueId = z.string();
1381
+ /**
1382
+ * A possible value for a session configuration option.
1383
+ */
1384
+ export const zSessionConfigSelectOption = z.object({
1385
+ value: zSessionConfigValueId,
1386
+ name: z.string(),
1387
+ description: defaultOnError(z.string().nullish(), () => undefined),
1388
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1389
+ });
1390
+ /**
1391
+ * Unique identifier for a session configuration option value group.
1392
+ */
1393
+ export const zSessionConfigGroupId = z.string();
1394
+ /**
1395
+ * A group of possible values for a session configuration option.
1396
+ */
1397
+ export const zSessionConfigSelectGroup = z.object({
1398
+ group: zSessionConfigGroupId,
1399
+ name: z.string(),
1400
+ options: requiredDefaultOnError(vecSkipError(zSessionConfigSelectOption), () => []),
1401
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1402
+ });
1403
+ /**
1404
+ * Possible values for a session configuration option.
1405
+ */
1406
+ export const zSessionConfigSelectOptions = z.union([
1407
+ z.array(zSessionConfigSelectOption),
1408
+ z.array(zSessionConfigSelectGroup),
1409
+ ]);
1410
+ /**
1411
+ * A single-value selector (dropdown) session configuration option payload.
1412
+ */
1413
+ export const zSessionConfigSelect = z.object({
1414
+ currentValue: zSessionConfigValueId,
1415
+ options: zSessionConfigSelectOptions,
1416
+ });
1417
+ /**
1418
+ * A boolean on/off toggle session configuration option payload.
1419
+ */
1420
+ export const zSessionConfigBoolean = z.object({
1421
+ currentValue: z.boolean(),
1422
+ });
1423
+ /**
1424
+ * A session configuration option selector and its current state.
1425
+ */
1426
+ export const zSessionConfigOption = z.intersection(z.union([
1427
+ zSessionConfigSelect.and(z.object({
1428
+ type: z.literal("select"),
1429
+ })),
1430
+ zSessionConfigBoolean.and(z.object({
1431
+ type: z.literal("boolean"),
1432
+ })),
1433
+ ]), z.object({
1434
+ id: zSessionConfigId,
1435
+ name: z.string(),
1436
+ description: defaultOnError(z.string().nullish(), () => undefined),
1437
+ category: defaultOnError(zSessionConfigOptionCategory.nullish(), () => undefined),
1438
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1439
+ }));
1440
+ /**
1441
+ * Response from creating a new session.
1442
+ *
1443
+ * See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
1444
+ */
1445
+ export const zNewSessionResponse = z.object({
1446
+ sessionId: zSessionId,
1447
+ modes: defaultOnError(zSessionModeState.nullish(), () => undefined),
1448
+ configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => undefined),
1449
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1450
+ });
1451
+ /**
1452
+ * Response from loading an existing session.
1453
+ */
1454
+ export const zLoadSessionResponse = z.object({
1455
+ modes: defaultOnError(zSessionModeState.nullish(), () => undefined),
1456
+ configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => undefined),
1457
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1458
+ });
1459
+ /**
1460
+ * Information about a session returned by session/list
1461
+ */
1462
+ export const zSessionInfo = z.object({
1463
+ sessionId: zSessionId,
1464
+ cwd: z.string(),
1465
+ additionalDirectories: defaultOnError(vecSkipError(z.string()).optional(), () => []),
1466
+ title: defaultOnError(z.string().nullish(), () => undefined),
1467
+ updatedAt: defaultOnError(z.string().nullish(), () => undefined),
1468
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1469
+ });
1470
+ /**
1471
+ * Response from listing sessions.
1472
+ */
1473
+ export const zListSessionsResponse = z.object({
1474
+ sessions: requiredDefaultOnError(vecSkipError(zSessionInfo), () => []),
1475
+ nextCursor: defaultOnError(z.string().nullish(), () => undefined),
1476
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1477
+ });
1478
+ /**
1479
+ * Response from deleting a session.
1480
+ */
1481
+ export const zDeleteSessionResponse = z.object({
1482
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1483
+ });
1484
+ /**
1485
+ * **UNSTABLE**
1486
+ *
1487
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1488
+ *
1489
+ * Response from forking an existing session.
1490
+ *
1491
+ * @experimental
1492
+ */
1493
+ export const zForkSessionResponse = z.object({
1494
+ sessionId: zSessionId,
1495
+ modes: defaultOnError(zSessionModeState.nullish(), () => undefined),
1496
+ configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => undefined),
1497
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1498
+ });
1499
+ /**
1500
+ * Response from resuming an existing session.
1501
+ */
1502
+ export const zResumeSessionResponse = z.object({
1503
+ modes: defaultOnError(zSessionModeState.nullish(), () => undefined),
1504
+ configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => undefined),
1505
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1506
+ });
1507
+ /**
1508
+ * Response from closing a session.
1509
+ */
1510
+ export const zCloseSessionResponse = z.object({
1511
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1512
+ });
1513
+ /**
1514
+ * Response to `session/set_mode` method.
1515
+ */
1516
+ export const zSetSessionModeResponse = z.object({
1517
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1518
+ });
1519
+ /**
1520
+ * Response to `session/set_config_option` method.
1521
+ */
1522
+ export const zSetSessionConfigOptionResponse = z.object({
1523
+ configOptions: requiredDefaultOnError(vecSkipError(zSessionConfigOption), () => []),
1524
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1525
+ });
1526
+ /**
1527
+ * Reasons why an agent stops processing a prompt turn.
1528
+ *
1529
+ * See protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/prompt-turn#stop-reasons)
1530
+ */
1531
+ export const zStopReason = z.union([
1532
+ z.literal("end_turn"),
1533
+ z.literal("max_tokens"),
1534
+ z.literal("max_turn_requests"),
1535
+ z.literal("refusal"),
1536
+ z.literal("cancelled"),
1537
+ ]);
1538
+ /**
1539
+ * **UNSTABLE**
1540
+ *
1541
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1542
+ *
1543
+ * Token usage information for a prompt turn.
1544
+ *
1545
+ * @experimental
1546
+ */
1547
+ export const zUsage = z.object({
1548
+ totalTokens: z.number(),
1549
+ inputTokens: z.number(),
1550
+ outputTokens: z.number(),
1551
+ thoughtTokens: defaultOnError(z.number().nullish(), () => undefined),
1552
+ cachedReadTokens: defaultOnError(z.number().nullish(), () => undefined),
1553
+ cachedWriteTokens: defaultOnError(z.number().nullish(), () => undefined),
1554
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1555
+ });
1556
+ /**
1557
+ * Response from processing a user prompt.
1558
+ *
1559
+ * See protocol docs: [Check for Completion](https://agentclientprotocol.com/protocol/prompt-turn#4-check-for-completion)
1560
+ */
1561
+ export const zPromptResponse = z.object({
1562
+ stopReason: zStopReason,
1563
+ usage: defaultOnError(zUsage.nullish(), () => undefined),
1564
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1565
+ });
1566
+ /**
1567
+ * Response to `nes/start`.
1568
+ */
1569
+ export const zStartNesResponse = z.object({
1570
+ sessionId: zSessionId,
1571
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1572
+ });
1573
+ /**
1574
+ * Unique identifier for a next edit suggestion.
1575
+ */
1576
+ export const zNesSuggestionId = z.string();
1577
+ /**
1578
+ * A zero-based position in a text document.
1579
+ *
1580
+ * The meaning of `character` depends on the negotiated position encoding.
1581
+ */
1582
+ export const zPosition = z.object({
1583
+ line: z.int().gte(0).max(4294967295, {
1584
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
1585
+ }),
1586
+ character: z.int().gte(0).max(4294967295, {
1587
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
1588
+ }),
1589
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1590
+ });
1591
+ /**
1592
+ * A range in a text document, expressed as start and end positions.
1593
+ */
1594
+ export const zRange = z.object({
1595
+ start: zPosition,
1596
+ end: zPosition,
1597
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1598
+ });
1599
+ /**
1600
+ * A text edit within a suggestion.
1601
+ */
1602
+ export const zNesTextEdit = z.object({
1603
+ range: zRange,
1604
+ newText: z.string(),
1605
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1606
+ });
1607
+ /**
1608
+ * A text edit suggestion.
1609
+ */
1610
+ export const zNesEditSuggestion = z.object({
1611
+ id: zNesSuggestionId,
1612
+ uri: z.string(),
1613
+ edits: z.array(zNesTextEdit),
1614
+ cursorPosition: defaultOnError(zPosition.nullish(), () => undefined),
1615
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1616
+ });
1617
+ /**
1618
+ * A jump-to-location suggestion.
1619
+ */
1620
+ export const zNesJumpSuggestion = z.object({
1621
+ id: zNesSuggestionId,
1622
+ uri: z.string(),
1623
+ position: zPosition,
1624
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1625
+ });
1626
+ /**
1627
+ * A rename symbol suggestion.
1628
+ */
1629
+ export const zNesRenameSuggestion = z.object({
1630
+ id: zNesSuggestionId,
1631
+ uri: z.string(),
1632
+ position: zPosition,
1633
+ newName: z.string(),
1634
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1635
+ });
1636
+ /**
1637
+ * A search-and-replace suggestion.
1638
+ */
1639
+ export const zNesSearchAndReplaceSuggestion = z.object({
1640
+ id: zNesSuggestionId,
1641
+ uri: z.string(),
1642
+ search: z.string(),
1643
+ replace: z.string(),
1644
+ isRegex: z.boolean().nullish(),
1645
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1646
+ });
1647
+ /**
1648
+ * A suggestion returned by the agent.
1649
+ */
1650
+ export const zNesSuggestion = z.union([
1651
+ zNesEditSuggestion.and(z.object({
1652
+ kind: z.literal("edit"),
1653
+ })),
1654
+ zNesJumpSuggestion.and(z.object({
1655
+ kind: z.literal("jump"),
1656
+ })),
1657
+ zNesRenameSuggestion.and(z.object({
1658
+ kind: z.literal("rename"),
1659
+ })),
1660
+ zNesSearchAndReplaceSuggestion.and(z.object({
1661
+ kind: z.literal("searchAndReplace"),
1662
+ })),
1663
+ ]);
1664
+ /**
1665
+ * Response to `nes/suggest`.
1666
+ */
1667
+ export const zSuggestNesResponse = z.object({
1668
+ suggestions: z.array(zNesSuggestion),
1669
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1670
+ });
1671
+ /**
1672
+ * Response from closing an NES session.
1673
+ */
1674
+ export const zCloseNesResponse = z.object({
1675
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1676
+ });
1677
+ /**
1678
+ * Allows for sending an arbitrary response to an [`ExtRequest`] that is not part of the ACP spec.
1679
+ * Extension methods provide a way to add custom functionality while maintaining
1680
+ * protocol compatibility.
1681
+ *
1682
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
1683
+ */
1684
+ export const zExtResponse = z.unknown();
1685
+ /**
1686
+ * **UNSTABLE**
1687
+ *
1688
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1689
+ *
1690
+ * Response to `mcp/message`.
1691
+ *
1692
+ * This is the inner MCP response result payload. Any JSON value is valid.
1693
+ *
1694
+ * @experimental
1695
+ */
1696
+ export const zMessageMcpResponse = z.unknown();
1697
+ /**
1698
+ * Predefined error codes for common JSON-RPC and ACP-specific errors.
1699
+ *
1700
+ * These codes follow the JSON-RPC 2.0 specification for standard errors
1701
+ * and use the reserved range (-32000 to -32099) for protocol-specific errors.
1702
+ */
1703
+ export const zErrorCode = z.union([
1704
+ z.literal(-32700),
1705
+ z.literal(-32600),
1706
+ z.literal(-32601),
1707
+ z.literal(-32602),
1708
+ z.literal(-32603),
1709
+ z.literal(-32800),
1710
+ z.literal(-32000),
1711
+ z.literal(-32002),
1712
+ z
1713
+ .int()
1714
+ .min(-2147483648, {
1715
+ error: "Invalid value: Expected int32 to be >= -2147483648",
1716
+ })
1717
+ .max(2147483647, {
1718
+ error: "Invalid value: Expected int32 to be <= 2147483647",
1719
+ }),
1720
+ ]);
1721
+ /**
1722
+ * JSON-RPC error object.
1723
+ *
1724
+ * Represents an error that occurred during method execution, following the
1725
+ * JSON-RPC 2.0 error object specification with optional additional data.
1726
+ *
1727
+ * See protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)
1728
+ */
1729
+ export const zError = z.object({
1730
+ code: zErrorCode,
1731
+ message: z.string(),
1732
+ data: defaultOnError(z.unknown().optional(), () => undefined),
1733
+ });
1734
+ /**
1735
+ * A JSON-RPC response object.
1736
+ */
1737
+ export const zAgentResponse = z.union([
1738
+ z.object({
1739
+ id: zRequestId,
1740
+ result: z.union([
1741
+ zInitializeResponse,
1742
+ zAuthenticateResponse,
1743
+ zListProvidersResponse,
1744
+ zSetProviderResponse,
1745
+ zDisableProviderResponse,
1746
+ zLogoutResponse,
1747
+ zNewSessionResponse,
1748
+ zLoadSessionResponse,
1749
+ zListSessionsResponse,
1750
+ zDeleteSessionResponse,
1751
+ zForkSessionResponse,
1752
+ zResumeSessionResponse,
1753
+ zCloseSessionResponse,
1754
+ zSetSessionModeResponse,
1755
+ zSetSessionConfigOptionResponse,
1756
+ zPromptResponse,
1757
+ zStartNesResponse,
1758
+ zSuggestNesResponse,
1759
+ zCloseNesResponse,
1760
+ zExtResponse,
1761
+ zMessageMcpResponse,
1762
+ ]),
1763
+ }),
1764
+ z.object({
1765
+ id: zRequestId,
1766
+ error: zError,
1767
+ }),
1768
+ ]);
1769
+ /**
1770
+ * Unique identifier for a message within a session.
1771
+ */
1772
+ export const zMessageId = z.string();
1773
+ /**
1774
+ * A streamed item of content
1775
+ */
1776
+ export const zContentChunk = z.object({
1777
+ content: zContentBlock,
1778
+ messageId: defaultOnError(zMessageId.nullish(), () => undefined),
1779
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1780
+ });
1781
+ /**
1782
+ * Represents a tool call that the language model has requested.
1783
+ *
1784
+ * Tool calls are actions that the agent executes on behalf of the language model,
1785
+ * such as reading files, executing code, or fetching data from external sources.
1786
+ *
1787
+ * See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/tool-calls)
1788
+ */
1789
+ export const zToolCall = z.object({
1790
+ toolCallId: zToolCallId,
1791
+ title: z.string(),
1792
+ name: defaultOnError(z.string().nullish(), () => undefined),
1793
+ kind: defaultOnError(zToolKind.optional(), () => undefined),
1794
+ status: defaultOnError(zToolCallStatus.optional(), () => undefined),
1795
+ content: defaultOnError(vecSkipError(zToolCallContent).optional(), () => []),
1796
+ locations: defaultOnError(vecSkipError(zToolCallLocation).optional(), () => []),
1797
+ rawInput: defaultOnError(z.unknown().optional(), () => undefined),
1798
+ rawOutput: defaultOnError(z.unknown().optional(), () => undefined),
1799
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1800
+ });
1801
+ /**
1802
+ * Priority levels for plan entries.
1803
+ *
1804
+ * Used to indicate the relative importance or urgency of different
1805
+ * tasks in the execution plan.
1806
+ * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
1807
+ */
1808
+ export const zPlanEntryPriority = z.union([
1809
+ z.literal("high"),
1810
+ z.literal("medium"),
1811
+ z.literal("low"),
1812
+ ]);
1813
+ /**
1814
+ * Status of a plan entry in the execution flow.
1815
+ *
1816
+ * Tracks the lifecycle of each task from planning through completion.
1817
+ * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
1818
+ */
1819
+ export const zPlanEntryStatus = z.union([
1820
+ z.literal("pending"),
1821
+ z.literal("in_progress"),
1822
+ z.literal("completed"),
1823
+ ]);
1824
+ /**
1825
+ * A single entry in the execution plan.
1826
+ *
1827
+ * Represents a task or goal that the assistant intends to accomplish
1828
+ * as part of fulfilling the user's request.
1829
+ * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/agent-plan#plan-entries)
1830
+ */
1831
+ export const zPlanEntry = z.object({
1832
+ content: z.string(),
1833
+ priority: zPlanEntryPriority,
1834
+ status: zPlanEntryStatus,
1835
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1836
+ });
1837
+ /**
1838
+ * An execution plan for accomplishing complex tasks.
1839
+ *
1840
+ * Plans consist of multiple entries representing individual tasks or goals.
1841
+ * Agents report plans to clients to provide visibility into their execution strategy.
1842
+ * Plans can evolve during execution as the agent discovers new requirements or completes tasks.
1843
+ *
1844
+ * See protocol docs: [Agent Plan](https://agentclientprotocol.com/protocol/agent-plan)
1845
+ */
1846
+ export const zPlan = z.object({
1847
+ entries: requiredDefaultOnError(vecSkipError(zPlanEntry), () => []),
1848
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1849
+ });
1850
+ /**
1851
+ * **UNSTABLE**
1852
+ *
1853
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1854
+ *
1855
+ * Unique identifier for a plan within a session.
1856
+ *
1857
+ * @experimental
1858
+ */
1859
+ export const zPlanId = z.string();
1860
+ /**
1861
+ * **UNSTABLE**
1862
+ *
1863
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1864
+ *
1865
+ * A plan represented as structured entries.
1866
+ *
1867
+ * @experimental
1868
+ */
1869
+ export const zPlanItems = z.object({
1870
+ planId: zPlanId,
1871
+ entries: requiredDefaultOnError(vecSkipError(zPlanEntry), () => []),
1872
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1873
+ });
1874
+ /**
1875
+ * **UNSTABLE**
1876
+ *
1877
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1878
+ *
1879
+ * A plan represented by a file URI.
1880
+ *
1881
+ * @experimental
1882
+ */
1883
+ export const zPlanFile = z.object({
1884
+ planId: zPlanId,
1885
+ uri: z.string(),
1886
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1887
+ });
1888
+ /**
1889
+ * **UNSTABLE**
1890
+ *
1891
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1892
+ *
1893
+ * A plan represented as raw markdown content.
1894
+ *
1895
+ * @experimental
1896
+ */
1897
+ export const zPlanMarkdown = z.object({
1898
+ planId: zPlanId,
1899
+ content: z.string(),
1900
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1901
+ });
1902
+ /**
1903
+ * **UNSTABLE**
1904
+ *
1905
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1906
+ *
1907
+ * Updated content for a plan.
1908
+ *
1909
+ * @experimental
1910
+ */
1911
+ export const zPlanUpdateContent = z.union([
1912
+ zPlanItems.and(z.object({
1913
+ type: z.literal("items"),
1914
+ })),
1915
+ zPlanFile.and(z.object({
1916
+ type: z.literal("file"),
1917
+ })),
1918
+ zPlanMarkdown.and(z.object({
1919
+ type: z.literal("markdown"),
1920
+ })),
1921
+ ]);
1922
+ /**
1923
+ * **UNSTABLE**
1924
+ *
1925
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1926
+ *
1927
+ * A content update for a plan identified by ID.
1928
+ *
1929
+ * @experimental
1930
+ */
1931
+ export const zPlanUpdate = z.object({
1932
+ plan: zPlanUpdateContent,
1933
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1934
+ });
1935
+ /**
1936
+ * **UNSTABLE**
1937
+ *
1938
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1939
+ *
1940
+ * Removal notice for a plan identified by ID.
1941
+ *
1942
+ * @experimental
1943
+ */
1944
+ export const zPlanRemoved = z.object({
1945
+ planId: zPlanId,
1946
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1947
+ });
1948
+ /**
1949
+ * All text that was typed after the command name is provided as input.
1950
+ */
1951
+ export const zUnstructuredCommandInput = z.object({
1952
+ hint: z.string(),
1953
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1954
+ });
1955
+ /**
1956
+ * unstructured
1957
+ *
1958
+ * All text that was typed after the command name is provided as input.
1959
+ */
1960
+ export const zAvailableCommandInput = zUnstructuredCommandInput;
1961
+ /**
1962
+ * Information about a command.
1963
+ */
1964
+ export const zAvailableCommand = z.object({
1965
+ name: z.string(),
1966
+ description: z.string(),
1967
+ input: defaultOnError(zAvailableCommandInput.nullish(), () => undefined),
1968
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1969
+ });
1970
+ /**
1971
+ * Available commands are ready or have changed
1972
+ */
1973
+ export const zAvailableCommandsUpdate = z.object({
1974
+ availableCommands: requiredDefaultOnError(vecSkipError(zAvailableCommand), () => []),
1975
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1976
+ });
1977
+ /**
1978
+ * The current mode of the session has changed
1979
+ *
1980
+ * See protocol docs: [Session Modes](https://agentclientprotocol.com/protocol/session-modes)
1981
+ */
1982
+ export const zCurrentModeUpdate = z.object({
1983
+ currentModeId: zSessionModeId,
1984
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1985
+ });
1986
+ /**
1987
+ * Session configuration options have been updated.
1988
+ */
1989
+ export const zConfigOptionUpdate = z.object({
1990
+ configOptions: requiredDefaultOnError(vecSkipError(zSessionConfigOption), () => []),
1991
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1992
+ });
1993
+ /**
1994
+ * Update to session metadata. All fields are optional to support partial updates.
1995
+ *
1996
+ * Agents send this notification to update session information like title or custom metadata.
1997
+ * This allows clients to display dynamic session names and track session state changes.
1998
+ */
1999
+ export const zSessionInfoUpdate = z.object({
2000
+ title: defaultOnError(z.string().nullish(), () => undefined),
2001
+ updatedAt: defaultOnError(z.string().nullish(), () => undefined),
2002
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2003
+ });
2004
+ /**
2005
+ * Cost information for a session.
2006
+ */
2007
+ export const zCost = z.object({
2008
+ amount: z.number(),
2009
+ currency: z.string(),
2010
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2011
+ });
2012
+ /**
2013
+ * Context window and cost update for a session.
2014
+ */
2015
+ export const zUsageUpdate = z.object({
2016
+ used: z.number(),
2017
+ size: z.number(),
2018
+ cost: defaultOnError(zCost.nullish(), () => undefined),
2019
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2020
+ });
2021
+ /**
2022
+ * Different types of updates that can be sent during session processing.
2023
+ *
2024
+ * These updates provide real-time feedback about the agent's progress.
2025
+ *
2026
+ * See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)
2027
+ */
2028
+ export const zSessionUpdate = z.union([
2029
+ zContentChunk.and(z.object({
2030
+ sessionUpdate: z.literal("user_message_chunk"),
2031
+ })),
2032
+ zContentChunk.and(z.object({
2033
+ sessionUpdate: z.literal("agent_message_chunk"),
2034
+ })),
2035
+ zContentChunk.and(z.object({
2036
+ sessionUpdate: z.literal("agent_thought_chunk"),
2037
+ })),
2038
+ zToolCall.and(z.object({
2039
+ sessionUpdate: z.literal("tool_call"),
2040
+ })),
2041
+ zToolCallUpdate.and(z.object({
2042
+ sessionUpdate: z.literal("tool_call_update"),
2043
+ })),
2044
+ zPlan.and(z.object({
2045
+ sessionUpdate: z.literal("plan"),
2046
+ })),
2047
+ zPlanUpdate.and(z.object({
2048
+ sessionUpdate: z.literal("plan_update"),
2049
+ })),
2050
+ zPlanRemoved.and(z.object({
2051
+ sessionUpdate: z.literal("plan_removed"),
2052
+ })),
2053
+ zAvailableCommandsUpdate.and(z.object({
2054
+ sessionUpdate: z.literal("available_commands_update"),
2055
+ })),
2056
+ zCurrentModeUpdate.and(z.object({
2057
+ sessionUpdate: z.literal("current_mode_update"),
2058
+ })),
2059
+ zConfigOptionUpdate.and(z.object({
2060
+ sessionUpdate: z.literal("config_option_update"),
2061
+ })),
2062
+ zSessionInfoUpdate.and(z.object({
2063
+ sessionUpdate: z.literal("session_info_update"),
2064
+ })),
2065
+ zUsageUpdate.and(z.object({
2066
+ sessionUpdate: z.literal("usage_update"),
2067
+ })),
2068
+ ]);
2069
+ /**
2070
+ * Notification containing a session update from the agent.
2071
+ *
2072
+ * Used to stream real-time progress and results during prompt processing.
2073
+ *
2074
+ * See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/prompt-turn#3-agent-reports-output)
2075
+ */
2076
+ export const zSessionNotification = z.object({
2077
+ sessionId: zSessionId,
2078
+ update: zSessionUpdate,
2079
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2080
+ });
2081
+ /**
2082
+ * **UNSTABLE**
2083
+ *
2084
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2085
+ *
2086
+ * Notification sent by the agent when a URL-based elicitation is complete.
2087
+ *
2088
+ * @experimental
2089
+ */
2090
+ export const zCompleteElicitationNotification = z.object({
2091
+ elicitationId: zElicitationId,
2092
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2093
+ });
2094
+ /**
2095
+ * **UNSTABLE**
2096
+ *
2097
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2098
+ *
2099
+ * Notification parameters for `mcp/message`.
2100
+ *
2101
+ * This is used when the wrapped MCP message is a notification and the outer JSON-RPC
2102
+ * envelope has no `id`.
2103
+ *
2104
+ * @experimental
2105
+ */
2106
+ export const zMessageMcpNotification = z.object({
2107
+ connectionId: zMcpConnectionId,
2108
+ method: z.string(),
2109
+ params: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2110
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2111
+ });
2112
+ /**
2113
+ * Allows the Agent to send an arbitrary notification that is not part of the ACP spec.
2114
+ * Extension notifications provide a way to send one-way messages for custom functionality
2115
+ * while maintaining protocol compatibility.
2116
+ *
2117
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/extensibility)
2118
+ */
2119
+ export const zExtNotification = z.unknown();
2120
+ /**
2121
+ * A JSON-RPC notification object.
2122
+ */
2123
+ export const zAgentNotification = z.object({
2124
+ method: z.string(),
2125
+ params: z
2126
+ .union([
2127
+ zSessionNotification,
2128
+ zCompleteElicitationNotification,
2129
+ zMessageMcpNotification,
2130
+ zExtNotification,
2131
+ ])
2132
+ .nullish(),
2133
+ });
2134
+ /**
2135
+ * File system capabilities that a client may support.
2136
+ *
2137
+ * See protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initialization#filesystem)
2138
+ */
2139
+ export const zFileSystemCapabilities = z.object({
2140
+ readTextFile: defaultOnError(z.boolean().optional().default(false), () => false),
2141
+ writeTextFile: defaultOnError(z.boolean().optional().default(false), () => false),
2142
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2143
+ });
2144
+ /**
2145
+ * Capabilities for boolean session configuration options.
2146
+ *
2147
+ * Supplying `{}` means the client supports boolean session configuration options.
2148
+ */
2149
+ export const zBooleanConfigOptionCapabilities = z.object({
2150
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2151
+ });
2152
+ /**
2153
+ * Session configuration option capabilities supported by the client.
2154
+ */
2155
+ export const zSessionConfigOptionsCapabilities = z.object({
2156
+ boolean: defaultOnError(zBooleanConfigOptionCapabilities.nullish(), () => undefined),
2157
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2158
+ });
2159
+ /**
2160
+ * Session-related capabilities supported by the client.
2161
+ */
2162
+ export const zClientSessionCapabilities = z.object({
2163
+ configOptions: defaultOnError(zSessionConfigOptionsCapabilities.nullish(), () => undefined),
2164
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2165
+ });
2166
+ /**
2167
+ * **UNSTABLE**
2168
+ *
2169
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2170
+ *
2171
+ * Capabilities for receiving `plan_update` and `plan_removed` session updates.
2172
+ *
2173
+ * @experimental
2174
+ */
2175
+ export const zPlanCapabilities = z.object({
2176
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2177
+ });
2178
+ /**
2179
+ * **UNSTABLE**
2180
+ *
2181
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2182
+ *
2183
+ * Authentication capabilities supported by the client.
2184
+ *
2185
+ * Advertised during initialization to inform the agent which authentication
2186
+ * method types the client can handle. This governs opt-in types that require
2187
+ * additional client-side support.
2188
+ *
2189
+ * @experimental
2190
+ */
2191
+ export const zAuthCapabilities = z.object({
2192
+ terminal: defaultOnError(z.boolean().optional().default(false), () => false),
2193
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2194
+ });
2195
+ /**
2196
+ * **UNSTABLE**
2197
+ *
2198
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2199
+ *
2200
+ * Form-based elicitation capabilities.
2201
+ *
2202
+ * Supplying `{}` means the client supports form-based elicitation.
2203
+ *
2204
+ * @experimental
2205
+ */
2206
+ export const zElicitationFormCapabilities = z.object({
2207
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2208
+ });
2209
+ /**
2210
+ * **UNSTABLE**
2211
+ *
2212
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2213
+ *
2214
+ * URL-based elicitation capabilities.
2215
+ *
2216
+ * Supplying `{}` means the client supports URL-based elicitation.
2217
+ *
2218
+ * @experimental
2219
+ */
2220
+ export const zElicitationUrlCapabilities = z.object({
2221
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2222
+ });
2223
+ /**
2224
+ * **UNSTABLE**
2225
+ *
2226
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2227
+ *
2228
+ * Elicitation capabilities supported by the client.
2229
+ *
2230
+ * @experimental
2231
+ */
2232
+ export const zElicitationCapabilities = z.object({
2233
+ form: defaultOnError(zElicitationFormCapabilities.nullish(), () => undefined),
2234
+ url: defaultOnError(zElicitationUrlCapabilities.nullish(), () => undefined),
2235
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2236
+ });
2237
+ /**
2238
+ * Marker for jump suggestion support.
2239
+ */
2240
+ export const zNesJumpCapabilities = z.object({
2241
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2242
+ });
2243
+ /**
2244
+ * Marker for rename suggestion support.
2245
+ */
2246
+ export const zNesRenameCapabilities = z.object({
2247
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2248
+ });
2249
+ /**
2250
+ * Marker for search and replace suggestion support.
2251
+ */
2252
+ export const zNesSearchAndReplaceCapabilities = z.object({
2253
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2254
+ });
2255
+ /**
2256
+ * NES capabilities advertised by the client during initialization.
2257
+ */
2258
+ export const zClientNesCapabilities = z.object({
2259
+ jump: defaultOnError(zNesJumpCapabilities.nullish(), () => undefined),
2260
+ rename: defaultOnError(zNesRenameCapabilities.nullish(), () => undefined),
2261
+ searchAndReplace: defaultOnError(zNesSearchAndReplaceCapabilities.nullish(), () => undefined),
2262
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2263
+ });
2264
+ /**
2265
+ * Capabilities supported by the client.
2266
+ *
2267
+ * Advertised during initialization to inform the agent about
2268
+ * available features and methods.
2269
+ *
2270
+ * See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/initialization#client-capabilities)
2271
+ */
2272
+ export const zClientCapabilities = z.object({
2273
+ fs: defaultOnError(zFileSystemCapabilities
2274
+ .optional()
2275
+ .default({ readTextFile: false, writeTextFile: false }), () => ({ readTextFile: false, writeTextFile: false })),
2276
+ terminal: defaultOnError(z.boolean().optional().default(false), () => false),
2277
+ session: defaultOnError(zClientSessionCapabilities.nullish(), () => undefined),
2278
+ plan: defaultOnError(zPlanCapabilities.nullish(), () => undefined),
2279
+ auth: defaultOnError(zAuthCapabilities.optional().default({ terminal: false }), () => ({ terminal: false })),
2280
+ elicitation: defaultOnError(zElicitationCapabilities.nullish(), () => undefined),
2281
+ nes: defaultOnError(zClientNesCapabilities.nullish(), () => undefined),
2282
+ positionEncodings: defaultOnError(vecSkipError(zPositionEncodingKind).optional(), () => []),
2283
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2284
+ });
2285
+ /**
2286
+ * Request parameters for the initialize method.
2287
+ *
2288
+ * Sent by the client to establish connection and negotiate capabilities.
2289
+ *
2290
+ * See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/initialization)
2291
+ */
2292
+ export const zInitializeRequest = z.object({
2293
+ protocolVersion: zProtocolVersion,
2294
+ clientCapabilities: defaultOnError(zClientCapabilities.optional().default({
2295
+ fs: { readTextFile: false, writeTextFile: false },
2296
+ terminal: false,
2297
+ auth: { terminal: false },
2298
+ }), () => ({
2299
+ fs: { readTextFile: false, writeTextFile: false },
2300
+ terminal: false,
2301
+ auth: { terminal: false },
2302
+ })),
2303
+ clientInfo: defaultOnError(zImplementation.nullish(), () => undefined),
2304
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2305
+ });
2306
+ /**
2307
+ * Request parameters for the authenticate method.
2308
+ *
2309
+ * Specifies which authentication method to use.
2310
+ */
2311
+ export const zAuthenticateRequest = z.object({
2312
+ methodId: zAuthMethodId,
2313
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2314
+ });
2315
+ /**
2316
+ * **UNSTABLE**
2317
+ *
2318
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2319
+ *
2320
+ * Request parameters for `providers/list`.
2321
+ *
2322
+ * @experimental
2323
+ */
2324
+ export const zListProvidersRequest = z.object({
2325
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2326
+ });
2327
+ /**
2328
+ * **UNSTABLE**
2329
+ *
2330
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2331
+ *
2332
+ * Request parameters for `providers/set`.
2333
+ *
2334
+ * Replaces the full configuration for one provider ID.
2335
+ *
2336
+ * @experimental
2337
+ */
2338
+ export const zSetProviderRequest = z.object({
2339
+ providerId: zProviderId,
2340
+ apiType: zLlmProtocol,
2341
+ baseUrl: z.string(),
2342
+ headers: z.record(z.string(), z.string()).optional(),
2343
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2344
+ });
2345
+ /**
2346
+ * **UNSTABLE**
2347
+ *
2348
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2349
+ *
2350
+ * Request parameters for `providers/disable`.
2351
+ *
2352
+ * @experimental
2353
+ */
2354
+ export const zDisableProviderRequest = z.object({
2355
+ providerId: zProviderId,
2356
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2357
+ });
2358
+ /**
2359
+ * Request parameters for the logout method.
2360
+ *
2361
+ * Terminates the current authenticated session.
2362
+ */
2363
+ export const zLogoutRequest = z.object({
2364
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2365
+ });
2366
+ /**
2367
+ * An HTTP header to set when making requests to the MCP server.
2368
+ */
2369
+ export const zHttpHeader = z.object({
2370
+ name: z.string(),
2371
+ value: z.string(),
2372
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2373
+ });
2374
+ /**
2375
+ * HTTP transport configuration for MCP.
2376
+ */
2377
+ export const zMcpServerHttp = z.object({
2378
+ name: z.string(),
2379
+ url: z.string(),
2380
+ headers: z.array(zHttpHeader),
2381
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2382
+ });
2383
+ /**
2384
+ * SSE transport configuration for MCP.
2385
+ */
2386
+ export const zMcpServerSse = z.object({
2387
+ name: z.string(),
2388
+ url: z.string(),
2389
+ headers: z.array(zHttpHeader),
2390
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2391
+ });
2392
+ /**
2393
+ * **UNSTABLE**
2394
+ *
2395
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2396
+ *
2397
+ * ACP transport configuration for MCP.
2398
+ *
2399
+ * The MCP server is provided by an ACP component and communicates over the ACP channel
2400
+ * using `mcp/connect`, `mcp/message`, and `mcp/disconnect`.
2401
+ *
2402
+ * @experimental
2403
+ */
2404
+ export const zMcpServerAcp = z.object({
2405
+ name: z.string(),
2406
+ serverId: zMcpServerAcpId,
2407
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2408
+ });
2409
+ /**
2410
+ * Stdio transport configuration for MCP.
2411
+ */
2412
+ export const zMcpServerStdio = z.object({
2413
+ name: z.string(),
2414
+ command: z.string(),
2415
+ args: z.array(z.string()),
2416
+ env: z.array(zEnvVariable),
2417
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2418
+ });
2419
+ /**
2420
+ * Configuration for connecting to an MCP (Model Context Protocol) server.
2421
+ *
2422
+ * MCP servers provide tools and context that the agent can use when
2423
+ * processing prompts.
2424
+ *
2425
+ * See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers)
2426
+ */
2427
+ export const zMcpServer = z.union([
2428
+ zMcpServerHttp.and(z.object({
2429
+ type: z.literal("http"),
2430
+ })),
2431
+ zMcpServerSse.and(z.object({
2432
+ type: z.literal("sse"),
2433
+ })),
2434
+ zMcpServerAcp.and(z.object({
2435
+ type: z.literal("acp"),
2436
+ })),
2437
+ zMcpServerStdio,
2438
+ ]);
2439
+ /**
2440
+ * Request parameters for creating a new session.
2441
+ *
2442
+ * See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/session-setup#creating-a-session)
2443
+ */
2444
+ export const zNewSessionRequest = z.object({
2445
+ cwd: z.string(),
2446
+ additionalDirectories: defaultOnError(vecSkipError(z.string()).optional(), () => []),
2447
+ mcpServers: requiredDefaultOnError(vecSkipError(zMcpServer), () => []),
2448
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2449
+ });
2450
+ /**
2451
+ * Request parameters for loading an existing session.
2452
+ *
2453
+ * Only available if the Agent supports the `loadSession` capability.
2454
+ *
2455
+ * See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)
2456
+ */
2457
+ export const zLoadSessionRequest = z.object({
2458
+ mcpServers: requiredDefaultOnError(vecSkipError(zMcpServer), () => []),
2459
+ cwd: z.string(),
2460
+ additionalDirectories: defaultOnError(vecSkipError(z.string()).optional(), () => []),
2461
+ sessionId: zSessionId,
2462
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2463
+ });
2464
+ /**
2465
+ * Request parameters for listing existing sessions.
2466
+ *
2467
+ * Only available if the Agent supports the `sessionCapabilities.list` capability.
2468
+ */
2469
+ export const zListSessionsRequest = z.object({
2470
+ cwd: z.string().nullish(),
2471
+ cursor: z.string().nullish(),
2472
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2473
+ });
2474
+ /**
2475
+ * Request parameters for deleting an existing session from `session/list`.
2476
+ *
2477
+ * Only available if the Agent supports the `sessionCapabilities.delete` capability.
2478
+ */
2479
+ export const zDeleteSessionRequest = z.object({
2480
+ sessionId: zSessionId,
2481
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2482
+ });
2483
+ /**
2484
+ * **UNSTABLE**
2485
+ *
2486
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2487
+ *
2488
+ * Request parameters for forking an existing session.
2489
+ *
2490
+ * Creates a new session based on the context of an existing one, allowing
2491
+ * operations like generating summaries without affecting the original session's history.
2492
+ *
2493
+ * Only available if the Agent supports the `session.fork` capability.
2494
+ *
2495
+ * @experimental
2496
+ */
2497
+ export const zForkSessionRequest = z.object({
2498
+ sessionId: zSessionId,
2499
+ cwd: z.string(),
2500
+ additionalDirectories: defaultOnError(vecSkipError(z.string()).optional(), () => []),
2501
+ mcpServers: defaultOnError(vecSkipError(zMcpServer).optional(), () => []),
2502
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2503
+ });
2504
+ /**
2505
+ * Request parameters for resuming an existing session.
2506
+ *
2507
+ * Resumes an existing session without returning previous messages (unlike `session/load`).
2508
+ * This is useful for agents that can resume sessions but don't implement full session loading.
2509
+ *
2510
+ * Only available if the Agent supports the `sessionCapabilities.resume` capability.
2511
+ */
2512
+ export const zResumeSessionRequest = z.object({
2513
+ sessionId: zSessionId,
2514
+ cwd: z.string(),
2515
+ additionalDirectories: defaultOnError(vecSkipError(z.string()).optional(), () => []),
2516
+ mcpServers: defaultOnError(vecSkipError(zMcpServer).optional(), () => []),
2517
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2518
+ });
2519
+ /**
2520
+ * Request parameters for closing an active session.
2521
+ *
2522
+ * If supported, the agent **must** cancel any ongoing work related to the session
2523
+ * (treat it as if `session/cancel` was called) and then free up any resources
2524
+ * associated with the session.
2525
+ *
2526
+ * Only available if the Agent supports the `sessionCapabilities.close` capability.
2527
+ */
2528
+ export const zCloseSessionRequest = z.object({
2529
+ sessionId: zSessionId,
2530
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2531
+ });
2532
+ /**
2533
+ * Request parameters for setting a session mode.
2534
+ */
2535
+ export const zSetSessionModeRequest = z.object({
2536
+ sessionId: zSessionId,
2537
+ modeId: zSessionModeId,
2538
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2539
+ });
2540
+ /**
2541
+ * Request parameters for setting a session configuration option.
2542
+ */
2543
+ export const zSetSessionConfigOptionRequest = z.intersection(z.union([
2544
+ z.object({
2545
+ value: z.boolean(),
2546
+ type: z.literal("boolean"),
2547
+ }),
2548
+ z.object({
2549
+ value: zSessionConfigValueId,
2550
+ }),
2551
+ ]), z.object({
2552
+ sessionId: zSessionId,
2553
+ configId: zSessionConfigId,
2554
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2555
+ }));
2556
+ /**
2557
+ * Request parameters for sending a user prompt to the agent.
2558
+ *
2559
+ * Contains the user's message and any additional context.
2560
+ *
2561
+ * See protocol docs: [User Message](https://agentclientprotocol.com/protocol/prompt-turn#1-user-message)
2562
+ */
2563
+ export const zPromptRequest = z.object({
2564
+ sessionId: zSessionId,
2565
+ prompt: z.array(zContentBlock),
2566
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2567
+ });
2568
+ /**
2569
+ * A workspace folder.
2570
+ */
2571
+ export const zWorkspaceFolder = z.object({
2572
+ uri: z.string(),
2573
+ name: z.string(),
2574
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2575
+ });
2576
+ /**
2577
+ * Repository metadata for an NES session.
2578
+ */
2579
+ export const zNesRepository = z.object({
2580
+ name: z.string(),
2581
+ owner: z.string(),
2582
+ remoteUrl: z.string(),
2583
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2584
+ });
2585
+ /**
2586
+ * Request to start an NES session.
2587
+ */
2588
+ export const zStartNesRequest = z.object({
2589
+ workspaceUri: defaultOnError(z.string().nullish(), () => undefined),
2590
+ workspaceFolders: z.array(zWorkspaceFolder).nullish(),
2591
+ repository: defaultOnError(zNesRepository.nullish(), () => undefined),
2592
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2593
+ });
2594
+ /**
2595
+ * What triggered the suggestion request.
2596
+ */
2597
+ export const zNesTriggerKind = z.union([
2598
+ z.literal("automatic"),
2599
+ z.literal("diagnostic"),
2600
+ z.literal("manual"),
2601
+ ]);
2602
+ /**
2603
+ * A recently accessed file.
2604
+ */
2605
+ export const zNesRecentFile = z.object({
2606
+ uri: z.string(),
2607
+ languageId: z.string(),
2608
+ text: z.string(),
2609
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2610
+ });
2611
+ /**
2612
+ * A code excerpt from a file.
2613
+ */
2614
+ export const zNesExcerpt = z.object({
2615
+ startLine: z.int().gte(0).max(4294967295, {
2616
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
2617
+ }),
2618
+ endLine: z.int().gte(0).max(4294967295, {
2619
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
2620
+ }),
2621
+ text: z.string(),
2622
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2623
+ });
2624
+ /**
2625
+ * A related code snippet from a file.
2626
+ */
2627
+ export const zNesRelatedSnippet = z.object({
2628
+ uri: z.string(),
2629
+ excerpts: z.array(zNesExcerpt),
2630
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2631
+ });
2632
+ /**
2633
+ * An entry in the edit history.
2634
+ */
2635
+ export const zNesEditHistoryEntry = z.object({
2636
+ uri: z.string(),
2637
+ diff: z.string(),
2638
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2639
+ });
2640
+ /**
2641
+ * A user action (typing, cursor movement, etc.).
2642
+ */
2643
+ export const zNesUserAction = z.object({
2644
+ action: z.string(),
2645
+ uri: z.string(),
2646
+ position: zPosition,
2647
+ timestampMs: z.number(),
2648
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2649
+ });
2650
+ /**
2651
+ * An open file in the editor.
2652
+ */
2653
+ export const zNesOpenFile = z.object({
2654
+ uri: z.string(),
2655
+ languageId: z.string(),
2656
+ visibleRange: defaultOnError(zRange.nullish(), () => undefined),
2657
+ lastFocusedMs: defaultOnError(z.number().nullish(), () => undefined),
2658
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2659
+ });
2660
+ /**
2661
+ * Severity of a diagnostic.
2662
+ */
2663
+ export const zNesDiagnosticSeverity = z.union([
2664
+ z.literal("error"),
2665
+ z.literal("warning"),
2666
+ z.literal("information"),
2667
+ z.literal("hint"),
2668
+ ]);
2669
+ /**
2670
+ * A diagnostic (error, warning, etc.).
2671
+ */
2672
+ export const zNesDiagnostic = z.object({
2673
+ uri: z.string(),
2674
+ range: zRange,
2675
+ severity: zNesDiagnosticSeverity,
2676
+ message: z.string(),
2677
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2678
+ });
2679
+ /**
2680
+ * Context attached to a suggestion request.
2681
+ */
2682
+ export const zNesSuggestContext = z.object({
2683
+ recentFiles: z.array(zNesRecentFile).nullish(),
2684
+ relatedSnippets: z.array(zNesRelatedSnippet).nullish(),
2685
+ editHistory: z.array(zNesEditHistoryEntry).nullish(),
2686
+ userActions: z.array(zNesUserAction).nullish(),
2687
+ openFiles: z.array(zNesOpenFile).nullish(),
2688
+ diagnostics: z.array(zNesDiagnostic).nullish(),
2689
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2690
+ });
2691
+ /**
2692
+ * Request for a code suggestion.
2693
+ */
2694
+ export const zSuggestNesRequest = z.object({
2695
+ sessionId: zSessionId,
2696
+ uri: z.string(),
2697
+ version: z.number(),
2698
+ position: zPosition,
2699
+ selection: zRange.nullish(),
2700
+ triggerKind: zNesTriggerKind,
2701
+ context: zNesSuggestContext.nullish(),
2702
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2703
+ });
2704
+ /**
2705
+ * Request to close an NES session.
2706
+ *
2707
+ * The agent **must** cancel any ongoing work related to the NES session
2708
+ * and then free up any resources associated with the session.
2709
+ */
2710
+ export const zCloseNesRequest = z.object({
2711
+ sessionId: zSessionId,
2712
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2713
+ });
2714
+ /**
2715
+ * A JSON-RPC request object.
2716
+ */
2717
+ export const zClientRequest = z.object({
2718
+ id: zRequestId,
2719
+ method: z.string(),
2720
+ params: z
2721
+ .union([
2722
+ zInitializeRequest,
2723
+ zAuthenticateRequest,
2724
+ zListProvidersRequest,
2725
+ zSetProviderRequest,
2726
+ zDisableProviderRequest,
2727
+ zLogoutRequest,
2728
+ zNewSessionRequest,
2729
+ zLoadSessionRequest,
2730
+ zListSessionsRequest,
2731
+ zDeleteSessionRequest,
2732
+ zForkSessionRequest,
2733
+ zResumeSessionRequest,
2734
+ zCloseSessionRequest,
2735
+ zSetSessionModeRequest,
2736
+ zSetSessionConfigOptionRequest,
2737
+ zPromptRequest,
2738
+ zStartNesRequest,
2739
+ zSuggestNesRequest,
2740
+ zCloseNesRequest,
2741
+ zMessageMcpRequest,
2742
+ zExtRequest,
2743
+ ])
2744
+ .nullish(),
2745
+ });
2746
+ /**
2747
+ * Response to `fs/write_text_file`
2748
+ */
2749
+ export const zWriteTextFileResponse = z.object({
2750
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2751
+ });
2752
+ /**
2753
+ * Response containing the contents of a text file.
2754
+ */
2755
+ export const zReadTextFileResponse = z.object({
2756
+ content: z.string(),
2757
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2758
+ });
2759
+ /**
2760
+ * The user selected one of the provided options.
2761
+ */
2762
+ export const zSelectedPermissionOutcome = z.object({
2763
+ optionId: zPermissionOptionId,
2764
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2765
+ });
2766
+ /**
2767
+ * The outcome of a permission request.
2768
+ */
2769
+ export const zRequestPermissionOutcome = z.union([
2770
+ z.object({
2771
+ outcome: z.literal("cancelled"),
2772
+ }),
2773
+ zSelectedPermissionOutcome.and(z.object({
2774
+ outcome: z.literal("selected"),
2775
+ })),
2776
+ ]);
2777
+ /**
2778
+ * Response to a permission request.
2779
+ */
2780
+ export const zRequestPermissionResponse = z.object({
2781
+ outcome: zRequestPermissionOutcome,
2782
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2783
+ });
2784
+ /**
2785
+ * Response containing the ID of the created terminal.
2786
+ */
2787
+ export const zCreateTerminalResponse = z.object({
2788
+ terminalId: zTerminalId,
2789
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2790
+ });
2791
+ /**
2792
+ * Exit status of a terminal command.
2793
+ */
2794
+ export const zTerminalExitStatus = z.object({
2795
+ exitCode: defaultOnError(z
2796
+ .int()
2797
+ .gte(0)
2798
+ .max(4294967295, {
2799
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
2800
+ })
2801
+ .nullish(), () => undefined),
2802
+ signal: defaultOnError(z.string().nullish(), () => undefined),
2803
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2804
+ });
2805
+ /**
2806
+ * Response containing the terminal output and exit status.
2807
+ */
2808
+ export const zTerminalOutputResponse = z.object({
2809
+ output: z.string(),
2810
+ truncated: z.boolean(),
2811
+ exitStatus: defaultOnError(zTerminalExitStatus.nullish(), () => undefined),
2812
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2813
+ });
2814
+ /**
2815
+ * Response to terminal/release method
2816
+ */
2817
+ export const zReleaseTerminalResponse = z.object({
2818
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2819
+ });
2820
+ /**
2821
+ * Response containing the exit status of a terminal command.
2822
+ */
2823
+ export const zWaitForTerminalExitResponse = z.object({
2824
+ exitCode: defaultOnError(z
2825
+ .int()
2826
+ .gte(0)
2827
+ .max(4294967295, {
2828
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
2829
+ })
2830
+ .nullish(), () => undefined),
2831
+ signal: defaultOnError(z.string().nullish(), () => undefined),
2832
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2833
+ });
2834
+ /**
2835
+ * Response to `terminal/kill` method
2836
+ */
2837
+ export const zKillTerminalResponse = z.object({
2838
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2839
+ });
2840
+ /**
2841
+ * Allowed wire representations for [`ElicitationContentValue`].
2842
+ */
2843
+ export const zElicitationContentValue = z.union([
2844
+ z.string(),
2845
+ z.number(),
2846
+ z.number(),
2847
+ z.boolean(),
2848
+ z.array(z.string()),
2849
+ ]);
2850
+ /**
2851
+ * **UNSTABLE**
2852
+ *
2853
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2854
+ *
2855
+ * The user accepted the elicitation and provided content.
2856
+ *
2857
+ * @experimental
2858
+ */
2859
+ export const zElicitationAcceptAction = z.object({
2860
+ content: z.record(z.string(), zElicitationContentValue).nullish(),
2861
+ });
2862
+ /**
2863
+ * **UNSTABLE**
2864
+ *
2865
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2866
+ *
2867
+ * Response from the client to an elicitation request.
2868
+ *
2869
+ * @experimental
2870
+ *
2871
+ * Custom variants (unknown `action` values) keep their extra
2872
+ * properties exactly as received; unlike known variants, those keys
2873
+ * bypass lenient-field salvage and arrive unvalidated.
2874
+ */
2875
+ export const zCreateElicitationResponse = preserveCustomPayload(z.intersection(z.union([
2876
+ zElicitationAcceptAction.and(z.object({
2877
+ action: z.literal("accept"),
2878
+ })),
2879
+ z.object({
2880
+ action: z.literal("decline"),
2881
+ }),
2882
+ z.object({
2883
+ action: z.literal("cancel"),
2884
+ }),
2885
+ excludeKnownTags(z.object({
2886
+ action: z.string(),
2887
+ }), "action", ["accept", "cancel", "decline"]),
2888
+ ]), z.object({
2889
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2890
+ })), "action", ["accept", "cancel", "decline"]);
2891
+ /**
2892
+ * **UNSTABLE**
2893
+ *
2894
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2895
+ *
2896
+ * Response to `mcp/connect`.
2897
+ *
2898
+ * @experimental
2899
+ */
2900
+ export const zConnectMcpResponse = z.object({
2901
+ connectionId: zMcpConnectionId,
2902
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2903
+ });
2904
+ /**
2905
+ * **UNSTABLE**
2906
+ *
2907
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2908
+ *
2909
+ * Response to `mcp/disconnect`.
2910
+ *
2911
+ * @experimental
2912
+ */
2913
+ export const zDisconnectMcpResponse = z.object({
2914
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2915
+ });
2916
+ /**
2917
+ * A JSON-RPC response object.
2918
+ */
2919
+ export const zClientResponse = z.union([
2920
+ z.object({
2921
+ id: zRequestId,
2922
+ result: z.union([
2923
+ zWriteTextFileResponse,
2924
+ zReadTextFileResponse,
2925
+ zRequestPermissionResponse,
2926
+ zCreateTerminalResponse,
2927
+ zTerminalOutputResponse,
2928
+ zReleaseTerminalResponse,
2929
+ zWaitForTerminalExitResponse,
2930
+ zKillTerminalResponse,
2931
+ zCreateElicitationResponse,
2932
+ zConnectMcpResponse,
2933
+ zDisconnectMcpResponse,
2934
+ zMessageMcpResponse,
2935
+ zExtResponse,
2936
+ ]),
2937
+ }),
2938
+ z.object({
2939
+ id: zRequestId,
2940
+ error: zError,
2941
+ }),
2942
+ ]);
2943
+ /**
2944
+ * Notification to cancel ongoing operations for a session.
2945
+ *
2946
+ * See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/prompt-turn#cancellation)
2947
+ */
2948
+ export const zCancelNotification = z.object({
2949
+ sessionId: zSessionId,
2950
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2951
+ });
2952
+ /**
2953
+ * Notification sent when a file is opened in the editor.
2954
+ */
2955
+ export const zDidOpenDocumentNotification = z.object({
2956
+ sessionId: zSessionId,
2957
+ uri: z.string(),
2958
+ languageId: z.string(),
2959
+ version: z.number(),
2960
+ text: z.string(),
2961
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2962
+ });
2963
+ /**
2964
+ * A content change event for a document.
2965
+ *
2966
+ * When `range` is `None`, `text` is the full content of the document.
2967
+ * When `range` is `Some`, `text` replaces the given range.
2968
+ */
2969
+ export const zTextDocumentContentChangeEvent = z.object({
2970
+ range: zRange.nullish(),
2971
+ text: z.string(),
2972
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2973
+ });
2974
+ /**
2975
+ * Notification sent when a file is edited.
2976
+ */
2977
+ export const zDidChangeDocumentNotification = z.object({
2978
+ sessionId: zSessionId,
2979
+ uri: z.string(),
2980
+ version: z.number(),
2981
+ contentChanges: requiredDefaultOnError(vecSkipError(zTextDocumentContentChangeEvent), () => []),
2982
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2983
+ });
2984
+ /**
2985
+ * Notification sent when a file is closed.
2986
+ */
2987
+ export const zDidCloseDocumentNotification = z.object({
2988
+ sessionId: zSessionId,
2989
+ uri: z.string(),
2990
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2991
+ });
2992
+ /**
2993
+ * Notification sent when a file is saved.
2994
+ */
2995
+ export const zDidSaveDocumentNotification = z.object({
2996
+ sessionId: zSessionId,
2997
+ uri: z.string(),
2998
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2999
+ });
3000
+ /**
3001
+ * Notification sent when a file becomes the active editor tab.
3002
+ */
3003
+ export const zDidFocusDocumentNotification = z.object({
3004
+ sessionId: zSessionId,
3005
+ uri: z.string(),
3006
+ version: z.number(),
3007
+ position: zPosition,
3008
+ visibleRange: zRange,
3009
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3010
+ });
3011
+ /**
3012
+ * Notification sent when a suggestion is accepted.
3013
+ */
3014
+ export const zAcceptNesNotification = z.object({
3015
+ sessionId: zSessionId,
3016
+ id: zNesSuggestionId,
3017
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3018
+ });
3019
+ /**
3020
+ * The reason a suggestion was rejected.
3021
+ */
3022
+ export const zNesRejectReason = z.union([
3023
+ z.literal("rejected"),
3024
+ z.literal("ignored"),
3025
+ z.literal("replaced"),
3026
+ z.literal("cancelled"),
3027
+ ]);
3028
+ /**
3029
+ * Notification sent when a suggestion is rejected.
3030
+ */
3031
+ export const zRejectNesNotification = z.object({
3032
+ sessionId: zSessionId,
3033
+ id: zNesSuggestionId,
3034
+ reason: defaultOnError(zNesRejectReason.nullish(), () => undefined),
3035
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3036
+ });
3037
+ /**
3038
+ * A JSON-RPC notification object.
3039
+ */
3040
+ export const zClientNotification = z.object({
3041
+ method: z.string(),
3042
+ params: z
3043
+ .union([
3044
+ zCancelNotification,
3045
+ zDidOpenDocumentNotification,
3046
+ zDidChangeDocumentNotification,
3047
+ zDidCloseDocumentNotification,
3048
+ zDidSaveDocumentNotification,
3049
+ zDidFocusDocumentNotification,
3050
+ zAcceptNesNotification,
3051
+ zRejectNesNotification,
3052
+ zMessageMcpNotification,
3053
+ zExtNotification,
3054
+ ])
3055
+ .nullish(),
3056
+ });
3057
+ /**
3058
+ * Notification to cancel an ongoing request.
3059
+ *
3060
+ * See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/cancellation)
3061
+ */
3062
+ export const zCancelRequestNotification = z.object({
3063
+ requestId: zRequestId,
3064
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3065
+ });
3066
+ //# sourceMappingURL=zod.gen.js.map