peaks-loop 4.1.3 → 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 +2 -2
- package/CHANGELOG.md +56 -0
- package/README-en.md +1 -1
- package/README.md +1 -1
- 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/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-emit-handoff-command.js +40 -3
- package/dist/cli/commands/code-gate-step-08-command.js +25 -9
- 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/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/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-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-from-dag.d.ts +27 -0
- package/dist/cli/commands/dispatch-from-dag.js +87 -257
- 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/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/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-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/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/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/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-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-terminalize-command.d.ts +3 -0
- package/dist/cli/commands/workflow-terminalize-command.js +56 -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/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 -657
- 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 +5 -5
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// src/cli/commands/web-install-command.ts
|
|
2
|
+
//
|
|
3
|
+
// `peaks web install` — the explicit form of the lazy chromium download, plus
|
|
4
|
+
// R6's recovery path (`--force`). Split out of `web-lifecycle-commands.ts`; the
|
|
5
|
+
// verb name, its options, the gate-first order, the post-install probe and the
|
|
6
|
+
// envelope shapes are unchanged.
|
|
7
|
+
import { fail, getErrorMessage, ok } from 'peaks-loop-shared/result';
|
|
8
|
+
import { degradedEnvelope } from '../../services/web/web-fallback.js';
|
|
9
|
+
import { INSTALL_SIZE_WARNING, installChromium, isWebDisabled, probeBrowserInstalled } from '../../services/web/web-install-service.js';
|
|
10
|
+
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
11
|
+
import { noSession, resolveSession } from './web-command-shared.js';
|
|
12
|
+
/** The MCP fallback for `install`, named so the LLM can act on it (decision C3). */
|
|
13
|
+
const WEB_DISABLED_ACTIONS = [
|
|
14
|
+
'Unset PEAKS_WEB_DISABLED to install locally',
|
|
15
|
+
'Or call mcp__playwright__browser_install instead'
|
|
16
|
+
];
|
|
17
|
+
/** The same fallback, minus the gate, for a download that failed on its own. */
|
|
18
|
+
const INSTALL_FAILED_ACTIONS = [
|
|
19
|
+
'Retry `peaks web install`, or `peaks web install --force` after a partial download',
|
|
20
|
+
'Or call mcp__playwright__browser_install instead'
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* R6's other half: a missing executable is the only reason to download, so an
|
|
24
|
+
* already-complete install is reported without spawning anything. The shortcut
|
|
25
|
+
* still names `--force`, because it is the only escape if a browser op keeps
|
|
26
|
+
* failing against a probe that says otherwise (R7).
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The ordered gate (tech-doc §5.1): `PEAKS_WEB_DISABLED` FIRST, before the
|
|
30
|
+
* session lookup and before anything that could touch the browser cache, so
|
|
31
|
+
* this verb cannot download under the gate even if every later step is broken.
|
|
32
|
+
* Returns the refusal to print, or `null` when the install may proceed.
|
|
33
|
+
*/
|
|
34
|
+
function installRefusal(command) {
|
|
35
|
+
if (isWebDisabled(process.env)) {
|
|
36
|
+
return fail(command, 'WEB_DISABLED', '`peaks web install` will not download anything while PEAKS_WEB_DISABLED=1', {}, WEB_DISABLED_ACTIONS);
|
|
37
|
+
}
|
|
38
|
+
return resolveSession() === null ? noSession(command) : null;
|
|
39
|
+
}
|
|
40
|
+
/** R7: an installer that exited 0 without landing the browser is not a success. */
|
|
41
|
+
function installIncompleteEnvelope() {
|
|
42
|
+
return degradedEnvelope('install', 'WEB_INSTALL_INCOMPLETE: `playwright install chromium` exited 0 but the browser it ' +
|
|
43
|
+
'names is still missing');
|
|
44
|
+
}
|
|
45
|
+
function installDoneEnvelope(command, after, warnings) {
|
|
46
|
+
return ok(command, {
|
|
47
|
+
installed: true,
|
|
48
|
+
downloaded: true,
|
|
49
|
+
version: after.version,
|
|
50
|
+
executablePath: after.executablePath
|
|
51
|
+
}, [...warnings]);
|
|
52
|
+
}
|
|
53
|
+
function alreadyInstalledEnvelope(command, before) {
|
|
54
|
+
return ok(command, {
|
|
55
|
+
installed: true,
|
|
56
|
+
downloaded: false,
|
|
57
|
+
version: before.version,
|
|
58
|
+
executablePath: before.executablePath
|
|
59
|
+
}, [], ['If browser ops still fail, re-run `peaks web install --force`']);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* `peaks web install` — the explicit form of the lazy download, plus R6's
|
|
63
|
+
* recovery path (`--force`).
|
|
64
|
+
*
|
|
65
|
+
* The gate is step 1 of the ordered gate (tech-doc §5.1) — see {@link installRefusal}.
|
|
66
|
+
*/
|
|
67
|
+
export async function runWebInstall(io, asJson, force) {
|
|
68
|
+
const command = 'peaks.web.install';
|
|
69
|
+
try {
|
|
70
|
+
const refusal = installRefusal(command);
|
|
71
|
+
if (refusal !== null) {
|
|
72
|
+
printResult(io, refusal, asJson);
|
|
73
|
+
process.exitCode = 1;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const before = await probeBrowserInstalled();
|
|
77
|
+
if (before.installed && !force) {
|
|
78
|
+
printResult(io, alreadyInstalledEnvelope(command, before), asJson);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
// R2: name the size on the human channel BEFORE the blocking download —
|
|
82
|
+
// this is the only point at which "before" is still available.
|
|
83
|
+
io.stderr(`warning: ${INSTALL_SIZE_WARNING}`);
|
|
84
|
+
const outcome = await installChromium({ force });
|
|
85
|
+
if (!outcome.ok) {
|
|
86
|
+
// R2: a failed download is a structured tier-3 envelope, never a stack.
|
|
87
|
+
printResult(io, degradedEnvelope('install', `${outcome.code}: ${outcome.message}`), asJson);
|
|
88
|
+
process.exitCode = 1;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
// `after.installed` is CONSULTED, not merely carried (R7): an installer
|
|
92
|
+
// that exits 0 without landing the browser — a proxy that filters the CDN, a
|
|
93
|
+
// pinned npx resolving into a different cache root, a partial install —
|
|
94
|
+
// reported `ok: true, downloaded: true, installed: false` with exit 0 and
|
|
95
|
+
// nothing to do next.
|
|
96
|
+
const after = await probeBrowserInstalled();
|
|
97
|
+
if (!after.installed) {
|
|
98
|
+
printResult(io, installIncompleteEnvelope(), asJson);
|
|
99
|
+
process.exitCode = 1;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
printResult(io, installDoneEnvelope(command, after, outcome.warnings), asJson);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
printResult(io, fail(command, 'WEB_INSTALL_FAILED', `peaks web install failed: ${getErrorMessage(error)}`, {}, INSTALL_FAILED_ACTIONS), asJson);
|
|
106
|
+
process.exitCode = 1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
export function registerWebInstallCommand(web, io) {
|
|
110
|
+
addJsonOption(web
|
|
111
|
+
.command('install')
|
|
112
|
+
.description('Download the pinned chromium for `peaks web` (one time, ~700 MB on disk). Needed only ' +
|
|
113
|
+
'before the first browser op — a read-only verb never downloads. Refuses while ' +
|
|
114
|
+
'PEAKS_WEB_DISABLED=1.')
|
|
115
|
+
.option('--force', "reinstall even if the browser is already present (Playwright's own recovery path)")).action((options) => runWebInstall(io, options.json === true, options.force === true));
|
|
116
|
+
}
|
|
@@ -13,36 +13,15 @@
|
|
|
13
13
|
* needs no daemon either, and `login` opens its own headed browser (the daemon's
|
|
14
14
|
* is headless) for a user-level profile that is deliberately cross-project
|
|
15
15
|
* (design §10.2) — which is why it needs no session binding.
|
|
16
|
+
*
|
|
17
|
+
* The verb implementations live beside this file, one module per verb:
|
|
18
|
+
* `web-status-command.ts`, `web-stop-command.ts`, `web-install-command.ts`,
|
|
19
|
+
* `web-login-command.ts`, with the session lookup in `web-command-shared.ts`.
|
|
16
20
|
*/
|
|
17
21
|
import type { Command } from 'commander';
|
|
18
|
-
import {
|
|
22
|
+
import type { ProgramIO } from '../cli-helpers.js';
|
|
19
23
|
export declare function registerWebLifecycleCommands(web: Command, io: ProgramIO): void;
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* caller that checks the process table right after this returns is not racing
|
|
25
|
-
* the teardown (AC6).
|
|
26
|
-
*/
|
|
27
|
-
export declare function runWebStop(io: ProgramIO, asJson: boolean): Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* `peaks web install` — the explicit form of the lazy download, plus R6's
|
|
30
|
-
* recovery path (`--force`).
|
|
31
|
-
*
|
|
32
|
-
* The gate is step 1 of the ordered gate (tech-doc §5.1): checked BEFORE the
|
|
33
|
-
* session lookup, before any lock and before anything that could touch the
|
|
34
|
-
* browser cache, so this verb cannot download under `PEAKS_WEB_DISABLED=1` even
|
|
35
|
-
* if every later step is broken (C2's matrix).
|
|
36
|
-
*/
|
|
37
|
-
export declare function runWebInstall(io: ProgramIO, asJson: boolean, force: boolean): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* `peaks web login --profile <name>` — the only path that persists a login
|
|
40
|
-
* (design §2/§5, PRD R7).
|
|
41
|
-
*
|
|
42
|
-
* `--profile` is enforced HERE rather than with commander's `requiredOption`,
|
|
43
|
-
* because `requiredOption` refuses before this handler runs — and then the
|
|
44
|
-
* `PEAKS_WEB_DISABLED` gate would no longer be statement #1 (tech-doc §5.1,
|
|
45
|
-
* AC5). A profile-less login refuses without touching the profile root: no
|
|
46
|
-
* directory, no storage state, no browser.
|
|
47
|
-
*/
|
|
48
|
-
export declare function runWebLogin(io: ProgramIO, asJson: boolean, rawProfile: string | undefined): Promise<void>;
|
|
24
|
+
export { runWebStatus } from './web-status-command.js';
|
|
25
|
+
export { runWebStop } from './web-stop-command.js';
|
|
26
|
+
export { runWebInstall } from './web-install-command.js';
|
|
27
|
+
export { runWebLogin } from './web-login-command.js';
|
|
@@ -1,323 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { degradedEnvelope } from '../../services/web/web-fallback.js';
|
|
6
|
-
import { INSTALL_SIZE_WARNING, installChromium, isWebDisabled, probeBrowserInstalled } from '../../services/web/web-install-service.js';
|
|
7
|
-
import { buildStatusReport } from '../../services/web/web-status-report.js';
|
|
8
|
-
import { cappedEcho, loginStorageStatePath, resolveProfileName, runHeadedLogin } from '../../services/web/web-login-profile.js';
|
|
9
|
-
import { addJsonOption, printResult } from '../cli-helpers.js';
|
|
1
|
+
import { registerWebInstallCommand } from './web-install-command.js';
|
|
2
|
+
import { registerWebLoginCommand } from './web-login-command.js';
|
|
3
|
+
import { registerWebStatusCommand } from './web-status-command.js';
|
|
4
|
+
import { registerWebStopCommand } from './web-stop-command.js';
|
|
10
5
|
export function registerWebLifecycleCommands(web, io) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"session's daemon is left running rather than signalled.")).action(async (options) => {
|
|
22
|
-
await runWebStop(io, options.json === true);
|
|
23
|
-
});
|
|
24
|
-
addJsonOption(web
|
|
25
|
-
.command('install')
|
|
26
|
-
.description('Download the pinned chromium for `peaks web` (one time, ~700 MB on disk). Needed only ' +
|
|
27
|
-
'before the first browser op — a read-only verb never downloads. Refuses while ' +
|
|
28
|
-
'PEAKS_WEB_DISABLED=1.')
|
|
29
|
-
.option('--force', "reinstall even if the browser is already present (Playwright's own recovery path)")).action(async (options) => {
|
|
30
|
-
await runWebInstall(io, options.json === true, options.force === true);
|
|
31
|
-
});
|
|
32
|
-
addJsonOption(web
|
|
33
|
-
.command('login')
|
|
34
|
-
.description('Open a HEADED browser so the user can log in themselves, then persist that session to ' +
|
|
35
|
-
'~/.peaks/web-profiles/<name>/storageState.json. Run it only when the user asks for a ' +
|
|
36
|
-
'persistent login: it writes live session cookies to disk. --profile is required, and ' +
|
|
37
|
-
'without it nothing is persisted.')
|
|
38
|
-
.option('--profile <name>', 'the login profile to persist (required; [a-z0-9._-], 1-64 chars — upper case folds to lower)')).action(async (options) => {
|
|
39
|
-
await runWebLogin(io, options.json === true, options.profile);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
/** Resolve this project's session, or report `NO_SESSION` exactly once. */
|
|
43
|
-
function resolveSession() {
|
|
44
|
-
const projectRoot = resolveCanonicalProjectRoot(process.cwd());
|
|
45
|
-
const sessionId = getCurrentSessionId(projectRoot);
|
|
46
|
-
return sessionId === null ? null : { projectRoot, sessionId };
|
|
47
|
-
}
|
|
48
|
-
/** The shared `NO_SESSION` envelope for both lifecycle verbs. */
|
|
49
|
-
function noSession(command) {
|
|
50
|
-
return fail(command, 'NO_SESSION', 'No peaks session is bound to this project root', {}, [
|
|
51
|
-
'Bind a session first (the LLM runs `peaks workspace init` on your behalf)'
|
|
52
|
-
]);
|
|
53
|
-
}
|
|
54
|
-
/** Everything `stop` did NOT clean, said out loud rather than left implicit. */
|
|
55
|
-
function stopWarnings(result) {
|
|
56
|
-
const warnings = [];
|
|
57
|
-
const stuck = result.pids.length - result.stopped;
|
|
58
|
-
if (stuck > 0) {
|
|
59
|
-
warnings.push(`${String(stuck)} daemon process(es) did not exit after the stop request; they are recorded, ` +
|
|
60
|
-
'so a later `peaks web stop` can try again');
|
|
61
|
-
}
|
|
62
|
-
if (result.orphanedPids.length > 0) {
|
|
63
|
-
warnings.push(`${String(result.orphanedPids.length)} daemon instance(s) are alive but could not be proven ` +
|
|
64
|
-
"to be this session's daemon (no authenticated identity); the processes were left running, " +
|
|
65
|
-
'because a pid that cannot be proven is never signalled, and their records are kept so ' +
|
|
66
|
-
'`peaks web status` and a later `stop` still see them');
|
|
67
|
-
}
|
|
68
|
-
return warnings;
|
|
69
|
-
}
|
|
70
|
-
export async function runWebStatus(io, asJson) {
|
|
71
|
-
const command = 'peaks.web.status';
|
|
72
|
-
try {
|
|
73
|
-
const session = resolveSession();
|
|
74
|
-
if (session === null) {
|
|
75
|
-
printResult(io, noSession(command), asJson);
|
|
76
|
-
process.exitCode = 1;
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
printResult(io, ok(command, await buildStatusReport(session.projectRoot, session.sessionId)), asJson);
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
printResult(io, fail(command, 'WEB_STATUS_FAILED', `peaks web status failed: ${getErrorMessage(error)}`, {}, []), asJson);
|
|
83
|
-
process.exitCode = 1;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Stop the daemon and clear its records. `stopped` counts the daemons whose
|
|
88
|
-
* process is confirmed GONE by return — not merely the ones we signalled — so a
|
|
89
|
-
* caller that checks the process table right after this returns is not racing
|
|
90
|
-
* the teardown (AC6).
|
|
91
|
-
*/
|
|
92
|
-
export async function runWebStop(io, asJson) {
|
|
93
|
-
const command = 'peaks.web.stop';
|
|
94
|
-
try {
|
|
95
|
-
const session = resolveSession();
|
|
96
|
-
if (session === null) {
|
|
97
|
-
printResult(io, noSession(command), asJson);
|
|
98
|
-
process.exitCode = 1;
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const result = await stopDaemon(session.projectRoot, session.sessionId);
|
|
102
|
-
printResult(io, ok(command, {
|
|
103
|
-
stopped: result.stopped,
|
|
104
|
-
pids: [...result.pids],
|
|
105
|
-
orphanedPids: [...result.orphanedPids]
|
|
106
|
-
}, stopWarnings(result)), asJson);
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
printResult(io, fail(command, 'WEB_STOP_FAILED', `peaks web stop failed: ${getErrorMessage(error)}`, {}, []), asJson);
|
|
110
|
-
process.exitCode = 1;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
/** The MCP fallback for `install`, named so the LLM can act on it (decision C3). */
|
|
114
|
-
const WEB_DISABLED_ACTIONS = [
|
|
115
|
-
'Unset PEAKS_WEB_DISABLED to install locally',
|
|
116
|
-
'Or call mcp__playwright__browser_install instead'
|
|
117
|
-
];
|
|
118
|
-
/** The same fallback, minus the gate, for a download that failed on its own. */
|
|
119
|
-
const INSTALL_FAILED_ACTIONS = [
|
|
120
|
-
'Retry `peaks web install`, or `peaks web install --force` after a partial download',
|
|
121
|
-
'Or call mcp__playwright__browser_install instead'
|
|
122
|
-
];
|
|
123
|
-
/**
|
|
124
|
-
* `peaks web install` — the explicit form of the lazy download, plus R6's
|
|
125
|
-
* recovery path (`--force`).
|
|
126
|
-
*
|
|
127
|
-
* The gate is step 1 of the ordered gate (tech-doc §5.1): checked BEFORE the
|
|
128
|
-
* session lookup, before any lock and before anything that could touch the
|
|
129
|
-
* browser cache, so this verb cannot download under `PEAKS_WEB_DISABLED=1` even
|
|
130
|
-
* if every later step is broken (C2's matrix).
|
|
131
|
-
*/
|
|
132
|
-
export async function runWebInstall(io, asJson, force) {
|
|
133
|
-
const command = 'peaks.web.install';
|
|
134
|
-
try {
|
|
135
|
-
if (isWebDisabled(process.env)) {
|
|
136
|
-
printResult(io, fail(command, 'WEB_DISABLED', '`peaks web install` will not download anything while PEAKS_WEB_DISABLED=1', {}, WEB_DISABLED_ACTIONS), asJson);
|
|
137
|
-
process.exitCode = 1;
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
const session = resolveSession();
|
|
141
|
-
if (session === null) {
|
|
142
|
-
printResult(io, noSession(command), asJson);
|
|
143
|
-
process.exitCode = 1;
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
// R6's other half: a missing executable is the only reason to download, so
|
|
147
|
-
// an already-complete install is reported without spawning anything. The
|
|
148
|
-
// shortcut still names `--force`, because it is the only escape if a browser
|
|
149
|
-
// op keeps failing against a probe that says otherwise (R7).
|
|
150
|
-
const before = await probeBrowserInstalled();
|
|
151
|
-
if (before.installed && !force) {
|
|
152
|
-
printResult(io, ok(command, {
|
|
153
|
-
installed: true,
|
|
154
|
-
downloaded: false,
|
|
155
|
-
version: before.version,
|
|
156
|
-
executablePath: before.executablePath
|
|
157
|
-
}, [], ['If browser ops still fail, re-run `peaks web install --force`']), asJson);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
// R2: name the size on the human channel BEFORE the blocking download —
|
|
161
|
-
// this is the only point at which "before" is still available.
|
|
162
|
-
io.stderr(`warning: ${INSTALL_SIZE_WARNING}`);
|
|
163
|
-
const outcome = await installChromium({ force });
|
|
164
|
-
if (!outcome.ok) {
|
|
165
|
-
// R2: a failed download is a structured tier-3 envelope, never a stack.
|
|
166
|
-
printResult(io, degradedEnvelope('install', `${outcome.code}: ${outcome.message}`), asJson);
|
|
167
|
-
process.exitCode = 1;
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
// `after.installed` is CONSULTED, not merely carried (R7). An installer
|
|
171
|
-
// that exits 0 without landing the browser — a proxy that filters the CDN, a
|
|
172
|
-
// pinned npx resolving into a different cache root, a partial install — used
|
|
173
|
-
// to report `ok: true, downloaded: true, installed: false` with exit 0 and
|
|
174
|
-
// nothing to do next.
|
|
175
|
-
const after = await probeBrowserInstalled();
|
|
176
|
-
if (!after.installed) {
|
|
177
|
-
printResult(io, degradedEnvelope('install', 'WEB_INSTALL_INCOMPLETE: `playwright install chromium` exited 0 but the browser it ' +
|
|
178
|
-
'names is still missing'), asJson);
|
|
179
|
-
process.exitCode = 1;
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
printResult(io, ok(command, {
|
|
183
|
-
installed: true,
|
|
184
|
-
downloaded: true,
|
|
185
|
-
version: after.version,
|
|
186
|
-
executablePath: after.executablePath
|
|
187
|
-
}, [...outcome.warnings]), asJson);
|
|
188
|
-
}
|
|
189
|
-
catch (error) {
|
|
190
|
-
printResult(io, fail(command, 'WEB_INSTALL_FAILED', `peaks web install failed: ${getErrorMessage(error)}`, {}, INSTALL_FAILED_ACTIONS), asJson);
|
|
191
|
-
process.exitCode = 1;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
/** What a caller can actually do after a refusal or an unclosed login. */
|
|
195
|
-
const LOGIN_NEXT_ACTIONS = [
|
|
196
|
-
'Re-run `peaks web login --profile <name>` when the user is ready to log in',
|
|
197
|
-
'Close the headed browser window when the login is finished — closing it is what saves the session'
|
|
198
|
-
];
|
|
199
|
-
/**
|
|
200
|
-
* The fold, said out loud on the one path that CANNOT fold (S4 repair, code F5 /
|
|
201
|
-
* security S5).
|
|
202
|
-
*
|
|
203
|
-
* The gate is statement #1 (tech-doc §5.1), so on this path the name was never
|
|
204
|
-
* validated and never folded — which is exactly why this refusal must not look
|
|
205
|
-
* like it disagrees with a live run about the profile. It reports what happened
|
|
206
|
-
* (nothing was folded, this is what was typed) rather than implying a canonical
|
|
207
|
-
* name was used, and it claims nothing about whether the name would be accepted.
|
|
208
|
-
* The echo is capped by the same helper the guard uses.
|
|
209
|
-
*/
|
|
210
|
-
function gateFoldNotice(rawProfile) {
|
|
211
|
-
if (rawProfile === undefined || rawProfile === rawProfile.toLowerCase()) {
|
|
212
|
-
return [];
|
|
213
|
-
}
|
|
214
|
-
return [
|
|
215
|
-
`--profile ${JSON.stringify(cappedEcho(rawProfile))} was NOT folded: PEAKS_WEB_DISABLED is ` +
|
|
216
|
-
'checked before the profile name, so this refusal echoes what was typed, not a canonical ' +
|
|
217
|
-
'profile. A run that gets past the gate lower-cases the name first.'
|
|
218
|
-
];
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* `peaks web login --profile <name>` — the only path that persists a login
|
|
222
|
-
* (design §2/§5, PRD R7).
|
|
223
|
-
*
|
|
224
|
-
* `--profile` is enforced HERE rather than with commander's `requiredOption`,
|
|
225
|
-
* because `requiredOption` refuses before this handler runs — and then the
|
|
226
|
-
* `PEAKS_WEB_DISABLED` gate would no longer be statement #1 (tech-doc §5.1,
|
|
227
|
-
* AC5). A profile-less login refuses without touching the profile root: no
|
|
228
|
-
* directory, no storage state, no browser.
|
|
229
|
-
*/
|
|
230
|
-
export async function runWebLogin(io, asJson, rawProfile) {
|
|
231
|
-
const command = 'peaks.web.login';
|
|
232
|
-
// Declared out here so the CATCH can report it too (S4 repair, security S5 /
|
|
233
|
-
// code F3): a launch failure happens AFTER the name was resolved, so a run
|
|
234
|
-
// that dies on `WEB_LAUNCH_FAILED` knows the canonical name just as well as
|
|
235
|
-
// one that succeeds, and must not be the one path where the fold is silent.
|
|
236
|
-
let foldWarnings = [];
|
|
237
|
-
try {
|
|
238
|
-
if (isWebDisabled(process.env)) {
|
|
239
|
-
const gateEnvelope = degradedEnvelope('login', 'PEAKS_WEB_DISABLED=1', 3, rawProfile === undefined ? {} : { profile: cappedEcho(rawProfile) });
|
|
240
|
-
printResult(io, { ...gateEnvelope, warnings: [...gateEnvelope.warnings, ...gateFoldNotice(rawProfile)] }, asJson);
|
|
241
|
-
process.exitCode = 1;
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
if (rawProfile === undefined || rawProfile === '') {
|
|
245
|
-
printResult(io, fail(command, 'WEB_PROFILE_REQUIRED', '`peaks web login` requires --profile <name>: it is the only verb that persists a login, ' +
|
|
246
|
-
'and there is no default profile — without a name nothing is written', {}, LOGIN_NEXT_ACTIONS), asJson);
|
|
247
|
-
process.exitCode = 1;
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
let profile;
|
|
251
|
-
try {
|
|
252
|
-
profile = resolveProfileName(rawProfile);
|
|
253
|
-
}
|
|
254
|
-
catch (error) {
|
|
255
|
-
// The helper's own message already begins with the code, and `fail()`
|
|
256
|
-
// puts the code in front of the message again — strip it, so human output
|
|
257
|
-
// does not read `WEB_PROFILE_NAME_INVALID: WEB_PROFILE_NAME_INVALID: …`.
|
|
258
|
-
const detail = getErrorMessage(error).replace(/^WEB_PROFILE_NAME_INVALID:\s*/, '');
|
|
259
|
-
printResult(io, fail(command, 'WEB_PROFILE_NAME_INVALID', detail, {}, LOGIN_NEXT_ACTIONS), asJson);
|
|
260
|
-
process.exitCode = 1;
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
// The fold (see `resolveProfileName`) is never silent: `--profile Work` and
|
|
264
|
-
// `--profile work` are one profile, and the caller is told which name was
|
|
265
|
-
// used. The two sides are deliberately not the same value — the left is what
|
|
266
|
-
// the caller TYPED (echoed through `cappedEcho`, since it is still caller
|
|
267
|
-
// input), the right is the canonical name the run uses from here on.
|
|
268
|
-
foldWarnings =
|
|
269
|
-
rawProfile === profile
|
|
270
|
-
? []
|
|
271
|
-
: [
|
|
272
|
-
`--profile ${JSON.stringify(cappedEcho(rawProfile))} resolved to the profile "${profile}"`
|
|
273
|
-
];
|
|
274
|
-
const outcome = await runHeadedLogin({
|
|
275
|
-
profile,
|
|
276
|
-
announce: () => {
|
|
277
|
-
io.stderr([
|
|
278
|
-
`peaks web login: a headed browser is open for profile "${profile}" — log in there yourself.`,
|
|
279
|
-
'Close the browser window when you are done: that is what saves the session, to ' +
|
|
280
|
-
`${loginStorageStatePath(profile)}.`,
|
|
281
|
-
'The session is captured while the window is open, so the saved state can be up to a ' +
|
|
282
|
-
'second older than what you see — finish logging in before you close it.'
|
|
283
|
-
].join('\n'));
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
if (!outcome.ok) {
|
|
287
|
-
// S1's F1. This is the ONLY path on which the runner returns `ok: false`
|
|
288
|
-
// AND a warning (a login whose context never opened and whose headed
|
|
289
|
-
// browser then refused to close — a browser nothing can then stop,
|
|
290
|
-
// because `stop` is daemon-scoped). `fail()` hard-codes `warnings: []`, so
|
|
291
|
-
// the warning is spread back over it, the shape `degradedEnvelope` uses.
|
|
292
|
-
printResult(io, {
|
|
293
|
-
...fail(command, outcome.code, outcome.message, {}, LOGIN_NEXT_ACTIONS),
|
|
294
|
-
warnings: [...foldWarnings, ...outcome.warnings]
|
|
295
|
-
}, asJson);
|
|
296
|
-
process.exitCode = 1;
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
// Counts, never the values: the file holds live session cookies and this
|
|
300
|
-
// envelope reaches a terminal (and a transcript).
|
|
301
|
-
const envelope = ok(command, {
|
|
302
|
-
profile: outcome.profile,
|
|
303
|
-
storageStatePath: outcome.storageStatePath,
|
|
304
|
-
bytes: outcome.bytes,
|
|
305
|
-
cookies: outcome.cookies,
|
|
306
|
-
origins: outcome.origins
|
|
307
|
-
}, [...foldWarnings, ...outcome.warnings]);
|
|
308
|
-
// R5: a capture that was written but could not be read back is `ok` — the
|
|
309
|
-
// file did land, so it is not a failure — but it is not a clean success
|
|
310
|
-
// either. The code is what an ok-only consumer cannot miss.
|
|
311
|
-
printResult(io, outcome.code === '' ? envelope : { ...envelope, code: outcome.code }, asJson);
|
|
312
|
-
}
|
|
313
|
-
catch (error) {
|
|
314
|
-
printResult(io, {
|
|
315
|
-
...fail(command, 'WEB_LOGIN_FAILED', `peaks web login failed: ${getErrorMessage(error)}`, {}, LOGIN_NEXT_ACTIONS),
|
|
316
|
-
// A run that reached `resolveProfileName` knows the canonical name, so a
|
|
317
|
-
// failure before the browser was even up reports the fold like every
|
|
318
|
-
// other path (S4 repair, code F5 / security S5).
|
|
319
|
-
warnings: foldWarnings
|
|
320
|
-
}, asJson);
|
|
321
|
-
process.exitCode = 1;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
6
|
+
registerWebStatusCommand(web, io);
|
|
7
|
+
registerWebStopCommand(web, io);
|
|
8
|
+
registerWebInstallCommand(web, io);
|
|
9
|
+
registerWebLoginCommand(web, io);
|
|
10
|
+
}
|
|
11
|
+
// Re-export for tests / external consumers.
|
|
12
|
+
export { runWebStatus } from './web-status-command.js';
|
|
13
|
+
export { runWebStop } from './web-stop-command.js';
|
|
14
|
+
export { runWebInstall } from './web-install-command.js';
|
|
15
|
+
export { runWebLogin } from './web-login-command.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import { type ProgramIO } from '../cli-helpers.js';
|
|
3
|
+
/**
|
|
4
|
+
* `peaks web login --profile <name>` — the only path that persists a login
|
|
5
|
+
* (design §2/§5, PRD R7).
|
|
6
|
+
*
|
|
7
|
+
* `--profile` is enforced HERE rather than with commander's `requiredOption`,
|
|
8
|
+
* because `requiredOption` refuses before this handler runs — and then the
|
|
9
|
+
* `PEAKS_WEB_DISABLED` gate would no longer be statement #1 (tech-doc §5.1,
|
|
10
|
+
* AC5). A profile-less login refuses without touching the profile root: no
|
|
11
|
+
* directory, no storage state, no browser.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runWebLogin(io: ProgramIO, asJson: boolean, rawProfile: string | undefined): Promise<void>;
|
|
14
|
+
export declare function registerWebLoginCommand(web: Command, io: ProgramIO): void;
|