@deftai/directive 0.125.2 → 0.126.0-beta.2
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/bin/deft-hook +14 -0
- package/bin/deft-hook.cmd +14 -0
- package/dist/bin.js +4333 -3
- package/package.json +12 -23
- package/dist/agents-refresh.d.ts +0 -11
- package/dist/agents-refresh.js +0 -90
- package/dist/authz.d.ts +0 -7
- package/dist/authz.js +0 -732
- package/dist/bin.d.ts +0 -3
- package/dist/branch-fixtures.d.ts +0 -45
- package/dist/branch-fixtures.js +0 -156
- package/dist/cache.d.ts +0 -4
- package/dist/cache.js +0 -10
- package/dist/capacity-backfill.d.ts +0 -3
- package/dist/capacity-backfill.js +0 -9
- package/dist/capacity-show.d.ts +0 -3
- package/dist/capacity-show.js +0 -9
- package/dist/change-init.d.ts +0 -3
- package/dist/change-init.js +0 -59
- package/dist/changelog-check.d.ts +0 -3
- package/dist/changelog-check.js +0 -52
- package/dist/check.d.ts +0 -15
- package/dist/check.js +0 -150
- package/dist/cli-package-version.d.ts +0 -3
- package/dist/cli-package-version.js +0 -23
- package/dist/cli-router/index.d.ts +0 -8
- package/dist/cli-router/index.js +0 -44
- package/dist/cli-router/route-argv.d.ts +0 -40
- package/dist/cli-router/route-argv.js +0 -371
- package/dist/codebase-default-extractor.d.ts +0 -3
- package/dist/codebase-default-extractor.js +0 -9
- package/dist/codebase-map-fresh.d.ts +0 -3
- package/dist/codebase-map-fresh.js +0 -9
- package/dist/codebase-map.d.ts +0 -3
- package/dist/codebase-map.js +0 -9
- package/dist/codebase-projection-registry.d.ts +0 -3
- package/dist/codebase-projection-registry.js +0 -9
- package/dist/codebase-provider.d.ts +0 -3
- package/dist/codebase-provider.js +0 -9
- package/dist/commit-lint.d.ts +0 -3
- package/dist/commit-lint.js +0 -44
- package/dist/content-validate-cli/validate-links.d.ts +0 -11
- package/dist/content-validate-cli/validate-links.js +0 -37
- package/dist/content-validate-cli/validate-strategy-output.d.ts +0 -13
- package/dist/content-validate-cli/validate-strategy-output.js +0 -56
- package/dist/content-validate-cli/verify-capacity.d.ts +0 -12
- package/dist/content-validate-cli/verify-capacity.js +0 -54
- package/dist/coverage-hotspots.d.ts +0 -18
- package/dist/coverage-hotspots.js +0 -158
- package/dist/design-critique-spend-resolve.d.ts +0 -18
- package/dist/design-critique-spend-resolve.js +0 -191
- package/dist/directive-finish-loop.d.ts +0 -3
- package/dist/directive-finish-loop.js +0 -10
- package/dist/dispatch.d.ts +0 -193
- package/dist/dispatch.js +0 -3082
- package/dist/doctor.d.ts +0 -19
- package/dist/doctor.js +0 -155
- package/dist/entrypoint.d.ts +0 -6
- package/dist/entrypoint.js +0 -19
- package/dist/escalation-cli.d.ts +0 -4
- package/dist/escalation-cli.js +0 -301
- package/dist/eval-health.d.ts +0 -13
- package/dist/eval-health.js +0 -63
- package/dist/eval-report.d.ts +0 -15
- package/dist/eval-report.js +0 -97
- package/dist/eval-run.d.ts +0 -17
- package/dist/eval-run.js +0 -122
- package/dist/eval-triggers.d.ts +0 -12
- package/dist/eval-triggers.js +0 -56
- package/dist/framework-check-updates.d.ts +0 -10
- package/dist/framework-check-updates.js +0 -68
- package/dist/gates-cli/_helpers.d.ts +0 -24
- package/dist/gates-cli/_helpers.js +0 -115
- package/dist/gates-cli/verify-bridge-drift.d.ts +0 -11
- package/dist/gates-cli/verify-bridge-drift.js +0 -47
- package/dist/gates-cli/verify-go-freeze.d.ts +0 -11
- package/dist/gates-cli/verify-go-freeze.js +0 -48
- package/dist/hook-bin.d.ts +0 -3
- package/dist/hook-bin.js +0 -11
- package/dist/hook-dispatch.d.ts +0 -80
- package/dist/hook-dispatch.js +0 -186
- package/dist/human-presence-mint.d.ts +0 -70
- package/dist/human-presence-mint.js +0 -204
- package/dist/identity-banner.d.ts +0 -13
- package/dist/identity-banner.js +0 -19
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -14
- package/dist/init-cli/constants.d.ts +0 -42
- package/dist/init-cli/constants.js +0 -42
- package/dist/init-cli/help.d.ts +0 -9
- package/dist/init-cli/help.js +0 -43
- package/dist/init-cli/init.d.ts +0 -26
- package/dist/init-cli/init.js +0 -80
- package/dist/init-cli/migrate.d.ts +0 -3
- package/dist/init-cli/migrate.js +0 -51
- package/dist/init-cli/resolve-binary.d.ts +0 -34
- package/dist/init-cli/resolve-binary.js +0 -78
- package/dist/init-cli/run-deft-install.d.ts +0 -23
- package/dist/init-cli/run-deft-install.js +0 -71
- package/dist/init-cli/update.d.ts +0 -5
- package/dist/init-cli/update.js +0 -38
- package/dist/install-cli/coverage-map.d.ts +0 -14
- package/dist/install-cli/coverage-map.js +0 -113
- package/dist/install-uninstall.d.ts +0 -3
- package/dist/install-uninstall.js +0 -44
- package/dist/install-upgrade.d.ts +0 -41
- package/dist/install-upgrade.js +0 -86
- package/dist/lifecycle-cli/coverage-map.d.ts +0 -16
- package/dist/lifecycle-cli/coverage-map.js +0 -254
- package/dist/lifecycle-cli/helpers.d.ts +0 -8
- package/dist/lifecycle-cli/helpers.js +0 -20
- package/dist/lifecycle-event.d.ts +0 -11
- package/dist/lifecycle-event.js +0 -45
- package/dist/lifecycle-stats.d.ts +0 -12
- package/dist/lifecycle-stats.js +0 -100
- package/dist/migrate-category-b.d.ts +0 -9
- package/dist/migrate-category-b.js +0 -52
- package/dist/migrate-preflight.d.ts +0 -10
- package/dist/migrate-preflight.js +0 -85
- package/dist/migrate-xbrief.d.ts +0 -11
- package/dist/migrate-xbrief.js +0 -88
- package/dist/occupancy-grant.d.ts +0 -18
- package/dist/occupancy-grant.js +0 -121
- package/dist/occupancy-heartbeat.d.ts +0 -8
- package/dist/occupancy-heartbeat.js +0 -63
- package/dist/occupancy-release.d.ts +0 -18
- package/dist/occupancy-release.js +0 -94
- package/dist/occupancy-steal.d.ts +0 -10
- package/dist/occupancy-steal.js +0 -83
- package/dist/occupancy-unrecognized.d.ts +0 -3
- package/dist/occupancy-unrecognized.js +0 -5
- package/dist/orchestration-cli/coverage-map.d.ts +0 -21
- package/dist/orchestration-cli/coverage-map.js +0 -225
- package/dist/orchestration-cli/helpers.d.ts +0 -11
- package/dist/orchestration-cli/helpers.js +0 -35
- package/dist/ownership-doctor.d.ts +0 -10
- package/dist/ownership-doctor.js +0 -96
- package/dist/ownership-fix.d.ts +0 -10
- package/dist/ownership-fix.js +0 -93
- package/dist/plan-sequence.d.ts +0 -13
- package/dist/plan-sequence.js +0 -196
- package/dist/policy-fixtures.d.ts +0 -33
- package/dist/policy-fixtures.js +0 -118
- package/dist/policy.d.ts +0 -35
- package/dist/policy.js +0 -738
- package/dist/pr-closing-keywords.d.ts +0 -3
- package/dist/pr-closing-keywords.js +0 -10
- package/dist/pr-finish-loop.d.ts +0 -3
- package/dist/pr-finish-loop.js +0 -10
- package/dist/pr-merge-readiness.d.ts +0 -3
- package/dist/pr-merge-readiness.js +0 -10
- package/dist/pr-monitor.d.ts +0 -3
- package/dist/pr-monitor.js +0 -10
- package/dist/pr-protected-issues.d.ts +0 -3
- package/dist/pr-protected-issues.js +0 -10
- package/dist/pr-wait-mergeable.d.ts +0 -3
- package/dist/pr-wait-mergeable.js +0 -10
- package/dist/pr-watch.d.ts +0 -3
- package/dist/pr-watch.js +0 -10
- package/dist/pre-pr-run.d.ts +0 -39
- package/dist/pre-pr-run.js +0 -514
- package/dist/preflight-cache.d.ts +0 -18
- package/dist/preflight-cache.js +0 -113
- package/dist/preflight-gh.d.ts +0 -15
- package/dist/preflight-gh.js +0 -143
- package/dist/probe-session.d.ts +0 -3
- package/dist/probe-session.js +0 -10
- package/dist/release-e2e-fixtures.d.ts +0 -29
- package/dist/release-e2e-fixtures.js +0 -38
- package/dist/release-e2e.d.ts +0 -3
- package/dist/release-e2e.js +0 -10
- package/dist/release-publish.d.ts +0 -3
- package/dist/release-publish.js +0 -10
- package/dist/release-rollback.d.ts +0 -3
- package/dist/release-rollback.js +0 -10
- package/dist/release-wait-npm.d.ts +0 -3
- package/dist/release-wait-npm.js +0 -10
- package/dist/release.d.ts +0 -3
- package/dist/release.js +0 -10
- package/dist/render-cli/deft-ts-runner.d.ts +0 -17
- package/dist/render-cli/deft-ts-runner.js +0 -19
- package/dist/render-cli/export-spec-cli.d.ts +0 -2
- package/dist/render-cli/export-spec-cli.js +0 -6
- package/dist/render-cli/prd-render-cli.d.ts +0 -2
- package/dist/render-cli/prd-render-cli.js +0 -37
- package/dist/render-cli/project-render-cli.d.ts +0 -2
- package/dist/render-cli/project-render-cli.js +0 -6
- package/dist/render-cli/rule-map-cli.d.ts +0 -2
- package/dist/render-cli/rule-map-cli.js +0 -5
- package/dist/render-cli/spec-reconstruct-cli.d.ts +0 -3
- package/dist/render-cli/spec-reconstruct-cli.js +0 -15
- package/dist/render-cli/spec-render-cli.d.ts +0 -2
- package/dist/render-cli/spec-render-cli.js +0 -39
- package/dist/render-cli/spec-validate-cli.d.ts +0 -2
- package/dist/render-cli/spec-validate-cli.js +0 -38
- package/dist/review-monitor-register.d.ts +0 -19
- package/dist/review-monitor-register.js +0 -183
- package/dist/review-monitor-release.d.ts +0 -14
- package/dist/review-monitor-release.js +0 -123
- package/dist/scm-sync-default.d.ts +0 -34
- package/dist/scm-sync-default.js +0 -210
- package/dist/scope-lifecycle.d.ts +0 -4
- package/dist/scope-lifecycle.js +0 -34
- package/dist/scope-record-approved-scope.d.ts +0 -29
- package/dist/scope-record-approved-scope.js +0 -319
- package/dist/scope-record-intent-constraint.d.ts +0 -16
- package/dist/scope-record-intent-constraint.js +0 -202
- package/dist/scope-record-observable-scope.d.ts +0 -16
- package/dist/scope-record-observable-scope.js +0 -204
- package/dist/session-ready.d.ts +0 -15
- package/dist/session-ready.js +0 -144
- package/dist/session-start.d.ts +0 -56
- package/dist/session-start.js +0 -554
- package/dist/slice.d.ts +0 -4
- package/dist/slice.js +0 -34
- package/dist/story-ready-fixtures.d.ts +0 -47
- package/dist/story-ready-fixtures.js +0 -137
- package/dist/subagent-monitor.d.ts +0 -3
- package/dist/subagent-monitor.js +0 -10
- package/dist/subagent-pre-cancel.d.ts +0 -21
- package/dist/subagent-pre-cancel.js +0 -240
- package/dist/subagent-steer-write.d.ts +0 -41
- package/dist/subagent-steer-write.js +0 -333
- package/dist/toolchain-check.d.ts +0 -8
- package/dist/toolchain-check.js +0 -54
- package/dist/triage-actions.d.ts +0 -23
- package/dist/triage-actions.js +0 -225
- package/dist/triage-aux-a-fixtures.d.ts +0 -33
- package/dist/triage-aux-a-fixtures.js +0 -107
- package/dist/triage-aux-b-fixtures.d.ts +0 -30
- package/dist/triage-aux-b-fixtures.js +0 -167
- package/dist/triage-bootstrap-fixtures.d.ts +0 -42
- package/dist/triage-bootstrap-fixtures.js +0 -139
- package/dist/triage-bootstrap.d.ts +0 -24
- package/dist/triage-bootstrap.js +0 -175
- package/dist/triage-bulk.d.ts +0 -17
- package/dist/triage-bulk.js +0 -154
- package/dist/triage-classify-fixtures.d.ts +0 -38
- package/dist/triage-classify-fixtures.js +0 -137
- package/dist/triage-classify.d.ts +0 -45
- package/dist/triage-classify.js +0 -287
- package/dist/triage-evaluate.d.ts +0 -14
- package/dist/triage-evaluate.js +0 -153
- package/dist/triage-help.d.ts +0 -3
- package/dist/triage-help.js +0 -10
- package/dist/triage-queue-fixtures.d.ts +0 -59
- package/dist/triage-queue-fixtures.js +0 -284
- package/dist/triage-queue.d.ts +0 -38
- package/dist/triage-queue.js +0 -391
- package/dist/triage-reconcile.d.ts +0 -11
- package/dist/triage-reconcile.js +0 -76
- package/dist/triage-refresh.d.ts +0 -7
- package/dist/triage-refresh.js +0 -37
- package/dist/triage-scope-drift.d.ts +0 -12
- package/dist/triage-scope-drift.js +0 -117
- package/dist/triage-scope-fixtures.d.ts +0 -32
- package/dist/triage-scope-fixtures.js +0 -131
- package/dist/triage-scope.d.ts +0 -4
- package/dist/triage-scope.js +0 -34
- package/dist/triage-smoketest.d.ts +0 -3
- package/dist/triage-smoketest.js +0 -43
- package/dist/triage-strip-withdrawn.d.ts +0 -21
- package/dist/triage-strip-withdrawn.js +0 -102
- package/dist/triage-subscribe.d.ts +0 -15
- package/dist/triage-subscribe.js +0 -157
- package/dist/triage-summary.d.ts +0 -14
- package/dist/triage-summary.js +0 -83
- package/dist/triage-welcome.d.ts +0 -14
- package/dist/triage-welcome.js +0 -121
- package/dist/ts-check-lane.d.ts +0 -9
- package/dist/ts-check-lane.js +0 -49
- package/dist/umbrella-current-shape.d.ts +0 -9
- package/dist/umbrella-current-shape.js +0 -56
- package/dist/vbrief-activate.d.ts +0 -3
- package/dist/vbrief-activate.js +0 -7
- package/dist/vbrief-build.d.ts +0 -3
- package/dist/vbrief-build.js +0 -8
- package/dist/vbrief-preflight-fixtures.d.ts +0 -32
- package/dist/vbrief-preflight-fixtures.js +0 -79
- package/dist/vbrief-preflight.d.ts +0 -13
- package/dist/vbrief-preflight.js +0 -141
- package/dist/vbrief-reconcile.d.ts +0 -3
- package/dist/vbrief-reconcile.js +0 -7
- package/dist/vbrief-validate.d.ts +0 -3
- package/dist/vbrief-validate.js +0 -8
- package/dist/vbrief-validation.d.ts +0 -3
- package/dist/vbrief-validation.js +0 -8
- package/dist/verify-ac.d.ts +0 -28
- package/dist/verify-ac.js +0 -439
- package/dist/verify-agents-md-advisory.d.ts +0 -19
- package/dist/verify-agents-md-advisory.js +0 -65
- package/dist/verify-agents-md-budget.d.ts +0 -12
- package/dist/verify-agents-md-budget.js +0 -71
- package/dist/verify-branch.d.ts +0 -14
- package/dist/verify-branch.js +0 -81
- package/dist/verify-class-checks.d.ts +0 -11
- package/dist/verify-class-checks.js +0 -71
- package/dist/verify-cohort-review-monitors.d.ts +0 -5
- package/dist/verify-cohort-review-monitors.js +0 -11
- package/dist/verify-completed-tracked.d.ts +0 -19
- package/dist/verify-completed-tracked.js +0 -202
- package/dist/verify-completed-write-guard.d.ts +0 -13
- package/dist/verify-completed-write-guard.js +0 -84
- package/dist/verify-consumer-check-contract.d.ts +0 -12
- package/dist/verify-consumer-check-contract.js +0 -70
- package/dist/verify-consumer-header-placeholder.d.ts +0 -12
- package/dist/verify-consumer-header-placeholder.js +0 -73
- package/dist/verify-consumer-test-lane.d.ts +0 -12
- package/dist/verify-consumer-test-lane.js +0 -57
- package/dist/verify-durable-effect-acquisition.d.ts +0 -13
- package/dist/verify-durable-effect-acquisition.js +0 -70
- package/dist/verify-encoding.d.ts +0 -15
- package/dist/verify-encoding.js +0 -83
- package/dist/verify-eval-health-relocation.d.ts +0 -16
- package/dist/verify-eval-health-relocation.js +0 -93
- package/dist/verify-eval-triggers-relocation.d.ts +0 -14
- package/dist/verify-eval-triggers-relocation.js +0 -74
- package/dist/verify-evaluator-surface.d.ts +0 -15
- package/dist/verify-evaluator-surface.js +0 -87
- package/dist/verify-forward-coverage.d.ts +0 -19
- package/dist/verify-forward-coverage.js +0 -144
- package/dist/verify-hooks-installed.d.ts +0 -24
- package/dist/verify-hooks-installed.js +0 -140
- package/dist/verify-intent-constraint.d.ts +0 -15
- package/dist/verify-intent-constraint.js +0 -86
- package/dist/verify-investigation.d.ts +0 -3
- package/dist/verify-investigation.js +0 -10
- package/dist/verify-judgment-gates.d.ts +0 -3
- package/dist/verify-judgment-gates.js +0 -10
- package/dist/verify-l4-owner.d.ts +0 -15
- package/dist/verify-l4-owner.js +0 -132
- package/dist/verify-lifecycle-visible.d.ts +0 -13
- package/dist/verify-lifecycle-visible.js +0 -68
- package/dist/verify-literal-ac.d.ts +0 -14
- package/dist/verify-literal-ac.js +0 -168
- package/dist/verify-no-task-runtime.d.ts +0 -3
- package/dist/verify-no-task-runtime.js +0 -16
- package/dist/verify-observable-scope.d.ts +0 -15
- package/dist/verify-observable-scope.js +0 -86
- package/dist/verify-operator-scope-limit.d.ts +0 -17
- package/dist/verify-operator-scope-limit.js +0 -285
- package/dist/verify-orphan-active.d.ts +0 -17
- package/dist/verify-orphan-active.js +0 -135
- package/dist/verify-ownership.d.ts +0 -10
- package/dist/verify-ownership.js +0 -90
- package/dist/verify-persisted-planning-narratives.d.ts +0 -12
- package/dist/verify-persisted-planning-narratives.js +0 -82
- package/dist/verify-plan-sequence.d.ts +0 -14
- package/dist/verify-plan-sequence.js +0 -138
- package/dist/verify-pr-closeout-attestable.d.ts +0 -15
- package/dist/verify-pr-closeout-attestable.js +0 -114
- package/dist/verify-presentation-ceiling.d.ts +0 -11
- package/dist/verify-presentation-ceiling.js +0 -71
- package/dist/verify-presentation-coverage.d.ts +0 -14
- package/dist/verify-presentation-coverage.js +0 -90
- package/dist/verify-review-monitor.d.ts +0 -25
- package/dist/verify-review-monitor.js +0 -341
- package/dist/verify-scope-provenance.d.ts +0 -16
- package/dist/verify-scope-provenance.js +0 -91
- package/dist/verify-session-ritual.d.ts +0 -23
- package/dist/verify-session-ritual.js +0 -144
- package/dist/verify-source-cli/rule-ownership-lint.d.ts +0 -12
- package/dist/verify-source-cli/rule-ownership-lint.js +0 -61
- package/dist/verify-source-cli/verify-biome-config.d.ts +0 -11
- package/dist/verify-source-cli/verify-biome-config.js +0 -46
- package/dist/verify-source-cli/verify-closing-keywords.d.ts +0 -35
- package/dist/verify-source-cli/verify-closing-keywords.js +0 -139
- package/dist/verify-source-cli/verify-consumer-hard-stops.d.ts +0 -16
- package/dist/verify-source-cli/verify-consumer-hard-stops.js +0 -99
- package/dist/verify-source-cli/verify-contained-writes.d.ts +0 -13
- package/dist/verify-source-cli/verify-contained-writes.js +0 -67
- package/dist/verify-source-cli/verify-content-manifest.d.ts +0 -12
- package/dist/verify-source-cli/verify-content-manifest.js +0 -61
- package/dist/verify-source-cli/verify-contract-drift.d.ts +0 -11
- package/dist/verify-source-cli/verify-contract-drift.js +0 -47
- package/dist/verify-source-cli/verify-cursor-tier1.d.ts +0 -12
- package/dist/verify-source-cli/verify-cursor-tier1.js +0 -51
- package/dist/verify-source-cli/verify-deposit-closure.d.ts +0 -12
- package/dist/verify-source-cli/verify-deposit-closure.js +0 -52
- package/dist/verify-source-cli/verify-openclaw-tier1.d.ts +0 -12
- package/dist/verify-source-cli/verify-openclaw-tier1.js +0 -51
- package/dist/verify-source-cli/verify-scm-boundary.d.ts +0 -13
- package/dist/verify-source-cli/verify-scm-boundary.js +0 -66
- package/dist/verify-source-cli/verify-semantic-single-source.d.ts +0 -11
- package/dist/verify-source-cli/verify-semantic-single-source.js +0 -49
- package/dist/verify-source-cli/verify-skill-external-fetch-gate.d.ts +0 -11
- package/dist/verify-source-cli/verify-skill-external-fetch-gate.js +0 -46
- package/dist/verify-source-cli/verify-spec-drift.d.ts +0 -3
- package/dist/verify-source-cli/verify-spec-drift.js +0 -15
- package/dist/verify-source-cli/verify-spec-prd-fresh.d.ts +0 -3
- package/dist/verify-source-cli/verify-spec-prd-fresh.js +0 -15
- package/dist/verify-source-cli/verify-stubs.d.ts +0 -11
- package/dist/verify-source-cli/verify-stubs.js +0 -27
- package/dist/verify-source-cli/verify-telemetry-coverage.d.ts +0 -13
- package/dist/verify-source-cli/verify-telemetry-coverage.js +0 -67
- package/dist/verify-source-cli/verify-xbrief-drift.d.ts +0 -15
- package/dist/verify-source-cli/verify-xbrief-drift.js +0 -80
- package/dist/verify-story-ready.d.ts +0 -18
- package/dist/verify-story-ready.js +0 -190
- package/dist/verify-subagent-alive.d.ts +0 -21
- package/dist/verify-subagent-alive.js +0 -219
- package/dist/verify-subagent-steer.d.ts +0 -19
- package/dist/verify-subagent-steer.js +0 -136
- package/dist/verify-test-boundary.d.ts +0 -12
- package/dist/verify-test-boundary.js +0 -80
- package/dist/verify-tools.d.ts +0 -13
- package/dist/verify-tools.js +0 -67
- package/dist/verify-wip-cap.d.ts +0 -13
- package/dist/verify-wip-cap.js +0 -62
- package/dist/windows-bin-ps1.d.ts +0 -39
- package/dist/windows-bin-ps1.js +0 -226
- package/dist/wip-cap-fixtures.d.ts +0 -37
- package/dist/wip-cap-fixtures.js +0 -122
- package/dist/wsl-ownership-guard.d.ts +0 -2
- package/dist/wsl-ownership-guard.js +0 -15
- package/dist/xbrief-create.d.ts +0 -3
- package/dist/xbrief-create.js +0 -9
- package/dist/xbrief-verify.d.ts +0 -3
- package/dist/xbrief-verify.js +0 -9
- package/scripts/remove-windows-ps1-shims.mjs +0 -26
package/dist/bin.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export interface ScenarioResult {
|
|
2
|
-
readonly name: string;
|
|
3
|
-
readonly exitCode: number;
|
|
4
|
-
readonly stdout: string;
|
|
5
|
-
readonly stderr: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ParityScenario {
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly branch: "default" | "feature" | "detached";
|
|
10
|
-
readonly defaultBranchName?: string;
|
|
11
|
-
readonly plan?: Record<string, unknown> | null;
|
|
12
|
-
readonly allowMissingProjectDefinition?: boolean;
|
|
13
|
-
readonly env?: Record<string, string | undefined>;
|
|
14
|
-
}
|
|
15
|
-
export interface ParityResult {
|
|
16
|
-
readonly ok: boolean;
|
|
17
|
-
readonly scenarios: Array<{
|
|
18
|
-
readonly name: string;
|
|
19
|
-
readonly exitMismatch: boolean;
|
|
20
|
-
readonly pythonExit: number;
|
|
21
|
-
readonly tsExit: number;
|
|
22
|
-
readonly messageMismatch: boolean;
|
|
23
|
-
readonly pythonMessage: string;
|
|
24
|
-
readonly tsMessage: string;
|
|
25
|
-
}>;
|
|
26
|
-
}
|
|
27
|
-
/** Scenarios exercised by the parity harness (mirrors Python contract cases). */
|
|
28
|
-
export declare const PARITY_SCENARIOS: readonly ParityScenario[];
|
|
29
|
-
/** Normalise gate message for comparison (trim, collapse whitespace). */
|
|
30
|
-
export declare function normaliseMessage(stdout: string, stderr: string, exitCode: number): string;
|
|
31
|
-
/** Build a fixture git repo for one scenario. */
|
|
32
|
-
export declare function buildScenarioRepo(scenario: ParityScenario): {
|
|
33
|
-
root: string;
|
|
34
|
-
};
|
|
35
|
-
/** Diff python vs TS gate outputs for one scenario. */
|
|
36
|
-
export declare function diffParity(python: ScenarioResult, ts: ScenarioResult): {
|
|
37
|
-
exitMismatch: boolean;
|
|
38
|
-
messageMismatch: boolean;
|
|
39
|
-
pythonMessage: string;
|
|
40
|
-
tsMessage: string;
|
|
41
|
-
};
|
|
42
|
-
/** Run all parity scenarios and return a structured result. */
|
|
43
|
-
/** Render a human-readable parity report (exported for unit tests). */
|
|
44
|
-
export declare function renderReport(result: ParityResult): string;
|
|
45
|
-
//# sourceMappingURL=branch-fixtures.d.ts.map
|
package/dist/branch-fixtures.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/** Test fixtures extracted from legacy parity harness (#2083). */
|
|
2
|
-
import { execFileSync } from "node:child_process";
|
|
3
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import { join } from "node:path";
|
|
6
|
-
function gitCommit(cwd, message) {
|
|
7
|
-
execFileSync("git", ["commit", "-q", "-m", message], {
|
|
8
|
-
cwd,
|
|
9
|
-
env: {
|
|
10
|
-
...process.env,
|
|
11
|
-
GIT_AUTHOR_NAME: "deft-parity",
|
|
12
|
-
GIT_AUTHOR_EMAIL: "parity@test.local",
|
|
13
|
-
GIT_COMMITTER_NAME: "deft-parity",
|
|
14
|
-
GIT_COMMITTER_EMAIL: "parity@test.local",
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function writeProjectDef(root, plan) {
|
|
19
|
-
const dir = join(root, "xbrief");
|
|
20
|
-
mkdirSync(dir, { recursive: true });
|
|
21
|
-
writeFileSync(join(dir, "PROJECT-DEFINITION.xbrief.json"), `${JSON.stringify({
|
|
22
|
-
xBRIEFInfo: { version: "0.8" },
|
|
23
|
-
plan: { title: "T", status: "running", items: [], ...plan },
|
|
24
|
-
}, null, 2)}\n`, { encoding: "utf8" });
|
|
25
|
-
}
|
|
26
|
-
/** Scenarios exercised by the parity harness (mirrors Python contract cases). */
|
|
27
|
-
export const PARITY_SCENARIOS = [
|
|
28
|
-
{
|
|
29
|
-
name: "setup-exemption",
|
|
30
|
-
branch: "default",
|
|
31
|
-
plan: null,
|
|
32
|
-
env: { DEFT_SETUP_INTERVIEW: "1", DEFT_ALLOW_DEFAULT_BRANCH_COMMIT: "" },
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "feature-branch",
|
|
36
|
-
branch: "feature",
|
|
37
|
-
plan: { policy: { allowDirectCommitsToMaster: false } },
|
|
38
|
-
env: { DEFT_SETUP_INTERVIEW: "", DEFT_ALLOW_DEFAULT_BRANCH_COMMIT: "" },
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: "detached-head",
|
|
42
|
-
branch: "detached",
|
|
43
|
-
plan: { policy: { allowDirectCommitsToMaster: false } },
|
|
44
|
-
env: { DEFT_SETUP_INTERVIEW: "", DEFT_ALLOW_DEFAULT_BRANCH_COMMIT: "" },
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: "master-blocked",
|
|
48
|
-
branch: "default",
|
|
49
|
-
defaultBranchName: "master",
|
|
50
|
-
plan: { policy: { allowDirectCommitsToMaster: false } },
|
|
51
|
-
env: { DEFT_SETUP_INTERVIEW: "", DEFT_ALLOW_DEFAULT_BRANCH_COMMIT: "" },
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: "master-opt-out-typed",
|
|
55
|
-
branch: "default",
|
|
56
|
-
defaultBranchName: "master",
|
|
57
|
-
plan: { policy: { allowDirectCommitsToMaster: true } },
|
|
58
|
-
env: { DEFT_SETUP_INTERVIEW: "", DEFT_ALLOW_DEFAULT_BRANCH_COMMIT: "" },
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: "env-bypass",
|
|
62
|
-
branch: "default",
|
|
63
|
-
defaultBranchName: "master",
|
|
64
|
-
plan: { policy: { allowDirectCommitsToMaster: false } },
|
|
65
|
-
env: { DEFT_SETUP_INTERVIEW: "", DEFT_ALLOW_DEFAULT_BRANCH_COMMIT: "1" },
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: "missing-pd-config-error",
|
|
69
|
-
branch: "default",
|
|
70
|
-
defaultBranchName: "master",
|
|
71
|
-
plan: undefined,
|
|
72
|
-
env: { DEFT_SETUP_INTERVIEW: "", DEFT_ALLOW_DEFAULT_BRANCH_COMMIT: "" },
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: "missing-pd-bootstrap",
|
|
76
|
-
branch: "default",
|
|
77
|
-
defaultBranchName: "master",
|
|
78
|
-
plan: undefined,
|
|
79
|
-
allowMissingProjectDefinition: true,
|
|
80
|
-
env: { DEFT_SETUP_INTERVIEW: "", DEFT_ALLOW_DEFAULT_BRANCH_COMMIT: "" },
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: "malformed-typed-field",
|
|
84
|
-
branch: "default",
|
|
85
|
-
defaultBranchName: "master",
|
|
86
|
-
plan: { policy: { allowDirectCommitsToMaster: "yes" } },
|
|
87
|
-
env: { DEFT_SETUP_INTERVIEW: "", DEFT_ALLOW_DEFAULT_BRANCH_COMMIT: "" },
|
|
88
|
-
},
|
|
89
|
-
];
|
|
90
|
-
/** Normalise gate message for comparison (trim, collapse whitespace). */
|
|
91
|
-
export function normaliseMessage(stdout, stderr, exitCode) {
|
|
92
|
-
const raw = exitCode === 0 ? stdout : stderr;
|
|
93
|
-
return raw
|
|
94
|
-
.trim()
|
|
95
|
-
.replace(/\s+/g, " ")
|
|
96
|
-
.replace(/PROJECT-DEFINITION not found at [^\s)]+/g, "PROJECT-DEFINITION not found at <ROOT>");
|
|
97
|
-
}
|
|
98
|
-
/** Build a fixture git repo for one scenario. */
|
|
99
|
-
export function buildScenarioRepo(scenario) {
|
|
100
|
-
const root = mkdtempSync(join(tmpdir(), "deft-branch-parity-"));
|
|
101
|
-
const defaultBranch = scenario.defaultBranchName ?? "master";
|
|
102
|
-
try {
|
|
103
|
-
writeFileSync(join(root, "README.md"), "# parity\n", "utf8");
|
|
104
|
-
if (scenario.plan !== null && scenario.plan !== undefined) {
|
|
105
|
-
writeProjectDef(root, scenario.plan);
|
|
106
|
-
}
|
|
107
|
-
execFileSync("git", ["init", "-q"], { cwd: root });
|
|
108
|
-
execFileSync("git", ["branch", "-M", defaultBranch], { cwd: root });
|
|
109
|
-
execFileSync("git", ["add", "-A"], { cwd: root });
|
|
110
|
-
gitCommit(root, "init");
|
|
111
|
-
if (scenario.branch === "feature") {
|
|
112
|
-
execFileSync("git", ["checkout", "-q", "-b", "feat/parity"], { cwd: root });
|
|
113
|
-
}
|
|
114
|
-
else if (scenario.branch === "detached") {
|
|
115
|
-
execFileSync("git", ["checkout", "-q", "--detach"], { cwd: root });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
catch (err) {
|
|
119
|
-
rmSync(root, { recursive: true, force: true });
|
|
120
|
-
throw err;
|
|
121
|
-
}
|
|
122
|
-
return { root };
|
|
123
|
-
}
|
|
124
|
-
/** Diff python vs TS gate outputs for one scenario. */
|
|
125
|
-
export function diffParity(python, ts) {
|
|
126
|
-
const pythonMessage = normaliseMessage(python.stdout, python.stderr, python.exitCode);
|
|
127
|
-
const tsMessage = normaliseMessage(ts.stdout, ts.stderr, ts.exitCode);
|
|
128
|
-
return {
|
|
129
|
-
exitMismatch: python.exitCode !== ts.exitCode,
|
|
130
|
-
messageMismatch: pythonMessage !== tsMessage,
|
|
131
|
-
pythonMessage,
|
|
132
|
-
tsMessage,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
/** Run all parity scenarios and return a structured result. */
|
|
136
|
-
/** Render a human-readable parity report (exported for unit tests). */
|
|
137
|
-
export function renderReport(result) {
|
|
138
|
-
if (result.ok) {
|
|
139
|
-
return `verify_branch parity: CLEAN -- Python and TS agree on ${result.scenarios.length} scenario(s).`;
|
|
140
|
-
}
|
|
141
|
-
const lines = ["verify_branch parity: DIVERGENCE"];
|
|
142
|
-
for (const s of result.scenarios) {
|
|
143
|
-
if (s.exitMismatch || s.messageMismatch) {
|
|
144
|
-
lines.push(` scenario: ${s.name}`);
|
|
145
|
-
if (s.exitMismatch) {
|
|
146
|
-
lines.push(` exit mismatch: python=${s.pythonExit} ts=${s.tsExit}`);
|
|
147
|
-
}
|
|
148
|
-
if (s.messageMismatch) {
|
|
149
|
-
lines.push(` python: ${s.pythonMessage}`);
|
|
150
|
-
lines.push(` ts: ${s.tsMessage}`);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return lines.join("\n");
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=branch-fixtures.js.map
|
package/dist/cache.d.ts
DELETED
package/dist/cache.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { main } from "@deftai/directive-core/dist/cache/main.js";
|
|
4
|
-
/* v8 ignore start -- entry guard; behaviour covered via main() unit tests */
|
|
5
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
6
|
-
process.exit(main(process.argv.slice(2)));
|
|
7
|
-
}
|
|
8
|
-
/* v8 ignore stop */
|
|
9
|
-
export { main };
|
|
10
|
-
//# sourceMappingURL=cache.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { runCapacityBackfillCli } from "@deftai/directive-core/capacity";
|
|
3
|
-
const result = await runCapacityBackfillCli(process.argv.slice(2));
|
|
4
|
-
if (result.stdout)
|
|
5
|
-
process.stdout.write(result.stdout);
|
|
6
|
-
if (result.stderr)
|
|
7
|
-
process.stderr.write(result.stderr);
|
|
8
|
-
process.exit(result.exitCode);
|
|
9
|
-
//# sourceMappingURL=capacity-backfill.js.map
|
package/dist/capacity-show.d.ts
DELETED
package/dist/capacity-show.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { runCapacityShowCli } from "@deftai/directive-core/capacity";
|
|
3
|
-
const result = runCapacityShowCli(process.argv.slice(2));
|
|
4
|
-
if (result.stdout)
|
|
5
|
-
process.stdout.write(result.stdout);
|
|
6
|
-
if (result.stderr)
|
|
7
|
-
process.stderr.write(result.stderr);
|
|
8
|
-
process.exit(result.exitCode);
|
|
9
|
-
//# sourceMappingURL=capacity-show.js.map
|
package/dist/change-init.d.ts
DELETED
package/dist/change-init.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { runChangeInit } from "@deftai/directive-core/task-surface";
|
|
5
|
-
function parseArgs(argv) {
|
|
6
|
-
let projectRoot = ".";
|
|
7
|
-
let name = "";
|
|
8
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
9
|
-
const arg = argv[i] ?? "";
|
|
10
|
-
if (arg === "--project-root") {
|
|
11
|
-
const value = argv[i + 1];
|
|
12
|
-
if (value === undefined) {
|
|
13
|
-
return { projectRoot, name, error: "argument --project-root: expected one argument" };
|
|
14
|
-
}
|
|
15
|
-
projectRoot = value;
|
|
16
|
-
i += 1;
|
|
17
|
-
}
|
|
18
|
-
else if (arg.startsWith("--project-root=")) {
|
|
19
|
-
projectRoot = arg.slice("--project-root=".length);
|
|
20
|
-
}
|
|
21
|
-
else if (arg === "--name") {
|
|
22
|
-
const value = argv[i + 1];
|
|
23
|
-
if (value === undefined) {
|
|
24
|
-
return { projectRoot, name, error: "argument --name: expected one argument" };
|
|
25
|
-
}
|
|
26
|
-
name = value;
|
|
27
|
-
i += 1;
|
|
28
|
-
}
|
|
29
|
-
else if (arg.startsWith("--name=")) {
|
|
30
|
-
name = arg.slice("--name=".length);
|
|
31
|
-
}
|
|
32
|
-
else if (!arg.startsWith("-") && name.length === 0) {
|
|
33
|
-
name = arg;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return { projectRoot, name, error: `unrecognized argument: ${arg}` };
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return { projectRoot, name };
|
|
40
|
-
}
|
|
41
|
-
export function run(argv) {
|
|
42
|
-
const args = parseArgs(argv);
|
|
43
|
-
if (args.error !== undefined) {
|
|
44
|
-
process.stderr.write(`change-init: ${args.error}\n`);
|
|
45
|
-
return 2;
|
|
46
|
-
}
|
|
47
|
-
return runChangeInit(resolve(args.projectRoot), args.name, {
|
|
48
|
-
writeOut: (text) => {
|
|
49
|
-
process.stdout.write(text);
|
|
50
|
-
},
|
|
51
|
-
writeErr: (text) => {
|
|
52
|
-
process.stderr.write(text);
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
57
|
-
process.exit(run(process.argv.slice(2)));
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=change-init.js.map
|
package/dist/changelog-check.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { runChangelogCheck } from "@deftai/directive-core/task-surface";
|
|
5
|
-
function parseChangelogCheckArgs(argv) {
|
|
6
|
-
let projectRoot = ".";
|
|
7
|
-
let againstMergeBase = false;
|
|
8
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
9
|
-
const arg = argv[i] ?? "";
|
|
10
|
-
if (arg === "--project-root") {
|
|
11
|
-
const value = argv[i + 1];
|
|
12
|
-
if (value === undefined) {
|
|
13
|
-
return {
|
|
14
|
-
projectRoot,
|
|
15
|
-
againstMergeBase,
|
|
16
|
-
error: "argument --project-root: expected one argument",
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
projectRoot = value;
|
|
20
|
-
i += 1;
|
|
21
|
-
}
|
|
22
|
-
else if (arg.startsWith("--project-root=")) {
|
|
23
|
-
projectRoot = arg.slice("--project-root=".length);
|
|
24
|
-
}
|
|
25
|
-
else if (arg === "--against-merge-base") {
|
|
26
|
-
againstMergeBase = true;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return { projectRoot, againstMergeBase, error: `unrecognized argument: ${arg}` };
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return { projectRoot, againstMergeBase };
|
|
33
|
-
}
|
|
34
|
-
export function run(argv) {
|
|
35
|
-
const args = parseChangelogCheckArgs(argv);
|
|
36
|
-
if (args.error !== undefined) {
|
|
37
|
-
process.stderr.write(`changelog-check: ${args.error}\n`);
|
|
38
|
-
return 2;
|
|
39
|
-
}
|
|
40
|
-
return runChangelogCheck(resolve(args.projectRoot), {
|
|
41
|
-
writeOut: (text) => {
|
|
42
|
-
process.stdout.write(text);
|
|
43
|
-
},
|
|
44
|
-
writeErr: (text) => {
|
|
45
|
-
process.stderr.write(text);
|
|
46
|
-
},
|
|
47
|
-
}, { againstMergeBase: args.againstMergeBase });
|
|
48
|
-
}
|
|
49
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
50
|
-
process.exit(run(process.argv.slice(2)));
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=changelog-check.js.map
|
package/dist/check.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export interface ParsedArgs {
|
|
3
|
-
frameworkRoot?: string;
|
|
4
|
-
projectRoot: string;
|
|
5
|
-
noCache?: boolean;
|
|
6
|
-
error?: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Resolve check's framework-root from `projectRoot` without last-resort
|
|
10
|
-
* `resolveDefaultFrameworkRoot` (#4722). Returns null on miss (fail-closed).
|
|
11
|
-
*/
|
|
12
|
-
export declare function resolveCheckFrameworkRoot(projectRoot: string, explicitRoot?: string | null): string | null;
|
|
13
|
-
export declare function parseArgs(argv: readonly string[]): ParsedArgs;
|
|
14
|
-
export declare function run(argv: readonly string[]): number;
|
|
15
|
-
//# sourceMappingURL=check.d.ts.map
|
package/dist/check.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* check.ts -- CLI wrapper for the context-aware `task check` orchestrator (#1854, #1713).
|
|
4
|
-
*
|
|
5
|
-
* Usage: deft-ts check [--framework-root <path>] [--project-root <path>] [--no-cache]
|
|
6
|
-
*
|
|
7
|
-
* Omitted --project-root defaults to cwd. Omitted --framework-root walks
|
|
8
|
-
* explicit / DEFT_ROOT / source checkout / .deft/core / legacy deft/ and
|
|
9
|
-
* fail-closes instead of resolveDefaultFrameworkRoot (#4722).
|
|
10
|
-
*/
|
|
11
|
-
import { statSync } from "node:fs";
|
|
12
|
-
import { join, resolve } from "node:path";
|
|
13
|
-
import { fileURLToPath } from "node:url";
|
|
14
|
-
import { dispatchTaskCheck } from "@deftai/directive-core/check";
|
|
15
|
-
import { DEFT_REPO_POSITIVE_MARKERS } from "@deftai/directive-core/doctor";
|
|
16
|
-
import { refuseIfWslOwnershipBlocked } from "./wsl-ownership-guard.js";
|
|
17
|
-
function isFrameworkSourceCheckoutAt(projectRoot) {
|
|
18
|
-
try {
|
|
19
|
-
if (!statSync(join(projectRoot, "main.md")).isFile()) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
return DEFT_REPO_POSITIVE_MARKERS.every((marker) => {
|
|
27
|
-
try {
|
|
28
|
-
return statSync(join(projectRoot, marker)).isFile();
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Resolve check's framework-root from `projectRoot` without last-resort
|
|
37
|
-
* `resolveDefaultFrameworkRoot` (#4722). Returns null on miss (fail-closed).
|
|
38
|
-
*/
|
|
39
|
-
export function resolveCheckFrameworkRoot(projectRoot, explicitRoot) {
|
|
40
|
-
const explicit = explicitRoot?.trim();
|
|
41
|
-
if (explicit) {
|
|
42
|
-
return resolve(explicit);
|
|
43
|
-
}
|
|
44
|
-
const envRoot = process.env.DEFT_ROOT?.trim();
|
|
45
|
-
if (envRoot) {
|
|
46
|
-
return resolve(envRoot);
|
|
47
|
-
}
|
|
48
|
-
const root = resolve(projectRoot);
|
|
49
|
-
if (isFrameworkSourceCheckoutAt(root)) {
|
|
50
|
-
return root;
|
|
51
|
-
}
|
|
52
|
-
for (const rel of [join(".deft", "core"), "deft"]) {
|
|
53
|
-
const candidate = join(root, rel);
|
|
54
|
-
try {
|
|
55
|
-
if (statSync(candidate).isDirectory()) {
|
|
56
|
-
return candidate;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
// try next candidate
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
function takeRootOptionValue(argv, index, flag) {
|
|
66
|
-
const next = argv[index + 1];
|
|
67
|
-
if (next === undefined || next.length === 0 || next.startsWith("-")) {
|
|
68
|
-
return { error: `argument ${flag}: expected one argument`, next: index };
|
|
69
|
-
}
|
|
70
|
-
return { value: next, next: index + 1 };
|
|
71
|
-
}
|
|
72
|
-
export function parseArgs(argv) {
|
|
73
|
-
let projectRoot = process.cwd();
|
|
74
|
-
let explicitFrameworkRoot;
|
|
75
|
-
let noCache = false;
|
|
76
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
77
|
-
const arg = argv[i] ?? "";
|
|
78
|
-
if (arg === "--no-cache") {
|
|
79
|
-
noCache = true;
|
|
80
|
-
}
|
|
81
|
-
else if (arg === "--project-root") {
|
|
82
|
-
const taken = takeRootOptionValue(argv, i, "--project-root");
|
|
83
|
-
if (taken.error !== undefined) {
|
|
84
|
-
return { projectRoot, error: taken.error };
|
|
85
|
-
}
|
|
86
|
-
projectRoot = taken.value ?? projectRoot;
|
|
87
|
-
i = taken.next;
|
|
88
|
-
}
|
|
89
|
-
else if (arg.startsWith("--project-root=")) {
|
|
90
|
-
const value = arg.slice("--project-root=".length);
|
|
91
|
-
if (value.length === 0) {
|
|
92
|
-
return { projectRoot, error: "argument --project-root: expected one argument" };
|
|
93
|
-
}
|
|
94
|
-
projectRoot = value;
|
|
95
|
-
}
|
|
96
|
-
else if (arg === "--framework-root") {
|
|
97
|
-
const taken = takeRootOptionValue(argv, i, "--framework-root");
|
|
98
|
-
if (taken.error !== undefined) {
|
|
99
|
-
return { projectRoot, error: taken.error };
|
|
100
|
-
}
|
|
101
|
-
explicitFrameworkRoot = taken.value;
|
|
102
|
-
i = taken.next;
|
|
103
|
-
}
|
|
104
|
-
else if (arg.startsWith("--framework-root=")) {
|
|
105
|
-
const value = arg.slice("--framework-root=".length);
|
|
106
|
-
if (value.length === 0) {
|
|
107
|
-
return { projectRoot, error: "argument --framework-root: expected one argument" };
|
|
108
|
-
}
|
|
109
|
-
explicitFrameworkRoot = value;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
return {
|
|
113
|
-
projectRoot,
|
|
114
|
-
error: `unrecognized argument: ${arg}`,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
const parsed = { projectRoot };
|
|
119
|
-
if (noCache) {
|
|
120
|
-
parsed.noCache = true;
|
|
121
|
-
}
|
|
122
|
-
const frameworkRoot = resolveCheckFrameworkRoot(projectRoot, explicitFrameworkRoot);
|
|
123
|
-
if (frameworkRoot !== null) {
|
|
124
|
-
parsed.frameworkRoot = frameworkRoot;
|
|
125
|
-
}
|
|
126
|
-
return parsed;
|
|
127
|
-
}
|
|
128
|
-
const FRAMEWORK_ROOT_MISS = "check: no framework-root at this project (source checkout, .deft/core, or legacy deft/). Run directive init.\n";
|
|
129
|
-
export function run(argv) {
|
|
130
|
-
const args = parseArgs(argv);
|
|
131
|
-
if (args.error !== undefined) {
|
|
132
|
-
process.stderr.write(`check: ${args.error}\n`);
|
|
133
|
-
return 2;
|
|
134
|
-
}
|
|
135
|
-
if (args.frameworkRoot === undefined) {
|
|
136
|
-
process.stderr.write(FRAMEWORK_ROOT_MISS);
|
|
137
|
-
return 2;
|
|
138
|
-
}
|
|
139
|
-
// #1617: live WSL ownership gate before first protected check write/orchestration.
|
|
140
|
-
const blocked = refuseIfWslOwnershipBlocked(args.projectRoot);
|
|
141
|
-
if (blocked !== null)
|
|
142
|
-
return blocked;
|
|
143
|
-
return dispatchTaskCheck(args.frameworkRoot, args.projectRoot, { noCache: args.noCache });
|
|
144
|
-
}
|
|
145
|
-
/* v8 ignore start -- entry guard */
|
|
146
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
147
|
-
process.exit(run(process.argv.slice(2)));
|
|
148
|
-
}
|
|
149
|
-
/* v8 ignore stop */
|
|
150
|
-
//# sourceMappingURL=check.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
const FALLBACK_VERSION = "0.0.0";
|
|
5
|
-
function parsePackageVersion(raw) {
|
|
6
|
-
const parsed = JSON.parse(raw);
|
|
7
|
-
if (parsed === null || typeof parsed !== "object") {
|
|
8
|
-
return FALLBACK_VERSION;
|
|
9
|
-
}
|
|
10
|
-
const version = parsed.version;
|
|
11
|
-
return typeof version === "string" && version.length > 0 ? version : FALLBACK_VERSION;
|
|
12
|
-
}
|
|
13
|
-
/** Reads `@deftai/directive` version from the installed CLI package.json adjacent to dist/ or src/. */
|
|
14
|
-
export function readCliPackageVersion() {
|
|
15
|
-
try {
|
|
16
|
-
const pkgPath = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
|
|
17
|
-
return parsePackageVersion(readFileSync(pkgPath, "utf8"));
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
20
|
-
return FALLBACK_VERSION;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=cli-package-version.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI router entry: `directive <namespace> <verb>` → flat dispatcher (#1670 / #11 S3).
|
|
3
|
-
*/
|
|
4
|
-
import { type DispatchIo } from "../dispatch.js";
|
|
5
|
-
export { DEFERRED_TOP_LEVEL_VERBS, PR_VERB_MAP, type RoutedArgv, type RouteKind, routeArgv, SCOPE_LIFECYCLE_VERBS, STUBBED_TOP_LEVEL_VERBS, SUBCOMMAND_ROUTES, TOP_LEVEL_UX_VERBS, taskKeyToDispatchArgv, VERIFY_VERB_MAP, } from "./route-argv.js";
|
|
6
|
-
/** Route user argv then dispatch to the existing engine handlers. */
|
|
7
|
-
export declare function routeAndDispatch(argv: readonly string[], io?: DispatchIo): Promise<number>;
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/cli-router/index.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI router entry: `directive <namespace> <verb>` → flat dispatcher (#1670 / #11 S3).
|
|
3
|
-
*/
|
|
4
|
-
import { dispatch, runDirectiveBootstrap } from "../dispatch.js";
|
|
5
|
-
import { runInit } from "../init-cli/init.js";
|
|
6
|
-
import { runMigrate } from "../init-cli/migrate.js";
|
|
7
|
-
import { runUpdate } from "../init-cli/update.js";
|
|
8
|
-
import { routeArgv } from "./route-argv.js";
|
|
9
|
-
function defaultIo() {
|
|
10
|
-
return {
|
|
11
|
-
writeOut: (text) => {
|
|
12
|
-
process.stdout.write(text);
|
|
13
|
-
},
|
|
14
|
-
writeErr: (text) => {
|
|
15
|
-
process.stderr.write(text);
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export { DEFERRED_TOP_LEVEL_VERBS, PR_VERB_MAP, routeArgv, SCOPE_LIFECYCLE_VERBS, STUBBED_TOP_LEVEL_VERBS, SUBCOMMAND_ROUTES, TOP_LEVEL_UX_VERBS, taskKeyToDispatchArgv, VERIFY_VERB_MAP, } from "./route-argv.js";
|
|
20
|
-
/** Route user argv then dispatch to the existing engine handlers. */
|
|
21
|
-
export async function routeAndDispatch(argv, io) {
|
|
22
|
-
const routed = routeArgv(argv);
|
|
23
|
-
if (routed.kind === "stub") {
|
|
24
|
-
const message = routed.stubMessage ?? "directive: command not available";
|
|
25
|
-
const sink = io ?? defaultIo();
|
|
26
|
-
sink.writeErr(`${message}\n`);
|
|
27
|
-
return 2;
|
|
28
|
-
}
|
|
29
|
-
const [first, ...rest] = routed.argv;
|
|
30
|
-
if (first === "init") {
|
|
31
|
-
return runInit(rest, io ?? defaultIo());
|
|
32
|
-
}
|
|
33
|
-
if (first === "update") {
|
|
34
|
-
return runUpdate(rest, io ?? defaultIo());
|
|
35
|
-
}
|
|
36
|
-
if (first === "migrate") {
|
|
37
|
-
return runMigrate(rest, io ?? defaultIo());
|
|
38
|
-
}
|
|
39
|
-
if (first === "bootstrap") {
|
|
40
|
-
return runDirectiveBootstrap(rest, io ?? defaultIo());
|
|
41
|
-
}
|
|
42
|
-
return dispatch(routed.argv, io);
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps `directive <namespace> <verb>` argv to flat dispatcher verbs (#1670 / #11 S3).
|
|
3
|
-
* Mirrors the `task <namespace>:<verb>` surface one-to-one.
|
|
4
|
-
*/
|
|
5
|
-
/** Top-level UX verbs promoted above the namespace layer (#1670). */
|
|
6
|
-
export declare const TOP_LEVEL_UX_VERBS: readonly ["init", "update", "migrate", "bootstrap", "check", "doctor", "version", "feature"];
|
|
7
|
-
/** Stubbed until a later story lands the handler (#1670 / #11). */
|
|
8
|
-
export declare const STUBBED_TOP_LEVEL_VERBS: Set<string>;
|
|
9
|
-
/** Registered but not yet implemented as TS handlers. */
|
|
10
|
-
export declare const DEFERRED_TOP_LEVEL_VERBS: Set<string>;
|
|
11
|
-
/** scope:* lifecycle verbs routed through scope-lifecycle handler. */
|
|
12
|
-
export declare const SCOPE_LIFECYCLE_VERBS: Set<string>;
|
|
13
|
-
/** pr:* task names that do not hyphenate 1:1 to handler stems. */
|
|
14
|
-
export declare const PR_VERB_MAP: Readonly<Record<string, string>>;
|
|
15
|
-
/** verify:* aliases that map to non-verify-* handler stems. */
|
|
16
|
-
export declare const VERIFY_VERB_MAP: Readonly<Record<string, string>>;
|
|
17
|
-
/** Namespace handlers that require a subcommand token after the handler stem. */
|
|
18
|
-
export declare const SUBCOMMAND_ROUTES: Readonly<Record<string, readonly [string, string]>>;
|
|
19
|
-
/** Eight scm:body:* dual-invoke names (#5521); keep in sync with SUBCOMMAND_ROUTES above. */
|
|
20
|
-
export declare const SCM_BODY_COLON_VERBS: readonly ["scm:body:issue:create", "scm:body:issue:edit", "scm:body:issue:fetch", "scm:body:issue:lint", "scm:body:comment:create", "scm:body:comment:edit", "scm:body:pr:edit", "scm:body:pr:lint"];
|
|
21
|
-
/**
|
|
22
|
-
* Colon forms handled by explicit `routeNamespaceVerb` branches (not SUBCOMMAND_ROUTES /
|
|
23
|
-
* PR_VERB_MAP / VERIFY_VERB_MAP / SCOPE_LIFECYCLE_VERBS). Scraped by rule-to-verb parity
|
|
24
|
-
* so valid citations like `deft framework:doctor` pass (#5521).
|
|
25
|
-
*/
|
|
26
|
-
export declare const ROUTER_BRANCH_COLON_VERBS: readonly ["framework:doctor", "agents:refresh", "scope:demote", "scope:decompose", "scope:undo", "scope:record-approved-scope", "scope:record-observable-scope", "scope:record-intent-constraint", "scm:issue:design-critique-chip", "scm:issue:design-critique-stale-ready", "scm:issue:work-claim", "issue:ingest", "issue:emit", "issue:sync-from-xbrief"];
|
|
27
|
-
export type RouteKind = "dispatch" | "stub";
|
|
28
|
-
export interface RoutedArgv {
|
|
29
|
-
kind: RouteKind;
|
|
30
|
-
argv: string[];
|
|
31
|
-
stubMessage?: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Transform user-facing argv (`directive <ns> <verb>` or top-level UX) into
|
|
35
|
-
* flat dispatcher argv consumed by `dispatch()`.
|
|
36
|
-
*/
|
|
37
|
-
export declare function routeArgv(argv: readonly string[]): RoutedArgv;
|
|
38
|
-
/** Map `namespace:verb` task key to flat dispatcher argv (test seam). */
|
|
39
|
-
export declare function taskKeyToDispatchArgv(taskKey: string, rest?: readonly string[]): string[] | null;
|
|
40
|
-
//# sourceMappingURL=route-argv.d.ts.map
|