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,3204 @@
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/v2/draft/session-setup#session-id)
23
+ */
24
+ export const zSessionId = z.string();
25
+ /**
26
+ * Unique identifier for a tool call within a session.
27
+ */
28
+ export const zToolCallId = z.string();
29
+ /**
30
+ * Categories of tools that can be invoked.
31
+ *
32
+ * Tool kinds help clients choose appropriate icons and optimize how they
33
+ * display tool execution progress.
34
+ *
35
+ * See protocol docs: [Creating](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#creating)
36
+ */
37
+ export const zToolKind = z.union([
38
+ z.literal("read"),
39
+ z.literal("edit"),
40
+ z.literal("delete"),
41
+ z.literal("move"),
42
+ z.literal("search"),
43
+ z.literal("execute"),
44
+ z.literal("think"),
45
+ z.literal("fetch"),
46
+ z.literal("switch_mode"),
47
+ z.literal("other"),
48
+ z.string(),
49
+ ]);
50
+ /**
51
+ * Execution status of a tool call.
52
+ *
53
+ * Tool calls progress through different statuses during their lifecycle.
54
+ *
55
+ * See protocol docs: [Status](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#status)
56
+ */
57
+ export const zToolCallStatus = z.union([
58
+ z.literal("pending"),
59
+ z.literal("in_progress"),
60
+ z.literal("completed"),
61
+ z.literal("failed"),
62
+ z.literal("cancelled"),
63
+ z.string(),
64
+ ]);
65
+ /**
66
+ * The sender or recipient of messages and data in a conversation.
67
+ */
68
+ export const zRole = z.union([
69
+ z.literal("assistant"),
70
+ z.literal("user"),
71
+ z.string(),
72
+ ]);
73
+ /**
74
+ * Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
75
+ */
76
+ export const zAnnotations = z.object({
77
+ audience: defaultOnError(vecSkipError(zRole).nullish(), () => undefined),
78
+ lastModified: defaultOnError(z.iso.datetime({ offset: true }).nullish(), () => undefined),
79
+ priority: defaultOnError(z.number().gte(0).lte(1).nullish(), () => undefined),
80
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
81
+ });
82
+ /**
83
+ * Text provided to or from an LLM.
84
+ */
85
+ export const zTextContent = z.object({
86
+ text: z.string(),
87
+ annotations: defaultOnError(zAnnotations.nullish(), () => undefined),
88
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
89
+ });
90
+ /**
91
+ * An Internet media type identifying the format of protocol content.
92
+ */
93
+ export const zMediaType = z.string();
94
+ /**
95
+ * An image provided to or from an LLM.
96
+ */
97
+ export const zImageContent = z.object({
98
+ data: z.string(),
99
+ mimeType: zMediaType,
100
+ uri: defaultOnError(z.url().nullish(), () => undefined),
101
+ annotations: defaultOnError(zAnnotations.nullish(), () => undefined),
102
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
103
+ });
104
+ /**
105
+ * Audio provided to or from an LLM.
106
+ */
107
+ export const zAudioContent = z.object({
108
+ data: z.string(),
109
+ mimeType: zMediaType,
110
+ annotations: defaultOnError(zAnnotations.nullish(), () => undefined),
111
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
112
+ });
113
+ /**
114
+ * Theme an icon is designed for.
115
+ */
116
+ export const zIconTheme = z.union([
117
+ z.literal("light"),
118
+ z.literal("dark"),
119
+ z.string(),
120
+ ]);
121
+ /**
122
+ * An optionally-sized icon that can be displayed in a user interface.
123
+ */
124
+ export const zIcon = z.object({
125
+ src: z.url(),
126
+ mimeType: defaultOnError(zMediaType.nullish(), () => undefined),
127
+ sizes: defaultOnError(vecSkipError(z.string()).nullish(), () => undefined),
128
+ theme: defaultOnError(zIconTheme.nullish(), () => undefined),
129
+ });
130
+ /**
131
+ * A resource that the server is capable of reading, included in a prompt or tool call result.
132
+ */
133
+ export const zResourceLink = z.object({
134
+ name: z.string(),
135
+ uri: z.url(),
136
+ title: defaultOnError(z.string().nullish(), () => undefined),
137
+ description: defaultOnError(z.string().nullish(), () => undefined),
138
+ icons: defaultOnError(vecSkipError(zIcon).nullish(), () => undefined),
139
+ mimeType: defaultOnError(zMediaType.nullish(), () => undefined),
140
+ size: defaultOnError(z.number().nullish(), () => undefined),
141
+ annotations: defaultOnError(zAnnotations.nullish(), () => undefined),
142
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
143
+ });
144
+ /**
145
+ * Text-based resource contents.
146
+ */
147
+ export const zTextResourceContents = z.object({
148
+ text: z.string(),
149
+ uri: z.url(),
150
+ mimeType: defaultOnError(zMediaType.nullish(), () => undefined),
151
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
152
+ });
153
+ /**
154
+ * Binary resource contents.
155
+ */
156
+ export const zBlobResourceContents = z.object({
157
+ blob: z.string(),
158
+ uri: z.url(),
159
+ mimeType: defaultOnError(zMediaType.nullish(), () => undefined),
160
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
161
+ });
162
+ /**
163
+ * Resource content that can be embedded in a message.
164
+ */
165
+ export const zEmbeddedResourceResource = z.union([
166
+ zTextResourceContents,
167
+ zBlobResourceContents,
168
+ ]);
169
+ /**
170
+ * The contents of a resource, embedded into a prompt or tool call result.
171
+ */
172
+ export const zEmbeddedResource = z.object({
173
+ resource: zEmbeddedResourceResource,
174
+ annotations: defaultOnError(zAnnotations.nullish(), () => undefined),
175
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
176
+ });
177
+ /**
178
+ * Content blocks represent displayable information in the Agent Client Protocol.
179
+ *
180
+ * They provide a structured way to handle various types of user-facing content—whether
181
+ * it's text from language models, images for analysis, or embedded resources for context.
182
+ *
183
+ * Content blocks appear in:
184
+ * - User prompts sent via `session/prompt`
185
+ * - Language model output reported through `session/update` notifications as
186
+ * message updates or streamed chunks
187
+ * - Progress updates and results from tool calls
188
+ *
189
+ * This structure is compatible with the Model Context Protocol (MCP), enabling
190
+ * agents to seamlessly forward content from MCP tool outputs without transformation.
191
+ *
192
+ * See protocol docs: [Content](https://agentclientprotocol.com/protocol/v2/draft/content)
193
+ *
194
+ * Custom variants (unknown `type` values) keep their extra
195
+ * properties exactly as received; unlike known variants, those keys
196
+ * bypass lenient-field salvage and arrive unvalidated.
197
+ */
198
+ export const zContentBlock = preserveCustomPayload(z.union([
199
+ zTextContent.and(z.object({
200
+ type: z.literal("text"),
201
+ })),
202
+ zImageContent.and(z.object({
203
+ type: z.literal("image"),
204
+ })),
205
+ zAudioContent.and(z.object({
206
+ type: z.literal("audio"),
207
+ })),
208
+ zResourceLink.and(z.object({
209
+ type: z.literal("resource_link"),
210
+ })),
211
+ zEmbeddedResource.and(z.object({
212
+ type: z.literal("resource"),
213
+ })),
214
+ excludeKnownTags(z.object({
215
+ type: z.string(),
216
+ }), "type", ["audio", "image", "resource", "resource_link", "text"]),
217
+ ]), "type", ["audio", "image", "resource", "resource_link", "text"]);
218
+ /**
219
+ * Standard content block (text, images, resources).
220
+ */
221
+ export const zContent = z.object({
222
+ content: zContentBlock,
223
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
224
+ });
225
+ /**
226
+ * Kind of file content represented by a diff change.
227
+ */
228
+ export const zDiffFileType = z.union([
229
+ z.literal("text"),
230
+ z.literal("binary"),
231
+ z.literal("directory"),
232
+ z.literal("symlink"),
233
+ z.string(),
234
+ ]);
235
+ /**
236
+ * An absolute filesystem path used by the protocol.
237
+ */
238
+ export const zAbsolutePath = z.string();
239
+ /**
240
+ * Operation metadata for add, delete, and modify changes.
241
+ */
242
+ export const zDiffPathChange = z.object({
243
+ path: zAbsolutePath,
244
+ });
245
+ /**
246
+ * Operation metadata for move and copy changes.
247
+ */
248
+ export const zDiffPathPairChange = z.object({
249
+ oldPath: zAbsolutePath,
250
+ path: zAbsolutePath,
251
+ });
252
+ /**
253
+ * One file-level change described by a [`Diff`].
254
+ *
255
+ * Structured change metadata lets clients identify affected files and
256
+ * operations without parsing the text patch.
257
+ *
258
+ * Custom variants (unknown `operation` values) keep their extra
259
+ * properties exactly as received; unlike known variants, those keys
260
+ * bypass lenient-field salvage and arrive unvalidated.
261
+ */
262
+ export const zDiffChange = preserveCustomPayload(z.intersection(z.union([
263
+ zDiffPathChange.and(z.object({
264
+ operation: z.literal("add"),
265
+ })),
266
+ zDiffPathChange.and(z.object({
267
+ operation: z.literal("delete"),
268
+ })),
269
+ zDiffPathChange.and(z.object({
270
+ operation: z.literal("modify"),
271
+ })),
272
+ zDiffPathPairChange.and(z.object({
273
+ operation: z.literal("move"),
274
+ })),
275
+ zDiffPathPairChange.and(z.object({
276
+ operation: z.literal("copy"),
277
+ })),
278
+ excludeKnownTags(z.object({
279
+ operation: z.string(),
280
+ }), "operation", ["add", "copy", "delete", "modify", "move"]),
281
+ ]), z.object({
282
+ fileType: defaultOnError(zDiffFileType.nullish(), () => undefined),
283
+ mimeType: defaultOnError(zMediaType.nullish(), () => undefined),
284
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
285
+ })), "operation", ["add", "copy", "delete", "modify", "move"]);
286
+ /**
287
+ * Text patch format used by [`DiffPatch`].
288
+ */
289
+ export const zDiffPatchFormat = z.union([z.literal("git_patch"), z.string()]);
290
+ /**
291
+ * Renderable patch text and its format.
292
+ */
293
+ export const zDiffPatch = z.object({
294
+ format: zDiffPatchFormat,
295
+ text: z.string(),
296
+ });
297
+ /**
298
+ * File changes produced by a tool call.
299
+ *
300
+ * `changes` is authoritative for affected absolute paths and operations.
301
+ * `patch` optionally carries renderable text for some or all of those changes
302
+ * and MUST be consistent with `changes`. Agents SHOULD provide `patch` whenever
303
+ * feasible. Clients MUST handle diffs where `patch` is omitted or `null`.
304
+ *
305
+ * See protocol docs: [Content](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#content)
306
+ */
307
+ export const zDiff = z.object({
308
+ changes: vecSkipError(zDiffChange),
309
+ patch: defaultOnError(zDiffPatch.nullish(), () => undefined),
310
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
311
+ });
312
+ /**
313
+ * Unique identifier for an agent-owned terminal within a session.
314
+ */
315
+ export const zTerminalId = z.string();
316
+ /**
317
+ * A display-only reference to an agent-owned terminal.
318
+ *
319
+ * Terminal state and output are delivered separately through
320
+ * [`TerminalUpdate`] and [`TerminalOutputChunk`].
321
+ */
322
+ export const zTerminal = z.object({
323
+ terminalId: zTerminalId,
324
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
325
+ });
326
+ /**
327
+ * Content produced by a tool call.
328
+ *
329
+ * Tool calls can produce different types of content including standard
330
+ * content blocks (text, images), file diffs, or display-only terminals.
331
+ *
332
+ * See protocol docs: [Content](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#content)
333
+ *
334
+ * Custom variants (unknown `type` values) keep their extra
335
+ * properties exactly as received; unlike known variants, those keys
336
+ * bypass lenient-field salvage and arrive unvalidated.
337
+ */
338
+ export const zToolCallContent = preserveCustomPayload(z.union([
339
+ zContent.and(z.object({
340
+ type: z.literal("content"),
341
+ })),
342
+ zDiff.and(z.object({
343
+ type: z.literal("diff"),
344
+ })),
345
+ zTerminal.and(z.object({
346
+ type: z.literal("terminal"),
347
+ })),
348
+ excludeKnownTags(z.object({
349
+ type: z.string(),
350
+ }), "type", ["content", "diff", "terminal"]),
351
+ ]), "type", ["content", "diff", "terminal"]);
352
+ /**
353
+ * A file location being accessed or modified by a tool.
354
+ *
355
+ * Enables clients to implement "follow-along" features that track
356
+ * which files the agent is working with in real-time.
357
+ *
358
+ * See protocol docs: [Following the Agent](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#following-the-agent)
359
+ */
360
+ export const zToolCallLocation = z.object({
361
+ path: zAbsolutePath,
362
+ line: defaultOnError(z
363
+ .int()
364
+ .gte(0)
365
+ .max(4294967295, {
366
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
367
+ })
368
+ .nullish(), () => undefined),
369
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
370
+ });
371
+ /**
372
+ * Represents an upsert for a tool call that the language model has requested.
373
+ *
374
+ * Tool calls are actions that the agent executes on behalf of the language model,
375
+ * such as reading files, executing code, or fetching data from external sources.
376
+ *
377
+ * Only [`ToolCallUpdate::tool_call_id`] is required. Other fields have patch semantics:
378
+ * omitted fields leave the existing tool call value unchanged, `null` clears or
379
+ * unsets the value, and concrete values replace the previous value. For
380
+ * collection fields, concrete arrays replace the previous collection, and both
381
+ * `null` and `[]` clear the collection. When a client receives a tool call ID it
382
+ * has not seen before, omitted fields use client defaults.
383
+ *
384
+ * See protocol docs: [Tool Calls](https://agentclientprotocol.com/protocol/v2/draft/tool-calls)
385
+ */
386
+ export const zToolCallUpdate = z.object({
387
+ toolCallId: zToolCallId,
388
+ name: defaultOnError(z.string().nullish(), () => undefined),
389
+ title: defaultOnError(z.string().nullish(), () => undefined),
390
+ kind: defaultOnError(zToolKind.nullish(), () => undefined),
391
+ status: defaultOnError(zToolCallStatus.nullish(), () => undefined),
392
+ content: defaultOnError(vecSkipError(zToolCallContent).nullish(), () => undefined),
393
+ locations: defaultOnError(vecSkipError(zToolCallLocation).nullish(), () => undefined),
394
+ rawInput: defaultOnError(z.unknown().optional(), () => undefined),
395
+ rawOutput: defaultOnError(z.unknown().optional(), () => undefined),
396
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
397
+ });
398
+ /**
399
+ * Permission request details for a tool call.
400
+ */
401
+ export const zToolCallPermissionSubject = z.object({
402
+ toolCall: zToolCallUpdate,
403
+ });
404
+ /**
405
+ * Permission request details for a command.
406
+ */
407
+ export const zCommandPermissionSubject = z.object({
408
+ command: z.string(),
409
+ cwd: zAbsolutePath,
410
+ toolCallId: defaultOnError(zToolCallId.nullish(), () => undefined),
411
+ terminalId: defaultOnError(zTerminalId.nullish(), () => undefined),
412
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
413
+ });
414
+ /**
415
+ * The operation requiring permission.
416
+ *
417
+ * Custom variants (unknown `type` values) keep their extra
418
+ * properties exactly as received; unlike known variants, those keys
419
+ * bypass lenient-field salvage and arrive unvalidated.
420
+ */
421
+ export const zRequestPermissionSubject = preserveCustomPayload(z.union([
422
+ zToolCallPermissionSubject.and(z.object({
423
+ type: z.literal("tool_call"),
424
+ })),
425
+ zCommandPermissionSubject.and(z.object({
426
+ type: z.literal("command"),
427
+ })),
428
+ excludeKnownTags(z.object({
429
+ type: z.string(),
430
+ }), "type", ["command", "tool_call"]),
431
+ ]), "type", ["command", "tool_call"]);
432
+ /**
433
+ * Unique identifier for a permission option.
434
+ */
435
+ export const zPermissionOptionId = z.string();
436
+ /**
437
+ * The type of permission option being presented to the user.
438
+ *
439
+ * Helps clients choose appropriate icons and UI treatment.
440
+ */
441
+ export const zPermissionOptionKind = z.union([
442
+ z.literal("allow_once"),
443
+ z.literal("allow_always"),
444
+ z.literal("reject_once"),
445
+ z.literal("reject_always"),
446
+ z.string(),
447
+ ]);
448
+ /**
449
+ * An option presented to the user when requesting permission.
450
+ */
451
+ export const zPermissionOption = z.object({
452
+ optionId: zPermissionOptionId,
453
+ name: z.string(),
454
+ kind: zPermissionOptionKind,
455
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
456
+ });
457
+ /**
458
+ * Request for user permission to proceed with an operation.
459
+ *
460
+ * Sent when the agent needs authorization before performing a sensitive operation.
461
+ *
462
+ * See protocol docs: [Requesting Permission](https://agentclientprotocol.com/protocol/v2/draft/tool-calls#requesting-permission)
463
+ */
464
+ export const zRequestPermissionRequest = z.object({
465
+ sessionId: zSessionId,
466
+ title: z.string(),
467
+ description: defaultOnError(z.string().nullish(), () => undefined),
468
+ subject: zRequestPermissionSubject.nullish(),
469
+ options: z.array(zPermissionOption).min(1),
470
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
471
+ });
472
+ /**
473
+ * **UNSTABLE**
474
+ *
475
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
476
+ *
477
+ * Session-scoped elicitation, optionally tied to a specific tool call.
478
+ *
479
+ * When `tool_call_id` is set, the elicitation is tied to a specific tool call.
480
+ * This is useful when an agent receives an elicitation from an MCP server
481
+ * during a tool call and needs to redirect it to the user.
482
+ *
483
+ * @experimental
484
+ */
485
+ export const zElicitationSessionScope = z.object({
486
+ sessionId: zSessionId,
487
+ toolCallId: defaultOnError(zToolCallId.nullish(), () => undefined),
488
+ });
489
+ /**
490
+ * **UNSTABLE**
491
+ *
492
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
493
+ *
494
+ * Request-scoped elicitation, tied to a specific JSON-RPC request outside of a session
495
+ * (e.g., during auth/configuration phases before any session is started).
496
+ *
497
+ * @experimental
498
+ */
499
+ export const zElicitationRequestScope = z.object({
500
+ requestId: zRequestId,
501
+ });
502
+ /**
503
+ * Object schema type.
504
+ */
505
+ export const zElicitationSchemaType = z.literal("object");
506
+ /**
507
+ * String format types for string properties in elicitation schemas.
508
+ */
509
+ export const zStringFormat = z.union([
510
+ z.literal("email"),
511
+ z.literal("uri"),
512
+ z.literal("date"),
513
+ z.literal("date-time"),
514
+ z.string(),
515
+ ]);
516
+ /**
517
+ * A titled enum option with a const value, human-readable title, and optional description.
518
+ */
519
+ export const zEnumOption = z.object({
520
+ const: z.string(),
521
+ title: z.string(),
522
+ description: defaultOnError(z.string().nullish(), () => undefined),
523
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
524
+ });
525
+ /**
526
+ * Schema for string properties in an elicitation form.
527
+ *
528
+ * When `enum` or `oneOf` is set, this represents a single-select enum
529
+ * with `"type": "string"`.
530
+ */
531
+ export const zStringPropertySchema = z.object({
532
+ title: defaultOnError(z.string().nullish(), () => undefined),
533
+ description: defaultOnError(z.string().nullish(), () => undefined),
534
+ minLength: z
535
+ .int()
536
+ .gte(0)
537
+ .max(4294967295, {
538
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
539
+ })
540
+ .nullish(),
541
+ maxLength: z
542
+ .int()
543
+ .gte(0)
544
+ .max(4294967295, {
545
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
546
+ })
547
+ .nullish(),
548
+ pattern: z.string().nullish(),
549
+ format: zStringFormat.nullish(),
550
+ default: defaultOnError(z.string().nullish(), () => undefined),
551
+ enum: z.array(z.string()).min(1).nullish(),
552
+ oneOf: z.array(zEnumOption).min(1).nullish(),
553
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
554
+ });
555
+ /**
556
+ * Schema for number (floating-point) properties in an elicitation form.
557
+ */
558
+ export const zNumberPropertySchema = z.object({
559
+ title: defaultOnError(z.string().nullish(), () => undefined),
560
+ description: defaultOnError(z.string().nullish(), () => undefined),
561
+ minimum: z.number().nullish(),
562
+ maximum: z.number().nullish(),
563
+ default: defaultOnError(z.number().nullish(), () => undefined),
564
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
565
+ });
566
+ /**
567
+ * Schema for integer properties in an elicitation form.
568
+ */
569
+ export const zIntegerPropertySchema = z.object({
570
+ title: defaultOnError(z.string().nullish(), () => undefined),
571
+ description: defaultOnError(z.string().nullish(), () => undefined),
572
+ minimum: z.number().nullish(),
573
+ maximum: z.number().nullish(),
574
+ default: defaultOnError(z.number().nullish(), () => undefined),
575
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
576
+ });
577
+ /**
578
+ * Schema for boolean properties in an elicitation form.
579
+ */
580
+ export const zBooleanPropertySchema = z.object({
581
+ title: defaultOnError(z.string().nullish(), () => undefined),
582
+ description: defaultOnError(z.string().nullish(), () => undefined),
583
+ default: defaultOnError(z.boolean().nullish(), () => undefined),
584
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
585
+ });
586
+ /**
587
+ * String item schema for multi-select enum properties.
588
+ */
589
+ export const zStringMultiSelectItems = z.object({
590
+ enum: z.array(z.string()).min(1),
591
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
592
+ });
593
+ /**
594
+ * Items definition for titled multi-select enum properties.
595
+ */
596
+ export const zTitledMultiSelectItems = z.object({
597
+ anyOf: z.array(zEnumOption).min(1),
598
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
599
+ });
600
+ /**
601
+ * Items for a multi-select (array) property schema.
602
+ *
603
+ * Custom variants (unknown `type` values) keep their extra
604
+ * properties exactly as received; unlike known variants, those keys
605
+ * bypass lenient-field salvage and arrive unvalidated.
606
+ */
607
+ export const zMultiSelectItems = preserveCustomPayload(z.union([
608
+ zStringMultiSelectItems.and(z.object({
609
+ type: z.literal("string"),
610
+ })),
611
+ excludeKnownTags(z.object({
612
+ type: z.string(),
613
+ }), "type", ["string"]),
614
+ zTitledMultiSelectItems,
615
+ ]), "type", ["string"]);
616
+ /**
617
+ * Schema for multi-select (array) properties in an elicitation form.
618
+ */
619
+ export const zMultiSelectPropertySchema = z.object({
620
+ title: defaultOnError(z.string().nullish(), () => undefined),
621
+ description: defaultOnError(z.string().nullish(), () => undefined),
622
+ minItems: z.number().nullish(),
623
+ maxItems: z.number().nullish(),
624
+ items: zMultiSelectItems,
625
+ default: defaultOnError(vecSkipError(z.string()).nullish(), () => undefined),
626
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
627
+ });
628
+ /**
629
+ * Property schema for elicitation form fields.
630
+ *
631
+ * Each variant corresponds to a JSON Schema `"type"` value.
632
+ * Single-select enums use the `String` variant with `enum` or `oneOf` set.
633
+ * Multi-select enums use the `Array` variant.
634
+ *
635
+ * Custom variants (unknown `type` values) keep their extra
636
+ * properties exactly as received; unlike known variants, those keys
637
+ * bypass lenient-field salvage and arrive unvalidated.
638
+ */
639
+ export const zElicitationPropertySchema = preserveCustomPayload(z.union([
640
+ zStringPropertySchema.and(z.object({
641
+ type: z.literal("string"),
642
+ })),
643
+ zNumberPropertySchema.and(z.object({
644
+ type: z.literal("number"),
645
+ })),
646
+ zIntegerPropertySchema.and(z.object({
647
+ type: z.literal("integer"),
648
+ })),
649
+ zBooleanPropertySchema.and(z.object({
650
+ type: z.literal("boolean"),
651
+ })),
652
+ zMultiSelectPropertySchema.and(z.object({
653
+ type: z.literal("array"),
654
+ })),
655
+ excludeKnownTags(z.object({
656
+ type: z.string(),
657
+ }), "type", ["array", "boolean", "integer", "number", "string"]),
658
+ ]), "type", ["array", "boolean", "integer", "number", "string"]);
659
+ /**
660
+ * Type-safe elicitation schema for requesting structured user input.
661
+ *
662
+ * This represents a JSON Schema object with primitive-typed properties,
663
+ * as required by the elicitation specification.
664
+ */
665
+ export const zElicitationSchema = z.object({
666
+ type: defaultOnError(zElicitationSchemaType.optional().default("object"), () => "object"),
667
+ title: defaultOnError(z.string().nullish(), () => undefined),
668
+ properties: z
669
+ .record(z.string(), zElicitationPropertySchema)
670
+ .optional()
671
+ .default({}),
672
+ required: z.array(z.string()).nullish(),
673
+ description: defaultOnError(z.string().nullish(), () => undefined),
674
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
675
+ });
676
+ /**
677
+ * **UNSTABLE**
678
+ *
679
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
680
+ *
681
+ * Form-based elicitation mode where the client renders a form from the provided schema.
682
+ *
683
+ * @experimental
684
+ */
685
+ export const zElicitationFormMode = z.intersection(z.union([zElicitationSessionScope, zElicitationRequestScope]), z.object({
686
+ requestedSchema: zElicitationSchema,
687
+ }));
688
+ /**
689
+ * **UNSTABLE**
690
+ *
691
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
692
+ *
693
+ * Unique identifier for an elicitation.
694
+ *
695
+ * @experimental
696
+ */
697
+ export const zElicitationId = z.string();
698
+ /**
699
+ * **UNSTABLE**
700
+ *
701
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
702
+ *
703
+ * URL-based elicitation mode where the client directs the user to a URL.
704
+ *
705
+ * @experimental
706
+ */
707
+ export const zElicitationUrlMode = z.intersection(z.union([zElicitationSessionScope, zElicitationRequestScope]), z.object({
708
+ elicitationId: zElicitationId,
709
+ url: z.url(),
710
+ }));
711
+ /**
712
+ * **UNSTABLE**
713
+ *
714
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
715
+ *
716
+ * Request from the agent to elicit structured user input.
717
+ *
718
+ * The agent sends this to the client to request information from the user,
719
+ * either via a form or by directing them to a URL.
720
+ * Elicitations are tied to a session (optionally a tool call) or a request.
721
+ *
722
+ * @experimental
723
+ *
724
+ * Custom variants (unknown `mode` values) keep their extra
725
+ * properties exactly as received; unlike known variants, those keys
726
+ * bypass lenient-field salvage and arrive unvalidated.
727
+ */
728
+ export const zCreateElicitationRequest = preserveCustomPayload(z.intersection(z.union([
729
+ zElicitationFormMode.and(z.object({
730
+ mode: z.literal("form"),
731
+ })),
732
+ zElicitationUrlMode.and(z.object({
733
+ mode: z.literal("url"),
734
+ })),
735
+ excludeKnownTags(z.intersection(z.union([zElicitationSessionScope, zElicitationRequestScope]), z.object({
736
+ mode: z.string(),
737
+ })), "mode", ["form", "url"]),
738
+ ]), z.object({
739
+ message: z.string(),
740
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
741
+ })), "mode", ["form", "url"]);
742
+ /**
743
+ * **UNSTABLE**
744
+ *
745
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
746
+ *
747
+ * Unique identifier for an MCP server using the ACP transport.
748
+ *
749
+ * The value is opaque and generated by the ACP component providing the MCP server. It is
750
+ * used by `mcp/connect` to route connection requests back to the component that declared the
751
+ * server.
752
+ *
753
+ * @experimental
754
+ */
755
+ export const zMcpServerAcpId = z.string();
756
+ /**
757
+ * **UNSTABLE**
758
+ *
759
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
760
+ *
761
+ * Request parameters for `mcp/connect`.
762
+ *
763
+ * @experimental
764
+ */
765
+ export const zConnectMcpRequest = z.object({
766
+ serverId: zMcpServerAcpId,
767
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
768
+ });
769
+ /**
770
+ * **UNSTABLE**
771
+ *
772
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
773
+ *
774
+ * A unique identifier for an active MCP-over-ACP connection.
775
+ *
776
+ * @experimental
777
+ */
778
+ export const zMcpConnectionId = z.string();
779
+ /**
780
+ * **UNSTABLE**
781
+ *
782
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
783
+ *
784
+ * Request parameters for `mcp/message`.
785
+ *
786
+ * @experimental
787
+ */
788
+ export const zMessageMcpRequest = z.object({
789
+ connectionId: zMcpConnectionId,
790
+ method: z.string(),
791
+ params: z.record(z.string(), z.unknown()).nullish(),
792
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
793
+ });
794
+ /**
795
+ * **UNSTABLE**
796
+ *
797
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
798
+ *
799
+ * Request parameters for `mcp/disconnect`.
800
+ *
801
+ * @experimental
802
+ */
803
+ export const zDisconnectMcpRequest = z.object({
804
+ connectionId: zMcpConnectionId,
805
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
806
+ });
807
+ /**
808
+ * Allows for sending an arbitrary request that is not part of the ACP spec.
809
+ * Extension methods provide a way to add custom functionality while maintaining
810
+ * protocol compatibility.
811
+ *
812
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)
813
+ */
814
+ export const zExtRequest = z.unknown();
815
+ /**
816
+ * A JSON-RPC request object.
817
+ */
818
+ export const zAgentRequest = z.object({
819
+ id: zRequestId,
820
+ method: z.string(),
821
+ params: z
822
+ .union([
823
+ zRequestPermissionRequest,
824
+ zCreateElicitationRequest,
825
+ zConnectMcpRequest,
826
+ zMessageMcpRequest,
827
+ zDisconnectMcpRequest,
828
+ zExtRequest,
829
+ ])
830
+ .nullish(),
831
+ });
832
+ /**
833
+ * Protocol version identifier.
834
+ *
835
+ * This version is only bumped for breaking changes.
836
+ * Non-breaking changes should be introduced via capabilities.
837
+ */
838
+ export const zProtocolVersion = z.int().gte(0).lte(65535);
839
+ /**
840
+ * Metadata about the implementation of the client or agent.
841
+ * Describes the name and version of an ACP implementation, with an optional
842
+ * title for UI representation.
843
+ */
844
+ export const zImplementation = z.object({
845
+ name: z.string(),
846
+ title: defaultOnError(z.string().nullish(), () => undefined),
847
+ version: z.string(),
848
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
849
+ });
850
+ /**
851
+ * Capabilities for image content in prompt requests.
852
+ *
853
+ * Supplying `{}` means the agent supports image content in prompts.
854
+ */
855
+ export const zPromptImageCapabilities = z.object({
856
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
857
+ });
858
+ /**
859
+ * Capabilities for audio content in prompt requests.
860
+ *
861
+ * Supplying `{}` means the agent supports audio content in prompts.
862
+ */
863
+ export const zPromptAudioCapabilities = z.object({
864
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
865
+ });
866
+ /**
867
+ * Capabilities for embedded context in prompt requests.
868
+ *
869
+ * Supplying `{}` means the agent supports embedded context in prompts.
870
+ */
871
+ export const zPromptEmbeddedContextCapabilities = z.object({
872
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
873
+ });
874
+ /**
875
+ * Prompt capabilities supported by the agent in `session/prompt` requests.
876
+ *
877
+ * Baseline agent functionality requires support for [`ContentBlock::Text`]
878
+ * and [`ContentBlock::ResourceLink`] in prompt requests.
879
+ *
880
+ * Other variants must be explicitly opted in to.
881
+ * Capabilities for different types of content in prompt requests.
882
+ *
883
+ * Indicates which content types beyond the baseline (text and resource links)
884
+ * the agent can process.
885
+ *
886
+ * See protocol docs: [Prompt Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#prompt-capabilities)
887
+ */
888
+ export const zPromptCapabilities = z.object({
889
+ image: defaultOnError(zPromptImageCapabilities.nullish(), () => undefined),
890
+ audio: defaultOnError(zPromptAudioCapabilities.nullish(), () => undefined),
891
+ embeddedContext: defaultOnError(zPromptEmbeddedContextCapabilities.nullish(), () => undefined),
892
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
893
+ });
894
+ /**
895
+ * Capabilities for stdio MCP server transports.
896
+ *
897
+ * Supplying `{}` means the agent supports stdio MCP server transports.
898
+ */
899
+ export const zMcpStdioCapabilities = z.object({
900
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
901
+ });
902
+ /**
903
+ * Capabilities for HTTP MCP server transports.
904
+ *
905
+ * Supplying `{}` means the agent supports HTTP MCP server transports.
906
+ */
907
+ export const zMcpHttpCapabilities = z.object({
908
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
909
+ });
910
+ /**
911
+ * **UNSTABLE**
912
+ *
913
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
914
+ *
915
+ * Capabilities for ACP MCP server transports.
916
+ *
917
+ * Supplying `{}` means the agent supports ACP MCP server transports.
918
+ *
919
+ * @experimental
920
+ */
921
+ export const zMcpAcpCapabilities = z.object({
922
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
923
+ });
924
+ /**
925
+ * MCP capabilities supported by the agent for session lifecycle requests.
926
+ */
927
+ export const zMcpCapabilities = z.object({
928
+ stdio: defaultOnError(zMcpStdioCapabilities.nullish(), () => undefined),
929
+ http: defaultOnError(zMcpHttpCapabilities.nullish(), () => undefined),
930
+ acp: defaultOnError(zMcpAcpCapabilities.nullish(), () => undefined),
931
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
932
+ });
933
+ /**
934
+ * Capabilities for the `session/delete` method.
935
+ *
936
+ * Supplying `{}` means the agent supports deleting sessions from `session/list`.
937
+ */
938
+ export const zSessionDeleteCapabilities = z.object({
939
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
940
+ });
941
+ /**
942
+ * Capabilities for additional session directories support.
943
+ *
944
+ * Supplying `{}` means the agent supports the `additionalDirectories` field on
945
+ * supported session lifecycle requests. Agents that also support
946
+ * `session/list` may return `SessionInfo.additionalDirectories` to report the
947
+ * complete ordered additional-root list associated with a listed session.
948
+ */
949
+ export const zSessionAdditionalDirectoriesCapabilities = z.object({
950
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
951
+ });
952
+ /**
953
+ * **UNSTABLE**
954
+ *
955
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
956
+ *
957
+ * Capabilities for the `session/fork` method.
958
+ *
959
+ * Supplying `{}` means the agent supports forking sessions.
960
+ *
961
+ * @experimental
962
+ */
963
+ export const zSessionForkCapabilities = z.object({
964
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
965
+ });
966
+ /**
967
+ * Session capabilities supported by the agent.
968
+ *
969
+ * Supplying `{}` means the agent supports the baseline session methods:
970
+ * `session/new`, `session/list`, `session/resume`, `session/close`,
971
+ * `session/prompt`, `session/cancel`, and `session/update`.
972
+ *
973
+ * Agents that support sessions **MAY** support additional session methods,
974
+ * prompt content types, and MCP transports by specifying additional
975
+ * capabilities.
976
+ *
977
+ * See protocol docs: [Session Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#session-capabilities)
978
+ */
979
+ export const zSessionCapabilities = z.object({
980
+ prompt: defaultOnError(zPromptCapabilities.nullish(), () => undefined),
981
+ mcp: defaultOnError(zMcpCapabilities.nullish(), () => undefined),
982
+ delete: defaultOnError(zSessionDeleteCapabilities.nullish(), () => undefined),
983
+ additionalDirectories: defaultOnError(zSessionAdditionalDirectoriesCapabilities.nullish(), () => undefined),
984
+ fork: defaultOnError(zSessionForkCapabilities.nullish(), () => undefined),
985
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
986
+ });
987
+ /**
988
+ * Authentication-related extension capabilities supported by the agent.
989
+ *
990
+ * This object does not advertise support for `auth/login` or `auth/logout`.
991
+ * Those methods are advertised by a non-empty `authMethods` list in the
992
+ * `initialize` response.
993
+ */
994
+ export const zAgentAuthCapabilities = z.object({
995
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
996
+ });
997
+ /**
998
+ * **UNSTABLE**
999
+ *
1000
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1001
+ *
1002
+ * Provider configuration capabilities supported by the agent.
1003
+ *
1004
+ * Supplying `{}` means the agent supports provider configuration methods.
1005
+ *
1006
+ * @experimental
1007
+ */
1008
+ export const zProvidersCapabilities = z.object({
1009
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1010
+ });
1011
+ /**
1012
+ * Marker for `document/didOpen` capability support.
1013
+ */
1014
+ export const zNesDocumentDidOpenCapabilities = z.object({
1015
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1016
+ });
1017
+ /**
1018
+ * How the agent wants document changes delivered.
1019
+ */
1020
+ export const zTextDocumentSyncKind = z.union([
1021
+ z.literal("full"),
1022
+ z.literal("incremental"),
1023
+ ]);
1024
+ /**
1025
+ * Capabilities for `document/didChange` events.
1026
+ */
1027
+ export const zNesDocumentDidChangeCapabilities = z.object({
1028
+ syncKind: zTextDocumentSyncKind,
1029
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1030
+ });
1031
+ /**
1032
+ * Marker for `document/didClose` capability support.
1033
+ */
1034
+ export const zNesDocumentDidCloseCapabilities = z.object({
1035
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1036
+ });
1037
+ /**
1038
+ * Marker for `document/didSave` capability support.
1039
+ */
1040
+ export const zNesDocumentDidSaveCapabilities = z.object({
1041
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1042
+ });
1043
+ /**
1044
+ * Marker for `document/didFocus` capability support.
1045
+ */
1046
+ export const zNesDocumentDidFocusCapabilities = z.object({
1047
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1048
+ });
1049
+ /**
1050
+ * Document event capabilities the agent wants to receive.
1051
+ */
1052
+ export const zNesDocumentEventCapabilities = z.object({
1053
+ didOpen: defaultOnError(zNesDocumentDidOpenCapabilities.nullish(), () => undefined),
1054
+ didChange: defaultOnError(zNesDocumentDidChangeCapabilities.nullish(), () => undefined),
1055
+ didClose: defaultOnError(zNesDocumentDidCloseCapabilities.nullish(), () => undefined),
1056
+ didSave: defaultOnError(zNesDocumentDidSaveCapabilities.nullish(), () => undefined),
1057
+ didFocus: defaultOnError(zNesDocumentDidFocusCapabilities.nullish(), () => undefined),
1058
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1059
+ });
1060
+ /**
1061
+ * Event capabilities the agent can consume.
1062
+ */
1063
+ export const zNesEventCapabilities = z.object({
1064
+ document: defaultOnError(zNesDocumentEventCapabilities.nullish(), () => undefined),
1065
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1066
+ });
1067
+ /**
1068
+ * Capabilities for recent files context.
1069
+ */
1070
+ export const zNesRecentFilesCapabilities = z.object({
1071
+ maxCount: defaultOnError(z
1072
+ .int()
1073
+ .gte(0)
1074
+ .max(4294967295, {
1075
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
1076
+ })
1077
+ .nullish(), () => undefined),
1078
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1079
+ });
1080
+ /**
1081
+ * Capabilities for related snippets context.
1082
+ */
1083
+ export const zNesRelatedSnippetsCapabilities = z.object({
1084
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1085
+ });
1086
+ /**
1087
+ * Capabilities for edit history context.
1088
+ */
1089
+ export const zNesEditHistoryCapabilities = z.object({
1090
+ maxCount: defaultOnError(z
1091
+ .int()
1092
+ .gte(0)
1093
+ .max(4294967295, {
1094
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
1095
+ })
1096
+ .nullish(), () => undefined),
1097
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1098
+ });
1099
+ /**
1100
+ * Capabilities for user actions context.
1101
+ */
1102
+ export const zNesUserActionsCapabilities = z.object({
1103
+ maxCount: defaultOnError(z
1104
+ .int()
1105
+ .gte(0)
1106
+ .max(4294967295, {
1107
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
1108
+ })
1109
+ .nullish(), () => undefined),
1110
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1111
+ });
1112
+ /**
1113
+ * Capabilities for open files context.
1114
+ */
1115
+ export const zNesOpenFilesCapabilities = z.object({
1116
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1117
+ });
1118
+ /**
1119
+ * Capabilities for diagnostics context.
1120
+ */
1121
+ export const zNesDiagnosticsCapabilities = z.object({
1122
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1123
+ });
1124
+ /**
1125
+ * Context capabilities the agent wants attached to each suggestion request.
1126
+ */
1127
+ export const zNesContextCapabilities = z.object({
1128
+ recentFiles: defaultOnError(zNesRecentFilesCapabilities.nullish(), () => undefined),
1129
+ relatedSnippets: defaultOnError(zNesRelatedSnippetsCapabilities.nullish(), () => undefined),
1130
+ editHistory: defaultOnError(zNesEditHistoryCapabilities.nullish(), () => undefined),
1131
+ userActions: defaultOnError(zNesUserActionsCapabilities.nullish(), () => undefined),
1132
+ openFiles: defaultOnError(zNesOpenFilesCapabilities.nullish(), () => undefined),
1133
+ diagnostics: defaultOnError(zNesDiagnosticsCapabilities.nullish(), () => undefined),
1134
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1135
+ });
1136
+ /**
1137
+ * NES capabilities advertised by the agent during initialization.
1138
+ *
1139
+ * Supplying `{}` means the agent supports the NES method surface. Omitted or
1140
+ * `null` both mean the agent does not advertise support for `nes*` methods.
1141
+ */
1142
+ export const zNesCapabilities = z.object({
1143
+ events: defaultOnError(zNesEventCapabilities.nullish(), () => undefined),
1144
+ context: defaultOnError(zNesContextCapabilities.nullish(), () => undefined),
1145
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1146
+ });
1147
+ /**
1148
+ * The encoding used for character offsets in positions.
1149
+ *
1150
+ * Follows the same conventions as LSP 3.17. The default is UTF-16.
1151
+ */
1152
+ export const zPositionEncodingKind = z.union([
1153
+ z.literal("utf-16"),
1154
+ z.literal("utf-32"),
1155
+ z.literal("utf-8"),
1156
+ ]);
1157
+ /**
1158
+ * Capabilities supported by the agent.
1159
+ *
1160
+ * Advertised during initialization to inform the client about
1161
+ * available features and content types.
1162
+ *
1163
+ * See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#agent-capabilities)
1164
+ */
1165
+ export const zAgentCapabilities = z.object({
1166
+ session: defaultOnError(zSessionCapabilities.nullish(), () => undefined),
1167
+ auth: defaultOnError(zAgentAuthCapabilities.nullish(), () => undefined),
1168
+ providers: defaultOnError(zProvidersCapabilities.nullish(), () => undefined),
1169
+ nes: defaultOnError(zNesCapabilities.nullish(), () => undefined),
1170
+ positionEncoding: defaultOnError(zPositionEncodingKind.nullish(), () => undefined),
1171
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1172
+ });
1173
+ /**
1174
+ * Typed identifier used for auth method values on the wire.
1175
+ */
1176
+ export const zAuthMethodId = z.string();
1177
+ /**
1178
+ * **UNSTABLE**
1179
+ *
1180
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1181
+ *
1182
+ * Describes a single environment variable for an [`AuthMethodEnvVar`] authentication method.
1183
+ *
1184
+ * @experimental
1185
+ */
1186
+ export const zAuthEnvVar = z.object({
1187
+ name: z.string(),
1188
+ label: defaultOnError(z.string().nullish(), () => undefined),
1189
+ secret: defaultOnError(z.boolean().optional().default(true), () => true),
1190
+ optional: defaultOnError(z.boolean().optional().default(false), () => false),
1191
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1192
+ });
1193
+ /**
1194
+ * **UNSTABLE**
1195
+ *
1196
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1197
+ *
1198
+ * Environment variable authentication method.
1199
+ *
1200
+ * The user provides credentials that the client passes to the agent as environment variables.
1201
+ *
1202
+ * @experimental
1203
+ */
1204
+ export const zAuthMethodEnvVar = z.object({
1205
+ methodId: zAuthMethodId,
1206
+ name: z.string(),
1207
+ description: defaultOnError(z.string().nullish(), () => undefined),
1208
+ vars: requiredDefaultOnError(vecSkipError(zAuthEnvVar), () => []),
1209
+ link: defaultOnError(z.url().nullish(), () => undefined),
1210
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1211
+ });
1212
+ /**
1213
+ * An environment variable to set when launching an MCP server.
1214
+ */
1215
+ export const zEnvVariable = z.object({
1216
+ name: z.string(),
1217
+ value: z.string(),
1218
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1219
+ });
1220
+ /**
1221
+ * **UNSTABLE**
1222
+ *
1223
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1224
+ *
1225
+ * Terminal-based authentication method.
1226
+ *
1227
+ * The client runs an interactive terminal for the user to authenticate via a TUI.
1228
+ *
1229
+ * @experimental
1230
+ */
1231
+ export const zAuthMethodTerminal = z.object({
1232
+ methodId: zAuthMethodId,
1233
+ name: z.string(),
1234
+ description: defaultOnError(z.string().nullish(), () => undefined),
1235
+ args: defaultOnError(vecSkipError(z.string()).optional(), () => []),
1236
+ env: defaultOnError(vecSkipError(zEnvVariable).optional(), () => []),
1237
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1238
+ });
1239
+ /**
1240
+ * Agent handles authentication itself.
1241
+ *
1242
+ * The `type` discriminator value is `agent`.
1243
+ */
1244
+ export const zAuthMethodAgent = z.object({
1245
+ methodId: zAuthMethodId,
1246
+ name: z.string(),
1247
+ description: defaultOnError(z.string().nullish(), () => undefined),
1248
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1249
+ });
1250
+ /**
1251
+ * Describes an available authentication method.
1252
+ *
1253
+ * The `type` field acts as the discriminator in the serialized JSON form.
1254
+ *
1255
+ * Custom variants (unknown `type` values) keep their extra
1256
+ * properties exactly as received; unlike known variants, those keys
1257
+ * bypass lenient-field salvage and arrive unvalidated.
1258
+ */
1259
+ export const zAuthMethod = preserveCustomPayload(z.union([
1260
+ zAuthMethodEnvVar.and(z.object({
1261
+ type: z.literal("env_var"),
1262
+ })),
1263
+ zAuthMethodTerminal.and(z.object({
1264
+ type: z.literal("terminal"),
1265
+ })),
1266
+ zAuthMethodAgent.and(z.object({
1267
+ type: z.literal("agent"),
1268
+ })),
1269
+ excludeKnownTags(z.object({
1270
+ type: z.string(),
1271
+ methodId: zAuthMethodId,
1272
+ name: z.string(),
1273
+ description: defaultOnError(z.string().nullish(), () => undefined),
1274
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1275
+ }), "type", ["agent", "env_var", "terminal"]),
1276
+ ]), "type", ["agent", "env_var", "terminal"]);
1277
+ /**
1278
+ * Response to the `initialize` method.
1279
+ *
1280
+ * Contains the negotiated protocol version and agent capabilities.
1281
+ *
1282
+ * See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v2/draft/initialization)
1283
+ */
1284
+ export const zInitializeResponse = z.object({
1285
+ protocolVersion: zProtocolVersion,
1286
+ info: zImplementation,
1287
+ capabilities: defaultOnError(zAgentCapabilities.optional().default({}), () => ({})),
1288
+ authMethods: defaultOnError(vecSkipError(zAuthMethod).optional(), () => []),
1289
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1290
+ });
1291
+ /**
1292
+ * Response to the `auth/login` method.
1293
+ */
1294
+ export const zLoginAuthResponse = z.object({
1295
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1296
+ });
1297
+ /**
1298
+ * **UNSTABLE**
1299
+ *
1300
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1301
+ *
1302
+ * Unique identifier for a configurable LLM provider.
1303
+ *
1304
+ * @experimental
1305
+ */
1306
+ export const zProviderId = z.string();
1307
+ /**
1308
+ * **UNSTABLE**
1309
+ *
1310
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1311
+ *
1312
+ * Well-known API protocol identifiers for LLM providers.
1313
+ *
1314
+ * Agents and clients MUST handle unknown protocol identifiers gracefully.
1315
+ *
1316
+ * Protocol names beginning with `_` are free for custom use, like other ACP extension methods.
1317
+ * Protocol names that do not begin with `_` are reserved for the ACP spec.
1318
+ *
1319
+ * @experimental
1320
+ */
1321
+ export const zLlmProtocol = z.union([
1322
+ z.literal("anthropic"),
1323
+ z.literal("openai"),
1324
+ z.literal("azure"),
1325
+ z.literal("vertex"),
1326
+ z.literal("bedrock"),
1327
+ z.string(),
1328
+ ]);
1329
+ /**
1330
+ * **UNSTABLE**
1331
+ *
1332
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1333
+ *
1334
+ * Current effective non-secret routing configuration for a provider.
1335
+ *
1336
+ * @experimental
1337
+ */
1338
+ export const zProviderCurrentConfig = z.object({
1339
+ apiType: zLlmProtocol,
1340
+ baseUrl: z.url(),
1341
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1342
+ });
1343
+ /**
1344
+ * **UNSTABLE**
1345
+ *
1346
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1347
+ *
1348
+ * Information about a configurable LLM provider.
1349
+ *
1350
+ * @experimental
1351
+ */
1352
+ export const zProviderInfo = z.object({
1353
+ providerId: zProviderId,
1354
+ supported: requiredDefaultOnError(vecSkipError(zLlmProtocol), () => []),
1355
+ required: z.boolean(),
1356
+ current: zProviderCurrentConfig.nullish(),
1357
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1358
+ });
1359
+ /**
1360
+ * **UNSTABLE**
1361
+ *
1362
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1363
+ *
1364
+ * Response to `providers/list`.
1365
+ *
1366
+ * @experimental
1367
+ */
1368
+ export const zListProvidersResponse = z.object({
1369
+ providers: z.array(zProviderInfo),
1370
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1371
+ });
1372
+ /**
1373
+ * **UNSTABLE**
1374
+ *
1375
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1376
+ *
1377
+ * Response to `providers/set`.
1378
+ *
1379
+ * @experimental
1380
+ */
1381
+ export const zSetProviderResponse = z.object({
1382
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1383
+ });
1384
+ /**
1385
+ * **UNSTABLE**
1386
+ *
1387
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1388
+ *
1389
+ * Response to `providers/disable`.
1390
+ *
1391
+ * @experimental
1392
+ */
1393
+ export const zDisableProviderResponse = z.object({
1394
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1395
+ });
1396
+ /**
1397
+ * Response to the `auth/logout` method.
1398
+ */
1399
+ export const zLogoutAuthResponse = z.object({
1400
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1401
+ });
1402
+ /**
1403
+ * Unique identifier for a session configuration option.
1404
+ */
1405
+ export const zSessionConfigId = z.string();
1406
+ /**
1407
+ * Semantic category for a session configuration option.
1408
+ *
1409
+ * This is intended to help Clients distinguish broadly common selectors (e.g. model selector vs
1410
+ * session mode selector vs thought/reasoning level) for UX purposes (keyboard shortcuts, icons,
1411
+ * placement). It MUST NOT be required for correctness. Clients MUST handle missing or unknown
1412
+ * categories gracefully.
1413
+ *
1414
+ * Category names beginning with `_` are free for custom use, like other ACP extension methods.
1415
+ * Category names that do not begin with `_` are reserved for the ACP spec.
1416
+ */
1417
+ export const zSessionConfigOptionCategory = z.union([
1418
+ z.literal("mode"),
1419
+ z.literal("model"),
1420
+ z.literal("model_config"),
1421
+ z.literal("thought_level"),
1422
+ z.string(),
1423
+ ]);
1424
+ /**
1425
+ * Unique identifier for a session configuration option value.
1426
+ */
1427
+ export const zSessionConfigValueId = z.string();
1428
+ /**
1429
+ * A possible value for a session configuration option.
1430
+ */
1431
+ export const zSessionConfigSelectOption = z.object({
1432
+ value: zSessionConfigValueId,
1433
+ name: z.string(),
1434
+ description: defaultOnError(z.string().nullish(), () => undefined),
1435
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1436
+ });
1437
+ /**
1438
+ * Unique identifier for a session configuration option value group.
1439
+ */
1440
+ export const zSessionConfigGroupId = z.string();
1441
+ /**
1442
+ * A group of possible values for a session configuration option.
1443
+ */
1444
+ export const zSessionConfigSelectGroup = z.object({
1445
+ groupId: zSessionConfigGroupId,
1446
+ name: z.string(),
1447
+ options: requiredDefaultOnError(vecSkipError(zSessionConfigSelectOption), () => []),
1448
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1449
+ });
1450
+ /**
1451
+ * Possible values for a session configuration option.
1452
+ */
1453
+ export const zSessionConfigSelectOptions = z.union([
1454
+ z.array(zSessionConfigSelectOption),
1455
+ z.array(zSessionConfigSelectGroup),
1456
+ ]);
1457
+ /**
1458
+ * A single-value selector (dropdown) session configuration option payload.
1459
+ */
1460
+ export const zSessionConfigSelect = z.object({
1461
+ currentValue: zSessionConfigValueId,
1462
+ options: zSessionConfigSelectOptions,
1463
+ });
1464
+ /**
1465
+ * A boolean on/off toggle session configuration option payload.
1466
+ */
1467
+ export const zSessionConfigBoolean = z.object({
1468
+ currentValue: z.boolean(),
1469
+ });
1470
+ /**
1471
+ * A session configuration option selector and its current state.
1472
+ *
1473
+ * Custom variants (unknown `type` values) keep their extra
1474
+ * properties exactly as received; unlike known variants, those keys
1475
+ * bypass lenient-field salvage and arrive unvalidated.
1476
+ */
1477
+ export const zSessionConfigOption = preserveCustomPayload(z.intersection(z.union([
1478
+ zSessionConfigSelect.and(z.object({
1479
+ type: z.literal("select"),
1480
+ })),
1481
+ zSessionConfigBoolean.and(z.object({
1482
+ type: z.literal("boolean"),
1483
+ })),
1484
+ excludeKnownTags(z.object({
1485
+ type: z.string(),
1486
+ }), "type", ["boolean", "select"]),
1487
+ ]), z.object({
1488
+ configId: zSessionConfigId,
1489
+ name: z.string(),
1490
+ description: defaultOnError(z.string().nullish(), () => undefined),
1491
+ category: defaultOnError(zSessionConfigOptionCategory.nullish(), () => undefined),
1492
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1493
+ })), "type", ["boolean", "select"]);
1494
+ /**
1495
+ * Response from creating a new session.
1496
+ *
1497
+ * See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/draft/session-setup#creating-a-session)
1498
+ */
1499
+ export const zNewSessionResponse = z.object({
1500
+ sessionId: zSessionId,
1501
+ configOptions: defaultOnError(vecSkipError(zSessionConfigOption).optional(), () => []),
1502
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1503
+ });
1504
+ /**
1505
+ * Information about a session returned by session/list
1506
+ */
1507
+ export const zSessionInfo = z.object({
1508
+ sessionId: zSessionId,
1509
+ cwd: zAbsolutePath,
1510
+ additionalDirectories: defaultOnError(vecSkipError(zAbsolutePath).optional(), () => []),
1511
+ title: defaultOnError(z.string().nullish(), () => undefined),
1512
+ updatedAt: defaultOnError(z.iso.datetime({ offset: true }).nullish(), () => undefined),
1513
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1514
+ });
1515
+ /**
1516
+ * An opaque cursor used to paginate `session/list` results.
1517
+ */
1518
+ export const zSessionListCursor = z.string();
1519
+ /**
1520
+ * Response from listing sessions.
1521
+ */
1522
+ export const zListSessionsResponse = z.object({
1523
+ sessions: requiredDefaultOnError(vecSkipError(zSessionInfo), () => []),
1524
+ nextCursor: defaultOnError(zSessionListCursor.nullish(), () => undefined),
1525
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1526
+ });
1527
+ /**
1528
+ * Response from deleting a session.
1529
+ */
1530
+ export const zDeleteSessionResponse = z.object({
1531
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1532
+ });
1533
+ /**
1534
+ * **UNSTABLE**
1535
+ *
1536
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1537
+ *
1538
+ * Response from forking an existing session.
1539
+ *
1540
+ * @experimental
1541
+ */
1542
+ export const zForkSessionResponse = z.object({
1543
+ sessionId: zSessionId,
1544
+ configOptions: defaultOnError(vecSkipError(zSessionConfigOption).optional(), () => []),
1545
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1546
+ });
1547
+ /**
1548
+ * Response from resuming an existing session.
1549
+ */
1550
+ export const zResumeSessionResponse = z.object({
1551
+ configOptions: defaultOnError(vecSkipError(zSessionConfigOption).optional(), () => []),
1552
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1553
+ });
1554
+ /**
1555
+ * Response from closing a session.
1556
+ */
1557
+ export const zCloseSessionResponse = z.object({
1558
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1559
+ });
1560
+ /**
1561
+ * Response to `session/set_config_option` method.
1562
+ */
1563
+ export const zSetSessionConfigOptionResponse = z.object({
1564
+ configOptions: requiredDefaultOnError(vecSkipError(zSessionConfigOption), () => []),
1565
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1566
+ });
1567
+ /**
1568
+ * Response acknowledging that a user prompt was accepted.
1569
+ *
1570
+ * This response does not indicate that the agent has finished processing.
1571
+ * Processing and completion are reported through `state_update` session updates.
1572
+ *
1573
+ * See protocol docs: [Prompt Accepted](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#2-prompt-accepted)
1574
+ */
1575
+ export const zPromptResponse = z.object({
1576
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1577
+ });
1578
+ /**
1579
+ * Response to `nes/start`.
1580
+ */
1581
+ export const zStartNesResponse = z.object({
1582
+ sessionId: zSessionId,
1583
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1584
+ });
1585
+ /**
1586
+ * **UNSTABLE**
1587
+ *
1588
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1589
+ *
1590
+ * Unique identifier for an NES suggestion.
1591
+ *
1592
+ * @experimental
1593
+ */
1594
+ export const zNesSuggestionId = z.string();
1595
+ /**
1596
+ * A zero-based position in a text document.
1597
+ *
1598
+ * The meaning of `character` depends on the negotiated position encoding.
1599
+ */
1600
+ export const zPosition = z.object({
1601
+ line: z.int().gte(0).max(4294967295, {
1602
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
1603
+ }),
1604
+ character: z.int().gte(0).max(4294967295, {
1605
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
1606
+ }),
1607
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1608
+ });
1609
+ /**
1610
+ * A range in a text document, expressed as start and end positions.
1611
+ */
1612
+ export const zRange = z.object({
1613
+ start: zPosition,
1614
+ end: zPosition,
1615
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1616
+ });
1617
+ /**
1618
+ * A text edit within a suggestion.
1619
+ */
1620
+ export const zNesTextEdit = z.object({
1621
+ range: zRange,
1622
+ newText: z.string(),
1623
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1624
+ });
1625
+ /**
1626
+ * A text edit suggestion.
1627
+ */
1628
+ export const zNesEditSuggestion = z.object({
1629
+ suggestionId: zNesSuggestionId,
1630
+ uri: z.url(),
1631
+ edits: z.array(zNesTextEdit).min(1),
1632
+ cursorPosition: defaultOnError(zPosition.nullish(), () => undefined),
1633
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1634
+ });
1635
+ /**
1636
+ * A jump-to-location suggestion.
1637
+ */
1638
+ export const zNesJumpSuggestion = z.object({
1639
+ suggestionId: zNesSuggestionId,
1640
+ uri: z.url(),
1641
+ position: zPosition,
1642
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1643
+ });
1644
+ /**
1645
+ * A rename symbol suggestion.
1646
+ */
1647
+ export const zNesRenameSuggestion = z.object({
1648
+ suggestionId: zNesSuggestionId,
1649
+ uri: z.url(),
1650
+ position: zPosition,
1651
+ newName: z.string(),
1652
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1653
+ });
1654
+ /**
1655
+ * A search-and-replace suggestion.
1656
+ */
1657
+ export const zNesSearchAndReplaceSuggestion = z.object({
1658
+ suggestionId: zNesSuggestionId,
1659
+ uri: z.url(),
1660
+ search: z.string(),
1661
+ replace: z.string(),
1662
+ isRegex: z.boolean().nullish(),
1663
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1664
+ });
1665
+ /**
1666
+ * A suggestion returned by the agent.
1667
+ *
1668
+ * Custom variants (unknown `kind` values) keep their extra
1669
+ * properties exactly as received; unlike known variants, those keys
1670
+ * bypass lenient-field salvage and arrive unvalidated.
1671
+ */
1672
+ export const zNesSuggestion = preserveCustomPayload(z.union([
1673
+ zNesEditSuggestion.and(z.object({
1674
+ kind: z.literal("edit"),
1675
+ })),
1676
+ zNesJumpSuggestion.and(z.object({
1677
+ kind: z.literal("jump"),
1678
+ })),
1679
+ zNesRenameSuggestion.and(z.object({
1680
+ kind: z.literal("rename"),
1681
+ })),
1682
+ zNesSearchAndReplaceSuggestion.and(z.object({
1683
+ kind: z.literal("searchAndReplace"),
1684
+ })),
1685
+ excludeKnownTags(z.object({
1686
+ kind: z.string(),
1687
+ suggestionId: zNesSuggestionId,
1688
+ }), "kind", ["edit", "jump", "rename", "searchAndReplace"]),
1689
+ ]), "kind", ["edit", "jump", "rename", "searchAndReplace"]);
1690
+ /**
1691
+ * Response to `nes/suggest`.
1692
+ */
1693
+ export const zSuggestNesResponse = z.object({
1694
+ suggestions: z.array(zNesSuggestion),
1695
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1696
+ });
1697
+ /**
1698
+ * Response from closing an NES session.
1699
+ */
1700
+ export const zCloseNesResponse = z.object({
1701
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1702
+ });
1703
+ /**
1704
+ * Allows for sending an arbitrary response to an [`ExtRequest`] that is not part of the ACP spec.
1705
+ * Extension methods provide a way to add custom functionality while maintaining
1706
+ * protocol compatibility.
1707
+ *
1708
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)
1709
+ */
1710
+ export const zExtResponse = z.unknown();
1711
+ /**
1712
+ * **UNSTABLE**
1713
+ *
1714
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1715
+ *
1716
+ * Response to `mcp/message`.
1717
+ *
1718
+ * This is the inner MCP response result payload. Any JSON value is valid.
1719
+ *
1720
+ * @experimental
1721
+ */
1722
+ export const zMessageMcpResponse = z.unknown();
1723
+ /**
1724
+ * Predefined error codes for common JSON-RPC and ACP-specific errors.
1725
+ *
1726
+ * These codes follow the JSON-RPC 2.0 specification for standard errors
1727
+ * and use the reserved range (-32000 to -32099) for protocol-specific errors.
1728
+ */
1729
+ export const zErrorCode = z.union([
1730
+ z.literal(-32700),
1731
+ z.literal(-32600),
1732
+ z.literal(-32601),
1733
+ z.literal(-32602),
1734
+ z.literal(-32603),
1735
+ z.literal(-32800),
1736
+ z.literal(-32000),
1737
+ z.literal(-32002),
1738
+ z
1739
+ .int()
1740
+ .min(-2147483648, {
1741
+ error: "Invalid value: Expected int32 to be >= -2147483648",
1742
+ })
1743
+ .max(2147483647, {
1744
+ error: "Invalid value: Expected int32 to be <= 2147483647",
1745
+ }),
1746
+ ]);
1747
+ /**
1748
+ * JSON-RPC error object.
1749
+ *
1750
+ * Represents an error that occurred during method execution, following the
1751
+ * JSON-RPC 2.0 error object specification with optional additional data.
1752
+ *
1753
+ * See protocol docs: [JSON-RPC Error Object](https://www.jsonrpc.org/specification#error_object)
1754
+ */
1755
+ export const zError = z.object({
1756
+ code: zErrorCode,
1757
+ message: z.string(),
1758
+ data: defaultOnError(z.unknown().optional(), () => undefined),
1759
+ });
1760
+ /**
1761
+ * A JSON-RPC response object.
1762
+ */
1763
+ export const zAgentResponse = z.union([
1764
+ z.object({
1765
+ id: zRequestId,
1766
+ result: z.union([
1767
+ zInitializeResponse,
1768
+ zLoginAuthResponse,
1769
+ zListProvidersResponse,
1770
+ zSetProviderResponse,
1771
+ zDisableProviderResponse,
1772
+ zLogoutAuthResponse,
1773
+ zNewSessionResponse,
1774
+ zListSessionsResponse,
1775
+ zDeleteSessionResponse,
1776
+ zForkSessionResponse,
1777
+ zResumeSessionResponse,
1778
+ zCloseSessionResponse,
1779
+ zSetSessionConfigOptionResponse,
1780
+ zPromptResponse,
1781
+ zStartNesResponse,
1782
+ zSuggestNesResponse,
1783
+ zCloseNesResponse,
1784
+ zExtResponse,
1785
+ zMessageMcpResponse,
1786
+ ]),
1787
+ }),
1788
+ z.object({
1789
+ id: zRequestId,
1790
+ error: zError,
1791
+ }),
1792
+ ]);
1793
+ /**
1794
+ * Unique identifier for a message within a session.
1795
+ */
1796
+ export const zMessageId = z.string();
1797
+ /**
1798
+ * A streamed item of message content.
1799
+ */
1800
+ export const zContentChunk = z.object({
1801
+ messageId: zMessageId,
1802
+ content: zContentBlock,
1803
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1804
+ });
1805
+ /**
1806
+ * A user message upsert.
1807
+ *
1808
+ * Only [`UserMessage::message_id`] is required. `content` has patch semantics:
1809
+ * an omitted field leaves existing message content unchanged, `null` clears the
1810
+ * value, and a concrete array replaces the previous value. For a new
1811
+ * `messageId`, omitted fields use client defaults. `content` is replaced as a
1812
+ * whole array; send `[]` or `null` to clear it.
1813
+ *
1814
+ * Message updates and chunks are applied in the order they are received. When
1815
+ * a `user_message` update includes `content`, that array replaces any content
1816
+ * previously accumulated for the message, including content from earlier
1817
+ * chunks. Later chunks with the same `messageId` append to the current
1818
+ * content.
1819
+ */
1820
+ export const zUserMessage = z.object({
1821
+ messageId: zMessageId,
1822
+ content: defaultOnError(vecSkipError(zContentBlock).nullish(), () => undefined),
1823
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1824
+ });
1825
+ /**
1826
+ * An agent message upsert.
1827
+ *
1828
+ * Only [`AgentMessage::message_id`] is required. `content` has patch semantics:
1829
+ * an omitted field leaves existing message content unchanged, `null` clears the
1830
+ * value, and a concrete array replaces the previous value. For a new
1831
+ * `messageId`, omitted fields use client defaults. `content` is replaced as a
1832
+ * whole array; send `[]` or `null` to clear it.
1833
+ *
1834
+ * Message updates and chunks are applied in the order they are received. When
1835
+ * an `agent_message` update includes `content`, that array replaces any
1836
+ * content previously accumulated for the message, including content from
1837
+ * earlier chunks. Later chunks with the same `messageId` append to the current
1838
+ * content.
1839
+ */
1840
+ export const zAgentMessage = z.object({
1841
+ messageId: zMessageId,
1842
+ content: defaultOnError(vecSkipError(zContentBlock).nullish(), () => undefined),
1843
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1844
+ });
1845
+ /**
1846
+ * An agent thought or reasoning message upsert.
1847
+ *
1848
+ * Only [`AgentThought::message_id`] is required. `content` has patch semantics:
1849
+ * an omitted field leaves existing thought content unchanged, `null` clears the
1850
+ * value, and a concrete array replaces the previous value. For a new
1851
+ * `messageId`, omitted fields use client defaults. `content` is replaced as a
1852
+ * whole array; send `[]` or `null` to clear it.
1853
+ *
1854
+ * Message updates and chunks are applied in the order they are received. When
1855
+ * an `agent_thought` update includes `content`, that array replaces any
1856
+ * content previously accumulated for the thought, including content from
1857
+ * earlier chunks. Later chunks with the same `messageId` append to the current
1858
+ * content.
1859
+ */
1860
+ export const zAgentThought = z.object({
1861
+ messageId: zMessageId,
1862
+ content: defaultOnError(vecSkipError(zContentBlock).nullish(), () => undefined),
1863
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1864
+ });
1865
+ /**
1866
+ * Foreground work is in progress.
1867
+ */
1868
+ export const zRunningStateUpdate = z.object({
1869
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1870
+ });
1871
+ /**
1872
+ * Reasons why an agent stops active session work.
1873
+ *
1874
+ * See protocol docs: [Stop Reasons](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#stop-reasons)
1875
+ */
1876
+ export const zStopReason = z.union([
1877
+ z.literal("end_turn"),
1878
+ z.literal("max_tokens"),
1879
+ z.literal("max_turn_requests"),
1880
+ z.literal("refusal"),
1881
+ z.literal("cancelled"),
1882
+ z.string(),
1883
+ ]);
1884
+ /**
1885
+ * **UNSTABLE**
1886
+ *
1887
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
1888
+ *
1889
+ * Token usage information for completed session work.
1890
+ *
1891
+ * @experimental
1892
+ */
1893
+ export const zUsage = z.object({
1894
+ totalTokens: z.number(),
1895
+ inputTokens: z.number(),
1896
+ outputTokens: z.number(),
1897
+ thoughtTokens: defaultOnError(z.number().nullish(), () => undefined),
1898
+ cachedReadTokens: defaultOnError(z.number().nullish(), () => undefined),
1899
+ cachedWriteTokens: defaultOnError(z.number().nullish(), () => undefined),
1900
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1901
+ });
1902
+ /**
1903
+ * The agent is ready to process a new prompt.
1904
+ */
1905
+ export const zIdleStateUpdate = z.object({
1906
+ stopReason: defaultOnError(zStopReason.nullish(), () => undefined),
1907
+ usage: defaultOnError(zUsage.nullish(), () => undefined),
1908
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1909
+ });
1910
+ /**
1911
+ * Foreground work is blocked on user action.
1912
+ */
1913
+ export const zRequiresActionStateUpdate = z.object({
1914
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1915
+ });
1916
+ /**
1917
+ * The state of the agent's foreground work has changed.
1918
+ *
1919
+ * Background activity can continue and emit other `session/update` notifications
1920
+ * while `idle`. Those notifications do not change this state.
1921
+ *
1922
+ * Custom variants (unknown `state` values) keep their extra
1923
+ * properties exactly as received; unlike known variants, those keys
1924
+ * bypass lenient-field salvage and arrive unvalidated.
1925
+ */
1926
+ export const zStateUpdate = preserveCustomPayload(z.union([
1927
+ zRunningStateUpdate.and(z.object({
1928
+ state: z.literal("running"),
1929
+ })),
1930
+ zIdleStateUpdate.and(z.object({
1931
+ state: z.literal("idle"),
1932
+ })),
1933
+ zRequiresActionStateUpdate.and(z.object({
1934
+ state: z.literal("requires_action"),
1935
+ })),
1936
+ excludeKnownTags(z.object({
1937
+ state: z.string(),
1938
+ }), "state", ["idle", "requires_action", "running"]),
1939
+ ]), "state", ["idle", "requires_action", "running"]);
1940
+ /**
1941
+ * A streamed item of tool-call content.
1942
+ *
1943
+ * Tool-call content chunks append one [`ToolCallContent`] item to the current
1944
+ * content for the matching [`ToolCallId`]. Agents can use
1945
+ * [`ToolCallUpdate::content`] when they need to replace the whole content
1946
+ * collection instead.
1947
+ */
1948
+ export const zToolCallContentChunk = z.object({
1949
+ toolCallId: zToolCallId,
1950
+ content: zToolCallContent,
1951
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1952
+ });
1953
+ /**
1954
+ * An authoritative replacement snapshot of terminal output bytes.
1955
+ */
1956
+ export const zTerminalOutput = z.object({
1957
+ data: z.string(),
1958
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1959
+ });
1960
+ /**
1961
+ * Exit information for an agent-owned terminal.
1962
+ *
1963
+ * The presence of this object marks the terminal as exited, even when neither
1964
+ * an exit code nor a signal is known.
1965
+ */
1966
+ export const zTerminalExitStatus = z.object({
1967
+ exitCode: defaultOnError(z
1968
+ .int()
1969
+ .gte(0)
1970
+ .max(4294967295, {
1971
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
1972
+ })
1973
+ .nullish(), () => undefined),
1974
+ signal: defaultOnError(z.string().nullish(), () => undefined),
1975
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1976
+ });
1977
+ /**
1978
+ * An upsert for the stored state of an agent-owned terminal.
1979
+ *
1980
+ * Only [`TerminalUpdate::terminal_id`] is required. Other fields have patch
1981
+ * semantics: omitted fields leave the stored value unchanged, `null` clears
1982
+ * it, and concrete values replace it. When the terminal ID is new, omitted
1983
+ * fields start unknown.
1984
+ */
1985
+ export const zTerminalUpdate = z.object({
1986
+ terminalId: zTerminalId,
1987
+ command: defaultOnError(z.string().nullish(), () => undefined),
1988
+ cwd: defaultOnError(zAbsolutePath.nullish(), () => undefined),
1989
+ output: defaultOnError(zTerminalOutput.nullish(), () => undefined),
1990
+ exitStatus: defaultOnError(zTerminalExitStatus.nullish(), () => undefined),
1991
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
1992
+ });
1993
+ /**
1994
+ * A chunk of bytes appended to an agent-owned terminal's output.
1995
+ */
1996
+ export const zTerminalOutputChunk = z.object({
1997
+ terminalId: zTerminalId,
1998
+ data: z.string(),
1999
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2000
+ });
2001
+ /**
2002
+ * Unique identifier for a plan within a session.
2003
+ */
2004
+ export const zPlanId = z.string();
2005
+ /**
2006
+ * Priority levels for plan entries.
2007
+ *
2008
+ * Used to indicate the relative importance or urgency of different
2009
+ * tasks in the execution plan.
2010
+ * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v2/draft/agent-plan#plan-entries)
2011
+ */
2012
+ export const zPlanEntryPriority = z.union([
2013
+ z.literal("high"),
2014
+ z.literal("medium"),
2015
+ z.literal("low"),
2016
+ z.string(),
2017
+ ]);
2018
+ /**
2019
+ * Status of a plan entry in the execution flow.
2020
+ *
2021
+ * Tracks the lifecycle of each task from planning through completion.
2022
+ * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v2/draft/agent-plan#plan-entries)
2023
+ */
2024
+ export const zPlanEntryStatus = z.union([
2025
+ z.literal("pending"),
2026
+ z.literal("in_progress"),
2027
+ z.literal("completed"),
2028
+ z.literal("cancelled"),
2029
+ z.string(),
2030
+ ]);
2031
+ /**
2032
+ * A single entry in the execution plan.
2033
+ *
2034
+ * Represents a task or goal that the assistant intends to accomplish
2035
+ * as part of fulfilling the user's request.
2036
+ * See protocol docs: [Plan Entries](https://agentclientprotocol.com/protocol/v2/draft/agent-plan#plan-entries)
2037
+ */
2038
+ export const zPlanEntry = z.object({
2039
+ content: z.string(),
2040
+ priority: zPlanEntryPriority,
2041
+ status: zPlanEntryStatus,
2042
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2043
+ });
2044
+ /**
2045
+ * A plan represented as structured entries.
2046
+ */
2047
+ export const zPlanItems = z.object({
2048
+ planId: zPlanId,
2049
+ entries: requiredDefaultOnError(vecSkipError(zPlanEntry), () => []),
2050
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2051
+ });
2052
+ /**
2053
+ * **UNSTABLE**
2054
+ *
2055
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2056
+ *
2057
+ * A plan represented by a file URI.
2058
+ *
2059
+ * @experimental
2060
+ */
2061
+ export const zPlanFile = z.object({
2062
+ planId: zPlanId,
2063
+ uri: z.url(),
2064
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2065
+ });
2066
+ /**
2067
+ * **UNSTABLE**
2068
+ *
2069
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2070
+ *
2071
+ * A plan represented as raw markdown content.
2072
+ *
2073
+ * @experimental
2074
+ */
2075
+ export const zPlanMarkdown = z.object({
2076
+ planId: zPlanId,
2077
+ content: z.string(),
2078
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2079
+ });
2080
+ /**
2081
+ * Updated content for a plan.
2082
+ *
2083
+ * Custom variants (unknown `type` values) keep their extra
2084
+ * properties exactly as received; unlike known variants, those keys
2085
+ * bypass lenient-field salvage and arrive unvalidated.
2086
+ */
2087
+ export const zPlanUpdateContent = preserveCustomPayload(z.union([
2088
+ zPlanItems.and(z.object({
2089
+ type: z.literal("items"),
2090
+ })),
2091
+ zPlanFile.and(z.object({
2092
+ type: z.literal("file"),
2093
+ })),
2094
+ zPlanMarkdown.and(z.object({
2095
+ type: z.literal("markdown"),
2096
+ })),
2097
+ excludeKnownTags(z.object({
2098
+ type: z.string(),
2099
+ planId: zPlanId,
2100
+ }), "type", ["file", "items", "markdown"]),
2101
+ ]), "type", ["file", "items", "markdown"]);
2102
+ /**
2103
+ * A content update for a plan identified by ID.
2104
+ */
2105
+ export const zPlanUpdate = z.object({
2106
+ plan: zPlanUpdateContent,
2107
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2108
+ });
2109
+ /**
2110
+ * **UNSTABLE**
2111
+ *
2112
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2113
+ *
2114
+ * Removal notice for a plan identified by ID.
2115
+ *
2116
+ * @experimental
2117
+ */
2118
+ export const zPlanRemoved = z.object({
2119
+ planId: zPlanId,
2120
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2121
+ });
2122
+ /**
2123
+ * All text that was typed after the command name is provided as input.
2124
+ */
2125
+ export const zTextCommandInput = z.object({
2126
+ hint: z.string(),
2127
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2128
+ });
2129
+ /**
2130
+ * The input specification for a command.
2131
+ *
2132
+ * Custom variants (unknown `type` values) keep their extra
2133
+ * properties exactly as received; unlike known variants, those keys
2134
+ * bypass lenient-field salvage and arrive unvalidated.
2135
+ */
2136
+ export const zAvailableCommandInput = preserveCustomPayload(z.union([
2137
+ zTextCommandInput.and(z.object({
2138
+ type: z.literal("text"),
2139
+ })),
2140
+ excludeKnownTags(z.object({
2141
+ type: z.string(),
2142
+ }), "type", ["text"]),
2143
+ ]), "type", ["text"]);
2144
+ /**
2145
+ * Information about a command.
2146
+ */
2147
+ export const zAvailableCommand = z.object({
2148
+ name: z.string(),
2149
+ description: z.string(),
2150
+ input: defaultOnError(zAvailableCommandInput.nullish(), () => undefined),
2151
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2152
+ });
2153
+ /**
2154
+ * Available commands are ready or have changed
2155
+ */
2156
+ export const zAvailableCommandsUpdate = z.object({
2157
+ availableCommands: requiredDefaultOnError(vecSkipError(zAvailableCommand), () => []),
2158
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2159
+ });
2160
+ /**
2161
+ * Session configuration options have been updated.
2162
+ */
2163
+ export const zConfigOptionUpdate = z.object({
2164
+ configOptions: requiredDefaultOnError(vecSkipError(zSessionConfigOption), () => []),
2165
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2166
+ });
2167
+ /**
2168
+ * Update to session metadata. All fields are optional to support partial updates.
2169
+ *
2170
+ * Agents send this notification to update session information like title or custom metadata.
2171
+ * This allows clients to display dynamic session names and track session state changes.
2172
+ *
2173
+ * Omitted fields leave the existing session info unchanged. `null` clears the
2174
+ * corresponding value.
2175
+ */
2176
+ export const zSessionInfoUpdate = z.object({
2177
+ title: defaultOnError(z.string().nullish(), () => undefined),
2178
+ updatedAt: defaultOnError(z.iso.datetime({ offset: true }).nullish(), () => undefined),
2179
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2180
+ });
2181
+ /**
2182
+ * Cost information for a session.
2183
+ */
2184
+ export const zCost = z.object({
2185
+ amount: z.number(),
2186
+ currency: z.string().regex(/^[A-Z]{3}$/),
2187
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2188
+ });
2189
+ /**
2190
+ * Context window and cost update for a session.
2191
+ */
2192
+ export const zUsageUpdate = z.object({
2193
+ used: z.number(),
2194
+ size: z.number(),
2195
+ cost: defaultOnError(zCost.nullish(), () => undefined),
2196
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2197
+ });
2198
+ /**
2199
+ * Different types of updates that can be sent while a session exists.
2200
+ *
2201
+ * These updates report messages, progress, and other session activity.
2202
+ *
2203
+ * See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#3-agent-reports-output)
2204
+ *
2205
+ * Custom variants (unknown `sessionUpdate` values) keep their extra
2206
+ * properties exactly as received; unlike known variants, those keys
2207
+ * bypass lenient-field salvage and arrive unvalidated.
2208
+ */
2209
+ export const zSessionUpdate = preserveCustomPayload(z.union([
2210
+ zContentChunk.and(z.object({
2211
+ sessionUpdate: z.literal("user_message_chunk"),
2212
+ })),
2213
+ zUserMessage.and(z.object({
2214
+ sessionUpdate: z.literal("user_message"),
2215
+ })),
2216
+ zContentChunk.and(z.object({
2217
+ sessionUpdate: z.literal("agent_message_chunk"),
2218
+ })),
2219
+ zAgentMessage.and(z.object({
2220
+ sessionUpdate: z.literal("agent_message"),
2221
+ })),
2222
+ zContentChunk.and(z.object({
2223
+ sessionUpdate: z.literal("agent_thought_chunk"),
2224
+ })),
2225
+ zAgentThought.and(z.object({
2226
+ sessionUpdate: z.literal("agent_thought"),
2227
+ })),
2228
+ zStateUpdate.and(z.object({
2229
+ sessionUpdate: z.literal("state_update"),
2230
+ })),
2231
+ zToolCallContentChunk.and(z.object({
2232
+ sessionUpdate: z.literal("tool_call_content_chunk"),
2233
+ })),
2234
+ zToolCallUpdate.and(z.object({
2235
+ sessionUpdate: z.literal("tool_call_update"),
2236
+ })),
2237
+ zTerminalUpdate.and(z.object({
2238
+ sessionUpdate: z.literal("terminal_update"),
2239
+ })),
2240
+ zTerminalOutputChunk.and(z.object({
2241
+ sessionUpdate: z.literal("terminal_output_chunk"),
2242
+ })),
2243
+ zPlanUpdate.and(z.object({
2244
+ sessionUpdate: z.literal("plan_update"),
2245
+ })),
2246
+ zPlanRemoved.and(z.object({
2247
+ sessionUpdate: z.literal("plan_removed"),
2248
+ })),
2249
+ zAvailableCommandsUpdate.and(z.object({
2250
+ sessionUpdate: z.literal("available_commands_update"),
2251
+ })),
2252
+ zConfigOptionUpdate.and(z.object({
2253
+ sessionUpdate: z.literal("config_option_update"),
2254
+ })),
2255
+ zSessionInfoUpdate.and(z.object({
2256
+ sessionUpdate: z.literal("session_info_update"),
2257
+ })),
2258
+ zUsageUpdate.and(z.object({
2259
+ sessionUpdate: z.literal("usage_update"),
2260
+ })),
2261
+ excludeKnownTags(z.object({
2262
+ sessionUpdate: z.string(),
2263
+ }), "sessionUpdate", [
2264
+ "agent_message",
2265
+ "agent_message_chunk",
2266
+ "agent_thought",
2267
+ "agent_thought_chunk",
2268
+ "available_commands_update",
2269
+ "config_option_update",
2270
+ "plan_removed",
2271
+ "plan_update",
2272
+ "session_info_update",
2273
+ "state_update",
2274
+ "terminal_output_chunk",
2275
+ "terminal_update",
2276
+ "tool_call_content_chunk",
2277
+ "tool_call_update",
2278
+ "usage_update",
2279
+ "user_message",
2280
+ "user_message_chunk",
2281
+ ]),
2282
+ ]), "sessionUpdate", [
2283
+ "agent_message",
2284
+ "agent_message_chunk",
2285
+ "agent_thought",
2286
+ "agent_thought_chunk",
2287
+ "available_commands_update",
2288
+ "config_option_update",
2289
+ "plan_removed",
2290
+ "plan_update",
2291
+ "session_info_update",
2292
+ "state_update",
2293
+ "terminal_output_chunk",
2294
+ "terminal_update",
2295
+ "tool_call_content_chunk",
2296
+ "tool_call_update",
2297
+ "usage_update",
2298
+ "user_message",
2299
+ "user_message_chunk",
2300
+ ]);
2301
+ /**
2302
+ * Notification containing a session update from the agent.
2303
+ *
2304
+ * Agents can send session updates at any point while the session exists.
2305
+ *
2306
+ * See protocol docs: [Agent Reports Output](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#3-agent-reports-output)
2307
+ */
2308
+ export const zUpdateSessionNotification = z.object({
2309
+ sessionId: zSessionId,
2310
+ update: zSessionUpdate,
2311
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2312
+ });
2313
+ /**
2314
+ * **UNSTABLE**
2315
+ *
2316
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2317
+ *
2318
+ * Notification sent by the agent when a URL-based elicitation is complete.
2319
+ *
2320
+ * @experimental
2321
+ */
2322
+ export const zCompleteElicitationNotification = z.object({
2323
+ elicitationId: zElicitationId,
2324
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2325
+ });
2326
+ /**
2327
+ * **UNSTABLE**
2328
+ *
2329
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2330
+ *
2331
+ * Notification parameters for `mcp/message`.
2332
+ *
2333
+ * This is used when the wrapped MCP message is a notification and the outer JSON-RPC
2334
+ * envelope has no `id`.
2335
+ *
2336
+ * @experimental
2337
+ */
2338
+ export const zMessageMcpNotification = z.object({
2339
+ connectionId: zMcpConnectionId,
2340
+ method: z.string(),
2341
+ params: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2342
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2343
+ });
2344
+ /**
2345
+ * Allows the Agent to send an arbitrary notification that is not part of the ACP spec.
2346
+ * Extension notifications provide a way to send one-way messages for custom functionality
2347
+ * while maintaining protocol compatibility.
2348
+ *
2349
+ * See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/draft/extensibility)
2350
+ */
2351
+ export const zExtNotification = z.unknown();
2352
+ /**
2353
+ * A JSON-RPC notification object.
2354
+ */
2355
+ export const zAgentNotification = z.object({
2356
+ method: z.string(),
2357
+ params: z
2358
+ .union([
2359
+ zUpdateSessionNotification,
2360
+ zCompleteElicitationNotification,
2361
+ zMessageMcpNotification,
2362
+ zExtNotification,
2363
+ ])
2364
+ .nullish(),
2365
+ });
2366
+ /**
2367
+ * **UNSTABLE**
2368
+ *
2369
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2370
+ *
2371
+ * Capabilities for terminal authentication methods.
2372
+ *
2373
+ * Supplying `{}` means the client supports terminal authentication methods.
2374
+ *
2375
+ * @experimental
2376
+ */
2377
+ export const zTerminalAuthCapabilities = z.object({
2378
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2379
+ });
2380
+ /**
2381
+ * **UNSTABLE**
2382
+ *
2383
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2384
+ *
2385
+ * Authentication capabilities supported by the client.
2386
+ *
2387
+ * Advertised during initialization to inform the agent which authentication
2388
+ * method types the client can handle. This governs opt-in types that require
2389
+ * additional client-side support.
2390
+ *
2391
+ * @experimental
2392
+ */
2393
+ export const zAuthCapabilities = z.object({
2394
+ terminal: defaultOnError(zTerminalAuthCapabilities.nullish(), () => undefined),
2395
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2396
+ });
2397
+ /**
2398
+ * **UNSTABLE**
2399
+ *
2400
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2401
+ *
2402
+ * Form-based elicitation capabilities.
2403
+ *
2404
+ * Supplying `{}` means the client supports form-based elicitation.
2405
+ *
2406
+ * @experimental
2407
+ */
2408
+ export const zElicitationFormCapabilities = z.object({
2409
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2410
+ });
2411
+ /**
2412
+ * **UNSTABLE**
2413
+ *
2414
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2415
+ *
2416
+ * URL-based elicitation capabilities.
2417
+ *
2418
+ * Supplying `{}` means the client supports URL-based elicitation.
2419
+ *
2420
+ * @experimental
2421
+ */
2422
+ export const zElicitationUrlCapabilities = z.object({
2423
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2424
+ });
2425
+ /**
2426
+ * **UNSTABLE**
2427
+ *
2428
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2429
+ *
2430
+ * Elicitation capabilities supported by the client.
2431
+ *
2432
+ * @experimental
2433
+ */
2434
+ export const zElicitationCapabilities = z.object({
2435
+ form: defaultOnError(zElicitationFormCapabilities.nullish(), () => undefined),
2436
+ url: defaultOnError(zElicitationUrlCapabilities.nullish(), () => undefined),
2437
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2438
+ });
2439
+ /**
2440
+ * Marker for jump suggestion support.
2441
+ */
2442
+ export const zNesJumpCapabilities = z.object({
2443
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2444
+ });
2445
+ /**
2446
+ * Marker for rename suggestion support.
2447
+ */
2448
+ export const zNesRenameCapabilities = z.object({
2449
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2450
+ });
2451
+ /**
2452
+ * Marker for search and replace suggestion support.
2453
+ */
2454
+ export const zNesSearchAndReplaceCapabilities = z.object({
2455
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2456
+ });
2457
+ /**
2458
+ * NES capabilities advertised by the client during initialization.
2459
+ */
2460
+ export const zClientNesCapabilities = z.object({
2461
+ jump: defaultOnError(zNesJumpCapabilities.nullish(), () => undefined),
2462
+ rename: defaultOnError(zNesRenameCapabilities.nullish(), () => undefined),
2463
+ searchAndReplace: defaultOnError(zNesSearchAndReplaceCapabilities.nullish(), () => undefined),
2464
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2465
+ });
2466
+ /**
2467
+ * Capabilities supported by the client.
2468
+ *
2469
+ * Advertised during initialization to inform the agent about
2470
+ * available features and methods.
2471
+ *
2472
+ * See protocol docs: [Client Capabilities](https://agentclientprotocol.com/protocol/v2/draft/initialization#client-capabilities)
2473
+ */
2474
+ export const zClientCapabilities = z.object({
2475
+ auth: defaultOnError(zAuthCapabilities.nullish(), () => undefined),
2476
+ elicitation: defaultOnError(zElicitationCapabilities.nullish(), () => undefined),
2477
+ nes: defaultOnError(zClientNesCapabilities.nullish(), () => undefined),
2478
+ positionEncodings: defaultOnError(vecSkipError(zPositionEncodingKind).optional(), () => []),
2479
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2480
+ });
2481
+ /**
2482
+ * Request parameters for the initialize method.
2483
+ *
2484
+ * Sent by the client to establish connection and negotiate capabilities.
2485
+ *
2486
+ * See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/v2/draft/initialization)
2487
+ */
2488
+ export const zInitializeRequest = z.object({
2489
+ protocolVersion: zProtocolVersion,
2490
+ info: zImplementation,
2491
+ capabilities: defaultOnError(zClientCapabilities.optional().default({}), () => ({})),
2492
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2493
+ });
2494
+ /**
2495
+ * Request parameters for the `auth/login` method.
2496
+ *
2497
+ * Specifies which authentication method to use.
2498
+ *
2499
+ * Agents MUST support this method when their `initialize` response advertised
2500
+ * at least one valid authentication method. Clients MUST NOT call this method
2501
+ * when `authMethods` was omitted or empty.
2502
+ */
2503
+ export const zLoginAuthRequest = z.object({
2504
+ methodId: zAuthMethodId,
2505
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2506
+ });
2507
+ /**
2508
+ * **UNSTABLE**
2509
+ *
2510
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2511
+ *
2512
+ * Request parameters for `providers/list`.
2513
+ *
2514
+ * @experimental
2515
+ */
2516
+ export const zListProvidersRequest = z.object({
2517
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2518
+ });
2519
+ /**
2520
+ * **UNSTABLE**
2521
+ *
2522
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2523
+ *
2524
+ * Request parameters for `providers/set`.
2525
+ *
2526
+ * Replaces the full configuration for one provider ID.
2527
+ *
2528
+ * @experimental
2529
+ */
2530
+ export const zSetProviderRequest = z.object({
2531
+ providerId: zProviderId,
2532
+ apiType: zLlmProtocol,
2533
+ baseUrl: z.url(),
2534
+ headers: z.record(z.string(), z.string()).optional(),
2535
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2536
+ });
2537
+ /**
2538
+ * **UNSTABLE**
2539
+ *
2540
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2541
+ *
2542
+ * Request parameters for `providers/disable`.
2543
+ *
2544
+ * @experimental
2545
+ */
2546
+ export const zDisableProviderRequest = z.object({
2547
+ providerId: zProviderId,
2548
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2549
+ });
2550
+ /**
2551
+ * Request parameters for the `auth/logout` method.
2552
+ *
2553
+ * Terminates the current authenticated session.
2554
+ *
2555
+ * Agents MUST support this method when their `initialize` response advertised
2556
+ * at least one valid authentication method. Clients MUST NOT call this method
2557
+ * when `authMethods` was omitted or empty.
2558
+ */
2559
+ export const zLogoutAuthRequest = z.object({
2560
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2561
+ });
2562
+ /**
2563
+ * An HTTP header to set when making requests to the MCP server.
2564
+ */
2565
+ export const zHttpHeader = z.object({
2566
+ name: z.string(),
2567
+ value: z.string(),
2568
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2569
+ });
2570
+ /**
2571
+ * HTTP transport configuration for MCP.
2572
+ */
2573
+ export const zMcpServerHttp = z.object({
2574
+ name: z.string(),
2575
+ url: z.url(),
2576
+ headers: z.array(zHttpHeader).optional(),
2577
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2578
+ });
2579
+ /**
2580
+ * **UNSTABLE**
2581
+ *
2582
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2583
+ *
2584
+ * ACP transport configuration for MCP.
2585
+ *
2586
+ * The MCP server is provided by an ACP component and communicates over the ACP channel
2587
+ * using `mcp/connect`, `mcp/message`, and `mcp/disconnect`.
2588
+ *
2589
+ * @experimental
2590
+ */
2591
+ export const zMcpServerAcp = z.object({
2592
+ name: z.string(),
2593
+ serverId: zMcpServerAcpId,
2594
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2595
+ });
2596
+ /**
2597
+ * Stdio transport configuration for MCP.
2598
+ */
2599
+ export const zMcpServerStdio = z.object({
2600
+ name: z.string(),
2601
+ command: zAbsolutePath,
2602
+ args: z.array(z.string()).optional(),
2603
+ env: z.array(zEnvVariable).optional(),
2604
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2605
+ });
2606
+ /**
2607
+ * Configuration for connecting to an MCP (Model Context Protocol) server.
2608
+ *
2609
+ * MCP servers provide tools and context that the agent can use when
2610
+ * processing prompts.
2611
+ *
2612
+ * See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/v2/draft/session-setup#mcp-servers)
2613
+ *
2614
+ * Custom variants (unknown `type` values) keep their extra
2615
+ * properties exactly as received; unlike known variants, those keys
2616
+ * bypass lenient-field salvage and arrive unvalidated.
2617
+ */
2618
+ export const zMcpServer = preserveCustomPayload(z.union([
2619
+ zMcpServerHttp.and(z.object({
2620
+ type: z.literal("http"),
2621
+ })),
2622
+ zMcpServerAcp.and(z.object({
2623
+ type: z.literal("acp"),
2624
+ })),
2625
+ zMcpServerStdio.and(z.object({
2626
+ type: z.literal("stdio"),
2627
+ })),
2628
+ excludeKnownTags(z.object({
2629
+ type: z.string(),
2630
+ }), "type", ["acp", "http", "stdio"]),
2631
+ ]), "type", ["acp", "http", "stdio"]);
2632
+ /**
2633
+ * Request parameters for creating a new session.
2634
+ *
2635
+ * See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol/v2/draft/session-setup#creating-a-session)
2636
+ */
2637
+ export const zNewSessionRequest = z.object({
2638
+ cwd: zAbsolutePath,
2639
+ additionalDirectories: defaultOnError(vecSkipError(zAbsolutePath).optional(), () => []),
2640
+ mcpServers: defaultOnError(vecSkipError(zMcpServer).optional(), () => []),
2641
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2642
+ });
2643
+ /**
2644
+ * Request parameters for listing existing sessions.
2645
+ */
2646
+ export const zListSessionsRequest = z.object({
2647
+ cwd: zAbsolutePath.nullish(),
2648
+ cursor: zSessionListCursor.nullish(),
2649
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2650
+ });
2651
+ /**
2652
+ * Request parameters for deleting an existing session from `session/list`.
2653
+ *
2654
+ * Only available if the Agent supports the `session.delete` capability.
2655
+ */
2656
+ export const zDeleteSessionRequest = z.object({
2657
+ sessionId: zSessionId,
2658
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2659
+ });
2660
+ /**
2661
+ * **UNSTABLE**
2662
+ *
2663
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2664
+ *
2665
+ * Request parameters for forking an existing session.
2666
+ *
2667
+ * Creates a new session based on the context of an existing one, allowing
2668
+ * operations like generating summaries without affecting the original session's history.
2669
+ *
2670
+ * Only available if the Agent supports the `session.fork` capability.
2671
+ *
2672
+ * @experimental
2673
+ */
2674
+ export const zForkSessionRequest = z.object({
2675
+ sessionId: zSessionId,
2676
+ cwd: zAbsolutePath,
2677
+ additionalDirectories: defaultOnError(vecSkipError(zAbsolutePath).optional(), () => []),
2678
+ mcpServers: defaultOnError(vecSkipError(zMcpServer).optional(), () => []),
2679
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2680
+ });
2681
+ /**
2682
+ * Inclusive replay cursor requesting replay from the start of the conversation.
2683
+ */
2684
+ export const zReplayFromStart = z.object({
2685
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2686
+ });
2687
+ /**
2688
+ * Inclusive cursor describing where replayed session history should begin.
2689
+ *
2690
+ * Replay includes the position identified by the cursor.
2691
+ *
2692
+ * Custom variants (unknown `type` values) keep their extra
2693
+ * properties exactly as received; unlike known variants, those keys
2694
+ * bypass lenient-field salvage and arrive unvalidated.
2695
+ */
2696
+ export const zReplayFrom = preserveCustomPayload(z.union([
2697
+ zReplayFromStart.and(z.object({
2698
+ type: z.literal("start"),
2699
+ })),
2700
+ excludeKnownTags(z.object({
2701
+ type: z.string(),
2702
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2703
+ }), "type", ["start"]),
2704
+ ]), "type", ["start"]);
2705
+ /**
2706
+ * Request parameters for resuming an existing session.
2707
+ *
2708
+ * Resumes an existing session and optionally replays prior conversation
2709
+ * history according to `replayFrom`.
2710
+ */
2711
+ export const zResumeSessionRequest = z.object({
2712
+ sessionId: zSessionId,
2713
+ cwd: zAbsolutePath,
2714
+ additionalDirectories: defaultOnError(vecSkipError(zAbsolutePath).optional(), () => []),
2715
+ mcpServers: defaultOnError(vecSkipError(zMcpServer).optional(), () => []),
2716
+ replayFrom: defaultOnError(zReplayFrom.nullish(), () => undefined),
2717
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2718
+ });
2719
+ /**
2720
+ * Request parameters for closing an active session.
2721
+ *
2722
+ * The agent **must** cancel any ongoing work related to the session (treat it
2723
+ * as if `session/cancel` was called) and then free up any resources associated
2724
+ * with the session.
2725
+ */
2726
+ export const zCloseSessionRequest = z.object({
2727
+ sessionId: zSessionId,
2728
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2729
+ });
2730
+ /**
2731
+ * Request parameters for setting a session configuration option.
2732
+ *
2733
+ * Custom variants (unknown `type` values) keep their extra
2734
+ * properties exactly as received; unlike known variants, those keys
2735
+ * bypass lenient-field salvage and arrive unvalidated.
2736
+ */
2737
+ export const zSetSessionConfigOptionRequest = preserveCustomPayload(z.intersection(z.union([
2738
+ z.object({
2739
+ value: zSessionConfigValueId,
2740
+ type: z.literal("id"),
2741
+ }),
2742
+ z.object({
2743
+ value: z.boolean(),
2744
+ type: z.literal("boolean"),
2745
+ }),
2746
+ excludeKnownTags(z.object({
2747
+ type: z.string(),
2748
+ value: z.unknown(),
2749
+ }), "type", ["boolean", "id"]),
2750
+ ]), z.object({
2751
+ sessionId: zSessionId,
2752
+ configId: zSessionConfigId,
2753
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2754
+ })), "type", ["boolean", "id"]);
2755
+ /**
2756
+ * Request parameters for sending a user prompt to the agent.
2757
+ *
2758
+ * Contains the user's message and any additional context.
2759
+ *
2760
+ * See protocol docs: [User Message](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#1-user-message)
2761
+ */
2762
+ export const zPromptRequest = z.object({
2763
+ sessionId: zSessionId,
2764
+ prompt: z.array(zContentBlock),
2765
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2766
+ });
2767
+ /**
2768
+ * A workspace folder.
2769
+ */
2770
+ export const zWorkspaceFolder = z.object({
2771
+ uri: z.url(),
2772
+ name: z.string(),
2773
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2774
+ });
2775
+ /**
2776
+ * Repository metadata for an NES session.
2777
+ */
2778
+ export const zNesRepository = z.object({
2779
+ name: z.string(),
2780
+ owner: z.string(),
2781
+ remoteUrl: z.string(),
2782
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2783
+ });
2784
+ /**
2785
+ * Request to start an NES session.
2786
+ */
2787
+ export const zStartNesRequest = z.object({
2788
+ workspaceUri: defaultOnError(z.url().nullish(), () => undefined),
2789
+ workspaceFolders: z.array(zWorkspaceFolder).nullish(),
2790
+ repository: defaultOnError(zNesRepository.nullish(), () => undefined),
2791
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2792
+ });
2793
+ /**
2794
+ * What triggered the suggestion request.
2795
+ */
2796
+ export const zNesTriggerKind = z.union([
2797
+ z.literal("automatic"),
2798
+ z.literal("diagnostic"),
2799
+ z.literal("manual"),
2800
+ z.string(),
2801
+ ]);
2802
+ /**
2803
+ * A recently accessed file.
2804
+ */
2805
+ export const zNesRecentFile = z.object({
2806
+ uri: z.url(),
2807
+ languageId: z.string(),
2808
+ text: z.string(),
2809
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2810
+ });
2811
+ /**
2812
+ * A code excerpt from a file.
2813
+ */
2814
+ export const zNesExcerpt = z.object({
2815
+ startLine: z.int().gte(0).max(4294967295, {
2816
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
2817
+ }),
2818
+ endLine: z.int().gte(0).max(4294967295, {
2819
+ error: "Invalid value: Expected uint32 to be <= 4294967295",
2820
+ }),
2821
+ text: z.string(),
2822
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2823
+ });
2824
+ /**
2825
+ * A related code snippet from a file.
2826
+ */
2827
+ export const zNesRelatedSnippet = z.object({
2828
+ uri: z.url(),
2829
+ excerpts: z.array(zNesExcerpt),
2830
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2831
+ });
2832
+ /**
2833
+ * An entry in the edit history.
2834
+ */
2835
+ export const zNesEditHistoryEntry = z.object({
2836
+ uri: z.url(),
2837
+ diff: z.string(),
2838
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2839
+ });
2840
+ /**
2841
+ * A user action (typing, cursor movement, etc.).
2842
+ */
2843
+ export const zNesUserAction = z.object({
2844
+ action: z.string(),
2845
+ uri: z.url(),
2846
+ position: zPosition,
2847
+ timestampMs: z.number(),
2848
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2849
+ });
2850
+ /**
2851
+ * An open file in the editor.
2852
+ */
2853
+ export const zNesOpenFile = z.object({
2854
+ uri: z.url(),
2855
+ languageId: z.string(),
2856
+ visibleRange: defaultOnError(zRange.nullish(), () => undefined),
2857
+ lastFocusedMs: defaultOnError(z.number().nullish(), () => undefined),
2858
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2859
+ });
2860
+ /**
2861
+ * Severity of a diagnostic.
2862
+ */
2863
+ export const zNesDiagnosticSeverity = z.union([
2864
+ z.literal("error"),
2865
+ z.literal("warning"),
2866
+ z.literal("information"),
2867
+ z.literal("hint"),
2868
+ z.string(),
2869
+ ]);
2870
+ /**
2871
+ * A diagnostic (error, warning, etc.).
2872
+ */
2873
+ export const zNesDiagnostic = z.object({
2874
+ uri: z.url(),
2875
+ range: zRange,
2876
+ severity: zNesDiagnosticSeverity,
2877
+ message: z.string(),
2878
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2879
+ });
2880
+ /**
2881
+ * Context attached to a suggestion request.
2882
+ */
2883
+ export const zNesSuggestContext = z.object({
2884
+ recentFiles: z.array(zNesRecentFile).nullish(),
2885
+ relatedSnippets: z.array(zNesRelatedSnippet).nullish(),
2886
+ editHistory: z.array(zNesEditHistoryEntry).nullish(),
2887
+ userActions: z.array(zNesUserAction).nullish(),
2888
+ openFiles: z.array(zNesOpenFile).nullish(),
2889
+ diagnostics: z.array(zNesDiagnostic).nullish(),
2890
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2891
+ });
2892
+ /**
2893
+ * Request for a code suggestion.
2894
+ */
2895
+ export const zSuggestNesRequest = z.object({
2896
+ sessionId: zSessionId,
2897
+ uri: z.url(),
2898
+ version: z.number(),
2899
+ position: zPosition,
2900
+ selection: zRange.nullish(),
2901
+ triggerKind: zNesTriggerKind,
2902
+ context: zNesSuggestContext.nullish(),
2903
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2904
+ });
2905
+ /**
2906
+ * Request to close an NES session.
2907
+ *
2908
+ * The agent **must** cancel any ongoing work related to the NES session
2909
+ * and then free up any resources associated with the session.
2910
+ */
2911
+ export const zCloseNesRequest = z.object({
2912
+ sessionId: zSessionId,
2913
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2914
+ });
2915
+ /**
2916
+ * A JSON-RPC request object.
2917
+ */
2918
+ export const zClientRequest = z.object({
2919
+ id: zRequestId,
2920
+ method: z.string(),
2921
+ params: z
2922
+ .union([
2923
+ zInitializeRequest,
2924
+ zLoginAuthRequest,
2925
+ zListProvidersRequest,
2926
+ zSetProviderRequest,
2927
+ zDisableProviderRequest,
2928
+ zLogoutAuthRequest,
2929
+ zNewSessionRequest,
2930
+ zListSessionsRequest,
2931
+ zDeleteSessionRequest,
2932
+ zForkSessionRequest,
2933
+ zResumeSessionRequest,
2934
+ zCloseSessionRequest,
2935
+ zSetSessionConfigOptionRequest,
2936
+ zPromptRequest,
2937
+ zStartNesRequest,
2938
+ zSuggestNesRequest,
2939
+ zCloseNesRequest,
2940
+ zMessageMcpRequest,
2941
+ zExtRequest,
2942
+ ])
2943
+ .nullish(),
2944
+ });
2945
+ /**
2946
+ * The user selected one of the provided options.
2947
+ */
2948
+ export const zSelectedPermissionOutcome = z.object({
2949
+ optionId: zPermissionOptionId,
2950
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2951
+ });
2952
+ /**
2953
+ * The outcome of a permission request.
2954
+ *
2955
+ * Custom variants (unknown `outcome` values) keep their extra
2956
+ * properties exactly as received; unlike known variants, those keys
2957
+ * bypass lenient-field salvage and arrive unvalidated.
2958
+ */
2959
+ export const zRequestPermissionOutcome = preserveCustomPayload(z.union([
2960
+ z.object({
2961
+ outcome: z.literal("cancelled"),
2962
+ }),
2963
+ zSelectedPermissionOutcome.and(z.object({
2964
+ outcome: z.literal("selected"),
2965
+ })),
2966
+ excludeKnownTags(z.object({
2967
+ outcome: z.string(),
2968
+ }), "outcome", ["cancelled", "selected"]),
2969
+ ]), "outcome", ["cancelled", "selected"]);
2970
+ /**
2971
+ * Response to a permission request.
2972
+ */
2973
+ export const zRequestPermissionResponse = z.object({
2974
+ outcome: zRequestPermissionOutcome,
2975
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
2976
+ });
2977
+ /**
2978
+ * Allowed wire representations for [`ElicitationContentValue`].
2979
+ */
2980
+ export const zElicitationContentValue = z.union([
2981
+ z.string(),
2982
+ z.number(),
2983
+ z.number(),
2984
+ z.boolean(),
2985
+ z.array(z.string()),
2986
+ ]);
2987
+ /**
2988
+ * **UNSTABLE**
2989
+ *
2990
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
2991
+ *
2992
+ * The user accepted the elicitation and provided content.
2993
+ *
2994
+ * @experimental
2995
+ */
2996
+ export const zElicitationAcceptAction = z.object({
2997
+ content: z.record(z.string(), zElicitationContentValue).nullish(),
2998
+ });
2999
+ /**
3000
+ * **UNSTABLE**
3001
+ *
3002
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
3003
+ *
3004
+ * Response from the client to an elicitation request.
3005
+ *
3006
+ * @experimental
3007
+ *
3008
+ * Custom variants (unknown `action` values) keep their extra
3009
+ * properties exactly as received; unlike known variants, those keys
3010
+ * bypass lenient-field salvage and arrive unvalidated.
3011
+ */
3012
+ export const zCreateElicitationResponse = preserveCustomPayload(z.intersection(z.union([
3013
+ zElicitationAcceptAction.and(z.object({
3014
+ action: z.literal("accept"),
3015
+ })),
3016
+ z.object({
3017
+ action: z.literal("decline"),
3018
+ }),
3019
+ z.object({
3020
+ action: z.literal("cancel"),
3021
+ }),
3022
+ excludeKnownTags(z.object({
3023
+ action: z.string(),
3024
+ }), "action", ["accept", "cancel", "decline"]),
3025
+ ]), z.object({
3026
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3027
+ })), "action", ["accept", "cancel", "decline"]);
3028
+ /**
3029
+ * **UNSTABLE**
3030
+ *
3031
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
3032
+ *
3033
+ * Response to `mcp/connect`.
3034
+ *
3035
+ * @experimental
3036
+ */
3037
+ export const zConnectMcpResponse = z.object({
3038
+ connectionId: zMcpConnectionId,
3039
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3040
+ });
3041
+ /**
3042
+ * **UNSTABLE**
3043
+ *
3044
+ * This capability is not part of the spec yet, and may be removed or changed at any point.
3045
+ *
3046
+ * Response to `mcp/disconnect`.
3047
+ *
3048
+ * @experimental
3049
+ */
3050
+ export const zDisconnectMcpResponse = z.object({
3051
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3052
+ });
3053
+ /**
3054
+ * A JSON-RPC response object.
3055
+ */
3056
+ export const zClientResponse = z.union([
3057
+ z.object({
3058
+ id: zRequestId,
3059
+ result: z.union([
3060
+ zRequestPermissionResponse,
3061
+ zCreateElicitationResponse,
3062
+ zConnectMcpResponse,
3063
+ zDisconnectMcpResponse,
3064
+ zMessageMcpResponse,
3065
+ zExtResponse,
3066
+ ]),
3067
+ }),
3068
+ z.object({
3069
+ id: zRequestId,
3070
+ error: zError,
3071
+ }),
3072
+ ]);
3073
+ /**
3074
+ * Notification to cancel ongoing operations for a session.
3075
+ *
3076
+ * See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/prompt-lifecycle#cancellation)
3077
+ */
3078
+ export const zCancelSessionNotification = z.object({
3079
+ sessionId: zSessionId,
3080
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3081
+ });
3082
+ /**
3083
+ * Notification sent when a file is opened in the editor.
3084
+ */
3085
+ export const zDidOpenDocumentNotification = z.object({
3086
+ sessionId: zSessionId,
3087
+ uri: z.url(),
3088
+ languageId: z.string(),
3089
+ version: z.number(),
3090
+ text: z.string(),
3091
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3092
+ });
3093
+ /**
3094
+ * A content change event for a document.
3095
+ *
3096
+ * When `range` is `None`, `text` is the full content of the document.
3097
+ * When `range` is `Some`, `text` replaces the given range.
3098
+ */
3099
+ export const zTextDocumentContentChangeEvent = z.object({
3100
+ range: zRange.nullish(),
3101
+ text: z.string(),
3102
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3103
+ });
3104
+ /**
3105
+ * Notification sent when a file is edited.
3106
+ */
3107
+ export const zDidChangeDocumentNotification = z.object({
3108
+ sessionId: zSessionId,
3109
+ uri: z.url(),
3110
+ version: z.number(),
3111
+ contentChanges: requiredDefaultOnError(vecSkipError(zTextDocumentContentChangeEvent), () => []),
3112
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3113
+ });
3114
+ /**
3115
+ * Notification sent when a file is closed.
3116
+ */
3117
+ export const zDidCloseDocumentNotification = z.object({
3118
+ sessionId: zSessionId,
3119
+ uri: z.url(),
3120
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3121
+ });
3122
+ /**
3123
+ * Notification sent when a file is saved.
3124
+ */
3125
+ export const zDidSaveDocumentNotification = z.object({
3126
+ sessionId: zSessionId,
3127
+ uri: z.url(),
3128
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3129
+ });
3130
+ /**
3131
+ * Notification sent when a file becomes the active editor tab.
3132
+ */
3133
+ export const zDidFocusDocumentNotification = z.object({
3134
+ sessionId: zSessionId,
3135
+ uri: z.url(),
3136
+ version: z.number(),
3137
+ position: zPosition,
3138
+ visibleRange: zRange,
3139
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3140
+ });
3141
+ /**
3142
+ * Notification sent when a suggestion is accepted.
3143
+ */
3144
+ export const zAcceptNesNotification = z.object({
3145
+ sessionId: zSessionId,
3146
+ suggestionId: zNesSuggestionId,
3147
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3148
+ });
3149
+ /**
3150
+ * The reason a suggestion was rejected.
3151
+ */
3152
+ export const zNesRejectReason = z.union([
3153
+ z.literal("rejected"),
3154
+ z.literal("ignored"),
3155
+ z.literal("replaced"),
3156
+ z.literal("cancelled"),
3157
+ z.string(),
3158
+ ]);
3159
+ /**
3160
+ * Notification sent when a suggestion is rejected.
3161
+ */
3162
+ export const zRejectNesNotification = z.object({
3163
+ sessionId: zSessionId,
3164
+ suggestionId: zNesSuggestionId,
3165
+ reason: defaultOnError(zNesRejectReason.nullish(), () => undefined),
3166
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3167
+ });
3168
+ /**
3169
+ * A JSON-RPC notification object.
3170
+ */
3171
+ export const zClientNotification = z.object({
3172
+ method: z.string(),
3173
+ params: z
3174
+ .union([
3175
+ zCancelSessionNotification,
3176
+ zDidOpenDocumentNotification,
3177
+ zDidChangeDocumentNotification,
3178
+ zDidCloseDocumentNotification,
3179
+ zDidSaveDocumentNotification,
3180
+ zDidFocusDocumentNotification,
3181
+ zAcceptNesNotification,
3182
+ zRejectNesNotification,
3183
+ zMessageMcpNotification,
3184
+ zExtNotification,
3185
+ ])
3186
+ .nullish(),
3187
+ });
3188
+ /**
3189
+ * Notification to cancel an ongoing request.
3190
+ *
3191
+ * See protocol docs: [Cancellation](https://agentclientprotocol.com/protocol/v2/draft/cancellation)
3192
+ */
3193
+ export const zCancelRequestNotification = z.object({
3194
+ requestId: zRequestId,
3195
+ _meta: defaultOnError(z.record(z.string(), z.unknown()).nullish(), () => undefined),
3196
+ });
3197
+ /**
3198
+ * A JSON-RPC notification object.
3199
+ */
3200
+ export const zProtocolLevelNotification = z.object({
3201
+ method: z.string(),
3202
+ params: zCancelRequestNotification.nullish(),
3203
+ });
3204
+ //# sourceMappingURL=zod.gen.js.map