indusagi 0.13.7 → 0.13.8

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 (446) hide show
  1. package/dist/agent.js +28713 -0
  2. package/dist/ai.js +19964 -0
  3. package/dist/capabilities.js +2730 -0
  4. package/dist/cli.js +9 -0
  5. package/dist/connectors-saas.js +3355 -0
  6. package/dist/index.js +18211 -0
  7. package/dist/interop.js +3247 -0
  8. package/dist/llmgateway.js +3343 -0
  9. package/dist/mcp.js +2448 -0
  10. package/dist/memory.js +0 -0
  11. package/dist/react-host/index.js +101 -0
  12. package/dist/react-host/ink.js +97 -0
  13. package/dist/react-host/jsx-runtime.js +95 -0
  14. package/dist/react-ink.js +3834 -0
  15. package/dist/runtime.js +4521 -0
  16. package/dist/sarvam-mcp.js +960 -0
  17. package/dist/shell-app.js +12435 -0
  18. package/dist/smithy.js +8133 -0
  19. package/dist/swarm.js +8918 -0
  20. package/dist/tracing.js +761 -0
  21. package/dist/tui.js +2213 -0
  22. package/dist/types/capabilities/backends/index.d.ts +10 -0
  23. package/dist/types/capabilities/backends/node-backends.d.ts +30 -0
  24. package/dist/types/capabilities/capabilities.test.d.ts +14 -0
  25. package/dist/types/capabilities/files/diff.d.ts +49 -0
  26. package/dist/types/capabilities/files/edit.d.ts +21 -0
  27. package/dist/types/capabilities/files/ls.d.ts +16 -0
  28. package/dist/types/capabilities/files/read-state-gate.d.ts +69 -0
  29. package/dist/types/capabilities/files/read-state-gate.test.d.ts +14 -0
  30. package/dist/types/capabilities/files/read.d.ts +15 -0
  31. package/dist/types/capabilities/files/write.d.ts +16 -0
  32. package/dist/types/capabilities/index.d.ts +29 -0
  33. package/dist/types/capabilities/kernel/backends.d.ts +119 -0
  34. package/dist/types/capabilities/kernel/context.d.ts +52 -0
  35. package/dist/types/capabilities/kernel/index.d.ts +24 -0
  36. package/dist/types/capabilities/kernel/output.d.ts +40 -0
  37. package/dist/types/capabilities/kernel/registry.d.ts +61 -0
  38. package/dist/types/capabilities/kernel/spec.d.ts +168 -0
  39. package/dist/types/capabilities/planning/todo.d.ts +62 -0
  40. package/dist/types/capabilities/registry.d.ts +44 -0
  41. package/dist/types/capabilities/search/find.d.ts +33 -0
  42. package/dist/types/capabilities/search/grep.d.ts +30 -0
  43. package/dist/types/capabilities/shell/bash.d.ts +18 -0
  44. package/dist/types/capabilities/shell/process.d.ts +33 -0
  45. package/dist/types/capabilities/web/webfetch.d.ts +25 -0
  46. package/dist/types/capabilities/web/websearch.d.ts +23 -0
  47. package/dist/types/connectors-saas/connectors-saas.test.d.ts +12 -0
  48. package/dist/types/connectors-saas/index.d.ts +16 -0
  49. package/dist/types/connectors-saas/saas/adapter/composio-backend.d.ts +60 -0
  50. package/dist/types/connectors-saas/saas/control/connect.d.ts +114 -0
  51. package/dist/types/connectors-saas/saas/control/tools.d.ts +67 -0
  52. package/dist/types/connectors-saas/saas/core/builder.d.ts +86 -0
  53. package/dist/types/connectors-saas/saas/core/cache.d.ts +53 -0
  54. package/dist/types/connectors-saas/saas/core/index.d.ts +14 -0
  55. package/dist/types/connectors-saas/saas/core/port.d.ts +157 -0
  56. package/dist/types/connectors-saas/saas/core/scope-planner.d.ts +74 -0
  57. package/dist/types/connectors-saas/saas/gateway.d.ts +133 -0
  58. package/dist/types/connectors-saas/saas/render/format.d.ts +54 -0
  59. package/dist/types/connectors-saas/saas/render/index.d.ts +19 -0
  60. package/dist/types/connectors-saas/saas/render/summarizers.d.ts +58 -0
  61. package/dist/types/connectors-sarvam/connect.d.ts +14 -0
  62. package/dist/types/connectors-sarvam/connectors-sarvam.test.d.ts +14 -0
  63. package/dist/types/connectors-sarvam/index.d.ts +14 -0
  64. package/dist/types/connectors-sarvam/toolbox.d.ts +19 -0
  65. package/dist/types/connectors-sarvam/types.d.ts +49 -0
  66. package/dist/types/connectors-zoho/connect.d.ts +22 -0
  67. package/dist/types/connectors-zoho/connectors-zoho.test.d.ts +10 -0
  68. package/dist/types/connectors-zoho/index.d.ts +13 -0
  69. package/dist/types/connectors-zoho/toolbox.d.ts +19 -0
  70. package/dist/types/connectors-zoho/types.d.ts +56 -0
  71. package/dist/types/facade/agent.d.ts +1 -0
  72. package/dist/types/facade/ai.d.ts +1 -0
  73. package/dist/types/facade/bot/actions/bash.d.ts +71 -0
  74. package/dist/types/facade/bot/actions/bash.test.d.ts +1 -0
  75. package/dist/types/facade/bot/actions/checkpoint.d.ts +49 -0
  76. package/dist/types/facade/bot/actions/checkpoint.test.d.ts +1 -0
  77. package/dist/types/facade/bot/actions/composio/accounts.d.ts +22 -0
  78. package/dist/types/facade/bot/actions/composio/client.d.ts +39 -0
  79. package/dist/types/facade/bot/actions/composio/connect.d.ts +19 -0
  80. package/dist/types/facade/bot/actions/composio/enable.d.ts +25 -0
  81. package/dist/types/facade/bot/actions/composio/execute.d.ts +26 -0
  82. package/dist/types/facade/bot/actions/composio/helpers.d.ts +16 -0
  83. package/dist/types/facade/bot/actions/composio/index.d.ts +9 -0
  84. package/dist/types/facade/bot/actions/composio/provider.d.ts +8 -0
  85. package/dist/types/facade/bot/actions/composio/toolkits.d.ts +22 -0
  86. package/dist/types/facade/bot/actions/composio/tools.d.ts +28 -0
  87. package/dist/types/facade/bot/actions/composio/types.d.ts +137 -0
  88. package/dist/types/facade/bot/actions/crew/activity-tracker.d.ts +65 -0
  89. package/dist/types/facade/bot/actions/crew/cleanup.d.ts +50 -0
  90. package/dist/types/facade/bot/actions/crew/fs-lock.d.ts +11 -0
  91. package/dist/types/facade/bot/actions/crew/index.d.ts +11 -0
  92. package/dist/types/facade/bot/actions/crew/mailbox.d.ts +20 -0
  93. package/dist/types/facade/bot/actions/crew/model-policy.d.ts +22 -0
  94. package/dist/types/facade/bot/actions/crew/names.d.ts +27 -0
  95. package/dist/types/facade/bot/actions/crew/protocol.d.ts +74 -0
  96. package/dist/types/facade/bot/actions/crew/task-store.d.ts +88 -0
  97. package/dist/types/facade/bot/actions/crew/team-attach-claim.d.ts +35 -0
  98. package/dist/types/facade/bot/actions/crew/team-config.d.ts +54 -0
  99. package/dist/types/facade/bot/actions/crew/worktree.d.ts +39 -0
  100. package/dist/types/facade/bot/actions/edit-diff.d.ts +66 -0
  101. package/dist/types/facade/bot/actions/edit-utils.d.ts +86 -0
  102. package/dist/types/facade/bot/actions/edit.d.ts +59 -0
  103. package/dist/types/facade/bot/actions/edit.test.d.ts +1 -0
  104. package/dist/types/facade/bot/actions/find.d.ts +27 -0
  105. package/dist/types/facade/bot/actions/find.test.d.ts +1 -0
  106. package/dist/types/facade/bot/actions/grep.d.ts +53 -0
  107. package/dist/types/facade/bot/actions/grep.test.d.ts +1 -0
  108. package/dist/types/facade/bot/actions/index.d.ts +316 -0
  109. package/dist/types/facade/bot/actions/kit/hook-runner.d.ts +12 -0
  110. package/dist/types/facade/bot/actions/kit/image-resize.d.ts +19 -0
  111. package/dist/types/facade/bot/actions/kit/mime.d.ts +1 -0
  112. package/dist/types/facade/bot/actions/kit/shell.d.ts +12 -0
  113. package/dist/types/facade/bot/actions/ls.d.ts +41 -0
  114. package/dist/types/facade/bot/actions/path-utils.d.ts +8 -0
  115. package/dist/types/facade/bot/actions/process-controller.d.ts +14 -0
  116. package/dist/types/facade/bot/actions/process-manager.d.ts +59 -0
  117. package/dist/types/facade/bot/actions/process-types.d.ts +73 -0
  118. package/dist/types/facade/bot/actions/process.d.ts +37 -0
  119. package/dist/types/facade/bot/actions/read-state.d.ts +83 -0
  120. package/dist/types/facade/bot/actions/read-state.test.d.ts +1 -0
  121. package/dist/types/facade/bot/actions/read.d.ts +43 -0
  122. package/dist/types/facade/bot/actions/read.test.d.ts +1 -0
  123. package/dist/types/facade/bot/actions/registry.d.ts +20 -0
  124. package/dist/types/facade/bot/actions/sandbox-backend.d.ts +99 -0
  125. package/dist/types/facade/bot/actions/sandbox-backend.test.d.ts +1 -0
  126. package/dist/types/facade/bot/actions/todo-store.d.ts +76 -0
  127. package/dist/types/facade/bot/actions/todo-types.d.ts +72 -0
  128. package/dist/types/facade/bot/actions/todo.d.ts +76 -0
  129. package/dist/types/facade/bot/actions/truncate.d.ts +78 -0
  130. package/dist/types/facade/bot/actions/webfetch.d.ts +35 -0
  131. package/dist/types/facade/bot/actions/websearch.d.ts +37 -0
  132. package/dist/types/facade/bot/actions/websearch.test.d.ts +1 -0
  133. package/dist/types/facade/bot/actions/write.d.ts +45 -0
  134. package/dist/types/facade/bot/agent-loop.d.ts +30 -0
  135. package/dist/types/facade/bot/agent-loop.test.d.ts +1 -0
  136. package/dist/types/facade/bot/agent.d.ts +140 -0
  137. package/dist/types/facade/bot/error-handler.d.ts +7 -0
  138. package/dist/types/facade/bot/event-bus.d.ts +8 -0
  139. package/dist/types/facade/bot/index.d.ts +7 -0
  140. package/dist/types/facade/bot/messages.d.ts +83 -0
  141. package/dist/types/facade/bot/permission-gate.test.d.ts +1 -0
  142. package/dist/types/facade/bot/proxy.d.ts +70 -0
  143. package/dist/types/facade/bot/session-manager.d.ts +409 -0
  144. package/dist/types/facade/bot/state-manager.d.ts +21 -0
  145. package/dist/types/facade/bot/telemetry.d.ts +6 -0
  146. package/dist/types/facade/bot/types.d.ts +267 -0
  147. package/dist/types/facade/mcp-core/client-pool.d.ts +105 -0
  148. package/dist/types/facade/mcp-core/client.d.ts +245 -0
  149. package/dist/types/facade/mcp-core/client.test.d.ts +18 -0
  150. package/dist/types/facade/mcp-core/config.d.ts +60 -0
  151. package/dist/types/facade/mcp-core/errors.d.ts +103 -0
  152. package/dist/types/facade/mcp-core/index.d.ts +59 -0
  153. package/dist/types/facade/mcp-core/oauth/flow.d.ts +72 -0
  154. package/dist/types/facade/mcp-core/oauth/index.d.ts +18 -0
  155. package/dist/types/facade/mcp-core/oauth/oauth.test.d.ts +8 -0
  156. package/dist/types/facade/mcp-core/oauth/provider.d.ts +51 -0
  157. package/dist/types/facade/mcp-core/oauth/token-store.d.ts +31 -0
  158. package/dist/types/facade/mcp-core/oauth/types.d.ts +96 -0
  159. package/dist/types/facade/mcp-core/schema-converter.d.ts +67 -0
  160. package/dist/types/facade/mcp-core/server.d.ts +110 -0
  161. package/dist/types/facade/mcp-core/tool-factory.d.ts +62 -0
  162. package/dist/types/facade/mcp-core/toolbox-bridge.d.ts +46 -0
  163. package/dist/types/facade/mcp-core/toolbox-bridge.test.d.ts +8 -0
  164. package/dist/types/facade/mcp-core/types.d.ts +298 -0
  165. package/dist/types/facade/mcp.d.ts +1 -0
  166. package/dist/types/facade/memory.d.ts +1 -0
  167. package/dist/types/facade/ml/adapters/amazon-bedrock.d.ts +32 -0
  168. package/dist/types/facade/ml/adapters/anthropic-retry.test.d.ts +1 -0
  169. package/dist/types/facade/ml/adapters/anthropic.d.ts +78 -0
  170. package/dist/types/facade/ml/adapters/azure-openai-responses.d.ts +14 -0
  171. package/dist/types/facade/ml/adapters/google-shared.d.ts +99 -0
  172. package/dist/types/facade/ml/adapters/google-vertex.d.ts +14 -0
  173. package/dist/types/facade/ml/adapters/google.d.ts +15 -0
  174. package/dist/types/facade/ml/adapters/kimi.d.ts +21 -0
  175. package/dist/types/facade/ml/adapters/mock.d.ts +9 -0
  176. package/dist/types/facade/ml/adapters/nvidia.d.ts +12 -0
  177. package/dist/types/facade/ml/adapters/openai-codex-responses.d.ts +8 -0
  178. package/dist/types/facade/ml/adapters/openai-completions.d.ts +24 -0
  179. package/dist/types/facade/ml/adapters/openai-responses-shared.d.ts +25 -0
  180. package/dist/types/facade/ml/adapters/openai-responses.d.ts +12 -0
  181. package/dist/types/facade/ml/adapters/openai-scaffold.d.ts +3 -0
  182. package/dist/types/facade/ml/adapters/register-builtins.d.ts +2 -0
  183. package/dist/types/facade/ml/adapters/simple-options.d.ts +39 -0
  184. package/dist/types/facade/ml/adapters/simple-options.test.d.ts +1 -0
  185. package/dist/types/facade/ml/adapters/transform-messages.d.ts +23 -0
  186. package/dist/types/facade/ml/api-registry.d.ts +49 -0
  187. package/dist/types/facade/ml/cli.d.ts +2 -0
  188. package/dist/types/facade/ml/env-api-keys.d.ts +19 -0
  189. package/dist/types/facade/ml/index.d.ts +27 -0
  190. package/dist/types/facade/ml/kit/auth/anthropic.d.ts +17 -0
  191. package/dist/types/facade/ml/kit/auth/github-copilot.d.ts +22 -0
  192. package/dist/types/facade/ml/kit/auth/index.d.ts +50 -0
  193. package/dist/types/facade/ml/kit/auth/kimi.d.ts +23 -0
  194. package/dist/types/facade/ml/kit/auth/oauth-page.d.ts +2 -0
  195. package/dist/types/facade/ml/kit/auth/openai-codex.d.ts +36 -0
  196. package/dist/types/facade/ml/kit/auth/pkce.d.ts +12 -0
  197. package/dist/types/facade/ml/kit/auth/types.d.ts +67 -0
  198. package/dist/types/facade/ml/kit/base-stream-handler.d.ts +30 -0
  199. package/dist/types/facade/ml/kit/event-stream.d.ts +63 -0
  200. package/dist/types/facade/ml/kit/index.d.ts +14 -0
  201. package/dist/types/facade/ml/kit/json-parse.d.ts +23 -0
  202. package/dist/types/facade/ml/kit/message-transform.d.ts +32 -0
  203. package/dist/types/facade/ml/kit/output-factory.d.ts +8 -0
  204. package/dist/types/facade/ml/kit/overflow.d.ts +9 -0
  205. package/dist/types/facade/ml/kit/provider-adapter.d.ts +56 -0
  206. package/dist/types/facade/ml/kit/provider-client-builder.d.ts +36 -0
  207. package/dist/types/facade/ml/kit/provider-consolidation.d.ts +3 -0
  208. package/dist/types/facade/ml/kit/provider-constants.d.ts +34 -0
  209. package/dist/types/facade/ml/kit/provider-errors.d.ts +52 -0
  210. package/dist/types/facade/ml/kit/sanitize-unicode.d.ts +2 -0
  211. package/dist/types/facade/ml/kit/stream-event-helper.d.ts +38 -0
  212. package/dist/types/facade/ml/kit/stream-handler-types.d.ts +46 -0
  213. package/dist/types/facade/ml/kit/streaming-state-manager.d.ts +42 -0
  214. package/dist/types/facade/ml/kit/tool-converter.d.ts +49 -0
  215. package/dist/types/facade/ml/kit/typebox-helpers.d.ts +24 -0
  216. package/dist/types/facade/ml/kit/validation.d.ts +26 -0
  217. package/dist/types/facade/ml/models.d.ts +41 -0
  218. package/dist/types/facade/ml/models.generated.d.ts +12405 -0
  219. package/dist/types/facade/ml/stream.d.ts +27 -0
  220. package/dist/types/facade/ml/types.d.ts +269 -0
  221. package/dist/types/index.d.ts +18 -0
  222. package/dist/types/interop/index.d.ts +12 -0
  223. package/dist/types/interop/interop.test.d.ts +19 -0
  224. package/dist/types/interop/protocol-bridge/bridge.d.ts +52 -0
  225. package/dist/types/interop/protocol-bridge/contract.d.ts +249 -0
  226. package/dist/types/interop/protocol-bridge/endpoint.d.ts +124 -0
  227. package/dist/types/interop/protocol-bridge/fleet.d.ts +92 -0
  228. package/dist/types/interop/protocol-bridge/host.d.ts +61 -0
  229. package/dist/types/interop/protocol-bridge/index.d.ts +16 -0
  230. package/dist/types/interop/protocol-bridge/schema.d.ts +29 -0
  231. package/dist/types/llmgateway/catalog/cards.d.ts +18 -0
  232. package/dist/types/llmgateway/catalog/cost.d.ts +15 -0
  233. package/dist/types/llmgateway/catalog/index.d.ts +7 -0
  234. package/dist/types/llmgateway/catalog/query.d.ts +40 -0
  235. package/dist/types/llmgateway/connectors/anthropic.d.ts +35 -0
  236. package/dist/types/llmgateway/connectors/azure-openai.d.ts +33 -0
  237. package/dist/types/llmgateway/connectors/bedrock.d.ts +113 -0
  238. package/dist/types/llmgateway/connectors/google-vertex.d.ts +38 -0
  239. package/dist/types/llmgateway/connectors/google.d.ts +40 -0
  240. package/dist/types/llmgateway/connectors/index.d.ts +26 -0
  241. package/dist/types/llmgateway/connectors/kimi.d.ts +28 -0
  242. package/dist/types/llmgateway/connectors/mock.d.ts +37 -0
  243. package/dist/types/llmgateway/connectors/nvidia.d.ts +27 -0
  244. package/dist/types/llmgateway/connectors/ollama.d.ts +45 -0
  245. package/dist/types/llmgateway/connectors/openai-chat.d.ts +25 -0
  246. package/dist/types/llmgateway/connectors/openai-responses.d.ts +49 -0
  247. package/dist/types/llmgateway/contract/connector.d.ts +32 -0
  248. package/dist/types/llmgateway/contract/conversation.d.ts +86 -0
  249. package/dist/types/llmgateway/contract/emission.d.ts +55 -0
  250. package/dist/types/llmgateway/contract/errors.d.ts +27 -0
  251. package/dist/types/llmgateway/contract/index.d.ts +13 -0
  252. package/dist/types/llmgateway/contract/model-card.d.ts +42 -0
  253. package/dist/types/llmgateway/contract/options.d.ts +31 -0
  254. package/dist/types/llmgateway/contract/reply.d.ts +33 -0
  255. package/dist/types/llmgateway/conversion/index.d.ts +10 -0
  256. package/dist/types/llmgateway/conversion/mappers.d.ts +65 -0
  257. package/dist/types/llmgateway/conversion/openai-compatible.d.ts +46 -0
  258. package/dist/types/llmgateway/conversion/reduce.d.ts +20 -0
  259. package/dist/types/llmgateway/credentials/oauth.d.ts +73 -0
  260. package/dist/types/llmgateway/credentials/pkce.d.ts +52 -0
  261. package/dist/types/llmgateway/credentials/secrets.d.ts +76 -0
  262. package/dist/types/llmgateway/gateway.d.ts +34 -0
  263. package/dist/types/llmgateway/gateway.test.d.ts +14 -0
  264. package/dist/types/llmgateway/index.d.ts +11 -0
  265. package/dist/types/llmgateway/streaming/channel.d.ts +24 -0
  266. package/dist/types/llmgateway/streaming/index.d.ts +10 -0
  267. package/dist/types/llmgateway/streaming/ndjson.d.ts +17 -0
  268. package/dist/types/llmgateway/streaming/sse.d.ts +31 -0
  269. package/dist/types/react-host/index.d.ts +9 -0
  270. package/dist/types/react-host/ink.d.ts +5 -0
  271. package/dist/types/react-host/jsx-runtime.d.ts +4 -0
  272. package/dist/types/react-host/loader.d.ts +3 -0
  273. package/dist/types/react-ink/components/ChangelogBlock.d.ts +8 -0
  274. package/dist/types/react-ink/components/DisplayBlockView.d.ts +8 -0
  275. package/dist/types/react-ink/components/Footer.d.ts +11 -0
  276. package/dist/types/react-ink/components/MessageList.d.ts +14 -0
  277. package/dist/types/react-ink/components/MessageRow.d.ts +13 -0
  278. package/dist/types/react-ink/components/StatusLine.d.ts +18 -0
  279. package/dist/types/react-ink/components/TaskPanel.d.ts +11 -0
  280. package/dist/types/react-ink/components/ToolEventBlock.d.ts +48 -0
  281. package/dist/types/react-ink/components/ToolEventBlock.test.d.ts +1 -0
  282. package/dist/types/react-ink/components/dialogs/DialogFrame.d.ts +8 -0
  283. package/dist/types/react-ink/components/dialogs/LoginDialog.d.ts +14 -0
  284. package/dist/types/react-ink/components/dialogs/ModelDialog.d.ts +9 -0
  285. package/dist/types/react-ink/components/dialogs/OAuthDialog.d.ts +9 -0
  286. package/dist/types/react-ink/components/dialogs/ScopedModelsDialog.d.ts +9 -0
  287. package/dist/types/react-ink/components/dialogs/SelectableDialog.d.ts +22 -0
  288. package/dist/types/react-ink/components/dialogs/SessionDialog.d.ts +13 -0
  289. package/dist/types/react-ink/components/dialogs/SettingsDialog.d.ts +14 -0
  290. package/dist/types/react-ink/components/dialogs/StartupSessionPicker.d.ts +9 -0
  291. package/dist/types/react-ink/components/dialogs/ThemeDialog.d.ts +26 -0
  292. package/dist/types/react-ink/components/dialogs/TreeDialog.d.ts +8 -0
  293. package/dist/types/react-ink/components/dialogs/UserMessageDialog.d.ts +8 -0
  294. package/dist/types/react-ink/components/messages/AssistantMessage.d.ts +12 -0
  295. package/dist/types/react-ink/components/messages/BashMessage.d.ts +8 -0
  296. package/dist/types/react-ink/components/messages/BranchSummaryMessage.d.ts +8 -0
  297. package/dist/types/react-ink/components/messages/CompactionMessage.d.ts +8 -0
  298. package/dist/types/react-ink/components/messages/CustomMessage.d.ts +9 -0
  299. package/dist/types/react-ink/components/messages/SkillInvocationMessage.d.ts +7 -0
  300. package/dist/types/react-ink/components/messages/ToolCallMessage.d.ts +8 -0
  301. package/dist/types/react-ink/components/messages/ToolResultBlock.d.ts +12 -0
  302. package/dist/types/react-ink/components/messages/UserMessage.d.ts +9 -0
  303. package/dist/types/react-ink/diff/Diff.d.ts +22 -0
  304. package/dist/types/react-ink/diff/diff.test.d.ts +1 -0
  305. package/dist/types/react-ink/diff/structured.d.ts +41 -0
  306. package/dist/types/react-ink/diff/word-diff.d.ts +27 -0
  307. package/dist/types/react-ink/index.d.ts +42 -0
  308. package/dist/types/react-ink/markdown/Markdown.d.ts +23 -0
  309. package/dist/types/react-ink/markdown/MarkdownTable.d.ts +19 -0
  310. package/dist/types/react-ink/markdown/StreamingMarkdown.d.ts +34 -0
  311. package/dist/types/react-ink/markdown/format-token.d.ts +39 -0
  312. package/dist/types/react-ink/markdown/highlight.d.ts +31 -0
  313. package/dist/types/react-ink/theme-adapter.d.ts +66 -0
  314. package/dist/types/react-ink/types.d.ts +133 -0
  315. package/dist/types/react-ink/utils/message-groups.d.ts +25 -0
  316. package/dist/types/react-ink/utils/selection-dialog.d.ts +2 -0
  317. package/dist/types/react-ink/utils/session-browser.d.ts +27 -0
  318. package/dist/types/react-ink/utils/tool-display.d.ts +37 -0
  319. package/dist/types/runtime/cadence/cadence.test.d.ts +6 -0
  320. package/dist/types/runtime/cadence/fold.d.ts +48 -0
  321. package/dist/types/runtime/cadence/index.d.ts +12 -0
  322. package/dist/types/runtime/cadence/reducer.d.ts +44 -0
  323. package/dist/types/runtime/conductor/agent.d.ts +71 -0
  324. package/dist/types/runtime/conductor/index.d.ts +11 -0
  325. package/dist/types/runtime/contract/config.d.ts +44 -0
  326. package/dist/types/runtime/contract/effect.d.ts +41 -0
  327. package/dist/types/runtime/contract/errors.d.ts +22 -0
  328. package/dist/types/runtime/contract/events.d.ts +63 -0
  329. package/dist/types/runtime/contract/index.d.ts +18 -0
  330. package/dist/types/runtime/contract/run-state.d.ts +57 -0
  331. package/dist/types/runtime/contract/session.d.ts +42 -0
  332. package/dist/types/runtime/contract/signal.d.ts +49 -0
  333. package/dist/types/runtime/contract/tools.d.ts +45 -0
  334. package/dist/types/runtime/dispatch/index.d.ts +9 -0
  335. package/dist/types/runtime/dispatch/scheduler.d.ts +53 -0
  336. package/dist/types/runtime/index.d.ts +22 -0
  337. package/dist/types/runtime/ledger/accumulator.d.ts +44 -0
  338. package/dist/types/runtime/ledger/bus.d.ts +50 -0
  339. package/dist/types/runtime/ledger/index.d.ts +11 -0
  340. package/dist/types/runtime/memory/compactor.d.ts +56 -0
  341. package/dist/types/runtime/memory/estimate.d.ts +21 -0
  342. package/dist/types/runtime/memory/index.d.ts +8 -0
  343. package/dist/types/runtime/runtime.test.d.ts +15 -0
  344. package/dist/types/runtime/store/dag.d.ts +72 -0
  345. package/dist/types/runtime/store/hash.d.ts +18 -0
  346. package/dist/types/runtime/store/index.d.ts +12 -0
  347. package/dist/types/runtime/store/persist.d.ts +49 -0
  348. package/dist/types/runtime/turn/driver.d.ts +32 -0
  349. package/dist/types/runtime/turn/index.d.ts +8 -0
  350. package/dist/types/runtime/wire/index.d.ts +10 -0
  351. package/dist/types/runtime/wire/projectors.d.ts +53 -0
  352. package/dist/types/shell-app/auth-cli/index.d.ts +9 -0
  353. package/dist/types/shell-app/auth-cli/oauth-cli.d.ts +73 -0
  354. package/dist/types/shell-app/boot/context.d.ts +108 -0
  355. package/dist/types/shell-app/boot/index.d.ts +13 -0
  356. package/dist/types/shell-app/boot/pipeline.d.ts +66 -0
  357. package/dist/types/shell-app/boot/stages.d.ts +77 -0
  358. package/dist/types/shell-app/cli.d.ts +75 -0
  359. package/dist/types/shell-app/config/index.d.ts +11 -0
  360. package/dist/types/shell-app/config/locator.d.ts +85 -0
  361. package/dist/types/shell-app/config/settings.d.ts +91 -0
  362. package/dist/types/shell-app/index.d.ts +26 -0
  363. package/dist/types/shell-app/invocation/flags.d.ts +89 -0
  364. package/dist/types/shell-app/invocation/parse.d.ts +89 -0
  365. package/dist/types/shell-app/locate/brand.d.ts +71 -0
  366. package/dist/types/shell-app/locate/index.d.ts +12 -0
  367. package/dist/types/shell-app/locate/locator.d.ts +122 -0
  368. package/dist/types/shell-app/runners/contract.d.ts +116 -0
  369. package/dist/types/shell-app/runners/index.d.ts +15 -0
  370. package/dist/types/shell-app/runners/one-shot.d.ts +21 -0
  371. package/dist/types/shell-app/runners/registry.d.ts +34 -0
  372. package/dist/types/shell-app/runners/repl.d.ts +51 -0
  373. package/dist/types/shell-app/runners/wire.d.ts +34 -0
  374. package/dist/types/shell-app/shell-app.test.d.ts +14 -0
  375. package/dist/types/shell-app/upgrade/index.d.ts +9 -0
  376. package/dist/types/shell-app/upgrade/upgrades.d.ts +62 -0
  377. package/dist/types/smithy/config/flag-reader.d.ts +128 -0
  378. package/dist/types/smithy/config/index.d.ts +9 -0
  379. package/dist/types/smithy/forge.d.ts +135 -0
  380. package/dist/types/smithy/index.d.ts +36 -0
  381. package/dist/types/smithy/knowledge/index.d.ts +10 -0
  382. package/dist/types/smithy/knowledge/loader.d.ts +64 -0
  383. package/dist/types/smithy/persona/blueprint.d.ts +75 -0
  384. package/dist/types/smithy/persona/define-agent.d.ts +51 -0
  385. package/dist/types/smithy/persona/index.d.ts +14 -0
  386. package/dist/types/smithy/persona/profiles.d.ts +44 -0
  387. package/dist/types/smithy/runtime/index.d.ts +9 -0
  388. package/dist/types/smithy/runtime/tool-ledger.d.ts +130 -0
  389. package/dist/types/smithy/smithy.test.d.ts +20 -0
  390. package/dist/types/smithy/ui/index.d.ts +11 -0
  391. package/dist/types/smithy/ui/transcript.d.ts +183 -0
  392. package/dist/types/swarm/coordinator.d.ts +192 -0
  393. package/dist/types/swarm/index.d.ts +33 -0
  394. package/dist/types/swarm/isolation/index.d.ts +14 -0
  395. package/dist/types/swarm/isolation/runner.d.ts +61 -0
  396. package/dist/types/swarm/isolation/worktree.d.ts +142 -0
  397. package/dist/types/swarm/kernel/faults.d.ts +52 -0
  398. package/dist/types/swarm/kernel/ids.d.ts +25 -0
  399. package/dist/types/swarm/kernel/index.d.ts +26 -0
  400. package/dist/types/swarm/kernel/json-cell.d.ts +113 -0
  401. package/dist/types/swarm/kernel/jsonl-log.d.ts +81 -0
  402. package/dist/types/swarm/postbox/channel.d.ts +88 -0
  403. package/dist/types/swarm/postbox/codecs.d.ts +253 -0
  404. package/dist/types/swarm/postbox/index.d.ts +16 -0
  405. package/dist/types/swarm/roster/index.d.ts +16 -0
  406. package/dist/types/swarm/roster/manifest.d.ts +185 -0
  407. package/dist/types/swarm/swarm.test.d.ts +24 -0
  408. package/dist/types/swarm/telemetry/activity.d.ts +143 -0
  409. package/dist/types/swarm/workboard/board.d.ts +174 -0
  410. package/dist/types/swarm/workboard/dep-graph.d.ts +77 -0
  411. package/dist/types/swarm/workboard/index.d.ts +12 -0
  412. package/dist/types/tracing/adapter/index.d.ts +12 -0
  413. package/dist/types/tracing/adapter/runtime-trace.d.ts +54 -0
  414. package/dist/types/tracing/channel/index.d.ts +9 -0
  415. package/dist/types/tracing/channel/signal.d.ts +93 -0
  416. package/dist/types/tracing/index.d.ts +25 -0
  417. package/dist/types/tracing/recorder/index.d.ts +12 -0
  418. package/dist/types/tracing/recorder/recorder.d.ts +75 -0
  419. package/dist/types/tracing/recorder/sampling.d.ts +55 -0
  420. package/dist/types/tracing/redaction/index.d.ts +8 -0
  421. package/dist/types/tracing/redaction/secret-scrubber.d.ts +95 -0
  422. package/dist/types/tracing/registry/hub.d.ts +57 -0
  423. package/dist/types/tracing/registry/index.d.ts +7 -0
  424. package/dist/types/tracing/signal/handle.d.ts +73 -0
  425. package/dist/types/tracing/signal/index.d.ts +12 -0
  426. package/dist/types/tracing/signal/segment.d.ts +124 -0
  427. package/dist/types/tracing/sinks/base.d.ts +51 -0
  428. package/dist/types/tracing/sinks/console.d.ts +44 -0
  429. package/dist/types/tracing/sinks/file.d.ts +47 -0
  430. package/dist/types/tracing/sinks/index.d.ts +16 -0
  431. package/dist/types/tracing/sinks/stream.d.ts +46 -0
  432. package/dist/types/tracing/tracing.test.d.ts +7 -0
  433. package/dist/types/ui/autocomplete.d.ts +59 -0
  434. package/dist/types/ui/contracts.d.ts +38 -0
  435. package/dist/types/ui/editor-component.d.ts +100 -0
  436. package/dist/types/ui/fuzzy.d.ts +29 -0
  437. package/dist/types/ui/index.d.ts +8 -0
  438. package/dist/types/ui/keybindings.d.ts +62 -0
  439. package/dist/types/ui/keys.d.ts +171 -0
  440. package/dist/types/ui/theme-types.d.ts +36 -0
  441. package/dist/types/ui/utils.d.ts +101 -0
  442. package/dist/types/ui-bridge/InteractiveApp.d.ts +38 -0
  443. package/dist/types/ui-bridge/adapter.d.ts +90 -0
  444. package/dist/types/ui-bridge/index.d.ts +37 -0
  445. package/dist/zoho.js +1451 -0
  446. package/package.json +48 -48
@@ -0,0 +1,62 @@
1
+ /**
2
+ * MCP Tool Factory
3
+ *
4
+ * Creates AgentTool instances from MCP tool definitions.
5
+ * Uses the factory pattern to match new_indusvx's ToolRegistry.
6
+ *
7
+ * Reference: MCP tool factory integration patterns.
8
+ */
9
+ import type { TSchema } from "@sinclair/typebox";
10
+ import type { AgentTool } from "../bot/types.js";
11
+ import type { MCPToolDefinition, MCPToolCallResult } from "./types.js";
12
+ /**
13
+ * Interface for MCP client that can call tools.
14
+ */
15
+ export interface MCPToolClient {
16
+ /** Server name */
17
+ readonly serverName: string;
18
+ /** Whether client is connected */
19
+ readonly connected: boolean;
20
+ /** Call a tool on the MCP server */
21
+ callTool(name: string, args: Record<string, unknown>): Promise<MCPToolCallResult>;
22
+ }
23
+ /**
24
+ * Create an AgentTool from an MCP tool definition.
25
+ *
26
+ * This function creates a factory that matches ToolRegistry's pattern.
27
+ * The tool is namespaced with the server name to avoid conflicts.
28
+ *
29
+ * @param mcpTool - MCP tool definition from the server
30
+ * @param client - MCP client to use for tool execution
31
+ * @returns Factory function that creates an AgentTool
32
+ */
33
+ export declare function createMCPAgentToolFactory(mcpTool: MCPToolDefinition, client: MCPToolClient): () => AgentTool<TSchema, MCPToolCallResult>;
34
+ /**
35
+ * Register all MCP tools from a client into a ToolRegistry.
36
+ *
37
+ * This is the main integration point with new_indusvx's ToolRegistry.
38
+ *
39
+ * @param registry - ToolRegistry instance to register tools into
40
+ * @param client - MCP client with tools to register
41
+ * @param tools - List of tool definitions from the server
42
+ * @returns Number of tools registered
43
+ */
44
+ export declare function registerMCPToolsInRegistry(registry: import("../bot/actions/registry.js").ToolRegistry, client: MCPToolClient, tools: MCPToolDefinition[]): Promise<number>;
45
+ /**
46
+ * Create a map of AgentTools from MCP tool definitions.
47
+ * Useful when you don't want to use the registry pattern.
48
+ *
49
+ * @param tools - List of tool definitions from the server
50
+ * @param client - MCP client to use for tool execution
51
+ * @returns Map of namespaced tool names to AgentTool instances
52
+ */
53
+ export declare function createMCPToolsMap(tools: MCPToolDefinition[], client: MCPToolClient): Map<string, AgentTool<TSchema, MCPToolCallResult>>;
54
+ /**
55
+ * Create a record of AgentTools from MCP tool definitions.
56
+ * Matches the format expected by Agent's tools property.
57
+ *
58
+ * @param tools - List of tool definitions from the server
59
+ * @param client - MCP client to use for tool execution
60
+ * @returns Record of namespaced tool names to AgentTool instances
61
+ */
62
+ export declare function createMCPToolsRecord(tools: MCPToolDefinition[], client: MCPToolClient): Record<string, AgentTool<TSchema, MCPToolCallResult>>;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Bridge a connected {@link MCPClient} into the runtime's {@link ToolBox} shape.
3
+ *
4
+ * `mcpClientToToolBox` is the entry point most callers want: it asks the
5
+ * connected client for its remote tool catalog, wraps each one with
6
+ * {@link defineTool} so the model sees a normal `ToolDescriptor`, and returns a
7
+ * {@link ToolBox} that drops straight into `createAgent({ tools })`. Every
8
+ * remote tool is registered under `"<prefix>__<name>"` so two MCP servers
9
+ * advertising the same name never collide.
10
+ *
11
+ * The mapping intentionally projects the MCP result into the kernel's
12
+ * {@link ToolContentBlock} vocabulary:
13
+ * - `text` blocks pass through verbatim;
14
+ * - `image` blocks become a one-line text mention (we do not ship raw
15
+ * base64 to the model through this seam; structured payloads travel on
16
+ * `structuredContent` instead);
17
+ * - `resource` blocks become a `[resource <uri>]` mention;
18
+ * - `structuredContent`, if present, is appended as a JSON content block.
19
+ */
20
+ import type { MCPClient } from "./client.js";
21
+ import type { MCPToolDefinition } from "./types.js";
22
+ import type { ToolBox } from "../../runtime/contract/index.js";
23
+ /** Options for {@link mcpClientToToolBox}. */
24
+ export interface McpToToolBoxOptions {
25
+ /**
26
+ * Prefix each tool name with `"<prefix>__"`. Default: `"mcp"`. Two clients
27
+ * bridged in the same agent should use distinct prefixes.
28
+ */
29
+ readonly namePrefix?: string;
30
+ /** Optional filter — return false to skip a tool. */
31
+ readonly filter?: (tool: MCPToolDefinition) => boolean;
32
+ /** Logger for diagnostics. */
33
+ readonly logger?: {
34
+ debug(msg: string): void;
35
+ error(msg: string, err?: unknown): void;
36
+ };
37
+ }
38
+ /**
39
+ * Wrap a connected {@link MCPClient} as a runtime {@link ToolBox}.
40
+ *
41
+ * Each remote tool becomes a prefixed descriptor (`"<prefix>__<name>"`) whose
42
+ * invocation is forwarded to `client.callTool` with the model's input passed
43
+ * through unchanged. Results are projected from MCP content blocks onto the
44
+ * kernel's `ToolContentBlock` vocabulary.
45
+ */
46
+ export declare function mcpClientToToolBox(client: MCPClient, options?: McpToToolBoxOptions): Promise<ToolBox>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Tests for {@link mcpClientToToolBox}.
3
+ *
4
+ * A small inline `FakeMCPClient` stands in for the real client: it tracks
5
+ * calls and scripts the responses of `listTools` / `callTool`. No network,
6
+ * no vi.mock — the codebase prefers stubbed fakes.
7
+ */
8
+ export {};
@@ -0,0 +1,298 @@
1
+ /**
2
+ * MCP Type Definitions
3
+ *
4
+ * Aligned with Model Context Protocol specification
5
+ * Reference: MCP client type definitions.
6
+ */
7
+ /**
8
+ * Configuration for MCP servers using stdio (subprocess) transport.
9
+ * Used when the MCP server is spawned as a subprocess that communicates via stdin/stdout.
10
+ */
11
+ export interface StdioServerConfig {
12
+ /** Command to execute (e.g., 'node', 'python', 'npx') */
13
+ command: string;
14
+ /** Optional arguments to pass to the command */
15
+ args?: string[];
16
+ /** Optional environment variables for the subprocess */
17
+ env?: Record<string, string>;
18
+ /** Optional working directory for the subprocess */
19
+ cwd?: string;
20
+ }
21
+ /**
22
+ * Configuration for MCP servers using HTTP-based transport (Streamable HTTP or SSE fallback).
23
+ * Used when connecting to remote MCP servers over HTTP.
24
+ */
25
+ export interface HttpServerConfig {
26
+ /** URL of the MCP server endpoint */
27
+ url: URL;
28
+ /** Optional headers for HTTP requests */
29
+ headers?: Record<string, string>;
30
+ /**
31
+ * Which HTTP transport to use.
32
+ * - "http" (default): Streamable HTTP (single endpoint, server-push channel)
33
+ * - "sse": legacy HTTP+SSE transport
34
+ */
35
+ transport?: "http" | "sse";
36
+ /** Custom fetch implementation */
37
+ fetch?: typeof fetch;
38
+ }
39
+ /**
40
+ * Configuration for connecting to an MCP server.
41
+ * Either stdio-based (subprocess) or HTTP-based (remote server).
42
+ */
43
+ export type MCPServerConfig = StdioServerConfig | HttpServerConfig;
44
+ /**
45
+ * Options for establishing an MCP connection.
46
+ */
47
+ export interface MCPConnectionOptions {
48
+ /** Unique name for this server connection */
49
+ name: string;
50
+ /** Server configuration (stdio or HTTP) */
51
+ config: MCPServerConfig;
52
+ /** Optional timeout in milliseconds */
53
+ timeout?: number;
54
+ }
55
+ /**
56
+ * Definition of a tool exposed by an MCP server.
57
+ */
58
+ export interface MCPToolDefinition {
59
+ /** Tool name */
60
+ name: string;
61
+ /** Human-readable description */
62
+ description?: string;
63
+ /** JSON Schema for input parameters */
64
+ inputSchema: Record<string, unknown>;
65
+ /** Optional JSON Schema for output */
66
+ outputSchema?: Record<string, unknown>;
67
+ }
68
+ /**
69
+ * Resource exposed by an MCP server.
70
+ */
71
+ export interface MCPResource {
72
+ /** Unique URI for this resource */
73
+ uri: string;
74
+ /** Human-readable name */
75
+ name?: string;
76
+ /** MIME type of the resource content */
77
+ mimeType?: string;
78
+ /** Description of the resource */
79
+ description?: string;
80
+ }
81
+ /**
82
+ * Prompt template exposed by an MCP server.
83
+ */
84
+ export interface MCPPrompt {
85
+ /** Prompt name */
86
+ name: string;
87
+ /** Human-readable description */
88
+ description?: string;
89
+ /** Arguments the prompt accepts */
90
+ arguments?: Array<{
91
+ name: string;
92
+ description?: string;
93
+ required?: boolean;
94
+ }>;
95
+ }
96
+ /**
97
+ * Result of MCP server initialization.
98
+ */
99
+ export interface MCPInitializeResult {
100
+ /** Protocol version supported by the server */
101
+ protocolVersion: string;
102
+ /** Server information */
103
+ serverInfo: {
104
+ name: string;
105
+ version?: string;
106
+ };
107
+ /** Server capabilities */
108
+ capabilities: Record<string, unknown>;
109
+ }
110
+ /**
111
+ * Current state of an MCP client connection.
112
+ */
113
+ export interface MCPClientState {
114
+ /** Whether the client is connected */
115
+ connected: boolean;
116
+ /** Name of the connected server */
117
+ serverName: string;
118
+ /** Tools available from the server */
119
+ tools: MCPToolDefinition[];
120
+ /** Resources available from the server */
121
+ resources: MCPResource[];
122
+ /** Prompts available from the server */
123
+ prompts: MCPPrompt[];
124
+ }
125
+ /**
126
+ * Request to call an MCP tool.
127
+ */
128
+ export interface MCPToolCallRequest {
129
+ /** Tool name */
130
+ name: string;
131
+ /** Tool arguments */
132
+ arguments: Record<string, unknown>;
133
+ }
134
+ /**
135
+ * Content block in an MCP tool call result.
136
+ */
137
+ export type MCPContentBlock = {
138
+ type: "text";
139
+ text: string;
140
+ } | {
141
+ type: "image";
142
+ data: string;
143
+ mimeType: string;
144
+ } | {
145
+ type: "resource";
146
+ resource: MCPResource;
147
+ };
148
+ /**
149
+ * Result of an MCP tool call.
150
+ */
151
+ export interface MCPToolCallResult {
152
+ /** Content blocks returned by the tool */
153
+ content: MCPContentBlock[];
154
+ /** Whether the tool execution resulted in an error */
155
+ isError?: boolean;
156
+ /** Structured content if the tool has an output schema */
157
+ structuredContent?: unknown;
158
+ }
159
+ /**
160
+ * Server configuration in the MCP config file.
161
+ */
162
+ export interface MCPServerConfigEntry {
163
+ /** Unique name for this server */
164
+ name: string;
165
+ /** Command for stdio transport */
166
+ command?: string;
167
+ /** Arguments for stdio transport */
168
+ args?: string[];
169
+ /** Environment variables for stdio transport */
170
+ env?: Record<string, string>;
171
+ /** URL for HTTP transport */
172
+ url?: string;
173
+ /** Headers for HTTP transport */
174
+ headers?: Record<string, string>;
175
+ /** HTTP transport flavor ("http" = Streamable HTTP default, "sse" = legacy) */
176
+ transport?: "http" | "sse";
177
+ /** Timeout in milliseconds */
178
+ timeout?: number;
179
+ /** Whether this server is enabled (default: true) */
180
+ enabled?: boolean;
181
+ }
182
+ /**
183
+ * Server configuration without name (for object format).
184
+ */
185
+ export interface MCPServerConfigValue {
186
+ /** Command for stdio transport */
187
+ command?: string;
188
+ /** Arguments for stdio transport */
189
+ args?: string[];
190
+ /** Environment variables for stdio transport */
191
+ env?: Record<string, string>;
192
+ /** URL for HTTP transport */
193
+ url?: string;
194
+ /** Headers for HTTP transport */
195
+ headers?: Record<string, string>;
196
+ /** HTTP transport flavor ("http" = Streamable HTTP default, "sse" = legacy) */
197
+ transport?: "http" | "sse";
198
+ /** Timeout in milliseconds */
199
+ timeout?: number;
200
+ /** Whether this server is enabled (default: true) */
201
+ enabled?: boolean;
202
+ }
203
+ /**
204
+ * MCP configuration file structure.
205
+ * Supports two formats:
206
+ * - Array: { "servers": [{ "name": "github", "command": "npx", ... }] }
207
+ * - Object: { "servers": { "github": { "command": "npx", ... } } }
208
+ */
209
+ export interface MCPConfigFile {
210
+ /** Server configurations (array or object with server names as keys) */
211
+ servers: MCPServerConfigEntry[] | Record<string, MCPServerConfigValue>;
212
+ }
213
+ /**
214
+ * MCP logging levels.
215
+ */
216
+ export type MCPLoggingLevel = "debug" | "info" | "notice" | "warning" | "error" | "critical" | "alert" | "emergency";
217
+ /**
218
+ * Log message from an MCP server.
219
+ */
220
+ export interface MCPLogMessage {
221
+ /** Logging level */
222
+ level: MCPLoggingLevel;
223
+ /** Log message content */
224
+ message: string;
225
+ /** Timestamp */
226
+ timestamp: Date;
227
+ /** Server name */
228
+ serverName: string;
229
+ /** Additional details */
230
+ details?: Record<string, unknown>;
231
+ }
232
+ /**
233
+ * Handler function for processing log messages from MCP servers.
234
+ */
235
+ export type MCPLogHandler = (logMessage: MCPLogMessage) => void;
236
+ /**
237
+ * Progress notification from an MCP server.
238
+ */
239
+ export interface MCPProgressNotification {
240
+ /** Progress token */
241
+ progressToken: string | number;
242
+ /** Current progress value */
243
+ progress: number;
244
+ /** Total value (optional) */
245
+ total?: number;
246
+ /** Human-readable message */
247
+ message?: string;
248
+ }
249
+ /**
250
+ * Handler function for processing progress notifications.
251
+ */
252
+ export type MCPProgressHandler = (params: MCPProgressNotification) => void;
253
+ /**
254
+ * Elicitation request from an MCP server (requesting user input).
255
+ */
256
+ export interface MCPElicitRequest {
257
+ /** Message to display to the user */
258
+ message: string;
259
+ /** JSON Schema for the expected response */
260
+ requestedSchema: Record<string, unknown>;
261
+ }
262
+ /**
263
+ * Response to an elicitation request.
264
+ */
265
+ export interface MCPElicitResult {
266
+ /** Action taken: accept, decline, or cancel */
267
+ action: "accept" | "decline" | "cancel";
268
+ /** Content if action is accept */
269
+ content?: Record<string, unknown>;
270
+ }
271
+ /**
272
+ * Handler function for processing elicitation requests.
273
+ */
274
+ export type MCPElicitationHandler = (request: MCPElicitRequest) => Promise<MCPElicitResult>;
275
+ /**
276
+ * Filesystem root exposed to MCP servers.
277
+ */
278
+ export interface MCPRoot {
279
+ /** Unique URI (must be file://) */
280
+ uri: string;
281
+ /** Human-readable name */
282
+ name?: string;
283
+ }
284
+ /**
285
+ * Base options common to all MCP server definitions.
286
+ */
287
+ export interface BaseServerOptions {
288
+ /** Optional handler for server log messages */
289
+ logger?: MCPLogHandler;
290
+ /** Optional timeout in milliseconds */
291
+ timeout?: number;
292
+ /** Whether to enable server log forwarding (default: true) */
293
+ enableServerLogs?: boolean;
294
+ /** Whether to enable progress tracking (default: false) */
295
+ enableProgressTracking?: boolean;
296
+ /** List of filesystem roots to expose to the MCP server */
297
+ roots?: MCPRoot[];
298
+ }
@@ -0,0 +1 @@
1
+ export * from "./mcp-core/index";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import { type Message, type SystemContentBlock, type ToolConfiguration } from "@aws-sdk/client-bedrock-runtime";
2
+ import type { Context, Model, SimpleStreamOptions, StreamFunction, StreamOptions, ThinkingBudgets, ThinkingLevel } from "../types.js";
3
+ export interface BedrockOptions extends StreamOptions {
4
+ region?: string;
5
+ profile?: string;
6
+ toolChoice?: "auto" | "any" | "none" | {
7
+ type: "tool";
8
+ name: string;
9
+ };
10
+ reasoning?: ThinkingLevel;
11
+ thinkingBudgets?: ThinkingBudgets;
12
+ interleavedThinking?: boolean;
13
+ }
14
+ export declare class BedrockRequestBuilder {
15
+ private readonly model;
16
+ private readonly context;
17
+ private readonly options;
18
+ constructor(model: Model<"bedrock-converse-stream">, context: Context, options: BedrockOptions);
19
+ build(): {
20
+ modelId: string;
21
+ messages: Message[];
22
+ system: SystemContentBlock[] | undefined;
23
+ inferenceConfig: {
24
+ maxTokens: number | undefined;
25
+ temperature: number | undefined;
26
+ };
27
+ toolConfig: ToolConfiguration | undefined;
28
+ additionalModelRequestFields: Record<string, any> | undefined;
29
+ };
30
+ }
31
+ export declare const streamBedrock: StreamFunction<"bedrock-converse-stream", BedrockOptions>;
32
+ export declare const streamSimpleBedrock: StreamFunction<"bedrock-converse-stream", SimpleStreamOptions>;
@@ -0,0 +1,78 @@
1
+ import type { MessageCreateParamsStreaming } from "@anthropic-ai/sdk/resources/messages.js";
2
+ import type { Context, Model, SimpleStreamOptions, StreamFunction, StreamOptions } from "../types.js";
3
+ import { BaseStreamHandler } from "../kit/base-stream-handler.js";
4
+ import { type ProviderLifecycleHooks } from "./simple-options.js";
5
+ export interface AnthropicOptions extends StreamOptions {
6
+ thinkingEnabled?: boolean;
7
+ thinkingBudgetTokens?: number;
8
+ interleavedThinking?: boolean;
9
+ toolChoice?: "auto" | "any" | "none" | {
10
+ type: "tool";
11
+ name: string;
12
+ };
13
+ }
14
+ export interface AnthropicExecutionOptions {
15
+ hooks?: ProviderLifecycleHooks<MessageCreateParamsStreaming, unknown>;
16
+ retryPolicy?: {
17
+ maxAttempts?: number;
18
+ baseDelayMs?: number;
19
+ };
20
+ }
21
+ /**
22
+ * Assembles the streaming request payload for the Anthropic Messages API.
23
+ *
24
+ * Acts as the single place that turns a generic model/context/options triple
25
+ * into a concrete `MessageCreateParamsStreaming` object.
26
+ */
27
+ export declare class AnthropicRequestBuilder {
28
+ private readonly model;
29
+ private readonly context;
30
+ private readonly isOAuthToken;
31
+ private readonly options?;
32
+ constructor(model: Model<"anthropic-messages">, context: Context, isOAuthToken: boolean, options?: AnthropicOptions | undefined);
33
+ /**
34
+ * Produce the parameters passed to the Anthropic streaming endpoint.
35
+ *
36
+ * @returns The fully populated SDK streaming request.
37
+ */
38
+ build(): MessageCreateParamsStreaming;
39
+ }
40
+ /**
41
+ * Stream handler tailored to Anthropic.
42
+ *
43
+ * Drives the Anthropic SDK stream and forwards normalized assistant events.
44
+ */
45
+ export declare class AnthropicStreamHandler extends BaseStreamHandler {
46
+ private readonly executeFn?;
47
+ constructor(executeFn?: (() => Promise<void>) | undefined);
48
+ /**
49
+ * Run the supplied executor, if any, to consume the Anthropic stream.
50
+ */
51
+ protected processStream(): Promise<void>;
52
+ /**
53
+ * Walk the raw SDK stream, handing each event to the supplied callback.
54
+ *
55
+ * @param anthropicStream - Raw async iterable produced by the Anthropic SDK.
56
+ * @param onEvent - Invoked once per streamed event.
57
+ */
58
+ process(anthropicStream: AsyncIterable<unknown>, onEvent: (event: any) => void): Promise<void>;
59
+ }
60
+ /**
61
+ * Reads a `Retry-After` header off an Anthropic APIError and converts it to a
62
+ * delay in milliseconds. The header is the integer-seconds form per the
63
+ * Anthropic API; a missing/non-numeric value yields `null` so callers fall
64
+ * back to exponential backoff.
65
+ */
66
+ export declare function parseAnthropicRetryAfterMs(error: unknown): number | null;
67
+ /**
68
+ * Classifies an Anthropic failure as worth retrying. Mirrors
69
+ * `kit/provider-errors.ts:isRetryableError`: transient HTTP statuses (408/409/
70
+ * 429/529/5xx) and an `overloaded_error` body are retryable; auth/validation
71
+ * (401/403/4xx) are not. Generic errors fall back to a message sniff covering
72
+ * network/timeout/overload conditions. The `_attempt` is accepted to satisfy
73
+ * the RetryPolicy.shouldRetry contract but unused here (the loop already caps
74
+ * attempts).
75
+ */
76
+ export declare function shouldRetryAnthropic(error: unknown, _attempt: number): boolean;
77
+ export declare const streamAnthropic: StreamFunction<"anthropic-messages", AnthropicOptions>;
78
+ export declare const streamSimpleAnthropic: StreamFunction<"anthropic-messages", SimpleStreamOptions>;
@@ -0,0 +1,14 @@
1
+ import type { SimpleStreamOptions, StreamFunction, StreamOptions } from "../types.js";
2
+ export interface AzureOpenAIResponsesOptions extends StreamOptions {
3
+ reasoningEffort?: "minimal" | "low" | "medium" | "high" | "xhigh";
4
+ reasoningSummary?: "auto" | "detailed" | "concise" | null;
5
+ azureApiVersion?: string;
6
+ azureResourceName?: string;
7
+ azureBaseUrl?: string;
8
+ azureDeploymentName?: string;
9
+ }
10
+ /**
11
+ * Streaming entry point for Azure OpenAI Responses deployments.
12
+ */
13
+ export declare const streamAzureOpenAIResponses: StreamFunction<"azure-openai-responses", AzureOpenAIResponsesOptions>;
14
+ export declare const streamSimpleAzureOpenAIResponses: StreamFunction<"azure-openai-responses", SimpleStreamOptions>;
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Common building blocks used by both Google front-ends — the Generative AI
3
+ * (Gemini) adapter and the Vertex AI adapter. Covers turning our messages and
4
+ * tools into Google's shapes, mapping finish reasons back to our stop reasons,
5
+ * and the bookkeeping around reasoning ("thought") signatures.
6
+ */
7
+ import { type Content, FinishReason, FunctionCallingConfigMode, type Part, type Schema } from "@google/genai";
8
+ import type { Context, Model, StopReason, Tool } from "../types.js";
9
+ import { type ProviderLifecycleHooks } from "./simple-options.js";
10
+ type GoogleApiType = "google-generative-ai" | "google-vertex";
11
+ export interface GoogleRequestExecutionOptions<TRequest = unknown, TResponse = unknown> {
12
+ hooks?: ProviderLifecycleHooks<TRequest, TResponse>;
13
+ retryPolicy?: {
14
+ maxAttempts?: number;
15
+ baseDelayMs?: number;
16
+ };
17
+ }
18
+ export declare function executeGoogleRequest<TRequest, TResponse>(request: TRequest, executor: () => Promise<TResponse>, options?: GoogleRequestExecutionOptions<TRequest, TResponse>): Promise<TResponse>;
19
+ /**
20
+ * Discrete reasoning intensities understood by Gemini. Every entry corresponds
21
+ * one-to-one with a value of the Google SDK's ThinkingLevel enum.
22
+ */
23
+ export type GoogleThinkingLevel = "THINKING_LEVEL_UNSPECIFIED" | "MINIMAL" | "LOW" | "MEDIUM" | "HIGH";
24
+ /**
25
+ * The four reasoning efforts callers can request, ordered weakest to strongest.
26
+ * Drawn from the internal ThinkingLevel set with the "xhigh" tier collapsed away.
27
+ */
28
+ export type ClampedReasoningEffort = "minimal" | "low" | "medium" | "high";
29
+ /** The slice of a Model object the Gemini reasoning helpers actually consult. */
30
+ type GeminiModelRef = {
31
+ id: string;
32
+ };
33
+ /**
34
+ * Family buckets that decide how reasoning effort maps onto a request. Gemini 3
35
+ * variants take a discrete level; everything else takes a token budget.
36
+ */
37
+ export type GeminiFamily = "gemini-3-pro" | "gemini-3-flash" | "default";
38
+ /** Sort a model id into the Gemini family whose reasoning rules apply to it. */
39
+ export declare function classifyGeminiFamily(modelId: string): GeminiFamily;
40
+ /**
41
+ * Pick the discrete Gemini thinking level for a given effort. The Gemini-3 Pro
42
+ * family uses its coarser two-rung table; all other ids use the full four-rung
43
+ * mapping.
44
+ */
45
+ export declare function selectGeminiThinkingLevel(effort: ClampedReasoningEffort, model: GeminiModelRef): GoogleThinkingLevel;
46
+ /**
47
+ * Resolve the thinking-token budget for a model/effort pair. A caller-supplied
48
+ * override wins outright; otherwise the per-family default table is consulted,
49
+ * and unrecognized families return -1 so the model sizes its own budget.
50
+ */
51
+ export declare function resolveGeminiThinkingBudget(model: GeminiModelRef, effort: ClampedReasoningEffort, customBudgets?: Partial<Record<ClampedReasoningEffort, number>>): number;
52
+ /**
53
+ * Distinguishes a reasoning fragment from a normal answer fragment: a Gemini
54
+ * `Part` whose `thought` flag is set holds the model's internal reasoning.
55
+ */
56
+ export declare function isThinkingPart(part: Pick<Part, "thought" | "thoughtSignature">): boolean;
57
+ /**
58
+ * Keep whichever thought signature is freshest as chunks stream in: a new
59
+ * non-empty value replaces the old one, otherwise the previous value stands.
60
+ */
61
+ export declare function retainThoughtSignature(existing: string | undefined, incoming: string | undefined): string | undefined;
62
+ /**
63
+ * Some models served through Google demand that every function call — and the
64
+ * function response that answers it — carry an explicit correlation id. This
65
+ * returns true for those model families.
66
+ */
67
+ export declare function requiresToolCallId(modelId: string): boolean;
68
+ /**
69
+ * Map our internal conversation history onto the `Content[]` array Gemini's
70
+ * generate-content request expects.
71
+ */
72
+ export declare function convertMessages<T extends GoogleApiType>(model: Model<T>, context: Context): Content[];
73
+ /**
74
+ * Repackage our tool definitions into the nested function-declaration block
75
+ * Gemini reads them from.
76
+ */
77
+ export declare function convertTools(tools: Tool[]): {
78
+ functionDeclarations: {
79
+ name: string;
80
+ description?: string;
81
+ parameters: Schema;
82
+ }[];
83
+ }[] | undefined;
84
+ /**
85
+ * Resolve one of our tool-choice keywords to the matching Gemini
86
+ * FunctionCallingConfigMode, defaulting to AUTO for anything unrecognized.
87
+ */
88
+ export declare function mapToolChoice(choice: string): FunctionCallingConfigMode;
89
+ /**
90
+ * Look up the unified StopReason for a Gemini FinishReason enum value, throwing
91
+ * if the enum carries a value the table above does not cover.
92
+ */
93
+ export declare function mapStopReason(reason: FinishReason): StopReason;
94
+ /**
95
+ * Variant of the finish-reason lookup that takes the raw string seen in
96
+ * deserialized API JSON, returning "error" for anything not explicitly listed.
97
+ */
98
+ export declare function mapStopReasonString(reason: string): StopReason;
99
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { SimpleStreamOptions, StreamFunction, StreamOptions } from "../types.js";
2
+ import { type GoogleThinkingLevel } from "./google-shared.js";
3
+ export interface GoogleVertexOptions extends StreamOptions {
4
+ toolChoice?: "auto" | "none" | "any";
5
+ thinking?: {
6
+ enabled: boolean;
7
+ budgetTokens?: number;
8
+ level?: GoogleThinkingLevel;
9
+ };
10
+ project?: string;
11
+ location?: string;
12
+ }
13
+ export declare const streamGoogleVertex: StreamFunction<"google-vertex", GoogleVertexOptions>;
14
+ export declare const streamSimpleGoogleVertex: StreamFunction<"google-vertex", SimpleStreamOptions>;