raiton 6.8.9-beta.25 → 6.10.0-beta.28
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/CHANGELOG.md +44 -0
- package/README.md +46 -1
- package/benchmarks/README.md +16 -0
- package/benchmarks/latest.json +172 -0
- package/benchmarks/latest.md +66 -0
- package/build/bin/index.mjs +33550 -21725
- package/build/types/bin/bootstrapper.d.ts +2 -0
- package/build/types/bin/cli-output.d.ts +46 -0
- package/build/types/bin/cli-tools.d.ts +13 -0
- package/build/types/bin/cli.d.ts +3 -0
- package/build/types/bin/commands.registry.d.ts +4 -0
- package/build/types/bin/constants.d.ts +3 -0
- package/build/types/bin/file-utils.d.ts +21 -0
- package/build/types/bin/index.d.ts +2 -0
- package/build/types/bin/name-utils.d.ts +4 -0
- package/build/types/bin/project-utils.d.ts +12 -0
- package/build/types/commands/artifact.command.d.ts +7 -0
- package/build/types/commands/build.command.d.ts +8 -0
- package/build/types/commands/client.command.d.ts +7 -0
- package/build/types/commands/contract.command.d.ts +8 -0
- package/build/types/commands/develop.command.d.ts +9 -0
- package/build/types/commands/docs.command.d.ts +8 -0
- package/build/types/commands/doctor.command.d.ts +9 -0
- package/build/types/commands/generate.command.d.ts +7 -0
- package/build/types/commands/inspect.command.d.ts +7 -0
- package/build/types/commands/mcp.command.d.ts +11 -0
- package/build/types/commands/new.command.d.ts +7 -0
- package/build/types/commands/openapi.command.d.ts +7 -0
- package/build/types/commands/routes.command.d.ts +7 -0
- package/build/types/commands/start.command.d.ts +9 -0
- package/build/types/commands/why.command.d.ts +7 -0
- package/build/types/contracts/decorators.d.ts +41 -0
- package/build/types/contracts/errors.d.ts +42 -0
- package/build/types/contracts/index.d.ts +4 -0
- package/build/types/contracts/schema.d.ts +70 -0
- package/build/types/contracts/typebox.d.ts +81 -0
- package/build/types/core/application.d.ts +37 -0
- package/build/types/core/artifacts/artifact.d.ts +3 -0
- package/build/types/core/artifacts/index.d.ts +1 -0
- package/build/types/core/artifacts/runner.d.ts +1 -0
- package/build/types/core/builder.d.ts +42 -0
- package/build/types/core/bytes.util.d.ts +3 -0
- package/build/types/core/command.d.ts +13 -0
- package/build/types/core/commands.d.ts +10 -0
- package/build/types/core/config/config.d.ts +27 -0
- package/build/types/core/config/define.d.ts +8 -0
- package/build/types/core/config/index.d.ts +3 -0
- package/build/types/core/config/schema.d.ts +24 -0
- package/build/types/core/context.d.ts +11 -0
- package/build/types/core/controller/builder.d.ts +26 -0
- package/build/types/core/controller/compiler.d.ts +2 -0
- package/build/types/core/controller/index.d.ts +4 -0
- package/build/types/core/controller/metadata.d.ts +3 -0
- package/build/types/core/controller/tracker.d.ts +9 -0
- package/build/types/core/directories.d.ts +10 -0
- package/build/types/core/guards.d.ts +11 -0
- package/build/types/core/helpers/index.d.ts +1 -0
- package/build/types/core/helpers/raiton.d.ts +1 -0
- package/build/types/core/hooks.d.ts +14 -0
- package/build/types/core/index.d.ts +17 -0
- package/build/types/core/injection/index.d.ts +1 -0
- package/build/types/core/injection/injection.d.ts +37 -0
- package/build/types/core/mcp/builder.d.ts +2 -0
- package/build/types/core/mcp/index.d.ts +3 -0
- package/build/types/core/mcp/metadata.d.ts +9 -0
- package/build/types/core/mcp/tracker.d.ts +9 -0
- package/build/types/core/middleware/compose.d.ts +8 -0
- package/build/types/core/middleware/index.d.ts +2 -0
- package/build/types/core/middleware/pipeline.d.ts +12 -0
- package/build/types/core/plugins/index.d.ts +2 -0
- package/build/types/core/plugins/plugin.d.ts +2 -0
- package/build/types/core/plugins/scope.d.ts +15 -0
- package/build/types/core/process.util.d.ts +1 -0
- package/build/types/core/raiton.d.ts +15 -0
- package/build/types/core/router/handler.d.ts +2 -0
- package/build/types/core/router/handler.utils.d.ts +37 -0
- package/build/types/core/router/index.d.ts +4 -0
- package/build/types/core/router/matcher.d.ts +50 -0
- package/build/types/core/router/route.d.ts +52 -0
- package/build/types/core/router/router.d.ts +23 -0
- package/build/types/core/scheduler/builder.d.ts +2 -0
- package/build/types/core/scheduler/cron.d.ts +32 -0
- package/build/types/core/scheduler/duration.d.ts +7 -0
- package/build/types/core/scheduler/index.d.ts +6 -0
- package/build/types/core/scheduler/manager.d.ts +47 -0
- package/build/types/core/scheduler/metadata.d.ts +8 -0
- package/build/types/core/scheduler/queue/backend.d.ts +42 -0
- package/build/types/core/scheduler/queue/index.d.ts +3 -0
- package/build/types/core/scheduler/queue/rabbitmq.backend.d.ts +37 -0
- package/build/types/core/scheduler/queue/redis.backend.d.ts +38 -0
- package/build/types/core/server.d.ts +9 -0
- package/build/types/core/socket/builder.d.ts +1 -0
- package/build/types/core/socket/index.d.ts +2 -0
- package/build/types/core/socket/metadata.d.ts +14 -0
- package/build/types/core/thread.d.ts +21 -0
- package/build/types/framework/artifacts.d.ts +20 -0
- package/build/types/framework/cache/cache.d.ts +84 -0
- package/build/types/framework/cache/cache.decorator.d.ts +21 -0
- package/build/types/framework/cache/etag.d.ts +62 -0
- package/build/types/framework/cache/index.d.ts +4 -0
- package/build/types/framework/cache/types.d.ts +89 -0
- package/build/types/framework/constants/decorators.constant.d.ts +28 -0
- package/build/types/framework/constants/index.d.ts +2 -0
- package/build/types/framework/constants/microservices.constant.d.ts +3 -0
- package/build/types/framework/controllers.d.ts +2 -0
- package/build/types/framework/data-transfer-object.d.ts +5 -0
- package/build/types/framework/decorators/access-guard.decorator.d.ts +1 -0
- package/build/types/framework/decorators/api-response.decorator.d.ts +66 -0
- package/build/types/framework/decorators/api.decorator.d.ts +160 -0
- package/build/types/framework/decorators/controllable.decorator.d.ts +3 -0
- package/build/types/framework/decorators/csrf-guard.decorator.d.ts +2 -0
- package/build/types/framework/decorators/csrf-token.decorator.d.ts +1 -0
- package/build/types/framework/decorators/guard.decorator.d.ts +2 -0
- package/build/types/framework/decorators/health-check.decorator.d.ts +17 -0
- package/build/types/framework/decorators/index.d.ts +15 -0
- package/build/types/framework/decorators/injection.decorator.d.ts +5 -0
- package/build/types/framework/decorators/mcp.decorator.d.ts +68 -0
- package/build/types/framework/decorators/middleware.decorator.d.ts +3 -0
- package/build/types/framework/decorators/parametrable.decorator.d.ts +9 -0
- package/build/types/framework/decorators/routable.decorator.d.ts +12 -0
- package/build/types/framework/decorators/route-interaction.decorator.d.ts +81 -0
- package/build/types/framework/decorators/scheduler.decorator.d.ts +54 -0
- package/build/types/framework/decorators/socket.decorator.d.ts +5 -0
- package/build/types/framework/encryption.d.ts +25 -0
- package/build/types/framework/enums/csrf.enum.d.ts +4 -0
- package/build/types/framework/enums/encrypted.enum.d.ts +20 -0
- package/build/types/framework/enums/event.message.enum.d.ts +4 -0
- package/build/types/framework/enums/http-method.enum.d.ts +10 -0
- package/build/types/framework/enums/http-parameters.enum.d.ts +11 -0
- package/build/types/framework/enums/http-status.enum.d.ts +64 -0
- package/build/types/framework/enums/index.d.ts +9 -0
- package/build/types/framework/enums/runtime.enum.d.ts +5 -0
- package/build/types/framework/enums/scheduler.enum.d.ts +21 -0
- package/build/types/framework/enums/timestamp.enum.d.ts +6 -0
- package/build/types/framework/env.d.ts +3 -0
- package/build/types/framework/errors/catalog.d.ts +42 -0
- package/build/types/framework/exceptions/http-exception.d.ts +18 -0
- package/build/types/framework/exceptions/index.d.ts +2 -0
- package/build/types/framework/exceptions/throwable.d.ts +76 -0
- package/build/types/framework/health-check.d.ts +42 -0
- package/build/types/framework/index.d.ts +20 -0
- package/build/types/framework/mcp/audit.d.ts +12 -0
- package/build/types/framework/mcp/conformance.d.ts +31 -0
- package/build/types/framework/mcp/handler.d.ts +11 -0
- package/build/types/framework/mcp/index.d.ts +5 -0
- package/build/types/framework/mcp/protocol.d.ts +17 -0
- package/build/types/framework/mcp/rate-limit.d.ts +10 -0
- package/build/types/framework/mcp/stdio.d.ts +40 -0
- package/build/types/framework/mcp/streamable-http.d.ts +17 -0
- package/build/types/framework/observability/index.d.ts +6 -0
- package/build/types/framework/observability/metrics.d.ts +23 -0
- package/build/types/framework/observability/plugin.d.ts +20 -0
- package/build/types/framework/observability/readiness.d.ts +9 -0
- package/build/types/framework/observability/request.d.ts +7 -0
- package/build/types/framework/observability/shutdown.d.ts +21 -0
- package/build/types/framework/observability/trace.d.ts +96 -0
- package/build/types/framework/parameter-bag.d.ts +14 -0
- package/build/types/framework/plugins/body-parser.plugin.d.ts +3 -0
- package/build/types/framework/plugins/dev.plugin.d.ts +12 -0
- package/build/types/framework/plugins/index.d.ts +5 -0
- package/build/types/framework/plugins/mcp.plugin.d.ts +15 -0
- package/build/types/framework/plugins/openapi.plugin.d.ts +58 -0
- package/build/types/framework/plugins/security/body-limit.d.ts +1 -0
- package/build/types/framework/plugins/security/cors.d.ts +10 -0
- package/build/types/framework/plugins/security/csrf.d.ts +2 -0
- package/build/types/framework/plugins/security/headers.d.ts +1 -0
- package/build/types/framework/plugins/security/index.d.ts +13 -0
- package/build/types/framework/plugins/security/method-guard.d.ts +1 -0
- package/build/types/framework/plugins/security/rate-limit.d.ts +5 -0
- package/build/types/framework/repositories.d.ts +5 -0
- package/build/types/framework/responses/error.d.ts +13 -0
- package/build/types/framework/responses/helpers.d.ts +7 -0
- package/build/types/framework/responses/http-throwable.d.ts +14 -0
- package/build/types/framework/responses/http.d.ts +13 -0
- package/build/types/framework/responses/index.d.ts +4 -0
- package/build/types/framework/runtime/bun/server.d.ts +2 -0
- package/build/types/framework/runtime/deno/server.d.ts +2 -0
- package/build/types/framework/runtime/index.d.ts +17 -0
- package/build/types/framework/runtime/node/reply.d.ts +12 -0
- package/build/types/framework/runtime/node/request.d.ts +33 -0
- package/build/types/framework/runtime/node/server.d.ts +2 -0
- package/build/types/framework/runtime/web/server.d.ts +1 -0
- package/build/types/framework/services.d.ts +5 -0
- package/build/types/framework/utilities/alias-path.util.d.ts +1 -0
- package/build/types/framework/utilities/artifact.util.d.ts +7 -0
- package/build/types/framework/utilities/callable.util.d.ts +1 -0
- package/build/types/framework/utilities/cookie.util.d.ts +1 -0
- package/build/types/framework/utilities/csrf.util.d.ts +26 -0
- package/build/types/framework/utilities/https.util.d.ts +49 -0
- package/build/types/framework/utilities/index.d.ts +12 -0
- package/build/types/framework/utilities/ip.util.d.ts +15 -0
- package/build/types/framework/utilities/json.util.d.ts +10 -0
- package/build/types/framework/utilities/openapi.utils.d.ts +7 -0
- package/build/types/framework/utilities/openapi.utils.impl.d.ts +18 -0
- package/build/types/framework/utilities/path.util.d.ts +3 -0
- package/build/types/framework/utilities/route-suggestion.util.d.ts +10 -0
- package/build/types/framework/utilities/url.util.d.ts +1 -0
- package/build/types/framework/utilities/utilities.util.d.ts +3 -0
- package/build/types/framework/utilities/validation.util.d.ts +8 -0
- package/build/types/framework/view-model.d.ts +4 -0
- package/build/types/generators/artifact.templates.d.ts +7 -0
- package/build/types/generators/index.d.ts +2 -0
- package/build/types/generators/project.templates.d.ts +21 -0
- package/build/types/manifest/client.d.ts +12 -0
- package/build/types/manifest/contract.d.ts +25 -0
- package/build/types/manifest/index.d.ts +5 -0
- package/build/types/manifest/introspect.d.ts +18 -0
- package/build/types/manifest/manifest.d.ts +18 -0
- package/build/types/manifest/schema.d.ts +177 -0
- package/build/types/requirements.d.ts +1 -0
- package/build/types/types/access-guards.d.ts +4 -0
- package/build/types/types/application.d.ts +32 -0
- package/build/types/types/artifact.d.ts +8 -0
- package/build/types/types/builder.d.ts +37 -0
- package/build/types/types/config.d.ts +62 -0
- package/build/types/types/controller.d.ts +27 -0
- package/build/types/types/contruct.d.ts +1 -0
- package/build/types/types/core.d.ts +11 -0
- package/build/types/types/csrf.d.ts +33 -0
- package/build/types/types/directory.d.ts +6 -0
- package/build/types/types/encryption.d.ts +14 -0
- package/build/types/types/generic.d.ts +2 -0
- package/build/types/types/guard.d.ts +9 -0
- package/build/types/types/http-responses.d.ts +7 -0
- package/build/types/types/index.d.ts +27 -0
- package/build/types/types/injection.d.ts +11 -0
- package/build/types/types/lifecycle.d.ts +9 -0
- package/build/types/types/mcp.d.ts +148 -0
- package/build/types/types/middleware.d.ts +12 -0
- package/build/types/types/parseable.d.ts +3 -0
- package/build/types/types/plugin.d.ts +6 -0
- package/build/types/types/raiton.d.ts +13 -0
- package/build/types/types/responses.d.ts +20 -0
- package/build/types/types/router.d.ts +13 -0
- package/build/types/types/runtime.d.ts +48 -0
- package/build/types/types/scheduler.d.ts +140 -0
- package/build/types/types/scheme.d.ts +125 -0
- package/build/types/types/server.d.ts +10 -0
- package/build/types/types/socket.d.ts +11 -0
- package/build/types/types/thread.d.ts +25 -0
- package/build/types/types/utilities.d.ts +4 -0
- package/build/types/types/values.d.ts +2 -0
- package/docs/AGENTS.md +55 -0
- package/docs/CLAUDE.md +55 -0
- package/docs/README.md +5 -0
- package/docs/contributors/cli/README.md +17 -3
- package/docs/contributors/cli/commands.md +28 -17
- package/docs/contributors/framework/plugins/openapi.md +12 -3
- package/docs/generated/cli/commands.md +26 -0
- package/docs/generated/config-schema.json +150 -0
- package/docs/generated/manifest-schema.json +236 -0
- package/docs/generated/manifest.json +101 -0
- package/docs/llms-full.txt +1271 -0
- package/docs/llms.txt +46 -0
- package/docs/user-guide/README.md +18 -12
- package/docs/user-guide/cli.md +21 -0
- package/docs/user-guide/config.md +14 -0
- package/docs/user-guide/contracts.md +67 -0
- package/docs/user-guide/en/README.md +83 -0
- package/docs/user-guide/getting-started.md +13 -1
- package/docs/user-guide/mcp.md +45 -2
- package/docs/user-guide/observability.md +74 -0
- package/docs/user-guide/openapi/plugin.md +10 -0
- package/docs/user-guide/recipes/README.md +32 -0
- package/docs/user-guide/recipes/contracts.md +52 -0
- package/docs/user-guide/recipes/doctor.md +16 -0
- package/docs/user-guide/recipes/generate.md +28 -0
- package/docs/user-guide/recipes/manifest.md +17 -0
- package/docs/user-guide/recipes/mcp-stdio.md +35 -0
- package/docs/user-guide/recipes/new-project.md +34 -0
- package/docs/user-guide/recipes/observability.md +17 -0
- package/package.json +40 -7
- package/scripts/bench.ts +586 -0
- package/scripts/postinstall.mjs +15 -0
- package/source/bin/cli-output.ts +139 -0
- package/source/bin/commands.registry.ts +23 -3
- package/source/bin/file-utils.ts +95 -0
- package/source/bin/name-utils.ts +26 -0
- package/source/bin/project-utils.ts +78 -0
- package/source/commands/artifact.command.ts +30 -15
- package/source/commands/client.command.ts +64 -0
- package/source/commands/contract.command.ts +104 -0
- package/source/commands/docs.command.ts +263 -0
- package/source/commands/doctor.command.ts +226 -0
- package/source/commands/generate.command.ts +58 -0
- package/source/commands/inspect.command.ts +108 -0
- package/source/commands/mcp.command.ts +258 -0
- package/source/commands/new.command.ts +135 -0
- package/source/commands/openapi.command.ts +95 -0
- package/source/commands/routes.command.ts +39 -0
- package/source/commands/why.command.ts +61 -0
- package/source/contracts/decorators.ts +151 -0
- package/source/contracts/errors.ts +76 -0
- package/source/contracts/index.ts +4 -0
- package/source/contracts/schema.ts +377 -0
- package/source/contracts/typebox.ts +193 -0
- package/source/core/application.ts +215 -73
- package/source/core/builder.ts +6 -2
- package/source/core/config/config.ts +144 -26
- package/source/core/config/define.ts +35 -8
- package/source/core/config/index.ts +2 -1
- package/source/core/config/schema.ts +263 -0
- package/source/core/controller/builder.ts +38 -13
- package/source/core/controller/compiler.ts +14 -7
- package/source/core/controller/metadata.ts +1 -1
- package/source/core/hooks.ts +13 -1
- package/source/core/injection/injection.ts +47 -9
- package/source/core/mcp/builder.ts +13 -2
- package/source/core/mcp/metadata.ts +2 -1
- package/source/core/middleware/compose.ts +48 -0
- package/source/core/middleware/pipeline.ts +69 -46
- package/source/core/raiton.ts +8 -0
- package/source/core/router/handler.ts +91 -31
- package/source/core/router/handler.utils.ts +107 -51
- package/source/core/router/matcher.ts +195 -24
- package/source/core/router/route.ts +100 -31
- package/source/core/router/router.ts +27 -2
- package/source/core/scheduler/metadata.ts +1 -1
- package/source/core/socket/metadata.ts +1 -1
- package/source/core/thread.ts +37 -2
- package/source/framework/artifacts.ts +47 -15
- package/source/framework/cache/cache.ts +48 -3
- package/source/framework/constants/decorators.constant.ts +5 -0
- package/source/framework/data-transfer-object.ts +4 -3
- package/source/framework/decorators/controllable.decorator.ts +3 -3
- package/source/framework/decorators/csrf-guard.decorator.ts +3 -2
- package/source/framework/decorators/csrf-token.decorator.ts +1 -1
- package/source/framework/decorators/guard.decorator.ts +3 -2
- package/source/framework/decorators/health-check.decorator.ts +1 -1
- package/source/framework/decorators/mcp.decorator.ts +38 -7
- package/source/framework/decorators/middleware.decorator.ts +2 -2
- package/source/framework/decorators/parametrable.decorator.ts +2 -1
- package/source/framework/decorators/routable.decorator.ts +3 -3
- package/source/framework/decorators/route-interaction.decorator.ts +2 -2
- package/source/framework/decorators/scheduler.decorator.ts +3 -3
- package/source/framework/decorators/socket.decorator.ts +3 -3
- package/source/framework/encryption.ts +46 -7
- package/source/framework/errors/catalog.ts +159 -0
- package/source/framework/exceptions/http-exception.ts +1 -1
- package/source/framework/health-check.ts +18 -0
- package/source/framework/index.ts +2 -0
- package/source/framework/mcp/audit.ts +57 -0
- package/source/framework/mcp/conformance.ts +195 -0
- package/source/framework/mcp/handler.ts +131 -9
- package/source/framework/mcp/index.ts +6 -1
- package/source/framework/mcp/protocol.ts +6 -0
- package/source/framework/mcp/rate-limit.ts +33 -0
- package/source/framework/mcp/stdio.ts +150 -0
- package/source/framework/mcp/streamable-http.ts +36 -5
- package/source/framework/observability/index.ts +6 -0
- package/source/framework/observability/metrics.ts +162 -0
- package/source/framework/observability/plugin.ts +151 -0
- package/source/framework/observability/readiness.ts +22 -0
- package/source/framework/observability/request.ts +31 -0
- package/source/framework/observability/shutdown.ts +68 -0
- package/source/framework/observability/trace.ts +241 -0
- package/source/framework/plugins/body-parser.plugin.ts +88 -85
- package/source/framework/plugins/dev.plugin.ts +227 -0
- package/source/framework/plugins/index.ts +2 -1
- package/source/framework/plugins/mcp.plugin.ts +14 -3
- package/source/framework/plugins/openapi.plugin.ts +56 -13
- package/source/framework/responses/helpers.ts +4 -4
- package/source/framework/responses/http-throwable.ts +1 -1
- package/source/framework/runtime/bun/server.ts +2 -1
- package/source/framework/runtime/deno/server.ts +2 -1
- package/source/framework/runtime/index.ts +45 -13
- package/source/framework/runtime/node/request.ts +59 -13
- package/source/framework/utilities/index.ts +3 -1
- package/source/framework/utilities/openapi.utils.impl.ts +705 -0
- package/source/framework/utilities/openapi.utils.ts +6 -636
- package/source/framework/utilities/route-suggestion.util.ts +59 -0
- package/source/framework/utilities/validation.util.ts +20 -0
- package/source/generators/artifact.templates.ts +230 -0
- package/source/generators/index.ts +2 -0
- package/source/generators/project.templates.ts +392 -0
- package/source/manifest/client.ts +299 -0
- package/source/manifest/contract.ts +138 -0
- package/source/manifest/index.ts +5 -0
- package/source/manifest/introspect.ts +52 -0
- package/source/manifest/manifest.ts +341 -0
- package/source/manifest/schema.ts +149 -0
- package/source/types/builder.ts +5 -0
- package/source/types/config.ts +64 -2
- package/source/types/mcp.ts +63 -1
- package/tsconfig.build.json +13 -0
- package/source/commands/grafts.command.ts +0 -27
- package/tests/artifact-resolution.test.ts +0 -60
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
export declare const MANIFEST_SCHEMA_VERSION = "1.0.0";
|
|
2
|
+
export declare const RouteManifestSchema: import("@sinclair/typebox").TObject<{
|
|
3
|
+
method: import("@sinclair/typebox").TString;
|
|
4
|
+
path: import("@sinclair/typebox").TString;
|
|
5
|
+
version: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
6
|
+
controller: import("@sinclair/typebox").TString;
|
|
7
|
+
handler: import("@sinclair/typebox").TString;
|
|
8
|
+
file: import("@sinclair/typebox").TString;
|
|
9
|
+
line: import("@sinclair/typebox").TNumber;
|
|
10
|
+
input: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
11
|
+
output: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
12
|
+
inputSchema: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
13
|
+
outputSchema: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const McpToolManifestSchema: import("@sinclair/typebox").TObject<{
|
|
16
|
+
name: import("@sinclair/typebox").TString;
|
|
17
|
+
description: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
18
|
+
file: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
19
|
+
line: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
20
|
+
inputSchema: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
21
|
+
outputSchema: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
22
|
+
annotations: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
23
|
+
readOnlyHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
24
|
+
destructiveHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
25
|
+
idempotentHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
26
|
+
openWorldHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
27
|
+
}>>;
|
|
28
|
+
exposed: import("@sinclair/typebox").TBoolean;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const McpServerManifestSchema: import("@sinclair/typebox").TObject<{
|
|
31
|
+
server: import("@sinclair/typebox").TString;
|
|
32
|
+
path: import("@sinclair/typebox").TString;
|
|
33
|
+
version: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
34
|
+
description: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
35
|
+
tools: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
36
|
+
name: import("@sinclair/typebox").TString;
|
|
37
|
+
description: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
38
|
+
file: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
39
|
+
line: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
40
|
+
inputSchema: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
41
|
+
outputSchema: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
42
|
+
annotations: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
43
|
+
readOnlyHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
44
|
+
destructiveHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
45
|
+
idempotentHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
46
|
+
openWorldHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
47
|
+
}>>;
|
|
48
|
+
exposed: import("@sinclair/typebox").TBoolean;
|
|
49
|
+
}>>;
|
|
50
|
+
prompts: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("../contracts/typebox.ts").TSchema>>;
|
|
51
|
+
resources: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("../contracts/typebox.ts").TSchema>>;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const ProjectManifestSchema: import("@sinclair/typebox").TObject<{
|
|
54
|
+
schemaVersion: import("@sinclair/typebox").TString;
|
|
55
|
+
generatedAt: import("@sinclair/typebox").TString;
|
|
56
|
+
framework: import("@sinclair/typebox").TObject<{
|
|
57
|
+
name: import("@sinclair/typebox").TString;
|
|
58
|
+
version: import("@sinclair/typebox").TString;
|
|
59
|
+
}>;
|
|
60
|
+
runtime: import("@sinclair/typebox").TString;
|
|
61
|
+
project: import("@sinclair/typebox").TObject<{
|
|
62
|
+
rootDir: import("@sinclair/typebox").TString;
|
|
63
|
+
entry: import("@sinclair/typebox").TString;
|
|
64
|
+
configFile: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
65
|
+
}>;
|
|
66
|
+
routes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
67
|
+
method: import("@sinclair/typebox").TString;
|
|
68
|
+
path: import("@sinclair/typebox").TString;
|
|
69
|
+
version: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
70
|
+
controller: import("@sinclair/typebox").TString;
|
|
71
|
+
handler: import("@sinclair/typebox").TString;
|
|
72
|
+
file: import("@sinclair/typebox").TString;
|
|
73
|
+
line: import("@sinclair/typebox").TNumber;
|
|
74
|
+
input: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
75
|
+
output: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
76
|
+
inputSchema: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
77
|
+
outputSchema: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
78
|
+
}>>;
|
|
79
|
+
injection: import("@sinclair/typebox").TNever;
|
|
80
|
+
artifacts: import("@sinclair/typebox").TArray<import("../contracts/typebox.ts").TSchema>;
|
|
81
|
+
config: import("@sinclair/typebox").TNever;
|
|
82
|
+
env: import("@sinclair/typebox").TArray<import("../contracts/typebox.ts").TSchema>;
|
|
83
|
+
mcp: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
84
|
+
server: import("@sinclair/typebox").TString;
|
|
85
|
+
path: import("@sinclair/typebox").TString;
|
|
86
|
+
version: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
87
|
+
description: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
88
|
+
tools: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
89
|
+
name: import("@sinclair/typebox").TString;
|
|
90
|
+
description: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
91
|
+
file: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
92
|
+
line: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
93
|
+
inputSchema: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
94
|
+
outputSchema: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
95
|
+
annotations: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
96
|
+
readOnlyHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
97
|
+
destructiveHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
98
|
+
idempotentHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
99
|
+
openWorldHint: import("@sinclair/typebox").TOptional<import("../contracts/typebox.ts").TSchema>;
|
|
100
|
+
}>>;
|
|
101
|
+
exposed: import("@sinclair/typebox").TBoolean;
|
|
102
|
+
}>>;
|
|
103
|
+
prompts: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("../contracts/typebox.ts").TSchema>>;
|
|
104
|
+
resources: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("../contracts/typebox.ts").TSchema>>;
|
|
105
|
+
}>>;
|
|
106
|
+
}>;
|
|
107
|
+
export interface McpToolAnnotationsManifest {
|
|
108
|
+
title?: string;
|
|
109
|
+
readOnlyHint?: boolean;
|
|
110
|
+
destructiveHint?: boolean;
|
|
111
|
+
idempotentHint?: boolean;
|
|
112
|
+
openWorldHint?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface McpToolManifest {
|
|
115
|
+
name: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
file?: string;
|
|
118
|
+
line?: number;
|
|
119
|
+
inputSchema?: Record<string, any>;
|
|
120
|
+
outputSchema?: Record<string, any>;
|
|
121
|
+
annotations?: McpToolAnnotationsManifest;
|
|
122
|
+
exposed: boolean;
|
|
123
|
+
}
|
|
124
|
+
export interface McpServerManifest {
|
|
125
|
+
server: string;
|
|
126
|
+
path: string;
|
|
127
|
+
version?: string;
|
|
128
|
+
description?: string;
|
|
129
|
+
tools: McpToolManifest[];
|
|
130
|
+
prompts?: Array<Record<string, any>>;
|
|
131
|
+
resources?: Array<Record<string, any>>;
|
|
132
|
+
}
|
|
133
|
+
export interface ProjectRouteManifest {
|
|
134
|
+
method: string;
|
|
135
|
+
path: string;
|
|
136
|
+
version?: string;
|
|
137
|
+
controller: string;
|
|
138
|
+
handler: string;
|
|
139
|
+
file: string;
|
|
140
|
+
line: number;
|
|
141
|
+
input?: string;
|
|
142
|
+
output?: string;
|
|
143
|
+
inputSchema?: Record<string, any>;
|
|
144
|
+
outputSchema?: Record<string, any>;
|
|
145
|
+
}
|
|
146
|
+
export interface ProjectManifest {
|
|
147
|
+
schemaVersion: string;
|
|
148
|
+
generatedAt: string;
|
|
149
|
+
framework: {
|
|
150
|
+
name: string;
|
|
151
|
+
version: string;
|
|
152
|
+
};
|
|
153
|
+
runtime: string;
|
|
154
|
+
project: {
|
|
155
|
+
rootDir: string;
|
|
156
|
+
entry: string;
|
|
157
|
+
configFile?: string;
|
|
158
|
+
};
|
|
159
|
+
routes: ProjectRouteManifest[];
|
|
160
|
+
injection: Record<string, string[]>;
|
|
161
|
+
artifacts: string[];
|
|
162
|
+
config: Record<string, string>;
|
|
163
|
+
env: string[];
|
|
164
|
+
mcp: McpServerManifest[];
|
|
165
|
+
}
|
|
166
|
+
export interface ManifestValidationResult {
|
|
167
|
+
valid: boolean;
|
|
168
|
+
errors: Array<{
|
|
169
|
+
path: string;
|
|
170
|
+
message: string;
|
|
171
|
+
}>;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Validate a manifest against the published, versioned schema.
|
|
175
|
+
*/
|
|
176
|
+
export declare function validateManifest(manifest: unknown): ManifestValidationResult;
|
|
177
|
+
export declare function manifestJsonSchema(): Record<string, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HttpMethod } from "../framework/index.ts";
|
|
2
|
+
import { HttpsConfigInput, HttpsConfigInterface } from "../framework/utilities/https.util.ts";
|
|
3
|
+
export interface ApplicationConfigInterface {
|
|
4
|
+
workdir?: string;
|
|
5
|
+
hostname?: string;
|
|
6
|
+
port?: number;
|
|
7
|
+
protocole?: 'http' | 'https';
|
|
8
|
+
pathname?: string;
|
|
9
|
+
prefix?: string;
|
|
10
|
+
develop?: boolean;
|
|
11
|
+
verbose?: boolean;
|
|
12
|
+
https?: HttpsConfigInput;
|
|
13
|
+
}
|
|
14
|
+
export interface ApplicationInterface {
|
|
15
|
+
readonly config: ApplicationConfigInterface;
|
|
16
|
+
get hostname(): string;
|
|
17
|
+
get https(): HttpsConfigInterface | undefined;
|
|
18
|
+
setOption<K extends keyof ApplicationConfigInterface>(key: K, value: ApplicationConfigInterface[K]): this;
|
|
19
|
+
setOptions(options: ApplicationConfigInterface): this;
|
|
20
|
+
register(plugin: any): this;
|
|
21
|
+
use(mw: any): this;
|
|
22
|
+
route(method: HttpMethod, path: string, handler: any, version?: string): this;
|
|
23
|
+
get(path: string, handler: any, version?: string): this;
|
|
24
|
+
post(path: string, handler: any, version?: string): this;
|
|
25
|
+
patch(path: string, handler: any, version?: string): this;
|
|
26
|
+
put(path: string, handler: any, version?: string): this;
|
|
27
|
+
delete(path: string, handler: any, version?: string): this;
|
|
28
|
+
options(path: string, handler: any, version?: string): this;
|
|
29
|
+
head(path: string, handler: any, version?: string): this;
|
|
30
|
+
trace(path: string, handler: any, version?: string): this;
|
|
31
|
+
handle(req: any, reply: any): Promise<any>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { WatchEventType } from "node:fs";
|
|
2
|
+
import type { HmrChannel } from "../framework/artifacts.ts";
|
|
3
|
+
export interface StartCommandOptionsInterface {
|
|
4
|
+
develop?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface BuildCommandOptionsInterface {
|
|
7
|
+
develop?: boolean;
|
|
8
|
+
bootstrap?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface BuilderConfigInterface {
|
|
11
|
+
serve?: boolean;
|
|
12
|
+
hmr?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Compile/typecheck when booting without serving. CLI introspection sets
|
|
15
|
+
* this to `false` so `inspect` and `doctor` never run a build.
|
|
16
|
+
*/
|
|
17
|
+
compile?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export type BuilderBootCallableType = (builder: BuilderInterface) => Promise<void>;
|
|
20
|
+
export interface BuilderInterface {
|
|
21
|
+
readonly workdir: string;
|
|
22
|
+
readonly options: BuilderConfigInterface;
|
|
23
|
+
get source(): string | null;
|
|
24
|
+
get out(): string | null;
|
|
25
|
+
get bootstrapper(): string | null;
|
|
26
|
+
get bootstrapperFile(): string | null;
|
|
27
|
+
prepare(): Promise<this>;
|
|
28
|
+
boot(): Promise<any>;
|
|
29
|
+
}
|
|
30
|
+
export interface BuilderHMRDeclarationInterface {
|
|
31
|
+
filename: string;
|
|
32
|
+
timestamp?: number;
|
|
33
|
+
version?: number;
|
|
34
|
+
type?: WatchEventType;
|
|
35
|
+
channel?: HmrChannel;
|
|
36
|
+
artifactType?: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ArtifactsConfigInterface } from "./artifact.ts";
|
|
2
|
+
import type { HttpsConfigInput } from "../framework/utilities/https.util.ts";
|
|
3
|
+
export type ObservabilityMode = "off" | "metrics" | "traces" | "all";
|
|
4
|
+
export interface ObservabilityConfigInterface {
|
|
5
|
+
/** Defaults to `off`: no metrics, no traces, no exporter. */
|
|
6
|
+
mode?: ObservabilityMode;
|
|
7
|
+
/** Prometheus exposition path. @default '/metrics' */
|
|
8
|
+
metricsPath?: string;
|
|
9
|
+
/** OTLP HTTP endpoint used when traces are enabled. */
|
|
10
|
+
otelEndpoint?: string;
|
|
11
|
+
/** Header carrying the correlation id. @default 'x-request-id' */
|
|
12
|
+
requestIdHeader?: string;
|
|
13
|
+
/** Service name attached to traces. */
|
|
14
|
+
serviceName?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ValidationConfigInterface {
|
|
17
|
+
/**
|
|
18
|
+
* Output validation. `auto` enables it in development and disables it in
|
|
19
|
+
* production. A boolean forces the value.
|
|
20
|
+
* @default 'auto'
|
|
21
|
+
*/
|
|
22
|
+
responses?: boolean | "auto";
|
|
23
|
+
}
|
|
24
|
+
export interface ShutdownConfigInterface {
|
|
25
|
+
/** Maximum time spent draining in-flight requests. @default 10000 */
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface DevPageConfigInterface {
|
|
29
|
+
/** Mount the development page. Defaults to the HMR/dev mode. */
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
/** Page route. @default '/__dev' */
|
|
32
|
+
path?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface McpConfigInterface {
|
|
35
|
+
/** Expose destructive tools. Defaults to false. */
|
|
36
|
+
exposeDestructive?: boolean;
|
|
37
|
+
/** Per-tool calls per minute. 0 disables the limiter. */
|
|
38
|
+
rateLimitPerMinute?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface ConfigurableInterface {
|
|
41
|
+
rootDir: string;
|
|
42
|
+
version: string;
|
|
43
|
+
artifacts?: ArtifactsConfigInterface;
|
|
44
|
+
port?: number;
|
|
45
|
+
hostname?: string;
|
|
46
|
+
protocole?: "http" | "https";
|
|
47
|
+
pathname?: string;
|
|
48
|
+
prefix?: string;
|
|
49
|
+
develop?: boolean;
|
|
50
|
+
verbose?: boolean;
|
|
51
|
+
https?: HttpsConfigInput;
|
|
52
|
+
observability?: ObservabilityConfigInterface;
|
|
53
|
+
validation?: ValidationConfigInterface;
|
|
54
|
+
shutdown?: ShutdownConfigInterface;
|
|
55
|
+
devPage?: DevPageConfigInterface;
|
|
56
|
+
mcp?: McpConfigInterface;
|
|
57
|
+
/** Documentation generation options. */
|
|
58
|
+
docs?: {
|
|
59
|
+
dir?: string;
|
|
60
|
+
lang?: "fr" | "en";
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HttpMethod, Parametrable } from "../framework/enums/index.ts";
|
|
2
|
+
import { ContextInterface } from "./core.ts";
|
|
3
|
+
import { MiddlewareCallable } from "./middleware.ts";
|
|
4
|
+
export interface ControllerMetaInterface {
|
|
5
|
+
prefix?: string;
|
|
6
|
+
routes: RouteMetaInterface[];
|
|
7
|
+
middlewares: Record<string, MiddlewareCallable[]>;
|
|
8
|
+
}
|
|
9
|
+
export type ControllerDecoratorCallable = (metadata: ControllerMetaInterface) => void;
|
|
10
|
+
export interface RouteMetaInterface {
|
|
11
|
+
method: HttpMethod;
|
|
12
|
+
path: string;
|
|
13
|
+
propertyKey: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ParamMetaInterface {
|
|
16
|
+
index: number;
|
|
17
|
+
type: Parametrable;
|
|
18
|
+
key?: string;
|
|
19
|
+
callable?: (ctx: ContextInterface) => any;
|
|
20
|
+
metatype?: any;
|
|
21
|
+
}
|
|
22
|
+
export interface RouteDecoratorParametersInterface {
|
|
23
|
+
controller: ControllerMetaInterface;
|
|
24
|
+
route: RouteMetaInterface;
|
|
25
|
+
index: number;
|
|
26
|
+
}
|
|
27
|
+
export type RouteDecoratorCallable = (parameters: RouteDecoratorParametersInterface) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ConstructorType<T = any> = new (...args: any[]) => T;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RuntimeRequestInterface, RuntimeReplyInterface } from './runtime.ts';
|
|
2
|
+
export type HookNameType = 'onRequest' | 'preParsing' | 'preHandler' | 'onSend' | 'onResponse';
|
|
3
|
+
export type HookHandlerCallable = (ctx: ContextInterface) => Promise<void> | void;
|
|
4
|
+
export interface ContextInterface {
|
|
5
|
+
req: RuntimeRequestInterface;
|
|
6
|
+
reply: RuntimeReplyInterface;
|
|
7
|
+
state: Record<string, any>;
|
|
8
|
+
decorate<T = any>(key: string, value: T): void;
|
|
9
|
+
get<T = any>(key: string): T;
|
|
10
|
+
send(body: any): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CSRFModeEnum } from "../framework/enums/index.ts";
|
|
2
|
+
export interface CsrfClientDetectionConfig {
|
|
3
|
+
headerName?: string;
|
|
4
|
+
skipClients?: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface CsrfOptions {
|
|
7
|
+
mode?: CSRFModeEnum;
|
|
8
|
+
secret?: string;
|
|
9
|
+
cookieName?: string;
|
|
10
|
+
headerName?: string;
|
|
11
|
+
ttl?: number;
|
|
12
|
+
methods?: string[];
|
|
13
|
+
skip?: string[];
|
|
14
|
+
client?: CsrfClientDetectionConfig;
|
|
15
|
+
cookieOptions?: CsrfCookieOptions;
|
|
16
|
+
}
|
|
17
|
+
export interface CsrfCookieOptions {
|
|
18
|
+
httpOnly?: boolean;
|
|
19
|
+
secure?: boolean;
|
|
20
|
+
sameSite?: 'strict' | 'lax' | 'none';
|
|
21
|
+
path?: string;
|
|
22
|
+
domain?: string;
|
|
23
|
+
maxAge?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface CsrfTokenPayload {
|
|
26
|
+
token: string;
|
|
27
|
+
expiresAt: number;
|
|
28
|
+
}
|
|
29
|
+
export interface CsrfGuardOptions {
|
|
30
|
+
mode?: CSRFModeEnum;
|
|
31
|
+
methods?: string[];
|
|
32
|
+
skipPaths?: string[];
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type EncryptionResultType = string;
|
|
2
|
+
export interface DerivationOptionsInterface {
|
|
3
|
+
salt?: string;
|
|
4
|
+
iterations?: number;
|
|
5
|
+
keylen?: number;
|
|
6
|
+
digest?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ScryptOptionsInterface {
|
|
9
|
+
salt?: string;
|
|
10
|
+
keylen?: number;
|
|
11
|
+
cost?: number;
|
|
12
|
+
blockSize?: number;
|
|
13
|
+
parallelization?: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MiddlewareParametersInterface } from "./middleware.ts";
|
|
2
|
+
export interface GuardOptions {
|
|
3
|
+
name: string;
|
|
4
|
+
handler: GuardCallable;
|
|
5
|
+
}
|
|
6
|
+
export interface GuardDeclaration extends GuardOptions {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type GuardCallable = (parameters: MiddlewareParametersInterface) => Promise<boolean> | boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type * from "./config.ts";
|
|
2
|
+
export type * from "./builder.ts";
|
|
3
|
+
export type * from "./thread.ts";
|
|
4
|
+
export type * from "./guard.ts";
|
|
5
|
+
export type * from "./contruct.ts";
|
|
6
|
+
export type * from "./directory.ts";
|
|
7
|
+
export type * from "./encryption.ts";
|
|
8
|
+
export type * from "./generic.ts";
|
|
9
|
+
export type * from "./parseable.ts";
|
|
10
|
+
export type * from "./values.ts";
|
|
11
|
+
export type * from "./utilities.ts";
|
|
12
|
+
export type * from "./artifact.ts";
|
|
13
|
+
export type * from "./middleware.ts";
|
|
14
|
+
export type * from "./core.ts";
|
|
15
|
+
export type * from "./plugin.ts";
|
|
16
|
+
export type * from "./runtime.ts";
|
|
17
|
+
export type * from "./router.ts";
|
|
18
|
+
export type * from "./controller.ts";
|
|
19
|
+
export type * from "./socket.ts";
|
|
20
|
+
export type * from "./injection.ts";
|
|
21
|
+
export type * from "./responses.ts";
|
|
22
|
+
export type * from "./server.ts";
|
|
23
|
+
export type * from "./raiton.ts";
|
|
24
|
+
export type * from "./lifecycle.ts";
|
|
25
|
+
export type * from "./mcp.ts";
|
|
26
|
+
export type * from "./csrf.ts";
|
|
27
|
+
export type * from "./scheduler.ts";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ConstructorType } from "./contruct.ts";
|
|
2
|
+
import { LifetimeEnum } from "@protorians/core";
|
|
3
|
+
export interface ContainerDefinitionInterface<T = any> {
|
|
4
|
+
name: string;
|
|
5
|
+
construct: ConstructorType<T>;
|
|
6
|
+
lifetime: LifetimeEnum;
|
|
7
|
+
instance?: any;
|
|
8
|
+
scope?: Symbol;
|
|
9
|
+
parameters?: any[];
|
|
10
|
+
properties?: Map<string | symbol, any>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
export type McpArgumentType = 'string' | 'number' | 'boolean' | 'integer' | 'array' | 'object' | 'null';
|
|
2
|
+
export interface McpArgumentSchema {
|
|
3
|
+
type?: McpArgumentType;
|
|
4
|
+
description?: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
enum?: any[];
|
|
7
|
+
default?: any;
|
|
8
|
+
items?: McpArgumentSchema;
|
|
9
|
+
properties?: Record<string, McpArgumentSchema>;
|
|
10
|
+
}
|
|
11
|
+
export interface McpArgumentMetaInterface {
|
|
12
|
+
name: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
schema?: McpArgumentSchema;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
metatype?: any;
|
|
17
|
+
}
|
|
18
|
+
export type McpElementType = 'tool' | 'prompt' | 'resource' | 'resource-template' | 'read';
|
|
19
|
+
/**
|
|
20
|
+
* MCP tool safety annotations (spec 2024-11-05 / 2025-06-18).
|
|
21
|
+
*/
|
|
22
|
+
export interface McpToolAnnotations {
|
|
23
|
+
title?: string;
|
|
24
|
+
readOnlyHint?: boolean;
|
|
25
|
+
destructiveHint?: boolean;
|
|
26
|
+
idempotentHint?: boolean;
|
|
27
|
+
openWorldHint?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface McpElementMetaInterface {
|
|
30
|
+
type: McpElementType;
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
propertyKey: string;
|
|
34
|
+
arguments: McpArgumentMetaInterface[];
|
|
35
|
+
uri?: string;
|
|
36
|
+
mimeType?: string;
|
|
37
|
+
title?: string;
|
|
38
|
+
/** JSON schema or contract schema for tool input. */
|
|
39
|
+
inputSchema?: any;
|
|
40
|
+
/** JSON schema or contract schema for structured tool output. */
|
|
41
|
+
outputSchema?: any;
|
|
42
|
+
annotations?: McpToolAnnotations;
|
|
43
|
+
/** Scopes required to call the tool. Empty means public. */
|
|
44
|
+
scopes?: string[];
|
|
45
|
+
/** Explicit destructive marker. `annotations.destructiveHint` wins. */
|
|
46
|
+
destructive?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface McpServerMetaInterface {
|
|
49
|
+
name?: string;
|
|
50
|
+
version?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
path: string;
|
|
53
|
+
instructions?: string;
|
|
54
|
+
tools: McpElementMetaInterface[];
|
|
55
|
+
prompts: McpElementMetaInterface[];
|
|
56
|
+
resources: McpElementMetaInterface[];
|
|
57
|
+
resourceTemplates: McpElementMetaInterface[];
|
|
58
|
+
/** Expose destructive tools for this server. Defaults to false. */
|
|
59
|
+
exposeDestructive?: boolean;
|
|
60
|
+
/** Per-tool calls per minute. 0 disables the limiter. */
|
|
61
|
+
rateLimitPerMinute?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface McpServerOptionsInterface {
|
|
64
|
+
name?: string;
|
|
65
|
+
version?: string;
|
|
66
|
+
description?: string;
|
|
67
|
+
path?: string;
|
|
68
|
+
instructions?: string;
|
|
69
|
+
exposeDestructive?: boolean;
|
|
70
|
+
rateLimitPerMinute?: number;
|
|
71
|
+
}
|
|
72
|
+
export interface McpToolOptions {
|
|
73
|
+
name?: string;
|
|
74
|
+
description?: string;
|
|
75
|
+
inputSchema?: any;
|
|
76
|
+
outputSchema?: any;
|
|
77
|
+
annotations?: McpToolAnnotations;
|
|
78
|
+
destructive?: boolean;
|
|
79
|
+
scopes?: string[];
|
|
80
|
+
}
|
|
81
|
+
export type McpNodeMethod = 'initialize' | 'ping' | 'tools/list' | 'tools/call' | 'prompts/list' | 'prompts/get' | 'resources/list' | 'resources/templates/list' | 'resources/read' | 'logging/setLevel';
|
|
82
|
+
export type McpTransportType = 'streamable-http' | 'stdio';
|
|
83
|
+
export interface McpServerRegistrationInterface {
|
|
84
|
+
path: string;
|
|
85
|
+
name: string;
|
|
86
|
+
version: string;
|
|
87
|
+
description?: string;
|
|
88
|
+
construct: any;
|
|
89
|
+
metadata: McpServerMetaInterface;
|
|
90
|
+
}
|
|
91
|
+
export interface McpRouteDescriptorInterface {
|
|
92
|
+
path: string;
|
|
93
|
+
propertyKey: string;
|
|
94
|
+
serverName: string;
|
|
95
|
+
}
|
|
96
|
+
export interface JsonRpcRequest {
|
|
97
|
+
jsonrpc?: string;
|
|
98
|
+
method: string;
|
|
99
|
+
params?: any;
|
|
100
|
+
id?: number | string | null;
|
|
101
|
+
}
|
|
102
|
+
export interface JsonRpcError {
|
|
103
|
+
code: number;
|
|
104
|
+
message: string;
|
|
105
|
+
data?: any;
|
|
106
|
+
}
|
|
107
|
+
export interface JsonRpcResponse {
|
|
108
|
+
jsonrpc: string;
|
|
109
|
+
id: number | string | null;
|
|
110
|
+
result?: any;
|
|
111
|
+
error?: JsonRpcError;
|
|
112
|
+
}
|
|
113
|
+
export type McpArgumentDecorator = string | McpArgumentMetaInterface;
|
|
114
|
+
export interface McpToolResultContent {
|
|
115
|
+
type: 'text' | 'image' | 'resource';
|
|
116
|
+
text?: string;
|
|
117
|
+
data?: string;
|
|
118
|
+
mimeType?: string;
|
|
119
|
+
resource?: any;
|
|
120
|
+
}
|
|
121
|
+
export interface McpTextContent {
|
|
122
|
+
type: 'text';
|
|
123
|
+
text: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Invocation context propagated by HTTP and stdio transports. Authentication
|
|
127
|
+
* itself is out of scope for spec 002, but scopes and actor are enforced when
|
|
128
|
+
* present so the future auth spec can plug in without an API change.
|
|
129
|
+
*/
|
|
130
|
+
export interface McpInvocationContext {
|
|
131
|
+
actor?: string;
|
|
132
|
+
scopes?: string[];
|
|
133
|
+
headers?: Record<string, string>;
|
|
134
|
+
transport?: McpTransportType;
|
|
135
|
+
sessionId?: string;
|
|
136
|
+
}
|
|
137
|
+
export interface McpAuditEvent {
|
|
138
|
+
callId: string;
|
|
139
|
+
server: string;
|
|
140
|
+
tool: string;
|
|
141
|
+
actor?: string;
|
|
142
|
+
transport?: McpTransportType;
|
|
143
|
+
durationMs: number;
|
|
144
|
+
success: boolean;
|
|
145
|
+
error?: string;
|
|
146
|
+
arguments?: any;
|
|
147
|
+
result?: any;
|
|
148
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RequestContext } from "../core/context.ts";
|
|
2
|
+
export type MiddlewareNextCallable = () => Promise<void>;
|
|
3
|
+
export interface MiddlewareSetupInterface {
|
|
4
|
+
setup: any;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export interface MiddlewareParametersInterface {
|
|
8
|
+
context: RequestContext;
|
|
9
|
+
next: MiddlewareNextCallable;
|
|
10
|
+
}
|
|
11
|
+
export type MiddlewareCallable = (parameters: MiddlewareParametersInterface) => Promise<any> | void;
|
|
12
|
+
export type MiddlewareType = MiddlewareCallable | MiddlewareSetupInterface;
|