@warlock.js/core 5.31.0 → 5.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/esm/application/app.d.mts +3 -3
- package/esm/application/app.d.mts.map +1 -1
- package/esm/application/application-config-types.d.mts +9 -2
- package/esm/application/application-config-types.d.mts.map +1 -1
- package/esm/application/application.d.mts +5 -7
- package/esm/application/application.d.mts.map +1 -1
- package/esm/application/application.mjs +3 -1
- package/esm/application/application.mjs.map +1 -1
- package/esm/application/boot-signal.d.mts +22 -20
- package/esm/application/boot-signal.d.mts.map +1 -1
- package/esm/application/boot-signal.mjs +15 -9
- package/esm/application/boot-signal.mjs.map +1 -1
- package/esm/application/index.d.mts +2 -1
- package/esm/application/index.mjs +1 -1
- package/esm/application/public-url.d.mts +1 -2
- package/esm/application/public-url.d.mts.map +1 -1
- package/esm/application/roles.d.mts +10 -11
- package/esm/application/roles.d.mts.map +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts +1 -3
- package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
- package/esm/benchmark/benchmark.d.mts +1 -3
- package/esm/benchmark/benchmark.d.mts.map +1 -1
- package/esm/benchmark/channels/console.channel.d.mts +1 -3
- package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts +1 -3
- package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
- package/esm/benchmark/index.mjs +1 -1
- package/esm/benchmark/profiler.d.mts +1 -3
- package/esm/benchmark/profiler.d.mts.map +1 -1
- package/esm/benchmark/profiler.mjs +2 -1
- package/esm/benchmark/profiler.mjs.map +1 -1
- package/esm/benchmark/types.d.mts +22 -17
- package/esm/benchmark/types.d.mts.map +1 -1
- package/esm/bootstrap/setup.d.mts +1 -2
- package/esm/bootstrap/setup.d.mts.map +1 -1
- package/esm/bootstrap.d.mts +1 -2
- package/esm/bootstrap.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.d.mts +3 -5
- package/esm/cache/database-cache-driver.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.mjs +1 -1
- package/esm/cache/index.d.mts +2 -1
- package/esm/cache/index.mjs +1 -1
- package/esm/cli/cli-commands.manager.mjs +6 -3
- package/esm/cli/cli-commands.manager.mjs.map +1 -1
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs +3 -2
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -1
- package/esm/cli/commands/ai/ai-command.action.mjs +140 -0
- package/esm/cli/commands/ai/ai-command.action.mjs.map +1 -0
- package/esm/cli/commands/ai.command.mjs +50 -0
- package/esm/cli/commands/ai.command.mjs.map +1 -0
- package/esm/cli/commands/board/board-command.action.mjs +1 -1
- package/esm/cli/commands/check/check-command.action.mjs +4 -1
- package/esm/cli/commands/check/check-command.action.mjs.map +1 -1
- package/esm/cli/commands/check/child-typecheck.mjs +1 -1
- package/esm/cli/commands/check/child-typecheck.mjs.map +1 -1
- package/esm/cli/commands/check/format-problems.mjs +1 -1
- package/esm/cli/commands/check.command.mjs +6 -1
- package/esm/cli/commands/check.command.mjs.map +1 -1
- package/esm/cli/commands/dev-server.command.mjs +3 -2
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/check.types.d.mts +29 -16
- package/esm/cli/commands/doctor/check.types.d.mts.map +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +22 -27
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs +2 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
- package/esm/cli/commands/explain/explain-command.action.mjs +1 -1
- package/esm/cli/commands/generate/generators/controller.generator.mjs +5 -2
- package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs +5 -3
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs +3 -2
- package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +2 -2
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs +1 -2
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
- package/esm/cli/commands/inspect/inspect-command.action.mjs +3 -2
- package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -1
- package/esm/cli/commands/issue/collect-environment.mjs +187 -0
- package/esm/cli/commands/issue/collect-environment.mjs.map +1 -0
- package/esm/cli/commands/issue/issue-command.action.mjs +70 -0
- package/esm/cli/commands/issue/issue-command.action.mjs.map +1 -0
- package/esm/cli/commands/issue.command.mjs +31 -0
- package/esm/cli/commands/issue.command.mjs.map +1 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs +15 -14
- package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -1
- package/esm/cli/commands/openapi-generator.action.mjs +1 -1
- package/esm/cli/commands/pm2/pm2-command.action.mjs +91 -0
- package/esm/cli/commands/pm2/pm2-command.action.mjs.map +1 -0
- package/esm/cli/commands/pm2/pm2-config.mjs +115 -0
- package/esm/cli/commands/pm2/pm2-config.mjs.map +1 -0
- package/esm/cli/commands/pm2.command.mjs +53 -0
- package/esm/cli/commands/pm2.command.mjs.map +1 -0
- package/esm/cli/commands/postman-generator.action.mjs +1 -1
- package/esm/cli/commands/routes/format-routes-table.mjs +1 -1
- package/esm/cli/commands/routes/route-row.mjs +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs +2 -2
- package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
- package/esm/cli/commands/test.command.mjs +1 -1
- package/esm/cli/commands/trace/trace-command.action.mjs +1 -1
- package/esm/cli/commands-loader.mjs +1 -1
- package/esm/cli/framework-cli-commands.mjs +6 -0
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +2 -2
- package/esm/cli/parse-cli-args.mjs.map +1 -1
- package/esm/cli/start.d.mts +1 -1
- package/esm/cli/string-similarity.mjs +1 -1
- package/esm/commands/cli-command.d.mts +2 -4
- package/esm/commands/cli-command.d.mts.map +1 -1
- package/esm/commands/index.d.mts +2 -1
- package/esm/commands/index.mjs +1 -1
- package/esm/commands/types.d.mts +8 -8
- package/esm/commands/types.d.mts.map +1 -1
- package/esm/config/config-getter.d.mts +2 -3
- package/esm/config/config-getter.d.mts.map +1 -1
- package/esm/config/config-getter.mjs +5 -5
- package/esm/config/config-getter.mjs.map +1 -1
- package/esm/config/config-handlers.d.mts +1 -3
- package/esm/config/config-handlers.d.mts.map +1 -1
- package/esm/config/config-loader.d.mts +1 -2
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +3 -3
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-manager.mjs +1 -1
- package/esm/config/config-schema.d.mts +19 -16
- package/esm/config/config-schema.d.mts.map +1 -1
- package/esm/config/config-setter.d.mts +2 -4
- package/esm/config/config-setter.d.mts.map +1 -1
- package/esm/config/config-setter.mjs +2 -2
- package/esm/config/config-setter.mjs.map +1 -1
- package/esm/config/config-special-handlers.d.mts +2 -4
- package/esm/config/config-special-handlers.d.mts.map +1 -1
- package/esm/config/index.d.mts +2 -1
- package/esm/config/index.mjs +1 -1
- package/esm/config/types.d.mts +4 -5
- package/esm/config/types.d.mts.map +1 -1
- package/esm/connectors/access-connector.d.mts +1 -3
- package/esm/connectors/access-connector.d.mts.map +1 -1
- package/esm/connectors/access-connector.mjs +2 -2
- package/esm/connectors/access-connector.mjs.map +1 -1
- package/esm/connectors/ai-connector.d.mts +1 -3
- package/esm/connectors/ai-connector.d.mts.map +1 -1
- package/esm/connectors/ai-connector.mjs +2 -2
- package/esm/connectors/ai-connector.mjs.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -3
- package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.d.mts +1 -3
- package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs +2 -1
- package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
- package/esm/connectors/base-connector.d.mts +1 -3
- package/esm/connectors/base-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.d.mts +1 -3
- package/esm/connectors/cache-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.mjs +3 -3
- package/esm/connectors/cache-connector.mjs.map +1 -1
- package/esm/connectors/connectors-manager.d.mts +2 -4
- package/esm/connectors/connectors-manager.d.mts.map +1 -1
- package/esm/connectors/connectors-manager.mjs +3 -6
- package/esm/connectors/connectors-manager.mjs.map +1 -1
- package/esm/connectors/database-connector.d.mts +1 -3
- package/esm/connectors/database-connector.d.mts.map +1 -1
- package/esm/connectors/database-connector.mjs +2 -2
- package/esm/connectors/database-connector.mjs.map +1 -1
- package/esm/connectors/describe-server-address.mjs +4 -4
- package/esm/connectors/describe-server-address.mjs.map +1 -1
- package/esm/connectors/herald-connector.d.mts +1 -3
- package/esm/connectors/herald-connector.d.mts.map +1 -1
- package/esm/connectors/herald-connector.mjs +2 -2
- package/esm/connectors/herald-connector.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts +1 -3
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +8 -7
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/index.d.mts +2 -1
- package/esm/connectors/index.mjs +1 -1
- package/esm/connectors/logger-connector.d.mts +1 -3
- package/esm/connectors/logger-connector.d.mts.map +1 -1
- package/esm/connectors/logger-connector.mjs +2 -2
- package/esm/connectors/logger-connector.mjs.map +1 -1
- package/esm/connectors/mail-connector.d.mts +1 -3
- package/esm/connectors/mail-connector.d.mts.map +1 -1
- package/esm/connectors/mail-connector.mjs +2 -2
- package/esm/connectors/mail-connector.mjs.map +1 -1
- package/esm/connectors/notifications-connector.d.mts +1 -3
- package/esm/connectors/notifications-connector.d.mts.map +1 -1
- package/esm/connectors/notifications-connector.mjs +2 -2
- package/esm/connectors/notifications-connector.mjs.map +1 -1
- package/esm/connectors/register-configured-connectors.d.mts +2 -4
- package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
- package/esm/connectors/shutdown-timeout.mjs +7 -0
- package/esm/connectors/shutdown-timeout.mjs.map +1 -0
- package/esm/connectors/socket-connector.d.mts +1 -3
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs +20 -11
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/connectors/storage.connector.d.mts +1 -3
- package/esm/connectors/storage.connector.d.mts.map +1 -1
- package/esm/connectors/storage.connector.mjs +2 -2
- package/esm/connectors/storage.connector.mjs.map +1 -1
- package/esm/connectors/types.d.mts +17 -14
- package/esm/connectors/types.d.mts.map +1 -1
- package/esm/container/container-instance-registry.mjs.map +1 -1
- package/esm/container/development-app-modules.d.mts +7 -5
- package/esm/container/development-app-modules.d.mts.map +1 -1
- package/esm/container/development-model-modules.d.mts +6 -5
- package/esm/container/development-model-modules.d.mts.map +1 -1
- package/esm/container/index.d.mts +4 -4
- package/esm/container/index.d.mts.map +1 -1
- package/esm/database/index.d.mts +3 -1
- package/esm/database/index.mjs +1 -1
- package/esm/database/migrate-action.mjs +1 -1
- package/esm/database/models/database-log/database-log.d.mts +2 -3
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/models/database-log/index.d.mts +2 -1
- package/esm/database/models/database-log/index.mjs +1 -1
- package/esm/database/seed-command-action.mjs +1 -1
- package/esm/database/seeds/seeder.d.mts +2 -4
- package/esm/database/seeds/seeder.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.d.mts +2 -3
- package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
- package/esm/database/seeds/seeders.manager.mjs +2 -1
- package/esm/database/seeds/seeders.manager.mjs.map +1 -1
- package/esm/database/seeds/types.d.mts +7 -8
- package/esm/database/seeds/types.d.mts.map +1 -1
- package/esm/database/utils.d.mts +4 -5
- package/esm/database/utils.d.mts.map +1 -1
- package/esm/dev-server/app-module-registry.mjs +1 -1
- package/esm/dev-server/create-worker.mjs +5 -3
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dependency-graph.d.mts +1 -3
- package/esm/dev-server/dependency-graph.d.mts.map +1 -1
- package/esm/dev-server/dependency-graph.mjs +1 -1
- package/esm/dev-server/dependency-graph.mjs.map +1 -1
- package/esm/dev-server/extract-translation-keys.mjs +16 -17
- package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
- package/esm/dev-server/file-manager.d.mts +3 -7
- package/esm/dev-server/file-manager.d.mts.map +1 -1
- package/esm/dev-server/file-operations.d.mts +1 -3
- package/esm/dev-server/file-operations.d.mts.map +1 -1
- package/esm/dev-server/files-watcher.mjs +12 -11
- package/esm/dev-server/files-watcher.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +6 -8
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +36 -115
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/default-health-checkers.mjs +6 -15
- package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -1
- package/esm/dev-server/health-checker/eslint-support.mjs +27 -0
- package/esm/dev-server/health-checker/eslint-support.mjs.map +1 -0
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +7 -6
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
- package/esm/dev-server/health-checker/file-health-result.d.mts +2 -2
- package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs +1 -0
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/oxlint-runner.mjs +6 -5
- package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs +2 -11
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +40 -174
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
- package/esm/dev-server/loader/hook-thread.d.mts +4 -8
- package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.d.mts +10 -6
- package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.mjs +4 -3
- package/esm/dev-server/loader/load-hook.mjs.map +1 -1
- package/esm/dev-server/loader/own-resolver.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs +3 -2
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-hook.d.mts +2 -2
- package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/resolve-hook.mjs +2 -1
- package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +2 -1
- package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
- package/esm/dev-server/manifest-manager.d.mts +1 -3
- package/esm/dev-server/manifest-manager.d.mts.map +1 -1
- package/esm/dev-server/model-module-registry.mjs +3 -3
- package/esm/dev-server/model-module-registry.mjs.map +1 -1
- package/esm/dev-server/model-resource-typings.mjs +40 -47
- package/esm/dev-server/model-resource-typings.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +2 -2
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/package-json-manager.mjs +1 -1
- package/esm/dev-server/parse-imports.mjs +6 -38
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/read-config-ast.mjs +3 -33
- package/esm/dev-server/read-config-ast.mjs.map +1 -1
- package/esm/dev-server/ready-block.mjs +1 -1
- package/esm/dev-server/shortcuts.mjs +1 -1
- package/esm/dev-server/special-files-collector.d.mts +2 -4
- package/esm/dev-server/special-files-collector.d.mts.map +1 -1
- package/esm/dev-server/supervisor.mjs +1 -1
- package/esm/dev-server/tsconfig-manager.mjs +3 -3
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/type-generator.mjs +28 -35
- package/esm/dev-server/type-generator.mjs.map +1 -1
- package/esm/dev-server/types.d.mts +3 -4
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/dev-server/update-check-cache.mjs +2 -2
- package/esm/dev-server/update-check-cache.mjs.map +1 -1
- package/esm/encryption/encrypt.d.mts +2 -3
- package/esm/encryption/encrypt.d.mts.map +1 -1
- package/esm/encryption/hash.d.mts +1 -2
- package/esm/encryption/hash.d.mts.map +1 -1
- package/esm/encryption/index.mjs +1 -1
- package/esm/encryption/password.d.mts +2 -3
- package/esm/encryption/password.d.mts.map +1 -1
- package/esm/encryption/types.d.mts +2 -3
- package/esm/encryption/types.d.mts.map +1 -1
- package/esm/errors/error-codes.d.mts +29 -22
- package/esm/errors/error-codes.d.mts.map +1 -1
- package/esm/errors/warlock-error.d.mts +1 -3
- package/esm/errors/warlock-error.d.mts.map +1 -1
- package/esm/generations/add-command.action.mjs +3 -2
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/features/bull-board.feature.mjs +2 -1
- package/esm/generations/features/bull-board.feature.mjs.map +1 -1
- package/esm/generations/features/index.mjs +2 -0
- package/esm/generations/features/index.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +2 -1
- package/esm/generations/features/notifications.feature.mjs.map +1 -1
- package/esm/generations/features/process.feature.mjs +65 -0
- package/esm/generations/features/process.feature.mjs.map +1 -0
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs +16 -23
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
- package/esm/generations/features/sitemap.feature.mjs +2 -1
- package/esm/generations/features/sitemap.feature.mjs.map +1 -1
- package/esm/generations/generation-fs.mjs +1 -1
- package/esm/generations/generation-run.mjs +1 -1
- package/esm/generations/stubs.mjs +1 -1
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/boot-port-preflight.d.mts +4 -5
- package/esm/http/boot-port-preflight.d.mts.map +1 -1
- package/esm/http/boot-port-preflight.mjs +2 -2
- package/esm/http/boot-port-preflight.mjs.map +1 -1
- package/esm/http/bounded-stream-queue.d.mts +4 -4
- package/esm/http/bounded-stream-queue.d.mts.map +1 -1
- package/esm/http/bounded-stream-queue.mjs +1 -1
- package/esm/http/bounded-stream-queue.mjs.map +1 -1
- package/esm/http/build-cors-options.mjs +2 -2
- package/esm/http/build-cors-options.mjs.map +1 -1
- package/esm/http/build-rate-limit-options.d.mts +2 -3
- package/esm/http/build-rate-limit-options.d.mts.map +1 -1
- package/esm/http/build-rate-limit-options.mjs +1 -1
- package/esm/http/build-rate-limit-options.mjs.map +1 -1
- package/esm/http/conditional-request.d.mts +14 -13
- package/esm/http/conditional-request.d.mts.map +1 -1
- package/esm/http/config.d.mts +2 -4
- package/esm/http/config.d.mts.map +1 -1
- package/esm/http/config.mjs +2 -2
- package/esm/http/config.mjs.map +1 -1
- package/esm/http/context/request-context.d.mts +6 -7
- package/esm/http/context/request-context.d.mts.map +1 -1
- package/esm/http/context/request-memo.d.mts +1 -2
- package/esm/http/context/request-memo.d.mts.map +1 -1
- package/esm/http/createHttpApplication.d.mts +2 -3
- package/esm/http/createHttpApplication.d.mts.map +1 -1
- package/esm/http/createHttpApplication.mjs +2 -2
- package/esm/http/createHttpApplication.mjs.map +1 -1
- package/esm/http/csp.d.mts +10 -12
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +2 -2
- package/esm/http/csp.mjs.map +1 -1
- package/esm/http/csrf-default-guard.d.mts +2 -4
- package/esm/http/csrf-default-guard.d.mts.map +1 -1
- package/esm/http/csrf-default-guard.mjs +1 -1
- package/esm/http/csrf-default-guard.mjs.map +1 -1
- package/esm/http/csrf-origin-policy.d.mts +7 -9
- package/esm/http/csrf-origin-policy.d.mts.map +1 -1
- package/esm/http/csrf-origin-policy.mjs +2 -2
- package/esm/http/csrf-origin-policy.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +2 -3
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/error-codes.d.mts +1 -2
- package/esm/http/error-codes.d.mts.map +1 -1
- package/esm/http/error-mapper.d.mts +2 -4
- package/esm/http/error-mapper.d.mts.map +1 -1
- package/esm/http/error-mapper.mjs +2 -2
- package/esm/http/error-mapper.mjs.map +1 -1
- package/esm/http/errors/errors.d.mts +28 -29
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/escape-header-value.d.mts +1 -2
- package/esm/http/escape-header-value.d.mts.map +1 -1
- package/esm/http/events.d.mts +2 -4
- package/esm/http/events.d.mts.map +1 -1
- package/esm/http/health.d.mts +4 -4
- package/esm/http/health.d.mts.map +1 -1
- package/esm/http/index.d.mts +4 -1
- package/esm/http/index.mjs +1 -1
- package/esm/http/middleware/cache-response-middleware.d.mts +2 -4
- package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts +3 -3
- package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.mjs +6 -6
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/middleware/index.d.mts +3 -1
- package/esm/http/middleware/index.mjs +1 -1
- package/esm/http/middleware/inject-request-context.d.mts +2 -4
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +3 -3
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts +3 -3
- package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts +3 -3
- package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.mjs +4 -4
- package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts +2 -2
- package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
- package/esm/http/middleware/middleware-list.d.mts +1 -3
- package/esm/http/middleware/middleware-list.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.mjs +2 -2
- package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts +2 -3
- package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts +3 -5
- package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
- package/esm/http/middleware/utils/index.d.mts +2 -1
- package/esm/http/middleware/utils/parse-size.d.mts +1 -2
- package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
- package/esm/http/middleware/utils/parse-size.mjs +2 -2
- package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
- package/esm/http/plugins.d.mts +2 -4
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +10 -10
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/port-preflight.d.mts +3 -4
- package/esm/http/port-preflight.d.mts.map +1 -1
- package/esm/http/port-preflight.mjs +2 -0
- package/esm/http/port-preflight.mjs.map +1 -1
- package/esm/http/rate-limit-cache-store.mjs +4 -3
- package/esm/http/rate-limit-cache-store.mjs.map +1 -1
- package/esm/http/ready-report.d.mts +15 -10
- package/esm/http/ready-report.d.mts.map +1 -1
- package/esm/http/request-controller.d.mts +1 -3
- package/esm/http/request-controller.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.d.mts +20 -16
- package/esm/http/request-log-snapshot.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.mjs +3 -3
- package/esm/http/request-log-snapshot.mjs.map +1 -1
- package/esm/http/request.d.mts +8 -7
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +8 -7
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +12 -11
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +7 -7
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/safe-redirect.d.mts +3 -4
- package/esm/http/safe-redirect.d.mts.map +1 -1
- package/esm/http/serialized.d.mts +12 -13
- package/esm/http/serialized.d.mts.map +1 -1
- package/esm/http/server-rebuilt.d.mts +3 -5
- package/esm/http/server-rebuilt.d.mts.map +1 -1
- package/esm/http/server.d.mts +9 -9
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +4 -4
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/stream-react-response.d.mts +7 -7
- package/esm/http/stream-react-response.d.mts.map +1 -1
- package/esm/http/tracing/index.mjs +1 -1
- package/esm/http/tracing/trace-id.d.mts +2 -3
- package/esm/http/tracing/trace-id.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.d.mts +10 -11
- package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.mjs +2 -2
- package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
- package/esm/http/tracing/tracing.type.d.mts +11 -9
- package/esm/http/tracing/tracing.type.d.mts.map +1 -1
- package/esm/http/types.d.mts +49 -43
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploaded-file.d.mts +6 -5
- package/esm/http/uploaded-file.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts +6 -6
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +1 -1
- package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
- package/esm/http/uploads/image-variant-cache-entries.mjs +1 -1
- package/esm/http/uploads/image-variant-cache.mjs +8 -8
- package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/image-variant-types.d.mts +7 -9
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +1 -2
- package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
- package/esm/http/uploads/index.d.mts +2 -1
- package/esm/http/uploads/index.mjs +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs.map +1 -1
- package/esm/http/uploads/purge-image-variants.d.mts +2 -4
- package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variant.d.mts +3 -5
- package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variants-config.mjs +4 -4
- package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs.map +1 -1
- package/esm/http/uploads/trim-image-variant-cache.mjs +3 -3
- package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.d.mts +6 -5
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +2 -1
- package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
- package/esm/http/uploads/variant-cache-key.mjs +1 -1
- package/esm/http/uploads-config.d.mts +2 -4
- package/esm/http/uploads-config.d.mts.map +1 -1
- package/esm/http/uploads-types.d.mts +19 -17
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/http/xmlable.d.mts +1 -2
- package/esm/http/xmlable.d.mts.map +1 -1
- package/esm/image/image.d.mts +6 -7
- package/esm/image/image.d.mts.map +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/image/index.d.mts +2 -1
- package/esm/image/index.mjs +1 -1
- package/esm/index.d.mts +28 -2
- package/esm/index.mjs +7 -2
- package/esm/loader/app-module-importer.d.mts +1 -2
- package/esm/loader/app-module-importer.d.mts.map +1 -1
- package/esm/localization/index.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.d.mts +4 -5
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
- package/esm/localization/register-locale-dictionary.d.mts +3 -4
- package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/register-locale-dictionary.mjs +2 -2
- package/esm/localization/register-locale-dictionary.mjs.map +1 -1
- package/esm/logger/fatal-visibility.d.mts +1 -2
- package/esm/logger/fatal-visibility.d.mts.map +1 -1
- package/esm/logger/index.d.mts +2 -1
- package/esm/logger/index.mjs +1 -1
- package/esm/logger/logger.d.mts +1 -3
- package/esm/logger/logger.d.mts.map +1 -1
- package/esm/logger/types.d.mts +2 -3
- package/esm/logger/types.d.mts.map +1 -1
- package/esm/mail/config.d.mts +12 -14
- package/esm/mail/config.d.mts.map +1 -1
- package/esm/mail/events.d.mts +4 -6
- package/esm/mail/events.d.mts.map +1 -1
- package/esm/mail/index.d.mts +2 -1
- package/esm/mail/index.mjs +1 -1
- package/esm/mail/mail.d.mts +1 -3
- package/esm/mail/mail.d.mts.map +1 -1
- package/esm/mail/mailer-pool.d.mts +5 -7
- package/esm/mail/mailer-pool.d.mts.map +1 -1
- package/esm/mail/react-mail.d.mts +1 -3
- package/esm/mail/react-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.d.mts +1 -3
- package/esm/mail/send-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.mjs +2 -1
- package/esm/mail/send-mail.mjs.map +1 -1
- package/esm/mail/test-mailbox.d.mts +11 -13
- package/esm/mail/test-mailbox.d.mts.map +1 -1
- package/esm/mail/types.d.mts +17 -18
- package/esm/mail/types.d.mts.map +1 -1
- package/esm/manifest/manifest-manager.mjs +1 -1
- package/esm/openapi/build-openapi-document.d.mts +2 -4
- package/esm/openapi/build-openapi-document.d.mts.map +1 -1
- package/esm/openapi/cast-schema.mjs +1 -1
- package/esm/openapi/development-openapi-provider.d.mts +5 -6
- package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
- package/esm/openapi/index.d.mts +3 -1
- package/esm/openapi/index.mjs +1 -1
- package/esm/openapi/openapi-child-output.mjs +2 -2
- package/esm/openapi/openapi-child-output.mjs.map +1 -1
- package/esm/openapi/postman/build-request-url.mjs +1 -1
- package/esm/openapi/postman/example-from-schema.d.mts +1 -3
- package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
- package/esm/openapi/postman/index.d.mts +2 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts +3 -5
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
- package/esm/openapi/postman/postman-types.d.mts +19 -18
- package/esm/openapi/postman/postman-types.d.mts.map +1 -1
- package/esm/openapi/postman/schema-refs.d.mts +1 -3
- package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
- package/esm/openapi/postman/uuid-v5.mjs +1 -1
- package/esm/openapi/schema-registry.d.mts +1 -1
- package/esm/openapi/security.mjs +1 -1
- package/esm/openapi/types.d.mts +23 -21
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-generated-imports.mjs +1 -1
- package/esm/production/build-contributions.mjs +1 -1
- package/esm/production/bundle-framework-dependencies.mjs +1 -1
- package/esm/production/dist-build-manifest.mjs +1 -1
- package/esm/production/esbuild-plugins.mjs.map +1 -1
- package/esm/production/esbuild-preflight.mjs +1 -1
- package/esm/production/production-builder.mjs +2 -1
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/production-supervisor.mjs +1 -1
- package/esm/production/registration-child-runner.mjs +4 -3
- package/esm/production/registration-child-runner.mjs.map +1 -1
- package/esm/production/resolve-build-config.d.mts +4 -4
- package/esm/production/resolve-build-config.d.mts.map +1 -1
- package/esm/production/resolve-build-config.mjs +1 -1
- package/esm/production/route-registration-child.d.mts +1 -1
- package/esm/production/route-registration-child.mjs +8 -7
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/tsconfig-path-aliases.mjs +1 -1
- package/esm/react/index.d.mts +1 -3
- package/esm/react/index.d.mts.map +1 -1
- package/esm/react/index.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +3 -4
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +2 -3
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs +10 -9
- package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/index.d.mts +2 -1
- package/esm/repositories/adapters/cascade/index.mjs +1 -1
- package/esm/repositories/contracts/index.d.mts +2 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts +4 -6
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -3
- package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts +23 -25
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/index.d.mts +4 -1
- package/esm/repositories/index.mjs +1 -1
- package/esm/repositories/repository.manager.d.mts +2 -3
- package/esm/repositories/repository.manager.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs +2 -2
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/define-resource.d.mts +3 -5
- package/esm/resource/define-resource.d.mts.map +1 -1
- package/esm/resource/index.d.mts +2 -1
- package/esm/resource/index.mjs +1 -1
- package/esm/resource/nullable-resource.d.mts +5 -7
- package/esm/resource/nullable-resource.d.mts.map +1 -1
- package/esm/resource/register-resource.d.mts +1 -3
- package/esm/resource/register-resource.d.mts.map +1 -1
- package/esm/resource/resource-field-builder.d.mts +1 -3
- package/esm/resource/resource-field-builder.d.mts.map +1 -1
- package/esm/resource/resource.d.mts +3 -5
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs +4 -2
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts +21 -21
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/index.d.mts +2 -1
- package/esm/restful/index.mjs +1 -1
- package/esm/restful/restful.d.mts +12 -32
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/router/index.d.mts +2 -1
- package/esm/router/index.mjs +1 -1
- package/esm/router/named-api-routes-with-responses.mjs +2 -1
- package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
- package/esm/router/normalize-request-path.d.mts +1 -2
- package/esm/router/normalize-request-path.d.mts.map +1 -1
- package/esm/router/normalize-route-path.d.mts +1 -2
- package/esm/router/normalize-route-path.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts +15 -13
- package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
- package/esm/router/resolve-route-rate-limit.mjs +3 -3
- package/esm/router/resolve-route-rate-limit.mjs.map +1 -1
- package/esm/router/route-builder.d.mts +1 -3
- package/esm/router/route-builder.d.mts.map +1 -1
- package/esm/router/route-guard-names.mjs +1 -1
- package/esm/router/route-guard-names.mjs.map +1 -1
- package/esm/router/route-name-method-suffix.d.mts +2 -3
- package/esm/router/route-name-method-suffix.d.mts.map +1 -1
- package/esm/router/route-name-taken-error.d.mts +1 -3
- package/esm/router/route-name-taken-error.d.mts.map +1 -1
- package/esm/router/route-registry.d.mts +1 -3
- package/esm/router/route-registry.d.mts.map +1 -1
- package/esm/router/router.d.mts +2 -4
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +8 -6
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +25 -26
- package/esm/router/types.d.mts.map +1 -1
- package/esm/router/unguarded-route-diagnostics.d.mts +6 -8
- package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -1
- package/esm/secrets/errors.d.mts +9 -0
- package/esm/secrets/errors.d.mts.map +1 -0
- package/esm/secrets/errors.mjs +22 -0
- package/esm/secrets/errors.mjs.map +1 -0
- package/esm/secrets/file-backend.mjs +167 -0
- package/esm/secrets/file-backend.mjs.map +1 -0
- package/esm/secrets/index.d.mts +6 -0
- package/esm/secrets/index.mjs +6 -0
- package/esm/secrets/keyring-backend.mjs +50 -0
- package/esm/secrets/keyring-backend.mjs.map +1 -0
- package/esm/secrets/memory-backend.d.mts +12 -0
- package/esm/secrets/memory-backend.d.mts.map +1 -0
- package/esm/secrets/memory-backend.mjs +28 -0
- package/esm/secrets/memory-backend.mjs.map +1 -0
- package/esm/secrets/secret-store.d.mts +25 -0
- package/esm/secrets/secret-store.d.mts.map +1 -0
- package/esm/secrets/secret-store.mjs +117 -0
- package/esm/secrets/secret-store.mjs.map +1 -0
- package/esm/secrets/secrets.d.mts +11 -0
- package/esm/secrets/secrets.d.mts.map +1 -0
- package/esm/secrets/secrets.mjs +63 -0
- package/esm/secrets/secrets.mjs.map +1 -0
- package/esm/secrets/types.d.mts +22 -0
- package/esm/secrets/types.d.mts.map +1 -0
- package/esm/socket/index.d.mts +2 -1
- package/esm/socket/index.mjs +2 -2
- package/esm/socket/types.d.mts +2 -4
- package/esm/socket/types.d.mts.map +1 -1
- package/esm/socket/utils.d.mts +8 -3
- package/esm/socket/utils.d.mts.map +1 -1
- package/esm/socket/utils.mjs +12 -1
- package/esm/socket/utils.mjs.map +1 -1
- package/esm/storage/config.d.mts +4 -6
- package/esm/storage/config.d.mts.map +1 -1
- package/esm/storage/context/storage-driver-context.d.mts +3 -4
- package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts +2 -4
- package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
- package/esm/storage/drivers/do-spaces-driver.d.mts +1 -3
- package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.d.mts +2 -3
- package/esm/storage/drivers/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs +8 -3
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/drivers/r2-driver.d.mts +1 -3
- package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
- package/esm/storage/drivers/s3-driver.d.mts +1 -3
- package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
- package/esm/storage/index.d.mts +2 -1
- package/esm/storage/index.mjs +1 -1
- package/esm/storage/local-disk-roots.mjs +2 -2
- package/esm/storage/local-disk-roots.mjs.map +1 -1
- package/esm/storage/scoped-storage.d.mts +2 -3
- package/esm/storage/scoped-storage.d.mts.map +1 -1
- package/esm/storage/storage-file.d.mts +1 -3
- package/esm/storage/storage-file.d.mts.map +1 -1
- package/esm/storage/storage.d.mts +3 -4
- package/esm/storage/storage.d.mts.map +1 -1
- package/esm/storage/types.d.mts +36 -36
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/classify-ip-address.d.mts +1 -2
- package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
- package/esm/storage/utils/contain-path.d.mts +1 -2
- package/esm/storage/utils/contain-path.d.mts.map +1 -1
- package/esm/storage/utils/mime.d.mts +2 -3
- package/esm/storage/utils/mime.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.d.mts +6 -6
- package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.mjs +3 -3
- package/esm/storage/utils/safe-fetch.mjs.map +1 -1
- package/esm/storage/utils/storage-capability-error.d.mts +1 -3
- package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-error.d.mts +2 -3
- package/esm/storage/utils/storage-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts +1 -2
- package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
- package/esm/tests/authenticated-test-client.d.mts +5 -6
- package/esm/tests/authenticated-test-client.d.mts.map +1 -1
- package/esm/tests/factories.d.mts +38 -23
- package/esm/tests/factories.d.mts.map +1 -1
- package/esm/tests/fakes/cache-fake.d.mts +14 -9
- package/esm/tests/fakes/cache-fake.d.mts.map +1 -1
- package/esm/tests/fakes/clock-fake.d.mts +13 -8
- package/esm/tests/fakes/clock-fake.d.mts.map +1 -1
- package/esm/tests/fakes/fake-assertion-error.d.mts +2 -3
- package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -1
- package/esm/tests/fakes/ids-fake.d.mts +5 -4
- package/esm/tests/fakes/ids-fake.d.mts.map +1 -1
- package/esm/tests/fakes/index.d.mts +3 -1
- package/esm/tests/fakes/index.mjs +2 -1
- package/esm/tests/fakes/mail-fake.d.mts +21 -13
- package/esm/tests/fakes/mail-fake.d.mts.map +1 -1
- package/esm/tests/fakes/queue-fake.d.mts +21 -13
- package/esm/tests/fakes/queue-fake.d.mts.map +1 -1
- package/esm/tests/fakes/secrets-fake.d.mts +13 -0
- package/esm/tests/fakes/secrets-fake.d.mts.map +1 -0
- package/esm/tests/fakes/secrets-fake.mjs +50 -0
- package/esm/tests/fakes/secrets-fake.mjs.map +1 -0
- package/esm/tests/fakes/storage-fake.d.mts +12 -8
- package/esm/tests/fakes/storage-fake.d.mts.map +1 -1
- package/esm/tests/fakes/storage-fake.mjs +1 -1
- package/esm/tests/fakes/test-fakes.d.mts +9 -10
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
- package/esm/tests/fakes/test-fakes.mjs +6 -3
- package/esm/tests/fakes/test-fakes.mjs.map +1 -1
- package/esm/tests/index.d.mts +3 -1
- package/esm/tests/index.mjs +2 -1
- package/esm/tests/snapshot-response.d.mts +4 -5
- package/esm/tests/snapshot-response.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.d.mts +4 -6
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +5 -5
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-connectors-selection.d.mts +2 -2
- package/esm/tests/test-connectors-selection.d.mts.map +1 -1
- package/esm/tests/test-connectors-selection.mjs +1 -1
- package/esm/tests/test-helpers.d.mts +11 -12
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-http-server.d.mts +14 -10
- package/esm/tests/test-http-server.d.mts.map +1 -1
- package/esm/tests/test-lifecycle-state.mjs +1 -1
- package/esm/tests/vitest-setup.d.mts +7 -8
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.d.mts +4 -5
- package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.mjs +2 -1
- package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-refresher.d.mts +19 -12
- package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -1
- package/esm/tooling/agents-md/installed-skills.d.mts +13 -9
- package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -1
- package/esm/tooling/agents-md/render-agents-md.d.mts +8 -7
- package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -1
- package/esm/tooling/agents-md/render-agents-md.mjs +2 -2
- package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -1
- package/esm/tooling/agents-md/write-agents-md.d.mts +17 -12
- package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -1
- package/esm/tooling/board/board-message.d.mts +4 -6
- package/esm/tooling/board/board-message.d.mts.map +1 -1
- package/esm/tooling/board/board.d.mts +50 -38
- package/esm/tooling/board/board.d.mts.map +1 -1
- package/esm/tooling/board/board.mjs +4 -3
- package/esm/tooling/board/board.mjs.map +1 -1
- package/esm/tooling/board/board.types.d.mts +32 -23
- package/esm/tooling/board/board.types.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.d.mts +4 -6
- package/esm/tooling/check/changed-files.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.mjs +2 -2
- package/esm/tooling/check/changed-files.mjs.map +1 -1
- package/esm/tooling/check/check-report.types.d.mts +22 -17
- package/esm/tooling/check/check-report.types.d.mts.map +1 -1
- package/esm/tooling/check/code-style-conventions.mjs +25 -25
- package/esm/tooling/check/code-style-conventions.mjs.map +1 -1
- package/esm/tooling/check/conventions-step.d.mts +4 -6
- package/esm/tooling/check/conventions-step.d.mts.map +1 -1
- package/esm/tooling/check/conventions-step.mjs +7 -18
- package/esm/tooling/check/conventions-step.mjs.map +1 -1
- package/esm/tooling/check/environment-step.d.mts +2 -4
- package/esm/tooling/check/environment-step.d.mts.map +1 -1
- package/esm/tooling/check/environment-step.mjs +1 -1
- package/esm/tooling/check/index.mjs +1 -1
- package/esm/tooling/check/lint-step.d.mts +5 -12
- package/esm/tooling/check/lint-step.d.mts.map +1 -1
- package/esm/tooling/check/lint-step.mjs +16 -12
- package/esm/tooling/check/lint-step.mjs.map +1 -1
- package/esm/tooling/check/request-input.mjs +15 -15
- package/esm/tooling/check/request-input.mjs.map +1 -1
- package/esm/tooling/check/run-check.d.mts +24 -14
- package/esm/tooling/check/run-check.d.mts.map +1 -1
- package/esm/tooling/check/run-check.mjs +2 -2
- package/esm/tooling/check/run-check.mjs.map +1 -1
- package/esm/tooling/check/run-tests.d.mts +22 -15
- package/esm/tooling/check/run-tests.d.mts.map +1 -1
- package/esm/tooling/check/security-conventions.mjs +133 -131
- package/esm/tooling/check/security-conventions.mjs.map +1 -1
- package/esm/tooling/check/source-ast.mjs +92 -132
- package/esm/tooling/check/source-ast.mjs.map +1 -1
- package/esm/tooling/check/tests-step.d.mts +7 -8
- package/esm/tooling/check/tests-step.d.mts.map +1 -1
- package/esm/tooling/check/tests-step.mjs +3 -3
- package/esm/tooling/check/tests-step.mjs.map +1 -1
- package/esm/tooling/dev-state/dev-server-state.d.mts +17 -13
- package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -1
- package/esm/tooling/devtools/devtools-client.d.mts +29 -20
- package/esm/tooling/devtools/devtools-client.d.mts.map +1 -1
- package/esm/tooling/generate/generation.d.mts +34 -22
- package/esm/tooling/generate/generation.d.mts.map +1 -1
- package/esm/tooling/generate/generation.mjs +9 -5
- package/esm/tooling/generate/generation.mjs.map +1 -1
- package/esm/tooling/generate/generator-spec.d.mts +9 -9
- package/esm/tooling/generate/generator-spec.d.mts.map +1 -1
- package/esm/tooling/generate/index.mjs +1 -1
- package/esm/tooling/generate/project-files.mjs +3 -3
- package/esm/tooling/generate/project-files.mjs.map +1 -1
- package/esm/tooling/generate/run-cli.d.mts +14 -11
- package/esm/tooling/generate/run-cli.d.mts.map +1 -1
- package/esm/tooling/generate/run-cli.mjs +2 -2
- package/esm/tooling/generate/run-cli.mjs.map +1 -1
- package/esm/tooling/generate/unified-diff.d.mts +10 -7
- package/esm/tooling/generate/unified-diff.d.mts.map +1 -1
- package/esm/tooling/index.d.mts +1 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts +7 -7
- package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-config.mjs +3 -3
- package/esm/tooling/inspect/collect-config.mjs.map +1 -1
- package/esm/tooling/inspect/collect-models.d.mts +4 -3
- package/esm/tooling/inspect/collect-models.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-models.mjs +1 -1
- package/esm/tooling/inspect/collect-packages.d.mts +1 -2
- package/esm/tooling/inspect/collect-packages.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-pages.mjs +10 -10
- package/esm/tooling/inspect/collect-pages.mjs.map +1 -1
- package/esm/tooling/inspect/collect-routes.mjs +1 -1
- package/esm/tooling/inspect/event-recorder.d.mts +7 -7
- package/esm/tooling/inspect/event-recorder.d.mts.map +1 -1
- package/esm/tooling/inspect/index.d.mts +2 -1
- package/esm/tooling/inspect/index.mjs +1 -1
- package/esm/tooling/inspect/inspect-app.d.mts +25 -16
- package/esm/tooling/inspect/inspect-app.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.schema.d.mts +1 -2
- package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.types.d.mts +86 -54
- package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -1
- package/esm/tooling/mcp/create-mcp-context.d.mts +11 -8
- package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -1
- package/esm/tooling/mcp/db-schema.d.mts +10 -9
- package/esm/tooling/mcp/db-schema.d.mts.map +1 -1
- package/esm/tooling/mcp/docs-search.d.mts +20 -15
- package/esm/tooling/mcp/docs-search.d.mts.map +1 -1
- package/esm/tooling/mcp/index.mjs +1 -1
- package/esm/tooling/mcp/load-ai-tools.d.mts +7 -8
- package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/load-ai-tools.mjs +2 -1
- package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -1
- package/esm/tooling/mcp/mcp-tools.d.mts +29 -19
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/mcp-tools.mjs +3 -2
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -1
- package/esm/tooling/mcp/start-mcp-server.d.mts +24 -17
- package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -1
- package/esm/tooling/mcp/start-mcp-server.mjs +1 -1
- package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -1
- package/esm/tooling/mcp/tool-input.d.mts +7 -7
- package/esm/tooling/mcp/tool-input.d.mts.map +1 -1
- package/esm/tooling/problem.d.mts +27 -17
- package/esm/tooling/problem.d.mts.map +1 -1
- package/esm/tooling/syntax/ast.mjs +230 -0
- package/esm/tooling/syntax/ast.mjs.map +1 -0
- package/esm/tooling/syntax/imports.mjs +34 -0
- package/esm/tooling/syntax/imports.mjs.map +1 -0
- package/esm/tooling/trace/trace-report.types.d.mts +36 -22
- package/esm/tooling/trace/trace-report.types.d.mts.map +1 -1
- package/esm/tooling/trace/trace-request.d.mts +27 -20
- package/esm/tooling/trace/trace-request.d.mts.map +1 -1
- package/esm/tooling/trace/trace-request.mjs +2 -2
- package/esm/tooling/trace/trace-request.mjs.map +1 -1
- package/esm/tooling/typecheck/index.mjs +1 -1
- package/esm/tooling/typecheck/run-typecheck.d.mts +15 -48
- package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -1
- package/esm/tooling/typecheck/run-typecheck.mjs +42 -105
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -1
- package/esm/tooling/typescript/compiler.d.mts +31 -0
- package/esm/tooling/typescript/compiler.d.mts.map +1 -0
- package/esm/tooling/typescript/compiler.mjs +120 -0
- package/esm/tooling/typescript/compiler.mjs.map +1 -0
- package/esm/updater/update-warlock-packages.mjs +3 -2
- package/esm/updater/update-warlock-packages.mjs.map +1 -1
- package/esm/upgrade/codemods/index.mjs +3 -1
- package/esm/upgrade/codemods/index.mjs.map +1 -1
- package/esm/upgrade/codemods/logger-sync-calls.mjs +1 -1
- package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -1
- package/esm/upgrade/codemods/oxc-toolchain.mjs +142 -0
- package/esm/upgrade/codemods/oxc-toolchain.mjs.map +1 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs +1 -1
- package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -1
- package/esm/upgrade/codemods/toolchain-templates.mjs +244 -0
- package/esm/upgrade/codemods/toolchain-templates.mjs.map +1 -0
- package/esm/upgrade/diff.mjs +1 -1
- package/esm/upgrade/diff.mjs.map +1 -1
- package/esm/upgrade/load-ts-morph.mjs +3 -2
- package/esm/upgrade/load-ts-morph.mjs.map +1 -1
- package/esm/upgrade/run-upgrade.mjs +26 -7
- package/esm/upgrade/run-upgrade.mjs.map +1 -1
- package/esm/use-cases/index.d.mts +2 -1
- package/esm/use-cases/index.mjs +1 -1
- package/esm/use-cases/types.d.mts +116 -63
- package/esm/use-cases/types.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts +1 -3
- package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
- package/esm/use-cases/use-case-events.d.mts +3 -5
- package/esm/use-cases/use-case-events.d.mts.map +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts +6 -6
- package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
- package/esm/use-cases/use-case.d.mts +2 -4
- package/esm/use-cases/use-case.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.d.mts +1 -3
- package/esm/use-cases/use-case.errors.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.d.mts +8 -10
- package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
- package/esm/utils/app-log.d.mts +1 -2
- package/esm/utils/app-log.d.mts.map +1 -1
- package/esm/utils/clock.d.mts +8 -6
- package/esm/utils/clock.d.mts.map +1 -1
- package/esm/utils/database-log.d.mts +3 -4
- package/esm/utils/database-log.d.mts.map +1 -1
- package/esm/utils/environment.d.mts +4 -5
- package/esm/utils/environment.d.mts.map +1 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/get-localized.d.mts +2 -3
- package/esm/utils/get-localized.d.mts.map +1 -1
- package/esm/utils/ids.d.mts +9 -6
- package/esm/utils/ids.d.mts.map +1 -1
- package/esm/utils/index.d.mts +2 -1
- package/esm/utils/index.mjs +1 -1
- package/esm/utils/normalized-path.d.mts +1 -2
- package/esm/utils/normalized-path.d.mts.map +1 -1
- package/esm/utils/npm-registry.d.mts +1 -2
- package/esm/utils/npm-registry.d.mts.map +1 -1
- package/esm/utils/paths.d.mts +13 -14
- package/esm/utils/paths.d.mts.map +1 -1
- package/esm/utils/paths.mjs +2 -2
- package/esm/utils/paths.mjs.map +1 -1
- package/esm/utils/promise-all-object.d.mts +1 -2
- package/esm/utils/promise-all-object.d.mts.map +1 -1
- package/esm/utils/queue.d.mts +1 -2
- package/esm/utils/queue.d.mts.map +1 -1
- package/esm/utils/runtime.d.mts +11 -10
- package/esm/utils/runtime.d.mts.map +1 -1
- package/esm/utils/sleep.d.mts +1 -2
- package/esm/utils/sleep.d.mts.map +1 -1
- package/esm/utils/sluggable.d.mts +1 -3
- package/esm/utils/sluggable.d.mts.map +1 -1
- package/esm/utils/to-json.d.mts +1 -2
- package/esm/utils/to-json.d.mts.map +1 -1
- package/esm/utils/types.d.mts +1 -2
- package/esm/utils/types.d.mts.map +1 -1
- package/esm/utils/urls.d.mts +5 -6
- package/esm/utils/urls.d.mts.map +1 -1
- package/esm/utils/version-compare.d.mts +1 -2
- package/esm/utils/version-compare.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts +2 -3
- package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts +2 -3
- package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/index.d.mts +2 -1
- package/esm/validation/database/index.mjs +1 -1
- package/esm/validation/database/types.d.mts +14 -10
- package/esm/validation/database/types.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts +2 -3
- package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts +2 -3
- package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
- package/esm/validation/file/file.d.mts +4 -6
- package/esm/validation/file/file.d.mts.map +1 -1
- package/esm/validation/file/index.d.mts +2 -1
- package/esm/validation/file/index.mjs +1 -1
- package/esm/validation/index.d.mts +5 -1
- package/esm/validation/index.mjs +1 -1
- package/esm/validation/plugins/index.mjs +1 -1
- package/esm/validation/types.d.mts +6 -4
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +2 -2
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validation-failure-status.mjs +2 -2
- package/esm/validation/validation-failure-status.mjs.map +1 -1
- package/esm/validation/validators/file-validator.d.mts +2 -4
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/validation/validators/index.d.mts +2 -1
- package/esm/validation/validators/index.mjs +1 -1
- package/esm/vite/lower-stage3-decorators.d.mts +2 -3
- package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
- package/esm/warlock-config/define-config.d.mts +1 -3
- package/esm/warlock-config/define-config.d.mts.map +1 -1
- package/esm/warlock-config/define-config.mjs +3 -2
- package/esm/warlock-config/define-config.mjs.map +1 -1
- package/esm/warlock-config/index.d.mts +2 -1
- package/esm/warlock-config/index.mjs +1 -1
- package/esm/warlock-config/types.d.mts +8 -6
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.d.mts +5 -7
- package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.mjs +2 -1
- package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
- package/esm/warlock-config/warn-deprecated-config.mjs +1 -1
- package/llms-full.txt +379 -22
- package/llms.txt +3 -2
- package/package.json +27 -15
- package/skills/README.md +2 -1
- package/skills/create-module/SKILL.md +7 -0
- package/skills/index.md +3 -1
- package/skills/report-framework-issue.md +154 -0
- package/skills/run-app/SKILL.md +120 -10
- package/skills/store-secrets/SKILL.md +102 -0
- package/skills/test-fakes/SKILL.md +13 -11
- package/skills/upgrade-from-5-29/SKILL.md +78 -0
- package/skills/warlock-check/SKILL.md +6 -1
- package/skills/warlock-doctor/SKILL.md +9 -0
- package/skills/wire-socket/SKILL.md +19 -0
- package/skills/write-cli-command/SKILL.md +21 -0
- package/esm/tooling/check/index.d.mts +0 -8
- package/esm/tooling/typecheck/index.d.mts +0 -1
|
@@ -1,83 +1,96 @@
|
|
|
1
1
|
import { BoardItem, BoardMessage, BoardState, BoardStatus, BoardVerdict } from "./board.types.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/tooling/board/board.d.ts
|
|
4
3
|
/** What `initBoard` did. */
|
|
5
|
-
type InitBoardResult = {
|
|
6
|
-
/** The board directory, relative to the project root. */
|
|
7
|
-
|
|
4
|
+
export type InitBoardResult = {
|
|
5
|
+
/** The board directory, relative to the project root. */
|
|
6
|
+
directory: string;
|
|
7
|
+
/** `false` when the board already existed. */
|
|
8
|
+
created: boolean;
|
|
9
|
+
/** Whether `.warlock/board/` was added to `.gitignore` by this call. */
|
|
8
10
|
gitignoreUpdated: boolean;
|
|
9
11
|
};
|
|
10
12
|
/** Inputs of {@link addBoardItem}. */
|
|
11
|
-
type AddBoardItemInput = {
|
|
13
|
+
export type AddBoardItemInput = {
|
|
12
14
|
title: string;
|
|
13
15
|
assignee?: string | null;
|
|
14
|
-
reviewer?: string | null;
|
|
15
|
-
|
|
16
|
+
reviewer?: string | null;
|
|
17
|
+
/** The agent creating it, recorded in the history. */
|
|
18
|
+
by?: string | null;
|
|
19
|
+
/** Clock, for tests. */
|
|
16
20
|
now?: () => Date;
|
|
17
21
|
};
|
|
18
22
|
/** Inputs of {@link moveBoardItem}. */
|
|
19
|
-
type MoveBoardItemOptions = {
|
|
23
|
+
export type MoveBoardItemOptions = {
|
|
20
24
|
by?: string | null;
|
|
21
25
|
note?: string | null;
|
|
22
26
|
now?: () => Date;
|
|
23
27
|
};
|
|
24
28
|
/** Inputs of {@link sendBoardMessage}. */
|
|
25
|
-
type SendBoardMessageInput = {
|
|
29
|
+
export type SendBoardMessageInput = {
|
|
26
30
|
to: string;
|
|
27
31
|
from: string;
|
|
28
32
|
subject: string;
|
|
29
|
-
body?: string;
|
|
30
|
-
|
|
33
|
+
body?: string;
|
|
34
|
+
/** The item the message is about. */
|
|
35
|
+
item?: number | null;
|
|
36
|
+
/** A review verdict; with `item`, also moves the item to that state. */
|
|
31
37
|
verdict?: BoardVerdict | null;
|
|
32
38
|
now?: () => Date;
|
|
33
39
|
};
|
|
34
40
|
/** What {@link sendBoardMessage} wrote. */
|
|
35
|
-
type SendBoardMessageResult = {
|
|
36
|
-
message: BoardMessage;
|
|
41
|
+
export type SendBoardMessageResult = {
|
|
42
|
+
message: BoardMessage;
|
|
43
|
+
/** The item after the verdict moved it, when the message carried one. */
|
|
37
44
|
item: BoardItem | null;
|
|
38
45
|
};
|
|
39
46
|
/** Inputs of {@link watchBoard}. */
|
|
40
|
-
type WatchBoardOptions = {
|
|
41
|
-
agent: string;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
export type WatchBoardOptions = {
|
|
48
|
+
agent: string;
|
|
49
|
+
/** Return messages numbered above this. Default: the agent's cursor. */
|
|
50
|
+
since?: number;
|
|
51
|
+
/** Give up after this long; throws `WL7404`. Default: 10 minutes. */
|
|
52
|
+
timeoutMs?: number;
|
|
53
|
+
/** Poll interval. Default: 250 ms. */
|
|
54
|
+
intervalMs?: number;
|
|
55
|
+
/** Stop early (resolves with no messages). */
|
|
45
56
|
signal?: AbortSignal;
|
|
46
57
|
};
|
|
47
58
|
/** What {@link watchBoard} returned. */
|
|
48
|
-
type WatchBoardResult = {
|
|
49
|
-
agent: string;
|
|
50
|
-
|
|
59
|
+
export type WatchBoardResult = {
|
|
60
|
+
agent: string;
|
|
61
|
+
/** The new messages, oldest first. */
|
|
62
|
+
messages: BoardMessage[];
|
|
63
|
+
/** The agent's cursor after the call. */
|
|
51
64
|
cursor: number;
|
|
52
65
|
};
|
|
53
66
|
/** A file-name slug: lower-case, dashes, at most 48 characters. */
|
|
54
|
-
declare function boardSlug(value: string, fallback: string): string;
|
|
67
|
+
export declare function boardSlug(value: string, fallback: string): string;
|
|
55
68
|
/** Throw unless `name` is a valid agent name. */
|
|
56
|
-
declare function assertAgentName(name: string, label?: string): void;
|
|
69
|
+
export declare function assertAgentName(name: string, label?: string): void;
|
|
57
70
|
/** Whether a `.gitignore` already ignores the board folder (or `.warlock` as a whole). */
|
|
58
|
-
declare function gitignoreCoversBoard(content: string): boolean;
|
|
71
|
+
export declare function gitignoreCoversBoard(content: string): boolean;
|
|
59
72
|
/**
|
|
60
73
|
* Create the board (idempotent): `.warlock/board/` with its `board.json`
|
|
61
74
|
* marker, `items/`, and `.warlock/board/` in `.gitignore` unless the project
|
|
62
75
|
* already ignores it. A `.gitignore` is created when there is none.
|
|
63
76
|
*/
|
|
64
|
-
declare function initBoard(cwd?: string, now?: () => Date): InitBoardResult;
|
|
77
|
+
export declare function initBoard(cwd?: string, now?: () => Date): InitBoardResult;
|
|
65
78
|
/** Every item, by id. Throws `WL7401` when the board does not exist. */
|
|
66
|
-
declare function listBoardItems(cwd?: string): BoardItem[];
|
|
79
|
+
export declare function listBoardItems(cwd?: string): BoardItem[];
|
|
67
80
|
/** One item. Throws `WL7402` for an unknown id. */
|
|
68
|
-
declare function readBoardItem(id: number, cwd?: string): BoardItem;
|
|
81
|
+
export declare function readBoardItem(id: number, cwd?: string): BoardItem;
|
|
69
82
|
/** Add an item in state `todo`, with a fresh id no other writer can take. */
|
|
70
|
-
declare function addBoardItem(input: AddBoardItemInput, cwd?: string): BoardItem;
|
|
83
|
+
export declare function addBoardItem(input: AddBoardItemInput, cwd?: string): BoardItem;
|
|
71
84
|
/** The states an item in `state` may move to. */
|
|
72
|
-
declare function nextBoardStates(state: BoardState): readonly BoardState[];
|
|
85
|
+
export declare function nextBoardStates(state: BoardState): readonly BoardState[];
|
|
73
86
|
/** Throw `WL7403` unless `from → to` is in {@link BOARD_TRANSITIONS}. */
|
|
74
|
-
declare function assertBoardTransition(id: number, from: BoardState, to: BoardState): void;
|
|
87
|
+
export declare function assertBoardTransition(id: number, from: BoardState, to: BoardState): void;
|
|
75
88
|
/**
|
|
76
89
|
* Move an item to another state, recording who moved it and why. Throws
|
|
77
90
|
* `WL7402` for an unknown id and `WL7403` for a move the state machine does
|
|
78
91
|
* not allow.
|
|
79
92
|
*/
|
|
80
|
-
declare function moveBoardItem(id: number, to: BoardState, options?: MoveBoardItemOptions, cwd?: string): BoardItem;
|
|
93
|
+
export declare function moveBoardItem(id: number, to: BoardState, options?: MoveBoardItemOptions, cwd?: string): BoardItem;
|
|
81
94
|
/**
|
|
82
95
|
* Write a message to `to-<agent>/NNNN-<slug>.md`. Messages are append-only:
|
|
83
96
|
* the number is reserved exclusively and the file is created with `wx`, so it
|
|
@@ -85,17 +98,17 @@ declare function moveBoardItem(id: number, to: BoardState, options?: MoveBoardIt
|
|
|
85
98
|
* `approved` / `changes-requested` — before the message is written, so a
|
|
86
99
|
* refused move (`WL7403`) leaves no message behind.
|
|
87
100
|
*/
|
|
88
|
-
declare function sendBoardMessage(input: SendBoardMessageInput, cwd?: string): SendBoardMessageResult;
|
|
101
|
+
export declare function sendBoardMessage(input: SendBoardMessageInput, cwd?: string): SendBoardMessageResult;
|
|
89
102
|
/** The messages in an agent's inbox numbered above `since`, oldest first. */
|
|
90
|
-
declare function listBoardMessages(agent: string, options?: {
|
|
103
|
+
export declare function listBoardMessages(agent: string, options?: {
|
|
91
104
|
since?: number;
|
|
92
105
|
}, cwd?: string): BoardMessage[];
|
|
93
106
|
/** The highest message number `watch` has returned to `agent` (0 when none). */
|
|
94
|
-
declare function readBoardCursor(agent: string, cwd?: string): number;
|
|
107
|
+
export declare function readBoardCursor(agent: string, cwd?: string): number;
|
|
95
108
|
/** Record that `agent` has seen messages up to `number`. Never moves the cursor back. */
|
|
96
|
-
declare function writeBoardCursor(agent: string, number: number, cwd?: string): number;
|
|
109
|
+
export declare function writeBoardCursor(agent: string, number: number, cwd?: string): number;
|
|
97
110
|
/** Every item and every inbox with its message count, cursor and unread count. */
|
|
98
|
-
declare function readBoardStatus(cwd?: string): BoardStatus;
|
|
111
|
+
export declare function readBoardStatus(cwd?: string): BoardStatus;
|
|
99
112
|
/**
|
|
100
113
|
* Block until `agent` has a message numbered above `since` (default: its
|
|
101
114
|
* cursor), then return every such message and advance the cursor past them.
|
|
@@ -103,7 +116,6 @@ declare function readBoardStatus(cwd?: string): BoardStatus;
|
|
|
103
116
|
* Polls the inbox every `intervalMs`; throws `WL7404` when `timeoutMs` passes
|
|
104
117
|
* first. An aborted `signal` resolves with no messages.
|
|
105
118
|
*/
|
|
106
|
-
declare function watchBoard(options: WatchBoardOptions, cwd?: string): Promise<WatchBoardResult>;
|
|
119
|
+
export declare function watchBoard(options: WatchBoardOptions, cwd?: string): Promise<WatchBoardResult>;
|
|
107
120
|
//#endregion
|
|
108
|
-
export { AddBoardItemInput, InitBoardResult, MoveBoardItemOptions, SendBoardMessageInput, SendBoardMessageResult, WatchBoardOptions, WatchBoardResult, addBoardItem, assertAgentName, assertBoardTransition, boardSlug, gitignoreCoversBoard, initBoard, listBoardItems, listBoardMessages, moveBoardItem, nextBoardStates, readBoardCursor, readBoardItem, readBoardStatus, sendBoardMessage, watchBoard, writeBoardCursor };
|
|
109
121
|
//# sourceMappingURL=board.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/board/board.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"board.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/board/board.ts"],"mappings":";;;YAiCY;;EAEV;;EAEA;;EAEA;;;YAIU;EACV;EACA;EACA;;EAEA;;EAEA,YAAY;;;YAIF;EACV;EACA;EACA,YAAY;;;YAIF;EACV;EACA;EACA;EACA;;EAEA;;EAEA,UAAU;EACV,YAAY;;;YAIF;EACV,SAAS;;EAET,MAAM;;;YAII;EACV;;EAEA;;EAEA;;EAEA;;EAEA,SAAS;;;YAIC;EACV;;EAEA,UAAU;;EAEV;;;wBAgBc,UAAU,eAAe;;wBAYzB,gBAAgB,cAAc;;wBA8E9B,qBAAqB;;;;;;wBAsBrB,UACd,cACA,YAAW,OACV;;wBA4Fa,eAAe,eAAsB;;wBAerC,cAAc,YAAY,eAAsB;;wBAgBhD,aAAa,OAAO,mBAAmB,eAAsB;;wBAqC7D,gBAAgB,OAAO,sBAAsB;;wBAK7C,sBAAsB,YAAY,MAAM,YAAY,IAAI;;;;;;wBAcxD,cACd,YACA,IAAI,YACJ,UAAS,sBACT,eACC;;;;;;;;wBAoCa,iBACd,OAAO,uBACP,eACC;;wBAyDa,kBACd,eACA;EAAW;GACX,eACC;;wBA6Ba,gBAAgB,eAAe;;wBAe/B,iBAAiB,eAAe,gBAAgB;;wBAchD,gBAAgB,eAAsB;;;;;;;;wBA+BhC,WACpB,SAAS,mBACT,eACC,QAAQ"}
|
|
@@ -78,7 +78,7 @@ function assertInitialized(cwd) {
|
|
|
78
78
|
}
|
|
79
79
|
/** Whether a `.gitignore` already ignores the board folder (or `.warlock` as a whole). */
|
|
80
80
|
function gitignoreCoversBoard(content) {
|
|
81
|
-
const covering = new Set([
|
|
81
|
+
const covering = /* @__PURE__ */ new Set([
|
|
82
82
|
".warlock",
|
|
83
83
|
".warlock/",
|
|
84
84
|
"/.warlock",
|
|
@@ -111,7 +111,8 @@ function initBoard(cwd = process.cwd(), now = () => /* @__PURE__ */ new Date())
|
|
|
111
111
|
const current = existsSync(gitignore) ? readFileSync(gitignore, "utf8") : "";
|
|
112
112
|
let gitignoreUpdated = false;
|
|
113
113
|
if (!gitignoreCoversBoard(current)) {
|
|
114
|
-
|
|
114
|
+
const separator = current.length === 0 || current.endsWith("\n") ? "" : "\n";
|
|
115
|
+
writeFileSync(gitignore, `${current}${separator}${current.length > 0 ? "\n" : ""}# Agent board (warlock board)\n${BOARD_DIRECTORY}/\n`, "utf8");
|
|
115
116
|
gitignoreUpdated = true;
|
|
116
117
|
}
|
|
117
118
|
return {
|
|
@@ -377,7 +378,7 @@ async function watchBoard(options, cwd = process.cwd()) {
|
|
|
377
378
|
assertInitialized(cwd);
|
|
378
379
|
assertAgentName(options.agent);
|
|
379
380
|
const since = options.since ?? readBoardCursor(options.agent, cwd);
|
|
380
|
-
const timeoutMs = options.timeoutMs ??
|
|
381
|
+
const timeoutMs = options.timeoutMs ?? 6e5;
|
|
381
382
|
const intervalMs = options.intervalMs ?? 250;
|
|
382
383
|
const deadline = Date.now() + timeoutMs;
|
|
383
384
|
for (;;) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/board/board.ts"],"sourcesContent":["import {\n existsSync,\n mkdirSync,\n readdirSync,\n readFileSync,\n renameSync,\n writeFileSync,\n} from \"node:fs\";\nimport path from \"node:path\";\nimport { WarlockError } from \"../../errors/warlock-error\";\nimport { formatBoardMessage, parseBoardMessage } from \"./board-message\";\nimport {\n BOARD_DIRECTORY,\n BOARD_TRANSITIONS,\n type BoardInbox,\n type BoardItem,\n type BoardMessage,\n type BoardState,\n type BoardStatus,\n type BoardVerdict,\n isBoardState,\n} from \"./board.types\";\n\n/** Agent names: lower-case letters, digits and dashes, starting with a letter or digit. */\nconst AGENT_NAME = /^[a-z0-9][a-z0-9-]*$/;\n\n/** How many sequence numbers a writer tries before giving up on a contended slot. */\nconst MAX_ALLOCATION_ATTEMPTS = 1000;\n\n/** The marker file `init` writes; its presence is what \"initialized\" means. */\nconst BOARD_FILE = \"board.json\";\n\n/** What `initBoard` did. */\nexport type InitBoardResult = {\n /** The board directory, relative to the project root. */\n directory: string;\n /** `false` when the board already existed. */\n created: boolean;\n /** Whether `.warlock/board/` was added to `.gitignore` by this call. */\n gitignoreUpdated: boolean;\n};\n\n/** Inputs of {@link addBoardItem}. */\nexport type AddBoardItemInput = {\n title: string;\n assignee?: string | null;\n reviewer?: string | null;\n /** The agent creating it, recorded in the history. */\n by?: string | null;\n /** Clock, for tests. */\n now?: () => Date;\n};\n\n/** Inputs of {@link moveBoardItem}. */\nexport type MoveBoardItemOptions = {\n by?: string | null;\n note?: string | null;\n now?: () => Date;\n};\n\n/** Inputs of {@link sendBoardMessage}. */\nexport type SendBoardMessageInput = {\n to: string;\n from: string;\n subject: string;\n body?: string;\n /** The item the message is about. */\n item?: number | null;\n /** A review verdict; with `item`, also moves the item to that state. */\n verdict?: BoardVerdict | null;\n now?: () => Date;\n};\n\n/** What {@link sendBoardMessage} wrote. */\nexport type SendBoardMessageResult = {\n message: BoardMessage;\n /** The item after the verdict moved it, when the message carried one. */\n item: BoardItem | null;\n};\n\n/** Inputs of {@link watchBoard}. */\nexport type WatchBoardOptions = {\n agent: string;\n /** Return messages numbered above this. Default: the agent's cursor. */\n since?: number;\n /** Give up after this long; throws `WL7404`. Default: 10 minutes. */\n timeoutMs?: number;\n /** Poll interval. Default: 250 ms. */\n intervalMs?: number;\n /** Stop early (resolves with no messages). */\n signal?: AbortSignal;\n};\n\n/** What {@link watchBoard} returned. */\nexport type WatchBoardResult = {\n agent: string;\n /** The new messages, oldest first. */\n messages: BoardMessage[];\n /** The agent's cursor after the call. */\n cursor: number;\n};\n\nfunction boardRoot(cwd: string): string {\n return path.join(cwd, BOARD_DIRECTORY);\n}\n\nfunction toPosix(value: string): string {\n return value.split(path.sep).join(\"/\");\n}\n\nfunction pad(value: number): string {\n return String(value).padStart(4, \"0\");\n}\n\n/** A file-name slug: lower-case, dashes, at most 48 characters. */\nexport function boardSlug(value: string, fallback: string): string {\n const slug = value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 48)\n .replace(/-+$/g, \"\");\n\n return slug.length > 0 ? slug : fallback;\n}\n\n/** Throw unless `name` is a valid agent name. */\nexport function assertAgentName(name: string, label = \"agent\"): void {\n if (!AGENT_NAME.test(name)) {\n throw new Error(\n `Invalid ${label} name ${JSON.stringify(name)}: use lower-case letters, digits and dashes (e.g. \"reviewer\").`,\n );\n }\n}\n\nfunction isErrnoException(error: unknown): error is NodeJS.ErrnoException {\n return error instanceof Error && \"code\" in error;\n}\n\n/** Write a file through a temp file and a rename, so a reader never sees half of it. */\nfunction writeAtomic(file: string, content: string): void {\n const temporary = `${file}.${process.pid}.${Date.now()}.tmp`;\n\n writeFileSync(temporary, content, \"utf8\");\n renameSync(temporary, file);\n}\n\n/** The `NNNN` numbers of the files in a directory named `NNNN-…`. */\nfunction numberedEntries(directory: string, extension: string): { number: number; name: string }[] {\n if (!existsSync(directory)) return [];\n\n return readdirSync(directory)\n .filter((name) => !name.startsWith(\".\") && name.endsWith(extension))\n .flatMap((name) => {\n const match = /^(\\d+)-/.exec(name);\n return match?.[1] ? [{ number: Number.parseInt(match[1], 10), name }] : [];\n })\n .sort((first, second) => first.number - second.number);\n}\n\n/**\n * Reserve the next free sequence number in `directory` by creating\n * `.seq/NNNN` exclusively (`wx`). Two writers racing for the same number:\n * one gets `EEXIST` and moves on to the next, so numbers are never shared.\n */\nfunction reserveNumber(directory: string, start: number): number {\n const sequence = path.join(directory, \".seq\");\n\n mkdirSync(sequence, { recursive: true });\n\n for (let number = start, attempt = 0; attempt < MAX_ALLOCATION_ATTEMPTS; number++, attempt++) {\n try {\n writeFileSync(path.join(sequence, pad(number)), \"\", { flag: \"wx\" });\n return number;\n } catch (error) {\n if (isErrnoException(error) && error.code === \"EEXIST\") continue;\n throw error;\n }\n }\n\n throw new Error(`Could not allocate a sequence number in ${directory}.`);\n}\n\nfunction nextNumber(directory: string, extension: string): number {\n const entries = numberedEntries(directory, extension);\n const highest = entries[entries.length - 1]?.number ?? 0;\n\n return reserveNumber(directory, highest + 1);\n}\n\n/** Throw `WL7401` unless the board exists. */\nfunction assertInitialized(cwd: string): string {\n const root = boardRoot(cwd);\n\n if (!existsSync(path.join(root, BOARD_FILE))) {\n throw new WarlockError(\n \"WL7401\",\n `No agent board in ${BOARD_DIRECTORY}. Run \\`warlock board init\\` at the project root.`,\n );\n }\n\n return root;\n}\n\n/** Whether a `.gitignore` already ignores the board folder (or `.warlock` as a whole). */\nexport function gitignoreCoversBoard(content: string): boolean {\n const covering = new Set([\n \".warlock\",\n \".warlock/\",\n \"/.warlock\",\n \"/.warlock/\",\n \".warlock/*\",\n \"/.warlock/*\",\n \".warlock/board\",\n \".warlock/board/\",\n \"/.warlock/board\",\n \"/.warlock/board/\",\n ]);\n\n return content.split(/\\r?\\n/).some((line) => covering.has(line.trim()));\n}\n\n/**\n * Create the board (idempotent): `.warlock/board/` with its `board.json`\n * marker, `items/`, and `.warlock/board/` in `.gitignore` unless the project\n * already ignores it. A `.gitignore` is created when there is none.\n */\nexport function initBoard(\n cwd = process.cwd(),\n now: () => Date = () => new Date(),\n): InitBoardResult {\n const root = boardRoot(cwd);\n const marker = path.join(root, BOARD_FILE);\n const created = !existsSync(marker);\n\n mkdirSync(path.join(root, \"items\"), { recursive: true });\n mkdirSync(path.join(root, \"cursors\"), { recursive: true });\n\n if (created) {\n writeAtomic(\n marker,\n `${JSON.stringify({ schemaVersion: 1, createdAt: now().toISOString() }, null, 2)}\\n`,\n );\n }\n\n const gitignore = path.join(cwd, \".gitignore\");\n const current = existsSync(gitignore) ? readFileSync(gitignore, \"utf8\") : \"\";\n let gitignoreUpdated = false;\n\n if (!gitignoreCoversBoard(current)) {\n const separator = current.length === 0 || current.endsWith(\"\\n\") ? \"\" : \"\\n\";\n\n writeFileSync(\n gitignore,\n `${current}${separator}${current.length > 0 ? \"\\n\" : \"\"}# Agent board (warlock board)\\n${BOARD_DIRECTORY}/\\n`,\n \"utf8\",\n );\n gitignoreUpdated = true;\n }\n\n return { directory: BOARD_DIRECTORY, created, gitignoreUpdated };\n}\n\nfunction parseItem(value: unknown): BoardItem | undefined {\n if (typeof value !== \"object\" || value === null) return undefined;\n\n const id = Reflect.get(value, \"id\");\n const title = Reflect.get(value, \"title\");\n const state = Reflect.get(value, \"state\");\n\n if (typeof id !== \"number\" || typeof title !== \"string\") return undefined;\n if (typeof state !== \"string\" || !isBoardState(state)) return undefined;\n\n const text = (key: string): string | null => {\n const field = Reflect.get(value, key);\n return typeof field === \"string\" ? field : null;\n };\n const history = Reflect.get(value, \"history\");\n\n return {\n id,\n title,\n state,\n assignee: text(\"assignee\"),\n reviewer: text(\"reviewer\"),\n createdAt: text(\"createdAt\") ?? \"\",\n updatedAt: text(\"updatedAt\") ?? \"\",\n history: Array.isArray(history)\n ? history.flatMap((entry: unknown) => {\n if (typeof entry !== \"object\" || entry === null) return [];\n\n const from = Reflect.get(entry, \"from\");\n const to = Reflect.get(entry, \"to\");\n const by = Reflect.get(entry, \"by\");\n const at = Reflect.get(entry, \"at\");\n const note = Reflect.get(entry, \"note\");\n\n if (typeof to !== \"string\" || !isBoardState(to)) return [];\n\n return [\n {\n from: typeof from === \"string\" && isBoardState(from) ? from : null,\n to,\n by: typeof by === \"string\" ? by : null,\n at: typeof at === \"string\" ? at : \"\",\n note: typeof note === \"string\" ? note : null,\n },\n ];\n })\n : [],\n };\n}\n\nfunction itemFile(root: string, id: number): string | undefined {\n const entry = numberedEntries(path.join(root, \"items\"), \".json\").find(\n (candidate) => candidate.number === id,\n );\n\n return entry ? path.join(root, \"items\", entry.name) : undefined;\n}\n\n/** Every item, by id. Throws `WL7401` when the board does not exist. */\nexport function listBoardItems(cwd = process.cwd()): BoardItem[] {\n const root = assertInitialized(cwd);\n const directory = path.join(root, \"items\");\n\n return numberedEntries(directory, \".json\").flatMap(({ name }) => {\n try {\n const item = parseItem(JSON.parse(readFileSync(path.join(directory, name), \"utf8\")));\n return item ? [item] : [];\n } catch {\n return [];\n }\n });\n}\n\n/** One item. Throws `WL7402` for an unknown id. */\nexport function readBoardItem(id: number, cwd = process.cwd()): BoardItem {\n const root = assertInitialized(cwd);\n const file = itemFile(root, id);\n const item = file ? parseItem(JSON.parse(readFileSync(file, \"utf8\"))) : undefined;\n\n if (!item) {\n throw new WarlockError(\n \"WL7402\",\n `Board item ${id} does not exist. Run \\`warlock board status\\` to list the items.`,\n );\n }\n\n return item;\n}\n\n/** Add an item in state `todo`, with a fresh id no other writer can take. */\nexport function addBoardItem(input: AddBoardItemInput, cwd = process.cwd()): BoardItem {\n const root = assertInitialized(cwd);\n const title = input.title.replace(/[\\r\\n]+/g, \" \").trim();\n\n if (title.length === 0) throw new Error(\"A board item needs a title.\");\n\n for (const [label, name] of [\n [\"assignee\", input.assignee],\n [\"reviewer\", input.reviewer],\n [\"by\", input.by],\n ] as const) {\n if (name) assertAgentName(name, label);\n }\n\n const directory = path.join(root, \"items\");\n const id = nextNumber(directory, \".json\");\n const at = (input.now ?? (() => new Date()))().toISOString();\n const item: BoardItem = {\n id,\n title,\n state: \"todo\",\n assignee: input.assignee ?? null,\n reviewer: input.reviewer ?? null,\n createdAt: at,\n updatedAt: at,\n history: [{ from: null, to: \"todo\", by: input.by ?? null, at, note: null }],\n };\n\n writeAtomic(\n path.join(directory, `${pad(id)}-${boardSlug(title, \"item\")}.json`),\n `${JSON.stringify(item, null, 2)}\\n`,\n );\n\n return item;\n}\n\n/** The states an item in `state` may move to. */\nexport function nextBoardStates(state: BoardState): readonly BoardState[] {\n return BOARD_TRANSITIONS[state];\n}\n\n/** Throw `WL7403` unless `from → to` is in {@link BOARD_TRANSITIONS}. */\nexport function assertBoardTransition(id: number, from: BoardState, to: BoardState): void {\n if (!BOARD_TRANSITIONS[from].includes(to)) {\n throw new WarlockError(\n \"WL7403\",\n `Board item ${id} is \"${from}\" and cannot move to \"${to}\". Allowed next states: ${BOARD_TRANSITIONS[from].join(\", \")}.`,\n );\n }\n}\n\n/**\n * Move an item to another state, recording who moved it and why. Throws\n * `WL7402` for an unknown id and `WL7403` for a move the state machine does\n * not allow.\n */\nexport function moveBoardItem(\n id: number,\n to: BoardState,\n options: MoveBoardItemOptions = {},\n cwd = process.cwd(),\n): BoardItem {\n const root = assertInitialized(cwd);\n const item = readBoardItem(id, cwd);\n const file = itemFile(root, id);\n\n if (options.by) assertAgentName(options.by, \"by\");\n\n assertBoardTransition(id, item.state, to);\n\n const at = (options.now ?? (() => new Date()))().toISOString();\n const moved: BoardItem = {\n ...item,\n state: to,\n updatedAt: at,\n history: [\n ...item.history,\n { from: item.state, to, by: options.by ?? null, at, note: options.note ?? null },\n ],\n };\n\n if (file) writeAtomic(file, `${JSON.stringify(moved, null, 2)}\\n`);\n\n return moved;\n}\n\nfunction inboxDirectory(root: string, agent: string): string {\n return path.join(root, `to-${agent}`);\n}\n\n/**\n * Write a message to `to-<agent>/NNNN-<slug>.md`. Messages are append-only:\n * the number is reserved exclusively and the file is created with `wx`, so it\n * is never rewritten. A verdict with an `item` also moves the item to\n * `approved` / `changes-requested` — before the message is written, so a\n * refused move (`WL7403`) leaves no message behind.\n */\nexport function sendBoardMessage(\n input: SendBoardMessageInput,\n cwd = process.cwd(),\n): SendBoardMessageResult {\n const root = assertInitialized(cwd);\n\n assertAgentName(input.to, \"recipient\");\n assertAgentName(input.from, \"sender\");\n\n const subject = input.subject.replace(/[\\r\\n]+/g, \" \").trim();\n\n if (subject.length === 0) throw new Error(\"A board message needs a subject.\");\n\n const itemId = input.item ?? null;\n const verdict = input.verdict ?? null;\n const now = input.now ?? (() => new Date());\n\n if (itemId !== null) readBoardItem(itemId, cwd);\n\n const item =\n itemId !== null && verdict !== null\n ? moveBoardItem(itemId, verdict, { by: input.from, note: subject, now }, cwd)\n : null;\n\n const directory = inboxDirectory(root, input.to);\n\n mkdirSync(directory, { recursive: true });\n\n const number = nextNumber(directory, \".md\");\n const at = now().toISOString();\n const name = `${pad(number)}-${boardSlug(subject, \"message\")}.md`;\n const file = path.join(directory, name);\n\n writeFileSync(\n file,\n formatBoardMessage(\n { from: input.from, to: input.to, item: itemId, subject, at },\n input.body ?? \"\",\n verdict,\n ),\n { encoding: \"utf8\", flag: \"wx\" },\n );\n\n return {\n message: {\n number,\n file: toPosix(path.relative(cwd, file)),\n from: input.from,\n to: input.to,\n item: itemId,\n subject,\n at,\n body: (input.body ?? \"\").replace(/\\s+$/, \"\"),\n verdict,\n },\n item,\n };\n}\n\n/** The messages in an agent's inbox numbered above `since`, oldest first. */\nexport function listBoardMessages(\n agent: string,\n options: { since?: number } = {},\n cwd = process.cwd(),\n): BoardMessage[] {\n const root = assertInitialized(cwd);\n\n assertAgentName(agent);\n\n const directory = inboxDirectory(root, agent);\n const since = options.since ?? 0;\n\n return numberedEntries(directory, \".md\")\n .filter((entry) => entry.number > since)\n .map(({ number, name }) => {\n const file = path.join(directory, name);\n const parsed = parseBoardMessage(readFileSync(file, \"utf8\"));\n\n return {\n number,\n file: toPosix(path.relative(cwd, file)),\n from: parsed.from,\n to: parsed.to || agent,\n item: parsed.item,\n subject: parsed.subject,\n at: parsed.at,\n body: parsed.body,\n verdict: parsed.verdict,\n };\n });\n}\n\n/** The highest message number `watch` has returned to `agent` (0 when none). */\nexport function readBoardCursor(agent: string, cwd = process.cwd()): number {\n const root = assertInitialized(cwd);\n\n assertAgentName(agent);\n\n const file = path.join(root, \"cursors\", agent);\n\n if (!existsSync(file)) return 0;\n\n const value = Number.parseInt(readFileSync(file, \"utf8\").trim(), 10);\n\n return Number.isInteger(value) && value > 0 ? value : 0;\n}\n\n/** Record that `agent` has seen messages up to `number`. Never moves the cursor back. */\nexport function writeBoardCursor(agent: string, number: number, cwd = process.cwd()): number {\n const root = assertInitialized(cwd);\n const current = readBoardCursor(agent, cwd);\n const next = Math.max(current, number);\n\n if (next !== current) {\n mkdirSync(path.join(root, \"cursors\"), { recursive: true });\n writeAtomic(path.join(root, \"cursors\", agent), `${next}\\n`);\n }\n\n return next;\n}\n\n/** Every item and every inbox with its message count, cursor and unread count. */\nexport function readBoardStatus(cwd = process.cwd()): BoardStatus {\n const root = assertInitialized(cwd);\n const inboxes: BoardInbox[] = readdirSync(root, { withFileTypes: true })\n .filter((entry) => entry.isDirectory() && entry.name.startsWith(\"to-\"))\n .map((entry) => entry.name.slice(3))\n .filter((agent) => /^[a-z0-9][a-z0-9-]*$/.test(agent))\n .sort()\n .map((agent) => {\n const numbers = numberedEntries(inboxDirectory(root, agent), \".md\").map(\n (entry) => entry.number,\n );\n const cursor = readBoardCursor(agent, cwd);\n\n return {\n agent,\n messages: numbers.length,\n cursor,\n unread: numbers.filter((number) => number > cursor).length,\n };\n });\n\n return { schemaVersion: 1, items: listBoardItems(cwd), inboxes };\n}\n\n/**\n * Block until `agent` has a message numbered above `since` (default: its\n * cursor), then return every such message and advance the cursor past them.\n *\n * Polls the inbox every `intervalMs`; throws `WL7404` when `timeoutMs` passes\n * first. An aborted `signal` resolves with no messages.\n */\nexport async function watchBoard(\n options: WatchBoardOptions,\n cwd = process.cwd(),\n): Promise<WatchBoardResult> {\n assertInitialized(cwd);\n assertAgentName(options.agent);\n\n const since = options.since ?? readBoardCursor(options.agent, cwd);\n const timeoutMs = options.timeoutMs ?? 10 * 60 * 1000;\n const intervalMs = options.intervalMs ?? 250;\n const deadline = Date.now() + timeoutMs;\n\n for (;;) {\n const messages = listBoardMessages(options.agent, { since }, cwd);\n\n if (messages.length > 0) {\n const newest = messages[messages.length - 1]?.number ?? since;\n\n return {\n agent: options.agent,\n messages,\n cursor: writeBoardCursor(options.agent, newest, cwd),\n };\n }\n\n if (options.signal?.aborted) {\n return { agent: options.agent, messages: [], cursor: readBoardCursor(options.agent, cwd) };\n }\n\n const remaining = deadline - Date.now();\n\n if (remaining <= 0) {\n throw new WarlockError(\n \"WL7404\",\n `No new message for \"${options.agent}\" after ${Math.round(timeoutMs / 1000)}s (watching messages above #${since}).`,\n );\n }\n\n await new Promise((resolve) => setTimeout(resolve, Math.min(intervalMs, remaining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AAI;EAEtC,IAAI,aAAa,GACf,MAAM,IAAI,aACR,UACA,uBAAuB,QAAQ,MAAM,UAAU,KAAK,MAAM,YAAY,GAAI,EAAE,8BAA8B,MAAM,GAClH;EAGF,MAAM,IAAI,SAAS,YAAY,WAAW,SAAS,KAAK,IAAI,YAAY,SAAS,CAAC,CAAC;CACrF;AACF"}
|
|
1
|
+
{"version":3,"file":"board.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/board/board.ts"],"sourcesContent":["import {\n existsSync,\n mkdirSync,\n readdirSync,\n readFileSync,\n renameSync,\n writeFileSync,\n} from \"node:fs\";\nimport path from \"node:path\";\nimport { WarlockError } from \"../../errors/warlock-error\";\nimport { formatBoardMessage, parseBoardMessage } from \"./board-message\";\nimport {\n BOARD_DIRECTORY,\n BOARD_TRANSITIONS,\n type BoardInbox,\n type BoardItem,\n type BoardMessage,\n type BoardState,\n type BoardStatus,\n type BoardVerdict,\n isBoardState,\n} from \"./board.types\";\n\n/** Agent names: lower-case letters, digits and dashes, starting with a letter or digit. */\nconst AGENT_NAME = /^[a-z0-9][a-z0-9-]*$/;\n\n/** How many sequence numbers a writer tries before giving up on a contended slot. */\nconst MAX_ALLOCATION_ATTEMPTS = 1000;\n\n/** The marker file `init` writes; its presence is what \"initialized\" means. */\nconst BOARD_FILE = \"board.json\";\n\n/** What `initBoard` did. */\nexport type InitBoardResult = {\n /** The board directory, relative to the project root. */\n directory: string;\n /** `false` when the board already existed. */\n created: boolean;\n /** Whether `.warlock/board/` was added to `.gitignore` by this call. */\n gitignoreUpdated: boolean;\n};\n\n/** Inputs of {@link addBoardItem}. */\nexport type AddBoardItemInput = {\n title: string;\n assignee?: string | null;\n reviewer?: string | null;\n /** The agent creating it, recorded in the history. */\n by?: string | null;\n /** Clock, for tests. */\n now?: () => Date;\n};\n\n/** Inputs of {@link moveBoardItem}. */\nexport type MoveBoardItemOptions = {\n by?: string | null;\n note?: string | null;\n now?: () => Date;\n};\n\n/** Inputs of {@link sendBoardMessage}. */\nexport type SendBoardMessageInput = {\n to: string;\n from: string;\n subject: string;\n body?: string;\n /** The item the message is about. */\n item?: number | null;\n /** A review verdict; with `item`, also moves the item to that state. */\n verdict?: BoardVerdict | null;\n now?: () => Date;\n};\n\n/** What {@link sendBoardMessage} wrote. */\nexport type SendBoardMessageResult = {\n message: BoardMessage;\n /** The item after the verdict moved it, when the message carried one. */\n item: BoardItem | null;\n};\n\n/** Inputs of {@link watchBoard}. */\nexport type WatchBoardOptions = {\n agent: string;\n /** Return messages numbered above this. Default: the agent's cursor. */\n since?: number;\n /** Give up after this long; throws `WL7404`. Default: 10 minutes. */\n timeoutMs?: number;\n /** Poll interval. Default: 250 ms. */\n intervalMs?: number;\n /** Stop early (resolves with no messages). */\n signal?: AbortSignal;\n};\n\n/** What {@link watchBoard} returned. */\nexport type WatchBoardResult = {\n agent: string;\n /** The new messages, oldest first. */\n messages: BoardMessage[];\n /** The agent's cursor after the call. */\n cursor: number;\n};\n\nfunction boardRoot(cwd: string): string {\n return path.join(cwd, BOARD_DIRECTORY);\n}\n\nfunction toPosix(value: string): string {\n return value.split(path.sep).join(\"/\");\n}\n\nfunction pad(value: number): string {\n return String(value).padStart(4, \"0\");\n}\n\n/** A file-name slug: lower-case, dashes, at most 48 characters. */\nexport function boardSlug(value: string, fallback: string): string {\n const slug = value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n .slice(0, 48)\n .replace(/-+$/g, \"\");\n\n return slug.length > 0 ? slug : fallback;\n}\n\n/** Throw unless `name` is a valid agent name. */\nexport function assertAgentName(name: string, label = \"agent\"): void {\n if (!AGENT_NAME.test(name)) {\n throw new Error(\n `Invalid ${label} name ${JSON.stringify(name)}: use lower-case letters, digits and dashes (e.g. \"reviewer\").`,\n );\n }\n}\n\nfunction isErrnoException(error: unknown): error is NodeJS.ErrnoException {\n return error instanceof Error && \"code\" in error;\n}\n\n/** Write a file through a temp file and a rename, so a reader never sees half of it. */\nfunction writeAtomic(file: string, content: string): void {\n const temporary = `${file}.${process.pid}.${Date.now()}.tmp`;\n\n writeFileSync(temporary, content, \"utf8\");\n renameSync(temporary, file);\n}\n\n/** The `NNNN` numbers of the files in a directory named `NNNN-…`. */\nfunction numberedEntries(directory: string, extension: string): { number: number; name: string }[] {\n if (!existsSync(directory)) return [];\n\n return readdirSync(directory)\n .filter((name) => !name.startsWith(\".\") && name.endsWith(extension))\n .flatMap((name) => {\n const match = /^(\\d+)-/.exec(name);\n return match?.[1] ? [{ number: Number.parseInt(match[1], 10), name }] : [];\n })\n .sort((first, second) => first.number - second.number);\n}\n\n/**\n * Reserve the next free sequence number in `directory` by creating\n * `.seq/NNNN` exclusively (`wx`). Two writers racing for the same number:\n * one gets `EEXIST` and moves on to the next, so numbers are never shared.\n */\nfunction reserveNumber(directory: string, start: number): number {\n const sequence = path.join(directory, \".seq\");\n\n mkdirSync(sequence, { recursive: true });\n\n for (let number = start, attempt = 0; attempt < MAX_ALLOCATION_ATTEMPTS; number++, attempt++) {\n try {\n writeFileSync(path.join(sequence, pad(number)), \"\", { flag: \"wx\" });\n return number;\n } catch (error) {\n if (isErrnoException(error) && error.code === \"EEXIST\") continue;\n throw error;\n }\n }\n\n throw new Error(`Could not allocate a sequence number in ${directory}.`);\n}\n\nfunction nextNumber(directory: string, extension: string): number {\n const entries = numberedEntries(directory, extension);\n const highest = entries[entries.length - 1]?.number ?? 0;\n\n return reserveNumber(directory, highest + 1);\n}\n\n/** Throw `WL7401` unless the board exists. */\nfunction assertInitialized(cwd: string): string {\n const root = boardRoot(cwd);\n\n if (!existsSync(path.join(root, BOARD_FILE))) {\n throw new WarlockError(\n \"WL7401\",\n `No agent board in ${BOARD_DIRECTORY}. Run \\`warlock board init\\` at the project root.`,\n );\n }\n\n return root;\n}\n\n/** Whether a `.gitignore` already ignores the board folder (or `.warlock` as a whole). */\nexport function gitignoreCoversBoard(content: string): boolean {\n const covering = new Set([\n \".warlock\",\n \".warlock/\",\n \"/.warlock\",\n \"/.warlock/\",\n \".warlock/*\",\n \"/.warlock/*\",\n \".warlock/board\",\n \".warlock/board/\",\n \"/.warlock/board\",\n \"/.warlock/board/\",\n ]);\n\n return content.split(/\\r?\\n/).some((line) => covering.has(line.trim()));\n}\n\n/**\n * Create the board (idempotent): `.warlock/board/` with its `board.json`\n * marker, `items/`, and `.warlock/board/` in `.gitignore` unless the project\n * already ignores it. A `.gitignore` is created when there is none.\n */\nexport function initBoard(\n cwd = process.cwd(),\n now: () => Date = () => new Date(),\n): InitBoardResult {\n const root = boardRoot(cwd);\n const marker = path.join(root, BOARD_FILE);\n const created = !existsSync(marker);\n\n mkdirSync(path.join(root, \"items\"), { recursive: true });\n mkdirSync(path.join(root, \"cursors\"), { recursive: true });\n\n if (created) {\n writeAtomic(\n marker,\n `${JSON.stringify({ schemaVersion: 1, createdAt: now().toISOString() }, null, 2)}\\n`,\n );\n }\n\n const gitignore = path.join(cwd, \".gitignore\");\n const current = existsSync(gitignore) ? readFileSync(gitignore, \"utf8\") : \"\";\n let gitignoreUpdated = false;\n\n if (!gitignoreCoversBoard(current)) {\n const separator = current.length === 0 || current.endsWith(\"\\n\") ? \"\" : \"\\n\";\n\n writeFileSync(\n gitignore,\n `${current}${separator}${current.length > 0 ? \"\\n\" : \"\"}# Agent board (warlock board)\\n${BOARD_DIRECTORY}/\\n`,\n \"utf8\",\n );\n gitignoreUpdated = true;\n }\n\n return { directory: BOARD_DIRECTORY, created, gitignoreUpdated };\n}\n\nfunction parseItem(value: unknown): BoardItem | undefined {\n if (typeof value !== \"object\" || value === null) return undefined;\n\n const id = Reflect.get(value, \"id\");\n const title = Reflect.get(value, \"title\");\n const state = Reflect.get(value, \"state\");\n\n if (typeof id !== \"number\" || typeof title !== \"string\") return undefined;\n if (typeof state !== \"string\" || !isBoardState(state)) return undefined;\n\n const text = (key: string): string | null => {\n const field = Reflect.get(value, key);\n return typeof field === \"string\" ? field : null;\n };\n const history = Reflect.get(value, \"history\");\n\n return {\n id,\n title,\n state,\n assignee: text(\"assignee\"),\n reviewer: text(\"reviewer\"),\n createdAt: text(\"createdAt\") ?? \"\",\n updatedAt: text(\"updatedAt\") ?? \"\",\n history: Array.isArray(history)\n ? history.flatMap((entry: unknown) => {\n if (typeof entry !== \"object\" || entry === null) return [];\n\n const from = Reflect.get(entry, \"from\");\n const to = Reflect.get(entry, \"to\");\n const by = Reflect.get(entry, \"by\");\n const at = Reflect.get(entry, \"at\");\n const note = Reflect.get(entry, \"note\");\n\n if (typeof to !== \"string\" || !isBoardState(to)) return [];\n\n return [\n {\n from: typeof from === \"string\" && isBoardState(from) ? from : null,\n to,\n by: typeof by === \"string\" ? by : null,\n at: typeof at === \"string\" ? at : \"\",\n note: typeof note === \"string\" ? note : null,\n },\n ];\n })\n : [],\n };\n}\n\nfunction itemFile(root: string, id: number): string | undefined {\n const entry = numberedEntries(path.join(root, \"items\"), \".json\").find(\n (candidate) => candidate.number === id,\n );\n\n return entry ? path.join(root, \"items\", entry.name) : undefined;\n}\n\n/** Every item, by id. Throws `WL7401` when the board does not exist. */\nexport function listBoardItems(cwd = process.cwd()): BoardItem[] {\n const root = assertInitialized(cwd);\n const directory = path.join(root, \"items\");\n\n return numberedEntries(directory, \".json\").flatMap(({ name }) => {\n try {\n const item = parseItem(JSON.parse(readFileSync(path.join(directory, name), \"utf8\")));\n return item ? [item] : [];\n } catch {\n return [];\n }\n });\n}\n\n/** One item. Throws `WL7402` for an unknown id. */\nexport function readBoardItem(id: number, cwd = process.cwd()): BoardItem {\n const root = assertInitialized(cwd);\n const file = itemFile(root, id);\n const item = file ? parseItem(JSON.parse(readFileSync(file, \"utf8\"))) : undefined;\n\n if (!item) {\n throw new WarlockError(\n \"WL7402\",\n `Board item ${id} does not exist. Run \\`warlock board status\\` to list the items.`,\n );\n }\n\n return item;\n}\n\n/** Add an item in state `todo`, with a fresh id no other writer can take. */\nexport function addBoardItem(input: AddBoardItemInput, cwd = process.cwd()): BoardItem {\n const root = assertInitialized(cwd);\n const title = input.title.replace(/[\\r\\n]+/g, \" \").trim();\n\n if (title.length === 0) throw new Error(\"A board item needs a title.\");\n\n for (const [label, name] of [\n [\"assignee\", input.assignee],\n [\"reviewer\", input.reviewer],\n [\"by\", input.by],\n ] as const) {\n if (name) assertAgentName(name, label);\n }\n\n const directory = path.join(root, \"items\");\n const id = nextNumber(directory, \".json\");\n const at = (input.now ?? (() => new Date()))().toISOString();\n const item: BoardItem = {\n id,\n title,\n state: \"todo\",\n assignee: input.assignee ?? null,\n reviewer: input.reviewer ?? null,\n createdAt: at,\n updatedAt: at,\n history: [{ from: null, to: \"todo\", by: input.by ?? null, at, note: null }],\n };\n\n writeAtomic(\n path.join(directory, `${pad(id)}-${boardSlug(title, \"item\")}.json`),\n `${JSON.stringify(item, null, 2)}\\n`,\n );\n\n return item;\n}\n\n/** The states an item in `state` may move to. */\nexport function nextBoardStates(state: BoardState): readonly BoardState[] {\n return BOARD_TRANSITIONS[state];\n}\n\n/** Throw `WL7403` unless `from → to` is in {@link BOARD_TRANSITIONS}. */\nexport function assertBoardTransition(id: number, from: BoardState, to: BoardState): void {\n if (!BOARD_TRANSITIONS[from].includes(to)) {\n throw new WarlockError(\n \"WL7403\",\n `Board item ${id} is \"${from}\" and cannot move to \"${to}\". Allowed next states: ${BOARD_TRANSITIONS[from].join(\", \")}.`,\n );\n }\n}\n\n/**\n * Move an item to another state, recording who moved it and why. Throws\n * `WL7402` for an unknown id and `WL7403` for a move the state machine does\n * not allow.\n */\nexport function moveBoardItem(\n id: number,\n to: BoardState,\n options: MoveBoardItemOptions = {},\n cwd = process.cwd(),\n): BoardItem {\n const root = assertInitialized(cwd);\n const item = readBoardItem(id, cwd);\n const file = itemFile(root, id);\n\n if (options.by) assertAgentName(options.by, \"by\");\n\n assertBoardTransition(id, item.state, to);\n\n const at = (options.now ?? (() => new Date()))().toISOString();\n const moved: BoardItem = {\n ...item,\n state: to,\n updatedAt: at,\n history: [\n ...item.history,\n { from: item.state, to, by: options.by ?? null, at, note: options.note ?? null },\n ],\n };\n\n if (file) writeAtomic(file, `${JSON.stringify(moved, null, 2)}\\n`);\n\n return moved;\n}\n\nfunction inboxDirectory(root: string, agent: string): string {\n return path.join(root, `to-${agent}`);\n}\n\n/**\n * Write a message to `to-<agent>/NNNN-<slug>.md`. Messages are append-only:\n * the number is reserved exclusively and the file is created with `wx`, so it\n * is never rewritten. A verdict with an `item` also moves the item to\n * `approved` / `changes-requested` — before the message is written, so a\n * refused move (`WL7403`) leaves no message behind.\n */\nexport function sendBoardMessage(\n input: SendBoardMessageInput,\n cwd = process.cwd(),\n): SendBoardMessageResult {\n const root = assertInitialized(cwd);\n\n assertAgentName(input.to, \"recipient\");\n assertAgentName(input.from, \"sender\");\n\n const subject = input.subject.replace(/[\\r\\n]+/g, \" \").trim();\n\n if (subject.length === 0) throw new Error(\"A board message needs a subject.\");\n\n const itemId = input.item ?? null;\n const verdict = input.verdict ?? null;\n const now = input.now ?? (() => new Date());\n\n if (itemId !== null) readBoardItem(itemId, cwd);\n\n const item =\n itemId !== null && verdict !== null\n ? moveBoardItem(itemId, verdict, { by: input.from, note: subject, now }, cwd)\n : null;\n\n const directory = inboxDirectory(root, input.to);\n\n mkdirSync(directory, { recursive: true });\n\n const number = nextNumber(directory, \".md\");\n const at = now().toISOString();\n const name = `${pad(number)}-${boardSlug(subject, \"message\")}.md`;\n const file = path.join(directory, name);\n\n writeFileSync(\n file,\n formatBoardMessage(\n { from: input.from, to: input.to, item: itemId, subject, at },\n input.body ?? \"\",\n verdict,\n ),\n { encoding: \"utf8\", flag: \"wx\" },\n );\n\n return {\n message: {\n number,\n file: toPosix(path.relative(cwd, file)),\n from: input.from,\n to: input.to,\n item: itemId,\n subject,\n at,\n body: (input.body ?? \"\").replace(/\\s+$/, \"\"),\n verdict,\n },\n item,\n };\n}\n\n/** The messages in an agent's inbox numbered above `since`, oldest first. */\nexport function listBoardMessages(\n agent: string,\n options: { since?: number } = {},\n cwd = process.cwd(),\n): BoardMessage[] {\n const root = assertInitialized(cwd);\n\n assertAgentName(agent);\n\n const directory = inboxDirectory(root, agent);\n const since = options.since ?? 0;\n\n return numberedEntries(directory, \".md\")\n .filter((entry) => entry.number > since)\n .map(({ number, name }) => {\n const file = path.join(directory, name);\n const parsed = parseBoardMessage(readFileSync(file, \"utf8\"));\n\n return {\n number,\n file: toPosix(path.relative(cwd, file)),\n from: parsed.from,\n to: parsed.to || agent,\n item: parsed.item,\n subject: parsed.subject,\n at: parsed.at,\n body: parsed.body,\n verdict: parsed.verdict,\n };\n });\n}\n\n/** The highest message number `watch` has returned to `agent` (0 when none). */\nexport function readBoardCursor(agent: string, cwd = process.cwd()): number {\n const root = assertInitialized(cwd);\n\n assertAgentName(agent);\n\n const file = path.join(root, \"cursors\", agent);\n\n if (!existsSync(file)) return 0;\n\n const value = Number.parseInt(readFileSync(file, \"utf8\").trim(), 10);\n\n return Number.isInteger(value) && value > 0 ? value : 0;\n}\n\n/** Record that `agent` has seen messages up to `number`. Never moves the cursor back. */\nexport function writeBoardCursor(agent: string, number: number, cwd = process.cwd()): number {\n const root = assertInitialized(cwd);\n const current = readBoardCursor(agent, cwd);\n const next = Math.max(current, number);\n\n if (next !== current) {\n mkdirSync(path.join(root, \"cursors\"), { recursive: true });\n writeAtomic(path.join(root, \"cursors\", agent), `${next}\\n`);\n }\n\n return next;\n}\n\n/** Every item and every inbox with its message count, cursor and unread count. */\nexport function readBoardStatus(cwd = process.cwd()): BoardStatus {\n const root = assertInitialized(cwd);\n const inboxes: BoardInbox[] = readdirSync(root, { withFileTypes: true })\n .filter((entry) => entry.isDirectory() && entry.name.startsWith(\"to-\"))\n .map((entry) => entry.name.slice(3))\n .filter((agent) => /^[a-z0-9][a-z0-9-]*$/.test(agent))\n .sort()\n .map((agent) => {\n const numbers = numberedEntries(inboxDirectory(root, agent), \".md\").map(\n (entry) => entry.number,\n );\n const cursor = readBoardCursor(agent, cwd);\n\n return {\n agent,\n messages: numbers.length,\n cursor,\n unread: numbers.filter((number) => number > cursor).length,\n };\n });\n\n return { schemaVersion: 1, items: listBoardItems(cwd), inboxes };\n}\n\n/**\n * Block until `agent` has a message numbered above `since` (default: its\n * cursor), then return every such message and advance the cursor past them.\n *\n * Polls the inbox every `intervalMs`; throws `WL7404` when `timeoutMs` passes\n * first. An aborted `signal` resolves with no messages.\n */\nexport async function watchBoard(\n options: WatchBoardOptions,\n cwd = process.cwd(),\n): Promise<WatchBoardResult> {\n assertInitialized(cwd);\n assertAgentName(options.agent);\n\n const since = options.since ?? readBoardCursor(options.agent, cwd);\n const timeoutMs = options.timeoutMs ?? 10 * 60 * 1000;\n const intervalMs = options.intervalMs ?? 250;\n const deadline = Date.now() + timeoutMs;\n\n for (;;) {\n const messages = listBoardMessages(options.agent, { since }, cwd);\n\n if (messages.length > 0) {\n const newest = messages[messages.length - 1]?.number ?? since;\n\n return {\n agent: options.agent,\n messages,\n cursor: writeBoardCursor(options.agent, newest, cwd),\n };\n }\n\n if (options.signal?.aborted) {\n return { agent: options.agent, messages: [], cursor: readBoardCursor(options.agent, cwd) };\n }\n\n const remaining = deadline - Date.now();\n\n if (remaining <= 0) {\n throw new WarlockError(\n \"WL7404\",\n `No new message for \"${options.agent}\" after ${Math.round(timeoutMs / 1000)}s (watching messages above #${since}).`,\n );\n }\n\n await new Promise((resolve) => setTimeout(resolve, Math.min(intervalMs, remaining)));\n }\n}\n"],"mappings":";;;;;;;;AAwBA,MAAM,aAAa;;AAGnB,MAAM,0BAA0B;;AAGhC,MAAM,aAAa;AAwEnB,SAAS,UAAU,KAAqB;CACtC,OAAO,KAAK,KAAK,KAAK,eAAe;AACvC;AAEA,SAAS,QAAQ,OAAuB;CACtC,OAAO,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG;AACvC;AAEA,SAAS,IAAI,OAAuB;CAClC,OAAO,OAAO,KAAK,CAAC,CAAC,SAAS,GAAG,GAAG;AACtC;;AAGA,SAAgB,UAAU,OAAe,UAA0B;CACjE,MAAM,OAAO,MACV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AO;GACL;GACA,UAAU,QAAQ;GAClB;GACA,QAAQ,QAAQ,QAAQ,WAAW,SAAS,MAAM,CAAC,CAAC;EACtD;CACF,CAAC;CAEH,OAAO;EAAE,eAAe;EAAG,OAAO,eAAe,GAAG;EAAG;CAAQ;AACjE;;;;;;;;AASA,eAAsB,WACpB,SACA,MAAM,QAAQ,IAAI,GACS;CAC3B,kBAAkB,GAAG;CACrB,gBAAgB,QAAQ,KAAK;CAE7B,MAAM,QAAQ,QAAQ,SAAS,gBAAgB,QAAQ,OAAO,GAAG;CACjE,MAAM,YAAY,QAAQ,aAAa;CACvC,MAAM,aAAa,QAAQ,cAAc;CACzC,MAAM,WAAW,KAAK,IAAI,IAAI;CAE9B,SAAS;EACP,MAAM,WAAW,kBAAkB,QAAQ,OAAO,EAAE,MAAM,GAAG,GAAG;EAEhE,IAAI,SAAS,SAAS,GAAG;GACvB,MAAM,SAAS,SAAS,SAAS,SAAS,EAAE,EAAE,UAAU;GAExD,OAAO;IACL,OAAO,QAAQ;IACf;IACA,QAAQ,iBAAiB,QAAQ,OAAO,QAAQ,GAAG;GACrD;EACF;EAEA,IAAI,QAAQ,QAAQ,SAClB,OAAO;GAAE,OAAO,QAAQ;GAAO,UAAU,CAAC;GAAG,QAAQ,gBAAgB,QAAQ,OAAO,GAAG;EAAE;EAG3F,MAAM,YAAY,WAAW,KAAK,IAAI;EAEtC,IAAI,aAAa,GACf,MAAM,IAAI,aACR,UACA,uBAAuB,QAAQ,MAAM,UAAU,KAAK,MAAM,YAAY,GAAI,EAAE,8BAA8B,MAAM,GAClH;EAGF,MAAM,IAAI,SAAS,YAAY,WAAW,SAAS,KAAK,IAAI,YAAY,SAAS,CAAC,CAAC;CACrF;AACF"}
|
|
@@ -5,30 +5,33 @@
|
|
|
5
5
|
* reviewer — share to track work items and exchange append-only messages.
|
|
6
6
|
*/
|
|
7
7
|
/** Where the board lives, under the project root. */
|
|
8
|
-
declare const BOARD_DIRECTORY = ".warlock/board";
|
|
8
|
+
export declare const BOARD_DIRECTORY = ".warlock/board";
|
|
9
9
|
/** Every state an item can be in. */
|
|
10
|
-
declare const BOARD_STATES: readonly ["todo", "in-progress", "ready-for-review", "changes-requested", "approved", "blocked"];
|
|
10
|
+
export declare const BOARD_STATES: readonly ["todo", "in-progress", "ready-for-review", "changes-requested", "approved", "blocked"];
|
|
11
11
|
/** One item state. */
|
|
12
|
-
type BoardState = (typeof BOARD_STATES)[number];
|
|
12
|
+
export type BoardState = (typeof BOARD_STATES)[number];
|
|
13
13
|
/**
|
|
14
14
|
* The allowed moves: an item in the key state may move to any listed state,
|
|
15
15
|
* and nowhere else. `approved` may only be reopened (`in-progress`).
|
|
16
16
|
*/
|
|
17
|
-
declare const BOARD_TRANSITIONS: Readonly<Record<BoardState, readonly BoardState[]>>;
|
|
17
|
+
export declare const BOARD_TRANSITIONS: Readonly<Record<BoardState, readonly BoardState[]>>;
|
|
18
18
|
/** A review verdict a message can carry. */
|
|
19
|
-
type BoardVerdict = "approved" | "changes-requested";
|
|
19
|
+
export type BoardVerdict = "approved" | "changes-requested";
|
|
20
20
|
/** The exact final line each verdict is written as. */
|
|
21
|
-
declare const BOARD_VERDICT_LINES: Readonly<Record<BoardVerdict, string>>;
|
|
21
|
+
export declare const BOARD_VERDICT_LINES: Readonly<Record<BoardVerdict, string>>;
|
|
22
22
|
/** One recorded state change of an item. */
|
|
23
|
-
type BoardHistoryEntry = {
|
|
24
|
-
/** `null` for the creation entry. */
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
export type BoardHistoryEntry = {
|
|
24
|
+
/** `null` for the creation entry. */
|
|
25
|
+
from: BoardState | null;
|
|
26
|
+
to: BoardState;
|
|
27
|
+
/** The agent that made the move, or `null` when not given. */
|
|
28
|
+
by: string | null;
|
|
29
|
+
/** ISO time. */
|
|
27
30
|
at: string;
|
|
28
31
|
note: string | null;
|
|
29
32
|
};
|
|
30
33
|
/** One work item, stored as `items/NNNN-<slug>.json`. */
|
|
31
|
-
type BoardItem = {
|
|
34
|
+
export type BoardItem = {
|
|
32
35
|
id: number;
|
|
33
36
|
title: string;
|
|
34
37
|
state: BoardState;
|
|
@@ -39,34 +42,40 @@ type BoardItem = {
|
|
|
39
42
|
history: BoardHistoryEntry[];
|
|
40
43
|
};
|
|
41
44
|
/** One message, stored as `to-<agent>/NNNN-<slug>.md`. */
|
|
42
|
-
type BoardMessage = {
|
|
43
|
-
/** The per-recipient sequence number (`NNNN`). */
|
|
45
|
+
export type BoardMessage = {
|
|
46
|
+
/** The per-recipient sequence number (`NNNN`). */
|
|
47
|
+
number: number;
|
|
48
|
+
/** Path relative to the project root, POSIX separators. */
|
|
44
49
|
file: string;
|
|
45
50
|
from: string;
|
|
46
|
-
to: string;
|
|
51
|
+
to: string;
|
|
52
|
+
/** The item the message is about, or `null`. */
|
|
47
53
|
item: number | null;
|
|
48
|
-
subject: string;
|
|
54
|
+
subject: string;
|
|
55
|
+
/** ISO time. */
|
|
49
56
|
at: string;
|
|
50
57
|
body: string;
|
|
51
58
|
verdict: BoardVerdict | null;
|
|
52
59
|
};
|
|
53
60
|
/** One recipient's inbox, as `readBoardStatus` reports it. */
|
|
54
|
-
type BoardInbox = {
|
|
55
|
-
agent: string;
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
export type BoardInbox = {
|
|
62
|
+
agent: string;
|
|
63
|
+
/** Messages in the inbox. */
|
|
64
|
+
messages: number;
|
|
65
|
+
/** The highest message number `watch` has returned to this agent (0 = none). */
|
|
66
|
+
cursor: number;
|
|
67
|
+
/** Messages numbered above the cursor. */
|
|
58
68
|
unread: number;
|
|
59
69
|
};
|
|
60
70
|
/** What `warlock board status --json` prints without an item id. */
|
|
61
|
-
type BoardStatus = {
|
|
71
|
+
export type BoardStatus = {
|
|
62
72
|
schemaVersion: 1;
|
|
63
73
|
items: BoardItem[];
|
|
64
74
|
inboxes: BoardInbox[];
|
|
65
75
|
};
|
|
66
76
|
/** Whether a string is a board state. */
|
|
67
|
-
declare function isBoardState(value: string): value is BoardState;
|
|
77
|
+
export declare function isBoardState(value: string): value is BoardState;
|
|
68
78
|
/** Whether a string is a verdict. */
|
|
69
|
-
declare function isBoardVerdict(value: string): value is BoardVerdict;
|
|
79
|
+
export declare function isBoardVerdict(value: string): value is BoardVerdict;
|
|
70
80
|
//#endregion
|
|
71
|
-
export { BOARD_DIRECTORY, BOARD_STATES, BOARD_TRANSITIONS, BOARD_VERDICT_LINES, BoardHistoryEntry, BoardInbox, BoardItem, BoardMessage, BoardState, BoardStatus, BoardVerdict, isBoardState, isBoardVerdict };
|
|
72
81
|
//# sourceMappingURL=board.types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board.types.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/board/board.types.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"board.types.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/board/board.types.ts"],"mappings":";;;;;;;qBAOa;;qBAGA;;YAUD,qBAAqB;;;;;qBAMpB,mBAAmB,SAAS,OAAO,qBAAqB;;YAUzD;;qBAGC,qBAAqB,SAAS,OAAO;;YAMtC;;EAEV,MAAM;EACN,IAAI;;EAEJ;;EAEA;EACA;;;YAIU;EACV;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;EACA,SAAS;;;YAIC;;EAEV;;EAEA;EACA;EACA;;EAEA;EACA;;EAEA;EACA;EACA,SAAS;;;YAIC;EACV;;EAEA;;EAEA;;EAEA;;;YAIU;EACV;EACA,OAAO;EACP,SAAS;;;wBAIK,aAAa,gBAAgB,SAAS;;wBAKtC,eAAe,gBAAgB,SAAS"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { ToolingProblem } from "../problem.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/tooling/check/changed-files.d.ts
|
|
4
3
|
/** The result of one git invocation. */
|
|
5
|
-
type GitResult = {
|
|
4
|
+
export type GitResult = {
|
|
6
5
|
code: number;
|
|
7
6
|
stdout: string;
|
|
8
7
|
stderr: string;
|
|
9
8
|
};
|
|
10
9
|
/** Runs `git <args>` in `cwd`. Injectable so tests need no repository. */
|
|
11
|
-
type GitRunner = (args: readonly string[], cwd: string) => Promise<GitResult>;
|
|
10
|
+
export type GitRunner = (args: readonly string[], cwd: string) => Promise<GitResult>;
|
|
12
11
|
/** The default {@link GitRunner}: the `git` on PATH. */
|
|
13
|
-
declare const runGit: GitRunner;
|
|
12
|
+
export declare const runGit: GitRunner;
|
|
14
13
|
/**
|
|
15
14
|
* The source files changed in the working tree — tracked changes against
|
|
16
15
|
* `base` (or HEAD) plus untracked files — relative to `cwd`, existing only.
|
|
@@ -19,7 +18,7 @@ declare const runGit: GitRunner;
|
|
|
19
18
|
* branch is compared with where it left `base` rather than with `base`'s tip.
|
|
20
19
|
* A git failure is a `WL8006` environment problem.
|
|
21
20
|
*/
|
|
22
|
-
declare function listChangedFiles(options: {
|
|
21
|
+
export declare function listChangedFiles(options: {
|
|
23
22
|
cwd: string;
|
|
24
23
|
base?: string;
|
|
25
24
|
git?: GitRunner;
|
|
@@ -29,5 +28,4 @@ declare function listChangedFiles(options: {
|
|
|
29
28
|
problem: ToolingProblem;
|
|
30
29
|
}>;
|
|
31
30
|
//#endregion
|
|
32
|
-
export { GitResult, GitRunner, listChangedFiles, runGit };
|
|
33
31
|
//# sourceMappingURL=changed-files.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changed-files.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/changed-files.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"changed-files.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/changed-files.ts"],"mappings":";;;YAMY;EAAc;EAAc;EAAgB;;;YAG5C,aAAa,yBAAyB,gBAAgB,QAAQ;;qBAG7D,QAAQ;;;;;;;;;wBAoCC,iBAAiB;EACrC;EACA;EACA,MAAM;IACJ;EAAU;;EAAsB,SAAS"}
|
|
@@ -10,7 +10,7 @@ const runGit = (args, cwd) => new Promise((resolve) => {
|
|
|
10
10
|
cwd,
|
|
11
11
|
encoding: "utf8",
|
|
12
12
|
windowsHide: true,
|
|
13
|
-
maxBuffer:
|
|
13
|
+
maxBuffer: 16777216
|
|
14
14
|
}, (error, stdout, stderr) => {
|
|
15
15
|
resolve({
|
|
16
16
|
code: error === null ? 0 : typeof error.code === "number" ? error.code : 127,
|
|
@@ -65,7 +65,7 @@ async function listChangedFiles(options) {
|
|
|
65
65
|
"--exclude-standard"
|
|
66
66
|
], options.cwd);
|
|
67
67
|
if (untracked.code !== 0) return { problem: gitProblem(`git ls-files failed: ${untracked.stderr.trim() || `exit ${untracked.code}`}`) };
|
|
68
|
-
return { files: [
|
|
68
|
+
return { files: [.../* @__PURE__ */ new Set([...lines(diff.stdout), ...lines(untracked.stdout)])].map((file) => file.split(path.sep).join("/")).filter((file) => SOURCE_FILE.test(file) && existsSync(path.join(options.cwd, file))).sort() };
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changed-files.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/changed-files.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { createProblem, type ToolingProblem } from \"../problem\";\n\n/** The result of one git invocation. */\nexport type GitResult = { code: number; stdout: string; stderr: string };\n\n/** Runs `git <args>` in `cwd`. Injectable so tests need no repository. */\nexport type GitRunner = (args: readonly string[], cwd: string) => Promise<GitResult>;\n\n/** The default {@link GitRunner}: the `git` on PATH. */\nexport const runGit: GitRunner = (args, cwd) =>\n new Promise((resolve) => {\n execFile(\n \"git\",\n [...args],\n { cwd, encoding: \"utf8\", windowsHide: true, maxBuffer: 16 * 1024 * 1024 },\n (error, stdout, stderr) => {\n const code = error === null ? 0 : typeof error.code === \"number\" ? error.code : 127;\n\n resolve({ code, stdout, stderr: stderr || (error?.message ?? \"\") });\n },\n );\n });\n\n/** Files `warlock check --changed` considers: JavaScript and TypeScript sources. */\nconst SOURCE_FILE = /\\.(?:[cm]?[jt]sx?)$/i;\n\nfunction lines(output: string): string[] {\n return output\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n}\n\nfunction gitProblem(message: string): ToolingProblem {\n return createProblem({ code: \"WL8006\", source: \"environment\", message });\n}\n\n/**\n * The source files changed in the working tree — tracked changes against\n * `base` (or HEAD) plus untracked files — relative to `cwd`, existing only.\n *\n * With `base`, the comparison point is `git merge-base <base> HEAD`, so a\n * branch is compared with where it left `base` rather than with `base`'s tip.\n * A git failure is a `WL8006` environment problem.\n */\nexport async function listChangedFiles(options: {\n cwd: string;\n base?: string;\n git?: GitRunner;\n}): Promise<{ files: string[] } | { problem: ToolingProblem }> {\n const git = options.git ?? runGit;\n let ref = \"HEAD\";\n\n if (options.base) {\n const mergeBase = await git([\"merge-base\", options.base, \"HEAD\"], options.cwd);\n\n if (mergeBase.code !== 0) {\n return {\n problem: gitProblem(\n `git merge-base ${options.base} HEAD failed: ${mergeBase.stderr.trim() || `exit ${mergeBase.code}`}`,\n ),\n };\n }\n\n ref = mergeBase.stdout.trim();\n }\n\n // `--relative` makes the paths relative to cwd and limits them to it.\n const diff = await git(\n [\"diff\", \"--name-only\", \"--relative\", \"--diff-filter=ACMR\", ref],\n options.cwd,\n );\n\n if (diff.code !== 0) {\n return {\n problem: gitProblem(\n `git diff against ${ref} failed: ${diff.stderr.trim() || `exit ${diff.code}`}`,\n ),\n };\n }\n\n const untracked = await git([\"ls-files\", \"--others\", \"--exclude-standard\"], options.cwd);\n\n if (untracked.code !== 0) {\n return {\n problem: gitProblem(\n `git ls-files failed: ${untracked.stderr.trim() || `exit ${untracked.code}`}`,\n ),\n };\n }\n\n const files = [...new Set([...lines(diff.stdout), ...lines(untracked.stdout)])]\n .map((file) => file.split(path.sep).join(\"/\"))\n .filter((file) => SOURCE_FILE.test(file) && existsSync(path.join(options.cwd, file)))\n .sort();\n\n return { files };\n}\n"],"mappings":";;;;;;;AAYA,MAAa,UAAqB,MAAM,QACtC,IAAI,SAAS,YAAY;CACvB,SACE,OACA,CAAC,GAAG,IAAI,GACR;EAAE;EAAK,UAAU;EAAQ,aAAa;EAAM,WAAW
|
|
1
|
+
{"version":3,"file":"changed-files.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/changed-files.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { createProblem, type ToolingProblem } from \"../problem\";\n\n/** The result of one git invocation. */\nexport type GitResult = { code: number; stdout: string; stderr: string };\n\n/** Runs `git <args>` in `cwd`. Injectable so tests need no repository. */\nexport type GitRunner = (args: readonly string[], cwd: string) => Promise<GitResult>;\n\n/** The default {@link GitRunner}: the `git` on PATH. */\nexport const runGit: GitRunner = (args, cwd) =>\n new Promise((resolve) => {\n execFile(\n \"git\",\n [...args],\n { cwd, encoding: \"utf8\", windowsHide: true, maxBuffer: 16 * 1024 * 1024 },\n (error, stdout, stderr) => {\n const code = error === null ? 0 : typeof error.code === \"number\" ? error.code : 127;\n\n resolve({ code, stdout, stderr: stderr || (error?.message ?? \"\") });\n },\n );\n });\n\n/** Files `warlock check --changed` considers: JavaScript and TypeScript sources. */\nconst SOURCE_FILE = /\\.(?:[cm]?[jt]sx?)$/i;\n\nfunction lines(output: string): string[] {\n return output\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n}\n\nfunction gitProblem(message: string): ToolingProblem {\n return createProblem({ code: \"WL8006\", source: \"environment\", message });\n}\n\n/**\n * The source files changed in the working tree — tracked changes against\n * `base` (or HEAD) plus untracked files — relative to `cwd`, existing only.\n *\n * With `base`, the comparison point is `git merge-base <base> HEAD`, so a\n * branch is compared with where it left `base` rather than with `base`'s tip.\n * A git failure is a `WL8006` environment problem.\n */\nexport async function listChangedFiles(options: {\n cwd: string;\n base?: string;\n git?: GitRunner;\n}): Promise<{ files: string[] } | { problem: ToolingProblem }> {\n const git = options.git ?? runGit;\n let ref = \"HEAD\";\n\n if (options.base) {\n const mergeBase = await git([\"merge-base\", options.base, \"HEAD\"], options.cwd);\n\n if (mergeBase.code !== 0) {\n return {\n problem: gitProblem(\n `git merge-base ${options.base} HEAD failed: ${mergeBase.stderr.trim() || `exit ${mergeBase.code}`}`,\n ),\n };\n }\n\n ref = mergeBase.stdout.trim();\n }\n\n // `--relative` makes the paths relative to cwd and limits them to it.\n const diff = await git(\n [\"diff\", \"--name-only\", \"--relative\", \"--diff-filter=ACMR\", ref],\n options.cwd,\n );\n\n if (diff.code !== 0) {\n return {\n problem: gitProblem(\n `git diff against ${ref} failed: ${diff.stderr.trim() || `exit ${diff.code}`}`,\n ),\n };\n }\n\n const untracked = await git([\"ls-files\", \"--others\", \"--exclude-standard\"], options.cwd);\n\n if (untracked.code !== 0) {\n return {\n problem: gitProblem(\n `git ls-files failed: ${untracked.stderr.trim() || `exit ${untracked.code}`}`,\n ),\n };\n }\n\n const files = [...new Set([...lines(diff.stdout), ...lines(untracked.stdout)])]\n .map((file) => file.split(path.sep).join(\"/\"))\n .filter((file) => SOURCE_FILE.test(file) && existsSync(path.join(options.cwd, file)))\n .sort();\n\n return { files };\n}\n"],"mappings":";;;;;;;AAYA,MAAa,UAAqB,MAAM,QACtC,IAAI,SAAS,YAAY;CACvB,SACE,OACA,CAAC,GAAG,IAAI,GACR;EAAE;EAAK,UAAU;EAAQ,aAAa;EAAM,WAAW;CAAiB,IACvE,OAAO,QAAQ,WAAW;EAGzB,QAAQ;GAAE,MAFG,UAAU,OAAO,IAAI,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO;GAEhE;GAAQ,QAAQ,WAAW,OAAO,WAAW;EAAI,CAAC;CACpE,CACF;AACF,CAAC;;AAGH,MAAM,cAAc;AAEpB,SAAS,MAAM,QAA0B;CACvC,OAAO,OACJ,MAAM,OAAO,CAAC,CACd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,CAAC,CAAC,CACpF,KAEU,EAAE;AACjB"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { ToolingProblem } from "../problem.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/tooling/check/check-report.types.d.ts
|
|
4
3
|
/** The steps `warlock check` runs, in order. */
|
|
5
|
-
declare const CHECK_STEPS: readonly ["environment", "typecheck", "lint", "tests", "conventions"];
|
|
4
|
+
export declare const CHECK_STEPS: readonly ["environment", "typecheck", "lint", "tests", "conventions"];
|
|
6
5
|
/** One step name. */
|
|
7
|
-
type CheckStepName = (typeof CHECK_STEPS)[number];
|
|
6
|
+
export type CheckStepName = (typeof CHECK_STEPS)[number];
|
|
8
7
|
/**
|
|
9
8
|
* - `passed`: ran and found no error.
|
|
10
9
|
* - `failed`: ran and found at least one error-severity problem.
|
|
11
10
|
* - `skipped`: does not apply (no lint config, no tests, nothing changed, `--skip`).
|
|
12
11
|
* - `blocked`: could not run because of this machine; an environment problem says why.
|
|
13
12
|
*/
|
|
14
|
-
type CheckStepStatus = "passed" | "failed" | "skipped" | "blocked";
|
|
13
|
+
export type CheckStepStatus = "passed" | "failed" | "skipped" | "blocked";
|
|
15
14
|
/** One step of the report. */
|
|
16
|
-
type CheckStep = {
|
|
15
|
+
export type CheckStep = {
|
|
17
16
|
name: CheckStepName;
|
|
18
17
|
status: CheckStepStatus;
|
|
19
|
-
durationMs: number;
|
|
18
|
+
durationMs: number;
|
|
19
|
+
/** One line on what the step did or why it did not run, or `null`. */
|
|
20
20
|
detail: string | null;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
@@ -32,31 +32,36 @@ type CheckStep = {
|
|
|
32
32
|
* 2 wins over 1: when the machine kept a step from running, the run did not
|
|
33
33
|
* check everything, so "only your code is wrong" cannot be claimed.
|
|
34
34
|
*/
|
|
35
|
-
declare const CHECK_EXIT_CODES: {
|
|
35
|
+
export declare const CHECK_EXIT_CODES: {
|
|
36
36
|
readonly ok: 0;
|
|
37
37
|
readonly code: 1;
|
|
38
38
|
readonly environment: 2;
|
|
39
39
|
};
|
|
40
40
|
/** One of {@link CHECK_EXIT_CODES}. */
|
|
41
|
-
type CheckExitCode = (typeof CHECK_EXIT_CODES)[keyof typeof CHECK_EXIT_CODES];
|
|
41
|
+
export type CheckExitCode = (typeof CHECK_EXIT_CODES)[keyof typeof CHECK_EXIT_CODES];
|
|
42
42
|
/** The exit code for a set of problems; see {@link CHECK_EXIT_CODES}. */
|
|
43
|
-
declare function checkExitCode(problems: readonly ToolingProblem[]): CheckExitCode;
|
|
43
|
+
export declare function checkExitCode(problems: readonly ToolingProblem[]): CheckExitCode;
|
|
44
44
|
/** What `warlock check --json` prints. */
|
|
45
|
-
type CheckReport = {
|
|
46
|
-
schemaVersion: 1;
|
|
45
|
+
export type CheckReport = {
|
|
46
|
+
schemaVersion: 1;
|
|
47
|
+
/** `true` when the exit code is 0. */
|
|
47
48
|
ok: boolean;
|
|
48
|
-
exitCode: CheckExitCode;
|
|
49
|
-
|
|
49
|
+
exitCode: CheckExitCode;
|
|
50
|
+
/** Whether the run was limited to changed files. */
|
|
51
|
+
changed: boolean;
|
|
52
|
+
/** The changed files the run was limited to (project-relative), or `null` for a full run. */
|
|
50
53
|
files: string[] | null;
|
|
51
|
-
steps: CheckStep[];
|
|
54
|
+
steps: CheckStep[];
|
|
55
|
+
/** One entry per problem, in step order. */
|
|
52
56
|
problems: ToolingProblem[];
|
|
53
57
|
summary: {
|
|
54
58
|
errors: number;
|
|
55
|
-
warnings: number;
|
|
56
|
-
|
|
59
|
+
warnings: number;
|
|
60
|
+
/** Error-severity problems in the code. */
|
|
61
|
+
code: number;
|
|
62
|
+
/** Error-severity problems with the machine. */
|
|
57
63
|
environment: number;
|
|
58
64
|
};
|
|
59
65
|
};
|
|
60
66
|
//#endregion
|
|
61
|
-
export { CHECK_EXIT_CODES, CHECK_STEPS, CheckExitCode, CheckReport, CheckStep, CheckStepName, CheckStepStatus, checkExitCode };
|
|
62
67
|
//# sourceMappingURL=check-report.types.d.mts.map
|