@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,197 @@
1
+ /**
2
+ * Elicitation Store Factory
3
+ *
4
+ * Factory functions for creating elicitation stores using @frontmcp/utils storage.
5
+ * Supports Memory, Redis, and Upstash backends with automatic detection.
6
+ *
7
+ * Note: Vercel KV is NOT supported for elicitation because it doesn't support pub/sub
8
+ * operations which are required for cross-node result routing.
9
+ *
10
+ * @module elicitation/store/elicitation-store.factory
11
+ */
12
+ import type { StorageConfig, RootStorage } from '@frontmcp/utils';
13
+ import type { FrontMcpLogger, RedisOptionsInput } from '../../common';
14
+ import type { ElicitationStore } from './elicitation.store';
15
+ /**
16
+ * Options for creating an elicitation store.
17
+ */
18
+ export interface ElicitationStoreOptions {
19
+ /**
20
+ * Storage configuration for the elicitation store.
21
+ * Uses @frontmcp/utils storage configuration format.
22
+ *
23
+ * @example Auto-detect
24
+ * ```typescript
25
+ * { type: 'auto' }
26
+ * ```
27
+ *
28
+ * @example Redis
29
+ * ```typescript
30
+ * {
31
+ * type: 'redis',
32
+ * redis: { url: 'redis://localhost:6379' }
33
+ * }
34
+ * ```
35
+ *
36
+ * @example Upstash
37
+ * ```typescript
38
+ * {
39
+ * type: 'upstash',
40
+ * upstash: { enablePubSub: true }
41
+ * }
42
+ * ```
43
+ */
44
+ storage?: StorageConfig;
45
+ /**
46
+ * Redis configuration for distributed deployments.
47
+ * This is a convenience option that maps to storage.redis.
48
+ * For new code, prefer using the `storage` option directly.
49
+ */
50
+ redis?: RedisOptionsInput;
51
+ /**
52
+ * Key prefix for all elicitation keys.
53
+ * @default 'mcp:elicit:'
54
+ */
55
+ keyPrefix?: string;
56
+ /**
57
+ * Logger instance for store operations.
58
+ */
59
+ logger?: FrontMcpLogger;
60
+ /**
61
+ * Whether running in Edge runtime (requires distributed storage).
62
+ * @default false
63
+ */
64
+ isEdgeRuntime?: boolean;
65
+ /**
66
+ * Whether to require pub/sub support.
67
+ * If true, will throw if the storage backend doesn't support pub/sub.
68
+ * @default true
69
+ */
70
+ requiresPubSub?: boolean;
71
+ /**
72
+ * Encryption configuration for elicitation data.
73
+ *
74
+ * When enabled, all elicitation data is encrypted using session-derived keys.
75
+ * This ensures that only requests with the actual sessionId can decrypt the data.
76
+ *
77
+ * @example Enable encryption (auto-detect secret from env)
78
+ * ```typescript
79
+ * { encryption: { enabled: true } }
80
+ * ```
81
+ *
82
+ * @example Explicit secret
83
+ * ```typescript
84
+ * { encryption: { enabled: true, secret: 'my-secret-key' } }
85
+ * ```
86
+ */
87
+ encryption?: {
88
+ /**
89
+ * Whether encryption is enabled.
90
+ * - true: Always encrypt (throws if no secret available)
91
+ * - false: Never encrypt
92
+ * - 'auto': Encrypt if secret is available (default)
93
+ * @default 'auto'
94
+ */
95
+ enabled?: boolean | 'auto';
96
+ /**
97
+ * Server secret for key derivation.
98
+ * Falls back to MCP_ELICITATION_SECRET, MCP_SESSION_SECRET, or MCP_SERVER_SECRET env vars.
99
+ */
100
+ secret?: string;
101
+ };
102
+ }
103
+ /**
104
+ * Result of creating an elicitation store.
105
+ */
106
+ export interface ElicitationStoreResult {
107
+ /**
108
+ * The created elicitation store.
109
+ */
110
+ store: ElicitationStore;
111
+ /**
112
+ * The type of storage backend used.
113
+ */
114
+ type: 'memory' | 'redis' | 'upstash' | 'auto';
115
+ /**
116
+ * The underlying storage instance.
117
+ * Available for advanced use cases.
118
+ */
119
+ storage: RootStorage;
120
+ /**
121
+ * Whether encryption is enabled for the store.
122
+ */
123
+ encrypted: boolean;
124
+ }
125
+ /**
126
+ * Create an elicitation store based on configuration.
127
+ *
128
+ * Uses @frontmcp/utils storage abstractions for unified backend support.
129
+ *
130
+ * @param options - Store configuration
131
+ * @returns The created elicitation store with type information
132
+ *
133
+ * @example Auto-detect (recommended)
134
+ * ```typescript
135
+ * const { store, type } = await createElicitationStore({
136
+ * keyPrefix: 'myapp:elicit:',
137
+ * logger,
138
+ * });
139
+ * ```
140
+ *
141
+ * @example Redis
142
+ * ```typescript
143
+ * const { store, type } = await createElicitationStore({
144
+ * storage: {
145
+ * type: 'redis',
146
+ * redis: { url: 'redis://localhost:6379' },
147
+ * },
148
+ * logger,
149
+ * });
150
+ * ```
151
+ *
152
+ * @example Memory (development)
153
+ * ```typescript
154
+ * const { store, type } = await createElicitationStore({
155
+ * storage: { type: 'memory' },
156
+ * logger,
157
+ * });
158
+ * ```
159
+ *
160
+ * @throws {ElicitationNotSupportedError} If Vercel KV is configured (no pub/sub support)
161
+ * @throws {ElicitationNotSupportedError} If running on Edge runtime without distributed storage
162
+ * @throws {ElicitationNotSupportedError} If pub/sub is required but not supported
163
+ */
164
+ export declare function createElicitationStore(options?: ElicitationStoreOptions): Promise<ElicitationStoreResult>;
165
+ /**
166
+ * Create an in-memory elicitation store explicitly.
167
+ * Use this when you know you want in-memory storage regardless of configuration.
168
+ *
169
+ * @param options - Optional configuration
170
+ * @returns An in-memory elicitation store
171
+ */
172
+ export declare function createMemoryElicitationStore(options?: {
173
+ keyPrefix?: string;
174
+ logger?: FrontMcpLogger;
175
+ encryption?: {
176
+ enabled?: boolean | 'auto';
177
+ secret?: string;
178
+ };
179
+ }): ElicitationStoreResult;
180
+ /**
181
+ * Create an elicitation store from an existing storage instance.
182
+ * Use this when you want to share a storage connection with other systems.
183
+ *
184
+ * @param storage - Existing storage instance
185
+ * @param options - Optional configuration
186
+ * @returns An elicitation store using the provided storage
187
+ */
188
+ export declare function createElicitationStoreFromStorage(storage: RootStorage, options?: {
189
+ keyPrefix?: string;
190
+ logger?: FrontMcpLogger;
191
+ requiresPubSub?: boolean;
192
+ encryption?: {
193
+ enabled?: boolean | 'auto';
194
+ secret?: string;
195
+ };
196
+ }): ElicitationStoreResult;
197
+ //# sourceMappingURL=elicitation-store.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elicitation-store.factory.d.ts","sourceRoot":"","sources":["../../../src/elicitation/store/elicitation-store.factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CA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C,EAAE,MAAM,CAAC;KACjB,CAAC;CACE,GACL,sBAAsB,CAwBxB;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACE,GACL,sBAAsB,CAsCxB"}
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Elicitation Store Interface
3
+ *
4
+ * Abstraction for storing and routing elicitation state across distributed systems.
5
+ * Supports storage backends with pub/sub for multi-node deployments and in-memory fallback for
6
+ * single-node/development environments.
7
+ *
8
+ * Key design decisions:
9
+ * - Pending records are keyed by sessionId (only one elicit per session allowed)
10
+ * - Pub/sub channels are keyed by elicitId (for result routing)
11
+ * - This separation allows form mode (lookup by session) and URL mode (direct elicitId)
12
+ */
13
+ import { ElicitResult, ElicitMode, PendingElicitFallback, ResolvedElicitResult, FallbackExecutionResult, FallbackResultCallback } from '../elicitation.types';
14
+ /**
15
+ * Record stored for each pending elicitation.
16
+ * Keyed by sessionId since only one pending elicit per session is allowed.
17
+ */
18
+ export interface PendingElicitRecord {
19
+ /** Unique identifier for this elicit request (used for pub/sub routing) */
20
+ elicitId: string;
21
+ /** Session ID that initiated the elicitation (used as storage key) */
22
+ sessionId: string;
23
+ /** Timestamp when the elicitation was created */
24
+ createdAt: number;
25
+ /** Absolute timestamp when the elicitation expires */
26
+ expiresAt: number;
27
+ /** Message displayed to the user */
28
+ message: string;
29
+ /** Elicitation mode (form or url) */
30
+ mode: ElicitMode;
31
+ /** JSON Schema for validating result content (optional for backward compat) */
32
+ requestedSchema?: Record<string, unknown>;
33
+ }
34
+ /**
35
+ * Callback type for elicitation result subscriptions.
36
+ */
37
+ export type ElicitResultCallback<T = unknown> = (result: ElicitResult<T>) => void;
38
+ /**
39
+ * Unsubscribe function returned by subscribeResult.
40
+ */
41
+ export type ElicitUnsubscribe = () => Promise<void>;
42
+ /**
43
+ * Elicitation store interface.
44
+ *
45
+ * Provides storage and pub/sub for elicitation state. In distributed deployments,
46
+ * this enables routing elicitation responses to the correct node via Redis pub/sub.
47
+ *
48
+ * Storage is keyed by sessionId (only one pending elicit per session).
49
+ * Pub/sub is keyed by elicitId (for cross-node result routing).
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * // Store pending elicitation (keyed by sessionId)
54
+ * await store.setPending({
55
+ * elicitId: 'elicit-123',
56
+ * sessionId: 'session-abc',
57
+ * createdAt: Date.now(),
58
+ * expiresAt: Date.now() + 300000,
59
+ * message: 'Confirm action?',
60
+ * mode: 'form',
61
+ * });
62
+ *
63
+ * // Subscribe to results by elicitId (on the node that sent the elicit)
64
+ * const unsubscribe = await store.subscribeResult('elicit-123', (result) => {
65
+ * console.log('Got result:', result);
66
+ * });
67
+ *
68
+ * // On any node: lookup by sessionId, then publish result by elicitId
69
+ * const pending = await store.getPending('session-abc');
70
+ * if (pending) {
71
+ * await store.publishResult(pending.elicitId, pending.sessionId, { status: 'accept', content: { confirmed: true } });
72
+ * }
73
+ * ```
74
+ */
75
+ export interface ElicitationStore {
76
+ /**
77
+ * Store a pending elicitation with TTL.
78
+ * The record is keyed by sessionId and will auto-expire based on `expiresAt`.
79
+ *
80
+ * @param record - The pending elicitation record to store
81
+ */
82
+ setPending(record: PendingElicitRecord): Promise<void>;
83
+ /**
84
+ * Get a pending elicitation by session ID.
85
+ * Since only one elicit per session is allowed, sessionId is the lookup key.
86
+ *
87
+ * @param sessionId - The session ID to look up
88
+ * @returns The pending record, or null if not found or expired
89
+ */
90
+ getPending(sessionId: string): Promise<PendingElicitRecord | null>;
91
+ /**
92
+ * Delete a pending elicitation by session ID.
93
+ * Called after the elicitation is resolved or times out.
94
+ *
95
+ * @param sessionId - The session ID to delete
96
+ */
97
+ deletePending(sessionId: string): Promise<void>;
98
+ /**
99
+ * Subscribe to elicitation results for a specific elicit ID.
100
+ * In distributed mode, this creates a Redis pub/sub subscription.
101
+ *
102
+ * @param elicitId - The elicitation ID to subscribe to
103
+ * @param callback - Called when a result is published for this elicit ID
104
+ * @param sessionId - Optional session ID for encrypted stores (required for decryption)
105
+ * @returns Unsubscribe function to clean up the subscription
106
+ */
107
+ subscribeResult<T = unknown>(elicitId: string, callback: ElicitResultCallback<T>, sessionId?: string): Promise<ElicitUnsubscribe>;
108
+ /**
109
+ * Publish an elicitation result.
110
+ * In distributed mode, this publishes via Redis pub/sub to reach the
111
+ * correct node regardless of which node received the client response.
112
+ * Also cleans up the pending record.
113
+ *
114
+ * @param elicitId - The elicitation ID
115
+ * @param sessionId - The session ID (for cleanup)
116
+ * @param result - The elicitation result to publish
117
+ */
118
+ publishResult<T = unknown>(elicitId: string, sessionId: string, result: ElicitResult<T>): Promise<void>;
119
+ /**
120
+ * Clean up store resources.
121
+ * Called during server shutdown.
122
+ */
123
+ destroy?(): Promise<void>;
124
+ /**
125
+ * Store a pending elicitation fallback context.
126
+ * Keyed by elicitId since we need to look up by elicitId when
127
+ * sendElicitationResult is called.
128
+ *
129
+ * @param record - The pending fallback record to store
130
+ */
131
+ setPendingFallback(record: PendingElicitFallback): Promise<void>;
132
+ /**
133
+ * Get a pending elicitation fallback by elicit ID.
134
+ *
135
+ * @param elicitId - The elicitation ID to look up
136
+ * @param sessionId - Optional session ID for encrypted stores (required for decryption)
137
+ * @returns The pending fallback record, or null if not found or expired
138
+ */
139
+ getPendingFallback(elicitId: string, sessionId?: string): Promise<PendingElicitFallback | null>;
140
+ /**
141
+ * Delete a pending elicitation fallback by elicit ID.
142
+ *
143
+ * @param elicitId - The elicitation ID to delete
144
+ */
145
+ deletePendingFallback(elicitId: string): Promise<void>;
146
+ /**
147
+ * Store a resolved elicit result for re-invocation.
148
+ * Used to pass the result to the tool when it's re-invoked.
149
+ *
150
+ * @param elicitId - The elicitation ID
151
+ * @param result - The elicitation result from the user
152
+ * @param sessionId - Optional session ID for encrypted stores (required for encryption)
153
+ */
154
+ setResolvedResult(elicitId: string, result: ElicitResult<unknown>, sessionId?: string): Promise<void>;
155
+ /**
156
+ * Get a resolved elicit result by elicit ID.
157
+ *
158
+ * @param elicitId - The elicitation ID to look up
159
+ * @param sessionId - Optional session ID for encrypted stores (required for decryption)
160
+ * @returns The resolved result, or null if not found
161
+ */
162
+ getResolvedResult(elicitId: string, sessionId?: string): Promise<ResolvedElicitResult | null>;
163
+ /**
164
+ * Delete a resolved elicit result by elicit ID.
165
+ *
166
+ * @param elicitId - The elicitation ID to delete
167
+ */
168
+ deleteResolvedResult(elicitId: string): Promise<void>;
169
+ /**
170
+ * Subscribe to fallback execution results for a specific elicit ID.
171
+ * In distributed mode, this creates a Redis pub/sub subscription
172
+ * for the channel `fallback-result:{elicitId}`.
173
+ *
174
+ * @param elicitId - The elicitation ID to subscribe to
175
+ * @param callback - Called when a fallback result is published for this elicit ID
176
+ * @param sessionId - Optional session ID for encrypted stores (required for decryption)
177
+ * @returns Unsubscribe function to clean up the subscription
178
+ */
179
+ subscribeFallbackResult(elicitId: string, callback: FallbackResultCallback, sessionId?: string): Promise<ElicitUnsubscribe>;
180
+ /**
181
+ * Publish a fallback execution result.
182
+ * In distributed mode, this publishes via Redis pub/sub to reach the
183
+ * waiting node that originated the elicitation request.
184
+ *
185
+ * @param elicitId - The elicitation ID
186
+ * @param sessionId - The session ID (for encryption)
187
+ * @param result - The fallback execution result to publish
188
+ */
189
+ publishFallbackResult(elicitId: string, sessionId: string, result: FallbackExecutionResult): Promise<void>;
190
+ }
191
+ //# sourceMappingURL=elicitation.store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elicitation.store.d.ts","sourceRoot":"","sources":["../../../src/elicitation/store/elicitation.store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL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AAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5G"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Encrypted Elicitation Store
3
+ *
4
+ * Wraps an underlying ElicitationStore with session-based encryption.
5
+ * All data is encrypted using session-derived keys before storage.
6
+ *
7
+ * Security Model:
8
+ * - Pending records: encrypted with record.sessionId
9
+ * - Fallback records: keyed by {sessionId}:{elicitId}, encrypted with sessionId
10
+ * - Resolved results: keyed by {sessionId}:{elicitId}, encrypted with sessionId
11
+ * - Pub/sub messages: encrypted with sessionId before publish
12
+ *
13
+ * Migration Support:
14
+ * - Reads attempt decryption first, falls back to plaintext for migration
15
+ * - All new writes are encrypted
16
+ * - Old data expires via TTL (5-10 minutes)
17
+ *
18
+ * @module elicitation/store/encrypted-elicitation.store
19
+ */
20
+ import type { FrontMcpLogger } from '../../common';
21
+ import type { ElicitationStore, PendingElicitRecord, ElicitResultCallback, ElicitUnsubscribe } from './elicitation.store';
22
+ import type { ElicitResult, PendingElicitFallback, ResolvedElicitResult, FallbackExecutionResult, FallbackResultCallback } from '../elicitation.types';
23
+ /**
24
+ * Options for creating an encrypted elicitation store.
25
+ */
26
+ export interface EncryptedElicitationStoreOptions {
27
+ /**
28
+ * Server secret for key derivation.
29
+ * Falls back to env vars if not provided.
30
+ */
31
+ secret?: string;
32
+ /**
33
+ * Logger instance for store operations.
34
+ */
35
+ logger?: FrontMcpLogger;
36
+ }
37
+ /**
38
+ * Encrypted wrapper around an ElicitationStore.
39
+ *
40
+ * Provides transparent encryption/decryption of all stored data using
41
+ * session-derived keys. This ensures that:
42
+ * 1. Data at rest is encrypted
43
+ * 2. Only requests with the correct sessionId can decrypt
44
+ * 3. Different sessions cannot access each other's data
45
+ */
46
+ export declare class EncryptedElicitationStore implements ElicitationStore {
47
+ private readonly store;
48
+ private readonly secret?;
49
+ private readonly logger?;
50
+ constructor(store: ElicitationStore, options?: EncryptedElicitationStoreOptions);
51
+ /**
52
+ * Store a pending elicitation with encryption.
53
+ * The record is encrypted using its own sessionId.
54
+ */
55
+ setPending(record: PendingElicitRecord): Promise<void>;
56
+ /**
57
+ * Get a pending elicitation by session ID.
58
+ * Attempts decryption, falls back to plaintext for migration.
59
+ */
60
+ getPending(sessionId: string): Promise<PendingElicitRecord | null>;
61
+ /**
62
+ * Delete a pending elicitation by session ID.
63
+ */
64
+ deletePending(sessionId: string): Promise<void>;
65
+ /**
66
+ * Subscribe to elicitation results with decryption.
67
+ */
68
+ subscribeResult<T = unknown>(elicitId: string, callback: ElicitResultCallback<T>, sessionId?: string): Promise<ElicitUnsubscribe>;
69
+ /**
70
+ * Publish an elicitation result with encryption.
71
+ */
72
+ publishResult<T = unknown>(elicitId: string, sessionId: string, result: ElicitResult<T>): Promise<void>;
73
+ /**
74
+ * Store a pending elicitation fallback context with encryption.
75
+ */
76
+ setPendingFallback(record: PendingElicitFallback): Promise<void>;
77
+ /**
78
+ * Get a pending elicitation fallback by elicit ID.
79
+ * Requires sessionId for decryption.
80
+ */
81
+ getPendingFallback(elicitId: string, sessionId?: string): Promise<PendingElicitFallback | null>;
82
+ /**
83
+ * Delete a pending elicitation fallback by elicit ID.
84
+ */
85
+ deletePendingFallback(elicitId: string): Promise<void>;
86
+ /**
87
+ * Store a resolved elicit result with encryption.
88
+ */
89
+ setResolvedResult(elicitId: string, result: ElicitResult<unknown>, sessionId?: string): Promise<void>;
90
+ /**
91
+ * Get a resolved elicit result by elicit ID.
92
+ * Requires sessionId for decryption.
93
+ */
94
+ getResolvedResult(elicitId: string, sessionId?: string): Promise<ResolvedElicitResult | null>;
95
+ /**
96
+ * Delete a resolved elicit result by elicit ID.
97
+ */
98
+ deleteResolvedResult(elicitId: string): Promise<void>;
99
+ /**
100
+ * Subscribe to fallback execution results with decryption.
101
+ */
102
+ subscribeFallbackResult(elicitId: string, callback: FallbackResultCallback, sessionId?: string): Promise<ElicitUnsubscribe>;
103
+ /**
104
+ * Publish a fallback execution result with encryption.
105
+ */
106
+ publishFallbackResult(elicitId: string, sessionId: string, result: FallbackExecutionResult): Promise<void>;
107
+ destroy(): Promise<void>;
108
+ /**
109
+ * Decrypt a pending record.
110
+ */
111
+ private decryptPendingRecord;
112
+ /**
113
+ * Decrypt a fallback record.
114
+ */
115
+ private decryptFallbackRecord;
116
+ /**
117
+ * Decrypt a resolved record.
118
+ */
119
+ private decryptResolvedRecord;
120
+ }
121
+ //# sourceMappingURL=encrypted-elicitation.store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encrypted-elicitation.store.d.ts","sourceRoot":"","sources":["../../../src/elicitation/store/encrypted-elicitation.store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAS9B;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,qBAAa,yBAA0B,YAAW,gBAAgB;IAChE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAiB;gBAE7B,KAAK,EAAE,gBAAgB,EAAE,OAAO,GAAE,gCAAqC;IAUnF;;;OAGG;IACG,UAAU,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IA+B5D;;;OA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MAAM,EAChB,QAAQ,EAAE,sBAAsB,EAChC,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,CAAC;IA+B7B;;OAEG;IACG,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB1G,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ9B;;OAEG;YACW,oBAAoB;IAuClC;;OAEG;YACW,qBAAqB;IAiDnC;;OAEG;YACW,qBAAqB;CA4CpC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Elicitation Store Module
3
+ *
4
+ * Storage abstractions for elicitation state management.
5
+ * Uses @frontmcp/utils storage for unified backend support.
6
+ *
7
+ * @module elicitation/store
8
+ */
9
+ export type { ElicitationStore, PendingElicitRecord, ElicitResultCallback, ElicitUnsubscribe, } from './elicitation.store';
10
+ export { StorageElicitationStore } from './storage-elicitation.store';
11
+ export { EncryptedElicitationStore, type EncryptedElicitationStoreOptions } from './encrypted-elicitation.store';
12
+ export { deriveElicitationKey, encryptElicitationData, decryptElicitationData, isEncryptedBlob, serializeElicitationBlob, deserializeElicitationBlob, encryptAndSerialize, deserializeAndDecrypt, tryDecryptStoredValue, getElicitationSecret, isElicitationEncryptionAvailable, type ElicitationEncryptedBlob, type ElicitationEncryptionConfig, } from './elicitation-encryption';
13
+ export { createElicitationStore, createMemoryElicitationStore, createElicitationStoreFromStorage, type ElicitationStoreOptions, type ElicitationStoreResult, } from './elicitation-store.factory';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elicitation/store/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,KAAK,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AAGjH,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,GACjC,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,iCAAiC,EACjC,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,GAC5B,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Storage-Based Elicitation Store
3
+ *
4
+ * Unified elicitation store implementation using @frontmcp/utils storage abstractions.
5
+ * Works with Memory, Redis, and Upstash backends.
6
+ *
7
+ * @module elicitation/store/storage-elicitation.store
8
+ */
9
+ import type { NamespacedStorage } from '@frontmcp/utils';
10
+ import type { FrontMcpLogger } from '../../common';
11
+ import type { ElicitationStore, PendingElicitRecord, ElicitResultCallback, ElicitUnsubscribe } from './elicitation.store';
12
+ import type { ElicitResult, PendingElicitFallback, ResolvedElicitResult, FallbackExecutionResult, FallbackResultCallback } from '../elicitation.types';
13
+ /**
14
+ * Elicitation store using @frontmcp/utils storage abstractions.
15
+ *
16
+ * Features:
17
+ * - Uses TypedStorage for type-safe JSON serialization
18
+ * - Uses NamespacedStorage for key prefixing
19
+ * - Uses native pub/sub from storage adapter (works with Memory, Redis, Upstash)
20
+ * - Automatic TTL-based expiration
21
+ *
22
+ * Storage layout:
23
+ * - `pending:{sessionId}` - Pending elicitation records
24
+ * - `fallback:{elicitId}` - Fallback context for re-invocation
25
+ * - `resolved:{elicitId}` - Pre-resolved results for fallback flow
26
+ * - Pub/sub channel: `result:{elicitId}` - Result routing
27
+ */
28
+ export declare class StorageElicitationStore implements ElicitationStore {
29
+ private readonly storage;
30
+ private readonly pending;
31
+ private readonly fallback;
32
+ private readonly resolved;
33
+ private readonly logger?;
34
+ /** Local callback registry for pub/sub (maps elicitId -> callbacks) */
35
+ private readonly localCallbacks;
36
+ /** Active subscriptions (maps elicitId -> unsubscribe function) */
37
+ private readonly activeSubscriptions;
38
+ /** Pending subscriptions guard to prevent duplicate concurrent subscribe calls */
39
+ private readonly pendingSubscriptions;
40
+ /** Local callback registry for fallback results (maps elicitId -> callbacks) */
41
+ private readonly fallbackResultCallbacks;
42
+ /** Active fallback subscriptions (maps elicitId -> unsubscribe function) */
43
+ private readonly activeFallbackSubscriptions;
44
+ /** Pending fallback subscriptions guard */
45
+ private readonly pendingFallbackSubscriptions;
46
+ constructor(storage: NamespacedStorage, logger?: FrontMcpLogger);
47
+ /**
48
+ * Store a pending elicitation with TTL.
49
+ */
50
+ setPending(record: PendingElicitRecord): Promise<void>;
51
+ /**
52
+ * Get a pending elicitation by session ID.
53
+ */
54
+ getPending(sessionId: string): Promise<PendingElicitRecord | null>;
55
+ /**
56
+ * Delete a pending elicitation by session ID.
57
+ */
58
+ deletePending(sessionId: string): Promise<void>;
59
+ /**
60
+ * Subscribe to elicitation results for a specific elicit ID.
61
+ * Uses in-flight subscription guard to prevent duplicate concurrent subscriptions.
62
+ */
63
+ subscribeResult<T = unknown>(elicitId: string, callback: ElicitResultCallback<T>, _sessionId?: string): Promise<ElicitUnsubscribe>;
64
+ /**
65
+ * Publish an elicitation result.
66
+ *
67
+ * When pub/sub is supported, we rely entirely on the pub/sub mechanism
68
+ * to deliver messages (even locally). This avoids double-invocation for
69
+ * memory-based storage where pub/sub IS local.
70
+ *
71
+ * When pub/sub is not supported, we invoke local callbacks directly.
72
+ */
73
+ publishResult<T = unknown>(elicitId: string, sessionId: string, result: ElicitResult<T>): Promise<void>;
74
+ /**
75
+ * Store a pending elicitation fallback context.
76
+ */
77
+ setPendingFallback(record: PendingElicitFallback): Promise<void>;
78
+ /**
79
+ * Get a pending elicitation fallback by elicit ID.
80
+ */
81
+ getPendingFallback(elicitId: string, _sessionId?: string): Promise<PendingElicitFallback | null>;
82
+ /**
83
+ * Delete a pending elicitation fallback by elicit ID.
84
+ */
85
+ deletePendingFallback(elicitId: string): Promise<void>;
86
+ /**
87
+ * Store a resolved elicit result for re-invocation.
88
+ */
89
+ setResolvedResult(elicitId: string, result: ElicitResult<unknown>, _sessionId?: string): Promise<void>;
90
+ /**
91
+ * Get a resolved elicit result by elicit ID.
92
+ */
93
+ getResolvedResult(elicitId: string, _sessionId?: string): Promise<ResolvedElicitResult | null>;
94
+ /**
95
+ * Delete a resolved elicit result by elicit ID.
96
+ */
97
+ deleteResolvedResult(elicitId: string): Promise<void>;
98
+ /**
99
+ * Subscribe to fallback execution results for a specific elicit ID.
100
+ * Uses in-flight subscription guard to prevent duplicate concurrent subscriptions.
101
+ */
102
+ subscribeFallbackResult(elicitId: string, callback: FallbackResultCallback, _sessionId?: string): Promise<ElicitUnsubscribe>;
103
+ /**
104
+ * Publish a fallback execution result.
105
+ *
106
+ * When pub/sub is supported, we rely entirely on the pub/sub mechanism
107
+ * to deliver messages (even locally). This avoids double-invocation for
108
+ * memory-based storage where pub/sub IS local.
109
+ *
110
+ * When pub/sub is not supported, we invoke local callbacks directly.
111
+ */
112
+ publishFallbackResult(elicitId: string, sessionId: string, result: FallbackExecutionResult): Promise<void>;
113
+ /**
114
+ * Clean up store resources.
115
+ */
116
+ destroy(): Promise<void>;
117
+ }
118
+ //# sourceMappingURL=storage-elicitation.store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-elicitation.store.d.ts","sourceRoot":"","sources":["../../../src/elicitation/store/storage-elicitation.store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,iBAAiB,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO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