@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
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { withConsoleOnStderr } from "../routes/with-console-on-stderr.mjs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { readFile, stat } from "node:fs/promises";
|
|
5
|
+
import { resolve as resolve$1 } from "import-meta-resolve";
|
|
6
|
+
|
|
7
|
+
//#region ../../packages/core/src/cli/commands/ai/ai-command.action.ts
|
|
8
|
+
/** Resolve from the caller's project, including optional provider packages. */
|
|
9
|
+
async function loadMeasureModule(specifier, cwd = process.cwd()) {
|
|
10
|
+
const parent = pathToFileURL(path.join(cwd, "package.json")).href;
|
|
11
|
+
return import(resolve$1(specifier, parent));
|
|
12
|
+
}
|
|
13
|
+
function object(value) {
|
|
14
|
+
return value !== null && typeof value === "object";
|
|
15
|
+
}
|
|
16
|
+
function isMeasureModule(value) {
|
|
17
|
+
return typeof value.measure === "function" && typeof value.skills === "function";
|
|
18
|
+
}
|
|
19
|
+
function isModel(value) {
|
|
20
|
+
return object(value) && typeof value.name === "string" && typeof value.provider === "string" && typeof value.complete === "function" && typeof value.stream === "function" && (value.countTokens === void 0 || typeof value.countTokens === "function") && (value.pricing === void 0 || object(value.pricing) && typeof value.pricing.input === "number" && Number.isFinite(value.pricing.input) && value.pricing.input >= 0 && typeof value.pricing.output === "number" && Number.isFinite(value.pricing.output) && value.pricing.output >= 0);
|
|
21
|
+
}
|
|
22
|
+
function isTool(value) {
|
|
23
|
+
return object(value) && typeof value.name === "string" && typeof value.description === "string" && typeof value.execute === "function" && (value.input === void 0 || object(value.input) && object(value.input["~standard"]) && typeof value.input["~standard"].validate === "function");
|
|
24
|
+
}
|
|
25
|
+
/** SDK constructor/model signatures verified against the first-party adapter sources. */
|
|
26
|
+
async function resolveMeasureModel(id, modelModule, load = loadMeasureModule, env = process.env) {
|
|
27
|
+
if (modelModule) {
|
|
28
|
+
const exported = await load(modelModule);
|
|
29
|
+
const model = typeof exported.resolveModel === "function" ? await exported.resolveModel(id) : exported.model ?? exported.default;
|
|
30
|
+
if (!isModel(model)) throw new Error("--model-module must export a model or resolveModel(id) returning a model.");
|
|
31
|
+
return model;
|
|
32
|
+
}
|
|
33
|
+
const separator = id.indexOf(":");
|
|
34
|
+
const provider = separator < 0 ? "openai" : id.slice(0, separator);
|
|
35
|
+
const name = separator < 0 ? id : id.slice(separator + 1);
|
|
36
|
+
const adapters = {
|
|
37
|
+
openai: {
|
|
38
|
+
package: "@warlock.js/ai-openai",
|
|
39
|
+
sdk: "OpenAISDK",
|
|
40
|
+
key: "OPENAI_API_KEY"
|
|
41
|
+
},
|
|
42
|
+
anthropic: {
|
|
43
|
+
package: "@warlock.js/ai-anthropic",
|
|
44
|
+
sdk: "AnthropicSDK",
|
|
45
|
+
key: "ANTHROPIC_API_KEY"
|
|
46
|
+
},
|
|
47
|
+
google: {
|
|
48
|
+
package: "@warlock.js/ai-google",
|
|
49
|
+
sdk: "GoogleSDK",
|
|
50
|
+
key: "GEMINI_API_KEY"
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const adapter = Object.hasOwn(adapters, provider) ? adapters[provider] : void 0;
|
|
54
|
+
if (!adapter || !name) throw new Error("Use a model ID, openai:<id>, anthropic:<id>, google:<id>, or --model-module for a custom provider.");
|
|
55
|
+
const apiKey = env[adapter.key];
|
|
56
|
+
if (!apiKey) throw new Error(`Set ${adapter.key}, or supply a configured model with --model-module.`);
|
|
57
|
+
let exported;
|
|
58
|
+
try {
|
|
59
|
+
exported = await load(adapter.package);
|
|
60
|
+
} catch (cause) {
|
|
61
|
+
throw new Error(`Cannot load ${adapter.package}. Install it in this project or use --model-module.`, { cause });
|
|
62
|
+
}
|
|
63
|
+
const Constructor = exported[adapter.sdk];
|
|
64
|
+
if (typeof Constructor !== "function") throw new Error(`${adapter.package} does not export ${adapter.sdk}.`);
|
|
65
|
+
const model = new Constructor({ apiKey }).model({
|
|
66
|
+
name,
|
|
67
|
+
...provider === "openai" ? { api: "responses" } : {}
|
|
68
|
+
});
|
|
69
|
+
if (!isModel(model)) throw new Error(`${adapter.package} returned an invalid model.`);
|
|
70
|
+
return model;
|
|
71
|
+
}
|
|
72
|
+
function formatMeasurement(report) {
|
|
73
|
+
const lines = [`${report.provider}:${report.model} — input per call`, "Part Tokens Source USD"];
|
|
74
|
+
const row = (name, part) => `${name}\t${part.tokens}\t${part.source}\t${part.costUSD === void 0 ? "unknown" : part.costUSD.toFixed(8)}`;
|
|
75
|
+
for (const [name, part] of Object.entries(report.parts)) lines.push(row(name, part));
|
|
76
|
+
lines.push(row("total", report.total));
|
|
77
|
+
if (report.probe) lines.push("Messages include a user probe: \".\"");
|
|
78
|
+
lines.push("USD uses uncached input pricing; output, cache adjustments and hosted-tool fees are excluded.");
|
|
79
|
+
return lines.join("\n");
|
|
80
|
+
}
|
|
81
|
+
async function aiCommandAction({ args, options }, dependencies = {}) {
|
|
82
|
+
if (args.length !== 1 || args[0] !== "measure") throw new Error("Usage: warlock ai measure --model <id> [--tools <module>] [--system <file>] [--skills <dir>] [--json]");
|
|
83
|
+
const stringOption = (name, required = false) => {
|
|
84
|
+
const value = options[name];
|
|
85
|
+
if (value === void 0 && !required) return void 0;
|
|
86
|
+
if (typeof value !== "string" || !value.trim()) throw new Error(`--${name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)} requires a value.`);
|
|
87
|
+
return value;
|
|
88
|
+
};
|
|
89
|
+
const id = stringOption("model", true);
|
|
90
|
+
if (!id) throw new Error("--model is required.");
|
|
91
|
+
const modelModule = stringOption("modelModule");
|
|
92
|
+
const toolsModule = stringOption("tools");
|
|
93
|
+
const systemFile = stringOption("system");
|
|
94
|
+
const skillsDir = stringOption("skills");
|
|
95
|
+
const cwd = dependencies.cwd ?? process.cwd();
|
|
96
|
+
const load = dependencies.load ?? ((specifier) => loadMeasureModule(specifier, cwd));
|
|
97
|
+
const calculate = async () => {
|
|
98
|
+
let exported;
|
|
99
|
+
try {
|
|
100
|
+
exported = await load("@warlock.js/ai");
|
|
101
|
+
} catch (cause) {
|
|
102
|
+
throw new Error("Cannot load @warlock.js/ai. Install it in this project to use warlock ai measure.", { cause });
|
|
103
|
+
}
|
|
104
|
+
if (!isMeasureModule(exported)) throw new Error("warlock ai measure requires @warlock.js/ai 5.33.0 or newer.");
|
|
105
|
+
const aiPackage = exported;
|
|
106
|
+
const model = await resolveMeasureModel(id, modelModule, load);
|
|
107
|
+
let tools = [];
|
|
108
|
+
if (toolsModule) {
|
|
109
|
+
const module = await load(toolsModule);
|
|
110
|
+
const entries = module.tools ?? module.default;
|
|
111
|
+
if (!Array.isArray(entries) || !entries.every(isTool)) throw new Error("--tools must export an array of tool configs as tools or default.");
|
|
112
|
+
tools = entries;
|
|
113
|
+
}
|
|
114
|
+
const system = systemFile ? await readFile(path.resolve(cwd, systemFile), "utf8") : void 0;
|
|
115
|
+
let skills;
|
|
116
|
+
if (skillsDir) {
|
|
117
|
+
const directory = path.resolve(cwd, skillsDir);
|
|
118
|
+
if (!(await stat(directory)).isDirectory()) throw new Error("--skills must name a directory.");
|
|
119
|
+
skills = aiPackage.skills({
|
|
120
|
+
name: "measured-skills",
|
|
121
|
+
sources: [{
|
|
122
|
+
type: "directory",
|
|
123
|
+
path: directory
|
|
124
|
+
}]
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return aiPackage.measure({
|
|
128
|
+
model,
|
|
129
|
+
tools,
|
|
130
|
+
system,
|
|
131
|
+
skills
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
const report = options.json === true ? await withConsoleOnStderr(calculate) : await calculate();
|
|
135
|
+
console.log(options.json === true ? JSON.stringify(report, null, 2) : formatMeasurement(report));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
export { aiCommandAction, formatMeasurement, loadMeasureModule, resolveMeasureModel };
|
|
140
|
+
//# sourceMappingURL=ai-command.action.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-command.action.mjs","names":["resolveModule"],"sources":["../../../../../../../../../../packages/core/src/cli/commands/ai/ai-command.action.ts"],"sourcesContent":["import { readFile, stat } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { resolve as resolveModule } from \"import-meta-resolve\";\nimport type { Measurement, ModelContract, ToolConfig } from \"@warlock.js/ai\";\nimport type { CommandActionData } from \"../../../commands/types\";\nimport { withConsoleOnStderr } from \"../routes/with-console-on-stderr\";\n\ntype ModuleExports = Record<string, unknown>;\ntype MeasureModule = Pick<typeof import(\"@warlock.js/ai\"), \"measure\" | \"skills\">;\ntype ModuleLoader = (specifier: string) => Promise<ModuleExports>;\ntype SDKConstructor = new (config: { apiKey: string }) => {\n model(config: { name: string; api?: \"responses\" }): ModelContract;\n};\n\n/** Resolve from the caller's project, including optional provider packages. */\nexport async function loadMeasureModule(\n specifier: string,\n cwd = process.cwd(),\n): Promise<ModuleExports> {\n const parent = pathToFileURL(path.join(cwd, \"package.json\")).href;\n return import(resolveModule(specifier, parent));\n}\n\nfunction object(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\";\n}\n\nfunction isMeasureModule(value: ModuleExports): value is ModuleExports & MeasureModule {\n return typeof value.measure === \"function\" && typeof value.skills === \"function\";\n}\n\nfunction isModel(value: unknown): value is ModelContract {\n return (\n object(value) &&\n typeof value.name === \"string\" &&\n typeof value.provider === \"string\" &&\n typeof value.complete === \"function\" &&\n typeof value.stream === \"function\" &&\n (value.countTokens === undefined || typeof value.countTokens === \"function\") &&\n (value.pricing === undefined ||\n (object(value.pricing) &&\n typeof value.pricing.input === \"number\" &&\n Number.isFinite(value.pricing.input) &&\n value.pricing.input >= 0 &&\n typeof value.pricing.output === \"number\" &&\n Number.isFinite(value.pricing.output) &&\n value.pricing.output >= 0))\n );\n}\n\nfunction isTool(value: unknown): value is ToolConfig<unknown, unknown> {\n return (\n object(value) &&\n typeof value.name === \"string\" &&\n typeof value.description === \"string\" &&\n typeof value.execute === \"function\" &&\n (value.input === undefined ||\n (object(value.input) &&\n object(value.input[\"~standard\"]) &&\n typeof value.input[\"~standard\"].validate === \"function\"))\n );\n}\n\n/** SDK constructor/model signatures verified against the first-party adapter sources. */\nexport async function resolveMeasureModel(\n id: string,\n modelModule: string | undefined,\n load: ModuleLoader = loadMeasureModule,\n env: NodeJS.ProcessEnv = process.env,\n): Promise<ModelContract> {\n if (modelModule) {\n const exported = await load(modelModule);\n const model: unknown =\n typeof exported.resolveModel === \"function\"\n ? await exported.resolveModel(id)\n : (exported.model ?? exported.default);\n if (!isModel(model))\n throw new Error(\"--model-module must export a model or resolveModel(id) returning a model.\");\n return model;\n }\n const separator = id.indexOf(\":\");\n const provider = separator < 0 ? \"openai\" : id.slice(0, separator);\n const name = separator < 0 ? id : id.slice(separator + 1);\n const adapters: Record<string, { package: string; sdk: string; key: string }> = {\n openai: { package: \"@warlock.js/ai-openai\", sdk: \"OpenAISDK\", key: \"OPENAI_API_KEY\" },\n anthropic: {\n package: \"@warlock.js/ai-anthropic\",\n sdk: \"AnthropicSDK\",\n key: \"ANTHROPIC_API_KEY\",\n },\n google: { package: \"@warlock.js/ai-google\", sdk: \"GoogleSDK\", key: \"GEMINI_API_KEY\" },\n };\n const adapter = Object.hasOwn(adapters, provider) ? adapters[provider] : undefined;\n if (!adapter || !name)\n throw new Error(\n \"Use a model ID, openai:<id>, anthropic:<id>, google:<id>, or --model-module for a custom provider.\",\n );\n const apiKey = env[adapter.key];\n if (!apiKey)\n throw new Error(`Set ${adapter.key}, or supply a configured model with --model-module.`);\n let exported: ModuleExports;\n try {\n exported = await load(adapter.package);\n } catch (cause) {\n throw new Error(\n `Cannot load ${adapter.package}. Install it in this project or use --model-module.`,\n { cause },\n );\n }\n const Constructor = exported[adapter.sdk];\n if (typeof Constructor !== \"function\")\n throw new Error(`${adapter.package} does not export ${adapter.sdk}.`);\n const sdk = new (Constructor as SDKConstructor)({ apiKey });\n // The Responses adapter exposes countTokens; the Chat adapter does not.\n const model = sdk.model({\n name,\n ...(provider === \"openai\" ? { api: \"responses\" as const } : {}),\n });\n if (!isModel(model)) throw new Error(`${adapter.package} returned an invalid model.`);\n return model;\n}\n\nexport function formatMeasurement(report: Measurement): string {\n const lines = [\n `${report.provider}:${report.model} — input per call`,\n \"Part\\tTokens\\tSource\\tUSD\",\n ];\n const row = (name: string, part: Measurement[\"total\"]) =>\n `${name}\\t${part.tokens}\\t${part.source}\\t${part.costUSD === undefined ? \"unknown\" : part.costUSD.toFixed(8)}`;\n for (const [name, part] of Object.entries(report.parts)) lines.push(row(name, part));\n lines.push(row(\"total\", report.total));\n if (report.probe) lines.push('Messages include a user probe: \".\"');\n lines.push(\n \"USD uses uncached input pricing; output, cache adjustments and hosted-tool fees are excluded.\",\n );\n return lines.join(\"\\n\");\n}\n\nexport async function aiCommandAction(\n { args, options }: CommandActionData,\n dependencies: { load?: ModuleLoader; cwd?: string } = {},\n): Promise<void> {\n if (args.length !== 1 || args[0] !== \"measure\")\n throw new Error(\n \"Usage: warlock ai measure --model <id> [--tools <module>] [--system <file>] [--skills <dir>] [--json]\",\n );\n const stringOption = (name: string, required = false): string | undefined => {\n const value = options[name];\n if (value === undefined && !required) return undefined;\n if (typeof value !== \"string\" || !value.trim())\n throw new Error(\n `--${name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)} requires a value.`,\n );\n return value;\n };\n const id = stringOption(\"model\", true);\n if (!id) throw new Error(\"--model is required.\");\n const modelModule = stringOption(\"modelModule\");\n const toolsModule = stringOption(\"tools\");\n const systemFile = stringOption(\"system\");\n const skillsDir = stringOption(\"skills\");\n const cwd = dependencies.cwd ?? process.cwd();\n const load = dependencies.load ?? ((specifier) => loadMeasureModule(specifier, cwd));\n const calculate = async (): Promise<Measurement> => {\n let exported: ModuleExports;\n try {\n exported = await load(\"@warlock.js/ai\");\n } catch (cause) {\n throw new Error(\n \"Cannot load @warlock.js/ai. Install it in this project to use warlock ai measure.\",\n { cause },\n );\n }\n // The optional peer stays behind the action; unrelated CLI commands never import AI.\n if (!isMeasureModule(exported)) {\n throw new Error(\"warlock ai measure requires @warlock.js/ai 5.33.0 or newer.\");\n }\n const aiPackage = exported;\n const model = await resolveMeasureModel(id, modelModule, load);\n let tools: ToolConfig<unknown, unknown>[] = [];\n if (toolsModule) {\n const module = await load(toolsModule);\n const entries: unknown = module.tools ?? module.default;\n if (!Array.isArray(entries) || !entries.every(isTool))\n throw new Error(\"--tools must export an array of tool configs as tools or default.\");\n tools = entries;\n }\n const system = systemFile ? await readFile(path.resolve(cwd, systemFile), \"utf8\") : undefined;\n let skills: ReturnType<typeof aiPackage.skills> | undefined;\n if (skillsDir) {\n const directory = path.resolve(cwd, skillsDir);\n if (!(await stat(directory)).isDirectory())\n throw new Error(\"--skills must name a directory.\");\n skills = aiPackage.skills({\n name: \"measured-skills\",\n sources: [{ type: \"directory\", path: directory }],\n });\n }\n return aiPackage.measure({ model, tools, system, skills });\n };\n const report = options.json === true ? await withConsoleOnStderr(calculate) : await calculate();\n console.log(options.json === true ? JSON.stringify(report, null, 2) : formatMeasurement(report));\n}\n"],"mappings":";;;;;;;;AAgBA,eAAsB,kBACpB,WACA,MAAM,QAAQ,IAAI,GACM;CACxB,MAAM,SAAS,cAAc,KAAK,KAAK,KAAK,cAAc,CAAC,CAAC,CAAC;CAC7D,OAAO,OAAOA,UAAc,WAAW,MAAM;AAC/C;AAEA,SAAS,OAAO,OAAkD;CAChE,OAAO,UAAU,QAAQ,OAAO,UAAU;AAC5C;AAEA,SAAS,gBAAgB,OAA8D;CACrF,OAAO,OAAO,MAAM,YAAY,cAAc,OAAO,MAAM,WAAW;AACxE;AAEA,SAAS,QAAQ,OAAwC;CACvD,OACE,OAAO,KAAK,KACZ,OAAO,MAAM,SAAS,YACtB,OAAO,MAAM,aAAa,YAC1B,OAAO,MAAM,aAAa,cAC1B,OAAO,MAAM,WAAW,eACvB,MAAM,gBAAgB,UAAa,OAAO,MAAM,gBAAgB,gBAChE,MAAM,YAAY,UAChB,OAAO,MAAM,OAAO,KACnB,OAAO,MAAM,QAAQ,UAAU,YAC/B,OAAO,SAAS,MAAM,QAAQ,KAAK,KACnC,MAAM,QAAQ,SAAS,KACvB,OAAO,MAAM,QAAQ,WAAW,YAChC,OAAO,SAAS,MAAM,QAAQ,MAAM,KACpC,MAAM,QAAQ,UAAU;AAEhC;AAEA,SAAS,OAAO,OAAuD;CACrE,OACE,OAAO,KAAK,KACZ,OAAO,MAAM,SAAS,YACtB,OAAO,MAAM,gBAAgB,YAC7B,OAAO,MAAM,YAAY,eACxB,MAAM,UAAU,UACd,OAAO,MAAM,KAAK,KACjB,OAAO,MAAM,MAAM,YAAY,KAC/B,OAAO,MAAM,MAAM,YAAY,CAAC,aAAa;AAErD;;AAGA,eAAsB,oBACpB,IACA,aACA,OAAqB,mBACrB,MAAyB,QAAQ,KACT;CACxB,IAAI,aAAa;EACf,MAAM,WAAW,MAAM,KAAK,WAAW;EACvC,MAAM,QACJ,OAAO,SAAS,iBAAiB,aAC7B,MAAM,SAAS,aAAa,EAAE,IAC7B,SAAS,SAAS,SAAS;EAClC,IAAI,CAAC,QAAQ,KAAK,GAChB,MAAM,IAAI,MAAM,2EAA2E;EAC7F,OAAO;CACT;CACA,MAAM,YAAY,GAAG,QAAQ,GAAG;CAChC,MAAM,WAAW,YAAY,IAAI,WAAW,GAAG,MAAM,GAAG,SAAS;CACjE,MAAM,OAAO,YAAY,IAAI,KAAK,GAAG,MAAM,YAAY,CAAC;CACxD,MAAM,WAA0E;EAC9E,QAAQ;GAAE,SAAS;GAAyB,KAAK;GAAa,KAAK;EAAiB;EACpF,WAAW;GACT,SAAS;GACT,KAAK;GACL,KAAK;EACP;EACA,QAAQ;GAAE,SAAS;GAAyB,KAAK;GAAa,KAAK;EAAiB;CACtF;CACA,MAAM,UAAU,OAAO,OAAO,UAAU,QAAQ,IAAI,SAAS,YAAY;CACzE,IAAI,CAAC,WAAW,CAAC,MACf,MAAM,IAAI,MACR,oGACF;CACF,MAAM,SAAS,IAAI,QAAQ;CAC3B,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,OAAO,QAAQ,IAAI,oDAAoD;CACzF,IAAI;CACJ,IAAI;EACF,WAAW,MAAM,KAAK,QAAQ,OAAO;CACvC,SAAS,OAAO;EACd,MAAM,IAAI,MACR,eAAe,QAAQ,QAAQ,sDAC/B,EAAE,MAAM,CACV;CACF;CACA,MAAM,cAAc,SAAS,QAAQ;CACrC,IAAI,OAAO,gBAAgB,YACzB,MAAM,IAAI,MAAM,GAAG,QAAQ,QAAQ,mBAAmB,QAAQ,IAAI,EAAE;CAGtE,MAAM,QAAQ,IAFG,YAA+B,EAAE,OAAO,CAEzC,CAAC,CAAC,MAAM;EACtB;EACA,GAAI,aAAa,WAAW,EAAE,KAAK,YAAqB,IAAI,CAAC;CAC/D,CAAC;CACD,IAAI,CAAC,QAAQ,KAAK,GAAG,MAAM,IAAI,MAAM,GAAG,QAAQ,QAAQ,4BAA4B;CACpF,OAAO;AACT;AAEA,SAAgB,kBAAkB,QAA6B;CAC7D,MAAM,QAAQ,CACZ,GAAG,OAAO,SAAS,GAAG,OAAO,MAAM,oBACnC,wBACF;CACA,MAAM,OAAO,MAAc,SACzB,GAAG,KAAK,IAAI,KAAK,OAAO,IAAI,KAAK,OAAO,IAAI,KAAK,YAAY,SAAY,YAAY,KAAK,QAAQ,QAAQ,CAAC;CAC7G,KAAK,MAAM,CAAC,MAAM,SAAS,OAAO,QAAQ,OAAO,KAAK,GAAG,MAAM,KAAK,IAAI,MAAM,IAAI,CAAC;CACnF,MAAM,KAAK,IAAI,SAAS,OAAO,KAAK,CAAC;CACrC,IAAI,OAAO,OAAO,MAAM,KAAK,sCAAoC;CACjE,MAAM,KACJ,+FACF;CACA,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,eAAsB,gBACpB,EAAE,MAAM,WACR,eAAsD,CAAC,GACxC;CACf,IAAI,KAAK,WAAW,KAAK,KAAK,OAAO,WACnC,MAAM,IAAI,MACR,uGACF;CACF,MAAM,gBAAgB,MAAc,WAAW,UAA8B;EAC3E,MAAM,QAAQ,QAAQ;EACtB,IAAI,UAAU,UAAa,CAAC,UAAU,OAAO;EAC7C,IAAI,OAAO,UAAU,YAAY,CAAC,MAAM,KAAK,GAC3C,MAAM,IAAI,MACR,KAAK,KAAK,QAAQ,WAAW,WAAW,IAAI,OAAO,YAAY,GAAG,EAAE,mBACtE;EACF,OAAO;CACT;CACA,MAAM,KAAK,aAAa,SAAS,IAAI;CACrC,IAAI,CAAC,IAAI,MAAM,IAAI,MAAM,sBAAsB;CAC/C,MAAM,cAAc,aAAa,aAAa;CAC9C,MAAM,cAAc,aAAa,OAAO;CACxC,MAAM,aAAa,aAAa,QAAQ;CACxC,MAAM,YAAY,aAAa,QAAQ;CACvC,MAAM,MAAM,aAAa,OAAO,QAAQ,IAAI;CAC5C,MAAM,OAAO,aAAa,UAAU,cAAc,kBAAkB,WAAW,GAAG;CAClF,MAAM,YAAY,YAAkC;EAClD,IAAI;EACJ,IAAI;GACF,WAAW,MAAM,KAAK,gBAAgB;EACxC,SAAS,OAAO;GACd,MAAM,IAAI,MACR,qFACA,EAAE,MAAM,CACV;EACF;EAEA,IAAI,CAAC,gBAAgB,QAAQ,GAC3B,MAAM,IAAI,MAAM,6DAA6D;EAE/E,MAAM,YAAY;EAClB,MAAM,QAAQ,MAAM,oBAAoB,IAAI,aAAa,IAAI;EAC7D,IAAI,QAAwC,CAAC;EAC7C,IAAI,aAAa;GACf,MAAM,SAAS,MAAM,KAAK,WAAW;GACrC,MAAM,UAAmB,OAAO,SAAS,OAAO;GAChD,IAAI,CAAC,MAAM,QAAQ,OAAO,KAAK,CAAC,QAAQ,MAAM,MAAM,GAClD,MAAM,IAAI,MAAM,mEAAmE;GACrF,QAAQ;EACV;EACA,MAAM,SAAS,aAAa,MAAM,SAAS,KAAK,QAAQ,KAAK,UAAU,GAAG,MAAM,IAAI;EACpF,IAAI;EACJ,IAAI,WAAW;GACb,MAAM,YAAY,KAAK,QAAQ,KAAK,SAAS;GAC7C,IAAI,EAAE,MAAM,KAAK,SAAS,EAAC,CAAE,YAAY,GACvC,MAAM,IAAI,MAAM,iCAAiC;GACnD,SAAS,UAAU,OAAO;IACxB,MAAM;IACN,SAAS,CAAC;KAAE,MAAM;KAAa,MAAM;IAAU,CAAC;GAClD,CAAC;EACH;EACA,OAAO,UAAU,QAAQ;GAAE;GAAO;GAAO;GAAQ;EAAO,CAAC;CAC3D;CACA,MAAM,SAAS,QAAQ,SAAS,OAAO,MAAM,oBAAoB,SAAS,IAAI,MAAM,UAAU;CAC9F,QAAQ,IAAI,QAAQ,SAAS,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC,IAAI,kBAAkB,MAAM,CAAC;AACjG"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { command } from "../../commands/cli-command.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../packages/core/src/cli/commands/ai.command.ts
|
|
4
|
+
/** Built in so installing AI does not require cli.commands registration. */
|
|
5
|
+
const aiCommand = command({
|
|
6
|
+
name: "ai <action>",
|
|
7
|
+
description: "Measure AI input tokens and uncached input USD per call",
|
|
8
|
+
preload: {},
|
|
9
|
+
options: [
|
|
10
|
+
{
|
|
11
|
+
text: "--model",
|
|
12
|
+
description: "Model ID (OpenAI), or openai: / anthropic: / google: ID",
|
|
13
|
+
type: "string",
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
text: "--model-module",
|
|
18
|
+
description: "Module exporting a model or resolveModel(id)",
|
|
19
|
+
type: "string"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
text: "--tools",
|
|
23
|
+
description: "Module exporting a tools array (named tools or default)",
|
|
24
|
+
type: "string"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
text: "--system",
|
|
28
|
+
description: "UTF-8 system prompt file",
|
|
29
|
+
type: "string"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
text: "--skills",
|
|
33
|
+
description: "Directory containing skill folders with SKILL.md files",
|
|
34
|
+
type: "string"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
text: "--json",
|
|
38
|
+
description: "Print one JSON report to stdout",
|
|
39
|
+
type: "boolean"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
action: async (data) => {
|
|
43
|
+
const { aiCommandAction } = await import("./ai/ai-command.action.mjs");
|
|
44
|
+
await aiCommandAction(data);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { aiCommand };
|
|
50
|
+
//# sourceMappingURL=ai.command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.command.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/cli/commands/ai.command.ts"],"sourcesContent":["import { command } from \"../../commands/cli-command\";\n\n/** Built in so installing AI does not require cli.commands registration. */\nexport const aiCommand = command({\n name: \"ai <action>\",\n description: \"Measure AI input tokens and uncached input USD per call\",\n preload: {},\n options: [\n {\n text: \"--model\",\n description: \"Model ID (OpenAI), or openai: / anthropic: / google: ID\",\n type: \"string\",\n required: true,\n },\n {\n text: \"--model-module\",\n description: \"Module exporting a model or resolveModel(id)\",\n type: \"string\",\n },\n {\n text: \"--tools\",\n description: \"Module exporting a tools array (named tools or default)\",\n type: \"string\",\n },\n { text: \"--system\", description: \"UTF-8 system prompt file\", type: \"string\" },\n {\n text: \"--skills\",\n description: \"Directory containing skill folders with SKILL.md files\",\n type: \"string\",\n },\n { text: \"--json\", description: \"Print one JSON report to stdout\", type: \"boolean\" },\n ],\n action: async (data) => {\n const { aiCommandAction } = await import(\"./ai/ai-command.action\");\n await aiCommandAction(data);\n },\n});\n"],"mappings":";;;;AAGA,MAAa,YAAY,QAAQ;CAC/B,MAAM;CACN,aAAa;CACb,SAAS,CAAC;CACV,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;GACN,UAAU;EACZ;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GAAE,MAAM;GAAY,aAAa;GAA4B,MAAM;EAAS;EAC5E;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GAAE,MAAM;GAAU,aAAa;GAAmC,MAAM;EAAU;CACpF;CACA,QAAQ,OAAO,SAAS;EACtB,MAAM,EAAE,oBAAoB,MAAM,OAAO;EACzC,MAAM,gBAAgB,IAAI;CAC5B;AACF,CAAC"}
|
|
@@ -275,5 +275,5 @@ async function boardCommandAction({ args, options }) {
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
//#endregion
|
|
278
|
-
export { boardCommandAction };
|
|
278
|
+
export { BOARD_ACTIONS, boardCommandAction, formatBoardItemLine, parseBoardInvocation, readBodyOption, runBoardInvocation };
|
|
279
279
|
//# sourceMappingURL=board-command.action.mjs.map
|
|
@@ -30,6 +30,8 @@ function parseSkippedSteps(value) {
|
|
|
30
30
|
* @param data Parsed CLI args: `changed`, `base`, `skip`, `project`, `json`.
|
|
31
31
|
*/
|
|
32
32
|
async function checkCommandAction({ options }) {
|
|
33
|
+
const lint = stringOption(options.lint);
|
|
34
|
+
if (lint !== void 0 && lint !== "oxlint" && lint !== "eslint") throw new Error("Unknown lint tool. Use --lint oxlint or --lint eslint (deprecated).");
|
|
33
35
|
const base = stringOption(options.base);
|
|
34
36
|
const changed = options.changed === true || base !== void 0;
|
|
35
37
|
const project = stringOption(options.project);
|
|
@@ -37,6 +39,7 @@ async function checkCommandAction({ options }) {
|
|
|
37
39
|
const cliEntry = process.argv[1];
|
|
38
40
|
const flags = [...changed ? ["--changed"] : [], ...base ? ["--base", base] : []];
|
|
39
41
|
const report = await runCheck({
|
|
42
|
+
lint,
|
|
40
43
|
changed,
|
|
41
44
|
base,
|
|
42
45
|
skip,
|
|
@@ -53,5 +56,5 @@ async function checkCommandAction({ options }) {
|
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
//#endregion
|
|
56
|
-
export { checkCommandAction };
|
|
59
|
+
export { checkCommandAction, parseSkippedSteps };
|
|
57
60
|
//# sourceMappingURL=check-command.action.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-command.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/check/check-command.action.ts"],"sourcesContent":["import type { CommandActionData } from \"../../../commands/types\";\nimport { CHECK_STEPS, type CheckStepName } from \"../../../tooling/check/check-report.types\";\nimport { runCheck } from \"../../../tooling/check/run-check\";\nimport { flushAndExit } from \"../../flush-and-exit\";\nimport { childTypecheckRunner } from \"./child-typecheck\";\nimport { formatCheckSummary, printProblems } from \"./format-problems\";\n\nfunction stringOption(value: string | number | boolean | undefined): string | undefined {\n return typeof value === \"string\" && value.trim().length > 0 ? value.trim() : undefined;\n}\n\nfunction isStepName(value: string): value is CheckStepName {\n return (CHECK_STEPS as readonly string[]).includes(value);\n}\n\n/** Parse `--skip typecheck,lint`; throws on an unknown step name. */\nexport function parseSkippedSteps(value: string | undefined): CheckStepName[] {\n if (!value) return [];\n\n const names = value\n .split(\",\")\n .map((name) => name.trim())\n .filter((name) => name.length > 0);\n const unknown = names.filter((name) => !isStepName(name));\n\n if (unknown.length > 0) {\n throw new Error(\n `Unknown check step(s): ${unknown.join(\", \")}. Valid steps: ${CHECK_STEPS.join(\", \")}.`,\n );\n }\n\n return names.filter(isStepName);\n}\n\n/**\n * Action behind `warlock check`.\n *\n * Runs {@link runCheck} with the typecheck in a child `warlock typecheck`\n * process (so a heap overflow is reported, not fatal), prints the problems and\n * the step summary — or, with `--json`, exactly the report — and exits with\n * the report's code: 0 clean, 1 your code, 2 this machine.\n *\n * @param data Parsed CLI args: `changed`, `base`, `skip`, `project`, `json`.\n */\nexport async function checkCommandAction({ options }: CommandActionData): Promise<void> {\n const base = stringOption(options.base);\n const changed = options.changed === true || base !== undefined;\n const project = stringOption(options.project);\n const skip = parseSkippedSteps(stringOption(options.skip));\n const cliEntry = process.argv[1];\n const flags = [...(changed ? [\"--changed\"] : []), ...(base ? [\"--base\", base] : [])];\n\n const report = await runCheck({\n changed,\n base,\n skip,\n project,\n ...(cliEntry ? { typecheck: childTypecheckRunner(cliEntry, flags) } : {}),\n });\n\n if (options.json === true) {\n console.log(JSON.stringify(report, null, 2));\n } else {\n printProblems(report.problems);\n\n if (report.problems.length > 0) console.log(\"\");\n\n for (const line of formatCheckSummary(report)) {\n console.log(line);\n }\n }\n\n if (report.exitCode !== 0) {\n await flushAndExit(report.exitCode);\n }\n}\n"],"mappings":";;;;;;;AAOA,SAAS,aAAa,OAAkE;CACtF,OAAO,OAAO,UAAU,YAAY,MAAM,KAAK,CAAC,CAAC,SAAS,IAAI,MAAM,KAAK,IAAI;AAC/E;AAEA,SAAS,WAAW,OAAuC;CACzD,OAAQ,YAAkC,SAAS,KAAK;AAC1D;;AAGA,SAAgB,kBAAkB,OAA4C;CAC5E,IAAI,CAAC,OAAO,OAAO,CAAC;CAEpB,MAAM,QAAQ,MACX,MAAM,GAAG,CAAC,CACV,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,QAAQ,SAAS,KAAK,SAAS,CAAC;CACnC,MAAM,UAAU,MAAM,QAAQ,SAAS,CAAC,WAAW,IAAI,CAAC;CAExD,IAAI,QAAQ,SAAS,GACnB,MAAM,IAAI,MACR,0BAA0B,QAAQ,KAAK,IAAI,EAAE,iBAAiB,YAAY,KAAK,IAAI,EAAE,EACvF;CAGF,OAAO,MAAM,OAAO,UAAU;AAChC;;;;;;;;;;;AAYA,eAAsB,mBAAmB,EAAE,WAA6C;CACtF,MAAM,OAAO,aAAa,QAAQ,IAAI;CACtC,MAAM,UAAU,QAAQ,YAAY,QAAQ,SAAS;CACrD,MAAM,UAAU,aAAa,QAAQ,OAAO;CAC5C,MAAM,OAAO,kBAAkB,aAAa,QAAQ,IAAI,CAAC;CACzD,MAAM,WAAW,QAAQ,KAAK;CAC9B,MAAM,QAAQ,CAAC,GAAI,UAAU,CAAC,WAAW,IAAI,CAAC,GAAI,GAAI,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,CAAE;CAEnF,MAAM,SAAS,MAAM,SAAS;EAC5B;EACA;EACA;EACA;EACA,GAAI,WAAW,EAAE,WAAW,qBAAqB,UAAU,KAAK,EAAE,IAAI,CAAC;CACzE,CAAC;CAED,IAAI,QAAQ,SAAS,MACnB,QAAQ,IAAI,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;MACtC;EACL,cAAc,OAAO,QAAQ;EAE7B,IAAI,OAAO,SAAS,SAAS,GAAG,QAAQ,IAAI,EAAE;EAE9C,KAAK,MAAM,QAAQ,mBAAmB,MAAM,GAC1C,QAAQ,IAAI,IAAI;CAEpB;CAEA,IAAI,OAAO,aAAa,GACtB,MAAM,aAAa,OAAO,QAAQ;AAEtC"}
|
|
1
|
+
{"version":3,"file":"check-command.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/check/check-command.action.ts"],"sourcesContent":["import type { CommandActionData } from \"../../../commands/types\";\nimport { CHECK_STEPS, type CheckStepName } from \"../../../tooling/check/check-report.types\";\nimport { runCheck } from \"../../../tooling/check/run-check\";\nimport { flushAndExit } from \"../../flush-and-exit\";\nimport { childTypecheckRunner } from \"./child-typecheck\";\nimport { formatCheckSummary, printProblems } from \"./format-problems\";\n\nfunction stringOption(value: string | number | boolean | undefined): string | undefined {\n return typeof value === \"string\" && value.trim().length > 0 ? value.trim() : undefined;\n}\n\nfunction isStepName(value: string): value is CheckStepName {\n return (CHECK_STEPS as readonly string[]).includes(value);\n}\n\n/** Parse `--skip typecheck,lint`; throws on an unknown step name. */\nexport function parseSkippedSteps(value: string | undefined): CheckStepName[] {\n if (!value) return [];\n\n const names = value\n .split(\",\")\n .map((name) => name.trim())\n .filter((name) => name.length > 0);\n const unknown = names.filter((name) => !isStepName(name));\n\n if (unknown.length > 0) {\n throw new Error(\n `Unknown check step(s): ${unknown.join(\", \")}. Valid steps: ${CHECK_STEPS.join(\", \")}.`,\n );\n }\n\n return names.filter(isStepName);\n}\n\n/**\n * Action behind `warlock check`.\n *\n * Runs {@link runCheck} with the typecheck in a child `warlock typecheck`\n * process (so a heap overflow is reported, not fatal), prints the problems and\n * the step summary — or, with `--json`, exactly the report — and exits with\n * the report's code: 0 clean, 1 your code, 2 this machine.\n *\n * @param data Parsed CLI args: `changed`, `base`, `skip`, `project`, `json`.\n */\nexport async function checkCommandAction({ options }: CommandActionData): Promise<void> {\n const lint = stringOption(options.lint);\n if (lint !== undefined && lint !== \"oxlint\" && lint !== \"eslint\") {\n throw new Error(\"Unknown lint tool. Use --lint oxlint or --lint eslint (deprecated).\");\n }\n const base = stringOption(options.base);\n const changed = options.changed === true || base !== undefined;\n const project = stringOption(options.project);\n const skip = parseSkippedSteps(stringOption(options.skip));\n const cliEntry = process.argv[1];\n const flags = [...(changed ? [\"--changed\"] : []), ...(base ? [\"--base\", base] : [])];\n\n const report = await runCheck({\n lint,\n changed,\n base,\n skip,\n project,\n ...(cliEntry ? { typecheck: childTypecheckRunner(cliEntry, flags) } : {}),\n });\n\n if (options.json === true) {\n console.log(JSON.stringify(report, null, 2));\n } else {\n printProblems(report.problems);\n\n if (report.problems.length > 0) console.log(\"\");\n\n for (const line of formatCheckSummary(report)) {\n console.log(line);\n }\n }\n\n if (report.exitCode !== 0) {\n await flushAndExit(report.exitCode);\n }\n}\n"],"mappings":";;;;;;;AAOA,SAAS,aAAa,OAAkE;CACtF,OAAO,OAAO,UAAU,YAAY,MAAM,KAAK,CAAC,CAAC,SAAS,IAAI,MAAM,KAAK,IAAI;AAC/E;AAEA,SAAS,WAAW,OAAuC;CACzD,OAAQ,YAAkC,SAAS,KAAK;AAC1D;;AAGA,SAAgB,kBAAkB,OAA4C;CAC5E,IAAI,CAAC,OAAO,OAAO,CAAC;CAEpB,MAAM,QAAQ,MACX,MAAM,GAAG,CAAC,CACV,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,QAAQ,SAAS,KAAK,SAAS,CAAC;CACnC,MAAM,UAAU,MAAM,QAAQ,SAAS,CAAC,WAAW,IAAI,CAAC;CAExD,IAAI,QAAQ,SAAS,GACnB,MAAM,IAAI,MACR,0BAA0B,QAAQ,KAAK,IAAI,EAAE,iBAAiB,YAAY,KAAK,IAAI,EAAE,EACvF;CAGF,OAAO,MAAM,OAAO,UAAU;AAChC;;;;;;;;;;;AAYA,eAAsB,mBAAmB,EAAE,WAA6C;CACtF,MAAM,OAAO,aAAa,QAAQ,IAAI;CACtC,IAAI,SAAS,UAAa,SAAS,YAAY,SAAS,UACtD,MAAM,IAAI,MAAM,qEAAqE;CAEvF,MAAM,OAAO,aAAa,QAAQ,IAAI;CACtC,MAAM,UAAU,QAAQ,YAAY,QAAQ,SAAS;CACrD,MAAM,UAAU,aAAa,QAAQ,OAAO;CAC5C,MAAM,OAAO,kBAAkB,aAAa,QAAQ,IAAI,CAAC;CACzD,MAAM,WAAW,QAAQ,KAAK;CAC9B,MAAM,QAAQ,CAAC,GAAI,UAAU,CAAC,WAAW,IAAI,CAAC,GAAI,GAAI,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,CAAE;CAEnF,MAAM,SAAS,MAAM,SAAS;EAC5B;EACA;EACA;EACA;EACA;EACA,GAAI,WAAW,EAAE,WAAW,qBAAqB,UAAU,KAAK,EAAE,IAAI,CAAC;CACzE,CAAC;CAED,IAAI,QAAQ,SAAS,MACnB,QAAQ,IAAI,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;MACtC;EACL,cAAc,OAAO,QAAQ;EAE7B,IAAI,OAAO,SAAS,SAAS,GAAG,QAAQ,IAAI,EAAE;EAE9C,KAAK,MAAM,QAAQ,mBAAmB,MAAM,GAC1C,QAAQ,IAAI,IAAI;CAEpB;CAEA,IAAI,OAAO,aAAa,GACtB,MAAM,aAAa,OAAO,QAAQ;AAEtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"child-typecheck.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/check/child-typecheck.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport type { TypecheckRunner } from \"../../../tooling/check/run-check\";\nimport { createProblem } from \"../../../tooling/problem\";\nimport type { TypecheckResult } from \"../../../tooling/typecheck/run-typecheck\";\n\nfunction isTypecheckResult(value: unknown): value is TypecheckResult {\n return (\n typeof value === \"object\" &&\n value !== null &&\n Array.isArray(Reflect.get(value, \"problems\")) &&\n typeof Reflect.get(value, \"checkedFiles\") === \"number\"\n );\n}\n\n/**\n * Run the typecheck step as `warlock typecheck --json` in a child process.\n *\n * The compiler is the one step that can exhaust the heap on a large app. In\n * its own process an overflow ends only that process, and `warlock check`\n * still prints its report — with a `WL8007` environment problem instead of\n * dying without output.\n *\n * @param cliEntry The warlock CLI script (`process.argv[1]` of `warlock check`).\n * @param flags The `--changed` / `--base` flags of the parent run, so the child\n * lists the same changed files.\n */\nexport function childTypecheckRunner(cliEntry: string, flags: readonly string[]): TypecheckRunner {\n return (options) =>\n new Promise((resolve) => {\n const args = [cliEntry, \"typecheck\", \"--json\", ...flags];\n\n if (options.project) args.push(\"--project\", options.project);\n\n execFile(\n process.execPath,\n args,\n {\n cwd: options.cwd ?? process.cwd(),\n encoding: \"utf8\",\n windowsHide: true,\n maxBuffer: 64 * 1024 * 1024,\n },\n (error, stdout, stderr) => {\n let parsed: unknown;\n\n try {\n parsed = JSON.parse(stdout);\n } catch {\n parsed = undefined;\n }\n\n if (isTypecheckResult(parsed)) {\n resolve(parsed);\n return;\n }\n\n const outOfMemory = /heap out of memory|ERR_WORKER_OUT_OF_MEMORY/i.test(stderr);\n const how = error?.signal\n ? `was killed (${error.signal})`\n : `exited with ${String(error?.code ?? 0)}`;\n\n resolve({\n ok: false,\n mode: options.files ? \"files\" : \"program\",\n files: null,\n checkedFiles: 0,\n durationMs: 0,\n buildInfoFile: null,\n problems: [\n createProblem({\n code: \"WL8007\",\n source: \"environment\",\n message: `The typecheck ${outOfMemory ? \"ran out of memory\" : how}: ${stderr.trim().split(\"\\n\").slice(-3).join(\" \") || \"no output\"}`,\n }),\n ],\n });\n },\n );\n });\n}\n"],"mappings":";;;;AAKA,SAAS,kBAAkB,OAA0C;CACnE,OACE,OAAO,UAAU,YACjB,UAAU,QACV,MAAM,QAAQ,QAAQ,IAAI,OAAO,UAAU,CAAC,KAC5C,OAAO,QAAQ,IAAI,OAAO,cAAc,MAAM;AAElD;;;;;;;;;;;;;AAcA,SAAgB,qBAAqB,UAAkB,OAA2C;CAChG,QAAQ,YACN,IAAI,SAAS,YAAY;EACvB,MAAM,OAAO;GAAC;GAAU;GAAa;GAAU,GAAG;EAAK;EAEvD,IAAI,QAAQ,SAAS,KAAK,KAAK,aAAa,QAAQ,OAAO;EAE3D,SACE,QAAQ,UACR,MACA;GACE,KAAK,QAAQ,OAAO,QAAQ,IAAI;GAChC,UAAU;GACV,aAAa;GACb,WAAW
|
|
1
|
+
{"version":3,"file":"child-typecheck.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/check/child-typecheck.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport type { TypecheckRunner } from \"../../../tooling/check/run-check\";\nimport { createProblem } from \"../../../tooling/problem\";\nimport type { TypecheckResult } from \"../../../tooling/typecheck/run-typecheck\";\n\nfunction isTypecheckResult(value: unknown): value is TypecheckResult {\n return (\n typeof value === \"object\" &&\n value !== null &&\n Array.isArray(Reflect.get(value, \"problems\")) &&\n typeof Reflect.get(value, \"checkedFiles\") === \"number\"\n );\n}\n\n/**\n * Run the typecheck step as `warlock typecheck --json` in a child process.\n *\n * The compiler is the one step that can exhaust the heap on a large app. In\n * its own process an overflow ends only that process, and `warlock check`\n * still prints its report — with a `WL8007` environment problem instead of\n * dying without output.\n *\n * @param cliEntry The warlock CLI script (`process.argv[1]` of `warlock check`).\n * @param flags The `--changed` / `--base` flags of the parent run, so the child\n * lists the same changed files.\n */\nexport function childTypecheckRunner(cliEntry: string, flags: readonly string[]): TypecheckRunner {\n return (options) =>\n new Promise((resolve) => {\n const args = [cliEntry, \"typecheck\", \"--json\", ...flags];\n\n if (options.project) args.push(\"--project\", options.project);\n\n execFile(\n process.execPath,\n args,\n {\n cwd: options.cwd ?? process.cwd(),\n encoding: \"utf8\",\n windowsHide: true,\n maxBuffer: 64 * 1024 * 1024,\n },\n (error, stdout, stderr) => {\n let parsed: unknown;\n\n try {\n parsed = JSON.parse(stdout);\n } catch {\n parsed = undefined;\n }\n\n if (isTypecheckResult(parsed)) {\n resolve(parsed);\n return;\n }\n\n const outOfMemory = /heap out of memory|ERR_WORKER_OUT_OF_MEMORY/i.test(stderr);\n const how = error?.signal\n ? `was killed (${error.signal})`\n : `exited with ${String(error?.code ?? 0)}`;\n\n resolve({\n ok: false,\n mode: options.files ? \"files\" : \"program\",\n files: null,\n checkedFiles: 0,\n durationMs: 0,\n buildInfoFile: null,\n problems: [\n createProblem({\n code: \"WL8007\",\n source: \"environment\",\n message: `The typecheck ${outOfMemory ? \"ran out of memory\" : how}: ${stderr.trim().split(\"\\n\").slice(-3).join(\" \") || \"no output\"}`,\n }),\n ],\n });\n },\n );\n });\n}\n"],"mappings":";;;;AAKA,SAAS,kBAAkB,OAA0C;CACnE,OACE,OAAO,UAAU,YACjB,UAAU,QACV,MAAM,QAAQ,QAAQ,IAAI,OAAO,UAAU,CAAC,KAC5C,OAAO,QAAQ,IAAI,OAAO,cAAc,MAAM;AAElD;;;;;;;;;;;;;AAcA,SAAgB,qBAAqB,UAAkB,OAA2C;CAChG,QAAQ,YACN,IAAI,SAAS,YAAY;EACvB,MAAM,OAAO;GAAC;GAAU;GAAa;GAAU,GAAG;EAAK;EAEvD,IAAI,QAAQ,SAAS,KAAK,KAAK,aAAa,QAAQ,OAAO;EAE3D,SACE,QAAQ,UACR,MACA;GACE,KAAK,QAAQ,OAAO,QAAQ,IAAI;GAChC,UAAU;GACV,aAAa;GACb,WAAW;EACb,IACC,OAAO,QAAQ,WAAW;GACzB,IAAI;GAEJ,IAAI;IACF,SAAS,KAAK,MAAM,MAAM;GAC5B,QAAQ;IACN,SAAS;GACX;GAEA,IAAI,kBAAkB,MAAM,GAAG;IAC7B,QAAQ,MAAM;IACd;GACF;GAEA,MAAM,cAAc,+CAA+C,KAAK,MAAM;GAC9E,MAAM,MAAM,OAAO,SACf,eAAe,MAAM,OAAO,KAC5B,eAAe,OAAO,OAAO,QAAQ,CAAC;GAE1C,QAAQ;IACN,IAAI;IACJ,MAAM,QAAQ,QAAQ,UAAU;IAChC,OAAO;IACP,cAAc;IACd,YAAY;IACZ,eAAe;IACf,UAAU,CACR,cAAc;KACZ,MAAM;KACN,QAAQ;KACR,SAAS,iBAAiB,cAAc,sBAAsB,IAAI,IAAI,OAAO,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,GAAG,KAAK;IACzH,CAAC,CACH;GACF,CAAC;EACH,CACF;CACF,CAAC;AACL"}
|
|
@@ -4,7 +4,7 @@ import { checkCommandAction } from "./check/check-command.action.mjs";
|
|
|
4
4
|
//#region ../../packages/core/src/cli/commands/check.command.ts
|
|
5
5
|
/**
|
|
6
6
|
* `warlock check` — the single verify command: typecheck, lint (the app's
|
|
7
|
-
*
|
|
7
|
+
* Oxlint config, or explicitly selected deprecated ESLint), the tests affected by the change, and framework
|
|
8
8
|
* convention checks, reported as one problem list. Exit 0 clean, 1 problems
|
|
9
9
|
* in the code, 2 problems with this machine.
|
|
10
10
|
*
|
|
@@ -17,6 +17,11 @@ const checkCommand = command({
|
|
|
17
17
|
description: "Typecheck, lint, run the affected tests and check conventions; one problem list, exit 1 for your code and 2 for this machine",
|
|
18
18
|
action: checkCommandAction,
|
|
19
19
|
options: [
|
|
20
|
+
{
|
|
21
|
+
text: "--lint",
|
|
22
|
+
description: "Lint tool: oxlint (default) or eslint (deprecated; removed in 5.34.0)",
|
|
23
|
+
type: "string"
|
|
24
|
+
},
|
|
20
25
|
{
|
|
21
26
|
text: "--changed, -c",
|
|
22
27
|
description: "Only the files changed against HEAD (plus untracked files) and what they affect",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.command.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/cli/commands/check.command.ts"],"sourcesContent":["import { command } from \"../../commands/cli-command\";\nimport { checkCommandAction } from \"./check/check-command.action\";\n\n/**\n * `warlock check` — the single verify command: typecheck, lint (the app's\n *
|
|
1
|
+
{"version":3,"file":"check.command.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/cli/commands/check.command.ts"],"sourcesContent":["import { command } from \"../../commands/cli-command\";\nimport { checkCommandAction } from \"./check/check-command.action\";\n\n/**\n * `warlock check` — the single verify command: typecheck, lint (the app's\n * Oxlint config, or explicitly selected deprecated ESLint), the tests affected by the change, and framework\n * convention checks, reported as one problem list. Exit 0 clean, 1 problems\n * in the code, 2 problems with this machine.\n *\n * No preload: the steps read files and run tools; nothing boots, connects or\n * binds a port, so `check` behaves the same with or without a database or\n * Redis running.\n */\nexport const checkCommand = command({\n name: \"check\",\n description:\n \"Typecheck, lint, run the affected tests and check conventions; one problem list, exit 1 for your code and 2 for this machine\",\n action: checkCommandAction,\n options: [\n {\n text: \"--lint\",\n description: \"Lint tool: oxlint (default) or eslint (deprecated; removed in 5.34.0)\",\n type: \"string\",\n },\n {\n text: \"--changed, -c\",\n description:\n \"Only the files changed against HEAD (plus untracked files) and what they affect\",\n type: \"boolean\",\n },\n {\n text: \"--base, -b\",\n description: \"Compare with the merge base of this ref instead of HEAD (implies --changed)\",\n type: \"string\",\n },\n {\n text: \"--skip, -s\",\n description:\n \"Comma-separated steps to skip: environment, typecheck, lint, tests, conventions\",\n type: \"string\",\n },\n {\n text: \"--project, -p\",\n description: \"tsconfig path (default tsconfig.json)\",\n type: \"string\",\n },\n {\n text: \"--json, -j\",\n description: \"Print the report as JSON\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,eAAe,QAAQ;CAClC,MAAM;CACN,aACE;CACF,QAAQ;CACR,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;CACF;AACF,CAAC"}
|
|
@@ -26,12 +26,13 @@ const devServerCommand = command({
|
|
|
26
26
|
await displayStartupBanner({ environment: "development" });
|
|
27
27
|
},
|
|
28
28
|
action: async (data) => {
|
|
29
|
-
|
|
29
|
+
const devServer = await startDevelopmentServer({
|
|
30
30
|
fresh: Boolean(data.options.fresh),
|
|
31
31
|
generateTypings: data.options.skipTypings ? false : void 0,
|
|
32
32
|
healthCheckers: data.options.skipHealth ? false : void 0,
|
|
33
33
|
mcp: data.options.mcp === true ? true : void 0
|
|
34
|
-
})
|
|
34
|
+
});
|
|
35
|
+
checkForFrameworkUpdate(devServer);
|
|
35
36
|
},
|
|
36
37
|
options: [
|
|
37
38
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server.command.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/cli/commands/dev-server.command.ts"],"sourcesContent":["import { checkForFrameworkUpdate } from \"../../dev-server/check-for-updates\";\nimport { startDevelopmentServer } from \"../../dev-server/start-development-server\";\nimport { isDevWorker, superviseDevServer } from \"../../dev-server/supervisor\";\nimport { assertEsbuildBinaryIsLinked } from \"../../production/esbuild-preflight\";\nimport { command } from \"../../commands/cli-command\";\nimport { assertNodeOnlyCommand } from \"../../utils/runtime\";\nimport { displayStartupBanner } from \"../cli-commands.utils\";\n\nexport const devServerCommand = command({\n name: \"dev\",\n description: \"Start development server (HMR, type-gen, health checks)\",\n persistent: true,\n preload: {\n runtimeStrategy: \"development\",\n // Overrides whatever NODE_ENV the shell exported. A shell with\n // NODE_ENV=production made Vite's dep optimiser pre-bundle the PRODUCTION\n // build of React, which silently suppresses hydration-mismatch warnings —\n // the dev server was hiding the exact class of bug it exists to surface.\n // Set here, in preload, because preloaders run before the action, and the\n // action is what eventually reaches Vite's `createServer`.\n environment: \"development\",\n config: true, // load all config\n bootstrap: true,\n prestart: true, // load prestart file (if exists)\n // Only the Early lifecycle phase starts here; the Late phase\n // (http, socket) starts after app modules load — see\n // development-server.ts STEP 8.5.\n connectors: true,\n },\n preAction: async () => {\n // Node only. The dev server compiles TypeScript and hot-reloads modules\n // through Node's module loader hooks; Bun and Deno run the production\n // build instead. Checked first so neither role starts anything on them.\n assertNodeOnlyCommand(\"dev\");\n\n // Fail before either role (supervisor or worker) does any other work —\n // a missing/unlinked esbuild binary would otherwise surface much later\n // as an opaque low-level error from deep inside the transpile path.\n assertEsbuildBinaryIsLinked();\n\n // Two roles share this command. The first `warlock dev` becomes a thin\n // supervisor that owns the terminal and (re)spawns the real server; the\n // process it spawns carries WARLOCK_DEV_WORKER and falls through to the\n // server itself. See supervisor.ts for why the split exists.\n //\n // This branch has to sit in `preAction`, which runs BEFORE the command's\n // preloaders: the supervisor must never load config or start connectors,\n // or it would hold a second database connection open for the whole\n // session. `superviseDevServer()` never resolves, so nothing below it —\n // preload included — runs in the supervisor.\n if (!isDevWorker()) {\n return superviseDevServer();\n }\n\n await displayStartupBanner({ environment: \"development\" });\n },\n action: async (data) => {\n const devServer = await startDevelopmentServer({\n fresh: Boolean(data.options.fresh),\n // Pass `false` only when the CLI flag is explicitly set; `undefined`\n // lets `warlock.config.ts > devServer.*` defaults apply.\n generateTypings: data.options.skipTypings ? false : undefined,\n healthCheckers: data.options.skipHealth ? false : undefined,\n mcp: data.options.mcp === true ? true : undefined,\n });\n\n // Fire-and-forget: once the server is ready, surface a one-line notice if\n // a newer @warlock.js/core has been published, and arm the `u` shortcut\n // that updates + restarts. Fully self-guarded — it never blocks startup\n // nor breaks dev if the registry is unreachable.\n void checkForFrameworkUpdate(devServer);\n },\n options: [\n {\n text: \"--fresh, -f\",\n description: \"Delete .warlock/manifest.json before start (force full re-parse from disk)\",\n type: \"boolean\",\n },\n {\n text: \"--skip-typings, -st\",\n description: \"Skip background type generation for this run\",\n type: \"boolean\",\n },\n {\n text: \"--skip-health, -sh\",\n description: \"Skip file health checkers for this run\",\n type: \"boolean\",\n },\n {\n text: \"--mcp\",\n description:\n \"Also serve `warlock mcp` over HTTP on loopback from the dev server (live registries; needs @warlock.js/ai-tools)\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;;;;;;AAQA,MAAa,mBAAmB,QAAQ;CACtC,MAAM;CACN,aAAa;CACb,YAAY;CACZ,SAAS;EACP,iBAAiB;EAOjB,aAAa;EACb,QAAQ;EACR,WAAW;EACX,UAAU;EAIV,YAAY;CACd;CACA,WAAW,YAAY;EAIrB,sBAAsB,KAAK;EAK3B,4BAA4B;EAY5B,IAAI,CAAC,YAAY,GACf,OAAO,mBAAmB;EAG5B,MAAM,qBAAqB,EAAE,aAAa,cAAc,CAAC;CAC3D;CACA,QAAQ,OAAO,SAAS;
|
|
1
|
+
{"version":3,"file":"dev-server.command.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/cli/commands/dev-server.command.ts"],"sourcesContent":["import { checkForFrameworkUpdate } from \"../../dev-server/check-for-updates\";\nimport { startDevelopmentServer } from \"../../dev-server/start-development-server\";\nimport { isDevWorker, superviseDevServer } from \"../../dev-server/supervisor\";\nimport { assertEsbuildBinaryIsLinked } from \"../../production/esbuild-preflight\";\nimport { command } from \"../../commands/cli-command\";\nimport { assertNodeOnlyCommand } from \"../../utils/runtime\";\nimport { displayStartupBanner } from \"../cli-commands.utils\";\n\nexport const devServerCommand = command({\n name: \"dev\",\n description: \"Start development server (HMR, type-gen, health checks)\",\n persistent: true,\n preload: {\n runtimeStrategy: \"development\",\n // Overrides whatever NODE_ENV the shell exported. A shell with\n // NODE_ENV=production made Vite's dep optimiser pre-bundle the PRODUCTION\n // build of React, which silently suppresses hydration-mismatch warnings —\n // the dev server was hiding the exact class of bug it exists to surface.\n // Set here, in preload, because preloaders run before the action, and the\n // action is what eventually reaches Vite's `createServer`.\n environment: \"development\",\n config: true, // load all config\n bootstrap: true,\n prestart: true, // load prestart file (if exists)\n // Only the Early lifecycle phase starts here; the Late phase\n // (http, socket) starts after app modules load — see\n // development-server.ts STEP 8.5.\n connectors: true,\n },\n preAction: async () => {\n // Node only. The dev server compiles TypeScript and hot-reloads modules\n // through Node's module loader hooks; Bun and Deno run the production\n // build instead. Checked first so neither role starts anything on them.\n assertNodeOnlyCommand(\"dev\");\n\n // Fail before either role (supervisor or worker) does any other work —\n // a missing/unlinked esbuild binary would otherwise surface much later\n // as an opaque low-level error from deep inside the transpile path.\n assertEsbuildBinaryIsLinked();\n\n // Two roles share this command. The first `warlock dev` becomes a thin\n // supervisor that owns the terminal and (re)spawns the real server; the\n // process it spawns carries WARLOCK_DEV_WORKER and falls through to the\n // server itself. See supervisor.ts for why the split exists.\n //\n // This branch has to sit in `preAction`, which runs BEFORE the command's\n // preloaders: the supervisor must never load config or start connectors,\n // or it would hold a second database connection open for the whole\n // session. `superviseDevServer()` never resolves, so nothing below it —\n // preload included — runs in the supervisor.\n if (!isDevWorker()) {\n return superviseDevServer();\n }\n\n await displayStartupBanner({ environment: \"development\" });\n },\n action: async (data) => {\n const devServer = await startDevelopmentServer({\n fresh: Boolean(data.options.fresh),\n // Pass `false` only when the CLI flag is explicitly set; `undefined`\n // lets `warlock.config.ts > devServer.*` defaults apply.\n generateTypings: data.options.skipTypings ? false : undefined,\n healthCheckers: data.options.skipHealth ? false : undefined,\n mcp: data.options.mcp === true ? true : undefined,\n });\n\n // Fire-and-forget: once the server is ready, surface a one-line notice if\n // a newer @warlock.js/core has been published, and arm the `u` shortcut\n // that updates + restarts. Fully self-guarded — it never blocks startup\n // nor breaks dev if the registry is unreachable.\n void checkForFrameworkUpdate(devServer);\n },\n options: [\n {\n text: \"--fresh, -f\",\n description: \"Delete .warlock/manifest.json before start (force full re-parse from disk)\",\n type: \"boolean\",\n },\n {\n text: \"--skip-typings, -st\",\n description: \"Skip background type generation for this run\",\n type: \"boolean\",\n },\n {\n text: \"--skip-health, -sh\",\n description: \"Skip file health checkers for this run\",\n type: \"boolean\",\n },\n {\n text: \"--mcp\",\n description:\n \"Also serve `warlock mcp` over HTTP on loopback from the dev server (live registries; needs @warlock.js/ai-tools)\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;;;;;;AAQA,MAAa,mBAAmB,QAAQ;CACtC,MAAM;CACN,aAAa;CACb,YAAY;CACZ,SAAS;EACP,iBAAiB;EAOjB,aAAa;EACb,QAAQ;EACR,WAAW;EACX,UAAU;EAIV,YAAY;CACd;CACA,WAAW,YAAY;EAIrB,sBAAsB,KAAK;EAK3B,4BAA4B;EAY5B,IAAI,CAAC,YAAY,GACf,OAAO,mBAAmB;EAG5B,MAAM,qBAAqB,EAAE,aAAa,cAAc,CAAC;CAC3D;CACA,QAAQ,OAAO,SAAS;EACtB,MAAM,YAAY,MAAM,uBAAuB;GAC7C,OAAO,QAAQ,KAAK,QAAQ,KAAK;GAGjC,iBAAiB,KAAK,QAAQ,cAAc,QAAQ;GACpD,gBAAgB,KAAK,QAAQ,aAAa,QAAQ;GAClD,KAAK,KAAK,QAAQ,QAAQ,OAAO,OAAO;EAC1C,CAAC;EAMD,AAAK,wBAAwB,SAAS;CACxC;CACA,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;AACF,CAAC"}
|
|
@@ -19,16 +19,20 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* A module the boot pass could not import, and why.
|
|
21
21
|
*/
|
|
22
|
-
type ModuleFailure = {
|
|
23
|
-
/** Project-relative path of the file that failed. */
|
|
22
|
+
export type ModuleFailure = {
|
|
23
|
+
/** Project-relative path of the file that failed. */
|
|
24
|
+
file: string;
|
|
25
|
+
/** The underlying error message (the cause, not the wrapper). */
|
|
24
26
|
message: string;
|
|
25
27
|
};
|
|
26
28
|
/**
|
|
27
29
|
* A model module the boot pass imported, with its exports — what `warlock
|
|
28
30
|
* inspect` reads the app's model classes from.
|
|
29
31
|
*/
|
|
30
|
-
type ModelModule = {
|
|
31
|
-
/** Project-relative path of the model file. */
|
|
32
|
+
export type ModelModule = {
|
|
33
|
+
/** Project-relative path of the model file. */
|
|
34
|
+
file: string;
|
|
35
|
+
/** The module's exports (a shallow copy of its namespace). */
|
|
32
36
|
exports: Record<string, unknown>;
|
|
33
37
|
};
|
|
34
38
|
/**
|
|
@@ -36,30 +40,40 @@ type ModelModule = {
|
|
|
36
40
|
* anything itself — and so the report cannot contain two checks that booted the
|
|
37
41
|
* app differently and disagreed about it.
|
|
38
42
|
*/
|
|
39
|
-
type DoctorBootContext = {
|
|
43
|
+
export type DoctorBootContext = {
|
|
40
44
|
/**
|
|
41
45
|
* Whether the pass completed. `false` means app discovery itself failed and
|
|
42
46
|
* every app-dependent check must say so rather than report a zero.
|
|
43
47
|
*/
|
|
44
|
-
booted: boolean;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
booted: boolean;
|
|
49
|
+
/** Number of `src/app/<module>/routes.ts` files found on disk. */
|
|
50
|
+
routeModules: number;
|
|
51
|
+
/** Routes registered by app modules alone, before late connectors booted. */
|
|
52
|
+
appRoutes: number;
|
|
53
|
+
/** Routes on the app router once every connector had booted. */
|
|
54
|
+
totalRoutes: number;
|
|
55
|
+
/** Every app module that failed to import, in load order. */
|
|
56
|
+
moduleFailures: ModuleFailure[];
|
|
57
|
+
/** The model modules that imported, with their exports, in load order. */
|
|
58
|
+
modelModules: ModelModule[];
|
|
59
|
+
/** What happened to the connectors. */
|
|
50
60
|
connectors: {
|
|
51
|
-
/** Names of every registered connector (built-ins + the app's own). */
|
|
61
|
+
/** Names of every registered connector (built-ins + the app's own). */
|
|
62
|
+
registered: string[];
|
|
52
63
|
/**
|
|
53
64
|
* The connectors the APP configured, i.e. registered names that are not
|
|
54
65
|
* framework built-ins. This is the part of the list that varies between
|
|
55
66
|
* projects — the built-in count is a constant and diagnoses nothing.
|
|
56
67
|
*/
|
|
57
|
-
configured: string[];
|
|
58
|
-
|
|
68
|
+
configured: string[];
|
|
69
|
+
/** Names that booted without throwing. */
|
|
70
|
+
booted: string[];
|
|
71
|
+
/** Connectors doctor deliberately did not boot, with the reason. */
|
|
59
72
|
skipped: {
|
|
60
73
|
name: string;
|
|
61
74
|
reason: string;
|
|
62
|
-
}[];
|
|
75
|
+
}[];
|
|
76
|
+
/** Connectors whose `boot()` threw, with the message. */
|
|
63
77
|
failures: {
|
|
64
78
|
name: string;
|
|
65
79
|
message: string;
|
|
@@ -72,5 +86,4 @@ type DoctorBootContext = {
|
|
|
72
86
|
};
|
|
73
87
|
};
|
|
74
88
|
//#endregion
|
|
75
|
-
export { DoctorBootContext };
|
|
76
89
|
//# sourceMappingURL=check.types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.types.d.mts","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/doctor/check.types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"check.types.d.mts","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/doctor/check.types.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;YAuBY;;EAEV;;EAGA;;;;;;YAOU;;EAEV;;EAGA,SAAS;;;;;;;YAQC;;;;;EAKV;;EAGA;;EAGA;;EAGA;;EAGA,gBAAgB;;EAGhB,cAAc;;EAGd;;IAEE;;;;;;IAOA;;IAGA;;IAGA;MAAW;MAAc;;;IAGzB;MAAY;MAAc;;;;;;IAM1B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { config } from "../../../../config/config-getter.mjs";
|
|
2
2
|
import { appPath, rootPath } from "../../../../utils/paths.mjs";
|
|
3
3
|
import { parseLocaleDictionary } from "../../../../localization/parse-locale-dictionary.mjs";
|
|
4
|
+
import { isExpressionStatement, isIdentifier, isNumericLiteral, isPropertyAssignment, isStringLiteral, keyName, parseSourceFile, valueText } from "../../../../tooling/syntax/ast.mjs";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import { existsSync, readFileSync, readdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
6
|
-
import
|
|
7
|
+
import { parseSync } from "oxc-parser";
|
|
7
8
|
|
|
8
9
|
//#region ../../packages/core/src/cli/commands/doctor/checks/locales-ts-deprecated.check.ts
|
|
9
10
|
function localeSources() {
|
|
@@ -14,23 +15,19 @@ function localeSources() {
|
|
|
14
15
|
module: entry.name
|
|
15
16
|
})).filter(({ file }) => existsSync(file));
|
|
16
17
|
}
|
|
17
|
-
function propertyName(property) {
|
|
18
|
-
if (ts.isIdentifier(property.name) || ts.isStringLiteral(property.name)) return property.name.text;
|
|
19
|
-
}
|
|
20
18
|
function literalObject(node) {
|
|
21
|
-
if (
|
|
19
|
+
if (node?.type !== "ObjectExpression") return void 0;
|
|
22
20
|
const value = Object.create(null);
|
|
23
21
|
for (const member of node.properties) {
|
|
24
|
-
if (!
|
|
25
|
-
const key =
|
|
22
|
+
if (!isPropertyAssignment(member)) return void 0;
|
|
23
|
+
const key = keyName(member.key);
|
|
26
24
|
if (key === void 0) return void 0;
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
if (isStringLiteral(member.value) || isNumericLiteral(member.value)) value[key] = member.value.value;
|
|
26
|
+
else {
|
|
27
|
+
const nested = literalObject(member.value);
|
|
28
|
+
if (nested === void 0) return void 0;
|
|
29
|
+
value[key] = nested;
|
|
30
30
|
}
|
|
31
|
-
const nested = literalObject(member.initializer);
|
|
32
|
-
if (nested === void 0) return void 0;
|
|
33
|
-
value[key] = nested;
|
|
34
31
|
}
|
|
35
32
|
return value;
|
|
36
33
|
}
|
|
@@ -46,40 +43,38 @@ function flattenLiteral(value, group, entries) {
|
|
|
46
43
|
return Object.entries(value).every(([key, nested]) => flattenLiteral(nested, group === "" ? key : `${group}.${key}`, entries));
|
|
47
44
|
}
|
|
48
45
|
function inspect(source) {
|
|
49
|
-
|
|
46
|
+
const jsonFile = path.join(path.dirname(source.file), "locales.json");
|
|
47
|
+
if (existsSync(jsonFile)) return {
|
|
50
48
|
...source,
|
|
51
49
|
convertible: false,
|
|
52
50
|
reason: "locales.json already exists"
|
|
53
51
|
};
|
|
54
52
|
const text = readFileSync(source.file, "utf8");
|
|
55
|
-
const program =
|
|
56
|
-
|
|
57
|
-
fileName: source.file,
|
|
58
|
-
reportDiagnostics: true
|
|
59
|
-
}).diagnostics;
|
|
60
|
-
if (syntaxDiagnostics !== void 0 && syntaxDiagnostics.length > 0) return {
|
|
53
|
+
const program = parseSourceFile(source.file, text);
|
|
54
|
+
if (parseSync(source.file, text).errors.length > 0) return {
|
|
61
55
|
...source,
|
|
62
56
|
convertible: false,
|
|
63
57
|
reason: "TypeScript syntax is invalid"
|
|
64
58
|
};
|
|
65
|
-
const [importStatement, callStatement] = program.
|
|
66
|
-
|
|
59
|
+
const [importStatement, callStatement] = program.body;
|
|
60
|
+
const binding = importStatement?.type === "ImportDeclaration" ? importStatement.specifiers[0] : void 0;
|
|
61
|
+
if (importStatement?.type !== "ImportDeclaration" || importStatement.source.value !== "@warlock.js/core" || importStatement.importKind === "type" || importStatement.specifiers.length !== 1 || binding?.type !== "ImportSpecifier" || binding.importKind === "type" || binding.local.name !== "groupedTranslations" || valueText(binding.imported) !== "groupedTranslations") return {
|
|
67
62
|
...source,
|
|
68
63
|
convertible: false,
|
|
69
64
|
reason: "must import only groupedTranslations from @warlock.js/core"
|
|
70
65
|
};
|
|
71
|
-
if (program.
|
|
66
|
+
if (program.body.length !== 2) return {
|
|
72
67
|
...source,
|
|
73
68
|
convertible: false,
|
|
74
69
|
reason: "must contain only the groupedTranslations import and one call"
|
|
75
70
|
};
|
|
76
|
-
if (!callStatement || !
|
|
71
|
+
if (!callStatement || !isExpressionStatement(callStatement) || callStatement.expression.type !== "CallExpression") return {
|
|
77
72
|
...source,
|
|
78
73
|
convertible: false,
|
|
79
74
|
reason: "must contain one top-level groupedTranslations call"
|
|
80
75
|
};
|
|
81
76
|
const call = callStatement.expression;
|
|
82
|
-
if (!
|
|
77
|
+
if (!isIdentifier(call.callee) || valueText(call.callee) !== "groupedTranslations" || call.arguments.length !== 2 || !call.arguments[0] || !isStringLiteral(call.arguments[0])) return {
|
|
83
78
|
...source,
|
|
84
79
|
convertible: false,
|
|
85
80
|
reason: "must call groupedTranslations with a string group and object"
|
|
@@ -90,7 +85,7 @@ function inspect(source) {
|
|
|
90
85
|
convertible: false,
|
|
91
86
|
reason: "translation object must contain only literal keys, objects, strings, or numbers"
|
|
92
87
|
};
|
|
93
|
-
const group = call.arguments[0].
|
|
88
|
+
const group = call.arguments[0].value;
|
|
94
89
|
const entries = Object.create(null);
|
|
95
90
|
if (!flattenLiteral(dictionary, group, entries)) return {
|
|
96
91
|
...source,
|
|
@@ -167,5 +162,5 @@ const localesTsDeprecatedCheck = {
|
|
|
167
162
|
};
|
|
168
163
|
|
|
169
164
|
//#endregion
|
|
170
|
-
export { fixLocaleSources, localesTsDeprecatedCheck };
|
|
165
|
+
export { fixLocaleSources, inspectLocaleSources, localesTsDeprecatedCheck };
|
|
171
166
|
//# sourceMappingURL=locales-ts-deprecated.check.mjs.map
|