@deftai/directive 0.126.2 → 0.128.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/bin/deft-hook +14 -0
- package/bin/deft-hook.cmd +14 -0
- package/dist/bin.js +4319 -3
- package/package.json +11 -21
- 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 -21
- package/dist/coverage-hotspots.js +0 -198
- 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 -3091
- 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 -23
- package/dist/occupancy-release.js +0 -102
- 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 -14
- package/dist/plan-sequence.js +0 -258
- package/dist/policy-fixtures.d.ts +0 -33
- package/dist/policy-fixtures.js +0 -118
- package/dist/policy.d.ts +0 -37
- package/dist/policy.js +0 -744
- 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 -581
- 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 -233
- 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 -17
- package/dist/verify-intent-constraint.js +0 -110
- 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 -17
- package/dist/verify-observable-scope.js +0 -110
- 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 -32
- package/dist/verify-review-monitor.js +0 -362
- 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/verify-tools.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
interface ParsedArgs {
|
|
3
|
-
install: boolean;
|
|
4
|
-
yes: boolean;
|
|
5
|
-
emitJson: boolean;
|
|
6
|
-
includeTask: boolean;
|
|
7
|
-
platform: string | undefined;
|
|
8
|
-
error?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
11
|
-
export declare function run(argv: string[]): number;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=verify-tools.d.ts.map
|
package/dist/verify-tools.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { verificationResultToJson, verifyRequiredTools } from "@deftai/directive-core/verify-env";
|
|
4
|
-
export function parseArgs(argv) {
|
|
5
|
-
const parsed = {
|
|
6
|
-
install: false,
|
|
7
|
-
yes: false,
|
|
8
|
-
emitJson: false,
|
|
9
|
-
includeTask: false,
|
|
10
|
-
platform: undefined,
|
|
11
|
-
};
|
|
12
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
13
|
-
const arg = argv[i];
|
|
14
|
-
if (arg === "--install")
|
|
15
|
-
parsed.install = true;
|
|
16
|
-
else if (arg === "--yes")
|
|
17
|
-
parsed.yes = true;
|
|
18
|
-
else if (arg === "--json")
|
|
19
|
-
parsed.emitJson = true;
|
|
20
|
-
else if (arg === "--include-task")
|
|
21
|
-
parsed.includeTask = true;
|
|
22
|
-
else if (arg === "--platform") {
|
|
23
|
-
const value = argv[i + 1];
|
|
24
|
-
if (value === undefined)
|
|
25
|
-
return { ...parsed, error: "argument --platform: expected one argument" };
|
|
26
|
-
parsed.platform = value;
|
|
27
|
-
i += 1;
|
|
28
|
-
}
|
|
29
|
-
else if (arg?.startsWith("--platform=")) {
|
|
30
|
-
parsed.platform = arg.slice("--platform=".length);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return { ...parsed, error: `unrecognized arguments: ${arg}` };
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return parsed;
|
|
37
|
-
}
|
|
38
|
-
export function run(argv) {
|
|
39
|
-
const args = parseArgs(argv);
|
|
40
|
-
if (args.error !== undefined) {
|
|
41
|
-
process.stderr.write(`verify_tools.py: error: ${args.error}\n`);
|
|
42
|
-
return 2;
|
|
43
|
-
}
|
|
44
|
-
const captured = [];
|
|
45
|
-
const result = verifyRequiredTools({
|
|
46
|
-
install: args.install,
|
|
47
|
-
assumeYes: args.yes,
|
|
48
|
-
includeTask: args.includeTask,
|
|
49
|
-
platformId: args.platform,
|
|
50
|
-
outputFn: (line) => {
|
|
51
|
-
captured.push(line);
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
if (args.emitJson) {
|
|
55
|
-
process.stdout.write(`${verificationResultToJson(result)}\n`);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
for (const line of captured) {
|
|
59
|
-
process.stdout.write(`${line}\n`);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return result.exitCode;
|
|
63
|
-
}
|
|
64
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
65
|
-
process.exit(run(process.argv.slice(2)));
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=verify-tools.js.map
|
package/dist/verify-wip-cap.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
interface ParsedArgs {
|
|
3
|
-
projectRoot: string;
|
|
4
|
-
allowOverCap: boolean;
|
|
5
|
-
quiet: boolean;
|
|
6
|
-
error?: string;
|
|
7
|
-
}
|
|
8
|
-
/** Parse verify-wip-cap CLI args, mirroring the Python argparse surface. */
|
|
9
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
10
|
-
/** Run the gate and return the process exit code. */
|
|
11
|
-
export declare function run(argv: string[]): number;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=verify-wip-cap.d.ts.map
|
package/dist/verify-wip-cap.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { evaluate } from "@deftai/directive-core/wip-cap";
|
|
5
|
-
/** Parse verify-wip-cap CLI args, mirroring the Python argparse surface. */
|
|
6
|
-
export function parseArgs(argv) {
|
|
7
|
-
const parsed = {
|
|
8
|
-
projectRoot: ".",
|
|
9
|
-
allowOverCap: false,
|
|
10
|
-
quiet: false,
|
|
11
|
-
};
|
|
12
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
13
|
-
const arg = argv[i];
|
|
14
|
-
if (arg === "--allow-over-cap") {
|
|
15
|
-
parsed.allowOverCap = true;
|
|
16
|
-
}
|
|
17
|
-
else if (arg === "--quiet") {
|
|
18
|
-
parsed.quiet = true;
|
|
19
|
-
}
|
|
20
|
-
else if (arg === "--project-root") {
|
|
21
|
-
const value = argv[i + 1];
|
|
22
|
-
if (value === undefined) {
|
|
23
|
-
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
24
|
-
}
|
|
25
|
-
parsed.projectRoot = value;
|
|
26
|
-
i += 1;
|
|
27
|
-
}
|
|
28
|
-
else if (arg?.startsWith("--project-root=")) {
|
|
29
|
-
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return parsed;
|
|
36
|
-
}
|
|
37
|
-
/** Run the gate and return the process exit code. */
|
|
38
|
-
export function run(argv) {
|
|
39
|
-
const args = parseArgs(argv);
|
|
40
|
-
if (args.error !== undefined) {
|
|
41
|
-
process.stderr.write(`verify_wip_cap: ${args.error}\n`);
|
|
42
|
-
return 2;
|
|
43
|
-
}
|
|
44
|
-
const projectRoot = resolve(args.projectRoot);
|
|
45
|
-
const result = evaluate(projectRoot, {
|
|
46
|
-
allowOverCap: args.allowOverCap,
|
|
47
|
-
quiet: args.quiet,
|
|
48
|
-
});
|
|
49
|
-
if (result.message.length > 0) {
|
|
50
|
-
if (result.stream === "stdout") {
|
|
51
|
-
process.stdout.write(`${result.message}\n`);
|
|
52
|
-
}
|
|
53
|
-
else if (result.stream === "stderr") {
|
|
54
|
-
process.stderr.write(`${result.message}\n`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return result.code;
|
|
58
|
-
}
|
|
59
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
60
|
-
process.exit(run(process.argv.slice(2)));
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=verify-wip-cap.js.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/** Fallback when package.json cannot be read. Keep aligned with the bin map. */
|
|
2
|
-
export declare const PACKAGE_BIN_NAMES: readonly ["directive", "deft", "deft-ts", "deft-hook", "deft-verify-encoding"];
|
|
3
|
-
/** Node owns these shims. This package must not delete them. */
|
|
4
|
-
export declare const NODE_OWNED_SHIM_NAMES: readonly ["npx", "npm"];
|
|
5
|
-
export interface Ps1ShimRemoval {
|
|
6
|
-
readonly removed: readonly string[];
|
|
7
|
-
readonly failed: readonly string[];
|
|
8
|
-
}
|
|
9
|
-
export declare function packageIsUnderNodeModules(pkgDir: string): boolean;
|
|
10
|
-
/** bin-links layout. Valid only when {@link packageIsUnderNodeModules} is true. */
|
|
11
|
-
export declare function nodeModulesDir(pkgDir: string): string;
|
|
12
|
-
/** Same directory bin-links uses for this package root. */
|
|
13
|
-
export declare function linkerBinDir(opts: {
|
|
14
|
-
readonly pkgDir: string;
|
|
15
|
-
readonly global: boolean;
|
|
16
|
-
readonly platform: string;
|
|
17
|
-
}): string;
|
|
18
|
-
export declare function isGlobalInstall(env: Readonly<Record<string, string | undefined>>): boolean;
|
|
19
|
-
export declare function candidateBinDirs(opts: {
|
|
20
|
-
readonly pkgDir: string;
|
|
21
|
-
readonly env: Readonly<Record<string, string | undefined>>;
|
|
22
|
-
readonly platform: string;
|
|
23
|
-
}): string[];
|
|
24
|
-
export declare function removeGeneratedPs1Shims(opts: {
|
|
25
|
-
readonly binDir: string;
|
|
26
|
-
readonly binNames: readonly string[];
|
|
27
|
-
readonly platform: string;
|
|
28
|
-
readonly protectedNames?: readonly string[];
|
|
29
|
-
}): Ps1ShimRemoval;
|
|
30
|
-
/** True when cmd-shim text records a target path inside this install. */
|
|
31
|
-
export declare function cmdShimTargetsPackage(cmdText: string, binDir: string, pkgDir: string): boolean;
|
|
32
|
-
export declare function readPackageBinNames(packageJsonText: string): string[];
|
|
33
|
-
export declare function removeInstalledWindowsPs1Shims(opts: {
|
|
34
|
-
readonly pkgDir: string;
|
|
35
|
-
readonly env: Readonly<Record<string, string | undefined>>;
|
|
36
|
-
readonly platform: string;
|
|
37
|
-
readonly readText?: (path: string) => string;
|
|
38
|
-
}): Ps1ShimRemoval;
|
|
39
|
-
//# sourceMappingURL=windows-bin-ps1.d.ts.map
|
package/dist/windows-bin-ps1.js
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* npm's Windows bin linker (cmd-shim) always writes a .ps1 beside the .cmd.
|
|
3
|
-
* PowerShell selects that .ps1 and stops when script execution is refused, so
|
|
4
|
-
* the bare name never reaches the .cmd. This runs from postinstall, after
|
|
5
|
-
* that link, and removes only this package's generated .ps1 files.
|
|
6
|
-
* A .ps1 is removed only when its sibling .cmd records a target inside this
|
|
7
|
-
* install, so an ambient PNPM_HOME from another install is left alone.
|
|
8
|
-
* It does not change npx.ps1, npm.ps1, or the operator's execution policy.
|
|
9
|
-
* Codex deposits bare deft-hook (#4659); this postinstall is what makes Restricted
|
|
10
|
-
* Get-Command select deft-hook.cmd without ExecutionPolicy Bypass.
|
|
11
|
-
*/
|
|
12
|
-
import { existsSync, readFileSync, realpathSync, unlinkSync } from "node:fs";
|
|
13
|
-
import { basename, dirname, join, win32 } from "node:path";
|
|
14
|
-
/** Fallback when package.json cannot be read. Keep aligned with the bin map. */
|
|
15
|
-
export const PACKAGE_BIN_NAMES = [
|
|
16
|
-
"directive",
|
|
17
|
-
"deft",
|
|
18
|
-
"deft-ts",
|
|
19
|
-
"deft-hook",
|
|
20
|
-
"deft-verify-encoding",
|
|
21
|
-
];
|
|
22
|
-
/** Node owns these shims. This package must not delete them. */
|
|
23
|
-
export const NODE_OWNED_SHIM_NAMES = ["npx", "npm"];
|
|
24
|
-
export function packageIsUnderNodeModules(pkgDir) {
|
|
25
|
-
const parent = dirname(pkgDir);
|
|
26
|
-
if (basename(parent) === "node_modules")
|
|
27
|
-
return true;
|
|
28
|
-
return basename(dirname(parent)) === "node_modules";
|
|
29
|
-
}
|
|
30
|
-
/** bin-links layout. Valid only when {@link packageIsUnderNodeModules} is true. */
|
|
31
|
-
export function nodeModulesDir(pkgDir) {
|
|
32
|
-
const scopeOrNm = dirname(pkgDir);
|
|
33
|
-
if (basename(scopeOrNm) === "node_modules")
|
|
34
|
-
return scopeOrNm;
|
|
35
|
-
return dirname(scopeOrNm);
|
|
36
|
-
}
|
|
37
|
-
/** Same directory bin-links uses for this package root. */
|
|
38
|
-
export function linkerBinDir(opts) {
|
|
39
|
-
const nm = nodeModulesDir(opts.pkgDir);
|
|
40
|
-
if (!opts.global)
|
|
41
|
-
return join(nm, ".bin");
|
|
42
|
-
const prefix = dirname(nm);
|
|
43
|
-
if (opts.platform === "win32")
|
|
44
|
-
return prefix;
|
|
45
|
-
return join(prefix, "bin");
|
|
46
|
-
}
|
|
47
|
-
export function isGlobalInstall(env) {
|
|
48
|
-
return env.npm_config_global === "true";
|
|
49
|
-
}
|
|
50
|
-
function dirKey(dir, platform) {
|
|
51
|
-
const norm = dir.replace(/[\\/]+/g, "/");
|
|
52
|
-
if (platform === "win32")
|
|
53
|
-
return norm.toLowerCase();
|
|
54
|
-
return norm;
|
|
55
|
-
}
|
|
56
|
-
function ancestorBinDirs(pkgDir, stopDir, platform) {
|
|
57
|
-
const stop = dirKey(stopDir, platform);
|
|
58
|
-
const start = dirKey(pkgDir, platform);
|
|
59
|
-
const stopPrefix = stop.endsWith("/") ? stop : `${stop}/`;
|
|
60
|
-
if (start !== stop && !start.startsWith(stopPrefix)) {
|
|
61
|
-
return [join(stopDir, "node_modules", ".bin")];
|
|
62
|
-
}
|
|
63
|
-
const out = [];
|
|
64
|
-
let dir = pkgDir;
|
|
65
|
-
for (;;) {
|
|
66
|
-
out.push(join(dir, "node_modules", ".bin"));
|
|
67
|
-
if (dirKey(dir, platform) === stop)
|
|
68
|
-
break;
|
|
69
|
-
const parent = dirname(dir);
|
|
70
|
-
if (parent === dir)
|
|
71
|
-
break;
|
|
72
|
-
dir = parent;
|
|
73
|
-
}
|
|
74
|
-
return out;
|
|
75
|
-
}
|
|
76
|
-
export function candidateBinDirs(opts) {
|
|
77
|
-
const global = isGlobalInstall(opts.env);
|
|
78
|
-
const dirs = [];
|
|
79
|
-
if (packageIsUnderNodeModules(opts.pkgDir)) {
|
|
80
|
-
dirs.push(linkerBinDir({ pkgDir: opts.pkgDir, global, platform: opts.platform }));
|
|
81
|
-
}
|
|
82
|
-
if (global) {
|
|
83
|
-
const prefix = opts.env.npm_config_prefix;
|
|
84
|
-
if (prefix !== undefined && prefix.length > 0) {
|
|
85
|
-
dirs.push(opts.platform === "win32" ? prefix : join(prefix, "bin"));
|
|
86
|
-
}
|
|
87
|
-
// Candidate only. Removal still requires the .cmd to target this install.
|
|
88
|
-
const pnpmHome = opts.env.PNPM_HOME;
|
|
89
|
-
if (pnpmHome !== undefined && pnpmHome.length > 0)
|
|
90
|
-
dirs.push(pnpmHome);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
const localPrefix = opts.env.npm_config_local_prefix;
|
|
94
|
-
if (localPrefix !== undefined && localPrefix.length > 0) {
|
|
95
|
-
dirs.push(...ancestorBinDirs(opts.pkgDir, localPrefix, opts.platform));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
const seen = new Set();
|
|
99
|
-
const out = [];
|
|
100
|
-
for (const dir of dirs) {
|
|
101
|
-
const key = dirKey(dir, opts.platform);
|
|
102
|
-
if (seen.has(key))
|
|
103
|
-
continue;
|
|
104
|
-
seen.add(key);
|
|
105
|
-
out.push(dir);
|
|
106
|
-
}
|
|
107
|
-
return out;
|
|
108
|
-
}
|
|
109
|
-
function isSafeBinName(name) {
|
|
110
|
-
if (name.length === 0)
|
|
111
|
-
return false;
|
|
112
|
-
if (name.includes("/") || name.includes("\\") || name.includes(".."))
|
|
113
|
-
return false;
|
|
114
|
-
return true;
|
|
115
|
-
}
|
|
116
|
-
export function removeGeneratedPs1Shims(opts) {
|
|
117
|
-
if (opts.platform !== "win32")
|
|
118
|
-
return { removed: [], failed: [] };
|
|
119
|
-
const protect = new Set((opts.protectedNames ?? NODE_OWNED_SHIM_NAMES).map((name) => name.toLowerCase()));
|
|
120
|
-
const removed = [];
|
|
121
|
-
const failed = [];
|
|
122
|
-
for (const name of opts.binNames) {
|
|
123
|
-
if (!isSafeBinName(name) || protect.has(name.toLowerCase()))
|
|
124
|
-
continue;
|
|
125
|
-
const ps1 = join(opts.binDir, `${name}.ps1`);
|
|
126
|
-
const cmd = join(opts.binDir, `${name}.cmd`);
|
|
127
|
-
if (!existsSync(cmd) || !existsSync(ps1))
|
|
128
|
-
continue;
|
|
129
|
-
try {
|
|
130
|
-
unlinkSync(ps1);
|
|
131
|
-
removed.push(ps1);
|
|
132
|
-
}
|
|
133
|
-
catch {
|
|
134
|
-
failed.push(ps1);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return { removed, failed };
|
|
138
|
-
}
|
|
139
|
-
function normalizedWinPath(p) {
|
|
140
|
-
const norm = win32.normalize(p).replace(/[\\/]+/g, "\\");
|
|
141
|
-
const trimmed = norm.length > 3 && norm.endsWith("\\") ? norm.slice(0, -1) : norm;
|
|
142
|
-
return trimmed.toLowerCase();
|
|
143
|
-
}
|
|
144
|
-
function pathIsInside(root, target) {
|
|
145
|
-
const rootKey = normalizedWinPath(root);
|
|
146
|
-
const targetKey = normalizedWinPath(target);
|
|
147
|
-
return targetKey === rootKey || targetKey.startsWith(`${rootKey}\\`);
|
|
148
|
-
}
|
|
149
|
-
/** cmd-shim text is Windows-shaped. realpath needs host separators or a junction never matches. */
|
|
150
|
-
function hostPath(p) {
|
|
151
|
-
return p.replace(/\\/g, "/");
|
|
152
|
-
}
|
|
153
|
-
function realpathIsInside(root, target) {
|
|
154
|
-
try {
|
|
155
|
-
return pathIsInside(realpathSync(hostPath(root)), realpathSync(hostPath(target)));
|
|
156
|
-
}
|
|
157
|
-
catch {
|
|
158
|
-
return false;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
/** True when cmd-shim text records a target path inside this install. */
|
|
162
|
-
export function cmdShimTargetsPackage(cmdText, binDir, pkgDir) {
|
|
163
|
-
const re = /%(?:dp0%|~dp0)(?:\\+|\/+)([^"\r\n\s]+)/gi;
|
|
164
|
-
for (const match of cmdText.matchAll(re)) {
|
|
165
|
-
const rel = match[1];
|
|
166
|
-
if (rel === undefined || rel.length === 0)
|
|
167
|
-
continue;
|
|
168
|
-
const resolved = win32.normalize(win32.join(binDir, rel.replace(/\//g, "\\")));
|
|
169
|
-
if (pathIsInside(pkgDir, resolved) || realpathIsInside(pkgDir, resolved))
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
|
-
return false;
|
|
173
|
-
}
|
|
174
|
-
function cmdLinksCurrentInstall(binDir, name, pkgDir) {
|
|
175
|
-
if (!isSafeBinName(name))
|
|
176
|
-
return false;
|
|
177
|
-
let text;
|
|
178
|
-
try {
|
|
179
|
-
text = readFileSync(join(binDir, `${name}.cmd`), "utf8");
|
|
180
|
-
}
|
|
181
|
-
catch {
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
return cmdShimTargetsPackage(text, binDir, pkgDir);
|
|
185
|
-
}
|
|
186
|
-
export function readPackageBinNames(packageJsonText) {
|
|
187
|
-
let parsed;
|
|
188
|
-
try {
|
|
189
|
-
parsed = JSON.parse(packageJsonText);
|
|
190
|
-
}
|
|
191
|
-
catch {
|
|
192
|
-
return [];
|
|
193
|
-
}
|
|
194
|
-
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
195
|
-
return [];
|
|
196
|
-
const bin = parsed.bin;
|
|
197
|
-
if (bin === null || typeof bin !== "object" || Array.isArray(bin))
|
|
198
|
-
return [];
|
|
199
|
-
return Object.keys(bin);
|
|
200
|
-
}
|
|
201
|
-
export function removeInstalledWindowsPs1Shims(opts) {
|
|
202
|
-
if (opts.platform !== "win32")
|
|
203
|
-
return { removed: [], failed: [] };
|
|
204
|
-
const readText = opts.readText ?? ((path) => readFileSync(path, "utf8"));
|
|
205
|
-
let names;
|
|
206
|
-
try {
|
|
207
|
-
names = readPackageBinNames(readText(join(opts.pkgDir, "package.json")));
|
|
208
|
-
}
|
|
209
|
-
catch {
|
|
210
|
-
names = PACKAGE_BIN_NAMES;
|
|
211
|
-
}
|
|
212
|
-
const removed = [];
|
|
213
|
-
const failed = [];
|
|
214
|
-
for (const binDir of candidateBinDirs(opts)) {
|
|
215
|
-
const linked = names.filter((name) => cmdLinksCurrentInstall(binDir, name, opts.pkgDir));
|
|
216
|
-
const result = removeGeneratedPs1Shims({
|
|
217
|
-
binDir,
|
|
218
|
-
binNames: linked,
|
|
219
|
-
platform: opts.platform,
|
|
220
|
-
});
|
|
221
|
-
removed.push(...result.removed);
|
|
222
|
-
failed.push(...result.failed);
|
|
223
|
-
}
|
|
224
|
-
return { removed, failed };
|
|
225
|
-
}
|
|
226
|
-
//# sourceMappingURL=windows-bin-ps1.js.map
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export interface CommandCapture {
|
|
2
|
-
readonly exitCode: number;
|
|
3
|
-
readonly stdout: string;
|
|
4
|
-
readonly stderr: string;
|
|
5
|
-
}
|
|
6
|
-
export interface WipFixtureOptions {
|
|
7
|
-
readonly plan?: Record<string, unknown>;
|
|
8
|
-
readonly pendingFiles?: number;
|
|
9
|
-
readonly activeFiles?: number;
|
|
10
|
-
}
|
|
11
|
-
export interface ParityCase {
|
|
12
|
-
readonly name: string;
|
|
13
|
-
readonly argv: string[];
|
|
14
|
-
readonly fixture?: WipFixtureOptions;
|
|
15
|
-
}
|
|
16
|
-
export interface ParityDiff {
|
|
17
|
-
readonly caseName: string;
|
|
18
|
-
readonly exitMismatch: boolean;
|
|
19
|
-
readonly stdoutMismatch: boolean;
|
|
20
|
-
readonly stderrMismatch: boolean;
|
|
21
|
-
readonly pythonExit: number;
|
|
22
|
-
readonly tsExit: number;
|
|
23
|
-
}
|
|
24
|
-
export interface ParityResult {
|
|
25
|
-
readonly ok: boolean;
|
|
26
|
-
readonly diffs: ParityDiff[];
|
|
27
|
-
}
|
|
28
|
-
/** Strip volatile absolute paths before compare. */
|
|
29
|
-
export declare function normalizeOutput(text: string): string;
|
|
30
|
-
/** Build a throwaway project root with optional PROJECT-DEFINITION and WIP files. */
|
|
31
|
-
export declare function buildFixtureRepo(options?: WipFixtureOptions): string;
|
|
32
|
-
/** Diff one parity case between Python oracle and TS CLI. */
|
|
33
|
-
export declare function diffCase(python: CommandCapture, ts: CommandCapture, caseName: string): ParityDiff;
|
|
34
|
-
export declare const PARITY_CASES: readonly ParityCase[];
|
|
35
|
-
/** Run all parity cases; returns aggregate result. */
|
|
36
|
-
export declare function renderReport(result: ParityResult): string;
|
|
37
|
-
//# sourceMappingURL=wip-cap-fixtures.d.ts.map
|
package/dist/wip-cap-fixtures.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/** Test fixtures extracted from legacy parity harness (#2083). */
|
|
2
|
-
import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
/** Strip volatile absolute paths before compare. */
|
|
6
|
-
export function normalizeOutput(text) {
|
|
7
|
-
return text.replace(/project_root=[^\s)]+/g, "project_root=<ROOT>");
|
|
8
|
-
}
|
|
9
|
-
function writeProjectDefinition(root, plan) {
|
|
10
|
-
const dir = join(root, "xbrief");
|
|
11
|
-
mkdirSync(dir, { recursive: true });
|
|
12
|
-
writeFileSync(join(dir, "PROJECT-DEFINITION.xbrief.json"), `${JSON.stringify({
|
|
13
|
-
xBRIEFInfo: { version: "0.8" },
|
|
14
|
-
plan: { title: "T", status: "running", items: [], ...plan },
|
|
15
|
-
}, null, 2)}\n`, { encoding: "utf8" });
|
|
16
|
-
}
|
|
17
|
-
function writeXbrief(root, folder, name) {
|
|
18
|
-
const dir = join(root, "xbrief", folder);
|
|
19
|
-
mkdirSync(dir, { recursive: true });
|
|
20
|
-
writeFileSync(join(dir, name), `${JSON.stringify({ xBRIEFInfo: { version: "0.8" }, plan: { status: "approved", title: "T", items: [] } })}\n`, { encoding: "utf8" });
|
|
21
|
-
}
|
|
22
|
-
/** Build a throwaway project root with optional PROJECT-DEFINITION and WIP files. */
|
|
23
|
-
export function buildFixtureRepo(options = {}) {
|
|
24
|
-
const root = mkdtempSync(join(tmpdir(), "deft-wip-cap-parity-"));
|
|
25
|
-
mkdirSync(join(root, "xbrief"), { recursive: true });
|
|
26
|
-
if (options.plan !== undefined) {
|
|
27
|
-
writeProjectDefinition(root, options.plan);
|
|
28
|
-
}
|
|
29
|
-
for (let i = 0; i < (options.pendingFiles ?? 0); i += 1) {
|
|
30
|
-
writeXbrief(root, "pending", `pending-${i}.xbrief.json`);
|
|
31
|
-
}
|
|
32
|
-
for (let i = 0; i < (options.activeFiles ?? 0); i += 1) {
|
|
33
|
-
writeXbrief(root, "active", `active-${i}.xbrief.json`);
|
|
34
|
-
}
|
|
35
|
-
return root;
|
|
36
|
-
}
|
|
37
|
-
/** Diff one parity case between Python oracle and TS CLI. */
|
|
38
|
-
export function diffCase(python, ts, caseName) {
|
|
39
|
-
const pyOut = normalizeOutput(python.stdout);
|
|
40
|
-
const tsOut = normalizeOutput(ts.stdout);
|
|
41
|
-
const pyErr = normalizeOutput(python.stderr);
|
|
42
|
-
const tsErr = normalizeOutput(ts.stderr);
|
|
43
|
-
return {
|
|
44
|
-
caseName,
|
|
45
|
-
exitMismatch: python.exitCode !== ts.exitCode,
|
|
46
|
-
stdoutMismatch: pyOut !== tsOut,
|
|
47
|
-
stderrMismatch: pyErr !== tsErr,
|
|
48
|
-
pythonExit: python.exitCode,
|
|
49
|
-
tsExit: ts.exitCode,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export const PARITY_CASES = [
|
|
53
|
-
{
|
|
54
|
-
name: "within-cap-typed-empty",
|
|
55
|
-
argv: [],
|
|
56
|
-
fixture: { plan: { policy: { wipCap: 5 } } },
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: "within-cap-with-files",
|
|
60
|
-
argv: [],
|
|
61
|
-
fixture: {
|
|
62
|
-
plan: { policy: { wipCap: 5 } },
|
|
63
|
-
pendingFiles: 2,
|
|
64
|
-
activeFiles: 1,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: "over-cap-refusal",
|
|
69
|
-
argv: [],
|
|
70
|
-
fixture: {
|
|
71
|
-
plan: { policy: { wipCap: 2 } },
|
|
72
|
-
pendingFiles: 1,
|
|
73
|
-
activeFiles: 1,
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "over-cap-allow-flag",
|
|
78
|
-
argv: ["--allow-over-cap"],
|
|
79
|
-
fixture: {
|
|
80
|
-
plan: { policy: { wipCap: 2 } },
|
|
81
|
-
pendingFiles: 2,
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: "malformed-wipCap",
|
|
86
|
-
argv: [],
|
|
87
|
-
fixture: { plan: { policy: { wipCap: -1 } } },
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: "within-cap-quiet",
|
|
91
|
-
argv: ["--quiet"],
|
|
92
|
-
fixture: { plan: { policy: { wipCap: 3 } }, pendingFiles: 1 },
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: "over-cap-allow-quiet",
|
|
96
|
-
argv: ["--allow-over-cap", "--quiet"],
|
|
97
|
-
fixture: {
|
|
98
|
-
plan: { policy: { wipCap: 1 } },
|
|
99
|
-
pendingFiles: 2,
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
];
|
|
103
|
-
/** Run all parity cases; returns aggregate result. */
|
|
104
|
-
export function renderReport(result) {
|
|
105
|
-
if (result.ok) {
|
|
106
|
-
return `verify:wip-cap parity: CLEAN -- Python and TS agree on ${PARITY_CASES.length} cases.`;
|
|
107
|
-
}
|
|
108
|
-
const lines = ["verify:wip-cap parity: DIVERGENCE"];
|
|
109
|
-
for (const d of result.diffs) {
|
|
110
|
-
if (d.exitMismatch || d.stdoutMismatch || d.stderrMismatch) {
|
|
111
|
-
lines.push(` case: ${d.caseName}`);
|
|
112
|
-
if (d.exitMismatch)
|
|
113
|
-
lines.push(` exit: python=${d.pythonExit} ts=${d.tsExit}`);
|
|
114
|
-
if (d.stdoutMismatch)
|
|
115
|
-
lines.push(" stdout mismatch");
|
|
116
|
-
if (d.stderrMismatch)
|
|
117
|
-
lines.push(" stderr mismatch");
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return lines.join("\n");
|
|
121
|
-
}
|
|
122
|
-
//# sourceMappingURL=wip-cap-fixtures.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared live WSL ownership gate for protected mutating CLI entry points (#1617).
|
|
3
|
-
* Independent of ritual/doctor cache. ownership:doctor/fix are not gated here.
|
|
4
|
-
*/
|
|
5
|
-
import { assertProtectedMutationOwnership } from "@deftai/directive-core/platform";
|
|
6
|
-
export function refuseIfWslOwnershipBlocked(projectRoot, writeErr = (text) => {
|
|
7
|
-
process.stderr.write(text);
|
|
8
|
-
}) {
|
|
9
|
-
const gate = assertProtectedMutationOwnership({ projectRoot });
|
|
10
|
-
if (gate.ok)
|
|
11
|
-
return null;
|
|
12
|
-
writeErr(`${gate.message}\n`);
|
|
13
|
-
return gate.exitCode;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=wsl-ownership-guard.js.map
|
package/dist/xbrief-create.d.ts
DELETED
package/dist/xbrief-create.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { runXbriefCreateCli } from "@deftai/directive-core/xbrief";
|
|
3
|
-
const result = runXbriefCreateCli(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=xbrief-create.js.map
|
package/dist/xbrief-verify.d.ts
DELETED
package/dist/xbrief-verify.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { runXbriefVerifyCli } from "@deftai/directive-core/xbrief";
|
|
3
|
-
const result = runXbriefVerifyCli(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=xbrief-verify.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* postinstall entry (#4654). The published tarball includes dist/.
|
|
3
|
-
* A workspace install before tsc has no linked shims yet, so a missing
|
|
4
|
-
* dist file is a no-op rather than a failed install.
|
|
5
|
-
*/
|
|
6
|
-
import { existsSync } from "node:fs";
|
|
7
|
-
import { dirname, join } from "node:path";
|
|
8
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
|
-
|
|
10
|
-
const pkgDir = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
11
|
-
const entry = join(pkgDir, "dist", "windows-bin-ps1.js");
|
|
12
|
-
|
|
13
|
-
if (existsSync(entry)) {
|
|
14
|
-
const mod = await import(pathToFileURL(entry).href);
|
|
15
|
-
const result = mod.removeInstalledWindowsPs1Shims({
|
|
16
|
-
pkgDir,
|
|
17
|
-
env: process.env,
|
|
18
|
-
platform: process.platform,
|
|
19
|
-
});
|
|
20
|
-
if (result.failed.length > 0) {
|
|
21
|
-
process.stderr.write(
|
|
22
|
-
`remove-windows-ps1-shims: could not remove ${result.failed.join(", ")}\n`,
|
|
23
|
-
);
|
|
24
|
-
process.exitCode = 1;
|
|
25
|
-
}
|
|
26
|
-
}
|