raiton 6.8.8-beta.24 → 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 +50 -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 +33575 -21723
- 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 +92 -19
- 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,13 @@
|
|
|
1
|
+
import { BuilderHMRDeclarationInterface } from "./builder.ts";
|
|
2
|
+
export interface RaitonSignalMapInterface {
|
|
3
|
+
ready?: undefined;
|
|
4
|
+
errors: any;
|
|
5
|
+
'hmr:artifact': BuilderHMRDeclarationInterface;
|
|
6
|
+
'hmr:di': BuilderHMRDeclarationInterface;
|
|
7
|
+
'hmr:controller': BuilderHMRDeclarationInterface;
|
|
8
|
+
'hmr:socket': BuilderHMRDeclarationInterface;
|
|
9
|
+
'hmr:middleware': BuilderHMRDeclarationInterface;
|
|
10
|
+
'hmr:hook': BuilderHMRDeclarationInterface;
|
|
11
|
+
'hmr:mcp': BuilderHMRDeclarationInterface;
|
|
12
|
+
'hmr:scheduler': BuilderHMRDeclarationInterface;
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HttpStatus } from "../framework/enums/http-status.enum.ts";
|
|
2
|
+
import { ParseableEntriesType, ParseableType } from "./parseable.ts";
|
|
3
|
+
export interface HttpResponseBaseInterface {
|
|
4
|
+
message: string;
|
|
5
|
+
statusCode?: HttpStatus;
|
|
6
|
+
}
|
|
7
|
+
export interface ErrorResponseInterface {
|
|
8
|
+
id: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
code?: string;
|
|
11
|
+
statusCode?: HttpStatus;
|
|
12
|
+
error?: Error;
|
|
13
|
+
}
|
|
14
|
+
export interface HttpResponseInterface<T extends ParseableType> extends ParseableEntriesType {
|
|
15
|
+
statusCode: number;
|
|
16
|
+
message?: string;
|
|
17
|
+
data?: T;
|
|
18
|
+
error?: any;
|
|
19
|
+
errorStack?: Error | ErrorResponseInterface[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RequestContext } from "../core/context.ts";
|
|
2
|
+
import { HttpMethod } from "../framework/index.ts";
|
|
3
|
+
export type RouteHandlerCallable = (ctx: RequestContext) => Promise<any> | any;
|
|
4
|
+
export interface RouteDefinitionInterface {
|
|
5
|
+
method: HttpMethod;
|
|
6
|
+
path: string;
|
|
7
|
+
version?: string;
|
|
8
|
+
handler: RouteHandlerCallable;
|
|
9
|
+
}
|
|
10
|
+
export interface RouteInteractionsSubscriber {
|
|
11
|
+
target: Function;
|
|
12
|
+
propertyKey: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RuntimeType } from "../framework/enums/runtime.enum.ts";
|
|
2
|
+
import { HttpsCertificateConfig, HttpsEnvironment } from "../framework/utilities/https.util.ts";
|
|
3
|
+
export interface RuntimeServerInterface {
|
|
4
|
+
listen(port: number, hostname?: string): Promise<void>;
|
|
5
|
+
close(): Promise<void>;
|
|
6
|
+
handle?(request: Request): Promise<Response>;
|
|
7
|
+
}
|
|
8
|
+
export interface RuntimeServerHttpsInterface {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
environment?: HttpsEnvironment;
|
|
11
|
+
certificate: HttpsCertificateConfig;
|
|
12
|
+
}
|
|
13
|
+
export interface RuntimeServerOptionsInterface {
|
|
14
|
+
prefix?: string;
|
|
15
|
+
https?: RuntimeServerHttpsInterface;
|
|
16
|
+
}
|
|
17
|
+
export interface RuntimeRequestInterface {
|
|
18
|
+
method: string;
|
|
19
|
+
url: string;
|
|
20
|
+
headers: Headers;
|
|
21
|
+
body?: ReadableStream<Uint8Array> | Uint8Array | Record<string, any> | null;
|
|
22
|
+
query?: Record<string, any>;
|
|
23
|
+
params?: Record<string, any>;
|
|
24
|
+
file?: any;
|
|
25
|
+
files?: any;
|
|
26
|
+
remoteAddress?: string;
|
|
27
|
+
ip?: string;
|
|
28
|
+
}
|
|
29
|
+
export type RuntimeHandlerCallable = (req: RuntimeRequestInterface, reply: RuntimeReplyInterface) => Promise<void>;
|
|
30
|
+
export interface RuntimeReplyInterface {
|
|
31
|
+
status(code: number): void;
|
|
32
|
+
header(name: string, value: string): void;
|
|
33
|
+
send(body: any): void;
|
|
34
|
+
text(text: string | Buffer): void;
|
|
35
|
+
json(data: any): void;
|
|
36
|
+
type(contentType: string): void;
|
|
37
|
+
}
|
|
38
|
+
export interface RuntimeAdapterInterface {
|
|
39
|
+
createServer(handler: RuntimeHandlerCallable, options?: RuntimeServerOptionsInterface): RuntimeServerInterface;
|
|
40
|
+
}
|
|
41
|
+
export interface RuntimeInterface {
|
|
42
|
+
readonly type: RuntimeType;
|
|
43
|
+
get isNode(): boolean;
|
|
44
|
+
get isDeno(): boolean;
|
|
45
|
+
get isBun(): boolean;
|
|
46
|
+
adapter(): RuntimeAdapterInterface;
|
|
47
|
+
createServer(handler: RuntimeHandlerCallable): RuntimeServerInterface;
|
|
48
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { ConstructorType } from "./contruct.ts";
|
|
2
|
+
export type TaskTriggerType = 'cron' | 'interval' | 'timeout' | 'task';
|
|
3
|
+
export type TaskStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled' | 'timed-out';
|
|
4
|
+
export type TaskPriority = 'lowest' | 'low' | 'normal' | 'high' | 'highest';
|
|
5
|
+
export type ScheduleInterval = number | string;
|
|
6
|
+
export type TaskRetryDelay = number | ((attempt: number) => number);
|
|
7
|
+
export interface TaskOptionsInterface {
|
|
8
|
+
name?: string;
|
|
9
|
+
queue?: string;
|
|
10
|
+
timezone?: string;
|
|
11
|
+
singleton?: boolean;
|
|
12
|
+
concurrency?: number;
|
|
13
|
+
retries?: number;
|
|
14
|
+
retryDelay?: TaskRetryDelay;
|
|
15
|
+
timeout?: number;
|
|
16
|
+
catchUp?: boolean;
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
consume?: boolean;
|
|
19
|
+
immediate?: boolean;
|
|
20
|
+
priority?: TaskPriority;
|
|
21
|
+
data?: any;
|
|
22
|
+
}
|
|
23
|
+
export interface CronOptionsInterface extends TaskOptionsInterface {
|
|
24
|
+
}
|
|
25
|
+
export interface IntervalOptionsInterface extends TaskOptionsInterface {
|
|
26
|
+
}
|
|
27
|
+
export interface TimeoutOptionsInterface extends TaskOptionsInterface {
|
|
28
|
+
}
|
|
29
|
+
export interface TaskDeclarationInterface extends TaskOptionsInterface {
|
|
30
|
+
}
|
|
31
|
+
export interface JobMetaInterface {
|
|
32
|
+
propertyKey: string;
|
|
33
|
+
name: string;
|
|
34
|
+
type: TaskTriggerType;
|
|
35
|
+
cron?: string;
|
|
36
|
+
interval?: number;
|
|
37
|
+
delay?: number;
|
|
38
|
+
queue?: string;
|
|
39
|
+
options: TaskOptionsInterface;
|
|
40
|
+
}
|
|
41
|
+
export interface SchedulerMetaInterface {
|
|
42
|
+
name: string;
|
|
43
|
+
queue: string;
|
|
44
|
+
timezone?: string;
|
|
45
|
+
jobs: JobMetaInterface[];
|
|
46
|
+
}
|
|
47
|
+
export interface SchedulerOptionsInterface {
|
|
48
|
+
name?: string;
|
|
49
|
+
queue?: string;
|
|
50
|
+
timezone?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface SchedulerRegistrationInterface {
|
|
53
|
+
name: string;
|
|
54
|
+
queue: string;
|
|
55
|
+
construct: ConstructorType;
|
|
56
|
+
metadata: SchedulerMetaInterface;
|
|
57
|
+
}
|
|
58
|
+
export interface TaskContextInterface<T = any> {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
queue?: string;
|
|
62
|
+
payload?: T;
|
|
63
|
+
data?: any;
|
|
64
|
+
trigger: TaskTriggerType;
|
|
65
|
+
attempt: number;
|
|
66
|
+
scheduledAt: Date;
|
|
67
|
+
startedAt: Date;
|
|
68
|
+
scheduler: SchedulerControlInterface;
|
|
69
|
+
}
|
|
70
|
+
export interface TaskInvocationInterface {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
queue?: string;
|
|
74
|
+
payload?: any;
|
|
75
|
+
data?: any;
|
|
76
|
+
trigger: TaskTriggerType;
|
|
77
|
+
attempt: number;
|
|
78
|
+
priority?: TaskPriority;
|
|
79
|
+
delay?: number;
|
|
80
|
+
scheduledAt: Date;
|
|
81
|
+
scheduleAt?: number;
|
|
82
|
+
}
|
|
83
|
+
export interface QueueMessageInterface<T = any> {
|
|
84
|
+
id: string;
|
|
85
|
+
queue: string;
|
|
86
|
+
payload: T;
|
|
87
|
+
attempts: number;
|
|
88
|
+
enqueuedAt: number;
|
|
89
|
+
availableAt: number;
|
|
90
|
+
receipt?: any;
|
|
91
|
+
}
|
|
92
|
+
export interface QueueDequeueOptionsInterface {
|
|
93
|
+
blockMs?: number;
|
|
94
|
+
count?: number;
|
|
95
|
+
}
|
|
96
|
+
export interface QueueBackendInterface {
|
|
97
|
+
readonly name: string;
|
|
98
|
+
connect(): Promise<void>;
|
|
99
|
+
disconnect(): Promise<void>;
|
|
100
|
+
enqueue(queue: string, message: QueueMessageInterface): Promise<string>;
|
|
101
|
+
dequeue(queue: string, options?: QueueDequeueOptionsInterface): Promise<QueueMessageInterface[]>;
|
|
102
|
+
acknowledge(queue: string, receipt: any): Promise<void>;
|
|
103
|
+
reject(queue: string, receipt: any, requeue?: boolean): Promise<void>;
|
|
104
|
+
length(queue: string): Promise<number>;
|
|
105
|
+
purge(queue: string): Promise<void>;
|
|
106
|
+
}
|
|
107
|
+
export interface SchedulerConfigInterface {
|
|
108
|
+
enabled: boolean;
|
|
109
|
+
timezone: string;
|
|
110
|
+
maxConcurrentJobs: number;
|
|
111
|
+
defaultQueue: string;
|
|
112
|
+
backend?: QueueBackendInterface;
|
|
113
|
+
backends?: Record<string, QueueBackendInterface>;
|
|
114
|
+
}
|
|
115
|
+
export interface ScheduledJobInfoInterface {
|
|
116
|
+
name: string;
|
|
117
|
+
type: TaskTriggerType;
|
|
118
|
+
queue: string;
|
|
119
|
+
nextRun?: Date;
|
|
120
|
+
lastRun?: Date;
|
|
121
|
+
lastError?: any;
|
|
122
|
+
running: number;
|
|
123
|
+
runCount: number;
|
|
124
|
+
failCount: number;
|
|
125
|
+
paused: boolean;
|
|
126
|
+
enabled: boolean;
|
|
127
|
+
}
|
|
128
|
+
export interface SchedulerControlInterface {
|
|
129
|
+
enqueue(name: string, payload?: any, options?: Partial<TaskInvocationInterface>): Promise<TaskInvocationInterface>;
|
|
130
|
+
dispatch(name: string, payload?: any, options?: Partial<TaskInvocationInterface>): Promise<any>;
|
|
131
|
+
trigger(name: string, payload?: any, options?: Partial<TaskInvocationInterface>): Promise<any>;
|
|
132
|
+
pause(name: string): void;
|
|
133
|
+
resume(name: string): void;
|
|
134
|
+
cancel(name: string): boolean;
|
|
135
|
+
getJobs(): ScheduledJobInfoInterface[];
|
|
136
|
+
getJob(name: string): ScheduledJobInfoInterface | undefined;
|
|
137
|
+
has(name: string): boolean;
|
|
138
|
+
start(): Promise<void>;
|
|
139
|
+
stop(): Promise<void>;
|
|
140
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { TObject, TProperties, TSchema } from "@sinclair/typebox";
|
|
2
|
+
export interface ISchemePropertyOptions {
|
|
3
|
+
optional?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The `ISchematic` interface provides a structured contract for managing and constructing schemas
|
|
7
|
+
* that define the shape of request bodies, parameters, query strings, and response structures.
|
|
8
|
+
* It allows dynamic assignment of schema properties and the retrieval of constructed schema configurations.
|
|
9
|
+
*
|
|
10
|
+
* @template TBody The schema type defining the request body.
|
|
11
|
+
* @template TParams The schema type defining the request parameters.
|
|
12
|
+
* @template TQuery The schema type defining the query string.
|
|
13
|
+
* @template TResponse The schema type defining the response structure, indexed by HTTP status codes.
|
|
14
|
+
*/
|
|
15
|
+
export interface IScheme<TBody extends TSchema | undefined = undefined, TParams extends TSchema | undefined = undefined, TQuery extends TSchema | undefined = undefined, TResponse extends Record<number, TSchema> | undefined = undefined> {
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves the value of the `$body` property.
|
|
18
|
+
*
|
|
19
|
+
* @return {TBody | undefined} The body content of type `TBody` or `undefined` if not set.
|
|
20
|
+
*/
|
|
21
|
+
get $body(): TBody | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Updates the body of the request with a specified key-value pair.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} key - The key to be added or updated in the body of the request.
|
|
26
|
+
* @param {TProperties} value - The value associated with the specified key.
|
|
27
|
+
* @return {this} The current instance to allow method chaining.
|
|
28
|
+
*/
|
|
29
|
+
body(key: string, value: TProperties): this;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves the current value of `$params`.
|
|
32
|
+
*
|
|
33
|
+
* This method returns the parameter(s) associated with the instance.
|
|
34
|
+
* It may return undefined if no parameters are set.
|
|
35
|
+
*
|
|
36
|
+
* @return {TParams | undefined} The current parameters or undefined if none are set.
|
|
37
|
+
*/
|
|
38
|
+
get $params(): TParams | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Assigns a key-value pair to the parameters of the current instance.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} key - The key for the parameter to be set.
|
|
43
|
+
* @param {TProperties} value - The value associated with the specified key.
|
|
44
|
+
* @return {this} The current instance with the updated parameter.
|
|
45
|
+
*/
|
|
46
|
+
params(key: string, value: TProperties): this;
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves the query string associated with the current object.
|
|
49
|
+
*
|
|
50
|
+
* @return {TQuery | undefined} The query string if defined, otherwise undefined.
|
|
51
|
+
*/
|
|
52
|
+
get $querystring(): TQuery | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Updates or sets a query string parameter with the specified key and value.
|
|
55
|
+
* If the query string already contains the key, its value will be updated.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} key - The key of the query string parameter to be updated or added.
|
|
58
|
+
* @param {TProperties} value - The value to be set for the specified query string key.
|
|
59
|
+
* @return {this} The current instance to allow for method chaining.
|
|
60
|
+
*/
|
|
61
|
+
querystring(key: string, value: TProperties): this;
|
|
62
|
+
/**
|
|
63
|
+
* Retrieves the response object associated with the instance.
|
|
64
|
+
*
|
|
65
|
+
* @return {TResponse | undefined} The response object if it exists, otherwise undefined.
|
|
66
|
+
*/
|
|
67
|
+
get $response(): TResponse | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Stores a key-value pair in the response object and returns the current instance for chaining.
|
|
70
|
+
*
|
|
71
|
+
* @param {number} key - The unique identifier for the value to be stored.
|
|
72
|
+
* @param {TProperties} value - The value to store associated with the provided key.
|
|
73
|
+
* @return {this} Returns the current instance to allow method chaining.
|
|
74
|
+
*/
|
|
75
|
+
response(key: number, value: TProperties): this;
|
|
76
|
+
/**
|
|
77
|
+
* Provides the schema options for handling the request and response structure.
|
|
78
|
+
*
|
|
79
|
+
* @return {ISchemeOptions<TBody, TParams, TQuery, TResponse>} The schema options defining the types for body, params, query, and response.
|
|
80
|
+
*/
|
|
81
|
+
schema(): ISchemeOptions<TBody, TParams, TQuery, TResponse>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Interface representing the schema configuration for various aspects of a request-response process.
|
|
85
|
+
*
|
|
86
|
+
* @template TBody Represents the schema for the request body. Defaults to undefined if not specified.
|
|
87
|
+
* @template TParams Represents the schema for request parameters. Defaults to undefined if not specified.
|
|
88
|
+
* @template TQuery Represents the schema for query string parameters. Defaults to undefined if not specified.
|
|
89
|
+
* @template TResponse Represents the schema for response objects, mapped by status codes. Defaults to undefined if not specified.
|
|
90
|
+
*
|
|
91
|
+
* @property {TBody} [body] Optional schema definition for the request body.
|
|
92
|
+
* @property {TParams} [params] Optional schema definition for the request parameters.
|
|
93
|
+
* @property {TQuery} [querystring] Optional schema definition for query string parameters.
|
|
94
|
+
* @property {TResponse} [response] Optional schema definition for response objects, associated with HTTP status codes.
|
|
95
|
+
*/
|
|
96
|
+
export interface ISchemeConfig<TBody extends TSchema | undefined = undefined, TParams extends TSchema | undefined = undefined, TQuery extends TSchema | undefined = undefined, TResponse extends Record<number, TSchema> | undefined = undefined> {
|
|
97
|
+
body?: TBody;
|
|
98
|
+
params?: TParams;
|
|
99
|
+
querystring?: TQuery;
|
|
100
|
+
response?: TResponse;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Interface representing schema options for defining request and response payloads
|
|
104
|
+
* in a structured and strongly-typed manner.
|
|
105
|
+
*
|
|
106
|
+
* @template TBody - The type of the schema for the request body, or undefined if not applicable.
|
|
107
|
+
* @template TParams - The type of the schema for the request parameters, or undefined if not applicable.
|
|
108
|
+
* @template TQuery - The type of the schema for the query string, or undefined if not applicable.
|
|
109
|
+
* @template TResponse - A record of HTTP status codes to their respective response schemas, or undefined if not applicable.
|
|
110
|
+
*
|
|
111
|
+
* @property body - Represents the schema definition for the request body.
|
|
112
|
+
* This is an optional property and only applies if TBody is specified.
|
|
113
|
+
* @property params - Represents the schema definition for the request parameters.
|
|
114
|
+
* This is an optional property and only applies if TParams is specified.
|
|
115
|
+
* @property querystring - Represents the schema definition for the query string.
|
|
116
|
+
* This is an optional property and only applies if TQuery is specified.
|
|
117
|
+
* @property response - Represents the schema definition for the response body, mapped by status code.
|
|
118
|
+
* This is an optional property and only applies if TResponse is specified.
|
|
119
|
+
*/
|
|
120
|
+
export interface ISchemeOptions<TBody extends TSchema | undefined = undefined, TParams extends TSchema | undefined = undefined, TQuery extends TSchema | undefined = undefined, TResponse extends Record<number, TSchema> | undefined = undefined> {
|
|
121
|
+
body?: TObject<NonNullable<TBody>> | undefined;
|
|
122
|
+
params?: TObject<NonNullable<TParams>> | undefined;
|
|
123
|
+
querystring?: TObject<NonNullable<TQuery>> | undefined;
|
|
124
|
+
response?: TObject<NonNullable<TResponse>> | undefined;
|
|
125
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ServerInterface {
|
|
2
|
+
readonly options: ServerOptionsInterface;
|
|
3
|
+
option<K extends keyof ServerOptionsInterface>(key: K): ServerOptionsInterface[K];
|
|
4
|
+
}
|
|
5
|
+
export interface ServerOptionsInterface {
|
|
6
|
+
os?: string;
|
|
7
|
+
arch?: string;
|
|
8
|
+
ip?: string;
|
|
9
|
+
port?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SocketMetaInterface {
|
|
2
|
+
namespace: string;
|
|
3
|
+
events: SocketEventMetaInterface[];
|
|
4
|
+
}
|
|
5
|
+
export interface SocketEventMetaInterface {
|
|
6
|
+
name: string;
|
|
7
|
+
propertyKey: string;
|
|
8
|
+
type: SocketEventType;
|
|
9
|
+
}
|
|
10
|
+
export type SocketEventType = 'message' | 'connect' | 'disconnect' | 'event';
|
|
11
|
+
export type SocketDecoratorCallable = (metadata: SocketMetaInterface) => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BuilderInterface } from "./builder.ts";
|
|
2
|
+
import { RuntimeAdapterInterface, RuntimeServerInterface } from "./runtime.ts";
|
|
3
|
+
import { ApplicationInterface } from "./application.ts";
|
|
4
|
+
import { RuntimeType } from "../framework/enums/runtime.enum.ts";
|
|
5
|
+
export interface ThreadSetupOptionsInterface {
|
|
6
|
+
application: ApplicationInterface;
|
|
7
|
+
runtime?: RuntimeType;
|
|
8
|
+
}
|
|
9
|
+
export type ThreadWaitCallable = () => (boolean | Promise<boolean>);
|
|
10
|
+
export interface ThreadInterface {
|
|
11
|
+
readonly appDir: string;
|
|
12
|
+
readonly builder: BuilderInterface;
|
|
13
|
+
application: ApplicationInterface | null;
|
|
14
|
+
runtime: RuntimeAdapterInterface | null;
|
|
15
|
+
runtimeServer: RuntimeServerInterface | null;
|
|
16
|
+
setup(options: ThreadSetupOptionsInterface): this;
|
|
17
|
+
run(): Promise<this>;
|
|
18
|
+
restart(): void;
|
|
19
|
+
stop(): void;
|
|
20
|
+
sleep(milliseconds: number): Promise<unknown>;
|
|
21
|
+
wait(condition: ThreadWaitCallable): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export interface ThreadOptionsInterface {
|
|
24
|
+
serve?: boolean;
|
|
25
|
+
}
|
package/docs/AGENTS.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# AGENTS.md — Raiton conventions
|
|
2
|
+
|
|
3
|
+
This repository uses **Raiton** (raiton 6.8.9-beta.25).
|
|
4
|
+
|
|
5
|
+
## Deterministic commands
|
|
6
|
+
|
|
7
|
+
Always prefer the CLI over guessing conventions:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
raiton routes --json # mounted routes
|
|
11
|
+
raiton inspect --json # versioned manifest (routes, DI, config, env, MCP)
|
|
12
|
+
raiton why GET /path # source file + decorator for a route
|
|
13
|
+
raiton doctor --json # actionable diagnostics
|
|
14
|
+
raiton mcp list --json # MCP servers and tool exposure
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Machine-readable commands write a single JSON document on stdout and logs on stderr.
|
|
18
|
+
Exit codes: 0 success, 1 usage, 2 prerequisite missing, 3 file conflict, 4 diagnostic failure.
|
|
19
|
+
|
|
20
|
+
## Project layout
|
|
21
|
+
|
|
22
|
+
- `source/main.ts` — default export receives the thread and calls `thread.setup({application}).run()`.
|
|
23
|
+
- `source/**/*.controller.ts` — controllers using `@Controllable` and `@Get/@Post/...`.
|
|
24
|
+
- `source/**/*.service.ts`, `.repository.ts`, `.dto.ts` — dependency-injected artifacts.
|
|
25
|
+
- `source/**/*.mcp.ts` — MCP servers using `@McpServer` / `@McpTool`.
|
|
26
|
+
- `raiton.config.ts` — typed project configuration, validated before listening.
|
|
27
|
+
|
|
28
|
+
## Contracts
|
|
29
|
+
|
|
30
|
+
Define each route contract once with TypeBox:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import {t} from "raiton/contracts"
|
|
34
|
+
|
|
35
|
+
export const CreateUser = t.object({email: t.string().email()})
|
|
36
|
+
export type CreateUser = t.infer<typeof CreateUser>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Use `@Input(CreateUser)` and `@Output(User)`. Invalid input is rejected before the handler with
|
|
40
|
+
`{error: true, code: "VALIDATION_ERROR", details: [{path, code, message}]}`.
|
|
41
|
+
|
|
42
|
+
## Known traps
|
|
43
|
+
|
|
44
|
+
- Destructive MCP tools are hidden unless `mcp.exposeDestructive` or the server option is explicit.
|
|
45
|
+
- Output validation is enabled in development only by default; do not rely on it in production.
|
|
46
|
+
- Do not edit generated files under `docs/generated`; run `raiton docs agents`.
|
|
47
|
+
- Never overwrite generated files without `--force`; use `--dry-run` first.
|
|
48
|
+
|
|
49
|
+
## Routes in this project
|
|
50
|
+
|
|
51
|
+
No route is currently mounted.
|
|
52
|
+
|
|
53
|
+
## MCP
|
|
54
|
+
|
|
55
|
+
No MCP server registered.
|
package/docs/CLAUDE.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# AGENTS.md — Raiton conventions
|
|
2
|
+
|
|
3
|
+
This repository uses **Raiton** (raiton 6.8.9-beta.25).
|
|
4
|
+
|
|
5
|
+
## Deterministic commands
|
|
6
|
+
|
|
7
|
+
Always prefer the CLI over guessing conventions:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
raiton routes --json # mounted routes
|
|
11
|
+
raiton inspect --json # versioned manifest (routes, DI, config, env, MCP)
|
|
12
|
+
raiton why GET /path # source file + decorator for a route
|
|
13
|
+
raiton doctor --json # actionable diagnostics
|
|
14
|
+
raiton mcp list --json # MCP servers and tool exposure
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Machine-readable commands write a single JSON document on stdout and logs on stderr.
|
|
18
|
+
Exit codes: 0 success, 1 usage, 2 prerequisite missing, 3 file conflict, 4 diagnostic failure.
|
|
19
|
+
|
|
20
|
+
## Project layout
|
|
21
|
+
|
|
22
|
+
- `source/main.ts` — default export receives the thread and calls `thread.setup({application}).run()`.
|
|
23
|
+
- `source/**/*.controller.ts` — controllers using `@Controllable` and `@Get/@Post/...`.
|
|
24
|
+
- `source/**/*.service.ts`, `.repository.ts`, `.dto.ts` — dependency-injected artifacts.
|
|
25
|
+
- `source/**/*.mcp.ts` — MCP servers using `@McpServer` / `@McpTool`.
|
|
26
|
+
- `raiton.config.ts` — typed project configuration, validated before listening.
|
|
27
|
+
|
|
28
|
+
## Contracts
|
|
29
|
+
|
|
30
|
+
Define each route contract once with TypeBox:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import {t} from "raiton/contracts"
|
|
34
|
+
|
|
35
|
+
export const CreateUser = t.object({email: t.string().email()})
|
|
36
|
+
export type CreateUser = t.infer<typeof CreateUser>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Use `@Input(CreateUser)` and `@Output(User)`. Invalid input is rejected before the handler with
|
|
40
|
+
`{error: true, code: "VALIDATION_ERROR", details: [{path, code, message}]}`.
|
|
41
|
+
|
|
42
|
+
## Known traps
|
|
43
|
+
|
|
44
|
+
- Destructive MCP tools are hidden unless `mcp.exposeDestructive` or the server option is explicit.
|
|
45
|
+
- Output validation is enabled in development only by default; do not rely on it in production.
|
|
46
|
+
- Do not edit generated files under `docs/generated`; run `raiton docs agents`.
|
|
47
|
+
- Never overwrite generated files without `--force`; use `--dry-run` first.
|
|
48
|
+
|
|
49
|
+
## Routes in this project
|
|
50
|
+
|
|
51
|
+
No route is currently mounted.
|
|
52
|
+
|
|
53
|
+
## MCP
|
|
54
|
+
|
|
55
|
+
No MCP server registered.
|
package/docs/README.md
CHANGED
|
@@ -11,3 +11,8 @@ Le dossier `docs/` est séparé en deux parcours :
|
|
|
11
11
|
|---------|-------------|
|
|
12
12
|
| [contributors/](contributors/README.md) | Architecture interne, noyau, runtime, décorateurs, plugins, CLI, types |
|
|
13
13
|
| [user-guide/](user-guide/README.md) | Démarrage, architecture d’un projet, API, injection, workflow |
|
|
14
|
+
| [user-guide/en/](user-guide/en/README.md) | English reference for the same contract |
|
|
15
|
+
| [user-guide/recipes/](user-guide/recipes/README.md) | Executable recipes for each feature |
|
|
16
|
+
| [llms.txt](llms.txt) | Compact index for AI agents |
|
|
17
|
+
| [llms-full.txt](llms-full.txt) | Full concatenated reference for AI agents |
|
|
18
|
+
| [AGENTS.md](AGENTS.md) | Deterministic conventions and known traps |
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
| Fichier | Description |
|
|
11
11
|
|---------|-------------|
|
|
12
|
-
| [commands.md](commands.md) | Détail des commandes `develop`, `build`, `start`, `artifact
|
|
12
|
+
| [commands.md](commands.md) | Détail des commandes `new`, `generate`, `routes`, `inspect`, `why`, `doctor`, `openapi`, `client`, `contract`, `mcp`, `docs`, `develop`, `build`, `start`, `artifact` |
|
|
13
13
|
| [hmr.md](hmr.md) | Fonctionnement du Hot Module Replacement |
|
|
14
14
|
|
|
15
15
|
## Commandes disponibles
|
|
@@ -20,7 +20,11 @@
|
|
|
20
20
|
| `build` | `b` | Compilation TypeScript vers JavaScript |
|
|
21
21
|
| `start` | `run` | Démarrage en production |
|
|
22
22
|
| `artifact` | `art` | Gestion des artifacts |
|
|
23
|
-
| `
|
|
23
|
+
| `generate` | `g` | Génération d'artifacts |
|
|
24
|
+
| `inspect` | - | Inventaire machine-readable |
|
|
25
|
+
| `doctor` | - | Diagnostic actionnable |
|
|
26
|
+
| `mcp` | - | Outils MCP HTTP/stdio |
|
|
27
|
+
| `docs` | - | Documentation pour agents |
|
|
24
28
|
|
|
25
29
|
```bash
|
|
26
30
|
# Aide
|
|
@@ -45,7 +49,17 @@ commands/
|
|
|
45
49
|
├── develop.command.ts ← develop/dev
|
|
46
50
|
├── build.command.ts ← build/b
|
|
47
51
|
├── artifact.command.ts ← artifact/art
|
|
48
|
-
|
|
52
|
+
├── new.command.ts ← création de projet
|
|
53
|
+
├── generate.command.ts ← génération d'artifacts
|
|
54
|
+
├── routes.command.ts ← liste des routes
|
|
55
|
+
├── inspect.command.ts ← manifeste de projet
|
|
56
|
+
├── why.command.ts ← origine d'une route
|
|
57
|
+
├── doctor.command.ts ← diagnostic
|
|
58
|
+
├── openapi.command.ts ← export OpenAPI
|
|
59
|
+
├── client.command.ts ← client typé
|
|
60
|
+
├── contract.command.ts ← contrôle de contrat
|
|
61
|
+
├── mcp.command.ts ← outils MCP
|
|
62
|
+
└── docs.command.ts ← documentation agents
|
|
49
63
|
```
|
|
50
64
|
|
|
51
65
|
## Flux de démarrage
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
# Commandes CLI
|
|
2
2
|
|
|
3
3
|
**Fichiers :** `source/commands/`
|
|
4
|
-
**Commandes intégrées :**
|
|
4
|
+
**Commandes intégrées :** 15 commandes
|
|
5
|
+
|
|
6
|
+
Toutes les commandes de diagnostic, d'inventaire et de génération supportent
|
|
7
|
+
`--json`, un mode non interactif et des codes de sortie stables
|
|
8
|
+
(`0` succès, `1` usage, `2` prérequis manquant, `3` conflit de fichiers,
|
|
9
|
+
`4` échec de diagnostic). Les erreurs exposent
|
|
10
|
+
`{ code, message, hint, docsUrl, location? }`.
|
|
5
11
|
|
|
6
12
|
> **Navigation :** [← cli/](README.md) | [↑ cli/](README.md) | [hmr.md →](hmr.md)
|
|
7
13
|
|
|
@@ -105,26 +111,31 @@ bun run build/bin/index.mjs
|
|
|
105
111
|
|
|
106
112
|
## `artifact` / `art`
|
|
107
113
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
bun raiton artifact --dump # Affiche les artifacts
|
|
112
|
-
bun raiton artifact --create # Crée un artifact
|
|
113
|
-
bun raiton artifact --remove # Supprime un artifact
|
|
114
|
-
bun raiton artifact --clear # Vide tous les artifacts
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
**Note :** Cette commande est actuellement en développement (stub).
|
|
118
|
-
|
|
119
|
-
## `grafts`
|
|
120
|
-
|
|
121
|
-
Génération de typings.
|
|
114
|
+
Inventaire des artifacts détectés.
|
|
122
115
|
|
|
123
116
|
```bash
|
|
124
|
-
bun raiton
|
|
117
|
+
bun raiton artifact --dump
|
|
118
|
+
bun raiton artifact --dump --json
|
|
125
119
|
```
|
|
126
120
|
|
|
127
|
-
|
|
121
|
+
## Onboarding, contrats et inventaire
|
|
122
|
+
|
|
123
|
+
| Commande | Rôle |
|
|
124
|
+
|---|---|
|
|
125
|
+
| `new <name>` | Crée un projet (`api`, `minimal`, `mcp-agent`) sans prompt ; `--dry-run`, `--force`, `--offline`, `--no-install`. |
|
|
126
|
+
| `generate <type> <name>` | Génère `controller`, `service`, `repository`, `dto`, `mcp-tool`, `test` ou `resource`. |
|
|
127
|
+
| `routes [--json]` | Liste les routes montées. |
|
|
128
|
+
| `inspect [--json]` | Émet le manifeste versionné (routes, DI, config, env, MCP, sources). |
|
|
129
|
+
| `why <method> <path>` | Indique le fichier, la ligne, le décorateur et l'artifact d'une route. |
|
|
130
|
+
| `doctor [--json] [--fix]` | Diagnostic actionnable (runtime, config, décorateurs, versions, ports, env). |
|
|
131
|
+
| `openapi export --out` | Exporte le document OpenAPI depuis les routes et contrats. |
|
|
132
|
+
| `client --out` | Génère un client TypeScript typé sans `any`. |
|
|
133
|
+
| `contract check --baseline` | Détecte les ruptures de contrat (route + champ). |
|
|
134
|
+
| `contract snapshot --out` | Écrit une baseline de contrat. |
|
|
135
|
+
| `mcp list\|inspect\|test\|serve\|conformance` | Outils MCP, transport HTTP et stdio. |
|
|
136
|
+
| `docs agents [--check]` | Génère `llms.txt`, `llms-full.txt`, `AGENTS.md`, `CLAUDE.md`, schémas et références. |
|
|
137
|
+
|
|
138
|
+
> `grafts` a été retiré tant qu'aucune implémentation stable n'est disponible.
|
|
128
139
|
|
|
129
140
|
## Commandes personnalisées du projet
|
|
130
141
|
|