@warlock.js/core 5.31.0 → 5.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/esm/application/app.d.mts +3 -3
- package/esm/application/app.d.mts.map +1 -1
- package/esm/application/application-config-types.d.mts +9 -2
- package/esm/application/application-config-types.d.mts.map +1 -1
- package/esm/application/application.d.mts +5 -7
- package/esm/application/application.d.mts.map +1 -1
- package/esm/application/application.mjs +3 -1
- package/esm/application/application.mjs.map +1 -1
- package/esm/application/boot-signal.d.mts +22 -20
- package/esm/application/boot-signal.d.mts.map +1 -1
- package/esm/application/boot-signal.mjs +15 -9
- package/esm/application/boot-signal.mjs.map +1 -1
- package/esm/application/index.d.mts +2 -1
- package/esm/application/index.mjs +1 -1
- package/esm/application/public-url.d.mts +1 -2
- package/esm/application/public-url.d.mts.map +1 -1
- package/esm/application/roles.d.mts +10 -11
- package/esm/application/roles.d.mts.map +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts +1 -3
- package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
- package/esm/benchmark/benchmark.d.mts +1 -3
- package/esm/benchmark/benchmark.d.mts.map +1 -1
- package/esm/benchmark/channels/console.channel.d.mts +1 -3
- package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts +1 -3
- package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
- package/esm/benchmark/index.mjs +1 -1
- package/esm/benchmark/profiler.d.mts +1 -3
- package/esm/benchmark/profiler.d.mts.map +1 -1
- package/esm/benchmark/profiler.mjs +2 -1
- package/esm/benchmark/profiler.mjs.map +1 -1
- package/esm/benchmark/types.d.mts +22 -17
- package/esm/benchmark/types.d.mts.map +1 -1
- package/esm/bootstrap/setup.d.mts +1 -2
- package/esm/bootstrap/setup.d.mts.map +1 -1
- package/esm/bootstrap.d.mts +1 -2
- package/esm/bootstrap.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.d.mts +3 -5
- package/esm/cache/database-cache-driver.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.mjs +1 -1
- package/esm/cache/index.d.mts +2 -1
- package/esm/cache/index.mjs +1 -1
- package/esm/cli/cli-commands.manager.mjs +6 -3
- package/esm/cli/cli-commands.manager.mjs.map +1 -1
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs +3 -2
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -1
- package/esm/cli/commands/ai/ai-command.action.mjs +140 -0
- package/esm/cli/commands/ai/ai-command.action.mjs.map +1 -0
- package/esm/cli/commands/ai.command.mjs +50 -0
- package/esm/cli/commands/ai.command.mjs.map +1 -0
- package/esm/cli/commands/board/board-command.action.mjs +1 -1
- package/esm/cli/commands/check/check-command.action.mjs +4 -1
- package/esm/cli/commands/check/check-command.action.mjs.map +1 -1
- package/esm/cli/commands/check/child-typecheck.mjs +1 -1
- package/esm/cli/commands/check/child-typecheck.mjs.map +1 -1
- package/esm/cli/commands/check/format-problems.mjs +1 -1
- package/esm/cli/commands/check.command.mjs +6 -1
- package/esm/cli/commands/check.command.mjs.map +1 -1
- package/esm/cli/commands/dev-server.command.mjs +3 -2
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/check.types.d.mts +29 -16
- package/esm/cli/commands/doctor/check.types.d.mts.map +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +22 -27
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs +2 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
- package/esm/cli/commands/explain/explain-command.action.mjs +1 -1
- package/esm/cli/commands/generate/generators/controller.generator.mjs +5 -2
- package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs +5 -3
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs +3 -2
- package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +2 -2
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs +1 -2
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
- package/esm/cli/commands/inspect/inspect-command.action.mjs +3 -2
- package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -1
- package/esm/cli/commands/issue/collect-environment.mjs +187 -0
- package/esm/cli/commands/issue/collect-environment.mjs.map +1 -0
- package/esm/cli/commands/issue/issue-command.action.mjs +70 -0
- package/esm/cli/commands/issue/issue-command.action.mjs.map +1 -0
- package/esm/cli/commands/issue.command.mjs +31 -0
- package/esm/cli/commands/issue.command.mjs.map +1 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs +15 -14
- package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -1
- package/esm/cli/commands/openapi-generator.action.mjs +1 -1
- package/esm/cli/commands/pm2/pm2-command.action.mjs +91 -0
- package/esm/cli/commands/pm2/pm2-command.action.mjs.map +1 -0
- package/esm/cli/commands/pm2/pm2-config.mjs +115 -0
- package/esm/cli/commands/pm2/pm2-config.mjs.map +1 -0
- package/esm/cli/commands/pm2.command.mjs +53 -0
- package/esm/cli/commands/pm2.command.mjs.map +1 -0
- package/esm/cli/commands/postman-generator.action.mjs +1 -1
- package/esm/cli/commands/routes/format-routes-table.mjs +1 -1
- package/esm/cli/commands/routes/route-row.mjs +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs +2 -2
- package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
- package/esm/cli/commands/test.command.mjs +1 -1
- package/esm/cli/commands/trace/trace-command.action.mjs +1 -1
- package/esm/cli/commands-loader.mjs +1 -1
- package/esm/cli/framework-cli-commands.mjs +6 -0
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +2 -2
- package/esm/cli/parse-cli-args.mjs.map +1 -1
- package/esm/cli/start.d.mts +1 -1
- package/esm/cli/string-similarity.mjs +1 -1
- package/esm/commands/cli-command.d.mts +2 -4
- package/esm/commands/cli-command.d.mts.map +1 -1
- package/esm/commands/index.d.mts +2 -1
- package/esm/commands/index.mjs +1 -1
- package/esm/commands/types.d.mts +8 -8
- package/esm/commands/types.d.mts.map +1 -1
- package/esm/config/config-getter.d.mts +2 -3
- package/esm/config/config-getter.d.mts.map +1 -1
- package/esm/config/config-getter.mjs +5 -5
- package/esm/config/config-getter.mjs.map +1 -1
- package/esm/config/config-handlers.d.mts +1 -3
- package/esm/config/config-handlers.d.mts.map +1 -1
- package/esm/config/config-loader.d.mts +1 -2
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +3 -3
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-manager.mjs +1 -1
- package/esm/config/config-schema.d.mts +19 -16
- package/esm/config/config-schema.d.mts.map +1 -1
- package/esm/config/config-setter.d.mts +2 -4
- package/esm/config/config-setter.d.mts.map +1 -1
- package/esm/config/config-setter.mjs +2 -2
- package/esm/config/config-setter.mjs.map +1 -1
- package/esm/config/config-special-handlers.d.mts +2 -4
- package/esm/config/config-special-handlers.d.mts.map +1 -1
- package/esm/config/index.d.mts +2 -1
- package/esm/config/index.mjs +1 -1
- package/esm/config/types.d.mts +4 -5
- package/esm/config/types.d.mts.map +1 -1
- package/esm/connectors/access-connector.d.mts +1 -3
- package/esm/connectors/access-connector.d.mts.map +1 -1
- package/esm/connectors/access-connector.mjs +2 -2
- package/esm/connectors/access-connector.mjs.map +1 -1
- package/esm/connectors/ai-connector.d.mts +1 -3
- package/esm/connectors/ai-connector.d.mts.map +1 -1
- package/esm/connectors/ai-connector.mjs +2 -2
- package/esm/connectors/ai-connector.mjs.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -3
- package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.d.mts +1 -3
- package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs +2 -1
- package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
- package/esm/connectors/base-connector.d.mts +1 -3
- package/esm/connectors/base-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.d.mts +1 -3
- package/esm/connectors/cache-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.mjs +3 -3
- package/esm/connectors/cache-connector.mjs.map +1 -1
- package/esm/connectors/connectors-manager.d.mts +2 -4
- package/esm/connectors/connectors-manager.d.mts.map +1 -1
- package/esm/connectors/connectors-manager.mjs +3 -6
- package/esm/connectors/connectors-manager.mjs.map +1 -1
- package/esm/connectors/database-connector.d.mts +1 -3
- package/esm/connectors/database-connector.d.mts.map +1 -1
- package/esm/connectors/database-connector.mjs +2 -2
- package/esm/connectors/database-connector.mjs.map +1 -1
- package/esm/connectors/describe-server-address.mjs +4 -4
- package/esm/connectors/describe-server-address.mjs.map +1 -1
- package/esm/connectors/herald-connector.d.mts +1 -3
- package/esm/connectors/herald-connector.d.mts.map +1 -1
- package/esm/connectors/herald-connector.mjs +2 -2
- package/esm/connectors/herald-connector.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts +1 -3
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +8 -7
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/index.d.mts +2 -1
- package/esm/connectors/index.mjs +1 -1
- package/esm/connectors/logger-connector.d.mts +1 -3
- package/esm/connectors/logger-connector.d.mts.map +1 -1
- package/esm/connectors/logger-connector.mjs +2 -2
- package/esm/connectors/logger-connector.mjs.map +1 -1
- package/esm/connectors/mail-connector.d.mts +1 -3
- package/esm/connectors/mail-connector.d.mts.map +1 -1
- package/esm/connectors/mail-connector.mjs +2 -2
- package/esm/connectors/mail-connector.mjs.map +1 -1
- package/esm/connectors/notifications-connector.d.mts +1 -3
- package/esm/connectors/notifications-connector.d.mts.map +1 -1
- package/esm/connectors/notifications-connector.mjs +2 -2
- package/esm/connectors/notifications-connector.mjs.map +1 -1
- package/esm/connectors/register-configured-connectors.d.mts +2 -4
- package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
- package/esm/connectors/shutdown-timeout.mjs +7 -0
- package/esm/connectors/shutdown-timeout.mjs.map +1 -0
- package/esm/connectors/socket-connector.d.mts +1 -3
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs +20 -11
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/connectors/storage.connector.d.mts +1 -3
- package/esm/connectors/storage.connector.d.mts.map +1 -1
- package/esm/connectors/storage.connector.mjs +2 -2
- package/esm/connectors/storage.connector.mjs.map +1 -1
- package/esm/connectors/types.d.mts +17 -14
- package/esm/connectors/types.d.mts.map +1 -1
- package/esm/container/container-instance-registry.mjs.map +1 -1
- package/esm/container/development-app-modules.d.mts +7 -5
- package/esm/container/development-app-modules.d.mts.map +1 -1
- package/esm/container/development-model-modules.d.mts +6 -5
- package/esm/container/development-model-modules.d.mts.map +1 -1
- package/esm/container/index.d.mts +4 -4
- package/esm/container/index.d.mts.map +1 -1
- package/esm/database/index.d.mts +3 -1
- package/esm/database/index.mjs +1 -1
- package/esm/database/migrate-action.mjs +1 -1
- package/esm/database/models/database-log/database-log.d.mts +2 -3
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/models/database-log/index.d.mts +2 -1
- package/esm/database/models/database-log/index.mjs +1 -1
- package/esm/database/seed-command-action.mjs +1 -1
- package/esm/database/seeds/seeder.d.mts +2 -4
- package/esm/database/seeds/seeder.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.d.mts +2 -3
- package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
- package/esm/database/seeds/seeders.manager.mjs +2 -1
- package/esm/database/seeds/seeders.manager.mjs.map +1 -1
- package/esm/database/seeds/types.d.mts +7 -8
- package/esm/database/seeds/types.d.mts.map +1 -1
- package/esm/database/utils.d.mts +4 -5
- package/esm/database/utils.d.mts.map +1 -1
- package/esm/dev-server/app-module-registry.mjs +1 -1
- package/esm/dev-server/create-worker.mjs +5 -3
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dependency-graph.d.mts +1 -3
- package/esm/dev-server/dependency-graph.d.mts.map +1 -1
- package/esm/dev-server/dependency-graph.mjs +1 -1
- package/esm/dev-server/dependency-graph.mjs.map +1 -1
- package/esm/dev-server/extract-translation-keys.mjs +16 -17
- package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
- package/esm/dev-server/file-manager.d.mts +3 -7
- package/esm/dev-server/file-manager.d.mts.map +1 -1
- package/esm/dev-server/file-operations.d.mts +1 -3
- package/esm/dev-server/file-operations.d.mts.map +1 -1
- package/esm/dev-server/files-watcher.mjs +12 -11
- package/esm/dev-server/files-watcher.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +6 -8
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +36 -115
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/default-health-checkers.mjs +6 -15
- package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -1
- package/esm/dev-server/health-checker/eslint-support.mjs +27 -0
- package/esm/dev-server/health-checker/eslint-support.mjs.map +1 -0
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +7 -6
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
- package/esm/dev-server/health-checker/file-health-result.d.mts +2 -2
- package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs +1 -0
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/oxlint-runner.mjs +6 -5
- package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs +2 -11
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +40 -174
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
- package/esm/dev-server/loader/hook-thread.d.mts +4 -8
- package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.d.mts +10 -6
- package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.mjs +4 -3
- package/esm/dev-server/loader/load-hook.mjs.map +1 -1
- package/esm/dev-server/loader/own-resolver.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs +3 -2
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-hook.d.mts +2 -2
- package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/resolve-hook.mjs +2 -1
- package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +2 -1
- package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
- package/esm/dev-server/manifest-manager.d.mts +1 -3
- package/esm/dev-server/manifest-manager.d.mts.map +1 -1
- package/esm/dev-server/model-module-registry.mjs +3 -3
- package/esm/dev-server/model-module-registry.mjs.map +1 -1
- package/esm/dev-server/model-resource-typings.mjs +40 -47
- package/esm/dev-server/model-resource-typings.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +2 -2
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/package-json-manager.mjs +1 -1
- package/esm/dev-server/parse-imports.mjs +6 -38
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/read-config-ast.mjs +3 -33
- package/esm/dev-server/read-config-ast.mjs.map +1 -1
- package/esm/dev-server/ready-block.mjs +1 -1
- package/esm/dev-server/shortcuts.mjs +1 -1
- package/esm/dev-server/special-files-collector.d.mts +2 -4
- package/esm/dev-server/special-files-collector.d.mts.map +1 -1
- package/esm/dev-server/supervisor.mjs +1 -1
- package/esm/dev-server/tsconfig-manager.mjs +3 -3
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/type-generator.mjs +28 -35
- package/esm/dev-server/type-generator.mjs.map +1 -1
- package/esm/dev-server/types.d.mts +3 -4
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/dev-server/update-check-cache.mjs +2 -2
- package/esm/dev-server/update-check-cache.mjs.map +1 -1
- package/esm/encryption/encrypt.d.mts +2 -3
- package/esm/encryption/encrypt.d.mts.map +1 -1
- package/esm/encryption/hash.d.mts +1 -2
- package/esm/encryption/hash.d.mts.map +1 -1
- package/esm/encryption/index.mjs +1 -1
- package/esm/encryption/password.d.mts +2 -3
- package/esm/encryption/password.d.mts.map +1 -1
- package/esm/encryption/types.d.mts +2 -3
- package/esm/encryption/types.d.mts.map +1 -1
- package/esm/errors/error-codes.d.mts +29 -22
- package/esm/errors/error-codes.d.mts.map +1 -1
- package/esm/errors/warlock-error.d.mts +1 -3
- package/esm/errors/warlock-error.d.mts.map +1 -1
- package/esm/generations/add-command.action.mjs +3 -2
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/features/bull-board.feature.mjs +2 -1
- package/esm/generations/features/bull-board.feature.mjs.map +1 -1
- package/esm/generations/features/index.mjs +2 -0
- package/esm/generations/features/index.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +2 -1
- package/esm/generations/features/notifications.feature.mjs.map +1 -1
- package/esm/generations/features/process.feature.mjs +65 -0
- package/esm/generations/features/process.feature.mjs.map +1 -0
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs +16 -23
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
- package/esm/generations/features/sitemap.feature.mjs +2 -1
- package/esm/generations/features/sitemap.feature.mjs.map +1 -1
- package/esm/generations/generation-fs.mjs +1 -1
- package/esm/generations/generation-run.mjs +1 -1
- package/esm/generations/stubs.mjs +1 -1
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/boot-port-preflight.d.mts +4 -5
- package/esm/http/boot-port-preflight.d.mts.map +1 -1
- package/esm/http/boot-port-preflight.mjs +2 -2
- package/esm/http/boot-port-preflight.mjs.map +1 -1
- package/esm/http/bounded-stream-queue.d.mts +4 -4
- package/esm/http/bounded-stream-queue.d.mts.map +1 -1
- package/esm/http/bounded-stream-queue.mjs +1 -1
- package/esm/http/bounded-stream-queue.mjs.map +1 -1
- package/esm/http/build-cors-options.mjs +2 -2
- package/esm/http/build-cors-options.mjs.map +1 -1
- package/esm/http/build-rate-limit-options.d.mts +2 -3
- package/esm/http/build-rate-limit-options.d.mts.map +1 -1
- package/esm/http/build-rate-limit-options.mjs +1 -1
- package/esm/http/build-rate-limit-options.mjs.map +1 -1
- package/esm/http/conditional-request.d.mts +14 -13
- package/esm/http/conditional-request.d.mts.map +1 -1
- package/esm/http/config.d.mts +2 -4
- package/esm/http/config.d.mts.map +1 -1
- package/esm/http/config.mjs +2 -2
- package/esm/http/config.mjs.map +1 -1
- package/esm/http/context/request-context.d.mts +6 -7
- package/esm/http/context/request-context.d.mts.map +1 -1
- package/esm/http/context/request-memo.d.mts +1 -2
- package/esm/http/context/request-memo.d.mts.map +1 -1
- package/esm/http/createHttpApplication.d.mts +2 -3
- package/esm/http/createHttpApplication.d.mts.map +1 -1
- package/esm/http/createHttpApplication.mjs +2 -2
- package/esm/http/createHttpApplication.mjs.map +1 -1
- package/esm/http/csp.d.mts +10 -12
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +2 -2
- package/esm/http/csp.mjs.map +1 -1
- package/esm/http/csrf-default-guard.d.mts +2 -4
- package/esm/http/csrf-default-guard.d.mts.map +1 -1
- package/esm/http/csrf-default-guard.mjs +1 -1
- package/esm/http/csrf-default-guard.mjs.map +1 -1
- package/esm/http/csrf-origin-policy.d.mts +7 -9
- package/esm/http/csrf-origin-policy.d.mts.map +1 -1
- package/esm/http/csrf-origin-policy.mjs +2 -2
- package/esm/http/csrf-origin-policy.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +2 -3
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/error-codes.d.mts +1 -2
- package/esm/http/error-codes.d.mts.map +1 -1
- package/esm/http/error-mapper.d.mts +2 -4
- package/esm/http/error-mapper.d.mts.map +1 -1
- package/esm/http/error-mapper.mjs +2 -2
- package/esm/http/error-mapper.mjs.map +1 -1
- package/esm/http/errors/errors.d.mts +28 -29
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/escape-header-value.d.mts +1 -2
- package/esm/http/escape-header-value.d.mts.map +1 -1
- package/esm/http/events.d.mts +2 -4
- package/esm/http/events.d.mts.map +1 -1
- package/esm/http/health.d.mts +4 -4
- package/esm/http/health.d.mts.map +1 -1
- package/esm/http/index.d.mts +4 -1
- package/esm/http/index.mjs +1 -1
- package/esm/http/middleware/cache-response-middleware.d.mts +2 -4
- package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts +3 -3
- package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.mjs +6 -6
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/middleware/index.d.mts +3 -1
- package/esm/http/middleware/index.mjs +1 -1
- package/esm/http/middleware/inject-request-context.d.mts +2 -4
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +3 -3
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts +3 -3
- package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts +3 -3
- package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.mjs +4 -4
- package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts +2 -2
- package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
- package/esm/http/middleware/middleware-list.d.mts +1 -3
- package/esm/http/middleware/middleware-list.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.mjs +2 -2
- package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts +2 -3
- package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts +3 -5
- package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
- package/esm/http/middleware/utils/index.d.mts +2 -1
- package/esm/http/middleware/utils/parse-size.d.mts +1 -2
- package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
- package/esm/http/middleware/utils/parse-size.mjs +2 -2
- package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
- package/esm/http/plugins.d.mts +2 -4
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +10 -10
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/port-preflight.d.mts +3 -4
- package/esm/http/port-preflight.d.mts.map +1 -1
- package/esm/http/port-preflight.mjs +2 -0
- package/esm/http/port-preflight.mjs.map +1 -1
- package/esm/http/rate-limit-cache-store.mjs +4 -3
- package/esm/http/rate-limit-cache-store.mjs.map +1 -1
- package/esm/http/ready-report.d.mts +15 -10
- package/esm/http/ready-report.d.mts.map +1 -1
- package/esm/http/request-controller.d.mts +1 -3
- package/esm/http/request-controller.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.d.mts +20 -16
- package/esm/http/request-log-snapshot.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.mjs +3 -3
- package/esm/http/request-log-snapshot.mjs.map +1 -1
- package/esm/http/request.d.mts +8 -7
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +8 -7
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +12 -11
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +7 -7
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/safe-redirect.d.mts +3 -4
- package/esm/http/safe-redirect.d.mts.map +1 -1
- package/esm/http/serialized.d.mts +12 -13
- package/esm/http/serialized.d.mts.map +1 -1
- package/esm/http/server-rebuilt.d.mts +3 -5
- package/esm/http/server-rebuilt.d.mts.map +1 -1
- package/esm/http/server.d.mts +9 -9
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +4 -4
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/stream-react-response.d.mts +7 -7
- package/esm/http/stream-react-response.d.mts.map +1 -1
- package/esm/http/tracing/index.mjs +1 -1
- package/esm/http/tracing/trace-id.d.mts +2 -3
- package/esm/http/tracing/trace-id.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.d.mts +10 -11
- package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.mjs +2 -2
- package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
- package/esm/http/tracing/tracing.type.d.mts +11 -9
- package/esm/http/tracing/tracing.type.d.mts.map +1 -1
- package/esm/http/types.d.mts +49 -43
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploaded-file.d.mts +6 -5
- package/esm/http/uploaded-file.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts +6 -6
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +1 -1
- package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
- package/esm/http/uploads/image-variant-cache-entries.mjs +1 -1
- package/esm/http/uploads/image-variant-cache.mjs +8 -8
- package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/image-variant-types.d.mts +7 -9
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +1 -2
- package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
- package/esm/http/uploads/index.d.mts +2 -1
- package/esm/http/uploads/index.mjs +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs.map +1 -1
- package/esm/http/uploads/purge-image-variants.d.mts +2 -4
- package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variant.d.mts +3 -5
- package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variants-config.mjs +4 -4
- package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs.map +1 -1
- package/esm/http/uploads/trim-image-variant-cache.mjs +3 -3
- package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.d.mts +6 -5
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +2 -1
- package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
- package/esm/http/uploads/variant-cache-key.mjs +1 -1
- package/esm/http/uploads-config.d.mts +2 -4
- package/esm/http/uploads-config.d.mts.map +1 -1
- package/esm/http/uploads-types.d.mts +19 -17
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/http/xmlable.d.mts +1 -2
- package/esm/http/xmlable.d.mts.map +1 -1
- package/esm/image/image.d.mts +6 -7
- package/esm/image/image.d.mts.map +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/image/index.d.mts +2 -1
- package/esm/image/index.mjs +1 -1
- package/esm/index.d.mts +28 -2
- package/esm/index.mjs +7 -2
- package/esm/loader/app-module-importer.d.mts +1 -2
- package/esm/loader/app-module-importer.d.mts.map +1 -1
- package/esm/localization/index.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.d.mts +4 -5
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
- package/esm/localization/register-locale-dictionary.d.mts +3 -4
- package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/register-locale-dictionary.mjs +2 -2
- package/esm/localization/register-locale-dictionary.mjs.map +1 -1
- package/esm/logger/fatal-visibility.d.mts +1 -2
- package/esm/logger/fatal-visibility.d.mts.map +1 -1
- package/esm/logger/index.d.mts +2 -1
- package/esm/logger/index.mjs +1 -1
- package/esm/logger/logger.d.mts +1 -3
- package/esm/logger/logger.d.mts.map +1 -1
- package/esm/logger/types.d.mts +2 -3
- package/esm/logger/types.d.mts.map +1 -1
- package/esm/mail/config.d.mts +12 -14
- package/esm/mail/config.d.mts.map +1 -1
- package/esm/mail/events.d.mts +4 -6
- package/esm/mail/events.d.mts.map +1 -1
- package/esm/mail/index.d.mts +2 -1
- package/esm/mail/index.mjs +1 -1
- package/esm/mail/mail.d.mts +1 -3
- package/esm/mail/mail.d.mts.map +1 -1
- package/esm/mail/mailer-pool.d.mts +5 -7
- package/esm/mail/mailer-pool.d.mts.map +1 -1
- package/esm/mail/react-mail.d.mts +1 -3
- package/esm/mail/react-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.d.mts +1 -3
- package/esm/mail/send-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.mjs +2 -1
- package/esm/mail/send-mail.mjs.map +1 -1
- package/esm/mail/test-mailbox.d.mts +11 -13
- package/esm/mail/test-mailbox.d.mts.map +1 -1
- package/esm/mail/types.d.mts +17 -18
- package/esm/mail/types.d.mts.map +1 -1
- package/esm/manifest/manifest-manager.mjs +1 -1
- package/esm/openapi/build-openapi-document.d.mts +2 -4
- package/esm/openapi/build-openapi-document.d.mts.map +1 -1
- package/esm/openapi/cast-schema.mjs +1 -1
- package/esm/openapi/development-openapi-provider.d.mts +5 -6
- package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
- package/esm/openapi/index.d.mts +3 -1
- package/esm/openapi/index.mjs +1 -1
- package/esm/openapi/openapi-child-output.mjs +2 -2
- package/esm/openapi/openapi-child-output.mjs.map +1 -1
- package/esm/openapi/postman/build-request-url.mjs +1 -1
- package/esm/openapi/postman/example-from-schema.d.mts +1 -3
- package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
- package/esm/openapi/postman/index.d.mts +2 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts +3 -5
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
- package/esm/openapi/postman/postman-types.d.mts +19 -18
- package/esm/openapi/postman/postman-types.d.mts.map +1 -1
- package/esm/openapi/postman/schema-refs.d.mts +1 -3
- package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
- package/esm/openapi/postman/uuid-v5.mjs +1 -1
- package/esm/openapi/schema-registry.d.mts +1 -1
- package/esm/openapi/security.mjs +1 -1
- package/esm/openapi/types.d.mts +23 -21
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-generated-imports.mjs +1 -1
- package/esm/production/build-contributions.mjs +1 -1
- package/esm/production/bundle-framework-dependencies.mjs +1 -1
- package/esm/production/dist-build-manifest.mjs +1 -1
- package/esm/production/esbuild-plugins.mjs.map +1 -1
- package/esm/production/esbuild-preflight.mjs +1 -1
- package/esm/production/production-builder.mjs +2 -1
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/production-supervisor.mjs +1 -1
- package/esm/production/registration-child-runner.mjs +4 -3
- package/esm/production/registration-child-runner.mjs.map +1 -1
- package/esm/production/resolve-build-config.d.mts +4 -4
- package/esm/production/resolve-build-config.d.mts.map +1 -1
- package/esm/production/resolve-build-config.mjs +1 -1
- package/esm/production/route-registration-child.d.mts +1 -1
- package/esm/production/route-registration-child.mjs +8 -7
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/tsconfig-path-aliases.mjs +1 -1
- package/esm/react/index.d.mts +1 -3
- package/esm/react/index.d.mts.map +1 -1
- package/esm/react/index.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +3 -4
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +2 -3
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs +10 -9
- package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/index.d.mts +2 -1
- package/esm/repositories/adapters/cascade/index.mjs +1 -1
- package/esm/repositories/contracts/index.d.mts +2 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts +4 -6
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -3
- package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts +23 -25
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/index.d.mts +4 -1
- package/esm/repositories/index.mjs +1 -1
- package/esm/repositories/repository.manager.d.mts +2 -3
- package/esm/repositories/repository.manager.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs +2 -2
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/define-resource.d.mts +3 -5
- package/esm/resource/define-resource.d.mts.map +1 -1
- package/esm/resource/index.d.mts +2 -1
- package/esm/resource/index.mjs +1 -1
- package/esm/resource/nullable-resource.d.mts +5 -7
- package/esm/resource/nullable-resource.d.mts.map +1 -1
- package/esm/resource/register-resource.d.mts +1 -3
- package/esm/resource/register-resource.d.mts.map +1 -1
- package/esm/resource/resource-field-builder.d.mts +1 -3
- package/esm/resource/resource-field-builder.d.mts.map +1 -1
- package/esm/resource/resource.d.mts +3 -5
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs +4 -2
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts +21 -21
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/index.d.mts +2 -1
- package/esm/restful/index.mjs +1 -1
- package/esm/restful/restful.d.mts +12 -32
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/router/index.d.mts +2 -1
- package/esm/router/index.mjs +1 -1
- package/esm/router/named-api-routes-with-responses.mjs +2 -1
- package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
- package/esm/router/normalize-request-path.d.mts +1 -2
- package/esm/router/normalize-request-path.d.mts.map +1 -1
- package/esm/router/normalize-route-path.d.mts +1 -2
- package/esm/router/normalize-route-path.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts +15 -13
- package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
- package/esm/router/resolve-route-rate-limit.mjs +3 -3
- package/esm/router/resolve-route-rate-limit.mjs.map +1 -1
- package/esm/router/route-builder.d.mts +1 -3
- package/esm/router/route-builder.d.mts.map +1 -1
- package/esm/router/route-guard-names.mjs +1 -1
- package/esm/router/route-guard-names.mjs.map +1 -1
- package/esm/router/route-name-method-suffix.d.mts +2 -3
- package/esm/router/route-name-method-suffix.d.mts.map +1 -1
- package/esm/router/route-name-taken-error.d.mts +1 -3
- package/esm/router/route-name-taken-error.d.mts.map +1 -1
- package/esm/router/route-registry.d.mts +1 -3
- package/esm/router/route-registry.d.mts.map +1 -1
- package/esm/router/router.d.mts +2 -4
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +8 -6
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +25 -26
- package/esm/router/types.d.mts.map +1 -1
- package/esm/router/unguarded-route-diagnostics.d.mts +6 -8
- package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -1
- package/esm/secrets/errors.d.mts +9 -0
- package/esm/secrets/errors.d.mts.map +1 -0
- package/esm/secrets/errors.mjs +22 -0
- package/esm/secrets/errors.mjs.map +1 -0
- package/esm/secrets/file-backend.mjs +167 -0
- package/esm/secrets/file-backend.mjs.map +1 -0
- package/esm/secrets/index.d.mts +6 -0
- package/esm/secrets/index.mjs +6 -0
- package/esm/secrets/keyring-backend.mjs +50 -0
- package/esm/secrets/keyring-backend.mjs.map +1 -0
- package/esm/secrets/memory-backend.d.mts +12 -0
- package/esm/secrets/memory-backend.d.mts.map +1 -0
- package/esm/secrets/memory-backend.mjs +28 -0
- package/esm/secrets/memory-backend.mjs.map +1 -0
- package/esm/secrets/secret-store.d.mts +25 -0
- package/esm/secrets/secret-store.d.mts.map +1 -0
- package/esm/secrets/secret-store.mjs +117 -0
- package/esm/secrets/secret-store.mjs.map +1 -0
- package/esm/secrets/secrets.d.mts +11 -0
- package/esm/secrets/secrets.d.mts.map +1 -0
- package/esm/secrets/secrets.mjs +63 -0
- package/esm/secrets/secrets.mjs.map +1 -0
- package/esm/secrets/types.d.mts +22 -0
- package/esm/secrets/types.d.mts.map +1 -0
- package/esm/socket/index.d.mts +2 -1
- package/esm/socket/index.mjs +2 -2
- package/esm/socket/types.d.mts +2 -4
- package/esm/socket/types.d.mts.map +1 -1
- package/esm/socket/utils.d.mts +8 -3
- package/esm/socket/utils.d.mts.map +1 -1
- package/esm/socket/utils.mjs +12 -1
- package/esm/socket/utils.mjs.map +1 -1
- package/esm/storage/config.d.mts +4 -6
- package/esm/storage/config.d.mts.map +1 -1
- package/esm/storage/context/storage-driver-context.d.mts +3 -4
- package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts +2 -4
- package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
- package/esm/storage/drivers/do-spaces-driver.d.mts +1 -3
- package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.d.mts +2 -3
- package/esm/storage/drivers/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs +8 -3
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/drivers/r2-driver.d.mts +1 -3
- package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
- package/esm/storage/drivers/s3-driver.d.mts +1 -3
- package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
- package/esm/storage/index.d.mts +2 -1
- package/esm/storage/index.mjs +1 -1
- package/esm/storage/local-disk-roots.mjs +2 -2
- package/esm/storage/local-disk-roots.mjs.map +1 -1
- package/esm/storage/scoped-storage.d.mts +2 -3
- package/esm/storage/scoped-storage.d.mts.map +1 -1
- package/esm/storage/storage-file.d.mts +1 -3
- package/esm/storage/storage-file.d.mts.map +1 -1
- package/esm/storage/storage.d.mts +3 -4
- package/esm/storage/storage.d.mts.map +1 -1
- package/esm/storage/types.d.mts +36 -36
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/classify-ip-address.d.mts +1 -2
- package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
- package/esm/storage/utils/contain-path.d.mts +1 -2
- package/esm/storage/utils/contain-path.d.mts.map +1 -1
- package/esm/storage/utils/mime.d.mts +2 -3
- package/esm/storage/utils/mime.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.d.mts +6 -6
- package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.mjs +3 -3
- package/esm/storage/utils/safe-fetch.mjs.map +1 -1
- package/esm/storage/utils/storage-capability-error.d.mts +1 -3
- package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-error.d.mts +2 -3
- package/esm/storage/utils/storage-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts +1 -2
- package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
- package/esm/tests/authenticated-test-client.d.mts +5 -6
- package/esm/tests/authenticated-test-client.d.mts.map +1 -1
- package/esm/tests/factories.d.mts +38 -23
- package/esm/tests/factories.d.mts.map +1 -1
- package/esm/tests/fakes/cache-fake.d.mts +14 -9
- package/esm/tests/fakes/cache-fake.d.mts.map +1 -1
- package/esm/tests/fakes/clock-fake.d.mts +13 -8
- package/esm/tests/fakes/clock-fake.d.mts.map +1 -1
- package/esm/tests/fakes/fake-assertion-error.d.mts +2 -3
- package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -1
- package/esm/tests/fakes/ids-fake.d.mts +5 -4
- package/esm/tests/fakes/ids-fake.d.mts.map +1 -1
- package/esm/tests/fakes/index.d.mts +3 -1
- package/esm/tests/fakes/index.mjs +2 -1
- package/esm/tests/fakes/mail-fake.d.mts +21 -13
- package/esm/tests/fakes/mail-fake.d.mts.map +1 -1
- package/esm/tests/fakes/queue-fake.d.mts +21 -13
- package/esm/tests/fakes/queue-fake.d.mts.map +1 -1
- package/esm/tests/fakes/secrets-fake.d.mts +13 -0
- package/esm/tests/fakes/secrets-fake.d.mts.map +1 -0
- package/esm/tests/fakes/secrets-fake.mjs +50 -0
- package/esm/tests/fakes/secrets-fake.mjs.map +1 -0
- package/esm/tests/fakes/storage-fake.d.mts +12 -8
- package/esm/tests/fakes/storage-fake.d.mts.map +1 -1
- package/esm/tests/fakes/storage-fake.mjs +1 -1
- package/esm/tests/fakes/test-fakes.d.mts +9 -10
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
- package/esm/tests/fakes/test-fakes.mjs +6 -3
- package/esm/tests/fakes/test-fakes.mjs.map +1 -1
- package/esm/tests/index.d.mts +3 -1
- package/esm/tests/index.mjs +2 -1
- package/esm/tests/snapshot-response.d.mts +4 -5
- package/esm/tests/snapshot-response.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.d.mts +4 -6
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +5 -5
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-connectors-selection.d.mts +2 -2
- package/esm/tests/test-connectors-selection.d.mts.map +1 -1
- package/esm/tests/test-connectors-selection.mjs +1 -1
- package/esm/tests/test-helpers.d.mts +11 -12
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-http-server.d.mts +14 -10
- package/esm/tests/test-http-server.d.mts.map +1 -1
- package/esm/tests/test-lifecycle-state.mjs +1 -1
- package/esm/tests/vitest-setup.d.mts +7 -8
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.d.mts +4 -5
- package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.mjs +2 -1
- package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-refresher.d.mts +19 -12
- package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -1
- package/esm/tooling/agents-md/installed-skills.d.mts +13 -9
- package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -1
- package/esm/tooling/agents-md/render-agents-md.d.mts +8 -7
- package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -1
- package/esm/tooling/agents-md/render-agents-md.mjs +2 -2
- package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -1
- package/esm/tooling/agents-md/write-agents-md.d.mts +17 -12
- package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -1
- package/esm/tooling/board/board-message.d.mts +4 -6
- package/esm/tooling/board/board-message.d.mts.map +1 -1
- package/esm/tooling/board/board.d.mts +50 -38
- package/esm/tooling/board/board.d.mts.map +1 -1
- package/esm/tooling/board/board.mjs +4 -3
- package/esm/tooling/board/board.mjs.map +1 -1
- package/esm/tooling/board/board.types.d.mts +32 -23
- package/esm/tooling/board/board.types.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.d.mts +4 -6
- package/esm/tooling/check/changed-files.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.mjs +2 -2
- package/esm/tooling/check/changed-files.mjs.map +1 -1
- package/esm/tooling/check/check-report.types.d.mts +22 -17
- package/esm/tooling/check/check-report.types.d.mts.map +1 -1
- package/esm/tooling/check/code-style-conventions.mjs +25 -25
- package/esm/tooling/check/code-style-conventions.mjs.map +1 -1
- package/esm/tooling/check/conventions-step.d.mts +4 -6
- package/esm/tooling/check/conventions-step.d.mts.map +1 -1
- package/esm/tooling/check/conventions-step.mjs +7 -18
- package/esm/tooling/check/conventions-step.mjs.map +1 -1
- package/esm/tooling/check/environment-step.d.mts +2 -4
- package/esm/tooling/check/environment-step.d.mts.map +1 -1
- package/esm/tooling/check/environment-step.mjs +1 -1
- package/esm/tooling/check/index.mjs +1 -1
- package/esm/tooling/check/lint-step.d.mts +5 -12
- package/esm/tooling/check/lint-step.d.mts.map +1 -1
- package/esm/tooling/check/lint-step.mjs +16 -12
- package/esm/tooling/check/lint-step.mjs.map +1 -1
- package/esm/tooling/check/request-input.mjs +15 -15
- package/esm/tooling/check/request-input.mjs.map +1 -1
- package/esm/tooling/check/run-check.d.mts +24 -14
- package/esm/tooling/check/run-check.d.mts.map +1 -1
- package/esm/tooling/check/run-check.mjs +2 -2
- package/esm/tooling/check/run-check.mjs.map +1 -1
- package/esm/tooling/check/run-tests.d.mts +22 -15
- package/esm/tooling/check/run-tests.d.mts.map +1 -1
- package/esm/tooling/check/security-conventions.mjs +133 -131
- package/esm/tooling/check/security-conventions.mjs.map +1 -1
- package/esm/tooling/check/source-ast.mjs +92 -132
- package/esm/tooling/check/source-ast.mjs.map +1 -1
- package/esm/tooling/check/tests-step.d.mts +7 -8
- package/esm/tooling/check/tests-step.d.mts.map +1 -1
- package/esm/tooling/check/tests-step.mjs +3 -3
- package/esm/tooling/check/tests-step.mjs.map +1 -1
- package/esm/tooling/dev-state/dev-server-state.d.mts +17 -13
- package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -1
- package/esm/tooling/devtools/devtools-client.d.mts +29 -20
- package/esm/tooling/devtools/devtools-client.d.mts.map +1 -1
- package/esm/tooling/generate/generation.d.mts +34 -22
- package/esm/tooling/generate/generation.d.mts.map +1 -1
- package/esm/tooling/generate/generation.mjs +9 -5
- package/esm/tooling/generate/generation.mjs.map +1 -1
- package/esm/tooling/generate/generator-spec.d.mts +9 -9
- package/esm/tooling/generate/generator-spec.d.mts.map +1 -1
- package/esm/tooling/generate/index.mjs +1 -1
- package/esm/tooling/generate/project-files.mjs +3 -3
- package/esm/tooling/generate/project-files.mjs.map +1 -1
- package/esm/tooling/generate/run-cli.d.mts +14 -11
- package/esm/tooling/generate/run-cli.d.mts.map +1 -1
- package/esm/tooling/generate/run-cli.mjs +2 -2
- package/esm/tooling/generate/run-cli.mjs.map +1 -1
- package/esm/tooling/generate/unified-diff.d.mts +10 -7
- package/esm/tooling/generate/unified-diff.d.mts.map +1 -1
- package/esm/tooling/index.d.mts +1 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts +7 -7
- package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-config.mjs +3 -3
- package/esm/tooling/inspect/collect-config.mjs.map +1 -1
- package/esm/tooling/inspect/collect-models.d.mts +4 -3
- package/esm/tooling/inspect/collect-models.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-models.mjs +1 -1
- package/esm/tooling/inspect/collect-packages.d.mts +1 -2
- package/esm/tooling/inspect/collect-packages.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-pages.mjs +10 -10
- package/esm/tooling/inspect/collect-pages.mjs.map +1 -1
- package/esm/tooling/inspect/collect-routes.mjs +1 -1
- package/esm/tooling/inspect/event-recorder.d.mts +7 -7
- package/esm/tooling/inspect/event-recorder.d.mts.map +1 -1
- package/esm/tooling/inspect/index.d.mts +2 -1
- package/esm/tooling/inspect/index.mjs +1 -1
- package/esm/tooling/inspect/inspect-app.d.mts +25 -16
- package/esm/tooling/inspect/inspect-app.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.schema.d.mts +1 -2
- package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.types.d.mts +86 -54
- package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -1
- package/esm/tooling/mcp/create-mcp-context.d.mts +11 -8
- package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -1
- package/esm/tooling/mcp/db-schema.d.mts +10 -9
- package/esm/tooling/mcp/db-schema.d.mts.map +1 -1
- package/esm/tooling/mcp/docs-search.d.mts +20 -15
- package/esm/tooling/mcp/docs-search.d.mts.map +1 -1
- package/esm/tooling/mcp/index.mjs +1 -1
- package/esm/tooling/mcp/load-ai-tools.d.mts +7 -8
- package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/load-ai-tools.mjs +2 -1
- package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -1
- package/esm/tooling/mcp/mcp-tools.d.mts +29 -19
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/mcp-tools.mjs +3 -2
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -1
- package/esm/tooling/mcp/start-mcp-server.d.mts +24 -17
- package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -1
- package/esm/tooling/mcp/start-mcp-server.mjs +1 -1
- package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -1
- package/esm/tooling/mcp/tool-input.d.mts +7 -7
- package/esm/tooling/mcp/tool-input.d.mts.map +1 -1
- package/esm/tooling/problem.d.mts +27 -17
- package/esm/tooling/problem.d.mts.map +1 -1
- package/esm/tooling/syntax/ast.mjs +230 -0
- package/esm/tooling/syntax/ast.mjs.map +1 -0
- package/esm/tooling/syntax/imports.mjs +34 -0
- package/esm/tooling/syntax/imports.mjs.map +1 -0
- package/esm/tooling/trace/trace-report.types.d.mts +36 -22
- package/esm/tooling/trace/trace-report.types.d.mts.map +1 -1
- package/esm/tooling/trace/trace-request.d.mts +27 -20
- package/esm/tooling/trace/trace-request.d.mts.map +1 -1
- package/esm/tooling/trace/trace-request.mjs +2 -2
- package/esm/tooling/trace/trace-request.mjs.map +1 -1
- package/esm/tooling/typecheck/index.mjs +1 -1
- package/esm/tooling/typecheck/run-typecheck.d.mts +15 -48
- package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -1
- package/esm/tooling/typecheck/run-typecheck.mjs +42 -105
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -1
- package/esm/tooling/typescript/compiler.d.mts +31 -0
- package/esm/tooling/typescript/compiler.d.mts.map +1 -0
- package/esm/tooling/typescript/compiler.mjs +120 -0
- package/esm/tooling/typescript/compiler.mjs.map +1 -0
- package/esm/updater/update-warlock-packages.mjs +3 -2
- package/esm/updater/update-warlock-packages.mjs.map +1 -1
- package/esm/upgrade/codemods/index.mjs +3 -1
- package/esm/upgrade/codemods/index.mjs.map +1 -1
- package/esm/upgrade/codemods/logger-sync-calls.mjs +1 -1
- package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -1
- package/esm/upgrade/codemods/oxc-toolchain.mjs +142 -0
- package/esm/upgrade/codemods/oxc-toolchain.mjs.map +1 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs +1 -1
- package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -1
- package/esm/upgrade/codemods/toolchain-templates.mjs +244 -0
- package/esm/upgrade/codemods/toolchain-templates.mjs.map +1 -0
- package/esm/upgrade/diff.mjs +1 -1
- package/esm/upgrade/diff.mjs.map +1 -1
- package/esm/upgrade/load-ts-morph.mjs +3 -2
- package/esm/upgrade/load-ts-morph.mjs.map +1 -1
- package/esm/upgrade/run-upgrade.mjs +26 -7
- package/esm/upgrade/run-upgrade.mjs.map +1 -1
- package/esm/use-cases/index.d.mts +2 -1
- package/esm/use-cases/index.mjs +1 -1
- package/esm/use-cases/types.d.mts +116 -63
- package/esm/use-cases/types.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts +1 -3
- package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
- package/esm/use-cases/use-case-events.d.mts +3 -5
- package/esm/use-cases/use-case-events.d.mts.map +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts +6 -6
- package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
- package/esm/use-cases/use-case.d.mts +2 -4
- package/esm/use-cases/use-case.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.d.mts +1 -3
- package/esm/use-cases/use-case.errors.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.d.mts +8 -10
- package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
- package/esm/utils/app-log.d.mts +1 -2
- package/esm/utils/app-log.d.mts.map +1 -1
- package/esm/utils/clock.d.mts +8 -6
- package/esm/utils/clock.d.mts.map +1 -1
- package/esm/utils/database-log.d.mts +3 -4
- package/esm/utils/database-log.d.mts.map +1 -1
- package/esm/utils/environment.d.mts +4 -5
- package/esm/utils/environment.d.mts.map +1 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/get-localized.d.mts +2 -3
- package/esm/utils/get-localized.d.mts.map +1 -1
- package/esm/utils/ids.d.mts +9 -6
- package/esm/utils/ids.d.mts.map +1 -1
- package/esm/utils/index.d.mts +2 -1
- package/esm/utils/index.mjs +1 -1
- package/esm/utils/normalized-path.d.mts +1 -2
- package/esm/utils/normalized-path.d.mts.map +1 -1
- package/esm/utils/npm-registry.d.mts +1 -2
- package/esm/utils/npm-registry.d.mts.map +1 -1
- package/esm/utils/paths.d.mts +13 -14
- package/esm/utils/paths.d.mts.map +1 -1
- package/esm/utils/paths.mjs +2 -2
- package/esm/utils/paths.mjs.map +1 -1
- package/esm/utils/promise-all-object.d.mts +1 -2
- package/esm/utils/promise-all-object.d.mts.map +1 -1
- package/esm/utils/queue.d.mts +1 -2
- package/esm/utils/queue.d.mts.map +1 -1
- package/esm/utils/runtime.d.mts +11 -10
- package/esm/utils/runtime.d.mts.map +1 -1
- package/esm/utils/sleep.d.mts +1 -2
- package/esm/utils/sleep.d.mts.map +1 -1
- package/esm/utils/sluggable.d.mts +1 -3
- package/esm/utils/sluggable.d.mts.map +1 -1
- package/esm/utils/to-json.d.mts +1 -2
- package/esm/utils/to-json.d.mts.map +1 -1
- package/esm/utils/types.d.mts +1 -2
- package/esm/utils/types.d.mts.map +1 -1
- package/esm/utils/urls.d.mts +5 -6
- package/esm/utils/urls.d.mts.map +1 -1
- package/esm/utils/version-compare.d.mts +1 -2
- package/esm/utils/version-compare.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts +2 -3
- package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts +2 -3
- package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/index.d.mts +2 -1
- package/esm/validation/database/index.mjs +1 -1
- package/esm/validation/database/types.d.mts +14 -10
- package/esm/validation/database/types.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts +2 -3
- package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts +2 -3
- package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
- package/esm/validation/file/file.d.mts +4 -6
- package/esm/validation/file/file.d.mts.map +1 -1
- package/esm/validation/file/index.d.mts +2 -1
- package/esm/validation/file/index.mjs +1 -1
- package/esm/validation/index.d.mts +5 -1
- package/esm/validation/index.mjs +1 -1
- package/esm/validation/plugins/index.mjs +1 -1
- package/esm/validation/types.d.mts +6 -4
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +2 -2
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validation-failure-status.mjs +2 -2
- package/esm/validation/validation-failure-status.mjs.map +1 -1
- package/esm/validation/validators/file-validator.d.mts +2 -4
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/validation/validators/index.d.mts +2 -1
- package/esm/validation/validators/index.mjs +1 -1
- package/esm/vite/lower-stage3-decorators.d.mts +2 -3
- package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
- package/esm/warlock-config/define-config.d.mts +1 -3
- package/esm/warlock-config/define-config.d.mts.map +1 -1
- package/esm/warlock-config/define-config.mjs +3 -2
- package/esm/warlock-config/define-config.mjs.map +1 -1
- package/esm/warlock-config/index.d.mts +2 -1
- package/esm/warlock-config/index.mjs +1 -1
- package/esm/warlock-config/types.d.mts +8 -6
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.d.mts +5 -7
- package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.mjs +2 -1
- package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
- package/esm/warlock-config/warn-deprecated-config.mjs +1 -1
- package/llms-full.txt +379 -22
- package/llms.txt +3 -2
- package/package.json +27 -15
- package/skills/README.md +2 -1
- package/skills/create-module/SKILL.md +7 -0
- package/skills/index.md +3 -1
- package/skills/report-framework-issue.md +154 -0
- package/skills/run-app/SKILL.md +120 -10
- package/skills/store-secrets/SKILL.md +102 -0
- package/skills/test-fakes/SKILL.md +13 -11
- package/skills/upgrade-from-5-29/SKILL.md +78 -0
- package/skills/warlock-check/SKILL.md +6 -1
- package/skills/warlock-doctor/SKILL.md +9 -0
- package/skills/wire-socket/SKILL.md +19 -0
- package/skills/write-cli-command/SKILL.md +21 -0
- package/esm/tooling/check/index.d.mts +0 -8
- package/esm/tooling/typecheck/index.d.mts +0 -1
|
@@ -68,20 +68,21 @@ async function mcpCommandAction({ options }) {
|
|
|
68
68
|
if (transport.type === "stdio") routeConsoleToStderr();
|
|
69
69
|
const allowWrites = options.allowWrites === true;
|
|
70
70
|
const inspectOptions = lazyInspectOptions();
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
sections
|
|
77
|
-
}),
|
|
78
|
-
...process.argv[1] ? { cliEntry: process.argv[1] } : {},
|
|
79
|
-
devtools: {
|
|
80
|
-
...stringOption(options.url) ? { url: stringOption(options.url) } : {},
|
|
81
|
-
...stringOption(options.devtoolsPath) ? { devtoolsPath: stringOption(options.devtoolsPath) } : {}
|
|
82
|
-
},
|
|
83
|
-
features: Object.keys(featuresMap)
|
|
71
|
+
const context = createMcpContext({
|
|
72
|
+
allowWrites,
|
|
73
|
+
inspect: async (sections) => inspectApp({
|
|
74
|
+
...await inspectOptions(),
|
|
75
|
+
sections
|
|
84
76
|
}),
|
|
77
|
+
...process.argv[1] ? { cliEntry: process.argv[1] } : {},
|
|
78
|
+
devtools: {
|
|
79
|
+
...stringOption(options.url) ? { url: stringOption(options.url) } : {},
|
|
80
|
+
...stringOption(options.devtoolsPath) ? { devtoolsPath: stringOption(options.devtoolsPath) } : {}
|
|
81
|
+
},
|
|
82
|
+
features: Object.keys(featuresMap)
|
|
83
|
+
});
|
|
84
|
+
const server = await startWarlockMcpServer({
|
|
85
|
+
context,
|
|
85
86
|
transport,
|
|
86
87
|
version: await getWarlockVersion()
|
|
87
88
|
});
|
|
@@ -99,5 +100,5 @@ async function mcpCommandAction({ options }) {
|
|
|
99
100
|
}
|
|
100
101
|
|
|
101
102
|
//#endregion
|
|
102
|
-
export { mcpCommandAction, routeConsoleToStderr };
|
|
103
|
+
export { mcpCommandAction, mcpTransportFromOptions, routeConsoleToStderr };
|
|
103
104
|
//# sourceMappingURL=mcp-command.action.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-command.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/mcp/mcp-command.action.ts"],"sourcesContent":["import type { CommandActionData } from \"../../../commands/types\";\nimport { featuresMap } from \"../../../generations/features\";\nimport { bootForInspect, inspectOptionsFromBoot } from \"../../../tooling/inspect/boot-for-inspect\";\nimport { inspectApp, type InspectOptions } from \"../../../tooling/inspect/inspect-app\";\nimport { createMcpContext } from \"../../../tooling/mcp/create-mcp-context\";\nimport {\n resolveMcpTransport,\n startWarlockMcpServer,\n type WarlockMcpTransport,\n} from \"../../../tooling/mcp/start-mcp-server\";\nimport { getWarlockVersion } from \"../../../utils/framework-vesion\";\nimport { flushAndExit } from \"../../flush-and-exit\";\n\nfunction stringOption(value: string | number | boolean | undefined): string | undefined {\n if (typeof value === \"number\") return String(value);\n\n return typeof value === \"string\" && value.trim().length > 0 ? value.trim() : undefined;\n}\n\n/**\n * The transport `warlock mcp` options describe: stdio by default, HTTP with\n * `--http` (and `--host`, `--port`, `--path`, `--token` / `WARLOCK_MCP_TOKEN`).\n * Throws on a port that is not a number.\n */\nexport function mcpTransportFromOptions(\n options: CommandActionData[\"options\"],\n env: NodeJS.ProcessEnv = process.env,\n): WarlockMcpTransport {\n const http =\n options.http === true || stringOption(options.host) !== undefined || options.port !== undefined;\n\n if (!http) return { type: \"stdio\" };\n\n const portText = stringOption(options.port);\n const port = portText === undefined ? 0 : Number(portText);\n\n if (!Number.isInteger(port) || port < 0 || port > 65_535) {\n throw new Error(`--port must be a number from 0 to 65535, got ${JSON.stringify(portText)}.`);\n }\n\n return {\n type: \"http\",\n host: stringOption(options.host) ?? \"127.0.0.1\",\n port,\n path: stringOption(options.path) ?? \"/mcp\",\n token: stringOption(options.token) ?? stringOption(env.WARLOCK_MCP_TOKEN),\n };\n}\n\n/**\n * Send `console.log` / `console.info` / `console.debug` to stderr for the rest\n * of the process: over stdio, stdout carries only JSON-RPC, so a stray log\n * line from the app (or the framework's logger) would corrupt the stream.\n */\nexport function routeConsoleToStderr(): () => void {\n const { log, info, debug } = console;\n const toStderr = (...args: unknown[]) => console.error(...args);\n\n console.log = toStderr;\n console.info = toStderr;\n console.debug = toStderr;\n\n return () => {\n console.log = log;\n console.info = info;\n console.debug = debug;\n };\n}\n\n/** The read-only boot, run once on the first tool call that needs the app. */\nfunction lazyInspectOptions(): () => Promise<InspectOptions> {\n let boot: Promise<InspectOptions> | undefined;\n\n return () => {\n boot ??= bootForInspect().then(inspectOptionsFromBoot);\n\n return boot;\n };\n}\n\n/**\n * Action behind `warlock mcp`.\n *\n * Serves the app's tools over MCP. The app is booted the `warlock inspect`\n * way — connectors booted, none started, no connection, no port — on the\n * first call that needs it, so the server answers `initialize` at once.\n * Runs until stdin closes (stdio) or SIGINT/SIGTERM.\n */\nexport async function mcpCommandAction({ options }: CommandActionData): Promise<void> {\n const transport = mcpTransportFromOptions(options);\n\n // Refuse an unsafe bind before anything boots.\n resolveMcpTransport(transport);\n\n if (transport.type === \"stdio\") routeConsoleToStderr();\n\n const allowWrites = options.allowWrites === true;\n const inspectOptions = lazyInspectOptions();\n const context = createMcpContext({\n allowWrites,\n inspect: async (sections) => inspectApp({ ...(await inspectOptions()), sections }),\n ...(process.argv[1] ? { cliEntry: process.argv[1] } : {}),\n devtools: {\n ...(stringOption(options.url) ? { url: stringOption(options.url) } : {}),\n ...(stringOption(options.devtoolsPath)\n ? { devtoolsPath: stringOption(options.devtoolsPath) }\n : {}),\n },\n features: Object.keys(featuresMap),\n });\n\n const server = await startWarlockMcpServer({\n context,\n transport,\n version: await getWarlockVersion(),\n });\n\n console.error(\n `warlock mcp: ${server.tools.length} tools on ${server.url ?? \"stdio\"} (${allowWrites ? \"writes allowed\" : \"read-only\"})`,\n );\n\n let closing = false;\n\n const stop = async () => {\n if (closing) return;\n closing = true;\n await server.close();\n await flushAndExit(0);\n };\n\n process.once(\"SIGINT\", () => void stop());\n process.once(\"SIGTERM\", () => void stop());\n\n if (transport.type === \"stdio\") {\n process.stdin.once(\"end\", () => void stop());\n }\n}\n"],"mappings":";;;;;;;;;AAaA,SAAS,aAAa,OAAkE;CACtF,IAAI,OAAO,UAAU,UAAU,OAAO,OAAO,KAAK;CAElD,OAAO,OAAO,UAAU,YAAY,MAAM,KAAK,CAAC,CAAC,SAAS,IAAI,MAAM,KAAK,IAAI;AAC/E;;;;;;AAOA,SAAgB,wBACd,SACA,MAAyB,QAAQ,KACZ;CAIrB,IAAI,EAFF,QAAQ,SAAS,QAAQ,aAAa,QAAQ,IAAI,MAAM,UAAa,QAAQ,SAAS,SAE7E,OAAO,EAAE,MAAM,QAAQ;CAElC,MAAM,WAAW,aAAa,QAAQ,IAAI;CAC1C,MAAM,OAAO,aAAa,SAAY,IAAI,OAAO,QAAQ;CAEzD,IAAI,CAAC,OAAO,UAAU,IAAI,KAAK,OAAO,KAAK,OAAO,OAChD,MAAM,IAAI,MAAM,gDAAgD,KAAK,UAAU,QAAQ,EAAE,EAAE;CAG7F,OAAO;EACL,MAAM;EACN,MAAM,aAAa,QAAQ,IAAI,KAAK;EACpC;EACA,MAAM,aAAa,QAAQ,IAAI,KAAK;EACpC,OAAO,aAAa,QAAQ,KAAK,KAAK,aAAa,IAAI,iBAAiB;CAC1E;AACF;;;;;;AAOA,SAAgB,uBAAmC;CACjD,MAAM,EAAE,KAAK,MAAM,UAAU;CAC7B,MAAM,YAAY,GAAG,SAAoB,QAAQ,MAAM,GAAG,IAAI;CAE9D,QAAQ,MAAM;CACd,QAAQ,OAAO;CACf,QAAQ,QAAQ;CAEhB,aAAa;EACX,QAAQ,MAAM;EACd,QAAQ,OAAO;EACf,QAAQ,QAAQ;CAClB;AACF;;AAGA,SAAS,qBAAoD;CAC3D,IAAI;CAEJ,aAAa;EACX,SAAS,eAAe,CAAC,CAAC,KAAK,sBAAsB;EAErD,OAAO;CACT;AACF;;;;;;;;;AAUA,eAAsB,iBAAiB,EAAE,WAA6C;CACpF,MAAM,YAAY,wBAAwB,OAAO;CAGjD,oBAAoB,SAAS;CAE7B,IAAI,UAAU,SAAS,SAAS,qBAAqB;CAErD,MAAM,cAAc,QAAQ,gBAAgB;CAC5C,MAAM,iBAAiB,mBAAmB;
|
|
1
|
+
{"version":3,"file":"mcp-command.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/mcp/mcp-command.action.ts"],"sourcesContent":["import type { CommandActionData } from \"../../../commands/types\";\nimport { featuresMap } from \"../../../generations/features\";\nimport { bootForInspect, inspectOptionsFromBoot } from \"../../../tooling/inspect/boot-for-inspect\";\nimport { inspectApp, type InspectOptions } from \"../../../tooling/inspect/inspect-app\";\nimport { createMcpContext } from \"../../../tooling/mcp/create-mcp-context\";\nimport {\n resolveMcpTransport,\n startWarlockMcpServer,\n type WarlockMcpTransport,\n} from \"../../../tooling/mcp/start-mcp-server\";\nimport { getWarlockVersion } from \"../../../utils/framework-vesion\";\nimport { flushAndExit } from \"../../flush-and-exit\";\n\nfunction stringOption(value: string | number | boolean | undefined): string | undefined {\n if (typeof value === \"number\") return String(value);\n\n return typeof value === \"string\" && value.trim().length > 0 ? value.trim() : undefined;\n}\n\n/**\n * The transport `warlock mcp` options describe: stdio by default, HTTP with\n * `--http` (and `--host`, `--port`, `--path`, `--token` / `WARLOCK_MCP_TOKEN`).\n * Throws on a port that is not a number.\n */\nexport function mcpTransportFromOptions(\n options: CommandActionData[\"options\"],\n env: NodeJS.ProcessEnv = process.env,\n): WarlockMcpTransport {\n const http =\n options.http === true || stringOption(options.host) !== undefined || options.port !== undefined;\n\n if (!http) return { type: \"stdio\" };\n\n const portText = stringOption(options.port);\n const port = portText === undefined ? 0 : Number(portText);\n\n if (!Number.isInteger(port) || port < 0 || port > 65_535) {\n throw new Error(`--port must be a number from 0 to 65535, got ${JSON.stringify(portText)}.`);\n }\n\n return {\n type: \"http\",\n host: stringOption(options.host) ?? \"127.0.0.1\",\n port,\n path: stringOption(options.path) ?? \"/mcp\",\n token: stringOption(options.token) ?? stringOption(env.WARLOCK_MCP_TOKEN),\n };\n}\n\n/**\n * Send `console.log` / `console.info` / `console.debug` to stderr for the rest\n * of the process: over stdio, stdout carries only JSON-RPC, so a stray log\n * line from the app (or the framework's logger) would corrupt the stream.\n */\nexport function routeConsoleToStderr(): () => void {\n const { log, info, debug } = console;\n const toStderr = (...args: unknown[]) => console.error(...args);\n\n console.log = toStderr;\n console.info = toStderr;\n console.debug = toStderr;\n\n return () => {\n console.log = log;\n console.info = info;\n console.debug = debug;\n };\n}\n\n/** The read-only boot, run once on the first tool call that needs the app. */\nfunction lazyInspectOptions(): () => Promise<InspectOptions> {\n let boot: Promise<InspectOptions> | undefined;\n\n return () => {\n boot ??= bootForInspect().then(inspectOptionsFromBoot);\n\n return boot;\n };\n}\n\n/**\n * Action behind `warlock mcp`.\n *\n * Serves the app's tools over MCP. The app is booted the `warlock inspect`\n * way — connectors booted, none started, no connection, no port — on the\n * first call that needs it, so the server answers `initialize` at once.\n * Runs until stdin closes (stdio) or SIGINT/SIGTERM.\n */\nexport async function mcpCommandAction({ options }: CommandActionData): Promise<void> {\n const transport = mcpTransportFromOptions(options);\n\n // Refuse an unsafe bind before anything boots.\n resolveMcpTransport(transport);\n\n if (transport.type === \"stdio\") routeConsoleToStderr();\n\n const allowWrites = options.allowWrites === true;\n const inspectOptions = lazyInspectOptions();\n const context = createMcpContext({\n allowWrites,\n inspect: async (sections) => inspectApp({ ...(await inspectOptions()), sections }),\n ...(process.argv[1] ? { cliEntry: process.argv[1] } : {}),\n devtools: {\n ...(stringOption(options.url) ? { url: stringOption(options.url) } : {}),\n ...(stringOption(options.devtoolsPath)\n ? { devtoolsPath: stringOption(options.devtoolsPath) }\n : {}),\n },\n features: Object.keys(featuresMap),\n });\n\n const server = await startWarlockMcpServer({\n context,\n transport,\n version: await getWarlockVersion(),\n });\n\n console.error(\n `warlock mcp: ${server.tools.length} tools on ${server.url ?? \"stdio\"} (${allowWrites ? \"writes allowed\" : \"read-only\"})`,\n );\n\n let closing = false;\n\n const stop = async () => {\n if (closing) return;\n closing = true;\n await server.close();\n await flushAndExit(0);\n };\n\n process.once(\"SIGINT\", () => void stop());\n process.once(\"SIGTERM\", () => void stop());\n\n if (transport.type === \"stdio\") {\n process.stdin.once(\"end\", () => void stop());\n }\n}\n"],"mappings":";;;;;;;;;AAaA,SAAS,aAAa,OAAkE;CACtF,IAAI,OAAO,UAAU,UAAU,OAAO,OAAO,KAAK;CAElD,OAAO,OAAO,UAAU,YAAY,MAAM,KAAK,CAAC,CAAC,SAAS,IAAI,MAAM,KAAK,IAAI;AAC/E;;;;;;AAOA,SAAgB,wBACd,SACA,MAAyB,QAAQ,KACZ;CAIrB,IAAI,EAFF,QAAQ,SAAS,QAAQ,aAAa,QAAQ,IAAI,MAAM,UAAa,QAAQ,SAAS,SAE7E,OAAO,EAAE,MAAM,QAAQ;CAElC,MAAM,WAAW,aAAa,QAAQ,IAAI;CAC1C,MAAM,OAAO,aAAa,SAAY,IAAI,OAAO,QAAQ;CAEzD,IAAI,CAAC,OAAO,UAAU,IAAI,KAAK,OAAO,KAAK,OAAO,OAChD,MAAM,IAAI,MAAM,gDAAgD,KAAK,UAAU,QAAQ,EAAE,EAAE;CAG7F,OAAO;EACL,MAAM;EACN,MAAM,aAAa,QAAQ,IAAI,KAAK;EACpC;EACA,MAAM,aAAa,QAAQ,IAAI,KAAK;EACpC,OAAO,aAAa,QAAQ,KAAK,KAAK,aAAa,IAAI,iBAAiB;CAC1E;AACF;;;;;;AAOA,SAAgB,uBAAmC;CACjD,MAAM,EAAE,KAAK,MAAM,UAAU;CAC7B,MAAM,YAAY,GAAG,SAAoB,QAAQ,MAAM,GAAG,IAAI;CAE9D,QAAQ,MAAM;CACd,QAAQ,OAAO;CACf,QAAQ,QAAQ;CAEhB,aAAa;EACX,QAAQ,MAAM;EACd,QAAQ,OAAO;EACf,QAAQ,QAAQ;CAClB;AACF;;AAGA,SAAS,qBAAoD;CAC3D,IAAI;CAEJ,aAAa;EACX,SAAS,eAAe,CAAC,CAAC,KAAK,sBAAsB;EAErD,OAAO;CACT;AACF;;;;;;;;;AAUA,eAAsB,iBAAiB,EAAE,WAA6C;CACpF,MAAM,YAAY,wBAAwB,OAAO;CAGjD,oBAAoB,SAAS;CAE7B,IAAI,UAAU,SAAS,SAAS,qBAAqB;CAErD,MAAM,cAAc,QAAQ,gBAAgB;CAC5C,MAAM,iBAAiB,mBAAmB;CAC1C,MAAM,UAAU,iBAAiB;EAC/B;EACA,SAAS,OAAO,aAAa,WAAW;GAAE,GAAI,MAAM,eAAe;GAAI;EAAS,CAAC;EACjF,GAAI,QAAQ,KAAK,KAAK,EAAE,UAAU,QAAQ,KAAK,GAAG,IAAI,CAAC;EACvD,UAAU;GACR,GAAI,aAAa,QAAQ,GAAG,IAAI,EAAE,KAAK,aAAa,QAAQ,GAAG,EAAE,IAAI,CAAC;GACtE,GAAI,aAAa,QAAQ,YAAY,IACjC,EAAE,cAAc,aAAa,QAAQ,YAAY,EAAE,IACnD,CAAC;EACP;EACA,UAAU,OAAO,KAAK,WAAW;CACnC,CAAC;CAED,MAAM,SAAS,MAAM,sBAAsB;EACzC;EACA;EACA,SAAS,MAAM,kBAAkB;CACnC,CAAC;CAED,QAAQ,MACN,gBAAgB,OAAO,MAAM,OAAO,YAAY,OAAO,OAAO,QAAQ,IAAI,cAAc,mBAAmB,YAAY,EACzH;CAEA,IAAI,UAAU;CAEd,MAAM,OAAO,YAAY;EACvB,IAAI,SAAS;EACb,UAAU;EACV,MAAM,OAAO,MAAM;EACnB,MAAM,aAAa,CAAC;CACtB;CAEA,QAAQ,KAAK,gBAAgB,KAAK,KAAK,CAAC;CACxC,QAAQ,KAAK,iBAAiB,KAAK,KAAK,CAAC;CAEzC,IAAI,UAAU,SAAS,SACrB,QAAQ,MAAM,KAAK,aAAa,KAAK,KAAK,CAAC;AAE/C"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { config } from "../../../config/config-getter.mjs";
|
|
2
|
+
import { resolveBuildConfig } from "../../../production/resolve-build-config.mjs";
|
|
3
|
+
import { checkDistReadyToStartAsync } from "../../../production/assert-dist-ready-to-start.mjs";
|
|
4
|
+
import { createPm2Config, selectPm2Targets, writePm2Config } from "./pm2-config.mjs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { readFile } from "node:fs/promises";
|
|
7
|
+
import { execFile } from "node:child_process";
|
|
8
|
+
|
|
9
|
+
//#region ../../packages/core/src/cli/commands/pm2/pm2-command.action.ts
|
|
10
|
+
/** No shell, no patterns, no import of PM2 or dependency on its daemon for init. */
|
|
11
|
+
function runPm2(args, cwd) {
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
const child = execFile("pm2", args, {
|
|
14
|
+
cwd,
|
|
15
|
+
encoding: "utf8",
|
|
16
|
+
maxBuffer: 8388608
|
|
17
|
+
}, (error, stdout) => {
|
|
18
|
+
if (error) reject(/* @__PURE__ */ new Error(`PM2 command failed (CLI pid ${child.pid ?? "unavailable"}). Install PM2 separately and ensure it is on PATH. ${error.message}`));
|
|
19
|
+
else resolve(stdout);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function stringOption(data, name) {
|
|
24
|
+
const value = data.options[name];
|
|
25
|
+
if (value === void 0) return void 0;
|
|
26
|
+
if (typeof value !== "string" || value.length === 0) throw new Error(`--${name} requires a value.`);
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
async function pm2CommandAction(data) {
|
|
30
|
+
const [action, ...extra] = data.args;
|
|
31
|
+
if (action !== "init" && action !== "reload" || extra.length > 0) throw new Error("Usage: warlock pm2 init | warlock pm2 reload [--id <pm2-id>]");
|
|
32
|
+
const allowed = new Set(action === "init" ? [
|
|
33
|
+
"project",
|
|
34
|
+
"app",
|
|
35
|
+
"cluster",
|
|
36
|
+
"instances",
|
|
37
|
+
"listenTimeout"
|
|
38
|
+
] : [
|
|
39
|
+
"project",
|
|
40
|
+
"app",
|
|
41
|
+
"id"
|
|
42
|
+
]);
|
|
43
|
+
for (const key of Object.keys(data.options)) if (!allowed.has(key)) throw new Error(`Unsupported option for pm2 ${action}: ${key}`);
|
|
44
|
+
if (data.options.cluster !== void 0 && typeof data.options.cluster !== "boolean") throw new Error("--cluster must be a boolean.");
|
|
45
|
+
const root = process.cwd();
|
|
46
|
+
const packageJson = JSON.parse(await readFile(path.join(root, "package.json"), "utf8"));
|
|
47
|
+
const packageName = typeof packageJson === "object" && packageJson !== null && "name" in packageJson && typeof packageJson.name === "string" ? packageJson.name : void 0;
|
|
48
|
+
const project = stringOption(data, "project") ?? packageName;
|
|
49
|
+
if (!project) throw new Error("Set package.json name or pass --project to identify this project.");
|
|
50
|
+
const app = config.get("app") ?? {};
|
|
51
|
+
const appOverride = stringOption(data, "app");
|
|
52
|
+
const build = resolveBuildConfig();
|
|
53
|
+
const input = {
|
|
54
|
+
root,
|
|
55
|
+
project,
|
|
56
|
+
app: appOverride === void 0 ? app : {
|
|
57
|
+
...app,
|
|
58
|
+
appName: appOverride
|
|
59
|
+
},
|
|
60
|
+
environment: process.env.NODE_ENV ?? "development",
|
|
61
|
+
entryPath: build.entryPath,
|
|
62
|
+
sourcemap: build.sourcemap,
|
|
63
|
+
http: config.get("http"),
|
|
64
|
+
socket: config.get("socket")
|
|
65
|
+
};
|
|
66
|
+
if (action === "init") {
|
|
67
|
+
const generated = createPm2Config(input, {
|
|
68
|
+
cluster: data.options.cluster === true,
|
|
69
|
+
instances: stringOption(data, "instances"),
|
|
70
|
+
listenTimeout: stringOption(data, "listenTimeout")
|
|
71
|
+
});
|
|
72
|
+
const target = await writePm2Config(root, generated.content);
|
|
73
|
+
console.log(`Created ${target} for ${generated.app.name}.`);
|
|
74
|
+
console.log(`Readiness URL: ${generated.readinessUrl ?? "unavailable (HTTP/health disabled or ephemeral port)"}`);
|
|
75
|
+
console.log(generated.app.exec_mode === "cluster" ? "Cluster reload replaces workers in sequence; a PM2 readiness timeout can still cause downtime." : "Fork mode uses a restart on reload; use --cluster for rolling HTTP reloads.");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const readiness = await checkDistReadyToStartAsync(build.outdir);
|
|
79
|
+
if (!readiness.ready) throw new Error(readiness.reason);
|
|
80
|
+
const list = JSON.parse(await runPm2(["jlist"], root));
|
|
81
|
+
const targets = selectPm2Targets(list, input, stringOption(data, "id"));
|
|
82
|
+
if (targets.some((target) => !target.cluster)) console.warn("Fork mode reload falls back to restart; expect a brief interruption.");
|
|
83
|
+
for (const target of targets) {
|
|
84
|
+
const output = await runPm2(["reload", String(target.id)], root);
|
|
85
|
+
if (output) process.stdout.write(output);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
export { pm2CommandAction, runPm2 };
|
|
91
|
+
//# sourceMappingURL=pm2-command.action.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pm2-command.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/pm2/pm2-command.action.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { AppConfigurations } from \"../../../application/application-config-types\";\nimport type { CommandActionData } from \"../../../commands/types\";\nimport { config } from \"../../../config/config-getter\";\nimport type { HttpConfigurations } from \"../../../http/types\";\nimport { checkDistReadyToStartAsync } from \"../../../production/assert-dist-ready-to-start\";\nimport { resolveBuildConfig } from \"../../../production/resolve-build-config\";\nimport type { SocketOptions } from \"../../../socket/types\";\nimport { createPm2Config, selectPm2Targets, writePm2Config } from \"./pm2-config\";\n\n/** No shell, no patterns, no import of PM2 or dependency on its daemon for init. */\nexport function runPm2(args: string[], cwd: string): Promise<string> {\n return new Promise((resolve, reject) => {\n const child = execFile(\n \"pm2\",\n args,\n { cwd, encoding: \"utf8\", maxBuffer: 8 * 1024 * 1024 },\n (error, stdout) => {\n if (error) {\n reject(\n new Error(\n `PM2 command failed (CLI pid ${child.pid ?? \"unavailable\"}). Install PM2 separately and ensure it is on PATH. ${error.message}`,\n ),\n );\n } else {\n resolve(stdout);\n }\n },\n );\n // Retain the child and its PID; this function never stops a daemon or any\n // application process. PM2 reload is invoked only with validated ids.\n });\n}\n\nfunction stringOption(data: CommandActionData, name: string): string | undefined {\n const value = data.options[name];\n if (value === undefined) return undefined;\n if (typeof value !== \"string\" || value.length === 0)\n throw new Error(`--${name} requires a value.`);\n return value;\n}\n\nexport async function pm2CommandAction(data: CommandActionData): Promise<void> {\n const [action, ...extra] = data.args;\n if ((action !== \"init\" && action !== \"reload\") || extra.length > 0) {\n throw new Error(\"Usage: warlock pm2 init | warlock pm2 reload [--id <pm2-id>]\");\n }\n const allowed = new Set(\n action === \"init\"\n ? [\"project\", \"app\", \"cluster\", \"instances\", \"listenTimeout\"]\n : [\"project\", \"app\", \"id\"],\n );\n for (const key of Object.keys(data.options)) {\n if (!allowed.has(key)) throw new Error(`Unsupported option for pm2 ${action}: ${key}`);\n }\n if (data.options.cluster !== undefined && typeof data.options.cluster !== \"boolean\") {\n throw new Error(\"--cluster must be a boolean.\");\n }\n\n const root = process.cwd();\n const packageJson: unknown = JSON.parse(await readFile(path.join(root, \"package.json\"), \"utf8\"));\n const packageName =\n typeof packageJson === \"object\" &&\n packageJson !== null &&\n \"name\" in packageJson &&\n typeof packageJson.name === \"string\"\n ? packageJson.name\n : undefined;\n const project = stringOption(data, \"project\") ?? packageName;\n if (!project)\n throw new Error(\"Set package.json name or pass --project to identify this project.\");\n const app = config.get<AppConfigurations | undefined>(\"app\") ?? {};\n const appOverride = stringOption(data, \"app\");\n const build = resolveBuildConfig();\n const input = {\n root,\n project,\n app: appOverride === undefined ? app : { ...app, appName: appOverride },\n environment: process.env.NODE_ENV ?? \"development\",\n entryPath: build.entryPath,\n sourcemap: build.sourcemap,\n http: config.get<HttpConfigurations | undefined>(\"http\"),\n socket: config.get<SocketOptions | undefined>(\"socket\"),\n };\n\n if (action === \"init\") {\n const generated = createPm2Config(input, {\n cluster: data.options.cluster === true,\n instances: stringOption(data, \"instances\"),\n listenTimeout: stringOption(data, \"listenTimeout\"),\n });\n const target = await writePm2Config(root, generated.content);\n console.log(`Created ${target} for ${generated.app.name}.`);\n console.log(\n `Readiness URL: ${generated.readinessUrl ?? \"unavailable (HTTP/health disabled or ephemeral port)\"}`,\n );\n console.log(\n generated.app.exec_mode === \"cluster\"\n ? \"Cluster reload replaces workers in sequence; a PM2 readiness timeout can still cause downtime.\"\n : \"Fork mode uses a restart on reload; use --cluster for rolling HTTP reloads.\",\n );\n return;\n }\n\n const readiness = await checkDistReadyToStartAsync(build.outdir);\n if (!readiness.ready) throw new Error(readiness.reason);\n // jlist is JSON per PM2's API.js. Match exact identity locally, then reload\n // numeric ids only; a name collision never broadens the operation.\n // https://github.com/Unitech/pm2/blob/master/lib/API.js\n const list: unknown = JSON.parse(await runPm2([\"jlist\"], root));\n const targets = selectPm2Targets(list, input, stringOption(data, \"id\"));\n if (targets.some((target) => !target.cluster)) {\n console.warn(\"Fork mode reload falls back to restart; expect a brief interruption.\");\n }\n for (const target of targets) {\n const output = await runPm2([\"reload\", String(target.id)], root);\n if (output) process.stdout.write(output);\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { resolveBindPort } from "../../../http/resolve-bind-port.mjs";
|
|
2
|
+
import { DEFAULT_SHUTDOWN_TIMEOUT } from "../../../connectors/shutdown-timeout.mjs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { writeFile } from "node:fs/promises";
|
|
5
|
+
|
|
6
|
+
//#region ../../packages/core/src/cli/commands/pm2/pm2-config.ts
|
|
7
|
+
/** Refuse selectors PM2 could interpret as patterns, file names or options. */
|
|
8
|
+
function nameComponent(value, label) {
|
|
9
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value)) throw new Error(`${label} must contain only letters, digits, underscores and hyphens, starting with a letter or digit.`);
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
function pm2AppName(input) {
|
|
13
|
+
return [
|
|
14
|
+
nameComponent(input.project.replace(/^@([^/]+)\/([^/]+)$/, "$1-$2"), "Project name (--project)"),
|
|
15
|
+
nameComponent(input.app.appName ?? "app", "App name (--app or app.appName)"),
|
|
16
|
+
nameComponent(input.environment, "NODE_ENV")
|
|
17
|
+
].join("-");
|
|
18
|
+
}
|
|
19
|
+
function positiveInteger(value, label) {
|
|
20
|
+
const number = typeof value === "number" ? value : /^\d+$/.test(value) ? Number(value) : NaN;
|
|
21
|
+
if (!Number.isSafeInteger(number) || number <= 0 || number > 2147483647) throw new Error(`${label} must be a positive integer no greater than 2147483647.`);
|
|
22
|
+
return number;
|
|
23
|
+
}
|
|
24
|
+
function assertClusterSockets(socket) {
|
|
25
|
+
if (!socket) return;
|
|
26
|
+
if (typeof socket.adapter !== "function") throw new Error("PM2 cluster mode with sockets requires socket.adapter for broadcasts between workers. Configure an adapter such as @socket.io/redis-adapter, or use fork mode.");
|
|
27
|
+
if (socket.options?.transports?.length !== 1 || socket.options.transports[0] !== "websocket") throw new Error("PM2 cluster sockets require socket.options.transports: [\"websocket\"] and WebSocket-only clients. Polling needs sticky routing to individual workers; use separate fork listeners behind a sticky proxy for polling.");
|
|
28
|
+
}
|
|
29
|
+
function readinessUrl(http) {
|
|
30
|
+
if (!http || http.health?.enabled === false) return void 0;
|
|
31
|
+
const port = resolveBindPort(http.port);
|
|
32
|
+
if (port === 0) return void 0;
|
|
33
|
+
const bindHost = http.host ?? "localhost";
|
|
34
|
+
const host = bindHost === "0.0.0.0" ? "127.0.0.1" : bindHost === "::" ? "::1" : bindHost;
|
|
35
|
+
const authority = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
36
|
+
const probePath = http.health?.readinessPath ?? "/ready";
|
|
37
|
+
if (!probePath.startsWith("/") || probePath.startsWith("//") || /[\r\n]/.test(probePath)) throw new Error("http.health.readinessPath must be a local absolute URL path.");
|
|
38
|
+
return `${http.serverOptions?.https ? "https" : "http"}://${authority}:${port}${probePath}`;
|
|
39
|
+
}
|
|
40
|
+
function createPm2Config(input, options = {}) {
|
|
41
|
+
const cluster = options.cluster === true;
|
|
42
|
+
if (!cluster && options.instances !== void 0) throw new Error("--instances requires --cluster; fork mode runs exactly one process.");
|
|
43
|
+
if (cluster) assertClusterSockets(input.socket);
|
|
44
|
+
const instances = cluster ? options.instances === "max" ? "max" : positiveInteger(options.instances ?? "2", "--instances") : 1;
|
|
45
|
+
const app = {
|
|
46
|
+
name: pm2AppName(input),
|
|
47
|
+
cwd: path.resolve(input.root),
|
|
48
|
+
script: path.resolve(input.root, input.entryPath),
|
|
49
|
+
interpreter: process.execPath,
|
|
50
|
+
node_args: input.sourcemap === false ? [] : ["--enable-source-maps"],
|
|
51
|
+
exec_mode: cluster ? "cluster" : "fork",
|
|
52
|
+
instances,
|
|
53
|
+
wait_ready: true,
|
|
54
|
+
listen_timeout: positiveInteger(options.listenTimeout ?? "30000", "--listen-timeout"),
|
|
55
|
+
kill_timeout: positiveInteger(input.app.shutdownTimeout ?? 1e4, "app.shutdownTimeout"),
|
|
56
|
+
time: false,
|
|
57
|
+
merge_logs: false,
|
|
58
|
+
env: { NODE_ENV: input.environment }
|
|
59
|
+
};
|
|
60
|
+
const url = readinessUrl(input.http);
|
|
61
|
+
return {
|
|
62
|
+
app,
|
|
63
|
+
content: [
|
|
64
|
+
"// Generated by warlock pm2 init. Rebuild the app before starting PM2.",
|
|
65
|
+
"// PM2 timeouts: https://pm2.keymetrics.io/docs/usage/signals-clean-restart/",
|
|
66
|
+
`// Readiness URL (external probe; PM2 does not poll it): ${JSON.stringify(url ?? "unavailable: HTTP/health disabled or ephemeral port").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029")}`,
|
|
67
|
+
`module.exports = ${JSON.stringify({ apps: [app] }, null, 2)};`,
|
|
68
|
+
""
|
|
69
|
+
].join("\n"),
|
|
70
|
+
readinessUrl: url
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
async function writePm2Config(root, content) {
|
|
74
|
+
const target = path.resolve(root, "ecosystem.config.cjs");
|
|
75
|
+
await writeFile(target, content, {
|
|
76
|
+
encoding: "utf8",
|
|
77
|
+
flag: "wx"
|
|
78
|
+
});
|
|
79
|
+
return target;
|
|
80
|
+
}
|
|
81
|
+
function record(value) {
|
|
82
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
83
|
+
}
|
|
84
|
+
/** Validate the entire target set before issuing any mutating PM2 command. */
|
|
85
|
+
function selectPm2Targets(list, input, id) {
|
|
86
|
+
if (!Array.isArray(list)) throw new Error("PM2 jlist did not return a process array.");
|
|
87
|
+
if (id !== void 0 && (!/^\d+$/.test(id) || !Number.isSafeInteger(Number(id)))) throw new Error("--id must be a numeric PM2 id.");
|
|
88
|
+
const name = pm2AppName(input);
|
|
89
|
+
const targets = [];
|
|
90
|
+
for (const item of list) {
|
|
91
|
+
const process = record(item);
|
|
92
|
+
if (!process) throw new Error("Invalid PM2 process entry.");
|
|
93
|
+
if (id !== void 0 ? process.pm_id !== Number(id) : process.name !== name) continue;
|
|
94
|
+
const env = record(process.pm2_env);
|
|
95
|
+
if (process.name !== name || !env || env.pm_cwd !== path.resolve(input.root) || env.pm_exec_path !== path.resolve(input.root, input.entryPath)) throw new Error(`Refusing to reload PM2 id ${String(process.pm_id)}: name, working directory or bundle does not belong to this app.`);
|
|
96
|
+
if (typeof process.pm_id !== "number" || !Number.isSafeInteger(process.pm_id) || process.pm_id < 0) throw new Error("Invalid PM2 id in process list.");
|
|
97
|
+
if (env.exec_mode !== "fork_mode" && env.exec_mode !== "cluster_mode") throw new Error("Unrecognized PM2 execution mode.");
|
|
98
|
+
const cluster = env.exec_mode === "cluster_mode";
|
|
99
|
+
if (cluster) {
|
|
100
|
+
assertClusterSockets(input.socket);
|
|
101
|
+
if (env.wait_ready !== true || env.status !== "online") throw new Error("Rolling reload requires an online cluster worker with wait_ready: true. Check its PM2 configuration and status.");
|
|
102
|
+
}
|
|
103
|
+
targets.push({
|
|
104
|
+
id: process.pm_id,
|
|
105
|
+
cluster
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (targets.length === 0) throw new Error(`No PM2 process belonging to ${name} was found. Start its ecosystem file first.`);
|
|
109
|
+
if (new Set(targets.map((target) => target.id)).size !== targets.length) throw new Error("Duplicate PM2 ids in process list.");
|
|
110
|
+
return targets;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
export { assertClusterSockets, createPm2Config, pm2AppName, selectPm2Targets, writePm2Config };
|
|
115
|
+
//# sourceMappingURL=pm2-config.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pm2-config.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/pm2/pm2-config.ts"],"sourcesContent":["import path from \"node:path\";\nimport { writeFile } from \"node:fs/promises\";\nimport type { AppConfigurations } from \"../../../application/application-config-types\";\nimport { DEFAULT_SHUTDOWN_TIMEOUT } from \"../../../connectors/shutdown-timeout\";\nimport { resolveBindPort } from \"../../../http/resolve-bind-port\";\nimport type { HttpConfigurations } from \"../../../http/types\";\nimport type { SocketOptions } from \"../../../socket/types\";\nimport type { ResolvedBuildConfig } from \"../../../production/resolve-build-config\";\n\nexport type Pm2AppInput = {\n root: string;\n project: string;\n app: AppConfigurations;\n environment: string;\n entryPath: string;\n sourcemap: ResolvedBuildConfig[\"sourcemap\"];\n http?: HttpConfigurations;\n socket?: SocketOptions;\n};\n\nexport type Pm2InitOptions = {\n cluster?: boolean;\n instances?: string;\n listenTimeout?: string;\n};\n\n/** Refuse selectors PM2 could interpret as patterns, file names or options. */\nfunction nameComponent(value: string, label: string): string {\n if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value)) {\n throw new Error(\n `${label} must contain only letters, digits, underscores and hyphens, starting with a letter or digit.`,\n );\n }\n return value;\n}\n\nexport function pm2AppName(input: Pick<Pm2AppInput, \"project\" | \"app\" | \"environment\">): string {\n // Preserve the npm scope in the project identity instead of dropping it.\n const project = input.project.replace(/^@([^/]+)\\/([^/]+)$/, \"$1-$2\");\n return [\n nameComponent(project, \"Project name (--project)\"),\n nameComponent(input.app.appName ?? \"app\", \"App name (--app or app.appName)\"),\n nameComponent(input.environment, \"NODE_ENV\"),\n ].join(\"-\");\n}\n\nfunction positiveInteger(value: number | string, label: string): number {\n const number = typeof value === \"number\" ? value : /^\\d+$/.test(value) ? Number(value) : NaN;\n if (!Number.isSafeInteger(number) || number <= 0 || number > 2_147_483_647) {\n throw new Error(`${label} must be a positive integer no greater than 2147483647.`);\n }\n return number;\n}\n\nexport function assertClusterSockets(socket?: SocketOptions): void {\n if (!socket) return;\n if (typeof socket.adapter !== \"function\") {\n throw new Error(\n \"PM2 cluster mode with sockets requires socket.adapter for broadcasts between workers. Configure an adapter such as @socket.io/redis-adapter, or use fork mode.\",\n );\n }\n // A proxy sticky to a shared PM2 port is not sticky to its workers. We do\n // not install primary-process routing. Fail closed for long-polling.\n // https://socket.io/docs/v4/using-multiple-nodes/\n if (socket.options?.transports?.length !== 1 || socket.options.transports[0] !== \"websocket\") {\n throw new Error(\n 'PM2 cluster sockets require socket.options.transports: [\"websocket\"] and WebSocket-only clients. Polling needs sticky routing to individual workers; use separate fork listeners behind a sticky proxy for polling.',\n );\n }\n}\n\nfunction readinessUrl(http?: HttpConfigurations): string | undefined {\n if (!http || http.health?.enabled === false) return undefined;\n const port = resolveBindPort(http.port);\n if (port === 0) return undefined;\n const bindHost = http.host ?? \"localhost\";\n const host = bindHost === \"0.0.0.0\" ? \"127.0.0.1\" : bindHost === \"::\" ? \"::1\" : bindHost;\n const authority = host.includes(\":\") && !host.startsWith(\"[\") ? `[${host}]` : host;\n const probePath = http.health?.readinessPath ?? \"/ready\";\n if (!probePath.startsWith(\"/\") || probePath.startsWith(\"//\") || /[\\r\\n]/.test(probePath)) {\n throw new Error(\"http.health.readinessPath must be a local absolute URL path.\");\n }\n return `${http.serverOptions?.https ? \"https\" : \"http\"}://${authority}:${port}${probePath}`;\n}\n\nexport function createPm2Config(input: Pm2AppInput, options: Pm2InitOptions = {}) {\n const cluster = options.cluster === true;\n if (!cluster && options.instances !== undefined) {\n throw new Error(\"--instances requires --cluster; fork mode runs exactly one process.\");\n }\n if (cluster) assertClusterSockets(input.socket);\n const instances = cluster\n ? options.instances === \"max\"\n ? \"max\"\n : positiveInteger(options.instances ?? \"2\", \"--instances\")\n : 1;\n const app = {\n name: pm2AppName(input),\n cwd: path.resolve(input.root),\n // Run the bundle itself, not the `warlock start` child supervisor: PM2\n // must own the process that listens and sends its readiness message.\n script: path.resolve(input.root, input.entryPath),\n interpreter: process.execPath,\n node_args: input.sourcemap === false ? [] : [\"--enable-source-maps\"],\n exec_mode: cluster ? \"cluster\" : \"fork\",\n instances,\n wait_ready: true,\n listen_timeout: positiveInteger(options.listenTimeout ?? \"30000\", \"--listen-timeout\"),\n kill_timeout: positiveInteger(\n input.app.shutdownTimeout ?? DEFAULT_SHUTDOWN_TIMEOUT,\n \"app.shutdownTimeout\",\n ),\n // Keep @warlock.js/logger messages intact; leave per-worker log suffixes.\n time: false,\n merge_logs: false,\n env: { NODE_ENV: input.environment },\n };\n const url = readinessUrl(input.http);\n // JSON encoding keeps project/config strings from becoming executable code\n // or escaping a comment in this CommonJS file.\n const content = [\n \"// Generated by warlock pm2 init. Rebuild the app before starting PM2.\",\n \"// PM2 timeouts: https://pm2.keymetrics.io/docs/usage/signals-clean-restart/\",\n `// Readiness URL (external probe; PM2 does not poll it): ${JSON.stringify(\n url ?? \"unavailable: HTTP/health disabled or ephemeral port\",\n )\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\")}`,\n `module.exports = ${JSON.stringify({ apps: [app] }, null, 2)};`,\n \"\",\n ].join(\"\\n\");\n return { app, content, readinessUrl: url };\n}\n\nexport async function writePm2Config(root: string, content: string): Promise<string> {\n const target = path.resolve(root, \"ecosystem.config.cjs\");\n // Atomic create: an existing/customized ecosystem is never overwritten.\n await writeFile(target, content, { encoding: \"utf8\", flag: \"wx\" });\n return target;\n}\n\nexport type Pm2Target = { id: number; cluster: boolean };\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return typeof value === \"object\" && value !== null && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/** Validate the entire target set before issuing any mutating PM2 command. */\nexport function selectPm2Targets(list: unknown, input: Pm2AppInput, id?: string): Pm2Target[] {\n if (!Array.isArray(list)) throw new Error(\"PM2 jlist did not return a process array.\");\n if (id !== undefined && (!/^\\d+$/.test(id) || !Number.isSafeInteger(Number(id)))) {\n throw new Error(\"--id must be a numeric PM2 id.\");\n }\n const name = pm2AppName(input);\n const targets: Pm2Target[] = [];\n for (const item of list) {\n const process = record(item);\n if (!process) throw new Error(\"Invalid PM2 process entry.\");\n if (id !== undefined ? process.pm_id !== Number(id) : process.name !== name) continue;\n const env = record(process.pm2_env);\n if (\n process.name !== name ||\n !env ||\n env.pm_cwd !== path.resolve(input.root) ||\n env.pm_exec_path !== path.resolve(input.root, input.entryPath)\n ) {\n throw new Error(\n `Refusing to reload PM2 id ${String(process.pm_id)}: name, working directory or bundle does not belong to this app.`,\n );\n }\n if (\n typeof process.pm_id !== \"number\" ||\n !Number.isSafeInteger(process.pm_id) ||\n process.pm_id < 0\n ) {\n throw new Error(\"Invalid PM2 id in process list.\");\n }\n if (env.exec_mode !== \"fork_mode\" && env.exec_mode !== \"cluster_mode\") {\n throw new Error(\"Unrecognized PM2 execution mode.\");\n }\n const cluster = env.exec_mode === \"cluster_mode\";\n if (cluster) {\n assertClusterSockets(input.socket);\n if (env.wait_ready !== true || env.status !== \"online\") {\n throw new Error(\n \"Rolling reload requires an online cluster worker with wait_ready: true. Check its PM2 configuration and status.\",\n );\n }\n }\n targets.push({ id: process.pm_id, cluster });\n }\n if (targets.length === 0)\n throw new Error(\n `No PM2 process belonging to ${name} was found. Start its ecosystem file first.`,\n );\n if (new Set(targets.map((target) => target.id)).size !== targets.length) {\n throw new Error(\"Duplicate PM2 ids in process list.\");\n }\n return targets;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { command } from "../../commands/cli-command.mjs";
|
|
2
|
+
import { pm2CommandAction } from "./pm2/pm2-command.action.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../../packages/core/src/cli/commands/pm2.command.ts
|
|
5
|
+
const pm2Command = command({
|
|
6
|
+
name: "pm2 <action>",
|
|
7
|
+
description: "Optional PM2 tooling: init an ecosystem file or reload only this app",
|
|
8
|
+
preload: {
|
|
9
|
+
warlockConfig: true,
|
|
10
|
+
config: [
|
|
11
|
+
"app",
|
|
12
|
+
"http",
|
|
13
|
+
"socket"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
action: pm2CommandAction,
|
|
17
|
+
options: [
|
|
18
|
+
{
|
|
19
|
+
text: "--project",
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Project name (default: package.json name)"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
text: "--app",
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "App name (default: app.appName or app)"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
text: "--cluster",
|
|
30
|
+
type: "boolean",
|
|
31
|
+
description: "init: use cluster mode (default: fork)"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
text: "--instances",
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "init with --cluster: worker count or max (default: 2)"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
text: "--listen-timeout",
|
|
40
|
+
type: "string",
|
|
41
|
+
description: "init: readiness timeout in ms (default: 30000)"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
text: "--id",
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "reload: one PM2 id, verified to belong to this app"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { pm2Command };
|
|
53
|
+
//# sourceMappingURL=pm2.command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pm2.command.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/cli/commands/pm2.command.ts"],"sourcesContent":["import { command } from \"../../commands/cli-command\";\nimport { pm2CommandAction } from \"./pm2/pm2-command.action\";\n\nexport const pm2Command = command({\n name: \"pm2 <action>\",\n description: \"Optional PM2 tooling: init an ecosystem file or reload only this app\",\n // Read config without running bootstrap, prestart or any connector.\n preload: { warlockConfig: true, config: [\"app\", \"http\", \"socket\"] },\n action: pm2CommandAction,\n options: [\n { text: \"--project\", type: \"string\", description: \"Project name (default: package.json name)\" },\n { text: \"--app\", type: \"string\", description: \"App name (default: app.appName or app)\" },\n { text: \"--cluster\", type: \"boolean\", description: \"init: use cluster mode (default: fork)\" },\n {\n text: \"--instances\",\n type: \"string\",\n description: \"init with --cluster: worker count or max (default: 2)\",\n },\n {\n text: \"--listen-timeout\",\n type: \"string\",\n description: \"init: readiness timeout in ms (default: 30000)\",\n },\n {\n text: \"--id\",\n type: \"string\",\n description: \"reload: one PM2 id, verified to belong to this app\",\n },\n ],\n});\n"],"mappings":";;;;AAGA,MAAa,aAAa,QAAQ;CAChC,MAAM;CACN,aAAa;CAEb,SAAS;EAAE,eAAe;EAAM,QAAQ;GAAC;GAAO;GAAQ;EAAQ;CAAE;CAClE,QAAQ;CACR,SAAS;EACP;GAAE,MAAM;GAAa,MAAM;GAAU,aAAa;EAA4C;EAC9F;GAAE,MAAM;GAAS,MAAM;GAAU,aAAa;EAAyC;EACvF;GAAE,MAAM;GAAa,MAAM;GAAW,aAAa;EAAyC;EAC5F;GACE,MAAM;GACN,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,MAAM;GACN,aAAa;EACf;CACF;AACF,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { bootForDiagnostics } from "../doctor/boot-for-diagnostics.mjs";
|
|
|
3
3
|
import { resolveBuildConfig } from "../../../production/resolve-build-config.mjs";
|
|
4
4
|
import { comparePageRoutes, diffPageRoutes } from "./diff-page-routes.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import
|
|
6
|
+
import fsSync from "node:fs";
|
|
7
7
|
|
|
8
8
|
//#region ../../packages/core/src/cli/commands/routes/routes-diff.action.ts
|
|
9
9
|
const SNAPSHOT_FILE = "page-routes.manifest.json";
|
|
@@ -26,7 +26,7 @@ function snapshotPath() {
|
|
|
26
26
|
function readSnapshot(file) {
|
|
27
27
|
let raw;
|
|
28
28
|
try {
|
|
29
|
-
raw =
|
|
29
|
+
raw = fsSync.readFileSync(file, "utf-8");
|
|
30
30
|
} catch {
|
|
31
31
|
throw new Error(`Cannot compare page routes: no build snapshot exists at "${file}". Run \`warlock build\` successfully, then run \`warlock routes:diff\` again.`);
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-diff.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/routes/routes-diff.action.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { resolveBuildConfig } from \"../../../production/resolve-build-config\";\nimport { router } from \"../../../router/router\";\nimport type { Route } from \"../../../router/types\";\nimport { bootForDiagnostics } from \"../doctor/boot-for-diagnostics\";\nimport { comparePageRoutes, diffPageRoutes, type PageRoute } from \"./diff-page-routes\";\n\ntype PageRoutesSnapshot = {\n version: 1;\n routes: PageRoute[];\n};\n\nconst SNAPSHOT_FILE = \"page-routes.manifest.json\";\n\n/**\n * What a clean `warlock routes:diff` does and does NOT prove, printed on a\n * clean run so the guarantee is stated where it is relied on.\n */\nconst CLEAN_RUN_LIMIT =\n \"Note: page names are compared as DERIVED by the build, so a clean diff does not prove \" +\n \"that no route name collided at registration (the router appends `.<method>` to a name \" +\n \"already claimed by another method). Run `warlock routes` to see the registered names.\";\n\nfunction routeFromLive(route: Route): PageRoute {\n return {\n method: route.method.toUpperCase() as \"GET\",\n path: route.path,\n name: route.name ?? \"\",\n source: route.sourceFile ?? \"\",\n };\n}\n\nfunction snapshotPath(): string {\n return path.join(resolveBuildConfig().outdir, SNAPSHOT_FILE);\n}\n\nfunction readSnapshot(file: string): PageRoutesSnapshot {\n let raw: string;\n\n try {\n raw = fs.readFileSync(file, \"utf-8\");\n } catch {\n throw new Error(\n `Cannot compare page routes: no build snapshot exists at \"${file}\". Run \\`warlock build\\` successfully, then run \\`warlock routes:diff\\` again.`,\n );\n }\n\n try {\n const parsed: unknown = JSON.parse(raw);\n\n if (\n typeof parsed !== \"object\" ||\n parsed === null ||\n (parsed as { version?: unknown }).version !== 1 ||\n !Array.isArray((parsed as { routes?: unknown }).routes) ||\n !(parsed as { routes: unknown[] }).routes.every(\n (route) =>\n typeof route === \"object\" &&\n route !== null &&\n (route as PageRoute).method === \"GET\" &&\n typeof (route as PageRoute).path === \"string\" &&\n typeof (route as PageRoute).name === \"string\" &&\n typeof (route as PageRoute).source === \"string\",\n )\n ) {\n throw new Error(\"invalid shape\");\n }\n\n return parsed as PageRoutesSnapshot;\n } catch {\n throw new Error(\n `Cannot compare page routes: build snapshot \"${file}\" is malformed. Run \\`warlock build\\` successfully to replace it, then retry.`,\n );\n }\n}\n\nfunction printRoute(prefix: string, route: PageRoute): void {\n const source = route.source ? ` (${route.source})` : \"\";\n console.log(`${prefix} GET ${route.path} ${route.name}${source}`);\n}\n\n/**\n * Compare the last successful production page surface with the live dev\n * surface.\n *\n * The comparison itself lives in `diff-page-routes.ts`, which also documents\n * why the route-name method suffix is the one registration-time difference the\n * build-time manifest cannot record — and therefore what a clean run of this\n * command does not prove.\n */\nexport async function routesDiffCommandAction(): Promise<void> {\n const snapshot = readSnapshot(snapshotPath());\n const context = await bootForDiagnostics();\n\n if (\n !context.booted ||\n context.moduleFailures.length > 0 ||\n context.connectors.failures.length > 0 ||\n context.connectors.registrationError !== undefined\n ) {\n const details = [\n ...context.moduleFailures.map(({ file, message }) => `${file}: ${message}`),\n ...context.connectors.failures.map(({ name, message }) => `${name}: ${message}`),\n ...(context.connectors.registrationError ? [context.connectors.registrationError] : []),\n ];\n throw new Error(\n `Cannot compare page routes because diagnostic boot failed.${details.length ? `\\n${details.join(\"\\n\")}` : \"\"}`,\n );\n }\n\n const live = router\n .list()\n .filter((route) => route.isPage)\n .map(routeFromLive)\n .sort(comparePageRoutes);\n const expected = [...snapshot.routes].sort(comparePageRoutes);\n const { changes, removed, added } = diffPageRoutes(expected, live);\n\n if (changes.length === 0 && removed.length === 0 && added.length === 0) {\n console.log(`Page routes match (${expected.length} routes).`);\n console.log(CLEAN_RUN_LIMIT);\n return;\n }\n\n for (const { before, after } of changes) {\n printRoute(\"changed -\", before);\n printRoute(\" +\", after);\n }\n for (const route of removed) printRoute(\"removed -\", route);\n for (const route of added) printRoute(\"added +\", route);\n\n throw new Error(\n `Page route drift: ${changes.length} changed, ${removed.length} removed, ${added.length} added. Run \\`warlock build\\` after reviewing these changes.`,\n );\n}\n"],"mappings":";;;;;;;;AAaA,MAAM,gBAAgB;;;;;AAMtB,MAAM,kBACJ;AAIF,SAAS,cAAc,OAAyB;CAC9C,OAAO;EACL,QAAQ,MAAM,OAAO,YAAY;EACjC,MAAM,MAAM;EACZ,MAAM,MAAM,QAAQ;EACpB,QAAQ,MAAM,cAAc;CAC9B;AACF;AAEA,SAAS,eAAuB;CAC9B,OAAO,KAAK,KAAK,mBAAmB,CAAC,CAAC,QAAQ,aAAa;AAC7D;AAEA,SAAS,aAAa,MAAkC;CACtD,IAAI;CAEJ,IAAI;EACF,
|
|
1
|
+
{"version":3,"file":"routes-diff.action.mjs","names":["fs"],"sources":["../../../../../../../../../../packages/core/src/cli/commands/routes/routes-diff.action.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { resolveBuildConfig } from \"../../../production/resolve-build-config\";\nimport { router } from \"../../../router/router\";\nimport type { Route } from \"../../../router/types\";\nimport { bootForDiagnostics } from \"../doctor/boot-for-diagnostics\";\nimport { comparePageRoutes, diffPageRoutes, type PageRoute } from \"./diff-page-routes\";\n\ntype PageRoutesSnapshot = {\n version: 1;\n routes: PageRoute[];\n};\n\nconst SNAPSHOT_FILE = \"page-routes.manifest.json\";\n\n/**\n * What a clean `warlock routes:diff` does and does NOT prove, printed on a\n * clean run so the guarantee is stated where it is relied on.\n */\nconst CLEAN_RUN_LIMIT =\n \"Note: page names are compared as DERIVED by the build, so a clean diff does not prove \" +\n \"that no route name collided at registration (the router appends `.<method>` to a name \" +\n \"already claimed by another method). Run `warlock routes` to see the registered names.\";\n\nfunction routeFromLive(route: Route): PageRoute {\n return {\n method: route.method.toUpperCase() as \"GET\",\n path: route.path,\n name: route.name ?? \"\",\n source: route.sourceFile ?? \"\",\n };\n}\n\nfunction snapshotPath(): string {\n return path.join(resolveBuildConfig().outdir, SNAPSHOT_FILE);\n}\n\nfunction readSnapshot(file: string): PageRoutesSnapshot {\n let raw: string;\n\n try {\n raw = fs.readFileSync(file, \"utf-8\");\n } catch {\n throw new Error(\n `Cannot compare page routes: no build snapshot exists at \"${file}\". Run \\`warlock build\\` successfully, then run \\`warlock routes:diff\\` again.`,\n );\n }\n\n try {\n const parsed: unknown = JSON.parse(raw);\n\n if (\n typeof parsed !== \"object\" ||\n parsed === null ||\n (parsed as { version?: unknown }).version !== 1 ||\n !Array.isArray((parsed as { routes?: unknown }).routes) ||\n !(parsed as { routes: unknown[] }).routes.every(\n (route) =>\n typeof route === \"object\" &&\n route !== null &&\n (route as PageRoute).method === \"GET\" &&\n typeof (route as PageRoute).path === \"string\" &&\n typeof (route as PageRoute).name === \"string\" &&\n typeof (route as PageRoute).source === \"string\",\n )\n ) {\n throw new Error(\"invalid shape\");\n }\n\n return parsed as PageRoutesSnapshot;\n } catch {\n throw new Error(\n `Cannot compare page routes: build snapshot \"${file}\" is malformed. Run \\`warlock build\\` successfully to replace it, then retry.`,\n );\n }\n}\n\nfunction printRoute(prefix: string, route: PageRoute): void {\n const source = route.source ? ` (${route.source})` : \"\";\n console.log(`${prefix} GET ${route.path} ${route.name}${source}`);\n}\n\n/**\n * Compare the last successful production page surface with the live dev\n * surface.\n *\n * The comparison itself lives in `diff-page-routes.ts`, which also documents\n * why the route-name method suffix is the one registration-time difference the\n * build-time manifest cannot record — and therefore what a clean run of this\n * command does not prove.\n */\nexport async function routesDiffCommandAction(): Promise<void> {\n const snapshot = readSnapshot(snapshotPath());\n const context = await bootForDiagnostics();\n\n if (\n !context.booted ||\n context.moduleFailures.length > 0 ||\n context.connectors.failures.length > 0 ||\n context.connectors.registrationError !== undefined\n ) {\n const details = [\n ...context.moduleFailures.map(({ file, message }) => `${file}: ${message}`),\n ...context.connectors.failures.map(({ name, message }) => `${name}: ${message}`),\n ...(context.connectors.registrationError ? [context.connectors.registrationError] : []),\n ];\n throw new Error(\n `Cannot compare page routes because diagnostic boot failed.${details.length ? `\\n${details.join(\"\\n\")}` : \"\"}`,\n );\n }\n\n const live = router\n .list()\n .filter((route) => route.isPage)\n .map(routeFromLive)\n .sort(comparePageRoutes);\n const expected = [...snapshot.routes].sort(comparePageRoutes);\n const { changes, removed, added } = diffPageRoutes(expected, live);\n\n if (changes.length === 0 && removed.length === 0 && added.length === 0) {\n console.log(`Page routes match (${expected.length} routes).`);\n console.log(CLEAN_RUN_LIMIT);\n return;\n }\n\n for (const { before, after } of changes) {\n printRoute(\"changed -\", before);\n printRoute(\" +\", after);\n }\n for (const route of removed) printRoute(\"removed -\", route);\n for (const route of added) printRoute(\"added +\", route);\n\n throw new Error(\n `Page route drift: ${changes.length} changed, ${removed.length} removed, ${added.length} added. Run \\`warlock build\\` after reviewing these changes.`,\n );\n}\n"],"mappings":";;;;;;;;AAaA,MAAM,gBAAgB;;;;;AAMtB,MAAM,kBACJ;AAIF,SAAS,cAAc,OAAyB;CAC9C,OAAO;EACL,QAAQ,MAAM,OAAO,YAAY;EACjC,MAAM,MAAM;EACZ,MAAM,MAAM,QAAQ;EACpB,QAAQ,MAAM,cAAc;CAC9B;AACF;AAEA,SAAS,eAAuB;CAC9B,OAAO,KAAK,KAAK,mBAAmB,CAAC,CAAC,QAAQ,aAAa;AAC7D;AAEA,SAAS,aAAa,MAAkC;CACtD,IAAI;CAEJ,IAAI;EACF,MAAMA,OAAG,aAAa,MAAM,OAAO;CACrC,QAAQ;EACN,MAAM,IAAI,MACR,4DAA4D,KAAK,+EACnE;CACF;CAEA,IAAI;EACF,MAAM,SAAkB,KAAK,MAAM,GAAG;EAEtC,IACE,OAAO,WAAW,YAClB,WAAW,QACV,OAAiC,YAAY,KAC9C,CAAC,MAAM,QAAS,OAAgC,MAAM,KACtD,CAAE,OAAiC,OAAO,OACvC,UACC,OAAO,UAAU,YACjB,UAAU,QACT,MAAoB,WAAW,SAChC,OAAQ,MAAoB,SAAS,YACrC,OAAQ,MAAoB,SAAS,YACrC,OAAQ,MAAoB,WAAW,QAC3C,GAEA,MAAM,IAAI,MAAM,eAAe;EAGjC,OAAO;CACT,QAAQ;EACN,MAAM,IAAI,MACR,+CAA+C,KAAK,8EACtD;CACF;AACF;AAEA,SAAS,WAAW,QAAgB,OAAwB;CAC1D,MAAM,SAAS,MAAM,SAAS,KAAK,MAAM,OAAO,KAAK;CACrD,QAAQ,IAAI,GAAG,OAAO,OAAO,MAAM,KAAK,IAAI,MAAM,OAAO,QAAQ;AACnE;;;;;;;;;;AAWA,eAAsB,0BAAyC;CAC7D,MAAM,WAAW,aAAa,aAAa,CAAC;CAC5C,MAAM,UAAU,MAAM,mBAAmB;CAEzC,IACE,CAAC,QAAQ,UACT,QAAQ,eAAe,SAAS,KAChC,QAAQ,WAAW,SAAS,SAAS,KACrC,QAAQ,WAAW,sBAAsB,QACzC;EACA,MAAM,UAAU;GACd,GAAG,QAAQ,eAAe,KAAK,EAAE,MAAM,cAAc,GAAG,KAAK,IAAI,SAAS;GAC1E,GAAG,QAAQ,WAAW,SAAS,KAAK,EAAE,MAAM,cAAc,GAAG,KAAK,IAAI,SAAS;GAC/E,GAAI,QAAQ,WAAW,oBAAoB,CAAC,QAAQ,WAAW,iBAAiB,IAAI,CAAC;EACvF;EACA,MAAM,IAAI,MACR,6DAA6D,QAAQ,SAAS,KAAK,QAAQ,KAAK,IAAI,MAAM,IAC5G;CACF;CAEA,MAAM,OAAO,OACV,KAAK,CAAC,CACN,QAAQ,UAAU,MAAM,MAAM,CAAC,CAC/B,IAAI,aAAa,CAAC,CAClB,KAAK,iBAAiB;CACzB,MAAM,WAAW,CAAC,GAAG,SAAS,MAAM,CAAC,CAAC,KAAK,iBAAiB;CAC5D,MAAM,EAAE,SAAS,SAAS,UAAU,eAAe,UAAU,IAAI;CAEjE,IAAI,QAAQ,WAAW,KAAK,QAAQ,WAAW,KAAK,MAAM,WAAW,GAAG;EACtE,QAAQ,IAAI,sBAAsB,SAAS,OAAO,UAAU;EAC5D,QAAQ,IAAI,eAAe;EAC3B;CACF;CAEA,KAAK,MAAM,EAAE,QAAQ,WAAW,SAAS;EACvC,WAAW,aAAa,MAAM;EAC9B,WAAW,aAAa,KAAK;CAC/B;CACA,KAAK,MAAM,SAAS,SAAS,WAAW,aAAa,KAAK;CAC1D,KAAK,MAAM,SAAS,OAAO,WAAW,aAAa,KAAK;CAExD,MAAM,IAAI,MACR,qBAAqB,QAAQ,OAAO,YAAY,QAAQ,OAAO,YAAY,MAAM,OAAO,6DAC1F;AACF"}
|
|
@@ -141,5 +141,5 @@ async function traceCommandAction({ args, options }) {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
//#endregion
|
|
144
|
-
export { traceCommandAction };
|
|
144
|
+
export { collectHeaderValues, formatTraceSummary, parseHeaderValues, parseTraceBody, traceCommandAction, traceFailureExitCode };
|
|
145
145
|
//# sourceMappingURL=trace-command.action.mjs.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { aiCommand } from "./commands/ai.command.mjs";
|
|
1
2
|
import { addCommand } from "./commands/add.command.mjs";
|
|
2
3
|
import { agentsMdCommand } from "./commands/agents-md.command.mjs";
|
|
3
4
|
import { boardCommand } from "./commands/board.command.mjs";
|
|
@@ -10,10 +11,12 @@ import { dropTablesCommand } from "./commands/drop-tables.command.mjs";
|
|
|
10
11
|
import { explainCommand } from "./commands/explain.command.mjs";
|
|
11
12
|
import { generateCommand, generateControllerCommand, generateEndpointCommand, generateMigrationCommand, generateModelCommand, generateModuleCommand, generateRepositoryCommand, generateResourceCommand, generateServiceCommand, generateUseCaseCommand, makeCommand } from "./commands/generate/generate.command.mjs";
|
|
12
13
|
import { inspectCommand } from "./commands/inspect.command.mjs";
|
|
14
|
+
import { issueCommand } from "./commands/issue.command.mjs";
|
|
13
15
|
import { mcpCommand } from "./commands/mcp.command.mjs";
|
|
14
16
|
import { migrateCommand } from "./commands/migrate.command.mjs";
|
|
15
17
|
import { openApiGeneratorCommand } from "./commands/openapi-generator.command.mjs";
|
|
16
18
|
import { postmanGeneratorCommand } from "./commands/postman-generator.command.mjs";
|
|
19
|
+
import { pm2Command } from "./commands/pm2.command.mjs";
|
|
17
20
|
import { routesCommand, routesDiffCommand } from "./commands/routes.command.mjs";
|
|
18
21
|
import { seedCommand } from "./commands/seed.command.mjs";
|
|
19
22
|
import { startProductionCommand } from "./commands/start-production.command.mjs";
|
|
@@ -32,11 +35,13 @@ const frameworkCommands = [
|
|
|
32
35
|
openApiGeneratorCommand,
|
|
33
36
|
postmanGeneratorCommand,
|
|
34
37
|
testCommand,
|
|
38
|
+
aiCommand,
|
|
35
39
|
doctorCommand,
|
|
36
40
|
routesCommand,
|
|
37
41
|
routesDiffCommand,
|
|
38
42
|
inspectCommand,
|
|
39
43
|
explainCommand,
|
|
44
|
+
issueCommand,
|
|
40
45
|
checkCommand,
|
|
41
46
|
typecheckCommand,
|
|
42
47
|
mcpCommand,
|
|
@@ -45,6 +50,7 @@ const frameworkCommands = [
|
|
|
45
50
|
boardCommand,
|
|
46
51
|
buildCommand,
|
|
47
52
|
startProductionCommand,
|
|
53
|
+
pm2Command,
|
|
48
54
|
migrateCommand,
|
|
49
55
|
seedCommand,
|
|
50
56
|
createDatabaseCommand,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-cli-commands.mjs","names":[],"sources":["../../../../../../../../packages/core/src/cli/framework-cli-commands.ts"],"sourcesContent":["import { addCommand } from \"./commands/add.command\";\nimport { agentsMdCommand } from \"./commands/agents-md.command\";\nimport { boardCommand } from \"./commands/board.command\";\nimport { buildCommand } from \"./commands/build.command\";\nimport { checkCommand } from \"./commands/check.command\";\nimport { createDatabaseCommand } from \"./commands/create-database.command\";\nimport { devServerCommand } from \"./commands/dev-server.command\";\nimport { doctorCommand } from \"./commands/doctor.command\";\nimport { dropTablesCommand } from \"./commands/drop-tables.command\";\nimport { explainCommand } from \"./commands/explain.command\";\nimport {\n generateCommand,\n generateControllerCommand,\n generateEndpointCommand,\n generateMigrationCommand,\n generateModelCommand,\n generateModuleCommand,\n generateRepositoryCommand,\n generateResourceCommand,\n generateServiceCommand,\n generateUseCaseCommand,\n makeCommand,\n} from \"./commands/generate/generate.command\";\nimport { inspectCommand } from \"./commands/inspect.command\";\nimport { mcpCommand } from \"./commands/mcp.command\";\nimport { migrateCommand } from \"./commands/migrate.command\";\nimport { openApiGeneratorCommand } from \"./commands/openapi-generator.command\";\nimport { postmanGeneratorCommand } from \"./commands/postman-generator.command\";\nimport { routesCommand, routesDiffCommand } from \"./commands/routes.command\";\nimport { seedCommand } from \"./commands/seed.command\";\nimport { startProductionCommand } from \"./commands/start-production.command\";\nimport { traceCommand } from \"./commands/trace.command\";\nimport { storagePutCommand } from \"./commands/storage-put.command\";\nimport { typecheckCommand } from \"./commands/typecheck.command\";\nimport { testCommand } from \"./commands/test.command\";\nimport { typingsGeneratorCommand } from \"./commands/typings-generator.command\";\nimport { updateCommand } from \"./commands/update.command\";\nimport { upgradeCommand } from \"./commands/upgrade.command\";\n\nexport const frameworkCommands = [\n // development commands\n devServerCommand,\n typingsGeneratorCommand,\n openApiGeneratorCommand,\n postmanGeneratorCommand,\n\n // testing commands\n testCommand,\n\n // diagnostics commands\n doctorCommand,\n routesCommand,\n routesDiffCommand,\n inspectCommand,\n explainCommand,\n checkCommand,\n typecheckCommand,\n\n // agent tooling commands\n mcpCommand,\n traceCommand,\n agentsMdCommand,\n boardCommand,\n\n // production commands\n buildCommand,\n startProductionCommand,\n\n // database commands\n migrateCommand,\n seedCommand,\n createDatabaseCommand,\n dropTablesCommand,\n\n // generation/installation commands\n addCommand,\n updateCommand,\n upgradeCommand,\n\n // scaffolding commands\n generateCommand,\n makeCommand,\n generateEndpointCommand,\n generateModuleCommand,\n generateControllerCommand,\n generateServiceCommand,\n generateUseCaseCommand,\n generateModelCommand,\n generateRepositoryCommand,\n generateResourceCommand,\n generateMigrationCommand,\n\n // storage commands\n storagePutCommand,\n];\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"framework-cli-commands.mjs","names":[],"sources":["../../../../../../../../packages/core/src/cli/framework-cli-commands.ts"],"sourcesContent":["import { aiCommand } from \"./commands/ai.command\";\nimport { addCommand } from \"./commands/add.command\";\nimport { agentsMdCommand } from \"./commands/agents-md.command\";\nimport { boardCommand } from \"./commands/board.command\";\nimport { buildCommand } from \"./commands/build.command\";\nimport { checkCommand } from \"./commands/check.command\";\nimport { createDatabaseCommand } from \"./commands/create-database.command\";\nimport { devServerCommand } from \"./commands/dev-server.command\";\nimport { doctorCommand } from \"./commands/doctor.command\";\nimport { dropTablesCommand } from \"./commands/drop-tables.command\";\nimport { explainCommand } from \"./commands/explain.command\";\nimport {\n generateCommand,\n generateControllerCommand,\n generateEndpointCommand,\n generateMigrationCommand,\n generateModelCommand,\n generateModuleCommand,\n generateRepositoryCommand,\n generateResourceCommand,\n generateServiceCommand,\n generateUseCaseCommand,\n makeCommand,\n} from \"./commands/generate/generate.command\";\nimport { inspectCommand } from \"./commands/inspect.command\";\nimport { issueCommand } from \"./commands/issue.command\";\nimport { mcpCommand } from \"./commands/mcp.command\";\nimport { migrateCommand } from \"./commands/migrate.command\";\nimport { openApiGeneratorCommand } from \"./commands/openapi-generator.command\";\nimport { postmanGeneratorCommand } from \"./commands/postman-generator.command\";\nimport { pm2Command } from \"./commands/pm2.command\";\nimport { routesCommand, routesDiffCommand } from \"./commands/routes.command\";\nimport { seedCommand } from \"./commands/seed.command\";\nimport { startProductionCommand } from \"./commands/start-production.command\";\nimport { traceCommand } from \"./commands/trace.command\";\nimport { storagePutCommand } from \"./commands/storage-put.command\";\nimport { typecheckCommand } from \"./commands/typecheck.command\";\nimport { testCommand } from \"./commands/test.command\";\nimport { typingsGeneratorCommand } from \"./commands/typings-generator.command\";\nimport { updateCommand } from \"./commands/update.command\";\nimport { upgradeCommand } from \"./commands/upgrade.command\";\n\nexport const frameworkCommands = [\n // development commands\n devServerCommand,\n typingsGeneratorCommand,\n openApiGeneratorCommand,\n postmanGeneratorCommand,\n\n // testing commands\n testCommand,\n\n // diagnostics commands\n aiCommand,\n doctorCommand,\n routesCommand,\n routesDiffCommand,\n inspectCommand,\n explainCommand,\n issueCommand,\n checkCommand,\n typecheckCommand,\n\n // agent tooling commands\n mcpCommand,\n traceCommand,\n agentsMdCommand,\n boardCommand,\n\n // production commands\n buildCommand,\n startProductionCommand,\n pm2Command,\n\n // database commands\n migrateCommand,\n seedCommand,\n createDatabaseCommand,\n dropTablesCommand,\n\n // generation/installation commands\n addCommand,\n updateCommand,\n upgradeCommand,\n\n // scaffolding commands\n generateCommand,\n makeCommand,\n generateEndpointCommand,\n generateModuleCommand,\n generateControllerCommand,\n generateServiceCommand,\n generateUseCaseCommand,\n generateModelCommand,\n generateRepositoryCommand,\n generateResourceCommand,\n generateMigrationCommand,\n\n // storage commands\n storagePutCommand,\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,oBAAoB;CAE/B;CACA;CACA;CACA;CAGA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;AACF"}
|
|
@@ -18,12 +18,12 @@ var CliOptionValueError = class extends Error {
|
|
|
18
18
|
this.name = "CliOptionValueError";
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
const TRUE_VALUES = new Set([
|
|
21
|
+
const TRUE_VALUES = /* @__PURE__ */ new Set([
|
|
22
22
|
"true",
|
|
23
23
|
"1",
|
|
24
24
|
"yes"
|
|
25
25
|
]);
|
|
26
|
-
const FALSE_VALUES = new Set([
|
|
26
|
+
const FALSE_VALUES = /* @__PURE__ */ new Set([
|
|
27
27
|
"false",
|
|
28
28
|
"0",
|
|
29
29
|
"no"
|