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.
- package/LICENSE +1 -1
- package/README.md +42 -137
- package/assets/gif/nitrocli.gif +0 -0
- package/assets/gif/nitrostudio-chat.gif +0 -0
- package/assets/gif/nitrostudio-main.gif +0 -0
- package/assets/gif/nitrostudio-testing.gif +0 -0
- package/package.json +15 -50
- package/dist/auth/__tests__/api-key.test.d.ts +0 -2
- package/dist/auth/__tests__/api-key.test.d.ts.map +0 -1
- package/dist/auth/__tests__/api-key.test.js +0 -156
- package/dist/auth/__tests__/api-key.test.js.map +0 -1
- package/dist/auth/__tests__/client.test.d.ts +0 -2
- package/dist/auth/__tests__/client.test.d.ts.map +0 -1
- package/dist/auth/__tests__/client.test.js +0 -173
- package/dist/auth/__tests__/client.test.js.map +0 -1
- package/dist/auth/__tests__/middleware.test.d.ts +0 -2
- package/dist/auth/__tests__/middleware.test.d.ts.map +0 -1
- package/dist/auth/__tests__/middleware.test.js +0 -232
- package/dist/auth/__tests__/middleware.test.js.map +0 -1
- package/dist/auth/__tests__/pkce.test.d.ts +0 -2
- package/dist/auth/__tests__/pkce.test.d.ts.map +0 -1
- package/dist/auth/__tests__/pkce.test.js +0 -110
- package/dist/auth/__tests__/pkce.test.js.map +0 -1
- package/dist/auth/__tests__/quick-setup.test.d.ts +0 -2
- package/dist/auth/__tests__/quick-setup.test.d.ts.map +0 -1
- package/dist/auth/__tests__/quick-setup.test.js +0 -95
- package/dist/auth/__tests__/quick-setup.test.js.map +0 -1
- package/dist/auth/__tests__/secure-secret.test.d.ts +0 -2
- package/dist/auth/__tests__/secure-secret.test.d.ts.map +0 -1
- package/dist/auth/__tests__/secure-secret.test.js +0 -104
- package/dist/auth/__tests__/secure-secret.test.js.map +0 -1
- package/dist/auth/__tests__/server-integration.test.d.ts +0 -2
- package/dist/auth/__tests__/server-integration.test.d.ts.map +0 -1
- package/dist/auth/__tests__/server-integration.test.js +0 -156
- package/dist/auth/__tests__/server-integration.test.js.map +0 -1
- package/dist/auth/__tests__/server-metadata.test.d.ts +0 -2
- package/dist/auth/__tests__/server-metadata.test.d.ts.map +0 -1
- package/dist/auth/__tests__/server-metadata.test.js +0 -72
- package/dist/auth/__tests__/server-metadata.test.js.map +0 -1
- package/dist/auth/__tests__/simple-jwt.test.d.ts +0 -2
- package/dist/auth/__tests__/simple-jwt.test.d.ts.map +0 -1
- package/dist/auth/__tests__/simple-jwt.test.js +0 -125
- package/dist/auth/__tests__/simple-jwt.test.js.map +0 -1
- package/dist/auth/__tests__/token-store.test.d.ts +0 -2
- package/dist/auth/__tests__/token-store.test.d.ts.map +0 -1
- package/dist/auth/__tests__/token-store.test.js +0 -167
- package/dist/auth/__tests__/token-store.test.js.map +0 -1
- package/dist/auth/__tests__/token-validation.test.d.ts +0 -2
- package/dist/auth/__tests__/token-validation.test.d.ts.map +0 -1
- package/dist/auth/__tests__/token-validation.test.js +0 -219
- package/dist/auth/__tests__/token-validation.test.js.map +0 -1
- package/dist/auth/api-key.d.ts +0 -118
- package/dist/auth/api-key.d.ts.map +0 -1
- package/dist/auth/api-key.js +0 -168
- package/dist/auth/api-key.js.map +0 -1
- package/dist/auth/client.d.ts +0 -151
- package/dist/auth/client.d.ts.map +0 -1
- package/dist/auth/client.js +0 -330
- package/dist/auth/client.js.map +0 -1
- package/dist/auth/index.d.ts +0 -31
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -46
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/middleware.d.ts +0 -95
- package/dist/auth/middleware.d.ts.map +0 -1
- package/dist/auth/middleware.js +0 -260
- package/dist/auth/middleware.js.map +0 -1
- package/dist/auth/pkce.d.ts +0 -53
- package/dist/auth/pkce.d.ts.map +0 -1
- package/dist/auth/pkce.js +0 -105
- package/dist/auth/pkce.js.map +0 -1
- package/dist/auth/quick-setup.d.ts +0 -94
- package/dist/auth/quick-setup.d.ts.map +0 -1
- package/dist/auth/quick-setup.js +0 -210
- package/dist/auth/quick-setup.js.map +0 -1
- package/dist/auth/secure-secret.d.ts +0 -136
- package/dist/auth/secure-secret.d.ts.map +0 -1
- package/dist/auth/secure-secret.js +0 -182
- package/dist/auth/secure-secret.js.map +0 -1
- package/dist/auth/server-integration.d.ts +0 -97
- package/dist/auth/server-integration.d.ts.map +0 -1
- package/dist/auth/server-integration.js +0 -182
- package/dist/auth/server-integration.js.map +0 -1
- package/dist/auth/server-metadata.d.ts +0 -51
- package/dist/auth/server-metadata.d.ts.map +0 -1
- package/dist/auth/server-metadata.js +0 -106
- package/dist/auth/server-metadata.js.map +0 -1
- package/dist/auth/simple-jwt.d.ts +0 -174
- package/dist/auth/simple-jwt.d.ts.map +0 -1
- package/dist/auth/simple-jwt.js +0 -162
- package/dist/auth/simple-jwt.js.map +0 -1
- package/dist/auth/token-store.d.ts +0 -104
- package/dist/auth/token-store.d.ts.map +0 -1
- package/dist/auth/token-store.js +0 -205
- package/dist/auth/token-store.js.map +0 -1
- package/dist/auth/token-validation.d.ts +0 -59
- package/dist/auth/token-validation.d.ts.map +0 -1
- package/dist/auth/token-validation.js +0 -241
- package/dist/auth/token-validation.js.map +0 -1
- package/dist/auth/types.d.ts +0 -215
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js +0 -6
- package/dist/auth/types.js.map +0 -1
- package/dist/core/__tests__/app-decorator.test.d.ts +0 -2
- package/dist/core/__tests__/app-decorator.test.d.ts.map +0 -1
- package/dist/core/__tests__/app-decorator.test.js +0 -100
- package/dist/core/__tests__/app-decorator.test.js.map +0 -1
- package/dist/core/__tests__/app-factory.extended.test.d.ts +0 -2
- package/dist/core/__tests__/app-factory.extended.test.d.ts.map +0 -1
- package/dist/core/__tests__/app-factory.extended.test.js +0 -244
- package/dist/core/__tests__/app-factory.extended.test.js.map +0 -1
- package/dist/core/__tests__/builders.test.d.ts +0 -2
- package/dist/core/__tests__/builders.test.d.ts.map +0 -1
- package/dist/core/__tests__/builders.test.js +0 -98
- package/dist/core/__tests__/builders.test.js.map +0 -1
- package/dist/core/__tests__/component.test.d.ts +0 -2
- package/dist/core/__tests__/component.test.d.ts.map +0 -1
- package/dist/core/__tests__/component.test.js +0 -151
- package/dist/core/__tests__/component.test.js.map +0 -1
- package/dist/core/__tests__/config-module.test.d.ts +0 -2
- package/dist/core/__tests__/config-module.test.d.ts.map +0 -1
- package/dist/core/__tests__/config-module.test.js +0 -90
- package/dist/core/__tests__/config-module.test.js.map +0 -1
- package/dist/core/__tests__/core-modules.test.d.ts +0 -2
- package/dist/core/__tests__/core-modules.test.d.ts.map +0 -1
- package/dist/core/__tests__/core-modules.test.js +0 -36
- package/dist/core/__tests__/core-modules.test.js.map +0 -1
- package/dist/core/__tests__/di.test.d.ts +0 -2
- package/dist/core/__tests__/di.test.d.ts.map +0 -1
- package/dist/core/__tests__/di.test.js +0 -101
- package/dist/core/__tests__/di.test.js.map +0 -1
- package/dist/core/__tests__/errors.test.d.ts +0 -2
- package/dist/core/__tests__/errors.test.d.ts.map +0 -1
- package/dist/core/__tests__/errors.test.js +0 -109
- package/dist/core/__tests__/errors.test.js.map +0 -1
- package/dist/core/__tests__/final.blitz.test.d.ts +0 -2
- package/dist/core/__tests__/final.blitz.test.d.ts.map +0 -1
- package/dist/core/__tests__/final.blitz.test.js +0 -327
- package/dist/core/__tests__/final.blitz.test.js.map +0 -1
- package/dist/core/__tests__/jwt-module.test.d.ts +0 -2
- package/dist/core/__tests__/jwt-module.test.d.ts.map +0 -1
- package/dist/core/__tests__/jwt-module.test.js +0 -60
- package/dist/core/__tests__/jwt-module.test.js.map +0 -1
- package/dist/core/__tests__/logger.test.d.ts +0 -2
- package/dist/core/__tests__/logger.test.d.ts.map +0 -1
- package/dist/core/__tests__/logger.test.js +0 -83
- package/dist/core/__tests__/logger.test.js.map +0 -1
- package/dist/core/__tests__/models.test.d.ts +0 -2
- package/dist/core/__tests__/models.test.d.ts.map +0 -1
- package/dist/core/__tests__/models.test.js +0 -142
- package/dist/core/__tests__/models.test.js.map +0 -1
- package/dist/core/__tests__/module.test.d.ts +0 -2
- package/dist/core/__tests__/module.test.d.ts.map +0 -1
- package/dist/core/__tests__/module.test.js +0 -58
- package/dist/core/__tests__/module.test.js.map +0 -1
- package/dist/core/__tests__/oauth-module.test.d.ts +0 -2
- package/dist/core/__tests__/oauth-module.test.d.ts.map +0 -1
- package/dist/core/__tests__/oauth-module.test.js +0 -168
- package/dist/core/__tests__/oauth-module.test.js.map +0 -1
- package/dist/core/__tests__/oauth.extended.test.d.ts +0 -2
- package/dist/core/__tests__/oauth.extended.test.d.ts.map +0 -1
- package/dist/core/__tests__/oauth.extended.test.js +0 -146
- package/dist/core/__tests__/oauth.extended.test.js.map +0 -1
- package/dist/core/__tests__/prompt.test.d.ts +0 -2
- package/dist/core/__tests__/prompt.test.d.ts.map +0 -1
- package/dist/core/__tests__/prompt.test.js +0 -126
- package/dist/core/__tests__/prompt.test.js.map +0 -1
- package/dist/core/__tests__/resource.test.d.ts +0 -2
- package/dist/core/__tests__/resource.test.d.ts.map +0 -1
- package/dist/core/__tests__/resource.test.js +0 -173
- package/dist/core/__tests__/resource.test.js.map +0 -1
- package/dist/core/__tests__/server.extended.test.d.ts +0 -2
- package/dist/core/__tests__/server.extended.test.d.ts.map +0 -1
- package/dist/core/__tests__/server.extended.test.js +0 -242
- package/dist/core/__tests__/server.extended.test.js.map +0 -1
- package/dist/core/__tests__/server.test.d.ts +0 -2
- package/dist/core/__tests__/server.test.d.ts.map +0 -1
- package/dist/core/__tests__/server.test.js +0 -120
- package/dist/core/__tests__/server.test.js.map +0 -1
- package/dist/core/__tests__/transport.http.test.d.ts +0 -2
- package/dist/core/__tests__/transport.http.test.d.ts.map +0 -1
- package/dist/core/__tests__/transport.http.test.js +0 -119
- package/dist/core/__tests__/transport.http.test.js.map +0 -1
- package/dist/core/__tests__/transport.streamable.test.d.ts +0 -2
- package/dist/core/__tests__/transport.streamable.test.d.ts.map +0 -1
- package/dist/core/__tests__/transport.streamable.test.js +0 -168
- package/dist/core/__tests__/transport.streamable.test.js.map +0 -1
- package/dist/core/__tests__/transports.test.d.ts +0 -2
- package/dist/core/__tests__/transports.test.d.ts.map +0 -1
- package/dist/core/__tests__/transports.test.js +0 -12
- package/dist/core/__tests__/transports.test.js.map +0 -1
- package/dist/core/apikey-module.d.ts +0 -69
- package/dist/core/apikey-module.d.ts.map +0 -1
- package/dist/core/apikey-module.js +0 -114
- package/dist/core/apikey-module.js.map +0 -1
- package/dist/core/app-decorator.d.ts +0 -59
- package/dist/core/app-decorator.d.ts.map +0 -1
- package/dist/core/app-decorator.js +0 -322
- package/dist/core/app-decorator.js.map +0 -1
- package/dist/core/builders.d.ts +0 -50
- package/dist/core/builders.d.ts.map +0 -1
- package/dist/core/builders.js +0 -139
- package/dist/core/builders.js.map +0 -1
- package/dist/core/component.d.ts +0 -111
- package/dist/core/component.d.ts.map +0 -1
- package/dist/core/component.js +0 -228
- package/dist/core/component.js.map +0 -1
- package/dist/core/config-module.d.ts +0 -62
- package/dist/core/config-module.d.ts.map +0 -1
- package/dist/core/config-module.js +0 -94
- package/dist/core/config-module.js.map +0 -1
- package/dist/core/decorators/__tests__/decorators.test.d.ts +0 -2
- package/dist/core/decorators/__tests__/decorators.test.d.ts.map +0 -1
- package/dist/core/decorators/__tests__/decorators.test.js +0 -103
- package/dist/core/decorators/__tests__/decorators.test.js.map +0 -1
- package/dist/core/decorators/__tests__/extended-decorators.test.d.ts +0 -2
- package/dist/core/decorators/__tests__/extended-decorators.test.d.ts.map +0 -1
- package/dist/core/decorators/__tests__/extended-decorators.test.js +0 -194
- package/dist/core/decorators/__tests__/extended-decorators.test.js.map +0 -1
- package/dist/core/decorators/__tests__/health-check.test.d.ts +0 -2
- package/dist/core/decorators/__tests__/health-check.test.d.ts.map +0 -1
- package/dist/core/decorators/__tests__/health-check.test.js +0 -119
- package/dist/core/decorators/__tests__/health-check.test.js.map +0 -1
- package/dist/core/decorators/cache.decorator.d.ts +0 -61
- package/dist/core/decorators/cache.decorator.d.ts.map +0 -1
- package/dist/core/decorators/cache.decorator.js +0 -115
- package/dist/core/decorators/cache.decorator.js.map +0 -1
- package/dist/core/decorators/health-check.decorator.d.ts +0 -80
- package/dist/core/decorators/health-check.decorator.d.ts.map +0 -1
- package/dist/core/decorators/health-check.decorator.js +0 -153
- package/dist/core/decorators/health-check.decorator.js.map +0 -1
- package/dist/core/decorators/rate-limit.decorator.d.ts +0 -63
- package/dist/core/decorators/rate-limit.decorator.d.ts.map +0 -1
- package/dist/core/decorators/rate-limit.decorator.js +0 -129
- package/dist/core/decorators/rate-limit.decorator.js.map +0 -1
- package/dist/core/decorators.d.ts +0 -190
- package/dist/core/decorators.d.ts.map +0 -1
- package/dist/core/decorators.js +0 -170
- package/dist/core/decorators.js.map +0 -1
- package/dist/core/di/__tests__/container.test.d.ts +0 -2
- package/dist/core/di/__tests__/container.test.d.ts.map +0 -1
- package/dist/core/di/__tests__/container.test.js +0 -88
- package/dist/core/di/__tests__/container.test.js.map +0 -1
- package/dist/core/di/container.d.ts +0 -64
- package/dist/core/di/container.d.ts.map +0 -1
- package/dist/core/di/container.js +0 -105
- package/dist/core/di/container.js.map +0 -1
- package/dist/core/di/injectable.decorator.d.ts +0 -62
- package/dist/core/di/injectable.decorator.d.ts.map +0 -1
- package/dist/core/di/injectable.decorator.js +0 -66
- package/dist/core/di/injectable.decorator.js.map +0 -1
- package/dist/core/di/metadata-shim.d.ts +0 -31
- package/dist/core/di/metadata-shim.d.ts.map +0 -1
- package/dist/core/di/metadata-shim.js +0 -181
- package/dist/core/di/metadata-shim.js.map +0 -1
- package/dist/core/errors.d.ts +0 -54
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/errors.js +0 -87
- package/dist/core/errors.js.map +0 -1
- package/dist/core/events/__tests__/events.test.d.ts +0 -2
- package/dist/core/events/__tests__/events.test.d.ts.map +0 -1
- package/dist/core/events/__tests__/events.test.js +0 -177
- package/dist/core/events/__tests__/events.test.js.map +0 -1
- package/dist/core/events/event-emitter.d.ts +0 -50
- package/dist/core/events/event-emitter.d.ts.map +0 -1
- package/dist/core/events/event-emitter.js +0 -94
- package/dist/core/events/event-emitter.js.map +0 -1
- package/dist/core/events/event.decorator.d.ts +0 -48
- package/dist/core/events/event.decorator.d.ts.map +0 -1
- package/dist/core/events/event.decorator.js +0 -72
- package/dist/core/events/event.decorator.js.map +0 -1
- package/dist/core/events/log-emitter.d.ts +0 -14
- package/dist/core/events/log-emitter.d.ts.map +0 -1
- package/dist/core/events/log-emitter.js +0 -20
- package/dist/core/events/log-emitter.js.map +0 -1
- package/dist/core/filters/__tests__/filters.test.d.ts +0 -2
- package/dist/core/filters/__tests__/filters.test.d.ts.map +0 -1
- package/dist/core/filters/__tests__/filters.test.js +0 -72
- package/dist/core/filters/__tests__/filters.test.js.map +0 -1
- package/dist/core/filters/exception-filter.decorator.d.ts +0 -40
- package/dist/core/filters/exception-filter.decorator.d.ts.map +0 -1
- package/dist/core/filters/exception-filter.decorator.js +0 -54
- package/dist/core/filters/exception-filter.decorator.js.map +0 -1
- package/dist/core/filters/exception-filter.interface.d.ts +0 -39
- package/dist/core/filters/exception-filter.interface.d.ts.map +0 -1
- package/dist/core/filters/exception-filter.interface.js +0 -2
- package/dist/core/filters/exception-filter.interface.js.map +0 -1
- package/dist/core/guards/__tests__/guards.test.d.ts +0 -2
- package/dist/core/guards/__tests__/guards.test.d.ts.map +0 -1
- package/dist/core/guards/__tests__/guards.test.js +0 -55
- package/dist/core/guards/__tests__/guards.test.js.map +0 -1
- package/dist/core/guards/apikey.guard.d.ts +0 -22
- package/dist/core/guards/apikey.guard.d.ts.map +0 -1
- package/dist/core/guards/apikey.guard.js +0 -11
- package/dist/core/guards/apikey.guard.js.map +0 -1
- package/dist/core/guards/guard.interface.d.ts +0 -18
- package/dist/core/guards/guard.interface.d.ts.map +0 -1
- package/dist/core/guards/guard.interface.js +0 -2
- package/dist/core/guards/guard.interface.js.map +0 -1
- package/dist/core/guards/jwt.guard.d.ts +0 -18
- package/dist/core/guards/jwt.guard.d.ts.map +0 -1
- package/dist/core/guards/jwt.guard.js +0 -2
- package/dist/core/guards/jwt.guard.js.map +0 -1
- package/dist/core/guards/oauth.guard.d.ts +0 -35
- package/dist/core/guards/oauth.guard.d.ts.map +0 -1
- package/dist/core/guards/oauth.guard.js +0 -2
- package/dist/core/guards/oauth.guard.js.map +0 -1
- package/dist/core/guards/use-guards.decorator.d.ts +0 -25
- package/dist/core/guards/use-guards.decorator.d.ts.map +0 -1
- package/dist/core/guards/use-guards.decorator.js +0 -32
- package/dist/core/guards/use-guards.decorator.js.map +0 -1
- package/dist/core/health/__tests__/health.test.d.ts +0 -2
- package/dist/core/health/__tests__/health.test.d.ts.map +0 -1
- package/dist/core/health/__tests__/health.test.js +0 -31
- package/dist/core/health/__tests__/health.test.js.map +0 -1
- package/dist/core/health/health-checks.resource.d.ts +0 -14
- package/dist/core/health/health-checks.resource.d.ts.map +0 -1
- package/dist/core/health/health-checks.resource.js +0 -29
- package/dist/core/health/health-checks.resource.js.map +0 -1
- package/dist/core/index.d.ts +0 -57
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -59
- package/dist/core/index.js.map +0 -1
- package/dist/core/interceptors/__tests__/interceptors.test.d.ts +0 -2
- package/dist/core/interceptors/__tests__/interceptors.test.d.ts.map +0 -1
- package/dist/core/interceptors/__tests__/interceptors.test.js +0 -52
- package/dist/core/interceptors/__tests__/interceptors.test.js.map +0 -1
- package/dist/core/interceptors/interceptor.decorator.d.ts +0 -37
- package/dist/core/interceptors/interceptor.decorator.d.ts.map +0 -1
- package/dist/core/interceptors/interceptor.decorator.js +0 -51
- package/dist/core/interceptors/interceptor.decorator.js.map +0 -1
- package/dist/core/interceptors/interceptor.interface.d.ts +0 -31
- package/dist/core/interceptors/interceptor.interface.d.ts.map +0 -1
- package/dist/core/interceptors/interceptor.interface.js +0 -2
- package/dist/core/interceptors/interceptor.interface.js.map +0 -1
- package/dist/core/jwt-module.d.ts +0 -51
- package/dist/core/jwt-module.d.ts.map +0 -1
- package/dist/core/jwt-module.js +0 -52
- package/dist/core/jwt-module.js.map +0 -1
- package/dist/core/logger.d.ts +0 -18
- package/dist/core/logger.d.ts.map +0 -1
- package/dist/core/logger.js +0 -53
- package/dist/core/logger.js.map +0 -1
- package/dist/core/middleware/__tests__/middleware.test.d.ts +0 -2
- package/dist/core/middleware/__tests__/middleware.test.d.ts.map +0 -1
- package/dist/core/middleware/__tests__/middleware.test.js +0 -105
- package/dist/core/middleware/__tests__/middleware.test.js.map +0 -1
- package/dist/core/middleware/middleware.decorator.d.ts +0 -39
- package/dist/core/middleware/middleware.decorator.d.ts.map +0 -1
- package/dist/core/middleware/middleware.decorator.js +0 -53
- package/dist/core/middleware/middleware.decorator.js.map +0 -1
- package/dist/core/middleware/middleware.interface.d.ts +0 -29
- package/dist/core/middleware/middleware.interface.d.ts.map +0 -1
- package/dist/core/middleware/middleware.interface.js +0 -2
- package/dist/core/middleware/middleware.interface.js.map +0 -1
- package/dist/core/module.d.ts +0 -93
- package/dist/core/module.d.ts.map +0 -1
- package/dist/core/module.js +0 -87
- package/dist/core/module.js.map +0 -1
- package/dist/core/oauth-module.d.ts +0 -123
- package/dist/core/oauth-module.d.ts.map +0 -1
- package/dist/core/oauth-module.js +0 -324
- package/dist/core/oauth-module.js.map +0 -1
- package/dist/core/pipes/__tests__/pipes.test.d.ts +0 -2
- package/dist/core/pipes/__tests__/pipes.test.d.ts.map +0 -1
- package/dist/core/pipes/__tests__/pipes.test.js +0 -164
- package/dist/core/pipes/__tests__/pipes.test.js.map +0 -1
- package/dist/core/pipes/pipe.decorator.d.ts +0 -64
- package/dist/core/pipes/pipe.decorator.d.ts.map +0 -1
- package/dist/core/pipes/pipe.decorator.js +0 -85
- package/dist/core/pipes/pipe.decorator.js.map +0 -1
- package/dist/core/pipes/pipe.interface.d.ts +0 -41
- package/dist/core/pipes/pipe.interface.d.ts.map +0 -1
- package/dist/core/pipes/pipe.interface.js +0 -2
- package/dist/core/pipes/pipe.interface.js.map +0 -1
- package/dist/core/prompt.d.ts +0 -46
- package/dist/core/prompt.d.ts.map +0 -1
- package/dist/core/prompt.js +0 -76
- package/dist/core/prompt.js.map +0 -1
- package/dist/core/resource.d.ts +0 -47
- package/dist/core/resource.d.ts.map +0 -1
- package/dist/core/resource.js +0 -90
- package/dist/core/resource.js.map +0 -1
- package/dist/core/server.d.ts +0 -129
- package/dist/core/server.d.ts.map +0 -1
- package/dist/core/server.js +0 -617
- package/dist/core/server.js.map +0 -1
- package/dist/core/tool.d.ts +0 -108
- package/dist/core/tool.d.ts.map +0 -1
- package/dist/core/tool.js +0 -241
- package/dist/core/tool.js.map +0 -1
- package/dist/core/transports/__tests__/transports.test.d.ts +0 -2
- package/dist/core/transports/__tests__/transports.test.d.ts.map +0 -1
- package/dist/core/transports/__tests__/transports.test.js +0 -249
- package/dist/core/transports/__tests__/transports.test.js.map +0 -1
- package/dist/core/transports/discovery-http-server.d.ts +0 -19
- package/dist/core/transports/discovery-http-server.d.ts.map +0 -1
- package/dist/core/transports/discovery-http-server.js +0 -54
- package/dist/core/transports/discovery-http-server.js.map +0 -1
- package/dist/core/transports/http-server.d.ts +0 -108
- package/dist/core/transports/http-server.d.ts.map +0 -1
- package/dist/core/transports/http-server.js +0 -293
- package/dist/core/transports/http-server.js.map +0 -1
- package/dist/core/transports/streamable-http.d.ts +0 -177
- package/dist/core/transports/streamable-http.d.ts.map +0 -1
- package/dist/core/transports/streamable-http.js +0 -1287
- package/dist/core/transports/streamable-http.js.map +0 -1
- package/dist/core/types.d.ts +0 -195
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -2
- package/dist/core/types.js.map +0 -1
- package/dist/core/widgets/__tests__/registry.test.d.ts +0 -2
- package/dist/core/widgets/__tests__/registry.test.d.ts.map +0 -1
- package/dist/core/widgets/__tests__/registry.test.js +0 -69
- package/dist/core/widgets/__tests__/registry.test.js.map +0 -1
- package/dist/core/widgets/widget-examples.resource.d.ts +0 -17
- package/dist/core/widgets/widget-examples.resource.d.ts.map +0 -1
- package/dist/core/widgets/widget-examples.resource.js +0 -28
- package/dist/core/widgets/widget-examples.resource.js.map +0 -1
- package/dist/core/widgets/widget-registry.d.ts +0 -56
- package/dist/core/widgets/widget-registry.d.ts.map +0 -1
- package/dist/core/widgets/widget-registry.js +0 -75
- package/dist/core/widgets/widget-registry.js.map +0 -1
- package/dist/testing/__tests__/testing.test.d.ts +0 -2
- package/dist/testing/__tests__/testing.test.d.ts.map +0 -1
- package/dist/testing/__tests__/testing.test.js +0 -167
- package/dist/testing/__tests__/testing.test.js.map +0 -1
- package/dist/testing/index.d.ts +0 -103
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js +0 -161
- package/dist/testing/index.js.map +0 -1
- package/dist/ui-next/__tests__/ui-next.test.d.ts +0 -2
- package/dist/ui-next/__tests__/ui-next.test.d.ts.map +0 -1
- package/dist/ui-next/__tests__/ui-next.test.js +0 -74
- package/dist/ui-next/__tests__/ui-next.test.js.map +0 -1
- package/dist/ui-next/index.d.ts +0 -31
- package/dist/ui-next/index.d.ts.map +0 -1
- package/dist/ui-next/index.js +0 -687
- 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;AAC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E,WAAW,CAAC,IAAI,EAAE,CAAC;AACzE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,MAAwB;IAC7C,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;AAC3D,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
/**
|
|
3
|
-
* Constructor type for metatype
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipe.interface.js","sourceRoot":"","sources":["../../../src/core/pipes/pipe.interface.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|
package/dist/core/prompt.d.ts
DELETED
|
@@ -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"}
|
package/dist/core/prompt.js
DELETED
|
@@ -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
|
package/dist/core/prompt.js.map
DELETED
|
@@ -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,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,SAAS;YAAE,OAAO;QAEvC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;YAC5C,IAAI,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;gBACxC,MAAM,IAAI,eAAe,CACvB,8BAA8B,GAAG,CAAC,IAAI,iBAAiB,IAAI,CAAC,IAAI,GAAG,CACpE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,UAA4B;IACvD,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/core/resource.d.ts
DELETED
|
@@ -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"}
|
package/dist/core/resource.js
DELETED
|
@@ -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,I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kCAAkC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YAClE,OAAO,OAAO,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAChI,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;OAEG;IACH,UAAU;QACR,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,IAAI,EAAE,IAAI,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"}
|
package/dist/core/server.d.ts
DELETED
|
@@ -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;;GAEG;AACH,UAAU,aAAa;IACrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,gBAAgB,CAAC,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IAC5D,eAAe,CAAC,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACzF;AAED;;GAEG;AACH,UAAU,cAAc;IACtB,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;GAEG;AAC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