@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
|
@@ -1,131 +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
|
|
8
|
-
.replace(/--project-root [^\s]+/g, "--project-root <ROOT>")
|
|
9
|
-
.replace(/--cache-root [^\s]+/g, "--cache-root <ROOT>")
|
|
10
|
-
.replace(/path=[^\s\n]+coverage\.json/g, "path=<ROOT>/coverage.json");
|
|
11
|
-
}
|
|
12
|
-
function writeProjectDefinition(root, policy = {}) {
|
|
13
|
-
const dir = join(root, "xbrief");
|
|
14
|
-
mkdirSync(dir, { recursive: true });
|
|
15
|
-
writeFileSync(join(dir, "PROJECT-DEFINITION.xbrief.json"), `${JSON.stringify({
|
|
16
|
-
xBRIEFInfo: { version: "0.8" },
|
|
17
|
-
plan: { title: "T", status: "running", items: [], policy },
|
|
18
|
-
}, null, 2)}\n`, "utf8");
|
|
19
|
-
}
|
|
20
|
-
export function buildFixtureRepo(options = {}) {
|
|
21
|
-
const root = mkdtempSync(join(tmpdir(), "deft-triage-scope-parity-"));
|
|
22
|
-
mkdirSync(join(root, "xbrief"), { recursive: true });
|
|
23
|
-
writeProjectDefinition(root, options.policy ?? {});
|
|
24
|
-
return root;
|
|
25
|
-
}
|
|
26
|
-
export function diffCase(python, ts, caseName) {
|
|
27
|
-
const pyOut = normalizeOutput(python.stdout);
|
|
28
|
-
const tsOut = normalizeOutput(ts.stdout);
|
|
29
|
-
const pyErr = normalizeOutput(python.stderr);
|
|
30
|
-
const tsErr = normalizeOutput(ts.stderr);
|
|
31
|
-
return {
|
|
32
|
-
caseName,
|
|
33
|
-
exitMismatch: python.exitCode !== ts.exitCode,
|
|
34
|
-
stdoutMismatch: pyOut !== tsOut,
|
|
35
|
-
stderrMismatch: pyErr !== tsErr,
|
|
36
|
-
pythonExit: python.exitCode,
|
|
37
|
-
tsExit: ts.exitCode,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export const PARITY_CASES = [
|
|
41
|
-
{
|
|
42
|
-
name: "list-default",
|
|
43
|
-
argv: ["--list"],
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: "list-custom-scope-ignores",
|
|
47
|
-
argv: ["--list"],
|
|
48
|
-
fixture: {
|
|
49
|
-
policy: {
|
|
50
|
-
triageScope: [{ rule: "labels", "any-of": ["bug"] }],
|
|
51
|
-
triageScopeIgnores: [
|
|
52
|
-
{ label: "wontfix" },
|
|
53
|
-
{ rule: "author", "any-of": ["dependabot[bot]"] },
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: "add-label",
|
|
60
|
-
argv: ["--add-label=priority:p0"],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: "add-milestone",
|
|
64
|
-
argv: ["--add-milestone=v2.0-blocker"],
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: "ignore-label",
|
|
68
|
-
argv: ["--ignore-label=wontfix"],
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: "mutations-mutually-exclusive",
|
|
72
|
-
argv: ["--add-label=bug", "--ignore-label=wontfix"],
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: "diff-from-upstream-missing-repo",
|
|
76
|
-
argv: ["--diff-from-upstream"],
|
|
77
|
-
fixture: { policy: {} },
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: "refresh-denominator-missing-repo",
|
|
81
|
-
argv: ["--refresh-denominator", "--count", "10"],
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "invalid-project-root",
|
|
85
|
-
argv: ["--list"],
|
|
86
|
-
fixture: undefined,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: "schema-error",
|
|
90
|
-
argv: ["--list"],
|
|
91
|
-
fixture: {
|
|
92
|
-
policy: {
|
|
93
|
-
triageScope: [{ rule: "bogus-type" }],
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: "refresh-denominator-success",
|
|
99
|
-
argv: [
|
|
100
|
-
"--refresh-denominator",
|
|
101
|
-
"--repo",
|
|
102
|
-
"deftai/directive",
|
|
103
|
-
"--count",
|
|
104
|
-
"247",
|
|
105
|
-
"--source",
|
|
106
|
-
"github-issue",
|
|
107
|
-
],
|
|
108
|
-
fixture: {
|
|
109
|
-
policy: { triageScope: [{ rule: "all-open" }] },
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
];
|
|
113
|
-
export function renderReport(result) {
|
|
114
|
-
if (result.ok) {
|
|
115
|
-
return `triage:scope parity: CLEAN -- Python and TS agree on ${PARITY_CASES.length} cases.`;
|
|
116
|
-
}
|
|
117
|
-
const lines = ["triage:scope parity: DIVERGENCE"];
|
|
118
|
-
for (const d of result.diffs) {
|
|
119
|
-
if (d.exitMismatch || d.stdoutMismatch || d.stderrMismatch) {
|
|
120
|
-
lines.push(` case: ${d.caseName}`);
|
|
121
|
-
if (d.exitMismatch)
|
|
122
|
-
lines.push(` exit: python=${d.pythonExit} ts=${d.tsExit}`);
|
|
123
|
-
if (d.stdoutMismatch)
|
|
124
|
-
lines.push(" stdout mismatch");
|
|
125
|
-
if (d.stderrMismatch)
|
|
126
|
-
lines.push(" stderr mismatch");
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return lines.join("\n");
|
|
130
|
-
}
|
|
131
|
-
//# sourceMappingURL=triage-scope-fixtures.js.map
|
package/dist/triage-scope.d.ts
DELETED
package/dist/triage-scope.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Thin CLI entry for triage:scope (#1725).
|
|
4
|
-
* Delegates to the core implementation at packages/core/dist/triage/scope/cli.js.
|
|
5
|
-
*/
|
|
6
|
-
import { spawnSync } from "node:child_process";
|
|
7
|
-
import { createRequire } from "node:module";
|
|
8
|
-
import { fileURLToPath } from "node:url";
|
|
9
|
-
const require = createRequire(import.meta.url);
|
|
10
|
-
// Resolve the core CLI by its published package name so it works both in the
|
|
11
|
-
// source monorepo and under a flattened npm install (#1993). The bare specifier
|
|
12
|
-
// resolves via @deftai/directive-core's "./dist/*.js" export map; a hand-built
|
|
13
|
-
// relative path would point at the non-existent "@deftai/core" once published.
|
|
14
|
-
function coreCliPath() {
|
|
15
|
-
return require.resolve("@deftai/directive-core/dist/triage/scope/cli.js");
|
|
16
|
-
}
|
|
17
|
-
/** Run triage:scope with argv; returns process exit code. */
|
|
18
|
-
export function run(argv) {
|
|
19
|
-
const result = spawnSync(process.execPath, [coreCliPath(), ...argv], {
|
|
20
|
-
encoding: "utf8",
|
|
21
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
22
|
-
});
|
|
23
|
-
if (typeof result.stdout === "string" && result.stdout.length > 0) {
|
|
24
|
-
process.stdout.write(result.stdout);
|
|
25
|
-
}
|
|
26
|
-
if (typeof result.stderr === "string" && result.stderr.length > 0) {
|
|
27
|
-
process.stderr.write(result.stderr);
|
|
28
|
-
}
|
|
29
|
-
return result.status ?? 2;
|
|
30
|
-
}
|
|
31
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
32
|
-
process.exit(run(process.argv.slice(2)));
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=triage-scope.js.map
|
package/dist/triage-smoketest.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, statSync } from "node:fs";
|
|
3
|
-
import { dirname, join, resolve } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { interceptHelp } from "@deftai/directive-core/dist/triage/help/index.js";
|
|
6
|
-
import { DEFAULT_FIXTURE_REL, parseSmoketestArgs, runSmoketest, } from "@deftai/directive-core/dist/triage/smoketest/index.js";
|
|
7
|
-
function resolveDeftRoot() {
|
|
8
|
-
if (process.env.DEFT_ROOT !== undefined && process.env.DEFT_ROOT.length > 0) {
|
|
9
|
-
return resolve(process.env.DEFT_ROOT);
|
|
10
|
-
}
|
|
11
|
-
return resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "..");
|
|
12
|
-
}
|
|
13
|
-
export function run(argv) {
|
|
14
|
-
const helpRc = interceptHelp("triage_smoketest", argv);
|
|
15
|
-
if (helpRc !== null) {
|
|
16
|
-
return helpRc;
|
|
17
|
-
}
|
|
18
|
-
const args = parseSmoketestArgs(argv);
|
|
19
|
-
if (args.error !== undefined) {
|
|
20
|
-
process.stderr.write(`${args.error}\n`);
|
|
21
|
-
return 2;
|
|
22
|
-
}
|
|
23
|
-
if (args.showHelp) {
|
|
24
|
-
return 0;
|
|
25
|
-
}
|
|
26
|
-
const deftRoot = resolveDeftRoot();
|
|
27
|
-
const fixtureRoot = resolve(args.fixture !== "" ? args.fixture : join(deftRoot, DEFAULT_FIXTURE_REL));
|
|
28
|
-
if (!existsSync(fixtureRoot) || !statSync(fixtureRoot).isDirectory()) {
|
|
29
|
-
process.stderr.write(`[triage:smoketest] FAIL: fixture root ${fixtureRoot} does not exist ` +
|
|
30
|
-
"or is not a directory.\n");
|
|
31
|
-
return 1;
|
|
32
|
-
}
|
|
33
|
-
return runSmoketest(fixtureRoot, {
|
|
34
|
-
verbose: args.verbose,
|
|
35
|
-
keepTempdir: args.keepTempdir,
|
|
36
|
-
cacheOnly: args.cacheOnly,
|
|
37
|
-
deftRoot,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
41
|
-
process.exit(run(process.argv.slice(2)));
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=triage-smoketest.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { type ListWithdrawnChipIssues } from "@deftai/directive-core/dist/triage/classify/withdraw.js";
|
|
3
|
-
import type { LabelClient } from "@deftai/directive-core/dist/vbrief-reconcile/types.js";
|
|
4
|
-
export interface StripParsedArgs {
|
|
5
|
-
projectRoot: string;
|
|
6
|
-
apply: boolean;
|
|
7
|
-
json: boolean;
|
|
8
|
-
emitDigest: boolean;
|
|
9
|
-
repo: string | null;
|
|
10
|
-
error?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function parseStripArgs(argv: string[]): StripParsedArgs;
|
|
13
|
-
export interface StripRunOptions {
|
|
14
|
-
readonly labelClient?: LabelClient;
|
|
15
|
-
readonly resolveDefaultRepo?: () => string | null;
|
|
16
|
-
readonly listIssues?: ListWithdrawnChipIssues;
|
|
17
|
-
}
|
|
18
|
-
export declare function runStripWithdrawn(argv: string[], options?: StripRunOptions): number;
|
|
19
|
-
/** Dispatch handler name (`CLI_MODULE_VERBS` looks for `run`). */
|
|
20
|
-
export declare const run: typeof runStripWithdrawn;
|
|
21
|
-
//# sourceMappingURL=triage-strip-withdrawn.d.ts.map
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { resolveRepoFromGitOrigin } from "@deftai/directive-core/dist/scm/design-critique-chip.js";
|
|
4
|
-
import { classifyIssue, resolveClassifyRules, resolveHoldMarkers, } from "@deftai/directive-core/dist/triage/classify/index.js";
|
|
5
|
-
import { CLASSIFY_MIRROR_WITHDRAWN_MESSAGE, stripWithdrawnChips, } from "@deftai/directive-core/dist/triage/classify/withdraw.js";
|
|
6
|
-
export function parseStripArgs(argv) {
|
|
7
|
-
const parsed = {
|
|
8
|
-
projectRoot: ".",
|
|
9
|
-
apply: false,
|
|
10
|
-
json: false,
|
|
11
|
-
emitDigest: false,
|
|
12
|
-
repo: null,
|
|
13
|
-
};
|
|
14
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
15
|
-
const arg = argv[i];
|
|
16
|
-
if (arg === "--apply") {
|
|
17
|
-
parsed.apply = true;
|
|
18
|
-
}
|
|
19
|
-
else if (arg === "--json") {
|
|
20
|
-
parsed.json = true;
|
|
21
|
-
}
|
|
22
|
-
else if (arg === "--emit-digest") {
|
|
23
|
-
parsed.emitDigest = true;
|
|
24
|
-
}
|
|
25
|
-
else if (arg === "--repo") {
|
|
26
|
-
const value = argv[i + 1];
|
|
27
|
-
if (value === undefined) {
|
|
28
|
-
return { ...parsed, error: "argument --repo: expected one argument" };
|
|
29
|
-
}
|
|
30
|
-
parsed.repo = value;
|
|
31
|
-
i += 1;
|
|
32
|
-
}
|
|
33
|
-
else if (arg?.startsWith("--repo=")) {
|
|
34
|
-
parsed.repo = arg.slice("--repo=".length);
|
|
35
|
-
}
|
|
36
|
-
else if (arg === "--project-root") {
|
|
37
|
-
const value = argv[i + 1];
|
|
38
|
-
if (value === undefined) {
|
|
39
|
-
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
40
|
-
}
|
|
41
|
-
parsed.projectRoot = value;
|
|
42
|
-
i += 1;
|
|
43
|
-
}
|
|
44
|
-
else if (arg?.startsWith("--project-root=")) {
|
|
45
|
-
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
46
|
-
}
|
|
47
|
-
else if (arg === "--help" || arg === "-h") {
|
|
48
|
-
return parsed;
|
|
49
|
-
}
|
|
50
|
-
else if (arg === "--") {
|
|
51
|
-
}
|
|
52
|
-
else if (arg?.startsWith("-")) {
|
|
53
|
-
return { ...parsed, error: `unrecognized arguments: ${arg}` };
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return parsed;
|
|
57
|
-
}
|
|
58
|
-
export function runStripWithdrawn(argv, options = {}) {
|
|
59
|
-
const args = parseStripArgs(argv);
|
|
60
|
-
if (args.error !== undefined) {
|
|
61
|
-
process.stderr.write(`ERR: ${args.error}\n`);
|
|
62
|
-
return 2;
|
|
63
|
-
}
|
|
64
|
-
const repo = args.repo ?? (options.resolveDefaultRepo ?? resolveRepoFromGitOrigin)();
|
|
65
|
-
if (repo === null || repo.length === 0) {
|
|
66
|
-
process.stderr.write("ERR: missing --repo OWNER/NAME (could not resolve from git origin)\n");
|
|
67
|
-
return 2;
|
|
68
|
-
}
|
|
69
|
-
const rules = resolveClassifyRules({ projectRoot: args.projectRoot });
|
|
70
|
-
const holdMarkers = resolveHoldMarkers({ projectRoot: args.projectRoot });
|
|
71
|
-
const [code, outcome] = stripWithdrawnChips({
|
|
72
|
-
repo,
|
|
73
|
-
dryRun: !args.apply,
|
|
74
|
-
emitDigest: args.emitDigest,
|
|
75
|
-
classify: args.emitDigest
|
|
76
|
-
? (issue, opts) => classifyIssue(issue, {
|
|
77
|
-
rules: opts?.rules ?? rules,
|
|
78
|
-
holdMarkers: opts?.holdMarkers ?? holdMarkers,
|
|
79
|
-
})
|
|
80
|
-
: undefined,
|
|
81
|
-
rules,
|
|
82
|
-
holdMarkers,
|
|
83
|
-
...(options.labelClient !== undefined ? { client: options.labelClient } : {}),
|
|
84
|
-
...(options.listIssues !== undefined ? { listIssues: options.listIssues } : {}),
|
|
85
|
-
});
|
|
86
|
-
if (args.json) {
|
|
87
|
-
process.stdout.write(`${JSON.stringify(outcome, null, 2)}\n`);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
process.stdout.write(`strip-withdrawn-chips repo=${outcome.repo} dry-run=${outcome.dry_run} ` +
|
|
91
|
-
`scanned=${outcome.scanned} planned=${outcome.planned} applied=${outcome.applied} ` +
|
|
92
|
-
`unchanged=${outcome.unchanged} errors=${outcome.errors}\n`);
|
|
93
|
-
process.stdout.write(`${CLASSIFY_MIRROR_WITHDRAWN_MESSAGE}\n`);
|
|
94
|
-
}
|
|
95
|
-
return code;
|
|
96
|
-
}
|
|
97
|
-
/** Dispatch handler name (`CLI_MODULE_VERBS` looks for `run`). */
|
|
98
|
-
export const run = runStripWithdrawn;
|
|
99
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
100
|
-
process.exit(runStripWithdrawn(process.argv.slice(2)));
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=triage-strip-withdrawn.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
interface ParsedArgs {
|
|
3
|
-
op: string;
|
|
4
|
-
projectRoot: string;
|
|
5
|
-
label: string | null;
|
|
6
|
-
milestone: string | null;
|
|
7
|
-
issue: number | null;
|
|
8
|
-
issueNote: string;
|
|
9
|
-
actor: string | null;
|
|
10
|
-
error?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
13
|
-
export declare function run(argv: string[]): number;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=triage-subscribe.d.ts.map
|
package/dist/triage-subscribe.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, statSync } from "node:fs";
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { interceptHelp } from "@deftai/directive-core/dist/triage/help/index.js";
|
|
6
|
-
import { RECONCILE_HINT, subscribe, unsubscribe, } from "@deftai/directive-core/dist/triage/subscribe/index.js";
|
|
7
|
-
export function parseArgs(argv) {
|
|
8
|
-
const parsed = {
|
|
9
|
-
op: "",
|
|
10
|
-
projectRoot: process.env.DEFT_PROJECT_ROOT ?? ".",
|
|
11
|
-
label: null,
|
|
12
|
-
milestone: null,
|
|
13
|
-
issue: null,
|
|
14
|
-
issueNote: "added via task triage:subscribe",
|
|
15
|
-
actor: null,
|
|
16
|
-
};
|
|
17
|
-
const positional = [];
|
|
18
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
19
|
-
const arg = argv[i];
|
|
20
|
-
if (arg === undefined)
|
|
21
|
-
continue;
|
|
22
|
-
if (arg === "--project-root") {
|
|
23
|
-
const value = argv[i + 1];
|
|
24
|
-
if (value === undefined) {
|
|
25
|
-
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
26
|
-
}
|
|
27
|
-
parsed.projectRoot = value;
|
|
28
|
-
i += 1;
|
|
29
|
-
}
|
|
30
|
-
else if (arg.startsWith("--project-root=")) {
|
|
31
|
-
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
32
|
-
}
|
|
33
|
-
else if (arg === "--label") {
|
|
34
|
-
const value = argv[i + 1];
|
|
35
|
-
if (value === undefined) {
|
|
36
|
-
return { ...parsed, error: "argument --label: expected one argument" };
|
|
37
|
-
}
|
|
38
|
-
parsed.label = value;
|
|
39
|
-
i += 1;
|
|
40
|
-
}
|
|
41
|
-
else if (arg.startsWith("--label=")) {
|
|
42
|
-
parsed.label = arg.slice("--label=".length);
|
|
43
|
-
}
|
|
44
|
-
else if (arg === "--milestone") {
|
|
45
|
-
const value = argv[i + 1];
|
|
46
|
-
if (value === undefined) {
|
|
47
|
-
return { ...parsed, error: "argument --milestone: expected one argument" };
|
|
48
|
-
}
|
|
49
|
-
parsed.milestone = value;
|
|
50
|
-
i += 1;
|
|
51
|
-
}
|
|
52
|
-
else if (arg.startsWith("--milestone=")) {
|
|
53
|
-
parsed.milestone = arg.slice("--milestone=".length);
|
|
54
|
-
}
|
|
55
|
-
else if (arg === "--issue") {
|
|
56
|
-
const value = argv[i + 1];
|
|
57
|
-
if (value === undefined) {
|
|
58
|
-
return { ...parsed, error: "argument --issue: expected one argument" };
|
|
59
|
-
}
|
|
60
|
-
parsed.issue = Number.parseInt(value, 10);
|
|
61
|
-
i += 1;
|
|
62
|
-
}
|
|
63
|
-
else if (arg.startsWith("--issue=")) {
|
|
64
|
-
parsed.issue = Number.parseInt(arg.slice("--issue=".length), 10);
|
|
65
|
-
}
|
|
66
|
-
else if (arg === "--issue-note") {
|
|
67
|
-
const value = argv[i + 1];
|
|
68
|
-
if (value === undefined) {
|
|
69
|
-
return { ...parsed, error: "argument --issue-note: expected one argument" };
|
|
70
|
-
}
|
|
71
|
-
parsed.issueNote = value;
|
|
72
|
-
i += 1;
|
|
73
|
-
}
|
|
74
|
-
else if (arg.startsWith("--issue-note=")) {
|
|
75
|
-
parsed.issueNote = arg.slice("--issue-note=".length);
|
|
76
|
-
}
|
|
77
|
-
else if (arg === "--actor") {
|
|
78
|
-
const value = argv[i + 1];
|
|
79
|
-
if (value === undefined) {
|
|
80
|
-
return { ...parsed, error: "argument --actor: expected one argument" };
|
|
81
|
-
}
|
|
82
|
-
parsed.actor = value;
|
|
83
|
-
i += 1;
|
|
84
|
-
}
|
|
85
|
-
else if (arg.startsWith("--actor=")) {
|
|
86
|
-
parsed.actor = arg.slice("--actor=".length);
|
|
87
|
-
}
|
|
88
|
-
else if (arg.startsWith("-")) {
|
|
89
|
-
return { ...parsed, error: `unrecognized arguments: ${arg}` };
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
positional.push(arg);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (positional.length > 0 && positional[0] !== undefined) {
|
|
96
|
-
parsed.op = positional[0];
|
|
97
|
-
}
|
|
98
|
-
return parsed;
|
|
99
|
-
}
|
|
100
|
-
export function run(argv) {
|
|
101
|
-
const helpRc = interceptHelp("triage_subscribe", argv);
|
|
102
|
-
if (helpRc !== null) {
|
|
103
|
-
return helpRc;
|
|
104
|
-
}
|
|
105
|
-
const args = parseArgs(argv);
|
|
106
|
-
if (args.error !== undefined) {
|
|
107
|
-
process.stderr.write(`${args.error}\n`);
|
|
108
|
-
return 2;
|
|
109
|
-
}
|
|
110
|
-
if (args.op !== "subscribe" && args.op !== "unsubscribe") {
|
|
111
|
-
process.stderr.write("triage:subscribe: first positional arg must be 'subscribe' or " +
|
|
112
|
-
"'unsubscribe'; e.g. task triage:subscribe -- --label=bug\n");
|
|
113
|
-
return 2;
|
|
114
|
-
}
|
|
115
|
-
const projectRoot = resolve(args.projectRoot);
|
|
116
|
-
if (!existsSync(projectRoot) || !statSync(projectRoot).isDirectory()) {
|
|
117
|
-
process.stderr.write(`triage:${args.op}: --project-root ${projectRoot} does not exist ` +
|
|
118
|
-
"or is not a directory.\n");
|
|
119
|
-
return 2;
|
|
120
|
-
}
|
|
121
|
-
const chosen = [args.label, args.milestone, args.issue].filter((v) => v !== null).length;
|
|
122
|
-
if (chosen !== 1) {
|
|
123
|
-
process.stderr.write(`triage:${args.op}: exactly one of --label / --milestone / --issue is required.\n`);
|
|
124
|
-
return 2;
|
|
125
|
-
}
|
|
126
|
-
try {
|
|
127
|
-
const [changed, message] = args.op === "subscribe"
|
|
128
|
-
? subscribe(projectRoot, {
|
|
129
|
-
label: args.label,
|
|
130
|
-
milestone: args.milestone,
|
|
131
|
-
issue: args.issue,
|
|
132
|
-
issueNote: args.issueNote,
|
|
133
|
-
actor: args.actor,
|
|
134
|
-
})
|
|
135
|
-
: unsubscribe(projectRoot, {
|
|
136
|
-
label: args.label,
|
|
137
|
-
milestone: args.milestone,
|
|
138
|
-
issue: args.issue,
|
|
139
|
-
actor: args.actor,
|
|
140
|
-
});
|
|
141
|
-
if (!changed) {
|
|
142
|
-
process.stderr.write(`triage:${args.op}: ${message} (no-op).\n`);
|
|
143
|
-
return 0;
|
|
144
|
-
}
|
|
145
|
-
process.stdout.write(`triage:${args.op}: ${message}.\n`);
|
|
146
|
-
process.stderr.write(`${RECONCILE_HINT}\n`);
|
|
147
|
-
return 0;
|
|
148
|
-
}
|
|
149
|
-
catch (exc) {
|
|
150
|
-
process.stderr.write(`triage:${args.op}: ${String(exc)}\n`);
|
|
151
|
-
return 1;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
155
|
-
process.exit(run(process.argv.slice(2)));
|
|
156
|
-
}
|
|
157
|
-
//# sourceMappingURL=triage-subscribe.js.map
|
package/dist/triage-summary.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
interface ParsedArgs {
|
|
3
|
-
projectRoot: string;
|
|
4
|
-
cacheRoot: string | null;
|
|
5
|
-
noHistory: boolean;
|
|
6
|
-
json: boolean;
|
|
7
|
-
error?: string;
|
|
8
|
-
}
|
|
9
|
-
/** Parse triage-summary CLI args, mirroring the Python argparse surface. */
|
|
10
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
11
|
-
/** Run the triage:summary CLI — always returns exit code 0. */
|
|
12
|
-
export declare function run(argv: string[]): number;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=triage-summary.d.ts.map
|
package/dist/triage-summary.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { ensureTriageCacheHydrated } from "@deftai/directive-core/dist/cache/empty-populate.js";
|
|
5
|
-
import { resolveTriageCachePath } from "@deftai/directive-core/dist/triage/cache-path.js";
|
|
6
|
-
import { appendHistory, computeSummary, formatSummary, pythonStyleStringify, summaryResultToRecord, utcIso, } from "@deftai/directive-core/dist/triage/summary/index.js";
|
|
7
|
-
/** Parse triage-summary CLI args, mirroring the Python argparse surface. */
|
|
8
|
-
export function parseArgs(argv) {
|
|
9
|
-
const parsed = {
|
|
10
|
-
projectRoot: ".",
|
|
11
|
-
cacheRoot: null,
|
|
12
|
-
noHistory: false,
|
|
13
|
-
json: false,
|
|
14
|
-
};
|
|
15
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
16
|
-
const arg = argv[i];
|
|
17
|
-
if (arg === "--no-history") {
|
|
18
|
-
parsed.noHistory = true;
|
|
19
|
-
}
|
|
20
|
-
else if (arg === "--json") {
|
|
21
|
-
parsed.json = true;
|
|
22
|
-
}
|
|
23
|
-
else if (arg === "--project-root") {
|
|
24
|
-
const value = argv[i + 1];
|
|
25
|
-
if (value === undefined) {
|
|
26
|
-
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
27
|
-
}
|
|
28
|
-
parsed.projectRoot = value;
|
|
29
|
-
i += 1;
|
|
30
|
-
}
|
|
31
|
-
else if (arg?.startsWith("--project-root=")) {
|
|
32
|
-
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
33
|
-
}
|
|
34
|
-
else if (arg === "--cache-root") {
|
|
35
|
-
const value = argv[i + 1];
|
|
36
|
-
if (value === undefined) {
|
|
37
|
-
return { ...parsed, error: "argument --cache-root: expected one argument" };
|
|
38
|
-
}
|
|
39
|
-
parsed.cacheRoot = value;
|
|
40
|
-
i += 1;
|
|
41
|
-
}
|
|
42
|
-
else if (arg?.startsWith("--cache-root=")) {
|
|
43
|
-
parsed.cacheRoot = arg.slice("--cache-root=".length);
|
|
44
|
-
}
|
|
45
|
-
else if (arg !== undefined && arg.length > 0) {
|
|
46
|
-
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return parsed;
|
|
50
|
-
}
|
|
51
|
-
/** Run the triage:summary CLI — always returns exit code 0. */
|
|
52
|
-
export function run(argv) {
|
|
53
|
-
const args = parseArgs(argv);
|
|
54
|
-
if (args.error !== undefined) {
|
|
55
|
-
process.stderr.write(`triage_summary: ${args.error}\n`);
|
|
56
|
-
return 2;
|
|
57
|
-
}
|
|
58
|
-
const projectRoot = resolve(args.projectRoot);
|
|
59
|
-
const cacheRoot = args.cacheRoot !== null ? resolve(args.cacheRoot) : undefined;
|
|
60
|
-
ensureTriageCacheHydrated(projectRoot, {
|
|
61
|
-
cacheRoot,
|
|
62
|
-
repo: process.env.DEFT_TRIAGE_REPO ?? null,
|
|
63
|
-
});
|
|
64
|
-
const result = computeSummary(projectRoot, { cacheRoot });
|
|
65
|
-
const line = formatSummary(result);
|
|
66
|
-
const emittedAt = utcIso();
|
|
67
|
-
if (args.json) {
|
|
68
|
-
const record = summaryResultToRecord(result, { emittedAt, line });
|
|
69
|
-
process.stdout.write(`${pythonStyleStringify(record)}\n`);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
process.stdout.write(`${line}\n`);
|
|
73
|
-
}
|
|
74
|
-
if (!args.noHistory) {
|
|
75
|
-
const historyPath = resolveTriageCachePath(projectRoot, "summary-history.jsonl");
|
|
76
|
-
appendHistory(historyPath, result, line, { emittedAt });
|
|
77
|
-
}
|
|
78
|
-
return 0;
|
|
79
|
-
}
|
|
80
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
81
|
-
process.exit(run(process.argv.slice(2)));
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=triage-summary.js.map
|
package/dist/triage-welcome.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
interface ParsedArgs {
|
|
3
|
-
projectRoot: string;
|
|
4
|
-
onboard: boolean;
|
|
5
|
-
noHistory: boolean;
|
|
6
|
-
taskPrefix: string;
|
|
7
|
-
preset: string | null;
|
|
8
|
-
wipCap: number | null;
|
|
9
|
-
error?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
12
|
-
export declare function run(argv: string[]): number;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=triage-welcome.d.ts.map
|