@frontmcp/sdk 1.0.3 → 1.1.0-beta.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 (443) hide show
  1. package/agent/agent.instance.d.ts +5 -7
  2. package/agent/agent.instance.d.ts.map +1 -1
  3. package/agent/agent.scope.d.ts +4 -4
  4. package/agent/flows/call-agent.flow.d.ts +211 -205
  5. package/agent/flows/call-agent.flow.d.ts.map +1 -1
  6. package/agent/hooks/agent.hooks.d.ts +4 -4
  7. package/agent/hooks/agent.hooks.d.ts.map +1 -1
  8. package/agent/index.d.ts +1 -1
  9. package/auth/flows/auth.verify.flow.d.ts +48 -44
  10. package/auth/flows/auth.verify.flow.d.ts.map +1 -1
  11. package/auth/flows/oauth.authorize.flow.d.ts +119 -137
  12. package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
  13. package/auth/flows/oauth.callback.flow.d.ts +64 -64
  14. package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
  15. package/auth/flows/oauth.provider-callback.flow.d.ts +52 -52
  16. package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -1
  17. package/auth/flows/oauth.register.flow.d.ts +35 -48
  18. package/auth/flows/oauth.register.flow.d.ts.map +1 -1
  19. package/auth/flows/oauth.token.flow.d.ts +53 -80
  20. package/auth/flows/oauth.token.flow.d.ts.map +1 -1
  21. package/auth/flows/session.verify.flow.d.ts +86 -83
  22. package/auth/flows/session.verify.flow.d.ts.map +1 -1
  23. package/auth/flows/well-known.jwks.flow.d.ts +61 -61
  24. package/auth/flows/well-known.jwks.flow.d.ts.map +1 -1
  25. package/auth/flows/well-known.oauth-authorization-server.flow.d.ts +66 -66
  26. package/auth/flows/well-known.oauth-authorization-server.flow.d.ts.map +1 -1
  27. package/auth/flows/well-known.prm.flow.d.ts +35 -36
  28. package/auth/flows/well-known.prm.flow.d.ts.map +1 -1
  29. package/auth/session/transport-session.manager.d.ts +1 -1
  30. package/auth/session/transport-session.manager.d.ts.map +1 -1
  31. package/auth/session/utils/session-id.utils.d.ts +2 -2
  32. package/auth/session/utils/session-id.utils.d.ts.map +1 -1
  33. package/builtin/authorities/authorities.plugin.d.ts +25 -0
  34. package/builtin/authorities/authorities.plugin.d.ts.map +1 -0
  35. package/builtin/authorities/authorities.plugin.options.d.ts +45 -0
  36. package/builtin/authorities/authorities.plugin.options.d.ts.map +1 -0
  37. package/builtin/authorities/index.d.ts +3 -0
  38. package/builtin/authorities/index.d.ts.map +1 -0
  39. package/builtin/config/config.plugin.d.ts +2 -2
  40. package/builtin/config/config.plugin.d.ts.map +1 -1
  41. package/builtin/config/config.types.d.ts +1 -1
  42. package/builtin/config/config.types.d.ts.map +1 -1
  43. package/builtin/config/index.d.ts +2 -2
  44. package/builtin/config/index.d.ts.map +1 -1
  45. package/builtin/config/providers/config-loader.d.ts +1 -1
  46. package/builtin/config/providers/config-loader.d.ts.map +1 -1
  47. package/builtin/config/providers/config.service.d.ts +2 -2
  48. package/builtin/config/providers/config.service.d.ts.map +1 -1
  49. package/builtin/config/providers/env-loader.d.ts +1 -1
  50. package/builtin/config/providers/env-loader.d.ts.map +1 -1
  51. package/channel/channel-notification.service.d.ts +52 -0
  52. package/channel/channel-notification.service.d.ts.map +1 -0
  53. package/channel/channel-scope.helper.d.ts +37 -0
  54. package/channel/channel-scope.helper.d.ts.map +1 -0
  55. package/channel/channel.events.d.ts +25 -0
  56. package/channel/channel.events.d.ts.map +1 -0
  57. package/channel/channel.instance.d.ts +105 -0
  58. package/channel/channel.instance.d.ts.map +1 -0
  59. package/channel/channel.registry.d.ts +65 -0
  60. package/channel/channel.registry.d.ts.map +1 -0
  61. package/channel/channel.types.d.ts +14 -0
  62. package/channel/channel.types.d.ts.map +1 -0
  63. package/channel/channel.utils.d.ts +19 -0
  64. package/channel/channel.utils.d.ts.map +1 -0
  65. package/channel/flows/list-channels.flow.d.ts +41 -0
  66. package/channel/flows/list-channels.flow.d.ts.map +1 -0
  67. package/channel/flows/send-channel-notification.flow.d.ts +38 -0
  68. package/channel/flows/send-channel-notification.flow.d.ts.map +1 -0
  69. package/channel/index.d.ts +14 -0
  70. package/channel/index.d.ts.map +1 -0
  71. package/channel/reply/channel-reply.tool.d.ts +15 -0
  72. package/channel/reply/channel-reply.tool.d.ts.map +1 -0
  73. package/channel/reply/reply.types.d.ts +14 -0
  74. package/channel/reply/reply.types.d.ts.map +1 -0
  75. package/channel/sources/agent-completion.source.d.ts +29 -0
  76. package/channel/sources/agent-completion.source.d.ts.map +1 -0
  77. package/channel/sources/app-event.source.d.ts +57 -0
  78. package/channel/sources/app-event.source.d.ts.map +1 -0
  79. package/channel/sources/index.d.ts +5 -0
  80. package/channel/sources/index.d.ts.map +1 -0
  81. package/channel/sources/job-completion.source.d.ts +28 -0
  82. package/channel/sources/job-completion.source.d.ts.map +1 -0
  83. package/channel/sources/webhook.source.d.ts +42 -0
  84. package/channel/sources/webhook.source.d.ts.map +1 -0
  85. package/common/common.schema.d.ts +11 -11
  86. package/common/common.schema.d.ts.map +1 -1
  87. package/common/decorators/agent.decorator.d.ts +4 -4
  88. package/common/decorators/agent.decorator.d.ts.map +1 -1
  89. package/common/decorators/channel.decorator.d.ts +59 -0
  90. package/common/decorators/channel.decorator.d.ts.map +1 -0
  91. package/common/decorators/front-mcp.decorator.d.ts +1 -1
  92. package/common/decorators/front-mcp.decorator.d.ts.map +1 -1
  93. package/common/decorators/index.d.ts +1 -0
  94. package/common/decorators/index.d.ts.map +1 -1
  95. package/common/decorators/job.decorator.d.ts +13 -9
  96. package/common/decorators/job.decorator.d.ts.map +1 -1
  97. package/common/decorators/tool.decorator.d.ts +12 -7
  98. package/common/decorators/tool.decorator.d.ts.map +1 -1
  99. package/common/entries/agent.entry.d.ts +6 -6
  100. package/common/entries/agent.entry.d.ts.map +1 -1
  101. package/common/entries/channel.entry.d.ts +58 -0
  102. package/common/entries/channel.entry.d.ts.map +1 -0
  103. package/common/entries/index.d.ts +1 -0
  104. package/common/entries/index.d.ts.map +1 -1
  105. package/common/entries/job.entry.d.ts +7 -7
  106. package/common/entries/job.entry.d.ts.map +1 -1
  107. package/common/entries/scope.entry.d.ts +32 -14
  108. package/common/entries/scope.entry.d.ts.map +1 -1
  109. package/common/entries/tool.entry.d.ts +12 -8
  110. package/common/entries/tool.entry.d.ts.map +1 -1
  111. package/common/flow/flow.utils.d.ts +1 -1
  112. package/common/flow/flow.utils.d.ts.map +1 -1
  113. package/common/interfaces/agent.interface.d.ts +8 -8
  114. package/common/interfaces/agent.interface.d.ts.map +1 -1
  115. package/common/interfaces/channel.interface.d.ts +131 -0
  116. package/common/interfaces/channel.interface.d.ts.map +1 -0
  117. package/common/interfaces/execution-context.interface.d.ts +27 -8
  118. package/common/interfaces/execution-context.interface.d.ts.map +1 -1
  119. package/common/interfaces/flow.interface.d.ts +6 -6
  120. package/common/interfaces/flow.interface.d.ts.map +1 -1
  121. package/common/interfaces/index.d.ts +1 -0
  122. package/common/interfaces/index.d.ts.map +1 -1
  123. package/common/interfaces/internal/flow.utils.d.ts +2 -2
  124. package/common/interfaces/internal/flow.utils.d.ts.map +1 -1
  125. package/common/interfaces/internal/registry.interface.d.ts +3 -1
  126. package/common/interfaces/internal/registry.interface.d.ts.map +1 -1
  127. package/common/interfaces/resource.interface.d.ts +7 -0
  128. package/common/interfaces/resource.interface.d.ts.map +1 -1
  129. package/common/interfaces/server.interface.d.ts +5 -3
  130. package/common/interfaces/server.interface.d.ts.map +1 -1
  131. package/common/interfaces/tool.interface.d.ts +18 -6
  132. package/common/interfaces/tool.interface.d.ts.map +1 -1
  133. package/common/metadata/adapter.metadata.d.ts +5 -6
  134. package/common/metadata/adapter.metadata.d.ts.map +1 -1
  135. package/common/metadata/agent.metadata.d.ts +94 -95
  136. package/common/metadata/agent.metadata.d.ts.map +1 -1
  137. package/common/metadata/app-filter.metadata.d.ts +21 -22
  138. package/common/metadata/app-filter.metadata.d.ts.map +1 -1
  139. package/common/metadata/app.metadata.d.ts +554 -547
  140. package/common/metadata/app.metadata.d.ts.map +1 -1
  141. package/common/metadata/auth-provider.metadata.d.ts +6 -7
  142. package/common/metadata/auth-provider.metadata.d.ts.map +1 -1
  143. package/common/metadata/channel.metadata.d.ts +286 -0
  144. package/common/metadata/channel.metadata.d.ts.map +1 -0
  145. package/common/metadata/flow.metadata.d.ts +14 -14
  146. package/common/metadata/flow.metadata.d.ts.map +1 -1
  147. package/common/metadata/front-mcp.metadata.d.ts +3591 -2715
  148. package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
  149. package/common/metadata/index.d.ts +1 -0
  150. package/common/metadata/index.d.ts.map +1 -1
  151. package/common/metadata/job.metadata.d.ts +26 -27
  152. package/common/metadata/job.metadata.d.ts.map +1 -1
  153. package/common/metadata/logger.metadata.d.ts +5 -6
  154. package/common/metadata/logger.metadata.d.ts.map +1 -1
  155. package/common/metadata/plugin.metadata.d.ts +21 -22
  156. package/common/metadata/plugin.metadata.d.ts.map +1 -1
  157. package/common/metadata/prompt.metadata.d.ts +24 -25
  158. package/common/metadata/prompt.metadata.d.ts.map +1 -1
  159. package/common/metadata/provider.metadata.d.ts +6 -7
  160. package/common/metadata/provider.metadata.d.ts.map +1 -1
  161. package/common/metadata/resource.metadata.d.ts +40 -41
  162. package/common/metadata/resource.metadata.d.ts.map +1 -1
  163. package/common/metadata/skill.metadata.d.ts +57 -57
  164. package/common/metadata/skill.metadata.d.ts.map +1 -1
  165. package/common/metadata/tool.metadata.d.ts +145 -120
  166. package/common/metadata/tool.metadata.d.ts.map +1 -1
  167. package/common/metadata/workflow.metadata.d.ts +43 -44
  168. package/common/metadata/workflow.metadata.d.ts.map +1 -1
  169. package/common/records/channel.record.d.ts +52 -0
  170. package/common/records/channel.record.d.ts.map +1 -0
  171. package/common/records/index.d.ts +1 -0
  172. package/common/records/index.d.ts.map +1 -1
  173. package/common/schemas/annotated-class.schema.d.ts +15 -15
  174. package/common/schemas/annotated-class.schema.d.ts.map +1 -1
  175. package/common/schemas/http-input.schema.d.ts +8 -9
  176. package/common/schemas/http-input.schema.d.ts.map +1 -1
  177. package/common/schemas/http-output.schema.d.ts +500 -496
  178. package/common/schemas/http-output.schema.d.ts.map +1 -1
  179. package/common/schemas/session-header.schema.d.ts +1 -2
  180. package/common/schemas/session-header.schema.d.ts.map +1 -1
  181. package/common/tokens/app.tokens.d.ts.map +1 -1
  182. package/common/tokens/channel.tokens.d.ts +14 -0
  183. package/common/tokens/channel.tokens.d.ts.map +1 -0
  184. package/common/tokens/front-mcp.tokens.d.ts +2 -2
  185. package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
  186. package/common/tokens/index.d.ts +1 -0
  187. package/common/tokens/index.d.ts.map +1 -1
  188. package/common/tokens/tool.tokens.d.ts +1 -0
  189. package/common/tokens/tool.tokens.d.ts.map +1 -1
  190. package/common/types/auth/session.types.d.ts +49 -50
  191. package/common/types/auth/session.types.d.ts.map +1 -1
  192. package/common/types/common.types.d.ts +1 -1
  193. package/common/types/common.types.d.ts.map +1 -1
  194. package/common/types/options/elicitation/schema.d.ts +28 -28
  195. package/common/types/options/elicitation/schema.d.ts.map +1 -1
  196. package/common/types/options/ext-apps/schema.d.ts +20 -20
  197. package/common/types/options/ext-apps/schema.d.ts.map +1 -1
  198. package/common/types/options/ext-apps/typecheck.d.ts.map +1 -1
  199. package/common/types/options/health/schema.d.ts +16 -16
  200. package/common/types/options/health/schema.d.ts.map +1 -1
  201. package/common/types/options/http/index.d.ts +1 -1
  202. package/common/types/options/http/index.d.ts.map +1 -1
  203. package/common/types/options/http/interfaces.d.ts +41 -1
  204. package/common/types/options/http/interfaces.d.ts.map +1 -1
  205. package/common/types/options/http/schema.d.ts +21 -12
  206. package/common/types/options/http/schema.d.ts.map +1 -1
  207. package/common/types/options/http/typecheck.d.ts.map +1 -1
  208. package/common/types/options/logging/schema.d.ts +8 -8
  209. package/common/types/options/logging/schema.d.ts.map +1 -1
  210. package/common/types/options/observability/schema.d.ts +6 -6
  211. package/common/types/options/observability/schema.d.ts.map +1 -1
  212. package/common/types/options/pagination/schema.d.ts +13 -13
  213. package/common/types/options/pagination/schema.d.ts.map +1 -1
  214. package/common/types/options/redis/schema.d.ts +62 -62
  215. package/common/types/options/redis/schema.d.ts.map +1 -1
  216. package/common/types/options/redis/typecheck.d.ts.map +1 -1
  217. package/common/types/options/server-info/schema.d.ts +13 -13
  218. package/common/types/options/server-info/schema.d.ts.map +1 -1
  219. package/common/types/options/session/schema.d.ts +22 -22
  220. package/common/types/options/session/schema.d.ts.map +1 -1
  221. package/common/types/options/skills-http/schema.d.ts +63 -63
  222. package/common/types/options/skills-http/schema.d.ts.map +1 -1
  223. package/common/types/options/skills-http/typecheck.d.ts.map +1 -1
  224. package/common/types/options/sqlite/schema.d.ts +9 -9
  225. package/common/types/options/sqlite/schema.d.ts.map +1 -1
  226. package/common/types/options/sqlite/typecheck.d.ts.map +1 -1
  227. package/common/types/options/transport/schema.d.ts +140 -140
  228. package/common/types/options/transport/schema.d.ts.map +1 -1
  229. package/common/types/options/transport/typecheck.d.ts.map +1 -1
  230. package/common/utils/decide-request-intent.utils.d.ts +16 -17
  231. package/common/utils/decide-request-intent.utils.d.ts.map +1 -1
  232. package/common/utils/path.utils.d.ts +10 -1
  233. package/common/utils/path.utils.d.ts.map +1 -1
  234. package/completion/flows/complete.flow.d.ts +68 -69
  235. package/completion/flows/complete.flow.d.ts.map +1 -1
  236. package/context/frontmcp-context.d.ts +9 -7
  237. package/context/frontmcp-context.d.ts.map +1 -1
  238. package/direct/create.d.ts +1 -1
  239. package/direct/create.d.ts.map +1 -1
  240. package/elicitation/elicitation.types.d.ts +2 -2
  241. package/elicitation/elicitation.types.d.ts.map +1 -1
  242. package/elicitation/flows/elicitation-request.flow.d.ts +40 -40
  243. package/elicitation/flows/elicitation-request.flow.d.ts.map +1 -1
  244. package/elicitation/flows/elicitation-result.flow.d.ts +23 -23
  245. package/elicitation/flows/elicitation-result.flow.d.ts.map +1 -1
  246. package/elicitation/helpers/elicit.helper.d.ts +4 -4
  247. package/elicitation/helpers/elicit.helper.d.ts.map +1 -1
  248. package/elicitation/helpers/extend-output-schema.d.ts.map +1 -1
  249. package/elicitation/send-elicitation-result.tool.d.ts.map +1 -1
  250. package/errors/authorization-required.error.d.ts +44 -44
  251. package/errors/authorization-required.error.d.ts.map +1 -1
  252. package/errors/index.d.ts +3 -2
  253. package/errors/index.d.ts.map +1 -1
  254. package/errors/sdk.errors.d.ts +6 -0
  255. package/errors/sdk.errors.d.ts.map +1 -1
  256. package/errors/task.error.d.ts +55 -0
  257. package/errors/task.error.d.ts.map +1 -0
  258. package/errors/transport.errors.d.ts +6 -0
  259. package/errors/transport.errors.d.ts.map +1 -1
  260. package/esm/index.mjs +42394 -36842
  261. package/esm-loader/esm-auth.types.d.ts +5 -6
  262. package/esm-loader/esm-auth.types.d.ts.map +1 -1
  263. package/esm-loader/esm-manifest.d.ts +13 -14
  264. package/esm-loader/esm-manifest.d.ts.map +1 -1
  265. package/esm-loader/factories/esm-record-builders.d.ts +2 -2
  266. package/esm-loader/factories/esm-record-builders.d.ts.map +1 -1
  267. package/front-mcp/front-mcp.d.ts +3 -3
  268. package/front-mcp/front-mcp.d.ts.map +1 -1
  269. package/front-mcp/front-mcp.providers.d.ts +328 -28
  270. package/front-mcp/front-mcp.providers.d.ts.map +1 -1
  271. package/ha/ha-manager.d.ts +119 -0
  272. package/ha/ha-manager.d.ts.map +1 -0
  273. package/ha/ha.constants.d.ts +11 -0
  274. package/ha/ha.constants.d.ts.map +1 -0
  275. package/ha/ha.types.d.ts +42 -0
  276. package/ha/ha.types.d.ts.map +1 -0
  277. package/ha/heartbeat.service.d.ts +44 -0
  278. package/ha/heartbeat.service.d.ts.map +1 -0
  279. package/ha/index.d.ts +8 -0
  280. package/ha/index.d.ts.map +1 -0
  281. package/ha/notification-relay.d.ts +60 -0
  282. package/ha/notification-relay.d.ts.map +1 -0
  283. package/ha/session-takeover.d.ts +28 -0
  284. package/ha/session-takeover.d.ts.map +1 -0
  285. package/health/health.service.d.ts +5 -0
  286. package/health/health.service.d.ts.map +1 -1
  287. package/index.d.ts +45 -28
  288. package/index.d.ts.map +1 -1
  289. package/index.js +43391 -37819
  290. package/job/job.instance.d.ts +6 -8
  291. package/job/job.instance.d.ts.map +1 -1
  292. package/job/tools/execute-job.tool.d.ts.map +1 -1
  293. package/job/tools/get-job-status.tool.d.ts.map +1 -1
  294. package/job/tools/list-jobs.tool.d.ts.map +1 -1
  295. package/job/tools/register-job.tool.d.ts.map +1 -1
  296. package/job/tools/remove-job.tool.d.ts.map +1 -1
  297. package/logging/flows/set-level.flow.d.ts +38 -39
  298. package/logging/flows/set-level.flow.d.ts.map +1 -1
  299. package/notification/index.d.ts +1 -1
  300. package/notification/index.d.ts.map +1 -1
  301. package/notification/notification.service.d.ts +68 -4
  302. package/notification/notification.service.d.ts.map +1 -1
  303. package/package.json +18 -14
  304. package/prompt/flows/get-prompt.flow.d.ts +194 -189
  305. package/prompt/flows/get-prompt.flow.d.ts.map +1 -1
  306. package/prompt/flows/prompts-list.flow.d.ts +60 -56
  307. package/prompt/flows/prompts-list.flow.d.ts.map +1 -1
  308. package/resource/flows/read-resource.flow.d.ts +91 -86
  309. package/resource/flows/read-resource.flow.d.ts.map +1 -1
  310. package/resource/flows/resource-templates-list.flow.d.ts +62 -58
  311. package/resource/flows/resource-templates-list.flow.d.ts.map +1 -1
  312. package/resource/flows/resources-list.flow.d.ts +62 -58
  313. package/resource/flows/resources-list.flow.d.ts.map +1 -1
  314. package/resource/flows/subscribe-resource.flow.d.ts +38 -39
  315. package/resource/flows/subscribe-resource.flow.d.ts.map +1 -1
  316. package/resource/flows/unsubscribe-resource.flow.d.ts +38 -39
  317. package/resource/flows/unsubscribe-resource.flow.d.ts.map +1 -1
  318. package/resource/resource.events.d.ts +2 -0
  319. package/resource/resource.events.d.ts.map +1 -1
  320. package/resource/resource.registry.d.ts +7 -0
  321. package/resource/resource.registry.d.ts.map +1 -1
  322. package/scope/flows/http.request.flow.d.ts +58 -56
  323. package/scope/flows/http.request.flow.d.ts.map +1 -1
  324. package/scope/scope.instance.d.ts +81 -15
  325. package/scope/scope.instance.d.ts.map +1 -1
  326. package/server/adapters/base.host.adapter.d.ts +4 -1
  327. package/server/adapters/base.host.adapter.d.ts.map +1 -1
  328. package/server/adapters/express.host.adapter.d.ts +8 -2
  329. package/server/adapters/express.host.adapter.d.ts.map +1 -1
  330. package/server/middleware/csp.middleware.d.ts +64 -0
  331. package/server/middleware/csp.middleware.d.ts.map +1 -0
  332. package/server/middleware/host-validation.middleware.d.ts +25 -0
  333. package/server/middleware/host-validation.middleware.d.ts.map +1 -0
  334. package/server/security/security-audit.d.ts +66 -0
  335. package/server/security/security-audit.d.ts.map +1 -0
  336. package/server/server.instance.d.ts +4 -4
  337. package/server/server.instance.d.ts.map +1 -1
  338. package/skill/flows/http/llm-full-txt.flow.d.ts +27 -32
  339. package/skill/flows/http/llm-full-txt.flow.d.ts.map +1 -1
  340. package/skill/flows/http/llm-txt.flow.d.ts +27 -32
  341. package/skill/flows/http/llm-txt.flow.d.ts.map +1 -1
  342. package/skill/flows/http/skills-api.flow.d.ts +33 -38
  343. package/skill/flows/http/skills-api.flow.d.ts.map +1 -1
  344. package/skill/flows/load-skill.flow.d.ts +100 -100
  345. package/skill/flows/load-skill.flow.d.ts.map +1 -1
  346. package/skill/flows/search-skills.flow.d.ts +56 -57
  347. package/skill/flows/search-skills.flow.d.ts.map +1 -1
  348. package/task/flows/tasks-cancel.flow.d.ts +72 -0
  349. package/task/flows/tasks-cancel.flow.d.ts.map +1 -0
  350. package/task/flows/tasks-get.flow.d.ts +69 -0
  351. package/task/flows/tasks-get.flow.d.ts.map +1 -0
  352. package/task/flows/tasks-list.flow.d.ts +73 -0
  353. package/task/flows/tasks-list.flow.d.ts.map +1 -0
  354. package/task/flows/tasks-result.flow.d.ts +93 -0
  355. package/task/flows/tasks-result.flow.d.ts.map +1 -0
  356. package/task/helpers/cli-task-runner.d.ts +46 -0
  357. package/task/helpers/cli-task-runner.d.ts.map +1 -0
  358. package/task/helpers/in-process-task-runner.d.ts +28 -0
  359. package/task/helpers/in-process-task-runner.d.ts.map +1 -0
  360. package/task/helpers/process-liveness.d.ts +16 -0
  361. package/task/helpers/process-liveness.d.ts.map +1 -0
  362. package/task/helpers/task-id.d.ts +10 -0
  363. package/task/helpers/task-id.d.ts.map +1 -0
  364. package/task/helpers/task-notifier.d.ts +20 -0
  365. package/task/helpers/task-notifier.d.ts.map +1 -0
  366. package/task/helpers/task-runner.d.ts +47 -0
  367. package/task/helpers/task-runner.d.ts.map +1 -0
  368. package/task/helpers/task-runner.types.d.ts +32 -0
  369. package/task/helpers/task-runner.types.d.ts.map +1 -0
  370. package/task/index.d.ts +24 -0
  371. package/task/index.d.ts.map +1 -0
  372. package/task/runtime/execute-task-flag.d.ts +11 -0
  373. package/task/runtime/execute-task-flag.d.ts.map +1 -0
  374. package/task/runtime/execute-task.d.ts +21 -0
  375. package/task/runtime/execute-task.d.ts.map +1 -0
  376. package/task/store/index.d.ts +4 -0
  377. package/task/store/index.d.ts.map +1 -0
  378. package/task/store/storage-task.store.d.ts +42 -0
  379. package/task/store/storage-task.store.d.ts.map +1 -0
  380. package/task/store/task-store.factory.d.ts +58 -0
  381. package/task/store/task-store.factory.d.ts.map +1 -0
  382. package/task/store/task.store.d.ts +76 -0
  383. package/task/store/task.store.d.ts.map +1 -0
  384. package/task/task-scope.helper.d.ts +18 -0
  385. package/task/task-scope.helper.d.ts.map +1 -0
  386. package/task/task.registry.d.ts +68 -0
  387. package/task/task.registry.d.ts.map +1 -0
  388. package/task/task.types.d.ts +201 -0
  389. package/task/task.types.d.ts.map +1 -0
  390. package/tool/flows/call-tool.flow.d.ts +216 -197
  391. package/tool/flows/call-tool.flow.d.ts.map +1 -1
  392. package/tool/flows/tools-list.flow.d.ts +82 -76
  393. package/tool/flows/tools-list.flow.d.ts.map +1 -1
  394. package/tool/tool.instance.d.ts +4 -6
  395. package/tool/tool.instance.d.ts.map +1 -1
  396. package/tool/tool.utils.d.ts +2 -2
  397. package/tool/tool.utils.d.ts.map +1 -1
  398. package/transport/adapters/transport.local.adapter.d.ts +10 -11
  399. package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
  400. package/transport/adapters/transport.sse.adapter.d.ts +5 -5
  401. package/transport/adapters/transport.sse.adapter.d.ts.map +1 -1
  402. package/transport/adapters/transport.streamable-http.adapter.d.ts +7 -7
  403. package/transport/adapters/transport.streamable-http.adapter.d.ts.map +1 -1
  404. package/transport/bus/index.d.ts +3 -0
  405. package/transport/bus/index.d.ts.map +1 -0
  406. package/transport/bus/redis-transport-bus.d.ts +90 -0
  407. package/transport/bus/redis-transport-bus.d.ts.map +1 -0
  408. package/transport/flows/handle.sse.flow.d.ts +17 -18
  409. package/transport/flows/handle.sse.flow.d.ts.map +1 -1
  410. package/transport/flows/handle.stateless-http.flow.d.ts +6 -7
  411. package/transport/flows/handle.stateless-http.flow.d.ts.map +1 -1
  412. package/transport/flows/handle.streamable-http.flow.d.ts +19 -19
  413. package/transport/flows/handle.streamable-http.flow.d.ts.map +1 -1
  414. package/transport/in-memory-server.d.ts +2 -3
  415. package/transport/in-memory-server.d.ts.map +1 -1
  416. package/transport/mcp-handlers/call-tool-request.handler.d.ts +2 -2
  417. package/transport/mcp-handlers/call-tool-request.handler.d.ts.map +1 -1
  418. package/transport/mcp-handlers/index.d.ts +719 -565
  419. package/transport/mcp-handlers/index.d.ts.map +1 -1
  420. package/transport/mcp-handlers/initialize-request.handler.d.ts.map +1 -1
  421. package/transport/mcp-handlers/mcp-error.utils.d.ts +15 -0
  422. package/transport/mcp-handlers/mcp-error.utils.d.ts.map +1 -0
  423. package/transport/mcp-handlers/mcp-handlers.types.d.ts +3 -3
  424. package/transport/mcp-handlers/mcp-handlers.types.d.ts.map +1 -1
  425. package/transport/mcp-handlers/skills-mcp.types.d.ts +97 -97
  426. package/transport/mcp-handlers/skills-mcp.types.d.ts.map +1 -1
  427. package/transport/mcp-handlers/tasks-cancel-request.handler.d.ts +4 -0
  428. package/transport/mcp-handlers/tasks-cancel-request.handler.d.ts.map +1 -0
  429. package/transport/mcp-handlers/tasks-get-request.handler.d.ts +4 -0
  430. package/transport/mcp-handlers/tasks-get-request.handler.d.ts.map +1 -0
  431. package/transport/mcp-handlers/tasks-list-request.handler.d.ts +4 -0
  432. package/transport/mcp-handlers/tasks-list-request.handler.d.ts.map +1 -0
  433. package/transport/mcp-handlers/tasks-result-request.handler.d.ts +4 -0
  434. package/transport/mcp-handlers/tasks-result-request.handler.d.ts.map +1 -0
  435. package/transport/transport.registry.d.ts +9 -4
  436. package/transport/transport.registry.d.ts.map +1 -1
  437. package/types/zod.types.d.ts +1 -1
  438. package/types/zod.types.d.ts.map +1 -1
  439. package/workflow/tools/execute-workflow.tool.d.ts.map +1 -1
  440. package/workflow/tools/get-workflow-status.tool.d.ts.map +1 -1
  441. package/workflow/tools/list-workflows.tool.d.ts.map +1 -1
  442. package/workflow/tools/register-workflow.tool.d.ts.map +1 -1
  443. package/workflow/tools/remove-workflow.tool.d.ts.map +1 -1
@@ -0,0 +1,58 @@
1
+ /**
2
+ * TaskStore factory — mirrors the elicitation-store factory pattern.
3
+ *
4
+ * Auto-detects the storage backend from config / env. Memory is the default
5
+ * for single-node / development; Redis or Upstash is required for multi-node
6
+ * deployments (both support pub/sub for cross-node terminal/cancel routing).
7
+ *
8
+ * Vercel KV is not supported (no pub/sub), matching the elicitation store.
9
+ *
10
+ * @module task/store/task-store.factory
11
+ */
12
+ import { type RootStorage, type StorageConfig } from '@frontmcp/utils';
13
+ import { type FrontMcpLogger, type RedisOptionsInput } from '../../common';
14
+ import { type TaskStore } from './task.store';
15
+ export declare class TaskStoreNotSupportedError extends Error {
16
+ constructor(message: string);
17
+ }
18
+ export interface TaskStoreOptions {
19
+ /** Storage config (@frontmcp/utils shape). */
20
+ storage?: StorageConfig;
21
+ /** Convenience: legacy redis option, mapped into `storage` when `storage` is absent. */
22
+ redis?: RedisOptionsInput;
23
+ /** Key prefix for all task keys. Default `mcp:task:`. */
24
+ keyPrefix?: string;
25
+ /** Logger. */
26
+ logger?: FrontMcpLogger;
27
+ /** Edge runtime mode — requires distributed storage. */
28
+ isEdgeRuntime?: boolean;
29
+ /**
30
+ * SQLite backend options. When provided, the factory returns a
31
+ * `SqliteTaskStore` instead of the utils-backed implementation.
32
+ * Required for cross-invocation persistence in CLI mode.
33
+ */
34
+ sqlite?: {
35
+ path: string;
36
+ encryption?: {
37
+ secret: string;
38
+ };
39
+ walMode?: boolean;
40
+ ttlCleanupIntervalMs?: number;
41
+ };
42
+ }
43
+ export interface TaskStoreResult {
44
+ store: TaskStore;
45
+ type: 'memory' | 'redis' | 'upstash' | 'sqlite' | 'auto';
46
+ /**
47
+ * Underlying storage instance (not populated for the SQLite backend, which
48
+ * manages its own Database connection internally).
49
+ */
50
+ storage?: RootStorage;
51
+ }
52
+ export declare function createTaskStore(options?: TaskStoreOptions): Promise<TaskStoreResult>;
53
+ /** Synchronous memory-backed factory, primarily for tests. */
54
+ export declare function createMemoryTaskStore(options?: {
55
+ keyPrefix?: string;
56
+ logger?: FrontMcpLogger;
57
+ }): TaskStoreResult;
58
+ //# sourceMappingURL=task-store.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-store.factory.d.ts","sourceRoot":"","sources":["../../../src/task/store/task-store.factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAA8C,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEnH,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,OAAO,EAAE,MAAM;CAI5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,wFAAwF;IACxF,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc;IACd,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,wDAAwD;IACxD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAChC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC/B,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IACzD;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAyBD,wBAAsB,eAAe,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CA4F9F;AAED,8DAA8D;AAC9D,wBAAgB,qBAAqB,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,cAAc,CAAA;CAAO,GAAG,eAAe,CAIpH"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * TaskStore interface — abstraction over persistent state for MCP background tasks.
3
+ *
4
+ * Mirrors the elicitation store design: reads/writes + pub/sub for cross-node
5
+ * result unblocking and cancel signaling.
6
+ *
7
+ * @module task/store/task.store
8
+ */
9
+ import type { TaskRecord } from '../task.types';
10
+ /** Callback invoked when a task reaches a terminal status. */
11
+ export type TaskTerminalCallback = (record: TaskRecord) => void;
12
+ /** Callback invoked when a task has been asked to cancel. */
13
+ export type TaskCancelCallback = () => void;
14
+ /** Unsubscribe handle returned by subscribe* methods. */
15
+ export type TaskUnsubscribe = () => Promise<void>;
16
+ /** Result of a paginated list operation. */
17
+ export interface TaskListPage {
18
+ tasks: TaskRecord[];
19
+ nextCursor?: string;
20
+ }
21
+ export interface TaskStore {
22
+ /**
23
+ * Persist a newly-created task record. The store SHOULD honor `expiresAt`
24
+ * as TTL for automatic cleanup. Must fail if a record with the same
25
+ * `taskId` already exists (taskId collisions are a bug upstream).
26
+ */
27
+ create(record: TaskRecord): Promise<void>;
28
+ /**
29
+ * Fetch a task record. Returns `null` if:
30
+ * - the task does not exist
31
+ * - the task has expired
32
+ * - `sessionId` does not match the record's session (hard auth binding)
33
+ */
34
+ get(taskId: string, sessionId: string): Promise<TaskRecord | null>;
35
+ /**
36
+ * Apply a partial patch. Returns the updated record, or `null` if the task
37
+ * no longer exists / belongs to a different session. Implementations should
38
+ * treat this as a read-modify-write (no external CAS requirement).
39
+ */
40
+ update(taskId: string, sessionId: string, patch: Partial<TaskRecord>): Promise<TaskRecord | null>;
41
+ /**
42
+ * Delete a task record. No-op if not found.
43
+ */
44
+ delete(taskId: string, sessionId: string): Promise<void>;
45
+ /**
46
+ * List tasks owned by `sessionId`, paginated.
47
+ * Cursor format is opaque to callers; implementations define their own.
48
+ */
49
+ list(sessionId: string, opts?: {
50
+ cursor?: string;
51
+ pageSize?: number;
52
+ }): Promise<TaskListPage>;
53
+ /**
54
+ * Subscribe for a one-shot terminal notification on the given task.
55
+ * Called once the store observes a terminal status.
56
+ */
57
+ subscribeTerminal(taskId: string, sessionId: string, cb: TaskTerminalCallback): Promise<TaskUnsubscribe>;
58
+ /**
59
+ * Publish a terminal state change. MUST be called after the backing record
60
+ * has been updated to a terminal status.
61
+ */
62
+ publishTerminal(record: TaskRecord): Promise<void>;
63
+ /**
64
+ * Subscribe for cancellation signals. Used by the node running the task to
65
+ * react to a `tasks/cancel` that arrived at a different node.
66
+ */
67
+ subscribeCancel(taskId: string, sessionId: string, cb: TaskCancelCallback): Promise<TaskUnsubscribe>;
68
+ /**
69
+ * Broadcast a cancellation signal. The authoritative state transition to
70
+ * `cancelled` still happens in the flow layer via `update()`.
71
+ */
72
+ publishCancel(taskId: string, sessionId: string): Promise<void>;
73
+ /** Optional teardown hook called during server shutdown. */
74
+ destroy?(): Promise<void>;
75
+ }
76
+ //# sourceMappingURL=task.store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.store.d.ts","sourceRoot":"","sources":["../../../src/task/store/task.store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,8DAA8D;AAC9D,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;AAEhE,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC;AAE5C,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAElD,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1C;;;;;OAKG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAEnE;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAElG;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;;OAGG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAE9F;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEzG;;;OAGG;IACH,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAErG;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE,4DAA4D;IAC5D,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Scope-level helper for projecting the `tasks` server capability.
3
+ *
4
+ * Computed inputs:
5
+ * - `hasTaskEnabledTool` — any tool with `execution.taskSupport != 'forbidden'`.
6
+ * - `canIdentifyRequestors` — scope has auth configured (so per-session
7
+ * binding is enforceable, gating the optional `tasks.list` capability).
8
+ *
9
+ * Kept here (and not on the scope class) so transport adapters that build
10
+ * capabilities inline (local adapter, in-memory server) can reuse the same
11
+ * logic without depending on TaskRegistry internals.
12
+ *
13
+ * @module task/task-scope.helper
14
+ */
15
+ import type { ServerCapabilities } from '@frontmcp/protocol';
16
+ import type { ScopeEntry } from '../common';
17
+ export declare function computeTaskCapabilities(scope: ScopeEntry): Partial<ServerCapabilities>;
18
+ //# sourceMappingURL=task-scope.helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-scope.helper.d.ts","sourceRoot":"","sources":["../../src/task/task-scope.helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAYtF"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * TaskRegistry — in-process bookkeeping for background task execution.
3
+ *
4
+ * Responsibilities:
5
+ * - Track AbortControllers for tasks currently running on this node so that
6
+ * `tasks/cancel` can signal them synchronously without a round-trip.
7
+ * - Compute the server's `tasks` capability for the MCP `initialize` response.
8
+ *
9
+ * Cross-node cancel signalling (when the cancel request lands on a different
10
+ * node than the one running the task) is handled by `TaskStore.subscribeCancel`
11
+ * + `publishCancel`, which is wired in `task-runner.ts`.
12
+ *
13
+ * @module task/task.registry
14
+ */
15
+ import type { ServerCapabilities } from '@frontmcp/protocol';
16
+ import type { FrontMcpLogger } from '../common';
17
+ import type { TaskRunner } from './helpers/task-runner.types';
18
+ import type { TasksConfig } from './task.types';
19
+ /**
20
+ * Snapshot the registry uses to decide whether to advertise the `tasks`
21
+ * capability. Kept minimal so it can be refreshed cheaply when tool metadata
22
+ * changes.
23
+ */
24
+ export interface TaskCapabilityInputs {
25
+ /**
26
+ * Whether any currently-registered tool declares `execution.taskSupport` other
27
+ * than `'forbidden'`. When false, the server does not advertise task support.
28
+ */
29
+ hasTaskEnabledTool: boolean;
30
+ /**
31
+ * Whether the current auth context can identify requestors. When false, the
32
+ * `tasks.list` capability is suppressed per spec §Security.
33
+ */
34
+ canIdentifyRequestors: boolean;
35
+ }
36
+ export declare class TaskRegistry {
37
+ private readonly abortControllers;
38
+ private readonly logger?;
39
+ private readonly config;
40
+ private _runner?;
41
+ constructor(config?: TasksConfig, logger?: FrontMcpLogger);
42
+ /** Assign the runner used to execute task-augmented tool calls. */
43
+ setRunner(runner: TaskRunner): void;
44
+ /** Current runner (in-process or CLI), set by the scope during init. */
45
+ get runner(): TaskRunner | undefined;
46
+ /** Register an AbortController for a running task on this node. */
47
+ trackRunning(taskId: string): AbortController;
48
+ /** Untrack a task once it leaves `working`/`input_required`. */
49
+ untrack(taskId: string): void;
50
+ /** Returns true if the task is running on this node and abort was fired. */
51
+ abort(taskId: string, reason?: string): boolean;
52
+ /** Count currently running tasks (for limits checks). */
53
+ runningCount(): number;
54
+ /** Access the tasks config for defaults/limits. */
55
+ getConfig(): TasksConfig;
56
+ /**
57
+ * Compute the MCP server capabilities contribution for tasks per
58
+ * 2025-11-25 §Capabilities.
59
+ *
60
+ * Advertises:
61
+ * - `tasks.requests.tools.call` — when any tool declares taskSupport.
62
+ * - `tasks.cancel` — always, when the feature is enabled.
63
+ * - `tasks.list` — only when requestors can be identified (otherwise
64
+ * listing would leak task metadata per spec §Security).
65
+ */
66
+ getCapabilities(inputs: TaskCapabilityInputs): Partial<ServerCapabilities>;
67
+ }
68
+ //# sourceMappingURL=task.registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.registry.d.ts","sourceRoot":"","sources":["../../src/task/task.registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsC;IACvE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,OAAO,CAAC,CAAa;gBAEjB,MAAM,GAAE,WAAgB,EAAE,MAAM,CAAC,EAAE,cAAc;IAK7D,mEAAmE;IACnE,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAInC,wEAAwE;IACxE,IAAI,MAAM,IAAI,UAAU,GAAG,SAAS,CAEnC;IAED,mEAAmE;IACnE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe;IAM7C,gEAAgE;IAChE,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI7B,4EAA4E;IAC5E,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO;IAc/C,yDAAyD;IACzD,YAAY,IAAI,MAAM;IAItB,mDAAmD;IACnD,SAAS,IAAI,WAAW;IAIxB;;;;;;;;;OASG;IACH,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAY3E"}
@@ -0,0 +1,201 @@
1
+ /**
2
+ * Task types for MCP 2025-11-25 background tasks support.
3
+ *
4
+ * See: https://modelcontextprotocol.io/specification/2025-11-25/basic/utilities/tasks
5
+ *
6
+ * All protocol-facing Zod schemas are re-exported from `@frontmcp/protocol`,
7
+ * which is the single boundary between FrontMCP internals and the upstream
8
+ * MCP protocol package. This module defines the server-side record shape
9
+ * used by the TaskStore and runtime.
10
+ *
11
+ * @module task/task.types
12
+ */
13
+ import type { CallToolResult, TaskStatus } from '@frontmcp/protocol';
14
+ import type { RedisOptionsInput } from '../common';
15
+ /**
16
+ * Default task configuration values, used when the server doesn't set them
17
+ * and clients don't request specific values.
18
+ */
19
+ export declare const TASK_DEFAULTS: {
20
+ readonly defaultTtlMs: 3600000;
21
+ readonly maxTtlMs: 86400000;
22
+ readonly defaultPollIntervalMs: 2000;
23
+ readonly maxConcurrentPerSession: 16;
24
+ };
25
+ /**
26
+ * The `io.modelcontextprotocol/related-task` _meta key per MCP spec.
27
+ */
28
+ export declare const RELATED_TASK_META_KEY: "io.modelcontextprotocol/related-task";
29
+ /**
30
+ * The JSON-RPC shape we persist when the underlying request completed with an
31
+ * error. `tasks/result` MUST return exactly this error to the client.
32
+ */
33
+ export interface TaskJsonRpcError {
34
+ code: number;
35
+ message: string;
36
+ data?: unknown;
37
+ }
38
+ /**
39
+ * Terminal outcome of a task, captured once the underlying request finishes.
40
+ * `kind` discriminates between a successful result payload (for a tools/call task
41
+ * this is a `CallToolResult`) and a JSON-RPC error.
42
+ */
43
+ export type TaskOutcome = {
44
+ kind: 'ok';
45
+ data: CallToolResult;
46
+ } | {
47
+ kind: 'error';
48
+ error: TaskJsonRpcError;
49
+ };
50
+ /**
51
+ * The record persisted in the TaskStore. Keyed by `(sessionId, taskId)`.
52
+ *
53
+ * `status` follows the MCP lifecycle: `working` ↔ `input_required` → terminal
54
+ * (`completed` | `failed` | `cancelled`). Transitions are enforced at the
55
+ * flow/runtime layer, not by the store.
56
+ */
57
+ export interface TaskRecord {
58
+ /** Cryptographically-secure, receiver-generated identifier. */
59
+ taskId: string;
60
+ /** Auth context binding — tasks are only visible within their owning session. */
61
+ sessionId: string;
62
+ /** Current state of the task execution. */
63
+ status: TaskStatus;
64
+ /** Optional human-readable status string (used for failures, cancellations). */
65
+ statusMessage?: string;
66
+ /** ISO 8601 timestamp when the task was created. */
67
+ createdAt: string;
68
+ /** ISO 8601 timestamp of the last state transition. */
69
+ lastUpdatedAt: string;
70
+ /**
71
+ * Task lifetime in milliseconds from creation. `null` means unlimited (server
72
+ * may still delete at its discretion). The receiver MAY clamp a client's
73
+ * requested TTL down to `TasksConfig.maxTtlMs`.
74
+ */
75
+ ttlMs: number | null;
76
+ /** Suggested polling interval in milliseconds (hint to the client). */
77
+ pollIntervalMs?: number;
78
+ /** Absolute epoch ms after which the store may delete this record. */
79
+ expiresAt: number;
80
+ /**
81
+ * The JSON-RPC method + params this task is wrapping. Only `tools/call` is
82
+ * supported in this iteration (see roadmap).
83
+ */
84
+ request: {
85
+ method: 'tools/call';
86
+ params: Record<string, unknown>;
87
+ };
88
+ /**
89
+ * Populated once `status` reaches a terminal state. Undefined while the task
90
+ * is `working` or `input_required`.
91
+ */
92
+ outcome?: TaskOutcome;
93
+ /**
94
+ * Progress token carried from the request's `_meta`. Remains valid for the
95
+ * duration of the task per spec.
96
+ */
97
+ progressToken?: string | number;
98
+ /**
99
+ * Identifies the runtime executing the task so we can orphan-detect and
100
+ * cross-process cancel.
101
+ *
102
+ * - `host: 'in-process'` — the same Node server that created the task.
103
+ * - `host: 'cli'` — a detached child process spawned by `CliTaskRunner`.
104
+ * `pid` is the child's PID; `spawnedAt` the launch timestamp.
105
+ */
106
+ executor?: {
107
+ host: 'in-process' | 'cli';
108
+ pid?: number;
109
+ spawnedAt?: string;
110
+ };
111
+ }
112
+ /**
113
+ * Projection of a TaskRecord to the MCP `Task` wire shape (what `tasks/get`,
114
+ * `tasks/list`, and `CreateTaskResult.task` return).
115
+ */
116
+ export interface TaskWireShape {
117
+ taskId: string;
118
+ status: TaskStatus;
119
+ ttl: number | null;
120
+ createdAt: string;
121
+ lastUpdatedAt: string;
122
+ pollInterval?: number;
123
+ statusMessage?: string;
124
+ }
125
+ export declare function toWireShape(record: TaskRecord): TaskWireShape;
126
+ export declare function isTerminal(status: TaskStatus): boolean;
127
+ /**
128
+ * Server-side configuration for the tasks subsystem. Wired in `@FrontMcp({ tasks: ... })`.
129
+ */
130
+ export interface TasksConfig {
131
+ /** Enable tasks. Defaults to true when any tool declares execution.taskSupport. */
132
+ enabled?: boolean;
133
+ /** Default TTL (ms) when the client doesn't request one. */
134
+ defaultTtlMs?: number;
135
+ /** Hard cap on TTL; client-requested values above this are clamped down. */
136
+ maxTtlMs?: number;
137
+ /** Suggested poll interval reported to clients. */
138
+ defaultPollIntervalMs?: number;
139
+ /** Maximum concurrent task records per session. */
140
+ maxConcurrentPerSession?: number;
141
+ /** Key prefix for the store. Default: 'mcp:task:'. */
142
+ keyPrefix?: string;
143
+ /**
144
+ * Redis/Upstash backend options. When set, the task store is backed by the
145
+ * `@frontmcp/utils` storage abstraction in pub/sub-capable mode, suitable for
146
+ * multi-node HA deployments. Mutually exclusive with `sqlite`.
147
+ */
148
+ redis?: RedisOptionsInput;
149
+ /**
150
+ * Throw at startup instead of warning when the runtime cannot run tasks
151
+ * reliably (edge/serverless with the in-process runner). Default `false`.
152
+ */
153
+ strict?: boolean;
154
+ /**
155
+ * Runner selection:
156
+ * - `'in-process'` (default): tasks run on the current Node event loop.
157
+ * Ideal for long-lived servers.
158
+ * - `'cli'`: tasks run in a detached child process spawned by the current
159
+ * executable. Required when the parent process cannot guarantee it'll
160
+ * outlive the task (short-lived CLI hosts, per-request serverless with
161
+ * a queue fronting it, etc.). MUST pair with a persistent `tasks.sqlite`
162
+ * or `tasks.redis` backend so the worker and host can read each other's
163
+ * state.
164
+ */
165
+ runner?: 'in-process' | 'cli';
166
+ /**
167
+ * SQLite task-store options. When set, the task store is backed by SQLite
168
+ * instead of the default @frontmcp/utils memory/Redis/Upstash storage.
169
+ * This is the only option that survives across CLI invocations.
170
+ */
171
+ sqlite?: {
172
+ /** Path to the SQLite database file. */
173
+ path: string;
174
+ /** Optional encryption secret (derives AES-256 key). */
175
+ encryption?: {
176
+ secret: string;
177
+ };
178
+ /** Enable WAL journal mode. Default: `true`. */
179
+ walMode?: boolean;
180
+ /** Periodic TTL cleanup interval in ms. Default: 60000. */
181
+ ttlCleanupIntervalMs?: number;
182
+ };
183
+ /**
184
+ * Command used by the CLI task runner to spawn detached child processes.
185
+ * When unset, the runner attempts to re-invoke the currently-running
186
+ * executable (`process.argv[0]` + `process.argv[1]`).
187
+ *
188
+ * Override when the FrontMCP entrypoint isn't on the default argv — e.g.,
189
+ * in tests or bundled CLI distributions.
190
+ *
191
+ * Example:
192
+ * ```ts
193
+ * cliRunnerCommand: { exe: 'node', args: ['./dist/server.js'] }
194
+ * ```
195
+ */
196
+ cliRunnerCommand?: {
197
+ exe: string;
198
+ args?: string[];
199
+ };
200
+ }
201
+ //# sourceMappingURL=task.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.types.d.ts","sourceRoot":"","sources":["../../src/task/task.types.ts"],"names":[],"mappings":"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"}