@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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BenchmarkErrorResult, BenchmarkOptions, BenchmarkSuccessResult } from "./types.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/benchmark/benchmark.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Measure the execution time of a function and classify its performance.
|
|
@@ -23,7 +22,6 @@ import { BenchmarkErrorResult, BenchmarkOptions, BenchmarkSuccessResult } from "
|
|
|
23
22
|
* }
|
|
24
23
|
* ```
|
|
25
24
|
*/
|
|
26
|
-
declare function measure<T>(name: string, fn: () => T | Promise<T>, options?: BenchmarkOptions<T>): Promise<BenchmarkSuccessResult<T> | BenchmarkErrorResult>;
|
|
25
|
+
export declare function measure<T>(name: string, fn: () => T | Promise<T>, options?: BenchmarkOptions<T>): Promise<BenchmarkSuccessResult<T> | BenchmarkErrorResult>;
|
|
27
26
|
//#endregion
|
|
28
|
-
export { measure };
|
|
29
27
|
//# sourceMappingURL=benchmark.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/benchmark/benchmark.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"benchmark.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/benchmark/benchmark.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;wBA+CsB,QAAQ,GAC5B,cACA,UAAU,IAAI,QAAQ,IACtB,UAAU,iBAAiB,KAC1B,QAAQ,uBAAuB,KAAK"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BenchmarkChannel, BenchmarkStats } from "../types.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/benchmark/channels/console.channel.d.ts
|
|
4
|
-
declare class ConsoleChannel implements BenchmarkChannel {
|
|
3
|
+
export declare class ConsoleChannel implements BenchmarkChannel {
|
|
5
4
|
/**
|
|
6
5
|
* Pretty-prints a stats table per operation on onFlush().
|
|
7
6
|
*
|
|
@@ -14,5 +13,4 @@ declare class ConsoleChannel implements BenchmarkChannel {
|
|
|
14
13
|
onFlush(stats: Record<string, BenchmarkStats>): void;
|
|
15
14
|
}
|
|
16
15
|
//#endregion
|
|
17
|
-
export { ConsoleChannel };
|
|
18
16
|
//# sourceMappingURL=console.channel.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.channel.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/benchmark/channels/console.channel.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"console.channel.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/benchmark/channels/console.channel.ts"],"mappings":";;qBAEa,0BAA0B;;;;;;;;;;EAU9B,QAAQ,OAAO,eAAe"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { BenchmarkChannel } from "../types.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/benchmark/channels/noop.channel.d.ts
|
|
4
|
-
declare class NoopChannel implements BenchmarkChannel {
|
|
3
|
+
export declare class NoopChannel implements BenchmarkChannel {
|
|
5
4
|
onFlush(): void;
|
|
6
5
|
}
|
|
7
6
|
//#endregion
|
|
8
|
-
export { NoopChannel };
|
|
9
7
|
//# sourceMappingURL=noop.channel.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noop.channel.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/benchmark/channels/noop.channel.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"noop.channel.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/benchmark/channels/noop.channel.ts"],"mappings":";;qBAEa,uBAAuB;EAC3B"}
|
package/esm/benchmark/index.mjs
CHANGED
|
@@ -4,4 +4,4 @@ import { ConsoleChannel } from "./channels/console.channel.mjs";
|
|
|
4
4
|
import { NoopChannel } from "./channels/noop.channel.mjs";
|
|
5
5
|
import { BenchmarkProfiler } from "./profiler.mjs";
|
|
6
6
|
|
|
7
|
-
export {
|
|
7
|
+
export { BenchmarkProfiler, BenchmarkSnapshots, ConsoleChannel, NoopChannel, measure };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BenchmarkErrorResult, BenchmarkProfilerOptions, BenchmarkStats, BenchmarkSuccessResult } from "./types.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/benchmark/profiler.d.ts
|
|
4
|
-
declare class BenchmarkProfiler {
|
|
3
|
+
export declare class BenchmarkProfiler {
|
|
5
4
|
private readonly maxSamples;
|
|
6
5
|
private readonly channels;
|
|
7
6
|
private readonly entries;
|
|
@@ -63,5 +62,4 @@ declare class BenchmarkProfiler {
|
|
|
63
62
|
dispose(): void;
|
|
64
63
|
}
|
|
65
64
|
//#endregion
|
|
66
|
-
export { BenchmarkProfiler };
|
|
67
65
|
//# sourceMappingURL=profiler.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiler.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/benchmark/profiler.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"profiler.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/benchmark/profiler.ts"],"mappings":";;qBAkBa;mBACM;mBACA;mBACA;UACT;EAER,YAAmB,UAAU;;;;;;;;;EAyBtB,OAAO,QAAQ,kCAAkC;;;;;;;;;;;EA6CjD,MAAM,eAAe;;;;;;;;;EAsCrB,YAAY,eAAe;;;;;;;EAiBrB,SAAS;;;;;;;;;;;EAmBf,MAAM;;;;;;;EAqBN"}
|
|
@@ -63,7 +63,8 @@ var BenchmarkProfiler = class {
|
|
|
63
63
|
const count = latencies.length;
|
|
64
64
|
if (count === 0) return void 0;
|
|
65
65
|
const getP = (percentile) => {
|
|
66
|
-
|
|
66
|
+
const index = Math.min(count - 1, Math.floor(count * percentile));
|
|
67
|
+
return latencies[index] ?? 0;
|
|
67
68
|
};
|
|
68
69
|
return {
|
|
69
70
|
p50: getP(.5),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiler.mjs","names":[],"sources":["../../../../../../../../packages/core/src/benchmark/profiler.ts"],"sourcesContent":["import { NoopChannel } from \"./channels/noop.channel\";\nimport type {\n BenchmarkChannel,\n BenchmarkErrorResult,\n BenchmarkProfilerOptions,\n BenchmarkStats,\n BenchmarkSuccessResult,\n} from \"./types\";\n\ntype BenchmarkEntry = {\n latencies: number[];\n sum: number;\n total: number;\n errors: number;\n firstSeenAt: Date;\n lastSeenAt: Date;\n};\n\nexport class BenchmarkProfiler {\n private readonly maxSamples: number;\n private readonly channels: BenchmarkChannel[];\n private readonly entries = new Map<string, BenchmarkEntry>();\n private interval?: ReturnType<typeof setInterval>;\n\n public constructor(options?: BenchmarkProfilerOptions) {\n this.maxSamples = options?.maxSamples ?? 1000;\n this.channels = options?.channels ?? [new NoopChannel()];\n\n if (options?.flushEvery) {\n this.interval = setInterval(() => {\n // Background interval: a failing channel must not become an unhandled rejection\n this.flush().catch((error) => {\n console.error(\"[benchmark] profiler flush failed\", error);\n });\n }, options.flushEvery);\n\n // Don't keep CLI / test processes alive just for the flush timer\n this.interval.unref?.();\n }\n }\n\n /**\n * Record one measurement result. Called automatically by measure() when a profiler is set.\n *\n * @param result - The success or error result from measure()\n *\n * @example\n * profiler.record(result);\n */\n public record(result: BenchmarkSuccessResult<unknown> | BenchmarkErrorResult): void {\n let entry = this.entries.get(result.name);\n\n if (!entry) {\n entry = {\n latencies: [],\n sum: 0,\n total: 0,\n errors: 0,\n firstSeenAt: result.startedAt,\n lastSeenAt: result.endedAt,\n };\n\n this.entries.set(result.name, entry);\n }\n\n entry.latencies.push(result.latency);\n entry.sum += result.latency;\n\n if (entry.latencies.length > this.maxSamples) {\n const removed = entry.latencies.shift();\n if (removed !== undefined) {\n entry.sum -= removed;\n }\n }\n\n entry.total += 1;\n\n if (!result.success) {\n entry.errors += 1;\n }\n\n entry.lastSeenAt = result.endedAt;\n }\n\n /**\n * Get aggregated stats for one operation name.\n * Computes p50/p95/p99 by sorting the ring buffer on demand.\n *\n * @param name - The operation name to get stats for.\n * @returns Stats object or undefined if no data yet.\n *\n * @example\n * const stats = profiler.stats(\"db-query\");\n */\n public stats(name: string): BenchmarkStats | undefined {\n const entry = this.entries.get(name);\n if (!entry || entry.latencies.length === 0) return undefined;\n\n const latencies = [...entry.latencies].sort((a, b) => a - b);\n const count = latencies.length;\n\n if (count === 0) return undefined;\n\n const getP = (percentile: number) => {\n const index = Math.min(count - 1, Math.floor(count * percentile));\n return latencies[index] ?? 0;\n };\n\n return {\n p50: getP(0.5),\n p90: getP(0.9),\n p95: getP(0.95),\n p99: getP(0.99),\n avg: Math.round((entry.sum / count) * 100) / 100,\n min: latencies[0] ?? 0,\n max: latencies[count - 1] ?? 0,\n count: entry.total,\n errors: entry.errors,\n errorRate: Math.round((entry.errors / entry.total) * 100) / 100,\n firstSeenAt: entry.firstSeenAt,\n lastSeenAt: entry.lastSeenAt,\n };\n }\n\n /**\n * Get stats for all tracked operations.\n *\n * @returns A record mapping operation names to their stats.\n *\n * @example\n * const all = profiler.allStats();\n */\n public allStats(): Record<string, BenchmarkStats> {\n const all: Record<string, BenchmarkStats> = {};\n for (const name of this.entries.keys()) {\n const operationStats = this.stats(name);\n if (operationStats) {\n all[name] = operationStats;\n }\n }\n return all;\n }\n\n /**\n * Send allStats() to all registered channels.\n *\n * @example\n * await profiler.flush();\n */\n public async flush(): Promise<void> {\n const stats = this.allStats();\n if (Object.keys(stats).length === 0) return;\n\n for (const channel of this.channels) {\n await channel.onFlush(stats);\n }\n }\n\n /**\n * Clear ring buffer for one or all operations.\n * Does NOT reset unbounded total/error counters.\n *\n * @param name - Optional operation name. If omitted, clears all ring buffers.\n *\n * @example\n * profiler.reset(\"db-query\");\n * profiler.reset();\n */\n public reset(name?: string): void {\n if (name) {\n const entry = this.entries.get(name);\n if (entry) {\n entry.latencies = [];\n entry.sum = 0;\n }\n } else {\n for (const entry of this.entries.values()) {\n entry.latencies = [];\n entry.sum = 0;\n }\n }\n }\n\n /**\n * Dispose the profiler, clearing its auto-flush interval.\n *\n * @example\n * profiler.dispose();\n */\n public dispose(): void {\n if (this.interval) {\n clearInterval(this.interval);\n this.interval = undefined;\n }\n }\n}\n"],"mappings":";;;AAkBA,IAAa,oBAAb,MAA+B;CAM7B,AAAO,YAAY,SAAoC;iCAH5B,IAAI,IAA4B;EAIzD,KAAK,aAAa,SAAS,cAAc;EACzC,KAAK,WAAW,SAAS,YAAY,CAAC,IAAI,YAAY,CAAC;EAEvD,IAAI,SAAS,YAAY;GACvB,KAAK,WAAW,kBAAkB;IAEhC,KAAK,MAAM,CAAC,CAAC,OAAO,UAAU;KAC5B,QAAQ,MAAM,qCAAqC,KAAK;IAC1D,CAAC;GACH,GAAG,QAAQ,UAAU;GAGrB,KAAK,SAAS,QAAQ;EACxB;CACF;;;;;;;;;CAUA,AAAO,OAAO,QAAsE;EAClF,IAAI,QAAQ,KAAK,QAAQ,IAAI,OAAO,IAAI;EAExC,IAAI,CAAC,OAAO;GACV,QAAQ;IACN,WAAW,CAAC;IACZ,KAAK;IACL,OAAO;IACP,QAAQ;IACR,aAAa,OAAO;IACpB,YAAY,OAAO;GACrB;GAEA,KAAK,QAAQ,IAAI,OAAO,MAAM,KAAK;EACrC;EAEA,MAAM,UAAU,KAAK,OAAO,OAAO;EACnC,MAAM,OAAO,OAAO;EAEpB,IAAI,MAAM,UAAU,SAAS,KAAK,YAAY;GAC5C,MAAM,UAAU,MAAM,UAAU,MAAM;GACtC,IAAI,YAAY,QACd,MAAM,OAAO;EAEjB;EAEA,MAAM,SAAS;EAEf,IAAI,CAAC,OAAO,SACV,MAAM,UAAU;EAGlB,MAAM,aAAa,OAAO;CAC5B;;;;;;;;;;;CAYA,AAAO,MAAM,MAA0C;EACrD,MAAM,QAAQ,KAAK,QAAQ,IAAI,IAAI;EACnC,IAAI,CAAC,SAAS,MAAM,UAAU,WAAW,GAAG,OAAO;EAEnD,MAAM,YAAY,CAAC,GAAG,MAAM,SAAS,CAAC,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC;EAC3D,MAAM,QAAQ,UAAU;EAExB,IAAI,UAAU,GAAG,OAAO;EAExB,MAAM,QAAQ,eAAuB;
|
|
1
|
+
{"version":3,"file":"profiler.mjs","names":[],"sources":["../../../../../../../../packages/core/src/benchmark/profiler.ts"],"sourcesContent":["import { NoopChannel } from \"./channels/noop.channel\";\nimport type {\n BenchmarkChannel,\n BenchmarkErrorResult,\n BenchmarkProfilerOptions,\n BenchmarkStats,\n BenchmarkSuccessResult,\n} from \"./types\";\n\ntype BenchmarkEntry = {\n latencies: number[];\n sum: number;\n total: number;\n errors: number;\n firstSeenAt: Date;\n lastSeenAt: Date;\n};\n\nexport class BenchmarkProfiler {\n private readonly maxSamples: number;\n private readonly channels: BenchmarkChannel[];\n private readonly entries = new Map<string, BenchmarkEntry>();\n private interval?: ReturnType<typeof setInterval>;\n\n public constructor(options?: BenchmarkProfilerOptions) {\n this.maxSamples = options?.maxSamples ?? 1000;\n this.channels = options?.channels ?? [new NoopChannel()];\n\n if (options?.flushEvery) {\n this.interval = setInterval(() => {\n // Background interval: a failing channel must not become an unhandled rejection\n this.flush().catch((error) => {\n console.error(\"[benchmark] profiler flush failed\", error);\n });\n }, options.flushEvery);\n\n // Don't keep CLI / test processes alive just for the flush timer\n this.interval.unref?.();\n }\n }\n\n /**\n * Record one measurement result. Called automatically by measure() when a profiler is set.\n *\n * @param result - The success or error result from measure()\n *\n * @example\n * profiler.record(result);\n */\n public record(result: BenchmarkSuccessResult<unknown> | BenchmarkErrorResult): void {\n let entry = this.entries.get(result.name);\n\n if (!entry) {\n entry = {\n latencies: [],\n sum: 0,\n total: 0,\n errors: 0,\n firstSeenAt: result.startedAt,\n lastSeenAt: result.endedAt,\n };\n\n this.entries.set(result.name, entry);\n }\n\n entry.latencies.push(result.latency);\n entry.sum += result.latency;\n\n if (entry.latencies.length > this.maxSamples) {\n const removed = entry.latencies.shift();\n if (removed !== undefined) {\n entry.sum -= removed;\n }\n }\n\n entry.total += 1;\n\n if (!result.success) {\n entry.errors += 1;\n }\n\n entry.lastSeenAt = result.endedAt;\n }\n\n /**\n * Get aggregated stats for one operation name.\n * Computes p50/p95/p99 by sorting the ring buffer on demand.\n *\n * @param name - The operation name to get stats for.\n * @returns Stats object or undefined if no data yet.\n *\n * @example\n * const stats = profiler.stats(\"db-query\");\n */\n public stats(name: string): BenchmarkStats | undefined {\n const entry = this.entries.get(name);\n if (!entry || entry.latencies.length === 0) return undefined;\n\n const latencies = [...entry.latencies].sort((a, b) => a - b);\n const count = latencies.length;\n\n if (count === 0) return undefined;\n\n const getP = (percentile: number) => {\n const index = Math.min(count - 1, Math.floor(count * percentile));\n return latencies[index] ?? 0;\n };\n\n return {\n p50: getP(0.5),\n p90: getP(0.9),\n p95: getP(0.95),\n p99: getP(0.99),\n avg: Math.round((entry.sum / count) * 100) / 100,\n min: latencies[0] ?? 0,\n max: latencies[count - 1] ?? 0,\n count: entry.total,\n errors: entry.errors,\n errorRate: Math.round((entry.errors / entry.total) * 100) / 100,\n firstSeenAt: entry.firstSeenAt,\n lastSeenAt: entry.lastSeenAt,\n };\n }\n\n /**\n * Get stats for all tracked operations.\n *\n * @returns A record mapping operation names to their stats.\n *\n * @example\n * const all = profiler.allStats();\n */\n public allStats(): Record<string, BenchmarkStats> {\n const all: Record<string, BenchmarkStats> = {};\n for (const name of this.entries.keys()) {\n const operationStats = this.stats(name);\n if (operationStats) {\n all[name] = operationStats;\n }\n }\n return all;\n }\n\n /**\n * Send allStats() to all registered channels.\n *\n * @example\n * await profiler.flush();\n */\n public async flush(): Promise<void> {\n const stats = this.allStats();\n if (Object.keys(stats).length === 0) return;\n\n for (const channel of this.channels) {\n await channel.onFlush(stats);\n }\n }\n\n /**\n * Clear ring buffer for one or all operations.\n * Does NOT reset unbounded total/error counters.\n *\n * @param name - Optional operation name. If omitted, clears all ring buffers.\n *\n * @example\n * profiler.reset(\"db-query\");\n * profiler.reset();\n */\n public reset(name?: string): void {\n if (name) {\n const entry = this.entries.get(name);\n if (entry) {\n entry.latencies = [];\n entry.sum = 0;\n }\n } else {\n for (const entry of this.entries.values()) {\n entry.latencies = [];\n entry.sum = 0;\n }\n }\n }\n\n /**\n * Dispose the profiler, clearing its auto-flush interval.\n *\n * @example\n * profiler.dispose();\n */\n public dispose(): void {\n if (this.interval) {\n clearInterval(this.interval);\n this.interval = undefined;\n }\n }\n}\n"],"mappings":";;;AAkBA,IAAa,oBAAb,MAA+B;CAM7B,AAAO,YAAY,SAAoC;iCAH5B,IAAI,IAA4B;EAIzD,KAAK,aAAa,SAAS,cAAc;EACzC,KAAK,WAAW,SAAS,YAAY,CAAC,IAAI,YAAY,CAAC;EAEvD,IAAI,SAAS,YAAY;GACvB,KAAK,WAAW,kBAAkB;IAEhC,KAAK,MAAM,CAAC,CAAC,OAAO,UAAU;KAC5B,QAAQ,MAAM,qCAAqC,KAAK;IAC1D,CAAC;GACH,GAAG,QAAQ,UAAU;GAGrB,KAAK,SAAS,QAAQ;EACxB;CACF;;;;;;;;;CAUA,AAAO,OAAO,QAAsE;EAClF,IAAI,QAAQ,KAAK,QAAQ,IAAI,OAAO,IAAI;EAExC,IAAI,CAAC,OAAO;GACV,QAAQ;IACN,WAAW,CAAC;IACZ,KAAK;IACL,OAAO;IACP,QAAQ;IACR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AG;GACtC,MAAM,iBAAiB,KAAK,MAAM,IAAI;GACtC,IAAI,gBACF,IAAI,QAAQ;EAEhB;EACA,OAAO;CACT;;;;;;;CAQA,MAAa,QAAuB;EAClC,MAAM,QAAQ,KAAK,SAAS;EAC5B,IAAI,OAAO,KAAK,KAAK,CAAC,CAAC,WAAW,GAAG;EAErC,KAAK,MAAM,WAAW,KAAK,UACzB,MAAM,QAAQ,QAAQ,KAAK;CAE/B;;;;;;;;;;;CAYA,AAAO,MAAM,MAAqB;EAChC,IAAI,MAAM;GACR,MAAM,QAAQ,KAAK,QAAQ,IAAI,IAAI;GACnC,IAAI,OAAO;IACT,MAAM,YAAY,CAAC;IACnB,MAAM,MAAM;GACd;EACF,OACE,KAAK,MAAM,SAAS,KAAK,QAAQ,OAAO,GAAG;GACzC,MAAM,YAAY,CAAC;GACnB,MAAM,MAAM;EACd;CAEJ;;;;;;;CAQA,AAAO,UAAgB;EACrB,IAAI,KAAK,UAAU;GACjB,cAAc,KAAK,QAAQ;GAC3B,KAAK,WAAW;EAClB;CACF;AACF"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { BenchmarkSnapshots } from "./benchmark-snapshots.mjs";
|
|
2
2
|
import { BenchmarkProfiler } from "./profiler.mjs";
|
|
3
|
-
|
|
4
3
|
//#region ../../packages/core/src/benchmark/types.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Global benchmark configuration (set via config.get("benchmark"))
|
|
7
6
|
*/
|
|
8
|
-
type BenchmarkConfigurations = {
|
|
7
|
+
export type BenchmarkConfigurations = {
|
|
9
8
|
enabled?: boolean;
|
|
10
9
|
latencyRange?: {
|
|
11
10
|
excellent: number;
|
|
@@ -14,7 +13,7 @@ type BenchmarkConfigurations = {
|
|
|
14
13
|
profiler?: BenchmarkProfiler;
|
|
15
14
|
snapshotContainer?: BenchmarkSnapshots;
|
|
16
15
|
};
|
|
17
|
-
type BenchmarkOptions<T = unknown> = {
|
|
16
|
+
export type BenchmarkOptions<T = unknown> = {
|
|
18
17
|
/**
|
|
19
18
|
* Quick enable/disable without removing the call.
|
|
20
19
|
* When false, fn() is still called but no timing occurs and no hooks fire.
|
|
@@ -81,7 +80,7 @@ type BenchmarkOptions<T = unknown> = {
|
|
|
81
80
|
*/
|
|
82
81
|
snapshotContainer?: BenchmarkSnapshots | false;
|
|
83
82
|
};
|
|
84
|
-
type BenchmarkResult = {
|
|
83
|
+
export type BenchmarkResult = {
|
|
85
84
|
/**
|
|
86
85
|
* Name of the benchmark
|
|
87
86
|
*/
|
|
@@ -110,44 +109,51 @@ type BenchmarkResult = {
|
|
|
110
109
|
/**
|
|
111
110
|
* Result of a successful benchmark measurement.
|
|
112
111
|
*/
|
|
113
|
-
type BenchmarkSuccessResult<T> = BenchmarkResult & {
|
|
112
|
+
export type BenchmarkSuccessResult<T> = BenchmarkResult & {
|
|
114
113
|
success: true;
|
|
115
114
|
value: T;
|
|
116
115
|
};
|
|
117
116
|
/**
|
|
118
117
|
* Result of a benchmarked error.
|
|
119
118
|
*/
|
|
120
|
-
type BenchmarkErrorResult = BenchmarkResult & {
|
|
119
|
+
export type BenchmarkErrorResult = BenchmarkResult & {
|
|
121
120
|
success: false;
|
|
122
121
|
error: unknown;
|
|
123
122
|
};
|
|
124
|
-
interface BenchmarkChannel {
|
|
123
|
+
export interface BenchmarkChannel {
|
|
125
124
|
/**
|
|
126
125
|
* Called on profiler.flush() with aggregated stats for all tracked operations.
|
|
127
126
|
*/
|
|
128
127
|
onFlush(stats: Record<string, BenchmarkStats>): void | Promise<void>;
|
|
129
128
|
}
|
|
130
|
-
type BenchmarkStats = {
|
|
129
|
+
export type BenchmarkStats = {
|
|
131
130
|
p50: number;
|
|
132
131
|
p90: number;
|
|
133
132
|
p95: number;
|
|
134
133
|
p99: number;
|
|
135
134
|
avg: number;
|
|
136
135
|
min: number;
|
|
137
|
-
max: number;
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
max: number;
|
|
137
|
+
/** Total call count — unbounded, not capped by ring buffer */
|
|
138
|
+
count: number;
|
|
139
|
+
/** Total error count — unbounded */
|
|
140
|
+
errors: number;
|
|
141
|
+
/** 0.0–1.0 — based on unbounded total/error counters */
|
|
140
142
|
errorRate: number;
|
|
141
143
|
firstSeenAt: Date;
|
|
142
144
|
lastSeenAt: Date;
|
|
143
145
|
};
|
|
144
|
-
type BenchmarkProfilerOptions = {
|
|
145
|
-
/** Max latency samples to keep per operation name. Default: 1000 */
|
|
146
|
-
|
|
146
|
+
export type BenchmarkProfilerOptions = {
|
|
147
|
+
/** Max latency samples to keep per operation name. Default: 1000 */
|
|
148
|
+
maxSamples?: number;
|
|
149
|
+
/** Channels to broadcast stats to on flush(). Default: [new NoopChannel()] */
|
|
150
|
+
channels?: BenchmarkChannel[];
|
|
151
|
+
/** Auto-flush interval in ms. If not set, flush() must be called manually. */
|
|
147
152
|
flushEvery?: number;
|
|
148
153
|
};
|
|
149
|
-
type BenchmarkSnapshotsOptions = {
|
|
150
|
-
/** Max snapshots to keep per operation name. Default: 100 */
|
|
154
|
+
export type BenchmarkSnapshotsOptions = {
|
|
155
|
+
/** Max snapshots to keep per operation name. Default: 100 */
|
|
156
|
+
maxSnapshots?: number;
|
|
151
157
|
/**
|
|
152
158
|
* What to capture:
|
|
153
159
|
* - "error" → only BenchmarkErrorResult (default, memory safe)
|
|
@@ -160,5 +166,4 @@ type BenchmarkSnapshotsOptions = {
|
|
|
160
166
|
capture?: "error" | "value" | "all";
|
|
161
167
|
};
|
|
162
168
|
//#endregion
|
|
163
|
-
export { BenchmarkChannel, BenchmarkConfigurations, BenchmarkErrorResult, BenchmarkOptions, BenchmarkProfilerOptions, BenchmarkResult, BenchmarkSnapshotsOptions, BenchmarkStats, BenchmarkSuccessResult };
|
|
164
169
|
//# sourceMappingURL=types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/benchmark/types.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/benchmark/types.ts"],"mappings":";;;;;;YAMY;EACV;EACA;IAAiB;IAAmB;;EACpC,WAAW;EACX,oBAAoB;;YAGV,iBAAiB;;;;;EAK3B;;;;;;;;;;EAUA;;;;IAIE;;;;IAIA;;;;;EAKF,cAAc,QAAQ,uBAAuB;;;;EAI7C,WAAW,QAAQ;;;;;EAKnB,YAAY,QAAQ,uBAAuB,KAAK;;;;;;EAMhD,OAAO;;;;;;;;EAQP,wBAAwB;;;;;;;EAOxB,WAAW;;;;;;;EAOX,oBAAoB;;YAGV;;;;EAIV;;;;EAIA;;;;EAIA;;;;EAIA,OAAO;;;;EAIP,WAAW;;;;EAIX,SAAS;;;;;YAMC,uBAAuB,KAAK;EACtC;EACA,OAAO;;;;;YAMG,uBAAuB;EACjC;EACA;;iBAGe;;;;EAIf,QAAQ,OAAO,eAAe,yBAAyB;;YAG7C;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;EACA,aAAa;EACb,YAAY;;YAGF;;EAEV;;EAEA,WAAW;;EAEX;;YAGU;;EAEV;;;;;;;;;;EAUA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/bootstrap/setup.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"setup.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/bootstrap/setup.ts"],"mappings":";wBAGgB"}
|
package/esm/bootstrap.d.mts
CHANGED
package/esm/bootstrap.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.mts","names":[],"sources":["../../../../../../../packages/core/src/bootstrap.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"bootstrap.d.mts","names":[],"sources":["../../../../../../../packages/core/src/bootstrap.ts"],"mappings":";wBAOsB,aAAS"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Model } from "@warlock.js/cascade";
|
|
2
2
|
import { BaseCacheDriver, CacheDriver, CacheKey, CacheSetOptions, CacheTtl } from "@warlock.js/cache";
|
|
3
|
-
|
|
4
3
|
//#region ../../packages/core/src/cache/database-cache-driver.d.ts
|
|
5
|
-
type DatabaseCacheOptions = {
|
|
4
|
+
export type DatabaseCacheOptions = {
|
|
6
5
|
/**
|
|
7
6
|
* Database model class
|
|
8
7
|
*/
|
|
@@ -18,10 +17,10 @@ type DatabaseCacheOptions = {
|
|
|
18
17
|
*/
|
|
19
18
|
ttl?: number;
|
|
20
19
|
};
|
|
21
|
-
declare class CacheModel extends Model {
|
|
20
|
+
export declare class CacheModel extends Model {
|
|
22
21
|
static table: string;
|
|
23
22
|
}
|
|
24
|
-
declare class DatabaseCacheDriver extends BaseCacheDriver<DatabaseCacheDriver, DatabaseCacheOptions> implements CacheDriver<DatabaseCacheDriver, DatabaseCacheOptions> {
|
|
23
|
+
export declare class DatabaseCacheDriver extends BaseCacheDriver<DatabaseCacheDriver, DatabaseCacheOptions> implements CacheDriver<DatabaseCacheDriver, DatabaseCacheOptions> {
|
|
25
24
|
/**
|
|
26
25
|
* {@inheritdoc}
|
|
27
26
|
*/
|
|
@@ -56,5 +55,4 @@ declare class DatabaseCacheDriver extends BaseCacheDriver<DatabaseCacheDriver, D
|
|
|
56
55
|
flush(): Promise<void>;
|
|
57
56
|
}
|
|
58
57
|
//#endregion
|
|
59
|
-
export { DatabaseCacheDriver, DatabaseCacheOptions };
|
|
60
58
|
//# sourceMappingURL=database-cache-driver.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database-cache-driver.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/cache/database-cache-driver.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"database-cache-driver.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/cache/database-cache-driver.ts"],"mappings":";;;YAUY;;;;EAIV,eAAe;;;;EAIf;;;;;;EAMA;;qBAGW,mBAAmB;SAChB;;qBAGH,4BACH,gBAAgB,qBAAqB,iCAClC,YAAY,qBAAqB;;;;EAKrC;;;;EAKA,cAAe;;;;EAKf,WAAW,SAAS;;;;EAWd,gBAAgB,oBAAiB;;;;EAiBjC,IAAI,KAAK,UAAU,YAAY,eAAe,WAAW,kBAAe;;;;EA2CxE,IAAI,KAAK,WAAQ;;;;EA0BjB,OAAO,KAAK,WAAQ;;;;EAepB,SAAK"}
|
package/esm/cache/index.d.mts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import { DatabaseCacheDriver, DatabaseCacheOptions } from "./database-cache-driver.mjs";
|
|
1
|
+
import { DatabaseCacheDriver, DatabaseCacheOptions } from "./database-cache-driver.mjs";
|
|
2
|
+
export { DatabaseCacheDriver, type DatabaseCacheOptions };
|
package/esm/cache/index.mjs
CHANGED
|
@@ -169,7 +169,9 @@ var CLICommandsManager = class {
|
|
|
169
169
|
const command = await this.lazyGetCommand(name);
|
|
170
170
|
if (manifestManager.hasChanges) await manifestManager.saveCommands();
|
|
171
171
|
if (!command) {
|
|
172
|
-
|
|
172
|
+
const allCommandNames = this.getAllCommandNames();
|
|
173
|
+
const suggestions = findSimilar(name, allCommandNames).map((s) => s.value);
|
|
174
|
+
displayCommandNotFound(name, suggestions);
|
|
173
175
|
process.exit(1);
|
|
174
176
|
}
|
|
175
177
|
if (isHelpCommand) {
|
|
@@ -218,12 +220,13 @@ var CLICommandsManager = class {
|
|
|
218
220
|
const projectCommands = await cliCommandsLoader.scanAll();
|
|
219
221
|
this.register(...projectCommands);
|
|
220
222
|
await manifestManager.saveCommands();
|
|
221
|
-
|
|
223
|
+
const helpCommands = this.commands.map((cmd) => ({
|
|
222
224
|
name: cmd.name,
|
|
223
225
|
alias: cmd.commandAlias,
|
|
224
226
|
description: cmd.commandDescription,
|
|
225
227
|
source: cmd.commandSource || "project"
|
|
226
|
-
}))
|
|
228
|
+
}));
|
|
229
|
+
await displayHelp(helpCommands);
|
|
227
230
|
}
|
|
228
231
|
/**
|
|
229
232
|
* Warm cache - scan all project commands and save to manifest
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-commands.manager.mjs","names":[],"sources":["../../../../../../../../packages/core/src/cli/cli-commands.manager.ts"],"sourcesContent":["import { toCamelCase } from \"@mongez/reinforcements\";\nimport { colors } from \"@mongez/copper\";\nimport { fileExistsAsync } from \"@warlock.js/fs\";\nimport { Application } from \"../application\";\nimport { bootstrap } from \"../bootstrap\";\nimport { loadConfigFiles } from \"../config/load-config-files\";\nimport { connectorsManager } from \"../connectors/connectors-manager\";\nimport { registerConfiguredConnectors } from \"../connectors/register-configured-connectors\";\nimport { ConnectorLifecyclePhase } from \"../connectors/types\";\nimport { filesOrchestrator } from \"../dev-server/files-orchestrator\";\nimport { isDevWorker } from \"../dev-server/supervisor\";\nimport { preflightConfiguredHttpPort, shouldPreflightHttpPort } from \"../http/boot-port-preflight\";\nimport { manifestManager } from \"../manifest/manifest-manager\";\nimport { appPath } from \"../utils\";\nimport { loadEnvironmentFiles } from \"../utils/load-environment\";\nimport { warlockConfigManager } from \"../warlock-config/warlock-config.manager\";\nimport { CLICommand } from \"../commands/cli-command\";\nimport {\n displayBootError,\n displayCommandError,\n displayCommandHelp,\n displayCommandNotFound,\n displayCommandSuccess,\n displayExecutingCommand,\n displayHelp,\n displayMissingCommand,\n displayMissingOptions,\n displayWarlockVersionInTerminal,\n type HelpCommandInfo,\n isMatchingCommandName,\n} from \"./cli-commands.utils\";\nimport { cliCommandsLoader } from \"./commands-loader\";\nimport { frameworkCommands } from \"./framework-cli-commands\";\nimport { CliOptionValueError, type ParsedCliArgs, parseCliArgs } from \"./parse-cli-args\";\nimport { findSimilar } from \"./string-similarity\";\nimport type { CommandActionData, ResolvedCLICommandOption } from \"../commands/types\";\n\n/**\n * Best-effort budget (ms) for draining stdout/stderr before a forced exit.\n * Bounded so a stuck stream can never hang the CLI.\n */\nconst EXIT_FLUSH_BUDGET = 500;\n\n/**\n * Exit with `code` once stdout/stderr have drained.\n *\n * `process.exit()` truncates writes still queued on a non-TTY stdout — a pipe,\n * a CI log — which is how the *reason* for a failure gets lost even when the\n * exit code is right. `exitCode` is set up front so that a natural exit (should\n * the drain outlive the process's remaining work) is non-zero too.\n */\nfunction exitAfterFlush(code: number) {\n process.exitCode = code;\n\n const timer = setTimeout(() => process.exit(code), EXIT_FLUSH_BUDGET);\n timer.unref?.();\n\n let pending = 2;\n const drained = () => {\n if (--pending > 0) return;\n\n clearTimeout(timer);\n process.exit(code);\n };\n\n // A zero-length write's callback fires once everything queued ahead of it has\n // been handed to the OS.\n process.stdout.write(\"\", drained);\n process.stderr.write(\"\", drained);\n}\n\n/**\n * How a command run ended, from the process's point of view.\n *\n * - `succeeded` — finished, nothing rejected afterwards; the CLI may exit 0.\n * - `failed` — reported an error; the exit code is owned by whoever reported it.\n * - `running` — a persistent command (dev/start) now owns the process.\n *\n * `execute` returns this instead of exiting on success itself. A method that\n * terminates the process out from under its caller cannot be awaited honestly:\n * the exit it schedules outlives the call, so the success it represents is\n * still unsettled when `execute` resolves — which is exactly how a green check\n * ends up printed next to the failure that contradicts it.\n */\nexport type CommandRunVerdict = \"succeeded\" | \"failed\" | \"running\";\n\n/**\n * Whether this process is the CHILD half of a supervised command.\n *\n * ## The finding this encodes\n *\n * `warlock dev` printing `› Running dev...` twice was NOT a double boot, and\n * the distinction is the whole point of this function existing rather than the\n * line simply being deleted. The sequence, in file order:\n *\n * 1. `execute()` prints the header (below) — BEFORE `commandPreAction`.\n * 2. `cli/commands/dev-server.command.ts` `preAction` calls\n * `superviseDevServer()` when `!isDevWorker()`.\n * 3. `dev-server/supervisor.ts` `spawnWorker()` re-spawns `process.argv` with\n * `WARLOCK_DEV_WORKER=1`, so the child runs `warlock dev` again and prints\n * the header too.\n * 4. `superviseDevServer()` returns a promise that never settles, so the\n * supervisor's `await commandPreAction(...)` never resolves — `loadPreloaders`\n * and `command.execute` are unreachable in the supervisor.\n *\n * Step 4 is why only ONE process ever loads config, connectors, app modules or\n * a scheduler. Verified by running it: one `APP-CODE-LOADED`, one\n * `Application.markBooted`, one `⚡ Warlock.js` banner, one route registration,\n * two processes. The `2 job(s) registered` in the original report is two jobs\n * in one scheduler, not two schedulers — a genuine double boot would have\n * printed that warning twice.\n *\n * So the defect is exactly one duplicated line, and this is the guard that\n * keeps it one. `tests/unit/cli/dev-command-single-boot.test.ts` fails if the\n * supervisor ever starts running preloaders — i.e. if the double boot the\n * duplicated line looked like ever becomes real.\n */\nfunction isRespawnedWorker(): boolean {\n return isDevWorker();\n}\n\nexport class CLICommandsManager {\n /**\n * List of commands\n */\n public commands: CLICommand[] = [];\n\n /**\n * Commands map (name -> command)\n */\n public commandsMap: Map<string, CLICommand> = new Map();\n\n /**\n * Alias map (alias -> command name)\n */\n public aliasMap: Map<string, string> = new Map();\n\n /**\n * Register the given commands\n */\n public register(...commands: CLICommand[]): this {\n this.commands.push(...commands);\n\n commands.forEach((command) => {\n // `split` always yields a first element, so this holds. Falling back to\n // the whole name rather than asserting keeps the map keyed by a REAL\n // command name — a key of `undefined` would register the command under\n // the literal string \"undefined\" and make it unreachable by its own name.\n const commandKey = command.name.split(\" \")[0] ?? command.name;\n\n manifestManager.addCommandToList(command.name, {\n relativePath: command.commandRelativePath,\n source: command.commandSource || \"project\",\n description: command.commandDescription,\n alias: command.commandAlias,\n options: command.commandOptions.length > 0 ? command.commandOptions : undefined,\n });\n\n this.commandsMap.set(commandKey, command);\n\n // Register alias if exists\n if (command.commandAlias) {\n this.aliasMap.set(command.commandAlias, commandKey);\n }\n });\n\n return this;\n }\n\n /**\n * Get command by name or alias\n */\n public getCommand(name: string): CLICommand | undefined {\n // First try direct lookup\n let command = this.commandsMap.get(name);\n if (command) return command;\n\n // Try alias lookup\n const realName = this.aliasMap.get(name);\n if (realName) {\n return this.commandsMap.get(realName);\n }\n\n return;\n }\n\n /**\n * Get all command names and aliases\n * Used for fuzzy matching suggestions\n */\n public getAllCommandNames(): string[] {\n const names: string[] = [];\n\n // Add all command names\n for (const name of this.commandsMap.keys()) {\n names.push(name);\n }\n\n // Add all aliases\n for (const alias of this.aliasMap.keys()) {\n names.push(alias);\n }\n\n // Also include cached commands from manifest\n const manifestCommands = manifestManager.commandsJson?.commands || {};\n // `Object.entries` rather than keys + index: the index read is\n // `T | undefined` under the strictness contract even for a key that came\n // from the object itself, and these names feed the CLI's \"did you mean?\"\n // suggestions — a literal \"undefined\" in that list is a suggestion no\n // operator can act on.\n for (const [name, meta] of Object.entries(manifestCommands)) {\n const baseName = name.split(\" \")[0] ?? name;\n\n if (!names.includes(baseName)) {\n names.push(baseName);\n }\n\n const alias = meta?.alias;\n\n if (alias && !names.includes(alias)) {\n names.push(alias);\n }\n }\n\n return names;\n }\n\n /**\n * Start the cli manager\n */\n public async start() {\n // Schema-less first pass: it exists to discover the command name and the\n // command-independent flags (--help, --version, --no-cache). Values here are\n // raw strings; the typed pass below is the one whose options reach a command.\n const { name, options } = parseCliArgs(process.argv);\n\n if (options.noCache) {\n manifestManager.clearCommandsCache();\n // remove the commands.json file as wel\n await manifestManager.removeCommandsFile();\n }\n\n // `-v` is only the version flag when no command was given: after a command\n // name it is that command's own short flag (`--with-validation`).\n if (options.version || (options.v && !name)) {\n await displayWarlockVersionInTerminal();\n process.exit(0);\n }\n\n // Try to load from manifest first (fastest path)\n await manifestManager.loadCommands();\n\n // Register framework commands first (needed for help)\n this.register(\n ...frameworkCommands.map((command) => {\n if (!command.commandSource) {\n command.commandSource = \"framework\";\n }\n return command;\n }),\n );\n\n const isHelpCommand = options.help || options.h;\n\n // Handle global help (no command)\n if (!name && isHelpCommand) {\n await this.showGlobalHelp();\n process.exit(0);\n }\n\n // Handle warm cache\n if (options.warmCache) {\n await this.warmCache();\n process.exit(0);\n }\n\n if (!name) {\n displayMissingCommand();\n process.exit(1);\n }\n\n const command = await this.lazyGetCommand(name);\n\n if (manifestManager.hasChanges) {\n await manifestManager.saveCommands();\n }\n\n if (!command) {\n // Find similar commands for suggestions\n const allCommandNames = this.getAllCommandNames();\n const suggestions = findSimilar(name, allCommandNames).map((s) => s.value);\n\n displayCommandNotFound(name, suggestions);\n process.exit(1);\n }\n\n // Handle command-specific help\n if (isHelpCommand) {\n displayCommandHelp({\n name: command.name,\n alias: command.commandAlias,\n description: command.commandDescription,\n options: command.commandOptions,\n });\n process.exit(0);\n }\n\n // The first parse above had no command to consult, so every value in it is\n // a raw string. Now that the command is resolved, re-read argv against its\n // declared options so a `type: \"boolean\"` option arrives as a boolean.\n const resolved = this.resolveCommandArgs(command);\n\n const verdict = await this.execute(command, {\n options: resolved.options,\n args: resolved.args,\n });\n\n // The process-level exit belongs to the entrypoint, not to `execute`.\n // A one-shot command can leave a handle open (a db connection, a watcher a\n // plugin forgot to close), so the CLI exits explicitly rather than waiting\n // for the loop to drain — but only on a verdict of `succeeded`. `failed`\n // already exited non-zero through whoever reported it, and `running` means\n // a persistent command owns the process now.\n if (verdict === \"succeeded\") {\n exitAfterFlush(0);\n }\n }\n\n /**\n * Re-parse argv against the resolved command's declared options.\n *\n * parseCliArgs runs twice on purpose. The first run produces the command\n * name, and there is no schema to consult yet; the second one, here, can be\n * type-aware. Re-reading argv (rather than post-processing the first result)\n * is what makes `--rollback users.ts` recoverable: by the time the first pass\n * returns, the swallowed positional is indistinguishable from a value.\n */\n protected resolveCommandArgs(command: CLICommand, argv: string[] = process.argv): ParsedCliArgs {\n try {\n return parseCliArgs(argv, command.commandOptions);\n } catch (error) {\n if (error instanceof CliOptionValueError) {\n console.log();\n console.log(` ${colors.redBright(\"Error:\")} ${error.message}`);\n console.log();\n process.exit(1);\n }\n\n throw error;\n }\n }\n\n /**\n * Show global help with all commands\n * Uses manifest if available for fast display\n */\n protected async showGlobalHelp() {\n // Always rescan rather than trusting `.warlock/commands.json`: the manifest\n // has no invalidation, so a newly added project command stayed invisible\n // and a removed one lingered in help until `--warm-cache`.\n await this.loadPluginsCommands();\n\n const projectCommands = await cliCommandsLoader.scanAll();\n\n this.register(...projectCommands);\n\n await manifestManager.saveCommands();\n\n // Build help info from registered commands\n const helpCommands: HelpCommandInfo[] = this.commands.map((cmd) => ({\n name: cmd.name,\n alias: cmd.commandAlias,\n description: cmd.commandDescription,\n source: cmd.commandSource || \"project\",\n }));\n\n await displayHelp(helpCommands);\n }\n\n /**\n * Warm cache - scan all project commands and save to manifest\n */\n protected async warmCache() {\n console.log();\n console.log(` ${colors.cyan(\"›\")} Scanning project commands...`);\n\n const projectCommands = await cliCommandsLoader.scanAll();\n\n this.register(...projectCommands);\n\n await manifestManager.saveCommands();\n\n console.log(\n ` ${colors.green(\"✔\")} Cached ${colors.bold(String(projectCommands.length))} project commands`,\n );\n console.log();\n }\n\n /**\n * Load plugins commands\n */\n protected async loadPluginsCommands() {\n await warlockConfigManager.load();\n\n if (warlockConfigManager.isLoaded) {\n this.register(\n ...(warlockConfigManager.get(\"cli\")?.commands || []).map((command) => {\n if (!command.commandSource) {\n command.commandSource = \"plugin\";\n }\n return command;\n }),\n );\n }\n }\n\n /**\n * Try to find the command based on the given command name or alias\n */\n protected async lazyGetCommand(name: string) {\n // first step, try to find it directly through current commands\n let command = this.getCommand(name);\n if (command) {\n return command;\n }\n\n // second step, try to find it through warlock config commands\n await this.loadPluginsCommands();\n\n command = this.getCommand(name);\n\n if (command) {\n return command;\n }\n\n // third step, try to find it through project commands\n await this.loadProjectCommands(name);\n\n command = this.getCommand(name);\n if (command) {\n return command;\n }\n\n return null;\n }\n\n /**\n * Load project commands\n */\n protected async loadProjectCommands(name: string) {\n // first get the commands.json contents as an object\n const jsonCommandsFile = await manifestManager.loadCommands();\n\n if (jsonCommandsFile) {\n // Check by name or alias\n // `Object.entries` hands the metadata over already narrowed; a `for...in`\n // index read is `T | undefined` and every field below is read off it.\n for (const [fullCommandName, cmdMeta] of Object.entries(jsonCommandsFile.commands)) {\n if (cmdMeta === undefined) continue;\n\n // Match by name or alias\n if (isMatchingCommandName(fullCommandName, name) || cmdMeta.alias === name) {\n const commandPath = cmdMeta.relativePath;\n if (commandPath) {\n const executedCommand = await cliCommandsLoader.load(commandPath);\n\n if (executedCommand) {\n executedCommand.$relativePath(commandPath);\n this.register(executedCommand);\n return;\n }\n }\n }\n }\n }\n\n const command = await cliCommandsLoader.locate(name);\n\n if (command) {\n this.register(command);\n return;\n }\n }\n\n /**\n * Validate required options\n */\n protected validateOptions(\n command: CLICommand,\n options: Record<string, string | boolean | number>,\n ): ResolvedCLICommandOption[] {\n const missing: ResolvedCLICommandOption[] = [];\n\n command.commandOptions.forEach((opt) => {\n if (opt.required) {\n // Check if option is provided by name or alias\n const name = toCamelCase(opt.name);\n const alias = opt.alias ? toCamelCase(opt.alias) : \"\";\n const hasOption =\n options[name] !== undefined ||\n options[opt.name] !== undefined ||\n (alias && options[alias] !== undefined);\n if (!hasOption) {\n missing.push(opt);\n }\n }\n });\n\n return missing;\n }\n\n /**\n * Apply default values to options\n */\n protected applyDefaultOptions(\n command: CLICommand,\n options: Record<string, string | boolean | number>,\n ): Record<string, string | boolean | number> {\n const result = { ...options };\n\n command.commandOptions.forEach((declared) => {\n // Parsed keys are camelCase; normalise so commands built with raw kebab\n // names still resolve, and mirror the value to the kebab key.\n const camelName = toCamelCase(declared.name);\n const opt = {\n ...declared,\n name: camelName,\n alias: declared.alias ? toCamelCase(declared.alias) : declared.alias,\n };\n\n const declaredValue = result[declared.name];\n if (result[camelName] === undefined && declaredValue !== undefined) {\n result[camelName] = declaredValue;\n }\n\n if (opt.defaultValue !== undefined) {\n const hasOption =\n result[opt.name] !== undefined || (opt.alias && result[opt.alias] !== undefined);\n if (!hasOption) {\n result[opt.name] = opt.defaultValue;\n }\n }\n\n // `!== undefined`, not truthiness: `-r=false` now resolves to the boolean\n // `false`, and a truthiness test would drop it before it ever reached the\n // canonical name — leaving `rollback` undefined instead of explicitly off.\n if (\n opt.alias !== undefined &&\n result[opt.alias] !== undefined &&\n result[opt.name] === undefined\n ) {\n // The `!== undefined` guard on the line above already proves this read\n // is defined, but the compiler does not carry a guard on one index\n // expression to a second, textually identical one. Reading it into a\n // local makes the narrowing survive, WITHOUT weakening the check — an\n // `?? ` fallback here would resurrect exactly the bug the comment above\n // describes, turning an explicit `-r=false` into a default.\n const aliasValue = result[opt.alias];\n\n if (aliasValue !== undefined) {\n result[opt.name] = aliasValue;\n }\n }\n });\n\n return result;\n }\n\n /**\n * Execute the given command and report how it ended.\n *\n * Returning the verdict — rather than exiting on success from in here — is\n * what makes the awaited result trustworthy: see {@link CommandRunVerdict}.\n */\n public async execute(command: CLICommand, data: CommandActionData): Promise<CommandRunVerdict> {\n const startTime = Date.now();\n\n // Validate required options\n const missingOptions = this.validateOptions(command, data.options);\n if (missingOptions.length > 0) {\n displayMissingOptions(missingOptions);\n process.exit(1);\n }\n\n // Apply default values\n data.options = this.applyDefaultOptions(command, data.options);\n\n // ONE header per `warlock <command>` the user typed — not one per process.\n //\n // `warlock dev` is TWO processes by design: the invocation the user typed\n // becomes a thin supervisor (`dev-server/supervisor.ts`) that re-spawns\n // `process.argv` with `WARLOCK_DEV_WORKER=1`, and the child is the actual\n // server. Both are `warlock dev`, so both reached this line and the user saw\n //\n // › Running dev...\n // › Running dev...\n //\n // which reads exactly like the application booting twice. It is not — see\n // the block comment on `isRespawnedWorker` — but the line was still wrong,\n // and it re-printed on every crash-restart on top of the supervisor's own\n // \"restarting\" notice.\n //\n // The SUPERVISOR keeps the header, not the worker: it prints immediately\n // (so a slow boot is not silent), it prints once for the whole session\n // (restarts are already announced as restarts), and it is the process the\n // user actually started.\n if (!isRespawnedWorker()) {\n displayExecutingCommand(command.name);\n }\n\n if (command.commandPreAction) {\n await command.commandPreAction(data);\n }\n\n // load preloaders\n if (command.commandPreload) {\n try {\n await this.loadPreloaders(command);\n } catch (error) {\n // A preload failure (a bad import in a config file, a connector that\n // throws on boot, a missing module export) happens BEFORE the command's\n // action runs — there is no run loop to recover into, so it is ALWAYS\n // fatal, persistent command (dev/start) or not. Surface the real cause\n // and the offending file, then exit. This MUST stay outside the\n // command-execute try/catch below: letting a preload rejection escape\n // turned `warlock dev` into a silent hang — the unhandled rejection slid\n // past while the already-started loader worker thread kept the process\n // alive, freezing just after the banner with no error printed.\n displayBootError(command.name, error as Error);\n process.exit(1);\n }\n }\n\n this.captureFatalAsyncErrors(command);\n\n try {\n await command.execute(data);\n\n // Persistent commands (dev/start) hand control to their run loop here.\n // There is no success banner to print and nothing to exit for.\n if (command.isPersistent) return \"running\";\n\n // Yield one full event-loop turn before declaring success, and AWAIT that\n // yield. Node flags an unhandled rejection only after the current turn's\n // microtasks drain, so reporting success synchronously here fired FIRST\n // and erased the failure — a `build` whose async work rejected exited 0\n // having emitted nothing.\n //\n // The await is the load-bearing part, not the yield. Scheduling this as a\n // bare `setImmediate` let `execute()` RESOLVE while the verdict was still\n // pending: the callback outlived the call it belonged to, so the green\n // check could surface after the caller had already moved on — in a later\n // command, or after a rejection reported in the interim, which the guard\n // below cannot see because by then it reads the state of a run that has\n // already ended. Awaiting binds the banner to THIS invocation: `execute`\n // does not resolve until the verdict it is about to report has settled.\n //\n // `setImmediate` runs in the same loop iteration's check phase, so this\n // cannot hang on a lingering handle the way dropping the exit would; it\n // only lets `captureFatalAsyncErrors` win the race when there is one.\n await new Promise<void>((resolve) => setImmediate(resolve));\n\n // The yield is what gives a floating rejection the chance to be reported;\n // this is what acts on it. A green check printed after that error would\n // contradict it, and the exit that follows would reset `process.exitCode`\n // to 0 — re-erasing the very failure this whole path exists to surface.\n if (this.fatalAsyncErrorReported) return \"failed\";\n\n displayCommandSuccess(command.name, Date.now() - startTime);\n\n return \"succeeded\";\n } catch (error) {\n displayCommandError(command.name, error as Error);\n // Persistent commands (dev/start) own their startup-failure exits;\n // by the time an error reaches here they've already entered their\n // run loop, so it's a runtime error we log but don't crash on —\n // HMR or process supervisors can recover. Non-persistent\n // one-shot commands always exit on failure.\n if (!command.isPersistent) {\n process.exit(1);\n }\n\n return \"failed\";\n }\n }\n\n /**\n * Fail loudly on async errors that escape the command's own promise.\n *\n * `execute` awaits `command.execute(data)`, but work the command merely\n * *started* settles outside that await — `@mongez/events` `trigger` /\n * `triggerAll` are synchronous and do not await their listeners, so an async\n * listener that throws leaves a floating rejection behind. Node reports it at\n * the end of the turn, by which point the CLI had already exited 0: the\n * failure was erased and the command looked green.\n *\n * Persistent commands (dev/start) are exempt from the exit for the same\n * reason as the catch block in `execute`: by the time they reach this point\n * they own a run loop that is expected to survive runtime errors so HMR or a\n * supervisor can recover. They still print — silence is what made this class\n * of failure invisible in the first place.\n */\n protected fatalAsyncErrorReported = false;\n\n protected captureFatalAsyncErrors(command: CLICommand) {\n const onFatalAsyncError = (reason: unknown) => {\n // A rejection reason is not necessarily an Error (`Promise.reject(\"x\")`),\n // and a crash handler must never itself throw.\n const error = reason instanceof Error ? reason : new Error(String(reason));\n\n // Set before printing, so the deferred success banner is suppressed even\n // if displaying the error yields.\n this.fatalAsyncErrorReported = true;\n\n displayCommandError(command.name, error);\n\n if (!command.isPersistent) {\n exitAfterFlush(1);\n }\n };\n\n process.on(\"unhandledRejection\", onFatalAsyncError);\n process.on(\"uncaughtException\", onFatalAsyncError);\n }\n\n /**\n * Load preloaders\n */\n protected async loadPreloaders(command: CLICommand) {\n const preloaders = command.commandPreload || {};\n\n if (preloaders.runtimeStrategy) {\n Application.setRuntimeStrategy(preloaders.runtimeStrategy);\n }\n\n // Override, not a default: a command that declares an environment gets it\n // regardless of what the shell exported. Then read it back — `process.env`\n // is process-global and anything may have written to it, so a value that\n // did not take must fail here, loudly, rather than surface later as a\n // production React bundle under `warlock dev`.\n if (preloaders.environment) {\n Application.setEnvironment(preloaders.environment);\n\n if (process.env.NODE_ENV !== preloaders.environment) {\n throw new Error(\n `Command \"${command.name}\" set NODE_ENV to \"${preloaders.environment}\", but it read back as ` +\n `\"${process.env.NODE_ENV}\". The environment did not take, and every decision made ` +\n `downstream of it — env file selection, bundler dep optimisation — would be wrong.`,\n );\n }\n }\n\n // Env BEFORE config, unconditionally, for every command.\n //\n // `warlock.config.ts` is a module whose body runs on import, and projects\n // legitimately call `env(\"BUILD_OUT\", \"dist\")` in it. Loading config first\n // evaluated that body against an empty env store, so every such call\n // silently returned its default — under `build` and `start`, which never\n // loaded env at all, and under `dev` too, because config was loaded first\n // regardless. The ordering is load-bearing in the other direction as well:\n // `loadEnv()` reads `process.env.NODE_ENV` at call time to choose\n // `.env.<NODE_ENV>` over `.env`, so it must follow `setEnvironment` above.\n await loadEnvironmentFiles();\n\n await warlockConfigManager.load();\n\n if (preloaders.config || preloaders.bootstrap || preloaders.prestart) {\n await filesOrchestrator.init();\n }\n\n // `preloaders.env` is gone: env is loaded above for every command, so the\n // branch that used to serve it could only re-parse the same files and\n // re-override `process.env` a second time.\n if (preloaders.bootstrap) {\n await bootstrap();\n\n if (await fileExistsAsync(appPath(\"bootstrap.ts\"))) {\n await filesOrchestrator.load(\"src/app/bootstrap.ts\");\n }\n }\n\n // Load configuration files\n if (preloaders.config) {\n await loadConfigFiles(preloaders.config);\n }\n\n if (preloaders.prestart) {\n if (await fileExistsAsync(appPath(\"prestart.ts\"))) {\n await filesOrchestrator.load(\"src/app/prestart.ts\");\n }\n }\n\n // Initialize connectors.\n // `connectors: true` only starts the early phase here — late-phase\n // connectors (http, socket) start after the command's action loads\n // app code. Explicit lists bypass phase splitting (caller knows\n // exactly which connectors they want).\n if (preloaders.connectors) {\n // REGISTER before starting — the non-bundled counterpart of section 2.5\n // of the generated production entry, and the \"dev preloader\" path\n // `register-configured-connectors.ts` documents.\n //\n // Without this, `warlock.config.ts > connectors` drove the BUILD only:\n // `warlock build` read the array to drain each connector's contribution,\n // but under `warlock dev` nothing ever registered it, so an app had to\n // call `connectorsManager.register(...)` from its own `main.ts` to get a\n // connector running. Apps that did BOTH then registered the same\n // connector twice in production — once here from the baked config, once\n // from their own app code — and it booted twice, which surfaced as\n // `Route name \"...\" is already taken` while installing page routes.\n //\n // The array is omitted deliberately, so the function reads the config\n // loaded above; `expectedNames` is omitted too, because drift is a\n // build↔runtime relationship and dev has no build to drift from.\n //\n // The idempotency this function provides is against ITSELF — a second\n // call skips names the first registered. It does NOT protect against an\n // app calling `connectorsManager.register()` directly, which pushes\n // unconditionally, and which runs AFTER this point in both modes. So a\n // connector belongs in the config array or in app code, never both:\n // listing it in both is the duplicate this comment's route-name error\n // describes.\n registerConfiguredConnectors();\n\n // Fail fast on a busy port BEFORE the early-phase connectors (database,\n // cache, ...) connect. `http` itself is a LATE-phase connector, so its\n // own preflight is not reached until after those early connectors are\n // up and every app module has been imported — 7-13s of work discarded\n // before anyone learns the port was taken. This is the dev-preload\n // counterpart of the check the generated production entry runs at the\n // same point in its own boot sequence (`production-builder.ts`, step\n // 2.6) — a cheap bind-and-release probe, not a connector reorder.\n // Only when this boot will actually start http: a scoped list without\n // \"http\" (seed, migrate, …) never binds the port, so probing it would\n // collide with a running dev server on a port it never uses (f9ace89e).\n if (shouldPreflightHttpPort(preloaders.connectors)) {\n await preflightConfiguredHttpPort();\n }\n\n if (preloaders.connectors === true) {\n await connectorsManager.startPhase(ConnectorLifecyclePhase.Early);\n } else {\n await connectorsManager.start(preloaders.connectors);\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAM,oBAAoB;;;;;;;;;AAU1B,SAAS,eAAe,MAAc;CACpC,QAAQ,WAAW;CAEnB,MAAM,QAAQ,iBAAiB,QAAQ,KAAK,IAAI,GAAG,iBAAiB;CACpE,MAAM,QAAQ;CAEd,IAAI,UAAU;CACd,MAAM,gBAAgB;EACpB,IAAI,EAAE,UAAU,GAAG;EAEnB,aAAa,KAAK;EAClB,QAAQ,KAAK,IAAI;CACnB;CAIA,QAAQ,OAAO,MAAM,IAAI,OAAO;CAChC,QAAQ,OAAO,MAAM,IAAI,OAAO;AAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAS,oBAA6B;CACpC,OAAO,YAAY;AACrB;AAEA,IAAa,qBAAb,MAAgC;;kBAIE,CAAC;qCAKa,IAAI,IAAI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Q,aAAa,CAAC,GAC9C,MAAM,kBAAkB,KAAK,qBAAqB;EACpD;EAQF,IAAI,WAAW,YAAY;GAyBzB,6BAA6B;GAa7B,IAAI,wBAAwB,WAAW,UAAU,GAC/C,MAAM,4BAA4B;GAGpC,IAAI,WAAW,eAAe,MAC5B,MAAM,kBAAkB,kBAAwC;QAEhE,MAAM,kBAAkB,MAAM,WAAW,UAAU;EAEvD;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"cli-commands.manager.mjs","names":[],"sources":["../../../../../../../../packages/core/src/cli/cli-commands.manager.ts"],"sourcesContent":["import { toCamelCase } from \"@mongez/reinforcements\";\nimport { colors } from \"@mongez/copper\";\nimport { fileExistsAsync } from \"@warlock.js/fs\";\nimport { Application } from \"../application\";\nimport { bootstrap } from \"../bootstrap\";\nimport { loadConfigFiles } from \"../config/load-config-files\";\nimport { connectorsManager } from \"../connectors/connectors-manager\";\nimport { registerConfiguredConnectors } from \"../connectors/register-configured-connectors\";\nimport { ConnectorLifecyclePhase } from \"../connectors/types\";\nimport { filesOrchestrator } from \"../dev-server/files-orchestrator\";\nimport { isDevWorker } from \"../dev-server/supervisor\";\nimport { preflightConfiguredHttpPort, shouldPreflightHttpPort } from \"../http/boot-port-preflight\";\nimport { manifestManager } from \"../manifest/manifest-manager\";\nimport { appPath } from \"../utils\";\nimport { loadEnvironmentFiles } from \"../utils/load-environment\";\nimport { warlockConfigManager } from \"../warlock-config/warlock-config.manager\";\nimport { CLICommand } from \"../commands/cli-command\";\nimport {\n displayBootError,\n displayCommandError,\n displayCommandHelp,\n displayCommandNotFound,\n displayCommandSuccess,\n displayExecutingCommand,\n displayHelp,\n displayMissingCommand,\n displayMissingOptions,\n displayWarlockVersionInTerminal,\n type HelpCommandInfo,\n isMatchingCommandName,\n} from \"./cli-commands.utils\";\nimport { cliCommandsLoader } from \"./commands-loader\";\nimport { frameworkCommands } from \"./framework-cli-commands\";\nimport { CliOptionValueError, type ParsedCliArgs, parseCliArgs } from \"./parse-cli-args\";\nimport { findSimilar } from \"./string-similarity\";\nimport type { CommandActionData, ResolvedCLICommandOption } from \"../commands/types\";\n\n/**\n * Best-effort budget (ms) for draining stdout/stderr before a forced exit.\n * Bounded so a stuck stream can never hang the CLI.\n */\nconst EXIT_FLUSH_BUDGET = 500;\n\n/**\n * Exit with `code` once stdout/stderr have drained.\n *\n * `process.exit()` truncates writes still queued on a non-TTY stdout — a pipe,\n * a CI log — which is how the *reason* for a failure gets lost even when the\n * exit code is right. `exitCode` is set up front so that a natural exit (should\n * the drain outlive the process's remaining work) is non-zero too.\n */\nfunction exitAfterFlush(code: number) {\n process.exitCode = code;\n\n const timer = setTimeout(() => process.exit(code), EXIT_FLUSH_BUDGET);\n timer.unref?.();\n\n let pending = 2;\n const drained = () => {\n if (--pending > 0) return;\n\n clearTimeout(timer);\n process.exit(code);\n };\n\n // A zero-length write's callback fires once everything queued ahead of it has\n // been handed to the OS.\n process.stdout.write(\"\", drained);\n process.stderr.write(\"\", drained);\n}\n\n/**\n * How a command run ended, from the process's point of view.\n *\n * - `succeeded` — finished, nothing rejected afterwards; the CLI may exit 0.\n * - `failed` — reported an error; the exit code is owned by whoever reported it.\n * - `running` — a persistent command (dev/start) now owns the process.\n *\n * `execute` returns this instead of exiting on success itself. A method that\n * terminates the process out from under its caller cannot be awaited honestly:\n * the exit it schedules outlives the call, so the success it represents is\n * still unsettled when `execute` resolves — which is exactly how a green check\n * ends up printed next to the failure that contradicts it.\n */\nexport type CommandRunVerdict = \"succeeded\" | \"failed\" | \"running\";\n\n/**\n * Whether this process is the CHILD half of a supervised command.\n *\n * ## The finding this encodes\n *\n * `warlock dev` printing `› Running dev...` twice was NOT a double boot, and\n * the distinction is the whole point of this function existing rather than the\n * line simply being deleted. The sequence, in file order:\n *\n * 1. `execute()` prints the header (below) — BEFORE `commandPreAction`.\n * 2. `cli/commands/dev-server.command.ts` `preAction` calls\n * `superviseDevServer()` when `!isDevWorker()`.\n * 3. `dev-server/supervisor.ts` `spawnWorker()` re-spawns `process.argv` with\n * `WARLOCK_DEV_WORKER=1`, so the child runs `warlock dev` again and prints\n * the header too.\n * 4. `superviseDevServer()` returns a promise that never settles, so the\n * supervisor's `await commandPreAction(...)` never resolves — `loadPreloaders`\n * and `command.execute` are unreachable in the supervisor.\n *\n * Step 4 is why only ONE process ever loads config, connectors, app modules or\n * a scheduler. Verified by running it: one `APP-CODE-LOADED`, one\n * `Application.markBooted`, one `⚡ Warlock.js` banner, one route registration,\n * two processes. The `2 job(s) registered` in the original report is two jobs\n * in one scheduler, not two schedulers — a genuine double boot would have\n * printed that warning twice.\n *\n * So the defect is exactly one duplicated line, and this is the guard that\n * keeps it one. `tests/unit/cli/dev-command-single-boot.test.ts` fails if the\n * supervisor ever starts running preloaders — i.e. if the double boot the\n * duplicated line looked like ever becomes real.\n */\nfunction isRespawnedWorker(): boolean {\n return isDevWorker();\n}\n\nexport class CLICommandsManager {\n /**\n * List of commands\n */\n public commands: CLICommand[] = [];\n\n /**\n * Commands map (name -> command)\n */\n public commandsMap: Map<string, CLICommand> = new Map();\n\n /**\n * Alias map (alias -> command name)\n */\n public aliasMap: Map<string, string> = new Map();\n\n /**\n * Register the given commands\n */\n public register(...commands: CLICommand[]): this {\n this.commands.push(...commands);\n\n commands.forEach((command) => {\n // `split` always yields a first element, so this holds. Falling back to\n // the whole name rather than asserting keeps the map keyed by a REAL\n // command name — a key of `undefined` would register the command under\n // the literal string \"undefined\" and make it unreachable by its own name.\n const commandKey = command.name.split(\" \")[0] ?? command.name;\n\n manifestManager.addCommandToList(command.name, {\n relativePath: command.commandRelativePath,\n source: command.commandSource || \"project\",\n description: command.commandDescription,\n alias: command.commandAlias,\n options: command.commandOptions.length > 0 ? command.commandOptions : undefined,\n });\n\n this.commandsMap.set(commandKey, command);\n\n // Register alias if exists\n if (command.commandAlias) {\n this.aliasMap.set(command.commandAlias, commandKey);\n }\n });\n\n return this;\n }\n\n /**\n * Get command by name or alias\n */\n public getCommand(name: string): CLICommand | undefined {\n // First try direct lookup\n let command = this.commandsMap.get(name);\n if (command) return command;\n\n // Try alias lookup\n const realName = this.aliasMap.get(name);\n if (realName) {\n return this.commandsMap.get(realName);\n }\n\n return;\n }\n\n /**\n * Get all command names and aliases\n * Used for fuzzy matching suggestions\n */\n public getAllCommandNames(): string[] {\n const names: string[] = [];\n\n // Add all command names\n for (const name of this.commandsMap.keys()) {\n names.push(name);\n }\n\n // Add all aliases\n for (const alias of this.aliasMap.keys()) {\n names.push(alias);\n }\n\n // Also include cached commands from manifest\n const manifestCommands = manifestManager.commandsJson?.commands || {};\n // `Object.entries` rather than keys + index: the index read is\n // `T | undefined` under the strictness contract even for a key that came\n // from the object itself, and these names feed the CLI's \"did you mean?\"\n // suggestions — a literal \"undefined\" in that list is a suggestion no\n // operator can act on.\n for (const [name, meta] of Object.entries(manifestCommands)) {\n const baseName = name.split(\" \")[0] ?? name;\n\n if (!names.includes(baseName)) {\n names.push(baseName);\n }\n\n const alias = meta?.alias;\n\n if (alias && !names.includes(alias)) {\n names.push(alias);\n }\n }\n\n return names;\n }\n\n /**\n * Start the cli manager\n */\n public async start() {\n // Schema-less first pass: it exists to discover the command name and the\n // command-independent flags (--help, --version, --no-cache). Values here are\n // raw strings; the typed pass below is the one whose options reach a command.\n const { name, options } = parseCliArgs(process.argv);\n\n if (options.noCache) {\n manifestManager.clearCommandsCache();\n // remove the commands.json file as wel\n await manifestManager.removeCommandsFile();\n }\n\n // `-v` is only the version flag when no command was given: after a command\n // name it is that command's own short flag (`--with-validation`).\n if (options.version || (options.v && !name)) {\n await displayWarlockVersionInTerminal();\n process.exit(0);\n }\n\n // Try to load from manifest first (fastest path)\n await manifestManager.loadCommands();\n\n // Register framework commands first (needed for help)\n this.register(\n ...frameworkCommands.map((command) => {\n if (!command.commandSource) {\n command.commandSource = \"framework\";\n }\n return command;\n }),\n );\n\n const isHelpCommand = options.help || options.h;\n\n // Handle global help (no command)\n if (!name && isHelpCommand) {\n await this.showGlobalHelp();\n process.exit(0);\n }\n\n // Handle warm cache\n if (options.warmCache) {\n await this.warmCache();\n process.exit(0);\n }\n\n if (!name) {\n displayMissingCommand();\n process.exit(1);\n }\n\n const command = await this.lazyGetCommand(name);\n\n if (manifestManager.hasChanges) {\n await manifestManager.saveCommands();\n }\n\n if (!command) {\n // Find similar commands for suggestions\n const allCommandNames = this.getAllCommandNames();\n const suggestions = findSimilar(name, allCommandNames).map((s) => s.value);\n\n displayCommandNotFound(name, suggestions);\n process.exit(1);\n }\n\n // Handle command-specific help\n if (isHelpCommand) {\n displayCommandHelp({\n name: command.name,\n alias: command.commandAlias,\n description: command.commandDescription,\n options: command.commandOptions,\n });\n process.exit(0);\n }\n\n // The first parse above had no command to consult, so every value in it is\n // a raw string. Now that the command is resolved, re-read argv against its\n // declared options so a `type: \"boolean\"` option arrives as a boolean.\n const resolved = this.resolveCommandArgs(command);\n\n const verdict = await this.execute(command, {\n options: resolved.options,\n args: resolved.args,\n });\n\n // The process-level exit belongs to the entrypoint, not to `execute`.\n // A one-shot command can leave a handle open (a db connection, a watcher a\n // plugin forgot to close), so the CLI exits explicitly rather than waiting\n // for the loop to drain — but only on a verdict of `succeeded`. `failed`\n // already exited non-zero through whoever reported it, and `running` means\n // a persistent command owns the process now.\n if (verdict === \"succeeded\") {\n exitAfterFlush(0);\n }\n }\n\n /**\n * Re-parse argv against the resolved command's declared options.\n *\n * parseCliArgs runs twice on purpose. The first run produces the command\n * name, and there is no schema to consult yet; the second one, here, can be\n * type-aware. Re-reading argv (rather than post-processing the first result)\n * is what makes `--rollback users.ts` recoverable: by the time the first pass\n * returns, the swallowed positional is indistinguishable from a value.\n */\n protected resolveCommandArgs(command: CLICommand, argv: string[] = process.argv): ParsedCliArgs {\n try {\n return parseCliArgs(argv, command.commandOptions);\n } catch (error) {\n if (error instanceof CliOptionValueError) {\n console.log();\n console.log(` ${colors.redBright(\"Error:\")} ${error.message}`);\n console.log();\n process.exit(1);\n }\n\n throw error;\n }\n }\n\n /**\n * Show global help with all commands\n * Uses manifest if available for fast display\n */\n protected async showGlobalHelp() {\n // Always rescan rather than trusting `.warlock/commands.json`: the manifest\n // has no invalidation, so a newly added project command stayed invisible\n // and a removed one lingered in help until `--warm-cache`.\n await this.loadPluginsCommands();\n\n const projectCommands = await cliCommandsLoader.scanAll();\n\n this.register(...projectCommands);\n\n await manifestManager.saveCommands();\n\n // Build help info from registered commands\n const helpCommands: HelpCommandInfo[] = this.commands.map((cmd) => ({\n name: cmd.name,\n alias: cmd.commandAlias,\n description: cmd.commandDescription,\n source: cmd.commandSource || \"project\",\n }));\n\n await displayHelp(helpCommands);\n }\n\n /**\n * Warm cache - scan all project commands and save to manifest\n */\n protected async warmCache() {\n console.log();\n console.log(` ${colors.cyan(\"›\")} Scanning project commands...`);\n\n const projectCommands = await cliCommandsLoader.scanAll();\n\n this.register(...projectCommands);\n\n await manifestManager.saveCommands();\n\n console.log(\n ` ${colors.green(\"✔\")} Cached ${colors.bold(String(projectCommands.length))} project commands`,\n );\n console.log();\n }\n\n /**\n * Load plugins commands\n */\n protected async loadPluginsCommands() {\n await warlockConfigManager.load();\n\n if (warlockConfigManager.isLoaded) {\n this.register(\n ...(warlockConfigManager.get(\"cli\")?.commands || []).map((command) => {\n if (!command.commandSource) {\n command.commandSource = \"plugin\";\n }\n return command;\n }),\n );\n }\n }\n\n /**\n * Try to find the command based on the given command name or alias\n */\n protected async lazyGetCommand(name: string) {\n // first step, try to find it directly through current commands\n let command = this.getCommand(name);\n if (command) {\n return command;\n }\n\n // second step, try to find it through warlock config commands\n await this.loadPluginsCommands();\n\n command = this.getCommand(name);\n\n if (command) {\n return command;\n }\n\n // third step, try to find it through project commands\n await this.loadProjectCommands(name);\n\n command = this.getCommand(name);\n if (command) {\n return command;\n }\n\n return null;\n }\n\n /**\n * Load project commands\n */\n protected async loadProjectCommands(name: string) {\n // first get the commands.json contents as an object\n const jsonCommandsFile = await manifestManager.loadCommands();\n\n if (jsonCommandsFile) {\n // Check by name or alias\n // `Object.entries` hands the metadata over already narrowed; a `for...in`\n // index read is `T | undefined` and every field below is read off it.\n for (const [fullCommandName, cmdMeta] of Object.entries(jsonCommandsFile.commands)) {\n if (cmdMeta === undefined) continue;\n\n // Match by name or alias\n if (isMatchingCommandName(fullCommandName, name) || cmdMeta.alias === name) {\n const commandPath = cmdMeta.relativePath;\n if (commandPath) {\n const executedCommand = await cliCommandsLoader.load(commandPath);\n\n if (executedCommand) {\n executedCommand.$relativePath(commandPath);\n this.register(executedCommand);\n return;\n }\n }\n }\n }\n }\n\n const command = await cliCommandsLoader.locate(name);\n\n if (command) {\n this.register(command);\n return;\n }\n }\n\n /**\n * Validate required options\n */\n protected validateOptions(\n command: CLICommand,\n options: Record<string, string | boolean | number>,\n ): ResolvedCLICommandOption[] {\n const missing: ResolvedCLICommandOption[] = [];\n\n command.commandOptions.forEach((opt) => {\n if (opt.required) {\n // Check if option is provided by name or alias\n const name = toCamelCase(opt.name);\n const alias = opt.alias ? toCamelCase(opt.alias) : \"\";\n const hasOption =\n options[name] !== undefined ||\n options[opt.name] !== undefined ||\n (alias && options[alias] !== undefined);\n if (!hasOption) {\n missing.push(opt);\n }\n }\n });\n\n return missing;\n }\n\n /**\n * Apply default values to options\n */\n protected applyDefaultOptions(\n command: CLICommand,\n options: Record<string, string | boolean | number>,\n ): Record<string, string | boolean | number> {\n const result = { ...options };\n\n command.commandOptions.forEach((declared) => {\n // Parsed keys are camelCase; normalise so commands built with raw kebab\n // names still resolve, and mirror the value to the kebab key.\n const camelName = toCamelCase(declared.name);\n const opt = {\n ...declared,\n name: camelName,\n alias: declared.alias ? toCamelCase(declared.alias) : declared.alias,\n };\n\n const declaredValue = result[declared.name];\n if (result[camelName] === undefined && declaredValue !== undefined) {\n result[camelName] = declaredValue;\n }\n\n if (opt.defaultValue !== undefined) {\n const hasOption =\n result[opt.name] !== undefined || (opt.alias && result[opt.alias] !== undefined);\n if (!hasOption) {\n result[opt.name] = opt.defaultValue;\n }\n }\n\n // `!== undefined`, not truthiness: `-r=false` now resolves to the boolean\n // `false`, and a truthiness test would drop it before it ever reached the\n // canonical name — leaving `rollback` undefined instead of explicitly off.\n if (\n opt.alias !== undefined &&\n result[opt.alias] !== undefined &&\n result[opt.name] === undefined\n ) {\n // The `!== undefined` guard on the line above already proves this read\n // is defined, but the compiler does not carry a guard on one index\n // expression to a second, textually identical one. Reading it into a\n // local makes the narrowing survive, WITHOUT weakening the check — an\n // `?? ` fallback here would resurrect exactly the bug the comment above\n // describes, turning an explicit `-r=false` into a default.\n const aliasValue = result[opt.alias];\n\n if (aliasValue !== undefined) {\n result[opt.name] = aliasValue;\n }\n }\n });\n\n return result;\n }\n\n /**\n * Execute the given command and report how it ended.\n *\n * Returning the verdict — rather than exiting on success from in here — is\n * what makes the awaited result trustworthy: see {@link CommandRunVerdict}.\n */\n public async execute(command: CLICommand, data: CommandActionData): Promise<CommandRunVerdict> {\n const startTime = Date.now();\n\n // Validate required options\n const missingOptions = this.validateOptions(command, data.options);\n if (missingOptions.length > 0) {\n displayMissingOptions(missingOptions);\n process.exit(1);\n }\n\n // Apply default values\n data.options = this.applyDefaultOptions(command, data.options);\n\n // ONE header per `warlock <command>` the user typed — not one per process.\n //\n // `warlock dev` is TWO processes by design: the invocation the user typed\n // becomes a thin supervisor (`dev-server/supervisor.ts`) that re-spawns\n // `process.argv` with `WARLOCK_DEV_WORKER=1`, and the child is the actual\n // server. Both are `warlock dev`, so both reached this line and the user saw\n //\n // › Running dev...\n // › Running dev...\n //\n // which reads exactly like the application booting twice. It is not — see\n // the block comment on `isRespawnedWorker` — but the line was still wrong,\n // and it re-printed on every crash-restart on top of the supervisor's own\n // \"restarting\" notice.\n //\n // The SUPERVISOR keeps the header, not the worker: it prints immediately\n // (so a slow boot is not silent), it prints once for the whole session\n // (restarts are already announced as restarts), and it is the process the\n // user actually started.\n if (!isRespawnedWorker()) {\n displayExecutingCommand(command.name);\n }\n\n if (command.commandPreAction) {\n await command.commandPreAction(data);\n }\n\n // load preloaders\n if (command.commandPreload) {\n try {\n await this.loadPreloaders(command);\n } catch (error) {\n // A preload failure (a bad import in a config file, a connector that\n // throws on boot, a missing module export) happens BEFORE the command's\n // action runs — there is no run loop to recover into, so it is ALWAYS\n // fatal, persistent command (dev/start) or not. Surface the real cause\n // and the offending file, then exit. This MUST stay outside the\n // command-execute try/catch below: letting a preload rejection escape\n // turned `warlock dev` into a silent hang — the unhandled rejection slid\n // past while the already-started loader worker thread kept the process\n // alive, freezing just after the banner with no error printed.\n displayBootError(command.name, error as Error);\n process.exit(1);\n }\n }\n\n this.captureFatalAsyncErrors(command);\n\n try {\n await command.execute(data);\n\n // Persistent commands (dev/start) hand control to their run loop here.\n // There is no success banner to print and nothing to exit for.\n if (command.isPersistent) return \"running\";\n\n // Yield one full event-loop turn before declaring success, and AWAIT that\n // yield. Node flags an unhandled rejection only after the current turn's\n // microtasks drain, so reporting success synchronously here fired FIRST\n // and erased the failure — a `build` whose async work rejected exited 0\n // having emitted nothing.\n //\n // The await is the load-bearing part, not the yield. Scheduling this as a\n // bare `setImmediate` let `execute()` RESOLVE while the verdict was still\n // pending: the callback outlived the call it belonged to, so the green\n // check could surface after the caller had already moved on — in a later\n // command, or after a rejection reported in the interim, which the guard\n // below cannot see because by then it reads the state of a run that has\n // already ended. Awaiting binds the banner to THIS invocation: `execute`\n // does not resolve until the verdict it is about to report has settled.\n //\n // `setImmediate` runs in the same loop iteration's check phase, so this\n // cannot hang on a lingering handle the way dropping the exit would; it\n // only lets `captureFatalAsyncErrors` win the race when there is one.\n await new Promise<void>((resolve) => setImmediate(resolve));\n\n // The yield is what gives a floating rejection the chance to be reported;\n // this is what acts on it. A green check printed after that error would\n // contradict it, and the exit that follows would reset `process.exitCode`\n // to 0 — re-erasing the very failure this whole path exists to surface.\n if (this.fatalAsyncErrorReported) return \"failed\";\n\n displayCommandSuccess(command.name, Date.now() - startTime);\n\n return \"succeeded\";\n } catch (error) {\n displayCommandError(command.name, error as Error);\n // Persistent commands (dev/start) own their startup-failure exits;\n // by the time an error reaches here they've already entered their\n // run loop, so it's a runtime error we log but don't crash on —\n // HMR or process supervisors can recover. Non-persistent\n // one-shot commands always exit on failure.\n if (!command.isPersistent) {\n process.exit(1);\n }\n\n return \"failed\";\n }\n }\n\n /**\n * Fail loudly on async errors that escape the command's own promise.\n *\n * `execute` awaits `command.execute(data)`, but work the command merely\n * *started* settles outside that await — `@mongez/events` `trigger` /\n * `triggerAll` are synchronous and do not await their listeners, so an async\n * listener that throws leaves a floating rejection behind. Node reports it at\n * the end of the turn, by which point the CLI had already exited 0: the\n * failure was erased and the command looked green.\n *\n * Persistent commands (dev/start) are exempt from the exit for the same\n * reason as the catch block in `execute`: by the time they reach this point\n * they own a run loop that is expected to survive runtime errors so HMR or a\n * supervisor can recover. They still print — silence is what made this class\n * of failure invisible in the first place.\n */\n protected fatalAsyncErrorReported = false;\n\n protected captureFatalAsyncErrors(command: CLICommand) {\n const onFatalAsyncError = (reason: unknown) => {\n // A rejection reason is not necessarily an Error (`Promise.reject(\"x\")`),\n // and a crash handler must never itself throw.\n const error = reason instanceof Error ? reason : new Error(String(reason));\n\n // Set before printing, so the deferred success banner is suppressed even\n // if displaying the error yields.\n this.fatalAsyncErrorReported = true;\n\n displayCommandError(command.name, error);\n\n if (!command.isPersistent) {\n exitAfterFlush(1);\n }\n };\n\n process.on(\"unhandledRejection\", onFatalAsyncError);\n process.on(\"uncaughtException\", onFatalAsyncError);\n }\n\n /**\n * Load preloaders\n */\n protected async loadPreloaders(command: CLICommand) {\n const preloaders = command.commandPreload || {};\n\n if (preloaders.runtimeStrategy) {\n Application.setRuntimeStrategy(preloaders.runtimeStrategy);\n }\n\n // Override, not a default: a command that declares an environment gets it\n // regardless of what the shell exported. Then read it back — `process.env`\n // is process-global and anything may have written to it, so a value that\n // did not take must fail here, loudly, rather than surface later as a\n // production React bundle under `warlock dev`.\n if (preloaders.environment) {\n Application.setEnvironment(preloaders.environment);\n\n if (process.env.NODE_ENV !== preloaders.environment) {\n throw new Error(\n `Command \"${command.name}\" set NODE_ENV to \"${preloaders.environment}\", but it read back as ` +\n `\"${process.env.NODE_ENV}\". The environment did not take, and every decision made ` +\n `downstream of it — env file selection, bundler dep optimisation — would be wrong.`,\n );\n }\n }\n\n // Env BEFORE config, unconditionally, for every command.\n //\n // `warlock.config.ts` is a module whose body runs on import, and projects\n // legitimately call `env(\"BUILD_OUT\", \"dist\")` in it. Loading config first\n // evaluated that body against an empty env store, so every such call\n // silently returned its default — under `build` and `start`, which never\n // loaded env at all, and under `dev` too, because config was loaded first\n // regardless. The ordering is load-bearing in the other direction as well:\n // `loadEnv()` reads `process.env.NODE_ENV` at call time to choose\n // `.env.<NODE_ENV>` over `.env`, so it must follow `setEnvironment` above.\n await loadEnvironmentFiles();\n\n await warlockConfigManager.load();\n\n if (preloaders.config || preloaders.bootstrap || preloaders.prestart) {\n await filesOrchestrator.init();\n }\n\n // `preloaders.env` is gone: env is loaded above for every command, so the\n // branch that used to serve it could only re-parse the same files and\n // re-override `process.env` a second time.\n if (preloaders.bootstrap) {\n await bootstrap();\n\n if (await fileExistsAsync(appPath(\"bootstrap.ts\"))) {\n await filesOrchestrator.load(\"src/app/bootstrap.ts\");\n }\n }\n\n // Load configuration files\n if (preloaders.config) {\n await loadConfigFiles(preloaders.config);\n }\n\n if (preloaders.prestart) {\n if (await fileExistsAsync(appPath(\"prestart.ts\"))) {\n await filesOrchestrator.load(\"src/app/prestart.ts\");\n }\n }\n\n // Initialize connectors.\n // `connectors: true` only starts the early phase here — late-phase\n // connectors (http, socket) start after the command's action loads\n // app code. Explicit lists bypass phase splitting (caller knows\n // exactly which connectors they want).\n if (preloaders.connectors) {\n // REGISTER before starting — the non-bundled counterpart of section 2.5\n // of the generated production entry, and the \"dev preloader\" path\n // `register-configured-connectors.ts` documents.\n //\n // Without this, `warlock.config.ts > connectors` drove the BUILD only:\n // `warlock build` read the array to drain each connector's contribution,\n // but under `warlock dev` nothing ever registered it, so an app had to\n // call `connectorsManager.register(...)` from its own `main.ts` to get a\n // connector running. Apps that did BOTH then registered the same\n // connector twice in production — once here from the baked config, once\n // from their own app code — and it booted twice, which surfaced as\n // `Route name \"...\" is already taken` while installing page routes.\n //\n // The array is omitted deliberately, so the function reads the config\n // loaded above; `expectedNames` is omitted too, because drift is a\n // build↔runtime relationship and dev has no build to drift from.\n //\n // The idempotency this function provides is against ITSELF — a second\n // call skips names the first registered. It does NOT protect against an\n // app calling `connectorsManager.register()` directly, which pushes\n // unconditionally, and which runs AFTER this point in both modes. So a\n // connector belongs in the config array or in app code, never both:\n // listing it in both is the duplicate this comment's route-name error\n // describes.\n registerConfiguredConnectors();\n\n // Fail fast on a busy port BEFORE the early-phase connectors (database,\n // cache, ...) connect. `http` itself is a LATE-phase connector, so its\n // own preflight is not reached until after those early connectors are\n // up and every app module has been imported — 7-13s of work discarded\n // before anyone learns the port was taken. This is the dev-preload\n // counterpart of the check the generated production entry runs at the\n // same point in its own boot sequence (`production-builder.ts`, step\n // 2.6) — a cheap bind-and-release probe, not a connector reorder.\n // Only when this boot will actually start http: a scoped list without\n // \"http\" (seed, migrate, …) never binds the port, so probing it would\n // collide with a running dev server on a port it never uses (f9ace89e).\n if (shouldPreflightHttpPort(preloaders.connectors)) {\n await preflightConfiguredHttpPort();\n }\n\n if (preloaders.connectors === true) {\n await connectorsManager.startPhase(ConnectorLifecyclePhase.Early);\n } else {\n await connectorsManager.start(preloaders.connectors);\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAM,oBAAoB;;;;;;;;;AAU1B,SAAS,eAAe,MAAc;CACpC,QAAQ,WAAW;CAEnB,MAAM,QAAQ,iBAAiB,QAAQ,KAAK,IAAI,GAAG,iBAAiB;CACpE,MAAM,QAAQ;CAEd,IAAI,UAAU;CACd,MAAM,gBAAgB;EACpB,IAAI,EAAE,UAAU,GAAG;EAEnB,aAAa,KAAK;EAClB,QAAQ,KAAK,IAAI;CACnB;CAIA,QAAQ,OAAO,MAAM,IAAI,OAAO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BAAkB,KAAK;EAM/B,IAAI,WAAW,WAAW;GACxB,MAAM,UAAU;GAEhB,IAAI,MAAM,gBAAgB,QAAQ,cAAc,CAAC,GAC/C,MAAM,kBAAkB,KAAK,sBAAsB;EAEvD;EAGA,IAAI,WAAW,QACb,MAAM,gBAAgB,WAAW,MAAM;EAGzC,IAAI,WAAW,UACb;OAAI,MAAM,gBAAgB,QAAQ,aAAa,CAAC,GAC9C,MAAM,kBAAkB,KAAK,qBAAqB;EACpD;EAQF,IAAI,WAAW,YAAY;GAyBzB,6BAA6B;GAa7B,IAAI,wBAAwB,WAAW,UAAU,GAC/C,MAAM,4BAA4B;GAGpC,IAAI,WAAW,eAAe,MAC5B,MAAM,kBAAkB,kBAAwC;QAEhE,MAAM,kBAAkB,MAAM,WAAW,UAAU;EAEvD;CACF;AACF"}
|
|
@@ -36,8 +36,9 @@ function formatWriteStatus(result) {
|
|
|
36
36
|
*/
|
|
37
37
|
async function agentsMdCommandAction({ options }) {
|
|
38
38
|
const cwd = process.cwd();
|
|
39
|
+
const boot = await withConsoleOnStderr(() => bootForInspect(cwd));
|
|
39
40
|
const report = await inspectApp({
|
|
40
|
-
...inspectOptionsFromBoot(
|
|
41
|
+
...inspectOptionsFromBoot(boot),
|
|
41
42
|
cwd,
|
|
42
43
|
sections: AGENTS_MD_SECTIONS
|
|
43
44
|
});
|
|
@@ -65,5 +66,5 @@ async function agentsMdCommandAction({ options }) {
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
//#endregion
|
|
68
|
-
export { agentsMdCommandAction };
|
|
69
|
+
export { AGENTS_MD_SECTIONS, agentsMdCommandAction, formatWriteStatus };
|
|
69
70
|
//# sourceMappingURL=agents-md-command.action.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-md-command.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/agents-md/agents-md-command.action.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { CommandActionData } from \"../../../commands/types\";\nimport { AGENTS_MD_FILE } from \"../../../tooling/agents-md/agents-md-markers\";\nimport { listInstalledSkills } from \"../../../tooling/agents-md/installed-skills\";\nimport { listAppModules, renderAgentsMdSection } from \"../../../tooling/agents-md/render-agents-md\";\nimport {\n writeAgentsMd,\n type WriteAgentsMdResult,\n} from \"../../../tooling/agents-md/write-agents-md\";\nimport { bootForInspect, inspectOptionsFromBoot } from \"../../../tooling/inspect/boot-for-inspect\";\nimport { inspectApp } from \"../../../tooling/inspect/inspect-app\";\nimport type { InspectSection } from \"../../../tooling/inspect/inspect-report.types\";\nimport { withConsoleOnStderr } from \"../routes/with-console-on-stderr\";\n\n/** The inspect sections the generated section reads. */\nexport const AGENTS_MD_SECTIONS: readonly InspectSection[] = [\"routes\", \"models\", \"packages\"];\n\n/** The one line `warlock agents-md --write` prints. */\nexport function formatWriteStatus(result: Pick<WriteAgentsMdResult, \"file\" | \"status\">): string {\n const file = path.relative(process.cwd(), result.file) || AGENTS_MD_FILE;\n\n switch (result.status) {\n case \"created\":\n return `Created ${file} with the generated section.`;\n case \"updated\":\n return `Updated the generated section of ${file}.`;\n case \"unchanged\":\n return `${file} is up to date.`;\n default:\n return `${file} does not exist; nothing written.`;\n }\n}\n\n/**\n * Action behind `warlock agents-md`.\n *\n * Boots the app read-only (the inspect boot pass) with boot output on stderr,\n * then prints the section (no flag), writes it (`--write`) or prints\n * `{ file, status, section }` (`--json`; `status` is `\"printed\"` without\n * `--write`). Malformed markers throw `WL7501` and nothing is written.\n *\n * @param data Parsed CLI args: `options.write`, `options.json`.\n */\nexport async function agentsMdCommandAction({ options }: CommandActionData): Promise<void> {\n const cwd = process.cwd();\n const boot = await withConsoleOnStderr(() => bootForInspect(cwd));\n const report = await inspectApp({\n ...inspectOptionsFromBoot(boot),\n cwd,\n sections: AGENTS_MD_SECTIONS,\n });\n\n if (options.write === true) {\n const result = writeAgentsMd({ cwd, report });\n\n console.log(\n options.json === true ? JSON.stringify(result, null, 2) : formatWriteStatus(result),\n );\n return;\n }\n\n const section = renderAgentsMdSection(report, {\n skills: listInstalledSkills(cwd),\n modules: listAppModules(cwd),\n });\n\n if (options.json === true) {\n console.log(\n JSON.stringify({ file: path.join(cwd, AGENTS_MD_FILE), status: \"printed\", section }, null, 2),\n );\n return;\n }\n\n process.stdout.write(section);\n}\n"],"mappings":";;;;;;;;;;;AAeA,MAAa,qBAAgD;CAAC;CAAU;CAAU;AAAU;;AAG5F,SAAgB,kBAAkB,QAA8D;CAC9F,MAAM,OAAO,KAAK,SAAS,QAAQ,IAAI,GAAG,OAAO,IAAI;CAErD,QAAQ,OAAO,QAAf;EACE,KAAK,WACH,OAAO,WAAW,KAAK;EACzB,KAAK,WACH,OAAO,oCAAoC,KAAK;EAClD,KAAK,aACH,OAAO,GAAG,KAAK;EACjB,SACE,OAAO,GAAG,KAAK;CACnB;AACF;;;;;;;;;;;AAYA,eAAsB,sBAAsB,EAAE,WAA6C;CACzF,MAAM,MAAM,QAAQ,IAAI;
|
|
1
|
+
{"version":3,"file":"agents-md-command.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/agents-md/agents-md-command.action.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { CommandActionData } from \"../../../commands/types\";\nimport { AGENTS_MD_FILE } from \"../../../tooling/agents-md/agents-md-markers\";\nimport { listInstalledSkills } from \"../../../tooling/agents-md/installed-skills\";\nimport { listAppModules, renderAgentsMdSection } from \"../../../tooling/agents-md/render-agents-md\";\nimport {\n writeAgentsMd,\n type WriteAgentsMdResult,\n} from \"../../../tooling/agents-md/write-agents-md\";\nimport { bootForInspect, inspectOptionsFromBoot } from \"../../../tooling/inspect/boot-for-inspect\";\nimport { inspectApp } from \"../../../tooling/inspect/inspect-app\";\nimport type { InspectSection } from \"../../../tooling/inspect/inspect-report.types\";\nimport { withConsoleOnStderr } from \"../routes/with-console-on-stderr\";\n\n/** The inspect sections the generated section reads. */\nexport const AGENTS_MD_SECTIONS: readonly InspectSection[] = [\"routes\", \"models\", \"packages\"];\n\n/** The one line `warlock agents-md --write` prints. */\nexport function formatWriteStatus(result: Pick<WriteAgentsMdResult, \"file\" | \"status\">): string {\n const file = path.relative(process.cwd(), result.file) || AGENTS_MD_FILE;\n\n switch (result.status) {\n case \"created\":\n return `Created ${file} with the generated section.`;\n case \"updated\":\n return `Updated the generated section of ${file}.`;\n case \"unchanged\":\n return `${file} is up to date.`;\n default:\n return `${file} does not exist; nothing written.`;\n }\n}\n\n/**\n * Action behind `warlock agents-md`.\n *\n * Boots the app read-only (the inspect boot pass) with boot output on stderr,\n * then prints the section (no flag), writes it (`--write`) or prints\n * `{ file, status, section }` (`--json`; `status` is `\"printed\"` without\n * `--write`). Malformed markers throw `WL7501` and nothing is written.\n *\n * @param data Parsed CLI args: `options.write`, `options.json`.\n */\nexport async function agentsMdCommandAction({ options }: CommandActionData): Promise<void> {\n const cwd = process.cwd();\n const boot = await withConsoleOnStderr(() => bootForInspect(cwd));\n const report = await inspectApp({\n ...inspectOptionsFromBoot(boot),\n cwd,\n sections: AGENTS_MD_SECTIONS,\n });\n\n if (options.write === true) {\n const result = writeAgentsMd({ cwd, report });\n\n console.log(\n options.json === true ? JSON.stringify(result, null, 2) : formatWriteStatus(result),\n );\n return;\n }\n\n const section = renderAgentsMdSection(report, {\n skills: listInstalledSkills(cwd),\n modules: listAppModules(cwd),\n });\n\n if (options.json === true) {\n console.log(\n JSON.stringify({ file: path.join(cwd, AGENTS_MD_FILE), status: \"printed\", section }, null, 2),\n );\n return;\n }\n\n process.stdout.write(section);\n}\n"],"mappings":";;;;;;;;;;;AAeA,MAAa,qBAAgD;CAAC;CAAU;CAAU;AAAU;;AAG5F,SAAgB,kBAAkB,QAA8D;CAC9F,MAAM,OAAO,KAAK,SAAS,QAAQ,IAAI,GAAG,OAAO,IAAI;CAErD,QAAQ,OAAO,QAAf;EACE,KAAK,WACH,OAAO,WAAW,KAAK;EACzB,KAAK,WACH,OAAO,oCAAoC,KAAK;EAClD,KAAK,aACH,OAAO,GAAG,KAAK;EACjB,SACE,OAAO,GAAG,KAAK;CACnB;AACF;;;;;;;;;;;AAYA,eAAsB,sBAAsB,EAAE,WAA6C;CACzF,MAAM,MAAM,QAAQ,IAAI;CACxB,MAAM,OAAO,MAAM,0BAA0B,eAAe,GAAG,CAAC;CAChE,MAAM,SAAS,MAAM,WAAW;EAC9B,GAAG,uBAAuB,IAAI;EAC9B;EACA,UAAU;CACZ,CAAC;CAED,IAAI,QAAQ,UAAU,MAAM;EAC1B,MAAM,SAAS,cAAc;GAAE;GAAK;EAAO,CAAC;EAE5C,QAAQ,IACN,QAAQ,SAAS,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC,IAAI,kBAAkB,MAAM,CACpF;EACA;CACF;CAEA,MAAM,UAAU,sBAAsB,QAAQ;EAC5C,QAAQ,oBAAoB,GAAG;EAC/B,SAAS,eAAe,GAAG;CAC7B,CAAC;CAED,IAAI,QAAQ,SAAS,MAAM;EACzB,QAAQ,IACN,KAAK,UAAU;GAAE,MAAM,KAAK,KAAK,KAAK,cAAc;GAAG,QAAQ;GAAW;EAAQ,GAAG,MAAM,CAAC,CAC9F;EACA;CACF;CAEA,QAAQ,OAAO,MAAM,OAAO;AAC9B"}
|