nitrostack 1.0.83 → 1.0.85

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 (439) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +42 -137
  3. package/assets/gif/nitrocli.gif +0 -0
  4. package/assets/gif/nitrostudio-chat.gif +0 -0
  5. package/assets/gif/nitrostudio-main.gif +0 -0
  6. package/assets/gif/nitrostudio-testing.gif +0 -0
  7. package/package.json +15 -50
  8. package/dist/auth/__tests__/api-key.test.d.ts +0 -2
  9. package/dist/auth/__tests__/api-key.test.d.ts.map +0 -1
  10. package/dist/auth/__tests__/api-key.test.js +0 -156
  11. package/dist/auth/__tests__/api-key.test.js.map +0 -1
  12. package/dist/auth/__tests__/client.test.d.ts +0 -2
  13. package/dist/auth/__tests__/client.test.d.ts.map +0 -1
  14. package/dist/auth/__tests__/client.test.js +0 -173
  15. package/dist/auth/__tests__/client.test.js.map +0 -1
  16. package/dist/auth/__tests__/middleware.test.d.ts +0 -2
  17. package/dist/auth/__tests__/middleware.test.d.ts.map +0 -1
  18. package/dist/auth/__tests__/middleware.test.js +0 -232
  19. package/dist/auth/__tests__/middleware.test.js.map +0 -1
  20. package/dist/auth/__tests__/pkce.test.d.ts +0 -2
  21. package/dist/auth/__tests__/pkce.test.d.ts.map +0 -1
  22. package/dist/auth/__tests__/pkce.test.js +0 -110
  23. package/dist/auth/__tests__/pkce.test.js.map +0 -1
  24. package/dist/auth/__tests__/quick-setup.test.d.ts +0 -2
  25. package/dist/auth/__tests__/quick-setup.test.d.ts.map +0 -1
  26. package/dist/auth/__tests__/quick-setup.test.js +0 -95
  27. package/dist/auth/__tests__/quick-setup.test.js.map +0 -1
  28. package/dist/auth/__tests__/secure-secret.test.d.ts +0 -2
  29. package/dist/auth/__tests__/secure-secret.test.d.ts.map +0 -1
  30. package/dist/auth/__tests__/secure-secret.test.js +0 -104
  31. package/dist/auth/__tests__/secure-secret.test.js.map +0 -1
  32. package/dist/auth/__tests__/server-integration.test.d.ts +0 -2
  33. package/dist/auth/__tests__/server-integration.test.d.ts.map +0 -1
  34. package/dist/auth/__tests__/server-integration.test.js +0 -156
  35. package/dist/auth/__tests__/server-integration.test.js.map +0 -1
  36. package/dist/auth/__tests__/server-metadata.test.d.ts +0 -2
  37. package/dist/auth/__tests__/server-metadata.test.d.ts.map +0 -1
  38. package/dist/auth/__tests__/server-metadata.test.js +0 -72
  39. package/dist/auth/__tests__/server-metadata.test.js.map +0 -1
  40. package/dist/auth/__tests__/simple-jwt.test.d.ts +0 -2
  41. package/dist/auth/__tests__/simple-jwt.test.d.ts.map +0 -1
  42. package/dist/auth/__tests__/simple-jwt.test.js +0 -125
  43. package/dist/auth/__tests__/simple-jwt.test.js.map +0 -1
  44. package/dist/auth/__tests__/token-store.test.d.ts +0 -2
  45. package/dist/auth/__tests__/token-store.test.d.ts.map +0 -1
  46. package/dist/auth/__tests__/token-store.test.js +0 -167
  47. package/dist/auth/__tests__/token-store.test.js.map +0 -1
  48. package/dist/auth/__tests__/token-validation.test.d.ts +0 -2
  49. package/dist/auth/__tests__/token-validation.test.d.ts.map +0 -1
  50. package/dist/auth/__tests__/token-validation.test.js +0 -219
  51. package/dist/auth/__tests__/token-validation.test.js.map +0 -1
  52. package/dist/auth/api-key.d.ts +0 -118
  53. package/dist/auth/api-key.d.ts.map +0 -1
  54. package/dist/auth/api-key.js +0 -168
  55. package/dist/auth/api-key.js.map +0 -1
  56. package/dist/auth/client.d.ts +0 -151
  57. package/dist/auth/client.d.ts.map +0 -1
  58. package/dist/auth/client.js +0 -330
  59. package/dist/auth/client.js.map +0 -1
  60. package/dist/auth/index.d.ts +0 -31
  61. package/dist/auth/index.d.ts.map +0 -1
  62. package/dist/auth/index.js +0 -46
  63. package/dist/auth/index.js.map +0 -1
  64. package/dist/auth/middleware.d.ts +0 -95
  65. package/dist/auth/middleware.d.ts.map +0 -1
  66. package/dist/auth/middleware.js +0 -260
  67. package/dist/auth/middleware.js.map +0 -1
  68. package/dist/auth/pkce.d.ts +0 -53
  69. package/dist/auth/pkce.d.ts.map +0 -1
  70. package/dist/auth/pkce.js +0 -105
  71. package/dist/auth/pkce.js.map +0 -1
  72. package/dist/auth/quick-setup.d.ts +0 -94
  73. package/dist/auth/quick-setup.d.ts.map +0 -1
  74. package/dist/auth/quick-setup.js +0 -210
  75. package/dist/auth/quick-setup.js.map +0 -1
  76. package/dist/auth/secure-secret.d.ts +0 -136
  77. package/dist/auth/secure-secret.d.ts.map +0 -1
  78. package/dist/auth/secure-secret.js +0 -182
  79. package/dist/auth/secure-secret.js.map +0 -1
  80. package/dist/auth/server-integration.d.ts +0 -97
  81. package/dist/auth/server-integration.d.ts.map +0 -1
  82. package/dist/auth/server-integration.js +0 -182
  83. package/dist/auth/server-integration.js.map +0 -1
  84. package/dist/auth/server-metadata.d.ts +0 -51
  85. package/dist/auth/server-metadata.d.ts.map +0 -1
  86. package/dist/auth/server-metadata.js +0 -106
  87. package/dist/auth/server-metadata.js.map +0 -1
  88. package/dist/auth/simple-jwt.d.ts +0 -174
  89. package/dist/auth/simple-jwt.d.ts.map +0 -1
  90. package/dist/auth/simple-jwt.js +0 -162
  91. package/dist/auth/simple-jwt.js.map +0 -1
  92. package/dist/auth/token-store.d.ts +0 -104
  93. package/dist/auth/token-store.d.ts.map +0 -1
  94. package/dist/auth/token-store.js +0 -205
  95. package/dist/auth/token-store.js.map +0 -1
  96. package/dist/auth/token-validation.d.ts +0 -59
  97. package/dist/auth/token-validation.d.ts.map +0 -1
  98. package/dist/auth/token-validation.js +0 -241
  99. package/dist/auth/token-validation.js.map +0 -1
  100. package/dist/auth/types.d.ts +0 -215
  101. package/dist/auth/types.d.ts.map +0 -1
  102. package/dist/auth/types.js +0 -6
  103. package/dist/auth/types.js.map +0 -1
  104. package/dist/core/__tests__/app-decorator.test.d.ts +0 -2
  105. package/dist/core/__tests__/app-decorator.test.d.ts.map +0 -1
  106. package/dist/core/__tests__/app-decorator.test.js +0 -100
  107. package/dist/core/__tests__/app-decorator.test.js.map +0 -1
  108. package/dist/core/__tests__/app-factory.extended.test.d.ts +0 -2
  109. package/dist/core/__tests__/app-factory.extended.test.d.ts.map +0 -1
  110. package/dist/core/__tests__/app-factory.extended.test.js +0 -244
  111. package/dist/core/__tests__/app-factory.extended.test.js.map +0 -1
  112. package/dist/core/__tests__/builders.test.d.ts +0 -2
  113. package/dist/core/__tests__/builders.test.d.ts.map +0 -1
  114. package/dist/core/__tests__/builders.test.js +0 -98
  115. package/dist/core/__tests__/builders.test.js.map +0 -1
  116. package/dist/core/__tests__/component.test.d.ts +0 -2
  117. package/dist/core/__tests__/component.test.d.ts.map +0 -1
  118. package/dist/core/__tests__/component.test.js +0 -151
  119. package/dist/core/__tests__/component.test.js.map +0 -1
  120. package/dist/core/__tests__/config-module.test.d.ts +0 -2
  121. package/dist/core/__tests__/config-module.test.d.ts.map +0 -1
  122. package/dist/core/__tests__/config-module.test.js +0 -90
  123. package/dist/core/__tests__/config-module.test.js.map +0 -1
  124. package/dist/core/__tests__/core-modules.test.d.ts +0 -2
  125. package/dist/core/__tests__/core-modules.test.d.ts.map +0 -1
  126. package/dist/core/__tests__/core-modules.test.js +0 -36
  127. package/dist/core/__tests__/core-modules.test.js.map +0 -1
  128. package/dist/core/__tests__/di.test.d.ts +0 -2
  129. package/dist/core/__tests__/di.test.d.ts.map +0 -1
  130. package/dist/core/__tests__/di.test.js +0 -101
  131. package/dist/core/__tests__/di.test.js.map +0 -1
  132. package/dist/core/__tests__/errors.test.d.ts +0 -2
  133. package/dist/core/__tests__/errors.test.d.ts.map +0 -1
  134. package/dist/core/__tests__/errors.test.js +0 -109
  135. package/dist/core/__tests__/errors.test.js.map +0 -1
  136. package/dist/core/__tests__/final.blitz.test.d.ts +0 -2
  137. package/dist/core/__tests__/final.blitz.test.d.ts.map +0 -1
  138. package/dist/core/__tests__/final.blitz.test.js +0 -327
  139. package/dist/core/__tests__/final.blitz.test.js.map +0 -1
  140. package/dist/core/__tests__/jwt-module.test.d.ts +0 -2
  141. package/dist/core/__tests__/jwt-module.test.d.ts.map +0 -1
  142. package/dist/core/__tests__/jwt-module.test.js +0 -60
  143. package/dist/core/__tests__/jwt-module.test.js.map +0 -1
  144. package/dist/core/__tests__/logger.test.d.ts +0 -2
  145. package/dist/core/__tests__/logger.test.d.ts.map +0 -1
  146. package/dist/core/__tests__/logger.test.js +0 -83
  147. package/dist/core/__tests__/logger.test.js.map +0 -1
  148. package/dist/core/__tests__/models.test.d.ts +0 -2
  149. package/dist/core/__tests__/models.test.d.ts.map +0 -1
  150. package/dist/core/__tests__/models.test.js +0 -142
  151. package/dist/core/__tests__/models.test.js.map +0 -1
  152. package/dist/core/__tests__/module.test.d.ts +0 -2
  153. package/dist/core/__tests__/module.test.d.ts.map +0 -1
  154. package/dist/core/__tests__/module.test.js +0 -58
  155. package/dist/core/__tests__/module.test.js.map +0 -1
  156. package/dist/core/__tests__/oauth-module.test.d.ts +0 -2
  157. package/dist/core/__tests__/oauth-module.test.d.ts.map +0 -1
  158. package/dist/core/__tests__/oauth-module.test.js +0 -168
  159. package/dist/core/__tests__/oauth-module.test.js.map +0 -1
  160. package/dist/core/__tests__/oauth.extended.test.d.ts +0 -2
  161. package/dist/core/__tests__/oauth.extended.test.d.ts.map +0 -1
  162. package/dist/core/__tests__/oauth.extended.test.js +0 -146
  163. package/dist/core/__tests__/oauth.extended.test.js.map +0 -1
  164. package/dist/core/__tests__/prompt.test.d.ts +0 -2
  165. package/dist/core/__tests__/prompt.test.d.ts.map +0 -1
  166. package/dist/core/__tests__/prompt.test.js +0 -126
  167. package/dist/core/__tests__/prompt.test.js.map +0 -1
  168. package/dist/core/__tests__/resource.test.d.ts +0 -2
  169. package/dist/core/__tests__/resource.test.d.ts.map +0 -1
  170. package/dist/core/__tests__/resource.test.js +0 -173
  171. package/dist/core/__tests__/resource.test.js.map +0 -1
  172. package/dist/core/__tests__/server.extended.test.d.ts +0 -2
  173. package/dist/core/__tests__/server.extended.test.d.ts.map +0 -1
  174. package/dist/core/__tests__/server.extended.test.js +0 -242
  175. package/dist/core/__tests__/server.extended.test.js.map +0 -1
  176. package/dist/core/__tests__/server.test.d.ts +0 -2
  177. package/dist/core/__tests__/server.test.d.ts.map +0 -1
  178. package/dist/core/__tests__/server.test.js +0 -120
  179. package/dist/core/__tests__/server.test.js.map +0 -1
  180. package/dist/core/__tests__/transport.http.test.d.ts +0 -2
  181. package/dist/core/__tests__/transport.http.test.d.ts.map +0 -1
  182. package/dist/core/__tests__/transport.http.test.js +0 -119
  183. package/dist/core/__tests__/transport.http.test.js.map +0 -1
  184. package/dist/core/__tests__/transport.streamable.test.d.ts +0 -2
  185. package/dist/core/__tests__/transport.streamable.test.d.ts.map +0 -1
  186. package/dist/core/__tests__/transport.streamable.test.js +0 -168
  187. package/dist/core/__tests__/transport.streamable.test.js.map +0 -1
  188. package/dist/core/__tests__/transports.test.d.ts +0 -2
  189. package/dist/core/__tests__/transports.test.d.ts.map +0 -1
  190. package/dist/core/__tests__/transports.test.js +0 -12
  191. package/dist/core/__tests__/transports.test.js.map +0 -1
  192. package/dist/core/apikey-module.d.ts +0 -69
  193. package/dist/core/apikey-module.d.ts.map +0 -1
  194. package/dist/core/apikey-module.js +0 -114
  195. package/dist/core/apikey-module.js.map +0 -1
  196. package/dist/core/app-decorator.d.ts +0 -59
  197. package/dist/core/app-decorator.d.ts.map +0 -1
  198. package/dist/core/app-decorator.js +0 -322
  199. package/dist/core/app-decorator.js.map +0 -1
  200. package/dist/core/builders.d.ts +0 -50
  201. package/dist/core/builders.d.ts.map +0 -1
  202. package/dist/core/builders.js +0 -139
  203. package/dist/core/builders.js.map +0 -1
  204. package/dist/core/component.d.ts +0 -111
  205. package/dist/core/component.d.ts.map +0 -1
  206. package/dist/core/component.js +0 -228
  207. package/dist/core/component.js.map +0 -1
  208. package/dist/core/config-module.d.ts +0 -62
  209. package/dist/core/config-module.d.ts.map +0 -1
  210. package/dist/core/config-module.js +0 -94
  211. package/dist/core/config-module.js.map +0 -1
  212. package/dist/core/decorators/__tests__/decorators.test.d.ts +0 -2
  213. package/dist/core/decorators/__tests__/decorators.test.d.ts.map +0 -1
  214. package/dist/core/decorators/__tests__/decorators.test.js +0 -103
  215. package/dist/core/decorators/__tests__/decorators.test.js.map +0 -1
  216. package/dist/core/decorators/__tests__/extended-decorators.test.d.ts +0 -2
  217. package/dist/core/decorators/__tests__/extended-decorators.test.d.ts.map +0 -1
  218. package/dist/core/decorators/__tests__/extended-decorators.test.js +0 -194
  219. package/dist/core/decorators/__tests__/extended-decorators.test.js.map +0 -1
  220. package/dist/core/decorators/__tests__/health-check.test.d.ts +0 -2
  221. package/dist/core/decorators/__tests__/health-check.test.d.ts.map +0 -1
  222. package/dist/core/decorators/__tests__/health-check.test.js +0 -119
  223. package/dist/core/decorators/__tests__/health-check.test.js.map +0 -1
  224. package/dist/core/decorators/cache.decorator.d.ts +0 -61
  225. package/dist/core/decorators/cache.decorator.d.ts.map +0 -1
  226. package/dist/core/decorators/cache.decorator.js +0 -115
  227. package/dist/core/decorators/cache.decorator.js.map +0 -1
  228. package/dist/core/decorators/health-check.decorator.d.ts +0 -80
  229. package/dist/core/decorators/health-check.decorator.d.ts.map +0 -1
  230. package/dist/core/decorators/health-check.decorator.js +0 -153
  231. package/dist/core/decorators/health-check.decorator.js.map +0 -1
  232. package/dist/core/decorators/rate-limit.decorator.d.ts +0 -63
  233. package/dist/core/decorators/rate-limit.decorator.d.ts.map +0 -1
  234. package/dist/core/decorators/rate-limit.decorator.js +0 -129
  235. package/dist/core/decorators/rate-limit.decorator.js.map +0 -1
  236. package/dist/core/decorators.d.ts +0 -190
  237. package/dist/core/decorators.d.ts.map +0 -1
  238. package/dist/core/decorators.js +0 -170
  239. package/dist/core/decorators.js.map +0 -1
  240. package/dist/core/di/__tests__/container.test.d.ts +0 -2
  241. package/dist/core/di/__tests__/container.test.d.ts.map +0 -1
  242. package/dist/core/di/__tests__/container.test.js +0 -88
  243. package/dist/core/di/__tests__/container.test.js.map +0 -1
  244. package/dist/core/di/container.d.ts +0 -64
  245. package/dist/core/di/container.d.ts.map +0 -1
  246. package/dist/core/di/container.js +0 -105
  247. package/dist/core/di/container.js.map +0 -1
  248. package/dist/core/di/injectable.decorator.d.ts +0 -62
  249. package/dist/core/di/injectable.decorator.d.ts.map +0 -1
  250. package/dist/core/di/injectable.decorator.js +0 -66
  251. package/dist/core/di/injectable.decorator.js.map +0 -1
  252. package/dist/core/di/metadata-shim.d.ts +0 -31
  253. package/dist/core/di/metadata-shim.d.ts.map +0 -1
  254. package/dist/core/di/metadata-shim.js +0 -181
  255. package/dist/core/di/metadata-shim.js.map +0 -1
  256. package/dist/core/errors.d.ts +0 -54
  257. package/dist/core/errors.d.ts.map +0 -1
  258. package/dist/core/errors.js +0 -87
  259. package/dist/core/errors.js.map +0 -1
  260. package/dist/core/events/__tests__/events.test.d.ts +0 -2
  261. package/dist/core/events/__tests__/events.test.d.ts.map +0 -1
  262. package/dist/core/events/__tests__/events.test.js +0 -177
  263. package/dist/core/events/__tests__/events.test.js.map +0 -1
  264. package/dist/core/events/event-emitter.d.ts +0 -50
  265. package/dist/core/events/event-emitter.d.ts.map +0 -1
  266. package/dist/core/events/event-emitter.js +0 -94
  267. package/dist/core/events/event-emitter.js.map +0 -1
  268. package/dist/core/events/event.decorator.d.ts +0 -48
  269. package/dist/core/events/event.decorator.d.ts.map +0 -1
  270. package/dist/core/events/event.decorator.js +0 -72
  271. package/dist/core/events/event.decorator.js.map +0 -1
  272. package/dist/core/events/log-emitter.d.ts +0 -14
  273. package/dist/core/events/log-emitter.d.ts.map +0 -1
  274. package/dist/core/events/log-emitter.js +0 -20
  275. package/dist/core/events/log-emitter.js.map +0 -1
  276. package/dist/core/filters/__tests__/filters.test.d.ts +0 -2
  277. package/dist/core/filters/__tests__/filters.test.d.ts.map +0 -1
  278. package/dist/core/filters/__tests__/filters.test.js +0 -72
  279. package/dist/core/filters/__tests__/filters.test.js.map +0 -1
  280. package/dist/core/filters/exception-filter.decorator.d.ts +0 -40
  281. package/dist/core/filters/exception-filter.decorator.d.ts.map +0 -1
  282. package/dist/core/filters/exception-filter.decorator.js +0 -54
  283. package/dist/core/filters/exception-filter.decorator.js.map +0 -1
  284. package/dist/core/filters/exception-filter.interface.d.ts +0 -39
  285. package/dist/core/filters/exception-filter.interface.d.ts.map +0 -1
  286. package/dist/core/filters/exception-filter.interface.js +0 -2
  287. package/dist/core/filters/exception-filter.interface.js.map +0 -1
  288. package/dist/core/guards/__tests__/guards.test.d.ts +0 -2
  289. package/dist/core/guards/__tests__/guards.test.d.ts.map +0 -1
  290. package/dist/core/guards/__tests__/guards.test.js +0 -55
  291. package/dist/core/guards/__tests__/guards.test.js.map +0 -1
  292. package/dist/core/guards/apikey.guard.d.ts +0 -22
  293. package/dist/core/guards/apikey.guard.d.ts.map +0 -1
  294. package/dist/core/guards/apikey.guard.js +0 -11
  295. package/dist/core/guards/apikey.guard.js.map +0 -1
  296. package/dist/core/guards/guard.interface.d.ts +0 -18
  297. package/dist/core/guards/guard.interface.d.ts.map +0 -1
  298. package/dist/core/guards/guard.interface.js +0 -2
  299. package/dist/core/guards/guard.interface.js.map +0 -1
  300. package/dist/core/guards/jwt.guard.d.ts +0 -18
  301. package/dist/core/guards/jwt.guard.d.ts.map +0 -1
  302. package/dist/core/guards/jwt.guard.js +0 -2
  303. package/dist/core/guards/jwt.guard.js.map +0 -1
  304. package/dist/core/guards/oauth.guard.d.ts +0 -35
  305. package/dist/core/guards/oauth.guard.d.ts.map +0 -1
  306. package/dist/core/guards/oauth.guard.js +0 -2
  307. package/dist/core/guards/oauth.guard.js.map +0 -1
  308. package/dist/core/guards/use-guards.decorator.d.ts +0 -25
  309. package/dist/core/guards/use-guards.decorator.d.ts.map +0 -1
  310. package/dist/core/guards/use-guards.decorator.js +0 -32
  311. package/dist/core/guards/use-guards.decorator.js.map +0 -1
  312. package/dist/core/health/__tests__/health.test.d.ts +0 -2
  313. package/dist/core/health/__tests__/health.test.d.ts.map +0 -1
  314. package/dist/core/health/__tests__/health.test.js +0 -31
  315. package/dist/core/health/__tests__/health.test.js.map +0 -1
  316. package/dist/core/health/health-checks.resource.d.ts +0 -14
  317. package/dist/core/health/health-checks.resource.d.ts.map +0 -1
  318. package/dist/core/health/health-checks.resource.js +0 -29
  319. package/dist/core/health/health-checks.resource.js.map +0 -1
  320. package/dist/core/index.d.ts +0 -57
  321. package/dist/core/index.d.ts.map +0 -1
  322. package/dist/core/index.js +0 -59
  323. package/dist/core/index.js.map +0 -1
  324. package/dist/core/interceptors/__tests__/interceptors.test.d.ts +0 -2
  325. package/dist/core/interceptors/__tests__/interceptors.test.d.ts.map +0 -1
  326. package/dist/core/interceptors/__tests__/interceptors.test.js +0 -52
  327. package/dist/core/interceptors/__tests__/interceptors.test.js.map +0 -1
  328. package/dist/core/interceptors/interceptor.decorator.d.ts +0 -37
  329. package/dist/core/interceptors/interceptor.decorator.d.ts.map +0 -1
  330. package/dist/core/interceptors/interceptor.decorator.js +0 -51
  331. package/dist/core/interceptors/interceptor.decorator.js.map +0 -1
  332. package/dist/core/interceptors/interceptor.interface.d.ts +0 -31
  333. package/dist/core/interceptors/interceptor.interface.d.ts.map +0 -1
  334. package/dist/core/interceptors/interceptor.interface.js +0 -2
  335. package/dist/core/interceptors/interceptor.interface.js.map +0 -1
  336. package/dist/core/jwt-module.d.ts +0 -51
  337. package/dist/core/jwt-module.d.ts.map +0 -1
  338. package/dist/core/jwt-module.js +0 -52
  339. package/dist/core/jwt-module.js.map +0 -1
  340. package/dist/core/logger.d.ts +0 -18
  341. package/dist/core/logger.d.ts.map +0 -1
  342. package/dist/core/logger.js +0 -53
  343. package/dist/core/logger.js.map +0 -1
  344. package/dist/core/middleware/__tests__/middleware.test.d.ts +0 -2
  345. package/dist/core/middleware/__tests__/middleware.test.d.ts.map +0 -1
  346. package/dist/core/middleware/__tests__/middleware.test.js +0 -105
  347. package/dist/core/middleware/__tests__/middleware.test.js.map +0 -1
  348. package/dist/core/middleware/middleware.decorator.d.ts +0 -39
  349. package/dist/core/middleware/middleware.decorator.d.ts.map +0 -1
  350. package/dist/core/middleware/middleware.decorator.js +0 -53
  351. package/dist/core/middleware/middleware.decorator.js.map +0 -1
  352. package/dist/core/middleware/middleware.interface.d.ts +0 -29
  353. package/dist/core/middleware/middleware.interface.d.ts.map +0 -1
  354. package/dist/core/middleware/middleware.interface.js +0 -2
  355. package/dist/core/middleware/middleware.interface.js.map +0 -1
  356. package/dist/core/module.d.ts +0 -93
  357. package/dist/core/module.d.ts.map +0 -1
  358. package/dist/core/module.js +0 -87
  359. package/dist/core/module.js.map +0 -1
  360. package/dist/core/oauth-module.d.ts +0 -123
  361. package/dist/core/oauth-module.d.ts.map +0 -1
  362. package/dist/core/oauth-module.js +0 -324
  363. package/dist/core/oauth-module.js.map +0 -1
  364. package/dist/core/pipes/__tests__/pipes.test.d.ts +0 -2
  365. package/dist/core/pipes/__tests__/pipes.test.d.ts.map +0 -1
  366. package/dist/core/pipes/__tests__/pipes.test.js +0 -164
  367. package/dist/core/pipes/__tests__/pipes.test.js.map +0 -1
  368. package/dist/core/pipes/pipe.decorator.d.ts +0 -64
  369. package/dist/core/pipes/pipe.decorator.d.ts.map +0 -1
  370. package/dist/core/pipes/pipe.decorator.js +0 -85
  371. package/dist/core/pipes/pipe.decorator.js.map +0 -1
  372. package/dist/core/pipes/pipe.interface.d.ts +0 -41
  373. package/dist/core/pipes/pipe.interface.d.ts.map +0 -1
  374. package/dist/core/pipes/pipe.interface.js +0 -2
  375. package/dist/core/pipes/pipe.interface.js.map +0 -1
  376. package/dist/core/prompt.d.ts +0 -46
  377. package/dist/core/prompt.d.ts.map +0 -1
  378. package/dist/core/prompt.js +0 -76
  379. package/dist/core/prompt.js.map +0 -1
  380. package/dist/core/resource.d.ts +0 -47
  381. package/dist/core/resource.d.ts.map +0 -1
  382. package/dist/core/resource.js +0 -90
  383. package/dist/core/resource.js.map +0 -1
  384. package/dist/core/server.d.ts +0 -129
  385. package/dist/core/server.d.ts.map +0 -1
  386. package/dist/core/server.js +0 -617
  387. package/dist/core/server.js.map +0 -1
  388. package/dist/core/tool.d.ts +0 -108
  389. package/dist/core/tool.d.ts.map +0 -1
  390. package/dist/core/tool.js +0 -241
  391. package/dist/core/tool.js.map +0 -1
  392. package/dist/core/transports/__tests__/transports.test.d.ts +0 -2
  393. package/dist/core/transports/__tests__/transports.test.d.ts.map +0 -1
  394. package/dist/core/transports/__tests__/transports.test.js +0 -249
  395. package/dist/core/transports/__tests__/transports.test.js.map +0 -1
  396. package/dist/core/transports/discovery-http-server.d.ts +0 -19
  397. package/dist/core/transports/discovery-http-server.d.ts.map +0 -1
  398. package/dist/core/transports/discovery-http-server.js +0 -54
  399. package/dist/core/transports/discovery-http-server.js.map +0 -1
  400. package/dist/core/transports/http-server.d.ts +0 -108
  401. package/dist/core/transports/http-server.d.ts.map +0 -1
  402. package/dist/core/transports/http-server.js +0 -293
  403. package/dist/core/transports/http-server.js.map +0 -1
  404. package/dist/core/transports/streamable-http.d.ts +0 -177
  405. package/dist/core/transports/streamable-http.d.ts.map +0 -1
  406. package/dist/core/transports/streamable-http.js +0 -1287
  407. package/dist/core/transports/streamable-http.js.map +0 -1
  408. package/dist/core/types.d.ts +0 -195
  409. package/dist/core/types.d.ts.map +0 -1
  410. package/dist/core/types.js +0 -2
  411. package/dist/core/types.js.map +0 -1
  412. package/dist/core/widgets/__tests__/registry.test.d.ts +0 -2
  413. package/dist/core/widgets/__tests__/registry.test.d.ts.map +0 -1
  414. package/dist/core/widgets/__tests__/registry.test.js +0 -69
  415. package/dist/core/widgets/__tests__/registry.test.js.map +0 -1
  416. package/dist/core/widgets/widget-examples.resource.d.ts +0 -17
  417. package/dist/core/widgets/widget-examples.resource.d.ts.map +0 -1
  418. package/dist/core/widgets/widget-examples.resource.js +0 -28
  419. package/dist/core/widgets/widget-examples.resource.js.map +0 -1
  420. package/dist/core/widgets/widget-registry.d.ts +0 -56
  421. package/dist/core/widgets/widget-registry.d.ts.map +0 -1
  422. package/dist/core/widgets/widget-registry.js +0 -75
  423. package/dist/core/widgets/widget-registry.js.map +0 -1
  424. package/dist/testing/__tests__/testing.test.d.ts +0 -2
  425. package/dist/testing/__tests__/testing.test.d.ts.map +0 -1
  426. package/dist/testing/__tests__/testing.test.js +0 -167
  427. package/dist/testing/__tests__/testing.test.js.map +0 -1
  428. package/dist/testing/index.d.ts +0 -103
  429. package/dist/testing/index.d.ts.map +0 -1
  430. package/dist/testing/index.js +0 -161
  431. package/dist/testing/index.js.map +0 -1
  432. package/dist/ui-next/__tests__/ui-next.test.d.ts +0 -2
  433. package/dist/ui-next/__tests__/ui-next.test.d.ts.map +0 -1
  434. package/dist/ui-next/__tests__/ui-next.test.js +0 -74
  435. package/dist/ui-next/__tests__/ui-next.test.js.map +0 -1
  436. package/dist/ui-next/index.d.ts +0 -31
  437. package/dist/ui-next/index.d.ts.map +0 -1
  438. package/dist/ui-next/index.js +0 -687
  439. package/dist/ui-next/index.js.map +0 -1
@@ -1,64 +0,0 @@
1
- import 'reflect-metadata';
2
- import { PipeConstructor } from './pipe.interface.js';
3
- import type { ClassConstructor } from '../types.js';
4
- /**
5
- * Marks a class as a pipe
6
- *
7
- * @example
8
- * ```typescript
9
- * @Pipe()
10
- * export class ValidationPipe implements PipeInterface {
11
- * transform(value: unknown, metadata: ArgumentMetadata) {
12
- * // Validate and transform
13
- * return value;
14
- * }
15
- * }
16
- * ```
17
- */
18
- export declare function Pipe(): ClassDecorator;
19
- /**
20
- * Apply pipes to tool input (entire input object)
21
- *
22
- * @example
23
- * ```typescript
24
- * @Tool({ name: 'create_user', ... })
25
- * @UsePipes(ValidationPipe, TransformPipe)
26
- * async createUser(input: unknown) { }
27
- * ```
28
- */
29
- export declare function UsePipes(...pipes: PipeConstructor[]): MethodDecorator;
30
- /**
31
- * Parameter decorator to apply pipes to specific parameters
32
- *
33
- * @example
34
- * ```typescript
35
- * @Tool({ name: 'create_user', ... })
36
- * async createUser(@Body(ValidationPipe) input: CreateUserDto) { }
37
- * ```
38
- */
39
- export declare function Body(...pipes: PipeConstructor[]): ParameterDecorator;
40
- /**
41
- * Shorthand for validation pipe
42
- */
43
- export declare function Validated(): ParameterDecorator;
44
- /**
45
- * Parameter pipes metadata
46
- */
47
- interface ParamPipeMetadata {
48
- type: string;
49
- pipes: PipeConstructor[];
50
- }
51
- /**
52
- * Get pipes for a method
53
- */
54
- export declare function getPipeMetadata(target: object, propertyKey: string | symbol): PipeConstructor[];
55
- /**
56
- * Get parameter pipes for a method
57
- */
58
- export declare function getParamPipesMetadata(target: object, propertyKey: string | symbol): Record<number, ParamPipeMetadata>;
59
- /**
60
- * Check if a class is marked as a pipe
61
- */
62
- export declare function isPipe(target: ClassConstructor): boolean;
63
- export {};
64
- //# sourceMappingURL=pipe.decorator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipe.decorator.d.ts","sourceRoot":"","sources":["../../../src/core/pipes/pipe.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMpD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,IAAI,cAAc,CAIrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,GAAG,KAAK,EAAE,eAAe,EAAE,GAAG,eAAe,CAUrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,eAAe,EAAE,GAAG,kBAAkB,CAWpE;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,kBAAkB,CAE9C;AAED;;GAEG;AACH,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,eAAe,EAAE,CAE/F;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAErH;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAExD"}
@@ -1,85 +0,0 @@
1
- import 'reflect-metadata';
2
- const PIPE_KEY = 'nitrostack:pipe';
3
- const IS_PIPE_KEY = 'nitrostack:is_pipe';
4
- const PARAM_PIPES_KEY = 'nitrostack:param_pipes';
5
- /**
6
- * Marks a class as a pipe
7
- *
8
- * @example
9
- * ```typescript
10
- * @Pipe()
11
- * export class ValidationPipe implements PipeInterface {
12
- * transform(value: unknown, metadata: ArgumentMetadata) {
13
- * // Validate and transform
14
- * return value;
15
- * }
16
- * }
17
- * ```
18
- */
19
- export function Pipe() {
20
- return (target) => {
21
- Reflect.defineMetadata(IS_PIPE_KEY, true, target);
22
- };
23
- }
24
- /**
25
- * Apply pipes to tool input (entire input object)
26
- *
27
- * @example
28
- * ```typescript
29
- * @Tool({ name: 'create_user', ... })
30
- * @UsePipes(ValidationPipe, TransformPipe)
31
- * async createUser(input: unknown) { }
32
- * ```
33
- */
34
- export function UsePipes(...pipes) {
35
- return (target, propertyKey, descriptor) => {
36
- const existingPipes = Reflect.getMetadata(PIPE_KEY, target, propertyKey) || [];
37
- Reflect.defineMetadata(PIPE_KEY, [...existingPipes, ...pipes], target, propertyKey);
38
- };
39
- }
40
- /**
41
- * Parameter decorator to apply pipes to specific parameters
42
- *
43
- * @example
44
- * ```typescript
45
- * @Tool({ name: 'create_user', ... })
46
- * async createUser(@Body(ValidationPipe) input: CreateUserDto) { }
47
- * ```
48
- */
49
- export function Body(...pipes) {
50
- return (target, propertyKey, parameterIndex) => {
51
- if (!propertyKey)
52
- return;
53
- const existingParams = Reflect.getMetadata(PARAM_PIPES_KEY, target, propertyKey) || {};
54
- existingParams[parameterIndex] = {
55
- type: 'body',
56
- pipes,
57
- };
58
- Reflect.defineMetadata(PARAM_PIPES_KEY, existingParams, target, propertyKey);
59
- };
60
- }
61
- /**
62
- * Shorthand for validation pipe
63
- */
64
- export function Validated() {
65
- return Body(); // Can be enhanced with default validation pipe
66
- }
67
- /**
68
- * Get pipes for a method
69
- */
70
- export function getPipeMetadata(target, propertyKey) {
71
- return Reflect.getMetadata(PIPE_KEY, target, propertyKey) || [];
72
- }
73
- /**
74
- * Get parameter pipes for a method
75
- */
76
- export function getParamPipesMetadata(target, propertyKey) {
77
- return Reflect.getMetadata(PARAM_PIPES_KEY, target, propertyKey) || {};
78
- }
79
- /**
80
- * Check if a class is marked as a pipe
81
- */
82
- export function isPipe(target) {
83
- return Reflect.getMetadata(IS_PIPE_KEY, target) === true;
84
- }
85
- //# sourceMappingURL=pipe.decorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipe.decorator.js","sourceRoot":"","sources":["../../../src/core/pipes/pipe.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAI1B,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AACnC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AACzC,MAAM,eAAe,GAAG,wBAAwB,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,MAAc,EAAE,EAAE;QACxB,OAAO,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAG,KAAwB;IAClD,OAAO,CAAC,MAAc,EAAE,WAA4B,EAAE,UAA8B,EAAE,EAAE;QACtF,MAAM,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;QAC/E,O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ype
4
- */
5
- type MetaType = new (...args: unknown[]) => unknown;
6
- /**
7
- * Argument metadata for pipe transformation
8
- */
9
- export interface ArgumentMetadata {
10
- type: 'body' | 'param' | 'query' | 'custom';
11
- metatype?: MetaType;
12
- data?: string | undefined;
13
- }
14
- /**
15
- * Pipe Interface
16
- *
17
- * Pipes are used to transform and validate input data before it reaches the tool handler.
18
- * Similar to NestJS pipes.
19
- *
20
- * @example
21
- * ```typescript
22
- * @Pipe()
23
- * export class ValidationPipe implements PipeInterface {
24
- * transform(value: unknown, metadata: ArgumentMetadata) {
25
- * if (!this.isValid(value)) {
26
- * throw new Error('Validation failed');
27
- * }
28
- * return value;
29
- * }
30
- * }
31
- * ```
32
- */
33
- export interface PipeInterface<T = unknown, R = unknown> {
34
- transform(value: T, metadata: ArgumentMetadata): R | Promise<R>;
35
- }
36
- /**
37
- * Pipe constructor type
38
- */
39
- export type PipeConstructor = new (...args: unknown[]) => PipeInterface;
40
- export {};
41
- //# sourceMappingURL=pipe.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipe.interface.d.ts","sourceRoot":"","sources":["../../../src/core/pipes/pipe.interface.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B;;GAEG;AACH,KAAK,QAAQ,GAAG,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC5C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO;IACrD,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,gBAAgB,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACjE;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,aAAa,CAAC"}
@@ -1,2 +0,0 @@
1
- import 'reflect-metadata';
2
- //# sourceMappingURL=pipe.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipe.interface.js","sourceRoot":"","sources":["../../../src/core/pipes/pipe.interface.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
@@ -1,46 +0,0 @@
1
- import { PromptDefinition, ExecutionContext, PromptMessage, PromptArgument, PromptArgumentValue } from './types.js';
2
- /**
3
- * MCP Prompt metadata structure
4
- */
5
- interface McpPrompt {
6
- name: string;
7
- description: string;
8
- arguments: PromptArgument[];
9
- }
10
- /**
11
- * Prompt class provides a clean abstraction for defining and executing prompts
12
- */
13
- export declare class Prompt {
14
- private definition;
15
- constructor(definition: PromptDefinition);
16
- /**
17
- * Get prompt name
18
- */
19
- get name(): string;
20
- /**
21
- * Get prompt description
22
- */
23
- get description(): string;
24
- /**
25
- * Get prompt arguments
26
- */
27
- get arguments(): PromptArgument[];
28
- /**
29
- * Execute the prompt with provided arguments
30
- */
31
- execute(args: Record<string, PromptArgumentValue>, context: ExecutionContext): Promise<PromptMessage[]>;
32
- /**
33
- * Validate prompt arguments
34
- */
35
- private validateArguments;
36
- /**
37
- * Create prompt metadata for MCP protocol
38
- */
39
- toMcpPrompt(): McpPrompt;
40
- }
41
- /**
42
- * Helper function to create a prompt
43
- */
44
- export declare function createPrompt(definition: PromptDefinition): Prompt;
45
- export {};
46
- //# sourceMappingURL=prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/core/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAc,MAAM,YAAY,CAAC;AAGhI;;GAEG;AACH,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,UAAU,CAAmB;gBAEzB,UAAU,EAAE,gBAAgB;IAIxC;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,cAAc,EAAE,CAEhC;IAED;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAoB7G;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAYzB;;OAEG;IACH,WAAW,IAAI,SAAS;CAOzB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,gBAAgB,GAAG,MAAM,CAEjE"}
@@ -1,76 +0,0 @@
1
- import { ValidationError } from './errors.js';
2
- /**
3
- * Prompt class provides a clean abstraction for defining and executing prompts
4
- */
5
- export class Prompt {
6
- definition;
7
- constructor(definition) {
8
- this.definition = definition;
9
- }
10
- /**
11
- * Get prompt name
12
- */
13
- get name() {
14
- return this.definition.name;
15
- }
16
- /**
17
- * Get prompt description
18
- */
19
- get description() {
20
- return this.definition.description;
21
- }
22
- /**
23
- * Get prompt arguments
24
- */
25
- get arguments() {
26
- return this.definition.arguments || [];
27
- }
28
- /**
29
- * Execute the prompt with provided arguments
30
- */
31
- async execute(args, context) {
32
- // Validate required arguments
33
- this.validateArguments(args);
34
- context.logger.info(`Executing prompt: ${this.name}`, { args: args });
35
- try {
36
- const messages = await this.definition.handler(args, context);
37
- context.logger.info(`Prompt executed successfully: ${this.name}`, {
38
- messageCount: messages.length,
39
- });
40
- return messages;
41
- }
42
- catch (error) {
43
- context.logger.error(`Error executing prompt: ${this.name}`, { error: error instanceof Error ? error.message : String(error) });
44
- throw error;
45
- }
46
- }
47
- /**
48
- * Validate prompt arguments
49
- */
50
- validateArguments(args) {
51
- if (!this.definition.arguments)
52
- return;
53
- for (const arg of this.definition.arguments) {
54
- if (arg.required && !(arg.name in args)) {
55
- throw new ValidationError(`Missing required argument '${arg.name}' for prompt '${this.name}'`);
56
- }
57
- }
58
- }
59
- /**
60
- * Create prompt metadata for MCP protocol
61
- */
62
- toMcpPrompt() {
63
- return {
64
- name: this.name,
65
- description: this.description,
66
- arguments: this.arguments,
67
- };
68
- }
69
- }
70
- /**
71
- * Helper function to create a prompt
72
- */
73
- export function createPrompt(definition) {
74
- return new Prompt(definition);
75
- }
76
- //# sourceMappingURL=prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/core/prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAW9C;;GAEG;AACH,MAAM,OAAO,MAAM;IACT,UAAU,CAAmB;IAErC,YAAY,UAA4B;QACtC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,IAAI,EAAE,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,IAAyC,EAAE,OAAyB;QAChF,8BAA8B;QAC9B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAE7B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,I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ED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,UAA4B;IACvD,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC"}
@@ -1,47 +0,0 @@
1
- import { ResourceDefinition, ExecutionContext, ResourceContent } from './types.js';
2
- /**
3
- * Resource class provides a clean abstraction for defining and serving resources
4
- */
5
- export declare class Resource {
6
- private definition;
7
- private cache?;
8
- constructor(definition: ResourceDefinition);
9
- /**
10
- * Get resource URI
11
- */
12
- get uri(): string;
13
- /**
14
- * Get resource name
15
- */
16
- get name(): string;
17
- /**
18
- * Get resource description
19
- */
20
- get description(): string;
21
- /**
22
- * Get resource MIME type
23
- */
24
- get mimeType(): string | undefined;
25
- /**
26
- * Fetch the resource content
27
- */
28
- fetch(context: ExecutionContext): Promise<ResourceContent>;
29
- /**
30
- * Clear cached content
31
- */
32
- clearCache(): void;
33
- /**
34
- * MCP Resource metadata structure
35
- */
36
- toMcpResource(): {
37
- uri: string;
38
- name: string;
39
- description: string;
40
- mimeType?: string;
41
- };
42
- }
43
- /**
44
- * Helper function to create a resource
45
- */
46
- export declare function createResource(definition: ResourceDefinition): Resource;
47
- //# sourceMappingURL=resource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/core/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnF;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,KAAK,CAAC,CAGZ;gBAEU,UAAU,EAAE,kBAAkB;IAI1C;;OAEG;IACH,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,GAAG,SAAS,CAEjC;IAED;;OAEG;IACG,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAkChE;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;OAEG;IACH,aAAa,IAAI;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;CAQvF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,kBAAkB,GAAG,QAAQ,CAEvE"}
@@ -1,90 +0,0 @@
1
- /**
2
- * Resource class provides a clean abstraction for defining and serving resources
3
- */
4
- export class Resource {
5
- definition;
6
- cache;
7
- constructor(definition) {
8
- this.definition = definition;
9
- }
10
- /**
11
- * Get resource URI
12
- */
13
- get uri() {
14
- return this.definition.uri;
15
- }
16
- /**
17
- * Get resource name
18
- */
19
- get name() {
20
- return this.definition.name;
21
- }
22
- /**
23
- * Get resource description
24
- */
25
- get description() {
26
- return this.definition.description;
27
- }
28
- /**
29
- * Get resource MIME type
30
- */
31
- get mimeType() {
32
- return this.definition.mimeType;
33
- }
34
- /**
35
- * Fetch the resource content
36
- */
37
- async fetch(context) {
38
- const cacheable = this.definition.metadata?.cacheable;
39
- const cacheMaxAge = this.definition.metadata?.cacheMaxAge || 60000; // 1 minute default
40
- // Check cache
41
- if (cacheable && this.cache) {
42
- const age = Date.now() - this.cache.timestamp;
43
- if (age < cacheMaxAge) {
44
- context.logger.debug(`Serving cached resource: ${this.uri}`);
45
- return this.cache.content;
46
- }
47
- }
48
- context.logger.info(`Fetching resource: ${this.uri}`);
49
- try {
50
- const content = await this.definition.handler(this.uri, context);
51
- // Update cache
52
- if (cacheable) {
53
- this.cache = {
54
- content,
55
- timestamp: Date.now(),
56
- };
57
- }
58
- context.logger.info(`Resource fetched successfully: ${this.uri}`);
59
- return content;
60
- }
61
- catch (error) {
62
- context.logger.error(`Error fetching resource: ${this.uri}`, { error: error instanceof Error ? error.message : String(error) });
63
- throw error;
64
- }
65
- }
66
- /**
67
- * Clear cached content
68
- */
69
- clearCache() {
70
- this.cache = undefined;
71
- }
72
- /**
73
- * MCP Resource metadata structure
74
- */
75
- toMcpResource() {
76
- return {
77
- uri: this.uri,
78
- name: this.name,
79
- description: this.description,
80
- mimeType: this.mimeType,
81
- };
82
- }
83
- }
84
- /**
85
- * Helper function to create a resource
86
- */
87
- export function createResource(definition) {
88
- return new Resource(definition);
89
- }
90
- //# sourceMappingURL=resource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../src/core/resource.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,QAAQ;IACX,UAAU,CAAqB;IAC/B,KAAK,CAGX;IAEF,YAAY,UAA8B;QACxC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,OAAyB;QACnC,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;QACtD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,WAAW,IAAI,KAAK,CAAC,CAAC,mBAAmB;QAEvF,cAAc;QACd,IAAI,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC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,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,UAA8B;IAC3D,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC"}
@@ -1,129 +0,0 @@
1
- import { Tool } from './tool.js';
2
- import { Resource } from './resource.js';
3
- import { Prompt } from './prompt.js';
4
- import { McpServerConfig, ServerStats, ClassConstructor } from './types.js';
5
- /**
6
- * HTTP Transport interface
7
- */
8
- interface HttpTransport {
9
- start(): Promise<void>;
10
- close(): Promise<void>;
11
- send(message: JsonRpcResponse): Promise<void>;
12
- onmessage?: (message: JsonRpcRequest) => Promise<void>;
13
- setToolsCallback?(callback: () => Promise<unknown[]>): void;
14
- setServerConfig?(config: {
15
- name: string;
16
- version: string;
17
- description?: string;
18
- }): void;
19
- }
20
- /**
21
- * JSON-RPC request structure
22
- */
23
- interface JsonRpcRequest {
24
- jsonrpc: '2.0';
25
- id?: string | number | null;
26
- method?: string;
27
- params?: Record<string, unknown>;
28
- }
29
- /**
30
- * JSON-RPC response structure
31
- */
32
- interface JsonRpcResponse {
33
- jsonrpc: '2.0';
34
- id: string | number | null;
35
- result?: unknown;
36
- error?: {
37
- code: number;
38
- message: string;
39
- data?: unknown;
40
- };
41
- }
42
- /**
43
- * NitroStackServer - Main server class
44
- */
45
- export declare class NitroStackServer {
46
- private mcpServer;
47
- private tools;
48
- private resources;
49
- private prompts;
50
- private modules;
51
- private config;
52
- private logger;
53
- private stats;
54
- private pendingComponentRegistrations;
55
- /** Transport type used by the server */
56
- private _transportType?;
57
- /** HTTP transport instance (when using http or dual mode) */
58
- private _httpTransport?;
59
- constructor(config?: McpServerConfig);
60
- /**
61
- * Add a tool to the server
62
- */
63
- tool(tool: Tool): this;
64
- /**
65
- * Register a component as an MCP resource
66
- */
67
- private registerComponentResource;
68
- /**
69
- * Add a resource to the server
70
- */
71
- resource(resource: Resource): this;
72
- /**
73
- * Add a prompt to the server
74
- */
75
- prompt(prompt: Prompt): this;
76
- /**
77
- * Register a module with all its controllers
78
- * Automatically extracts and registers all tools, resources, and prompts
79
- *
80
- * @example
81
- * ```typescript
82
- * server.module(AuthModule);
83
- * server.module(ProductsModule);
84
- * ```
85
- */
86
- module(moduleClass: ClassConstructor): this;
87
- /**
88
- * Get server statistics
89
- */
90
- getStats(): ServerStats;
91
- /**
92
- * Create execution context
93
- */
94
- private createContext;
95
- /**
96
- * Setup MCP protocol handlers
97
- */
98
- private setupHandlers;
99
- /**
100
- * Start the server
101
- * Automatically determines the transport based on NODE_ENV
102
- *
103
- * Transport determination:
104
- * - MCP_TRANSPORT_TYPE env var takes precedence (for explicit control)
105
- * - NODE_ENV=development or unset → stdio mode
106
- * - NODE_ENV=production → dual mode (STDIO + HTTP)
107
- */
108
- start(): Promise<void>;
109
- /**
110
- * Start the server with specified transport
111
- * @param transportType - 'stdio', 'http', or 'dual' (default: 'stdio')
112
- * @param transportOptions - Transport-specific options
113
- */
114
- private startWithTransport;
115
- /**
116
- * Stop the server
117
- */
118
- stop(): Promise<void>;
119
- /**
120
- * Get the HTTP transport (for modules that need to register endpoints)
121
- */
122
- getHttpTransport(): HttpTransport | undefined;
123
- }
124
- /**
125
- * Helper function to create a server
126
- */
127
- export declare function createServer(config: McpServerConfig): NitroStackServer;
128
- export {};
129
- //# sourceMappingURL=server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/core/server.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAkB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EACL,eAAe,EAGf,WAAW,EAEX,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAwBpB;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