@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/session-start.js
DELETED
|
@@ -1,581 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { CEREMONY_DEPTHS, normalizeCeremonyModelTier, normalizeCeremonyProjectShape, normalizeCeremonyTaskSize, selectCeremonyDepth, } from "@deftai/directive-core/policy";
|
|
5
|
-
import { COLD_CEREMONY_TIER, PRIMARY_CLAIM_EXCEPTIONS, parseDeferrals, parseSessionPostureToken, publishApplyingHostFromCanonicalSessionId, READ_ONLY_POSTURE, REARM_CEREMONY_TIER, REQUIREMENTS_POSTURE, resolveProductionHostEffortDescriptor, ritualStatePath, runSessionStart, SESSION_CEREMONY_TIERS, } from "@deftai/directive-core/session";
|
|
6
|
-
function parseCeremonyDepth(raw) {
|
|
7
|
-
const value = raw.trim().toLowerCase();
|
|
8
|
-
if (CEREMONY_DEPTHS.includes(value)) {
|
|
9
|
-
return value;
|
|
10
|
-
}
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
function parseCeremonyTier(raw) {
|
|
14
|
-
const value = raw.trim().toLowerCase();
|
|
15
|
-
if (SESSION_CEREMONY_TIERS.includes(value)) {
|
|
16
|
-
return value;
|
|
17
|
-
}
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
const PRIMARY_CLAIM_EXCEPTION_HELP = PRIMARY_CLAIM_EXCEPTIONS.join("|");
|
|
21
|
-
function parsePrimaryClaimException(raw) {
|
|
22
|
-
const value = raw.trim();
|
|
23
|
-
if (PRIMARY_CLAIM_EXCEPTIONS.includes(value)) {
|
|
24
|
-
return value;
|
|
25
|
-
}
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
/** Parse session:start CLI args, mirroring scripts/session_start.py. */
|
|
29
|
-
export function parseArgs(argv) {
|
|
30
|
-
const parsed = {
|
|
31
|
-
projectRoot: ".",
|
|
32
|
-
deferValues: [],
|
|
33
|
-
deferOwedReason: null,
|
|
34
|
-
emitJson: false,
|
|
35
|
-
noHistory: false,
|
|
36
|
-
readOnly: false,
|
|
37
|
-
withNetwork: false,
|
|
38
|
-
ceremonyTier: COLD_CEREMONY_TIER,
|
|
39
|
-
ceremonyDialInputs: {},
|
|
40
|
-
ceremonyDepthOverride: null,
|
|
41
|
-
effortBudgetHost: {},
|
|
42
|
-
compact: false,
|
|
43
|
-
steal: false,
|
|
44
|
-
confirm: false,
|
|
45
|
-
occupant: null,
|
|
46
|
-
primaryClaimException: null,
|
|
47
|
-
sessionId: null,
|
|
48
|
-
posture: null,
|
|
49
|
-
};
|
|
50
|
-
const dialInputs = {};
|
|
51
|
-
for (let i = 0; i < argv.length; i += 1) {
|
|
52
|
-
const arg = argv[i];
|
|
53
|
-
if (arg === "--") {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
if (arg === "--json") {
|
|
57
|
-
parsed.emitJson = true;
|
|
58
|
-
}
|
|
59
|
-
else if (arg === "--no-history") {
|
|
60
|
-
parsed.noHistory = true;
|
|
61
|
-
}
|
|
62
|
-
else if (arg === "--read-only") {
|
|
63
|
-
parsed.readOnly = true;
|
|
64
|
-
}
|
|
65
|
-
else if (arg === "--with-network") {
|
|
66
|
-
parsed.withNetwork = true;
|
|
67
|
-
}
|
|
68
|
-
else if (arg === "--rearm") {
|
|
69
|
-
// #2992: shortcut for --tier=rearm
|
|
70
|
-
parsed.ceremonyTier = REARM_CEREMONY_TIER;
|
|
71
|
-
}
|
|
72
|
-
else if (arg === "--tier") {
|
|
73
|
-
const value = argv[i + 1];
|
|
74
|
-
if (value === undefined) {
|
|
75
|
-
return { ...parsed, error: "argument --tier: expected one argument (cold|rearm)" };
|
|
76
|
-
}
|
|
77
|
-
const tier = parseCeremonyTier(value);
|
|
78
|
-
if (tier === null) {
|
|
79
|
-
return {
|
|
80
|
-
...parsed,
|
|
81
|
-
error: `argument --tier: expected cold|rearm, got ${JSON.stringify(value)}`,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
parsed.ceremonyTier = tier;
|
|
85
|
-
i += 1;
|
|
86
|
-
}
|
|
87
|
-
else if (arg?.startsWith("--tier=")) {
|
|
88
|
-
const value = arg.slice("--tier=".length);
|
|
89
|
-
const tier = parseCeremonyTier(value);
|
|
90
|
-
if (tier === null) {
|
|
91
|
-
return {
|
|
92
|
-
...parsed,
|
|
93
|
-
error: `argument --tier: expected cold|rearm, got ${JSON.stringify(value)}`,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
parsed.ceremonyTier = tier;
|
|
97
|
-
}
|
|
98
|
-
else if (arg === "--project-root") {
|
|
99
|
-
const value = argv[i + 1];
|
|
100
|
-
if (value === undefined || value.startsWith("--")) {
|
|
101
|
-
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
102
|
-
}
|
|
103
|
-
parsed.projectRoot = value;
|
|
104
|
-
i += 1;
|
|
105
|
-
}
|
|
106
|
-
else if (arg?.startsWith("--project-root=")) {
|
|
107
|
-
const value = arg.slice("--project-root=".length);
|
|
108
|
-
if (value.length === 0 || value.startsWith("--")) {
|
|
109
|
-
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
110
|
-
}
|
|
111
|
-
parsed.projectRoot = value;
|
|
112
|
-
}
|
|
113
|
-
else if (arg === "--defer") {
|
|
114
|
-
const value = argv[i + 1];
|
|
115
|
-
if (value === undefined || value.startsWith("--")) {
|
|
116
|
-
return { ...parsed, error: "argument --defer: expected one argument" };
|
|
117
|
-
}
|
|
118
|
-
parsed.deferValues.push(value);
|
|
119
|
-
i += 1;
|
|
120
|
-
}
|
|
121
|
-
else if (arg?.startsWith("--defer=")) {
|
|
122
|
-
const value = arg.slice("--defer=".length);
|
|
123
|
-
if (value.length === 0 || value.startsWith("--")) {
|
|
124
|
-
return { ...parsed, error: "argument --defer: expected one argument" };
|
|
125
|
-
}
|
|
126
|
-
parsed.deferValues.push(value);
|
|
127
|
-
}
|
|
128
|
-
else if (arg === "--defer-owed") {
|
|
129
|
-
const value = argv[i + 1];
|
|
130
|
-
if (value === undefined || value.startsWith("--")) {
|
|
131
|
-
return { ...parsed, error: "argument --defer-owed: expected one argument" };
|
|
132
|
-
}
|
|
133
|
-
parsed.deferOwedReason = value;
|
|
134
|
-
i += 1;
|
|
135
|
-
}
|
|
136
|
-
else if (arg?.startsWith("--defer-owed=")) {
|
|
137
|
-
const value = arg.slice("--defer-owed=".length);
|
|
138
|
-
if (value.length === 0 || value.startsWith("--")) {
|
|
139
|
-
return { ...parsed, error: "argument --defer-owed: expected one argument" };
|
|
140
|
-
}
|
|
141
|
-
parsed.deferOwedReason = value;
|
|
142
|
-
}
|
|
143
|
-
else if (arg === "--task-size" || arg === "--ceremony-task-size") {
|
|
144
|
-
const value = argv[i + 1];
|
|
145
|
-
if (value === undefined) {
|
|
146
|
-
return { ...parsed, error: `argument ${arg}: expected one argument (S|M|L|XL)` };
|
|
147
|
-
}
|
|
148
|
-
const size = normalizeCeremonyTaskSize(value);
|
|
149
|
-
if (size === null) {
|
|
150
|
-
return {
|
|
151
|
-
...parsed,
|
|
152
|
-
error: `argument ${arg}: expected S|M|L|XL (or small|medium|large), got ${JSON.stringify(value)}`,
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
dialInputs.taskSize = size;
|
|
156
|
-
i += 1;
|
|
157
|
-
}
|
|
158
|
-
else if (arg?.startsWith("--task-size=") || arg?.startsWith("--ceremony-task-size=")) {
|
|
159
|
-
const value = arg.slice(arg.indexOf("=") + 1);
|
|
160
|
-
const size = normalizeCeremonyTaskSize(value);
|
|
161
|
-
if (size === null) {
|
|
162
|
-
return {
|
|
163
|
-
...parsed,
|
|
164
|
-
error: `argument --task-size: expected S|M|L|XL, got ${JSON.stringify(value)}`,
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
dialInputs.taskSize = size;
|
|
168
|
-
}
|
|
169
|
-
else if (arg === "--model-tier" || arg === "--ceremony-model-tier") {
|
|
170
|
-
const value = argv[i + 1];
|
|
171
|
-
if (value === undefined) {
|
|
172
|
-
return {
|
|
173
|
-
...parsed,
|
|
174
|
-
error: `argument ${arg}: expected one argument (frontier|mid|low)`,
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
const tier = normalizeCeremonyModelTier(value);
|
|
178
|
-
if (tier === null) {
|
|
179
|
-
return {
|
|
180
|
-
...parsed,
|
|
181
|
-
error: `argument ${arg}: expected frontier|mid|low, got ${JSON.stringify(value)}`,
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
dialInputs.modelTier = tier;
|
|
185
|
-
i += 1;
|
|
186
|
-
}
|
|
187
|
-
else if (arg?.startsWith("--model-tier=") || arg?.startsWith("--ceremony-model-tier=")) {
|
|
188
|
-
const value = arg.slice(arg.indexOf("=") + 1);
|
|
189
|
-
const tier = normalizeCeremonyModelTier(value);
|
|
190
|
-
if (tier === null) {
|
|
191
|
-
return {
|
|
192
|
-
...parsed,
|
|
193
|
-
error: `argument --model-tier: expected frontier|mid|low, got ${JSON.stringify(value)}`,
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
dialInputs.modelTier = tier;
|
|
197
|
-
}
|
|
198
|
-
else if (arg === "--project-shape" || arg === "--ceremony-project-shape") {
|
|
199
|
-
const value = argv[i + 1];
|
|
200
|
-
if (value === undefined) {
|
|
201
|
-
return {
|
|
202
|
-
...parsed,
|
|
203
|
-
error: `argument ${arg}: expected one argument (project|non-project)`,
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
const shape = normalizeCeremonyProjectShape(value);
|
|
207
|
-
if (shape === null) {
|
|
208
|
-
return {
|
|
209
|
-
...parsed,
|
|
210
|
-
error: `argument ${arg}: expected project|non-project, got ${JSON.stringify(value)}`,
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
dialInputs.projectShape = shape;
|
|
214
|
-
i += 1;
|
|
215
|
-
}
|
|
216
|
-
else if (arg?.startsWith("--project-shape=") ||
|
|
217
|
-
arg?.startsWith("--ceremony-project-shape=")) {
|
|
218
|
-
const value = arg.slice(arg.indexOf("=") + 1);
|
|
219
|
-
const shape = normalizeCeremonyProjectShape(value);
|
|
220
|
-
if (shape === null) {
|
|
221
|
-
return {
|
|
222
|
-
...parsed,
|
|
223
|
-
error: `argument --project-shape: expected project|non-project, got ${JSON.stringify(value)}`,
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
dialInputs.projectShape = shape;
|
|
227
|
-
}
|
|
228
|
-
else if (arg === "--ceremony-depth") {
|
|
229
|
-
const value = argv[i + 1];
|
|
230
|
-
if (value === undefined) {
|
|
231
|
-
return {
|
|
232
|
-
...parsed,
|
|
233
|
-
error: "argument --ceremony-depth: expected one argument (minimal|rapid|standard|elevated)",
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
const depth = parseCeremonyDepth(value);
|
|
237
|
-
if (depth === null) {
|
|
238
|
-
return {
|
|
239
|
-
...parsed,
|
|
240
|
-
error: `argument --ceremony-depth: expected minimal|rapid|standard|elevated, got ${JSON.stringify(value)}`,
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
parsed.ceremonyDepthOverride = depth;
|
|
244
|
-
i += 1;
|
|
245
|
-
}
|
|
246
|
-
else if (arg?.startsWith("--ceremony-depth=")) {
|
|
247
|
-
const value = arg.slice("--ceremony-depth=".length);
|
|
248
|
-
const depth = parseCeremonyDepth(value);
|
|
249
|
-
if (depth === null) {
|
|
250
|
-
return {
|
|
251
|
-
...parsed,
|
|
252
|
-
error: `argument --ceremony-depth: expected minimal|rapid|standard|elevated, got ${JSON.stringify(value)}`,
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
parsed.ceremonyDepthOverride = depth;
|
|
256
|
-
}
|
|
257
|
-
else if (arg === "--max-turns") {
|
|
258
|
-
// #3266: harness hard turn budget for bank-the-pass guidance
|
|
259
|
-
const value = argv[i + 1];
|
|
260
|
-
if (value === undefined) {
|
|
261
|
-
return { ...parsed, error: "argument --max-turns: expected one argument" };
|
|
262
|
-
}
|
|
263
|
-
const n = Number(value);
|
|
264
|
-
if (!Number.isFinite(n) || n < 0) {
|
|
265
|
-
return {
|
|
266
|
-
...parsed,
|
|
267
|
-
error: `argument --max-turns: expected non-negative number, got ${JSON.stringify(value)}`,
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
parsed.effortBudgetHost.maxTurns = n;
|
|
271
|
-
i += 1;
|
|
272
|
-
}
|
|
273
|
-
else if (arg?.startsWith("--max-turns=")) {
|
|
274
|
-
const value = arg.slice("--max-turns=".length);
|
|
275
|
-
const n = Number(value);
|
|
276
|
-
if (!Number.isFinite(n) || n < 0) {
|
|
277
|
-
return {
|
|
278
|
-
...parsed,
|
|
279
|
-
error: `argument --max-turns: expected non-negative number, got ${JSON.stringify(value)}`,
|
|
280
|
-
};
|
|
281
|
-
}
|
|
282
|
-
parsed.effortBudgetHost.maxTurns = n;
|
|
283
|
-
}
|
|
284
|
-
else if (arg === "--max-budget") {
|
|
285
|
-
const value = argv[i + 1];
|
|
286
|
-
if (value === undefined) {
|
|
287
|
-
return { ...parsed, error: "argument --max-budget: expected one argument" };
|
|
288
|
-
}
|
|
289
|
-
const n = Number(value);
|
|
290
|
-
if (!Number.isFinite(n) || n < 0) {
|
|
291
|
-
return {
|
|
292
|
-
...parsed,
|
|
293
|
-
error: `argument --max-budget: expected non-negative number, got ${JSON.stringify(value)}`,
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
parsed.effortBudgetHost.maxBudget = n;
|
|
297
|
-
i += 1;
|
|
298
|
-
}
|
|
299
|
-
else if (arg?.startsWith("--max-budget=")) {
|
|
300
|
-
const value = arg.slice("--max-budget=".length);
|
|
301
|
-
const n = Number(value);
|
|
302
|
-
if (!Number.isFinite(n) || n < 0) {
|
|
303
|
-
return {
|
|
304
|
-
...parsed,
|
|
305
|
-
error: `argument --max-budget: expected non-negative number, got ${JSON.stringify(value)}`,
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
parsed.effortBudgetHost.maxBudget = n;
|
|
309
|
-
}
|
|
310
|
-
else if (arg === "--hard-budget") {
|
|
311
|
-
parsed.effortBudgetHost.hardBudget = true;
|
|
312
|
-
}
|
|
313
|
-
else if (arg === "--compact") {
|
|
314
|
-
// #3286: terse machine orientation output (opt-in; verbose remains default)
|
|
315
|
-
parsed.compact = true;
|
|
316
|
-
}
|
|
317
|
-
else if (arg === "--steal") {
|
|
318
|
-
parsed.steal = true;
|
|
319
|
-
}
|
|
320
|
-
else if (arg === "--primary-claim-exception") {
|
|
321
|
-
const value = argv[i + 1];
|
|
322
|
-
if (value === undefined || value.startsWith("--")) {
|
|
323
|
-
return {
|
|
324
|
-
...parsed,
|
|
325
|
-
error: `argument --primary-claim-exception: expected one argument (${PRIMARY_CLAIM_EXCEPTION_HELP})`,
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
const exception = parsePrimaryClaimException(value);
|
|
329
|
-
if (exception === null) {
|
|
330
|
-
return {
|
|
331
|
-
...parsed,
|
|
332
|
-
error: `argument --primary-claim-exception: expected ${PRIMARY_CLAIM_EXCEPTION_HELP}, got ${JSON.stringify(value)}`,
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
parsed.primaryClaimException = exception;
|
|
336
|
-
i += 1;
|
|
337
|
-
}
|
|
338
|
-
else if (arg?.startsWith("--primary-claim-exception=")) {
|
|
339
|
-
const value = arg.slice("--primary-claim-exception=".length);
|
|
340
|
-
if (value.length === 0 || value.startsWith("--")) {
|
|
341
|
-
return {
|
|
342
|
-
...parsed,
|
|
343
|
-
error: `argument --primary-claim-exception: expected one argument (${PRIMARY_CLAIM_EXCEPTION_HELP})`,
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
const exception = parsePrimaryClaimException(value);
|
|
347
|
-
if (exception === null) {
|
|
348
|
-
return {
|
|
349
|
-
...parsed,
|
|
350
|
-
error: `argument --primary-claim-exception: expected ${PRIMARY_CLAIM_EXCEPTION_HELP}, got ${JSON.stringify(value)}`,
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
parsed.primaryClaimException = exception;
|
|
354
|
-
}
|
|
355
|
-
else if (arg === "--confirm") {
|
|
356
|
-
parsed.confirm = true;
|
|
357
|
-
}
|
|
358
|
-
else if (arg === "--session-id") {
|
|
359
|
-
const value = argv[i + 1];
|
|
360
|
-
if (value === undefined || value.startsWith("--")) {
|
|
361
|
-
return { ...parsed, error: "argument --session-id: expected one argument" };
|
|
362
|
-
}
|
|
363
|
-
const sessionId = value.trim();
|
|
364
|
-
if (sessionId.length === 0 || sessionId.startsWith("--")) {
|
|
365
|
-
return { ...parsed, error: "argument --session-id: expected a non-empty value" };
|
|
366
|
-
}
|
|
367
|
-
parsed.sessionId = sessionId;
|
|
368
|
-
i += 1;
|
|
369
|
-
}
|
|
370
|
-
else if (arg?.startsWith("--session-id=")) {
|
|
371
|
-
const sessionId = arg.slice("--session-id=".length).trim();
|
|
372
|
-
if (sessionId.length === 0 || sessionId.startsWith("--")) {
|
|
373
|
-
return { ...parsed, error: "argument --session-id: expected a non-empty value" };
|
|
374
|
-
}
|
|
375
|
-
parsed.sessionId = sessionId;
|
|
376
|
-
}
|
|
377
|
-
else if (arg === "--occupant") {
|
|
378
|
-
const value = argv[i + 1];
|
|
379
|
-
if (value === undefined || value.startsWith("--")) {
|
|
380
|
-
return { ...parsed, error: "argument --occupant: expected one argument" };
|
|
381
|
-
}
|
|
382
|
-
parsed.occupant = value;
|
|
383
|
-
i += 1;
|
|
384
|
-
}
|
|
385
|
-
else if (arg?.startsWith("--occupant=")) {
|
|
386
|
-
const value = arg.slice("--occupant=".length);
|
|
387
|
-
if (value.length === 0 || value.startsWith("--")) {
|
|
388
|
-
return { ...parsed, error: "argument --occupant: expected one argument" };
|
|
389
|
-
}
|
|
390
|
-
parsed.occupant = value;
|
|
391
|
-
}
|
|
392
|
-
else if (arg === "--posture") {
|
|
393
|
-
const value = argv[i + 1];
|
|
394
|
-
if (value === undefined || value.startsWith("--")) {
|
|
395
|
-
return {
|
|
396
|
-
...parsed,
|
|
397
|
-
error: "argument --posture: expected one argument (read-only|mutation|requirements)",
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
const parsedPosture = parseSessionPostureToken(value);
|
|
401
|
-
if (parsedPosture.error !== null) {
|
|
402
|
-
return { ...parsed, error: parsedPosture.error };
|
|
403
|
-
}
|
|
404
|
-
if (parsedPosture.token === "assist") {
|
|
405
|
-
return {
|
|
406
|
-
...parsed,
|
|
407
|
-
error: "argument --posture=docs|assist is scratch-only; set DEFT_SESSION_POSTURE=assist. Tracked docs use --posture=requirements",
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
if (parsedPosture.token === null) {
|
|
411
|
-
return {
|
|
412
|
-
...parsed,
|
|
413
|
-
error: "argument --posture: expected one argument (read-only|mutation|requirements)",
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
parsed.posture = parsedPosture.token;
|
|
417
|
-
i += 1;
|
|
418
|
-
}
|
|
419
|
-
else if (arg?.startsWith("--posture=")) {
|
|
420
|
-
const value = arg.slice("--posture=".length);
|
|
421
|
-
const parsedPosture = parseSessionPostureToken(value);
|
|
422
|
-
if (parsedPosture.error !== null) {
|
|
423
|
-
return { ...parsed, error: parsedPosture.error };
|
|
424
|
-
}
|
|
425
|
-
if (parsedPosture.token === "assist") {
|
|
426
|
-
return {
|
|
427
|
-
...parsed,
|
|
428
|
-
error: "argument --posture=docs|assist is scratch-only; set DEFT_SESSION_POSTURE=assist. Tracked docs use --posture=requirements",
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
if (parsedPosture.token === null) {
|
|
432
|
-
return {
|
|
433
|
-
...parsed,
|
|
434
|
-
error: "argument --posture: expected one argument (read-only|mutation|requirements)",
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
parsed.posture = parsedPosture.token;
|
|
438
|
-
}
|
|
439
|
-
else {
|
|
440
|
-
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
parsed.ceremonyDialInputs = {
|
|
444
|
-
taskSize: dialInputs.taskSize ?? null,
|
|
445
|
-
modelTier: dialInputs.modelTier ?? null,
|
|
446
|
-
projectShape: dialInputs.projectShape ?? null,
|
|
447
|
-
};
|
|
448
|
-
return parsed;
|
|
449
|
-
}
|
|
450
|
-
/** Native session:start handler (#2032 — replaces framework-commands Python bridge). */
|
|
451
|
-
export function run(argv) {
|
|
452
|
-
const args = parseArgs(argv);
|
|
453
|
-
if (args.error !== undefined) {
|
|
454
|
-
process.stderr.write(`session_start: ${args.error}\n`);
|
|
455
|
-
return 2;
|
|
456
|
-
}
|
|
457
|
-
const projectRoot = resolve(args.projectRoot);
|
|
458
|
-
const { deferrals, errors } = parseDeferrals(args.deferValues);
|
|
459
|
-
if (errors.length > 0) {
|
|
460
|
-
for (const error of errors) {
|
|
461
|
-
process.stderr.write(`${error}\n`);
|
|
462
|
-
}
|
|
463
|
-
return 2;
|
|
464
|
-
}
|
|
465
|
-
const capturedStdout = [];
|
|
466
|
-
const prevWrite = process.stdout.write.bind(process.stdout);
|
|
467
|
-
process.stdout.write = ((chunk, encoding, callback) => {
|
|
468
|
-
capturedStdout.push(String(chunk));
|
|
469
|
-
const cb = typeof encoding === "function" ? encoding : callback;
|
|
470
|
-
if (typeof cb === "function") {
|
|
471
|
-
cb();
|
|
472
|
-
}
|
|
473
|
-
return true;
|
|
474
|
-
});
|
|
475
|
-
// #3266: production host adapter — native harness env + DEFT_HOST_EFFORT_BUDGET + CLI flags.
|
|
476
|
-
const hostDescriptor = {
|
|
477
|
-
...resolveProductionHostEffortDescriptor(process.env),
|
|
478
|
-
};
|
|
479
|
-
if (args.effortBudgetHost.maxTurns !== undefined) {
|
|
480
|
-
hostDescriptor.maxTurns = args.effortBudgetHost.maxTurns;
|
|
481
|
-
}
|
|
482
|
-
if (args.effortBudgetHost.maxBudget !== undefined) {
|
|
483
|
-
hostDescriptor.maxBudget = args.effortBudgetHost.maxBudget;
|
|
484
|
-
}
|
|
485
|
-
if (args.effortBudgetHost.hardBudget === true) {
|
|
486
|
-
hostDescriptor.hardBudget = true;
|
|
487
|
-
}
|
|
488
|
-
let result;
|
|
489
|
-
try {
|
|
490
|
-
// #3214: --ceremony-depth forces this session only (not persisted to policy).
|
|
491
|
-
result = runSessionStart(projectRoot, {
|
|
492
|
-
deferrals,
|
|
493
|
-
writeHistory: !args.noHistory,
|
|
494
|
-
posture: args.readOnly ? READ_ONLY_POSTURE : (args.posture ?? undefined),
|
|
495
|
-
allowOptionalNetwork: args.withNetwork ? true : undefined,
|
|
496
|
-
ceremonyTier: args.ceremonyTier,
|
|
497
|
-
ceremonyDialInputs: args.ceremonyDialInputs,
|
|
498
|
-
effortBudgetSeams: { hostDescriptor, environ: process.env },
|
|
499
|
-
// #3286: --compact flag; DEFT_SESSION_COMPACT still resolved inside core.
|
|
500
|
-
compact: args.compact ? true : undefined,
|
|
501
|
-
steal: args.steal ? true : undefined,
|
|
502
|
-
confirm: args.confirm ? true : undefined,
|
|
503
|
-
occupant: args.occupant ?? undefined,
|
|
504
|
-
primaryClaimException: args.primaryClaimException ?? undefined,
|
|
505
|
-
sessionId: args.sessionId ?? undefined,
|
|
506
|
-
deferOwedReason: args.deferOwedReason,
|
|
507
|
-
...(args.ceremonyDepthOverride !== null
|
|
508
|
-
? {
|
|
509
|
-
ceremonyDial: selectCeremonyDepth({
|
|
510
|
-
config: { enabled: true, override: args.ceremonyDepthOverride },
|
|
511
|
-
inputs: args.ceremonyDialInputs,
|
|
512
|
-
}),
|
|
513
|
-
ceremonyDialStartTierProvenance: "external-pin",
|
|
514
|
-
}
|
|
515
|
-
: {}),
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
finally {
|
|
519
|
-
process.stdout.write = prevWrite;
|
|
520
|
-
}
|
|
521
|
-
const lines = [...result.lines];
|
|
522
|
-
const stray = capturedStdout.join("").trim();
|
|
523
|
-
if (stray) {
|
|
524
|
-
lines.push(stray);
|
|
525
|
-
}
|
|
526
|
-
// #5676: read-only may bootstrap the applying-host record; mutation/rearm
|
|
527
|
-
// republishes as reinforcement after a successful ceremony. Skip opt-out /
|
|
528
|
-
// kill-switch disabled results so .no-deft-directive stays write-free.
|
|
529
|
-
const disabled = typeof result.payload === "object" &&
|
|
530
|
-
result.payload !== null &&
|
|
531
|
-
result.payload.disabled === true;
|
|
532
|
-
if (result.code === 0 && !disabled) {
|
|
533
|
-
const owner = args.sessionId?.trim() ||
|
|
534
|
-
(typeof result.payload.occupancy === "object" &&
|
|
535
|
-
result.payload.occupancy !== null &&
|
|
536
|
-
typeof result.payload.occupancy.session_id === "string"
|
|
537
|
-
? String(result.payload.occupancy.session_id)
|
|
538
|
-
: "") ||
|
|
539
|
-
process.env.DEFT_SESSION_ID?.trim() ||
|
|
540
|
-
"";
|
|
541
|
-
if (owner.length > 0) {
|
|
542
|
-
try {
|
|
543
|
-
const transport = process.env.GROK_HOOK_EVENT?.trim() ? "grok-hook-event" : "native";
|
|
544
|
-
publishApplyingHostFromCanonicalSessionId(projectRoot, owner, {
|
|
545
|
-
transport: owner.startsWith("host:cursor:") ? "native" : transport,
|
|
546
|
-
});
|
|
547
|
-
}
|
|
548
|
-
catch {
|
|
549
|
-
/* ceremony success stays authoritative; applying-host is best-effort */
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
if (args.emitJson) {
|
|
554
|
-
const sorted = Object.keys(result.payload)
|
|
555
|
-
.sort()
|
|
556
|
-
.reduce((acc, key) => {
|
|
557
|
-
acc[key] = result.payload[key];
|
|
558
|
-
return acc;
|
|
559
|
-
}, {});
|
|
560
|
-
process.stdout.write(`${JSON.stringify(sorted)}\n`);
|
|
561
|
-
return result.code;
|
|
562
|
-
}
|
|
563
|
-
const sink = result.code === 0 ? process.stdout : process.stderr;
|
|
564
|
-
for (const line of lines) {
|
|
565
|
-
sink.write(`${line}\n`);
|
|
566
|
-
}
|
|
567
|
-
if (result.code === 0) {
|
|
568
|
-
const posture = result.payload.posture;
|
|
569
|
-
if (posture === READ_ONLY_POSTURE || posture === REQUIREMENTS_POSTURE) {
|
|
570
|
-
process.stdout.write(`[deft] ${String(result.payload.message)}\n`);
|
|
571
|
-
}
|
|
572
|
-
else {
|
|
573
|
-
process.stdout.write(`[deft] session ritual recorded at ${ritualStatePath(projectRoot)} (diagnostic-only; not posture authority)\n`);
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
return result.code;
|
|
577
|
-
}
|
|
578
|
-
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
579
|
-
process.exit(run(process.argv.slice(2)));
|
|
580
|
-
}
|
|
581
|
-
//# sourceMappingURL=session-start.js.map
|
package/dist/slice.d.ts
DELETED
package/dist/slice.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Thin CLI entry for slice:record-existing / slice:list (#1727).
|
|
4
|
-
* Delegates to the core implementation at packages/core/dist/slice/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/slice/cli.js");
|
|
16
|
-
}
|
|
17
|
-
/** Run slice verbs 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=slice.js.map
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export interface ScenarioResult {
|
|
2
|
-
readonly name: string;
|
|
3
|
-
readonly exitCode: number;
|
|
4
|
-
readonly stdout: string;
|
|
5
|
-
readonly stderr: string;
|
|
6
|
-
}
|
|
7
|
-
export interface ParityScenario {
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly vbriefRel: string;
|
|
10
|
-
readonly vbriefStatus?: string;
|
|
11
|
-
readonly envelopeRel: string | null;
|
|
12
|
-
readonly allowDirty?: boolean;
|
|
13
|
-
readonly dirty?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface ParityResult {
|
|
16
|
-
readonly ok: boolean;
|
|
17
|
-
readonly scenarios: Array<{
|
|
18
|
-
readonly name: string;
|
|
19
|
-
readonly exitMismatch: boolean;
|
|
20
|
-
readonly pythonExit: number;
|
|
21
|
-
readonly tsExit: number;
|
|
22
|
-
readonly messageMismatch: boolean;
|
|
23
|
-
readonly pythonMessage: string;
|
|
24
|
-
readonly tsMessage: string;
|
|
25
|
-
}>;
|
|
26
|
-
}
|
|
27
|
-
/** Scenarios exercised by the parity harness (mirrors Python contract cases). */
|
|
28
|
-
export declare const PARITY_SCENARIOS: readonly ParityScenario[];
|
|
29
|
-
/** Normalise gate message for comparison (trim, collapse whitespace). */
|
|
30
|
-
export declare function normaliseMessage(stdout: string, stderr: string, exitCode: number): string;
|
|
31
|
-
/** Build a fixture repo for one scenario; return repo root + vbrief absolute path. */
|
|
32
|
-
export declare function buildScenarioRepo(scenario: ParityScenario): {
|
|
33
|
-
root: string;
|
|
34
|
-
vbriefPath: string;
|
|
35
|
-
envelopePath: string | null;
|
|
36
|
-
};
|
|
37
|
-
/** Diff python vs TS gate outputs across all parity scenarios. */
|
|
38
|
-
export declare function diffParity(python: ScenarioResult, ts: ScenarioResult): {
|
|
39
|
-
exitMismatch: boolean;
|
|
40
|
-
messageMismatch: boolean;
|
|
41
|
-
pythonMessage: string;
|
|
42
|
-
tsMessage: string;
|
|
43
|
-
};
|
|
44
|
-
/** Run all parity scenarios and return a structured result. */
|
|
45
|
-
/** Render a human-readable parity report (exported for unit tests). */
|
|
46
|
-
export declare function renderReport(result: ParityResult): string;
|
|
47
|
-
//# sourceMappingURL=story-ready-fixtures.d.ts.map
|