@frontmcp/sdk 1.13.2 → 1.14.0-rc.1

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 (568) hide show
  1. package/agent/agent.instance.d.ts +4 -0
  2. package/agent/agent.instance.d.ts.map +1 -1
  3. package/agent/agent.scope.d.ts +3 -0
  4. package/agent/agent.scope.d.ts.map +1 -1
  5. package/agent/flows/call-agent.flow.d.ts.map +1 -1
  6. package/app/instances/app.local.instance.d.ts.map +1 -1
  7. package/app/lazy/lazy-placeholders.d.ts +6 -9
  8. package/app/lazy/lazy-placeholders.d.ts.map +1 -1
  9. package/auth/auth-ui/auth-ui.contract.d.ts +4 -1
  10. package/auth/auth-ui/auth-ui.contract.d.ts.map +1 -1
  11. package/auth/authorized-apps.utils.d.ts +2 -0
  12. package/auth/authorized-apps.utils.d.ts.map +1 -1
  13. package/auth/client-display-name.d.ts +52 -0
  14. package/auth/client-display-name.d.ts.map +1 -0
  15. package/auth/federated-steps.d.ts.map +1 -1
  16. package/auth/flows/oauth.auth-ui.flow.d.ts +1 -1
  17. package/auth/flows/oauth.authorize.flow.d.ts +6 -3
  18. package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
  19. package/auth/flows/oauth.callback.flow.d.ts +3 -8
  20. package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
  21. package/auth/flows/oauth.connect.flow.d.ts +1 -1
  22. package/auth/flows/oauth.provider-callback.flow.d.ts +9 -2
  23. package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -1
  24. package/auth/flows/oauth.register.flow.d.ts +6 -4
  25. package/auth/flows/oauth.register.flow.d.ts.map +1 -1
  26. package/auth/flows/oauth.token.flow.d.ts +1 -1
  27. package/auth/flows/oauth.userinfo.flow.d.ts +1 -1
  28. package/auth/flows/session.verify.flow.d.ts +20 -4
  29. package/auth/flows/session.verify.flow.d.ts.map +1 -1
  30. package/auth/flows/well-known.jwks.flow.d.ts +3 -3
  31. package/auth/flows/well-known.oauth-authorization-server.flow.d.ts +2 -2
  32. package/auth/flows/well-known.prm.flow.d.ts +1 -1
  33. package/auth/instances/instance.local-primary-auth.d.ts +8 -0
  34. package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
  35. package/auth/instances/instance.remote-primary-auth.d.ts +2 -0
  36. package/auth/instances/instance.remote-primary-auth.d.ts.map +1 -1
  37. package/auth/session/session-store.factory.d.ts.map +1 -1
  38. package/browser/agent/agent.instance.mjs +16 -0
  39. package/browser/agent/agent.scope.mjs +9 -0
  40. package/browser/agent/flows/call-agent.flow.mjs +3 -1
  41. package/browser/app/instances/app.local.instance.mjs +6 -1
  42. package/browser/app/lazy/lazy-placeholders.mjs +3 -3
  43. package/browser/auth/authorized-apps.utils.mjs +15 -0
  44. package/browser/auth/client-display-name.mjs +62 -0
  45. package/browser/auth/federated-steps.mjs +2 -0
  46. package/browser/auth/flows/oauth.authorize.flow.mjs +25 -10
  47. package/browser/auth/flows/oauth.callback.flow.mjs +29 -31
  48. package/browser/auth/flows/oauth.provider-callback.flow.mjs +83 -14
  49. package/browser/auth/flows/oauth.register.flow.mjs +5 -24
  50. package/browser/auth/flows/session.verify.flow.mjs +31 -12
  51. package/browser/auth/instances/instance.local-primary-auth.mjs +43 -10
  52. package/browser/auth/instances/instance.remote-primary-auth.mjs +15 -0
  53. package/browser/auth/session/session-store.factory.mjs +15 -36
  54. package/browser/builtin/authorities/authorities-input.mjs +12 -0
  55. package/browser/common/decorators/front-mcp.decorator.mjs +2 -1
  56. package/browser/common/decorators/http-route.decorator.mjs +4 -0
  57. package/browser/common/index.mjs +2 -2
  58. package/browser/common/interfaces/server.interface.mjs +4 -0
  59. package/browser/common/metadata/duty.metadata.mjs +29 -6
  60. package/browser/common/metadata/event.metadata.mjs +2 -1
  61. package/browser/common/metadata/front-mcp.metadata.mjs +18 -1
  62. package/browser/common/metadata/workflow.metadata.mjs +1 -0
  63. package/browser/common/tokens/front-mcp.tokens.mjs +3 -0
  64. package/browser/common/tokens/workflow.tokens.mjs +1 -0
  65. package/browser/common/types/auth/session.types.mjs +2 -0
  66. package/browser/common/types/index.mjs +1 -1
  67. package/browser/common/types/options/http/schema.mjs +14 -6
  68. package/browser/common/types/options/index.mjs +1 -1
  69. package/browser/common/types/options/redis/connection.mjs +19 -0
  70. package/browser/common/types/options/redis/index.mjs +12 -0
  71. package/browser/common/types/options/redis/schema.mjs +145 -12
  72. package/browser/common/types/options/skills-http/schema.mjs +18 -0
  73. package/browser/common/types/options/transport/schema.mjs +10 -0
  74. package/browser/common/utils/auth-info.utils.mjs +17 -3
  75. package/browser/common/utils/guard.utils.mjs +3 -2
  76. package/browser/common/utils/index.mjs +2 -1
  77. package/browser/completion/flows/complete.flow.mjs +13 -7
  78. package/browser/duty/duty.lifecycle.mjs +32 -5
  79. package/browser/duty/duty.runner.mjs +3 -1
  80. package/browser/duty/lease-holder.mjs +50 -3
  81. package/browser/duty/lease-store.mjs +9 -6
  82. package/browser/elicitation/flows/elicitation-request.flow.mjs +7 -1
  83. package/browser/elicitation/flows/elicitation-result.flow.mjs +8 -2
  84. package/browser/elicitation/questions/question-store.factory.mjs +2 -5
  85. package/browser/elicitation/store/elicitation-store.factory.mjs +11 -4
  86. package/browser/errors/browser-entry-point.errors.mjs +1 -0
  87. package/browser/errors/duty.errors.mjs +9 -0
  88. package/browser/errors/index.mjs +11 -1
  89. package/browser/errors/job.errors.mjs +29 -4
  90. package/browser/errors/mcp.error.mjs +54 -8
  91. package/browser/errors/provider.errors.mjs +18 -0
  92. package/browser/errors/transport.errors.mjs +31 -0
  93. package/browser/event/delivery/event-outbox.mjs +43 -9
  94. package/browser/event/event-gates.mjs +6 -2
  95. package/browser/event/event-scope.helper.mjs +5 -1
  96. package/browser/event/flows/event-ended.flow.mjs +9 -3
  97. package/browser/event/flows/event-poll.flow.mjs +3 -1
  98. package/browser/event/flows/event-publish.flow.mjs +1 -0
  99. package/browser/event/flows/event-subscribe.flow.mjs +2 -9
  100. package/browser/event/flows/event-unsubscribe.flow.mjs +5 -2
  101. package/browser/event/poll/event-poll-leases.mjs +4 -3
  102. package/browser/event/replay/event-replays.mjs +2 -0
  103. package/browser/event/stream/event-stream.mjs +4 -0
  104. package/browser/event/stream/event-streams.mjs +9 -6
  105. package/browser/event/subscription/event-subscription-store.factory.mjs +3 -4
  106. package/browser/event/subscription/event-subscription-termination.mjs +1 -0
  107. package/browser/event/subscription/event-subscription.store.mjs +11 -1
  108. package/browser/event/subscription/event-subscriptions.mjs +4 -1
  109. package/browser/front-mcp/front-mcp.mjs +38 -4
  110. package/browser/ha/ha-manager.mjs +2 -1
  111. package/browser/ha/ha-redis-client.mjs +22 -0
  112. package/browser/ha/heartbeat.service.mjs +2 -1
  113. package/browser/ha/index.mjs +2 -0
  114. package/browser/ha/notification-relay.mjs +11 -3
  115. package/browser/http-route/flows/http.route.flow.mjs +78 -7
  116. package/browser/http-route/http-route.table.mjs +38 -11
  117. package/browser/http-route/people-session-store.mjs +7 -6
  118. package/browser/http-route/people-sign-in.routes.mjs +44 -3
  119. package/browser/index.cjs +21320 -17819
  120. package/browser/index.mjs +10 -3
  121. package/browser/job/execution/job-execution.manager.mjs +293 -84
  122. package/browser/job/flows/execute-job.flow.mjs +6 -4
  123. package/browser/job/index.mjs +3 -1
  124. package/browser/job/job-admission.mjs +284 -2
  125. package/browser/job/job-attempt.mjs +2 -1
  126. package/browser/job/job-run-access.mjs +20 -0
  127. package/browser/job/job-scope.helper.mjs +37 -10
  128. package/browser/job/runner/detached-job.worker.mjs +71 -10
  129. package/browser/job/runner/job-runner.mjs +27 -1
  130. package/browser/job/store/job-definition-store.factory.mjs +13 -12
  131. package/browser/job/store/job-state-store.factory.mjs +14 -5
  132. package/browser/job/store/memory-job-state.store.mjs +91 -7
  133. package/browser/job/store/redis-job-state.store.mjs +39 -6
  134. package/browser/job/store/storage-job-state.store.mjs +35 -2
  135. package/browser/job/tools/cancel-job.tool.mjs +2 -2
  136. package/browser/job/tools/register-job.tool.mjs +5 -2
  137. package/browser/job/tools/remove-job.tool.mjs +9 -0
  138. package/browser/job/tools/update-job.tool.mjs +8 -0
  139. package/browser/notification/notification.service.mjs +14 -3
  140. package/browser/prompt/flows/get-prompt.flow.mjs +10 -3
  141. package/browser/prompt/flows/prompts-list.flow.mjs +7 -2
  142. package/browser/provider/borrow-providers.mjs +40 -0
  143. package/browser/provider/container-handle.mjs +10 -0
  144. package/browser/provider/create-container.mjs +25 -3
  145. package/browser/provider/provider.registry.mjs +43 -6
  146. package/browser/remote-mcp/remote-oauth.mjs +43 -13
  147. package/browser/resource/flows/read-resource.flow.mjs +15 -4
  148. package/browser/resource/flows/resource-templates-list.flow.mjs +7 -2
  149. package/browser/resource/flows/resources-list.flow.mjs +7 -2
  150. package/browser/resource/flows/subscribe-resource.flow.mjs +21 -5
  151. package/browser/resource/materialized/materialized-resources.mjs +53 -23
  152. package/browser/resource/materialized/resource-store.mjs +97 -26
  153. package/browser/resource/resource.events.mjs +12 -1
  154. package/browser/resource/resource.registry.mjs +66 -8
  155. package/browser/scope/flows/http.request.flow.mjs +52 -3
  156. package/browser/scope/scope.instance.mjs +12 -14
  157. package/browser/server/custom-routes.helper.mjs +57 -6
  158. package/browser/server/security/resolve-allowed-hosts.mjs +26 -2
  159. package/browser/server/security/same-origin.mjs +5 -5
  160. package/browser/server/server.instance.mjs +56 -3
  161. package/browser/skill/cache/skill-http-cache.catalog.mjs +7 -6
  162. package/browser/skill/cache/skill-http-cache.factory.mjs +16 -19
  163. package/browser/skill/cache/skill-http-cache.mjs +14 -4
  164. package/browser/skill/flows/http/llm-full-txt.flow.mjs +16 -5
  165. package/browser/skill/flows/http/llm-txt.flow.mjs +1 -0
  166. package/browser/skill/flows/http/skills-api.flow.mjs +6 -5
  167. package/browser/skill/flows/load-skill.flow.mjs +9 -4
  168. package/browser/skill/skill-filter.helper.mjs +41 -4
  169. package/browser/skill/skill-http.utils.mjs +8 -8
  170. package/browser/surface/entry-enabled.mjs +22 -6
  171. package/browser/surface/index.mjs +8 -2
  172. package/browser/surface/live-surface.mjs +63 -3
  173. package/browser/task/helpers/task-run-context.mjs +12 -0
  174. package/browser/task/helpers/task-runner.mjs +2 -0
  175. package/browser/task/store/storage-task.store.mjs +1 -4
  176. package/browser/task/store/task-store.factory.mjs +2 -3
  177. package/browser/task/task.types.mjs +2 -0
  178. package/browser/tool/flows/call-tool.flow.mjs +56 -17
  179. package/browser/tool/flows/tools-list.flow.mjs +2 -2
  180. package/browser/tool/ui/ui-shared.mjs +5 -1
  181. package/browser/tool/ui/widget-enabled.mjs +11 -0
  182. package/browser/tool/undeclared-arguments-message.mjs +7 -5
  183. package/browser/tool/undeclared-arguments.mjs +8 -1
  184. package/browser/transport/adapters/streamable-http-transport.mjs +4 -0
  185. package/browser/transport/adapters/transport.local.adapter.mjs +26 -21
  186. package/browser/transport/adapters/transport.sse.adapter.mjs +15 -2
  187. package/browser/transport/adapters/transport.streamable-http.adapter.mjs +7 -1
  188. package/browser/transport/bus/redis-transport-bus.mjs +83 -28
  189. package/browser/transport/channel-signature.mjs +40 -0
  190. package/browser/transport/event-stores/redis.event-store.mjs +14 -27
  191. package/browser/transport/flows/handle.mcp-20260728.flow.mjs +4 -3
  192. package/browser/transport/flows/handle.streamable-http.flow.mjs +17 -10
  193. package/browser/transport/mcp-20260728/client/index.mjs +1 -1
  194. package/browser/transport/mcp-20260728/client/mcp-stateless.client.mjs +77 -15
  195. package/browser/transport/mcp-20260728/index.mjs +1 -1
  196. package/browser/transport/mcp-20260728/result-decorator.mjs +14 -7
  197. package/browser/transport/mcp-20260728/subscriptions.mjs +27 -7
  198. package/browser/transport/mcp-handlers/index.mjs +11 -2
  199. package/browser/transport/relay/relay-scope.helper.mjs +34 -6
  200. package/browser/transport/session-end-channel.mjs +199 -0
  201. package/browser/transport/transport.local.mjs +3 -0
  202. package/browser/transport/transport.registry.mjs +352 -21
  203. package/browser/transport/web-fetch-handler.mjs +64 -4
  204. package/browser/utils/same-origin-fetch.utils.mjs +33 -0
  205. package/browser/work/index.mjs +13 -0
  206. package/browser/work/work-spans.mjs +55 -0
  207. package/browser/worker/worker.lifecycle.mjs +3 -1
  208. package/browser/workflow/engine/workflow-step.executor.mjs +32 -12
  209. package/browser/workflow/engine/workflow.engine.mjs +5 -0
  210. package/browser/workflow/tools/register-workflow.tool.mjs +5 -2
  211. package/browser/workflow/tools/remove-workflow.tool.mjs +9 -0
  212. package/browser/workflow/tools/update-workflow.tool.mjs +8 -0
  213. package/builtin/authorities/authorities-input.d.ts +3 -0
  214. package/builtin/authorities/authorities-input.d.ts.map +1 -0
  215. package/common/decorators/front-mcp.decorator.d.ts.map +1 -1
  216. package/common/decorators/http-route.decorator.d.ts.map +1 -1
  217. package/common/entries/scope.entry.d.ts +3 -0
  218. package/common/entries/scope.entry.d.ts.map +1 -1
  219. package/common/interfaces/server.interface.d.ts +2 -0
  220. package/common/interfaces/server.interface.d.ts.map +1 -1
  221. package/common/metadata/agent.metadata.d.ts +2 -2
  222. package/common/metadata/app.metadata.d.ts +500 -52
  223. package/common/metadata/app.metadata.d.ts.map +1 -1
  224. package/common/metadata/duty.metadata.d.ts +41 -11
  225. package/common/metadata/duty.metadata.d.ts.map +1 -1
  226. package/common/metadata/enabled.metadata.d.ts +32 -0
  227. package/common/metadata/enabled.metadata.d.ts.map +1 -1
  228. package/common/metadata/event.metadata.d.ts +146 -0
  229. package/common/metadata/event.metadata.d.ts.map +1 -1
  230. package/common/metadata/front-mcp.metadata.d.ts +9457 -348
  231. package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
  232. package/common/metadata/http-route.metadata.d.ts +7 -0
  233. package/common/metadata/http-route.metadata.d.ts.map +1 -1
  234. package/common/metadata/job.metadata.d.ts +1 -1
  235. package/common/metadata/output-policy.d.ts +1 -1
  236. package/common/metadata/plugin.metadata.d.ts +2 -2
  237. package/common/metadata/tool.metadata.d.ts +1 -1
  238. package/common/metadata/worker.metadata.d.ts +4 -4
  239. package/common/metadata/workflow.metadata.d.ts +15 -1
  240. package/common/metadata/workflow.metadata.d.ts.map +1 -1
  241. package/common/records/job.record.d.ts +6 -0
  242. package/common/records/job.record.d.ts.map +1 -1
  243. package/common/records/workflow.record.d.ts +6 -0
  244. package/common/records/workflow.record.d.ts.map +1 -1
  245. package/common/schemas/annotated-class.schema.d.ts +1 -1
  246. package/common/schemas/http-output.schema.d.ts +24 -24
  247. package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
  248. package/common/tokens/workflow.tokens.d.ts +1 -0
  249. package/common/tokens/workflow.tokens.d.ts.map +1 -1
  250. package/common/types/auth/session.types.d.ts +12 -1
  251. package/common/types/auth/session.types.d.ts.map +1 -1
  252. package/common/types/options/elicitation/schema.d.ts +137 -0
  253. package/common/types/options/elicitation/schema.d.ts.map +1 -1
  254. package/common/types/options/http/interfaces.d.ts +41 -4
  255. package/common/types/options/http/interfaces.d.ts.map +1 -1
  256. package/common/types/options/http/schema.d.ts +5 -2
  257. package/common/types/options/http/schema.d.ts.map +1 -1
  258. package/common/types/options/redis/connection.d.ts +18 -0
  259. package/common/types/options/redis/connection.d.ts.map +1 -0
  260. package/common/types/options/redis/index.d.ts +7 -3
  261. package/common/types/options/redis/index.d.ts.map +1 -1
  262. package/common/types/options/redis/interfaces.d.ts +54 -2
  263. package/common/types/options/redis/interfaces.d.ts.map +1 -1
  264. package/common/types/options/redis/schema.d.ts +412 -2
  265. package/common/types/options/redis/schema.d.ts.map +1 -1
  266. package/common/types/options/skills-http/interfaces.d.ts +7 -0
  267. package/common/types/options/skills-http/interfaces.d.ts.map +1 -1
  268. package/common/types/options/skills-http/schema.d.ts +19 -0
  269. package/common/types/options/skills-http/schema.d.ts.map +1 -1
  270. package/common/types/options/transport/index.d.ts +1 -1
  271. package/common/types/options/transport/index.d.ts.map +1 -1
  272. package/common/types/options/transport/interfaces.d.ts +32 -0
  273. package/common/types/options/transport/interfaces.d.ts.map +1 -1
  274. package/common/types/options/transport/schema.d.ts +548 -0
  275. package/common/types/options/transport/schema.d.ts.map +1 -1
  276. package/common/utils/auth-info.utils.d.ts +29 -1
  277. package/common/utils/auth-info.utils.d.ts.map +1 -1
  278. package/common/utils/guard.utils.d.ts +6 -3
  279. package/common/utils/guard.utils.d.ts.map +1 -1
  280. package/common/utils/index.d.ts +1 -0
  281. package/common/utils/index.d.ts.map +1 -1
  282. package/completion/flows/complete.flow.d.ts +5 -1
  283. package/completion/flows/complete.flow.d.ts.map +1 -1
  284. package/context/frontmcp-context.provider.d.ts +1 -1
  285. package/direct/direct.types.d.ts +4 -4
  286. package/direct/direct.types.d.ts.map +1 -1
  287. package/duty/duty.lifecycle.d.ts +1 -1
  288. package/duty/duty.lifecycle.d.ts.map +1 -1
  289. package/duty/duty.runner.d.ts +6 -1
  290. package/duty/duty.runner.d.ts.map +1 -1
  291. package/duty/lease-holder.d.ts +26 -3
  292. package/duty/lease-holder.d.ts.map +1 -1
  293. package/duty/lease-store.d.ts +2 -0
  294. package/duty/lease-store.d.ts.map +1 -1
  295. package/elicitation/elicitation.types.d.ts +2 -0
  296. package/elicitation/elicitation.types.d.ts.map +1 -1
  297. package/elicitation/flows/elicitation-request.flow.d.ts +2 -0
  298. package/elicitation/flows/elicitation-request.flow.d.ts.map +1 -1
  299. package/elicitation/flows/elicitation-result.flow.d.ts +3 -1
  300. package/elicitation/flows/elicitation-result.flow.d.ts.map +1 -1
  301. package/elicitation/questions/question-store.factory.d.ts.map +1 -1
  302. package/elicitation/store/elicitation-store.factory.d.ts.map +1 -1
  303. package/elicitation/store/elicitation.store.d.ts +2 -0
  304. package/elicitation/store/elicitation.store.d.ts.map +1 -1
  305. package/errors/browser-entry-point.errors.d.ts +1 -0
  306. package/errors/browser-entry-point.errors.d.ts.map +1 -1
  307. package/errors/duty.errors.d.ts +4 -0
  308. package/errors/duty.errors.d.ts.map +1 -1
  309. package/errors/index.d.ts +3 -3
  310. package/errors/index.d.ts.map +1 -1
  311. package/errors/job.errors.d.ts +22 -4
  312. package/errors/job.errors.d.ts.map +1 -1
  313. package/errors/mcp.error.d.ts +11 -1
  314. package/errors/mcp.error.d.ts.map +1 -1
  315. package/errors/provider.errors.d.ts +11 -0
  316. package/errors/provider.errors.d.ts.map +1 -1
  317. package/errors/transport.errors.d.ts +29 -0
  318. package/errors/transport.errors.d.ts.map +1 -1
  319. package/esm/index.mjs +56 -51
  320. package/event/delivery/event-outbox.d.ts +15 -2
  321. package/event/delivery/event-outbox.d.ts.map +1 -1
  322. package/event/event-gates.d.ts +6 -1
  323. package/event/event-gates.d.ts.map +1 -1
  324. package/event/event-scope.helper.d.ts.map +1 -1
  325. package/event/flows/event-ended.flow.d.ts +4 -3
  326. package/event/flows/event-ended.flow.d.ts.map +1 -1
  327. package/event/flows/event-poll.flow.d.ts.map +1 -1
  328. package/event/flows/event-publish-http.flow.d.ts +1 -1
  329. package/event/flows/event-publish.flow.d.ts.map +1 -1
  330. package/event/flows/event-subscribe.flow.d.ts.map +1 -1
  331. package/event/flows/event-unsubscribe.flow.d.ts +2 -2
  332. package/event/flows/event-unsubscribe.flow.d.ts.map +1 -1
  333. package/event/index.d.ts +1 -1
  334. package/event/index.d.ts.map +1 -1
  335. package/event/poll/event-poll-leases.d.ts +4 -2
  336. package/event/poll/event-poll-leases.d.ts.map +1 -1
  337. package/event/replay/event-replays.d.ts.map +1 -1
  338. package/event/stream/event-stream.d.ts +2 -0
  339. package/event/stream/event-stream.d.ts.map +1 -1
  340. package/event/stream/event-streams.d.ts +5 -2
  341. package/event/stream/event-streams.d.ts.map +1 -1
  342. package/event/subscription/event-subscription-store.factory.d.ts.map +1 -1
  343. package/event/subscription/event-subscription-termination.d.ts.map +1 -1
  344. package/event/subscription/event-subscription.store.d.ts +6 -0
  345. package/event/subscription/event-subscription.store.d.ts.map +1 -1
  346. package/event/subscription/event-subscriptions.d.ts +4 -4
  347. package/event/subscription/event-subscriptions.d.ts.map +1 -1
  348. package/front-mcp/front-mcp.d.ts +7 -2
  349. package/front-mcp/front-mcp.d.ts.map +1 -1
  350. package/ha/ha-manager.d.ts.map +1 -1
  351. package/ha/ha-redis-client.d.ts +16 -0
  352. package/ha/ha-redis-client.d.ts.map +1 -0
  353. package/ha/heartbeat.service.d.ts +4 -2
  354. package/ha/heartbeat.service.d.ts.map +1 -1
  355. package/ha/index.d.ts +2 -1
  356. package/ha/index.d.ts.map +1 -1
  357. package/ha/notification-relay.d.ts +8 -3
  358. package/ha/notification-relay.d.ts.map +1 -1
  359. package/ha/relay-messages.d.ts +23 -4
  360. package/ha/relay-messages.d.ts.map +1 -1
  361. package/http-route/flows/http.route.flow.d.ts +15 -4
  362. package/http-route/flows/http.route.flow.d.ts.map +1 -1
  363. package/http-route/http-route.table.d.ts +5 -1
  364. package/http-route/http-route.table.d.ts.map +1 -1
  365. package/http-route/people-session-store.d.ts +4 -2
  366. package/http-route/people-session-store.d.ts.map +1 -1
  367. package/http-route/people-sign-in.routes.d.ts +10 -0
  368. package/http-route/people-sign-in.routes.d.ts.map +1 -1
  369. package/index.d.ts +15 -14
  370. package/index.d.ts.map +1 -1
  371. package/index.js +62 -57
  372. package/job/execution/job-execution.manager.d.ts +73 -7
  373. package/job/execution/job-execution.manager.d.ts.map +1 -1
  374. package/job/flows/execute-job.flow.d.ts.map +1 -1
  375. package/job/index.d.ts +2 -2
  376. package/job/index.d.ts.map +1 -1
  377. package/job/job-admission.d.ts +81 -2
  378. package/job/job-admission.d.ts.map +1 -1
  379. package/job/job-attempt.d.ts +2 -2
  380. package/job/job-attempt.d.ts.map +1 -1
  381. package/job/job-run-access.d.ts +14 -0
  382. package/job/job-run-access.d.ts.map +1 -1
  383. package/job/job-scope.helper.d.ts +20 -0
  384. package/job/job-scope.helper.d.ts.map +1 -1
  385. package/job/runner/detached-job.worker.d.ts +9 -0
  386. package/job/runner/detached-job.worker.d.ts.map +1 -1
  387. package/job/runner/job-runner.d.ts +18 -0
  388. package/job/runner/job-runner.d.ts.map +1 -1
  389. package/job/store/job-definition-store.factory.d.ts +5 -1
  390. package/job/store/job-definition-store.factory.d.ts.map +1 -1
  391. package/job/store/job-state-store.factory.d.ts +5 -1
  392. package/job/store/job-state-store.factory.d.ts.map +1 -1
  393. package/job/store/job-state.interface.d.ts +16 -0
  394. package/job/store/job-state.interface.d.ts.map +1 -1
  395. package/job/store/memory-job-state.store.d.ts +33 -2
  396. package/job/store/memory-job-state.store.d.ts.map +1 -1
  397. package/job/store/redis-job-state.store.d.ts +13 -3
  398. package/job/store/redis-job-state.store.d.ts.map +1 -1
  399. package/job/store/storage-job-state.store.d.ts +4 -0
  400. package/job/store/storage-job-state.store.d.ts.map +1 -1
  401. package/job/tools/cancel-job.tool.d.ts.map +1 -1
  402. package/job/tools/register-job.tool.d.ts.map +1 -1
  403. package/job/tools/remove-job.tool.d.ts.map +1 -1
  404. package/job/tools/update-job.tool.d.ts.map +1 -1
  405. package/mcp-registry/flows/server-card.flow.d.ts +3 -3
  406. package/mcp-registry/flows/well-known.ai-catalog.flow.d.ts +2 -2
  407. package/mcp-registry/flows/well-known.mcp-registry-auth.flow.d.ts +1 -1
  408. package/notification/notification.service.d.ts +5 -1
  409. package/notification/notification.service.d.ts.map +1 -1
  410. package/package.json +10 -10
  411. package/prompt/flows/get-prompt.flow.d.ts.map +1 -1
  412. package/prompt/flows/prompts-list.flow.d.ts +1 -1
  413. package/prompt/flows/prompts-list.flow.d.ts.map +1 -1
  414. package/provider/borrow-providers.d.ts +15 -0
  415. package/provider/borrow-providers.d.ts.map +1 -0
  416. package/provider/container-handle.d.ts +31 -0
  417. package/provider/container-handle.d.ts.map +1 -0
  418. package/provider/create-container.d.ts +8 -2
  419. package/provider/create-container.d.ts.map +1 -1
  420. package/provider/provider.registry.d.ts +23 -4
  421. package/provider/provider.registry.d.ts.map +1 -1
  422. package/remote-mcp/remote-oauth.d.ts +3 -1
  423. package/remote-mcp/remote-oauth.d.ts.map +1 -1
  424. package/resource/flows/read-resource.flow.d.ts.map +1 -1
  425. package/resource/flows/resource-templates-list.flow.d.ts +1 -1
  426. package/resource/flows/resource-templates-list.flow.d.ts.map +1 -1
  427. package/resource/flows/resources-list.flow.d.ts +1 -1
  428. package/resource/flows/resources-list.flow.d.ts.map +1 -1
  429. package/resource/flows/subscribe-resource.flow.d.ts +1 -0
  430. package/resource/flows/subscribe-resource.flow.d.ts.map +1 -1
  431. package/resource/materialized/materialized-resources.d.ts +15 -3
  432. package/resource/materialized/materialized-resources.d.ts.map +1 -1
  433. package/resource/materialized/resource-store.d.ts +6 -2
  434. package/resource/materialized/resource-store.d.ts.map +1 -1
  435. package/resource/resource.events.d.ts +3 -0
  436. package/resource/resource.events.d.ts.map +1 -1
  437. package/resource/resource.registry.d.ts +8 -3
  438. package/resource/resource.registry.d.ts.map +1 -1
  439. package/scope/flows/http.request.flow.d.ts +8 -1
  440. package/scope/flows/http.request.flow.d.ts.map +1 -1
  441. package/scope/scope.instance.d.ts +2 -2
  442. package/scope/scope.instance.d.ts.map +1 -1
  443. package/server/adapters/express.host.adapter.d.ts +26 -0
  444. package/server/adapters/express.host.adapter.d.ts.map +1 -1
  445. package/server/adapters/user-content.listener.d.ts +5 -1
  446. package/server/adapters/user-content.listener.d.ts.map +1 -1
  447. package/server/custom-routes.helper.d.ts +19 -2
  448. package/server/custom-routes.helper.d.ts.map +1 -1
  449. package/server/security/resolve-allowed-hosts.d.ts +16 -0
  450. package/server/security/resolve-allowed-hosts.d.ts.map +1 -1
  451. package/server/security/same-origin.d.ts +2 -1
  452. package/server/security/same-origin.d.ts.map +1 -1
  453. package/server/server.instance.d.ts +10 -0
  454. package/server/server.instance.d.ts.map +1 -1
  455. package/shared/ensure-shared-server.d.ts +9 -2
  456. package/shared/ensure-shared-server.d.ts.map +1 -1
  457. package/shared/flows/shared.drain.flow.d.ts +1 -1
  458. package/shared/flows/shared.identify.flow.d.ts +6 -2
  459. package/shared/flows/shared.identify.flow.d.ts.map +1 -1
  460. package/shared/index.d.ts.map +1 -1
  461. package/shared/shared-attach.d.ts +15 -6
  462. package/shared/shared-attach.d.ts.map +1 -1
  463. package/shared/shared-embedded.d.ts +12 -2
  464. package/shared/shared-embedded.d.ts.map +1 -1
  465. package/shared/shared-endpoint.d.ts +3 -1
  466. package/shared/shared-endpoint.d.ts.map +1 -1
  467. package/shared/shared-files.d.ts +2 -0
  468. package/shared/shared-files.d.ts.map +1 -1
  469. package/shared/shared-serve.d.ts +20 -1
  470. package/shared/shared-serve.d.ts.map +1 -1
  471. package/shared/shared-server.lifecycle.d.ts +40 -10
  472. package/shared/shared-server.lifecycle.d.ts.map +1 -1
  473. package/shared/shared-server.options.d.ts +43 -6
  474. package/shared/shared-server.options.d.ts.map +1 -1
  475. package/skill/cache/skill-http-cache.catalog.d.ts +4 -4
  476. package/skill/cache/skill-http-cache.catalog.d.ts.map +1 -1
  477. package/skill/cache/skill-http-cache.d.ts +15 -2
  478. package/skill/cache/skill-http-cache.d.ts.map +1 -1
  479. package/skill/cache/skill-http-cache.factory.d.ts +12 -0
  480. package/skill/cache/skill-http-cache.factory.d.ts.map +1 -1
  481. package/skill/flows/http/llm-full-txt.flow.d.ts +1 -1
  482. package/skill/flows/http/llm-full-txt.flow.d.ts.map +1 -1
  483. package/skill/flows/http/llm-txt.flow.d.ts +1 -1
  484. package/skill/flows/http/llm-txt.flow.d.ts.map +1 -1
  485. package/skill/flows/http/skills-api.flow.d.ts +1 -1
  486. package/skill/flows/http/skills-api.flow.d.ts.map +1 -1
  487. package/skill/flows/load-skill.flow.d.ts.map +1 -1
  488. package/skill/skill-filter.helper.d.ts +16 -0
  489. package/skill/skill-filter.helper.d.ts.map +1 -1
  490. package/skill/skill-http.utils.d.ts +7 -1
  491. package/skill/skill-http.utils.d.ts.map +1 -1
  492. package/surface/entry-enabled.d.ts +23 -6
  493. package/surface/entry-enabled.d.ts.map +1 -1
  494. package/surface/index.d.ts +2 -2
  495. package/surface/index.d.ts.map +1 -1
  496. package/surface/live-surface.d.ts +32 -7
  497. package/surface/live-surface.d.ts.map +1 -1
  498. package/task/helpers/task-run-context.d.ts +5 -0
  499. package/task/helpers/task-run-context.d.ts.map +1 -0
  500. package/task/helpers/task-runner.d.ts.map +1 -1
  501. package/task/store/storage-task.store.d.ts.map +1 -1
  502. package/task/store/task-store.factory.d.ts.map +1 -1
  503. package/task/store/task.store.d.ts +1 -1
  504. package/task/store/task.store.d.ts.map +1 -1
  505. package/task/task.types.d.ts +1 -0
  506. package/task/task.types.d.ts.map +1 -1
  507. package/tool/flows/call-tool.flow.d.ts +10 -3
  508. package/tool/flows/call-tool.flow.d.ts.map +1 -1
  509. package/tool/flows/tools-list.flow.d.ts +1 -1
  510. package/tool/flows/tools-list.flow.d.ts.map +1 -1
  511. package/tool/ui/ui-shared.d.ts +2 -0
  512. package/tool/ui/ui-shared.d.ts.map +1 -1
  513. package/tool/ui/widget-enabled.d.ts +8 -0
  514. package/tool/ui/widget-enabled.d.ts.map +1 -0
  515. package/tool/undeclared-arguments-message.d.ts.map +1 -1
  516. package/tool/undeclared-arguments.d.ts +4 -0
  517. package/tool/undeclared-arguments.d.ts.map +1 -1
  518. package/transport/adapters/streamable-http-transport.d.ts +2 -0
  519. package/transport/adapters/streamable-http-transport.d.ts.map +1 -1
  520. package/transport/adapters/transport.local.adapter.d.ts +3 -0
  521. package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
  522. package/transport/adapters/transport.sse.adapter.d.ts +3 -0
  523. package/transport/adapters/transport.sse.adapter.d.ts.map +1 -1
  524. package/transport/adapters/transport.streamable-http.adapter.d.ts +1 -0
  525. package/transport/adapters/transport.streamable-http.adapter.d.ts.map +1 -1
  526. package/transport/bus/redis-transport-bus.d.ts +25 -4
  527. package/transport/bus/redis-transport-bus.d.ts.map +1 -1
  528. package/transport/channel-signature.d.ts +16 -0
  529. package/transport/channel-signature.d.ts.map +1 -0
  530. package/transport/event-stores/redis.event-store.d.ts +1 -1
  531. package/transport/event-stores/redis.event-store.d.ts.map +1 -1
  532. package/transport/flows/handle.mcp-20260728.flow.d.ts +2 -1
  533. package/transport/flows/handle.mcp-20260728.flow.d.ts.map +1 -1
  534. package/transport/flows/handle.streamable-http.flow.d.ts +1 -1
  535. package/transport/flows/handle.streamable-http.flow.d.ts.map +1 -1
  536. package/transport/mcp-20260728/client/mcp-stateless.client.d.ts +8 -0
  537. package/transport/mcp-20260728/client/mcp-stateless.client.d.ts.map +1 -1
  538. package/transport/mcp-20260728/result-decorator.d.ts +4 -2
  539. package/transport/mcp-20260728/result-decorator.d.ts.map +1 -1
  540. package/transport/mcp-20260728/subscriptions.d.ts +2 -0
  541. package/transport/mcp-20260728/subscriptions.d.ts.map +1 -1
  542. package/transport/mcp-handlers/index.d.ts +5 -3
  543. package/transport/mcp-handlers/index.d.ts.map +1 -1
  544. package/transport/relay/relay-scope.helper.d.ts +2 -2
  545. package/transport/relay/relay-scope.helper.d.ts.map +1 -1
  546. package/transport/session-end-channel.d.ts +81 -0
  547. package/transport/session-end-channel.d.ts.map +1 -0
  548. package/transport/transport.local.d.ts +2 -1
  549. package/transport/transport.local.d.ts.map +1 -1
  550. package/transport/transport.registry.d.ts +73 -2
  551. package/transport/transport.registry.d.ts.map +1 -1
  552. package/transport/transport.types.d.ts +6 -1
  553. package/transport/transport.types.d.ts.map +1 -1
  554. package/transport/web-fetch-handler.d.ts.map +1 -1
  555. package/utils/same-origin-fetch.utils.d.ts +5 -0
  556. package/utils/same-origin-fetch.utils.d.ts.map +1 -0
  557. package/work/index.d.ts +2 -0
  558. package/work/index.d.ts.map +1 -0
  559. package/work/work-spans.d.ts +42 -0
  560. package/work/work-spans.d.ts.map +1 -0
  561. package/worker/worker.lifecycle.d.ts.map +1 -1
  562. package/workflow/engine/workflow-step.executor.d.ts +10 -3
  563. package/workflow/engine/workflow-step.executor.d.ts.map +1 -1
  564. package/workflow/engine/workflow.engine.d.ts +2 -0
  565. package/workflow/engine/workflow.engine.d.ts.map +1 -1
  566. package/workflow/tools/register-workflow.tool.d.ts.map +1 -1
  567. package/workflow/tools/remove-workflow.tool.d.ts.map +1 -1
  568. package/workflow/tools/update-workflow.tool.d.ts.map +1 -1
@@ -4,6 +4,7 @@ import { type MetricsOptionsInterface } from '../common/types/options/metrics';
4
4
  import { type HealthService } from '../health';
5
5
  import { type MetricsService } from '../metrics';
6
6
  import { type HostServerAdapter } from './adapters/base.host.adapter';
7
+ import { type CheckClientIpFn } from './custom-routes.helper';
7
8
  /** The server's HTTP options; without `bodyLimit`, the host adapter applies its default. */
8
9
  export type HttpServerOptions = Omit<HttpOptions, 'bodyLimit'> & Partial<Pick<HttpOptions, 'bodyLimit'>>;
9
10
  export declare class FrontMcpServerInstance extends FrontMcpServer {
@@ -16,6 +17,7 @@ export declare class FrontMcpServerInstance extends FrontMcpServer {
16
17
  private _metricsService?;
17
18
  private _metricsConfig?;
18
19
  private userContent?;
20
+ private checkClientIp?;
19
21
  constructor(httpConfig: HttpServerOptions);
20
22
  private setupDefaults;
21
23
  registerMiddleware(entryPath: string, handler: ServerRequestHandler): void | Promise<void>;
@@ -41,9 +43,17 @@ export declare class FrontMcpServerInstance extends FrontMcpServer {
41
43
  * registration without ambiguity.
42
44
  */
43
45
  setMetricsConfig(metricsConfig: MetricsOptionsInterface): void;
46
+ /** The `throttle.ipFilter` check the metrics route and the user-content listener run before they answer. */
47
+ setClientIpCheck(checkClientIp: CheckClientIpFn): void;
44
48
  prepare(): void;
45
49
  getHandler(): unknown;
46
50
  start(): Promise<void>;
51
+ loopbackNames(): readonly string[] | undefined;
52
+ /** Browsers keep cookies per host, not per port, so a content hostname the MCP listener also answers to shares them. */
53
+ private warnOfSharedContentHosts;
54
+ /** The Host values the MCP listener accepts, as its host check derives them: `any` when it checks no Host. */
55
+ private mcpListenerHosts;
56
+ private refuseClient;
47
57
  stop(): Promise<void>;
48
58
  }
49
59
  //# sourceMappingURL=server.instance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.instance.d.ts","sourceRoot":"","sources":["../../src/server/server.instance.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EAEd,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAC1B,M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AC,CAAsB;IAC1C,OAAO,CAAC,aAAa,CAAC,CAAkB;gBAE5B,UAAU,EAAE,iBAAiB;IAMzC,OAAO,CAAC,aAAa;IAiCrB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB;IAInE,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB;IAI7E;;;OAGG;IACH,gBAAgB,CAAC,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,sBAAsB,GAAG,IAAI;IAK1F;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,sBAAsB,GAAG,IAAI;IAI3D;;;OAGG;IACH,iBAAiB,CAAC,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,uBAAuB,GAAG,IAAI;IAK/F;;;;OAIG;IACH,gBAAgB,CAAC,aAAa,EAAE,uBAAuB,GAAG,IAAI;IAI9D,4GAA4G;IAC5G,gBAAgB,CAAC,aAAa,EAAE,eAAe,GAAG,IAAI;IAItD,OAAO;IAiCP,UAAU,IAAI,OAAO;IAIf,KAAK;IA6BF,aAAa,IAAI,SAAS,MAAM,EAAE,GAAG,SAAS;IAKvD,wHAAwH;IACxH,OAAO,CAAC,wBAAwB;IAkBhC,8GAA8G;IAC9G,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,YAAY;IAUL,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CASrC"}
@@ -43,6 +43,10 @@ export interface EnsureSharedServerOptions {
43
43
  replaceOlder: boolean;
44
44
  /** How long it may take, including starting or replacing a server. */
45
45
  budgetMs: number;
46
+ /** Whether it may start, or replace, a server; without it, it only attaches to one that runs. @default true */
47
+ mayStart?: boolean;
48
+ /** Whether the server it starts runs its own version, so it may drain an older one first: only its own entry does. */
49
+ startsOwnVersion?: boolean;
46
50
  openLock(): Promise<StartLockHandle>;
47
51
  spawnServer(startLockHolder: string): SpawnedServer;
48
52
  pollMs?: number;
@@ -53,6 +57,9 @@ export interface EnsureSharedServerOptions {
53
57
  * the start lock's holder starts one; an older one it first asks to drain, and waits for it to go.
54
58
  */
55
59
  export declare function ensureSharedServer(options: EnsureSharedServerOptions): Promise<SharedServerAttachment>;
56
- /** Run this process's entry again, detached, as the key's server: it outlives the session that started it. */
57
- export declare function spawnSharedServer(key: string, startLockHolder: string): SpawnedServer;
60
+ /**
61
+ * Run this process's entry again detached as the key's server, or `entry`, from its own folder, when named. The server
62
+ * gets the session's Node flags but those that open an inspector.
63
+ */
64
+ export declare function spawnSharedServer(key: string, startLockHolder: string, entry?: string): SpawnedServer;
58
65
  //# sourceMappingURL=ensure-shared-server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensure-shared-server.d.ts","sourceRoot":"","sources":["../../src/shared/ensure-shared-server.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG7E,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAoB,KAAK,iBAAiB,EAA2B,MAAM,gBAAgB,CAAC;AACnG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,mGAAmG;AACnG,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AACxD,wHAAwH;AACxH,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAIlE,6FAA6F;AAC7F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,cAAc,CAAC;IACzB,+GAA+G;IAC/G,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gB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACrC,WAAW,CAAC,eAAe,EAAE,MAAM,GAAG,aAAa,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;CACpC;AA+DD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA4C5G;AA2DD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,aAAa,CAmBrG"}
@@ -19,8 +19,8 @@ declare const outputSchema: import("@frontmcp/lazy-zod").ZodObject<{
19
19
  httpOnly: import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodBoolean>;
20
20
  secure: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
21
21
  sameSite: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodEnum<{
22
- none: "none";
23
22
  strict: "strict";
23
+ none: "none";
24
24
  lax: "lax";
25
25
  }>>;
26
26
  maxAge: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
@@ -19,8 +19,8 @@ declare const outputSchema: import("@frontmcp/lazy-zod").ZodObject<{
19
19
  httpOnly: import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodBoolean>;
20
20
  secure: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
21
21
  sameSite: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodEnum<{
22
- none: "none";
23
22
  strict: "strict";
23
+ none: "none";
24
24
  lax: "lax";
25
25
  }>>;
26
26
  maxAge: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodNumber>;
@@ -37,7 +37,11 @@ declare global {
37
37
  }
38
38
  }
39
39
  declare const name: "shared:identify";
40
- /** POST /.well-known/frontmcp-shared-server: the HMAC of the client's nonce, bound to the server's endpoint and version. */
40
+ /**
41
+ * POST /.well-known/frontmcp-shared-server: the HMAC of the client's nonce, bound to the server's endpoint and version;
42
+ * `503` with `x-frontmcp-shared-server: exiting` and the same proof once the server is exiting. A challenge is no
43
+ * activity: the request that follows it carries the token, and counts.
44
+ */
41
45
  export default class SharedIdentifyFlow extends FlowBase<typeof name> {
42
46
  static canActivate(request: ServerRequest): boolean;
43
47
  checkIpFilter(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"shared.identify.flow.d.ts","sourceRoot":"","sources":["../../../src/shared/flows/shared.identify.flow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAIL,QAAQ,EAMR,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAKtB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AACpC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;gCAAiB,CAAC;AAEpC,QAAA,MAAM,IAAI;;;CAG2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,iBAAiB,EAAE,cAAc,CAC/B,kBAAkB,EAClB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CACnC,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,iBAA0B,CAAC;AAGxC,4HAA4H;AAS5H,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IACnE,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAK7C,aAAa;IAKb,YAAY;IAKZ,KAAK;CAWZ"}
1
+ {"version":3,"file":"shared.identify.flow.d.ts","sourceRoot":"","sources":["../../../src/shared/flows/shared.identify.flow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAIL,QAAQ,EAMR,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAKtB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AACpC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;gCAAiB,CAAC;AAEpC,QAAA,MAAM,IAAI;;;CAG2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,iBAAiB,EAAE,cAAc,CAC/B,kBAAkB,EAClB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CACnC,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,iBAA0B,CAAC;AAGxC;;;;GAIG;AASH,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IACnE,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAK7C,aAAa;IAKb,YAAY;IAKZ,KAAK;CAWZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAQzE,OAAO,EAAe,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAWxE;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,MAAM,EAAE,mBAAmB,EAC3B,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,oBAAoB,GAC3D,OAAO,CAAC,IAAI,CAAC,CAiCf"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAQzE,OAAO,EAAe,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAgBxE;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,MAAM,EAAE,mBAAmB,EAC3B,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,oBAAoB,GAC3D,OAAO,CAAC,IAAI,CAAC,CAiDf"}
@@ -1,8 +1,8 @@
1
1
  import type { Readable, Writable } from 'node:stream';
2
2
  import { InternalMcpError } from '../errors/mcp.error';
3
3
  import { type SpawnedServer } from './ensure-shared-server';
4
- import type { EmbeddedSharedServer } from './shared-embedded';
5
- import type { ResolvedSharedServerOptions } from './shared-server.options';
4
+ import type { BootedEmbeddedServer } from './shared-embedded';
5
+ import { type ResolvedSharedServerOptions } from './shared-server.options';
6
6
  export interface AttachSharedSessionOptions extends ResolvedSharedServerOptions {
7
7
  input: Readable;
8
8
  output: Writable;
@@ -10,10 +10,17 @@ export interface AttachSharedSessionOptions extends ResolvedSharedServerOptions
10
10
  name: string;
11
11
  /** The session's own version, `info.version`: it never attaches to an older server. */
12
12
  version: string;
13
- /** Run the server in this process, when the session can't, or may not, attach to the key's server. */
14
- embed(): Promise<EmbeddedSharedServer>;
15
- spawnServer?: (startLockHolder: string) => SpawnedServer;
13
+ /** Boot the server of `key` in this process, serving nothing until started; with `spare`, while attaching. */
14
+ bootEmbedded(key: string): Promise<BootedEmbeddedServer>;
15
+ /** Start the server of `key`: one the session's own config names (see {@link mayStartServerOf}). */
16
+ spawnServer?: (startLockHolder: string, key: string) => SpawnedServer;
17
+ /** What `keyFileSignature()` said of `rereadKey.file` before the first key read: a change since moves the session. */
18
+ keySignature?: string;
16
19
  }
20
+ /** What tells a change of the key file: its size and time, or that it is missing. */
21
+ export declare function keyFileSignature(file: string): Promise<string>;
22
+ /** Whether a session may start the server of `key`: its first key's, with its own entry, or one its `entries` name. */
23
+ export declare function mayStartServerOf(options: Pick<AttachSharedSessionOptions, 'key' | 'entries'>, key: string): boolean;
17
24
  export interface SharedSession {
18
25
  /** Resolves once the session reaches a server; rejects, after answering the requests it held, when it can't. */
19
26
  readonly attached: Promise<void>;
@@ -31,7 +38,9 @@ export declare function towardsServer(send: typeof fetch): typeof fetch;
31
38
  * goes away, the session reaches the next one, replays the client's `initialize` and tells it the lists changed;
32
39
  * when it can't attach to one, it runs the server in its own process. What the server sends on its own reaches the
33
40
  * client over the session's notification stream, a Claude Code channel event included. A session that lost that
34
- * stream follows a server that took its key over, without waiting for a request of its client.
41
+ * stream follows a server that took its key over, without waiting for a request of its client. A request a server
42
+ * sends the client goes out under an id of the session's own, and the client's answer goes back to that server alone,
43
+ * also after the session moved to another; an answer for a server the session left is dropped.
35
44
  */
36
45
  export declare function attachSharedSession(options: AttachSharedSessionOptions): SharedSession;
37
46
  //# sourceMappingURL=shared-attach.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared-attach.d.ts","sourceRoot":"","sources":["../../src/shared/shared-attach.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAYtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAS9D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAa3E,MAAM,WAAW,0BAA2B,SAAQ,2BAA2B;IA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,MAAM,EAAE,QAAQ,CAAC;IACjB,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,OAAO,EAAE,MAAM,CAAC;IAChB,8GAA8G;IAC9G,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACzD,oGAAoG;IACpG,WAAW,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,aAAa,CAAC;IACtE,sHAAsH;IACtH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,qFAAqF;AACrF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAOpE;AAED,uHAAuH;AACvH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,0BAA0B,EAAE,KAAK,GAAG,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnH;AAED,MAAM,WAAW,aAAa;IAC5B,gHAAgH;IAChH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAKD,8GAA8G;AAC9G,qBAAa,qBAAsB,SAAQ,gBAAgB;IAEvD,QAAQ,CAAC,OAAO,EAAE,OAAO;gBAAhB,OAAO,EAAE,OAAO,EACzB,MAAM,EAAE,MAAM;CAIjB;AAyCD,sHAAsH;AACtH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,KAAK,GAAG,OAAO,KAAK,CAe9D;AA0CD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,aAAa,CA6btF"}
@@ -1,5 +1,6 @@
1
1
  import { type FrontMcpConfigInput, type FrontMcpConfigType } from '../common';
2
2
  import { type SharedServerInstance } from './shared-serve';
3
+ import type { ResolvedSharedServerOptions } from './shared-server.options';
3
4
  /** The server a session runs in its own process, reached through the same HTTP flows as the shared one. */
4
5
  export interface EmbeddedSharedServer {
5
6
  url: string;
@@ -7,6 +8,15 @@ export interface EmbeddedSharedServer {
7
8
  fetch: typeof fetch;
8
9
  close(): Promise<void>;
9
10
  }
10
- /** Run `config` in this process as the key's shared server would run it: static auth for a fresh token, no listener. */
11
- export declare function runEmbeddedServer(config: FrontMcpConfigInput, key: string, create: (config: FrontMcpConfigType) => SharedServerInstance): Promise<EmbeddedSharedServer>;
11
+ /** A server booted in the session's process, serving nothing yet: `start()` serves it, `close()` shuts it down. */
12
+ export interface BootedEmbeddedServer {
13
+ start(): Promise<EmbeddedSharedServer>;
14
+ close(): Promise<void>;
15
+ }
16
+ /**
17
+ * Boot `config` in this process as the key's shared server would run it: static auth for a fresh token, the routes and
18
+ * people auth the config's `http` keeps, and a listener of its own (see {@link embeddedListener}), so its session gets
19
+ * a notification stream as on the shared server. Nothing is served, and no `onReady()` runs, until `start()`.
20
+ */
21
+ export declare function bootEmbeddedServer(config: FrontMcpConfigInput, options: Pick<ResolvedSharedServerOptions, 'key' | 'transport'>, create: (config: FrontMcpConfigType) => SharedServerInstance): Promise<BootedEmbeddedServer>;
12
22
  //# sourceMappingURL=shared-embedded.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared-embedded.d.ts","sourceRoot":"","sources":["../../src/shared/shared-embedded.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAItG,OAAO,EAA+B,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAExF,2GAA2G;AAC3G,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,wHAAwH;AACxH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,oBAAoB,GAC3D,OAAO,CAAC,oBAAoB,CAAC,CAsB/B"}
1
+ {"version":3,"file":"shared-embedded.d.ts","sourceRoot":"","sources":["../../src/shared/shared-embedded.ts"],"names":[],"mappings":"AAKA,OAAO,EAA0B,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAOtG,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAE3E,2GAA2G;AAC3G,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,mHAAmH;AACnH,MAAM,WAAW,oBAAoB;IACnC,KAAK,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACvC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAyBD;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,IAAI,CAAC,2BAA2B,EAAE,KAAK,GAAG,WAAW,CAAC,EAC/D,MAAM,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,oBAAoB,GAC3D,OAAO,CAAC,oBAAoB,CAAC,CA8C/B"}
@@ -17,7 +17,8 @@ export declare function unixEndpoint(socketPath: string): SharedEndpoint;
17
17
  export declare function httpEndpoint(port: number): SharedEndpoint;
18
18
  /**
19
19
  * `refused`: something answered, but it did not prove it holds the key; `verified` carries the version it proved.
20
- * `exiting`: it says it is exiting, which needs no proof, since it is sent nothing more either way.
20
+ * `exiting`: it says it is exiting, and `proven` whether it proved it holds the key as it said so; it is sent nothing
21
+ * more either way.
21
22
  */
22
23
  export type IdentifyResult = {
23
24
  outcome: 'verified';
@@ -26,6 +27,7 @@ export type IdentifyResult = {
26
27
  outcome: 'refused';
27
28
  } | {
28
29
  outcome: 'exiting';
30
+ proven: boolean;
29
31
  } | {
30
32
  outcome: 'unreachable';
31
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"shared-endpoint.d.ts","sourceRoot":"","sources":["../../src/shared/shared-endpoint.ts"],"names":[],"mappings":"AASA,2GAA2G;AAC3G,eAAO,MAAM,oBAAoB,wCAAwC,CAAC;AAC1E,oGAAoG;AACpG,eAAO,MAAM,iBAAiB,8CAAkC,CAAC;AACjE,uHAAuH;AACvH,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAC9D,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,kDAAkD;AAClD,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAK7C,MAAM,WAAW,cAAc;IAC7B,+FAA+F;IAC/F,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAE/D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAGzD;AAmBD;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,OAAO,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,GACtB;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,GACtB;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC;AAE/B,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAA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AAE,OAAO,EAAE,SAAS,CAAA;CAAE,GACtB;IAAE,OAAO,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GACvC;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC;AAE/B,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE/D;AAED,4FAA4F;AAC5F,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,UAAU,EACpB,SAAS,SAAsB,GAC9B,OAAO,CAAC,cAAc,CAAC,CAwBzB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,KAAK,CAoB/F;AAED,4HAA4H;AAC5H,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE;IAAE,QAAQ,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,OAAO,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACxE,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAalB"}
@@ -15,6 +15,8 @@ export interface SharedServerRecord {
15
15
  secret: string;
16
16
  }
17
17
  export declare function sharedServerFiles(key: string): SharedServerFiles;
18
+ /** Whether the platform can listen on a socket at `socketPath`: a socket address holds at most 103 bytes of it. */
19
+ export declare function socketPathFits(socketPath: string): boolean;
18
20
  /** Refuse a socket path the platform can't listen on, which would otherwise fail with a bare `EINVAL`. */
19
21
  export declare function assertSocketPathFits(files: SharedServerFiles): void;
20
22
  /** Create the key's folder owner-only, and refuse one that another user could replace, or one above it. */
@@ -1 +1 @@
1
- {"version":3,"file":"shared-files.d.ts","sourceRoot":"","sources":["../../src/shared/shared-files.ts"],"names":[],"mappings":"AAgBA,2GAA2G;AAC3G,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAA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ACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAsBD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAShE;AAED,mHAAmH;AACnH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,0GAA0G;AAC1G,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAMnE;AAED,2GAA2G;AAC3G,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAapF;AAED,gGAAgG;AAChG,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAO3G;AASD,iGAAiG;AACjG,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAkBxG;AAED,mGAAmG;AACnG,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM7F"}
@@ -1,4 +1,4 @@
1
- import { type FrontMcpConfigInput, type FrontMcpConfigType, type ScopeEntry } from '../common';
1
+ import { type FrontMcpConfigInput, type FrontMcpConfigType, type HttpOptionsInput, type ScopeEntry } from '../common';
2
2
  import type { ResolvedSharedServerOptions } from './shared-server.options';
3
3
  /** The part of `FrontMcpInstance` a shared server runs. */
4
4
  export interface SharedServerInstance {
@@ -13,6 +13,25 @@ export interface SharedServerHandle {
13
13
  /** Refuse new requests, remove the record, let the requests in flight finish, then shut the server down. */
14
14
  close(): Promise<void>;
15
15
  }
16
+ /** A port nothing listens on now; a process that takes it first makes the listen fail, and gets no token. */
17
+ export declare function freeLoopbackPort(): Promise<number>;
18
+ /**
19
+ * What a shared server keeps of the config's `http`: its MCP path, its routes, how people sign in to its pages (see
20
+ * {@link sharedPeopleAuth}), its body limits and its headers. Where it listens, its CORS and its Host and Origin checks
21
+ * are the shared server's own.
22
+ */
23
+ export declare function keptHttpOptions(http: HttpOptionsInput | undefined): HttpOptionsInput;
24
+ /**
25
+ * An owner-only socket, or loopback with Host checked against the loopback names and every Origin refused but the
26
+ * server's own (a page it serves posting back to it), with what the config's `http` keeps (see {@link keptHttpOptions}).
27
+ */
28
+ export declare function sharedHttpOptions(endpoint: {
29
+ socketPath: string;
30
+ port?: undefined;
31
+ } | {
32
+ port: number;
33
+ socketPath?: undefined;
34
+ }, http: HttpOptionsInput | undefined): HttpOptionsInput;
16
35
  /** Refuse an app with auth of its own: it would keep that auth, and answer requests that lack the token. */
17
36
  export declare function assertTokenGuardsEveryScope(instance: SharedServerInstance, key: string, token: string): void;
18
37
  export interface ServeSharedOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"shared-serve.d.ts","sourceRoot":"","sources":["../../src/shared/shared-serve.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EAEvB,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AAmBnB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAW3E,2DAA2D;AAC3D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,eAAe,IAAI,UAAU,GAAG,SAAS,CAAC;IAC1C,SAA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The answer to a request that reaches a shared server once it is exiting: sent again, it reaches the next one. */
3
- export declare function exitingResponse(): ReturnType<typeof httpRespond.json>;
2
+ /**
3
+ * The answer to a request that reaches a shared server once it is exiting: sent again, it reaches the next one. To an
4
+ * identity challenge it carries the server's proof.
5
+ */
6
+ export declare function exitingResponse(proof?: {
7
+ proof: string;
8
+ version: string;
9
+ }): ReturnType<typeof httpRespond.json>;
4
10
  /** The Node response of a request: it tells when the request is over, and can be cut off. */
5
11
  interface TrackedResponse {
6
12
  once?(event: 'close', listener: () => void): unknown;
7
13
  destroy?(): unknown;
14
+ readonly closed?: boolean;
8
15
  }
9
- /** The part of an `http:request` run the lifecycle reads: whether it is authorized, its method and Node response, and how to answer. */
10
- interface HttpRequestRun {
16
+ /** The part of a route's run the lifecycle reads: its Node response, and how to answer. */
17
+ interface HttpRouteRun {
11
18
  readonly rawInput: {
12
19
  request?: {
13
20
  method?: string;
14
21
  };
15
22
  response?: TrackedResponse;
16
23
  };
24
+ respond(output: ReturnType<typeof httpRespond.json>): void;
25
+ }
26
+ /** The part of an `@HttpRoute`'s run the lifecycle reads besides: the route, and so whether it is public. */
27
+ interface HttpPageRun extends HttpRouteRun {
28
+ readonly state: {
29
+ get(key: 'route'): {
30
+ auth?: string;
31
+ } | undefined;
32
+ };
33
+ }
34
+ /** The part of an `http:request` run the lifecycle reads: whether it is authorized, its method and Node response, and how to answer. */
35
+ interface HttpRequestRun extends HttpRouteRun {
17
36
  readonly state: {
18
37
  get(key: 'verifyResult'): {
19
38
  kind: string;
20
39
  } | undefined;
21
40
  };
22
- respond(output: ReturnType<typeof httpRespond.json>): void;
23
41
  }
24
42
  /**
25
43
  * How long a shared server has gone without a request, and its exit: once asked to exit, it answers every new
26
44
  * request 503 with `x-frontmcp-shared-server: exiting`, so its sessions send it to the next server instead. Only a
27
- * request that carries the token, or an identity challenge, counts as activity. A notification stream a session
28
- * holds open (its `GET`) keeps the server from being idle, and is cut off, not waited for, when the server exits.
45
+ * request a credential admitted counts as activity, until its handler settled and its response closed: one that
46
+ * carries the token, or one to a route that is not public once its auth admitted it (the token, or a signed-in
47
+ * person). An identity challenge does not; the request that follows it does. A notification stream a session holds
48
+ * open (its `GET`) keeps the server from being idle, and is cut off, not waited for, when the server exits; every route's request is waited for until its handler settled and
49
+ * its response closed, its event streams included.
29
50
  */
30
51
  export declare class SharedServerLifecycle {
31
52
  #private;
@@ -34,13 +55,22 @@ export declare class SharedServerLifecycle {
34
55
  get isExiting(): boolean;
35
56
  /** Ask the server to exit; the first reason wins. */
36
57
  exit(reason: string): void;
37
- /** Count a session's identity challenge as activity: a session that just found the server is about to use it. */
38
- touch(): void;
39
- /** How long no request has been in flight and no notification stream open, in ms. */
58
+ /** How long no request that counts as activity has been in flight and no notification stream open, in ms. */
40
59
  idleFor(now?: number): number;
41
60
  /** Resolves once no request is in flight, or after `timeoutMs`. */
42
61
  settled(timeoutMs: number): Promise<void>;
43
62
  trackRequest(run: HttpRequestRun): void;
63
+ /** A request an `@HttpRoute` admitted, people pages included; one to a public route is no activity. */
64
+ trackRouteRequest(run: HttpPageRun): void;
65
+ /** The `@HttpRoute`'s handler settled, whatever its outcome. */
66
+ finishRouteHandler(run: HttpRouteRun): void;
67
+ /** A request to a route the host mounts (`http.routes`, channel webhooks): activity once an `auth: true` route admitted it. */
68
+ trackHostRouteRequest(run: HttpRouteRun): void;
69
+ private refuseWhenExiting;
70
+ /** Count a request in flight until its response closed: as activity when `active`, and waited for at exit when `waited`. */
71
+ private startRequest;
72
+ /** Count activity until the function returned is called, once. */
73
+ private holdActivity;
44
74
  /** Keep a session's notification stream until it closes: it is activity, but no request to wait for at exit. */
45
75
  private holdStream;
46
76
  private finishRequest;
@@ -1 +1 @@
1
- {"version":3,"file":"shared-server.lifecycle.d.ts","sourceRoot":"","sources":["../../src/shared/shared-server.lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,WAAW,EAAE,MAAM,WAAW,CAAC;AAKrD,oHAAoH;AACpH,wBAAgB,eAAe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vB;IAED,qDAAqD;IACrD,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAO1B,6GAA6G;IAC7G,OAAO,CAAC,GAAG,SAAa,GAAG,MAAM;IAIjC,mEAAmE;IACnE,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAczC,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAWvC,uGAAuG;IAEvG,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAQzC,gEAAgE;IAEhE,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI;IAQ3C,+HAA+H;IAE/H,qBAAqB,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI;IAc9C,OAAO,CAAC,iBAAiB;IAIzB,4HAA4H;IAC5H,OAAO,CAAC,YAAY;IAWpB,kEAAkE;IAClE,OAAO,CAAC,YAAY;IAYpB,gHAAgH;IAChH,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,aAAa;CAKtB"}
@@ -1,8 +1,17 @@
1
1
  /** How sessions reach a shared local server: an owner-only Unix socket, or loopback HTTP. */
2
2
  export type SharedServerTransport = 'unix' | 'http';
3
+ /** A function a session reads its key with: when it starts, and again each time `rereadKey` fires. */
4
+ export type SharedServerKeyFunction = () => string | Promise<string>;
5
+ /** When a session whose `key` is a function reads it again. */
6
+ export interface SharedServerKeyReread {
7
+ /** The file whose change re-reads the key: it appears, goes, or its size or modification time changes. */
8
+ file: string;
9
+ /** How often the file is checked. @default 1000 */
10
+ intervalMs?: number;
11
+ }
3
12
  export interface SharedServerOptions {
4
- /** Names the server: every session started with the same key on this machine shares one server process. */
5
- key: string;
13
+ /** Names the server; a function is read at the start and on `rereadKey`, and a new key moves the session. */
14
+ key: string | SharedServerKeyFunction;
6
15
  /** @default 'unix', or 'http' on Windows */
7
16
  transport?: SharedServerTransport;
8
17
  /**
@@ -21,18 +30,46 @@ export interface SharedServerOptions {
21
30
  idleTimeoutMs?: number | false;
22
31
  /** The folder the server runs from: it exits once that folder is removed; `false` never. @default the entry's folder */
23
32
  checkout?: string | false;
33
+ /**
34
+ * Boot the server in the session's own process while the session attaches, so a session that can't attach serves its
35
+ * client at once, without booting it then. The spare serves nothing until it is needed, and is shut down once the
36
+ * session attached. @default false
37
+ */
38
+ spare?: boolean;
39
+ /** When a function `key` is read again (see {@link SharedServerKeyReread}); without it, it is read once. */
40
+ rereadKey?: SharedServerKeyReread;
41
+ /** By key, the entry that starts the server of a key the session moves to; it starts no other key's server. */
42
+ entries?: Record<string, string>;
24
43
  }
25
44
  export interface ResolvedSharedServerOptions {
45
+ /** The key: the string, or what the function answered when the session started. */
26
46
  key: string;
27
47
  transport: SharedServerTransport;
28
48
  attachBudgetMs: number;
29
49
  replaceOlder: boolean;
30
50
  idleTimeoutMs: number | false;
31
51
  checkout: string | false;
52
+ spare: boolean;
53
+ /** The function `key`, which the session reads again. */
54
+ keySource?: SharedServerKeyFunction;
55
+ rereadKey?: Required<SharedServerKeyReread>;
56
+ /** The entries of the keys a session may start a server for, by key, with absolute paths. */
57
+ entries: Readonly<Record<string, string>>;
32
58
  }
33
- /**
34
- * Validate `runShared()`'s options and resolve the transport for `platform`, and the checkout: the folder of `entry`,
35
- * the file the process runs, or the working folder without one.
36
- */
59
+ type ValidatedOptions = Omit<ResolvedSharedServerOptions, 'key' | 'keySource'> & {
60
+ key: string | SharedServerKeyFunction;
61
+ };
62
+ /** Validate `runShared()`'s options; the key stays a function when it is one. */
63
+ export declare function validateSharedServerOptions(input: unknown, platform?: NodeJS.Platform, entry?: string): ValidatedOptions;
64
+ /** {@link validateSharedServerOptions} for a string key: the checkout is the folder of `entry`, else the cwd. */
37
65
  export declare function parseSharedServerOptions(input: unknown, platform?: NodeJS.Platform, entry?: string): ResolvedSharedServerOptions;
66
+ /** Whether `value` is a key a shared server can have: its folder is the same on every file system. */
67
+ export declare function isSharedServerKey(value: unknown): value is string;
68
+ /** What a key function answers: a key, or why it gave none (it threw, or answered something that is not a key). */
69
+ export declare function readSharedServerKey(source: SharedServerKeyFunction): Promise<{
70
+ key: string;
71
+ } | {
72
+ error: string;
73
+ }>;
74
+ export {};
38
75
  //# sourceMappingURL=shared-server.options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared-server.options.d.ts","sourceRoot":"","sources":["../../src/shared/shared-server.options.ts"],"names":[],"mappings":"AAMA,6FAA6F;AAC7F,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,mBAAmB;IAClC,2GAA2G;IAC3G,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qHAAqH;IACrH,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC/B,wHAAwH;IACxH,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC3B;AAED,MAAM,WAAW,2BAA2B;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,qBAAqB,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,KAAK,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;CAC1B;AA8CD;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,KAAK,CAAC,EAAE,MAAM,GACb,2BAA2B,CAsB7B"}
1
+ {"version":3,"file":"shared-server.options.d.ts","sourceRoot":"","sources":["../../src/shared/shared-server.options.ts"],"names":[],"mappings":"AAMA,6FAA6F;AAC7F,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEp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C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC3C;AAsFD,KAAK,gBAAgB,GAAG,IAAI,CAAC,2BAA2B,EAAE,KAAK,GAAG,WAAW,CAAC,GAAG;IAC/E,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC;CACvC,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,KAAK,CAAC,EAAE,MAAM,GACb,gBAAgB,CAkDlB;AAED,iHAAiH;AACjH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,KAAK,CAAC,EAAE,MAAM,GACb,2BAA2B,CAM7B;AAED,sGAAsG;AACtG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEjE;AAED,mHAAmH;AACnH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAS9C"}
@@ -1,6 +1,6 @@
1
1
  import type { SkillEntry } from '../../common';
2
- /** `body`, made from `skills`, as the cache keeps it: prefixed with the digest of those skills. */
3
- export declare function toCachedDocument(body: string, skills: readonly SkillEntry[]): string;
4
- /** The body of a cached document made from exactly `skills`; null for one made from other skills, or none. */
5
- export declare function fromCachedDocument(cached: string | null, skills: readonly SkillEntry[]): string | null;
2
+ /** `body`, made from `skills` while `toolsOff` were switched off, as the cache keeps it: prefixed with their digest. */
3
+ export declare function toCachedDocument(body: string, skills: readonly SkillEntry[], toolsOff?: readonly string[]): string;
4
+ /** The body of a cached document made from exactly `skills` and `toolsOff`; null for one made from others, or none. */
5
+ export declare function fromCachedDocument(cached: string | null, skills: readonly SkillEntry[], toolsOff?: readonly string[]): string | null;
6
6
  //# sourceMappingURL=skill-http-cache.catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-http-cache.catalog.d.ts","sourceRoot":"","sources":["../../../src/skill/cache/skill-http-cache.catalog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO/C,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,CAEpF;AAED,8GAA8G;AAC9G,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,GAAG,IAAI,CAGtG"}
1
+ {"version":3,"file":"skill-http-cache.catalog.d.ts","sourceRoot":"","sources":["../../../src/skill/cache/skill-http-cache.catalog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAW/C,wHAAwH;AACxH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,QAAQ,GAAE,SAAS,MAAM,EAAO,GAC/B,MAAM,CAER;AAED,uHAAuH;AACvH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,QAAQ,GAAE,SAAS,MAAM,EAAO,GAC/B,MAAM,GAAG,IAAI,CAGf"}
@@ -111,10 +111,20 @@ export declare class RedisSkillHttpCache implements SkillHttpCache {
111
111
  private readonly keyPrefix;
112
112
  private readonly ttlMs;
113
113
  private readonly getClient;
114
+ private readonly listKeys;
115
+ private readonly deleteKeys;
116
+ /**
117
+ * @param options.listKeys how to find the keys matching a pattern; by default the client's `keys()`
118
+ * (Vercel KV). A Redis server or cluster is scanned instead (the factory passes SCAN over every master).
119
+ * @param options.deleteKeys how to delete several keys; by default one `del(...keys)` (one DEL per
120
+ * key on a cluster, whose keys span hash slots).
121
+ */
114
122
  constructor(options: {
115
123
  getClient: () => Promise<RedisClient>;
116
124
  keyPrefix?: string;
117
125
  ttlMs?: number;
126
+ listKeys?: (client: RedisClient, pattern: string) => Promise<string[]>;
127
+ deleteKeys?: (client: RedisClient, keys: string[]) => Promise<unknown>;
118
128
  });
119
129
  getLlmTxt(): Promise<string | null>;
120
130
  setLlmTxt(content: string): Promise<void>;
@@ -132,12 +142,15 @@ export declare class RedisSkillHttpCache implements SkillHttpCache {
132
142
  }
133
143
  /**
134
144
  * Minimal Redis client interface used by the cache.
135
- * Compatible with ioredis and @vercel/kv.
145
+ * Compatible with ioredis, node-redis (through FrontMCP's adapter) and @vercel/kv.
146
+ *
147
+ * `keys` is only needed by the default key listing (Vercel KV); a Redis server or cluster is
148
+ * scanned with SCAN instead.
136
149
  */
137
150
  export interface RedisClient {
138
151
  get(key: string): Promise<string | null>;
139
152
  setex(key: string, seconds: number, value: string): Promise<unknown>;
140
153
  del(...keys: string[]): Promise<unknown>;
141
- keys(pattern: string): Promise<string[]>;
154
+ keys?(pattern: string): Promise<string[]>;
142
155
  }
143
156
  //# sourceMappingURL=skill-http-cache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-http-cache.d.ts","sourceRoot":"","sources":["../../../src/skill/cache/skill-http-cache.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IAElC;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEpC;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;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AC,OAAO,CAAC,CAAC;IACrE,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAC3C"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Factory for creating skill HTTP cache instances.
3
+ *
4
+ * @module skill/cache/skill-http-cache.factory
5
+ */
6
+ import { type RedisClientInput, type RedisClusterOption } from '@frontmcp/utils';
1
7
  import type { FrontMcpLogger } from '../../common/index.js';
2
8
  import { type SkillHttpCache } from './skill-http-cache.js';
3
9
  /**
@@ -16,6 +22,12 @@ export interface SkillHttpCacheRedisOptions {
16
22
  password?: string;
17
23
  /** Redis database number */
18
24
  db?: number;
25
+ /** Connect over TLS (`redis` provider) */
26
+ tls?: boolean;
27
+ /** The host is a Redis Cluster endpoint (`true`), or `{ nodes, options }` (`redis` provider) */
28
+ cluster?: RedisClusterOption;
29
+ /** A Redis client you made, in place of host/port (`redis` provider); FrontMCP never closes it */
30
+ client?: RedisClientInput;
19
31
  /** Vercel KV REST URL (`vercel-kv` provider); defaults to `KV_REST_API_URL` */
20
32
  url?: string;
21
33
  /** Vercel KV REST token (`vercel-kv` provider); defaults to `KV_REST_API_TOKEN` */
@@ -1 +1 @@
1
- {"version":3,"file":"skill-http-cache.factory.d.ts","sourceRoot":"","sources":["../../../src/skill/cache/skill-http-cache.factory.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,0BAA0B;IAC1B,QAAQ,EAAE,OAAO,GAAG,WAAW,GAAG,YAAY,CAAC;IAC/C,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,KAAK,CAAC,EAAE,0BAA0B,CAAC;IAEnC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,yBAAyB;IACzB,KAAK,EAAE,cAAc,CAAC;IACtB,sCAAsC;IACtC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC1B;AAWD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAyB7G"}
1
+ {"version":3,"file":"skill-http-cache.factory.d.ts","sourceRoot":"","sources":["../../../src/skill/cache/skill-http-cache.factory.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,0BAA0B;IAC1B,QAAQ,EAAE,OAAO,GAAG,WAAW,GAAG,YAAY,CAAC;IAC/C,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,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