@frontmcp/sdk 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (896) hide show
  1. package/README.md +81 -99
  2. package/package.json +24 -2
  3. package/src/adapter/adapter.instance.d.ts +11 -0
  4. package/src/adapter/adapter.instance.js +65 -0
  5. package/src/adapter/adapter.instance.js.map +1 -0
  6. package/src/adapter/adapter.regsitry.d.ts +13 -0
  7. package/src/adapter/adapter.regsitry.js +54 -0
  8. package/src/adapter/adapter.regsitry.js.map +1 -0
  9. package/src/adapter/adapter.utils.d.ts +10 -0
  10. package/src/adapter/adapter.utils.js +83 -0
  11. package/src/adapter/adapter.utils.js.map +1 -0
  12. package/src/app/app.registry.d.ts +12 -0
  13. package/src/app/app.registry.js +64 -0
  14. package/src/app/app.registry.js.map +1 -0
  15. package/src/app/app.utils.d.ts +15 -0
  16. package/src/app/app.utils.js +58 -0
  17. package/src/app/app.utils.js.map +1 -0
  18. package/src/app/instances/app.local.instance.d.ts +25 -0
  19. package/src/app/instances/app.local.instance.js +70 -0
  20. package/src/app/instances/app.local.instance.js.map +1 -0
  21. package/src/app/instances/app.remote.instance.d.ts +13 -0
  22. package/src/app/instances/app.remote.instance.js +36 -0
  23. package/src/app/instances/app.remote.instance.js.map +1 -0
  24. package/src/app/instances/index.d.ts +2 -0
  25. package/src/app/instances/index.js +6 -0
  26. package/src/app/instances/index.js.map +1 -0
  27. package/src/auth/auth.registry.d.ts +13 -0
  28. package/src/auth/auth.registry.js +81 -0
  29. package/src/auth/auth.registry.js.map +1 -0
  30. package/src/auth/auth.utils.d.ts +10 -0
  31. package/src/auth/auth.utils.js +85 -0
  32. package/src/auth/auth.utils.js.map +1 -0
  33. package/src/auth/flows/oauth.authorize.flow.d.ts +231 -0
  34. package/src/auth/flows/oauth.authorize.flow.js +154 -0
  35. package/src/auth/flows/oauth.authorize.flow.js.map +1 -0
  36. package/src/auth/flows/oauth.register.flow.d.ts +202 -0
  37. package/src/auth/flows/oauth.register.flow.js +201 -0
  38. package/src/auth/flows/oauth.register.flow.js.map +1 -0
  39. package/src/auth/flows/oauth.token.flow.d.ts +242 -0
  40. package/src/auth/flows/oauth.token.flow.js +181 -0
  41. package/src/auth/flows/oauth.token.flow.js.map +1 -0
  42. package/src/auth/flows/session.verify.flow.d.ts +404 -0
  43. package/src/auth/flows/session.verify.flow.js +205 -0
  44. package/src/auth/flows/session.verify.flow.js.map +1 -0
  45. package/src/auth/flows/well-known.jwks.flow.d.ts +261 -0
  46. package/src/auth/flows/well-known.jwks.flow.js +82 -0
  47. package/src/auth/flows/well-known.jwks.flow.js.map +1 -0
  48. package/src/auth/flows/well-known.oauth-authorization-server.flow.d.ts +282 -0
  49. package/src/auth/flows/well-known.oauth-authorization-server.flow.js +123 -0
  50. package/src/auth/flows/well-known.oauth-authorization-server.flow.js.map +1 -0
  51. package/src/auth/flows/well-known.prm.flow.d.ts +159 -0
  52. package/src/auth/flows/well-known.prm.flow.js +107 -0
  53. package/src/auth/flows/well-known.prm.flow.js.map +1 -0
  54. package/src/auth/instances/instance.local-primary-auth.d.ts +19 -0
  55. package/src/auth/instances/instance.local-primary-auth.js +76 -0
  56. package/src/auth/instances/instance.local-primary-auth.js.map +1 -0
  57. package/src/auth/instances/instance.remote-primary-auth.d.ts +14 -0
  58. package/src/auth/instances/instance.remote-primary-auth.js +47 -0
  59. package/src/auth/instances/instance.remote-primary-auth.js.map +1 -0
  60. package/src/auth/jwks/index.d.ts +2 -0
  61. package/src/auth/jwks/index.js +6 -0
  62. package/src/auth/jwks/index.js.map +1 -0
  63. package/src/auth/jwks/jwks.service.d.ts +41 -0
  64. package/src/auth/jwks/jwks.service.js +235 -0
  65. package/src/auth/jwks/jwks.service.js.map +1 -0
  66. package/src/auth/jwks/jwks.types.d.ts +25 -0
  67. package/src/auth/jwks/jwks.types.js +3 -0
  68. package/src/auth/jwks/jwks.types.js.map +1 -0
  69. package/src/auth/jwks/jwks.utils.d.ts +4 -0
  70. package/src/auth/jwks/jwks.utils.js +32 -0
  71. package/src/auth/jwks/jwks.utils.js.map +1 -0
  72. package/src/auth/oauth/flows/oauth.authorize.flow.d.ts +31 -0
  73. package/src/auth/oauth/flows/oauth.authorize.flow.js +33 -0
  74. package/src/auth/oauth/flows/oauth.authorize.flow.js.map +1 -0
  75. package/src/auth/oauth/flows/oauth.device-authorization.flow.d.ts +46 -0
  76. package/src/auth/oauth/flows/oauth.device-authorization.flow.js +48 -0
  77. package/src/auth/oauth/flows/oauth.device-authorization.flow.js.map +1 -0
  78. package/src/auth/oauth/flows/oauth.introspect.flow.d.ts +26 -0
  79. package/src/auth/oauth/flows/oauth.introspect.flow.js +28 -0
  80. package/src/auth/oauth/flows/oauth.introspect.flow.js.map +1 -0
  81. package/src/auth/oauth/flows/oauth.par.flow.d.ts +27 -0
  82. package/src/auth/oauth/flows/oauth.par.flow.js +29 -0
  83. package/src/auth/oauth/flows/oauth.par.flow.js.map +1 -0
  84. package/src/auth/oauth/flows/oauth.revoke.flow.d.ts +25 -0
  85. package/src/auth/oauth/flows/oauth.revoke.flow.js +27 -0
  86. package/src/auth/oauth/flows/oauth.revoke.flow.js.map +1 -0
  87. package/src/auth/oauth/flows/oauth.token.flow.d.ts +57 -0
  88. package/src/auth/oauth/flows/oauth.token.flow.js +59 -0
  89. package/src/auth/oauth/flows/oauth.token.flow.js.map +1 -0
  90. package/src/auth/oauth/flows/oauth.userinfo.flow.d.ts +22 -0
  91. package/src/auth/oauth/flows/oauth.userinfo.flow.js +24 -0
  92. package/src/auth/oauth/flows/oauth.userinfo.flow.js.map +1 -0
  93. package/src/auth/oauth/flows/oidc.logout.flow.d.ts +18 -0
  94. package/src/auth/oauth/flows/oidc.logout.flow.js +20 -0
  95. package/src/auth/oauth/flows/oidc.logout.flow.js.map +1 -0
  96. package/src/auth/path.utils.d.ts +20 -0
  97. package/src/auth/path.utils.js +71 -0
  98. package/src/auth/path.utils.js.map +1 -0
  99. package/src/auth/session/index.d.ts +4 -0
  100. package/src/auth/session/index.js +10 -0
  101. package/src/auth/session/index.js.map +1 -0
  102. package/src/auth/session/record/session.base.d.ts +103 -0
  103. package/src/auth/session/record/session.base.js +123 -0
  104. package/src/auth/session/record/session.base.js.map +1 -0
  105. package/src/auth/session/record/session.stateful.d.ts +20 -0
  106. package/src/auth/session/record/session.stateful.js +55 -0
  107. package/src/auth/session/record/session.stateful.js.map +1 -0
  108. package/src/auth/session/record/session.stateless.d.ts +17 -0
  109. package/src/auth/session/record/session.stateless.js +30 -0
  110. package/src/auth/session/record/session.stateless.js.map +1 -0
  111. package/src/auth/session/record/session.transparent.d.ts +17 -0
  112. package/src/auth/session/record/session.transparent.js +22 -0
  113. package/src/auth/session/record/session.transparent.js.map +1 -0
  114. package/src/auth/session/session.crypto.d.ts +7 -0
  115. package/src/auth/session/session.crypto.js +47 -0
  116. package/src/auth/session/session.crypto.js.map +1 -0
  117. package/src/auth/session/session.schema.d.ts +5 -0
  118. package/src/auth/session/session.schema.js +13 -0
  119. package/src/auth/session/session.schema.js.map +1 -0
  120. package/src/auth/session/session.service.d.ts +17 -0
  121. package/src/auth/session/session.service.js +111 -0
  122. package/src/auth/session/session.service.js.map +1 -0
  123. package/src/auth/session/session.transport.d.ts +4 -0
  124. package/src/auth/session/session.transport.js +20 -0
  125. package/src/auth/session/session.transport.js.map +1 -0
  126. package/src/auth/session/session.types.d.ts +65 -0
  127. package/src/auth/session/session.types.js +4 -0
  128. package/src/auth/session/session.types.js.map +1 -0
  129. package/src/auth/session/token.refresh.d.ts +60 -0
  130. package/src/auth/session/token.refresh.js +63 -0
  131. package/src/auth/session/token.refresh.js.map +1 -0
  132. package/src/auth/session/token.store.d.ts +35 -0
  133. package/src/auth/session/token.store.js +53 -0
  134. package/src/auth/session/token.store.js.map +1 -0
  135. package/src/auth/session/token.vault.d.ts +26 -0
  136. package/src/auth/session/token.vault.js +54 -0
  137. package/src/auth/session/token.vault.js.map +1 -0
  138. package/src/auth/session/utils/auth-token.utils.d.ts +11 -0
  139. package/src/auth/session/utils/auth-token.utils.js +57 -0
  140. package/src/auth/session/utils/auth-token.utils.js.map +1 -0
  141. package/src/auth/session/utils/session-id.utils.d.ts +17 -0
  142. package/src/auth/session/utils/session-id.utils.js +129 -0
  143. package/src/auth/session/utils/session-id.utils.js.map +1 -0
  144. package/src/auth/session/utils/tiny-ttl-cache.d.ts +7 -0
  145. package/src/auth/session/utils/tiny-ttl-cache.js +26 -0
  146. package/src/auth/session/utils/tiny-ttl-cache.js.map +1 -0
  147. package/src/common/common.schema.d.ts +29 -0
  148. package/src/common/common.schema.js +35 -0
  149. package/src/common/common.schema.js.map +1 -0
  150. package/src/common/constants.d.ts +2 -0
  151. package/src/common/constants.js +8 -0
  152. package/src/common/constants.js.map +1 -0
  153. package/src/common/decorators/adapter.decorator.js.map +1 -0
  154. package/src/common/decorators/app.decorator.js.map +1 -0
  155. package/src/common/decorators/auth-provider.decorator.js.map +1 -0
  156. package/src/common/decorators/flow.decorator.js.map +1 -0
  157. package/src/common/decorators/front-mcp.decorator.js +40 -0
  158. package/src/common/decorators/front-mcp.decorator.js.map +1 -0
  159. package/src/common/decorators/hook.decorator.js.map +1 -0
  160. package/src/common/decorators/index.js.map +1 -0
  161. package/src/common/decorators/logger.decorator.js.map +1 -0
  162. package/src/common/decorators/plugin.decorator.js.map +1 -0
  163. package/src/common/decorators/prompt.decorator.js.map +1 -0
  164. package/src/common/decorators/provider.decorator.js.map +1 -0
  165. package/src/common/decorators/resource.decorator.js.map +1 -0
  166. package/src/common/decorators/tool.decorator.d.ts +42 -0
  167. package/src/common/decorators/tool.decorator.js +46 -0
  168. package/src/common/decorators/tool.decorator.js.map +1 -0
  169. package/src/common/decorators-old/async-with.decorator.d.ts +10 -0
  170. package/src/common/decorators-old/async-with.decorator.js +24 -0
  171. package/src/common/decorators-old/async-with.decorator.js.map +1 -0
  172. package/src/common/decorators-old/auth-hook.decorator.js.map +1 -0
  173. package/src/common/decorators-old/session-hook.decorator.js.map +1 -0
  174. package/src/common/dynamic/dynamic.adapter.js.map +1 -0
  175. package/src/common/dynamic/dynamic.plugin.js.map +1 -0
  176. package/src/common/dynamic/dynamic.utils.d.ts +3 -0
  177. package/src/common/dynamic/dynamic.utils.js.map +1 -0
  178. package/src/common/dynamic/index.js.map +1 -0
  179. package/src/common/entries/adapter.entry.js.map +1 -0
  180. package/src/common/entries/app.entry.d.ts +13 -0
  181. package/src/common/entries/app.entry.js.map +1 -0
  182. package/src/common/entries/auth-provider.entry.js.map +1 -0
  183. package/src/common/entries/base.entry.js.map +1 -0
  184. package/src/common/entries/flow.entry.js.map +1 -0
  185. package/src/common/entries/hook.entry.js.map +1 -0
  186. package/src/common/entries/index.js.map +1 -0
  187. package/src/common/entries/logger.entry.js.map +1 -0
  188. package/src/common/entries/plugin.entry.js.map +1 -0
  189. package/src/common/entries/prompt.entry.js.map +1 -0
  190. package/src/common/entries/provider.entry.js.map +1 -0
  191. package/src/common/entries/resource.entry.js.map +1 -0
  192. package/src/common/entries/scope.entry.js.map +1 -0
  193. package/src/common/entries/tool.entry.js.map +1 -0
  194. package/src/common/index.d.ts +17 -0
  195. package/src/common/index.js +21 -0
  196. package/src/common/index.js.map +1 -0
  197. package/src/common/interfaces/adapter.interface.js.map +1 -0
  198. package/src/common/interfaces/app.interface.js.map +1 -0
  199. package/src/common/interfaces/auth-hook.interface.js.map +1 -0
  200. package/src/common/interfaces/auth-provider.interface.js.map +1 -0
  201. package/src/common/interfaces/base.interface.js.map +1 -0
  202. package/src/common/interfaces/flow.interface.d.ts +41 -0
  203. package/src/common/interfaces/flow.interface.js.map +1 -0
  204. package/src/common/interfaces/front-mcp.interface.js.map +1 -0
  205. package/src/common/interfaces/hook.interface.js.map +1 -0
  206. package/src/common/interfaces/index.js.map +1 -0
  207. package/src/common/interfaces/internal/flow.utils.d.ts +23 -0
  208. package/src/common/interfaces/internal/flow.utils.js.map +1 -0
  209. package/src/common/interfaces/internal/index.js.map +1 -0
  210. package/src/common/interfaces/internal/primary-auth-provider.interface.d.ts +24 -0
  211. package/src/common/interfaces/internal/primary-auth-provider.interface.js.map +1 -0
  212. package/src/common/interfaces/internal/registry.interface.d.ts +95 -0
  213. package/src/common/interfaces/internal/registry.interface.js.map +1 -0
  214. package/src/common/interfaces/logger.interface.js.map +1 -0
  215. package/src/common/interfaces/plugin.interface.js.map +1 -0
  216. package/src/common/interfaces/prompt.interface.js.map +1 -0
  217. package/src/common/interfaces/provider.interface.js.map +1 -0
  218. package/src/common/interfaces/resource.interface.js.map +1 -0
  219. package/src/common/interfaces/scope.interface.js.map +1 -0
  220. package/src/common/interfaces/server.interface.js.map +1 -0
  221. package/src/common/interfaces/session-hook.interface.js.map +1 -0
  222. package/src/common/interfaces/tool-hook.interface.js.map +1 -0
  223. package/src/common/interfaces/tool.interface.js.map +1 -0
  224. package/src/common/metadata/adapter.metadata.js.map +1 -0
  225. package/src/common/metadata/app.metadata.d.ts +872 -0
  226. package/src/common/metadata/app.metadata.js.map +1 -0
  227. package/src/common/metadata/auth-provider.metadata.js.map +1 -0
  228. package/src/common/metadata/flow.metadata.d.ts +77 -0
  229. package/src/common/metadata/flow.metadata.js.map +1 -0
  230. package/src/common/metadata/front-mcp.metadata.d.ts +1144 -0
  231. package/src/common/metadata/front-mcp.metadata.js.map +1 -0
  232. package/src/common/metadata/hook.metadata.js.map +1 -0
  233. package/src/common/metadata/index.js.map +1 -0
  234. package/src/common/metadata/logger.metadata.js.map +1 -0
  235. package/src/common/metadata/plugin.metadata.js.map +1 -0
  236. package/src/common/metadata/prompt.metadata.js.map +1 -0
  237. package/src/common/metadata/provider.metadata.js.map +1 -0
  238. package/src/common/metadata/resource.metadata.js.map +1 -0
  239. package/src/common/metadata/tool.metadata.d.ts +178 -0
  240. package/src/common/metadata/tool.metadata.js.map +1 -0
  241. package/src/common/providers/session.provider.js.map +1 -0
  242. package/src/common/records/adapter.record.js.map +1 -0
  243. package/src/common/records/app.record.js.map +1 -0
  244. package/src/common/records/auth-provider.record.js.map +1 -0
  245. package/src/common/records/flow.record.js.map +1 -0
  246. package/src/common/records/hook.record.js.map +1 -0
  247. package/src/common/records/index.js.map +1 -0
  248. package/src/common/records/logger.record.d.ts +11 -0
  249. package/src/common/records/logger.record.js.map +1 -0
  250. package/src/common/records/plugin.record.js.map +1 -0
  251. package/src/common/records/prompt.record.js.map +1 -0
  252. package/src/common/records/provider.record.js.map +1 -0
  253. package/src/common/records/resource.record.js.map +1 -0
  254. package/src/common/records/scope.record.js.map +1 -0
  255. package/src/common/records/tool.record.js.map +1 -0
  256. package/src/common/schemas/annotated-class.schema.js.map +1 -0
  257. package/src/common/schemas/http-input.schema.js.map +1 -0
  258. package/src/common/schemas/http-output.schema.d.ts +2011 -0
  259. package/src/common/schemas/http-output.schema.js.map +1 -0
  260. package/src/common/schemas/index.js.map +1 -0
  261. package/src/common/tokens/adapter.tokens.js.map +1 -0
  262. package/src/common/tokens/app.tokens.js.map +1 -0
  263. package/src/common/tokens/auth-provider.tokens.js.map +1 -0
  264. package/src/common/tokens/base.tokens.js.map +1 -0
  265. package/src/common/tokens/flow-hook.tokens.js.map +1 -0
  266. package/src/common/tokens/flow.tokens.js.map +1 -0
  267. package/src/common/tokens/front-mcp.tokens.js.map +1 -0
  268. package/src/common/tokens/index.js.map +1 -0
  269. package/src/common/tokens/logger.tokens.js.map +1 -0
  270. package/src/common/tokens/plugin.tokens.js.map +1 -0
  271. package/src/common/tokens/prompt.tokens.js.map +1 -0
  272. package/src/common/tokens/provider.tokens.js.map +1 -0
  273. package/src/common/tokens/resource.tokens.js.map +1 -0
  274. package/src/common/tokens/server.tokens.js.map +1 -0
  275. package/src/common/tokens/tool.tokens.js.map +1 -0
  276. package/src/common/types/auth/index.js.map +1 -0
  277. package/src/common/types/auth/jwt.types.js.map +1 -0
  278. package/src/common/types/auth/session.types.d.ts +263 -0
  279. package/src/common/types/auth/session.types.js.map +1 -0
  280. package/src/common/types/common.types.js.map +1 -0
  281. package/src/common/types/index.js.map +1 -0
  282. package/src/common/types/options/auth.options.d.ts +513 -0
  283. package/src/common/types/options/auth.options.js.map +1 -0
  284. package/src/common/types/options/http.options.js.map +1 -0
  285. package/src/common/types/options/index.js.map +1 -0
  286. package/src/common/types/options/logging.options.d.ts +39 -0
  287. package/src/common/types/options/logging.options.js.map +1 -0
  288. package/src/common/types/options/server-info.options.d.ts +48 -0
  289. package/src/common/types/options/server-info.options.js.map +1 -0
  290. package/src/common/types/options/session.options.d.ts +67 -0
  291. package/src/common/types/options/session.options.js.map +1 -0
  292. package/src/common/utils/decide-request-intent.utils.d.ts +79 -0
  293. package/src/common/utils/decide-request-intent.utils.js.map +1 -0
  294. package/src/common/utils/index.js.map +1 -0
  295. package/src/common/utils/path.utils.d.ts +20 -0
  296. package/src/common/utils/path.utils.js.map +1 -0
  297. package/src/exceptions/mcp-exceptions/session-missing.exception.d.ts +3 -0
  298. package/src/exceptions/mcp-exceptions/session-missing.exception.js +11 -0
  299. package/src/exceptions/mcp-exceptions/session-missing.exception.js.map +1 -0
  300. package/src/exceptions/mcp-exceptions/unsupported-client-version.exception.d.ts +5 -0
  301. package/src/exceptions/mcp-exceptions/unsupported-client-version.exception.js +15 -0
  302. package/src/exceptions/mcp-exceptions/unsupported-client-version.exception.js.map +1 -0
  303. package/src/flows/flow.instance.d.ts +16 -0
  304. package/src/flows/flow.instance.js +332 -0
  305. package/src/flows/flow.instance.js.map +1 -0
  306. package/src/flows/flow.registry.d.ts +14 -0
  307. package/src/flows/flow.registry.js +79 -0
  308. package/src/flows/flow.registry.js.map +1 -0
  309. package/src/flows/flow.stages.d.ts +12 -0
  310. package/src/flows/flow.stages.js +110 -0
  311. package/src/flows/flow.stages.js.map +1 -0
  312. package/src/flows/flow.utils.d.ts +8 -0
  313. package/src/flows/flow.utils.js +36 -0
  314. package/src/flows/flow.utils.js.map +1 -0
  315. package/src/front-mcp/front-mcp.d.ts +12 -0
  316. package/src/front-mcp/front-mcp.js +44 -0
  317. package/src/front-mcp/front-mcp.js.map +1 -0
  318. package/src/front-mcp/front-mcp.providers.d.ts +198 -0
  319. package/src/front-mcp/front-mcp.providers.js +30 -0
  320. package/src/front-mcp/front-mcp.providers.js.map +1 -0
  321. package/src/front-mcp/front-mcp.tokens.d.ts +2 -0
  322. package/src/front-mcp/front-mcp.tokens.js +5 -0
  323. package/src/front-mcp/front-mcp.tokens.js.map +1 -0
  324. package/src/front-mcp/index.d.ts +1 -0
  325. package/src/front-mcp/index.js +5 -0
  326. package/src/front-mcp/index.js.map +1 -0
  327. package/src/hooks/hook.instance.d.ts +7 -0
  328. package/src/hooks/hook.instance.js +23 -0
  329. package/src/hooks/hook.instance.js.map +1 -0
  330. package/src/hooks/hook.registry.d.ts +34 -0
  331. package/src/hooks/hook.registry.js +138 -0
  332. package/src/hooks/hook.registry.js.map +1 -0
  333. package/src/hooks/hooks.utils.d.ts +3 -0
  334. package/src/hooks/hooks.utils.js +27 -0
  335. package/src/hooks/hooks.utils.js.map +1 -0
  336. package/src/index.d.ts +21 -18
  337. package/src/index.js +9 -18
  338. package/src/index.js.map +1 -1
  339. package/src/logger/instances/instance.console-logger.d.ts +10 -0
  340. package/src/logger/instances/instance.console-logger.js +75 -0
  341. package/src/logger/instances/instance.console-logger.js.map +1 -0
  342. package/src/logger/instances/instance.logger.d.ts +24 -0
  343. package/src/logger/instances/instance.logger.js +77 -0
  344. package/src/logger/instances/instance.logger.js.map +1 -0
  345. package/src/logger/logger.registry.d.ts +13 -0
  346. package/src/logger/logger.registry.js +91 -0
  347. package/src/logger/logger.registry.js.map +1 -0
  348. package/src/logger/logger.tokens.d.ts +1 -0
  349. package/src/logger/logger.tokens.js +3 -0
  350. package/src/logger/logger.tokens.js.map +1 -0
  351. package/src/logger/logger.types.d.ts +10 -0
  352. package/src/logger/logger.types.js +8 -0
  353. package/src/logger/logger.types.js.map +1 -0
  354. package/src/logger/logger.utils.d.ts +15 -0
  355. package/src/logger/logger.utils.js +42 -0
  356. package/src/logger/logger.utils.js.map +1 -0
  357. package/src/plugin/plugin.registry.d.ts +24 -0
  358. package/src/plugin/plugin.registry.js +137 -0
  359. package/src/plugin/plugin.registry.js.map +1 -0
  360. package/src/plugin/plugin.utils.d.ts +10 -0
  361. package/src/plugin/plugin.utils.js +88 -0
  362. package/src/plugin/plugin.utils.js.map +1 -0
  363. package/src/prompt/prompt.registry.d.ts +16 -0
  364. package/src/prompt/prompt.registry.js +34 -0
  365. package/src/prompt/prompt.registry.js.map +1 -0
  366. package/src/provider/provider.registry.d.ts +75 -0
  367. package/src/provider/provider.registry.js +679 -0
  368. package/src/provider/provider.registry.js.map +1 -0
  369. package/src/provider/provider.types.d.ts +9 -0
  370. package/src/provider/provider.types.js +3 -0
  371. package/src/provider/provider.types.js.map +1 -0
  372. package/src/provider/provider.utils.d.ts +13 -0
  373. package/src/provider/provider.utils.js +103 -0
  374. package/src/provider/provider.utils.js.map +1 -0
  375. package/src/regsitry/index.d.ts +1 -0
  376. package/src/regsitry/index.js +5 -0
  377. package/src/regsitry/index.js.map +1 -0
  378. package/src/regsitry/registry.base.d.ts +25 -0
  379. package/src/regsitry/registry.base.js +32 -0
  380. package/src/regsitry/registry.base.js.map +1 -0
  381. package/src/resource/resource.registry.d.ts +15 -0
  382. package/src/resource/resource.registry.js +31 -0
  383. package/src/resource/resource.registry.js.map +1 -0
  384. package/src/scope/flows/http.request.flow.d.ts +384 -0
  385. package/src/scope/flows/http.request.flow.js +210 -0
  386. package/src/scope/flows/http.request.flow.js.map +1 -0
  387. package/src/scope/index.d.ts +1 -0
  388. package/src/scope/index.js +6 -0
  389. package/src/scope/index.js.map +1 -0
  390. package/src/scope/scope.instance.d.ts +35 -0
  391. package/src/scope/scope.instance.js +120 -0
  392. package/src/scope/scope.instance.js.map +1 -0
  393. package/src/scope/scope.registry.d.ts +10 -0
  394. package/src/scope/scope.registry.js +93 -0
  395. package/src/scope/scope.registry.js.map +1 -0
  396. package/src/scope/scope.utils.d.ts +13 -0
  397. package/src/scope/scope.utils.js +59 -0
  398. package/src/scope/scope.utils.js.map +1 -0
  399. package/src/server/adapters/base.host.adapter.d.ts +7 -0
  400. package/src/server/adapters/base.host.adapter.js +8 -0
  401. package/src/server/adapters/base.host.adapter.js.map +1 -0
  402. package/src/server/adapters/express.host.adapter.d.ts +12 -0
  403. package/src/server/adapters/express.host.adapter.js +50 -0
  404. package/src/server/adapters/express.host.adapter.js.map +1 -0
  405. package/src/server/server.instance.d.ts +12 -0
  406. package/src/server/server.instance.js +47 -0
  407. package/src/server/server.instance.js.map +1 -0
  408. package/src/server/server.types.d.ts +24 -0
  409. package/src/server/server.types.js +3 -0
  410. package/src/server/server.types.js.map +1 -0
  411. package/src/server/server.validation.d.ts +2 -0
  412. package/src/server/server.validation.js +192 -0
  413. package/src/server/server.validation.js.map +1 -0
  414. package/src/store/adapters/store.base.adapter.d.ts +21 -0
  415. package/src/store/adapters/store.base.adapter.js +16 -0
  416. package/src/store/adapters/store.base.adapter.js.map +1 -0
  417. package/src/store/adapters/store.memory.adapter.d.ts +26 -0
  418. package/src/store/adapters/store.memory.adapter.js +87 -0
  419. package/src/store/adapters/store.memory.adapter.js.map +1 -0
  420. package/src/store/adapters/store.redis.adapter.d.ts +33 -0
  421. package/src/store/adapters/store.redis.adapter.js +104 -0
  422. package/src/store/adapters/store.redis.adapter.js.map +1 -0
  423. package/src/store/index.d.ts +8 -0
  424. package/src/store/index.js +12 -0
  425. package/src/store/index.js.map +1 -0
  426. package/src/store/store.helpers.d.ts +9 -0
  427. package/src/store/store.helpers.js +67 -0
  428. package/src/store/store.helpers.js.map +1 -0
  429. package/src/store/store.registry.d.ts +13 -0
  430. package/src/store/store.registry.js +37 -0
  431. package/src/store/store.registry.js.map +1 -0
  432. package/src/store/store.tokens.d.ts +3 -0
  433. package/src/store/store.tokens.js +7 -0
  434. package/src/store/store.tokens.js.map +1 -0
  435. package/src/store/store.types.d.ts +64 -0
  436. package/src/store/store.types.js +11 -0
  437. package/src/store/store.types.js.map +1 -0
  438. package/src/store/store.utils.d.ts +8 -0
  439. package/src/store/store.utils.js +18 -0
  440. package/src/store/store.utils.js.map +1 -0
  441. package/src/tool/flows/call-tool.flow.d.ts +875 -0
  442. package/src/tool/flows/call-tool.flow.js +249 -0
  443. package/src/tool/flows/call-tool.flow.js.map +1 -0
  444. package/src/tool/flows/tools-list.flow.d.ts +771 -0
  445. package/src/tool/flows/tools-list.flow.js +149 -0
  446. package/src/tool/flows/tools-list.flow.js.map +1 -0
  447. package/src/tool/tool.events.d.ts +17 -0
  448. package/src/tool/tool.events.js +16 -0
  449. package/src/tool/tool.events.js.map +1 -0
  450. package/src/tool/tool.instance.d.ts +15 -0
  451. package/src/tool/tool.instance.js +68 -0
  452. package/src/tool/tool.instance.js.map +1 -0
  453. package/src/tool/tool.registry.d.ts +72 -0
  454. package/src/tool/tool.registry.js +339 -0
  455. package/src/tool/tool.registry.js.map +1 -0
  456. package/src/tool/tool.types.d.ts +25 -0
  457. package/src/tool/tool.types.js +10 -0
  458. package/src/tool/tool.types.js.map +1 -0
  459. package/src/tool/tool.utils.d.ts +20 -0
  460. package/src/tool/tool.utils.js +157 -0
  461. package/src/tool/tool.utils.js.map +1 -0
  462. package/src/transport/adapters/transport.local.adapter.d.ts +41 -0
  463. package/src/transport/adapters/transport.local.adapter.js +127 -0
  464. package/src/transport/adapters/transport.local.adapter.js.map +1 -0
  465. package/src/transport/adapters/transport.sse.adapter.d.ts +14 -0
  466. package/src/transport/adapters/transport.sse.adapter.js +63 -0
  467. package/src/transport/adapters/transport.sse.adapter.js.map +1 -0
  468. package/src/transport/adapters/transport.streamable-http.adapter.d.ts +13 -0
  469. package/src/transport/adapters/transport.streamable-http.adapter.js +65 -0
  470. package/src/transport/adapters/transport.streamable-http.adapter.js.map +1 -0
  471. package/src/transport/flows/handle.sse.flow.d.ts +92 -0
  472. package/src/transport/flows/handle.sse.flow.js +129 -0
  473. package/src/transport/flows/handle.sse.flow.js.map +1 -0
  474. package/src/transport/flows/handle.streamable-http.flow.d.ts +93 -0
  475. package/src/transport/flows/handle.streamable-http.flow.js +125 -0
  476. package/src/transport/flows/handle.streamable-http.flow.js.map +1 -0
  477. package/src/transport/legacy/legacy.sse.tranporter.d.ts +75 -0
  478. package/src/transport/legacy/legacy.sse.tranporter.js +170 -0
  479. package/src/transport/legacy/legacy.sse.tranporter.js.map +1 -0
  480. package/src/transport/mcp-handlers/Initialized-notification.hanlder.d.ts +3 -0
  481. package/src/transport/mcp-handlers/Initialized-notification.hanlder.js +14 -0
  482. package/src/transport/mcp-handlers/Initialized-notification.hanlder.js.map +1 -0
  483. package/src/transport/mcp-handlers/call-tool-request.handler.d.ts +3 -0
  484. package/src/transport/mcp-handlers/call-tool-request.handler.js +15 -0
  485. package/src/transport/mcp-handlers/call-tool-request.handler.js.map +1 -0
  486. package/src/transport/mcp-handlers/index.d.ts +521 -0
  487. package/src/transport/mcp-handlers/index.js +20 -0
  488. package/src/transport/mcp-handlers/index.js.map +1 -0
  489. package/src/transport/mcp-handlers/initialize-request.handler.d.ts +3 -0
  490. package/src/transport/mcp-handlers/initialize-request.handler.js +33 -0
  491. package/src/transport/mcp-handlers/initialize-request.handler.js.map +1 -0
  492. package/src/transport/mcp-handlers/list-tools-request.handler.d.ts +285 -0
  493. package/src/transport/mcp-handlers/list-tools-request.handler.js +11 -0
  494. package/src/transport/mcp-handlers/list-tools-request.handler.js.map +1 -0
  495. package/src/transport/mcp-handlers/mcp-handlers.types.d.ts +37 -0
  496. package/src/transport/mcp-handlers/mcp-handlers.types.js +3 -0
  497. package/src/transport/mcp-handlers/mcp-handlers.types.js.map +1 -0
  498. package/src/transport/transport.error.d.ts +4 -0
  499. package/src/transport/transport.error.js +25 -0
  500. package/src/transport/transport.error.js.map +1 -0
  501. package/src/transport/transport.event-store.d.ts +10 -0
  502. package/src/transport/transport.event-store.js +36 -0
  503. package/src/transport/transport.event-store.js.map +1 -0
  504. package/src/transport/transport.local.d.ts +17 -0
  505. package/src/transport/transport.local.js +65 -0
  506. package/src/transport/transport.local.js.map +1 -0
  507. package/src/transport/transport.registry.d.ts +23 -0
  508. package/src/transport/transport.registry.js +138 -0
  509. package/src/transport/transport.registry.js.map +1 -0
  510. package/src/transport/transport.remote.d.ts +15 -0
  511. package/src/transport/transport.remote.js +31 -0
  512. package/src/transport/transport.remote.js.map +1 -0
  513. package/src/transport/transport.types.d.ts +54 -0
  514. package/src/transport/transport.types.js +3 -0
  515. package/src/transport/transport.types.js.map +1 -0
  516. package/src/types/drinen-hooks.types.d.ts +20 -0
  517. package/src/types/drinen-hooks.types.js +3 -0
  518. package/src/types/drinen-hooks.types.js.map +1 -0
  519. package/src/types/invoke.type.d.ts +15 -0
  520. package/src/types/invoke.type.js +34 -0
  521. package/src/types/invoke.type.js.map +1 -0
  522. package/src/types/token.types.d.ts +1 -0
  523. package/src/types/token.types.js +3 -0
  524. package/src/types/token.types.js.map +1 -0
  525. package/src/utils/metadata.utils.d.ts +5 -0
  526. package/src/utils/metadata.utils.js +26 -0
  527. package/src/utils/metadata.utils.js.map +1 -0
  528. package/src/utils/server.utils.d.ts +19 -0
  529. package/src/utils/server.utils.js +59 -0
  530. package/src/utils/server.utils.js.map +1 -0
  531. package/src/utils/string.utils.d.ts +1 -0
  532. package/src/utils/string.utils.js +10 -0
  533. package/src/utils/string.utils.js.map +1 -0
  534. package/src/utils/token.utils.d.ts +11 -0
  535. package/src/utils/token.utils.js +65 -0
  536. package/src/utils/token.utils.js.map +1 -0
  537. package/src/utils/types.utils.d.ts +7 -0
  538. package/src/utils/types.utils.js +3 -0
  539. package/src/utils/types.utils.js.map +1 -0
  540. package/src/constants.d.ts +0 -30
  541. package/src/constants.js +0 -36
  542. package/src/constants.js.map +0 -1
  543. package/src/decorators/adapter.decorator.js.map +0 -1
  544. package/src/decorators/app.decorator.js.map +0 -1
  545. package/src/decorators/auth-provider.decorator.js.map +0 -1
  546. package/src/decorators/flow.decorator.js.map +0 -1
  547. package/src/decorators/front-mcp.decorator.js +0 -40
  548. package/src/decorators/front-mcp.decorator.js.map +0 -1
  549. package/src/decorators/hook.decorator.js.map +0 -1
  550. package/src/decorators/index.js.map +0 -1
  551. package/src/decorators/logger.decorator.js.map +0 -1
  552. package/src/decorators/plugin.decorator.js.map +0 -1
  553. package/src/decorators/prompt.decorator.js.map +0 -1
  554. package/src/decorators/provider.decorator.js.map +0 -1
  555. package/src/decorators/resource.decorator.js.map +0 -1
  556. package/src/decorators/tool.decorator.d.ts +0 -42
  557. package/src/decorators/tool.decorator.js +0 -45
  558. package/src/decorators/tool.decorator.js.map +0 -1
  559. package/src/decorators-old/async-with.decorator.d.ts +0 -9
  560. package/src/decorators-old/async-with.decorator.js +0 -23
  561. package/src/decorators-old/async-with.decorator.js.map +0 -1
  562. package/src/decorators-old/auth-hook.decorator.js.map +0 -1
  563. package/src/decorators-old/session-hook.decorator.js.map +0 -1
  564. package/src/decorators-old/tool-hook.decorator.d.ts +0 -14
  565. package/src/decorators-old/tool-hook.decorator.js +0 -27
  566. package/src/decorators-old/tool-hook.decorator.js.map +0 -1
  567. package/src/dynamic/dynamic.adapter.js.map +0 -1
  568. package/src/dynamic/dynamic.plugin.js.map +0 -1
  569. package/src/dynamic/dynamic.utils.d.ts +0 -3
  570. package/src/dynamic/dynamic.utils.js.map +0 -1
  571. package/src/dynamic/index.js.map +0 -1
  572. package/src/entries/adapter.entry.js.map +0 -1
  573. package/src/entries/app.entry.d.ts +0 -13
  574. package/src/entries/app.entry.js.map +0 -1
  575. package/src/entries/auth-provider.entry.js.map +0 -1
  576. package/src/entries/base.entry.js.map +0 -1
  577. package/src/entries/flow.entry.js.map +0 -1
  578. package/src/entries/hook.entry.js.map +0 -1
  579. package/src/entries/index.js.map +0 -1
  580. package/src/entries/logger.entry.js.map +0 -1
  581. package/src/entries/plugin.entry.js.map +0 -1
  582. package/src/entries/prompt.entry.js.map +0 -1
  583. package/src/entries/provider.entry.js.map +0 -1
  584. package/src/entries/resource.entry.js.map +0 -1
  585. package/src/entries/scope.entry.js.map +0 -1
  586. package/src/entries/tool.entry.js.map +0 -1
  587. package/src/interfaces/adapter.interface.js.map +0 -1
  588. package/src/interfaces/app.interface.js.map +0 -1
  589. package/src/interfaces/auth-hook.interface.js.map +0 -1
  590. package/src/interfaces/auth-provider.interface.js.map +0 -1
  591. package/src/interfaces/base.interface.js.map +0 -1
  592. package/src/interfaces/flow.interface.d.ts +0 -41
  593. package/src/interfaces/flow.interface.js.map +0 -1
  594. package/src/interfaces/front-mcp.interface.js.map +0 -1
  595. package/src/interfaces/hook.interface.js.map +0 -1
  596. package/src/interfaces/index.js.map +0 -1
  597. package/src/interfaces/internal/flow.utils.d.ts +0 -24
  598. package/src/interfaces/internal/flow.utils.js.map +0 -1
  599. package/src/interfaces/internal/index.js.map +0 -1
  600. package/src/interfaces/internal/primary-auth-provider.interface.d.ts +0 -24
  601. package/src/interfaces/internal/primary-auth-provider.interface.js.map +0 -1
  602. package/src/interfaces/internal/registry.interface.d.ts +0 -97
  603. package/src/interfaces/internal/registry.interface.js.map +0 -1
  604. package/src/interfaces/logger.interface.js.map +0 -1
  605. package/src/interfaces/plugin.interface.js.map +0 -1
  606. package/src/interfaces/prompt.interface.js.map +0 -1
  607. package/src/interfaces/provider.interface.js.map +0 -1
  608. package/src/interfaces/resource.interface.js.map +0 -1
  609. package/src/interfaces/scope.interface.js.map +0 -1
  610. package/src/interfaces/server.interface.js.map +0 -1
  611. package/src/interfaces/session-hook.interface.js.map +0 -1
  612. package/src/interfaces/tool-hook.interface.js.map +0 -1
  613. package/src/interfaces/tool.interface.js.map +0 -1
  614. package/src/metadata/adapter.metadata.js.map +0 -1
  615. package/src/metadata/app.metadata.d.ts +0 -872
  616. package/src/metadata/app.metadata.js.map +0 -1
  617. package/src/metadata/auth-provider.metadata.js.map +0 -1
  618. package/src/metadata/flow.metadata.d.ts +0 -77
  619. package/src/metadata/flow.metadata.js.map +0 -1
  620. package/src/metadata/front-mcp.metadata.d.ts +0 -1144
  621. package/src/metadata/front-mcp.metadata.js.map +0 -1
  622. package/src/metadata/hook.metadata.js.map +0 -1
  623. package/src/metadata/index.js.map +0 -1
  624. package/src/metadata/logger.metadata.js.map +0 -1
  625. package/src/metadata/plugin.metadata.js.map +0 -1
  626. package/src/metadata/prompt.metadata.js.map +0 -1
  627. package/src/metadata/provider.metadata.js.map +0 -1
  628. package/src/metadata/resource.metadata.js.map +0 -1
  629. package/src/metadata/tool.metadata.d.ts +0 -178
  630. package/src/metadata/tool.metadata.js.map +0 -1
  631. package/src/providers/session.provider.js.map +0 -1
  632. package/src/records/adapter.record.js.map +0 -1
  633. package/src/records/app.record.js.map +0 -1
  634. package/src/records/auth-provider.record.js.map +0 -1
  635. package/src/records/flow.record.js.map +0 -1
  636. package/src/records/hook.record.js.map +0 -1
  637. package/src/records/index.js.map +0 -1
  638. package/src/records/logger.record.d.ts +0 -11
  639. package/src/records/logger.record.js.map +0 -1
  640. package/src/records/plugin.record.js.map +0 -1
  641. package/src/records/prompt.record.js.map +0 -1
  642. package/src/records/provider.record.js.map +0 -1
  643. package/src/records/resource.record.js.map +0 -1
  644. package/src/records/scope.record.js.map +0 -1
  645. package/src/records/tool.record.js.map +0 -1
  646. package/src/schemas/annotated-class.schema.js.map +0 -1
  647. package/src/schemas/http-input.schema.js.map +0 -1
  648. package/src/schemas/http-output.schema.d.ts +0 -2011
  649. package/src/schemas/http-output.schema.js.map +0 -1
  650. package/src/schemas/index.js.map +0 -1
  651. package/src/tokens/adapter.tokens.js.map +0 -1
  652. package/src/tokens/app.tokens.js.map +0 -1
  653. package/src/tokens/auth-provider.tokens.js.map +0 -1
  654. package/src/tokens/base.tokens.js.map +0 -1
  655. package/src/tokens/flow-hook.tokens.js.map +0 -1
  656. package/src/tokens/flow.tokens.js.map +0 -1
  657. package/src/tokens/front-mcp.tokens.js.map +0 -1
  658. package/src/tokens/index.js.map +0 -1
  659. package/src/tokens/logger.tokens.js.map +0 -1
  660. package/src/tokens/plugin.tokens.js.map +0 -1
  661. package/src/tokens/prompt.tokens.js.map +0 -1
  662. package/src/tokens/provider.tokens.js.map +0 -1
  663. package/src/tokens/resource.tokens.js.map +0 -1
  664. package/src/tokens/server.tokens.js.map +0 -1
  665. package/src/tokens/tool.tokens.js.map +0 -1
  666. package/src/types/auth/index.js.map +0 -1
  667. package/src/types/auth/jwt.types.js.map +0 -1
  668. package/src/types/auth/session.types.d.ts +0 -263
  669. package/src/types/auth/session.types.js.map +0 -1
  670. package/src/types/common.types.js.map +0 -1
  671. package/src/types/index.js.map +0 -1
  672. package/src/types/options/auth.options.d.ts +0 -513
  673. package/src/types/options/auth.options.js.map +0 -1
  674. package/src/types/options/http.options.js.map +0 -1
  675. package/src/types/options/index.js.map +0 -1
  676. package/src/types/options/logging.options.d.ts +0 -39
  677. package/src/types/options/logging.options.js.map +0 -1
  678. package/src/types/options/server-info.options.d.ts +0 -48
  679. package/src/types/options/server-info.options.js.map +0 -1
  680. package/src/types/options/session.options.d.ts +0 -67
  681. package/src/types/options/session.options.js.map +0 -1
  682. package/src/utils/decide-request-intent.utils.d.ts +0 -79
  683. package/src/utils/decide-request-intent.utils.js.map +0 -1
  684. package/src/utils/index.js.map +0 -1
  685. package/src/utils/path.utils.d.ts +0 -20
  686. package/src/utils/path.utils.js.map +0 -1
  687. /package/src/{decorators → common/decorators}/adapter.decorator.d.ts +0 -0
  688. /package/src/{decorators → common/decorators}/adapter.decorator.js +0 -0
  689. /package/src/{decorators → common/decorators}/app.decorator.d.ts +0 -0
  690. /package/src/{decorators → common/decorators}/app.decorator.js +0 -0
  691. /package/src/{decorators → common/decorators}/auth-provider.decorator.d.ts +0 -0
  692. /package/src/{decorators → common/decorators}/auth-provider.decorator.js +0 -0
  693. /package/src/{decorators → common/decorators}/flow.decorator.d.ts +0 -0
  694. /package/src/{decorators → common/decorators}/flow.decorator.js +0 -0
  695. /package/src/{decorators → common/decorators}/front-mcp.decorator.d.ts +0 -0
  696. /package/src/{decorators → common/decorators}/hook.decorator.d.ts +0 -0
  697. /package/src/{decorators → common/decorators}/hook.decorator.js +0 -0
  698. /package/src/{decorators → common/decorators}/index.d.ts +0 -0
  699. /package/src/{decorators → common/decorators}/index.js +0 -0
  700. /package/src/{decorators → common/decorators}/logger.decorator.d.ts +0 -0
  701. /package/src/{decorators → common/decorators}/logger.decorator.js +0 -0
  702. /package/src/{decorators → common/decorators}/plugin.decorator.d.ts +0 -0
  703. /package/src/{decorators → common/decorators}/plugin.decorator.js +0 -0
  704. /package/src/{decorators → common/decorators}/prompt.decorator.d.ts +0 -0
  705. /package/src/{decorators → common/decorators}/prompt.decorator.js +0 -0
  706. /package/src/{decorators → common/decorators}/provider.decorator.d.ts +0 -0
  707. /package/src/{decorators → common/decorators}/provider.decorator.js +0 -0
  708. /package/src/{decorators → common/decorators}/resource.decorator.d.ts +0 -0
  709. /package/src/{decorators → common/decorators}/resource.decorator.js +0 -0
  710. /package/src/{decorators-old → common/decorators-old}/auth-hook.decorator.d.ts +0 -0
  711. /package/src/{decorators-old → common/decorators-old}/auth-hook.decorator.js +0 -0
  712. /package/src/{decorators-old → common/decorators-old}/session-hook.decorator.d.ts +0 -0
  713. /package/src/{decorators-old → common/decorators-old}/session-hook.decorator.js +0 -0
  714. /package/src/{dynamic → common/dynamic}/dynamic.adapter.d.ts +0 -0
  715. /package/src/{dynamic → common/dynamic}/dynamic.adapter.js +0 -0
  716. /package/src/{dynamic → common/dynamic}/dynamic.plugin.d.ts +0 -0
  717. /package/src/{dynamic → common/dynamic}/dynamic.plugin.js +0 -0
  718. /package/src/{dynamic → common/dynamic}/dynamic.utils.js +0 -0
  719. /package/src/{dynamic → common/dynamic}/index.d.ts +0 -0
  720. /package/src/{dynamic → common/dynamic}/index.js +0 -0
  721. /package/src/{entries → common/entries}/adapter.entry.d.ts +0 -0
  722. /package/src/{entries → common/entries}/adapter.entry.js +0 -0
  723. /package/src/{entries → common/entries}/app.entry.js +0 -0
  724. /package/src/{entries → common/entries}/auth-provider.entry.d.ts +0 -0
  725. /package/src/{entries → common/entries}/auth-provider.entry.js +0 -0
  726. /package/src/{entries → common/entries}/base.entry.d.ts +0 -0
  727. /package/src/{entries → common/entries}/base.entry.js +0 -0
  728. /package/src/{entries → common/entries}/flow.entry.d.ts +0 -0
  729. /package/src/{entries → common/entries}/flow.entry.js +0 -0
  730. /package/src/{entries → common/entries}/hook.entry.d.ts +0 -0
  731. /package/src/{entries → common/entries}/hook.entry.js +0 -0
  732. /package/src/{entries → common/entries}/index.d.ts +0 -0
  733. /package/src/{entries → common/entries}/index.js +0 -0
  734. /package/src/{entries → common/entries}/logger.entry.d.ts +0 -0
  735. /package/src/{entries → common/entries}/logger.entry.js +0 -0
  736. /package/src/{entries → common/entries}/plugin.entry.d.ts +0 -0
  737. /package/src/{entries → common/entries}/plugin.entry.js +0 -0
  738. /package/src/{entries → common/entries}/prompt.entry.d.ts +0 -0
  739. /package/src/{entries → common/entries}/prompt.entry.js +0 -0
  740. /package/src/{entries → common/entries}/provider.entry.d.ts +0 -0
  741. /package/src/{entries → common/entries}/provider.entry.js +0 -0
  742. /package/src/{entries → common/entries}/resource.entry.d.ts +0 -0
  743. /package/src/{entries → common/entries}/resource.entry.js +0 -0
  744. /package/src/{entries → common/entries}/scope.entry.d.ts +0 -0
  745. /package/src/{entries → common/entries}/scope.entry.js +0 -0
  746. /package/src/{entries → common/entries}/tool.entry.d.ts +0 -0
  747. /package/src/{entries → common/entries}/tool.entry.js +0 -0
  748. /package/src/{interfaces → common/interfaces}/adapter.interface.d.ts +0 -0
  749. /package/src/{interfaces → common/interfaces}/adapter.interface.js +0 -0
  750. /package/src/{interfaces → common/interfaces}/app.interface.d.ts +0 -0
  751. /package/src/{interfaces → common/interfaces}/app.interface.js +0 -0
  752. /package/src/{interfaces → common/interfaces}/auth-hook.interface.d.ts +0 -0
  753. /package/src/{interfaces → common/interfaces}/auth-hook.interface.js +0 -0
  754. /package/src/{interfaces → common/interfaces}/auth-provider.interface.d.ts +0 -0
  755. /package/src/{interfaces → common/interfaces}/auth-provider.interface.js +0 -0
  756. /package/src/{interfaces → common/interfaces}/base.interface.d.ts +0 -0
  757. /package/src/{interfaces → common/interfaces}/base.interface.js +0 -0
  758. /package/src/{interfaces → common/interfaces}/flow.interface.js +0 -0
  759. /package/src/{interfaces → common/interfaces}/front-mcp.interface.d.ts +0 -0
  760. /package/src/{interfaces → common/interfaces}/front-mcp.interface.js +0 -0
  761. /package/src/{interfaces → common/interfaces}/hook.interface.d.ts +0 -0
  762. /package/src/{interfaces → common/interfaces}/hook.interface.js +0 -0
  763. /package/src/{interfaces → common/interfaces}/index.d.ts +0 -0
  764. /package/src/{interfaces → common/interfaces}/index.js +0 -0
  765. /package/src/{interfaces → common/interfaces}/internal/flow.utils.js +0 -0
  766. /package/src/{interfaces → common/interfaces}/internal/index.d.ts +0 -0
  767. /package/src/{interfaces → common/interfaces}/internal/index.js +0 -0
  768. /package/src/{interfaces → common/interfaces}/internal/primary-auth-provider.interface.js +0 -0
  769. /package/src/{interfaces → common/interfaces}/internal/registry.interface.js +0 -0
  770. /package/src/{interfaces → common/interfaces}/logger.interface.d.ts +0 -0
  771. /package/src/{interfaces → common/interfaces}/logger.interface.js +0 -0
  772. /package/src/{interfaces → common/interfaces}/plugin.interface.d.ts +0 -0
  773. /package/src/{interfaces → common/interfaces}/plugin.interface.js +0 -0
  774. /package/src/{interfaces → common/interfaces}/prompt.interface.d.ts +0 -0
  775. /package/src/{interfaces → common/interfaces}/prompt.interface.js +0 -0
  776. /package/src/{interfaces → common/interfaces}/provider.interface.d.ts +0 -0
  777. /package/src/{interfaces → common/interfaces}/provider.interface.js +0 -0
  778. /package/src/{interfaces → common/interfaces}/resource.interface.d.ts +0 -0
  779. /package/src/{interfaces → common/interfaces}/resource.interface.js +0 -0
  780. /package/src/{interfaces → common/interfaces}/scope.interface.d.ts +0 -0
  781. /package/src/{interfaces → common/interfaces}/scope.interface.js +0 -0
  782. /package/src/{interfaces → common/interfaces}/server.interface.d.ts +0 -0
  783. /package/src/{interfaces → common/interfaces}/server.interface.js +0 -0
  784. /package/src/{interfaces → common/interfaces}/session-hook.interface.d.ts +0 -0
  785. /package/src/{interfaces → common/interfaces}/session-hook.interface.js +0 -0
  786. /package/src/{interfaces → common/interfaces}/tool-hook.interface.d.ts +0 -0
  787. /package/src/{interfaces → common/interfaces}/tool-hook.interface.js +0 -0
  788. /package/src/{interfaces → common/interfaces}/tool.interface.d.ts +0 -0
  789. /package/src/{interfaces → common/interfaces}/tool.interface.js +0 -0
  790. /package/src/{metadata → common/metadata}/adapter.metadata.d.ts +0 -0
  791. /package/src/{metadata → common/metadata}/adapter.metadata.js +0 -0
  792. /package/src/{metadata → common/metadata}/app.metadata.js +0 -0
  793. /package/src/{metadata → common/metadata}/auth-provider.metadata.d.ts +0 -0
  794. /package/src/{metadata → common/metadata}/auth-provider.metadata.js +0 -0
  795. /package/src/{metadata → common/metadata}/flow.metadata.js +0 -0
  796. /package/src/{metadata → common/metadata}/front-mcp.metadata.js +0 -0
  797. /package/src/{metadata → common/metadata}/hook.metadata.d.ts +0 -0
  798. /package/src/{metadata → common/metadata}/hook.metadata.js +0 -0
  799. /package/src/{metadata → common/metadata}/index.d.ts +0 -0
  800. /package/src/{metadata → common/metadata}/index.js +0 -0
  801. /package/src/{metadata → common/metadata}/logger.metadata.d.ts +0 -0
  802. /package/src/{metadata → common/metadata}/logger.metadata.js +0 -0
  803. /package/src/{metadata → common/metadata}/plugin.metadata.d.ts +0 -0
  804. /package/src/{metadata → common/metadata}/plugin.metadata.js +0 -0
  805. /package/src/{metadata → common/metadata}/prompt.metadata.d.ts +0 -0
  806. /package/src/{metadata → common/metadata}/prompt.metadata.js +0 -0
  807. /package/src/{metadata → common/metadata}/provider.metadata.d.ts +0 -0
  808. /package/src/{metadata → common/metadata}/provider.metadata.js +0 -0
  809. /package/src/{metadata → common/metadata}/resource.metadata.d.ts +0 -0
  810. /package/src/{metadata → common/metadata}/resource.metadata.js +0 -0
  811. /package/src/{metadata → common/metadata}/tool.metadata.js +0 -0
  812. /package/src/{providers → common/providers}/session.provider.d.ts +0 -0
  813. /package/src/{providers → common/providers}/session.provider.js +0 -0
  814. /package/src/{records → common/records}/adapter.record.d.ts +0 -0
  815. /package/src/{records → common/records}/adapter.record.js +0 -0
  816. /package/src/{records → common/records}/app.record.d.ts +0 -0
  817. /package/src/{records → common/records}/app.record.js +0 -0
  818. /package/src/{records → common/records}/auth-provider.record.d.ts +0 -0
  819. /package/src/{records → common/records}/auth-provider.record.js +0 -0
  820. /package/src/{records → common/records}/flow.record.d.ts +0 -0
  821. /package/src/{records → common/records}/flow.record.js +0 -0
  822. /package/src/{records → common/records}/hook.record.d.ts +0 -0
  823. /package/src/{records → common/records}/hook.record.js +0 -0
  824. /package/src/{records → common/records}/index.d.ts +0 -0
  825. /package/src/{records → common/records}/index.js +0 -0
  826. /package/src/{records → common/records}/logger.record.js +0 -0
  827. /package/src/{records → common/records}/plugin.record.d.ts +0 -0
  828. /package/src/{records → common/records}/plugin.record.js +0 -0
  829. /package/src/{records → common/records}/prompt.record.d.ts +0 -0
  830. /package/src/{records → common/records}/prompt.record.js +0 -0
  831. /package/src/{records → common/records}/provider.record.d.ts +0 -0
  832. /package/src/{records → common/records}/provider.record.js +0 -0
  833. /package/src/{records → common/records}/resource.record.d.ts +0 -0
  834. /package/src/{records → common/records}/resource.record.js +0 -0
  835. /package/src/{records → common/records}/scope.record.d.ts +0 -0
  836. /package/src/{records → common/records}/scope.record.js +0 -0
  837. /package/src/{records → common/records}/tool.record.d.ts +0 -0
  838. /package/src/{records → common/records}/tool.record.js +0 -0
  839. /package/src/{schemas → common/schemas}/annotated-class.schema.d.ts +0 -0
  840. /package/src/{schemas → common/schemas}/annotated-class.schema.js +0 -0
  841. /package/src/{schemas → common/schemas}/http-input.schema.d.ts +0 -0
  842. /package/src/{schemas → common/schemas}/http-input.schema.js +0 -0
  843. /package/src/{schemas → common/schemas}/http-output.schema.js +0 -0
  844. /package/src/{schemas → common/schemas}/index.d.ts +0 -0
  845. /package/src/{schemas → common/schemas}/index.js +0 -0
  846. /package/src/{tokens → common/tokens}/adapter.tokens.d.ts +0 -0
  847. /package/src/{tokens → common/tokens}/adapter.tokens.js +0 -0
  848. /package/src/{tokens → common/tokens}/app.tokens.d.ts +0 -0
  849. /package/src/{tokens → common/tokens}/app.tokens.js +0 -0
  850. /package/src/{tokens → common/tokens}/auth-provider.tokens.d.ts +0 -0
  851. /package/src/{tokens → common/tokens}/auth-provider.tokens.js +0 -0
  852. /package/src/{tokens → common/tokens}/base.tokens.d.ts +0 -0
  853. /package/src/{tokens → common/tokens}/base.tokens.js +0 -0
  854. /package/src/{tokens → common/tokens}/flow-hook.tokens.d.ts +0 -0
  855. /package/src/{tokens → common/tokens}/flow-hook.tokens.js +0 -0
  856. /package/src/{tokens → common/tokens}/flow.tokens.d.ts +0 -0
  857. /package/src/{tokens → common/tokens}/flow.tokens.js +0 -0
  858. /package/src/{tokens → common/tokens}/front-mcp.tokens.d.ts +0 -0
  859. /package/src/{tokens → common/tokens}/front-mcp.tokens.js +0 -0
  860. /package/src/{tokens → common/tokens}/index.d.ts +0 -0
  861. /package/src/{tokens → common/tokens}/index.js +0 -0
  862. /package/src/{tokens → common/tokens}/logger.tokens.d.ts +0 -0
  863. /package/src/{tokens → common/tokens}/logger.tokens.js +0 -0
  864. /package/src/{tokens → common/tokens}/plugin.tokens.d.ts +0 -0
  865. /package/src/{tokens → common/tokens}/plugin.tokens.js +0 -0
  866. /package/src/{tokens → common/tokens}/prompt.tokens.d.ts +0 -0
  867. /package/src/{tokens → common/tokens}/prompt.tokens.js +0 -0
  868. /package/src/{tokens → common/tokens}/provider.tokens.d.ts +0 -0
  869. /package/src/{tokens → common/tokens}/provider.tokens.js +0 -0
  870. /package/src/{tokens → common/tokens}/resource.tokens.d.ts +0 -0
  871. /package/src/{tokens → common/tokens}/resource.tokens.js +0 -0
  872. /package/src/{tokens → common/tokens}/server.tokens.d.ts +0 -0
  873. /package/src/{tokens → common/tokens}/server.tokens.js +0 -0
  874. /package/src/{tokens → common/tokens}/tool.tokens.d.ts +0 -0
  875. /package/src/{tokens → common/tokens}/tool.tokens.js +0 -0
  876. /package/src/{types → common/types}/auth/index.d.ts +0 -0
  877. /package/src/{types → common/types}/auth/index.js +0 -0
  878. /package/src/{types → common/types}/auth/jwt.types.d.ts +0 -0
  879. /package/src/{types → common/types}/auth/jwt.types.js +0 -0
  880. /package/src/{types → common/types}/auth/session.types.js +0 -0
  881. /package/src/{types → common/types}/common.types.d.ts +0 -0
  882. /package/src/{types → common/types}/common.types.js +0 -0
  883. /package/src/{types → common/types}/index.d.ts +0 -0
  884. /package/src/{types → common/types}/index.js +0 -0
  885. /package/src/{types → common/types}/options/auth.options.js +0 -0
  886. /package/src/{types → common/types}/options/http.options.d.ts +0 -0
  887. /package/src/{types → common/types}/options/http.options.js +0 -0
  888. /package/src/{types → common/types}/options/index.d.ts +0 -0
  889. /package/src/{types → common/types}/options/index.js +0 -0
  890. /package/src/{types → common/types}/options/logging.options.js +0 -0
  891. /package/src/{types → common/types}/options/server-info.options.js +0 -0
  892. /package/src/{types → common/types}/options/session.options.js +0 -0
  893. /package/src/{utils → common/utils}/decide-request-intent.utils.js +0 -0
  894. /package/src/{utils → common/utils}/index.d.ts +0 -0
  895. /package/src/{utils → common/utils}/index.js +0 -0
  896. /package/src/{utils → common/utils}/path.utils.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-hook.interface.js","sourceRoot":"","sources":["../../../src/interfaces/auth-hook.interface.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,IAAY,aAwIX;AAxID,WAAY,aAAa;IACvB;;;;;;OAMG;IACH,wDAAuC,CAAA;IAGvC;;;;OAIG;IACH,sDAAqC,CAAA;IAErC;;;;OAIG;IACH,wDAAuC,CAAA;IAEvC,gDAAgD;IAEhD;;;;OAIG;IACH,gDAA+B,CAAA;IAE/B;;;;OAIG;IACH,gDAA+B,CAAA;IAE/B;;;;;;OAMG;IACH,wDAAuC,CAAA;IAEvC;;;;;OAKG;IACH,wDAAuC,CAAA;IAEvC;;;;OAIG;IACH,oDAAmC,CAAA;IAEnC,2CAA2C;IAE3C;;;;OAIG;IACH,kDAAiC,CAAA;IAEjC;;;;OAIG;IACH,gDAA+B,CAAA;IAE/B,iCAAiC;IAEjC;;;OAGG;IACH,0DAAyC,CAAA;IAEzC;;;OAGG;IACH,wDAAuC,CAAA;IAEvC,4DAA4D;IAE5D;;;;;OAKG;IACH,8CAA6B,CAAA;IAE7B;;;;;;OAMG;IACH,oCAAmB,CAAA;IAEnB;;;;OAIG;IACH,wCAAuB,CAAA;IAEvB;;;;OAIG;IACH,sCAAqB,CAAA;IAErB;;;;;;OAMG;IACH,wCAAuB,CAAA;AACzB,CAAC,EAxIW,aAAa,6BAAb,aAAa,QAwIxB","sourcesContent":["/**\n * Lifecycle stages for auth invocation.\n *\n * Ordering notes:\n * - \"will*\" stages run before the action; \"did*\" stages run after.\n * - Higher `priority()` runs earlier for \"will*\" (outermost), and later for \"did*\".\n * - Finalization stages (`willFinalize`, `willAudit`, `didAudit`, `onMetrics`) should be placed\n * in your plan’s `finalize` array to run on both success and error paths.\n *\n * Control flow:\n * - Hooks may call `ctx.respond(value)` to short-circuit with a return value.\n * - Hooks may call `ctx.abort(reason, code?, httpStatus?)` to stop with an error.\n *\n */\n\nexport enum AuthHookStage {\n /** Prepare a new session (or re-register an incoming secureJwt).\n * Responsibilities:\n * - Validate incoming token (if any); compute defaults; attach user hints.\n * - Initialize per-session resources and attach to `ctx.data`.\n * Failure modes:\n * - `ctx.abort('invalid jwt', 'INVALID_SESSION', 401)`.\n */\n willCreateSession = 'willCreateSession',\n\n\n /** Session created and registered.\n * Responsibilities:\n * - Announce readiness (mount handlers/streams), emit side-effects if needed.\n * - Optionally shape `ctx.output` with a `SessionContextView`.\n */\n didCreateSession = 'didCreateSession',\n\n /** Bind DI providers needed for this session/request.\n * Responsibilities:\n * - Resolve and bind providers so later hooks can `ctx.get(...)`.\n * - May set `ctx.bindProvider/bindProviders` helpers.\n */\n willBindProviders = 'willBindProviders',\n\n // ---------- Auth (within a session) ----------\n\n /** Signal the beginning of an auth sequence in the scope of this session.\n * Responsibilities:\n * - Initialize auth-related state (PKCE/state, CSRF, telemetry).\n * - Decide transport (SSE/StreamableHTTP) for status/URL events if applicable.\n */\n willBeginAuth = 'willBeginAuth',\n\n /** Streamable authorization progress within the session.\n * Responsibilities:\n * - Emit URL/status events (e.g., “authorize_url”, “awaiting_callback”).\n * - Optionally `ctx.respond({event: ...})` for push-style transports.\n */\n willAuthorize = 'willAuthorize', // stream-able events (URL/status)\n\n /** Prepare and gate the token exchange with the provider.\n * Responsibilities:\n * - Verify callback params; ensure prerequisites (sessionId present).\n * - Compute exchange request; rate-limit/anti-replay checks.\n * Failure modes:\n * - `ctx.abort('invalid state/pkce', 'OAUTH_CALLBACK_ERROR', 400)`.\n */\n willExchangeToken = 'willExchangeToken',\n\n /** SecureMcp JWT has been minted/confirmed for this session.\n * Responsibilities:\n * - React to issuance (e.g., persist session claims, notify listeners).\n * Notes:\n * - Fired once the session’s secureJwt is known; avoid logging secrets.\n */\n didIssueSecureJwt = 'didIssueSecureJwt',\n\n /** Encrypt and store provider tokens for this session.\n * Responsibilities:\n * - Write encrypted blobs to the session record (per provider).\n * - Derive minimal metadata (scopes/expiry) for later claims-only exposure.\n */\n willStoreTokens = 'willStoreTokens',\n\n // ---------- Access (read path) ----------\n\n /** Authorize and prepare a session read.\n * Responsibilities:\n * - Validate access to the session; attach read-scoped providers if required.\n * - Optionally shape a partial view before execute.\n */\n willGetSession = 'willGetSession',\n\n /** Post-process the session view.\n * Responsibilities:\n * - Redact/transform/derive fields for the final response.\n * - Set `ctx.output` to a `SessionContextView`.\n */\n didGetSession = 'didGetSession',\n\n // ---------- Disposal ----------\n\n /** Announce shutdown and allow flush/cleanup.\n * Responsibilities:\n * - Close streams, unsubscribe listeners, schedule disposers.\n */\n willDisposeSession = 'willDisposeSession',\n\n /** Confirm teardown and emit metrics.\n * Responsibilities:\n * - Final confirmation of resource release; summarize outcome.\n */\n didDisposeSession = 'didDisposeSession',\n\n // ---------- Finalize / audit / metrics / errors ----------\n\n /** Optional “late finally” hook if you need a single place before audit/metrics.\n * Responsibilities:\n * - Last-chance cleanup across success/error paths (idempotent, non-throwing).\n * Notes:\n * - Include this stage in your plan’s `finalize` array to activate.\n */\n willFinalize = 'willFinalize',\n\n /** Centralized error handler.\n * Responsibilities:\n * - Redact sensitive data; map internal errors to public codes.\n * - Optionally `ctx.respond({ error })` or `ctx.abort(...)`.\n * Notes:\n * - Should not throw; runs before audit/metrics finalize.\n */\n onError = 'onError',\n\n /** Pre-audit collection on both success and error paths.\n * Responsibilities:\n * - Build audit envelope (actor, sessionId, providers touched).\n * - Normalize and strip secrets (no raw tokens).\n */\n willAudit = 'willAudit',\n\n /** Persist/emit the audit record.\n * Responsibilities:\n * - Write to audit sink(s) with outcome and timings.\n * - Correlate via `ctx.requestId`/`ctx.sessionId`.\n */\n didAudit = 'didAudit',\n\n /** Telemetry/metrics emission for both success and errors.\n * Responsibilities:\n * - Counters & timings (create/get/dispose/auth/exchange/store).\n * - Error code/tag cardinality kept small for SLOs/alerts.\n * Constraints:\n * - Non-throwing; must not alter control flow.\n */\n onMetrics = 'onMetrics',\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-provider.interface.js","sourceRoot":"","sources":["../../../src/interfaces/auth-provider.interface.ts"],"names":[],"mappings":";;AAuCA,8CAIC;AAfD;;;;;;;;;;GAUG;AACH,SAAgB,iBAAiB,CAC/B,GAA6C;IAE7C,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { Type, Token, ClassType, ValueType, FactoryType, ClassToken } from './base.interface';\nimport { AuthProviderMetadata } from '../metadata';\n\n\nexport interface AuthProviderInterface {\n headers(): Record<string, string>;\n\n refreshToken?(): Promise<string | undefined>;\n}\n\n\nexport type AuthProviderClassType<Provide> = ClassType<Provide> & AuthProviderMetadata;\nexport type AuthProviderValueType<Provide> = ValueType<Provide> & AuthProviderMetadata;\nexport type AuthProviderFactoryType<Provide, Tokens extends readonly (ClassToken | Token)[]> =\n FactoryType<Provide, Tokens>\n & AuthProviderMetadata;\n\n\nexport type AuthProviderType<\n Provide extends AuthProviderInterface = any,\n Tokens extends readonly (ClassToken | Token)[] = readonly (ClassToken | Token)[]\n> =\n | Type<Provide>\n | AuthProviderClassType<Provide>\n | AuthProviderValueType<Provide>\n | AuthProviderFactoryType<Provide, Tokens>\n\n\n/**\n * Helper to define factory providers without tuple widening.\n * Enforces that `useFactory` params follow the `inject()` tokens (order + arity).\n *\n * Usage:\n * const p = AsyncMcpProvider({\n * provide: RedisProviderRef,\n * inject: () => [ExpenseConfigRef, RedisType] as const,\n * useFactory: async (config, redis) => new RedisProvider(redis),\n * });\n */\nexport function AsyncAuthProvider<Provide, const Tokens extends readonly (ClassToken | Token)[]>(\n cfg: AuthProviderFactoryType<Provide, Tokens>,\n): AuthProviderFactoryType<Provide, Tokens> {\n return cfg;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.interface.js","sourceRoot":"","sources":["../../../src/interfaces/base.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Constructor type for a concrete class that produces instances of T.\n *\n * Useful anywhere a factory/DI container expects a class reference that can be\n * `new`-ed. For example: `getProvider(UserRepo as Type<UserRepo>)`.\n */\nexport interface Type<T = unknown> extends Function {\n new(...args: any[]): T;\n}\n\n/**\n * Constructor type for a concrete class that produces instances of T.\n *\n * Useful anywhere a factory/DI container expects a class reference that can be\n * `new`-ed. For example: `getProvider(UserRepo as Type<UserRepo>)`.\n */\nexport type FuncType<T> = (...args: any[]) => any | Promise<any>;\n\n\nexport type PartialStagesType<T extends string> = Partial<Record<T, Type[]>>;\n\n/**\n * Empty Constructor type for a concrete class that produces instances of T.\n *\n * Useful anywhere a factory/DI container expects a class reference that can be\n * `new`-ed. For example: `getProvider(UserRepo as Type<UserRepo>)`.\n */\nexport interface CtorType<T = unknown> extends Function {\n new(): T;\n}\n\nexport type Ctor<T> = new (...args: any[]) => T;\n\n/**\n * Shape of an abstract class (or interface-like constructor) whose instances\n * cannot be created directly but still expose a prototype of T.\n *\n * This is handy when accepting references that may point at abstract bases\n * instead of concrete implementors.\n */\nexport interface Abstract<T> extends Function {\n prototype: T;\n}\n\n/**\n * A reference token that may be used to look up or identify a dependency.\n *\n * Typical usages:\n * - string | symbol: named tokens (e.g., provider IDs like \"provider:redis\").\n * - Type<T>: a concrete class constructor (can be instantiated).\n * - Abstract<T>: an abstract base reference (resolved to a concrete impl).\n * - Function: generic function references when needed.\n */\nexport type Reference<T = unknown> = string | symbol | Type<T> | Abstract<T> | Function;\n\n/** A DI token that can be either a class constructor or a logical reference. */\nexport type Token<T = any> = Type<T> | Reference<T>;\n\n\nexport interface ClassType<Provide> {\n provide: Reference<Provide>;\n useClass: Type<Provide>;\n}\n\nexport interface ValueType<Provide> {\n provide: Reference<Provide>;\n useValue: Provide;\n}\n\n/** Map a tuple of tokens to a tuple of their instance types (order preserved). */\n\nexport type ClassToken<T = any> = abstract new (...a: any) => T;\n// Branded symbol token that carries the payload type T\n\n// export type Resolve<Tokens extends readonly Token[]> = {\n// [K in keyof Tokens]: Tokens[K] extends Token<infer R> ? R : never;\n// };\n\n/** 2) Map tokens -> runtime parameter types **/\ntype ResolveToken<T> =\n T extends ClassToken<infer R> ? R\n : T extends symbol & { readonly __di_type?: infer R } ? R\n : never;\n\ntype ResolveTokens<Tokens extends readonly unknown[]> = {\n [K in keyof Tokens]: Tokens[K] extends Token<infer R> ? R : ResolveToken<Tokens[K]>;\n};\n\n// Rest parameters can't be readonly tuples; strip readonly.\ntype Mutable<T extends readonly unknown[]> = { -readonly [K in keyof T]: T[K] };\n\n/** 3) FactoryType with correct useFactory shape **/\nexport interface FactoryType<Provide, Tokens extends readonly (ClassToken | Token)[]> {\n provide: Reference<Provide>;\n inject: () => Tokens;\n useFactory: (...args: Mutable<ResolveTokens<Tokens>>) => Provide | Promise<Provide>;\n}\n\n\n\nexport type RequiredByKey<T, K extends keyof T> = T & Required<Omit<T, K>>;\n"]}
@@ -1,41 +0,0 @@
1
- import { Token, Type } from './base.interface';
2
- import { FlowMetadata, FlowName } from '../metadata';
3
- import { z } from 'zod';
4
- import { HookEntry, ScopeEntry } from '../entries';
5
- import { FlowStateOf } from './internal/flow.utils';
6
- import { FrontMcpLogger } from "./logger.interface";
7
- export type FlowInputOf<N extends FlowName> = z.infer<ExtendFlows[N]['input']>;
8
- export type FlowOutputOf<N extends FlowName> = z.infer<ExtendFlows[N]['output']>;
9
- export type FlowPlanOf<N extends FlowName> = ExtendFlows[N]['plan'];
10
- export type FlowCtxOf<N extends FlowName> = ExtendFlows[N]['ctx'];
11
- export type FlowStagesOf<N extends FlowName> = ExtendFlows[N]['stage'];
12
- export type FlowExecuteStagesOf<N extends FlowName> = ExtendFlows[N]['executeStage'];
13
- export type FlowControlType = 'respond' | 'fail' | 'abort' | 'next' | 'handled';
14
- export declare class FlowControl extends Error {
15
- readonly type: FlowControlType;
16
- readonly output: any;
17
- constructor(type: FlowControlType, output: any);
18
- static respond<T>(output: T): never;
19
- static next(): never;
20
- static handled(): never;
21
- static fail(error: Error): never;
22
- static abort(reason: string): never;
23
- }
24
- export declare abstract class FlowBase<N extends FlowName = FlowName> {
25
- protected readonly metadata: FlowMetadata<N>;
26
- readonly rawInput: Partial<FlowInputOf<N>> | any;
27
- protected readonly scope: ScopeEntry;
28
- protected readonly appendContextHooks: (hooks: HookEntry[]) => void;
29
- protected readonly deps: ReadonlyMap<Token, unknown>;
30
- protected input: FlowInputOf<N>;
31
- state: FlowStateOf<N>;
32
- scopeLogger: FrontMcpLogger;
33
- constructor(metadata: FlowMetadata<N>, rawInput: Partial<FlowInputOf<N>> | any, scope: ScopeEntry, appendContextHooks: (hooks: HookEntry[]) => void, deps?: ReadonlyMap<Token, unknown>);
34
- get<T>(token: Token<T>): T;
35
- respond(output: FlowOutputOf<N>): void;
36
- fail(error: Error): void;
37
- protected abort(message: string): void;
38
- protected next(): void;
39
- protected handled(): void;
40
- }
41
- export type FlowType<Provide = FlowBase> = Type<Provide>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"flow.interface.js","sourceRoot":"","sources":["../../../src/interfaces/flow.interface.ts"],"names":[],"mappings":";;;AAIA,sDAA6D;AAa7D,MAAa,WAAY,SAAQ,KAAK;IACR;IAAuC;IAAnE,YAA4B,IAAqB,EAAkB,MAAW;QAC5E,KAAK,EAAE,CAAC;QADkB,SAAI,GAAJ,IAAI,CAAiB;QAAkB,WAAM,GAAN,MAAM,CAAK;IAE9E,CAAC;IAED,MAAM,CAAC,OAAO,CAAI,MAAS;QACzB,MAAM,IAAI,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,IAAI;QACT,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,MAAM,IAAI,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,KAAY;QACtB,MAAM,IAAI,WAAW,CAAC,MAAM,EAAE,EAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAC,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,MAAc;QACzB,MAAM,IAAI,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;CAEF;AAzBD,kCAyBC;AAGD,uCAAuC;AACvC,MAAsB,QAAQ;IAMP;IACV;IACU;IACA;IACA;IATX,KAAK,CAAiB;IAChC,KAAK,GAAmB,sBAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7C,WAAW,CAAiB;IAE5B,YACqB,QAAyB,EACnC,QAAuC,EAC7B,KAAiB,EACjB,kBAAgD,EAChD,OAAoC,IAAI,GAAG,EAAE;QAJ7C,aAAQ,GAAR,QAAQ,CAAiB;QACnC,aAAQ,GAAR,QAAQ,CAA+B;QAC7B,UAAK,GAAL,KAAK,CAAY;QACjB,uBAAkB,GAAlB,kBAAkB,CAA8B;QAChD,SAAI,GAAJ,IAAI,CAAyC;QAEhE,IAAI,CAAC,KAAK,GAAI,QAAQ,CAAC,WAAmB,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,CAAC;QAC9D,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;IAClC,CAAC;IAED,GAAG,CAAI,KAAe;QACpB,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAM,CAAC;QAC3D,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,CAAC,MAAuB;QAC7B,MAAM,WAAW,CAAC,OAAO,CAAE,IAAI,CAAC,QAAQ,CAAC,YAAiC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5F,CAAC;IAED,IAAI,CAAC,KAAY;QACf,MAAM,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAES,KAAK,CAAC,OAAe;QAC7B,MAAM,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAES,IAAI;QACZ,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAES,OAAO;QACf,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;CAEF;AAzCD,4BAyCC","sourcesContent":["import {Token, Type} from './base.interface';\nimport {FlowMetadata, FlowName} from '../metadata';\nimport {z} from 'zod';\nimport {HookEntry, ScopeEntry} from '../entries';\nimport {FlowState, FlowStateOf} from './internal/flow.utils';\nimport {FrontMcpLogger} from \"./logger.interface\";\n\nexport type FlowInputOf<N extends FlowName> = z.infer<ExtendFlows[N]['input']>;\nexport type FlowOutputOf<N extends FlowName> = z.infer<ExtendFlows[N]['output']>;\nexport type FlowPlanOf<N extends FlowName> = ExtendFlows[N]['plan'];\nexport type FlowCtxOf<N extends FlowName> = ExtendFlows[N]['ctx'];\nexport type FlowStagesOf<N extends FlowName> = ExtendFlows[N]['stage'];\nexport type FlowExecuteStagesOf<N extends FlowName> = ExtendFlows[N]['executeStage'];\n\n\nexport type FlowControlType = 'respond' | 'fail' | 'abort' | 'next' | 'handled';\n\nexport class FlowControl extends Error {\n constructor(public readonly type: FlowControlType, public readonly output: any) {\n super();\n }\n\n static respond<T>(output: T): never {\n throw new FlowControl('respond', output);\n }\n\n static next(): never {\n throw new FlowControl('next', null);\n }\n\n static handled(): never {\n throw new FlowControl('handled', null);\n }\n\n static fail(error: Error): never {\n throw new FlowControl('fail', {error: error.message});\n }\n\n static abort(reason: string): never {\n throw new FlowControl('abort', reason);\n }\n\n}\n\n\n// 1) The actual abstract class (value)\nexport abstract class FlowBase<N extends FlowName = FlowName> {\n protected input: FlowInputOf<N>;\n state: FlowStateOf<N> = FlowState.create({});\n scopeLogger: FrontMcpLogger;\n\n constructor(\n protected readonly metadata: FlowMetadata<N>,\n readonly rawInput: Partial<FlowInputOf<N>> | any,\n protected readonly scope: ScopeEntry,\n protected readonly appendContextHooks: (hooks: HookEntry[]) => void,\n protected readonly deps: ReadonlyMap<Token, unknown> = new Map(),\n ) {\n this.input = (metadata.inputSchema as any)?.parse?.(rawInput);\n this.scopeLogger = scope.logger;\n }\n\n get<T>(token: Token<T>): T {\n if (this.deps.has(token)) return this.deps.get(token) as T;\n return this.scope.providers.get(token);\n }\n\n respond(output: FlowOutputOf<N>) {\n throw FlowControl.respond((this.metadata.outputSchema as z.ZodObject<any>).parse(output));\n }\n\n fail(error: Error) {\n throw FlowControl.fail(error);\n }\n\n protected abort(message: string) {\n throw FlowControl.abort(message);\n }\n\n protected next() {\n throw FlowControl.next();\n }\n\n protected handled() {\n throw FlowControl.handled();\n }\n\n}\n\nexport type FlowType<Provide = FlowBase> =\n | Type<Provide>\n\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"front-mcp.interface.js","sourceRoot":"","sources":["../../../src/interfaces/front-mcp.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { FrontMcpConfigType } from '../metadata';\n\n\nexport interface FrontMcpInterface {\n readonly config: FrontMcpConfigType;\n readonly ready: Promise<void>;\n\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hook.interface.js","sourceRoot":"","sources":["../../../src/interfaces/hook.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Type} from './base.interface';\n\nexport type HookBase<In, Ctx> = (input: In, ctx?: Ctx) => Promise<void>;\n\nexport type HookType = Type<HookBase<any, any>>\n\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,gEAAsC;AACtC,6DAAmC;AACnC,4DAAkC;AAClC,2DAAiC;AACjC,2DAAiC;AACjC,0DAAgC;AAChC,+DAAqC;AACrC,oEAA0C;AAC1C,8DAAoC;AACpC,6DAAmC;AACnC,2DAAiC;AACjC,+DAAqC;AACrC,6DAAmC;AACnC,6DAAmC;AAEnC,qDAA0B","sourcesContent":["export * from './base.interface';\nexport * from './front-mcp.interface';\nexport * from './server.interface';\nexport * from './scope.interface';\nexport * from './flow.interface';\nexport * from './hook.interface';\nexport * from './app.interface';\nexport * from './provider.interface';\nexport * from './auth-provider.interface';\nexport * from './adapter.interface';\nexport * from './plugin.interface';\nexport * from './tool.interface';\nexport * from './resource.interface';\nexport * from './prompt.interface';\nexport * from './logger.interface';\n\nexport * from './internal'"]}
@@ -1,24 +0,0 @@
1
- import { z } from 'zod';
2
- import { FlowName } from '../../metadata';
3
- export type Dict = Record<PropertyKey, unknown>;
4
- type RequiredView<T> = {
5
- [K in keyof T]-?: Exclude<T[K], undefined>;
6
- };
7
- type StateAccess<T> = {
8
- [K in keyof T]: T[K] | undefined;
9
- } & {
10
- required: RequiredView<T>;
11
- };
12
- type StateType<Name extends FlowName> = z.infer<ExtendFlows[Name]['state']>;
13
- export type FlowStateOf<Name extends FlowName, T = StateType<Name>> = StateAccess<T> & {
14
- get<K extends keyof T>(key: K): T[K] | undefined;
15
- getOrThrow<K extends keyof T>(key: K, message?: string): Exclude<T[K], undefined>;
16
- set<K extends keyof T>(key: K, value: T[K]): FlowStateOf<Name, T>;
17
- set(patch: Partial<T>): FlowStateOf<Name, T>;
18
- snapshot(): Readonly<Partial<T>>;
19
- };
20
- export declare class FlowState {
21
- private constructor();
22
- static create<Name extends FlowName, T = StateType<Name>>(initial?: Partial<T>): FlowStateOf<Name>;
23
- }
24
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"flow.utils.js","sourceRoot":"","sources":["../../../../src/interfaces/internal/flow.utils.ts"],"names":[],"mappings":";;;AAiBA,MAAa,SAAS;IACpB;QACE,WAAW;IACb,CAAC;IAED,MAAM,CAAC,MAAM,CAA6C,OAAoB;QAC5E,MAAM,IAAI,GAAe,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAEvD,MAAM,GAAG,GAAG;YACV,GAAG,CAAoB,GAAM;gBAC3B,OAAO,IAAI,CAAC,GAAG,CAAqB,CAAC;YACvC,CAAC;YACD,UAAU,CAAoB,GAAM,EAAE,OAAgB;gBACpD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;gBACtB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;oBACtC,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,sCAAsC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACnF,CAAC;gBACD,OAAO,GAA+B,CAAC;YACzC,CAAC;YACD,GAAG,CAAoB,GAAG,IAA8B;gBACtD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;oBAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;qBAC/C,CAAC;oBACJ,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAiB,CAAC;oBAChC,IAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;gBACvB,CAAC;gBACD,OAAO,KAA0B,CAAC;YACpC,CAAC;YACD,QAAQ;gBACN,OAAO,EAAE,GAAG,IAAI,EAA0B,CAAC;YAC7C,CAAC;SACF,CAAC;QAEF,MAAM,aAAa,GAAG,IAAI,KAAK,CAAC,EAAqB,EAAE;YACrD,GAAG,CAAC,EAAE,EAAE,IAAiB;gBACvB,MAAM,GAAG,GAAI,IAAY,CAAC,IAAI,CAAC,CAAC;gBAChC,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;oBACtC,MAAM,IAAI,KAAK,CAAC,sCAAsC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACzE,CAAC;gBACD,OAAO,GAAG,CAAC;YACb,CAAC;YACD,GAAG,CAAC,EAAE,EAAE,IAAI;gBACV,MAAM,GAAG,GAAI,IAAY,CAAC,IAAI,CAAC,CAAC;gBAChC,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC;YAC3C,CAAC;YACD,OAAO;gBACL,OAAO,OAAO,CAAC,OAAO,CAAC,IAAc,CAAC,CAAC;YACzC,CAAC;YACD,wBAAwB;gBACtB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;YAClD,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAc,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;QAElF,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,GAAU,EAAE;YAClC,GAAG,CAAC,EAAE,EAAE,IAAiB,EAAE,QAAQ;gBACjC,IAAI,IAAI,KAAK,UAAU;oBAAE,OAAO,aAAa,CAAC;gBAC9C,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;oBAAE,OAAO,OAAO,CAAC,GAAG,CAAC,GAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;gBACzE,OAAQ,IAAY,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;YACD,GAAG,CAAC,EAAE,EAAE,IAAiB,EAAE,KAAK;gBAC7B,IAAY,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;gBAC5B,OAAO,IAAI,CAAC;YACd,CAAC;YACD,GAAG,CAAC,EAAE,EAAE,IAAI;gBACV,OAAO,IAAI,KAAK,UAAU,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,IAAK,IAAe,CAAC;YACjF,CAAC;YACD,OAAO;gBACL,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,IAAc,CAAC,EAAE,UAAU,EAAE,GAAG,UAAU,CAA+B,CAAC;YACvG,CAAC;YACD,wBAAwB,CAAC,EAAE,EAAE,IAAI;gBAC/B,IAAI,IAAI,KAAK,UAAU,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;oBAChD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;gBACnD,CAAC;gBACD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;YAClD,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,KAA0B,CAAC;IACpC,CAAC;CACF;AAhFD,8BAgFC","sourcesContent":["import { z } from 'zod';\nimport { FlowName } from '../../metadata';\n\nexport type Dict = Record<PropertyKey, unknown>;\ntype RequiredView<T> = { [K in keyof T]-?: Exclude<T[K], undefined> };\ntype StateAccess<T> = { [K in keyof T]: T[K] | undefined } & { required: RequiredView<T> };\n\ntype StateType<Name extends FlowName> = z.infer<ExtendFlows[Name]['state']>\n\nexport type FlowStateOf<Name extends FlowName, T = StateType<Name>> = StateAccess<T> & {\n get<K extends keyof T>(key: K): T[K] | undefined;\n getOrThrow<K extends keyof T>(key: K, message?: string): Exclude<T[K], undefined>;\n set<K extends keyof T>(key: K, value: T[K]): FlowStateOf<Name, T>;\n set(patch: Partial<T>): FlowStateOf<Name, T>;\n snapshot(): Readonly<Partial<T>>;\n};\n\nexport class FlowState {\n private constructor() {\n /* empty */\n }\n\n static create<Name extends FlowName, T = StateType<Name>>(initial?: Partial<T>): FlowStateOf<Name> {\n const data: Partial<T> = initial ? { ...initial } : {};\n\n const api = {\n get<K extends keyof T>(key: K) {\n return data[key] as T[K] | undefined;\n },\n getOrThrow<K extends keyof T>(key: K, message?: string) {\n const val = data[key];\n if (val === undefined || val === null) {\n throw new Error(message ?? `InvokeState: missing required key \"${String(key)}\"`);\n }\n return val as Exclude<T[K], undefined>;\n },\n set<K extends keyof T>(...args: [K, T[K]] | [Partial<T>]) {\n if (args.length === 1) Object.assign(data, args[0]);\n else {\n const [k, v] = args as [K, T[K]];\n (data as any)[k] = v;\n }\n return proxy as FlowStateOf<Name>;\n },\n snapshot() {\n return { ...data } as Readonly<Partial<T>>;\n },\n };\n\n const requiredProxy = new Proxy({} as RequiredView<T>, {\n get(_t, prop: PropertyKey) {\n const val = (data as any)[prop];\n if (val === undefined || val === null) {\n throw new Error(`InvokeState: missing required key \"${String(prop)}\"`);\n }\n return val;\n },\n has(_t, prop) {\n const val = (data as any)[prop];\n return val !== undefined && val !== null;\n },\n ownKeys() {\n return Reflect.ownKeys(data as object);\n },\n getOwnPropertyDescriptor() {\n return { enumerable: true, configurable: true };\n },\n });\n\n const methodKeys = new Set<PropertyKey>(['get', 'getOrThrow', 'set', 'snapshot']);\n\n const proxy = new Proxy(api as any, {\n get(_t, prop: PropertyKey, receiver) {\n if (prop === 'required') return requiredProxy;\n if (methodKeys.has(prop)) return Reflect.get(api as any, prop, receiver);\n return (data as any)[prop];\n },\n set(_t, prop: PropertyKey, value) {\n (data as any)[prop] = value;\n return true;\n },\n has(_t, prop) {\n return prop === 'required' || methodKeys.has(prop) || prop in (data as object);\n },\n ownKeys() {\n return [...Reflect.ownKeys(data as object), 'required', ...methodKeys] as ArrayLike<string | symbol>;\n },\n getOwnPropertyDescriptor(_t, prop) {\n if (prop === 'required' || methodKeys.has(prop)) {\n return { enumerable: false, configurable: true };\n }\n return { enumerable: true, configurable: true };\n },\n });\n\n return proxy as FlowStateOf<Name>;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/interfaces/internal/index.ts"],"names":[],"mappings":";;;AAAA,kBAAkB;AAClB,4EAAkD;AAClD,+DAAqC","sourcesContent":["// core interfaces\nexport * from './primary-auth-provider.interface';\nexport * from './registry.interface';\n"]}
@@ -1,24 +0,0 @@
1
- import { ServerRequest } from '../server.interface';
2
- import { AuthOptions } from '../../types';
3
- /**
4
- * Base class for primary auth provider.
5
- * Used for easy access current auth context by dependency injection.
6
- *
7
- * In tool context, you can access current auth context by calling:
8
- * this.get(FrontMcpAuth) | this.get(Auth)
9
- *
10
- * Or in session scoped Providers in constructor arguments:
11
- * constructor(private readonly auth: FrontMcpAuth) {
12
- * // auth.fetch('MY endpoint ')
13
- * }
14
- */
15
- export declare abstract class FrontMcpAuth {
16
- ready: Promise<void>;
17
- readonly options: AuthOptions;
18
- readonly id: string;
19
- constructor(options: AuthOptions);
20
- abstract fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
21
- abstract validate(request: ServerRequest): Promise<void>;
22
- abstract get issuer(): string;
23
- }
24
- export { FrontMcpAuth as Auth, };
@@ -1 +0,0 @@
1
- {"version":3,"file":"primary-auth-provider.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/internal/primary-auth-provider.interface.ts"],"names":[],"mappings":";;;AAEA,uCAA0C;AAG1C;;;;;;;;;;;GAWG;AACH,MAAsB,YAAY;IAChC,KAAK,CAAgB;IACZ,OAAO,CAAc;IACrB,EAAE,CAAS;IAEpB,YAAY,OAAoB;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,IAAI,IAAA,mBAAW,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvD,CAAC;IAEH,CAAC;CAOF;AApBD,oCAoBC;AAGiB,4BAAI","sourcesContent":["import { ServerRequest } from '../server.interface';\nimport { AuthOptions } from '../../types';\nimport { urlToSafeId } from '../../utils';\n\n\n/**\n * Base class for primary auth provider.\n * Used for easy access current auth context by dependency injection.\n *\n * In tool context, you can access current auth context by calling:\n * this.get(FrontMcpAuth) | this.get(Auth)\n *\n * Or in session scoped Providers in constructor arguments:\n * constructor(private readonly auth: FrontMcpAuth) {\n * // auth.fetch('MY endpoint ')\n * }\n */\nexport abstract class FrontMcpAuth {\n ready: Promise<void>;\n readonly options: AuthOptions;\n readonly id: string;\n\n constructor(options: AuthOptions) {\n this.options = options;\n if (options.type === 'local') {\n this.id = options.id;\n } else {\n this.id = options.id ?? urlToSafeId(options.baseUrl);\n }\n\n }\n\n abstract fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;\n\n abstract validate(request: ServerRequest): Promise<void>\n\n abstract get issuer(): string\n}\n\nexport {\n FrontMcpAuth as Auth,\n};"]}
@@ -1,97 +0,0 @@
1
- import { ScopeEntry, FlowEntry, AuthProviderEntry, AppEntry, ProviderEntry, PluginEntry, AdapterEntry, PromptEntry, ResourceEntry, ToolEntry, LoggerEntry } from '../../entries';
2
- import { Token } from '../base.interface';
3
- import { EntryOwnerRef } from '../../entries';
4
- import { FrontMcpAuth } from './primary-auth-provider.interface';
5
- import { FlowName } from '../../metadata';
6
- import { HookEntry } from "../../entries/hook.entry";
7
- import { FlowCtxOf, FlowInputOf, FlowStagesOf } from "../flow.interface";
8
- import { HookRecord } from "../../records";
9
- export interface ScopeRegistryInterface {
10
- getScopes(): ScopeEntry[];
11
- }
12
- export interface FlowRegistryInterface {
13
- getFlows(): FlowEntry<FlowName>[];
14
- }
15
- export interface HookRegistryInterface {
16
- /**
17
- * used to pull hooks registered by a class and related to that class only,
18
- * like registering hooks on specific tool execution
19
- * @param token
20
- */
21
- getClsHooks(token: Token): HookEntry[];
22
- /**
23
- * Used to pull all hooks registered to specific flow by name,
24
- * this is used to construct the flow graph and execute hooks in order
25
- * @param flow
26
- */
27
- getFlowHooks<Name extends FlowName>(flow: Name): HookEntry<FlowInputOf<Name>, Name, FlowStagesOf<Name>, FlowCtxOf<Name>>[];
28
- /**
29
- * Used to pull all hooks registered to specific flow and stage by name,
30
- * this is used to construct the flow graph and execute hooks in order
31
- * @param flow
32
- * @param stage
33
- */
34
- getFlowStageHooks<Name extends FlowName>(flow: Name, stage: FlowStagesOf<Name> | string): HookEntry<FlowInputOf<Name>, Name, FlowStagesOf<Name>, FlowCtxOf<Name>>[];
35
- registerHooks(embedded: boolean, ...records: HookRecord[]): Promise<void[]>;
36
- }
37
- export interface ProviderViews {
38
- /** App-wide singletons, created at boot. Immutable from invokes POV. */
39
- global: ReadonlyMap<Token, unknown>;
40
- /** Session-scoped cache for this sessionId. Mutable. */
41
- session: Map<Token, unknown>;
42
- /** Request-scoped providers for this single invocation. Mutable. */
43
- request: Map<Token, unknown>;
44
- }
45
- export interface ProviderRegistryInterface {
46
- get<T>(token: Token<T>): T;
47
- getProviders(): ProviderEntry[];
48
- getRegistries<T extends RegistryKind>(type: T): RegistryType[T][];
49
- buildViews(session: any): Promise<ProviderViews>;
50
- }
51
- export interface AuthRegistryInterface {
52
- getPrimary(): FrontMcpAuth;
53
- getAuthProviders(): AuthProviderEntry[];
54
- }
55
- export interface AppRegistryInterface {
56
- getApps(): AppEntry[];
57
- }
58
- export interface PluginRegistryInterface {
59
- getPlugins(): PluginEntry[];
60
- }
61
- export interface AdapterRegistryInterface {
62
- getAdapters(): AdapterEntry[];
63
- }
64
- export interface ToolRegistryInterface {
65
- owner: EntryOwnerRef;
66
- getTools(includeHidden?: boolean): ToolEntry[];
67
- getInlineTools(): ToolEntry<any, any>[];
68
- }
69
- export interface ResourceRegistryInterface {
70
- getResources(): ResourceEntry<any, any>[];
71
- getInlineResources(): ResourceEntry<any, any>[];
72
- }
73
- export interface PromptRegistryInterface {
74
- getPrompts(): PromptEntry[];
75
- getInlinePrompts(): PromptEntry[];
76
- }
77
- export interface LoggerRegistryInterface {
78
- getLoggers(): LoggerEntry[];
79
- }
80
- export type GlobalRegistryKind = 'LoggerRegistry' | 'ScopeRegistry';
81
- export type ScopedRegistryKind = 'AppRegistry' | 'AuthRegistry' | 'FlowRegistry' | 'HookRegistry';
82
- export type AppRegistryKind = 'ProviderRegistry' | 'PluginRegistry' | 'AdapterRegistry' | 'ToolRegistry' | 'PromptRegistry' | 'ResourceRegistry';
83
- export type RegistryKind = GlobalRegistryKind | ScopedRegistryKind | AppRegistryKind;
84
- export type RegistryType = {
85
- LoggerRegistry: LoggerRegistryInterface;
86
- ScopeRegistry: ScopeRegistryInterface;
87
- FlowRegistry: FlowRegistryInterface;
88
- HookRegistry: HookRegistryInterface;
89
- AppRegistry: AppRegistryInterface;
90
- AuthRegistry: AuthRegistryInterface;
91
- ProviderRegistry: ProviderRegistryInterface;
92
- PluginRegistry: PluginRegistryInterface;
93
- AdapterRegistry: AdapterRegistryInterface;
94
- ToolRegistry: ToolRegistryInterface;
95
- ResourceRegistry: ResourceRegistryInterface;
96
- PromptRegistry: PromptRegistryInterface;
97
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/internal/registry.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {\n ScopeEntry,\n FlowEntry,\n AuthProviderEntry,\n AppEntry,\n ProviderEntry,\n PluginEntry,\n AdapterEntry,\n PromptEntry,\n ResourceEntry,\n ToolEntry, LoggerEntry,\n} from '../../entries';\nimport {Token} from '../base.interface';\nimport {EntryOwnerRef} from '../../entries';\nimport {FrontMcpAuth} from './primary-auth-provider.interface';\nimport {FlowName} from '../../metadata';\nimport {HookEntry} from \"../../entries/hook.entry\";\nimport {FlowCtxOf, FlowInputOf, FlowStagesOf} from \"../flow.interface\";\nimport {HookRecord} from \"../../records\";\n\nexport interface ScopeRegistryInterface {\n getScopes(): ScopeEntry[];\n}\n\nexport interface FlowRegistryInterface {\n getFlows(): FlowEntry<FlowName>[];\n}\n\nexport interface HookRegistryInterface {\n /**\n * used to pull hooks registered by a class and related to that class only,\n * like registering hooks on specific tool execution\n * @param token\n */\n getClsHooks(token: Token): HookEntry[];\n\n /**\n * Used to pull all hooks registered to specific flow by name,\n * this is used to construct the flow graph and execute hooks in order\n * @param flow\n */\n getFlowHooks<Name extends FlowName>(flow: Name): HookEntry<FlowInputOf<Name>, Name, FlowStagesOf<Name>, FlowCtxOf<Name>>[];\n\n\n /**\n * Used to pull all hooks registered to specific flow and stage by name,\n * this is used to construct the flow graph and execute hooks in order\n * @param flow\n * @param stage\n */\n getFlowStageHooks<Name extends FlowName>(\n flow: Name,\n stage: FlowStagesOf<Name> | string\n ): HookEntry<FlowInputOf<Name>, Name, FlowStagesOf<Name>, FlowCtxOf<Name>>[]\n registerHooks(embedded:boolean,...records: HookRecord[]): Promise<void[]>;\n}\n\n\nexport interface ProviderViews {\n /** App-wide singletons, created at boot. Immutable from invokes POV. */\n global: ReadonlyMap<Token, unknown>;\n /** Session-scoped cache for this sessionId. Mutable. */\n session: Map<Token, unknown>;\n /** Request-scoped providers for this single invocation. Mutable. */\n request: Map<Token, unknown>;\n}\n\n\nexport interface ProviderRegistryInterface {\n get<T>(token: Token<T>): T;\n\n getProviders(): ProviderEntry[];\n\n getRegistries<T extends RegistryKind>(type: T): RegistryType[T][];\n\n // TODO: fix session type\n buildViews(session: any): Promise<ProviderViews>;\n}\n\nexport interface AuthRegistryInterface {\n getPrimary(): FrontMcpAuth;\n\n getAuthProviders(): AuthProviderEntry[];\n}\n\nexport interface AppRegistryInterface {\n getApps(): AppEntry[];\n}\n\nexport interface PluginRegistryInterface {\n getPlugins(): PluginEntry[];\n}\n\nexport interface AdapterRegistryInterface {\n getAdapters(): AdapterEntry[];\n}\n\nexport interface ToolRegistryInterface {\n owner: EntryOwnerRef;\n\n // inline tools plus discovered by nested tool registries\n getTools(includeHidden?: boolean): ToolEntry[];\n\n // inline tools only\n getInlineTools(): ToolEntry<any, any>[];\n}\n\n\nexport interface ResourceRegistryInterface {\n // inline resources plus discovered by nested tool registries\n getResources(): ResourceEntry<any, any>[];\n\n // inline resources only\n getInlineResources(): ResourceEntry<any, any>[];\n}\n\n\nexport interface PromptRegistryInterface {\n // inline prompts plus discovered by nested tool registries\n getPrompts(): PromptEntry[];\n\n // inline prompts only\n getInlinePrompts(): PromptEntry[];\n}\n\n\nexport interface LoggerRegistryInterface {\n getLoggers(): LoggerEntry[];\n\n}\n\n\nexport type GlobalRegistryKind =\n | 'LoggerRegistry'\n | 'ScopeRegistry'\n\nexport type ScopedRegistryKind =\n | 'AppRegistry'\n | 'AuthRegistry'\n | 'FlowRegistry'\n | 'HookRegistry'\n\nexport type AppRegistryKind =\n | 'ProviderRegistry'\n | 'PluginRegistry'\n | 'AdapterRegistry'\n | 'ToolRegistry'\n | 'PromptRegistry'\n | 'ResourceRegistry'\n\n\nexport type RegistryKind = GlobalRegistryKind | ScopedRegistryKind | AppRegistryKind;\n\nexport type RegistryType = {\n LoggerRegistry: LoggerRegistryInterface;\n ScopeRegistry: ScopeRegistryInterface;\n FlowRegistry: FlowRegistryInterface;\n HookRegistry: HookRegistryInterface;\n AppRegistry: AppRegistryInterface;\n AuthRegistry: AuthRegistryInterface,\n ProviderRegistry: ProviderRegistryInterface;\n PluginRegistry: PluginRegistryInterface;\n AdapterRegistry: AdapterRegistryInterface;\n ToolRegistry: ToolRegistryInterface;\n ResourceRegistry: ResourceRegistryInterface;\n PromptRegistry: PromptRegistryInterface;\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.interface.js","sourceRoot":"","sources":["../../../src/interfaces/logger.interface.ts"],"names":[],"mappings":";;;AAeA,MAAsB,qBAAqB;CAE1C;AAFD,sDAEC;AAOD,MAAsB,cAAc;CAgCnC;AAhCD,wCAgCC","sourcesContent":["import { Type } from './base.interface';\nimport { LogLevel } from '../types';\n\n\nexport interface LogRecord {\n level: LogLevel;\n levelName: string;\n message: string;\n args: unknown[];\n timestamp: Date;\n prefix: string;\n}\n\nexport type LogFn = (msg?: any, ...args: any[]) => void;\n\nexport abstract class LogTransportInterface {\n abstract log(rec: LogRecord): void\n}\n\n\nexport type LogTransportType<T = any> =\n | Type<T>\n\n\nexport abstract class FrontMcpLogger {\n abstract child(prefix: string): FrontMcpLogger;\n\n /**\n * Verbose — extremely granular, high-volume logs useful when diagnosing tricky bugs\n * (function entry/exit, detailed branches, low-level I/O). Disable in most environments.\n */\n abstract get verbose(): ((...args: any[]) => void);\n\n /**\n * Debug — development-focused diagnostics (state changes, computed values, API request params),\n * still fairly verbose but less noisy than TRACE. Typically disabled in production.\n */\n abstract get debug(): ((...args: any[]) => void);\n\n /**\n * Info — key milestones in normal operation (server start, feature toggles, user actions,\n * successful requests). Safe to keep enabled in production.\n */\n abstract get info(): ((...args: any[]) => void);\n\n /**\n * Warn — unexpected or suboptimal situations that the system handled and continued\n * (fallbacks, retries, partial failures). Worth investigating but not service-breaking.\n */\n abstract get warn(): ((...args: any[]) => void);\n\n /**\n * Error — failures where an operation could not complete or data is invalid,\n */\n abstract get error(): ((...args: any[]) => void);\n\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.interface.js","sourceRoot":"","sources":["../../../src/interfaces/plugin.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { Type, Token, ValueType, ClassType, FactoryType } from './base.interface';\nimport { PluginMetadata } from '../metadata';\n\nexport interface PluginInterface {\n\n}\n\n\nexport type PluginClassType<Provide> = ClassType<Provide> & PluginMetadata;\nexport type PluginValueType<Provide> = ValueType<Provide> & PluginMetadata;\nexport type PluginFactoryType<Provide, Tokens extends readonly Token[]> = FactoryType<Provide, Tokens> & PluginMetadata;\n\n\nexport type PluginType<Provide extends PluginInterface = PluginInterface> =\n | Type<Provide>\n | PluginClassType<Provide>\n | PluginValueType<Provide>\n | PluginFactoryType<Provide, any[]>\n\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt.interface.js","sourceRoot":"","sources":["../../../src/interfaces/prompt.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { FuncType, Type } from './base.interface';\n\n\ninterface PromptInterface {\n\n}\n\ntype PromptType =\n | Type<PromptInterface>\n | FuncType<PromptInterface>;\n\n\nexport {\n PromptInterface,\n PromptInterface as FrontMcpPromptInterface,\n PromptType,\n PromptType as FrontMcpPromptType,\n};\n\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider.interface.js","sourceRoot":"","sources":["../../../src/interfaces/provider.interface.ts"],"names":[],"mappings":";;AAgCA,sCAIC;AAfD;;;;;;;;;;GAUG;AACH,SAAgB,aAAa,CAC3B,GAAyC;IAEzC,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { Type, Token, ValueType, ClassType, FactoryType, ClassToken } from './base.interface';\nimport { ProviderMetadata } from '../metadata';\n\nexport interface ProviderInterface {\n}\n\nexport type ProviderClassType<Provide> = ClassType<Provide> & ProviderMetadata;\nexport type ProviderValueType<Provide> = ValueType<Provide> & ProviderMetadata;\nexport type ProviderFactoryType<Provide, Tokens extends readonly (ClassToken | Token)[]> = FactoryType<Provide, Tokens> & ProviderMetadata;\n\n\nexport type ProviderType<\n Provide extends ProviderInterface = any,\n Tokens extends readonly (ClassToken | Token)[] = readonly (ClassToken | Token)[]\n> =\n | Type<Provide>\n | ProviderClassType<Provide>\n | ProviderValueType<Provide>\n | ProviderFactoryType<Provide, Tokens>\n\n\n/**\n * Helper to define factory providers without tuple widening.\n * Enforces that `useFactory` params follow the `inject()` tokens (order + arity).\n *\n * Usage:\n * const p = AsyncMcpProvider({\n * provide: RedisProviderRef,\n * inject: () => [ExpenseConfigRef, RedisType] as const,\n * useFactory: async (config, redis) => new RedisProvider(redis),\n * });\n */\nexport function AsyncProvider<Provide, const Tokens extends readonly (ClassToken | Token)[]>(\n cfg: ProviderFactoryType<Provide, Tokens>,\n): ProviderFactoryType<Provide, Tokens> {\n return cfg;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.interface.js","sourceRoot":"","sources":["../../../src/interfaces/resource.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { ResourceMetadata } from '../metadata';\nimport { FuncType, Token, Type } from './base.interface';\n\n\nexport interface ResourceInterface<In = any, Out = any> {\n execute(input: In, context: ResourceContext<In, Out>): Promise<Out>;\n}\n\nexport type ResourceType<In = any, Out = any> =\n | Type<ResourceInterface<In, Out>>\n | FuncType<ResourceInterface<In, Out>>\n\n\nexport interface ResourceContext<In, Out> {\n readonly resourceId: string;\n readonly resourceName: string;\n readonly metadata: ResourceMetadata;\n\n\n get<T>(token: Token<T>): T;\n\n tryGet<T>(token: Token<T>): T | undefined;\n\n get inputHistory(): In[];\n\n get outputHistory(): Out[];\n\n set input(value: In);\n\n get input(): In;\n\n set output(value: Out);\n\n get output(): Out | undefined;\n\n respond(value: Out): never;\n\n fail(reason: string, error: any): never;\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"scope.interface.js","sourceRoot":"","sources":["../../../src/interfaces/scope.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { Type } from './base.interface';\n\nexport interface ScopeInterface {\n\n}\n\nexport type ScopeType = Type<ScopeInterface>\n\n\nexport {\n ScopeInterface as FrontMcpScopeInterface,\n ScopeType as FrontMcpScopeType,\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.interface.js","sourceRoot":"","sources":["../../../src/interfaces/server.interface.ts"],"names":[],"mappings":";;;AAAA,+BAA6E;AAK7E,MAAa,aAAc,SAAQ,sBAAe;IAEhD,IAAI,CAAS;IAGb,KAAK,CAAoC;IACzC,IAAI,CAAO;IACX,WAAW,CAAiB;CAC7B;AARD,sCAQC;AAED,MAAsB,cAAe,SAAQ,qBAAkB;CAU9D;AAVD,wCAUC;AAMD,MAAsB,cAAc;CA+BnC;AA/BD,wCA+BC","sourcesContent":["import { IncomingMessage, ServerResponse as HttpServerResponse } from 'http';\nimport { Authorization } from '../types'; // TODO: move to internal\n\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';\n\nexport class ServerRequest extends IncomingMessage {\n declare method: HttpMethod;\n path: string;\n declare url: string;\n declare headers: Record<string, string>;\n query: Record<string, string | string[]>;\n body?: any;\n authSession?: Authorization;\n}\n\nexport abstract class ServerResponse extends HttpServerResponse {\n abstract status(code: number): ServerResponse;\n\n abstract json(payload: any): void;\n\n abstract send(payload: any): void;\n\n abstract redirect(url: string): void;\n\n abstract redirect(status: number, url: string): void;\n}\n\nexport type NextFn = () => Promise<void> | void;\n\nexport type ServerRequestHandler = (req: ServerRequest, res: ServerResponse, next: NextFn) => Promise<void> | void;\n\nexport abstract class FrontMcpServer {\n\n /**\n * Register a middleware handler for a specific entry path.\n * @param entryPath - e.g. '' or '/mcp'\n * @param handler - (req, res, next) => {// middleware // next()}\n */\n abstract registerMiddleware(entryPath: string, handler: ServerRequestHandler): Promise<void> | void;\n\n /**\n * Register a route handler for a specific path.\n * @param method - e.g. 'GET' or 'POST'\n * @param path - e.g. '/mcp/invoke'\n * @param handler - (req, res) => {// route handler // res.end() }\n */\n abstract registerRoute(method: HttpMethod, path: string, handler: ServerRequestHandler): Promise<void> | void;\n\n /**\n * Enhance a request handler with request/response processing and error handling.\n * This handle will be stored as the first middleware in the chain to align adapter handler\n * with the gateway's request/response processing.\n */\n abstract enhancedHandler(\n handler: ServerRequestHandler,\n ): (req: any, res: any, next: () => any) => Promise<void> | void;\n\n\n /**\n * Start the server on the specified port\n */\n abstract start(port?: number): Promise<void> | void;\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-hook.interface.js","sourceRoot":"","sources":["../../../src/interfaces/session-hook.interface.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,IAAY,gBAuIX;AAvID,WAAY,gBAAgB;IAC1B;;;;;;OAMG;IACH,2DAAuC,CAAA;IAEvC;;;;OAIG;IACH,yDAAqC,CAAA;IAErC;;;;OAIG;IACH,2DAAuC,CAAA;IAEvC,gDAAgD;IAEhD;;;;OAIG;IACH,mDAA+B,CAAA;IAE/B;;;;OAIG;IACH,mDAA+B,CAAA;IAE/B;;;;;;OAMG;IACH,2DAAuC,CAAA;IAEvC;;;;;OAKG;IACH,2DAAuC,CAAA;IAEvC;;;;OAIG;IACH,uDAAmC,CAAA;IAEnC,2CAA2C;IAE3C;;;;OAIG;IACH,qDAAiC,CAAA;IAEjC;;;;OAIG;IACH,mDAA+B,CAAA;IAE/B,iCAAiC;IAEjC;;;OAGG;IACH,6DAAyC,CAAA;IAEzC;;;OAGG;IACH,2DAAuC,CAAA;IAEvC,4DAA4D;IAE5D;;;;;OAKG;IACH,iDAA6B,CAAA;IAE7B;;;;;;OAMG;IACH,uCAAmB,CAAA;IAEnB;;;;OAIG;IACH,2CAAuB,CAAA;IAEvB;;;;OAIG;IACH,yCAAqB,CAAA;IAErB;;;;;;OAMG;IACH,2CAAuB,CAAA;AACzB,CAAC,EAvIW,gBAAgB,gCAAhB,gBAAgB,QAuI3B","sourcesContent":["/**\n * Lifecycle stages for session invocation.\n *\n * Ordering notes:\n * - \"will*\" stages run before the action; \"did*\" stages run after.\n * - Higher `priority()` runs earlier for \"will*\" (outermost), and later for \"did*\".\n * - Finalization stages (`willFinalize`, `willAudit`, `didAudit`, `onMetrics`) should be placed\n * in your plan’s `finalize` array to run on both success and error paths.\n *\n * Control flow:\n * - Hooks may call `ctx.respond(value)` to short-circuit with a return value.\n * - Hooks may call `ctx.abort(reason, code?, httpStatus?)` to stop with an error.\n *\n * Common context fields:\n * - `ctx.sessionId` SecureMcp session id (== secureJwt) once created/validated.\n * - `ctx.input`/`output` Arbitrary payloads for the current flow.\n * - `ctx.data` Shared bag for cross-hook state.\n * - `ctx.providers` Optional provider views if needed for UI/selection.\n */\nexport enum SessionHookStage {\n /** Prepare a new session (or re-register an incoming secureJwt).\n * Responsibilities:\n * - Validate incoming token (if any); compute defaults; attach user hints.\n * - Initialize per-session resources and attach to `ctx.data`.\n * Failure modes:\n * - `ctx.abort('invalid jwt', 'INVALID_SESSION', 401)`.\n */\n willCreateSession = 'willCreateSession',\n\n /** Session created and registered.\n * Responsibilities:\n * - Announce readiness (mount handlers/streams), emit side-effects if needed.\n * - Optionally shape `ctx.output` with a `SessionContextView`.\n */\n didCreateSession = 'didCreateSession',\n\n /** Bind DI providers needed for this session/request.\n * Responsibilities:\n * - Resolve and bind providers so later hooks can `ctx.get(...)`.\n * - May set `ctx.bindProvider/bindProviders` helpers.\n */\n willBindProviders = 'willBindProviders',\n\n // ---------- Auth (within a session) ----------\n\n /** Signal the beginning of an auth sequence in the scope of this session.\n * Responsibilities:\n * - Initialize auth-related state (PKCE/state, CSRF, telemetry).\n * - Decide transport (SSE/StreamableHTTP) for status/URL events if applicable.\n */\n willBeginAuth = 'willBeginAuth',\n\n /** Streamable authorization progress within the session.\n * Responsibilities:\n * - Emit URL/status events (e.g., “authorize_url”, “awaiting_callback”).\n * - Optionally `ctx.respond({event: ...})` for push-style transports.\n */\n willAuthorize = 'willAuthorize', // stream-able events (URL/status)\n\n /** Prepare and gate the token exchange with the provider.\n * Responsibilities:\n * - Verify callback params; ensure prerequisites (sessionId present).\n * - Compute exchange request; rate-limit/anti-replay checks.\n * Failure modes:\n * - `ctx.abort('invalid state/pkce', 'OAUTH_CALLBACK_ERROR', 400)`.\n */\n willExchangeToken = 'willExchangeToken',\n\n /** SecureMcp JWT has been minted/confirmed for this session.\n * Responsibilities:\n * - React to issuance (e.g., persist session claims, notify listeners).\n * Notes:\n * - Fired once the session’s secureJwt is known; avoid logging secrets.\n */\n didIssueSecureJwt = 'didIssueSecureJwt',\n\n /** Encrypt and store provider tokens for this session.\n * Responsibilities:\n * - Write encrypted blobs to the session record (per provider).\n * - Derive minimal metadata (scopes/expiry) for later claims-only exposure.\n */\n willStoreTokens = 'willStoreTokens',\n\n // ---------- Access (read path) ----------\n\n /** Authorize and prepare a session read.\n * Responsibilities:\n * - Validate access to the session; attach read-scoped providers if required.\n * - Optionally shape a partial view before execute.\n */\n willGetSession = 'willGetSession',\n\n /** Post-process the session view.\n * Responsibilities:\n * - Redact/transform/derive fields for the final response.\n * - Set `ctx.output` to a `SessionContextView`.\n */\n didGetSession = 'didGetSession',\n\n // ---------- Disposal ----------\n\n /** Announce shutdown and allow flush/cleanup.\n * Responsibilities:\n * - Close streams, unsubscribe listeners, schedule disposers.\n */\n willDisposeSession = 'willDisposeSession',\n\n /** Confirm teardown and emit metrics.\n * Responsibilities:\n * - Final confirmation of resource release; summarize outcome.\n */\n didDisposeSession = 'didDisposeSession',\n\n // ---------- Finalize / audit / metrics / errors ----------\n\n /** Optional “late finally” hook if you need a single place before audit/metrics.\n * Responsibilities:\n * - Last-chance cleanup across success/error paths (idempotent, non-throwing).\n * Notes:\n * - Include this stage in your plan’s `finalize` array to activate.\n */\n willFinalize = 'willFinalize',\n\n /** Centralized error handler.\n * Responsibilities:\n * - Redact sensitive data; map internal errors to public codes.\n * - Optionally `ctx.respond({ error })` or `ctx.abort(...)`.\n * Notes:\n * - Should not throw; runs before audit/metrics finalize.\n */\n onError = 'onError',\n\n /** Pre-audit collection on both success and error paths.\n * Responsibilities:\n * - Build audit envelope (actor, sessionId, providers touched).\n * - Normalize and strip secrets (no raw tokens).\n */\n willAudit = 'willAudit',\n\n /** Persist/emit the audit record.\n * Responsibilities:\n * - Write to audit sink(s) with outcome and timings.\n * - Correlate via `ctx.requestId`/`ctx.sessionId`.\n */\n didAudit = 'didAudit',\n\n /** Telemetry/metrics emission for both success and errors.\n * Responsibilities:\n * - Counters & timings (create/get/dispose/auth/exchange/store).\n * - Error code/tag cardinality kept small for SLOs/alerts.\n * Constraints:\n * - Non-throwing; must not alter control flow.\n */\n onMetrics = 'onMetrics',\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-hook.interface.js","sourceRoot":"","sources":["../../../src/interfaces/tool-hook.interface.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,IAAY,aA+GX;AA/GD,WAAY,aAAa;IACvB;gEAC4D;IAC5D,wDAAuC,CAAA;IAEvC,uFAAuF;IACvF,oEAAmD,CAAA;IAEnD,0EAA0E;IAC1E,kEAAiD,CAAA;IAEjD,kFAAkF;IAClF,gDAA+B,CAAA;IAE/B,8FAA8F;IAC9F,sDAAqC,CAAA;IAErC,oFAAoF;IACpF,gEAA+C,CAAA;IAE/C,0DAA0D;IAE1D,+EAA+E;IAC/E,sDAAqC,CAAA;IAErC,0EAA0E;IAC1E,oDAAmC,CAAA;IAEnC,2EAA2E;IAC3E,8DAA6C,CAAA;IAE7C,wDAAwD;IACxD,4DAA2C,CAAA;IAE3C,kDAAkD;IAElD,8EAA8E;IAC9E,kDAAiC,CAAA;IAEjC,sEAAsE;IACtE,wDAAuC,CAAA;IAEvC,2EAA2E;IAC3E,0DAAyC,CAAA;IAEzC,+DAA+D;IAC/D,oDAAmC,CAAA;IAEnC,2EAA2E;IAC3E,wDAAuC,CAAA;IAEvC,4CAA4C;IAE5C,gFAAgF;IAChF,gDAA+B,CAAA;IAE/B,0EAA0E;IAC1E,4CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,8CAA6B,CAAA;IAE7B,wDAAwD;IACxD,kDAAiC,CAAA;IAEjC,8CAA8C;IAE9C,mHAAmH;IACnH,gDAA+B,CAAA;IAE/B,4EAA4E;IAC5E,4CAA2B,CAAA;IAE3B,gFAAgF;IAChF,0CAAyB,CAAA;IAEzB,mDAAmD;IAEnD,8EAA8E;IAC9E,sDAAqC,CAAA;IAErC,2EAA2E;IAC3E,0DAAyC,CAAA;IAEzC,mFAAmF;IACnF,4DAA2C,CAAA;IAE3C,0DAA0D;IAE1D,oFAAoF;IACpF,oCAAmB,CAAA;IAEnB,gEAAgE;IAChE,sCAAqB,CAAA;IAErB,uEAAuE;IACvE,wCAAuB,CAAA;IAEvB,+DAA+D;IAC/D,sCAAqB,CAAA;IAErB,mDAAmD;IACnD,wCAAuB,CAAA;IAEvB,yDAAyD;IAEzD,yFAAyF;IACzF,oCAAmB,CAAA;IAEnB,6EAA6E;IAC7E,0DAAyC,CAAA;AAC3C,CAAC,EA/GW,aAAa,6BAAb,aAAa,QA+GxB","sourcesContent":["/**\n * Lifecycle stages for tool invocation.\n *\n * Ordering notes:\n * - \"will*\" stages run before the action; \"did*\" run after.\n * - Higher `priority()` runs earlier for \"will*\" (outermost for wrappers), and later for \"did*\".\n * - `aroundExecute` wraps the actual execution block (including will/didExecute inside).\n *\n * Control flow:\n * - Hooks may call `ctx.respond(value)` to short-circuit with a value.\n * - Hooks may call `ctx.abort(reason, code?, httpStatus?)` to deny/stop.\n * - Hooks may call `ctx.retryAfter(ms, reason?)` to signal backoff.\n */\nexport enum ToolHookStage {\n /** Bind DI providers needed for this invocation (from ctor tokens + hook/tool `provide()`).\n * Runs very early so later hooks can use `ctx.get(...)`. */\n willBindProviders = 'willBindProviders',\n\n /** Last chance to populate/shape the invocation context (user, tenant, attrs, ids). */\n willCreateInvokeContext = 'willCreateInvokeContext',\n\n /** Post-context creation; good for sanity checks, tracing decorations. */\n didCreateInvokeContext = 'didCreateInvokeContext',\n\n /** Authorization gate (roles/scopes/RBAC/ABAC). May `abort()` if unauthorized. */\n willAuthorize = 'willAuthorize',\n\n /** Consent gate. May `respond()` with a consent challenge or `abort()` if missing consent. */\n willCheckConsent = 'willCheckConsent',\n\n /** Feature-flag gate (enable/disable per user/tenant/experiment). May `abort()`. */\n willCheckFeatureFlags = 'willCheckFeatureFlags',\n\n // ---------------- Capacity & Resilience ----------------\n\n /** Acquire rate-limit quota. May `retryAfter()` or `abort()` on exhaustion. */\n willAcquireQuota = 'willAcquireQuota',\n\n /** Release rate-limit quota (best-effort; typically run in `finally`). */\n didReleaseQuota = 'didReleaseQuota',\n\n /** Acquire concurrency slot/semaphore. May `retryAfter()` or `abort()`. */\n willAcquireSemaphore = 'willAcquireSemaphore',\n\n /** Release concurrency slot/semaphore (best-effort). */\n didReleaseSemaphore = 'didReleaseSemaphore',\n\n // ---------------- Input shaping ----------------\n\n /** Parse/coerce raw input (types, defaults). Mutate `ctx.input` as needed. */\n willParseInput = 'willParseInput',\n\n /** Validate business rules for input. May `abort()` on violations. */\n willValidateInput = 'willValidateInput',\n\n /** Normalize/canonicalize input (ids → uuids, trim, sort fields, etc.). */\n willNormalizeInput = 'willNormalizeInput',\n\n /** Apply DLP/minimization to input (mask/drop/hash fields). */\n willRedactInput = 'willRedactInput',\n\n /** Inject credentials/secrets (tokens, API keys) into context or input. */\n willInjectSecrets = 'willInjectSecrets',\n\n // ---------------- Caching ----------------\n\n /** Attempt to serve from cache. May `respond(cachedValue)` to short-circuit. */\n willReadCache = 'willReadCache',\n\n /** Metrics/telemetry for cache hit; typically emitted by cache plugin. */\n didCacheHit = 'didCacheHit',\n\n /** Metrics/telemetry for cache miss; typically emitted by cache plugin. */\n didCacheMiss = 'didCacheMiss',\n\n /** Write result to cache after successful execution. */\n willWriteCache = 'willWriteCache',\n\n // ---------------- Execution ----------------\n\n /** Around wrapper for execution (timeouts/retries/circuit/tracing). Must call `next()` unless short-circuiting. */\n aroundExecute = 'aroundExecute',\n\n /** Right before calling the tool implementation; may mutate `ctx.input`. */\n willExecute = 'willExecute',\n\n /** Right after tool returns; `ctx.output` is available for downstream hooks. */\n didExecute = 'didExecute',\n\n // ---------------- Output shaping ----------------\n\n /** Apply DLP/minimization to output (mask/drop/truncate sensitive fields). */\n willRedactOutput = 'willRedactOutput',\n\n /** Validate output against business/schema rules. May `abort()` or fix. */\n willValidateOutput = 'willValidateOutput',\n\n /** Transform output shape (projection/mapping/pagination). Mutate `ctx.output`. */\n willTransformOutput = 'willTransformOutput',\n\n // ---------------- Retry & Observability ----------------\n\n /** Called on each retry attempt by a retry wrapper (emit metrics/backoff hints). */\n onRetry = 'onRetry',\n\n /** Called when retries are exhausted and execution gives up. */\n onGiveUp = 'onGiveUp',\n\n /** Prepare audit payload (apply redaction) and/or write audit logs. */\n willAudit = 'willAudit',\n\n /** Post-audit hook (confirm persistence, forward to sinks). */\n didAudit = 'didAudit',\n\n /** Emit metrics (counters, histograms, traces). */\n onMetrics = 'onMetrics',\n\n // ---------------- Error & Finalization ----------------\n\n /** Error handler for unexpected failures or control errors. Can map/normalize errors. */\n onError = 'onError',\n\n /** Always runs at the very end (success or error). Cleanup/releases here. */\n willFinalizeInvoke = 'willFinalizeInvoke',\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool.interface.js","sourceRoot":"","sources":["../../../src/interfaces/tool.interface.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAKlC,qDAA6C;AAuB7C,MAAsB,WAAW;IACvB,SAAS,CAA4B;IACpC,QAAQ,CAAW;IAET,KAAK,CAAS;IACd,MAAM,CAAS;IACf,QAAQ,CAAS;IAC3B,QAAQ,CAAe;IACb,MAAM,CAAiB;IAEhC,WAAW,CAAS;IAE9B,uCAAuC;IAC/B,SAAS,CAAqB;IAC9B,MAAM,CAAM;IAEpB,wCAAwC;IAChC,YAAY,CAAsB;IAClC,OAAO,CAAO;IAEd,MAAM,CAAS;IAEvB,iBAAiB;IACA,aAAa,GAAuB,EAAE,CAAC;IACvC,cAAc,GAAwB,EAAE,CAAC;IAG1D,YAAY,IAAsB;QAChC,MAAM,EAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAC;QAC5D,IAAI,CAAC,KAAK,GAAG,IAAA,mBAAU,GAAE,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAID,GAAG,CAAI,KAAe;QACpB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAI,KAAe;QACvB,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,0CAA0C,EAAE,KAAK,CAAC,CAAC;YACpE,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAY,CAAC;IAC3B,CAAC;IAED,IAAW,KAAK,CAAC,CAAiB;QAChC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YACtB,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,KAAK,EAAE,CAAC;SACT,CAAC,CAAC;IACL,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,MAAM,CAAC,CAAkB;QAClC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAC,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,GAAE,CAAC,CAAC;IACjF,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,OAAO,CAAC,KAAU;QAChB,iEAAiE;QACjE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,4BAAW,CAAC,OAAO,CAAM,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,sDAAsD;IAC5C,IAAI,CAAC,GAAU;QACvB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,4BAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,IAAI,CAAC,KAAa;QAChB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,KAAwB,EAAE,IAAkB;QAChD,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC;CACF;AAvGD,kCAuGC","sourcesContent":["import {randomUUID} from \"crypto\";\nimport {FuncType, Token, Type} from \"./base.interface\";\nimport {ProviderRegistryInterface} from \"./internal\";\nimport {ToolMetadata} from \"../metadata\";\nimport {FrontMcpLogger} from \"./logger.interface\";\nimport {FlowControl} from \"./flow.interface\";\nimport {URL} from \"url\";\nimport {AuthInfo} from \"@modelcontextprotocol/sdk/server/auth/types.js\";\n\nexport type ToolType<T = any> =\n | Type<T>\n | FuncType<T>\n\ntype HistoryEntry<T> = {\n at: number;\n stage?: string;\n value: T | undefined;\n note?: string;\n};\n\nexport type ToolCtorArgs<In> = {\n metadata: ToolMetadata;\n input: In;\n providers: ProviderRegistryInterface;\n logger: FrontMcpLogger\n authInfo: AuthInfo;\n}\n\nexport abstract class ToolContext<In = any, Out= any> {\n private providers: ProviderRegistryInterface;\n readonly authInfo: AuthInfo;\n\n protected readonly runId: string;\n protected readonly toolId: string;\n protected readonly toolName: string;\n readonly metadata: ToolMetadata;\n protected readonly logger: FrontMcpLogger;\n\n protected activeStage: string;\n\n // ---- INPUT storages (backing fields)\n private _rawInput?: Partial<In> | any;\n private _input?: In;\n\n // ---- OUTPUT storages (backing fields)\n private _outputDraft?: Partial<Out> | any;\n private _output?: Out;\n\n private _error?: Error;\n\n // ---- histories\n private readonly _inputHistory: HistoryEntry<In>[] = [];\n private readonly _outputHistory: HistoryEntry<Out>[] = [];\n\n\n constructor(args: ToolCtorArgs<In>) {\n const {metadata, input, providers, logger, authInfo} = args;\n this.runId = randomUUID();\n this.toolName = metadata.name;\n this.toolId = metadata.id ?? metadata.name;\n this.metadata = metadata;\n this._input = input;\n this.providers = providers;\n this.logger = logger.child(`tool:${this.toolId}`);\n this.authInfo = authInfo;\n }\n\n abstract execute(input: In): Promise<Out>;\n\n get<T>(token: Token<T>): T {\n return this.providers.get(token);\n }\n\n tryGet<T>(token: Token<T>): T | undefined {\n try {\n return this.providers.get(token);\n } catch (e) {\n this.logger.warn(\"Requesting provider that doesn't exist: \", token);\n return undefined;\n }\n }\n\n public get input(): In {\n return this._input as In;\n }\n\n public set input(v: In | undefined) {\n this._input = v;\n this._inputHistory.push({\n at: Date.now(),\n stage: this.activeStage,\n value: v,\n });\n }\n\n public get inputHistory(): ReadonlyArray<HistoryEntry<In>> {\n return this._inputHistory;\n }\n\n public get output(): Out | undefined {\n return this._output;\n }\n\n public set output(v: Out | undefined) {\n this._output = v;\n this._outputHistory.push({at: Date.now(), stage: this.activeStage, value: v,});\n }\n\n public get outputHistory(): ReadonlyArray<HistoryEntry<Out>> {\n return this._outputHistory;\n }\n\n respond(value: Out): never {\n // record validated output and surface the value via control flow\n this.output = value;\n FlowControl.respond<Out>(value);\n }\n\n /** Fail the run (invoker will run error/finalize). */\n protected fail(err: Error): never {\n this._error = err;\n FlowControl.fail(err);\n }\n\n mark(stage: string): void {\n this.activeStage = stage;\n }\n\n fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {\n return fetch(input, init);\n }\n}\n\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.metadata.js","sourceRoot":"","sources":["../../../src/metadata/adapter.metadata.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAcX,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACI,CAAC,CAAC,WAAW,EAAE,CAAC","sourcesContent":["import { z } from 'zod';\nimport { RawZodShape } from '../types';\n\n\n/**\n * Declarative metadata describing what a FrontMcpAdapter contributes at app scope.\n */\nexport interface AdapterMetadata {\n id?: string;\n name: string;\n description?: string;\n}\n\n\nexport const frontMcpAdapterMetadataSchema = z.object({\n id: z.string().optional(),\n name: z.string().min(1),\n description: z.string().optional(),\n} satisfies RawZodShape<AdapterMetadata>).passthrough();\n"]}