peaks-loop 4.1.2 → 4.1.4
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/.claude-plugin/marketplace.json +136 -47
- package/CHANGELOG.md +112 -0
- package/README-en.md +1 -1
- package/README.md +1 -1
- package/contracts/readonly-argv-whitelist.json +211 -0
- package/dist/cli/commands/asset-command-shared.d.ts +12 -0
- package/dist/cli/commands/asset-command-shared.js +45 -0
- package/dist/cli/commands/asset-commands.d.ts +6 -1
- package/dist/cli/commands/asset-commands.js +11 -372
- package/dist/cli/commands/asset-crystallize-command.d.ts +3 -0
- package/dist/cli/commands/asset-crystallize-command.js +60 -0
- package/dist/cli/commands/asset-crystallize-payload.d.ts +47 -0
- package/dist/cli/commands/asset-crystallize-payload.js +85 -0
- package/dist/cli/commands/asset-crystallize-runner.d.ts +3 -0
- package/dist/cli/commands/asset-crystallize-runner.js +133 -0
- package/dist/cli/commands/asset-dispose-command.d.ts +3 -0
- package/dist/cli/commands/asset-dispose-command.js +99 -0
- package/dist/cli/commands/asset-status-command.d.ts +3 -0
- package/dist/cli/commands/asset-status-command.js +100 -0
- package/dist/cli/commands/audit-artifact-runners.d.ts +16 -0
- package/dist/cli/commands/audit-artifact-runners.js +170 -0
- package/dist/cli/commands/audit-command-shared.d.ts +97 -0
- package/dist/cli/commands/audit-command-shared.js +60 -0
- package/dist/cli/commands/audit-commands.d.ts +7 -31
- package/dist/cli/commands/audit-commands.js +64 -473
- package/dist/cli/commands/audit-goal-runners.d.ts +17 -0
- package/dist/cli/commands/audit-goal-runners.js +114 -0
- package/dist/cli/commands/audit-red-lines-runners.d.ts +11 -0
- package/dist/cli/commands/audit-red-lines-runners.js +43 -0
- package/dist/cli/commands/audit-refusal-data.d.ts +23 -0
- package/dist/cli/commands/audit-refusal-data.js +69 -0
- package/dist/cli/commands/audit-static-runners.d.ts +13 -0
- package/dist/cli/commands/audit-static-runners.js +139 -0
- package/dist/cli/commands/await-runners.d.ts +11 -0
- package/dist/cli/commands/await-runners.js +148 -0
- package/dist/cli/commands/baseline-audit-command.d.ts +3 -0
- package/dist/cli/commands/baseline-audit-command.js +64 -0
- package/dist/cli/commands/baseline-command-shared.d.ts +23 -0
- package/dist/cli/commands/baseline-command-shared.js +39 -0
- package/dist/cli/commands/baseline-commands.js +33 -313
- package/dist/cli/commands/baseline-freeze-commands.d.ts +4 -0
- package/dist/cli/commands/baseline-freeze-commands.js +81 -0
- package/dist/cli/commands/baseline-guard-command.d.ts +3 -0
- package/dist/cli/commands/baseline-guard-command.js +52 -0
- package/dist/cli/commands/baseline-read-commands.d.ts +5 -0
- package/dist/cli/commands/baseline-read-commands.js +72 -0
- package/dist/cli/commands/baseline-rollback-commands.d.ts +4 -0
- package/dist/cli/commands/baseline-rollback-commands.js +88 -0
- package/dist/cli/commands/classify-downgrade-command.d.ts +9 -0
- package/dist/cli/commands/classify-downgrade-command.js +21 -0
- package/dist/cli/commands/classify-run-command.d.ts +9 -0
- package/dist/cli/commands/classify-run-command.js +73 -0
- package/dist/cli/commands/classify-signals.d.ts +5 -0
- package/dist/cli/commands/classify-signals.js +104 -0
- package/dist/cli/commands/code-auto-compact-command.d.ts +3 -0
- package/dist/cli/commands/code-auto-compact-command.js +124 -0
- package/dist/cli/commands/code-auto-compact-envelope.d.ts +22 -0
- package/dist/cli/commands/code-auto-compact-envelope.js +39 -0
- package/dist/cli/commands/code-context-audit-command.d.ts +3 -0
- package/dist/cli/commands/code-context-audit-command.js +68 -0
- package/dist/cli/commands/code-context-now-command.d.ts +3 -0
- package/dist/cli/commands/code-context-now-command.js +124 -0
- package/dist/cli/commands/code-context-now-envelope.d.ts +66 -0
- package/dist/cli/commands/code-context-now-envelope.js +136 -0
- package/dist/cli/commands/code-context-now-mapping.d.ts +27 -0
- package/dist/cli/commands/code-context-now-mapping.js +43 -0
- package/dist/cli/commands/code-emit-handoff-command.d.ts +3 -0
- package/dist/cli/commands/code-emit-handoff-command.js +136 -0
- package/dist/cli/commands/code-gate-step-08-command.d.ts +3 -0
- package/dist/cli/commands/code-gate-step-08-command.js +155 -0
- package/dist/cli/commands/code-post-compact-detect-command.d.ts +3 -0
- package/dist/cli/commands/code-post-compact-detect-command.js +50 -0
- package/dist/cli/commands/code-runtime-commands.d.ts +9 -43
- package/dist/cli/commands/code-runtime-commands.js +20 -672
- package/dist/cli/commands/code-runtime-session.d.ts +1 -0
- package/dist/cli/commands/code-runtime-session.js +15 -0
- package/dist/cli/commands/codegraph-command-options.d.ts +22 -0
- package/dist/cli/commands/codegraph-command-options.js +22 -0
- package/dist/cli/commands/codegraph-commands.d.ts +2 -2
- package/dist/cli/commands/codegraph-commands.js +14 -397
- package/dist/cli/commands/codegraph-config-restore-command.d.ts +3 -0
- package/dist/cli/commands/codegraph-config-restore-command.js +200 -0
- package/dist/cli/commands/codegraph-proxy-commands.d.ts +10 -0
- package/dist/cli/commands/codegraph-proxy-commands.js +159 -0
- package/dist/cli/commands/codegraph-repair-commands.d.ts +3 -0
- package/dist/cli/commands/codegraph-repair-commands.js +94 -0
- package/dist/cli/commands/codegraph-status-command.d.ts +1 -1
- package/dist/cli/commands/codegraph-status-command.js +27 -214
- package/dist/cli/commands/codegraph-status-integrity.d.ts +44 -0
- package/dist/cli/commands/codegraph-status-integrity.js +121 -0
- package/dist/cli/commands/codegraph-status-json.d.ts +5 -0
- package/dist/cli/commands/codegraph-status-json.js +127 -0
- package/dist/cli/commands/compact-command.d.ts +6 -2
- package/dist/cli/commands/compact-command.js +12 -559
- package/dist/cli/commands/compact-dry-run-command.d.ts +3 -0
- package/dist/cli/commands/compact-dry-run-command.js +87 -0
- package/dist/cli/commands/compact-force-command.d.ts +3 -0
- package/dist/cli/commands/compact-force-command.js +98 -0
- package/dist/cli/commands/compact-harness-window-command.d.ts +3 -0
- package/dist/cli/commands/compact-harness-window-command.js +174 -0
- package/dist/cli/commands/compact-history-command.d.ts +3 -0
- package/dist/cli/commands/compact-history-command.js +89 -0
- package/dist/cli/commands/compact-read-commands.d.ts +3 -0
- package/dist/cli/commands/compact-read-commands.js +123 -0
- package/dist/cli/commands/compact-settle-command.d.ts +3 -0
- package/dist/cli/commands/compact-settle-command.js +130 -0
- package/dist/cli/commands/compact-shared.d.ts +9 -0
- package/dist/cli/commands/compact-shared.js +26 -0
- package/dist/cli/commands/container-command-shared.d.ts +60 -0
- package/dist/cli/commands/container-command-shared.js +52 -0
- package/dist/cli/commands/container-commands.d.ts +1 -1
- package/dist/cli/commands/container-commands.js +4 -216
- package/dist/cli/commands/container-release-command.d.ts +3 -0
- package/dist/cli/commands/container-release-command.js +105 -0
- package/dist/cli/commands/container-spawn-command.d.ts +3 -0
- package/dist/cli/commands/container-spawn-command.js +148 -0
- package/dist/cli/commands/context-check-command.d.ts +3 -0
- package/dist/cli/commands/context-check-command.js +81 -0
- package/dist/cli/commands/context-commands.d.ts +2 -7
- package/dist/cli/commands/context-commands.js +6 -276
- package/dist/cli/commands/context-layer-command.d.ts +3 -0
- package/dist/cli/commands/context-layer-command.js +34 -0
- package/dist/cli/commands/context-layer-fetchers.d.ts +15 -0
- package/dist/cli/commands/context-layer-fetchers.js +162 -0
- package/dist/cli/commands/context-status-command.d.ts +17 -0
- package/dist/cli/commands/context-status-command.js +41 -0
- package/dist/cli/commands/contract-write-command.d.ts +3 -0
- package/dist/cli/commands/contract-write-command.js +144 -0
- package/dist/cli/commands/core/doctor-bindings.d.ts +17 -0
- package/dist/cli/commands/core/doctor-bindings.js +30 -0
- package/dist/cli/commands/core/doctor-command.d.ts +4 -18
- package/dist/cli/commands/core/doctor-command.js +2 -323
- package/dist/cli/commands/core/doctor-logs.d.ts +8 -0
- package/dist/cli/commands/core/doctor-logs.js +32 -0
- package/dist/cli/commands/core/doctor-probes.d.ts +3 -0
- package/dist/cli/commands/core/doctor-probes.js +55 -0
- package/dist/cli/commands/core/doctor-run-command.d.ts +12 -0
- package/dist/cli/commands/core/doctor-run-command.js +172 -0
- package/dist/cli/commands/core/doctor-summary.d.ts +7 -0
- package/dist/cli/commands/core/doctor-summary.js +39 -0
- package/dist/cli/commands/core/memory-command-shared.d.ts +25 -0
- package/dist/cli/commands/core/memory-command-shared.js +20 -0
- package/dist/cli/commands/core/memory-command.d.ts +1 -1
- package/dist/cli/commands/core/memory-command.js +6 -227
- package/dist/cli/commands/core/memory-delegated-verbs.d.ts +4 -0
- package/dist/cli/commands/core/memory-delegated-verbs.js +178 -0
- package/dist/cli/commands/core/memory-extract-command.d.ts +3 -0
- package/dist/cli/commands/core/memory-extract-command.js +90 -0
- package/dist/cli/commands/core/memory-sync-command.d.ts +3 -0
- package/dist/cli/commands/core/memory-sync-command.js +38 -0
- package/dist/cli/commands/core/session-command.d.ts +1 -1
- package/dist/cli/commands/core/session-command.js +12 -206
- package/dist/cli/commands/core/session-info-command.d.ts +3 -0
- package/dist/cli/commands/core/session-info-command.js +142 -0
- package/dist/cli/commands/core/session-verb-commands.d.ts +5 -0
- package/dist/cli/commands/core/session-verb-commands.js +58 -0
- package/dist/cli/commands/core/skill-command.d.ts +1 -44
- package/dist/cli/commands/core/skill-command.js +13 -541
- package/dist/cli/commands/core/skill-context-verdict.d.ts +38 -0
- package/dist/cli/commands/core/skill-context-verdict.js +63 -0
- package/dist/cli/commands/core/skill-generated-config-notice.d.ts +41 -0
- package/dist/cli/commands/core/skill-generated-config-notice.js +75 -0
- package/dist/cli/commands/core/skill-heartbeat-commands.d.ts +3 -0
- package/dist/cli/commands/core/skill-heartbeat-commands.js +50 -0
- package/dist/cli/commands/core/skill-presence-commands.d.ts +3 -0
- package/dist/cli/commands/core/skill-presence-commands.js +123 -0
- package/dist/cli/commands/core/skill-presence-housekeeping-commands.d.ts +3 -0
- package/dist/cli/commands/core/skill-presence-housekeeping-commands.js +165 -0
- package/dist/cli/commands/core/skill-registry-commands.d.ts +3 -0
- package/dist/cli/commands/core/skill-registry-commands.js +117 -0
- package/dist/cli/commands/core/skill-runbook-command.d.ts +3 -0
- package/dist/cli/commands/core/skill-runbook-command.js +29 -0
- package/dist/cli/commands/core/standards-command.d.ts +1 -24
- package/dist/cli/commands/core/standards-command.js +33 -201
- package/dist/cli/commands/core/standards-init-command.d.ts +3 -0
- package/dist/cli/commands/core/standards-init-command.js +87 -0
- package/dist/cli/commands/core/standards-lint.d.ts +24 -0
- package/dist/cli/commands/core/standards-lint.js +57 -0
- package/dist/cli/commands/core/standards-migrate-command.d.ts +3 -0
- package/dist/cli/commands/core/standards-migrate-command.js +57 -0
- package/dist/cli/commands/cron-scheduler-commands.d.ts +5 -1
- package/dist/cli/commands/cron-scheduler-commands.js +36 -206
- package/dist/cli/commands/cron-scheduler-run-once-command.d.ts +7 -0
- package/dist/cli/commands/cron-scheduler-run-once-command.js +35 -0
- package/dist/cli/commands/cron-scheduler-shared.d.ts +6 -0
- package/dist/cli/commands/cron-scheduler-shared.js +48 -0
- package/dist/cli/commands/cron-scheduler-start-command.d.ts +7 -0
- package/dist/cli/commands/cron-scheduler-start-command.js +65 -0
- package/dist/cli/commands/cron-scheduler-status-command.d.ts +7 -0
- package/dist/cli/commands/cron-scheduler-status-command.js +46 -0
- package/dist/cli/commands/cron-scheduler-stop-command.d.ts +7 -0
- package/dist/cli/commands/cron-scheduler-stop-command.js +61 -0
- package/dist/cli/commands/dispatch-command-spec.d.ts +2 -0
- package/dist/cli/commands/dispatch-command-spec.js +62 -0
- package/dist/cli/commands/dispatch-commands.js +159 -775
- package/dist/cli/commands/dispatch-dag-envelope.d.ts +41 -0
- package/dist/cli/commands/dispatch-dag-envelope.js +49 -0
- package/dist/cli/commands/dispatch-dag-failure.d.ts +18 -0
- package/dist/cli/commands/dispatch-dag-failure.js +16 -0
- package/dist/cli/commands/dispatch-dag-preflight.d.ts +51 -0
- package/dist/cli/commands/dispatch-dag-preflight.js +105 -0
- package/dist/cli/commands/dispatch-dag-runners.d.ts +48 -0
- package/dist/cli/commands/dispatch-dag-runners.js +73 -0
- package/dist/cli/commands/dispatch-detached-branch.d.ts +3 -0
- package/dist/cli/commands/dispatch-detached-branch.js +58 -0
- package/dist/cli/commands/dispatch-envelope.d.ts +36 -0
- package/dist/cli/commands/dispatch-envelope.js +104 -0
- package/dist/cli/commands/dispatch-from-dag.d.ts +27 -0
- package/dist/cli/commands/dispatch-from-dag.js +87 -257
- package/dist/cli/commands/dispatch-isolation-lease.d.ts +17 -0
- package/dist/cli/commands/dispatch-isolation-lease.js +149 -0
- package/dist/cli/commands/dispatch-preflight.d.ts +7 -0
- package/dist/cli/commands/dispatch-preflight.js +105 -0
- package/dist/cli/commands/dispatch-prompt-blocks.d.ts +10 -0
- package/dist/cli/commands/dispatch-prompt-blocks.js +56 -0
- package/dist/cli/commands/dispatch-prompt-composition.d.ts +30 -0
- package/dist/cli/commands/dispatch-prompt-composition.js +171 -0
- package/dist/cli/commands/dispatch-record-write.d.ts +24 -0
- package/dist/cli/commands/dispatch-record-write.js +96 -0
- package/dist/cli/commands/dispatch-tool-call.d.ts +15 -0
- package/dist/cli/commands/dispatch-tool-call.js +128 -0
- package/dist/cli/commands/evolution-command-shared.d.ts +78 -0
- package/dist/cli/commands/evolution-command-shared.js +107 -0
- package/dist/cli/commands/evolution-commands.d.ts +11 -1
- package/dist/cli/commands/evolution-commands.js +19 -350
- package/dist/cli/commands/evolution-evaluate-command.d.ts +24 -0
- package/dist/cli/commands/evolution-evaluate-command.js +138 -0
- package/dist/cli/commands/evolution-propose-command.d.ts +23 -0
- package/dist/cli/commands/evolution-propose-command.js +145 -0
- package/dist/cli/commands/evolution-status-command.d.ts +17 -0
- package/dist/cli/commands/evolution-status-command.js +41 -0
- package/dist/cli/commands/evolution-verdict-commands.d.ts +30 -0
- package/dist/cli/commands/evolution-verdict-commands.js +100 -0
- package/dist/cli/commands/final-review-command-envelopes.d.ts +44 -0
- package/dist/cli/commands/final-review-command-envelopes.js +100 -0
- package/dist/cli/commands/final-review-command-shared.d.ts +52 -0
- package/dist/cli/commands/final-review-command-shared.js +35 -0
- package/dist/cli/commands/final-review-commands.d.ts +7 -27
- package/dist/cli/commands/final-review-commands.js +13 -240
- package/dist/cli/commands/final-review-prepare-command.d.ts +3 -0
- package/dist/cli/commands/final-review-prepare-command.js +200 -0
- package/dist/cli/commands/finalize-accumulator.d.ts +44 -0
- package/dist/cli/commands/finalize-accumulator.js +55 -0
- package/dist/cli/commands/finalize-branches.d.ts +34 -0
- package/dist/cli/commands/finalize-branches.js +119 -0
- package/dist/cli/commands/finalize-runners.d.ts +3 -0
- package/dist/cli/commands/finalize-runners.js +92 -0
- package/dist/cli/commands/finalize-selection.d.ts +65 -0
- package/dist/cli/commands/finalize-selection.js +35 -0
- package/dist/cli/commands/gate-commands.js +26 -8
- package/dist/cli/commands/governance-classify-contract-commands.d.ts +23 -9
- package/dist/cli/commands/governance-classify-contract-commands.js +26 -269
- package/dist/cli/commands/hooks-command-shared.d.ts +42 -0
- package/dist/cli/commands/hooks-command-shared.js +32 -0
- package/dist/cli/commands/hooks-commands.d.ts +20 -0
- package/dist/cli/commands/hooks-commands.js +75 -309
- package/dist/cli/commands/hooks-install-envelopes.d.ts +6 -0
- package/dist/cli/commands/hooks-install-envelopes.js +144 -0
- package/dist/cli/commands/hooks-status-command.d.ts +3 -0
- package/dist/cli/commands/hooks-status-command.js +93 -0
- package/dist/cli/commands/hooks-uninstall-command.d.ts +3 -0
- package/dist/cli/commands/hooks-uninstall-command.js +43 -0
- package/dist/cli/commands/job-checkpoint-commands.d.ts +3 -0
- package/dist/cli/commands/job-checkpoint-commands.js +157 -0
- package/dist/cli/commands/job-command-shared.d.ts +109 -0
- package/dist/cli/commands/job-command-shared.js +72 -0
- package/dist/cli/commands/job-commands.d.ts +4 -64
- package/dist/cli/commands/job-commands.js +42 -552
- package/dist/cli/commands/job-cost-check-command.d.ts +3 -0
- package/dist/cli/commands/job-cost-check-command.js +41 -0
- package/dist/cli/commands/job-init-status-commands.d.ts +3 -0
- package/dist/cli/commands/job-init-status-commands.js +149 -0
- package/dist/cli/commands/job-run-commands.d.ts +3 -0
- package/dist/cli/commands/job-run-commands.js +97 -0
- package/dist/cli/commands/job-state-root.d.ts +35 -0
- package/dist/cli/commands/job-state-root.js +76 -0
- package/dist/cli/commands/loop-command-shared.d.ts +31 -0
- package/dist/cli/commands/loop-command-shared.js +15 -0
- package/dist/cli/commands/loop-commands.d.ts +12 -17
- package/dist/cli/commands/loop-commands.js +56 -238
- package/dist/cli/commands/loop-eval-capture-index.d.ts +4 -0
- package/dist/cli/commands/loop-eval-capture-index.js +44 -0
- package/dist/cli/commands/loop-eval-commands.d.ts +8 -5
- package/dist/cli/commands/loop-eval-commands.js +12 -626
- package/dist/cli/commands/loop-eval-eval-command.d.ts +3 -0
- package/dist/cli/commands/loop-eval-eval-command.js +168 -0
- package/dist/cli/commands/loop-eval-monotonic-command.d.ts +3 -0
- package/dist/cli/commands/loop-eval-monotonic-command.js +90 -0
- package/dist/cli/commands/loop-eval-parents.d.ts +7 -0
- package/dist/cli/commands/loop-eval-parents.js +20 -0
- package/dist/cli/commands/loop-eval-run-code.d.ts +7 -0
- package/dist/cli/commands/loop-eval-run-code.js +40 -0
- package/dist/cli/commands/loop-eval-run-command.d.ts +3 -0
- package/dist/cli/commands/loop-eval-run-command.js +113 -0
- package/dist/cli/commands/loop-eval-spec-commands.d.ts +3 -0
- package/dist/cli/commands/loop-eval-spec-commands.js +165 -0
- package/dist/cli/commands/loop-eval-spec-lint-command.d.ts +3 -0
- package/dist/cli/commands/loop-eval-spec-lint-command.js +42 -0
- package/dist/cli/commands/loop-eval-workflow-commands.d.ts +3 -0
- package/dist/cli/commands/loop-eval-workflow-commands.js +141 -0
- package/dist/cli/commands/loop-export-command.d.ts +3 -0
- package/dist/cli/commands/loop-export-command.js +73 -0
- package/dist/cli/commands/loop-goal-compose-command.d.ts +3 -0
- package/dist/cli/commands/loop-goal-compose-command.js +36 -0
- package/dist/cli/commands/loop-import-command.d.ts +3 -0
- package/dist/cli/commands/loop-import-command.js +86 -0
- package/dist/cli/commands/loop-placeholder-commands.d.ts +3 -0
- package/dist/cli/commands/loop-placeholder-commands.js +52 -0
- package/dist/cli/commands/mcp-commands.d.ts +10 -0
- package/dist/cli/commands/mcp-commands.js +157 -0
- package/dist/cli/commands/memory-command-shared.d.ts +59 -0
- package/dist/cli/commands/memory-command-shared.js +39 -0
- package/dist/cli/commands/memory-commands.d.ts +6 -79
- package/dist/cli/commands/memory-commands.js +19 -309
- package/dist/cli/commands/memory-ingest-command.d.ts +3 -0
- package/dist/cli/commands/memory-ingest-command.js +50 -0
- package/dist/cli/commands/memory-list-command.d.ts +16 -0
- package/dist/cli/commands/memory-list-command.js +129 -0
- package/dist/cli/commands/memory-reindex-command.d.ts +9 -0
- package/dist/cli/commands/memory-reindex-command.js +78 -0
- package/dist/cli/commands/memory-rotate-command.d.ts +3 -0
- package/dist/cli/commands/memory-rotate-command.js +55 -0
- package/dist/cli/commands/memory-search-command.d.ts +7 -0
- package/dist/cli/commands/memory-search-command.js +46 -0
- package/dist/cli/commands/openspec-archive-command.d.ts +3 -0
- package/dist/cli/commands/openspec-archive-command.js +55 -0
- package/dist/cli/commands/openspec-command-shared.d.ts +62 -0
- package/dist/cli/commands/openspec-command-shared.js +135 -0
- package/dist/cli/commands/openspec-commands.d.ts +1 -1
- package/dist/cli/commands/openspec-commands.js +33 -306
- package/dist/cli/commands/openspec-from-doctor-command.d.ts +3 -0
- package/dist/cli/commands/openspec-from-doctor-command.js +66 -0
- package/dist/cli/commands/openspec-init-command.d.ts +3 -0
- package/dist/cli/commands/openspec-init-command.js +49 -0
- package/dist/cli/commands/openspec-list-command.d.ts +3 -0
- package/dist/cli/commands/openspec-list-command.js +27 -0
- package/dist/cli/commands/openspec-render-command.d.ts +3 -0
- package/dist/cli/commands/openspec-render-command.js +33 -0
- package/dist/cli/commands/openspec-show-command.d.ts +3 -0
- package/dist/cli/commands/openspec-show-command.js +33 -0
- package/dist/cli/commands/openspec-to-rd-command.d.ts +3 -0
- package/dist/cli/commands/openspec-to-rd-command.js +33 -0
- package/dist/cli/commands/openspec-validate-command.d.ts +3 -0
- package/dist/cli/commands/openspec-validate-command.js +45 -0
- package/dist/cli/commands/playwright-browser-command.d.ts +8 -0
- package/dist/cli/commands/playwright-browser-command.js +61 -0
- package/dist/cli/commands/playwright-commands.d.ts +10 -62
- package/dist/cli/commands/playwright-commands.js +77 -400
- package/dist/cli/commands/playwright-envelope.d.ts +8 -0
- package/dist/cli/commands/playwright-envelope.js +29 -0
- package/dist/cli/commands/playwright-ls-stop-commands.d.ts +4 -0
- package/dist/cli/commands/playwright-ls-stop-commands.js +74 -0
- package/dist/cli/commands/playwright-session-store.d.ts +65 -0
- package/dist/cli/commands/playwright-session-store.js +189 -0
- package/dist/cli/commands/project-commands.d.ts +19 -0
- package/dist/cli/commands/project-commands.js +98 -259
- package/dist/cli/commands/project-context-command.d.ts +3 -0
- package/dist/cli/commands/project-context-command.js +44 -0
- package/dist/cli/commands/project-dashboard-command.d.ts +3 -0
- package/dist/cli/commands/project-dashboard-command.js +74 -0
- package/dist/cli/commands/project-knowledge-command.d.ts +3 -0
- package/dist/cli/commands/project-knowledge-command.js +48 -0
- package/dist/cli/commands/project-memories-show-command.d.ts +3 -0
- package/dist/cli/commands/project-memories-show-command.js +87 -0
- package/dist/cli/commands/project-memory-index-command.d.ts +3 -0
- package/dist/cli/commands/project-memory-index-command.js +31 -0
- package/dist/cli/commands/qa-archive-screenshots-command.d.ts +3 -0
- package/dist/cli/commands/qa-archive-screenshots-command.js +53 -0
- package/dist/cli/commands/qa-commands.d.ts +14 -87
- package/dist/cli/commands/qa-commands.js +17 -315
- package/dist/cli/commands/qa-context-prestep.d.ts +1 -0
- package/dist/cli/commands/qa-context-prestep.js +34 -0
- package/dist/cli/commands/qa-run-command.d.ts +3 -0
- package/dist/cli/commands/qa-run-command.js +105 -0
- package/dist/cli/commands/qa-run-options.d.ts +23 -0
- package/dist/cli/commands/qa-run-options.js +31 -0
- package/dist/cli/commands/qa-run-slice.d.ts +41 -0
- package/dist/cli/commands/qa-run-slice.js +145 -0
- package/dist/cli/commands/release-canary-command.d.ts +28 -0
- package/dist/cli/commands/release-canary-command.js +129 -0
- package/dist/cli/commands/release-command-shared.d.ts +13 -0
- package/dist/cli/commands/release-command-shared.js +18 -0
- package/dist/cli/commands/release-commands.d.ts +10 -18
- package/dist/cli/commands/release-commands.js +25 -298
- package/dist/cli/commands/release-done-command.d.ts +3 -0
- package/dist/cli/commands/release-done-command.js +64 -0
- package/dist/cli/commands/release-hotfix-command.d.ts +3 -0
- package/dist/cli/commands/release-hotfix-command.js +50 -0
- package/dist/cli/commands/release-plan-command.d.ts +3 -0
- package/dist/cli/commands/release-plan-command.js +33 -0
- package/dist/cli/commands/release-precheck-command.d.ts +3 -0
- package/dist/cli/commands/release-precheck-command.js +28 -0
- package/dist/cli/commands/release-promote-command.d.ts +3 -0
- package/dist/cli/commands/release-promote-command.js +34 -0
- package/dist/cli/commands/release-rollback-command.d.ts +3 -0
- package/dist/cli/commands/release-rollback-command.js +33 -0
- package/dist/cli/commands/release-watch-command.d.ts +3 -0
- package/dist/cli/commands/release-watch-command.js +44 -0
- package/dist/cli/commands/request-command-options.d.ts +49 -0
- package/dist/cli/commands/request-command-options.js +1 -0
- package/dist/cli/commands/request-commands.d.ts +3 -9
- package/dist/cli/commands/request-commands.js +17 -522
- package/dist/cli/commands/request-init-command.d.ts +3 -0
- package/dist/cli/commands/request-init-command.js +100 -0
- package/dist/cli/commands/request-lint-command.d.ts +3 -0
- package/dist/cli/commands/request-lint-command.js +50 -0
- package/dist/cli/commands/request-list-command.d.ts +10 -0
- package/dist/cli/commands/request-list-command.js +53 -0
- package/dist/cli/commands/request-repair-status-command.d.ts +3 -0
- package/dist/cli/commands/request-repair-status-command.js +61 -0
- package/dist/cli/commands/request-show-command.d.ts +3 -0
- package/dist/cli/commands/request-show-command.js +56 -0
- package/dist/cli/commands/request-transition-command.d.ts +3 -0
- package/dist/cli/commands/request-transition-command.js +122 -0
- package/dist/cli/commands/request-transition-failures.d.ts +8 -0
- package/dist/cli/commands/request-transition-failures.js +90 -0
- package/dist/cli/commands/request-transition-hooks.d.ts +50 -0
- package/dist/cli/commands/request-transition-hooks.js +115 -0
- package/dist/cli/commands/request-transition-preflight.d.ts +10 -0
- package/dist/cli/commands/request-transition-preflight.js +107 -0
- package/dist/cli/commands/scan-command-shared.d.ts +96 -0
- package/dist/cli/commands/scan-command-shared.js +83 -0
- package/dist/cli/commands/scan-commands.d.ts +3 -2
- package/dist/cli/commands/scan-commands.js +23 -463
- package/dist/cli/commands/scan-inventory-commands.d.ts +3 -0
- package/dist/cli/commands/scan-inventory-commands.js +96 -0
- package/dist/cli/commands/scan-project-commands.d.ts +3 -0
- package/dist/cli/commands/scan-project-commands.js +65 -0
- package/dist/cli/commands/scan-scope-commands.d.ts +3 -0
- package/dist/cli/commands/scan-scope-commands.js +149 -0
- package/dist/cli/commands/scan-scope-helpers.d.ts +8 -0
- package/dist/cli/commands/scan-scope-helpers.js +54 -0
- package/dist/cli/commands/scan-structural-commands.d.ts +3 -0
- package/dist/cli/commands/scan-structural-commands.js +113 -0
- package/dist/cli/commands/sediment-argv-flags.d.ts +54 -0
- package/dist/cli/commands/sediment-argv-flags.js +116 -0
- package/dist/cli/commands/sediment-command-shared.d.ts +15 -0
- package/dist/cli/commands/sediment-command-shared.js +5 -0
- package/dist/cli/commands/sediment-commands.d.ts +35 -59
- package/dist/cli/commands/sediment-commands.js +36 -590
- package/dist/cli/commands/sediment-pool-commands.d.ts +9 -0
- package/dist/cli/commands/sediment-pool-commands.js +185 -0
- package/dist/cli/commands/sediment-query-commands.d.ts +4 -0
- package/dist/cli/commands/sediment-query-commands.js +94 -0
- package/dist/cli/commands/sediment-release-commands.d.ts +8 -0
- package/dist/cli/commands/sediment-release-commands.js +232 -0
- package/dist/cli/commands/share-commands.d.ts +12 -68
- package/dist/cli/commands/share-commands.js +47 -556
- package/dist/cli/commands/share-error-hints.d.ts +14 -0
- package/dist/cli/commands/share-error-hints.js +38 -0
- package/dist/cli/commands/share-identity.d.ts +13 -0
- package/dist/cli/commands/share-identity.js +22 -0
- package/dist/cli/commands/share-record-paths.d.ts +37 -0
- package/dist/cli/commands/share-record-paths.js +68 -0
- package/dist/cli/commands/share-runners.d.ts +3 -0
- package/dist/cli/commands/share-runners.js +158 -0
- package/dist/cli/commands/shared-read-runners.d.ts +3 -0
- package/dist/cli/commands/shared-read-runners.js +51 -0
- package/dist/cli/commands/slice-check-command.d.ts +3 -0
- package/dist/cli/commands/slice-check-command.js +54 -0
- package/dist/cli/commands/slice-commands.d.ts +2 -22
- package/dist/cli/commands/slice-commands.js +18 -517
- package/dist/cli/commands/slice-decompose-artifacts.d.ts +18 -0
- package/dist/cli/commands/slice-decompose-artifacts.js +79 -0
- package/dist/cli/commands/slice-decompose-command.d.ts +3 -0
- package/dist/cli/commands/slice-decompose-command.js +123 -0
- package/dist/cli/commands/slice-list-commands.d.ts +3 -0
- package/dist/cli/commands/slice-list-commands.js +182 -0
- package/dist/cli/commands/slice-pick-command.d.ts +3 -0
- package/dist/cli/commands/slice-pick-command.js +60 -0
- package/dist/cli/commands/slice-plan-command.d.ts +24 -0
- package/dist/cli/commands/slice-plan-command.js +111 -0
- package/dist/cli/commands/sop-advance-command.d.ts +3 -0
- package/dist/cli/commands/sop-advance-command.js +160 -0
- package/dist/cli/commands/sop-check-command.d.ts +3 -0
- package/dist/cli/commands/sop-check-command.js +44 -0
- package/dist/cli/commands/sop-command-shared.d.ts +23 -0
- package/dist/cli/commands/sop-command-shared.js +18 -0
- package/dist/cli/commands/sop-commands.d.ts +15 -1
- package/dist/cli/commands/sop-commands.js +26 -240
- package/dist/cli/commands/sop-init-command.d.ts +3 -0
- package/dist/cli/commands/sop-init-command.js +51 -0
- package/dist/cli/commands/sop-lint-command.d.ts +3 -0
- package/dist/cli/commands/sop-lint-command.js +64 -0
- package/dist/cli/commands/sop-register-command.d.ts +3 -0
- package/dist/cli/commands/sop-register-command.js +48 -0
- package/dist/cli/commands/sop-registry-command.d.ts +3 -0
- package/dist/cli/commands/sop-registry-command.js +30 -0
- package/dist/cli/commands/statusline-command-shared.d.ts +73 -0
- package/dist/cli/commands/statusline-command-shared.js +90 -0
- package/dist/cli/commands/statusline-commands.d.ts +1 -19
- package/dist/cli/commands/statusline-commands.js +48 -287
- package/dist/cli/commands/statusline-compact-command.d.ts +4 -0
- package/dist/cli/commands/statusline-compact-command.js +54 -0
- package/dist/cli/commands/statusline-install-command.d.ts +3 -0
- package/dist/cli/commands/statusline-install-command.js +48 -0
- package/dist/cli/commands/statusline-render-command.d.ts +9 -0
- package/dist/cli/commands/statusline-render-command.js +55 -0
- package/dist/cli/commands/statusline-status-command.d.ts +3 -0
- package/dist/cli/commands/statusline-status-command.js +23 -0
- package/dist/cli/commands/statusline-uninstall-command.d.ts +3 -0
- package/dist/cli/commands/statusline-uninstall-command.js +23 -0
- package/dist/cli/commands/test-command-run-helpers.d.ts +27 -0
- package/dist/cli/commands/test-command-run-helpers.js +73 -0
- package/dist/cli/commands/test-command-runner-resolution.d.ts +57 -0
- package/dist/cli/commands/test-command-runner-resolution.js +183 -0
- package/dist/cli/commands/test-commands.d.ts +8 -56
- package/dist/cli/commands/test-commands.js +26 -249
- package/dist/cli/commands/vm-command-shared.d.ts +23 -0
- package/dist/cli/commands/vm-command-shared.js +23 -0
- package/dist/cli/commands/vm-commands.d.ts +1 -28
- package/dist/cli/commands/vm-commands.js +36 -270
- package/dist/cli/commands/vm-hypervisor-runtime.d.ts +15 -0
- package/dist/cli/commands/vm-hypervisor-runtime.js +64 -0
- package/dist/cli/commands/vm-release-command.d.ts +5 -0
- package/dist/cli/commands/vm-release-command.js +101 -0
- package/dist/cli/commands/vm-spawn-command.d.ts +5 -0
- package/dist/cli/commands/vm-spawn-command.js +177 -0
- package/dist/cli/commands/web-command-shared.d.ts +12 -0
- package/dist/cli/commands/web-command-shared.js +30 -0
- package/dist/cli/commands/web-commands.d.ts +7 -14
- package/dist/cli/commands/web-commands.js +6 -314
- package/dist/cli/commands/web-install-command.d.ts +10 -0
- package/dist/cli/commands/web-install-command.js +116 -0
- package/dist/cli/commands/web-lifecycle-commands.d.ts +9 -30
- package/dist/cli/commands/web-lifecycle-commands.js +14 -322
- package/dist/cli/commands/web-login-command.d.ts +14 -0
- package/dist/cli/commands/web-login-command.js +189 -0
- package/dist/cli/commands/web-op-payload.d.ts +22 -0
- package/dist/cli/commands/web-op-payload.js +89 -0
- package/dist/cli/commands/web-op-refusals.d.ts +37 -0
- package/dist/cli/commands/web-op-refusals.js +73 -0
- package/dist/cli/commands/web-op-runner.d.ts +14 -0
- package/dist/cli/commands/web-op-runner.js +166 -0
- package/dist/cli/commands/web-status-command.d.ts +4 -0
- package/dist/cli/commands/web-status-command.js +32 -0
- package/dist/cli/commands/web-stop-command.d.ts +10 -0
- package/dist/cli/commands/web-stop-command.js +59 -0
- package/dist/cli/commands/web-verb-specs.d.ts +18 -0
- package/dist/cli/commands/web-verb-specs.js +66 -0
- package/dist/cli/commands/workflow-command-shared.d.ts +102 -0
- package/dist/cli/commands/workflow-command-shared.js +74 -0
- package/dist/cli/commands/workflow-commands.d.ts +10 -1
- package/dist/cli/commands/workflow-commands.js +6 -594
- package/dist/cli/commands/workflow-gate-commands.d.ts +3 -0
- package/dist/cli/commands/workflow-gate-commands.js +116 -0
- package/dist/cli/commands/workflow-graph-commands.d.ts +3 -0
- package/dist/cli/commands/workflow-graph-commands.js +73 -0
- package/dist/cli/commands/workflow-init-command.d.ts +3 -0
- package/dist/cli/commands/workflow-init-command.js +68 -0
- package/dist/cli/commands/workflow-lifecycle-commands.d.ts +9 -59
- package/dist/cli/commands/workflow-lifecycle-commands.js +14 -348
- package/dist/cli/commands/workflow-node-commands.d.ts +3 -0
- package/dist/cli/commands/workflow-node-commands.js +154 -0
- package/dist/cli/commands/workflow-plan-helpers.d.ts +48 -0
- package/dist/cli/commands/workflow-plan-helpers.js +103 -0
- package/dist/cli/commands/workflow-planning-commands.d.ts +3 -0
- package/dist/cli/commands/workflow-planning-commands.js +56 -0
- package/dist/cli/commands/workflow-swarm-actions.d.ts +7 -0
- package/dist/cli/commands/workflow-swarm-actions.js +109 -0
- package/dist/cli/commands/workflow-swarm-commands.d.ts +3 -0
- package/dist/cli/commands/workflow-swarm-commands.js +138 -0
- package/dist/cli/commands/workflow-tech-actions.d.ts +10 -0
- package/dist/cli/commands/workflow-tech-actions.js +150 -0
- package/dist/cli/commands/workflow-terminalize-command.d.ts +3 -0
- package/dist/cli/commands/workflow-terminalize-command.js +56 -0
- package/dist/cli/commands/workspace/init-actions.d.ts +10 -0
- package/dist/cli/commands/workspace/init-actions.js +199 -0
- package/dist/cli/commands/workspace/init-codegraph-stake.d.ts +10 -0
- package/dist/cli/commands/workspace/init-codegraph-stake.js +54 -0
- package/dist/cli/commands/workspace/init-command.d.ts +8 -124
- package/dist/cli/commands/workspace/init-command.js +59 -623
- package/dist/cli/commands/workspace/init-context.d.ts +58 -0
- package/dist/cli/commands/workspace/init-context.js +121 -0
- package/dist/cli/commands/workspace/init-envelope.d.ts +3 -0
- package/dist/cli/commands/workspace/init-envelope.js +34 -0
- package/dist/cli/commands/workspace/init-failures.d.ts +3 -0
- package/dist/cli/commands/workspace/init-failures.js +84 -0
- package/dist/cli/commands/workspace/init-hooks-decision.d.ts +24 -0
- package/dist/cli/commands/workspace/init-hooks-decision.js +189 -0
- package/dist/cli/commands/workspace/init-options.d.ts +102 -0
- package/dist/cli/commands/workspace/init-options.js +1 -0
- package/dist/cli/commands/worktree-lease-commands.d.ts +10 -6
- package/dist/cli/commands/worktree-lease-commands.js +42 -512
- package/dist/cli/commands/worktree-lease-gc-command.d.ts +12 -0
- package/dist/cli/commands/worktree-lease-gc-command.js +117 -0
- package/dist/cli/commands/worktree-lease-git.d.ts +22 -0
- package/dist/cli/commands/worktree-lease-git.js +48 -0
- package/dist/cli/commands/worktree-lease-list-command.d.ts +12 -0
- package/dist/cli/commands/worktree-lease-list-command.js +100 -0
- package/dist/cli/commands/worktree-lease-load.d.ts +37 -0
- package/dist/cli/commands/worktree-lease-load.js +28 -0
- package/dist/cli/commands/worktree-lease-release-command.d.ts +13 -0
- package/dist/cli/commands/worktree-lease-release-command.js +105 -0
- package/dist/cli/commands/worktree-lease-renew-command.d.ts +11 -0
- package/dist/cli/commands/worktree-lease-renew-command.js +99 -0
- package/dist/cli/commands/worktree-lease-session.d.ts +22 -0
- package/dist/cli/commands/worktree-lease-session.js +29 -0
- package/dist/cli/commands/worktree-lease-spawn-command.d.ts +11 -0
- package/dist/cli/commands/worktree-lease-spawn-command.js +119 -0
- package/dist/cli/commands/worktree-lease-status-command.d.ts +11 -0
- package/dist/cli/commands/worktree-lease-status-command.js +86 -0
- package/dist/cli/commands/worktree-lease-store.d.ts +19 -0
- package/dist/cli/commands/worktree-lease-store.js +24 -0
- package/dist/cli/program.js +5 -0
- package/dist/services/code/auto-compact-artifacts.d.ts +54 -0
- package/dist/services/code/auto-compact-artifacts.js +135 -0
- package/dist/services/code/auto-compact-attempt.d.ts +46 -0
- package/dist/services/code/auto-compact-attempt.js +88 -0
- package/dist/services/code/auto-compact-decision.d.ts +74 -0
- package/dist/services/code/auto-compact-decision.js +149 -0
- package/dist/services/code/auto-compact-dispatch-gate.d.ts +36 -0
- package/dist/services/code/auto-compact-dispatch-gate.js +86 -0
- package/dist/services/code/auto-compact-envelopes.d.ts +33 -0
- package/dist/services/code/auto-compact-envelopes.js +134 -0
- package/dist/services/code/auto-compact-history.d.ts +46 -0
- package/dist/services/code/auto-compact-history.js +17 -0
- package/dist/services/code/auto-compact-orchestrator.d.ts +11 -240
- package/dist/services/code/auto-compact-orchestrator.js +165 -686
- package/dist/services/code/auto-compact-run-types.d.ts +123 -0
- package/dist/services/code/auto-compact-run-types.js +1 -0
- package/dist/services/code/emit-handoff.d.ts +35 -1
- package/dist/services/code/emit-handoff.js +128 -7
- package/dist/services/code/step-08-gate.d.ts +28 -19
- package/dist/services/code/step-08-gate.js +92 -35
- package/dist/services/config/config-coercion.d.ts +7 -0
- package/dist/services/config/config-coercion.js +156 -0
- package/dist/services/config/config-file-io.d.ts +11 -0
- package/dist/services/config/config-file-io.js +61 -0
- package/dist/services/config/config-get.d.ts +2 -0
- package/dist/services/config/config-get.js +36 -0
- package/dist/services/config/config-global-loader.d.ts +15 -0
- package/dist/services/config/config-global-loader.js +111 -0
- package/dist/services/config/config-nested-path.d.ts +3 -0
- package/dist/services/config/config-nested-path.js +53 -0
- package/dist/services/config/config-primitives.d.ts +16 -0
- package/dist/services/config/config-primitives.js +24 -0
- package/dist/services/config/config-service.d.ts +9 -33
- package/dist/services/config/config-service.js +16 -665
- package/dist/services/config/config-validation.d.ts +19 -0
- package/dist/services/config/config-validation.js +152 -0
- package/dist/services/config/config-workspace.d.ts +10 -0
- package/dist/services/config/config-workspace.js +158 -0
- package/dist/services/distribution/mcp-install-runner.d.ts +21 -0
- package/dist/services/distribution/mcp-install-runner.js +59 -0
- package/dist/services/distribution/mcp-install.d.ts +95 -0
- package/dist/services/distribution/mcp-install.js +179 -0
- package/dist/services/distribution/plugin-manifest.d.ts +97 -0
- package/dist/services/distribution/plugin-manifest.js +126 -0
- package/dist/services/hooks/mcp-surface-gate.d.ts +19 -0
- package/dist/services/hooks/mcp-surface-gate.js +87 -0
- package/dist/services/ide/adapters/claude-code-adapter.d.ts +4 -35
- package/dist/services/ide/adapters/claude-code-adapter.js +48 -171
- package/dist/services/ide/adapters/claude-code-local-state.d.ts +28 -0
- package/dist/services/ide/adapters/claude-code-local-state.js +112 -0
- package/dist/services/ide/adapters/claude-code-model-window.d.ts +37 -0
- package/dist/services/ide/adapters/claude-code-model-window.js +113 -0
- package/dist/services/ide/ide-mcp-install-types.d.ts +78 -0
- package/dist/services/ide/ide-mcp-install-types.js +104 -0
- package/dist/services/ide/ide-types.d.ts +45 -1
- package/dist/services/ide/mcp-tool-matcher.d.ts +34 -0
- package/dist/services/ide/mcp-tool-matcher.js +84 -0
- package/dist/services/lint/npx-resolver.js +7 -0
- package/dist/services/mcp/cli-executor.d.ts +36 -0
- package/dist/services/mcp/cli-executor.js +97 -0
- package/dist/services/mcp/json-rpc.d.ts +81 -0
- package/dist/services/mcp/json-rpc.js +116 -0
- package/dist/services/mcp/memory-tool.d.ts +3 -0
- package/dist/services/mcp/memory-tool.js +62 -0
- package/dist/services/mcp/server-main.d.ts +1 -0
- package/dist/services/mcp/server-main.js +66 -0
- package/dist/services/mcp/server.d.ts +22 -0
- package/dist/services/mcp/server.js +152 -0
- package/dist/services/mcp/surface.d.ts +62 -0
- package/dist/services/mcp/surface.js +198 -0
- package/dist/services/mcp/tool-core.d.ts +42 -0
- package/dist/services/mcp/tool-core.js +137 -0
- package/dist/services/mcp/tools.d.ts +13 -0
- package/dist/services/mcp/tools.js +58 -0
- package/dist/services/readonly-surface/argv-guard.d.ts +32 -0
- package/dist/services/readonly-surface/argv-guard.js +164 -0
- package/dist/services/readonly-surface/readonly-whitelist.d.ts +147 -0
- package/dist/services/readonly-surface/readonly-whitelist.js +107 -0
- package/dist/services/readonly-surface/whitelist-generator.d.ts +64 -0
- package/dist/services/readonly-surface/whitelist-generator.js +212 -0
- package/dist/services/skills/hooks-codegate-superpowers.d.ts +1 -0
- package/dist/services/skills/hooks-codegate-superpowers.js +26 -0
- package/dist/services/skills/hooks-settings-deny-list.d.ts +61 -0
- package/dist/services/skills/hooks-settings-deny-list.js +173 -0
- package/dist/services/skills/hooks-settings-envelopes.d.ts +20 -0
- package/dist/services/skills/hooks-settings-envelopes.js +79 -0
- package/dist/services/skills/hooks-settings-file-shape.d.ts +43 -0
- package/dist/services/skills/hooks-settings-file-shape.js +207 -0
- package/dist/services/skills/hooks-settings-paths.d.ts +34 -0
- package/dist/services/skills/hooks-settings-paths.js +75 -0
- package/dist/services/skills/hooks-settings-read-installed.d.ts +39 -0
- package/dist/services/skills/hooks-settings-read-installed.js +60 -0
- package/dist/services/skills/hooks-settings-service.d.ts +12 -212
- package/dist/services/skills/hooks-settings-service.js +71 -649
- package/dist/services/skills/hooks-settings-types.d.ts +139 -0
- package/dist/services/skills/hooks-settings-types.js +1 -0
- package/dist/services/workspace/claude-settings-template-merge.d.ts +89 -0
- package/dist/services/workspace/claude-settings-template-merge.js +243 -0
- package/dist/services/workspace/claude-settings-template.d.ts +29 -87
- package/dist/services/workspace/claude-settings-template.js +81 -236
- package/package.json +17 -6
- package/scripts/install-skills-bundles.mjs +233 -0
- package/scripts/install-skills-fs.mjs +148 -0
- package/scripts/install-skills-ide.mjs +279 -0
- package/scripts/install-skills-output-style-default.mjs +196 -0
- package/scripts/install-skills-output-styles.mjs +121 -0
- package/scripts/install-skills-report.mjs +42 -0
- package/scripts/install-skills-user-config.mjs +198 -0
- package/scripts/install-skills.mjs +36 -1066
- package/scripts/watch-tree.mjs +140 -0
- package/scripts/watch.mjs +4 -126
- package/skills/peaks-status/SKILL.md +31 -13
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// The `peaks sub-agent dispatch` preflight: every refusal that can be decided from
|
|
2
|
+
// the argv alone, before the session id, the lease or the prompt blocks are touched.
|
|
3
|
+
// Returns the prompt-size decision, or `null` when a refusal was already printed.
|
|
4
|
+
import { printResult } from '../cli-helpers.js';
|
|
5
|
+
import { fail } from 'peaks-loop-shared/result';
|
|
6
|
+
import { evaluatePromptSize } from '../../services/context/context-guard.js';
|
|
7
|
+
import { TEST_TOOL_DETECTION_BLOCK } from '../../services/dispatch/test-tool-detection.js';
|
|
8
|
+
import { PROMPT_LIMIT_BYTES, RECOMMENDED_ROLES, validateRole } from './sub-agent-shared.js';
|
|
9
|
+
function rejectInvalidRole(io, role, validation, asJson) {
|
|
10
|
+
printResult(io, fail('sub-agent.dispatch', 'INVALID_ROLE', validation, { role, toolCall: null, dispatchRecordPath: null }, [
|
|
11
|
+
'Use a non-empty role string with no control characters.',
|
|
12
|
+
`Recommended: ${RECOMMENDED_ROLES}.`
|
|
13
|
+
]), asJson);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
function rejectRemovedAgentRole(io, role, asJson) {
|
|
18
|
+
printResult(io, fail('sub-agent.dispatch', 'ROLE_REMOVED', 'The agent role was removed in Slice 3', {
|
|
19
|
+
role,
|
|
20
|
+
reason: 'role-removed-in-slice-3',
|
|
21
|
+
toolCall: null,
|
|
22
|
+
dispatchRecordPath: null
|
|
23
|
+
}, []), asJson);
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
function rejectMissingPrompt(io, role, asJson) {
|
|
28
|
+
printResult(io, fail('sub-agent.dispatch', 'MISSING_PROMPT', '--prompt is required when --from-dag is not provided', { role, toolCall: null, dispatchRecordPath: null }, [
|
|
29
|
+
'Re-run with either:',
|
|
30
|
+
' • `--prompt <text>` for single-role dispatch, OR',
|
|
31
|
+
' • `--from-dag <file>` for DAG-aware multi-slice dispatch (no --prompt needed; the per-slice prompt is generated from the DAG nodes).'
|
|
32
|
+
]), asJson);
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
// DOGFOOD ONLY: --prompt-length overrides the actual prompt content with
|
|
37
|
+
// a synthetic prompt of the given size in bytes. The original --prompt
|
|
38
|
+
// is still required (commander needs it). This avoids ARG_MAX limits
|
|
39
|
+
// on Windows when the dogfood prompt is > 200KB.
|
|
40
|
+
function applyPromptLengthOverride(options) {
|
|
41
|
+
if (typeof options.promptLength === 'string' && options.promptLength.length > 0) {
|
|
42
|
+
const len = Number.parseInt(options.promptLength, 10);
|
|
43
|
+
if (Number.isInteger(len) && len > 0) {
|
|
44
|
+
options.prompt = 'x'.repeat(len);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function rejectPromptTooLarge(io, role, promptLength, asJson) {
|
|
49
|
+
printResult(io, fail('sub-agent.dispatch', 'PROMPT_TOO_LARGE', `prompt exceeds ${PROMPT_LIMIT_BYTES} bytes (got ${promptLength})`, { role, toolCall: null, dispatchRecordPath: null }, [
|
|
50
|
+
'Truncate the prompt or split into multiple dispatches.',
|
|
51
|
+
'Pass --force to override the 80% threshold at CLI (NOT allowed at hook layer).'
|
|
52
|
+
]), asJson);
|
|
53
|
+
process.exitCode = 1;
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
function rejectGuardDecision(io, role, args, asJson) {
|
|
57
|
+
const { promptLength, decision } = args;
|
|
58
|
+
printResult(io, fail('sub-agent.dispatch', decision.code, `prompt size ${promptLength} bytes exceeds threshold (tier=${decision.evaluation.tier}, ratio=${decision.evaluation.ratio.toFixed(3)})`, {
|
|
59
|
+
role,
|
|
60
|
+
toolCall: null,
|
|
61
|
+
dispatchRecordPath: null
|
|
62
|
+
}, [
|
|
63
|
+
decision.suggest ?? 'Trim prompt or pass --force to override at CLI.',
|
|
64
|
+
'PreToolUse hook layer will still reject regardless of --force (RL-30 strict).'
|
|
65
|
+
]), asJson);
|
|
66
|
+
process.exitCode = 1;
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
export function preflightDispatch(io, role, options, asJson) {
|
|
70
|
+
const validation = validateRole(role);
|
|
71
|
+
if (validation !== null) {
|
|
72
|
+
return rejectInvalidRole(io, role, validation, asJson);
|
|
73
|
+
}
|
|
74
|
+
// Slice 3 (on-demand-ecc) D-012: the `agent` role was removed in
|
|
75
|
+
// 4.0.0-beta.11 — there is no longer a subprocess path for it
|
|
76
|
+
// (the upstream ECC v2.0.0 ships no `ecc` binary). This guard
|
|
77
|
+
// sits AFTER role validation but BEFORE the missing-prompt
|
|
78
|
+
// check so an action-path dispatch with a valid prompt still
|
|
79
|
+
// returns a clear ROLE_REMOVED envelope + exit 1. Note that
|
|
80
|
+
// Commander short-circuits `--help` BEFORE `.action()` fires,
|
|
81
|
+
// so `peaks sub-agent dispatch agent --help` continues to
|
|
82
|
+
// exit 0 with the help text — that is intentional, not a bug.
|
|
83
|
+
if (role === 'agent') {
|
|
84
|
+
return rejectRemovedAgentRole(io, role, asJson);
|
|
85
|
+
}
|
|
86
|
+
if (!options.prompt || options.prompt.length === 0) {
|
|
87
|
+
return rejectMissingPrompt(io, role, asJson);
|
|
88
|
+
}
|
|
89
|
+
// Slice 4.0.8 RD §4 D4c required `--graph-node` here, before the session
|
|
90
|
+
// id existed, so the only recovery it could offer was prose. The node is
|
|
91
|
+
// now provisioned inside the try block below, once `sid` is known.
|
|
92
|
+
applyPromptLengthOverride(options);
|
|
93
|
+
if (options.prompt.length + TEST_TOOL_DETECTION_BLOCK.length > PROMPT_LIMIT_BYTES) {
|
|
94
|
+
return rejectPromptTooLarge(io, role, options.prompt.length, asJson);
|
|
95
|
+
}
|
|
96
|
+
// G9 CLI 兜底 — evaluate prompt size against the threshold table.
|
|
97
|
+
const decision = evaluatePromptSize(options.prompt.length, { force: options.force === true });
|
|
98
|
+
if (!decision.allow) {
|
|
99
|
+
return rejectGuardDecision(io, role, { promptLength: options.prompt.length, decision }, asJson);
|
|
100
|
+
}
|
|
101
|
+
// The prompt the caller composes with: the `--prompt` the caller passed, or the
|
|
102
|
+
// synthetic one `--prompt-length` substituted for it. Handed back explicitly so a
|
|
103
|
+
// caller that has only the argv cannot mistake an absent prompt for an empty one.
|
|
104
|
+
return { decision, prompt: options.prompt };
|
|
105
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DispatchOptions } from './sub-agent-shared.js';
|
|
2
|
+
export declare function buildIsolationBlock(isolationMode: 'worktree' | 'container' | 'vm' | null, leaseId: string | null, worktreePath: string | null, worktreeBranch: string | null): string;
|
|
3
|
+
export declare function buildMustLsFilesBlock(options: DispatchOptions, projectRoot: string): {
|
|
4
|
+
mustLsFilesVerification: {
|
|
5
|
+
path: string;
|
|
6
|
+
exists: boolean;
|
|
7
|
+
files: readonly string[];
|
|
8
|
+
} | null;
|
|
9
|
+
mustLsFilesBlock: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// The two prompt blocks `composeDispatchPrompt` prepends: the Part 2.C worktree
|
|
2
|
+
// isolation envelope and the F5 `must_ls_files` anti-fake-green enforcement
|
|
3
|
+
// block. Split out of `dispatch-prompt-composition.ts` when compressing that
|
|
4
|
+
// module's long function pushed it past the 300-line cap; both bodies are the
|
|
5
|
+
// originals, moved verbatim.
|
|
6
|
+
import { runGitLsFiles } from '../../services/dispatch/dispatch-sub-agent.js';
|
|
7
|
+
// Part 2.C: when --isolation worktree, prepend an isolation envelope
|
|
8
|
+
// block so the sub-agent sees the lease id + worktree path. The block
|
|
9
|
+
// is short (a few lines). We deliberately do NOT set
|
|
10
|
+
// process.env.PEAKS_WORKTREE_LEASE_ID here — sub-agents are spawned
|
|
11
|
+
// by the LLM in its own environment, not as children of this CLI;
|
|
12
|
+
// the lease id travels through the dispatch record + prompt body.
|
|
13
|
+
export function buildIsolationBlock(isolationMode, leaseId, worktreePath, worktreeBranch) {
|
|
14
|
+
return isolationMode !== null && leaseId !== null
|
|
15
|
+
? `\n## Worktree isolation (Part 2.C)\n` +
|
|
16
|
+
`leaseId: ${leaseId}\n` +
|
|
17
|
+
`worktreePath: ${worktreePath}\n` +
|
|
18
|
+
`branch: ${worktreeBranch}\n` +
|
|
19
|
+
`You MAY ` +
|
|
20
|
+
'`git worktree add` ' +
|
|
21
|
+
`and ` +
|
|
22
|
+
'`git worktree remove` ' +
|
|
23
|
+
`against this lease without a separate ` +
|
|
24
|
+
'`peaks worktree auth grant` ' +
|
|
25
|
+
`— the PreToolUse gate reads the lease file. Run ` +
|
|
26
|
+
'`peaks worktree release --lease-id ${leaseId}` ' +
|
|
27
|
+
`when done.\n`
|
|
28
|
+
: '';
|
|
29
|
+
}
|
|
30
|
+
// F5 follow-up: anti-fake-green gate. When `--must-ls-files <glob>`
|
|
31
|
+
// is supplied, run `git ls-files <glob>` upfront, surface the
|
|
32
|
+
// result in the envelope as `mustLsFilesVerification: { path,
|
|
33
|
+
// exists, files }`, and prepend a `## must_ls_files enforcement`
|
|
34
|
+
// frontmatter block to the sub-agent prompt that mandates the
|
|
35
|
+
// file-existence verification as the LLM's FIRST action (before
|
|
36
|
+
// any "completed"/"PASS" claim). When the flag is absent the
|
|
37
|
+
// field is `null` and no block is injected — old call sites
|
|
38
|
+
export function buildMustLsFilesBlock(options, projectRoot) {
|
|
39
|
+
let mustLsFilesVerification = null;
|
|
40
|
+
let mustLsFilesBlock = '';
|
|
41
|
+
if (typeof options.mustLsFiles === 'string' && options.mustLsFiles.length > 0) {
|
|
42
|
+
const glob = options.mustLsFiles;
|
|
43
|
+
const files = runGitLsFiles(projectRoot, glob);
|
|
44
|
+
const exists = files.length > 0;
|
|
45
|
+
mustLsFilesVerification = { path: glob, exists, files };
|
|
46
|
+
mustLsFilesBlock =
|
|
47
|
+
`\n## must_ls_files enforcement (F5 anti-fake-green)\n` +
|
|
48
|
+
`glob: ${glob}\n` +
|
|
49
|
+
`verification: ${exists ? `EXISTS (${files.length} file${files.length === 1 ? '' : 's'} found)` : 'MISSING (no files matched the glob)'}\n` +
|
|
50
|
+
(exists ? `first match: ${files[0] ?? ''}\n` : '') +
|
|
51
|
+
`BEFORE any claim that work is "completed" or "PASS", you MUST run \`git ls-files ${glob}\` from the project root and ` +
|
|
52
|
+
`confirm the file exists. Anti-fake-green rule (sediment 2026-08-11-rid-001-redo-fake-green-recovery-closure §Lesson 1): ` +
|
|
53
|
+
`if the file does not exist, your verdict MUST be \`status: "blocked"\` with reason "must_ls_files_failed". Do NOT silently skip this step.\n`;
|
|
54
|
+
}
|
|
55
|
+
return { mustLsFilesVerification, mustLsFilesBlock };
|
|
56
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ProgramIO } from '../cli-helpers.js';
|
|
2
|
+
import { getAdapter } from '../../services/ide/ide-registry.js';
|
|
3
|
+
import type { ContextGuardDecision } from '../../services/context/context-guard.js';
|
|
4
|
+
import { type DispatchOptions } from './sub-agent-shared.js';
|
|
5
|
+
export interface ComposeDispatchPromptInput {
|
|
6
|
+
projectRoot: string;
|
|
7
|
+
sid: string;
|
|
8
|
+
rid: string;
|
|
9
|
+
role: string;
|
|
10
|
+
options: DispatchOptions;
|
|
11
|
+
/** The prompt the sub-agent receives, as `preflightDispatch` resolved it. */
|
|
12
|
+
prompt: string;
|
|
13
|
+
isolationMode: 'worktree' | 'container' | 'vm' | null;
|
|
14
|
+
leaseId: string | null;
|
|
15
|
+
worktreePath: string | null;
|
|
16
|
+
worktreeBranch: string | null;
|
|
17
|
+
decision: ContextGuardDecision;
|
|
18
|
+
asJson: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ComposedDispatchPrompt {
|
|
21
|
+
adapter: ReturnType<typeof getAdapter>;
|
|
22
|
+
effectivePrompt: string;
|
|
23
|
+
warnings: string[];
|
|
24
|
+
mustLsFilesVerification: {
|
|
25
|
+
path: string;
|
|
26
|
+
exists: boolean;
|
|
27
|
+
files: readonly string[];
|
|
28
|
+
} | null;
|
|
29
|
+
}
|
|
30
|
+
export declare function composeDispatchPrompt(io: ProgramIO, input: ComposeDispatchPromptInput): Promise<ComposedDispatchPrompt | null>;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// The prompt `peaks sub-agent dispatch` hands a sub-agent: the adapter check, the
|
|
2
|
+
// optional preflight blocks (memory / codegraph / UI library / fresh context /
|
|
3
|
+
// context probe / session capsule), the isolation and must-ls-files blocks, and the
|
|
4
|
+
// warning list the envelope carries.
|
|
5
|
+
import { fail, getErrorMessage } from 'peaks-loop-shared/result';
|
|
6
|
+
import { printResult } from '../cli-helpers.js';
|
|
7
|
+
import { detectInstalledIde } from '../../services/ide/ide-detector.js';
|
|
8
|
+
import { getAdapter } from '../../services/ide/ide-registry.js';
|
|
9
|
+
import { resolveOuterSessionId } from '../../services/session/binding-status-service.js';
|
|
10
|
+
import { loadPreferences } from '../../services/preferences/preferences-service.js';
|
|
11
|
+
import { DEFAULT_PREFERENCES } from '../../services/preferences/preferences-types.js';
|
|
12
|
+
import { MemoryPreflightService, deriveMemoryQuery } from '../../services/context/memory-preflight-service.js';
|
|
13
|
+
import { buildDispatchSystemPrompt } from '../../services/context/build-dispatch-system-prompt.js';
|
|
14
|
+
import { readSessionCapsule } from '../../services/dispatch/session-capsule.js';
|
|
15
|
+
import { computeUiLibraryDispatchBlock } from '../../services/standards/ui-library-dispatch-block.js';
|
|
16
|
+
import { readFreshContextBlock } from '../../services/fresh-context/fresh-context-block.js';
|
|
17
|
+
import { deprecatedReviewerWarnings } from './sub-agent-shared.js';
|
|
18
|
+
import { buildIsolationBlock, buildMustLsFilesBlock } from './dispatch-prompt-blocks.js';
|
|
19
|
+
// loadPreferences can throw on schema mismatch; we fall back to defaults
|
|
20
|
+
// to avoid breaking the dispatch on a stale preferences.json file.
|
|
21
|
+
function loadProjectPreferences(projectRoot) {
|
|
22
|
+
try {
|
|
23
|
+
return loadPreferences(projectRoot);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// TODO(g2): legacy silent catch — grace: 1 minor release (v2.14.0)
|
|
27
|
+
// Keep default preferences.
|
|
28
|
+
return DEFAULT_PREFERENCES;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function rejectUnsupportedIde(io, ide, role, asJson) {
|
|
32
|
+
printResult(io, fail('sub-agent.dispatch', 'IDE_NOT_SUPPORTED', `IDE ${ide} does not support role "${role}"`, { role, toolCall: null, dispatchRecordPath: null }, ['Switch to a registered IDE (e.g. claude-code) or pick a role the current IDE supports.']), asJson);
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
// memory preflight block (or silently skip when unavailable) via the
|
|
37
|
+
// pure-function builder.
|
|
38
|
+
function loadMemoryBlock(projectRoot, projectPrefs, role, prompt) {
|
|
39
|
+
const preflightService = new MemoryPreflightService(projectRoot, projectPrefs);
|
|
40
|
+
// task at hand (role + first line of the brief), not the bare role.
|
|
41
|
+
return preflightService.fetchBlock(deriveMemoryQuery(role, prompt));
|
|
42
|
+
}
|
|
43
|
+
// codegraph preflight for RD planning. BEFORE the RD sub-agent's
|
|
44
|
+
// prompt is composed, ensure the index exists (init + index best-effort
|
|
45
|
+
// when `.codegraph/` is absent) and read a BOUNDED structure summary.
|
|
46
|
+
// `rd` only — other roles keep the legacy prompt byte-identical.
|
|
47
|
+
// Fail-soft: any failure degrades and dispatch proceeds. On failure the
|
|
48
|
+
// preflight's NOTE — the upstream cause — travels as the same value as
|
|
49
|
+
// the block, so the reason cannot be dropped while the block survives.
|
|
50
|
+
// The old `block : null` dropped it, so every degraded dispatch read as success.
|
|
51
|
+
async function loadCodegraphBlock(projectRoot, role) {
|
|
52
|
+
let codegraphBlock;
|
|
53
|
+
if (role === 'rd') {
|
|
54
|
+
try {
|
|
55
|
+
const { buildCodegraphPreflightBlock } = await import('../../services/codegraph/codegraph-preflight-service.js');
|
|
56
|
+
const preflight = await buildCodegraphPreflightBlock(projectRoot);
|
|
57
|
+
codegraphBlock = preflight.available ? preflight.block : preflight.note;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
codegraphBlock = `codegraph preflight threw: ${getErrorMessage(error)}`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return codegraphBlock;
|
|
64
|
+
}
|
|
65
|
+
// component library (+ CSS framework + build tool) in the RD/UI
|
|
66
|
+
// dispatch system prompt so the sub-agent prefers the library over
|
|
67
|
+
// hand-rolled native DOM. Only injected for frontend-generating roles
|
|
68
|
+
// (rd + ui) — qa/sc/txt/prd keep the legacy prompt byte-identical.
|
|
69
|
+
// Fail-soft inside the wrapper: a detection error degrades to null.
|
|
70
|
+
function loadProjectStackBlock(projectRoot, role) {
|
|
71
|
+
let projectStackBlock;
|
|
72
|
+
if (role === 'rd' || role === 'ui') {
|
|
73
|
+
projectStackBlock = computeUiLibraryDispatchBlock(projectRoot);
|
|
74
|
+
}
|
|
75
|
+
return projectStackBlock;
|
|
76
|
+
}
|
|
77
|
+
// Slice 2026-09-07-search-first-preflight: read the orchestrator-
|
|
78
|
+
// synthesized fresh-context block for rd + prd dispatches. The block
|
|
79
|
+
// was written to .peaks/_runtime/<sid>/fresh-context.md when the
|
|
80
|
+
// preflight triggered; it carries ≤5 binding directives that hedge
|
|
81
|
+
// model training-data lag. Fail-soft: a missing / unreadable file, or
|
|
82
|
+
// a file without the `## Fresh context` heading, degrades to null so
|
|
83
|
+
// the prompt stays byte-identical to the legacy shape. Other roles
|
|
84
|
+
// (qa/sc/txt/ui) keep the legacy prompt unchanged.
|
|
85
|
+
function loadFreshContextBlock(projectRoot, sid, role) {
|
|
86
|
+
let freshContextBlock;
|
|
87
|
+
if (role === 'rd' || role === 'prd') {
|
|
88
|
+
freshContextBlock = readFreshContextBlock(projectRoot, sid);
|
|
89
|
+
}
|
|
90
|
+
return freshContextBlock;
|
|
91
|
+
}
|
|
92
|
+
// authoritative context-fill probe before composing the
|
|
93
|
+
// dispatch prompt. The probe is token-counted (IDE adapter's
|
|
94
|
+
// `compact` env-var), not a byte estimate. The composer
|
|
95
|
+
// prepends a `## Context window` block so the dispatched
|
|
96
|
+
// sub-agent reads the actual ratio instead of guessing
|
|
97
|
+
// from message length (char/4 estimates diverge by 2-4x
|
|
98
|
+
// and have caused false "context too low" reports at 60%+
|
|
99
|
+
// free).
|
|
100
|
+
async function loadContextProbe(projectRoot, sid) {
|
|
101
|
+
let contextProbe = null;
|
|
102
|
+
try {
|
|
103
|
+
const { readContextPercent } = await import('../../services/context/auto-compact-reader.js');
|
|
104
|
+
const outerSessionId = resolveOuterSessionId(projectRoot, sid);
|
|
105
|
+
contextProbe = readContextPercent({
|
|
106
|
+
projectRoot,
|
|
107
|
+
sessionId: sid,
|
|
108
|
+
outerSessionId,
|
|
109
|
+
env: process.env
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
// Probe is best-effort; the composer renders a
|
|
114
|
+
// "no probe available" hint instead of failing the
|
|
115
|
+
// dispatch.
|
|
116
|
+
}
|
|
117
|
+
return contextProbe;
|
|
118
|
+
}
|
|
119
|
+
async function composeMemoryAugmentedBody(input, projectPrefs) {
|
|
120
|
+
const { projectRoot, sid, rid, role, prompt } = input;
|
|
121
|
+
const memoryBlock = await loadMemoryBlock(projectRoot, projectPrefs, role, prompt);
|
|
122
|
+
const codegraphBlock = await loadCodegraphBlock(projectRoot, role);
|
|
123
|
+
const projectStackBlock = loadProjectStackBlock(projectRoot, role);
|
|
124
|
+
const freshContextBlock = loadFreshContextBlock(projectRoot, sid, role);
|
|
125
|
+
const contextProbe = await loadContextProbe(projectRoot, sid);
|
|
126
|
+
// capsule published by the orchestrator via `peaks sub-agent share`.
|
|
127
|
+
// Absent capsule → no pointer and no precedence line (byte-identical
|
|
128
|
+
// legacy prompt).
|
|
129
|
+
const capsuleRef = readSessionCapsule({ projectRoot, sid, rid });
|
|
130
|
+
return buildDispatchSystemPrompt({
|
|
131
|
+
taskTitle: role,
|
|
132
|
+
taskBody: prompt,
|
|
133
|
+
memoryBlock,
|
|
134
|
+
// unified Test Tool Detection injection for every role.
|
|
135
|
+
contextProbe,
|
|
136
|
+
// exactOptionalPropertyTypes: only set codegraphBlock when the rd
|
|
137
|
+
// preflight actually produced a value (null = attempted-unavailable,
|
|
138
|
+
// undefined = not requested → legacy prompt unchanged).
|
|
139
|
+
...(codegraphBlock !== undefined ? { codegraphBlock } : {}),
|
|
140
|
+
// Same optionality contract for the project-stack block: set only
|
|
141
|
+
// when the rd/ui detection ran (null = no library → no block,
|
|
142
|
+
// undefined = non-frontend role → legacy prompt unchanged).
|
|
143
|
+
...(projectStackBlock !== undefined ? { projectStackBlock } : {}),
|
|
144
|
+
// Same optionality contract for the fresh-context block: set only
|
|
145
|
+
// when the rd/prd read ran (null = no block on disk → no block,
|
|
146
|
+
// undefined = non-rd/prd role → legacy prompt unchanged).
|
|
147
|
+
...(freshContextBlock !== undefined ? { freshContextBlock } : {}),
|
|
148
|
+
// §4: advisory session capsule pointer + precedence line.
|
|
149
|
+
...(capsuleRef !== null
|
|
150
|
+
? {
|
|
151
|
+
capsule: { batchId: capsuleRef.batchId, key: capsuleRef.key, bytes: capsuleRef.bytes }
|
|
152
|
+
}
|
|
153
|
+
: {})
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
export async function composeDispatchPrompt(io, input) {
|
|
157
|
+
const { projectRoot, role, options, isolationMode, leaseId, worktreePath, worktreeBranch, decision, asJson } = input;
|
|
158
|
+
const projectPrefs = loadProjectPreferences(projectRoot);
|
|
159
|
+
const ide = detectInstalledIde(projectRoot) ?? 'claude-code';
|
|
160
|
+
const adapter = getAdapter(ide);
|
|
161
|
+
if (!adapter.subAgentDispatcher.supportsRole(role)) {
|
|
162
|
+
return rejectUnsupportedIde(io, ide, role, asJson);
|
|
163
|
+
}
|
|
164
|
+
const memoryAugmentedBody = await composeMemoryAugmentedBody(input, projectPrefs);
|
|
165
|
+
const isolationBlock = buildIsolationBlock(isolationMode, leaseId, worktreePath, worktreeBranch);
|
|
166
|
+
const { mustLsFilesVerification, mustLsFilesBlock } = buildMustLsFilesBlock(options, projectRoot);
|
|
167
|
+
const effectivePrompt = `${memoryAugmentedBody}${isolationBlock}${mustLsFilesBlock}`;
|
|
168
|
+
// + rerouted here, never refused — rationale on the helper itself.
|
|
169
|
+
const warnings = [...decision.warnings, ...deprecatedReviewerWarnings(role)];
|
|
170
|
+
return { adapter, effectivePrompt, warnings, mustLsFilesVerification };
|
|
171
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { noteDispatched } from '../../services/dispatch/batch-counter.js';
|
|
2
|
+
import { type ArtifactMeta } from '../../services/context/artifact-meta.js';
|
|
3
|
+
import { type SubAgentToolCall } from '../../services/dispatch/sub-agent-dispatcher.js';
|
|
4
|
+
import { type DispatchOptions } from './sub-agent-shared.js';
|
|
5
|
+
export interface WriteDispatchRecordInput {
|
|
6
|
+
options: DispatchOptions;
|
|
7
|
+
projectRoot: string;
|
|
8
|
+
sid: string;
|
|
9
|
+
rid: string;
|
|
10
|
+
role: string;
|
|
11
|
+
effectivePrompt: string;
|
|
12
|
+
toolCall: SubAgentToolCall;
|
|
13
|
+
batchId: string;
|
|
14
|
+
isolationMode: 'worktree' | 'container' | 'vm' | null;
|
|
15
|
+
leaseId: string | null;
|
|
16
|
+
/** The dispatch's warning list — this function appends to it, as the inline block did. */
|
|
17
|
+
warnings: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface DispatchRecordWrite {
|
|
20
|
+
artifactMeta: ArtifactMeta | null;
|
|
21
|
+
dispatchRecordPath: string;
|
|
22
|
+
counter: ReturnType<typeof noteDispatched>;
|
|
23
|
+
}
|
|
24
|
+
export declare function writeDispatchRecord(input: WriteDispatchRecordInput): DispatchRecordWrite;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// The `peaks sub-agent dispatch` record write: the optional G7 artifact meta, the graph
|
|
2
|
+
// node binding, the dispatch record itself, and the batch counter.
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { getErrorMessage } from 'peaks-loop-shared/result';
|
|
5
|
+
import { noteDispatched } from '../../services/dispatch/batch-counter.js';
|
|
6
|
+
import { writeInitialDispatchRecord } from '../../services/dispatch/dispatch-record-writer.js';
|
|
7
|
+
import { provisionDispatchNode } from '../../services/workflow/provision-dispatch-node.js';
|
|
8
|
+
import { buildArtifactMeta } from '../../services/context/artifact-meta.js';
|
|
9
|
+
import { assertSafeArtifactPath } from 'peaks-loop-shared-channel';
|
|
10
|
+
// G7 — optional --write-artifact: build ArtifactMeta, attach to record.
|
|
11
|
+
function resolveArtifactMeta(input) {
|
|
12
|
+
const { options, projectRoot, rid, role, warnings } = input;
|
|
13
|
+
let artifactMeta = null;
|
|
14
|
+
if (typeof options.writeArtifact === 'string' && options.writeArtifact.length > 0) {
|
|
15
|
+
try {
|
|
16
|
+
assertSafeArtifactPath(options.writeArtifact, projectRoot);
|
|
17
|
+
if (!existsSync(options.writeArtifact)) {
|
|
18
|
+
warnings.push('ARTIFACT_NOT_FOUND');
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
artifactMeta = buildArtifactMeta({
|
|
22
|
+
path: options.writeArtifact,
|
|
23
|
+
rid,
|
|
24
|
+
role,
|
|
25
|
+
idx: 1, // single dispatch, idx=1
|
|
26
|
+
summary: null
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
warnings.push(`ARTIFACT_PATH_INVALID: ${getErrorMessage(err)}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return artifactMeta;
|
|
35
|
+
}
|
|
36
|
+
// Slice 4.0.8 RD §4 D4c: bind this dispatch to a graph node. When the
|
|
37
|
+
// caller names none, provision one — that is what collapses the
|
|
38
|
+
// documented three-step ritual (create graph -> `peaks workflow node
|
|
39
|
+
// prepare` -> dispatch) into a single call. Those three fields were
|
|
40
|
+
// also never passed to the writer, so the record's graph binding was
|
|
41
|
+
// always null and the writer's transition never fired: the feature was
|
|
42
|
+
// inert, and only its precondition (the required flag) was real.
|
|
43
|
+
function resolveGraphBinding(options, projectRoot, sid, role) {
|
|
44
|
+
if (typeof options.graphNode === 'string' && options.graphNode.length > 0) {
|
|
45
|
+
return {
|
|
46
|
+
nodeId: options.graphNode,
|
|
47
|
+
workflowId: options.workflowId ?? null,
|
|
48
|
+
graphRef: options.graphRef ?? null
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const provisioned = provisionDispatchNode({
|
|
52
|
+
projectRoot,
|
|
53
|
+
sessionId: sid,
|
|
54
|
+
role,
|
|
55
|
+
workflowId: options.workflowId,
|
|
56
|
+
graphRef: options.graphRef
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
nodeId: provisioned.nodeId,
|
|
60
|
+
workflowId: provisioned.workflowId,
|
|
61
|
+
graphRef: provisioned.graphRef
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function writeDispatchRecord(input) {
|
|
65
|
+
const { options, projectRoot, sid, rid, role, effectivePrompt, toolCall, batchId, isolationMode, leaseId, warnings } = input;
|
|
66
|
+
const artifactMeta = resolveArtifactMeta(input);
|
|
67
|
+
const graphBinding = resolveGraphBinding(options, projectRoot, sid, role);
|
|
68
|
+
const { path: dispatchRecordPath } = writeInitialDispatchRecord({
|
|
69
|
+
projectRoot,
|
|
70
|
+
sessionId: sid,
|
|
71
|
+
requestId: rid,
|
|
72
|
+
role,
|
|
73
|
+
prompt: effectivePrompt,
|
|
74
|
+
workflowId: graphBinding.workflowId,
|
|
75
|
+
graphNodeId: graphBinding.nodeId,
|
|
76
|
+
graphRef: graphBinding.graphRef,
|
|
77
|
+
toolCall,
|
|
78
|
+
batchId,
|
|
79
|
+
// lease id on the dispatch record so the finalize-time
|
|
80
|
+
// release hook (markCompleted / heartbeat --status done) can
|
|
81
|
+
// auto-fire `peaks worktree release` when the sub-agent
|
|
82
|
+
// completes. Null when --isolation was not requested.
|
|
83
|
+
leaseId,
|
|
84
|
+
// ISO timestamp when the isolation mode was set up. Null
|
|
85
|
+
// when --isolation was not requested. The dashboard reads
|
|
86
|
+
// this directly off the dispatch record to compute
|
|
87
|
+
// isolation duration without cross-referencing the
|
|
88
|
+
// metrics stream.
|
|
89
|
+
isolationStartedAt: isolationMode !== null ? new Date().toISOString() : null
|
|
90
|
+
});
|
|
91
|
+
const counter = noteDispatched(projectRoot, sid, batchId);
|
|
92
|
+
if (counter.warning) {
|
|
93
|
+
warnings.push(counter.warning.message);
|
|
94
|
+
}
|
|
95
|
+
return { artifactMeta, dispatchRecordPath, counter };
|
|
96
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ProgramIO } from '../cli-helpers.js';
|
|
2
|
+
import { getAdapter } from '../../services/ide/ide-registry.js';
|
|
3
|
+
import { type SubAgentToolCall } from '../../services/dispatch/sub-agent-dispatcher.js';
|
|
4
|
+
export interface BuildDispatchToolCallInput {
|
|
5
|
+
adapter: ReturnType<typeof getAdapter>;
|
|
6
|
+
role: string;
|
|
7
|
+
effectivePrompt: string;
|
|
8
|
+
rid: string;
|
|
9
|
+
sid: string;
|
|
10
|
+
projectRoot: string;
|
|
11
|
+
isolationMode: 'worktree' | 'container' | 'vm' | null;
|
|
12
|
+
leaseId: string | null;
|
|
13
|
+
asJson: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function buildDispatchToolCall(io: ProgramIO, input: BuildDispatchToolCallInput): SubAgentToolCall | null;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// The tool call `peaks sub-agent dispatch` returns: built by the active adapter, then
|
|
2
|
+
// stamped with the isolation lease, the provenance token, the Playwright profile env
|
|
3
|
+
// and the observability event.
|
|
4
|
+
import { fail } from 'peaks-loop-shared/result';
|
|
5
|
+
import { printResult } from '../cli-helpers.js';
|
|
6
|
+
import { SubAgentNotSupportedError } from '../../services/dispatch/sub-agent-dispatcher.js';
|
|
7
|
+
import { emitObservabilityEvent, OBSERVABILITY_SUBAGENT_ROLES } from '../../services/observability/observability-service.js';
|
|
8
|
+
import { createDispatchProvenanceToken, DISPATCH_PROVENANCE_ENV, writeDispatchProvenance } from '../../services/worktree/dispatch-provenance.js';
|
|
9
|
+
import { playwrightProfilePaths } from '../../services/worktree/playwright-profile.js';
|
|
10
|
+
function writeWorktreeProvenance(input) {
|
|
11
|
+
const { projectRoot, sid, rid, leaseId, provenanceToken } = input;
|
|
12
|
+
writeDispatchProvenance({
|
|
13
|
+
projectRoot,
|
|
14
|
+
record: {
|
|
15
|
+
schemaVersion: 1,
|
|
16
|
+
token: provenanceToken,
|
|
17
|
+
sessionId: sid,
|
|
18
|
+
requestId: rid,
|
|
19
|
+
leaseId,
|
|
20
|
+
isolation: 'worktree',
|
|
21
|
+
issuedAt: new Date().toISOString()
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// Part 2.C: stamp the toolCall with `isolation` + a sub-agent
|
|
26
|
+
// env block so adapters that surface it (Claude Code's Task
|
|
27
|
+
// tool) propagate the lease id to the spawned process. The
|
|
28
|
+
// env block is the canonical hook the PreToolUse gate reads
|
|
29
|
+
// (gate-commands.ts: process.env.PEAKS_WORKTREE_LEASE_ID).
|
|
30
|
+
function applyIsolationStamp(toolCall, input) {
|
|
31
|
+
const { projectRoot, sid, rid, isolationMode, leaseId } = input;
|
|
32
|
+
if (isolationMode !== null && leaseId !== null) {
|
|
33
|
+
const existingEnv = toolCall.args['env'] ?? {};
|
|
34
|
+
const provenanceToken = createDispatchProvenanceToken({
|
|
35
|
+
sessionId: sid,
|
|
36
|
+
requestId: rid,
|
|
37
|
+
leaseId
|
|
38
|
+
});
|
|
39
|
+
if (isolationMode === 'worktree') {
|
|
40
|
+
writeWorktreeProvenance({ projectRoot, sid, rid, leaseId, provenanceToken });
|
|
41
|
+
}
|
|
42
|
+
// two Playwright profile-isolation env vars so the sub-agent's
|
|
43
|
+
// browser MCP session lands in a deterministic
|
|
44
|
+
// `.peaks/_runtime/<sid>/pw-profiles/<dispatchId>/` directory
|
|
45
|
+
// (see src/services/worktree/playwright-profile.ts). Without
|
|
46
|
+
// these, concurrent dispatches share the user's default
|
|
47
|
+
// Chromium profile and corrupt cookies / localStorage.
|
|
48
|
+
const profile = playwrightProfilePaths({
|
|
49
|
+
projectRoot,
|
|
50
|
+
sessionId: sid,
|
|
51
|
+
dispatchId: rid
|
|
52
|
+
});
|
|
53
|
+
toolCall = {
|
|
54
|
+
...toolCall,
|
|
55
|
+
args: {
|
|
56
|
+
...toolCall.args,
|
|
57
|
+
isolation: isolationMode,
|
|
58
|
+
env: {
|
|
59
|
+
...existingEnv,
|
|
60
|
+
PEAKS_WORKTREE_LEASE_ID: leaseId,
|
|
61
|
+
PEAKS_PLAYWRIGHT_USER_DATA_DIR: profile.userDataDir,
|
|
62
|
+
PEAKS_PLAYWRIGHT_PROFILE_NAME: profile.profileName,
|
|
63
|
+
...(isolationMode === 'worktree' ? { [DISPATCH_PROVENANCE_ENV]: provenanceToken } : {})
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return toolCall;
|
|
69
|
+
}
|
|
70
|
+
// Slice C of v2.11.1 — observability hook #2/7. Fire-and-forget
|
|
71
|
+
// per PRD Q4 (full-auto must never fail-loud). The
|
|
72
|
+
// synchronous emit returns {written:false} on disk-full; we
|
|
73
|
+
// deliberately swallow the result so dispatch contract is
|
|
74
|
+
// unchanged. role is only included when it matches the schema's
|
|
75
|
+
// known sub-agent role set; otherwise it's omitted (non-standard
|
|
76
|
+
// roles like 'qa-business' would otherwise drop the event
|
|
77
|
+
// through schema rejection).
|
|
78
|
+
function emitDispatchObservability(input) {
|
|
79
|
+
const { adapter, role, effectivePrompt, sid, rid, projectRoot } = input;
|
|
80
|
+
const KNOWN_ROLES = new Set(OBSERVABILITY_SUBAGENT_ROLES);
|
|
81
|
+
const knownRole = KNOWN_ROLES.has(role)
|
|
82
|
+
? role
|
|
83
|
+
: null;
|
|
84
|
+
emitObservabilityEvent({
|
|
85
|
+
schemaVersion: 1,
|
|
86
|
+
ts: new Date().toISOString(),
|
|
87
|
+
sessionId: sid,
|
|
88
|
+
category: 'dispatch',
|
|
89
|
+
...(knownRole !== null ? { role: knownRole } : {}),
|
|
90
|
+
detail: {
|
|
91
|
+
requestId: rid,
|
|
92
|
+
ide: adapter.subAgentDispatcher.label,
|
|
93
|
+
promptBytes: effectivePrompt.length
|
|
94
|
+
}
|
|
95
|
+
}, { projectRoot });
|
|
96
|
+
}
|
|
97
|
+
function rejectUnsupportedAdapter(io, role, error, asJson) {
|
|
98
|
+
printResult(io, fail('sub-agent.dispatch', 'IDE_NOT_SUPPORTED', error.message, { role, toolCall: null, dispatchRecordPath: null }, ['Switch IDE or pick a role the current IDE supports.']), asJson);
|
|
99
|
+
process.exitCode = 1;
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
export function buildDispatchToolCall(io, input) {
|
|
103
|
+
const { adapter, role, effectivePrompt, rid, sid, projectRoot, isolationMode, leaseId, asJson } = input;
|
|
104
|
+
let toolCall;
|
|
105
|
+
try {
|
|
106
|
+
toolCall = adapter.subAgentDispatcher.buildToolCall({
|
|
107
|
+
role,
|
|
108
|
+
prompt: effectivePrompt,
|
|
109
|
+
requestId: rid,
|
|
110
|
+
sessionId: sid
|
|
111
|
+
});
|
|
112
|
+
toolCall = applyIsolationStamp(toolCall, {
|
|
113
|
+
projectRoot,
|
|
114
|
+
sid,
|
|
115
|
+
rid,
|
|
116
|
+
isolationMode,
|
|
117
|
+
leaseId
|
|
118
|
+
});
|
|
119
|
+
emitDispatchObservability({ adapter, role, effectivePrompt, sid, rid, projectRoot });
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (error instanceof SubAgentNotSupportedError) {
|
|
123
|
+
return rejectUnsupportedAdapter(io, role, error, asJson);
|
|
124
|
+
}
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
return toolCall;
|
|
128
|
+
}
|