@frontmcp/sdk 0.7.2 → 0.8.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 (630) hide show
  1. package/agent/adapters/adapter.factory.d.ts +27 -18
  2. package/agent/adapters/adapter.factory.d.ts.map +1 -1
  3. package/agent/agent.instance.d.ts +5 -0
  4. package/agent/agent.instance.d.ts.map +1 -1
  5. package/agent/agent.scope.d.ts +54 -72
  6. package/agent/agent.scope.d.ts.map +1 -1
  7. package/agent/flows/call-agent.flow.d.ts +1 -0
  8. package/agent/flows/call-agent.flow.d.ts.map +1 -1
  9. package/app/instances/app.local.instance.d.ts +3 -0
  10. package/app/instances/app.local.instance.d.ts.map +1 -1
  11. package/app/instances/app.remote.instance.d.ts +3 -0
  12. package/app/instances/app.remote.instance.d.ts.map +1 -1
  13. package/auth/auth.registry.d.ts.map +1 -1
  14. package/auth/authorization/authorization.types.d.ts +7 -180
  15. package/auth/authorization/authorization.types.d.ts.map +1 -1
  16. package/auth/authorization/index.d.ts +2 -0
  17. package/auth/authorization/index.d.ts.map +1 -1
  18. package/auth/authorization/orchestrated.accessor.d.ts +161 -0
  19. package/auth/authorization/orchestrated.accessor.d.ts.map +1 -0
  20. package/auth/authorization/orchestrated.authorization.d.ts +19 -4
  21. package/auth/authorization/orchestrated.authorization.d.ts.map +1 -1
  22. package/auth/authorization/orchestrated.context-extension.d.ts +108 -0
  23. package/auth/authorization/orchestrated.context-extension.d.ts.map +1 -0
  24. package/auth/cimd/index.d.ts +14 -0
  25. package/auth/cimd/index.d.ts.map +1 -0
  26. package/auth/flows/auth.verify.flow.d.ts.map +1 -1
  27. package/auth/flows/oauth.authorize.flow.d.ts +30 -3
  28. package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
  29. package/auth/flows/oauth.callback.flow.d.ts +11 -3
  30. package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
  31. package/auth/flows/oauth.provider-callback.flow.d.ts +118 -0
  32. package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -0
  33. package/auth/flows/oauth.register.flow.d.ts +1 -1
  34. package/auth/flows/oauth.token.flow.d.ts +1 -1
  35. package/auth/flows/session.verify.flow.d.ts +8 -0
  36. package/auth/flows/session.verify.flow.d.ts.map +1 -1
  37. package/auth/flows/well-known.jwks.flow.d.ts +3 -3
  38. package/auth/flows/well-known.oauth-authorization-server.flow.d.ts +3 -2
  39. package/auth/flows/well-known.oauth-authorization-server.flow.d.ts.map +1 -1
  40. package/auth/flows/well-known.prm.flow.d.ts +1 -1
  41. package/auth/instances/instance.local-primary-auth.d.ts +88 -1
  42. package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
  43. package/auth/machine-id.d.ts +14 -0
  44. package/auth/machine-id.d.ts.map +1 -1
  45. package/auth/session/encrypted-authorization-vault.d.ts +2 -3
  46. package/auth/session/encrypted-authorization-vault.d.ts.map +1 -1
  47. package/auth/session/federated-auth.session.d.ts +252 -0
  48. package/auth/session/federated-auth.session.d.ts.map +1 -0
  49. package/auth/session/index.d.ts +6 -2
  50. package/auth/session/index.d.ts.map +1 -1
  51. package/auth/session/orchestrated-token.store.d.ts +155 -0
  52. package/auth/session/orchestrated-token.store.d.ts.map +1 -0
  53. package/auth/session/record/session.base.d.ts +7 -7
  54. package/auth/session/record/session.base.d.ts.map +1 -1
  55. package/auth/session/record/session.mcp.d.ts +11 -0
  56. package/auth/session/record/session.mcp.d.ts.map +1 -0
  57. package/auth/session/redis-session.store.d.ts +10 -5
  58. package/auth/session/redis-session.store.d.ts.map +1 -1
  59. package/auth/session/session-crypto.d.ts +6 -9
  60. package/auth/session/session-crypto.d.ts.map +1 -1
  61. package/{store/store.factory.d.ts → auth/session/session-store.factory.d.ts} +10 -36
  62. package/auth/session/session-store.factory.d.ts.map +1 -0
  63. package/auth/session/session.service.d.ts +4 -8
  64. package/auth/session/session.service.d.ts.map +1 -1
  65. package/auth/session/session.transport.d.ts +8 -2
  66. package/auth/session/session.transport.d.ts.map +1 -1
  67. package/auth/session/session.types.d.ts +5 -5
  68. package/auth/session/session.types.d.ts.map +1 -1
  69. package/auth/session/token.refresh.d.ts +1 -2
  70. package/auth/session/token.refresh.d.ts.map +1 -1
  71. package/auth/session/transport-session.manager.d.ts +7 -6
  72. package/auth/session/transport-session.manager.d.ts.map +1 -1
  73. package/auth/session/utils/session-id.utils.d.ts +18 -1
  74. package/auth/session/utils/session-id.utils.d.ts.map +1 -1
  75. package/auth/session/vercel-kv-session.store.d.ts +16 -16
  76. package/auth/session/vercel-kv-session.store.d.ts.map +1 -1
  77. package/auth/utils/authorization-id.utils.d.ts +12 -0
  78. package/auth/utils/authorization-id.utils.d.ts.map +1 -0
  79. package/auth/utils/index.d.ts +1 -2
  80. package/auth/utils/index.d.ts.map +1 -1
  81. package/auth/vault/auth-providers.accessor.d.ts +153 -0
  82. package/auth/vault/auth-providers.accessor.d.ts.map +1 -0
  83. package/auth/vault/auth-providers.accessor.impl.d.ts +52 -0
  84. package/auth/vault/auth-providers.accessor.impl.d.ts.map +1 -0
  85. package/auth/vault/auth-providers.context-extension.d.ts +68 -0
  86. package/auth/vault/auth-providers.context-extension.d.ts.map +1 -0
  87. package/auth/vault/auth-providers.providers.d.ts +40 -0
  88. package/auth/vault/auth-providers.providers.d.ts.map +1 -0
  89. package/auth/vault/auth-providers.registry.d.ts +110 -0
  90. package/auth/vault/auth-providers.registry.d.ts.map +1 -0
  91. package/auth/vault/auth-providers.vault.d.ts +93 -0
  92. package/auth/vault/auth-providers.vault.d.ts.map +1 -0
  93. package/auth/vault/credential-cache.d.ts +13 -0
  94. package/auth/vault/credential-cache.d.ts.map +1 -0
  95. package/auth/vault/credential-loaders/eager-loader.d.ts +46 -0
  96. package/auth/vault/credential-loaders/eager-loader.d.ts.map +1 -0
  97. package/auth/vault/credential-loaders/index.d.ts +7 -0
  98. package/auth/vault/credential-loaders/index.d.ts.map +1 -0
  99. package/auth/vault/credential-loaders/lazy-loader.d.ts +53 -0
  100. package/auth/vault/credential-loaders/lazy-loader.d.ts.map +1 -0
  101. package/auth/vault/index.d.ts +56 -0
  102. package/auth/vault/index.d.ts.map +1 -0
  103. package/builtin/config/config-resolver.d.ts +162 -0
  104. package/builtin/config/config-resolver.d.ts.map +1 -0
  105. package/builtin/config/config.plugin.d.ts +63 -0
  106. package/builtin/config/config.plugin.d.ts.map +1 -0
  107. package/builtin/config/config.symbols.d.ts +7 -0
  108. package/builtin/config/config.symbols.d.ts.map +1 -0
  109. package/builtin/config/config.types.d.ts +71 -0
  110. package/builtin/config/config.types.d.ts.map +1 -0
  111. package/builtin/config/index.d.ts +68 -0
  112. package/builtin/config/index.d.ts.map +1 -0
  113. package/builtin/config/providers/config-loader.d.ts +36 -0
  114. package/builtin/config/providers/config-loader.d.ts.map +1 -0
  115. package/builtin/config/providers/config.service.d.ts +108 -0
  116. package/builtin/config/providers/config.service.d.ts.map +1 -0
  117. package/builtin/config/providers/env-loader.d.ts +76 -0
  118. package/builtin/config/providers/env-loader.d.ts.map +1 -0
  119. package/builtin/index.d.ts +7 -0
  120. package/builtin/index.d.ts.map +1 -0
  121. package/common/decorators/front-mcp.decorator.d.ts.map +1 -1
  122. package/common/decorators/hook.decorator.d.ts +0 -10
  123. package/common/decorators/hook.decorator.d.ts.map +1 -1
  124. package/common/decorators/index.d.ts +1 -0
  125. package/common/decorators/index.d.ts.map +1 -1
  126. package/common/decorators/skill.decorator.d.ts +105 -0
  127. package/common/decorators/skill.decorator.d.ts.map +1 -0
  128. package/common/dynamic/dynamic.adapter.d.ts +14 -4
  129. package/common/dynamic/dynamic.adapter.d.ts.map +1 -1
  130. package/common/entries/app.entry.d.ts +2 -0
  131. package/common/entries/app.entry.d.ts.map +1 -1
  132. package/common/entries/index.d.ts +1 -0
  133. package/common/entries/index.d.ts.map +1 -1
  134. package/common/entries/prompt.entry.d.ts +0 -6
  135. package/common/entries/prompt.entry.d.ts.map +1 -1
  136. package/common/entries/resource.entry.d.ts +0 -6
  137. package/common/entries/resource.entry.d.ts.map +1 -1
  138. package/common/entries/scope.entry.d.ts +2 -0
  139. package/common/entries/scope.entry.d.ts.map +1 -1
  140. package/common/entries/skill.entry.d.ts +95 -0
  141. package/common/entries/skill.entry.d.ts.map +1 -0
  142. package/common/entries/tool.entry.d.ts +17 -9
  143. package/common/entries/tool.entry.d.ts.map +1 -1
  144. package/common/interfaces/agent.interface.d.ts +35 -6
  145. package/common/interfaces/agent.interface.d.ts.map +1 -1
  146. package/common/interfaces/execution-context.interface.d.ts +14 -0
  147. package/common/interfaces/execution-context.interface.d.ts.map +1 -1
  148. package/common/interfaces/index.d.ts +1 -0
  149. package/common/interfaces/index.d.ts.map +1 -1
  150. package/common/interfaces/internal/primary-auth-provider.interface.d.ts +1 -7
  151. package/common/interfaces/internal/primary-auth-provider.interface.d.ts.map +1 -1
  152. package/common/interfaces/internal/registry.interface.d.ts +4 -1
  153. package/common/interfaces/internal/registry.interface.d.ts.map +1 -1
  154. package/common/interfaces/skill.interface.d.ts +91 -0
  155. package/common/interfaces/skill.interface.d.ts.map +1 -0
  156. package/common/interfaces/tool.interface.d.ts +39 -0
  157. package/common/interfaces/tool.interface.d.ts.map +1 -1
  158. package/common/metadata/agent.metadata.d.ts +62 -2
  159. package/common/metadata/agent.metadata.d.ts.map +1 -1
  160. package/common/metadata/app.metadata.d.ts +168 -169
  161. package/common/metadata/app.metadata.d.ts.map +1 -1
  162. package/common/metadata/front-mcp.metadata.d.ts +2182 -721
  163. package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
  164. package/common/metadata/index.d.ts +1 -0
  165. package/common/metadata/index.d.ts.map +1 -1
  166. package/common/metadata/plugin.metadata.d.ts +8 -1
  167. package/common/metadata/plugin.metadata.d.ts.map +1 -1
  168. package/common/metadata/skill.metadata.d.ts +366 -0
  169. package/common/metadata/skill.metadata.d.ts.map +1 -0
  170. package/common/metadata/tool.metadata.d.ts +71 -0
  171. package/common/metadata/tool.metadata.d.ts.map +1 -1
  172. package/common/records/index.d.ts +1 -0
  173. package/common/records/index.d.ts.map +1 -1
  174. package/common/records/skill.record.d.ts +55 -0
  175. package/common/records/skill.record.d.ts.map +1 -0
  176. package/common/schemas/annotated-class.schema.d.ts +1 -0
  177. package/common/schemas/annotated-class.schema.d.ts.map +1 -1
  178. package/common/schemas/http-output.schema.d.ts +24 -24
  179. package/common/tokens/app.tokens.d.ts.map +1 -1
  180. package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
  181. package/common/tokens/index.d.ts +1 -0
  182. package/common/tokens/index.d.ts.map +1 -1
  183. package/common/tokens/plugin.tokens.d.ts +1 -0
  184. package/common/tokens/plugin.tokens.d.ts.map +1 -1
  185. package/common/tokens/skill.tokens.d.ts +18 -0
  186. package/common/tokens/skill.tokens.d.ts.map +1 -0
  187. package/common/tokens/tool.tokens.d.ts +2 -0
  188. package/common/tokens/tool.tokens.d.ts.map +1 -1
  189. package/common/types/auth/session.types.d.ts +21 -0
  190. package/common/types/auth/session.types.d.ts.map +1 -1
  191. package/common/types/options/auth/app-auth.schema.d.ts +80 -84
  192. package/common/types/options/auth/app-auth.schema.d.ts.map +1 -1
  193. package/common/types/options/auth/index.d.ts +6 -8
  194. package/common/types/options/auth/index.d.ts.map +1 -1
  195. package/common/types/options/auth/{auth.interfaces.d.ts → interfaces.d.ts} +17 -48
  196. package/common/types/options/auth/interfaces.d.ts.map +1 -0
  197. package/common/types/options/auth/orchestrated.schema.d.ts +160 -84
  198. package/common/types/options/auth/orchestrated.schema.d.ts.map +1 -1
  199. package/common/types/options/auth/public.schema.d.ts +0 -21
  200. package/common/types/options/auth/public.schema.d.ts.map +1 -1
  201. package/common/types/options/auth/{auth.schema.d.ts → schema.d.ts} +81 -85
  202. package/common/types/options/auth/schema.d.ts.map +1 -0
  203. package/common/types/options/auth/shared.schemas.d.ts +12 -0
  204. package/common/types/options/auth/shared.schemas.d.ts.map +1 -1
  205. package/common/types/options/auth/transparent.schema.d.ts +0 -21
  206. package/common/types/options/auth/transparent.schema.d.ts.map +1 -1
  207. package/common/types/options/auth/typecheck.d.ts +2 -0
  208. package/common/types/options/auth/typecheck.d.ts.map +1 -0
  209. package/common/types/options/auth/{auth.utils.d.ts → utils.d.ts} +2 -2
  210. package/common/types/options/auth/utils.d.ts.map +1 -0
  211. package/common/types/options/elicitation/index.d.ts +4 -0
  212. package/common/types/options/elicitation/index.d.ts.map +1 -0
  213. package/common/types/options/elicitation/interfaces.d.ts +80 -0
  214. package/common/types/options/elicitation/interfaces.d.ts.map +1 -0
  215. package/common/types/options/elicitation/schema.d.ts +75 -0
  216. package/common/types/options/elicitation/schema.d.ts.map +1 -0
  217. package/common/types/options/ext-apps/index.d.ts +3 -0
  218. package/common/types/options/ext-apps/index.d.ts.map +1 -0
  219. package/common/types/options/ext-apps/interfaces.d.ts +2 -0
  220. package/common/types/options/ext-apps/interfaces.d.ts.map +1 -0
  221. package/common/types/options/ext-apps/schema.d.ts +80 -0
  222. package/common/types/options/ext-apps/schema.d.ts.map +1 -0
  223. package/common/types/options/http/index.d.ts +4 -0
  224. package/common/types/options/http/index.d.ts.map +1 -0
  225. package/common/types/options/http/interfaces.d.ts +23 -0
  226. package/common/types/options/http/interfaces.d.ts.map +1 -0
  227. package/common/types/options/http/schema.d.ts +18 -0
  228. package/common/types/options/http/schema.d.ts.map +1 -0
  229. package/common/types/options/index.d.ts +10 -6
  230. package/common/types/options/index.d.ts.map +1 -1
  231. package/common/types/options/logging/index.d.ts +5 -0
  232. package/common/types/options/logging/index.d.ts.map +1 -0
  233. package/common/types/options/logging/interfaces.d.ts +41 -0
  234. package/common/types/options/logging/interfaces.d.ts.map +1 -0
  235. package/common/types/options/logging/schema.d.ts +24 -0
  236. package/common/types/options/logging/schema.d.ts.map +1 -0
  237. package/common/types/options/pagination/index.d.ts +4 -0
  238. package/common/types/options/pagination/index.d.ts.map +1 -0
  239. package/common/types/options/pagination/interfaces.d.ts +43 -0
  240. package/common/types/options/pagination/interfaces.d.ts.map +1 -0
  241. package/common/types/options/pagination/schema.d.ts +41 -0
  242. package/common/types/options/pagination/schema.d.ts.map +1 -0
  243. package/common/types/options/redis/index.d.ts +4 -0
  244. package/common/types/options/redis/index.d.ts.map +1 -0
  245. package/common/types/options/redis/interfaces.d.ts +81 -0
  246. package/common/types/options/redis/interfaces.d.ts.map +1 -0
  247. package/common/types/options/{redis.options.d.ts → redis/schema.d.ts} +2 -2
  248. package/common/types/options/redis/schema.d.ts.map +1 -0
  249. package/common/types/options/server-info/index.d.ts +4 -0
  250. package/common/types/options/server-info/index.d.ts.map +1 -0
  251. package/common/types/options/server-info/interfaces.d.ts +27 -0
  252. package/common/types/options/server-info/interfaces.d.ts.map +1 -0
  253. package/common/types/options/{server-info.options.d.ts → server-info/schema.d.ts} +13 -10
  254. package/common/types/options/server-info/schema.d.ts.map +1 -0
  255. package/common/types/options/session/index.d.ts +4 -0
  256. package/common/types/options/session/index.d.ts.map +1 -0
  257. package/common/types/options/session/interfaces.d.ts +66 -0
  258. package/common/types/options/session/interfaces.d.ts.map +1 -0
  259. package/common/types/options/session/schema.d.ts +79 -0
  260. package/common/types/options/session/schema.d.ts.map +1 -0
  261. package/common/types/options/skills-http/index.d.ts +4 -0
  262. package/common/types/options/skills-http/index.d.ts.map +1 -0
  263. package/common/types/options/skills-http/interfaces.d.ts +321 -0
  264. package/common/types/options/skills-http/interfaces.d.ts.map +1 -0
  265. package/common/types/options/skills-http/schema.d.ts +139 -0
  266. package/common/types/options/skills-http/schema.d.ts.map +1 -0
  267. package/common/types/options/transport/index.d.ts +4 -0
  268. package/common/types/options/transport/index.d.ts.map +1 -0
  269. package/common/types/options/transport/interfaces.d.ts +354 -0
  270. package/common/types/options/transport/interfaces.d.ts.map +1 -0
  271. package/common/types/options/transport/schema.d.ts +309 -0
  272. package/common/types/options/transport/schema.d.ts.map +1 -0
  273. package/common/types/options/transport/typecheck.d.ts +2 -0
  274. package/common/types/options/transport/typecheck.d.ts.map +1 -0
  275. package/common/utils/decide-request-intent.utils.d.ts +3 -3
  276. package/common/utils/decide-request-intent.utils.d.ts.map +1 -1
  277. package/context/context-extension.d.ts +1 -28
  278. package/context/context-extension.d.ts.map +1 -1
  279. package/context/frontmcp-context-storage.d.ts.map +1 -1
  280. package/context/frontmcp-context.d.ts +36 -39
  281. package/context/frontmcp-context.d.ts.map +1 -1
  282. package/context/frontmcp-context.provider.d.ts +3 -9
  283. package/context/frontmcp-context.provider.d.ts.map +1 -1
  284. package/context/index.d.ts +5 -20
  285. package/context/index.d.ts.map +1 -1
  286. package/context/metadata.utils.d.ts +24 -0
  287. package/context/metadata.utils.d.ts.map +1 -0
  288. package/direct/client.types.d.ts +447 -0
  289. package/direct/client.types.d.ts.map +1 -0
  290. package/direct/connect.d.ts +188 -0
  291. package/direct/connect.d.ts.map +1 -0
  292. package/direct/direct-client.d.ts +7 -0
  293. package/direct/direct-client.d.ts.map +1 -0
  294. package/direct/direct-server.d.ts +38 -0
  295. package/direct/direct-server.d.ts.map +1 -0
  296. package/direct/direct.types.d.ts +134 -0
  297. package/direct/direct.types.d.ts.map +1 -0
  298. package/direct/index.d.ts +15 -0
  299. package/direct/index.d.ts.map +1 -0
  300. package/direct/llm-platform.d.ts +94 -0
  301. package/direct/llm-platform.d.ts.map +1 -0
  302. package/elicitation/elicitation-fallback.schema.d.ts +32 -0
  303. package/elicitation/elicitation-fallback.schema.d.ts.map +1 -0
  304. package/elicitation/elicitation.types.d.ts +160 -0
  305. package/elicitation/elicitation.types.d.ts.map +1 -0
  306. package/elicitation/flows/elicitation-request.flow.d.ts +98 -0
  307. package/elicitation/flows/elicitation-request.flow.d.ts.map +1 -0
  308. package/elicitation/flows/elicitation-result.flow.d.ts +79 -0
  309. package/elicitation/flows/elicitation-result.flow.d.ts.map +1 -0
  310. package/elicitation/flows/index.d.ts +10 -0
  311. package/elicitation/flows/index.d.ts.map +1 -0
  312. package/elicitation/helpers/elicit.helper.d.ts +65 -0
  313. package/elicitation/helpers/elicit.helper.d.ts.map +1 -0
  314. package/elicitation/helpers/extend-output-schema.d.ts +31 -0
  315. package/elicitation/helpers/extend-output-schema.d.ts.map +1 -0
  316. package/elicitation/helpers/fallback.helper.d.ts +60 -0
  317. package/elicitation/helpers/fallback.helper.d.ts.map +1 -0
  318. package/elicitation/helpers/index.d.ts +12 -0
  319. package/elicitation/helpers/index.d.ts.map +1 -0
  320. package/elicitation/helpers/validate-elicitation-content.d.ts +52 -0
  321. package/elicitation/helpers/validate-elicitation-content.d.ts.map +1 -0
  322. package/elicitation/hooks/elicitation.hooks.d.ts +66 -0
  323. package/elicitation/hooks/elicitation.hooks.d.ts.map +1 -0
  324. package/elicitation/hooks/index.d.ts +9 -0
  325. package/elicitation/hooks/index.d.ts.map +1 -0
  326. package/elicitation/index.d.ts +18 -0
  327. package/elicitation/index.d.ts.map +1 -0
  328. package/elicitation/send-elicitation-result.tool.d.ts +18 -0
  329. package/elicitation/send-elicitation-result.tool.d.ts.map +1 -0
  330. package/elicitation/store/elicitation-encryption.d.ts +134 -0
  331. package/elicitation/store/elicitation-encryption.d.ts.map +1 -0
  332. package/elicitation/store/elicitation-store.factory.d.ts +197 -0
  333. package/elicitation/store/elicitation-store.factory.d.ts.map +1 -0
  334. package/elicitation/store/elicitation.store.d.ts +191 -0
  335. package/elicitation/store/elicitation.store.d.ts.map +1 -0
  336. package/elicitation/store/encrypted-elicitation.store.d.ts +121 -0
  337. package/elicitation/store/encrypted-elicitation.store.d.ts.map +1 -0
  338. package/elicitation/store/index.d.ts +14 -0
  339. package/elicitation/store/index.d.ts.map +1 -0
  340. package/elicitation/store/storage-elicitation.store.d.ts +118 -0
  341. package/elicitation/store/storage-elicitation.store.d.ts.map +1 -0
  342. package/errors/elicitation.error.d.ts +115 -0
  343. package/errors/elicitation.error.d.ts.map +1 -0
  344. package/errors/index.d.ts +1 -0
  345. package/errors/index.d.ts.map +1 -1
  346. package/esm/index.mjs +30824 -19537
  347. package/esm/package.json +13 -7
  348. package/ext-apps/ext-apps.handler.d.ts +177 -0
  349. package/ext-apps/ext-apps.handler.d.ts.map +1 -0
  350. package/ext-apps/ext-apps.types.d.ts +273 -0
  351. package/ext-apps/ext-apps.types.d.ts.map +1 -0
  352. package/ext-apps/index.d.ts +13 -0
  353. package/ext-apps/index.d.ts.map +1 -0
  354. package/flows/flow.instance.d.ts.map +1 -1
  355. package/front-mcp/front-mcp.d.ts +64 -2
  356. package/front-mcp/front-mcp.d.ts.map +1 -1
  357. package/front-mcp/front-mcp.providers.d.ts +604 -236
  358. package/front-mcp/front-mcp.providers.d.ts.map +1 -1
  359. package/index.d.ts +17 -0
  360. package/index.d.ts.map +1 -1
  361. package/index.js +31066 -19707
  362. package/notification/index.d.ts +1 -1
  363. package/notification/index.d.ts.map +1 -1
  364. package/notification/notification.service.d.ts +18 -0
  365. package/notification/notification.service.d.ts.map +1 -1
  366. package/package.json +13 -7
  367. package/plugin/plugin.registry.d.ts +2 -0
  368. package/plugin/plugin.registry.d.ts.map +1 -1
  369. package/provider/provider.registry.d.ts +8 -3
  370. package/provider/provider.registry.d.ts.map +1 -1
  371. package/scope/flows/http.request.flow.d.ts +4 -0
  372. package/scope/flows/http.request.flow.d.ts.map +1 -1
  373. package/scope/scope.instance.d.ts +74 -0
  374. package/scope/scope.instance.d.ts.map +1 -1
  375. package/server/server.instance.d.ts +3 -3
  376. package/server/server.instance.d.ts.map +1 -1
  377. package/skill/auth/index.d.ts +10 -0
  378. package/skill/auth/index.d.ts.map +1 -0
  379. package/skill/auth/skill-http-auth.d.ts +112 -0
  380. package/skill/auth/skill-http-auth.d.ts.map +1 -0
  381. package/skill/cache/index.d.ts +13 -0
  382. package/skill/cache/index.d.ts.map +1 -0
  383. package/skill/cache/skill-http-cache.d.ts +144 -0
  384. package/skill/cache/skill-http-cache.d.ts.map +1 -0
  385. package/skill/cache/skill-http-cache.factory.d.ts +83 -0
  386. package/skill/cache/skill-http-cache.factory.d.ts.map +1 -0
  387. package/skill/cache/skill-http-cache.holder.d.ts +35 -0
  388. package/skill/cache/skill-http-cache.holder.d.ts.map +1 -0
  389. package/skill/errors/index.d.ts +3 -0
  390. package/skill/errors/index.d.ts.map +1 -0
  391. package/skill/errors/skill-validation.error.d.ts +110 -0
  392. package/skill/errors/skill-validation.error.d.ts.map +1 -0
  393. package/skill/errors/tool-not-allowed.error.d.ts +66 -0
  394. package/skill/errors/tool-not-allowed.error.d.ts.map +1 -0
  395. package/skill/flows/http/index.d.ts +12 -0
  396. package/skill/flows/http/index.d.ts.map +1 -0
  397. package/skill/flows/http/llm-full-txt.flow.d.ts +70 -0
  398. package/skill/flows/http/llm-full-txt.flow.d.ts.map +1 -0
  399. package/skill/flows/http/llm-txt.flow.d.ts +77 -0
  400. package/skill/flows/http/llm-txt.flow.d.ts.map +1 -0
  401. package/skill/flows/http/skills-api.flow.d.ts +81 -0
  402. package/skill/flows/http/skills-api.flow.d.ts.map +1 -0
  403. package/skill/flows/index.d.ts +13 -0
  404. package/skill/flows/index.d.ts.map +1 -0
  405. package/skill/flows/load-skill.flow.d.ts +169 -0
  406. package/skill/flows/load-skill.flow.d.ts.map +1 -0
  407. package/skill/flows/search-skills.flow.d.ts +101 -0
  408. package/skill/flows/search-skills.flow.d.ts.map +1 -0
  409. package/skill/guards/index.d.ts +2 -0
  410. package/skill/guards/index.d.ts.map +1 -0
  411. package/skill/guards/tool-authorization.guard.d.ts +87 -0
  412. package/skill/guards/tool-authorization.guard.d.ts.map +1 -0
  413. package/skill/hooks/index.d.ts +2 -0
  414. package/skill/hooks/index.d.ts.map +1 -0
  415. package/skill/hooks/skill-tool.hook.d.ts +52 -0
  416. package/skill/hooks/skill-tool.hook.d.ts.map +1 -0
  417. package/skill/index.d.ts +74 -0
  418. package/skill/index.d.ts.map +1 -0
  419. package/skill/providers/external-skill.provider.d.ts +240 -0
  420. package/skill/providers/external-skill.provider.d.ts.map +1 -0
  421. package/skill/providers/index.d.ts +12 -0
  422. package/skill/providers/index.d.ts.map +1 -0
  423. package/skill/providers/memory-skill.provider.d.ts +97 -0
  424. package/skill/providers/memory-skill.provider.d.ts.map +1 -0
  425. package/skill/session/index.d.ts +4 -0
  426. package/skill/session/index.d.ts.map +1 -0
  427. package/skill/session/skill-session-store.interface.d.ts +79 -0
  428. package/skill/session/skill-session-store.interface.d.ts.map +1 -0
  429. package/skill/session/skill-session.manager.d.ts +137 -0
  430. package/skill/session/skill-session.manager.d.ts.map +1 -0
  431. package/skill/session/skill-session.types.d.ts +303 -0
  432. package/skill/session/skill-session.types.d.ts.map +1 -0
  433. package/skill/skill-http.utils.d.ts +107 -0
  434. package/skill/skill-http.utils.d.ts.map +1 -0
  435. package/skill/skill-mode.utils.d.ts +53 -0
  436. package/skill/skill-mode.utils.d.ts.map +1 -0
  437. package/skill/skill-scope.helper.d.ts +55 -0
  438. package/skill/skill-scope.helper.d.ts.map +1 -0
  439. package/skill/skill-storage.factory.d.ts +194 -0
  440. package/skill/skill-storage.factory.d.ts.map +1 -0
  441. package/skill/skill-storage.interface.d.ts +230 -0
  442. package/skill/skill-storage.interface.d.ts.map +1 -0
  443. package/skill/skill-validator.d.ts +63 -0
  444. package/skill/skill-validator.d.ts.map +1 -0
  445. package/skill/skill.events.d.ts +88 -0
  446. package/skill/skill.events.d.ts.map +1 -0
  447. package/skill/skill.instance.d.ts +92 -0
  448. package/skill/skill.instance.d.ts.map +1 -0
  449. package/skill/skill.registry.d.ts +309 -0
  450. package/skill/skill.registry.d.ts.map +1 -0
  451. package/skill/skill.utils.d.ts +90 -0
  452. package/skill/skill.utils.d.ts.map +1 -0
  453. package/skill/sync/index.d.ts +16 -0
  454. package/skill/sync/index.d.ts.map +1 -0
  455. package/skill/sync/memory-sync-state.store.d.ts +49 -0
  456. package/skill/sync/memory-sync-state.store.d.ts.map +1 -0
  457. package/skill/sync/skill-hash.d.ts +65 -0
  458. package/skill/sync/skill-hash.d.ts.map +1 -0
  459. package/skill/sync/sync-state.interface.d.ts +125 -0
  460. package/skill/sync/sync-state.interface.d.ts.map +1 -0
  461. package/skill/tools/index.d.ts +21 -0
  462. package/skill/tools/index.d.ts.map +1 -0
  463. package/skill/tools/load-skills.tool.d.ts +76 -0
  464. package/skill/tools/load-skills.tool.d.ts.map +1 -0
  465. package/skill/tools/search-skills.tool.d.ts +61 -0
  466. package/skill/tools/search-skills.tool.d.ts.map +1 -0
  467. package/tool/flows/call-tool.flow.d.ts +1 -0
  468. package/tool/flows/call-tool.flow.d.ts.map +1 -1
  469. package/tool/flows/tools-list.flow.d.ts +15 -0
  470. package/tool/flows/tools-list.flow.d.ts.map +1 -1
  471. package/tool/tool.instance.d.ts +8 -0
  472. package/tool/tool.instance.d.ts.map +1 -1
  473. package/tool/tool.registry.d.ts +11 -0
  474. package/tool/tool.registry.d.ts.map +1 -1
  475. package/tool/tool.utils.d.ts.map +1 -1
  476. package/tool/ui/template-helpers.d.ts +0 -5
  477. package/tool/ui/template-helpers.d.ts.map +1 -1
  478. package/transport/adapters/streamable-http-transport.d.ts.map +1 -1
  479. package/transport/adapters/transport.local.adapter.d.ts +54 -9
  480. package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
  481. package/transport/adapters/transport.sse.adapter.d.ts +11 -2
  482. package/transport/adapters/transport.sse.adapter.d.ts.map +1 -1
  483. package/transport/adapters/transport.streamable-http.adapter.d.ts +21 -2
  484. package/transport/adapters/transport.streamable-http.adapter.d.ts.map +1 -1
  485. package/transport/event-stores/event-store.factory.d.ts +96 -0
  486. package/transport/event-stores/event-store.factory.d.ts.map +1 -0
  487. package/transport/event-stores/index.d.ts +47 -0
  488. package/transport/event-stores/index.d.ts.map +1 -0
  489. package/transport/event-stores/memory.event-store.d.ts +51 -0
  490. package/transport/event-stores/memory.event-store.d.ts.map +1 -0
  491. package/transport/event-stores/redis.event-store.d.ts +79 -0
  492. package/transport/event-stores/redis.event-store.d.ts.map +1 -0
  493. package/transport/flows/handle.sse.flow.d.ts.map +1 -1
  494. package/transport/flows/handle.streamable-http.flow.d.ts +3 -1
  495. package/transport/flows/handle.streamable-http.flow.d.ts.map +1 -1
  496. package/transport/in-memory-server.d.ts +85 -0
  497. package/transport/in-memory-server.d.ts.map +1 -0
  498. package/transport/index.d.ts +47 -0
  499. package/transport/index.d.ts.map +1 -1
  500. package/transport/mcp-handlers/complete-request.handler.d.ts +3 -84
  501. package/transport/mcp-handlers/complete-request.handler.d.ts.map +1 -1
  502. package/transport/mcp-handlers/get-prompt-request.handler.d.ts +3 -128
  503. package/transport/mcp-handlers/get-prompt-request.handler.d.ts.map +1 -1
  504. package/transport/mcp-handlers/index.d.ts +463 -490
  505. package/transport/mcp-handlers/index.d.ts.map +1 -1
  506. package/transport/mcp-handlers/initialize-request.handler.d.ts.map +1 -1
  507. package/transport/mcp-handlers/list-prompts-request.handler.d.ts +3 -70
  508. package/transport/mcp-handlers/list-prompts-request.handler.d.ts.map +1 -1
  509. package/transport/mcp-handlers/list-resource-templates-request.handler.d.ts +3 -72
  510. package/transport/mcp-handlers/list-resource-templates-request.handler.d.ts.map +1 -1
  511. package/transport/mcp-handlers/list-resources-request.handler.d.ts +3 -72
  512. package/transport/mcp-handlers/list-resources-request.handler.d.ts.map +1 -1
  513. package/transport/mcp-handlers/list-tools-request.handler.d.ts +3 -85
  514. package/transport/mcp-handlers/list-tools-request.handler.d.ts.map +1 -1
  515. package/transport/mcp-handlers/read-resource-request.handler.d.ts +3 -61
  516. package/transport/mcp-handlers/read-resource-request.handler.d.ts.map +1 -1
  517. package/transport/mcp-handlers/skills-list-request.handler.d.ts +9 -0
  518. package/transport/mcp-handlers/skills-list-request.handler.d.ts.map +1 -0
  519. package/transport/mcp-handlers/skills-load-request.handler.d.ts +9 -0
  520. package/transport/mcp-handlers/skills-load-request.handler.d.ts.map +1 -0
  521. package/transport/mcp-handlers/skills-mcp.types.d.ts +157 -0
  522. package/transport/mcp-handlers/skills-mcp.types.d.ts.map +1 -0
  523. package/transport/mcp-handlers/skills-search-request.handler.d.ts +9 -0
  524. package/transport/mcp-handlers/skills-search-request.handler.d.ts.map +1 -0
  525. package/transport/transport.registry.d.ts +9 -1
  526. package/transport/transport.registry.d.ts.map +1 -1
  527. package/transport/transport.types.d.ts +1 -8
  528. package/transport/transport.types.d.ts.map +1 -1
  529. package/auth/jwks/dev-key-persistence.d.ts +0 -64
  530. package/auth/jwks/dev-key-persistence.d.ts.map +0 -1
  531. package/auth/jwks/index.d.ts +0 -4
  532. package/auth/jwks/index.d.ts.map +0 -1
  533. package/auth/jwks/jwks.service.d.ts +0 -58
  534. package/auth/jwks/jwks.service.d.ts.map +0 -1
  535. package/auth/jwks/jwks.types.d.ts +0 -33
  536. package/auth/jwks/jwks.types.d.ts.map +0 -1
  537. package/auth/jwks/jwks.utils.d.ts +0 -5
  538. package/auth/jwks/jwks.utils.d.ts.map +0 -1
  539. package/auth/oauth/flows/oauth.authorize.flow.d.ts +0 -32
  540. package/auth/oauth/flows/oauth.authorize.flow.d.ts.map +0 -1
  541. package/auth/oauth/flows/oauth.device-authorization.flow.d.ts +0 -47
  542. package/auth/oauth/flows/oauth.device-authorization.flow.d.ts.map +0 -1
  543. package/auth/oauth/flows/oauth.introspect.flow.d.ts +0 -27
  544. package/auth/oauth/flows/oauth.introspect.flow.d.ts.map +0 -1
  545. package/auth/oauth/flows/oauth.par.flow.d.ts +0 -28
  546. package/auth/oauth/flows/oauth.par.flow.d.ts.map +0 -1
  547. package/auth/oauth/flows/oauth.revoke.flow.d.ts +0 -26
  548. package/auth/oauth/flows/oauth.revoke.flow.d.ts.map +0 -1
  549. package/auth/oauth/flows/oauth.token.flow.d.ts +0 -58
  550. package/auth/oauth/flows/oauth.token.flow.d.ts.map +0 -1
  551. package/auth/oauth/flows/oauth.userinfo.flow.d.ts +0 -23
  552. package/auth/oauth/flows/oauth.userinfo.flow.d.ts.map +0 -1
  553. package/auth/oauth/flows/oidc.logout.flow.d.ts +0 -19
  554. package/auth/oauth/flows/oidc.logout.flow.d.ts.map +0 -1
  555. package/auth/session/authorization-vault.d.ts +0 -612
  556. package/auth/session/authorization-vault.d.ts.map +0 -1
  557. package/auth/session/authorization.store.d.ts +0 -302
  558. package/auth/session/authorization.store.d.ts.map +0 -1
  559. package/auth/session/record/session.stateful.d.ts +0 -21
  560. package/auth/session/record/session.stateful.d.ts.map +0 -1
  561. package/auth/session/record/session.stateless.d.ts +0 -18
  562. package/auth/session/record/session.stateless.d.ts.map +0 -1
  563. package/auth/session/record/session.transparent.d.ts +0 -18
  564. package/auth/session/record/session.transparent.d.ts.map +0 -1
  565. package/auth/session/session.crypto.d.ts +0 -8
  566. package/auth/session/session.crypto.d.ts.map +0 -1
  567. package/auth/session/session.schema.d.ts +0 -6
  568. package/auth/session/session.schema.d.ts.map +0 -1
  569. package/auth/session/token.store.d.ts +0 -36
  570. package/auth/session/token.store.d.ts.map +0 -1
  571. package/auth/session/token.vault.d.ts +0 -27
  572. package/auth/session/token.vault.d.ts.map +0 -1
  573. package/auth/session/vault-encryption.d.ts +0 -190
  574. package/auth/session/vault-encryption.d.ts.map +0 -1
  575. package/auth/utils/audience.validator.d.ts +0 -130
  576. package/auth/utils/audience.validator.d.ts.map +0 -1
  577. package/auth/utils/www-authenticate.utils.d.ts +0 -98
  578. package/auth/utils/www-authenticate.utils.d.ts.map +0 -1
  579. package/common/migrate/auth-transport.migrate.d.ts +0 -63
  580. package/common/migrate/auth-transport.migrate.d.ts.map +0 -1
  581. package/common/migrate/index.d.ts +0 -2
  582. package/common/migrate/index.d.ts.map +0 -1
  583. package/common/types/options/auth/auth.interfaces.d.ts.map +0 -1
  584. package/common/types/options/auth/auth.schema.d.ts.map +0 -1
  585. package/common/types/options/auth/auth.typecheck.d.ts +0 -2
  586. package/common/types/options/auth/auth.typecheck.d.ts.map +0 -1
  587. package/common/types/options/auth/auth.utils.d.ts.map +0 -1
  588. package/common/types/options/auth/transport.deprecated.d.ts +0 -64
  589. package/common/types/options/auth/transport.deprecated.d.ts.map +0 -1
  590. package/common/types/options/http.options.d.ts +0 -15
  591. package/common/types/options/http.options.d.ts.map +0 -1
  592. package/common/types/options/logging.options.d.ts +0 -29
  593. package/common/types/options/logging.options.d.ts.map +0 -1
  594. package/common/types/options/redis.options.d.ts.map +0 -1
  595. package/common/types/options/server-info.options.d.ts.map +0 -1
  596. package/common/types/options/session.options.d.ts +0 -148
  597. package/common/types/options/session.options.d.ts.map +0 -1
  598. package/common/types/options/transport.options.d.ts +0 -178
  599. package/common/types/options/transport.options.d.ts.map +0 -1
  600. package/context/request-context-storage.d.ts +0 -90
  601. package/context/request-context-storage.d.ts.map +0 -1
  602. package/context/request-context.d.ts +0 -185
  603. package/context/request-context.d.ts.map +0 -1
  604. package/context/request-context.provider.d.ts +0 -38
  605. package/context/request-context.provider.d.ts.map +0 -1
  606. package/context/session-key.provider.d.ts +0 -46
  607. package/context/session-key.provider.d.ts.map +0 -1
  608. package/store/adapters/store.base.adapter.d.ts +0 -22
  609. package/store/adapters/store.base.adapter.d.ts.map +0 -1
  610. package/store/adapters/store.memory.adapter.d.ts +0 -27
  611. package/store/adapters/store.memory.adapter.d.ts.map +0 -1
  612. package/store/adapters/store.redis.adapter.d.ts +0 -34
  613. package/store/adapters/store.redis.adapter.d.ts.map +0 -1
  614. package/store/adapters/store.vercel-kv.adapter.d.ts +0 -87
  615. package/store/adapters/store.vercel-kv.adapter.d.ts.map +0 -1
  616. package/store/index.d.ts +0 -11
  617. package/store/index.d.ts.map +0 -1
  618. package/store/store.factory.d.ts.map +0 -1
  619. package/store/store.helpers.d.ts +0 -10
  620. package/store/store.helpers.d.ts.map +0 -1
  621. package/store/store.registry.d.ts +0 -14
  622. package/store/store.registry.d.ts.map +0 -1
  623. package/store/store.tokens.d.ts +0 -4
  624. package/store/store.tokens.d.ts.map +0 -1
  625. package/store/store.types.d.ts +0 -65
  626. package/store/store.types.d.ts.map +0 -1
  627. package/store/store.utils.d.ts +0 -9
  628. package/store/store.utils.d.ts.map +0 -1
  629. package/transport/transport.event-store.d.ts +0 -11
  630. package/transport/transport.event-store.d.ts.map +0 -1
@@ -0,0 +1,38 @@
1
+ /**
2
+ * DirectMcpServerImpl - Implementation of DirectMcpServer
3
+ *
4
+ * Provides programmatic access to FrontMCP servers by bypassing the HTTP transport
5
+ * layer and invoking flows directly on the Scope instance.
6
+ */
7
+ import type { ListToolsResult, CallToolResult, ListResourcesResult, ReadResourceResult, ListPromptsResult, GetPromptResult, ListResourceTemplatesResult } from '@modelcontextprotocol/sdk/types.js';
8
+ import type { DirectMcpServer, DirectCallOptions } from './direct.types';
9
+ import type { Scope } from '../scope/scope.instance';
10
+ /**
11
+ * Implementation of DirectMcpServer that bypasses HTTP transport
12
+ * and invokes flows directly on a Scope instance.
13
+ */
14
+ export declare class DirectMcpServerImpl implements DirectMcpServer {
15
+ private readonly scope;
16
+ readonly ready: Promise<void>;
17
+ private _isDisposed;
18
+ private readonly defaultSessionId;
19
+ constructor(scope: Scope);
20
+ /**
21
+ * Build the MCP handler context that flows expect.
22
+ * This simulates what the transport layer creates from HTTP request.
23
+ */
24
+ private buildHandlerContext;
25
+ /**
26
+ * Run a flow and handle FlowControl exceptions.
27
+ */
28
+ private runFlow;
29
+ listTools(options?: DirectCallOptions): Promise<ListToolsResult>;
30
+ callTool(name: string, args?: Record<string, unknown>, options?: DirectCallOptions): Promise<CallToolResult>;
31
+ listResources(options?: DirectCallOptions): Promise<ListResourcesResult>;
32
+ listResourceTemplates(options?: DirectCallOptions): Promise<ListResourceTemplatesResult>;
33
+ readResource(uri: string, options?: DirectCallOptions): Promise<ReadResourceResult>;
34
+ listPrompts(options?: DirectCallOptions): Promise<ListPromptsResult>;
35
+ getPrompt(name: string, args?: Record<string, string>, options?: DirectCallOptions): Promise<GetPromptResult>;
36
+ dispose(): Promise<void>;
37
+ }
38
+ //# sourceMappingURL=direct-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direct-server.d.ts","sourceRoot":"","sources":["../../src/direct/direct-server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC5B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAA4C,MAAM,gBAAgB,CAAC;AACnH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAsCrD;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACzD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;gBAE9B,KAAK,EAAE,KAAK;IAMxB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAW3B;;OAEG;YACW,OAAO;IAmCf,SAAS,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC;IAIhE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;IAY5G,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAQxE,qBAAqB,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAQxF,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAYnF,WAAW,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIpE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC;IAY7G,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAc/B"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Direct MCP Server - Types and Interfaces
3
+ *
4
+ * Provides programmatic access to FrontMCP servers without HTTP/stdio transports.
5
+ * Useful for embedding MCP servers in existing applications, testing, and agent backends.
6
+ */
7
+ import type { ListToolsResult, CallToolResult, ListResourcesResult, ReadResourceResult, ListPromptsResult, GetPromptResult, ListResourceTemplatesResult } from '@modelcontextprotocol/sdk/types.js';
8
+ /**
9
+ * Auth context for direct server invocation.
10
+ * Simulates what would come from JWT validation in the HTTP layer.
11
+ */
12
+ export interface DirectAuthContext {
13
+ /** Session ID for context tracking (auto-generated if not provided) */
14
+ sessionId?: string;
15
+ /** User/client token for authorization (e.g., JWT) */
16
+ token?: string;
17
+ /** User claims (extracted from token) */
18
+ user?: {
19
+ sub?: string;
20
+ [key: string]: unknown;
21
+ };
22
+ /** Additional auth info (claims, scopes, etc.) */
23
+ extra?: Record<string, unknown>;
24
+ }
25
+ /**
26
+ * Request metadata for direct calls.
27
+ */
28
+ export interface DirectRequestMetadata {
29
+ /** User-Agent string */
30
+ userAgent?: string;
31
+ /** Client IP address */
32
+ clientIp?: string;
33
+ /** Custom headers matching x-frontmcp-* pattern */
34
+ customHeaders?: Record<string, string>;
35
+ }
36
+ /**
37
+ * Options for direct method calls.
38
+ */
39
+ export interface DirectCallOptions {
40
+ /** Auth context to inject (simulates JWT header) */
41
+ authContext?: DirectAuthContext;
42
+ /** Request metadata */
43
+ metadata?: DirectRequestMetadata;
44
+ }
45
+ /**
46
+ * Direct MCP server interface - bypasses HTTP transport layer.
47
+ *
48
+ * Provides programmatic access to MCP operations (tools, resources, prompts)
49
+ * without requiring HTTP infrastructure.
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * import { FrontMcpInstance } from '@frontmcp/sdk';
54
+ *
55
+ * const server = await FrontMcpInstance.createDirect({
56
+ * info: { name: 'MyServer', version: '1.0.0' },
57
+ * apps: [MyApp],
58
+ * });
59
+ *
60
+ * // List all tools
61
+ * const { tools } = await server.listTools();
62
+ *
63
+ * // Call a tool with auth context
64
+ * const result = await server.callTool('my-tool', { input: 'value' }, {
65
+ * authContext: { token: 'jwt-token', sessionId: 'user-123' }
66
+ * });
67
+ *
68
+ * // Cleanup when done
69
+ * await server.dispose();
70
+ * ```
71
+ */
72
+ export interface DirectMcpServer {
73
+ /** Ready promise - resolves when server is initialized */
74
+ readonly ready: Promise<void>;
75
+ /**
76
+ * List all available tools.
77
+ *
78
+ * @param options - Optional call options with auth context
79
+ * @returns List of tool definitions
80
+ */
81
+ listTools(options?: DirectCallOptions): Promise<ListToolsResult>;
82
+ /**
83
+ * Call a tool with arguments.
84
+ *
85
+ * @param name - Tool name
86
+ * @param args - Tool arguments
87
+ * @param options - Optional call options with auth context
88
+ * @returns Tool execution result
89
+ */
90
+ callTool(name: string, args?: Record<string, unknown>, options?: DirectCallOptions): Promise<CallToolResult>;
91
+ /**
92
+ * List all available resources.
93
+ *
94
+ * @param options - Optional call options with auth context
95
+ * @returns List of resource definitions
96
+ */
97
+ listResources(options?: DirectCallOptions): Promise<ListResourcesResult>;
98
+ /**
99
+ * List all available resource templates.
100
+ *
101
+ * @param options - Optional call options with auth context
102
+ * @returns List of resource template definitions
103
+ */
104
+ listResourceTemplates(options?: DirectCallOptions): Promise<ListResourceTemplatesResult>;
105
+ /**
106
+ * Read a resource by URI.
107
+ *
108
+ * @param uri - Resource URI
109
+ * @param options - Optional call options with auth context
110
+ * @returns Resource content
111
+ */
112
+ readResource(uri: string, options?: DirectCallOptions): Promise<ReadResourceResult>;
113
+ /**
114
+ * List all available prompts.
115
+ *
116
+ * @param options - Optional call options with auth context
117
+ * @returns List of prompt definitions
118
+ */
119
+ listPrompts(options?: DirectCallOptions): Promise<ListPromptsResult>;
120
+ /**
121
+ * Get a prompt with arguments.
122
+ *
123
+ * @param name - Prompt name
124
+ * @param args - Prompt arguments
125
+ * @param options - Optional call options with auth context
126
+ * @returns Prompt content with messages
127
+ */
128
+ getPrompt(name: string, args?: Record<string, string>, options?: DirectCallOptions): Promise<GetPromptResult>;
129
+ /**
130
+ * Dispose the server and cleanup resources.
131
+ */
132
+ dispose(): Promise<void>;
133
+ }
134
+ //# sourceMappingURL=direct.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direct.types.d.ts","sourceRoot":"","sources":["../../src/direct/direct.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC5B,MAAM,oCAAoC,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,IAAI,CAAC,EAAE;QACL,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,uBAAuB;IACvB,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAM9B;;;;;OAKG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEjE;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAM7G;;;;;OAKG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEzE;;;;;OAKG;IACH,qBAAqB,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAEzF;;;;;;OAMG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAMpF;;;;;OAKG;IACH,WAAW,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAErE;;;;;;;OAOG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAM9G;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Direct MCP Server Module
3
+ *
4
+ * Provides programmatic access to FrontMCP servers without HTTP/stdio transports.
5
+ *
6
+ * @module direct
7
+ */
8
+ export type { DirectClient, ConnectOptions, LLMConnectOptions, SessionOptions, ClientInfo, LLMPlatform, SearchSkillsOptions, SearchSkillsResult, SkillSearchResultItem, LoadSkillsOptions, LoadSkillsResult, LoadedSkillItem, ListSkillsOptions, ListSkillsResult, ElicitationRequest, ElicitationResponse, ElicitationHandler, CompleteOptions, CompleteResult, McpLogLevel, } from './client.types';
9
+ export { connect, connectOpenAI, connectClaude, connectLangChain, connectVercelAI } from './connect';
10
+ export { DirectClientImpl } from './direct-client';
11
+ export { detectPlatform, formatToolsForPlatform, formatResultForPlatform, PLATFORM_CLIENT_INFO } from './llm-platform';
12
+ export type { OpenAITool, ClaudeTool, LangChainTool, VercelAITool, VercelAITools } from './llm-platform';
13
+ export type { DirectMcpServer, DirectAuthContext, DirectCallOptions, DirectRequestMetadata } from './direct.types';
14
+ export { DirectMcpServerImpl } from './direct-server';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/direct/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,YAAY,EACV,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,WAAW,EAEX,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAEhB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAElB,eAAe,EACf,cAAc,EAEd,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAMrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACvH,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAMzG,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEnH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * LLM Platform Detection and Formatting
3
+ *
4
+ * Detects LLM platform from clientInfo and formats tools/results accordingly.
5
+ */
6
+ import type { Tool as McpTool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
7
+ import type { LLMPlatform, ClientInfo } from './client.types';
8
+ /**
9
+ * Client info presets for each LLM platform.
10
+ * Used by LLM-specific connect helpers.
11
+ */
12
+ export declare const PLATFORM_CLIENT_INFO: Record<LLMPlatform, ClientInfo>;
13
+ /**
14
+ * Detect LLM platform from clientInfo.
15
+ *
16
+ * @param clientInfo - MCP client info from handshake
17
+ * @returns Detected LLM platform
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * detectPlatform({ name: 'openai-agent', version: '1.0.0' }); // 'openai'
22
+ * detectPlatform({ name: 'claude', version: '1.0.0' }); // 'claude'
23
+ * detectPlatform({ name: 'my-agent', version: '1.0.0' }); // 'raw'
24
+ * ```
25
+ */
26
+ export declare function detectPlatform(clientInfo: ClientInfo): LLMPlatform;
27
+ /** OpenAI function calling tool format */
28
+ export interface OpenAITool {
29
+ type: 'function';
30
+ function: {
31
+ name: string;
32
+ description?: string;
33
+ parameters: Record<string, unknown>;
34
+ strict: boolean;
35
+ };
36
+ }
37
+ /** Anthropic Claude tool format */
38
+ export interface ClaudeTool {
39
+ name: string;
40
+ description?: string;
41
+ input_schema: Record<string, unknown>;
42
+ }
43
+ /** LangChain tool schema format */
44
+ export interface LangChainTool {
45
+ name: string;
46
+ description: string;
47
+ schema: Record<string, unknown>;
48
+ }
49
+ /** Vercel AI SDK tool format */
50
+ export interface VercelAITool {
51
+ description: string;
52
+ parameters: Record<string, unknown>;
53
+ }
54
+ /** Vercel AI tools map */
55
+ export type VercelAITools = Record<string, VercelAITool>;
56
+ /**
57
+ * Union of all platform-specific tool formats.
58
+ * Returned by formatToolsForPlatform based on detected platform.
59
+ */
60
+ export type FormattedTools = OpenAITool[] | ClaudeTool[] | LangChainTool[] | VercelAITools | McpTool[];
61
+ /**
62
+ * Union of all platform-specific tool result formats.
63
+ * Returned by formatResultForPlatform based on detected platform.
64
+ */
65
+ export type FormattedToolResult = string | unknown | Array<{
66
+ type: string;
67
+ text: string;
68
+ }> | CallToolResult | {
69
+ text?: string[];
70
+ images?: Array<{
71
+ data: string;
72
+ mimeType: string;
73
+ }>;
74
+ };
75
+ /**
76
+ * Format MCP tools for the specified LLM platform.
77
+ *
78
+ * @param tools - MCP tools from listTools()
79
+ * @param platform - Target LLM platform
80
+ * @returns Tools formatted for the platform
81
+ */
82
+ export declare function formatToolsForPlatform(tools: McpTool[], platform: LLMPlatform): FormattedTools;
83
+ /**
84
+ * Format MCP CallToolResult for the specified LLM platform.
85
+ *
86
+ * Handles both content-based responses (standard CallToolResult) and
87
+ * toolResult-based responses (newer MCP SDK versions).
88
+ *
89
+ * @param result - MCP tool result from callTool()
90
+ * @param platform - Target LLM platform
91
+ * @returns Result formatted for the platform
92
+ */
93
+ export declare function formatResultForPlatform(result: CallToolResult, platform: LLMPlatform): FormattedToolResult;
94
+ //# sourceMappingURL=llm-platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-platform.d.ts","sourceRoot":"","sources":["../../src/direct/llm-platform.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,EAAE,cAAc,EAA6B,MAAM,oCAAoC,CAAC;AACrH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,CAMhE,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW,CAiBlE;AAMD,0CAA0C;AAC1C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,MAAM,EAAE,OAAO,CAAC;KACjB,CAAC;CACH;AAMD,mCAAmC;AACnC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAMD,mCAAmC;AACnC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAMD,gCAAgC;AAChC,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,0BAA0B;AAC1B,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAMzD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,EAAE,GAAG,UAAU,EAAE,GAAG,aAAa,EAAE,GAAG,aAAa,GAAG,OAAO,EAAE,CAAC;AAEvG;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,OAAO,GACP,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GACrC,cAAc,GACd;IACE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD,CAAC;AA0DN;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,WAAW,GAAG,cAAc,CA+C9F;AA6ED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,GAAG,mBAAmB,CAuC1G"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Elicitation Fallback JSON Schema
3
+ *
4
+ * Defines the JSON Schema for elicitation fallback responses.
5
+ * This schema is used to extend tool output schemas when elicitation is enabled,
6
+ * allowing tools to return either their normal output OR an elicitation pending response.
7
+ *
8
+ * The fallback response instructs the LLM to collect user input and call
9
+ * sendElicitationResult to continue the original tool execution.
10
+ */
11
+ /**
12
+ * JSON Schema for the elicitation fallback response type.
13
+ * This is used in oneOf union with tool output schemas.
14
+ */
15
+ export declare const ELICITATION_FALLBACK_JSON_SCHEMA: Record<string, unknown>;
16
+ /**
17
+ * Type representing the elicitation fallback response structure.
18
+ * Used for type-checking at compile time.
19
+ */
20
+ export interface ElicitationFallbackResponse {
21
+ elicitationPending: {
22
+ /** Unique identifier for this elicitation request */
23
+ elicitId: string;
24
+ /** Question or prompt to display to the user */
25
+ message: string;
26
+ /** Instructions for the LLM on handling the request */
27
+ instructions?: string;
28
+ /** JSON Schema for expected response */
29
+ schema?: Record<string, unknown>;
30
+ };
31
+ }
32
+ //# sourceMappingURL=elicitation-fallback.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elicitation-fallback.schema.d.ts","sourceRoot":"","sources":["../../src/elicitation/elicitation-fallback.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AACH,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA6BpE,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kBAAkB,EAAE;QAClB,qDAAqD;QACrD,QAAQ,EAAE,MAAM,CAAC;QACjB,gDAAgD;QAChD,OAAO,EAAE,MAAM,CAAC;QAChB,uDAAuD;QACvD,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,wCAAwC;QACxC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,CAAC;CACH"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Elicitation Types - MCP Elicitation Support
3
+ *
4
+ * Types for requesting interactive user input from MCP clients during
5
+ * tool or agent execution.
6
+ */
7
+ import { ZodType } from 'zod';
8
+ import { Infer } from '../types/zod.types';
9
+ /**
10
+ * Default timeout for elicitation requests (5 minutes).
11
+ */
12
+ export declare const DEFAULT_ELICIT_TTL = 300000;
13
+ /**
14
+ * Possible statuses for an elicitation result.
15
+ *
16
+ * - `accept`: User submitted/accepted the elicitation (MCP SDK calls this 'accept')
17
+ * - `cancel`: User cancelled the elicitation
18
+ * - `decline`: User declined to provide information
19
+ */
20
+ export type ElicitStatus = 'accept' | 'cancel' | 'decline';
21
+ /**
22
+ * Result of an elicitation request.
23
+ *
24
+ * @template T - The type of the content when status is 'accept'
25
+ */
26
+ export interface ElicitResult<T = unknown> {
27
+ /**
28
+ * The user's action in response to the elicitation.
29
+ * Valid values: 'accept' | 'cancel' | 'decline' (see ElicitStatus)
30
+ */
31
+ status: ElicitStatus;
32
+ /**
33
+ * The validated content from the user's response.
34
+ * Only present when status is 'accept'.
35
+ */
36
+ content?: T;
37
+ }
38
+ /**
39
+ * Elicitation mode.
40
+ *
41
+ * - `form`: Display a form to collect structured input (most common)
42
+ * - `url`: Redirect user to a URL for out-of-band interaction (OAuth, payments)
43
+ */
44
+ export type ElicitMode = 'form' | 'url';
45
+ /**
46
+ * Options for elicitation requests.
47
+ */
48
+ export interface ElicitOptions {
49
+ /**
50
+ * The elicitation mode.
51
+ * @default 'form'
52
+ */
53
+ mode?: ElicitMode;
54
+ /**
55
+ * Timeout in milliseconds before the elicitation request times out.
56
+ * On timeout, an ElicitationTimeoutError is thrown to kill execution.
57
+ * @default 300000 (5 minutes)
58
+ */
59
+ ttl?: number;
60
+ /**
61
+ * Unique identifier for URL-mode elicitation.
62
+ * Required for URL mode to track completion via notifications.
63
+ */
64
+ elicitationId?: string;
65
+ }
66
+ /**
67
+ * Typed elicitation result that preserves the schema type.
68
+ *
69
+ * @template T - Zod schema type
70
+ */
71
+ export type TypedElicitResult<T extends ZodType> = ElicitResult<Infer<T>>;
72
+ /**
73
+ * MCP SDK elicitation result format.
74
+ *
75
+ * This represents the raw format from MCP SDK where `action` is used instead of `status`.
76
+ * Used in transport layer when handling responses from the client.
77
+ */
78
+ export interface McpElicitResult {
79
+ /** The user's action (MCP SDK uses 'action' instead of 'status') */
80
+ action: ElicitStatus;
81
+ /** The content from the user's response (only present when action is 'accept') */
82
+ content?: unknown;
83
+ }
84
+ /**
85
+ * Internal pending elicit tracking structure.
86
+ * Used by transport adapters to manage pending elicitation requests.
87
+ */
88
+ export interface PendingElicit<T = unknown> {
89
+ /** Unique identifier for this elicit request */
90
+ elicitId: string;
91
+ /** Handle for the timeout timer */
92
+ timeoutHandle: ReturnType<typeof setTimeout>;
93
+ /** Resolve function to complete the elicit promise */
94
+ resolve: (result: ElicitResult<T>) => void;
95
+ /** Reject function to fail the elicit promise */
96
+ reject: (err: unknown) => void;
97
+ }
98
+ /**
99
+ * Pending elicitation fallback record.
100
+ *
101
+ * Stores context needed to re-invoke the tool when the result arrives
102
+ * via the sendElicitationResult tool. Used for clients that don't support
103
+ * the standard MCP elicitation protocol.
104
+ */
105
+ export interface PendingElicitFallback {
106
+ /** Unique identifier for this elicit request */
107
+ elicitId: string;
108
+ /** Session ID that initiated the elicitation */
109
+ sessionId: string;
110
+ /** Name of the tool that requested elicitation */
111
+ toolName: string;
112
+ /** Original input arguments passed to the tool */
113
+ toolInput: unknown;
114
+ /** Message displayed to the user */
115
+ elicitMessage: string;
116
+ /** JSON Schema for the expected response */
117
+ elicitSchema: Record<string, unknown>;
118
+ /** Timestamp when the elicitation was created */
119
+ createdAt: number;
120
+ /** Absolute timestamp when the elicitation expires */
121
+ expiresAt: number;
122
+ }
123
+ /**
124
+ * Pre-resolved elicit result for fallback continuation.
125
+ *
126
+ * Stored when sendElicitationResult is called, and retrieved when
127
+ * the tool is re-invoked to provide the elicit result immediately.
128
+ */
129
+ export interface ResolvedElicitResult {
130
+ /** Unique identifier for this elicit request */
131
+ elicitId: string;
132
+ /** The elicitation result from the user */
133
+ result: ElicitResult<unknown>;
134
+ /** Timestamp when the result was resolved */
135
+ resolvedAt: number;
136
+ }
137
+ /**
138
+ * Result of fallback execution from sendElicitationResult.
139
+ *
140
+ * Published via pub/sub to notify the original waiting request
141
+ * when the tool re-invocation completes.
142
+ */
143
+ export interface FallbackExecutionResult {
144
+ /** Whether the tool execution succeeded */
145
+ success: boolean;
146
+ /** The tool result when success is true (MCP CallToolResult) */
147
+ result?: unknown;
148
+ /** Error message when success is false */
149
+ error?: string;
150
+ }
151
+ /**
152
+ * Callback type for fallback result subscriptions.
153
+ */
154
+ export type FallbackResultCallback = (result: FallbackExecutionResult) => void;
155
+ /**
156
+ * Default timeout for waiting fallback requests (5 minutes).
157
+ * Should match DEFAULT_ELICIT_TTL.
158
+ */
159
+ export declare const DEFAULT_FALLBACK_WAIT_TTL = 300000;
160
+ //# sourceMappingURL=elicitation.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elicitation.types.d.ts","sourceRoot":"","sources":["../../src/elicitation/elicitation.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC;;;OAGG;IACH,MAAM,EAAE,YAAY,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC;CACb;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,OAAO,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,MAAM,EAAE,YAAY,CAAC;IAErB,kFAAkF;IAClF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO;IACxC,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IAEjB,mCAAmC;IACnC,aAAa,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAE7C,sDAAsD;IACtD,OAAO,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAE3C,iDAAiD;IACjD,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IAEjB,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAElB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IAEjB,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;IAEnB,oCAAoC;IACpC,aAAa,EAAE,MAAM,CAAC;IAEtB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEtC,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAElB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IAEjB,2CAA2C;IAC3C,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAE9B,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IAEjB,gEAAgE;IAChE,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,yBAAyB,SAAS,CAAC"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Elicitation Request Flow
3
+ *
4
+ * Flow for initiating an elicitation request to the client.
5
+ * Provides hook points for middleware/plugins to intercept elicitation.
6
+ *
7
+ * @module elicitation/flows/elicitation-request.flow
8
+ */
9
+ import { FlowBase, FlowRunOptions } from '../../common';
10
+ import { z } from 'zod';
11
+ import type { PendingElicitRecord } from '../store';
12
+ declare const inputSchema: z.ZodObject<{
13
+ relatedRequestId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
14
+ sessionId: z.ZodString;
15
+ message: z.ZodString;
16
+ requestedSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
17
+ options: z.ZodOptional<z.ZodObject<{
18
+ mode: z.ZodOptional<z.ZodEnum<{
19
+ url: "url";
20
+ form: "form";
21
+ }>>;
22
+ ttl: z.ZodOptional<z.ZodNumber>;
23
+ elicitationId: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$strip>>;
25
+ }, z.core.$strip>;
26
+ declare const outputSchema: z.ZodObject<{
27
+ elicitId: z.ZodString;
28
+ sessionId: z.ZodString;
29
+ expiresAt: z.ZodNumber;
30
+ mode: z.ZodEnum<{
31
+ url: "url";
32
+ form: "form";
33
+ }>;
34
+ requestParams: z.ZodRecord<z.ZodString, z.ZodUnknown>;
35
+ pendingRecord: z.ZodType<PendingElicitRecord>;
36
+ }, z.core.$strip>;
37
+ declare const stateSchema: z.ZodObject<{
38
+ relatedRequestId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
39
+ sessionId: z.ZodString;
40
+ message: z.ZodString;
41
+ requestedSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
42
+ mode: z.ZodDefault<z.ZodEnum<{
43
+ url: "url";
44
+ form: "form";
45
+ }>>;
46
+ ttl: z.ZodDefault<z.ZodNumber>;
47
+ elicitationId: z.ZodOptional<z.ZodString>;
48
+ elicitId: z.ZodString;
49
+ expiresAt: z.ZodNumber;
50
+ pendingRecord: z.ZodType<PendingElicitRecord | undefined>;
51
+ requestParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
52
+ output: z.ZodOptional<z.ZodObject<{
53
+ elicitId: z.ZodString;
54
+ sessionId: z.ZodString;
55
+ expiresAt: z.ZodNumber;
56
+ mode: z.ZodEnum<{
57
+ url: "url";
58
+ form: "form";
59
+ }>;
60
+ requestParams: z.ZodRecord<z.ZodString, z.ZodUnknown>;
61
+ pendingRecord: z.ZodType<PendingElicitRecord>;
62
+ }, z.core.$strip>>;
63
+ }, z.core.$strip>;
64
+ declare const plan: {
65
+ readonly pre: ["parseInput", "validateRequest"];
66
+ readonly execute: ["generateElicitId", "storePendingRecord", "buildRequestParams"];
67
+ readonly finalize: ["finalize"];
68
+ };
69
+ declare global {
70
+ interface ExtendFlows {
71
+ 'elicitation:request': FlowRunOptions<ElicitationRequestFlow, typeof plan, typeof inputSchema, typeof outputSchema, typeof stateSchema>;
72
+ }
73
+ }
74
+ declare const name: "elicitation:request";
75
+ /**
76
+ * Flow for preparing an elicitation request.
77
+ *
78
+ * This flow handles the preparation stages of an elicitation:
79
+ * 1. Parse and validate input
80
+ * 2. Validate the request (mode requirements)
81
+ * 3. Generate elicit ID
82
+ * 4. Store pending record
83
+ * 5. Build request parameters
84
+ *
85
+ * The actual sending and waiting for response is handled by the transport
86
+ * adapter after this flow completes.
87
+ */
88
+ export default class ElicitationRequestFlow extends FlowBase<typeof name> {
89
+ logger: import("../../common").FrontMcpLogger;
90
+ parseInput(): Promise<void>;
91
+ validateRequest(): Promise<void>;
92
+ generateElicitId(): Promise<void>;
93
+ storePendingRecord(): Promise<void>;
94
+ buildRequestParams(): Promise<void>;
95
+ finalize(): Promise<void>;
96
+ }
97
+ export { ElicitationRequestFlow };
98
+ //# sourceMappingURL=elicitation-request.flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elicitation-request.flow.d.ts","sourceRoot":"","sources":["../../../src/elicitation/flows/elicitation-request.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,QAAQ,EAAyB,cAAc,EAAE,MAAM,cAAc,CAAC;AACrF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAGpD,QAAA,MAAM,WAAW;;;;;;;;;;;;;iBAiBf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;mBAYU,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;iBACxD,CAAC;AAEH,QAAA,MAAM,WAAW;;;;;;;;;;;;;mBAUsB,CAAC,CAAC,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;;;;;;;;;;;uBAbrD,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;;iBAgBxD,CAAC;AAEH,QAAA,MAAM,IAAI;;;;CAI2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,qBAAqB,EAAE,cAAc,CACnC,sBAAsB,EACtB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,qBAA8B,CAAC;AAG5C;;;;;;;;;;;;GAYG;AAQH,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IACvE,MAAM,wCAAoD;IAGpD,UAAU;IAoBV,eAAe;IAcf,gBAAgB;IAehB,kBAAkB;IAuBlB,kBAAkB;IAyBlB,QAAQ;CAuBf;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}