@warlock.js/core 5.30.0 → 5.31.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 +142 -36
- package/README.md +28 -23
- package/bin/source-load-hook.mjs +63 -0
- package/bin/warlock.js +102 -42
- package/esm/cli/commands/add.command.mjs +4 -2
- package/esm/cli/commands/add.command.mjs.map +1 -1
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs +69 -0
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -0
- package/esm/cli/commands/agents-md.command.mjs +38 -0
- package/esm/cli/commands/agents-md.command.mjs.map +1 -0
- package/esm/cli/commands/board/board-command.action.mjs +279 -0
- package/esm/cli/commands/board/board-command.action.mjs.map +1 -0
- package/esm/cli/commands/board.command.mjs +78 -0
- package/esm/cli/commands/board.command.mjs.map +1 -0
- package/esm/cli/commands/build.command.mjs +6 -1
- package/esm/cli/commands/build.command.mjs.map +1 -1
- package/esm/cli/commands/check/check-command.action.mjs +57 -0
- package/esm/cli/commands/check/check-command.action.mjs.map +1 -0
- package/esm/cli/commands/check/child-typecheck.mjs +66 -0
- package/esm/cli/commands/check/child-typecheck.mjs.map +1 -0
- package/esm/cli/commands/check/format-problems.mjs +43 -0
- package/esm/cli/commands/check/format-problems.mjs.map +1 -0
- package/esm/cli/commands/check/typecheck-command.action.mjs +61 -0
- package/esm/cli/commands/check/typecheck-command.action.mjs.map +1 -0
- package/esm/cli/commands/check.command.mjs +50 -0
- package/esm/cli/commands/check.command.mjs.map +1 -0
- package/esm/cli/commands/dev-server.command.mjs +9 -1
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs +8 -3
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs.map +1 -1
- package/esm/cli/commands/doctor/check.types.d.mts +76 -0
- package/esm/cli/commands/doctor/check.types.d.mts.map +1 -0
- package/esm/cli/commands/doctor/checks/config.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/config.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/connectors.check.mjs +2 -0
- package/esm/cli/commands/doctor/checks/connectors.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/handler-signature.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/handler-signature.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/health.check.mjs +3 -0
- package/esm/cli/commands/doctor/checks/health.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/optional-peers.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/optional-peers.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs +4 -0
- package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/routes.check.mjs +3 -0
- package/esm/cli/commands/doctor/checks/routes.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs +14 -6
- package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
- package/esm/cli/commands/doctor/format-report.mjs +30 -2
- package/esm/cli/commands/doctor/format-report.mjs.map +1 -1
- package/esm/cli/commands/doctor.command.mjs +4 -0
- package/esm/cli/commands/doctor.command.mjs.map +1 -1
- package/esm/cli/commands/explain/explain-command.action.mjs +64 -0
- package/esm/cli/commands/explain/explain-command.action.mjs.map +1 -0
- package/esm/cli/commands/explain.command.mjs +23 -0
- package/esm/cli/commands/explain.command.mjs.map +1 -0
- package/esm/cli/commands/generate/generate.command.mjs +124 -124
- package/esm/cli/commands/generate/generate.command.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs +311 -0
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/migration.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/migration.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs +1 -1
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +341 -0
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -0
- package/esm/cli/commands/generate/templates/stubs.mjs +19 -6
- package/esm/cli/commands/generate/templates/stubs.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs +137 -0
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -0
- package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
- package/esm/cli/commands/generate/utils/name-parser.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/prompt.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/writer.mjs +38 -13
- package/esm/cli/commands/generate/utils/writer.mjs.map +1 -1
- package/esm/cli/commands/inspect/inspect-command.action.mjs +72 -0
- package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -0
- package/esm/cli/commands/inspect.command.mjs +39 -0
- package/esm/cli/commands/inspect.command.mjs.map +1 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs +103 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -0
- package/esm/cli/commands/mcp.command.mjs +76 -0
- package/esm/cli/commands/mcp.command.mjs.map +1 -0
- package/esm/cli/commands/openapi-generator.action.mjs.map +1 -1
- package/esm/cli/commands/openapi-generator.command.mjs.map +1 -1
- package/esm/cli/commands/postman-generator.action.mjs.map +1 -1
- package/esm/cli/commands/postman-generator.command.mjs.map +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs +1 -1
- package/esm/cli/commands/test.command.mjs +131 -0
- package/esm/cli/commands/test.command.mjs.map +1 -0
- package/esm/cli/commands/trace/trace-command.action.mjs +145 -0
- package/esm/cli/commands/trace/trace-command.action.mjs.map +1 -0
- package/esm/cli/commands/trace.command.mjs +60 -0
- package/esm/cli/commands/trace.command.mjs.map +1 -0
- package/esm/cli/commands/typecheck.command.mjs +40 -0
- package/esm/cli/commands/typecheck.command.mjs.map +1 -0
- package/esm/cli/commands/upgrade.command.mjs +46 -0
- package/esm/cli/commands/upgrade.command.mjs.map +1 -0
- package/esm/cli/flush-and-exit.mjs +34 -0
- package/esm/cli/flush-and-exit.mjs.map +1 -0
- package/esm/cli/framework-cli-commands.mjs +23 -1
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +1 -0
- package/esm/cli/parse-cli-args.mjs.map +1 -1
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +34 -13
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-schema.d.mts +67 -0
- package/esm/config/config-schema.d.mts.map +1 -0
- package/esm/config/config-schema.mjs +77 -0
- package/esm/config/config-schema.mjs.map +1 -0
- package/esm/config/index.d.mts +6 -0
- package/esm/config/index.mjs +1 -0
- package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.mjs +2 -1
- package/esm/connectors/assert-no-reserved-connector-names.mjs.map +1 -1
- package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs +26 -2
- package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +3 -2
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/single-server-warnings.mjs.map +1 -1
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/container/index.d.mts.map +1 -1
- package/esm/container/index.mjs.map +1 -1
- package/esm/database/migrate-action.mjs.map +1 -1
- package/esm/database/models/database-log/database-log.d.mts +0 -28
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.d.mts +4 -0
- package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.mjs +2 -0
- package/esm/database/seeds/seeder.errors.mjs.map +1 -1
- package/esm/dev-server/boot-precondition-error.mjs +1 -0
- package/esm/dev-server/boot-precondition-error.mjs.map +1 -1
- package/esm/dev-server/create-worker.mjs +15 -9
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dev-agent-tooling.mjs +135 -0
- package/esm/dev-server/dev-agent-tooling.mjs.map +1 -0
- package/esm/dev-server/dev-logger.mjs.map +1 -1
- package/esm/dev-server/development-server.mjs +8 -0
- package/esm/dev-server/development-server.mjs.map +1 -1
- package/esm/dev-server/files-orchestrator.mjs +4 -5
- package/esm/dev-server/files-orchestrator.mjs.map +1 -1
- package/esm/dev-server/files-watcher.mjs +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +2 -3
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs +33 -0
- package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs.map +1 -0
- package/esm/dev-server/health-checker/default-health-checkers.mjs +31 -0
- package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -0
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +9 -3
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs +15 -4
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/oxlint-runner.mjs +302 -0
- package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -0
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -0
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.mjs +42 -0
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.mjs.map +1 -0
- package/esm/dev-server/loader/loader-port-acks.mjs +1 -1
- package/esm/dev-server/loader/loader-port-acks.mjs.map +1 -1
- package/esm/dev-server/loader/register-loader.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-hook.mjs +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +1 -1
- package/esm/dev-server/model-resource-typings.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +1 -0
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/parse-imports.mjs +1 -1
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/route-types-publisher.mjs +1 -1
- package/esm/dev-server/start-development-server.mjs.map +1 -1
- package/esm/dev-server/translation-keys-sources.mjs +1 -1
- package/esm/dev-server/translation-keys-sources.mjs.map +1 -1
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/type-generator.mjs +3 -3
- package/esm/dev-server/type-generator.mjs.map +1 -1
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/errors/container-key-missing-error.mjs +1 -0
- package/esm/errors/container-key-missing-error.mjs.map +1 -1
- package/esm/errors/error-codes.d.mts +653 -0
- package/esm/errors/error-codes.d.mts.map +1 -0
- package/esm/errors/error-codes.mjs +634 -0
- package/esm/errors/error-codes.mjs.map +1 -0
- package/esm/errors/esbuild-binary-missing-error.mjs +1 -0
- package/esm/errors/esbuild-binary-missing-error.mjs.map +1 -1
- package/esm/errors/index.d.mts +3 -1
- package/esm/errors/index.mjs +3 -1
- package/esm/errors/unknown-locale-error.mjs +1 -0
- package/esm/errors/unknown-locale-error.mjs.map +1 -1
- package/esm/errors/warlock-error.d.mts +23 -0
- package/esm/errors/warlock-error.d.mts.map +1 -0
- package/esm/errors/warlock-error.mjs +22 -0
- package/esm/errors/warlock-error.mjs.map +1 -0
- package/esm/generations/add-command.action.mjs +19 -3
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/features/access.feature.mjs +1 -1
- package/esm/generations/features/access.feature.mjs.map +1 -1
- package/esm/generations/features/bull-board.feature.mjs +1 -1
- package/esm/generations/features/bull-board.feature.mjs.map +1 -1
- package/esm/generations/features/mysql.feature.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +5 -2
- package/esm/generations/features/notifications.feature.mjs.map +1 -1
- package/esm/generations/features/queue.feature.mjs +1 -1
- package/esm/generations/features/queue.feature.mjs.map +1 -1
- package/esm/generations/features/react-email.feature.mjs +1 -1
- package/esm/generations/features/react-email.feature.mjs.map +1 -1
- package/esm/generations/features/shadcn.feature.mjs +1 -1
- package/esm/generations/features/shadcn.feature.mjs.map +1 -1
- package/esm/generations/features/shared/link-ai-package-import.mjs +1 -1
- package/esm/generations/features/shared/link-ai-package-import.mjs.map +1 -1
- 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/patch-tsconfig-include.mjs.map +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs.map +1 -1
- package/esm/generations/features/sitemap.feature.mjs +1 -1
- package/esm/generations/features/sitemap.feature.mjs.map +1 -1
- package/esm/generations/features/tailwind.feature.mjs +1 -1
- package/esm/generations/features/tailwind.feature.mjs.map +1 -1
- package/esm/generations/features/test.feature.mjs +11 -6
- package/esm/generations/features/test.feature.mjs.map +1 -1
- package/esm/generations/features/web.feature.mjs +1 -1
- package/esm/generations/features/web.feature.mjs.map +1 -1
- package/esm/generations/generation-fs.mjs +73 -0
- package/esm/generations/generation-fs.mjs.map +1 -0
- package/esm/generations/generation-run.mjs +185 -0
- package/esm/generations/generation-run.mjs.map +1 -0
- package/esm/generations/stubs.mjs +155 -13
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/bounded-stream-queue.d.mts +10 -0
- package/esm/http/bounded-stream-queue.d.mts.map +1 -0
- package/esm/http/bounded-stream-queue.mjs +97 -0
- package/esm/http/bounded-stream-queue.mjs.map +1 -0
- package/esm/http/build-rate-limit-options.d.mts +13 -0
- package/esm/http/build-rate-limit-options.d.mts.map +1 -1
- package/esm/http/build-rate-limit-options.mjs.map +1 -1
- package/esm/http/conditional-request.d.mts +86 -0
- package/esm/http/conditional-request.d.mts.map +1 -0
- package/esm/http/conditional-request.mjs +121 -0
- package/esm/http/conditional-request.mjs.map +1 -0
- package/esm/http/csp.d.mts +2 -0
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +1 -0
- package/esm/http/csp.mjs.map +1 -1
- package/esm/http/csrf-origin-policy.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +24 -84
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/errors/errors.d.mts +2 -0
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/errors/errors.mjs +1 -0
- package/esm/http/errors/errors.mjs.map +1 -1
- package/esm/http/escape-header-value.d.mts +18 -0
- package/esm/http/escape-header-value.d.mts.map +1 -0
- package/esm/http/escape-header-value.mjs +27 -0
- package/esm/http/escape-header-value.mjs.map +1 -0
- package/esm/http/flush-pending-cookies.mjs.map +1 -1
- package/esm/http/index.d.mts +5 -2
- package/esm/http/index.mjs +4 -1
- package/esm/http/lazy-static.mjs +194 -0
- package/esm/http/lazy-static.mjs.map +1 -0
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +7 -4
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/rate-limit-cache-store.mjs +2 -1
- package/esm/http/rate-limit-cache-store.mjs.map +1 -1
- package/esm/http/request-log-snapshot.d.mts +12 -5
- package/esm/http/request-log-snapshot.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.mjs +83 -4
- package/esm/http/request-log-snapshot.mjs.map +1 -1
- package/esm/http/request.d.mts +2 -2
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +5 -4
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +11 -1
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +164 -76
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/safe-redirect.d.mts +51 -0
- package/esm/http/safe-redirect.d.mts.map +1 -0
- package/esm/http/safe-redirect.mjs +80 -0
- package/esm/http/safe-redirect.mjs.map +1 -0
- package/esm/http/serialized.d.mts.map +1 -1
- package/esm/http/server.d.mts +3 -1
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +14 -4
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/stream-transport.mjs +4 -2
- package/esm/http/stream-transport.mjs.map +1 -1
- package/esm/http/types.d.mts +44 -11
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variant.mjs +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts +10 -7
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +61 -24
- package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
- package/esm/http/uploads/image-variant-cache-entries.mjs +78 -0
- package/esm/http/uploads/image-variant-cache-entries.mjs.map +1 -0
- package/esm/http/uploads/image-variant-cache.mjs +72 -30
- package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/image-variant-types.d.mts +2 -0
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +3 -1
- package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.mjs +3 -2
- package/esm/http/uploads/image-variants-config-error.mjs.map +1 -1
- package/esm/http/uploads/load-variant-source.mjs +1 -1
- package/esm/http/uploads/load-variant-source.mjs.map +1 -1
- package/esm/http/uploads/purge-image-variants.d.mts +7 -2
- package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/purge-image-variants.mjs +16 -16
- package/esm/http/uploads/purge-image-variants.mjs.map +1 -1
- package/esm/http/uploads/remote-variant-source.mjs +115 -0
- package/esm/http/uploads/remote-variant-source.mjs.map +1 -0
- package/esm/http/uploads/resolve-image-variant.d.mts +3 -4
- package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variant.mjs +10 -18
- package/esm/http/uploads/resolve-image-variant.mjs.map +1 -1
- package/esm/http/uploads/resolve-image-variants-config.mjs +5 -3
- package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
- package/esm/http/uploads/resolve-remote-image-variant.mjs +89 -0
- package/esm/http/uploads/resolve-remote-image-variant.mjs.map +1 -0
- package/esm/http/uploads/trim-image-variant-cache.mjs +193 -0
- package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -0
- package/esm/http/uploads/uploaded-file.controller.d.mts +5 -3
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +16 -8
- 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-types.d.mts +6 -2
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/index.d.mts +17 -6
- package/esm/index.mjs +14 -3
- package/esm/localization/parse-locale-dictionary.d.mts +2 -0
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +1 -0
- package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
- package/esm/mail/config.d.mts +12 -1
- package/esm/mail/config.d.mts.map +1 -1
- package/esm/mail/config.mjs +16 -1
- package/esm/mail/config.mjs.map +1 -1
- package/esm/mail/index.d.mts +1 -1
- package/esm/mail/index.mjs +1 -1
- package/esm/net/index.d.mts +2 -0
- package/esm/net/index.mjs +3 -0
- package/esm/openapi/build-openapi-document.d.mts.map +1 -1
- package/esm/openapi/build-openapi-document.mjs +8 -5
- package/esm/openapi/build-openapi-document.mjs.map +1 -1
- package/esm/openapi/error-responses.mjs +28 -2
- package/esm/openapi/error-responses.mjs.map +1 -1
- package/esm/openapi/postman/build-request-body.mjs.map +1 -1
- package/esm/openapi/postman/build-request-url.mjs.map +1 -1
- package/esm/openapi/postman/build-saved-responses.mjs.map +1 -1
- package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
- package/esm/openapi/postman/example-from-schema.mjs.map +1 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
- package/esm/openapi/postman/openapi-to-postman-collection.mjs.map +1 -1
- package/esm/openapi/postman/schema-refs.mjs.map +1 -1
- package/esm/openapi/postman/uuid-v5.mjs.map +1 -1
- package/esm/openapi/request-schemas.mjs.map +1 -1
- package/esm/openapi/response-schemas.mjs.map +1 -1
- package/esm/openapi/schema-registry.d.mts +1 -0
- package/esm/openapi/schema-registry.mjs.map +1 -1
- package/esm/openapi/security.mjs.map +1 -1
- package/esm/openapi/types.d.mts +3 -2
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-generated-imports.mjs +1 -0
- package/esm/production/assert-generated-imports.mjs.map +1 -1
- package/esm/production/production-builder.mjs +12 -4
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/resolve-build-config.mjs +1 -0
- package/esm/production/resolve-build-config.mjs.map +1 -1
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/route-registration-snapshot.mjs.map +1 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/restful.d.mts +5 -5
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/restful/restful.mjs.map +1 -1
- package/esm/router/build-route-rate-limit.mjs.map +1 -1
- package/esm/router/dev-dispatch.mjs +31 -12
- package/esm/router/dev-dispatch.mjs.map +1 -1
- package/esm/router/index.d.mts +4 -2
- package/esm/router/index.mjs +2 -0
- package/esm/router/log-request-lifecycle.mjs.map +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.mjs.map +1 -1
- package/esm/router/resolve-route-rate-limit.mjs +47 -0
- package/esm/router/resolve-route-rate-limit.mjs.map +1 -0
- package/esm/router/resolve-route-validation.mjs +19 -0
- package/esm/router/resolve-route-validation.mjs.map +1 -0
- package/esm/router/route-guard-names.mjs +30 -0
- package/esm/router/route-guard-names.mjs.map +1 -0
- package/esm/router/route-name-taken-error.d.mts +14 -0
- package/esm/router/route-name-taken-error.d.mts.map +1 -0
- package/esm/router/route-name-taken-error.mjs +18 -0
- package/esm/router/route-name-taken-error.mjs.map +1 -0
- package/esm/router/router.d.mts +32 -13
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +71 -38
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +137 -17
- package/esm/router/types.d.mts.map +1 -1
- package/esm/router/unguarded-route-diagnostics.d.mts +40 -0
- package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -0
- package/esm/router/unguarded-route-diagnostics.mjs +95 -0
- package/esm/router/unguarded-route-diagnostics.mjs.map +1 -0
- 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/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/local-disk-roots.mjs +24 -0
- package/esm/storage/local-disk-roots.mjs.map +1 -0
- package/esm/storage/storage.d.mts +14 -0
- package/esm/storage/storage.d.mts.map +1 -1
- package/esm/storage/storage.mjs +22 -0
- package/esm/storage/storage.mjs.map +1 -1
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts +2 -0
- package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.mjs +1 -0
- package/esm/storage/utils/storage-not-initialized-error.mjs.map +1 -1
- package/esm/tests/authenticated-test-client.d.mts +32 -0
- package/esm/tests/authenticated-test-client.d.mts.map +1 -0
- package/esm/tests/authenticated-test-client.mjs +40 -0
- package/esm/tests/authenticated-test-client.mjs.map +1 -0
- package/esm/tests/factories.d.mts +59 -0
- package/esm/tests/factories.d.mts.map +1 -0
- package/esm/tests/factories.mjs +105 -0
- package/esm/tests/factories.mjs.map +1 -0
- package/esm/tests/fakes/cache-fake.d.mts +29 -0
- package/esm/tests/fakes/cache-fake.d.mts.map +1 -0
- package/esm/tests/fakes/cache-fake.mjs +79 -0
- package/esm/tests/fakes/cache-fake.mjs.map +1 -0
- package/esm/tests/fakes/clock-fake.d.mts +32 -0
- package/esm/tests/fakes/clock-fake.d.mts.map +1 -0
- package/esm/tests/fakes/clock-fake.mjs +69 -0
- package/esm/tests/fakes/clock-fake.mjs.map +1 -0
- package/esm/tests/fakes/fake-assertion-error.d.mts +13 -0
- package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -0
- package/esm/tests/fakes/fake-assertion-error.mjs +20 -0
- package/esm/tests/fakes/fake-assertion-error.mjs.map +1 -0
- package/esm/tests/fakes/ids-fake.d.mts +22 -0
- package/esm/tests/fakes/ids-fake.d.mts.map +1 -0
- package/esm/tests/fakes/ids-fake.mjs +57 -0
- package/esm/tests/fakes/ids-fake.mjs.map +1 -0
- package/esm/tests/fakes/index.d.mts +8 -0
- package/esm/tests/fakes/index.mjs +10 -0
- package/esm/tests/fakes/mail-fake.d.mts +41 -0
- package/esm/tests/fakes/mail-fake.d.mts.map +1 -0
- package/esm/tests/fakes/mail-fake.mjs +111 -0
- package/esm/tests/fakes/mail-fake.mjs.map +1 -0
- package/esm/tests/fakes/queue-fake.d.mts +48 -0
- package/esm/tests/fakes/queue-fake.d.mts.map +1 -0
- package/esm/tests/fakes/queue-fake.mjs +134 -0
- package/esm/tests/fakes/queue-fake.mjs.map +1 -0
- package/esm/tests/fakes/storage-fake.d.mts +31 -0
- package/esm/tests/fakes/storage-fake.d.mts.map +1 -0
- package/esm/tests/fakes/storage-fake.mjs +122 -0
- package/esm/tests/fakes/storage-fake.mjs.map +1 -0
- package/esm/tests/fakes/test-fakes.d.mts +39 -0
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -0
- package/esm/tests/fakes/test-fakes.mjs +90 -0
- package/esm/tests/fakes/test-fakes.mjs.map +1 -0
- package/esm/tests/index.d.mts +14 -2
- package/esm/tests/index.mjs +15 -2
- package/esm/tests/snapshot-response.d.mts +34 -0
- package/esm/tests/snapshot-response.d.mts.map +1 -0
- package/esm/tests/snapshot-response.mjs +42 -0
- package/esm/tests/snapshot-response.mjs.map +1 -0
- package/esm/tests/start-http-development-server.d.mts +22 -0
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +36 -3
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-helpers.d.mts +20 -1
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-helpers.mjs +40 -27
- package/esm/tests/test-helpers.mjs.map +1 -1
- package/esm/tests/test-http-server.d.mts +62 -0
- package/esm/tests/test-http-server.d.mts.map +1 -0
- package/esm/tests/test-http-server.mjs +119 -0
- package/esm/tests/test-http-server.mjs.map +1 -0
- package/esm/tests/vitest-setup.d.mts +11 -0
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs +12 -4
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.d.mts +27 -0
- package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -0
- package/esm/tooling/agents-md/agents-md-markers.mjs +59 -0
- package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -0
- package/esm/tooling/agents-md/agents-md-refresher.d.mts +36 -0
- package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -0
- package/esm/tooling/agents-md/agents-md-refresher.mjs +72 -0
- package/esm/tooling/agents-md/agents-md-refresher.mjs.map +1 -0
- package/esm/tooling/agents-md/index.mjs +7 -0
- package/esm/tooling/agents-md/installed-skills.d.mts +30 -0
- package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -0
- package/esm/tooling/agents-md/installed-skills.mjs +74 -0
- package/esm/tooling/agents-md/installed-skills.mjs.map +1 -0
- package/esm/tooling/agents-md/render-agents-md.d.mts +33 -0
- package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -0
- package/esm/tooling/agents-md/render-agents-md.mjs +195 -0
- package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -0
- package/esm/tooling/agents-md/write-agents-md.d.mts +33 -0
- package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -0
- package/esm/tooling/agents-md/write-agents-md.mjs +49 -0
- package/esm/tooling/agents-md/write-agents-md.mjs.map +1 -0
- package/esm/tooling/board/board-message.d.mts +31 -0
- package/esm/tooling/board/board-message.d.mts.map +1 -0
- package/esm/tooling/board/board-message.mjs +86 -0
- package/esm/tooling/board/board-message.mjs.map +1 -0
- package/esm/tooling/board/board.d.mts +109 -0
- package/esm/tooling/board/board.d.mts.map +1 -0
- package/esm/tooling/board/board.mjs +406 -0
- package/esm/tooling/board/board.mjs.map +1 -0
- package/esm/tooling/board/board.types.d.mts +72 -0
- package/esm/tooling/board/board.types.d.mts.map +1 -0
- package/esm/tooling/board/board.types.mjs +54 -0
- package/esm/tooling/board/board.types.mjs.map +1 -0
- package/esm/tooling/check/changed-files.d.mts +33 -0
- package/esm/tooling/check/changed-files.d.mts.map +1 -0
- package/esm/tooling/check/changed-files.mjs +73 -0
- package/esm/tooling/check/changed-files.mjs.map +1 -0
- package/esm/tooling/check/check-report.types.d.mts +62 -0
- package/esm/tooling/check/check-report.types.d.mts.map +1 -0
- package/esm/tooling/check/check-report.types.mjs +37 -0
- package/esm/tooling/check/check-report.types.mjs.map +1 -0
- package/esm/tooling/check/code-style-conventions.mjs +106 -0
- package/esm/tooling/check/code-style-conventions.mjs.map +1 -0
- package/esm/tooling/check/conventions-step.d.mts +34 -0
- package/esm/tooling/check/conventions-step.d.mts.map +1 -0
- package/esm/tooling/check/conventions-step.mjs +184 -0
- package/esm/tooling/check/conventions-step.mjs.map +1 -0
- package/esm/tooling/check/environment-step.d.mts +18 -0
- package/esm/tooling/check/environment-step.d.mts.map +1 -0
- package/esm/tooling/check/environment-step.mjs +78 -0
- package/esm/tooling/check/environment-step.mjs.map +1 -0
- package/esm/tooling/check/index.d.mts +8 -0
- package/esm/tooling/check/index.mjs +10 -0
- package/esm/tooling/check/lint-step.d.mts +19 -0
- package/esm/tooling/check/lint-step.d.mts.map +1 -0
- package/esm/tooling/check/lint-step.mjs +111 -0
- package/esm/tooling/check/lint-step.mjs.map +1 -0
- package/esm/tooling/check/request-input.mjs +132 -0
- package/esm/tooling/check/request-input.mjs.map +1 -0
- package/esm/tooling/check/run-check.d.mts +35 -0
- package/esm/tooling/check/run-check.d.mts.map +1 -0
- package/esm/tooling/check/run-check.mjs +192 -0
- package/esm/tooling/check/run-check.mjs.map +1 -0
- package/esm/tooling/check/run-tests.d.mts +48 -0
- package/esm/tooling/check/run-tests.d.mts.map +1 -0
- package/esm/tooling/check/run-tests.mjs +93 -0
- package/esm/tooling/check/run-tests.mjs.map +1 -0
- package/esm/tooling/check/security-conventions.mjs +648 -0
- package/esm/tooling/check/security-conventions.mjs.map +1 -0
- package/esm/tooling/check/source-ast.mjs +195 -0
- package/esm/tooling/check/source-ast.mjs.map +1 -0
- package/esm/tooling/check/source-files.mjs +27 -0
- package/esm/tooling/check/source-files.mjs.map +1 -0
- package/esm/tooling/check/tests-step.d.mts +34 -0
- package/esm/tooling/check/tests-step.d.mts.map +1 -0
- package/esm/tooling/check/tests-step.mjs +177 -0
- package/esm/tooling/check/tests-step.mjs.map +1 -0
- package/esm/tooling/dev-state/dev-server-state.d.mts +39 -0
- package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -0
- package/esm/tooling/dev-state/dev-server-state.mjs +67 -0
- package/esm/tooling/dev-state/dev-server-state.mjs.map +1 -0
- package/esm/tooling/devtools/devtools-client.d.mts +91 -0
- package/esm/tooling/devtools/devtools-client.d.mts.map +1 -0
- package/esm/tooling/devtools/devtools-client.mjs +155 -0
- package/esm/tooling/devtools/devtools-client.mjs.map +1 -0
- package/esm/tooling/generate/generation.d.mts +78 -0
- package/esm/tooling/generate/generation.d.mts.map +1 -0
- package/esm/tooling/generate/generation.mjs +123 -0
- package/esm/tooling/generate/generation.mjs.map +1 -0
- package/esm/tooling/generate/generator-spec.d.mts +57 -0
- package/esm/tooling/generate/generator-spec.d.mts.map +1 -0
- package/esm/tooling/generate/generator-spec.mjs +102 -0
- package/esm/tooling/generate/generator-spec.mjs.map +1 -0
- package/esm/tooling/generate/index.mjs +6 -0
- package/esm/tooling/generate/project-files.mjs +121 -0
- package/esm/tooling/generate/project-files.mjs.map +1 -0
- package/esm/tooling/generate/run-cli.d.mts +40 -0
- package/esm/tooling/generate/run-cli.d.mts.map +1 -0
- package/esm/tooling/generate/run-cli.mjs +93 -0
- package/esm/tooling/generate/run-cli.mjs.map +1 -0
- package/esm/tooling/generate/unified-diff.d.mts +37 -0
- package/esm/tooling/generate/unified-diff.d.mts.map +1 -0
- package/esm/tooling/generate/unified-diff.mjs +161 -0
- package/esm/tooling/generate/unified-diff.mjs.map +1 -0
- package/esm/tooling/index.d.mts +41 -0
- package/esm/tooling/index.mjs +45 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts +23 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -0
- package/esm/tooling/inspect/boot-for-inspect.mjs +63 -0
- package/esm/tooling/inspect/boot-for-inspect.mjs.map +1 -0
- package/esm/tooling/inspect/collect-config.mjs +77 -0
- package/esm/tooling/inspect/collect-config.mjs.map +1 -0
- package/esm/tooling/inspect/collect-models.d.mts +9 -0
- package/esm/tooling/inspect/collect-models.d.mts.map +1 -0
- package/esm/tooling/inspect/collect-models.mjs +154 -0
- package/esm/tooling/inspect/collect-models.mjs.map +1 -0
- package/esm/tooling/inspect/collect-packages.d.mts +10 -0
- package/esm/tooling/inspect/collect-packages.d.mts.map +1 -0
- package/esm/tooling/inspect/collect-packages.mjs +157 -0
- package/esm/tooling/inspect/collect-packages.mjs.map +1 -0
- package/esm/tooling/inspect/collect-pages.mjs +108 -0
- package/esm/tooling/inspect/collect-pages.mjs.map +1 -0
- package/esm/tooling/inspect/collect-routes.mjs +168 -0
- package/esm/tooling/inspect/collect-routes.mjs.map +1 -0
- package/esm/tooling/inspect/event-recorder.d.mts +37 -0
- package/esm/tooling/inspect/event-recorder.d.mts.map +1 -0
- package/esm/tooling/inspect/event-recorder.mjs +91 -0
- package/esm/tooling/inspect/event-recorder.mjs.map +1 -0
- package/esm/tooling/inspect/index.d.mts +7 -0
- package/esm/tooling/inspect/index.mjs +7 -0
- package/esm/tooling/inspect/inspect-app.d.mts +53 -0
- package/esm/tooling/inspect/inspect-app.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-app.mjs +92 -0
- package/esm/tooling/inspect/inspect-app.mjs.map +1 -0
- package/esm/tooling/inspect/inspect-report.schema.d.mts +15 -0
- package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-report.schema.mjs +463 -0
- package/esm/tooling/inspect/inspect-report.schema.mjs.map +1 -0
- package/esm/tooling/inspect/inspect-report.types.d.mts +196 -0
- package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-report.types.mjs +33 -0
- package/esm/tooling/inspect/inspect-report.types.mjs.map +1 -0
- package/esm/tooling/mcp/create-mcp-context.d.mts +26 -0
- package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -0
- package/esm/tooling/mcp/create-mcp-context.mjs +75 -0
- package/esm/tooling/mcp/create-mcp-context.mjs.map +1 -0
- package/esm/tooling/mcp/db-schema.d.mts +49 -0
- package/esm/tooling/mcp/db-schema.d.mts.map +1 -0
- package/esm/tooling/mcp/db-schema.mjs +56 -0
- package/esm/tooling/mcp/db-schema.mjs.map +1 -0
- package/esm/tooling/mcp/docs-search.d.mts +72 -0
- package/esm/tooling/mcp/docs-search.d.mts.map +1 -0
- package/esm/tooling/mcp/docs-search.mjs +178 -0
- package/esm/tooling/mcp/docs-search.mjs.map +1 -0
- package/esm/tooling/mcp/index.mjs +9 -0
- package/esm/tooling/mcp/load-ai-tools.d.mts +62 -0
- package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -0
- package/esm/tooling/mcp/load-ai-tools.mjs +44 -0
- package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -0
- package/esm/tooling/mcp/mcp-tools.d.mts +60 -0
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -0
- package/esm/tooling/mcp/mcp-tools.mjs +513 -0
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -0
- package/esm/tooling/mcp/start-mcp-server.d.mts +56 -0
- package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -0
- package/esm/tooling/mcp/start-mcp-server.mjs +126 -0
- package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -0
- package/esm/tooling/mcp/tool-input.d.mts +75 -0
- package/esm/tooling/mcp/tool-input.d.mts.map +1 -0
- package/esm/tooling/mcp/tool-input.mjs +72 -0
- package/esm/tooling/mcp/tool-input.mjs.map +1 -0
- package/esm/tooling/problem.d.mts +45 -0
- package/esm/tooling/problem.d.mts.map +1 -0
- package/esm/tooling/problem.mjs +28 -0
- package/esm/tooling/problem.mjs.map +1 -0
- package/esm/tooling/trace/trace-report.types.d.mts +71 -0
- package/esm/tooling/trace/trace-report.types.d.mts.map +1 -0
- package/esm/tooling/trace/trace-report.types.mjs +7 -0
- package/esm/tooling/trace/trace-report.types.mjs.map +1 -0
- package/esm/tooling/trace/trace-request.d.mts +83 -0
- package/esm/tooling/trace/trace-request.d.mts.map +1 -0
- package/esm/tooling/trace/trace-request.mjs +241 -0
- package/esm/tooling/trace/trace-request.mjs.map +1 -0
- package/esm/tooling/typecheck/index.d.mts +1 -0
- package/esm/tooling/typecheck/index.mjs +3 -0
- package/esm/tooling/typecheck/run-typecheck.d.mts +59 -0
- package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -0
- package/esm/tooling/typecheck/run-typecheck.mjs +153 -0
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -0
- package/esm/upgrade/codemods/head-viewport.mjs +46 -0
- package/esm/upgrade/codemods/head-viewport.mjs.map +1 -0
- package/esm/upgrade/codemods/helpers.mjs +81 -0
- package/esm/upgrade/codemods/helpers.mjs.map +1 -0
- package/esm/upgrade/codemods/index.mjs +34 -0
- package/esm/upgrade/codemods/index.mjs.map +1 -0
- package/esm/upgrade/codemods/logger-sync-calls.mjs +57 -0
- package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -0
- package/esm/upgrade/codemods/package-json.mjs +122 -0
- package/esm/upgrade/codemods/package-json.mjs.map +1 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs +82 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -0
- package/esm/upgrade/codemods/review-sites.mjs +262 -0
- package/esm/upgrade/codemods/review-sites.mjs.map +1 -0
- package/esm/upgrade/diff.mjs +119 -0
- package/esm/upgrade/diff.mjs.map +1 -0
- package/esm/upgrade/format-upgrade-report.mjs +32 -0
- package/esm/upgrade/format-upgrade-report.mjs.map +1 -0
- package/esm/upgrade/load-ts-morph.mjs +48 -0
- package/esm/upgrade/load-ts-morph.mjs.map +1 -0
- package/esm/upgrade/notes.mjs +16 -0
- package/esm/upgrade/notes.mjs.map +1 -0
- package/esm/upgrade/run-upgrade.mjs +246 -0
- package/esm/upgrade/run-upgrade.mjs.map +1 -0
- package/esm/upgrade/upgrade-command.action.mjs +37 -0
- package/esm/upgrade/upgrade-command.action.mjs.map +1 -0
- package/esm/upgrade/version.mjs +39 -0
- package/esm/upgrade/version.mjs.map +1 -0
- package/esm/use-cases/use-cases-registry.mjs.map +1 -1
- package/esm/utils/clock.d.mts +33 -0
- package/esm/utils/clock.d.mts.map +1 -0
- package/esm/utils/clock.mjs +27 -0
- package/esm/utils/clock.mjs.map +1 -0
- package/esm/utils/framework-vesion.mjs +1 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/ids.d.mts +32 -0
- package/esm/utils/ids.d.mts.map +1 -0
- package/esm/utils/ids.mjs +33 -0
- package/esm/utils/ids.mjs.map +1 -0
- package/esm/utils/index.d.mts +3 -0
- package/esm/utils/index.mjs +3 -0
- package/esm/utils/runtime.d.mts +59 -0
- package/esm/utils/runtime.d.mts.map +1 -0
- package/esm/utils/runtime.mjs +85 -0
- package/esm/utils/runtime.mjs.map +1 -0
- package/esm/validation/index.d.mts +1 -1
- package/esm/validation/types.d.mts +57 -2
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +19 -2
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validation-failure-status.mjs +15 -0
- package/esm/validation/validation-failure-status.mjs.map +1 -0
- package/esm/validation/validators/file-validator.d.mts +0 -16
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/warlock-config/bundle-config.mjs +1 -1
- package/esm/warlock-config/types.d.mts +27 -3
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/llms-full.txt +3166 -736
- package/llms.txt +16 -6
- package/package.json +43 -13
- package/schemas/inspect-report.schema.json +554 -0
- package/skills/README.md +9 -0
- package/skills/add-connector/SKILL.md +26 -38
- package/skills/benchmark-code/SKILL.md +30 -24
- package/skills/build-restful/SKILL.md +14 -14
- package/skills/build-url/SKILL.md +18 -18
- package/skills/configure-app/SKILL.md +107 -14
- package/skills/create-controller/SKILL.md +25 -12
- package/skills/create-module/SKILL.md +3 -3
- package/skills/define-resource/SKILL.md +32 -29
- package/skills/encrypt-data/SKILL.md +21 -19
- package/skills/generate-openapi/SKILL.md +50 -24
- package/skills/hash-password/SKILL.md +2 -2
- package/skills/health-checks/SKILL.md +24 -7
- package/skills/index.md +9 -4
- package/skills/lower-stage3-decorators/SKILL.md +4 -4
- package/skills/make-endpoint/SKILL.md +110 -0
- package/skills/model-factories/SKILL.md +92 -0
- package/skills/process-image/SKILL.md +32 -30
- package/skills/register-route/SKILL.md +109 -10
- package/skills/request-memo/SKILL.md +1 -1
- package/skills/request-tracing/SKILL.md +4 -1
- package/skills/resolve-path/SKILL.md +45 -44
- package/skills/retry-operation/SKILL.md +20 -11
- package/skills/run-app/SKILL.md +106 -22
- package/skills/send-response/SKILL.md +179 -14
- package/skills/store-file/SKILL.md +93 -53
- package/skills/test-fakes/SKILL.md +123 -0
- package/skills/test-http/SKILL.md +125 -21
- package/skills/test-service/SKILL.md +41 -1
- package/skills/update-packages/SKILL.md +29 -18
- package/skills/upgrade-from-5-29/SKILL.md +413 -0
- package/skills/upload-file/SKILL.md +31 -33
- package/skills/use-app-context/SKILL.md +38 -31
- package/skills/use-middleware/SKILL.md +45 -25
- package/skills/use-model-transformers/SKILL.md +37 -28
- package/skills/use-repository/SKILL.md +2 -2
- package/skills/validate-input/SKILL.md +72 -28
- package/skills/warlock-agents-md/SKILL.md +96 -0
- package/skills/warlock-board/SKILL.md +123 -0
- package/skills/warlock-check/SKILL.md +132 -0
- package/skills/warlock-conventions/SKILL.md +115 -0
- package/skills/warlock-doctor/SKILL.md +55 -22
- package/skills/warlock-inspect/SKILL.md +134 -0
- package/skills/warlock-mcp/SKILL.md +120 -0
- package/skills/warlock-routes/SKILL.md +18 -11
- package/skills/warlock-trace/SKILL.md +81 -0
- package/skills/wire-socket/SKILL.md +8 -8
- package/skills/write-seeder/SKILL.md +46 -32
- package/skills/write-use-case/SKILL.md +40 -27
- package/esm/http/uploads/matches-if-none-match.mjs +0 -13
- package/esm/http/uploads/matches-if-none-match.mjs.map +0 -1
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { importedLocalNames, importsFrom, manualAt, objectProperty, objectPropertyNames } from "./helpers.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../packages/core/src/upgrade/codemods/review-sites.ts
|
|
4
|
+
/**
|
|
5
|
+
* Breaking changes that are behavioural decisions, not mechanical edits. These
|
|
6
|
+
* codemods change nothing; they list every call site to review with the
|
|
7
|
+
* reason, so nothing is missed.
|
|
8
|
+
*/
|
|
9
|
+
/** Call expressions in files that import from `moduleName`. */
|
|
10
|
+
function callsIn(context, moduleName) {
|
|
11
|
+
const { SyntaxKind } = context.tsMorph;
|
|
12
|
+
return context.sourceFiles.filter((sourceFile) => importsFrom(sourceFile, moduleName)).flatMap((sourceFile) => sourceFile.getDescendantsOfKind(SyntaxKind.CallExpression));
|
|
13
|
+
}
|
|
14
|
+
function calleeName(context, call) {
|
|
15
|
+
const { Node } = context.tsMorph;
|
|
16
|
+
const callee = call.getExpression();
|
|
17
|
+
if (Node.isIdentifier(callee)) return callee.getText();
|
|
18
|
+
if (Node.isPropertyAccessExpression(callee)) return callee.getName();
|
|
19
|
+
}
|
|
20
|
+
/** `v.object(...)....catch(` → whether the chain starts at a container factory. */
|
|
21
|
+
function chainRoot(context, call) {
|
|
22
|
+
const { Node } = context.tsMorph;
|
|
23
|
+
let current = call.getExpression();
|
|
24
|
+
let root;
|
|
25
|
+
for (;;) {
|
|
26
|
+
if (Node.isPropertyAccessExpression(current)) {
|
|
27
|
+
current = current.getExpression();
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (Node.isCallExpression(current)) {
|
|
31
|
+
const callee = current.getExpression();
|
|
32
|
+
if (Node.isPropertyAccessExpression(callee)) root = callee.getText();
|
|
33
|
+
current = callee;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
return root;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const sealValidateResult = {
|
|
40
|
+
id: "seal-validate-result",
|
|
41
|
+
version: "5.30.0",
|
|
42
|
+
package: "@warlock.js/seal",
|
|
43
|
+
title: "Check `isValid` before reading `validate()` data",
|
|
44
|
+
skill: "seal-basics",
|
|
45
|
+
run(context) {
|
|
46
|
+
const { Node } = context.tsMorph;
|
|
47
|
+
const output = {
|
|
48
|
+
edits: [],
|
|
49
|
+
manual: []
|
|
50
|
+
};
|
|
51
|
+
for (const sourceFile of context.sourceFiles) {
|
|
52
|
+
const validators = importedLocalNames(sourceFile, "@warlock.js/seal", "validate");
|
|
53
|
+
if (validators.size === 0) continue;
|
|
54
|
+
const text = sourceFile.getFullText();
|
|
55
|
+
for (const call of sourceFile.getDescendantsOfKind(context.tsMorph.SyntaxKind.CallExpression)) {
|
|
56
|
+
const callee = call.getExpression();
|
|
57
|
+
if (!Node.isIdentifier(callee) || !validators.has(callee.getText())) continue;
|
|
58
|
+
const name = call.getFirstAncestorByKind(context.tsMorph.SyntaxKind.VariableDeclaration)?.getNameNode();
|
|
59
|
+
if (!name || !Node.isIdentifier(name)) continue;
|
|
60
|
+
const variable = name.getText();
|
|
61
|
+
if (!text.includes(`${variable}.data`) || text.includes(`${variable}.isValid`)) continue;
|
|
62
|
+
output.manual.push(manualAt(context, call, `\`${variable}.data\` is \`undefined\` when validation fails and typed only after \`if (${variable}.isValid)\`. Check it before reading the data.`));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return output;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const aiToolDispatch = {
|
|
69
|
+
id: "ai-tool-dispatch",
|
|
70
|
+
version: "5.30.0",
|
|
71
|
+
package: "@warlock.js/ai",
|
|
72
|
+
title: "Review agents whose tools now run concurrently",
|
|
73
|
+
skill: "upgrade-from-5-29",
|
|
74
|
+
run(context) {
|
|
75
|
+
const { Node } = context.tsMorph;
|
|
76
|
+
const output = {
|
|
77
|
+
edits: [],
|
|
78
|
+
manual: []
|
|
79
|
+
};
|
|
80
|
+
for (const call of callsIn(context, "@warlock.js/ai")) {
|
|
81
|
+
const name = calleeName(context, call);
|
|
82
|
+
if (name !== "agent" && name !== "spawnSubAgent") continue;
|
|
83
|
+
const options = call.getArguments()[0];
|
|
84
|
+
if (!options || !Node.isObjectLiteralExpression(options)) continue;
|
|
85
|
+
const keys = objectPropertyNames(context.tsMorph, options);
|
|
86
|
+
if (!keys.has("tools") || keys.has("toolDispatch") || keys.has("maxConcurrentTools")) continue;
|
|
87
|
+
output.manual.push(manualAt(context, call, `\`${name}()\` with tools now runs one trip's tools concurrently (up to 4). If a tool depends on another's side effects, set \`toolDispatch: "sequential"\`.`));
|
|
88
|
+
}
|
|
89
|
+
return output;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const RESERVED_ANTHROPIC_BODY_KEYS = [
|
|
93
|
+
"model",
|
|
94
|
+
"messages",
|
|
95
|
+
"system",
|
|
96
|
+
"tools",
|
|
97
|
+
"mcp_servers",
|
|
98
|
+
"stream"
|
|
99
|
+
];
|
|
100
|
+
const aiAnthropicBody = {
|
|
101
|
+
id: "ai-anthropic-body",
|
|
102
|
+
version: "5.30.0",
|
|
103
|
+
package: "@warlock.js/ai-anthropic",
|
|
104
|
+
title: "Move reserved keys out of `providerOptions.anthropic.body`",
|
|
105
|
+
skill: "upgrade-from-5-29",
|
|
106
|
+
run(context) {
|
|
107
|
+
const { Node, SyntaxKind } = context.tsMorph;
|
|
108
|
+
const output = {
|
|
109
|
+
edits: [],
|
|
110
|
+
manual: []
|
|
111
|
+
};
|
|
112
|
+
for (const sourceFile of context.sourceFiles) for (const literal of sourceFile.getDescendantsOfKind(SyntaxKind.ObjectLiteralExpression)) {
|
|
113
|
+
const anthropic = objectProperty(context.tsMorph, literal, "anthropic");
|
|
114
|
+
if (!anthropic || !Node.isObjectLiteralExpression(anthropic)) continue;
|
|
115
|
+
const parent = literal.getParent();
|
|
116
|
+
if (!parent || !Node.isPropertyAssignment(parent) || parent.getName() !== "providerOptions") continue;
|
|
117
|
+
const body = objectProperty(context.tsMorph, anthropic, "body");
|
|
118
|
+
if (!body || !Node.isObjectLiteralExpression(body)) continue;
|
|
119
|
+
const reserved = RESERVED_ANTHROPIC_BODY_KEYS.filter((key) => objectPropertyNames(context.tsMorph, body).has(key));
|
|
120
|
+
if (reserved.length === 0) continue;
|
|
121
|
+
output.manual.push(manualAt(context, body, `\`providerOptions.anthropic.body\` can no longer set ${reserved.map((key) => `\`${key}\``).join(", ")} (it throws InvalidRequestError). Use the normal model/messages/tools options.`));
|
|
122
|
+
}
|
|
123
|
+
return output;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const aiFinishReason = {
|
|
127
|
+
id: "ai-finish-reason",
|
|
128
|
+
version: "5.30.0",
|
|
129
|
+
package: "@warlock.js/ai",
|
|
130
|
+
title: "Handle the new finish reasons",
|
|
131
|
+
skill: "upgrade-from-5-29",
|
|
132
|
+
run(context) {
|
|
133
|
+
const { SyntaxKind } = context.tsMorph;
|
|
134
|
+
const output = {
|
|
135
|
+
edits: [],
|
|
136
|
+
manual: []
|
|
137
|
+
};
|
|
138
|
+
for (const sourceFile of context.sourceFiles) {
|
|
139
|
+
if (!importsFrom(sourceFile, "@warlock.js/ai")) continue;
|
|
140
|
+
for (const statement of sourceFile.getDescendantsOfKind(SyntaxKind.SwitchStatement)) {
|
|
141
|
+
if (!/finishReason$/.test(statement.getExpression().getText())) continue;
|
|
142
|
+
output.manual.push(manualAt(context, statement, "A `finishReason` switch: 5.30 adds \"context_exceeded\", \"pause_turn\" and \"refusal\" (Anthropic used to report them as \"length\"/\"error\"). Handle each."));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return output;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const sealRefineOutput = {
|
|
149
|
+
id: "seal-refine-output",
|
|
150
|
+
version: "5.31.0",
|
|
151
|
+
package: "@warlock.js/seal",
|
|
152
|
+
title: "Review `.refine()` callbacks",
|
|
153
|
+
skill: "seal-basics",
|
|
154
|
+
run(context) {
|
|
155
|
+
const output = {
|
|
156
|
+
edits: [],
|
|
157
|
+
manual: []
|
|
158
|
+
};
|
|
159
|
+
for (const call of callsIn(context, "@warlock.js/seal")) {
|
|
160
|
+
if (calleeName(context, call) !== "refine") continue;
|
|
161
|
+
output.manual.push(manualAt(context, call, "`.refine()` now runs on the validated output, after child rules and transforms, and skips absent/null/invalid values. Move checks that need the raw input to `.addRule()`."));
|
|
162
|
+
}
|
|
163
|
+
return output;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
const CONTAINERS = /^v\.(object|array|record|tuple)$/;
|
|
167
|
+
const sealContainerCatch = {
|
|
168
|
+
id: "seal-container-catch",
|
|
169
|
+
version: "5.31.0",
|
|
170
|
+
package: "@warlock.js/seal",
|
|
171
|
+
title: "Move `.catch()` off container validators",
|
|
172
|
+
skill: "seal-basics",
|
|
173
|
+
run(context) {
|
|
174
|
+
const output = {
|
|
175
|
+
edits: [],
|
|
176
|
+
manual: []
|
|
177
|
+
};
|
|
178
|
+
for (const call of callsIn(context, "@warlock.js/seal")) {
|
|
179
|
+
if (calleeName(context, call) !== "catch") continue;
|
|
180
|
+
const root = chainRoot(context, call);
|
|
181
|
+
if (!root || !CONTAINERS.test(root)) continue;
|
|
182
|
+
output.manual.push(manualAt(context, call, `\`.catch()\` on \`${root}()\` is now a no-op, including for the container's own rules. Put the catch on the child validators, or handle the failed result.`));
|
|
183
|
+
}
|
|
184
|
+
return output;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const sealUnionOutput = {
|
|
188
|
+
id: "seal-union-output",
|
|
189
|
+
version: "5.31.0",
|
|
190
|
+
package: "@warlock.js/seal",
|
|
191
|
+
title: "Review `v.union()` output",
|
|
192
|
+
skill: "seal-basics",
|
|
193
|
+
run(context) {
|
|
194
|
+
const output = {
|
|
195
|
+
edits: [],
|
|
196
|
+
manual: []
|
|
197
|
+
};
|
|
198
|
+
for (const call of callsIn(context, "@warlock.js/seal")) {
|
|
199
|
+
if (call.getExpression().getText() !== "v.union") continue;
|
|
200
|
+
output.manual.push(manualAt(context, call, "`v.union()` now returns the matched branch's validated output (trimmed strings, parsed dates, defaults, stripped keys). Check code that persists or compares it."));
|
|
201
|
+
}
|
|
202
|
+
return output;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const aiCompactionOptIn = {
|
|
206
|
+
id: "ai-compaction-opt-in",
|
|
207
|
+
version: "5.31.0",
|
|
208
|
+
package: "@warlock.js/ai",
|
|
209
|
+
title: "Give agent compaction its required settings",
|
|
210
|
+
skill: "upgrade-from-5-29",
|
|
211
|
+
run(context) {
|
|
212
|
+
const { Node } = context.tsMorph;
|
|
213
|
+
const output = {
|
|
214
|
+
edits: [],
|
|
215
|
+
manual: []
|
|
216
|
+
};
|
|
217
|
+
for (const call of callsIn(context, "@warlock.js/ai")) {
|
|
218
|
+
if (calleeName(context, call) !== "agent") continue;
|
|
219
|
+
const options = call.getArguments()[0];
|
|
220
|
+
if (!options || !Node.isObjectLiteralExpression(options)) continue;
|
|
221
|
+
const compaction = objectProperty(context.tsMorph, options, "compaction");
|
|
222
|
+
if (!compaction) continue;
|
|
223
|
+
const keys = Node.isObjectLiteralExpression(compaction) ? objectPropertyNames(context.tsMorph, compaction) : /* @__PURE__ */ new Set();
|
|
224
|
+
if (keys.has("afterTokens") && keys.has("summarize")) continue;
|
|
225
|
+
output.manual.push(manualAt(context, compaction, "`compaction` is opt-in in 5.31 and needs `afterTokens` and a `summarize` callback (optional `keep`, `countTokens`)."));
|
|
226
|
+
}
|
|
227
|
+
return output;
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
const rateLimitDefaults = {
|
|
231
|
+
id: "rate-limit-defaults",
|
|
232
|
+
version: "5.31.0",
|
|
233
|
+
package: "@warlock.js/core",
|
|
234
|
+
title: "Review the rate limit that now applies everywhere",
|
|
235
|
+
skill: "configure-app",
|
|
236
|
+
run(context) {
|
|
237
|
+
const output = {
|
|
238
|
+
edits: [],
|
|
239
|
+
manual: []
|
|
240
|
+
};
|
|
241
|
+
const hint = "Rate limits now apply in production and development to every route, page and static asset: 60 requests/minute per IP by default, shared. Review `http.rateLimit.max`, set `trustProxy` or a `keyGenerator` behind a proxy, or `global: false` to keep only per-route limits.";
|
|
242
|
+
const httpConfig = context.sourceFiles.find((sourceFile) => context.relativePath(sourceFile).match(/^src\/config\/http\.tsx?$/));
|
|
243
|
+
if (!httpConfig) {
|
|
244
|
+
output.manual.push({
|
|
245
|
+
file: "src/config/http.ts",
|
|
246
|
+
line: 1,
|
|
247
|
+
hint
|
|
248
|
+
});
|
|
249
|
+
return output;
|
|
250
|
+
}
|
|
251
|
+
if (!/\brateLimit\s*:/.test(httpConfig.getFullText())) output.manual.push({
|
|
252
|
+
file: context.relativePath(httpConfig),
|
|
253
|
+
line: 1,
|
|
254
|
+
hint
|
|
255
|
+
});
|
|
256
|
+
return output;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
//#endregion
|
|
261
|
+
export { aiAnthropicBody, aiCompactionOptIn, aiFinishReason, aiToolDispatch, rateLimitDefaults, sealContainerCatch, sealRefineOutput, sealUnionOutput, sealValidateResult };
|
|
262
|
+
//# sourceMappingURL=review-sites.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-sites.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/upgrade/codemods/review-sites.ts"],"sourcesContent":["import type * as TsMorph from \"ts-morph\";\nimport type { Codemod, CodemodContext, CodemodOutput } from \"../types\";\nimport {\n importedLocalNames,\n importsFrom,\n manualAt,\n objectProperty,\n objectPropertyNames,\n} from \"./helpers\";\n\n/**\n * Breaking changes that are behavioural decisions, not mechanical edits. These\n * codemods change nothing; they list every call site to review with the\n * reason, so nothing is missed.\n */\n\n/** Call expressions in files that import from `moduleName`. */\nfunction callsIn(context: CodemodContext, moduleName: string): TsMorph.CallExpression[] {\n const { SyntaxKind } = context.tsMorph;\n return context.sourceFiles\n .filter((sourceFile) => importsFrom(sourceFile, moduleName))\n .flatMap((sourceFile) => sourceFile.getDescendantsOfKind(SyntaxKind.CallExpression));\n}\n\nfunction calleeName(context: CodemodContext, call: TsMorph.CallExpression): string | undefined {\n const { Node } = context.tsMorph;\n const callee = call.getExpression();\n if (Node.isIdentifier(callee)) return callee.getText();\n if (Node.isPropertyAccessExpression(callee)) return callee.getName();\n return undefined;\n}\n\n/** `v.object(...)....catch(` → whether the chain starts at a container factory. */\nfunction chainRoot(context: CodemodContext, call: TsMorph.CallExpression): string | undefined {\n const { Node } = context.tsMorph;\n let current: TsMorph.Node = call.getExpression();\n let root: string | undefined;\n for (;;) {\n if (Node.isPropertyAccessExpression(current)) {\n current = current.getExpression();\n continue;\n }\n if (Node.isCallExpression(current)) {\n const callee = current.getExpression();\n if (Node.isPropertyAccessExpression(callee)) root = callee.getText();\n current = callee;\n continue;\n }\n return root;\n }\n}\n\nexport const sealValidateResult: Codemod = {\n id: \"seal-validate-result\",\n version: \"5.30.0\",\n package: \"@warlock.js/seal\",\n title: \"Check `isValid` before reading `validate()` data\",\n skill: \"seal-basics\",\n run(context) {\n const { Node } = context.tsMorph;\n const output: CodemodOutput = { edits: [], manual: [] };\n\n for (const sourceFile of context.sourceFiles) {\n const validators = importedLocalNames(sourceFile, \"@warlock.js/seal\", \"validate\");\n if (validators.size === 0) continue;\n const text = sourceFile.getFullText();\n\n for (const call of sourceFile.getDescendantsOfKind(\n context.tsMorph.SyntaxKind.CallExpression,\n )) {\n const callee = call.getExpression();\n if (!Node.isIdentifier(callee) || !validators.has(callee.getText())) continue;\n const declaration = call.getFirstAncestorByKind(\n context.tsMorph.SyntaxKind.VariableDeclaration,\n );\n const name = declaration?.getNameNode();\n if (!name || !Node.isIdentifier(name)) continue;\n const variable = name.getText();\n if (!text.includes(`${variable}.data`) || text.includes(`${variable}.isValid`)) continue;\n output.manual.push(\n manualAt(\n context,\n call,\n `\\`${variable}.data\\` is \\`undefined\\` when validation fails and typed only after \\`if (${variable}.isValid)\\`. Check it before reading the data.`,\n ),\n );\n }\n }\n\n return output;\n },\n};\n\nexport const aiToolDispatch: Codemod = {\n id: \"ai-tool-dispatch\",\n version: \"5.30.0\",\n package: \"@warlock.js/ai\",\n title: \"Review agents whose tools now run concurrently\",\n skill: \"upgrade-from-5-29\",\n run(context) {\n const { Node } = context.tsMorph;\n const output: CodemodOutput = { edits: [], manual: [] };\n\n for (const call of callsIn(context, \"@warlock.js/ai\")) {\n const name = calleeName(context, call);\n if (name !== \"agent\" && name !== \"spawnSubAgent\") continue;\n const options = call.getArguments()[0];\n if (!options || !Node.isObjectLiteralExpression(options)) continue;\n const keys = objectPropertyNames(context.tsMorph, options);\n if (!keys.has(\"tools\") || keys.has(\"toolDispatch\") || keys.has(\"maxConcurrentTools\"))\n continue;\n output.manual.push(\n manualAt(\n context,\n call,\n `\\`${name}()\\` with tools now runs one trip's tools concurrently (up to 4). If a tool depends on another's side effects, set \\`toolDispatch: \"sequential\"\\`.`,\n ),\n );\n }\n\n return output;\n },\n};\n\nconst RESERVED_ANTHROPIC_BODY_KEYS = [\n \"model\",\n \"messages\",\n \"system\",\n \"tools\",\n \"mcp_servers\",\n \"stream\",\n];\n\nexport const aiAnthropicBody: Codemod = {\n id: \"ai-anthropic-body\",\n version: \"5.30.0\",\n package: \"@warlock.js/ai-anthropic\",\n title: \"Move reserved keys out of `providerOptions.anthropic.body`\",\n skill: \"upgrade-from-5-29\",\n run(context) {\n const { Node, SyntaxKind } = context.tsMorph;\n const output: CodemodOutput = { edits: [], manual: [] };\n\n for (const sourceFile of context.sourceFiles) {\n for (const literal of sourceFile.getDescendantsOfKind(SyntaxKind.ObjectLiteralExpression)) {\n const anthropic = objectProperty(context.tsMorph, literal, \"anthropic\");\n if (!anthropic || !Node.isObjectLiteralExpression(anthropic)) continue;\n const parent = literal.getParent();\n if (\n !parent ||\n !Node.isPropertyAssignment(parent) ||\n parent.getName() !== \"providerOptions\"\n ) {\n continue;\n }\n const body = objectProperty(context.tsMorph, anthropic, \"body\");\n if (!body || !Node.isObjectLiteralExpression(body)) continue;\n const reserved = RESERVED_ANTHROPIC_BODY_KEYS.filter((key) =>\n objectPropertyNames(context.tsMorph, body).has(key),\n );\n if (reserved.length === 0) continue;\n output.manual.push(\n manualAt(\n context,\n body,\n `\\`providerOptions.anthropic.body\\` can no longer set ${reserved.map((key) => `\\`${key}\\``).join(\", \")} (it throws InvalidRequestError). Use the normal model/messages/tools options.`,\n ),\n );\n }\n }\n\n return output;\n },\n};\n\nexport const aiFinishReason: Codemod = {\n id: \"ai-finish-reason\",\n version: \"5.30.0\",\n package: \"@warlock.js/ai\",\n title: \"Handle the new finish reasons\",\n skill: \"upgrade-from-5-29\",\n run(context) {\n const { SyntaxKind } = context.tsMorph;\n const output: CodemodOutput = { edits: [], manual: [] };\n\n for (const sourceFile of context.sourceFiles) {\n if (!importsFrom(sourceFile, \"@warlock.js/ai\")) continue;\n for (const statement of sourceFile.getDescendantsOfKind(SyntaxKind.SwitchStatement)) {\n if (!/finishReason$/.test(statement.getExpression().getText())) continue;\n output.manual.push(\n manualAt(\n context,\n statement,\n 'A `finishReason` switch: 5.30 adds \"context_exceeded\", \"pause_turn\" and \"refusal\" (Anthropic used to report them as \"length\"/\"error\"). Handle each.',\n ),\n );\n }\n }\n\n return output;\n },\n};\n\nexport const sealRefineOutput: Codemod = {\n id: \"seal-refine-output\",\n version: \"5.31.0\",\n package: \"@warlock.js/seal\",\n title: \"Review `.refine()` callbacks\",\n skill: \"seal-basics\",\n run(context) {\n const output: CodemodOutput = { edits: [], manual: [] };\n for (const call of callsIn(context, \"@warlock.js/seal\")) {\n if (calleeName(context, call) !== \"refine\") continue;\n output.manual.push(\n manualAt(\n context,\n call,\n \"`.refine()` now runs on the validated output, after child rules and transforms, and skips absent/null/invalid values. Move checks that need the raw input to `.addRule()`.\",\n ),\n );\n }\n return output;\n },\n};\n\nconst CONTAINERS = /^v\\.(object|array|record|tuple)$/;\n\nexport const sealContainerCatch: Codemod = {\n id: \"seal-container-catch\",\n version: \"5.31.0\",\n package: \"@warlock.js/seal\",\n title: \"Move `.catch()` off container validators\",\n skill: \"seal-basics\",\n run(context) {\n const output: CodemodOutput = { edits: [], manual: [] };\n for (const call of callsIn(context, \"@warlock.js/seal\")) {\n if (calleeName(context, call) !== \"catch\") continue;\n const root = chainRoot(context, call);\n if (!root || !CONTAINERS.test(root)) continue;\n output.manual.push(\n manualAt(\n context,\n call,\n `\\`.catch()\\` on \\`${root}()\\` is now a no-op, including for the container's own rules. Put the catch on the child validators, or handle the failed result.`,\n ),\n );\n }\n return output;\n },\n};\n\nexport const sealUnionOutput: Codemod = {\n id: \"seal-union-output\",\n version: \"5.31.0\",\n package: \"@warlock.js/seal\",\n title: \"Review `v.union()` output\",\n skill: \"seal-basics\",\n run(context) {\n const output: CodemodOutput = { edits: [], manual: [] };\n for (const call of callsIn(context, \"@warlock.js/seal\")) {\n if (call.getExpression().getText() !== \"v.union\") continue;\n output.manual.push(\n manualAt(\n context,\n call,\n \"`v.union()` now returns the matched branch's validated output (trimmed strings, parsed dates, defaults, stripped keys). Check code that persists or compares it.\",\n ),\n );\n }\n return output;\n },\n};\n\nexport const aiCompactionOptIn: Codemod = {\n id: \"ai-compaction-opt-in\",\n version: \"5.31.0\",\n package: \"@warlock.js/ai\",\n title: \"Give agent compaction its required settings\",\n skill: \"upgrade-from-5-29\",\n run(context) {\n const { Node } = context.tsMorph;\n const output: CodemodOutput = { edits: [], manual: [] };\n for (const call of callsIn(context, \"@warlock.js/ai\")) {\n if (calleeName(context, call) !== \"agent\") continue;\n const options = call.getArguments()[0];\n if (!options || !Node.isObjectLiteralExpression(options)) continue;\n const compaction = objectProperty(context.tsMorph, options, \"compaction\");\n if (!compaction) continue;\n const keys = Node.isObjectLiteralExpression(compaction)\n ? objectPropertyNames(context.tsMorph, compaction)\n : new Set<string>();\n if (keys.has(\"afterTokens\") && keys.has(\"summarize\")) continue;\n output.manual.push(\n manualAt(\n context,\n compaction,\n \"`compaction` is opt-in in 5.31 and needs `afterTokens` and a `summarize` callback (optional `keep`, `countTokens`).\",\n ),\n );\n }\n return output;\n },\n};\n\nexport const rateLimitDefaults: Codemod = {\n id: \"rate-limit-defaults\",\n version: \"5.31.0\",\n package: \"@warlock.js/core\",\n title: \"Review the rate limit that now applies everywhere\",\n skill: \"configure-app\",\n run(context) {\n const output: CodemodOutput = { edits: [], manual: [] };\n const hint =\n \"Rate limits now apply in production and development to every route, page and static asset: 60 requests/minute per IP by default, shared. Review `http.rateLimit.max`, set `trustProxy` or a `keyGenerator` behind a proxy, or `global: false` to keep only per-route limits.\";\n\n const httpConfig = context.sourceFiles.find((sourceFile) =>\n context.relativePath(sourceFile).match(/^src\\/config\\/http\\.tsx?$/),\n );\n if (!httpConfig) {\n output.manual.push({ file: \"src/config/http.ts\", line: 1, hint });\n return output;\n }\n if (!/\\brateLimit\\s*:/.test(httpConfig.getFullText())) {\n output.manual.push({ file: context.relativePath(httpConfig), line: 1, hint });\n }\n return output;\n },\n};\n"],"mappings":";;;;;;;;;AAiBA,SAAS,QAAQ,SAAyB,YAA8C;CACtF,MAAM,EAAE,eAAe,QAAQ;CAC/B,OAAO,QAAQ,YACZ,QAAQ,eAAe,YAAY,YAAY,UAAU,CAAC,CAAC,CAC3D,SAAS,eAAe,WAAW,qBAAqB,WAAW,cAAc,CAAC;AACvF;AAEA,SAAS,WAAW,SAAyB,MAAkD;CAC7F,MAAM,EAAE,SAAS,QAAQ;CACzB,MAAM,SAAS,KAAK,cAAc;CAClC,IAAI,KAAK,aAAa,MAAM,GAAG,OAAO,OAAO,QAAQ;CACrD,IAAI,KAAK,2BAA2B,MAAM,GAAG,OAAO,OAAO,QAAQ;AAErE;;AAGA,SAAS,UAAU,SAAyB,MAAkD;CAC5F,MAAM,EAAE,SAAS,QAAQ;CACzB,IAAI,UAAwB,KAAK,cAAc;CAC/C,IAAI;CACJ,SAAS;EACP,IAAI,KAAK,2BAA2B,OAAO,GAAG;GAC5C,UAAU,QAAQ,cAAc;GAChC;EACF;EACA,IAAI,KAAK,iBAAiB,OAAO,GAAG;GAClC,MAAM,SAAS,QAAQ,cAAc;GACrC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,OAAO;CACP,IAAI,SAAS;EACX,MAAM,SAAwB;GAAE,OAAO,CAAC;GAAG,QAAQ,CAAC;EAAE;EACtD,MAAM,OACJ;EAEF,MAAM,aAAa,QAAQ,YAAY,MAAM,eAC3C,QAAQ,aAAa,UAAU,CAAC,CAAC,MAAM,2BAA2B,CACpE;EACA,IAAI,CAAC,YAAY;GACf,OAAO,OAAO,KAAK;IAAE,MAAM;IAAsB,MAAM;IAAG;GAAK,CAAC;GAChE,OAAO;EACT;EACA,IAAI,CAAC,kBAAkB,KAAK,WAAW,YAAY,CAAC,GAClD,OAAO,OAAO,KAAK;GAAE,MAAM,QAAQ,aAAa,UAAU;GAAG,MAAM;GAAG;EAAK,CAAC;EAE9E,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
//#region ../../packages/core/src/upgrade/diff.ts
|
|
2
|
+
/**
|
|
3
|
+
* A minimal unified diff (`diff -u` shape, 3 lines of context) between two
|
|
4
|
+
* versions of one file, enough for `warlock upgrade --dry-run` to show what
|
|
5
|
+
* it would change. Line-based longest common subsequence; files too large for
|
|
6
|
+
* that are shown as one replaced hunk.
|
|
7
|
+
*/
|
|
8
|
+
const CONTEXT = 3;
|
|
9
|
+
const MAX_CELLS = 16e6;
|
|
10
|
+
function unifiedDiff(file, before, after) {
|
|
11
|
+
if (before === after) return "";
|
|
12
|
+
const operations = diffLines(splitLines(before), splitLines(after));
|
|
13
|
+
return `--- a/${file}\n+++ b/${file}\n` + formatHunks(operations);
|
|
14
|
+
}
|
|
15
|
+
function splitLines(text) {
|
|
16
|
+
if (text === "") return [];
|
|
17
|
+
const lines = text.split("\n");
|
|
18
|
+
if (lines[lines.length - 1] === "") lines.pop();
|
|
19
|
+
return lines;
|
|
20
|
+
}
|
|
21
|
+
function diffLines(oldLines, newLines) {
|
|
22
|
+
const n = oldLines.length;
|
|
23
|
+
const m = newLines.length;
|
|
24
|
+
if (n * m > MAX_CELLS) return [...oldLines.map((text) => ({
|
|
25
|
+
type: "removed",
|
|
26
|
+
text
|
|
27
|
+
})), ...newLines.map((text) => ({
|
|
28
|
+
type: "added",
|
|
29
|
+
text
|
|
30
|
+
}))];
|
|
31
|
+
const lengths = [];
|
|
32
|
+
for (let i = 0; i <= n; i++) lengths.push(new Uint32Array(m + 1));
|
|
33
|
+
for (let i = n - 1; i >= 0; i--) {
|
|
34
|
+
const row = lengths[i];
|
|
35
|
+
const below = lengths[i + 1];
|
|
36
|
+
for (let j = m - 1; j >= 0; j--) row[j] = oldLines[i] === newLines[j] ? (below[j + 1] ?? 0) + 1 : Math.max(below[j] ?? 0, row[j + 1] ?? 0);
|
|
37
|
+
}
|
|
38
|
+
const operations = [];
|
|
39
|
+
let i = 0;
|
|
40
|
+
let j = 0;
|
|
41
|
+
while (i < n && j < m) if (oldLines[i] === newLines[j]) {
|
|
42
|
+
operations.push({
|
|
43
|
+
type: "same",
|
|
44
|
+
text: oldLines[i] ?? ""
|
|
45
|
+
});
|
|
46
|
+
i++;
|
|
47
|
+
j++;
|
|
48
|
+
} else if ((lengths[i + 1]?.[j] ?? 0) >= (lengths[i]?.[j + 1] ?? 0)) {
|
|
49
|
+
operations.push({
|
|
50
|
+
type: "removed",
|
|
51
|
+
text: oldLines[i] ?? ""
|
|
52
|
+
});
|
|
53
|
+
i++;
|
|
54
|
+
} else {
|
|
55
|
+
operations.push({
|
|
56
|
+
type: "added",
|
|
57
|
+
text: newLines[j] ?? ""
|
|
58
|
+
});
|
|
59
|
+
j++;
|
|
60
|
+
}
|
|
61
|
+
while (i < n) operations.push({
|
|
62
|
+
type: "removed",
|
|
63
|
+
text: oldLines[i++] ?? ""
|
|
64
|
+
});
|
|
65
|
+
while (j < m) operations.push({
|
|
66
|
+
type: "added",
|
|
67
|
+
text: newLines[j++] ?? ""
|
|
68
|
+
});
|
|
69
|
+
return operations;
|
|
70
|
+
}
|
|
71
|
+
function formatHunks(operations) {
|
|
72
|
+
const changed = operations.map((operation, index) => operation.type === "same" ? -1 : index).filter((index) => index >= 0);
|
|
73
|
+
let output = "";
|
|
74
|
+
let cursor = 0;
|
|
75
|
+
while (cursor < changed.length) {
|
|
76
|
+
const firstChange = changed[cursor] ?? 0;
|
|
77
|
+
let lastChange = firstChange;
|
|
78
|
+
while (cursor + 1 < changed.length && (changed[cursor + 1] ?? 0) - lastChange <= CONTEXT * 2) {
|
|
79
|
+
cursor++;
|
|
80
|
+
lastChange = changed[cursor] ?? lastChange;
|
|
81
|
+
}
|
|
82
|
+
cursor++;
|
|
83
|
+
const start = Math.max(0, firstChange - CONTEXT);
|
|
84
|
+
const end = Math.min(operations.length, lastChange + CONTEXT + 1);
|
|
85
|
+
let oldStart = 1;
|
|
86
|
+
let newStart = 1;
|
|
87
|
+
for (let index = 0; index < start; index++) {
|
|
88
|
+
const type = operations[index]?.type;
|
|
89
|
+
if (type !== "added") oldStart++;
|
|
90
|
+
if (type !== "removed") newStart++;
|
|
91
|
+
}
|
|
92
|
+
let oldCount = 0;
|
|
93
|
+
let newCount = 0;
|
|
94
|
+
let body = "";
|
|
95
|
+
for (let index = start; index < end; index++) {
|
|
96
|
+
const operation = operations[index];
|
|
97
|
+
if (!operation) continue;
|
|
98
|
+
if (operation.type === "same") {
|
|
99
|
+
oldCount++;
|
|
100
|
+
newCount++;
|
|
101
|
+
body += ` ${operation.text}\n`;
|
|
102
|
+
} else if (operation.type === "removed") {
|
|
103
|
+
oldCount++;
|
|
104
|
+
body += `-${operation.text}\n`;
|
|
105
|
+
} else {
|
|
106
|
+
newCount++;
|
|
107
|
+
body += `+${operation.text}\n`;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const oldRange = oldCount === 0 ? `${oldStart - 1},0` : `${oldStart},${oldCount}`;
|
|
111
|
+
const newRange = newCount === 0 ? `${newStart - 1},0` : `${newStart},${newCount}`;
|
|
112
|
+
output += `@@ -${oldRange} +${newRange} @@\n${body}`;
|
|
113
|
+
}
|
|
114
|
+
return output;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
export { unifiedDiff };
|
|
119
|
+
//# sourceMappingURL=diff.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/diff.ts"],"sourcesContent":["/**\n * A minimal unified diff (`diff -u` shape, 3 lines of context) between two\n * versions of one file, enough for `warlock upgrade --dry-run` to show what\n * it would change. Line-based longest common subsequence; files too large for\n * that are shown as one replaced hunk.\n */\nconst CONTEXT = 3;\nconst MAX_CELLS = 16_000_000;\n\ntype Operation = { type: \"same\" | \"removed\" | \"added\"; text: string };\n\nexport function unifiedDiff(file: string, before: string, after: string): string {\n if (before === after) return \"\";\n\n const oldLines = splitLines(before);\n const newLines = splitLines(after);\n const operations = diffLines(oldLines, newLines);\n\n const header = `--- a/${file}\\n+++ b/${file}\\n`;\n return header + formatHunks(operations);\n}\n\nfunction splitLines(text: string): string[] {\n if (text === \"\") return [];\n const lines = text.split(\"\\n\");\n if (lines[lines.length - 1] === \"\") lines.pop();\n return lines;\n}\n\nfunction diffLines(oldLines: string[], newLines: string[]): Operation[] {\n const n = oldLines.length;\n const m = newLines.length;\n\n if (n * m > MAX_CELLS) {\n return [\n ...oldLines.map((text): Operation => ({ type: \"removed\", text })),\n ...newLines.map((text): Operation => ({ type: \"added\", text })),\n ];\n }\n\n // lengths[i][j] = LCS length of oldLines[i..] and newLines[j..]\n const lengths: Uint32Array[] = [];\n for (let i = 0; i <= n; i++) lengths.push(new Uint32Array(m + 1));\n\n for (let i = n - 1; i >= 0; i--) {\n const row = lengths[i] as Uint32Array;\n const below = lengths[i + 1] as Uint32Array;\n for (let j = m - 1; j >= 0; j--) {\n row[j] =\n oldLines[i] === newLines[j]\n ? (below[j + 1] ?? 0) + 1\n : Math.max(below[j] ?? 0, row[j + 1] ?? 0);\n }\n }\n\n const operations: Operation[] = [];\n let i = 0;\n let j = 0;\n while (i < n && j < m) {\n if (oldLines[i] === newLines[j]) {\n operations.push({ type: \"same\", text: oldLines[i] ?? \"\" });\n i++;\n j++;\n } else if ((lengths[i + 1]?.[j] ?? 0) >= (lengths[i]?.[j + 1] ?? 0)) {\n operations.push({ type: \"removed\", text: oldLines[i] ?? \"\" });\n i++;\n } else {\n operations.push({ type: \"added\", text: newLines[j] ?? \"\" });\n j++;\n }\n }\n while (i < n) operations.push({ type: \"removed\", text: oldLines[i++] ?? \"\" });\n while (j < m) operations.push({ type: \"added\", text: newLines[j++] ?? \"\" });\n\n return operations;\n}\n\nfunction formatHunks(operations: Operation[]): string {\n const changed = operations\n .map((operation, index) => (operation.type === \"same\" ? -1 : index))\n .filter((index) => index >= 0);\n\n let output = \"\";\n let cursor = 0;\n\n while (cursor < changed.length) {\n const firstChange = changed[cursor] ?? 0;\n let lastChange = firstChange;\n // Merge changes whose context windows touch.\n while (cursor + 1 < changed.length && (changed[cursor + 1] ?? 0) - lastChange <= CONTEXT * 2) {\n cursor++;\n lastChange = changed[cursor] ?? lastChange;\n }\n cursor++;\n\n const start = Math.max(0, firstChange - CONTEXT);\n const end = Math.min(operations.length, lastChange + CONTEXT + 1);\n\n let oldStart = 1;\n let newStart = 1;\n for (let index = 0; index < start; index++) {\n const type = operations[index]?.type;\n if (type !== \"added\") oldStart++;\n if (type !== \"removed\") newStart++;\n }\n\n let oldCount = 0;\n let newCount = 0;\n let body = \"\";\n for (let index = start; index < end; index++) {\n const operation = operations[index];\n if (!operation) continue;\n if (operation.type === \"same\") {\n oldCount++;\n newCount++;\n body += ` ${operation.text}\\n`;\n } else if (operation.type === \"removed\") {\n oldCount++;\n body += `-${operation.text}\\n`;\n } else {\n newCount++;\n body += `+${operation.text}\\n`;\n }\n }\n\n const oldRange = oldCount === 0 ? `${oldStart - 1},0` : `${oldStart},${oldCount}`;\n const newRange = newCount === 0 ? `${newStart - 1},0` : `${newStart},${newCount}`;\n output += `@@ -${oldRange} +${newRange} @@\\n${body}`;\n }\n\n return output;\n}\n"],"mappings":";;;;;;;AAM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KAAK,SAAS;GAC5C,MAAM,YAAY,WAAW;GAC7B,IAAI,CAAC,WAAW;GAChB,IAAI,UAAU,SAAS,QAAQ;IAC7B;IACA;IACA,QAAQ,IAAI,UAAU,KAAK;GAC7B,OAAO,IAAI,UAAU,SAAS,WAAW;IACvC;IACA,QAAQ,IAAI,UAAU,KAAK;GAC7B,OAAO;IACL;IACA,QAAQ,IAAI,UAAU,KAAK;GAC7B;EACF;EAEA,MAAM,WAAW,aAAa,IAAI,GAAG,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG;EACvE,MAAM,WAAW,aAAa,IAAI,GAAG,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG;EACvE,UAAU,OAAO,SAAS,IAAI,SAAS,OAAO;CAChD;CAEA,OAAO;AACT"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { colors } from "@mongez/copper";
|
|
2
|
+
|
|
3
|
+
//#region ../../packages/core/src/upgrade/format-upgrade-report.ts
|
|
4
|
+
/** The human-readable `warlock upgrade` report. */
|
|
5
|
+
function formatUpgradeReport(result) {
|
|
6
|
+
const lines = [];
|
|
7
|
+
const verb = result.dryRun ? "would change" : "changed";
|
|
8
|
+
lines.push(colors.bold(`warlock upgrade ${result.from} → ${result.to}`) + (result.dryRun ? colors.dim(" (dry run: nothing written)") : ""), "");
|
|
9
|
+
for (const codemod of result.codemods) {
|
|
10
|
+
const applied = result.applied.filter((item) => item.codemod === codemod.id);
|
|
11
|
+
const manual = result.manual.filter((item) => item.codemod === codemod.id);
|
|
12
|
+
const mark = applied.length > 0 ? colors.green("✓") : manual.length > 0 ? colors.yellow("!") : colors.dim("·");
|
|
13
|
+
const counts = [applied.length > 0 ? `${applied.length} ${verb}` : "", manual.length > 0 ? `${manual.length} to review` : ""].filter(Boolean).join(", ");
|
|
14
|
+
lines.push(`${mark} ${codemod.id} ${colors.dim(`(${codemod.version})`)} ${codemod.title}${counts ? colors.dim(` — ${counts}`) : colors.dim(" — nothing to do")}`);
|
|
15
|
+
for (const item of applied) lines.push(` ${colors.cyan(`${item.file}:${item.line}`)} ${item.description}`);
|
|
16
|
+
for (const item of manual) lines.push(` ${colors.yellow(`${item.file}:${item.line}`)} ${item.hint}`);
|
|
17
|
+
}
|
|
18
|
+
if (result.notes.length > 0) {
|
|
19
|
+
lines.push("", colors.bold("Plan for (no code change):"));
|
|
20
|
+
for (const note of result.notes) lines.push(` - ${note.text} ${colors.dim(`(${note.version})`)}`);
|
|
21
|
+
}
|
|
22
|
+
if (result.dryRun && result.diff) lines.push("", colors.bold("Diff:"), result.diff.trimEnd());
|
|
23
|
+
lines.push("");
|
|
24
|
+
lines.push(`${result.changedFiles.length} file(s) ${verb}, ${result.manual.length} place(s) to review by hand.`);
|
|
25
|
+
if (result.installHint) lines.push(`Package versions ${result.dryRun ? "would be" : "were"} updated in package.json: run ${colors.cyan(result.installHint)}.`);
|
|
26
|
+
lines.push(`Then run your type check and tests. The ${colors.cyan("upgrade-from-5-29")} skill explains each change.`);
|
|
27
|
+
return lines.join("\n");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { formatUpgradeReport };
|
|
32
|
+
//# sourceMappingURL=format-upgrade-report.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-upgrade-report.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/format-upgrade-report.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport type { UpgradeResult } from \"./types\";\n\n/** The human-readable `warlock upgrade` report. */\nexport function formatUpgradeReport(result: UpgradeResult): string {\n const lines: string[] = [];\n const verb = result.dryRun ? \"would change\" : \"changed\";\n\n lines.push(\n colors.bold(`warlock upgrade ${result.from} → ${result.to}`) +\n (result.dryRun ? colors.dim(\" (dry run: nothing written)\") : \"\"),\n \"\",\n );\n\n for (const codemod of result.codemods) {\n const applied = result.applied.filter((item) => item.codemod === codemod.id);\n const manual = result.manual.filter((item) => item.codemod === codemod.id);\n const mark =\n applied.length > 0\n ? colors.green(\"✓\")\n : manual.length > 0\n ? colors.yellow(\"!\")\n : colors.dim(\"·\");\n const counts = [\n applied.length > 0 ? `${applied.length} ${verb}` : \"\",\n manual.length > 0 ? `${manual.length} to review` : \"\",\n ]\n .filter(Boolean)\n .join(\", \");\n\n lines.push(\n `${mark} ${codemod.id} ${colors.dim(`(${codemod.version})`)} ${codemod.title}${counts ? colors.dim(` — ${counts}`) : colors.dim(\" — nothing to do\")}`,\n );\n for (const item of applied) {\n lines.push(` ${colors.cyan(`${item.file}:${item.line}`)} ${item.description}`);\n }\n for (const item of manual) {\n lines.push(` ${colors.yellow(`${item.file}:${item.line}`)} ${item.hint}`);\n }\n }\n\n if (result.notes.length > 0) {\n lines.push(\"\", colors.bold(\"Plan for (no code change):\"));\n for (const note of result.notes)\n lines.push(` - ${note.text} ${colors.dim(`(${note.version})`)}`);\n }\n\n if (result.dryRun && result.diff) {\n lines.push(\"\", colors.bold(\"Diff:\"), result.diff.trimEnd());\n }\n\n lines.push(\"\");\n lines.push(\n `${result.changedFiles.length} file(s) ${verb}, ${result.manual.length} place(s) to review by hand.`,\n );\n if (result.installHint) {\n lines.push(\n `Package versions ${result.dryRun ? \"would be\" : \"were\"} updated in package.json: run ${colors.cyan(result.installHint)}.`,\n );\n }\n lines.push(\n `Then run your type check and tests. The ${colors.cyan(\"upgrade-from-5-29\")} skill explains each change.`,\n );\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;AAIA,SAAgB,oBAAoB,QAA+B;CACjE,MAAM,QAAkB,CAAC;CACzB,MAAM,OAAO,OAAO,SAAS,iBAAiB;CAE9C,MAAM,KACJ,OAAO,KAAK,mBAAmB,OAAO,KAAK,KAAK,OAAO,IAAI,KACxD,OAAO,SAAS,OAAO,IAAI,6BAA6B,IAAI,KAC/D,EACF;CAEA,KAAK,MAAM,WAAW,OAAO,UAAU;EACrC,MAAM,UAAU,OAAO,QAAQ,QAAQ,SAAS,KAAK,YAAY,QAAQ,EAA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AAI,OAAO,aACT,MAAM,KACJ,oBAAoB,OAAO,SAAS,aAAa,OAAO,gCAAgC,OAAO,KAAK,OAAO,WAAW,EAAE,EAC1H;CAEF,MAAM,KACJ,2CAA2C,OAAO,KAAK,mBAAmB,EAAE,6BAC9E;CAEA,OAAO,MAAM,KAAK,IAAI;AACxB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { detectPackageManager } from "../updater/package-manager.mjs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
|
|
6
|
+
//#region ../../packages/core/src/upgrade/load-ts-morph.ts
|
|
7
|
+
/** Thrown when `ts-morph` is not installed; the message says how to add it. */
|
|
8
|
+
var TsMorphMissingError = class extends Error {
|
|
9
|
+
constructor(installCommand) {
|
|
10
|
+
super(`warlock upgrade edits source files with ts-morph, which is not installed. Add it as a development dependency, then run the command again:\n\n ${installCommand}\n`);
|
|
11
|
+
this.installCommand = installCommand;
|
|
12
|
+
this.name = "TsMorphMissingError";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/** The dev-dependency install command for `ts-morph` with this package manager. */
|
|
16
|
+
function tsMorphInstallCommand(packageManager) {
|
|
17
|
+
switch (packageManager) {
|
|
18
|
+
case "pnpm": return "pnpm add --save-dev ts-morph";
|
|
19
|
+
case "yarn": return "yarn add --dev ts-morph";
|
|
20
|
+
case "bun": return "bun add --dev ts-morph";
|
|
21
|
+
default: return "npm install --save-dev ts-morph";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Load `ts-morph` lazily: it is an optional peer of `@warlock.js/core`, needed
|
|
26
|
+
* only by `warlock upgrade`. Resolved from the app first (where the user
|
|
27
|
+
* installs it), then from core's own location.
|
|
28
|
+
*/
|
|
29
|
+
async function loadTsMorph(root) {
|
|
30
|
+
try {
|
|
31
|
+
return fromNamespace(await import(pathToFileURL(createRequire(path.join(root, "package.json")).resolve("ts-morph")).href));
|
|
32
|
+
} catch {}
|
|
33
|
+
try {
|
|
34
|
+
return fromNamespace(await import("ts-morph"));
|
|
35
|
+
} catch {
|
|
36
|
+
throw new TsMorphMissingError(tsMorphInstallCommand(await detectPackageManager(root)));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** A CommonJS package imported from ESM may expose its API on `default` only. */
|
|
40
|
+
function fromNamespace(namespace) {
|
|
41
|
+
const candidate = namespace;
|
|
42
|
+
if (typeof candidate.Project === "function") return namespace;
|
|
43
|
+
return candidate.default;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { TsMorphMissingError, loadTsMorph };
|
|
48
|
+
//# sourceMappingURL=load-ts-morph.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-ts-morph.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/load-ts-morph.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { detectPackageManager, type PackageManager } from \"../updater/package-manager\";\nimport type { TsMorphModule } from \"./types\";\n\n/** Thrown when `ts-morph` is not installed; the message says how to add it. */\nexport class TsMorphMissingError extends Error {\n public override readonly name = \"TsMorphMissingError\";\n\n public constructor(public readonly installCommand: string) {\n super(\n `warlock upgrade edits source files with ts-morph, which is not installed. ` +\n `Add it as a development dependency, then run the command again:\\n\\n ${installCommand}\\n`,\n );\n }\n}\n\n/** The dev-dependency install command for `ts-morph` with this package manager. */\nexport function tsMorphInstallCommand(packageManager: PackageManager): string {\n switch (packageManager) {\n case \"pnpm\":\n return \"pnpm add --save-dev ts-morph\";\n case \"yarn\":\n return \"yarn add --dev ts-morph\";\n case \"bun\":\n return \"bun add --dev ts-morph\";\n default:\n return \"npm install --save-dev ts-morph\";\n }\n}\n\n/**\n * Load `ts-morph` lazily: it is an optional peer of `@warlock.js/core`, needed\n * only by `warlock upgrade`. Resolved from the app first (where the user\n * installs it), then from core's own location.\n */\nexport async function loadTsMorph(root: string): Promise<TsMorphModule> {\n try {\n const resolved = createRequire(path.join(root, \"package.json\")).resolve(\"ts-morph\");\n return fromNamespace(await import(pathToFileURL(resolved).href));\n } catch {\n // Not in the app; try core's own resolution below.\n }\n\n try {\n return fromNamespace(await import(\"ts-morph\"));\n } catch {\n throw new TsMorphMissingError(tsMorphInstallCommand(await detectPackageManager(root)));\n }\n}\n\n/** A CommonJS package imported from ESM may expose its API on `default` only. */\nfunction fromNamespace(namespace: unknown): TsMorphModule {\n const candidate = namespace as { Project?: unknown; default?: unknown };\n if (typeof candidate.Project === \"function\") return namespace as TsMorphModule;\n return candidate.default as TsMorphModule;\n}\n"],"mappings":";;;;;;;AAOA,IAAa,sBAAb,cAAyC,MAAM;CAG7C,AAAO,YAAY,AAAgB,gBAAwB;EACzD,MACE,kJAC0E,eAAe,GAC3F;EAJiC;cAFH;CAOhC;AACF;;AAGA,SAAgB,sBAAsB,gBAAwC;CAC5E,QAAQ,gBAAR;EACE,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,OACH,OAAO;EACT,SACE,OAAO;CACX;AACF;;;;;;AAOA,eAAsB,YAAY,MAAsC;CACtE,IAAI;EAEF,OAAO,cAAc,MAAM,OAAO,cADjB,cAAc,KAAK,KAAK,MAAM,cAAc,CAAC,CAAC,CAAC,QAAQ,UACjB,CAAC,CAAC,CAAC,KAAK;CACjE,QAAQ,CAER;CAEA,IAAI;EACF,OAAO,cAAc,MAAM,OAAO,WAAW;CAC/C,QAAQ;EACN,MAAM,IAAI,oBAAoB,sBAAsB,MAAM,qBAAqB,IAAI,CAAC,CAAC;CACvF;AACF;;AAGA,SAAS,cAAc,WAAmC;CACxD,MAAM,YAAY;CAClB,IAAI,OAAO,UAAU,YAAY,YAAY,OAAO;CACpD,OAAO,UAAU;AACnB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region ../../packages/core/src/upgrade/notes.ts
|
|
2
|
+
/**
|
|
3
|
+
* Breaking changes with nothing to edit in source: they change data or
|
|
4
|
+
* operations. Printed so the rollout plans for them.
|
|
5
|
+
*/
|
|
6
|
+
const UPGRADE_NOTES = [{
|
|
7
|
+
version: "5.30.0",
|
|
8
|
+
text: "Auth login throttle keys are hashed: counters and lockouts written by 5.29 are forgotten on upgrade (locked accounts and IPs unlock)."
|
|
9
|
+
}, {
|
|
10
|
+
version: "5.30.0",
|
|
11
|
+
text: "Image derivatives use a new cache layout: the first request re-renders each one. Delete the old two-level cache folders once the rollout is done."
|
|
12
|
+
}];
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { UPGRADE_NOTES };
|
|
16
|
+
//# sourceMappingURL=notes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notes.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/notes.ts"],"sourcesContent":["import type { UpgradeNote } from \"./types\";\n\n/**\n * Breaking changes with nothing to edit in source: they change data or\n * operations. Printed so the rollout plans for them.\n */\nexport const UPGRADE_NOTES: readonly UpgradeNote[] = [\n {\n version: \"5.30.0\",\n text: \"Auth login throttle keys are hashed: counters and lockouts written by 5.29 are forgotten on upgrade (locked accounts and IPs unlock).\",\n },\n {\n version: \"5.30.0\",\n text: \"Image derivatives use a new cache layout: the first request re-renders each one. Delete the old two-level cache folders once the rollout is done.\",\n },\n];\n"],"mappings":";;;;;AAMA,MAAa,gBAAwC,CACnD;CACE,SAAS;CACT,MAAM;AACR,GACA;CACE,SAAS;CACT,MAAM;AACR,CACF"}
|