eve 0.71.2 → 0.72.0

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 (470) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +22 -6
  3. package/dist/src/acp/adapter.js +1 -1
  4. package/dist/src/ai/decide.d.ts +7 -0
  5. package/dist/src/ai/decide.js +1 -0
  6. package/dist/src/channel/conversation-context.d.ts +4 -1
  7. package/dist/src/channel/invoke-tool.d.ts +41 -0
  8. package/dist/src/channel/invoke-tool.js +1 -0
  9. package/dist/src/channel/routes.d.ts +3 -0
  10. package/dist/src/chunks/{use-eve-agent-CFCaYnrI.js → use-eve-agent-C1GYGCtb.js} +698 -388
  11. package/dist/src/chunks/{use-eve-agent-DcDhXNv1.js → use-eve-agent-hZJ7CB8t.js} +698 -388
  12. package/dist/src/cli/commands/integration-setup.js +1 -1
  13. package/dist/src/cli/commands/registry.js +1 -1
  14. package/dist/src/cli/commands/trace-detail.d.ts +1 -1
  15. package/dist/src/cli/commands/trace-detail.js +1 -1
  16. package/dist/src/cli/dev/tui/runner.js +1 -1
  17. package/dist/src/cli/dev/tui/setup-flow.d.ts +1 -0
  18. package/dist/src/cli/dev/tui/setup-panel.d.ts +1 -0
  19. package/dist/src/cli/dev/tui/setup-panel.js +2 -1
  20. package/dist/src/cli/dev/tui/traces/trace-conversation.d.ts +2 -2
  21. package/dist/src/cli/dev/tui/traces/trace-conversation.js +2 -2
  22. package/dist/src/cli/dev/tui/transcript-parts.d.ts +2 -1
  23. package/dist/src/cli/dev/tui/transcript-parts.js +1 -1
  24. package/dist/src/cli/dev/tui/transcript.js +1 -1
  25. package/dist/src/cli/dev/tui/tui-prompter.js +1 -1
  26. package/dist/src/client/conversation-projection.d.ts +4 -0
  27. package/dist/src/client/conversation-projection.js +1 -0
  28. package/dist/src/client/conversation-reducer.js +1 -1
  29. package/dist/src/client/conversation-state.d.ts +5 -26
  30. package/dist/src/client/conversation-state.js +1 -1
  31. package/dist/src/client/index.d.ts +1 -0
  32. package/dist/src/client/index.js +1 -1
  33. package/dist/src/client/message-action-parts.d.ts +1 -11
  34. package/dist/src/client/message-action-parts.js +1 -1
  35. package/dist/src/client/message-reducer.d.ts +3 -1
  36. package/dist/src/client/message-reducer.js +1 -1
  37. package/dist/src/client/session-utils.js +1 -1
  38. package/dist/src/client/session.js +1 -1
  39. package/dist/src/client/tool-call-state.d.ts +23 -0
  40. package/dist/src/client/tool-call-state.js +1 -0
  41. package/dist/src/client/tool-part-state.d.ts +7 -0
  42. package/dist/src/client/tool-part-state.js +1 -0
  43. package/dist/src/compiled/.vendor-stamp.json +10 -10
  44. package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +1453 -1358
  45. package/dist/src/compiled/@ai-sdk/anthropic/index.js +1 -2
  46. package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +172 -163
  47. package/dist/src/compiled/@ai-sdk/code-mode/index.js +15 -20
  48. package/dist/src/compiled/@ai-sdk/google/index.d.ts +772 -733
  49. package/dist/src/compiled/@ai-sdk/google/index.js +6 -8
  50. package/dist/src/compiled/@ai-sdk/mcp/index.d.ts +887 -790
  51. package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
  52. package/dist/src/compiled/@ai-sdk/openai/index.d.ts +1722 -1691
  53. package/dist/src/compiled/@ai-sdk/openai/index.js +3 -14
  54. package/dist/src/compiled/@ai-sdk/otel/index.d.ts +216 -159
  55. package/dist/src/compiled/@ai-sdk/otel/index.js +3 -3
  56. package/dist/src/compiled/@ai-sdk/provider/index.d.ts +7542 -7271
  57. package/dist/src/compiled/@ai-sdk/provider/index.js +1 -3
  58. package/dist/src/compiled/@ai-sdk/provider-utils/index.d.ts +1799 -1600
  59. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  60. package/dist/src/compiled/_chunks/workflow/dist-DXLdlucM.js +15 -0
  61. package/dist/src/compiled/_chunks/workflow/experimental-decision-BrfWf6-n.js +3 -0
  62. package/dist/src/compiler/extension-compatibility.d.ts +36 -20
  63. package/dist/src/compiler/extension-compatibility.js +1 -1
  64. package/dist/src/compiler/manifest.js +1 -1
  65. package/dist/src/context/build-dynamic-tools.js +1 -1
  66. package/dist/src/context/caller-scope.d.ts +7 -0
  67. package/dist/src/context/caller-scope.js +1 -0
  68. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  69. package/dist/src/context/dynamic-tool-metadata.d.ts +1 -0
  70. package/dist/src/context/providers/session.js +1 -1
  71. package/dist/src/evals/define-eval.d.ts +1 -1
  72. package/dist/src/evals/judge.d.ts +1 -1
  73. package/dist/src/evals/judge.js +2 -2
  74. package/dist/src/evals/types.d.ts +8 -8
  75. package/dist/src/execution/cancel-descendant-turns-step.d.ts +1 -0
  76. package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
  77. package/dist/src/execution/cancelled-model-call-batch.js +1 -1
  78. package/dist/src/execution/coordination-dispatch-shared.d.ts +2 -1
  79. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  80. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  81. package/dist/src/execution/durable-session-read.d.ts +5 -0
  82. package/dist/src/execution/durable-session-read.js +1 -0
  83. package/dist/src/execution/durable-session-store.d.ts +4 -10
  84. package/dist/src/execution/durable-session-store.js +1 -1
  85. package/dist/src/execution/dynamic-connections.d.ts +3 -3
  86. package/dist/src/execution/dynamic-connections.js +1 -1
  87. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  88. package/dist/src/execution/invoke-tool.d.ts +35 -0
  89. package/dist/src/execution/invoke-tool.js +1 -0
  90. package/dist/src/execution/legacy-session/interrupt-step.js +1 -1
  91. package/dist/src/execution/legacy-session/snapshot.d.ts +3 -0
  92. package/dist/src/execution/legacy-session/snapshot.js +1 -1
  93. package/dist/src/execution/model-call-batching.js +1 -1
  94. package/dist/src/execution/node-step.d.ts +2 -0
  95. package/dist/src/execution/node-step.js +1 -1
  96. package/dist/src/execution/proxied-deliver-step.js +1 -1
  97. package/dist/src/execution/publish-session-events.d.ts +8 -0
  98. package/dist/src/execution/publish-session-events.js +1 -1
  99. package/dist/src/execution/sandbox/active-handles.d.ts +6 -0
  100. package/dist/src/execution/sandbox/active-handles.js +1 -1
  101. package/dist/src/execution/sandbox/ensure.js +1 -1
  102. package/dist/src/execution/session/active-turn.js +1 -1
  103. package/dist/src/execution/session/answer-caller.d.ts +15 -0
  104. package/dist/src/execution/session/answer-caller.js +1 -0
  105. package/dist/src/execution/session/checkpoint-migrations.js +1 -1
  106. package/dist/src/execution/session/finalization.js +1 -1
  107. package/dist/src/execution/session/handoff-steps.d.ts +3 -1
  108. package/dist/src/execution/session/handoff-steps.js +1 -1
  109. package/dist/src/execution/session/handoff.d.ts +1 -1
  110. package/dist/src/execution/session/handoff.js +1 -1
  111. package/dist/src/execution/session/pending-turn-state.d.ts +8 -3
  112. package/dist/src/execution/session/pending-turn-state.js +1 -1
  113. package/dist/src/execution/session/task-tool-tracing-step.d.ts +5 -0
  114. package/dist/src/execution/session/task-tool-tracing-step.js +1 -0
  115. package/dist/src/execution/session/turn-step-result.js +1 -1
  116. package/dist/src/execution/session/turn-step.js +1 -1
  117. package/dist/src/execution/session/turn-waiting-step.js +1 -1
  118. package/dist/src/execution/session/turn.d.ts +1 -0
  119. package/dist/src/execution/session/turn.js +1 -1
  120. package/dist/src/execution/settle-cancelled-turn-step.d.ts +4 -6
  121. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  122. package/dist/src/execution/tasks/start.d.ts +3 -3
  123. package/dist/src/execution/tasks/start.js +1 -1
  124. package/dist/src/execution/tasks/steps.d.ts +1 -1
  125. package/dist/src/execution/tasks/steps.js +1 -1
  126. package/dist/src/execution/terminal-session-completion-step.d.ts +7 -0
  127. package/dist/src/execution/terminal-session-completion-step.js +1 -1
  128. package/dist/src/execution/terminal-session-failure-step.js +1 -1
  129. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  130. package/dist/src/execution/tools/connection-tools.js +1 -1
  131. package/dist/src/execution/tools/workflow/authorization-completion.js +1 -1
  132. package/dist/src/execution/tools/workflow/harness-definition.js +1 -1
  133. package/dist/src/execution/tools/workflow/step-execution.js +1 -1
  134. package/dist/src/execution/tools/workflow/step.js +1 -1
  135. package/dist/src/execution/tools/workflow/withdraw-step.d.ts +7 -9
  136. package/dist/src/execution/tools/workflow/withdraw-step.js +1 -1
  137. package/dist/src/execution/workflow-runtime.js +1 -1
  138. package/dist/src/execution/workflow-trace-context.d.ts +2 -2
  139. package/dist/src/harness/authorization.d.ts +4 -2
  140. package/dist/src/harness/authorization.js +1 -1
  141. package/dist/src/harness/{compaction.js → compaction/engine.js} +1 -1
  142. package/dist/src/harness/compaction/step.d.ts +46 -0
  143. package/dist/src/harness/compaction/step.js +1 -0
  144. package/dist/src/harness/coordination.d.ts +32 -64
  145. package/dist/src/harness/coordination.js +1 -1
  146. package/dist/src/harness/current-messages.d.ts +1 -3
  147. package/dist/src/harness/current-messages.js +1 -1
  148. package/dist/src/harness/emission.d.ts +4 -52
  149. package/dist/src/harness/emission.js +1 -1
  150. package/dist/src/harness/execute-tool.d.ts +1 -0
  151. package/dist/src/harness/final-output.d.ts +5 -0
  152. package/dist/src/harness/final-output.js +1 -1
  153. package/dist/src/harness/hitl/approvals.d.ts +115 -0
  154. package/dist/src/harness/hitl/approvals.js +1 -0
  155. package/dist/src/harness/hitl/approved-call-callers.d.ts +14 -0
  156. package/dist/src/harness/hitl/approved-call-callers.js +1 -0
  157. package/dist/src/harness/hitl/approved-calls.d.ts +37 -0
  158. package/dist/src/harness/hitl/approved-calls.js +1 -0
  159. package/dist/src/harness/{session-limit-continuation.d.ts → hitl/budget-request.d.ts} +3 -1
  160. package/dist/src/harness/hitl/budget-request.js +1 -0
  161. package/dist/src/harness/hitl/budget.d.ts +21 -0
  162. package/dist/src/harness/hitl/budget.js +1 -0
  163. package/dist/src/harness/{approval-candidates.d.ts → hitl/candidates.d.ts} +13 -18
  164. package/dist/src/harness/hitl/candidates.js +1 -0
  165. package/dist/src/harness/hitl/coordinator.js +1 -0
  166. package/dist/src/harness/hitl/delivery.d.ts +37 -0
  167. package/dist/src/harness/hitl/delivery.js +1 -0
  168. package/dist/src/harness/hitl/index.d.ts +49 -0
  169. package/dist/src/harness/hitl/index.js +1 -0
  170. package/dist/src/harness/hitl/intake.d.ts +67 -0
  171. package/dist/src/harness/hitl/intake.js +1 -0
  172. package/dist/src/harness/{stale-input-responses.d.ts → hitl/stale-responses.d.ts} +5 -3
  173. package/dist/src/harness/hitl/stale-responses.js +3 -0
  174. package/dist/src/harness/inline-tool-authorization.d.ts +4 -0
  175. package/dist/src/harness/inline-tool-authorization.js +1 -1
  176. package/dist/src/harness/input-extraction.d.ts +1 -10
  177. package/dist/src/harness/input-extraction.js +1 -1
  178. package/dist/src/harness/input-request-resolution.d.ts +1 -5
  179. package/dist/src/harness/input-request-resolution.js +1 -1
  180. package/dist/src/harness/messages.js +1 -1
  181. package/dist/src/harness/model-call/call.d.ts +78 -0
  182. package/dist/src/harness/model-call/call.js +1 -0
  183. package/dist/src/harness/{model-call-error.d.ts → model-call/errors.d.ts} +1 -1
  184. package/dist/src/harness/model-call/failure.d.ts +52 -0
  185. package/dist/src/harness/model-call/failure.js +1 -0
  186. package/dist/src/harness/model-call/model.d.ts +18 -0
  187. package/dist/src/harness/model-call/model.js +1 -0
  188. package/dist/src/harness/model-call/recovery.d.ts +52 -0
  189. package/dist/src/harness/model-call/recovery.js +1 -0
  190. package/dist/src/harness/model-call/request.d.ts +30 -0
  191. package/dist/src/harness/model-call/request.js +3 -0
  192. package/dist/src/harness/model-call/response.d.ts +39 -0
  193. package/dist/src/harness/model-call/response.js +1 -0
  194. package/dist/src/harness/model-call/retry.d.ts +11 -0
  195. package/dist/src/harness/model-call/retry.js +1 -0
  196. package/dist/src/harness/model-call/run.d.ts +38 -0
  197. package/dist/src/harness/model-call/run.js +1 -0
  198. package/dist/src/harness/model-call/tools.d.ts +48 -0
  199. package/dist/src/harness/model-call/tools.js +1 -0
  200. package/dist/src/harness/model-call/usage.d.ts +23 -0
  201. package/dist/src/harness/model-call/usage.js +1 -0
  202. package/dist/src/harness/nested-actions.d.ts +2 -2
  203. package/dist/src/harness/provider-tools.d.ts +7 -3
  204. package/dist/src/harness/provider-tools.js +1 -1
  205. package/dist/src/harness/proxy-input-requests.d.ts +4 -12
  206. package/dist/src/harness/proxy-input-requests.js +1 -1
  207. package/dist/src/harness/session-machine/commit.d.ts +28 -0
  208. package/dist/src/harness/session-machine/commit.js +1 -0
  209. package/dist/src/harness/session-machine/current.d.ts +29 -0
  210. package/dist/src/harness/session-machine/current.js +1 -0
  211. package/dist/src/harness/session-machine/events.d.ts +6 -0
  212. package/dist/src/harness/session-machine/events.js +1 -0
  213. package/dist/src/harness/session-machine/resolver-events.d.ts +12 -0
  214. package/dist/src/harness/session-machine/resolver-events.js +1 -0
  215. package/dist/src/harness/session-machine/state.d.ts +47 -0
  216. package/dist/src/harness/session-machine/state.js +1 -0
  217. package/dist/src/harness/session-machine/transitions.d.ts +188 -0
  218. package/dist/src/harness/session-machine/transitions.js +1 -0
  219. package/dist/src/harness/session-machine/view.d.ts +58 -0
  220. package/dist/src/harness/session-machine/view.js +1 -0
  221. package/dist/src/harness/step/after-model.d.ts +7 -0
  222. package/dist/src/harness/step/after-model.js +1 -0
  223. package/dist/src/harness/step/context.d.ts +59 -0
  224. package/dist/src/harness/step/context.js +1 -0
  225. package/dist/src/harness/step/intake.d.ts +34 -0
  226. package/dist/src/harness/step/intake.js +1 -0
  227. package/dist/src/harness/step/prompt.d.ts +37 -0
  228. package/dist/src/harness/step/prompt.js +1 -0
  229. package/dist/src/harness/step-hooks.d.ts +8 -13
  230. package/dist/src/harness/step-hooks.js +1 -1
  231. package/dist/src/harness/tool-call-io.d.ts +25 -0
  232. package/dist/src/harness/tool-call-io.js +1 -0
  233. package/dist/src/harness/tool-loop.d.ts +7 -22
  234. package/dist/src/harness/tool-loop.js +1 -3
  235. package/dist/src/harness/tool-model-output.d.ts +1 -2
  236. package/dist/src/harness/tools.d.ts +14 -0
  237. package/dist/src/harness/tools.js +1 -1
  238. package/dist/src/harness/turn-tag-state.d.ts +1 -1
  239. package/dist/src/harness/types.d.ts +6 -0
  240. package/dist/src/instrumentation/ai-sdk-hook-bridge.d.ts +1 -1
  241. package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
  242. package/dist/src/instrumentation/content.js +1 -1
  243. package/dist/src/instrumentation/dispatch.js +1 -1
  244. package/dist/src/instrumentation/lifecycle.d.ts +28 -52
  245. package/dist/src/instrumentation/native-events.d.ts +2 -1
  246. package/dist/src/instrumentation/native-events.js +1 -1
  247. package/dist/src/instrumentation/provider.d.ts +1 -1
  248. package/dist/src/instrumentation/runtime-context.d.ts +2 -3
  249. package/dist/src/instrumentation/runtime-context.js +1 -1
  250. package/dist/src/instrumentation/runtime.d.ts +11 -1
  251. package/dist/src/instrumentation/runtime.js +1 -1
  252. package/dist/src/instrumentation/state.d.ts +6 -1
  253. package/dist/src/instrumentation/state.js +1 -1
  254. package/dist/src/internal/application/package.js +1 -1
  255. package/dist/src/internal/attachments/limited-read.d.ts +16 -0
  256. package/dist/src/internal/attachments/limited-read.js +1 -0
  257. package/dist/src/internal/authored-definition/schema-backed.d.ts +2 -1
  258. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  259. package/dist/src/internal/gateway.d.ts +2 -0
  260. package/dist/src/internal/gateway.js +1 -1
  261. package/dist/src/internal/mcp/published-tools.d.ts +13 -0
  262. package/dist/src/internal/mcp/published-tools.js +1 -0
  263. package/dist/src/internal/mcp/request-trace-context.d.ts +12 -0
  264. package/dist/src/internal/mcp/request-trace-context.js +1 -0
  265. package/dist/src/internal/mcp/streamable-http-server.d.ts +7 -3
  266. package/dist/src/internal/mcp/streamable-http-server.js +1 -1
  267. package/dist/src/internal/model-auth/transport.d.ts +3 -3
  268. package/dist/src/internal/model-auth/transport.js +1 -1
  269. package/dist/src/internal/nitro/host/instrumentation-entry.js +2 -2
  270. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  271. package/dist/src/internal/nitro/routes/channel-request-instrumentation.js +1 -1
  272. package/dist/src/internal/nitro/routes/route-invoke-tool.d.ts +24 -0
  273. package/dist/src/internal/nitro/routes/route-invoke-tool.js +1 -0
  274. package/dist/src/models/auto.d.ts +5 -5
  275. package/dist/src/models/auto.js +2 -2
  276. package/dist/src/protocol/message.d.ts +7 -0
  277. package/dist/src/protocol/message.js +1 -1
  278. package/dist/src/protocol/session-projection.d.ts +159 -0
  279. package/dist/src/protocol/session-projection.js +1 -0
  280. package/dist/src/public/ai/index.d.ts +1 -1
  281. package/dist/src/public/ai/index.js +1 -1
  282. package/dist/src/public/channels/chat-sdk/attachment-refs.d.ts +15 -0
  283. package/dist/src/public/channels/chat-sdk/attachment-refs.js +1 -0
  284. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  285. package/dist/src/public/channels/chat-sdk/messageToUserContent.d.ts +11 -5
  286. package/dist/src/public/channels/chat-sdk/messageToUserContent.js +1 -1
  287. package/dist/src/public/channels/discord/attachments.d.ts +15 -0
  288. package/dist/src/public/channels/discord/attachments.js +1 -0
  289. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  290. package/dist/src/public/channels/discord/inbound.d.ts +13 -0
  291. package/dist/src/public/channels/discord/inbound.js +1 -1
  292. package/dist/src/public/channels/index.d.ts +1 -1
  293. package/dist/src/public/channels/linear/inbound-uploads.d.ts +21 -0
  294. package/dist/src/public/channels/linear/inbound-uploads.js +1 -0
  295. package/dist/src/public/channels/linear/linearChannel.js +1 -1
  296. package/dist/src/public/channels/linq/inboundContent.d.ts +7 -1
  297. package/dist/src/public/channels/linq/inboundContent.js +1 -1
  298. package/dist/src/public/channels/linq/linqChannel.js +1 -1
  299. package/dist/src/public/channels/mcp.d.ts +17 -2
  300. package/dist/src/public/channels/mcp.js +1 -1
  301. package/dist/src/public/channels/photon/attachments.d.ts +21 -0
  302. package/dist/src/public/channels/photon/attachments.js +1 -0
  303. package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
  304. package/dist/src/public/channels/slack/attachments.d.ts +3 -1
  305. package/dist/src/public/channels/slack/attachments.js +1 -1
  306. package/dist/src/public/channels/slack/slackChannel.js +1 -1
  307. package/dist/src/public/channels/teams/attachments.d.ts +4 -4
  308. package/dist/src/public/channels/teams/attachments.js +1 -1
  309. package/dist/src/public/channels/telegram/attachments.js +1 -1
  310. package/dist/src/public/channels/twilio/api.d.ts +7 -0
  311. package/dist/src/public/channels/twilio/api.js +1 -1
  312. package/dist/src/public/channels/twilio/inbound.d.ts +7 -0
  313. package/dist/src/public/channels/twilio/inbound.js +2 -2
  314. package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
  315. package/dist/src/public/definitions/channel.d.ts +1 -0
  316. package/dist/src/public/definitions/connections/mcp.d.ts +1 -1
  317. package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
  318. package/dist/src/public/models/openai/chatgpt/model.js +1 -1
  319. package/dist/src/react/index.d.ts +1 -0
  320. package/dist/src/react/index.js +1 -1
  321. package/dist/src/runtime/agent/mock-model-adapter.js +2 -2
  322. package/dist/src/runtime/connections/mcp-client.js +1 -1
  323. package/dist/src/runtime/connections/scoped-authorization.js +1 -1
  324. package/dist/src/runtime/resolve-tool.js +1 -1
  325. package/dist/src/setup/boxes/resolve-provisioning.d.ts +2 -0
  326. package/dist/src/setup/boxes/resolve-provisioning.js +1 -1
  327. package/dist/src/setup/cli/prompt-ui.d.ts +3 -0
  328. package/dist/src/setup/cli/prompt-ui.js +3 -1
  329. package/dist/src/setup/cli/select-component.d.ts +1 -0
  330. package/dist/src/setup/cli/select-component.js +1 -1
  331. package/dist/src/setup/flows/ensure-vercel-project.d.ts +2 -0
  332. package/dist/src/setup/flows/ensure-vercel-project.js +1 -1
  333. package/dist/src/setup/integrations/discord/api.js +1 -1
  334. package/dist/src/setup/integrations/web/auth-options.d.ts +4 -0
  335. package/dist/src/setup/integrations/web/auth-options.js +1 -0
  336. package/dist/src/setup/integrations/web/auth-scaffold.d.ts +7 -0
  337. package/dist/src/setup/integrations/web/auth-scaffold.js +1 -0
  338. package/dist/src/setup/integrations/web/provision-auth.d.ts +3 -0
  339. package/dist/src/setup/integrations/web/provision-auth.js +1 -0
  340. package/dist/src/setup/integrations/web/setup.d.ts +11 -6
  341. package/dist/src/setup/integrations/web/setup.js +3 -3
  342. package/dist/src/setup/prompter.d.ts +2 -0
  343. package/dist/src/setup/prompter.js +1 -1
  344. package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
  345. package/dist/src/setup/scaffold/create/project.js +2 -2
  346. package/dist/src/setup/scaffold/create/web-template.d.ts +3 -3
  347. package/dist/src/setup/scaffold/create/web-template.js +26 -8
  348. package/dist/src/setup/scaffold/update/web-options.js +1 -1
  349. package/dist/src/setup/vercel-project-api.d.ts +9 -0
  350. package/dist/src/setup/vercel-project-api.js +1 -1
  351. package/dist/src/setup/vercel-project.d.ts +4 -2
  352. package/dist/src/setup/vercel-project.js +0 -0
  353. package/dist/src/shared/web-search.d.ts +1 -1
  354. package/dist/src/subagents/adapter.js +1 -1
  355. package/dist/src/subagents/event-proxy-step.js +1 -1
  356. package/dist/src/subagents/hitl-proxy.d.ts +4 -28
  357. package/dist/src/subagents/hitl-proxy.js +1 -1
  358. package/dist/src/svelte/index.d.ts +2 -0
  359. package/dist/src/svelte/index.js +39 -2
  360. package/dist/src/svelte/use-eve-agent.js +1 -1
  361. package/dist/src/tools/approval/policies.d.ts +5 -5
  362. package/dist/src/tools/approval/policies.js +1 -1
  363. package/dist/src/tools/framework/agent.js +1 -1
  364. package/dist/src/tools/provided/agent-router.js +1 -1
  365. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  366. package/dist/src/tools/provided/ask-question.js +2 -2
  367. package/dist/src/tools/provided/bash.js +1 -1
  368. package/dist/src/tools/provided/framework-tool.d.ts +3 -0
  369. package/dist/src/tools/provided/framework-tool.js +1 -0
  370. package/dist/src/tools/provided/glob.js +2 -2
  371. package/dist/src/tools/provided/grep.js +2 -2
  372. package/dist/src/tools/provided/load-skill.js +1 -1
  373. package/dist/src/tools/provided/no-reply.js +1 -1
  374. package/dist/src/tools/provided/read-file.js +2 -2
  375. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  376. package/dist/src/tools/provided/sleep.js +1 -1
  377. package/dist/src/tools/provided/task-cancel.js +1 -1
  378. package/dist/src/tools/provided/task-wait.js +1 -1
  379. package/dist/src/tools/provided/web-fetch.js +2 -2
  380. package/dist/src/tools/provided/web-search.js +1 -1
  381. package/dist/src/tools/provided/workflow.js +1 -1
  382. package/dist/src/tools/provided/write-file.js +2 -2
  383. package/dist/src/tracing/agent-approval-instrumentation.d.ts +2 -2
  384. package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
  385. package/dist/src/tracing/agent-otel-provider.js +2 -2
  386. package/dist/src/tracing/agent-otel-usage.d.ts +1 -1
  387. package/dist/src/tracing/agent-otel-usage.js +1 -1
  388. package/dist/src/tracing/agent-span-contract.d.ts +8 -1
  389. package/dist/src/tracing/agent-span-contract.js +1 -1
  390. package/dist/src/tracing/agent-tool-instrumentation.d.ts +16 -5
  391. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  392. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  393. package/dist/src/tracing/agent-trace-span-processor.js +1 -1
  394. package/dist/src/tracing/agent-trace-state.d.ts +8 -3
  395. package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
  396. package/dist/src/tracing/invoke-tool-span.d.ts +61 -0
  397. package/dist/src/tracing/invoke-tool-span.js +1 -0
  398. package/dist/src/tracing/local-trace-analysis.js +1 -1
  399. package/dist/src/vue/index.d.ts +2 -0
  400. package/dist/src/vue/index.js +39 -2
  401. package/dist/src/vue/use-eve-agent.js +1 -1
  402. package/docs/agent-config.md +2 -2
  403. package/docs/channels/chat-sdk.mdx +3 -1
  404. package/docs/channels/custom.mdx +3 -0
  405. package/docs/channels/discord.mdx +5 -4
  406. package/docs/channels/eve.mdx +65 -0
  407. package/docs/channels/linear.mdx +1 -1
  408. package/docs/channels/linq.mdx +2 -0
  409. package/docs/channels/mcp.mdx +39 -1
  410. package/docs/channels/photon.mdx +5 -0
  411. package/docs/channels/teams.mdx +4 -7
  412. package/docs/channels/twilio.mdx +1 -1
  413. package/docs/concepts/built-in-tools.md +12 -0
  414. package/docs/concepts/sessions-runs-and-streaming.md +3 -3
  415. package/docs/connections/overview.mdx +1 -1
  416. package/docs/dynamic-configuration/meta.json +1 -1
  417. package/docs/evals/judge.mdx +16 -16
  418. package/docs/evals/overview.mdx +1 -1
  419. package/docs/guides/{evaluate.md → decide.md} +35 -35
  420. package/docs/guides/dynamic-capabilities.md +1 -1
  421. package/docs/guides/frontend/overview.mdx +3 -1
  422. package/docs/guides/hooks.md +1 -1
  423. package/docs/guides/instrumentation/instrumentation.mdx +23 -22
  424. package/docs/guides/instrumentation/otel.mdx +13 -2
  425. package/docs/reference/cli.md +4 -2
  426. package/docs/reference/typescript-api.md +4 -2
  427. package/docs/tools/human-in-the-loop.md +8 -4
  428. package/docs/tools/workflows.mdx +4 -4
  429. package/package.json +13 -11
  430. package/dist/src/ai/evaluate.d.ts +0 -7
  431. package/dist/src/ai/evaluate.js +0 -1
  432. package/dist/src/client/message-task-parts.d.ts +0 -8
  433. package/dist/src/client/message-task-parts.js +0 -1
  434. package/dist/src/compiled/_chunks/workflow/dist-C3ZE62yI.js +0 -25
  435. package/dist/src/compiled/_chunks/workflow/experimental-evaluation-Dm32egEG.js +0 -5
  436. package/dist/src/harness/active-turn-id.d.ts +0 -11
  437. package/dist/src/harness/active-turn-id.js +0 -1
  438. package/dist/src/harness/approval-candidates.js +0 -1
  439. package/dist/src/harness/approval-delivery-coordinator.js +0 -1
  440. package/dist/src/harness/cancelled-turn-emission.d.ts +0 -12
  441. package/dist/src/harness/cancelled-turn-emission.js +0 -1
  442. package/dist/src/harness/emission-state.d.ts +0 -26
  443. package/dist/src/harness/emission-state.js +0 -1
  444. package/dist/src/harness/held-requests.d.ts +0 -18
  445. package/dist/src/harness/held-requests.js +0 -1
  446. package/dist/src/harness/hitl/approval-input-requests.d.ts +0 -27
  447. package/dist/src/harness/hitl/approval-input-requests.js +0 -1
  448. package/dist/src/harness/hitl/pending-input-resolution.d.ts +0 -54
  449. package/dist/src/harness/hitl/pending-input-resolution.js +0 -1
  450. package/dist/src/harness/hitl/session-limit-input-requests.d.ts +0 -12
  451. package/dist/src/harness/hitl/session-limit-input-requests.js +0 -1
  452. package/dist/src/harness/input-requests.d.ts +0 -31
  453. package/dist/src/harness/input-requests.js +0 -1
  454. package/dist/src/harness/pending-input-batches.d.ts +0 -81
  455. package/dist/src/harness/pending-input-batches.js +0 -1
  456. package/dist/src/harness/session-limit-continuation.js +0 -1
  457. package/dist/src/harness/session-limit-enforcement.d.ts +0 -45
  458. package/dist/src/harness/session-limit-enforcement.js +0 -1
  459. package/dist/src/harness/stale-input-responses.js +0 -3
  460. package/dist/src/harness/workflow-dispatch.d.ts +0 -30
  461. package/dist/src/harness/workflow-dispatch.js +0 -1
  462. package/dist/src/public/channels/linear/inbound-images.d.ts +0 -19
  463. package/dist/src/public/channels/linear/inbound-images.js +0 -1
  464. package/dist/src/tracing/agent-action-instrumentation.d.ts +0 -25
  465. package/dist/src/tracing/agent-action-instrumentation.js +0 -1
  466. /package/dist/src/harness/{compaction.d.ts → compaction/engine.d.ts} +0 -0
  467. /package/dist/src/harness/{compaction-prompt.d.ts → compaction/prompt.d.ts} +0 -0
  468. /package/dist/src/harness/{compaction-prompt.js → compaction/prompt.js} +0 -0
  469. /package/dist/src/harness/{approval-delivery-coordinator.d.ts → hitl/coordinator.d.ts} +0 -0
  470. /package/dist/src/harness/{model-call-error.js → model-call/errors.js} +0 -0
@@ -1,102 +1,103 @@
1
- import { z } from '#compiled/zod/index.js';
2
- import { FetchFunction, FlexibleSchema, Tool } from '#compiled/@ai-sdk/provider-utils/index.js';
3
- import { JSONObject } from '#compiled/@ai-sdk/provider/index.js';
4
-
1
+ import { FetchFunction, FlexibleSchema, Tool } from "#compiled/@ai-sdk/provider-utils/index.js";
2
+ import { z } from "#compiled/zod/index.js";
3
+ import { AISDKError, JSONObject } from "#compiled/@ai-sdk/provider/index.js";
4
+ //#region src/tool/json-rpc-message.d.ts
5
5
  declare const JSONRPCRequestSchema: z.ZodObject<{
6
- jsonrpc: z.ZodLiteral<"2.0">;
7
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
8
- method: z.ZodString;
9
- params: z.ZodOptional<z.ZodObject<{
10
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
11
- }, z.core.$loose>>;
6
+ jsonrpc: z.ZodLiteral<"2.0">;
7
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
8
+ method: z.ZodString;
9
+ params: z.ZodOptional<z.ZodObject<{
10
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
11
+ }, z.core.$loose>>;
12
12
  }, z.core.$strict>;
13
13
  type JSONRPCRequest = z.infer<typeof JSONRPCRequestSchema>;
14
14
  declare const JSONRPCResponseSchema: z.ZodObject<{
15
- jsonrpc: z.ZodLiteral<"2.0">;
16
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
17
- result: z.ZodObject<{
18
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
19
- resultType: z.ZodOptional<z.ZodString>;
20
- }, z.core.$loose>;
15
+ jsonrpc: z.ZodLiteral<"2.0">;
16
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
17
+ result: z.ZodObject<{
18
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
19
+ resultType: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$loose>;
21
21
  }, z.core.$strict>;
22
22
  type JSONRPCResponse = z.infer<typeof JSONRPCResponseSchema>;
23
23
  declare const JSONRPCErrorSchema: z.ZodObject<{
24
- jsonrpc: z.ZodLiteral<"2.0">;
25
- id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
26
- error: z.ZodObject<{
27
- code: z.ZodNumber;
28
- message: z.ZodString;
29
- data: z.ZodOptional<z.ZodUnknown>;
30
- }, z.core.$strip>;
24
+ jsonrpc: z.ZodLiteral<"2.0">;
25
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
26
+ error: z.ZodObject<{
27
+ code: z.ZodNumber;
28
+ message: z.ZodString;
29
+ data: z.ZodOptional<z.ZodUnknown>;
30
+ }, z.core.$strip>;
31
31
  }, z.core.$strict>;
32
32
  type JSONRPCError = z.infer<typeof JSONRPCErrorSchema>;
33
33
  declare const JSONRPCNotificationSchema: z.ZodObject<{
34
- jsonrpc: z.ZodLiteral<"2.0">;
35
- method: z.ZodString;
36
- params: z.ZodOptional<z.ZodObject<{
37
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
38
- }, z.core.$loose>>;
34
+ jsonrpc: z.ZodLiteral<"2.0">;
35
+ method: z.ZodString;
36
+ params: z.ZodOptional<z.ZodObject<{
37
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
38
+ }, z.core.$loose>>;
39
39
  }, z.core.$strict>;
40
40
  type JSONRPCNotification = z.infer<typeof JSONRPCNotificationSchema>;
41
41
  declare const JSONRPCMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
42
- jsonrpc: z.ZodLiteral<"2.0">;
43
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
44
- method: z.ZodString;
45
- params: z.ZodOptional<z.ZodObject<{
46
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
47
- }, z.core.$loose>>;
42
+ jsonrpc: z.ZodLiteral<"2.0">;
43
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
44
+ method: z.ZodString;
45
+ params: z.ZodOptional<z.ZodObject<{
46
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
47
+ }, z.core.$loose>>;
48
48
  }, z.core.$strict>, z.ZodObject<{
49
- jsonrpc: z.ZodLiteral<"2.0">;
50
- method: z.ZodString;
51
- params: z.ZodOptional<z.ZodObject<{
52
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
53
- }, z.core.$loose>>;
49
+ jsonrpc: z.ZodLiteral<"2.0">;
50
+ method: z.ZodString;
51
+ params: z.ZodOptional<z.ZodObject<{
52
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
53
+ }, z.core.$loose>>;
54
54
  }, z.core.$strict>, z.ZodObject<{
55
- jsonrpc: z.ZodLiteral<"2.0">;
56
- id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
57
- result: z.ZodObject<{
58
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
59
- resultType: z.ZodOptional<z.ZodString>;
60
- }, z.core.$loose>;
55
+ jsonrpc: z.ZodLiteral<"2.0">;
56
+ id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
57
+ result: z.ZodObject<{
58
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
59
+ resultType: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$loose>;
61
61
  }, z.core.$strict>, z.ZodObject<{
62
- jsonrpc: z.ZodLiteral<"2.0">;
63
- id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
64
- error: z.ZodObject<{
65
- code: z.ZodNumber;
66
- message: z.ZodString;
67
- data: z.ZodOptional<z.ZodUnknown>;
68
- }, z.core.$strip>;
62
+ jsonrpc: z.ZodLiteral<"2.0">;
63
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
64
+ error: z.ZodObject<{
65
+ code: z.ZodNumber;
66
+ message: z.ZodString;
67
+ data: z.ZodOptional<z.ZodUnknown>;
68
+ }, z.core.$strip>;
69
69
  }, z.core.$strict>]>;
70
70
  type JSONRPCMessage = z.infer<typeof JSONRPCMessageSchema>;
71
- declare function validateJSONRPCMessage(message: unknown): JSONRPCMessage;
72
-
71
+ export declare function validateJSONRPCMessage(message: unknown): JSONRPCMessage;
72
+ //#endregion
73
+ //#region src/tool/oauth-types.d.ts
73
74
  /**
74
75
  * OAuth 2.1 token response
75
76
  */
76
77
  declare const OAuthTokensSchema: z.ZodObject<{
77
- access_token: z.ZodString;
78
- id_token: z.ZodOptional<z.ZodString>;
79
- token_type: z.ZodString;
80
- expires_in: z.ZodOptional<z.ZodNumber>;
81
- scope: z.ZodOptional<z.ZodString>;
82
- refresh_token: z.ZodOptional<z.ZodString>;
83
- issuer: z.ZodOptional<z.ZodString>;
84
- authorization_server: z.ZodOptional<z.ZodString>;
85
- token_endpoint: z.ZodOptional<z.ZodString>;
78
+ access_token: z.ZodString;
79
+ id_token: z.ZodOptional<z.ZodString>;
80
+ token_type: z.ZodString;
81
+ expires_in: z.ZodOptional<z.ZodNumber>;
82
+ scope: z.ZodOptional<z.ZodString>;
83
+ refresh_token: z.ZodOptional<z.ZodString>;
84
+ issuer: z.ZodOptional<z.ZodString>;
85
+ authorization_server: z.ZodOptional<z.ZodString>;
86
+ token_endpoint: z.ZodOptional<z.ZodString>;
86
87
  }, z.core.$strip>;
87
88
  declare const OAuthMetadataSchema: z.ZodObject<{
88
- issuer: z.ZodString;
89
- authorization_endpoint: z.ZodString;
90
- token_endpoint: z.ZodString;
91
- registration_endpoint: z.ZodOptional<z.ZodString>;
92
- authorization_response_iss_parameter_supported: z.ZodOptional<z.ZodBoolean>;
93
- client_id_metadata_document_supported: z.ZodOptional<z.ZodBoolean>;
94
- scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
95
- response_types_supported: z.ZodArray<z.ZodString>;
96
- grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
97
- code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
- token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
- token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
89
+ issuer: z.ZodString;
90
+ authorization_endpoint: z.ZodString;
91
+ token_endpoint: z.ZodString;
92
+ registration_endpoint: z.ZodOptional<z.ZodString>;
93
+ authorization_response_iss_parameter_supported: z.ZodOptional<z.ZodBoolean>;
94
+ client_id_metadata_document_supported: z.ZodOptional<z.ZodBoolean>;
95
+ scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
96
+ response_types_supported: z.ZodArray<z.ZodString>;
97
+ grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
+ code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
+ token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
+ token_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
101
  }, z.core.$loose>;
101
102
  /**
102
103
  * OpenID Connect Discovery metadata that may include OAuth 2.0 fields
@@ -104,50 +105,50 @@ declare const OAuthMetadataSchema: z.ZodObject<{
104
105
  * return a mix of OpenID Connect and OAuth 2.0 metadata fields
105
106
  */
106
107
  declare const OpenIdProviderDiscoveryMetadataSchema: z.ZodObject<{
107
- issuer: z.ZodString;
108
- authorization_endpoint: z.ZodString;
109
- token_endpoint: z.ZodString;
110
- userinfo_endpoint: z.ZodOptional<z.ZodString>;
111
- jwks_uri: z.ZodString;
112
- registration_endpoint: z.ZodOptional<z.ZodString>;
113
- authorization_response_iss_parameter_supported: z.ZodOptional<z.ZodBoolean>;
114
- client_id_metadata_document_supported: z.ZodOptional<z.ZodBoolean>;
115
- scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
116
- response_types_supported: z.ZodArray<z.ZodString>;
117
- grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
118
- subject_types_supported: z.ZodArray<z.ZodString>;
119
- id_token_signing_alg_values_supported: z.ZodArray<z.ZodString>;
120
- claims_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
121
- token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
- code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
108
+ issuer: z.ZodString;
109
+ authorization_endpoint: z.ZodString;
110
+ token_endpoint: z.ZodString;
111
+ userinfo_endpoint: z.ZodOptional<z.ZodString>;
112
+ jwks_uri: z.ZodString;
113
+ registration_endpoint: z.ZodOptional<z.ZodString>;
114
+ authorization_response_iss_parameter_supported: z.ZodOptional<z.ZodBoolean>;
115
+ client_id_metadata_document_supported: z.ZodOptional<z.ZodBoolean>;
116
+ scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
117
+ response_types_supported: z.ZodArray<z.ZodString>;
118
+ grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
119
+ subject_types_supported: z.ZodArray<z.ZodString>;
120
+ id_token_signing_alg_values_supported: z.ZodArray<z.ZodString>;
121
+ claims_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
122
+ token_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
+ code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
124
  }, z.core.$loose>;
124
125
  declare const OAuthClientInformationSchema: z.ZodObject<{
125
- client_id: z.ZodString;
126
- client_secret: z.ZodOptional<z.ZodString>;
127
- client_id_issued_at: z.ZodOptional<z.ZodNumber>;
128
- client_secret_expires_at: z.ZodOptional<z.ZodNumber>;
129
- issuer: z.ZodOptional<z.ZodString>;
130
- authorization_server: z.ZodOptional<z.ZodString>;
131
- token_endpoint: z.ZodOptional<z.ZodString>;
126
+ client_id: z.ZodString;
127
+ client_secret: z.ZodOptional<z.ZodString>;
128
+ client_id_issued_at: z.ZodOptional<z.ZodNumber>;
129
+ client_secret_expires_at: z.ZodOptional<z.ZodNumber>;
130
+ issuer: z.ZodOptional<z.ZodString>;
131
+ authorization_server: z.ZodOptional<z.ZodString>;
132
+ token_endpoint: z.ZodOptional<z.ZodString>;
132
133
  }, z.core.$strip>;
133
134
  declare const OAuthClientMetadataSchema: z.ZodObject<{
134
- redirect_uris: z.ZodArray<z.ZodString>;
135
- application_type: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"native">, z.ZodLiteral<"web">]>>;
136
- token_endpoint_auth_method: z.ZodOptional<z.ZodString>;
137
- grant_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
138
- response_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
139
- client_name: z.ZodOptional<z.ZodString>;
140
- client_uri: z.ZodOptional<z.ZodString>;
141
- logo_uri: z.ZodOptional<z.ZodString>;
142
- scope: z.ZodOptional<z.ZodString>;
143
- contacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
144
- tos_uri: z.ZodOptional<z.ZodString>;
145
- policy_uri: z.ZodOptional<z.ZodString>;
146
- jwks_uri: z.ZodOptional<z.ZodString>;
147
- jwks: z.ZodOptional<z.ZodAny>;
148
- software_id: z.ZodOptional<z.ZodString>;
149
- software_version: z.ZodOptional<z.ZodString>;
150
- software_statement: z.ZodOptional<z.ZodString>;
135
+ redirect_uris: z.ZodArray<z.ZodString>;
136
+ application_type: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"native">, z.ZodLiteral<"web">]>>;
137
+ token_endpoint_auth_method: z.ZodOptional<z.ZodString>;
138
+ grant_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
139
+ response_types: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
+ client_name: z.ZodOptional<z.ZodString>;
141
+ client_uri: z.ZodOptional<z.ZodString>;
142
+ logo_uri: z.ZodOptional<z.ZodString>;
143
+ scope: z.ZodOptional<z.ZodString>;
144
+ contacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
+ tos_uri: z.ZodOptional<z.ZodString>;
146
+ policy_uri: z.ZodOptional<z.ZodString>;
147
+ jwks_uri: z.ZodOptional<z.ZodString>;
148
+ jwks: z.ZodOptional<z.ZodAny>;
149
+ software_id: z.ZodOptional<z.ZodString>;
150
+ software_version: z.ZodOptional<z.ZodString>;
151
+ software_statement: z.ZodOptional<z.ZodString>;
151
152
  }, z.core.$strip>;
152
153
  type OAuthMetadata = z.infer<typeof OAuthMetadataSchema>;
153
154
  type OpenIdProviderDiscoveryMetadata = z.infer<typeof OpenIdProviderDiscoveryMetadataSchema>;
@@ -155,226 +156,271 @@ type OAuthTokens = z.infer<typeof OAuthTokensSchema>;
155
156
  type OAuthClientInformation = z.infer<typeof OAuthClientInformationSchema>;
156
157
  type AuthorizationServerMetadata = OAuthMetadata | OpenIdProviderDiscoveryMetadata;
157
158
  type OAuthClientMetadata = z.infer<typeof OAuthClientMetadataSchema>;
158
-
159
+ //#endregion
160
+ //#region src/error/oauth-error.d.ts
161
+ declare const symbol$1: unique symbol;
162
+ /**
163
+ * An error occurred with the MCP client within the OAuth flow.
164
+ */
165
+ export declare class MCPClientOAuthError extends AISDKError {
166
+ private readonly [symbol$1];
167
+ constructor({ name, message, cause }: {
168
+ name?: string;
169
+ message: string;
170
+ cause?: unknown;
171
+ });
172
+ static isInstance(error: unknown): error is MCPClientOAuthError;
173
+ }
174
+ declare const mismatchSymbol: unique symbol;
175
+ export declare class AuthorizationServerMismatchError extends MCPClientOAuthError {
176
+ private readonly [mismatchSymbol];
177
+ static errorCode: string;
178
+ constructor({ message, cause }: {
179
+ message: string;
180
+ cause?: unknown;
181
+ });
182
+ static isInstance(error: unknown): error is AuthorizationServerMismatchError;
183
+ }
184
+ //#endregion
185
+ //#region src/tool/oauth.d.ts
159
186
  type AuthResult = 'AUTHORIZED' | 'REDIRECT';
160
187
  interface OAuthAuthorizationServerInformation {
161
- issuer?: string;
162
- authorizationServerUrl: string;
163
- tokenEndpoint: string;
188
+ issuer?: string;
189
+ authorizationServerUrl: string;
190
+ tokenEndpoint: string;
164
191
  }
165
192
  interface OAuthClientProvider {
166
- /**
167
- * Returns current access token if present; undefined otherwise.
168
- */
169
- tokens(): OAuthTokens | undefined | Promise<OAuthTokens | undefined>;
170
- saveTokens(tokens: OAuthTokens): void | Promise<void>;
171
- redirectToAuthorization(authorizationUrl: URL): void | Promise<void>;
172
- saveCodeVerifier(codeVerifier: string): void | Promise<void>;
173
- codeVerifier(): string | Promise<string>;
174
- /**
175
- * Adds custom client authentication to OAuth token requests.
176
- *
177
- * This optional method allows implementations to customize how client credentials
178
- * are included in token exchange and refresh requests. When provided, this method
179
- * is called instead of the default authentication logic, giving full control over
180
- * the authentication mechanism.
181
- *
182
- * Common use cases include:
183
- * - Supporting authentication methods beyond the standard OAuth 2.0 methods
184
- * - Adding custom headers for proprietary authentication schemes
185
- * - Implementing client assertion-based authentication (e.g., JWT bearer tokens)
186
- *
187
- * @param headers - The request headers (can be modified to add authentication)
188
- * @param params - The request body parameters (can be modified to add credentials)
189
- * @param url - The token endpoint URL being called
190
- * @param metadata - Optional OAuth metadata for the server, which may include supported authentication methods
191
- */
192
- addClientAuthentication?(headers: Headers, params: URLSearchParams, url: string | URL, metadata?: AuthorizationServerMetadata): void | Promise<void>;
193
- /**
194
- * If implemented, provides a way for the client to invalidate (e.g. delete) the specified
195
- * credentials, in the case where the server has indicated that they are no longer valid.
196
- * This avoids requiring the user to intervene manually.
197
- */
198
- invalidateCredentials?(scope: 'all' | 'client' | 'tokens' | 'verifier'): void | Promise<void>;
199
- get redirectUrl(): string | URL;
200
- get clientMetadata(): OAuthClientMetadata;
201
- clientInformation(): OAuthClientInformation | undefined | Promise<OAuthClientInformation | undefined>;
202
- saveClientInformation?(clientInformation: OAuthClientInformation): void | Promise<void>;
203
- authorizationServerInformation?(): OAuthAuthorizationServerInformation | undefined | Promise<OAuthAuthorizationServerInformation | undefined>;
204
- saveAuthorizationServerInformation?(authorizationServerInformation: OAuthAuthorizationServerInformation): void | Promise<void>;
205
- /**
206
- * Validates an authorization server URL discovered from MCP protected resource
207
- * metadata before the client fetches its OAuth metadata.
208
- */
209
- validateAuthorizationServerURL?(serverUrl: string | URL, authorizationServerUrl: string | URL): void | Promise<void>;
210
- state?(): string | Promise<string>;
211
- saveState?(state: string): void | Promise<void>;
212
- storedState?(): string | undefined | Promise<string | undefined>;
213
- validateResourceURL?(serverUrl: string | URL, resource?: string): Promise<URL | undefined>;
193
+ /**
194
+ * Returns current access token if present; undefined otherwise.
195
+ */
196
+ tokens(): OAuthTokens | undefined | Promise<OAuthTokens | undefined>;
197
+ saveTokens(tokens: OAuthTokens): void | Promise<void>;
198
+ redirectToAuthorization(authorizationUrl: URL): void | Promise<void>;
199
+ saveCodeVerifier(codeVerifier: string): void | Promise<void>;
200
+ codeVerifier(): string | Promise<string>;
201
+ /**
202
+ * Adds custom client authentication to OAuth token requests.
203
+ *
204
+ * This optional method allows implementations to customize how client credentials
205
+ * are included in token exchange and refresh requests. When provided, this method
206
+ * is called instead of the default authentication logic, giving full control over
207
+ * the authentication mechanism.
208
+ *
209
+ * Common use cases include:
210
+ * - Supporting authentication methods beyond the standard OAuth 2.0 methods
211
+ * - Adding custom headers for proprietary authentication schemes
212
+ * - Implementing client assertion-based authentication (e.g., JWT bearer tokens)
213
+ *
214
+ * @param headers - The request headers (can be modified to add authentication)
215
+ * @param params - The request body parameters (can be modified to add credentials)
216
+ * @param url - The token endpoint URL being called
217
+ * @param metadata - Optional OAuth metadata for the server, which may include supported authentication methods
218
+ */
219
+ addClientAuthentication?(headers: Headers, params: URLSearchParams, url: string | URL, metadata?: AuthorizationServerMetadata): void | Promise<void>;
220
+ /**
221
+ * If implemented, provides a way for the client to invalidate (e.g. delete) the specified
222
+ * credentials, in the case where the server has indicated that they are no longer valid.
223
+ * This avoids requiring the user to intervene manually.
224
+ *
225
+ * For token invalidation, context identifies the token generation being invalidated
226
+ * when available. Providers sharing storage must atomically compare and delete
227
+ * that generation so a concurrent refresh's tokens are preserved. Omitting or
228
+ * ignoring context retains unconditional invalidation.
229
+ */
230
+ invalidateCredentials?(scope: 'all' | 'client' | 'tokens' | 'verifier', context?: {
231
+ tokens: OAuthTokens;
232
+ }): void | Promise<void>;
233
+ get redirectUrl(): string | URL;
234
+ get clientMetadata(): OAuthClientMetadata;
235
+ clientInformation(): OAuthClientInformation | undefined | Promise<OAuthClientInformation | undefined>;
236
+ /**
237
+ * Returns whether the current client information was obtained through
238
+ * dynamic client registration.
239
+ *
240
+ * Return `true` only when the current client information was saved after a
241
+ * dynamic registration response. When this method is omitted or returns
242
+ * `false`, the client information is treated as pre-registered and is not
243
+ * automatically invalidated after client authentication errors.
244
+ */
245
+ isClientInformationDynamicallyRegistered?(): boolean | Promise<boolean>;
246
+ saveClientInformation?(clientInformation: OAuthClientInformation): void | Promise<void>;
247
+ authorizationServerInformation?(): OAuthAuthorizationServerInformation | undefined | Promise<OAuthAuthorizationServerInformation | undefined>;
248
+ saveAuthorizationServerInformation?(authorizationServerInformation: OAuthAuthorizationServerInformation): void | Promise<void>;
249
+ /**
250
+ * Validates an authorization server URL discovered from MCP protected resource
251
+ * metadata before the client fetches its OAuth metadata.
252
+ */
253
+ validateAuthorizationServerURL?(serverUrl: string | URL, authorizationServerUrl: string | URL): void | Promise<void>;
254
+ state?(): string | Promise<string>;
255
+ saveState?(state: string): void | Promise<void>;
256
+ storedState?(): string | undefined | Promise<string | undefined>;
257
+ validateResourceURL?(serverUrl: string | URL, resource?: string): Promise<URL | undefined>;
214
258
  }
215
- declare class UnauthorizedError extends Error {
216
- constructor(message?: string);
259
+ export declare class UnauthorizedError extends Error {
260
+ constructor(message?: string);
217
261
  }
218
- declare function auth(provider: OAuthClientProvider, options: {
219
- serverUrl: string | URL;
220
- authorizationCode?: string;
221
- callbackState?: string;
222
- /**
223
- * Value of the `iss` parameter from the authorization response.
224
- */
225
- callbackIssuer?: string;
226
- scope?: string;
227
- resourceMetadataUrl?: URL;
228
- fetchFn?: FetchFunction;
262
+ export declare function auth(provider: OAuthClientProvider, options: {
263
+ serverUrl: string | URL;
264
+ authorizationCode?: string;
265
+ callbackState?: string;
266
+ /**
267
+ * Value of the `iss` parameter from the authorization response.
268
+ */
269
+ callbackIssuer?: string;
270
+ scope?: string;
271
+ resourceMetadataUrl?: URL;
272
+ fetchFn?: FetchFunction;
229
273
  }): Promise<AuthResult>;
230
-
274
+ //#endregion
275
+ //#region src/tool/mcp-transport.d.ts
231
276
  /**
232
277
  * Transport interface for MCP (Model Context Protocol) communication.
233
278
  * Maps to the `Transport` interface in the MCP spec.
234
279
  */
235
280
  type MCPTransportSendOptions = {
236
- /**
237
- * Cancels the transport operation for this message.
238
- */
239
- signal?: AbortSignal;
240
- /**
241
- * Request-specific HTTP headers produced from MCP tool parameters.
242
- */
243
- headers?: Record<string, string>;
244
- /**
245
- * Associates an outgoing message with an incoming request.
246
- */
247
- relatedRequestId?: string | number;
248
- /**
249
- * Resumes a previously interrupted request.
250
- */
251
- resumptionToken?: string;
252
- /**
253
- * Receives updated resumption tokens from transports that support them.
254
- */
255
- onresumptiontoken?: (token: string) => void;
281
+ /**
282
+ * Cancels the transport operation for this message.
283
+ */
284
+ signal?: AbortSignal;
285
+ /**
286
+ * Request-specific HTTP headers produced from MCP tool parameters.
287
+ */
288
+ headers?: Record<string, string>;
289
+ /**
290
+ * Associates an outgoing message with an incoming request.
291
+ */
292
+ relatedRequestId?: string | number;
293
+ /**
294
+ * Resumes a previously interrupted request.
295
+ */
296
+ resumptionToken?: string;
297
+ /**
298
+ * Receives updated resumption tokens from transports that support them.
299
+ */
300
+ onresumptiontoken?: (token: string) => void;
256
301
  };
257
302
  type MCPTransportCloseOptions = {
258
- /**
259
- * Cancels transport cleanup.
260
- */
261
- signal?: AbortSignal;
303
+ /**
304
+ * Cancels transport cleanup.
305
+ */
306
+ signal?: AbortSignal;
262
307
  };
263
308
  interface MCPTransport {
264
- /**
265
- * Whether this transport can probe for stateless MCP protocol versions.
266
- *
267
- * Custom transports default to the legacy initialization flow unless they
268
- * explicitly opt in.
269
- */
270
- supportsProtocolVersionDiscovery?: boolean;
271
- /**
272
- * Whether this transport mirrors x-mcp-header tool parameters into request
273
- * headers.
274
- */
275
- supportsMcpToolParameterHeaders?: boolean;
276
- /**
277
- * Initialize and start the transport
278
- */
279
- start(): Promise<void>;
280
- /**
281
- * Send a JSON-RPC message through the transport
282
- * @param message The JSON-RPC message to send
283
- * @param options Optional request-scoped cancellation options
284
- */
285
- send(message: JSONRPCMessage, options?: MCPTransportSendOptions): Promise<void>;
286
- /**
287
- * Clean up and close the transport
288
- * @param options Optional cancellation options for transport cleanup
289
- */
290
- close(options?: MCPTransportCloseOptions): Promise<void>;
291
- /**
292
- * Event handler for transport closure
293
- */
294
- onclose?: () => void;
295
- /**
296
- * Event handler for transport errors
297
- */
298
- onerror?: (error: Error) => void;
299
- /**
300
- * Event handler for received messages
301
- */
302
- onmessage?: (message: JSONRPCMessage) => void;
303
- /**
304
- * The protocol version negotiated during initialization.
305
- */
306
- protocolVersion?: string;
307
- /**
308
- * Set the protocol version negotiated during initialization.
309
- */
310
- setProtocolVersion?(version: string): void;
309
+ /**
310
+ * Whether this transport can probe for stateless MCP protocol versions.
311
+ *
312
+ * Custom transports default to the legacy initialization flow unless they
313
+ * explicitly opt in.
314
+ */
315
+ supportsProtocolVersionDiscovery?: boolean;
316
+ /**
317
+ * Whether this transport mirrors x-mcp-header tool parameters into request
318
+ * headers.
319
+ */
320
+ supportsMcpToolParameterHeaders?: boolean;
321
+ /**
322
+ * Initialize and start the transport
323
+ */
324
+ start(): Promise<void>;
325
+ /**
326
+ * Send a JSON-RPC message through the transport
327
+ * @param message The JSON-RPC message to send
328
+ * @param options Optional request-scoped cancellation options
329
+ */
330
+ send(message: JSONRPCMessage, options?: MCPTransportSendOptions): Promise<void>;
331
+ /**
332
+ * Clean up and close the transport
333
+ * @param options Optional cancellation options for transport cleanup
334
+ */
335
+ close(options?: MCPTransportCloseOptions): Promise<void>;
336
+ /**
337
+ * Event handler for transport closure
338
+ */
339
+ onclose?: () => void;
340
+ /**
341
+ * Event handler for transport errors
342
+ */
343
+ onerror?: (error: Error) => void;
344
+ /**
345
+ * Event handler for received messages
346
+ */
347
+ onmessage?: (message: JSONRPCMessage) => void;
348
+ /**
349
+ * The protocol version negotiated during initialization.
350
+ */
351
+ protocolVersion?: string;
352
+ /**
353
+ * Set the protocol version negotiated during initialization.
354
+ */
355
+ setProtocolVersion?(version: string): void;
311
356
  }
312
357
  type MCPTransportConfig = {
313
- type: 'sse' | 'http';
314
- /**
315
- * The URL of the MCP server.
316
- */
317
- url: string;
318
- /**
319
- * Additional HTTP headers to be sent with requests.
320
- */
321
- headers?: Record<string, string>;
322
- /**
323
- * An optional OAuth client provider to use for authentication for MCP servers.
324
- */
325
- authProvider?: OAuthClientProvider;
326
- /**
327
- * Controls how HTTP redirects are handled for transport requests.
328
- * - `'follow'`: Follow redirects automatically (standard fetch behavior).
329
- * - `'error'`: Reject any redirect response with an error.
330
- * @default 'error'
331
- */
332
- redirect?: 'follow' | 'error';
333
- /**
334
- * Initial MCP session id to send with resumed Streamable HTTP requests after
335
- * initialization.
336
- * Only used by the HTTP transport.
337
- */
338
- initialSessionId?: string;
339
- /**
340
- * Initial MCP protocol version to send before initialize negotiates one.
341
- * Only used by the HTTP transport.
342
- */
343
- initialProtocolVersion?: string;
344
- /**
345
- * Called when the Streamable HTTP server creates, changes, or clears the MCP
346
- * session id.
347
- * Only used by the HTTP transport.
348
- */
349
- onSessionIdChange?: (sessionId: string | undefined) => void;
350
- /**
351
- * Called when a Streamable HTTP request returns 404 for an existing MCP
352
- * session id. The transport clears the session id before reporting the
353
- * underlying HTTP error.
354
- * Only used by the HTTP transport.
355
- */
356
- onSessionExpired?: (sessionId: string) => void;
357
- /**
358
- * Whether close() should send DELETE for the current MCP session id.
359
- * Set to false when the application intends to reattach to the session later.
360
- * Only used by the HTTP transport.
361
- * @default true
362
- */
363
- terminateSessionOnClose?: boolean;
364
- /**
365
- * Optional custom fetch implementation to use for HTTP requests.
366
- * Useful for runtimes that need a request-local fetch.
367
- * @default globalThis.fetch
368
- */
369
- fetch?: FetchFunction;
358
+ type: 'sse' | 'http';
359
+ /**
360
+ * The URL of the MCP server.
361
+ */
362
+ url: string;
363
+ /**
364
+ * Additional HTTP headers to be sent with requests.
365
+ */
366
+ headers?: Record<string, string>;
367
+ /**
368
+ * An optional OAuth client provider to use for authentication for MCP servers.
369
+ */
370
+ authProvider?: OAuthClientProvider;
371
+ /**
372
+ * Controls how HTTP redirects are handled for transport requests.
373
+ * - `'follow'`: Follow redirects automatically (standard fetch behavior).
374
+ * - `'error'`: Reject any redirect response with an error.
375
+ * @default 'error'
376
+ */
377
+ redirect?: 'follow' | 'error';
378
+ /**
379
+ * Initial MCP session id to send with resumed Streamable HTTP requests after
380
+ * initialization.
381
+ * Only used by the HTTP transport.
382
+ */
383
+ initialSessionId?: string;
384
+ /**
385
+ * Initial MCP protocol version to send before initialize negotiates one.
386
+ * Only used by the HTTP transport.
387
+ */
388
+ initialProtocolVersion?: string;
389
+ /**
390
+ * Called when the Streamable HTTP server creates, changes, or clears the MCP
391
+ * session id.
392
+ * Only used by the HTTP transport.
393
+ */
394
+ onSessionIdChange?: (sessionId: string | undefined) => void;
395
+ /**
396
+ * Called when a Streamable HTTP request returns 404 for an existing MCP
397
+ * session id. The transport clears the session id before reporting the
398
+ * underlying HTTP error.
399
+ * Only used by the HTTP transport.
400
+ */
401
+ onSessionExpired?: (sessionId: string) => void;
402
+ /**
403
+ * Whether close() should send DELETE for the current MCP session id.
404
+ * Set to false when the application intends to reattach to the session later.
405
+ * Only used by the HTTP transport.
406
+ * @default true
407
+ */
408
+ terminateSessionOnClose?: boolean;
409
+ /**
410
+ * Optional custom fetch implementation to use for HTTP requests.
411
+ * Useful for runtimes that need a request-local fetch.
412
+ * @default globalThis.fetch
413
+ */
414
+ fetch?: FetchFunction;
370
415
  };
371
-
416
+ //#endregion
417
+ //#region src/tool/types.d.ts
372
418
  type McpProviderMetadata = {
373
- clientName?: string;
374
- title?: string;
375
- toolName?: string;
376
- annotations?: McpToolAnnotations;
377
- app?: JSONObject;
419
+ clientName?: string;
420
+ title?: string;
421
+ toolName?: string;
422
+ annotations?: McpToolAnnotations;
423
+ app?: JSONObject;
378
424
  };
379
425
  /**
380
426
  * Behavioral hints reported by an MCP server for a tool.
@@ -384,583 +430,584 @@ type McpProviderMetadata = {
384
430
  * @see https://modelcontextprotocol.io/specification/2026-07-28/schema#toolannotations
385
431
  */
386
432
  type McpToolAnnotations = {
387
- title?: string;
388
- readOnlyHint?: boolean;
389
- destructiveHint?: boolean;
390
- idempotentHint?: boolean;
391
- openWorldHint?: boolean;
433
+ title?: string;
434
+ readOnlyHint?: boolean;
435
+ destructiveHint?: boolean;
436
+ idempotentHint?: boolean;
437
+ openWorldHint?: boolean;
392
438
  };
393
439
  /** MCP tool metadata - keys should follow MCP _meta key format specification */
394
440
  declare const ToolMetaSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
395
441
  type ToolMeta = z.infer<typeof ToolMetaSchema>;
396
442
  type ToolSchemas = Record<string, {
397
- inputSchema: FlexibleSchema<JSONObject | unknown>;
398
- outputSchema?: FlexibleSchema<JSONObject | unknown>;
443
+ inputSchema: FlexibleSchema<JSONObject | unknown>;
444
+ outputSchema?: FlexibleSchema<JSONObject | unknown>;
399
445
  }> | 'automatic' | undefined;
400
446
  /** Base MCP tool type with execute and _meta */
401
447
  type McpToolBase<INPUT = unknown, OUTPUT = CallToolResult> = Tool<INPUT, OUTPUT> & Required<Pick<Tool<INPUT, OUTPUT>, 'execute'>> & {
402
- _meta?: ToolMeta;
448
+ _meta?: ToolMeta;
403
449
  };
404
450
  type McpToolSet<TOOL_SCHEMAS extends ToolSchemas = 'automatic'> = TOOL_SCHEMAS extends Record<string, {
405
- inputSchema: FlexibleSchema<any>;
406
- outputSchema?: FlexibleSchema<any>;
407
- }> ? {
408
- [K in keyof TOOL_SCHEMAS]: TOOL_SCHEMAS[K] extends {
409
- inputSchema: FlexibleSchema<infer INPUT>;
410
- outputSchema: FlexibleSchema<infer OUTPUT>;
411
- } ? McpToolBase<INPUT, OUTPUT> : TOOL_SCHEMAS[K] extends {
412
- inputSchema: FlexibleSchema<infer INPUT>;
413
- } ? McpToolBase<INPUT, CallToolResult> : never;
414
- } : Record<string, McpToolBase<unknown, CallToolResult>>;
451
+ inputSchema: FlexibleSchema<any>;
452
+ outputSchema?: FlexibleSchema<any>;
453
+ }> ? { [K in keyof TOOL_SCHEMAS]: TOOL_SCHEMAS[K] extends {
454
+ inputSchema: FlexibleSchema<infer INPUT>;
455
+ outputSchema: FlexibleSchema<infer OUTPUT>;
456
+ } ? McpToolBase<INPUT, OUTPUT> : TOOL_SCHEMAS[K] extends {
457
+ inputSchema: FlexibleSchema<infer INPUT>;
458
+ } ? McpToolBase<INPUT, CallToolResult> : never; } : Record<string, McpToolBase<unknown, CallToolResult>>;
415
459
  declare const ClientOrServerImplementationSchema: z.ZodObject<{
416
- name: z.ZodString;
417
- version: z.ZodString;
418
- title: z.ZodOptional<z.ZodString>;
460
+ name: z.ZodString;
461
+ version: z.ZodString;
462
+ title: z.ZodOptional<z.ZodString>;
419
463
  }, z.core.$loose>;
420
464
  type Configuration = z.infer<typeof ClientOrServerImplementationSchema>;
421
465
  declare const BaseParamsSchema: z.ZodObject<{
422
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
466
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
423
467
  }, z.core.$loose>;
424
468
  type BaseParams = z.infer<typeof BaseParamsSchema>;
425
469
  declare const RequestSchema: z.ZodObject<{
426
- method: z.ZodString;
427
- params: z.ZodOptional<z.ZodObject<{
428
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
429
- }, z.core.$loose>>;
470
+ method: z.ZodString;
471
+ params: z.ZodOptional<z.ZodObject<{
472
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
473
+ }, z.core.$loose>>;
430
474
  }, z.core.$strip>;
431
475
  type Request = z.infer<typeof RequestSchema>;
432
476
  type RequestOptions = {
433
- signal?: AbortSignal;
434
- timeout?: number;
435
- maxTotalTimeout?: number;
477
+ signal?: AbortSignal;
478
+ timeout?: number;
479
+ maxTotalTimeout?: number;
436
480
  };
437
481
  declare const ClientCapabilitiesSchema: z.ZodObject<{
438
- elicitation: z.ZodOptional<z.ZodObject<{
439
- applyDefaults: z.ZodOptional<z.ZodBoolean>;
440
- }, z.core.$loose>>;
482
+ elicitation: z.ZodOptional<z.ZodObject<{
483
+ applyDefaults: z.ZodOptional<z.ZodBoolean>;
484
+ }, z.core.$loose>>;
441
485
  }, z.core.$loose>;
442
486
  type ClientCapabilities = z.infer<typeof ClientCapabilitiesSchema>;
443
487
  declare const InitializeResultSchema: z.ZodObject<{
444
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
445
- resultType: z.ZodOptional<z.ZodString>;
446
- protocolVersion: z.ZodString;
447
- capabilities: z.ZodObject<{
448
- experimental: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
449
- logging: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
450
- completions: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
451
- prompts: z.ZodOptional<z.ZodObject<{
452
- listChanged: z.ZodOptional<z.ZodBoolean>;
453
- }, z.core.$loose>>;
454
- resources: z.ZodOptional<z.ZodObject<{
455
- subscribe: z.ZodOptional<z.ZodBoolean>;
456
- listChanged: z.ZodOptional<z.ZodBoolean>;
457
- }, z.core.$loose>>;
458
- tools: z.ZodOptional<z.ZodObject<{
459
- listChanged: z.ZodOptional<z.ZodBoolean>;
460
- }, z.core.$loose>>;
461
- elicitation: z.ZodOptional<z.ZodObject<{
462
- applyDefaults: z.ZodOptional<z.ZodBoolean>;
463
- }, z.core.$loose>>;
464
- }, z.core.$loose>;
465
- serverInfo: z.ZodObject<{
466
- name: z.ZodString;
467
- version: z.ZodString;
468
- title: z.ZodOptional<z.ZodString>;
469
- }, z.core.$loose>;
470
- instructions: z.ZodOptional<z.ZodString>;
488
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
489
+ resultType: z.ZodOptional<z.ZodString>;
490
+ protocolVersion: z.ZodString;
491
+ capabilities: z.ZodObject<{
492
+ experimental: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
493
+ logging: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
494
+ completions: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
495
+ prompts: z.ZodOptional<z.ZodObject<{
496
+ listChanged: z.ZodOptional<z.ZodBoolean>;
497
+ }, z.core.$loose>>;
498
+ resources: z.ZodOptional<z.ZodObject<{
499
+ subscribe: z.ZodOptional<z.ZodBoolean>;
500
+ listChanged: z.ZodOptional<z.ZodBoolean>;
501
+ }, z.core.$loose>>;
502
+ tools: z.ZodOptional<z.ZodObject<{
503
+ listChanged: z.ZodOptional<z.ZodBoolean>;
504
+ }, z.core.$loose>>;
505
+ elicitation: z.ZodOptional<z.ZodObject<{
506
+ applyDefaults: z.ZodOptional<z.ZodBoolean>;
507
+ }, z.core.$loose>>;
508
+ }, z.core.$loose>;
509
+ serverInfo: z.ZodObject<{
510
+ name: z.ZodString;
511
+ version: z.ZodString;
512
+ title: z.ZodOptional<z.ZodString>;
513
+ }, z.core.$loose>;
514
+ instructions: z.ZodOptional<z.ZodString>;
471
515
  }, z.core.$loose>;
472
516
  type InitializeResult = z.infer<typeof InitializeResultSchema>;
473
517
  type PaginatedRequest = Request & {
474
- params?: BaseParams & {
475
- cursor?: string;
476
- };
518
+ params?: BaseParams & {
519
+ cursor?: string;
520
+ };
477
521
  };
478
522
  declare const ListToolsResultSchema: z.ZodObject<{
479
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
480
- resultType: z.ZodOptional<z.ZodString>;
481
- nextCursor: z.ZodOptional<z.ZodString>;
482
- tools: z.ZodArray<z.ZodObject<{
483
- name: z.ZodString;
484
- title: z.ZodOptional<z.ZodString>;
485
- description: z.ZodOptional<z.ZodString>;
486
- inputSchema: z.ZodObject<{
487
- type: z.ZodOptional<z.ZodUnknown>;
488
- properties: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
489
- }, z.core.$loose>;
490
- outputSchema: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
491
- annotations: z.ZodOptional<z.ZodObject<{
492
- title: z.ZodOptional<z.ZodString>;
493
- readOnlyHint: z.ZodOptional<z.ZodBoolean>;
494
- destructiveHint: z.ZodOptional<z.ZodBoolean>;
495
- idempotentHint: z.ZodOptional<z.ZodBoolean>;
496
- openWorldHint: z.ZodOptional<z.ZodBoolean>;
497
- }, z.core.$loose>>;
498
- _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
523
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
524
+ resultType: z.ZodOptional<z.ZodString>;
525
+ nextCursor: z.ZodOptional<z.ZodString>;
526
+ tools: z.ZodArray<z.ZodObject<{
527
+ name: z.ZodString;
528
+ title: z.ZodOptional<z.ZodString>;
529
+ description: z.ZodOptional<z.ZodString>;
530
+ inputSchema: z.ZodObject<{
531
+ type: z.ZodOptional<z.ZodUnknown>;
532
+ properties: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
533
+ }, z.core.$loose>;
534
+ outputSchema: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
535
+ annotations: z.ZodOptional<z.ZodObject<{
536
+ title: z.ZodOptional<z.ZodString>;
537
+ readOnlyHint: z.ZodOptional<z.ZodBoolean>;
538
+ destructiveHint: z.ZodOptional<z.ZodBoolean>;
539
+ idempotentHint: z.ZodOptional<z.ZodBoolean>;
540
+ openWorldHint: z.ZodOptional<z.ZodBoolean>;
499
541
  }, z.core.$loose>>;
542
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
543
+ }, z.core.$loose>>;
500
544
  }, z.core.$loose>;
501
545
  type ListToolsResult = z.infer<typeof ListToolsResultSchema>;
502
546
  declare const ListResourcesResultSchema: z.ZodObject<{
503
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
504
- resultType: z.ZodOptional<z.ZodString>;
505
- nextCursor: z.ZodOptional<z.ZodString>;
506
- resources: z.ZodArray<z.ZodObject<{
507
- uri: z.ZodString;
508
- name: z.ZodString;
509
- title: z.ZodOptional<z.ZodString>;
510
- description: z.ZodOptional<z.ZodString>;
511
- mimeType: z.ZodOptional<z.ZodString>;
512
- size: z.ZodOptional<z.ZodNumber>;
513
- }, z.core.$loose>>;
547
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
548
+ resultType: z.ZodOptional<z.ZodString>;
549
+ nextCursor: z.ZodOptional<z.ZodString>;
550
+ resources: z.ZodArray<z.ZodObject<{
551
+ uri: z.ZodString;
552
+ name: z.ZodString;
553
+ title: z.ZodOptional<z.ZodString>;
554
+ description: z.ZodOptional<z.ZodString>;
555
+ mimeType: z.ZodOptional<z.ZodString>;
556
+ size: z.ZodOptional<z.ZodNumber>;
557
+ }, z.core.$loose>>;
514
558
  }, z.core.$loose>;
515
559
  type ListResourcesResult = z.infer<typeof ListResourcesResultSchema>;
516
560
  declare const CallToolResultSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
517
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
518
- resultType: z.ZodOptional<z.ZodString>;
519
- content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
520
- type: z.ZodLiteral<"text">;
521
- text: z.ZodString;
522
- }, z.core.$loose>, z.ZodObject<{
523
- type: z.ZodLiteral<"image">;
524
- data: z.ZodBase64;
525
- mimeType: z.ZodString;
561
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
562
+ resultType: z.ZodOptional<z.ZodString>;
563
+ content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
564
+ type: z.ZodLiteral<"text">;
565
+ text: z.ZodString;
566
+ }, z.core.$loose>, z.ZodObject<{
567
+ type: z.ZodLiteral<"image">;
568
+ data: z.ZodBase64;
569
+ mimeType: z.ZodString;
570
+ }, z.core.$loose>, z.ZodObject<{
571
+ type: z.ZodLiteral<"resource">;
572
+ resource: z.ZodUnion<readonly [z.ZodObject<{
573
+ uri: z.ZodString;
574
+ name: z.ZodOptional<z.ZodString>;
575
+ title: z.ZodOptional<z.ZodString>;
576
+ mimeType: z.ZodOptional<z.ZodString>;
577
+ text: z.ZodString;
526
578
  }, z.core.$loose>, z.ZodObject<{
527
- type: z.ZodLiteral<"resource">;
528
- resource: z.ZodUnion<readonly [z.ZodObject<{
529
- uri: z.ZodString;
530
- name: z.ZodOptional<z.ZodString>;
531
- title: z.ZodOptional<z.ZodString>;
532
- mimeType: z.ZodOptional<z.ZodString>;
533
- text: z.ZodString;
534
- }, z.core.$loose>, z.ZodObject<{
535
- uri: z.ZodString;
536
- name: z.ZodOptional<z.ZodString>;
537
- title: z.ZodOptional<z.ZodString>;
538
- mimeType: z.ZodOptional<z.ZodString>;
539
- blob: z.ZodBase64;
540
- }, z.core.$loose>]>;
541
- }, z.core.$loose>, z.ZodObject<{
542
- type: z.ZodLiteral<"resource_link">;
543
- uri: z.ZodString;
544
- name: z.ZodString;
545
- description: z.ZodOptional<z.ZodString>;
546
- mimeType: z.ZodOptional<z.ZodString>;
547
- }, z.core.$loose>, z.ZodObject<{
548
- type: z.ZodString;
549
- }, z.core.$loose>]>>;
550
- structuredContent: z.ZodOptional<z.ZodUnknown>;
551
- isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
579
+ uri: z.ZodString;
580
+ name: z.ZodOptional<z.ZodString>;
581
+ title: z.ZodOptional<z.ZodString>;
582
+ mimeType: z.ZodOptional<z.ZodString>;
583
+ blob: z.ZodBase64;
584
+ }, z.core.$loose>]>;
585
+ }, z.core.$loose>, z.ZodObject<{
586
+ type: z.ZodLiteral<"resource_link">;
587
+ uri: z.ZodString;
588
+ name: z.ZodString;
589
+ description: z.ZodOptional<z.ZodString>;
590
+ mimeType: z.ZodOptional<z.ZodString>;
591
+ }, z.core.$loose>, z.ZodObject<{
592
+ type: z.ZodString;
593
+ }, z.core.$loose>]>>;
594
+ structuredContent: z.ZodOptional<z.ZodUnknown>;
595
+ isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
552
596
  }, z.core.$loose>, z.ZodPipe<z.ZodPipe<z.ZodObject<{
553
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
554
- resultType: z.ZodOptional<z.ZodString>;
555
- content: z.ZodOptional<z.ZodNever>;
556
- structuredContent: z.ZodJSONSchema;
557
- isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
597
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
598
+ resultType: z.ZodOptional<z.ZodString>;
599
+ content: z.ZodOptional<z.ZodNever>;
600
+ structuredContent: z.ZodJSONSchema;
601
+ isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
558
602
  }, z.core.$loose>, z.ZodTransform<{
603
+ [x: string]: unknown;
604
+ content: ({
559
605
  [x: string]: unknown;
560
- content: ({
561
- [x: string]: unknown;
562
- type: "text";
563
- text: string;
564
- } | {
565
- [x: string]: unknown;
566
- type: "image";
567
- data: string;
568
- mimeType: string;
569
- } | {
570
- [x: string]: unknown;
571
- type: "resource";
572
- resource: {
573
- [x: string]: unknown;
574
- uri: string;
575
- text: string;
576
- name?: string | undefined;
577
- title?: string | undefined;
578
- mimeType?: string | undefined;
579
- } | {
580
- [x: string]: unknown;
581
- uri: string;
582
- blob: string;
583
- name?: string | undefined;
584
- title?: string | undefined;
585
- mimeType?: string | undefined;
586
- };
587
- } | {
588
- [x: string]: unknown;
589
- type: "resource_link";
590
- uri: string;
591
- name: string;
592
- description?: string | undefined;
593
- mimeType?: string | undefined;
606
+ type: "text";
607
+ text: string;
608
+ } | {
609
+ [x: string]: unknown;
610
+ type: "image";
611
+ data: string;
612
+ mimeType: string;
613
+ } | {
614
+ [x: string]: unknown;
615
+ type: "resource";
616
+ resource: {
617
+ [x: string]: unknown;
618
+ uri: string;
619
+ text: string;
620
+ name?: string | undefined;
621
+ title?: string | undefined;
622
+ mimeType?: string | undefined;
594
623
  } | {
595
- [x: string]: unknown;
596
- type: string;
597
- })[];
598
- _meta?: {
599
- [x: string]: unknown;
600
- } | undefined;
601
- resultType?: string | undefined;
602
- structuredContent?: unknown;
603
- isError?: boolean | undefined;
624
+ [x: string]: unknown;
625
+ uri: string;
626
+ blob: string;
627
+ name?: string | undefined;
628
+ title?: string | undefined;
629
+ mimeType?: string | undefined;
630
+ };
631
+ } | {
632
+ [x: string]: unknown;
633
+ type: "resource_link";
634
+ uri: string;
635
+ name: string;
636
+ description?: string | undefined;
637
+ mimeType?: string | undefined;
638
+ } | {
639
+ [x: string]: unknown;
640
+ type: string;
641
+ })[];
642
+ _meta?: {
643
+ [x: string]: unknown;
644
+ } | undefined;
645
+ resultType?: string | undefined;
646
+ structuredContent?: unknown;
647
+ isError?: boolean | undefined;
604
648
  }, {
649
+ [x: string]: unknown;
650
+ structuredContent: z.core.util.JSONType;
651
+ _meta?: {
605
652
  [x: string]: unknown;
606
- structuredContent: z.core.util.JSONType;
607
- _meta?: {
608
- [x: string]: unknown;
609
- } | undefined;
610
- resultType?: string | undefined;
611
- content?: undefined;
612
- isError?: boolean | undefined;
653
+ } | undefined;
654
+ resultType?: string | undefined;
655
+ content?: undefined;
656
+ isError?: boolean | undefined;
613
657
  }>>, z.ZodObject<{
614
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
615
- resultType: z.ZodOptional<z.ZodString>;
616
- content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
617
- type: z.ZodLiteral<"text">;
618
- text: z.ZodString;
619
- }, z.core.$loose>, z.ZodObject<{
620
- type: z.ZodLiteral<"image">;
621
- data: z.ZodBase64;
622
- mimeType: z.ZodString;
623
- }, z.core.$loose>, z.ZodObject<{
624
- type: z.ZodLiteral<"resource">;
625
- resource: z.ZodUnion<readonly [z.ZodObject<{
626
- uri: z.ZodString;
627
- name: z.ZodOptional<z.ZodString>;
628
- title: z.ZodOptional<z.ZodString>;
629
- mimeType: z.ZodOptional<z.ZodString>;
630
- text: z.ZodString;
631
- }, z.core.$loose>, z.ZodObject<{
632
- uri: z.ZodString;
633
- name: z.ZodOptional<z.ZodString>;
634
- title: z.ZodOptional<z.ZodString>;
635
- mimeType: z.ZodOptional<z.ZodString>;
636
- blob: z.ZodBase64;
637
- }, z.core.$loose>]>;
658
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
659
+ resultType: z.ZodOptional<z.ZodString>;
660
+ content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
661
+ type: z.ZodLiteral<"text">;
662
+ text: z.ZodString;
663
+ }, z.core.$loose>, z.ZodObject<{
664
+ type: z.ZodLiteral<"image">;
665
+ data: z.ZodBase64;
666
+ mimeType: z.ZodString;
667
+ }, z.core.$loose>, z.ZodObject<{
668
+ type: z.ZodLiteral<"resource">;
669
+ resource: z.ZodUnion<readonly [z.ZodObject<{
670
+ uri: z.ZodString;
671
+ name: z.ZodOptional<z.ZodString>;
672
+ title: z.ZodOptional<z.ZodString>;
673
+ mimeType: z.ZodOptional<z.ZodString>;
674
+ text: z.ZodString;
638
675
  }, z.core.$loose>, z.ZodObject<{
639
- type: z.ZodLiteral<"resource_link">;
640
- uri: z.ZodString;
641
- name: z.ZodString;
642
- description: z.ZodOptional<z.ZodString>;
643
- mimeType: z.ZodOptional<z.ZodString>;
644
- }, z.core.$loose>, z.ZodObject<{
645
- type: z.ZodString;
646
- }, z.core.$loose>]>>;
647
- structuredContent: z.ZodOptional<z.ZodUnknown>;
648
- isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
676
+ uri: z.ZodString;
677
+ name: z.ZodOptional<z.ZodString>;
678
+ title: z.ZodOptional<z.ZodString>;
679
+ mimeType: z.ZodOptional<z.ZodString>;
680
+ blob: z.ZodBase64;
681
+ }, z.core.$loose>]>;
682
+ }, z.core.$loose>, z.ZodObject<{
683
+ type: z.ZodLiteral<"resource_link">;
684
+ uri: z.ZodString;
685
+ name: z.ZodString;
686
+ description: z.ZodOptional<z.ZodString>;
687
+ mimeType: z.ZodOptional<z.ZodString>;
688
+ }, z.core.$loose>, z.ZodObject<{
689
+ type: z.ZodString;
690
+ }, z.core.$loose>]>>;
691
+ structuredContent: z.ZodOptional<z.ZodUnknown>;
692
+ isError: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
649
693
  }, z.core.$loose>>]>, z.ZodObject<{
650
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
651
- resultType: z.ZodOptional<z.ZodString>;
652
- toolResult: z.ZodNonOptional<z.ZodUnknown>;
694
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
695
+ resultType: z.ZodOptional<z.ZodString>;
696
+ toolResult: z.ZodNonOptional<z.ZodUnknown>;
653
697
  }, z.core.$loose>]>;
654
698
  type CallToolResult = z.infer<typeof CallToolResultSchema>;
655
699
  declare const ListResourceTemplatesResultSchema: z.ZodObject<{
656
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
657
- resultType: z.ZodOptional<z.ZodString>;
658
- resourceTemplates: z.ZodArray<z.ZodObject<{
659
- uriTemplate: z.ZodString;
660
- name: z.ZodString;
661
- title: z.ZodOptional<z.ZodString>;
662
- description: z.ZodOptional<z.ZodString>;
663
- mimeType: z.ZodOptional<z.ZodString>;
664
- }, z.core.$loose>>;
700
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
701
+ resultType: z.ZodOptional<z.ZodString>;
702
+ resourceTemplates: z.ZodArray<z.ZodObject<{
703
+ uriTemplate: z.ZodString;
704
+ name: z.ZodString;
705
+ title: z.ZodOptional<z.ZodString>;
706
+ description: z.ZodOptional<z.ZodString>;
707
+ mimeType: z.ZodOptional<z.ZodString>;
708
+ }, z.core.$loose>>;
665
709
  }, z.core.$loose>;
666
710
  type ListResourceTemplatesResult = z.infer<typeof ListResourceTemplatesResultSchema>;
667
711
  declare const ReadResourceResultSchema: z.ZodObject<{
668
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
669
- resultType: z.ZodOptional<z.ZodString>;
670
- contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
671
- uri: z.ZodString;
672
- name: z.ZodOptional<z.ZodString>;
673
- title: z.ZodOptional<z.ZodString>;
674
- mimeType: z.ZodOptional<z.ZodString>;
675
- text: z.ZodString;
676
- }, z.core.$loose>, z.ZodObject<{
677
- uri: z.ZodString;
678
- name: z.ZodOptional<z.ZodString>;
679
- title: z.ZodOptional<z.ZodString>;
680
- mimeType: z.ZodOptional<z.ZodString>;
681
- blob: z.ZodBase64;
682
- }, z.core.$loose>]>>;
712
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
713
+ resultType: z.ZodOptional<z.ZodString>;
714
+ contents: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
715
+ uri: z.ZodString;
716
+ name: z.ZodOptional<z.ZodString>;
717
+ title: z.ZodOptional<z.ZodString>;
718
+ mimeType: z.ZodOptional<z.ZodString>;
719
+ text: z.ZodString;
720
+ }, z.core.$loose>, z.ZodObject<{
721
+ uri: z.ZodString;
722
+ name: z.ZodOptional<z.ZodString>;
723
+ title: z.ZodOptional<z.ZodString>;
724
+ mimeType: z.ZodOptional<z.ZodString>;
725
+ blob: z.ZodBase64;
726
+ }, z.core.$loose>]>>;
683
727
  }, z.core.$loose>;
684
728
  type ReadResourceResult = z.infer<typeof ReadResourceResultSchema>;
685
729
  declare const CompleteRequestParamsSchema: z.ZodObject<{
686
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
687
- ref: z.ZodUnion<readonly [z.ZodObject<{
688
- type: z.ZodLiteral<"ref/prompt">;
689
- name: z.ZodString;
690
- }, z.core.$loose>, z.ZodObject<{
691
- type: z.ZodLiteral<"ref/resource">;
692
- uri: z.ZodString;
693
- }, z.core.$loose>]>;
694
- argument: z.ZodObject<{
695
- name: z.ZodString;
696
- value: z.ZodString;
697
- }, z.core.$loose>;
698
- context: z.ZodOptional<z.ZodObject<{
699
- arguments: z.ZodRecord<z.ZodString, z.ZodString>;
700
- }, z.core.$loose>>;
730
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
731
+ ref: z.ZodUnion<readonly [z.ZodObject<{
732
+ type: z.ZodLiteral<"ref/prompt">;
733
+ name: z.ZodString;
734
+ }, z.core.$loose>, z.ZodObject<{
735
+ type: z.ZodLiteral<"ref/resource">;
736
+ uri: z.ZodString;
737
+ }, z.core.$loose>]>;
738
+ argument: z.ZodObject<{
739
+ name: z.ZodString;
740
+ value: z.ZodString;
741
+ }, z.core.$loose>;
742
+ context: z.ZodOptional<z.ZodObject<{
743
+ arguments: z.ZodRecord<z.ZodString, z.ZodString>;
744
+ }, z.core.$loose>>;
701
745
  }, z.core.$loose>;
702
746
  type CompleteRequestParams = z.infer<typeof CompleteRequestParamsSchema>;
703
747
  declare const CompleteResultSchema: z.ZodObject<{
704
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
705
- resultType: z.ZodOptional<z.ZodString>;
706
- completion: z.ZodObject<{
707
- values: z.ZodArray<z.ZodString>;
708
- total: z.ZodOptional<z.ZodNumber>;
709
- hasMore: z.ZodOptional<z.ZodBoolean>;
710
- }, z.core.$loose>;
748
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
749
+ resultType: z.ZodOptional<z.ZodString>;
750
+ completion: z.ZodObject<{
751
+ values: z.ZodArray<z.ZodString>;
752
+ total: z.ZodOptional<z.ZodNumber>;
753
+ hasMore: z.ZodOptional<z.ZodBoolean>;
754
+ }, z.core.$loose>;
711
755
  }, z.core.$loose>;
712
756
  type CompleteResult = z.infer<typeof CompleteResultSchema>;
713
757
  declare const ListPromptsResultSchema: z.ZodObject<{
714
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
715
- resultType: z.ZodOptional<z.ZodString>;
716
- nextCursor: z.ZodOptional<z.ZodString>;
717
- prompts: z.ZodArray<z.ZodObject<{
718
- name: z.ZodString;
719
- title: z.ZodOptional<z.ZodString>;
720
- description: z.ZodOptional<z.ZodString>;
721
- arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
722
- name: z.ZodString;
723
- description: z.ZodOptional<z.ZodString>;
724
- required: z.ZodOptional<z.ZodBoolean>;
725
- }, z.core.$loose>>>;
726
- }, z.core.$loose>>;
758
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
759
+ resultType: z.ZodOptional<z.ZodString>;
760
+ nextCursor: z.ZodOptional<z.ZodString>;
761
+ prompts: z.ZodArray<z.ZodObject<{
762
+ name: z.ZodString;
763
+ title: z.ZodOptional<z.ZodString>;
764
+ description: z.ZodOptional<z.ZodString>;
765
+ arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
766
+ name: z.ZodString;
767
+ description: z.ZodOptional<z.ZodString>;
768
+ required: z.ZodOptional<z.ZodBoolean>;
769
+ }, z.core.$loose>>>;
770
+ }, z.core.$loose>>;
727
771
  }, z.core.$loose>;
728
772
  type ListPromptsResult = z.infer<typeof ListPromptsResultSchema>;
729
773
  declare const GetPromptResultSchema: z.ZodObject<{
730
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
731
- resultType: z.ZodOptional<z.ZodString>;
732
- description: z.ZodOptional<z.ZodString>;
733
- messages: z.ZodArray<z.ZodObject<{
734
- role: z.ZodUnion<readonly [z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
735
- content: z.ZodUnion<readonly [z.ZodObject<{
736
- type: z.ZodLiteral<"text">;
737
- text: z.ZodString;
738
- }, z.core.$loose>, z.ZodObject<{
739
- type: z.ZodLiteral<"image">;
740
- data: z.ZodBase64;
741
- mimeType: z.ZodString;
742
- }, z.core.$loose>, z.ZodObject<{
743
- type: z.ZodLiteral<"resource">;
744
- resource: z.ZodUnion<readonly [z.ZodObject<{
745
- uri: z.ZodString;
746
- name: z.ZodOptional<z.ZodString>;
747
- title: z.ZodOptional<z.ZodString>;
748
- mimeType: z.ZodOptional<z.ZodString>;
749
- text: z.ZodString;
750
- }, z.core.$loose>, z.ZodObject<{
751
- uri: z.ZodString;
752
- name: z.ZodOptional<z.ZodString>;
753
- title: z.ZodOptional<z.ZodString>;
754
- mimeType: z.ZodOptional<z.ZodString>;
755
- blob: z.ZodBase64;
756
- }, z.core.$loose>]>;
757
- }, z.core.$loose>, z.ZodObject<{
758
- type: z.ZodLiteral<"resource_link">;
759
- uri: z.ZodString;
760
- name: z.ZodString;
761
- description: z.ZodOptional<z.ZodString>;
762
- mimeType: z.ZodOptional<z.ZodString>;
763
- }, z.core.$loose>]>;
764
- }, z.core.$loose>>;
774
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
775
+ resultType: z.ZodOptional<z.ZodString>;
776
+ description: z.ZodOptional<z.ZodString>;
777
+ messages: z.ZodArray<z.ZodObject<{
778
+ role: z.ZodUnion<readonly [z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
779
+ content: z.ZodUnion<readonly [z.ZodObject<{
780
+ type: z.ZodLiteral<"text">;
781
+ text: z.ZodString;
782
+ }, z.core.$loose>, z.ZodObject<{
783
+ type: z.ZodLiteral<"image">;
784
+ data: z.ZodBase64;
785
+ mimeType: z.ZodString;
786
+ }, z.core.$loose>, z.ZodObject<{
787
+ type: z.ZodLiteral<"resource">;
788
+ resource: z.ZodUnion<readonly [z.ZodObject<{
789
+ uri: z.ZodString;
790
+ name: z.ZodOptional<z.ZodString>;
791
+ title: z.ZodOptional<z.ZodString>;
792
+ mimeType: z.ZodOptional<z.ZodString>;
793
+ text: z.ZodString;
794
+ }, z.core.$loose>, z.ZodObject<{
795
+ uri: z.ZodString;
796
+ name: z.ZodOptional<z.ZodString>;
797
+ title: z.ZodOptional<z.ZodString>;
798
+ mimeType: z.ZodOptional<z.ZodString>;
799
+ blob: z.ZodBase64;
800
+ }, z.core.$loose>]>;
801
+ }, z.core.$loose>, z.ZodObject<{
802
+ type: z.ZodLiteral<"resource_link">;
803
+ uri: z.ZodString;
804
+ name: z.ZodString;
805
+ description: z.ZodOptional<z.ZodString>;
806
+ mimeType: z.ZodOptional<z.ZodString>;
807
+ }, z.core.$loose>]>;
808
+ }, z.core.$loose>>;
765
809
  }, z.core.$loose>;
766
810
  type GetPromptResult = z.infer<typeof GetPromptResultSchema>;
767
- declare const ElicitationRequestSchema: z.ZodObject<{
768
- method: z.ZodLiteral<"elicitation/create">;
769
- params: z.ZodObject<{
770
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
771
- message: z.ZodString;
772
- requestedSchema: z.ZodUnknown;
773
- }, z.core.$loose>;
811
+ export declare const ElicitationRequestSchema: z.ZodObject<{
812
+ method: z.ZodLiteral<"elicitation/create">;
813
+ params: z.ZodObject<{
814
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
815
+ message: z.ZodString;
816
+ requestedSchema: z.ZodUnknown;
817
+ }, z.core.$loose>;
774
818
  }, z.core.$strip>;
775
819
  type ElicitationRequest = z.infer<typeof ElicitationRequestSchema>;
776
- declare const ElicitResultSchema: z.ZodObject<{
777
- _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
778
- resultType: z.ZodOptional<z.ZodString>;
779
- action: z.ZodUnion<readonly [z.ZodLiteral<"accept">, z.ZodLiteral<"decline">, z.ZodLiteral<"cancel">]>;
780
- content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
820
+ export declare const ElicitResultSchema: z.ZodObject<{
821
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
822
+ resultType: z.ZodOptional<z.ZodString>;
823
+ action: z.ZodUnion<readonly [z.ZodLiteral<"accept">, z.ZodLiteral<"decline">, z.ZodLiteral<"cancel">]>;
824
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
781
825
  }, z.core.$loose>;
782
826
  type ElicitResult = z.infer<typeof ElicitResultSchema>;
783
-
827
+ //#endregion
828
+ //#region src/tool/mcp-client.d.ts
784
829
  interface MCPClientConfig {
785
- /** Transport configuration for connecting to the MCP server */
786
- transport: MCPTransportConfig | MCPTransport;
787
- /**
788
- * Whether transports that support stateless protocol discovery should probe
789
- * with `server/discover` before falling back to legacy initialization.
790
- *
791
- * Disable this for legacy servers that require `initialize` to be the first
792
- * request.
793
- *
794
- * @default true
795
- */
796
- protocolVersionDiscovery?: boolean;
797
- /**
798
- * Options that bound or cancel transport startup and the initialize request.
799
- */
800
- initializationOptions?: RequestOptions;
801
- /** Optional callback for uncaught errors */
802
- onUncaughtError?: (error: unknown) => void;
803
- /**
804
- * Maximum number of retries for transient MCP tool call failures.
805
- *
806
- * Set to 0 to disable retries. Retries only apply to tools/call requests.
807
- * JSON-RPC application errors, such as invalid params, are not retried.
808
- *
809
- * @default 0
810
- */
811
- maxRetries?: number;
812
- /**
813
- * Initialize result from a previous MCP session. When provided, the client
814
- * starts the transport and reuses this metadata without sending a new
815
- * initialize request.
816
- */
817
- initialInitializeResult?: InitializeResult;
818
- /** Optional client name, defaults to 'ai-sdk-mcp-client' */
819
- clientName?: string;
820
- /**
821
- * Optional client name, defaults to 'ai-sdk-mcp-client'
822
- *
823
- * @deprecated Use `clientName` instead.
824
- */
825
- name?: string;
826
- /** Optional client version, defaults to '1.0.0' */
827
- version?: string;
828
- /**
829
- * Optional client capabilities to advertise during initialization
830
- *
831
- * NOTE: It is up to the client application to handle the requests properly. This parameter just helps surface the request from the server
832
- */
833
- capabilities?: ClientCapabilities;
830
+ /** Transport configuration for connecting to the MCP server */
831
+ transport: MCPTransportConfig | MCPTransport;
832
+ /**
833
+ * Whether transports that support stateless protocol discovery should probe
834
+ * with `server/discover` before falling back to legacy initialization.
835
+ *
836
+ * Disable this for legacy servers that require `initialize` to be the first
837
+ * request.
838
+ *
839
+ * @default true
840
+ */
841
+ protocolVersionDiscovery?: boolean;
842
+ /**
843
+ * Options that bound or cancel transport startup and the initialize request.
844
+ */
845
+ initializationOptions?: RequestOptions;
846
+ /** Optional callback for uncaught errors */
847
+ onUncaughtError?: (error: unknown) => void;
848
+ /**
849
+ * Maximum number of retries for transient MCP tool call failures.
850
+ *
851
+ * Set to 0 to disable retries. Retries only apply to tools/call requests.
852
+ * JSON-RPC application errors, such as invalid params, are not retried.
853
+ *
854
+ * @default 0
855
+ */
856
+ maxRetries?: number;
857
+ /**
858
+ * Initialize result from a previous MCP session. When provided, the client
859
+ * starts the transport and reuses this metadata without sending a new
860
+ * initialize request.
861
+ */
862
+ initialInitializeResult?: InitializeResult;
863
+ /** Optional client name, defaults to 'ai-sdk-mcp-client' */
864
+ clientName?: string;
865
+ /**
866
+ * Optional client name, defaults to 'ai-sdk-mcp-client'
867
+ *
868
+ * @deprecated Use `clientName` instead.
869
+ */
870
+ name?: string;
871
+ /** Optional client version, defaults to '1.0.0' */
872
+ version?: string;
873
+ /**
874
+ * Optional client capabilities to advertise during initialization
875
+ *
876
+ * NOTE: It is up to the client application to handle the requests properly. This parameter just helps surface the request from the server
877
+ */
878
+ capabilities?: ClientCapabilities;
834
879
  }
835
- declare function createMCPClient(config: MCPClientConfig): Promise<MCPClient>;
880
+ export declare function createMCPClient(config: MCPClientConfig): Promise<MCPClient>;
836
881
  interface MCPClient {
837
- /**
838
- * Information about the connected MCP server, as reported during initialization.
839
- * @see https://modelcontextprotocol.io/specification/2025-11-25/schema#implementation
840
- */
841
- readonly serverInfo: Configuration;
842
- /**
843
- * The full initialize result used by this client, either from the server
844
- * during initialization or from `initialInitializeResult`.
845
- */
846
- readonly initializeResult: InitializeResult;
847
- /**
848
- * Optional instructions provided by the server during the initialize handshake.
849
- *
850
- * These describe how to use the server and its features, and can be used by clients
851
- * to improve LLM interactions (e.g. by including them in the system prompt).
852
- *
853
- * @see https://modelcontextprotocol.io/specification/2025-11-25/schema#initializeresult
854
- */
855
- readonly instructions?: string;
856
- tools<TOOL_SCHEMAS extends ToolSchemas = 'automatic'>(options?: {
857
- schemas?: TOOL_SCHEMAS;
858
- }): Promise<McpToolSet<TOOL_SCHEMAS>>;
859
- /**
860
- * Lists available tools from the MCP server.
861
- */
862
- listTools(options?: {
863
- params?: PaginatedRequest['params'];
864
- options?: RequestOptions;
865
- }): Promise<ListToolsResult>;
866
- /**
867
- * Calls a tool on the MCP server.
868
- */
869
- callTool(args: {
870
- name: string;
871
- arguments?: Record<string, unknown>;
872
- options?: RequestOptions;
873
- }): Promise<CallToolResult>;
874
- /**
875
- * Creates AI SDK tools from tool definitions.
876
- */
877
- toolsFromDefinitions<TOOL_SCHEMAS extends ToolSchemas = 'automatic'>(definitions: ListToolsResult, options?: {
878
- schemas?: TOOL_SCHEMAS;
879
- }): McpToolSet<TOOL_SCHEMAS>;
880
- listResources(options?: {
881
- params?: PaginatedRequest['params'];
882
- options?: RequestOptions;
883
- }): Promise<ListResourcesResult>;
884
- readResource(args: {
885
- uri: string;
886
- options?: RequestOptions;
887
- }): Promise<ReadResourceResult>;
888
- listResourceTemplates(options?: {
889
- options?: RequestOptions;
890
- }): Promise<ListResourceTemplatesResult>;
891
- experimental_listPrompts(options?: {
892
- params?: PaginatedRequest['params'];
893
- options?: RequestOptions;
894
- }): Promise<ListPromptsResult>;
895
- experimental_getPrompt(args: {
896
- name: string;
897
- arguments?: Record<string, unknown>;
898
- options?: RequestOptions;
899
- }): Promise<GetPromptResult>;
900
- complete(args: CompleteRequestParams & {
901
- options?: RequestOptions;
902
- }): Promise<CompleteResult>;
903
- onElicitationRequest(schema: typeof ElicitationRequestSchema, handler: (request: ElicitationRequest) => Promise<ElicitResult> | ElicitResult): void;
904
- close: () => Promise<void>;
882
+ /**
883
+ * Information about the connected MCP server, as reported during initialization.
884
+ * @see https://modelcontextprotocol.io/specification/2025-11-25/schema#implementation
885
+ */
886
+ readonly serverInfo: Configuration;
887
+ /**
888
+ * The full initialize result used by this client, either from the server
889
+ * during initialization or from `initialInitializeResult`.
890
+ */
891
+ readonly initializeResult: InitializeResult;
892
+ /**
893
+ * Optional instructions provided by the server during the initialize handshake.
894
+ *
895
+ * These describe how to use the server and its features, and can be used by clients
896
+ * to improve LLM interactions (e.g. by including them in the system prompt).
897
+ *
898
+ * @see https://modelcontextprotocol.io/specification/2025-11-25/schema#initializeresult
899
+ */
900
+ readonly instructions?: string;
901
+ tools<TOOL_SCHEMAS extends ToolSchemas = 'automatic'>(options?: {
902
+ schemas?: TOOL_SCHEMAS;
903
+ }): Promise<McpToolSet<TOOL_SCHEMAS>>;
904
+ /**
905
+ * Lists available tools from the MCP server.
906
+ */
907
+ listTools(options?: {
908
+ params?: PaginatedRequest['params'];
909
+ options?: RequestOptions;
910
+ }): Promise<ListToolsResult>;
911
+ /**
912
+ * Calls a tool on the MCP server.
913
+ */
914
+ callTool(args: {
915
+ name: string;
916
+ arguments?: Record<string, unknown>;
917
+ options?: RequestOptions;
918
+ }): Promise<CallToolResult>;
919
+ /**
920
+ * Creates AI SDK tools from tool definitions.
921
+ */
922
+ toolsFromDefinitions<TOOL_SCHEMAS extends ToolSchemas = 'automatic'>(definitions: ListToolsResult, options?: {
923
+ schemas?: TOOL_SCHEMAS;
924
+ }): McpToolSet<TOOL_SCHEMAS>;
925
+ listResources(options?: {
926
+ params?: PaginatedRequest['params'];
927
+ options?: RequestOptions;
928
+ }): Promise<ListResourcesResult>;
929
+ readResource(args: {
930
+ uri: string;
931
+ options?: RequestOptions;
932
+ }): Promise<ReadResourceResult>;
933
+ listResourceTemplates(options?: {
934
+ options?: RequestOptions;
935
+ }): Promise<ListResourceTemplatesResult>;
936
+ experimental_listPrompts(options?: {
937
+ params?: PaginatedRequest['params'];
938
+ options?: RequestOptions;
939
+ }): Promise<ListPromptsResult>;
940
+ experimental_getPrompt(args: {
941
+ name: string;
942
+ arguments?: Record<string, unknown>;
943
+ options?: RequestOptions;
944
+ }): Promise<GetPromptResult>;
945
+ complete(args: CompleteRequestParams & {
946
+ options?: RequestOptions;
947
+ }): Promise<CompleteResult>;
948
+ onElicitationRequest(schema: typeof ElicitationRequestSchema, handler: (request: ElicitationRequest) => Promise<ElicitResult> | ElicitResult): void;
949
+ close: () => Promise<void>;
905
950
  }
906
-
951
+ //#endregion
952
+ //#region src/tool/mcp-apps.d.ts
907
953
  /**
908
954
  * MIME type for HTML resources that are meant to be rendered as MCP Apps.
909
955
  */
910
- declare const MCP_APP_MIME_TYPE: "text/html;profile=mcp-app";
956
+ export declare const MCP_APP_MIME_TYPE: "text/html;profile=mcp-app";
911
957
  /**
912
958
  * Client capabilities to pass to `createMCPClient` when the host supports MCP Apps.
913
959
  */
914
- declare const mcpAppClientCapabilities: {
915
- readonly extensions: {
916
- readonly "io.modelcontextprotocol/ui": {
917
- readonly mimeTypes: readonly ["text/html;profile=mcp-app"];
918
- };
960
+ export declare const mcpAppClientCapabilities: {
961
+ readonly extensions: {
962
+ readonly "io.modelcontextprotocol/ui": {
963
+ readonly mimeTypes: readonly ["text/html;profile=mcp-app"];
919
964
  };
965
+ };
920
966
  };
921
967
  /**
922
968
  * Content security policy metadata requested by an MCP App resource.
923
969
  */
924
970
  type MCPAppResourceCSP = {
925
- connectDomains?: string[];
926
- resourceDomains?: string[];
927
- frameDomains?: string[];
928
- [key: string]: unknown;
971
+ connectDomains?: string[];
972
+ resourceDomains?: string[];
973
+ frameDomains?: string[];
974
+ [key: string]: unknown;
929
975
  };
930
976
  /**
931
977
  * Host rendering metadata from an MCP App resource.
932
978
  */
933
979
  type MCPAppResourceMeta = {
934
- prefersBorder?: boolean;
935
- csp?: MCPAppResourceCSP;
936
- permissions?: Record<string, unknown>;
937
- [key: string]: unknown;
980
+ prefersBorder?: boolean;
981
+ csp?: MCPAppResourceCSP;
982
+ permissions?: Record<string, unknown>;
983
+ [key: string]: unknown;
938
984
  };
939
985
  /**
940
986
  * HTML and metadata needed by a host to render an MCP App.
941
987
  */
942
988
  type MCPAppResource = {
943
- uri: string;
944
- mimeType: typeof MCP_APP_MIME_TYPE;
945
- html: string;
946
- meta?: MCPAppResourceMeta;
989
+ uri: string;
990
+ mimeType: typeof MCP_APP_MIME_TYPE;
991
+ html: string;
992
+ meta?: MCPAppResourceMeta;
947
993
  };
948
994
  /**
949
995
  * Splits tool definitions into model-visible tools and app-visible tools.
950
996
  */
951
- declare function splitMCPAppTools(definitions: ListToolsResult): {
952
- modelVisible: ListToolsResult;
953
- appVisible: ListToolsResult;
997
+ export declare function splitMCPAppTools(definitions: ListToolsResult): {
998
+ modelVisible: ListToolsResult;
999
+ appVisible: ListToolsResult;
954
1000
  };
955
1001
  /**
956
1002
  * Reads a `ui://` resource from an MCP server and normalizes it for rendering.
957
1003
  */
958
- declare function readMCPAppResource({ client, uri, options, }: {
959
- client: Pick<MCPClient, 'readResource'>;
960
- uri: string;
961
- options?: RequestOptions;
1004
+ export declare function readMCPAppResource({ client, uri, options }: {
1005
+ client: Pick<MCPClient, 'readResource'>;
1006
+ uri: string;
1007
+ options?: RequestOptions;
962
1008
  }): Promise<MCPAppResource>;
963
-
1009
+ //#endregion
1010
+ //#region src/tool/mcp-app-fingerprint.d.ts
964
1011
  /**
965
1012
  * Stable SHA-256 digest (base64url) over an MCP App resource's `html`, `csp`,
966
1013
  * and `permissions`.
@@ -969,11 +1016,61 @@ declare function readMCPAppResource({ client, uri, options, }: {
969
1016
  * {@link detectMCPAppResourceDrift} to detect a changed resource. Baseline
970
1017
  * storage and the response are the host's concern, mirroring `fingerprintTools`.
971
1018
  */
972
- declare function fingerprintMCPAppResource(resource: MCPAppResource): Promise<string>;
1019
+ export declare function fingerprintMCPAppResource(resource: MCPAppResource): Promise<string>;
973
1020
  /**
974
1021
  * Compares two fingerprints from {@link fingerprintMCPAppResource}. Returns
975
1022
  * `true` when the current resource differs from its baseline.
976
1023
  */
977
- declare function detectMCPAppResourceDrift(current: string, baseline: string): boolean;
978
-
979
- export { type CallToolResult, type CompleteRequestParams, type CompleteResult, type Configuration, type ElicitResult, ElicitResultSchema, type ElicitationRequest, ElicitationRequestSchema, type InitializeResult, type JSONRPCError, type JSONRPCMessage, type JSONRPCNotification, type JSONRPCRequest, type JSONRPCResponse, type ListToolsResult, type MCPAppResource, type MCPAppResourceCSP, type MCPAppResourceMeta, type MCPClient, type ClientCapabilities as MCPClientCapabilities, type MCPClientConfig, type MCPTransport, type MCPTransportCloseOptions, type MCPTransportSendOptions, MCP_APP_MIME_TYPE, type McpProviderMetadata, type McpToolAnnotations, type OAuthAuthorizationServerInformation, type OAuthClientInformation, type OAuthClientMetadata, type OAuthClientProvider, type OAuthTokens, UnauthorizedError, auth, createMCPClient, detectMCPAppResourceDrift, type MCPClient as experimental_MCPClient, type ClientCapabilities as experimental_MCPClientCapabilities, type MCPClientConfig as experimental_MCPClientConfig, createMCPClient as experimental_createMCPClient, fingerprintMCPAppResource, mcpAppClientCapabilities, readMCPAppResource, splitMCPAppTools, validateJSONRPCMessage };
1024
+ export declare function detectMCPAppResourceDrift(current: string, baseline: string): boolean;
1025
+ //#endregion
1026
+ //#region src/error/mcp-client-error.d.ts
1027
+ declare const symbol: unique symbol;
1028
+ /**
1029
+ * An error occurred with the MCP client.
1030
+ */
1031
+ export declare class MCPClientError extends AISDKError {
1032
+ private readonly [symbol];
1033
+ readonly data?: unknown;
1034
+ /**
1035
+ * JSON-RPC error code from the server response, per the JSON-RPC 2.0
1036
+ * spec (e.g. `-32601` method-not-found, `-32602` invalid-params, or
1037
+ * MCP-specific codes such as `-32002` resource-not-found). This is the
1038
+ * application-level error code populated from `error.code` in the
1039
+ * server's JSON-RPC error payload. Distinct from `statusCode`, which
1040
+ * is the HTTP transport status.
1041
+ */
1042
+ readonly code?: number;
1043
+ /**
1044
+ * HTTP status code from the failed response, when the error originated
1045
+ * from an HTTP-based transport. Undefined for stdio transport
1046
+ * errors and for failures that do not have an associated response
1047
+ * status (e.g. network errors, abort). Distinct from `code`, which is
1048
+ * the JSON-RPC application error code.
1049
+ */
1050
+ readonly statusCode?: number;
1051
+ /**
1052
+ * URL of the MCP endpoint the failing request was sent to, when the
1053
+ * error originated from an HTTP transport failure.
1054
+ */
1055
+ readonly url?: string;
1056
+ /**
1057
+ * Body of the failing HTTP response, decoded as text, when available.
1058
+ * Undefined when the body could not be read or the error did not have
1059
+ * an associated response.
1060
+ */
1061
+ readonly responseBody?: string;
1062
+ constructor({ name, message, cause, data, code, statusCode, url, responseBody }: {
1063
+ name?: string;
1064
+ message: string;
1065
+ cause?: unknown;
1066
+ data?: unknown;
1067
+ code?: number;
1068
+ statusCode?: number;
1069
+ url?: string;
1070
+ responseBody?: string;
1071
+ });
1072
+ static isInstance(error: unknown): error is MCPClientError;
1073
+ }
1074
+ //#endregion
1075
+ export { type CallToolResult, type CompleteRequestParams, type CompleteResult, type Configuration, type ElicitResult, type ElicitationRequest, type InitializeResult, type JSONRPCError, type JSONRPCMessage, type JSONRPCNotification, type JSONRPCRequest, type JSONRPCResponse, type ListToolsResult, type MCPAppResource, type MCPAppResourceCSP, type MCPAppResourceMeta, type MCPClient, type MCPClient as experimental_MCPClient, type ClientCapabilities as MCPClientCapabilities, type ClientCapabilities as experimental_MCPClientCapabilities, type MCPClientConfig, type MCPClientConfig as experimental_MCPClientConfig, type MCPTransport, type MCPTransportCloseOptions, type MCPTransportSendOptions, type McpProviderMetadata, type McpToolAnnotations, type OAuthAuthorizationServerInformation, type OAuthClientInformation, type OAuthClientMetadata, type OAuthClientProvider, type OAuthTokens, createMCPClient as experimental_createMCPClient };
1076
+ //# sourceMappingURL=index.d.ts.map