peaks-loop 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +51 -0
- package/CHANGELOG.md +3136 -0
- package/LICENSE +21 -0
- package/README-en.md +281 -0
- package/README.md +365 -0
- package/agents/karpathy-reviewer.md +229 -0
- package/bin/peaks.js +2 -0
- package/dist/src/cli/cli-helpers.d.ts +25 -0
- package/dist/src/cli/cli-helpers.js +78 -0
- package/dist/src/cli/commands/agent-commands.d.ts +20 -0
- package/dist/src/cli/commands/agent-commands.js +48 -0
- package/dist/src/cli/commands/audit-commands.d.ts +28 -0
- package/dist/src/cli/commands/audit-commands.js +437 -0
- package/dist/src/cli/commands/capability-commands.d.ts +16 -0
- package/dist/src/cli/commands/capability-commands.js +45 -0
- package/dist/src/cli/commands/capability-worker-config-sc-commands.d.ts +3 -0
- package/dist/src/cli/commands/capability-worker-config-sc-commands.js +10 -0
- package/dist/src/cli/commands/classify-classify-commands.d.ts +19 -0
- package/dist/src/cli/commands/classify-classify-commands.js +151 -0
- package/dist/src/cli/commands/code-review-commands.d.ts +34 -0
- package/dist/src/cli/commands/code-review-commands.js +83 -0
- package/dist/src/cli/commands/codegraph-commands.d.ts +3 -0
- package/dist/src/cli/commands/codegraph-commands.js +99 -0
- package/dist/src/cli/commands/complexity-commands.d.ts +9 -0
- package/dist/src/cli/commands/complexity-commands.js +34 -0
- package/dist/src/cli/commands/config-commands.d.ts +3 -0
- package/dist/src/cli/commands/config-commands.js +220 -0
- package/dist/src/cli/commands/context-builder-commands.d.ts +11 -0
- package/dist/src/cli/commands/context-builder-commands.js +85 -0
- package/dist/src/cli/commands/context-commands.d.ts +21 -0
- package/dist/src/cli/commands/context-commands.js +254 -0
- package/dist/src/cli/commands/contract-commands.d.ts +26 -0
- package/dist/src/cli/commands/contract-commands.js +114 -0
- package/dist/src/cli/commands/core/artifacts-command.d.ts +3 -0
- package/dist/src/cli/commands/core/artifacts-command.js +62 -0
- package/dist/src/cli/commands/core/binding-commands.d.ts +3 -0
- package/dist/src/cli/commands/core/binding-commands.js +58 -0
- package/dist/src/cli/commands/core/doctor-command.d.ts +11 -0
- package/dist/src/cli/commands/core/doctor-command.js +204 -0
- package/dist/src/cli/commands/core/memory-command.d.ts +3 -0
- package/dist/src/cli/commands/core/memory-command.js +98 -0
- package/dist/src/cli/commands/core/profile-command.d.ts +3 -0
- package/dist/src/cli/commands/core/profile-command.js +9 -0
- package/dist/src/cli/commands/core/proxy-command.d.ts +3 -0
- package/dist/src/cli/commands/core/proxy-command.js +26 -0
- package/dist/src/cli/commands/core/session-command.d.ts +3 -0
- package/dist/src/cli/commands/core/session-command.js +213 -0
- package/dist/src/cli/commands/core/skill-command.d.ts +3 -0
- package/dist/src/cli/commands/core/skill-command.js +275 -0
- package/dist/src/cli/commands/core/standards-command.d.ts +3 -0
- package/dist/src/cli/commands/core/standards-command.js +95 -0
- package/dist/src/cli/commands/core-artifact-commands.d.ts +15 -0
- package/dist/src/cli/commands/core-artifact-commands.js +31 -0
- package/dist/src/cli/commands/dispatch-commands.d.ts +10 -0
- package/dist/src/cli/commands/dispatch-commands.js +351 -0
- package/dist/src/cli/commands/dispatch-from-dag.d.ts +3 -0
- package/dist/src/cli/commands/dispatch-from-dag.js +251 -0
- package/dist/src/cli/commands/doc-commands.d.ts +11 -0
- package/dist/src/cli/commands/doc-commands.js +65 -0
- package/dist/src/cli/commands/feedback-commands.d.ts +18 -0
- package/dist/src/cli/commands/feedback-commands.js +145 -0
- package/dist/src/cli/commands/final-review-commands.d.ts +31 -0
- package/dist/src/cli/commands/final-review-commands.js +161 -0
- package/dist/src/cli/commands/fixture-commands.d.ts +32 -0
- package/dist/src/cli/commands/fixture-commands.js +91 -0
- package/dist/src/cli/commands/fork-commands.d.ts +16 -0
- package/dist/src/cli/commands/fork-commands.js +163 -0
- package/dist/src/cli/commands/gate-commands.d.ts +3 -0
- package/dist/src/cli/commands/gate-commands.js +117 -0
- package/dist/src/cli/commands/heartbeat-commands.d.ts +3 -0
- package/dist/src/cli/commands/heartbeat-commands.js +135 -0
- package/dist/src/cli/commands/hook-handle.d.ts +17 -0
- package/dist/src/cli/commands/hook-handle.js +157 -0
- package/dist/src/cli/commands/hooks-commands.d.ts +3 -0
- package/dist/src/cli/commands/hooks-commands.js +156 -0
- package/dist/src/cli/commands/impact-commands.d.ts +15 -0
- package/dist/src/cli/commands/impact-commands.js +62 -0
- package/dist/src/cli/commands/legacy-commands.d.ts +11 -0
- package/dist/src/cli/commands/legacy-commands.js +32 -0
- package/dist/src/cli/commands/log-commands.d.ts +17 -0
- package/dist/src/cli/commands/log-commands.js +64 -0
- package/dist/src/cli/commands/loop-commands.d.ts +21 -0
- package/dist/src/cli/commands/loop-commands.js +128 -0
- package/dist/src/cli/commands/loop-eval-commands.d.ts +20 -0
- package/dist/src/cli/commands/loop-eval-commands.js +526 -0
- package/dist/src/cli/commands/memory-commands.d.ts +23 -0
- package/dist/src/cli/commands/memory-commands.js +129 -0
- package/dist/src/cli/commands/migrate-1-4-1-command.d.ts +11 -0
- package/dist/src/cli/commands/migrate-1-4-1-command.js +34 -0
- package/dist/src/cli/commands/migrate-v2-10-to-v2-11-command.d.ts +20 -0
- package/dist/src/cli/commands/migrate-v2-10-to-v2-11-command.js +52 -0
- package/dist/src/cli/commands/mut-commands.d.ts +20 -0
- package/dist/src/cli/commands/mut-commands.js +239 -0
- package/dist/src/cli/commands/observability-commands.d.ts +22 -0
- package/dist/src/cli/commands/observability-commands.js +201 -0
- package/dist/src/cli/commands/openspec-commands.d.ts +3 -0
- package/dist/src/cli/commands/openspec-commands.js +237 -0
- package/dist/src/cli/commands/perf-audit-commands.d.ts +22 -0
- package/dist/src/cli/commands/perf-audit-commands.js +132 -0
- package/dist/src/cli/commands/perf-commands.d.ts +3 -0
- package/dist/src/cli/commands/perf-commands.js +41 -0
- package/dist/src/cli/commands/playwright-commands.d.ts +95 -0
- package/dist/src/cli/commands/playwright-commands.js +432 -0
- package/dist/src/cli/commands/prd-blocks-commands.d.ts +18 -0
- package/dist/src/cli/commands/prd-blocks-commands.js +50 -0
- package/dist/src/cli/commands/prd-commands.d.ts +18 -0
- package/dist/src/cli/commands/prd-commands.js +141 -0
- package/dist/src/cli/commands/preferences-commands.d.ts +2 -0
- package/dist/src/cli/commands/preferences-commands.js +197 -0
- package/dist/src/cli/commands/project-commands.d.ts +3 -0
- package/dist/src/cli/commands/project-commands.js +248 -0
- package/dist/src/cli/commands/qa-business-review-commands.d.ts +17 -0
- package/dist/src/cli/commands/qa-business-review-commands.js +148 -0
- package/dist/src/cli/commands/qa-commands.d.ts +94 -0
- package/dist/src/cli/commands/qa-commands.js +271 -0
- package/dist/src/cli/commands/release-commands.d.ts +24 -0
- package/dist/src/cli/commands/release-commands.js +231 -0
- package/dist/src/cli/commands/request-commands.d.ts +3 -0
- package/dist/src/cli/commands/request-commands.js +509 -0
- package/dist/src/cli/commands/retrospective-commands.d.ts +12 -0
- package/dist/src/cli/commands/retrospective-commands.js +175 -0
- package/dist/src/cli/commands/reviewer-commands.d.ts +14 -0
- package/dist/src/cli/commands/reviewer-commands.js +64 -0
- package/dist/src/cli/commands/role-commands.d.ts +13 -0
- package/dist/src/cli/commands/role-commands.js +85 -0
- package/dist/src/cli/commands/sc-commands.d.ts +3 -0
- package/dist/src/cli/commands/sc-commands.js +45 -0
- package/dist/src/cli/commands/scan-commands.d.ts +3 -0
- package/dist/src/cli/commands/scan-commands.js +445 -0
- package/dist/src/cli/commands/security-audit-commands.d.ts +23 -0
- package/dist/src/cli/commands/security-audit-commands.js +132 -0
- package/dist/src/cli/commands/session-checkpoint-command.d.ts +10 -0
- package/dist/src/cli/commands/session-checkpoint-command.js +100 -0
- package/dist/src/cli/commands/session-resume-command.d.ts +11 -0
- package/dist/src/cli/commands/session-resume-command.js +83 -0
- package/dist/src/cli/commands/share-commands.d.ts +17 -0
- package/dist/src/cli/commands/share-commands.js +296 -0
- package/dist/src/cli/commands/skill-conformance-commands.d.ts +9 -0
- package/dist/src/cli/commands/skill-conformance-commands.js +39 -0
- package/dist/src/cli/commands/slice-commands.d.ts +24 -0
- package/dist/src/cli/commands/slice-commands.js +492 -0
- package/dist/src/cli/commands/slice-integrate-commands.d.ts +11 -0
- package/dist/src/cli/commands/slice-integrate-commands.js +74 -0
- package/dist/src/cli/commands/slice-review-commands.d.ts +23 -0
- package/dist/src/cli/commands/slice-review-commands.js +162 -0
- package/dist/src/cli/commands/smoke-commands.d.ts +21 -0
- package/dist/src/cli/commands/smoke-commands.js +203 -0
- package/dist/src/cli/commands/solo-commands.d.ts +80 -0
- package/dist/src/cli/commands/solo-commands.js +435 -0
- package/dist/src/cli/commands/sop-commands.d.ts +3 -0
- package/dist/src/cli/commands/sop-commands.js +215 -0
- package/dist/src/cli/commands/statusline-commands.d.ts +3 -0
- package/dist/src/cli/commands/statusline-commands.js +169 -0
- package/dist/src/cli/commands/sub-agent-commands.d.ts +22 -0
- package/dist/src/cli/commands/sub-agent-commands.js +19 -0
- package/dist/src/cli/commands/sub-agent-dispatch-guard.d.ts +55 -0
- package/dist/src/cli/commands/sub-agent-dispatch-guard.js +57 -0
- package/dist/src/cli/commands/sub-agent-shared.d.ts +99 -0
- package/dist/src/cli/commands/sub-agent-shared.js +67 -0
- package/dist/src/cli/commands/test-commands.d.ts +47 -0
- package/dist/src/cli/commands/test-commands.js +204 -0
- package/dist/src/cli/commands/understand-commands.d.ts +3 -0
- package/dist/src/cli/commands/understand-commands.js +112 -0
- package/dist/src/cli/commands/upgrade-commands.d.ts +23 -0
- package/dist/src/cli/commands/upgrade-commands.js +119 -0
- package/dist/src/cli/commands/user-touchpoint-commands.d.ts +18 -0
- package/dist/src/cli/commands/user-touchpoint-commands.js +78 -0
- package/dist/src/cli/commands/verdict-aggregate-command.d.ts +14 -0
- package/dist/src/cli/commands/verdict-aggregate-command.js +106 -0
- package/dist/src/cli/commands/worker-commands.d.ts +3 -0
- package/dist/src/cli/commands/worker-commands.js +52 -0
- package/dist/src/cli/commands/workflow-commands.d.ts +3 -0
- package/dist/src/cli/commands/workflow-commands.js +535 -0
- package/dist/src/cli/commands/workflow-plan-commands.d.ts +39 -0
- package/dist/src/cli/commands/workflow-plan-commands.js +163 -0
- package/dist/src/cli/commands/workspace/clean-command.d.ts +14 -0
- package/dist/src/cli/commands/workspace/clean-command.js +49 -0
- package/dist/src/cli/commands/workspace/helpers.d.ts +28 -0
- package/dist/src/cli/commands/workspace/helpers.js +87 -0
- package/dist/src/cli/commands/workspace/init-command.d.ts +121 -0
- package/dist/src/cli/commands/workspace/init-command.js +436 -0
- package/dist/src/cli/commands/workspace/migrate-command.d.ts +11 -0
- package/dist/src/cli/commands/workspace/migrate-command.js +91 -0
- package/dist/src/cli/commands/workspace/reconcile-command.d.ts +14 -0
- package/dist/src/cli/commands/workspace/reconcile-command.js +103 -0
- package/dist/src/cli/commands/workspace-commands.d.ts +18 -0
- package/dist/src/cli/commands/workspace-commands.js +50 -0
- package/dist/src/cli/index.d.ts +1 -0
- package/dist/src/cli/index.js +30 -0
- package/dist/src/cli/program.d.ts +5 -0
- package/dist/src/cli/program.js +336 -0
- package/dist/src/hooks/pre-tool-use-sub-agent.d.ts +28 -0
- package/dist/src/hooks/pre-tool-use-sub-agent.js +105 -0
- package/dist/src/lib/render/message-renderer.d.ts +20 -0
- package/dist/src/lib/render/message-renderer.js +80 -0
- package/dist/src/services/agent/ecc-agent-service.d.ts +47 -0
- package/dist/src/services/agent/ecc-agent-service.js +143 -0
- package/dist/src/services/artifacts/artifact-lint-service.d.ts +23 -0
- package/dist/src/services/artifacts/artifact-lint-service.js +99 -0
- package/dist/src/services/artifacts/artifact-prerequisites.d.ts +78 -0
- package/dist/src/services/artifacts/artifact-prerequisites.js +491 -0
- package/dist/src/services/artifacts/artifact-service.d.ts +43 -0
- package/dist/src/services/artifacts/artifact-service.js +98 -0
- package/dist/src/services/artifacts/artifact-templates.d.ts +30 -0
- package/dist/src/services/artifacts/artifact-templates.js +302 -0
- package/dist/src/services/artifacts/repair-cycle-service.d.ts +23 -0
- package/dist/src/services/artifacts/repair-cycle-service.js +52 -0
- package/dist/src/services/artifacts/request-artifact-service.d.ts +116 -0
- package/dist/src/services/artifacts/request-artifact-service.js +451 -0
- package/dist/src/services/artifacts/request-artifact-state-helpers.d.ts +51 -0
- package/dist/src/services/artifacts/request-artifact-state-helpers.js +114 -0
- package/dist/src/services/artifacts/workspace-service.d.ts +34 -0
- package/dist/src/services/artifacts/workspace-service.js +272 -0
- package/dist/src/services/audit/artifact-writer.d.ts +93 -0
- package/dist/src/services/audit/artifact-writer.js +303 -0
- package/dist/src/services/audit/audit-goal-service.d.ts +35 -0
- package/dist/src/services/audit/audit-goal-service.js +75 -0
- package/dist/src/services/audit/audit-goal-types.d.ts +40 -0
- package/dist/src/services/audit/audit-goal-types.js +15 -0
- package/dist/src/services/audit/backing-detector.d.ts +24 -0
- package/dist/src/services/audit/backing-detector.js +59 -0
- package/dist/src/services/audit/classifier.d.ts +38 -0
- package/dist/src/services/audit/classifier.js +134 -0
- package/dist/src/services/audit/decision-writer.d.ts +76 -0
- package/dist/src/services/audit/decision-writer.js +217 -0
- package/dist/src/services/audit/enforcers/active-skill-resolver.d.ts +29 -0
- package/dist/src/services/audit/enforcers/active-skill-resolver.js +71 -0
- package/dist/src/services/audit/enforcers/design-draft-confirm.d.ts +24 -0
- package/dist/src/services/audit/enforcers/design-draft-confirm.js +58 -0
- package/dist/src/services/audit/enforcers/lint-audit-regression.d.ts +21 -0
- package/dist/src/services/audit/enforcers/lint-audit-regression.js +86 -0
- package/dist/src/services/audit/enforcers/lint-catalog-governance.d.ts +32 -0
- package/dist/src/services/audit/enforcers/lint-catalog-governance.js +48 -0
- package/dist/src/services/audit/enforcers/lint-cli-back.d.ts +16 -0
- package/dist/src/services/audit/enforcers/lint-cli-back.js +35 -0
- package/dist/src/services/audit/enforcers/lint-output-style.d.ts +11 -0
- package/dist/src/services/audit/enforcers/lint-output-style.js +94 -0
- package/dist/src/services/audit/enforcers/lint-reference-integrity.d.ts +6 -0
- package/dist/src/services/audit/enforcers/lint-reference-integrity.js +83 -0
- package/dist/src/services/audit/enforcers/lint-reference-shape.d.ts +30 -0
- package/dist/src/services/audit/enforcers/lint-reference-shape.js +272 -0
- package/dist/src/services/audit/enforcers/lint-style.d.ts +49 -0
- package/dist/src/services/audit/enforcers/lint-style.js +173 -0
- package/dist/src/services/audit/enforcers/lint-workflow-shape.d.ts +4 -0
- package/dist/src/services/audit/enforcers/lint-workflow-shape.js +100 -0
- package/dist/src/services/audit/enforcers/login-gate.d.ts +23 -0
- package/dist/src/services/audit/enforcers/login-gate.js +40 -0
- package/dist/src/services/audit/enforcers/mock-placement.d.ts +25 -0
- package/dist/src/services/audit/enforcers/mock-placement.js +48 -0
- package/dist/src/services/audit/enforcers/no-root-pollution.d.ts +21 -0
- package/dist/src/services/audit/enforcers/no-root-pollution.js +56 -0
- package/dist/src/services/audit/enforcers/pre-rd-scan.d.ts +22 -0
- package/dist/src/services/audit/enforcers/pre-rd-scan.js +23 -0
- package/dist/src/services/audit/enforcers/prototype-fidelity.d.ts +25 -0
- package/dist/src/services/audit/enforcers/prototype-fidelity.js +75 -0
- package/dist/src/services/audit/enforcers/resume-detection.d.ts +21 -0
- package/dist/src/services/audit/enforcers/resume-detection.js +52 -0
- package/dist/src/services/audit/enforcers/solo-code-ban.d.ts +23 -0
- package/dist/src/services/audit/enforcers/solo-code-ban.js +27 -0
- package/dist/src/services/audit/enforcers/sub-agent-sid.d.ts +25 -0
- package/dist/src/services/audit/enforcers/sub-agent-sid.js +63 -0
- package/dist/src/services/audit/prose-ratio-calculator.d.ts +45 -0
- package/dist/src/services/audit/prose-ratio-calculator.js +52 -0
- package/dist/src/services/audit/red-line-catalog-p2-a.d.ts +21 -0
- package/dist/src/services/audit/red-line-catalog-p2-a.js +229 -0
- package/dist/src/services/audit/red-line-catalog-p2-b.d.ts +19 -0
- package/dist/src/services/audit/red-line-catalog-p2-b.js +225 -0
- package/dist/src/services/audit/red-line-catalog.d.ts +51 -0
- package/dist/src/services/audit/red-line-catalog.js +195 -0
- package/dist/src/services/audit/red-lines-service.d.ts +23 -0
- package/dist/src/services/audit/red-lines-service.js +464 -0
- package/dist/src/services/audit/scanners/openspec-scanner.d.ts +15 -0
- package/dist/src/services/audit/scanners/openspec-scanner.js +55 -0
- package/dist/src/services/audit/scanners/rules-tree-scanner.d.ts +16 -0
- package/dist/src/services/audit/scanners/rules-tree-scanner.js +56 -0
- package/dist/src/services/audit/scanners/skills-tree-scanner.d.ts +17 -0
- package/dist/src/services/audit/scanners/skills-tree-scanner.js +46 -0
- package/dist/src/services/audit/static-service.d.ts +60 -0
- package/dist/src/services/audit/static-service.js +130 -0
- package/dist/src/services/audit/types.d.ts +86 -0
- package/dist/src/services/audit/types.js +13 -0
- package/dist/src/services/audit-independent/perf-audit-service.d.ts +151 -0
- package/dist/src/services/audit-independent/perf-audit-service.js +316 -0
- package/dist/src/services/audit-independent/security-audit-service.d.ts +155 -0
- package/dist/src/services/audit-independent/security-audit-service.js +316 -0
- package/dist/src/services/classify/classify-service.d.ts +42 -0
- package/dist/src/services/classify/classify-service.js +122 -0
- package/dist/src/services/classify/classify-types.d.ts +79 -0
- package/dist/src/services/classify/classify-types.js +90 -0
- package/dist/src/services/code-review/ecc-bridge.d.ts +148 -0
- package/dist/src/services/code-review/ecc-bridge.js +242 -0
- package/dist/src/services/code-review/ocr-service.d.ts +129 -0
- package/dist/src/services/code-review/ocr-service.js +369 -0
- package/dist/src/services/codegraph/codegraph-process-runner.d.ts +2 -0
- package/dist/src/services/codegraph/codegraph-process-runner.js +93 -0
- package/dist/src/services/codegraph/codegraph-service.d.ts +43 -0
- package/dist/src/services/codegraph/codegraph-service.js +160 -0
- package/dist/src/services/complexity/complexity-estimator.d.ts +34 -0
- package/dist/src/services/complexity/complexity-estimator.js +64 -0
- package/dist/src/services/config/config-migration.d.ts +45 -0
- package/dist/src/services/config/config-migration.js +154 -0
- package/dist/src/services/config/config-restore.d.ts +10 -0
- package/dist/src/services/config/config-restore.js +47 -0
- package/dist/src/services/config/config-rollback.d.ts +13 -0
- package/dist/src/services/config/config-rollback.js +26 -0
- package/dist/src/services/config/config-safety.d.ts +40 -0
- package/dist/src/services/config/config-safety.js +359 -0
- package/dist/src/services/config/config-service.d.ts +69 -0
- package/dist/src/services/config/config-service.js +814 -0
- package/dist/src/services/config/config-types.d.ts +119 -0
- package/dist/src/services/config/config-types.js +18 -0
- package/dist/src/services/config/model-routing.d.ts +4 -0
- package/dist/src/services/config/model-routing.js +17 -0
- package/dist/src/services/config/provider-service.d.ts +48 -0
- package/dist/src/services/config/provider-service.js +143 -0
- package/dist/src/services/config/proxy-service.d.ts +21 -0
- package/dist/src/services/config/proxy-service.js +44 -0
- package/dist/src/services/config/sidecar-store.d.ts +25 -0
- package/dist/src/services/config/sidecar-store.js +61 -0
- package/dist/src/services/config/workspace-state-service.d.ts +30 -0
- package/dist/src/services/config/workspace-state-service.js +142 -0
- package/dist/src/services/context/artifact-meta.d.ts +72 -0
- package/dist/src/services/context/artifact-meta.js +105 -0
- package/dist/src/services/context/auto-compact-dispatcher.d.ts +37 -0
- package/dist/src/services/context/auto-compact-dispatcher.js +190 -0
- package/dist/src/services/context/auto-compact-reader.d.ts +51 -0
- package/dist/src/services/context/auto-compact-reader.js +164 -0
- package/dist/src/services/context/auto-compact-types.d.ts +143 -0
- package/dist/src/services/context/auto-compact-types.js +36 -0
- package/dist/src/services/context/collector.d.ts +24 -0
- package/dist/src/services/context/collector.js +133 -0
- package/dist/src/services/context/context-builder.d.ts +30 -0
- package/dist/src/services/context/context-builder.js +78 -0
- package/dist/src/services/context/context-guard.d.ts +49 -0
- package/dist/src/services/context/context-guard.js +91 -0
- package/dist/src/services/context/context-schema.d.ts +415 -0
- package/dist/src/services/context/context-schema.js +73 -0
- package/dist/src/services/context/dispatch-context-guard.d.ts +27 -0
- package/dist/src/services/context/dispatch-context-guard.js +192 -0
- package/dist/src/services/context/doc-retriever.d.ts +26 -0
- package/dist/src/services/context/doc-retriever.js +51 -0
- package/dist/src/services/context/headroom-client.d.ts +34 -0
- package/dist/src/services/context/headroom-client.js +117 -0
- package/dist/src/services/context/headroom-fetcher.d.ts +6 -0
- package/dist/src/services/context/headroom-fetcher.js +28 -0
- package/dist/src/services/context/headroom-prefs.d.ts +46 -0
- package/dist/src/services/context/headroom-prefs.js +34 -0
- package/dist/src/services/context/index.d.ts +7 -0
- package/dist/src/services/context/index.js +6 -0
- package/dist/src/services/context/main-session-monitor.d.ts +77 -0
- package/dist/src/services/context/main-session-monitor.js +130 -0
- package/dist/src/services/context/renderer.d.ts +20 -0
- package/dist/src/services/context/renderer.js +30 -0
- package/dist/src/services/context/shared-channel.d.ts +93 -0
- package/dist/src/services/context/shared-channel.js +308 -0
- package/dist/src/services/context/threshold.d.ts +35 -0
- package/dist/src/services/context/threshold.js +76 -0
- package/dist/src/services/context/tokenizer.d.ts +12 -0
- package/dist/src/services/context/tokenizer.js +43 -0
- package/dist/src/services/context/types.d.ts +93 -0
- package/dist/src/services/context/types.js +9 -0
- package/dist/src/services/dashboard/project-dashboard-service.d.ts +91 -0
- package/dist/src/services/dashboard/project-dashboard-service.js +147 -0
- package/dist/src/services/dispatch/batch-counter.d.ts +27 -0
- package/dist/src/services/dispatch/batch-counter.js +102 -0
- package/dist/src/services/dispatch/contract-store.d.ts +63 -0
- package/dist/src/services/dispatch/contract-store.js +157 -0
- package/dist/src/services/dispatch/dispatch-record-writer.d.ts +138 -0
- package/dist/src/services/dispatch/dispatch-record-writer.js +460 -0
- package/dist/src/services/dispatch/heartbeat-truncator.d.ts +26 -0
- package/dist/src/services/dispatch/heartbeat-truncator.js +13 -0
- package/dist/src/services/dispatch/leak-detector.d.ts +11 -0
- package/dist/src/services/dispatch/leak-detector.js +72 -0
- package/dist/src/services/dispatch/slice-dag.d.ts +81 -0
- package/dist/src/services/dispatch/slice-dag.js +238 -0
- package/dist/src/services/dispatch/sub-agent-dispatcher.d.ts +239 -0
- package/dist/src/services/dispatch/sub-agent-dispatcher.js +382 -0
- package/dist/src/services/dispatch/test-tool-detection.d.ts +36 -0
- package/dist/src/services/dispatch/test-tool-detection.js +46 -0
- package/dist/src/services/doc/doc-generator.d.ts +38 -0
- package/dist/src/services/doc/doc-generator.js +122 -0
- package/dist/src/services/doctor/doctor-service.d.ts +149 -0
- package/dist/src/services/doctor/doctor-service.js +929 -0
- package/dist/src/services/feedback/feedback-promotion-service.d.ts +123 -0
- package/dist/src/services/feedback/feedback-promotion-service.js +300 -0
- package/dist/src/services/filesystem/file-lock.d.ts +11 -0
- package/dist/src/services/filesystem/file-lock.js +129 -0
- package/dist/src/services/final-review/final-review-service.d.ts +12 -0
- package/dist/src/services/final-review/final-review-service.js +52 -0
- package/dist/src/services/final-review/final-review-types.d.ts +42 -0
- package/dist/src/services/final-review/final-review-types.js +18 -0
- package/dist/src/services/fixture/fixture-capture-service.d.ts +87 -0
- package/dist/src/services/fixture/fixture-capture-service.js +317 -0
- package/dist/src/services/fixture/fixture-sanitize-service.d.ts +117 -0
- package/dist/src/services/fixture/fixture-sanitize-service.js +161 -0
- package/dist/src/services/fixture/index.d.ts +8 -0
- package/dist/src/services/fixture/index.js +8 -0
- package/dist/src/services/fork/fork-sync-state.d.ts +85 -0
- package/dist/src/services/fork/fork-sync-state.js +130 -0
- package/dist/src/services/fuzzy-matching/fuzzy-match-service.d.ts +15 -0
- package/dist/src/services/fuzzy-matching/fuzzy-match-service.js +56 -0
- package/dist/src/services/fuzzy-matching/fzf-pick-service.d.ts +68 -0
- package/dist/src/services/fuzzy-matching/fzf-pick-service.js +158 -0
- package/dist/src/services/fuzzy-matching/types.d.ts +20 -0
- package/dist/src/services/fuzzy-matching/types.js +1 -0
- package/dist/src/services/handoff/handoff-parser.d.ts +28 -0
- package/dist/src/services/handoff/handoff-parser.js +69 -0
- package/dist/src/services/handoff/handoff-types.d.ts +39 -0
- package/dist/src/services/handoff/handoff-types.js +19 -0
- package/dist/src/services/handoff/handoff-writer.d.ts +23 -0
- package/dist/src/services/handoff/handoff-writer.js +30 -0
- package/dist/src/services/hooks/output.d.ts +92 -0
- package/dist/src/services/hooks/output.js +111 -0
- package/dist/src/services/hooks/presence-marker-detector.d.ts +16 -0
- package/dist/src/services/hooks/presence-marker-detector.js +105 -0
- package/dist/src/services/ide/adapters/claude-code-adapter.d.ts +18 -0
- package/dist/src/services/ide/adapters/claude-code-adapter.js +91 -0
- package/dist/src/services/ide/adapters/codex-adapter.d.ts +46 -0
- package/dist/src/services/ide/adapters/codex-adapter.js +97 -0
- package/dist/src/services/ide/adapters/cursor-adapter.d.ts +36 -0
- package/dist/src/services/ide/adapters/cursor-adapter.js +84 -0
- package/dist/src/services/ide/adapters/hermes-adapter.d.ts +21 -0
- package/dist/src/services/ide/adapters/hermes-adapter.js +51 -0
- package/dist/src/services/ide/adapters/openclaw-adapter.d.ts +14 -0
- package/dist/src/services/ide/adapters/openclaw-adapter.js +42 -0
- package/dist/src/services/ide/adapters/trae-adapter.d.ts +42 -0
- package/dist/src/services/ide/adapters/trae-adapter.js +83 -0
- package/dist/src/services/ide/hook-protocol.d.ts +47 -0
- package/dist/src/services/ide/hook-protocol.js +74 -0
- package/dist/src/services/ide/hook-translator.d.ts +72 -0
- package/dist/src/services/ide/hook-translator.js +128 -0
- package/dist/src/services/ide/ide-detector.d.ts +10 -0
- package/dist/src/services/ide/ide-detector.js +19 -0
- package/dist/src/services/ide/ide-registry.d.ts +14 -0
- package/dist/src/services/ide/ide-registry.js +60 -0
- package/dist/src/services/ide/ide-types.d.ts +230 -0
- package/dist/src/services/ide/ide-types.js +2 -0
- package/dist/src/services/ide/resource-profile.d.ts +52 -0
- package/dist/src/services/ide/resource-profile.js +33 -0
- package/dist/src/services/ide/shared/atomic-json.d.ts +15 -0
- package/dist/src/services/ide/shared/atomic-json.js +58 -0
- package/dist/src/services/ide/shared/safe-path.d.ts +11 -0
- package/dist/src/services/ide/shared/safe-path.js +29 -0
- package/dist/src/services/impact/impact-scan-service.d.ts +66 -0
- package/dist/src/services/impact/impact-scan-service.js +197 -0
- package/dist/src/services/legacy/legacy-detector.d.ts +34 -0
- package/dist/src/services/legacy/legacy-detector.js +111 -0
- package/dist/src/services/log/log-commands-service.d.ts +54 -0
- package/dist/src/services/log/log-commands-service.js +83 -0
- package/dist/src/services/log/logger.d.ts +103 -0
- package/dist/src/services/log/logger.js +224 -0
- package/dist/src/services/log/redact.d.ts +32 -0
- package/dist/src/services/log/redact.js +89 -0
- package/dist/src/services/log/retention.d.ts +34 -0
- package/dist/src/services/log/retention.js +78 -0
- package/dist/src/services/loop/evaluator-dispatcher.d.ts +50 -0
- package/dist/src/services/loop/evaluator-dispatcher.js +551 -0
- package/dist/src/services/loop/monotonic-guard.d.ts +80 -0
- package/dist/src/services/loop/monotonic-guard.js +215 -0
- package/dist/src/services/loop/monotonic-runner.d.ts +55 -0
- package/dist/src/services/loop/monotonic-runner.js +197 -0
- package/dist/src/services/loop/run-driver.d.ts +70 -0
- package/dist/src/services/loop/run-driver.js +379 -0
- package/dist/src/services/loop/spec-service.d.ts +90 -0
- package/dist/src/services/loop/spec-service.js +497 -0
- package/dist/src/services/memory/llm-reranker.d.ts +174 -0
- package/dist/src/services/memory/llm-reranker.js +284 -0
- package/dist/src/services/memory/memory-search-service.d.ts +93 -0
- package/dist/src/services/memory/memory-search-service.js +117 -0
- package/dist/src/services/memory/project-context-service.d.ts +11 -0
- package/dist/src/services/memory/project-context-service.js +148 -0
- package/dist/src/services/memory/project-memory-service.d.ts +167 -0
- package/dist/src/services/memory/project-memory-service.js +817 -0
- package/dist/src/services/migration/v2-10-to-v2-11-service.d.ts +44 -0
- package/dist/src/services/migration/v2-10-to-v2-11-service.js +190 -0
- package/dist/src/services/migration/v2-10-to-v2-11-types.d.ts +41 -0
- package/dist/src/services/migration/v2-10-to-v2-11-types.js +23 -0
- package/dist/src/services/mode/bypass-tracker.d.ts +4 -0
- package/dist/src/services/mode/bypass-tracker.js +31 -0
- package/dist/src/services/mode/mode-enforcement.d.ts +14 -0
- package/dist/src/services/mode/mode-enforcement.js +84 -0
- package/dist/src/services/mut/assert-scanner.d.ts +6 -0
- package/dist/src/services/mut/assert-scanner.js +116 -0
- package/dist/src/services/mut/index.d.ts +8 -0
- package/dist/src/services/mut/index.js +7 -0
- package/dist/src/services/mut/mut-runner.d.ts +39 -0
- package/dist/src/services/mut/mut-runner.js +29 -0
- package/dist/src/services/mut/production-stryker.d.ts +7 -0
- package/dist/src/services/mut/production-stryker.js +66 -0
- package/dist/src/services/mut/report-builder.d.ts +11 -0
- package/dist/src/services/mut/report-builder.js +110 -0
- package/dist/src/services/mut/report-loader.d.ts +31 -0
- package/dist/src/services/mut/report-loader.js +78 -0
- package/dist/src/services/mut/thresholds.d.ts +21 -0
- package/dist/src/services/mut/thresholds.js +22 -0
- package/dist/src/services/mut/types.d.ts +336 -0
- package/dist/src/services/mut/types.js +59 -0
- package/dist/src/services/observability/aggregation.d.ts +64 -0
- package/dist/src/services/observability/aggregation.js +217 -0
- package/dist/src/services/observability/jsonl-store.d.ts +59 -0
- package/dist/src/services/observability/jsonl-store.js +120 -0
- package/dist/src/services/observability/observability-service.d.ts +95 -0
- package/dist/src/services/observability/observability-service.js +119 -0
- package/dist/src/services/observability/report-formatter.d.ts +42 -0
- package/dist/src/services/observability/report-formatter.js +156 -0
- package/dist/src/services/openspec/openspec-archive-service.d.ts +12 -0
- package/dist/src/services/openspec/openspec-archive-service.js +28 -0
- package/dist/src/services/openspec/openspec-bridge-service.d.ts +16 -0
- package/dist/src/services/openspec/openspec-bridge-service.js +76 -0
- package/dist/src/services/openspec/openspec-init-service.d.ts +23 -0
- package/dist/src/services/openspec/openspec-init-service.js +122 -0
- package/dist/src/services/openspec/openspec-propose-from-doctor-service.d.ts +31 -0
- package/dist/src/services/openspec/openspec-propose-from-doctor-service.js +95 -0
- package/dist/src/services/openspec/openspec-render-service.d.ts +38 -0
- package/dist/src/services/openspec/openspec-render-service.js +130 -0
- package/dist/src/services/openspec/openspec-scan-service.d.ts +6 -0
- package/dist/src/services/openspec/openspec-scan-service.js +123 -0
- package/dist/src/services/openspec/openspec-types.d.ts +39 -0
- package/dist/src/services/openspec/openspec-types.js +1 -0
- package/dist/src/services/openspec/openspec-validate-service.d.ts +27 -0
- package/dist/src/services/openspec/openspec-validate-service.js +77 -0
- package/dist/src/services/perf/perf-baseline-service.d.ts +70 -0
- package/dist/src/services/perf/perf-baseline-service.js +214 -0
- package/dist/src/services/prd/handoff-auto-regen.d.ts +22 -0
- package/dist/src/services/prd/handoff-auto-regen.js +73 -0
- package/dist/src/services/prd/handoff-service.d.ts +54 -0
- package/dist/src/services/prd/handoff-service.js +142 -0
- package/dist/src/services/prd/handoff-types.d.ts +64 -0
- package/dist/src/services/prd/handoff-types.js +22 -0
- package/dist/src/services/prd/prd-blocks-checker.d.ts +51 -0
- package/dist/src/services/prd/prd-blocks-checker.js +130 -0
- package/dist/src/services/prd/project-scan-reader.d.ts +24 -0
- package/dist/src/services/prd/project-scan-reader.js +150 -0
- package/dist/src/services/prd/project-scan-sediment.d.ts +97 -0
- package/dist/src/services/prd/project-scan-sediment.js +445 -0
- package/dist/src/services/prd/project-scan-types.d.ts +66 -0
- package/dist/src/services/prd/project-scan-types.js +20 -0
- package/dist/src/services/preferences/preferences-service.d.ts +38 -0
- package/dist/src/services/preferences/preferences-service.js +198 -0
- package/dist/src/services/preferences/preferences-types.d.ts +148 -0
- package/dist/src/services/preferences/preferences-types.js +53 -0
- package/dist/src/services/profiles/profile-service.d.ts +6 -0
- package/dist/src/services/profiles/profile-service.js +19 -0
- package/dist/src/services/progress/progress-service.d.ts +125 -0
- package/dist/src/services/progress/progress-service.js +192 -0
- package/dist/src/services/providers/minimax-provider-service.d.ts +24 -0
- package/dist/src/services/providers/minimax-provider-service.js +143 -0
- package/dist/src/services/providers/minimax-worker-service.d.ts +21 -0
- package/dist/src/services/providers/minimax-worker-service.js +83 -0
- package/dist/src/services/proxy/proxy-service.d.ts +7 -0
- package/dist/src/services/proxy/proxy-service.js +31 -0
- package/dist/src/services/qa/browser-event-logger.d.ts +40 -0
- package/dist/src/services/qa/browser-event-logger.js +54 -0
- package/dist/src/services/qa/browser-restart-detector.d.ts +74 -0
- package/dist/src/services/qa/browser-restart-detector.js +138 -0
- package/dist/src/services/qa/browser-reuse-hint.d.ts +18 -0
- package/dist/src/services/qa/browser-reuse-hint.js +18 -0
- package/dist/src/services/qa/browser-wrapper-service.d.ts +37 -0
- package/dist/src/services/qa/browser-wrapper-service.js +88 -0
- package/dist/src/services/qa/qa-business-review-state.d.ts +47 -0
- package/dist/src/services/qa/qa-business-review-state.js +96 -0
- package/dist/src/services/rd/ast-gate.d.ts +19 -0
- package/dist/src/services/rd/ast-gate.js +71 -0
- package/dist/src/services/rd/impl.d.ts +9 -0
- package/dist/src/services/rd/impl.js +57 -0
- package/dist/src/services/rd/rd-service.d.ts +129 -0
- package/dist/src/services/rd/rd-service.js +438 -0
- package/dist/src/services/rd/reviewer-dispatch-policy.d.ts +122 -0
- package/dist/src/services/rd/reviewer-dispatch-policy.js +148 -0
- package/dist/src/services/rd/standards-diagnostic.d.ts +76 -0
- package/dist/src/services/rd/standards-diagnostic.js +166 -0
- package/dist/src/services/rd/strategic-stage.d.ts +4 -0
- package/dist/src/services/rd/strategic-stage.js +15 -0
- package/dist/src/services/rd/strategy.d.ts +13 -0
- package/dist/src/services/rd/strategy.js +60 -0
- package/dist/src/services/rd/tactical-stage.d.ts +33 -0
- package/dist/src/services/rd/tactical-stage.js +62 -0
- package/dist/src/services/rd/types.d.ts +252 -0
- package/dist/src/services/rd/types.js +47 -0
- package/dist/src/services/recommendations/capability-availability.d.ts +5 -0
- package/dist/src/services/recommendations/capability-availability.js +40 -0
- package/dist/src/services/recommendations/capability-map-service.d.ts +7 -0
- package/dist/src/services/recommendations/capability-map-service.js +131 -0
- package/dist/src/services/recommendations/capability-seed-items.d.ts +2 -0
- package/dist/src/services/recommendations/capability-seed-items.js +140 -0
- package/dist/src/services/recommendations/capability-seed-mappings.d.ts +2 -0
- package/dist/src/services/recommendations/capability-seed-mappings.js +54 -0
- package/dist/src/services/recommendations/capability-seed-sources.d.ts +2 -0
- package/dist/src/services/recommendations/capability-seed-sources.js +35 -0
- package/dist/src/services/recommendations/recommendation-service.d.ts +8 -0
- package/dist/src/services/recommendations/recommendation-service.js +106 -0
- package/dist/src/services/recommendations/recommendation-types.d.ts +129 -0
- package/dist/src/services/recommendations/recommendation-types.js +1 -0
- package/dist/src/services/recommendations/seed-capability-catalog.d.ts +3 -0
- package/dist/src/services/recommendations/seed-capability-catalog.js +3 -0
- package/dist/src/services/refactor/refactor-service.d.ts +9 -0
- package/dist/src/services/refactor/refactor-service.js +36 -0
- package/dist/src/services/release/release-state.d.ts +70 -0
- package/dist/src/services/release/release-state.js +140 -0
- package/dist/src/services/retrospective/retrospective-index.d.ts +37 -0
- package/dist/src/services/retrospective/retrospective-index.js +110 -0
- package/dist/src/services/retrospective/retrospective-search-service.d.ts +55 -0
- package/dist/src/services/retrospective/retrospective-search-service.js +107 -0
- package/dist/src/services/retrospective/retrospective-show.d.ts +40 -0
- package/dist/src/services/retrospective/retrospective-show.js +109 -0
- package/dist/src/services/reviewer/model-family.d.ts +18 -0
- package/dist/src/services/reviewer/model-family.js +70 -0
- package/dist/src/services/reviewer/providers/anthropic.d.ts +2 -0
- package/dist/src/services/reviewer/providers/anthropic.js +61 -0
- package/dist/src/services/reviewer/providers/ollama.d.ts +26 -0
- package/dist/src/services/reviewer/providers/ollama.js +38 -0
- package/dist/src/services/reviewer/providers/openai.d.ts +2 -0
- package/dist/src/services/reviewer/providers/openai.js +63 -0
- package/dist/src/services/reviewer/reviewer-config.d.ts +34 -0
- package/dist/src/services/reviewer/reviewer-config.js +100 -0
- package/dist/src/services/reviewer/reviewer-service.d.ts +56 -0
- package/dist/src/services/reviewer/reviewer-service.js +263 -0
- package/dist/src/services/reviewer/selection-strategies.d.ts +27 -0
- package/dist/src/services/reviewer/selection-strategies.js +53 -0
- package/dist/src/services/role/role-registry.d.ts +38 -0
- package/dist/src/services/role/role-registry.js +83 -0
- package/dist/src/services/sc/index.d.ts +1 -0
- package/dist/src/services/sc/index.js +1 -0
- package/dist/src/services/sc/sc-service.d.ts +131 -0
- package/dist/src/services/sc/sc-service.js +552 -0
- package/dist/src/services/scan/acceptance-coverage-service.d.ts +42 -0
- package/dist/src/services/scan/acceptance-coverage-service.js +140 -0
- package/dist/src/services/scan/api-surface-service.d.ts +69 -0
- package/dist/src/services/scan/api-surface-service.js +239 -0
- package/dist/src/services/scan/archetype-service.d.ts +5 -0
- package/dist/src/services/scan/archetype-service.js +242 -0
- package/dist/src/services/scan/diff-scope-service.d.ts +40 -0
- package/dist/src/services/scan/diff-scope-service.js +198 -0
- package/dist/src/services/scan/existing-system-service.d.ts +7 -0
- package/dist/src/services/scan/existing-system-service.js +300 -0
- package/dist/src/services/scan/file-size-scan.d.ts +23 -0
- package/dist/src/services/scan/file-size-scan.js +68 -0
- package/dist/src/services/scan/karpathy-service.d.ts +60 -0
- package/dist/src/services/scan/karpathy-service.js +228 -0
- package/dist/src/services/scan/libraries-service.d.ts +24 -0
- package/dist/src/services/scan/libraries-service.js +419 -0
- package/dist/src/services/scan/libraries-types.d.ts +59 -0
- package/dist/src/services/scan/libraries-types.js +9 -0
- package/dist/src/services/scan/orphan-service.d.ts +76 -0
- package/dist/src/services/scan/orphan-service.js +538 -0
- package/dist/src/services/scan/scan-types.d.ts +59 -0
- package/dist/src/services/scan/scan-types.js +1 -0
- package/dist/src/services/scan/type-sanity-service.d.ts +23 -0
- package/dist/src/services/scan/type-sanity-service.js +116 -0
- package/dist/src/services/security/safe-settings-path.d.ts +12 -0
- package/dist/src/services/security/safe-settings-path.js +104 -0
- package/dist/src/services/session/binding-status-service.d.ts +56 -0
- package/dist/src/services/session/binding-status-service.js +106 -0
- package/dist/src/services/session/binding-store.d.ts +161 -0
- package/dist/src/services/session/binding-store.js +509 -0
- package/dist/src/services/session/caller-binding-service.d.ts +70 -0
- package/dist/src/services/session/caller-binding-service.js +148 -0
- package/dist/src/services/session/caller-id-types.d.ts +77 -0
- package/dist/src/services/session/caller-id-types.js +46 -0
- package/dist/src/services/session/getSessionDir.d.ts +1 -0
- package/dist/src/services/session/getSessionDir.js +27 -0
- package/dist/src/services/session/index.d.ts +6 -0
- package/dist/src/services/session/index.js +7 -0
- package/dist/src/services/session/platform-fallbacks.d.ts +31 -0
- package/dist/src/services/session/platform-fallbacks.js +35 -0
- package/dist/src/services/session/resolve-caller-id.d.ts +57 -0
- package/dist/src/services/session/resolve-caller-id.js +88 -0
- package/dist/src/services/session/session-binding-bridge.d.ts +76 -0
- package/dist/src/services/session/session-binding-bridge.js +247 -0
- package/dist/src/services/session/session-checkpoint-service.d.ts +57 -0
- package/dist/src/services/session/session-checkpoint-service.js +143 -0
- package/dist/src/services/session/session-manager.d.ts +168 -0
- package/dist/src/services/session/session-manager.js +502 -0
- package/dist/src/services/session/session-resume-service.d.ts +25 -0
- package/dist/src/services/session/session-resume-service.js +101 -0
- package/dist/src/services/signal/cancel-handler.d.ts +14 -0
- package/dist/src/services/signal/cancel-handler.js +76 -0
- package/dist/src/services/skill/resume-detector.d.ts +54 -0
- package/dist/src/services/skill/resume-detector.js +334 -0
- package/dist/src/services/skill/skill-scheduler.d.ts +40 -0
- package/dist/src/services/skill/skill-scheduler.js +53 -0
- package/dist/src/services/skills/hooks-settings-service.d.ts +137 -0
- package/dist/src/services/skills/hooks-settings-service.js +396 -0
- package/dist/src/services/skills/skill-conformance-service.d.ts +40 -0
- package/dist/src/services/skills/skill-conformance-service.js +136 -0
- package/dist/src/services/skills/skill-presence-service.d.ts +158 -0
- package/dist/src/services/skills/skill-presence-service.js +474 -0
- package/dist/src/services/skills/skill-registry.d.ts +17 -0
- package/dist/src/services/skills/skill-registry.js +40 -0
- package/dist/src/services/skills/skill-runbook-service.d.ts +11 -0
- package/dist/src/services/skills/skill-runbook-service.js +128 -0
- package/dist/src/services/skills/skill-statusline-renderer.d.ts +6 -0
- package/dist/src/services/skills/skill-statusline-renderer.js +55 -0
- package/dist/src/services/skills/skill-statusline-service.d.ts +24 -0
- package/dist/src/services/skills/skill-statusline-service.js +110 -0
- package/dist/src/services/skills/statusline-settings-service.d.ts +59 -0
- package/dist/src/services/skills/statusline-settings-service.js +141 -0
- package/dist/src/services/skills/sync-service.d.ts +86 -0
- package/dist/src/services/skills/sync-service.js +271 -0
- package/dist/src/services/slice/calibration-store.d.ts +39 -0
- package/dist/src/services/slice/calibration-store.js +68 -0
- package/dist/src/services/slice/cross-pass-edge-merger.d.ts +53 -0
- package/dist/src/services/slice/cross-pass-edge-merger.js +246 -0
- package/dist/src/services/slice/granularity-decider.d.ts +37 -0
- package/dist/src/services/slice/granularity-decider.js +40 -0
- package/dist/src/services/slice/llm-arbitrator.d.ts +35 -0
- package/dist/src/services/slice/llm-arbitrator.js +63 -0
- package/dist/src/services/slice/multi-pass-orchestrator.d.ts +67 -0
- package/dist/src/services/slice/multi-pass-orchestrator.js +225 -0
- package/dist/src/services/slice/schema-router.d.ts +44 -0
- package/dist/src/services/slice/schema-router.js +61 -0
- package/dist/src/services/slice/slice-archive-service.d.ts +20 -0
- package/dist/src/services/slice/slice-archive-service.js +111 -0
- package/dist/src/services/slice/slice-benchmark-service.d.ts +19 -0
- package/dist/src/services/slice/slice-benchmark-service.js +60 -0
- package/dist/src/services/slice/slice-check-service.d.ts +2 -0
- package/dist/src/services/slice/slice-check-service.js +459 -0
- package/dist/src/services/slice/slice-check-types.d.ts +104 -0
- package/dist/src/services/slice/slice-check-types.js +28 -0
- package/dist/src/services/slice/slice-decompose-runners.d.ts +23 -0
- package/dist/src/services/slice/slice-decompose-runners.js +174 -0
- package/dist/src/services/slice/slice-decompose-service.d.ts +24 -0
- package/dist/src/services/slice/slice-decompose-service.js +532 -0
- package/dist/src/services/slice/slice-decompose-types.d.ts +263 -0
- package/dist/src/services/slice/slice-decompose-types.js +30 -0
- package/dist/src/services/slice/slice-integration.d.ts +43 -0
- package/dist/src/services/slice/slice-integration.js +106 -0
- package/dist/src/services/slice/slice-pick-service.d.ts +32 -0
- package/dist/src/services/slice/slice-pick-service.js +75 -0
- package/dist/src/services/slice/slice-review-state.d.ts +70 -0
- package/dist/src/services/slice/slice-review-state.js +109 -0
- package/dist/src/services/slice/slice-topology-types.d.ts +115 -0
- package/dist/src/services/slice/slice-topology-types.js +20 -0
- package/dist/src/services/smoke/smoke-paths-state.d.ts +73 -0
- package/dist/src/services/smoke/smoke-paths-state.js +117 -0
- package/dist/src/services/solo/auto-compact-orchestrator.d.ts +98 -0
- package/dist/src/services/solo/auto-compact-orchestrator.js +343 -0
- package/dist/src/services/solo/batch-heartbeat-poller.d.ts +51 -0
- package/dist/src/services/solo/batch-heartbeat-poller.js +88 -0
- package/dist/src/services/solo/dag-orchestrator.d.ts +128 -0
- package/dist/src/services/solo/dag-orchestrator.js +304 -0
- package/dist/src/services/solo/mode-gate.d.ts +163 -0
- package/dist/src/services/solo/mode-gate.js +212 -0
- package/dist/src/services/solo/post-compact-detector.d.ts +61 -0
- package/dist/src/services/solo/post-compact-detector.js +240 -0
- package/dist/src/services/solo/status-line-renderer.d.ts +34 -0
- package/dist/src/services/solo/status-line-renderer.js +55 -0
- package/dist/src/services/solo/user-touchpoint-classifier.d.ts +44 -0
- package/dist/src/services/solo/user-touchpoint-classifier.js +145 -0
- package/dist/src/services/sop/gate-enforce-service.d.ts +33 -0
- package/dist/src/services/sop/gate-enforce-service.js +168 -0
- package/dist/src/services/sop/sop-advance-service.d.ts +74 -0
- package/dist/src/services/sop/sop-advance-service.js +115 -0
- package/dist/src/services/sop/sop-check-service.d.ts +45 -0
- package/dist/src/services/sop/sop-check-service.js +181 -0
- package/dist/src/services/sop/sop-paths.d.ts +62 -0
- package/dist/src/services/sop/sop-paths.js +92 -0
- package/dist/src/services/sop/sop-registry-service.d.ts +46 -0
- package/dist/src/services/sop/sop-registry-service.js +89 -0
- package/dist/src/services/sop/sop-service.d.ts +55 -0
- package/dist/src/services/sop/sop-service.js +222 -0
- package/dist/src/services/sop/sop-types.d.ts +95 -0
- package/dist/src/services/sop/sop-types.js +11 -0
- package/dist/src/services/standards/ide-aware-standards-service.d.ts +94 -0
- package/dist/src/services/standards/ide-aware-standards-service.js +89 -0
- package/dist/src/services/standards/migrate-claude-rules-service.d.ts +19 -0
- package/dist/src/services/standards/migrate-claude-rules-service.js +193 -0
- package/dist/src/services/standards/migrate-service.d.ts +63 -0
- package/dist/src/services/standards/migrate-service.js +193 -0
- package/dist/src/services/standards/missing-standards-detector.d.ts +79 -0
- package/dist/src/services/standards/missing-standards-detector.js +132 -0
- package/dist/src/services/standards/project-context.d.ts +24 -0
- package/dist/src/services/standards/project-context.js +314 -0
- package/dist/src/services/standards/project-standards-service.d.ts +114 -0
- package/dist/src/services/standards/project-standards-service.js +574 -0
- package/dist/src/services/tech/tech-service.d.ts +69 -0
- package/dist/src/services/tech/tech-service.js +299 -0
- package/dist/src/services/test-cache/test-cache-service.d.ts +70 -0
- package/dist/src/services/test-cache/test-cache-service.js +175 -0
- package/dist/src/services/understand/understand-scan-service.d.ts +28 -0
- package/dist/src/services/understand/understand-scan-service.js +170 -0
- package/dist/src/services/understand/understand-types.d.ts +50 -0
- package/dist/src/services/understand/understand-types.js +1 -0
- package/dist/src/services/upgrade/1x-detector-service.d.ts +7 -0
- package/dist/src/services/upgrade/1x-detector-service.js +94 -0
- package/dist/src/services/upgrade/gitignore-migrate-service.d.ts +56 -0
- package/dist/src/services/upgrade/gitignore-migrate-service.js +170 -0
- package/dist/src/services/upgrade/upgrade-service.d.ts +47 -0
- package/dist/src/services/upgrade/upgrade-service.js +381 -0
- package/dist/src/services/verdict/envelopes.d.ts +93 -0
- package/dist/src/services/verdict/envelopes.js +349 -0
- package/dist/src/services/verdict/verdict-aggregator.d.ts +94 -0
- package/dist/src/services/verdict/verdict-aggregator.js +112 -0
- package/dist/src/services/workflow/artifact-paths.d.ts +59 -0
- package/dist/src/services/workflow/artifact-paths.js +166 -0
- package/dist/src/services/workflow/autonomous-resume-writer.d.ts +16 -0
- package/dist/src/services/workflow/autonomous-resume-writer.js +170 -0
- package/dist/src/services/workflow/pipeline-verify-service.d.ts +90 -0
- package/dist/src/services/workflow/pipeline-verify-service.js +449 -0
- package/dist/src/services/workflow/plan-reader.d.ts +29 -0
- package/dist/src/services/workflow/plan-reader.js +174 -0
- package/dist/src/services/workflow/plan-refresher.d.ts +32 -0
- package/dist/src/services/workflow/plan-refresher.js +353 -0
- package/dist/src/services/workflow/plan-trigger-detector.d.ts +55 -0
- package/dist/src/services/workflow/plan-trigger-detector.js +142 -0
- package/dist/src/services/workflow/workflow-autonomous-resume-helpers.d.ts +19 -0
- package/dist/src/services/workflow/workflow-autonomous-resume-helpers.js +300 -0
- package/dist/src/services/workflow/workflow-autonomous-service.d.ts +100 -0
- package/dist/src/services/workflow/workflow-autonomous-service.js +306 -0
- package/dist/src/services/workflow/workflow-loader.d.ts +63 -0
- package/dist/src/services/workflow/workflow-loader.js +168 -0
- package/dist/src/services/workflow/workflow-router-service.d.ts +85 -0
- package/dist/src/services/workflow/workflow-router-service.js +227 -0
- package/dist/src/services/workflow/workflow-skip-service.d.ts +106 -0
- package/dist/src/services/workflow/workflow-skip-service.js +209 -0
- package/dist/src/services/workflow/workflow-spec.d.ts +116 -0
- package/dist/src/services/workflow/workflow-spec.js +431 -0
- package/dist/src/services/workflow/workflow-state-store.d.ts +27 -0
- package/dist/src/services/workflow/workflow-state-store.js +95 -0
- package/dist/src/services/workspace/claude-settings-template.d.ts +96 -0
- package/dist/src/services/workspace/claude-settings-template.js +215 -0
- package/dist/src/services/workspace/migrate-1-4-1-service.d.ts +44 -0
- package/dist/src/services/workspace/migrate-1-4-1-service.js +195 -0
- package/dist/src/services/workspace/migrate-service.d.ts +2 -0
- package/dist/src/services/workspace/migrate-service.js +613 -0
- package/dist/src/services/workspace/migrate-types.d.ts +127 -0
- package/dist/src/services/workspace/migrate-types.js +21 -0
- package/dist/src/services/workspace/reconcile-service.d.ts +188 -0
- package/dist/src/services/workspace/reconcile-service.js +683 -0
- package/dist/src/services/workspace/reconcile-types.d.ts +130 -0
- package/dist/src/services/workspace/reconcile-types.js +13 -0
- package/dist/src/services/workspace/sid-naming-guard.d.ts +17 -0
- package/dist/src/services/workspace/sid-naming-guard.js +34 -0
- package/dist/src/services/workspace/workspace-claude-settings-materializer.d.ts +45 -0
- package/dist/src/services/workspace/workspace-claude-settings-materializer.js +194 -0
- package/dist/src/services/workspace/workspace-clean-service.d.ts +28 -0
- package/dist/src/services/workspace/workspace-clean-service.js +46 -0
- package/dist/src/services/workspace/workspace-service.d.ts +177 -0
- package/dist/src/services/workspace/workspace-service.js +432 -0
- package/dist/src/services/workspace/workspace-state-service.d.ts +7 -0
- package/dist/src/services/workspace/workspace-state-service.js +43 -0
- package/dist/src/shared/format-md-compact.d.ts +32 -0
- package/dist/src/shared/format-md-compact.js +297 -0
- package/dist/src/shared/frontmatter.d.ts +6 -0
- package/dist/src/shared/frontmatter.js +165 -0
- package/dist/src/shared/fs-utils.d.ts +4 -0
- package/dist/src/shared/fs-utils.js +16 -0
- package/dist/src/shared/fs.d.ts +4 -0
- package/dist/src/shared/fs.js +26 -0
- package/dist/src/shared/incrementing-number.d.ts +23 -0
- package/dist/src/shared/incrementing-number.js +68 -0
- package/dist/src/shared/json-schema-mini.d.ts +10 -0
- package/dist/src/shared/json-schema-mini.js +113 -0
- package/dist/src/shared/path-safety.d.ts +21 -0
- package/dist/src/shared/path-safety.js +54 -0
- package/dist/src/shared/path-utils.d.ts +13 -0
- package/dist/src/shared/path-utils.js +56 -0
- package/dist/src/shared/paths.d.ts +6 -0
- package/dist/src/shared/paths.js +50 -0
- package/dist/src/shared/planner-response.d.ts +21 -0
- package/dist/src/shared/planner-response.js +26 -0
- package/dist/src/shared/platform.d.ts +6 -0
- package/dist/src/shared/platform.js +11 -0
- package/dist/src/shared/process.d.ts +5 -0
- package/dist/src/shared/process.js +12 -0
- package/dist/src/shared/result.d.ts +22 -0
- package/dist/src/shared/result.js +46 -0
- package/dist/src/shared/stale-policy.d.ts +67 -0
- package/dist/src/shared/stale-policy.js +85 -0
- package/dist/src/shared/version.d.ts +1 -0
- package/dist/src/shared/version.js +1 -0
- package/output-styles/peaks-skill-swarm.md +132 -0
- package/package.json +101 -0
- package/schemas/approval-record.schema.json +14 -0
- package/schemas/artifact-manifest.schema.json +16 -0
- package/schemas/artifact-retention-report.schema.json +38 -0
- package/schemas/artifact-workspace.schema.json +22 -0
- package/schemas/capability-availability.schema.json +36 -0
- package/schemas/capability-item.schema.json +37 -0
- package/schemas/capability-source.schema.json +30 -0
- package/schemas/change-impact.schema.json +15 -0
- package/schemas/context-capsule.schema.json +16 -0
- package/schemas/context.schema.json +360 -0
- package/schemas/decomposition-v1.json +194 -0
- package/schemas/decomposition-v2.json +193 -0
- package/schemas/doctor-report.schema.json +34 -0
- package/schemas/library-breaking-changes.data.json +141 -0
- package/schemas/library-breaking-changes.meta.json +6 -0
- package/schemas/library-breaking-changes.schema.json +50 -0
- package/schemas/mcp-apply-result.schema.json +46 -0
- package/schemas/mcp-install-plan.schema.json +71 -0
- package/schemas/mcp-install-spec.schema.json +29 -0
- package/schemas/mcp-server.schema.json +29 -0
- package/schemas/openspec-change-summary.schema.json +68 -0
- package/schemas/openspec-render-request.schema.json +61 -0
- package/schemas/openspec-validation-result.schema.json +36 -0
- package/schemas/recommendation-plan.schema.json +37 -0
- package/schemas/refactor-slice-spec.schema.json +19 -0
- package/schemas/replay-fixture.schema.json +158 -0
- package/schemas/reviewer-envelope.schema.json +79 -0
- package/schemas/sop-manifest.schema.json +52 -0
- package/scripts/clean-dist.mjs +8 -0
- package/scripts/install-skills.mjs +1202 -0
- package/scripts/sync-version.mjs +12 -0
- package/scripts/watch.mjs +389 -0
- package/skills/peaks-audit/SKILL.md +151 -0
- package/skills/peaks-audit/references/6-dimensions.md +141 -0
- package/skills/peaks-doctor/SKILL.md +59 -0
- package/skills/peaks-doctor/references/doctor-check-catalog.md +31 -0
- package/skills/peaks-doctor/references/from-doctor-flow.md +64 -0
- package/skills/peaks-doctor/test_prompts.json +17 -0
- package/skills/peaks-final-review/SKILL.md +157 -0
- package/skills/peaks-final-review/references/4-dimensions.md +117 -0
- package/skills/peaks-ide/SKILL.md +161 -0
- package/skills/peaks-ide/references/audit-log-helper.md +52 -0
- package/skills/peaks-perf-audit/SKILL.md +166 -0
- package/skills/peaks-perf-audit/references/audit-protocol.md +173 -0
- package/skills/peaks-prd/SKILL.md +319 -0
- package/skills/peaks-prd/references/artifact-contracts.md +7 -0
- package/skills/peaks-prd/references/artifact-per-request.md +78 -0
- package/skills/peaks-prd/references/command-migration.md +3 -0
- package/skills/peaks-prd/references/prd-for-multi-pass.md +49 -0
- package/skills/peaks-prd/references/workflow.md +43 -0
- package/skills/peaks-qa/SKILL.md +240 -0
- package/skills/peaks-qa/references/artifact-contracts.md +7 -0
- package/skills/peaks-qa/references/artifact-per-request.md +25 -0
- package/skills/peaks-qa/references/browser-validation-contracts.md +51 -0
- package/skills/peaks-qa/references/codegraph-regression-focus.md +5 -0
- package/skills/peaks-qa/references/command-migration.md +3 -0
- package/skills/peaks-qa/references/external-capability-guidance.md +9 -0
- package/skills/peaks-qa/references/openspec-validation-gate.md +55 -0
- package/skills/peaks-qa/references/qa-compact-handoff.md +3 -0
- package/skills/peaks-qa/references/qa-context-governance.md +24 -0
- package/skills/peaks-qa/references/qa-fanout-contract.md +158 -0
- package/skills/peaks-qa/references/qa-gstack-integration.md +7 -0
- package/skills/peaks-qa/references/qa-local-artifacts.md +3 -0
- package/skills/peaks-qa/references/qa-matt-pocock-integration.md +9 -0
- package/skills/peaks-qa/references/qa-perf-test-plan.md +67 -0
- package/skills/peaks-qa/references/qa-refactor-role.md +3 -0
- package/skills/peaks-qa/references/qa-runbook.md +72 -0
- package/skills/peaks-qa/references/qa-security-test-plan.md +73 -0
- package/skills/peaks-qa/references/qa-skill-presence.md +22 -0
- package/skills/peaks-qa/references/qa-standards-preflight.md +8 -0
- package/skills/peaks-qa/references/qa-sub-agent-dispatch.md +46 -0
- package/skills/peaks-qa/references/qa-transition-gates.md +86 -0
- package/skills/peaks-qa/references/reading-handoff-frontmatter.md +30 -0
- package/skills/peaks-qa/references/regression-gates.md +24 -0
- package/skills/peaks-qa/references/requirement-boundary-recheck.md +9 -0
- package/skills/peaks-qa/references/test-case-generation.md +27 -0
- package/skills/peaks-qa/references/test-report-output.md +14 -0
- package/skills/peaks-rd/SKILL.md +279 -0
- package/skills/peaks-rd/references/artifact-and-standards-output.md +9 -0
- package/skills/peaks-rd/references/artifact-contracts.md +7 -0
- package/skills/peaks-rd/references/artifact-per-request.md +112 -0
- package/skills/peaks-rd/references/browser-action-wrapper.md +39 -0
- package/skills/peaks-rd/references/browser-self-test-contracts.md +29 -0
- package/skills/peaks-rd/references/code-reviewer-4dim-hint.md +72 -0
- package/skills/peaks-rd/references/codegraph-project-analysis.md +5 -0
- package/skills/peaks-rd/references/command-migration.md +3 -0
- package/skills/peaks-rd/references/compact-handoff.md +3 -0
- package/skills/peaks-rd/references/external-references.md +11 -0
- package/skills/peaks-rd/references/frontend-project-generation.md +11 -0
- package/skills/peaks-rd/references/karpathy-reviewer-prompt.md +2 -0
- package/skills/peaks-rd/references/library-version-awareness.md +30 -0
- package/skills/peaks-rd/references/mandatory-perf-baseline.md +42 -0
- package/skills/peaks-rd/references/matt-pocock-integration.md +11 -0
- package/skills/peaks-rd/references/mock-data-placement.md +40 -0
- package/skills/peaks-rd/references/ocr-integration.md +229 -0
- package/skills/peaks-rd/references/openspec-cli.md +62 -0
- package/skills/peaks-rd/references/parallel-review-fanout.md +90 -0
- package/skills/peaks-rd/references/rd-context-governance.md +36 -0
- package/skills/peaks-rd/references/rd-fanout-contracts.md +216 -0
- package/skills/peaks-rd/references/rd-gstack-integration.md +16 -0
- package/skills/peaks-rd/references/rd-runbook.md +190 -0
- package/skills/peaks-rd/references/rd-standards-preflight.md +8 -0
- package/skills/peaks-rd/references/rd-sub-agent-dispatch.md +111 -0
- package/skills/peaks-rd/references/rd-transition-gates.md +148 -0
- package/skills/peaks-rd/references/reading-v2-slice-results.md +54 -0
- package/skills/peaks-rd/references/refactor-workflow.md +39 -0
- package/skills/peaks-rd/references/skill-presence-and-title.md +22 -0
- package/skills/peaks-rd/references/v2-12-fanout-collapse.md +64 -0
- package/skills/peaks-rd/references/writing-handoff-frontmatter.md +68 -0
- package/skills/peaks-reviewer/SKILL.md +76 -0
- package/skills/peaks-reviewer/references/reviewer-prompt.md +50 -0
- package/skills/peaks-reviewer/references/reviewer-schema.md +49 -0
- package/skills/peaks-sc/SKILL.md +166 -0
- package/skills/peaks-sc/references/artifact-contracts.md +3 -0
- package/skills/peaks-sc/references/artifact-retention.md +14 -0
- package/skills/peaks-sc/references/command-migration.md +3 -0
- package/skills/peaks-sc/references/openspec-commit-boundaries.md +33 -0
- package/skills/peaks-security-audit/SKILL.md +167 -0
- package/skills/peaks-security-audit/references/audit-protocol.md +175 -0
- package/skills/peaks-slice-decompose/SKILL.md +111 -0
- package/skills/peaks-slice-decompose/references/cross-pass-edge-interpretation.md +158 -0
- package/skills/peaks-slice-decompose/references/granularity-decision.md +129 -0
- package/skills/peaks-slice-decompose/references/v2-schema.md +156 -0
- package/skills/peaks-solo/SKILL.md +316 -0
- package/skills/peaks-solo/references/a2a-artifact-mapping.md +115 -0
- package/skills/peaks-solo/references/anchoring-and-session-info.md +34 -0
- package/skills/peaks-solo/references/artifact-contracts.md +65 -0
- package/skills/peaks-solo/references/boundaries.md +21 -0
- package/skills/peaks-solo/references/browser-workflow.md +127 -0
- package/skills/peaks-solo/references/checkpoint-resume.md +70 -0
- package/skills/peaks-solo/references/codegraph-orchestration.md +5 -0
- package/skills/peaks-solo/references/command-migration.md +3 -0
- package/skills/peaks-solo/references/completion-handoff.md +18 -0
- package/skills/peaks-solo/references/context-governance.md +204 -0
- package/skills/peaks-solo/references/cross-date-session-check.md +67 -0
- package/skills/peaks-solo/references/dag-orchestrator.md +56 -0
- package/skills/peaks-solo/references/envelope-contract.md +130 -0
- package/skills/peaks-solo/references/existing-system-extraction.md +78 -0
- package/skills/peaks-solo/references/external-references.md +17 -0
- package/skills/peaks-solo/references/external-skill-invocation.md +72 -0
- package/skills/peaks-solo/references/fanout-mandatory.md +109 -0
- package/skills/peaks-solo/references/fast-mode.md +23 -0
- package/skills/peaks-solo/references/frontend-only-mode.md +87 -0
- package/skills/peaks-solo/references/gstack-integration.md +7 -0
- package/skills/peaks-solo/references/headroom-integration.md +107 -0
- package/skills/peaks-solo/references/local-artifact-workspace.md +79 -0
- package/skills/peaks-solo/references/micro-cycle.md +316 -0
- package/skills/peaks-solo/references/mode-selection-with-stale-presence.md +124 -0
- package/skills/peaks-solo/references/mode-selection.md +21 -0
- package/skills/peaks-solo/references/openspec-workflow.md +81 -0
- package/skills/peaks-solo/references/periodic-checkpoint.md +71 -0
- package/skills/peaks-solo/references/playwright-mcp-multi-terminal.md +114 -0
- package/skills/peaks-solo/references/project-memory-loading.md +17 -0
- package/skills/peaks-solo/references/project-scan-checklist.md +136 -0
- package/skills/peaks-solo/references/quality-gate-cheatsheet.md +13 -0
- package/skills/peaks-solo/references/refactor-mode.md +24 -0
- package/skills/peaks-solo/references/resume-detection.md +63 -0
- package/skills/peaks-solo/references/runbook.md +188 -0
- package/skills/peaks-solo/references/skill-presence-and-title.md +31 -0
- package/skills/peaks-solo/references/standards-preflight.md +23 -0
- package/skills/peaks-solo/references/step-0-55-1x-detection.md +82 -0
- package/skills/peaks-solo/references/sub-agent-dispatch.md +334 -0
- package/skills/peaks-solo/references/swarm-dispatch-contract.md +230 -0
- package/skills/peaks-solo/references/workflow-gates-and-types.md +186 -0
- package/skills/peaks-solo/references/workflow.md +38 -0
- package/skills/peaks-solo-resume/SKILL.md +81 -0
- package/skills/peaks-solo-status/SKILL.md +120 -0
- package/skills/peaks-solo-test/SKILL.md +84 -0
- package/skills/peaks-sop/SKILL.md +209 -0
- package/skills/peaks-sop/references/sop-authoring.md +161 -0
- package/skills/peaks-txt/SKILL.md +303 -0
- package/skills/peaks-txt/references/artifact-contracts.md +7 -0
- package/skills/peaks-txt/references/command-migration.md +3 -0
- package/skills/peaks-txt/references/context-capsule.md +21 -0
- package/skills/peaks-ui/SKILL.md +369 -0
- package/skills/peaks-ui/references/artifact-contracts.md +3 -0
- package/skills/peaks-ui/references/artifact-per-request.md +71 -0
- package/skills/peaks-ui/references/command-migration.md +3 -0
- package/skills/peaks-ui/references/workflow.md +27 -0
|
@@ -0,0 +1,1202 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { closeSync, constants, existsSync, fchmodSync, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, readlinkSync, realpathSync, readdirSync, renameSync, symlinkSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
5
|
+
import { homedir } from 'node:os';
|
|
6
|
+
import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
|
+
|
|
9
|
+
function getPathStats(path) {
|
|
10
|
+
try {
|
|
11
|
+
return lstatSync(path);
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function isBrokenSymlink(stats, targetPath) {
|
|
18
|
+
return stats.isSymbolicLink() && !existsSync(targetPath);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function validateManagedMarkerPath(markerPath) {
|
|
22
|
+
const markerStats = getPathStats(markerPath);
|
|
23
|
+
if (!markerStats) return;
|
|
24
|
+
if (markerStats.isSymbolicLink()) {
|
|
25
|
+
throw new Error('Peaks managed marker path must not be a symlink');
|
|
26
|
+
}
|
|
27
|
+
if (!markerStats.isFile()) {
|
|
28
|
+
throw new Error('Peaks managed marker path must be a file');
|
|
29
|
+
}
|
|
30
|
+
if (markerStats.nlink !== 1) {
|
|
31
|
+
throw new Error('Peaks managed marker path must not be hardlinked');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function validateOpenFile(fd, path, errorMessage) {
|
|
36
|
+
const fdStats = fstatSync(fd);
|
|
37
|
+
const pathStats = lstatSync(path);
|
|
38
|
+
if (!fdStats.isFile() || !pathStats.isFile() || fdStats.dev !== pathStats.dev || fdStats.ino !== pathStats.ino) {
|
|
39
|
+
throw new Error(errorMessage);
|
|
40
|
+
}
|
|
41
|
+
if (fdStats.nlink !== 1 || pathStats.nlink !== 1) {
|
|
42
|
+
throw new Error(`${errorMessage}: hardlinked file`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function createFileIdentity(path) {
|
|
47
|
+
const stats = lstatSync(path);
|
|
48
|
+
if (!stats.isFile() || stats.isSymbolicLink() || stats.nlink !== 1) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return { dev: stats.dev, ino: stats.ino };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function isSameFileIdentity(path, identity) {
|
|
55
|
+
if (identity === null) return false;
|
|
56
|
+
const stats = getPathStats(path);
|
|
57
|
+
return Boolean(stats?.isFile() && !stats.isSymbolicLink() && stats.nlink === 1 && stats.dev === identity.dev && stats.ino === identity.ino);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function getSafeReadOpenFlags() {
|
|
61
|
+
return typeof constants.O_NOFOLLOW === 'number' ? constants.O_RDONLY | constants.O_NOFOLLOW : constants.O_RDONLY;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function readFileSafely(path, errorMessage) {
|
|
65
|
+
const fd = openSync(path, getSafeReadOpenFlags());
|
|
66
|
+
try {
|
|
67
|
+
validateOpenFile(fd, path, errorMessage);
|
|
68
|
+
return readFileSync(fd, 'utf8');
|
|
69
|
+
} finally {
|
|
70
|
+
closeSync(fd);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function getManagedTarget(targetPath) {
|
|
75
|
+
const markerPath = `${targetPath}.peaks-managed`;
|
|
76
|
+
validateManagedMarkerPath(markerPath);
|
|
77
|
+
if (!existsSync(markerPath)) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return readFileSafely(markerPath, 'Peaks managed marker path changed during read').trim();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function markManagedPeaksLink(targetPath, sourcePath) {
|
|
84
|
+
const markerPath = `${targetPath}.peaks-managed`;
|
|
85
|
+
validateManagedMarkerPath(markerPath);
|
|
86
|
+
writeFileAtomically(markerPath, `${sourcePath}\n`, 'Peaks managed marker path changed during write', () => validateManagedMarkerPath(markerPath));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function readPackageSourceFile(path) {
|
|
90
|
+
const stats = lstatSync(path);
|
|
91
|
+
if (!stats.isFile() || stats.isSymbolicLink()) {
|
|
92
|
+
throw new Error('Peaks package source path must be a file');
|
|
93
|
+
}
|
|
94
|
+
return readFileSync(path, 'utf8');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function hashContent(content) {
|
|
98
|
+
return createHash('sha256').update(content).digest('hex');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function hashFileContent(path) {
|
|
102
|
+
return hashContent(readFileSafely(path, 'Peaks managed file path changed during read'));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function createManagedOutputStyleMarker(sourcePath, outputStyleName) {
|
|
106
|
+
const content = readPackageSourceFile(sourcePath);
|
|
107
|
+
return `${JSON.stringify({ version: 1, kind: 'output-style', outputStyleName, sourcePath, contentSha256: hashContent(content) })}\n`;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function parseManagedOutputStyleMarker(managedTarget) {
|
|
111
|
+
if (managedTarget === null) return null;
|
|
112
|
+
try {
|
|
113
|
+
const marker = JSON.parse(managedTarget);
|
|
114
|
+
if (marker?.version !== 1 || marker?.kind !== 'output-style' || typeof marker.outputStyleName !== 'string' || typeof marker.sourcePath !== 'string' || typeof marker.contentSha256 !== 'string') {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
return marker;
|
|
118
|
+
} catch {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function isTrustedOutputStyleSource(marker, sourcePath, outputStyleName) {
|
|
124
|
+
return marker.outputStyleName === outputStyleName && resolve(marker.sourcePath) === resolve(sourcePath) && basename(resolve(marker.sourcePath)) === outputStyleName;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function getManagedPeaksOutputStyleIdentity(managedTarget, targetPath, sourcePath, outputStyleName) {
|
|
128
|
+
const marker = parseManagedOutputStyleMarker(managedTarget);
|
|
129
|
+
const sourceHash = hashContent(readPackageSourceFile(sourcePath));
|
|
130
|
+
if (marker === null || !isTrustedOutputStyleSource(marker, sourcePath, outputStyleName) || !existsSync(targetPath) || hashFileContent(targetPath) !== sourceHash || marker.contentSha256 !== sourceHash) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
return createFileIdentity(targetPath);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function validateInstallRoot(targetRoot, label) {
|
|
137
|
+
const rootStats = lstatSync(targetRoot);
|
|
138
|
+
if (rootStats.isSymbolicLink()) {
|
|
139
|
+
throw new Error(`${label} install root must not be a symlink`);
|
|
140
|
+
}
|
|
141
|
+
if (!rootStats.isDirectory()) {
|
|
142
|
+
throw new Error(`${label} install root must be a directory`);
|
|
143
|
+
}
|
|
144
|
+
return rootStats;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function createInstallRootValidator(targetRoot, label) {
|
|
148
|
+
const expectedStats = validateInstallRoot(targetRoot, label);
|
|
149
|
+
return () => {
|
|
150
|
+
const rootStats = validateInstallRoot(targetRoot, label);
|
|
151
|
+
if (rootStats.dev !== expectedStats.dev || rootStats.ino !== expectedStats.ino) {
|
|
152
|
+
throw new Error(`${label} install root changed during write`);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function createInstallResult() {
|
|
158
|
+
return { installed: [], skipped: [] };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function resolvePackageRoot(options = {}) {
|
|
162
|
+
return resolve(options.packageRoot ?? join(dirname(fileURLToPath(import.meta.url)), '..'));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function readPackageVersion(packageRoot = resolvePackageRoot()) {
|
|
166
|
+
const packageJson = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8'));
|
|
167
|
+
if (typeof packageJson.version !== 'string' || packageJson.version.length === 0) {
|
|
168
|
+
throw new Error('package.json version must be a non-empty string');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return packageJson.version;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function createConfigDefaults(packageRoot) {
|
|
175
|
+
return {
|
|
176
|
+
version: readPackageVersion(packageRoot),
|
|
177
|
+
currentWorkspace: null,
|
|
178
|
+
workspaces: [],
|
|
179
|
+
language: 'en',
|
|
180
|
+
model: 'sonnet',
|
|
181
|
+
economyMode: true,
|
|
182
|
+
swarmMode: true,
|
|
183
|
+
tokens: {},
|
|
184
|
+
providers: {
|
|
185
|
+
minimax: {
|
|
186
|
+
model: 'minimax-2.7'
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
proxy: {}
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function createConfigResult(overrides = {}) {
|
|
194
|
+
return { created: false, updated: false, skipped: false, ...overrides };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function isInsidePath(childPath, parentPath) {
|
|
198
|
+
const relativePath = relative(parentPath, childPath);
|
|
199
|
+
return relativePath === '' || (!relativePath.startsWith('..') && !isAbsolute(relativePath));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function isPlainObject(value) {
|
|
203
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function mergeMissingConfigValues(existing, defaults) {
|
|
207
|
+
return Object.entries(defaults).reduce((next, [key, defaultValue]) => {
|
|
208
|
+
if (!(key in next)) {
|
|
209
|
+
return { ...next, [key]: defaultValue };
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const existingValue = next[key];
|
|
213
|
+
if (isPlainObject(existingValue) && isPlainObject(defaultValue)) {
|
|
214
|
+
return { ...next, [key]: mergeMissingConfigValues(existingValue, defaultValue) };
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return next;
|
|
218
|
+
}, { ...existing });
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function readConfigFile(configPath, label) {
|
|
222
|
+
if (!existsSync(configPath)) {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
try {
|
|
227
|
+
const parsed = JSON.parse(readFileSafely(configPath, `${label} config path changed during read`));
|
|
228
|
+
if (!isPlainObject(parsed)) {
|
|
229
|
+
throw new Error(`${label} config must contain a JSON object`);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return parsed;
|
|
233
|
+
} catch (error) {
|
|
234
|
+
const message = error instanceof SyntaxError ? `${label} config must contain valid JSON` : error instanceof Error ? error.message : String(error);
|
|
235
|
+
throw new Error(message);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function validateConfigPath(root, peaksRoot, configPath, label) {
|
|
240
|
+
const rootReal = realpathSync(root);
|
|
241
|
+
const peaksStats = lstatSync(peaksRoot);
|
|
242
|
+
const peaksReal = realpathSync(peaksRoot);
|
|
243
|
+
if (!peaksStats.isDirectory() || peaksStats.isSymbolicLink() || peaksReal !== resolve(rootReal, '.peaks')) {
|
|
244
|
+
throw new Error(`${label} config path must stay inside the ${label.toLowerCase()} root`);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const configStats = getPathStats(configPath);
|
|
248
|
+
if (configStats?.isSymbolicLink()) {
|
|
249
|
+
throw new Error(`${label} config path must not be a symlink`);
|
|
250
|
+
}
|
|
251
|
+
if (configStats && !configStats.isFile()) {
|
|
252
|
+
throw new Error(`${label} config path must be a file`);
|
|
253
|
+
}
|
|
254
|
+
if (configStats) {
|
|
255
|
+
if (configStats.nlink !== 1) {
|
|
256
|
+
throw new Error(`${label} config path must not be hardlinked`);
|
|
257
|
+
}
|
|
258
|
+
const configReal = realpathSync(configPath);
|
|
259
|
+
if (!isInsidePath(configReal, rootReal) || !isInsidePath(configReal, peaksReal)) {
|
|
260
|
+
throw new Error(`${label} config path must stay inside the ${label.toLowerCase()} root`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function validateProjectConfigPaths(projectRoot, peaksRoot, configPath) {
|
|
266
|
+
validateConfigPath(projectRoot, peaksRoot, configPath, 'Project');
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function validateUserConfigPaths(userRoot, peaksRoot, configPath) {
|
|
270
|
+
validateConfigPath(userRoot, peaksRoot, configPath, 'User');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function getSafeTempOpenFlags() {
|
|
274
|
+
const baseFlags = constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL;
|
|
275
|
+
return typeof constants.O_NOFOLLOW === 'number' ? baseFlags | constants.O_NOFOLLOW : baseFlags;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function writeFileExclusively(path, content, errorMessage, validateBeforeWrite) {
|
|
279
|
+
validateBeforeWrite();
|
|
280
|
+
let fd = openSync(path, getSafeTempOpenFlags(), 0o600);
|
|
281
|
+
let closeError = null;
|
|
282
|
+
let identity = null;
|
|
283
|
+
try {
|
|
284
|
+
validateOpenFile(fd, path, errorMessage);
|
|
285
|
+
validateBeforeWrite();
|
|
286
|
+
validateOpenFile(fd, path, errorMessage);
|
|
287
|
+
identity = createFileIdentity(path);
|
|
288
|
+
if (identity === null) {
|
|
289
|
+
throw new Error(errorMessage);
|
|
290
|
+
}
|
|
291
|
+
fchmodSync(fd, 0o600);
|
|
292
|
+
writeFileSync(fd, content, 'utf8');
|
|
293
|
+
const writeFd = fd;
|
|
294
|
+
fd = null;
|
|
295
|
+
closeSync(writeFd);
|
|
296
|
+
return identity;
|
|
297
|
+
} finally {
|
|
298
|
+
if (fd !== null) {
|
|
299
|
+
try {
|
|
300
|
+
closeSync(fd);
|
|
301
|
+
} catch (error) {
|
|
302
|
+
closeError = error;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (closeError) {
|
|
306
|
+
throw closeError;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function writeFileAtomically(configPath, content, errorMessage, validateBeforeWrite) {
|
|
312
|
+
validateBeforeWrite();
|
|
313
|
+
|
|
314
|
+
const tempPath = `${configPath}.${process.pid}.${randomUUID()}.tmp`;
|
|
315
|
+
let fd = openSync(tempPath, getSafeTempOpenFlags(), 0o600);
|
|
316
|
+
let renamed = false;
|
|
317
|
+
let closeError = null;
|
|
318
|
+
try {
|
|
319
|
+
validateOpenFile(fd, tempPath, errorMessage);
|
|
320
|
+
fchmodSync(fd, 0o600);
|
|
321
|
+
writeFileSync(fd, content, 'utf8');
|
|
322
|
+
const writeFd = fd;
|
|
323
|
+
fd = null;
|
|
324
|
+
closeSync(writeFd);
|
|
325
|
+
validateBeforeWrite();
|
|
326
|
+
const readFd = openSync(tempPath, getSafeReadOpenFlags());
|
|
327
|
+
try {
|
|
328
|
+
validateOpenFile(readFd, tempPath, errorMessage);
|
|
329
|
+
} finally {
|
|
330
|
+
closeSync(readFd);
|
|
331
|
+
}
|
|
332
|
+
renameSync(tempPath, configPath);
|
|
333
|
+
renamed = true;
|
|
334
|
+
} finally {
|
|
335
|
+
if (fd !== null) {
|
|
336
|
+
try {
|
|
337
|
+
closeSync(fd);
|
|
338
|
+
} catch (error) {
|
|
339
|
+
closeError = error;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
try {
|
|
343
|
+
if (!renamed && existsSync(tempPath)) {
|
|
344
|
+
unlinkSync(tempPath);
|
|
345
|
+
}
|
|
346
|
+
} finally {
|
|
347
|
+
if (closeError) {
|
|
348
|
+
throw closeError;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function writeProjectConfig(projectRoot, peaksRoot, configPath, content) {
|
|
355
|
+
writeFileAtomically(configPath, content, 'Project config path changed during write', () => validateProjectConfigPaths(projectRoot, peaksRoot, configPath));
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function writeUserConfig(userRoot, peaksRoot, configPath, content) {
|
|
359
|
+
writeFileAtomically(configPath, content, 'User config path changed during write', () => validateUserConfigPaths(userRoot, peaksRoot, configPath));
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function resolveProjectRoot(options) {
|
|
363
|
+
const projectRoot = options.projectRoot ?? process.env.PEAKS_PROJECT_ROOT ?? process.env.INIT_CWD;
|
|
364
|
+
return projectRoot ? resolve(projectRoot) : null;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Slice #011: Detect the installed IDE for the postinstall dispatch layer.
|
|
369
|
+
*
|
|
370
|
+
* Mirrors `src/services/ide/ide-detector.ts:detectInstalledIde` (cwd heuristic)
|
|
371
|
+
* but inlined here because `install-skills.mjs` is a plain `.mjs` script and
|
|
372
|
+
* cannot import the TS service at runtime. The dispatch:
|
|
373
|
+
* - Look for `.claude`, `.trae`, `.codex`, `.cursor`, `.qoder`,
|
|
374
|
+
* `.tongyi-lingma` in the project root in that insertion order
|
|
375
|
+
* (matches the registry's adapter order in `src/services/ide/ide-registry.ts`).
|
|
376
|
+
* - Returns the first match, or `null` if no adapter's directory is present.
|
|
377
|
+
*
|
|
378
|
+
* If the resolved IDE has no `skillInstall` declared (Trae in slice 1.3.2),
|
|
379
|
+
* the caller falls back to the legacy `~/.claude/{skills,output-styles}` path
|
|
380
|
+
* + emits a stderr warning. The dispatch is conservative: the env-var
|
|
381
|
+
* overrides `PEAKS_CLAUDE_SKILLS_DIR` / `PEAKS_CLAUDE_OUTPUT_STYLES_DIR`
|
|
382
|
+
* continue to work, and the legacy default is preserved.
|
|
383
|
+
*/
|
|
384
|
+
const IDE_DETECTION_DIRS = [
|
|
385
|
+
{ id: 'claude-code', dir: '.claude' },
|
|
386
|
+
{ id: 'trae', dir: '.trae' },
|
|
387
|
+
{ id: 'trae-cn', dir: '.trae-cn' },
|
|
388
|
+
{ id: 'codex', dir: '.codex' },
|
|
389
|
+
{ id: 'cursor', dir: '.cursor' },
|
|
390
|
+
{ id: 'qoder', dir: '.qoder' },
|
|
391
|
+
{ id: 'tongyi-lingma', dir: '.tongyi-lingma' },
|
|
392
|
+
];
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Per-IDE skill install paths. Per peaks-cli tenet
|
|
396
|
+
* "minimal-user-operation" (2026-06-11), the user should
|
|
397
|
+
* never have to run a per-platform install command — the
|
|
398
|
+
* `npm i -g peaks-cli` postinstall iterates ALL of these
|
|
399
|
+
* and symlinks the peaks-* skill family to every platform
|
|
400
|
+
* the user might be on.
|
|
401
|
+
*
|
|
402
|
+
* 1.x had only `claude-code` (the other 5 entries were
|
|
403
|
+
* `null`); real Trae users reported the Trae skill
|
|
404
|
+
* directory was never populated. 2.0 fixes this by giving
|
|
405
|
+
* all 8 platforms canonical install paths.
|
|
406
|
+
*/
|
|
407
|
+
const IDE_SKILL_INSTALL_PROFILES = {
|
|
408
|
+
'claude-code': {
|
|
409
|
+
skillsDir: join(homedir(), '.claude', 'skills'),
|
|
410
|
+
outputStylesDir: join(homedir(), '.claude', 'output-styles'),
|
|
411
|
+
agentsDir: join(homedir(), '.claude', 'agents'),
|
|
412
|
+
envVar: 'PEAKS_CLAUDE_SKILLS_DIR',
|
|
413
|
+
outputStylesEnvVar: 'PEAKS_CLAUDE_OUTPUT_STYLES_DIR',
|
|
414
|
+
agentsEnvVar: 'PEAKS_CLAUDE_AGENTS_DIR',
|
|
415
|
+
},
|
|
416
|
+
'trae': {
|
|
417
|
+
skillsDir: join(homedir(), '.trae', 'skills'),
|
|
418
|
+
outputStylesDir: join(homedir(), '.trae', 'output-styles'),
|
|
419
|
+
agentsDir: join(homedir(), '.trae', 'agents'),
|
|
420
|
+
envVar: 'PEAKS_TRAE_SKILLS_DIR',
|
|
421
|
+
outputStylesEnvVar: 'PEAKS_TRAE_OUTPUT_STYLES_DIR',
|
|
422
|
+
agentsEnvVar: 'PEAKS_TRAE_AGENTS_DIR',
|
|
423
|
+
},
|
|
424
|
+
'trae-cn': {
|
|
425
|
+
skillsDir: join(homedir(), '.trae-cn', 'skills'),
|
|
426
|
+
outputStylesDir: join(homedir(), '.trae-cn', 'output-styles'),
|
|
427
|
+
agentsDir: join(homedir(), '.trae-cn', 'agents'),
|
|
428
|
+
envVar: 'PEAKS_TRAE_CN_SKILLS_DIR',
|
|
429
|
+
outputStylesEnvVar: 'PEAKS_TRAE_CN_OUTPUT_STYLES_DIR',
|
|
430
|
+
agentsEnvVar: 'PEAKS_TRAE_CN_AGENTS_DIR',
|
|
431
|
+
},
|
|
432
|
+
'codex': {
|
|
433
|
+
skillsDir: join(homedir(), '.codex', 'skills'),
|
|
434
|
+
outputStylesDir: join(homedir(), '.codex', 'output-styles'),
|
|
435
|
+
agentsDir: join(homedir(), '.codex', 'agents'),
|
|
436
|
+
envVar: 'PEAKS_CODEX_SKILLS_DIR',
|
|
437
|
+
outputStylesEnvVar: 'PEAKS_CODEX_OUTPUT_STYLES_DIR',
|
|
438
|
+
agentsEnvVar: 'PEAKS_CODEX_AGENTS_DIR',
|
|
439
|
+
},
|
|
440
|
+
'cursor': {
|
|
441
|
+
skillsDir: join(homedir(), '.cursor', 'skills'),
|
|
442
|
+
outputStylesDir: join(homedir(), '.cursor', 'output-styles'),
|
|
443
|
+
agentsDir: join(homedir(), '.cursor', 'agents'),
|
|
444
|
+
envVar: 'PEAKS_CURSOR_SKILLS_DIR',
|
|
445
|
+
outputStylesEnvVar: 'PEAKS_CURSOR_OUTPUT_STYLES_DIR',
|
|
446
|
+
agentsEnvVar: 'PEAKS_CURSOR_AGENTS_DIR',
|
|
447
|
+
},
|
|
448
|
+
'qoder': {
|
|
449
|
+
skillsDir: join(homedir(), '.qoder', 'skills'),
|
|
450
|
+
outputStylesDir: join(homedir(), '.qoder', 'output-styles'),
|
|
451
|
+
envVar: 'PEAKS_QODER_SKILLS_DIR',
|
|
452
|
+
outputStylesEnvVar: 'PEAKS_QODER_OUTPUT_STYLES_DIR',
|
|
453
|
+
},
|
|
454
|
+
'tongyi-lingma': {
|
|
455
|
+
skillsDir: join(homedir(), '.tongyi-lingma', 'skills'),
|
|
456
|
+
outputStylesDir: join(homedir(), '.tongyi-lingma', 'output-styles'),
|
|
457
|
+
envVar: 'PEAKS_TONGYI_SKILLS_DIR',
|
|
458
|
+
outputStylesEnvVar: 'PEAKS_TONGYI_OUTPUT_STYLES_DIR',
|
|
459
|
+
},
|
|
460
|
+
'hermes': {
|
|
461
|
+
skillsDir: join(homedir(), '.hermes', 'skills'),
|
|
462
|
+
outputStylesDir: join(homedir(), '.hermes', 'output-styles'),
|
|
463
|
+
envVar: 'PEAKS_HERMES_SKILLS_DIR',
|
|
464
|
+
outputStylesEnvVar: 'PEAKS_HERMES_OUTPUT_STYLES_DIR',
|
|
465
|
+
},
|
|
466
|
+
'openclaw': {
|
|
467
|
+
skillsDir: join(homedir(), '.openclaw', 'skills'),
|
|
468
|
+
outputStylesDir: join(homedir(), '.openclaw', 'output-styles'),
|
|
469
|
+
envVar: 'PEAKS_OPENCLAW_SKILLS_DIR',
|
|
470
|
+
outputStylesEnvVar: 'PEAKS_OPENCLAW_OUTPUT_STYLES_DIR',
|
|
471
|
+
},
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
function detectInstalledIdeId(projectRoot) {
|
|
475
|
+
if (!projectRoot) return null;
|
|
476
|
+
for (const { id, dir } of IDE_DETECTION_DIRS) {
|
|
477
|
+
if (existsSync(join(projectRoot, dir))) {
|
|
478
|
+
return id;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return null;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function resolveIdeSkillInstallProfile(ideId) {
|
|
485
|
+
if (ideId === null) return null;
|
|
486
|
+
return IDE_SKILL_INSTALL_PROFILES[ideId] ?? null;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function warnUnverifiedIde(ideId, projectRoot) {
|
|
490
|
+
process.stderr.write(
|
|
491
|
+
`peaks install-skills: IDE '${ideId}' has no skillInstall profile declared; ` +
|
|
492
|
+
`falling back to the legacy Claude Code path (~/.claude/skills + ~/.claude/output-styles) ` +
|
|
493
|
+
`for project '${projectRoot}'. This is a slice #011 follow-up gap; ` +
|
|
494
|
+
`see .peaks/memory/ide-adapter-resource-profile-framework.md.\n`
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
function warnNoIdeDetected(projectRoot) {
|
|
499
|
+
process.stderr.write(
|
|
500
|
+
`peaks install-skills: no IDE detected in '${projectRoot ?? '(project root unknown)'}'; ` +
|
|
501
|
+
`installing to the legacy Claude Code path (~/.claude/skills + ~/.claude/output-styles). ` +
|
|
502
|
+
`Set PEAKS_CLAUDE_SKILLS_DIR / PEAKS_CLAUDE_OUTPUT_STYLES_DIR to override.\n`
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
function writeMergedConfig(configPath, label, defaults, writeConfig) {
|
|
507
|
+
const existing = readConfigFile(configPath, label);
|
|
508
|
+
const next = { ...(existing === null ? defaults : mergeMissingConfigValues(existing, defaults)), version: defaults.version };
|
|
509
|
+
const currentJson = existing === null ? null : `${JSON.stringify(existing, null, 2)}\n`;
|
|
510
|
+
const nextJson = `${JSON.stringify(next, null, 2)}\n`;
|
|
511
|
+
|
|
512
|
+
if (currentJson === nextJson) {
|
|
513
|
+
return createConfigResult();
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
writeConfig(nextJson);
|
|
517
|
+
return createConfigResult(existing === null ? { created: true } : { updated: true });
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export function installUserConfig(options = {}) {
|
|
521
|
+
if (process.env.PEAKS_SKIP_SKILL_INSTALL === '1' || process.env.PEAKS_SKIP_USER_CONFIG_INSTALL === '1') {
|
|
522
|
+
return createConfigResult({ skipped: true });
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
const userRoot = resolve(options.userRoot ?? homedir());
|
|
526
|
+
const peaksRoot = resolve(userRoot, '.peaks');
|
|
527
|
+
const configPath = resolve(peaksRoot, 'config.json');
|
|
528
|
+
if (!isInsidePath(configPath, userRoot)) {
|
|
529
|
+
throw new Error('User config path must stay inside the user root');
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
if (!existsSync(peaksRoot)) {
|
|
533
|
+
mkdirSync(peaksRoot, { recursive: true });
|
|
534
|
+
}
|
|
535
|
+
validateUserConfigPaths(userRoot, peaksRoot, configPath);
|
|
536
|
+
|
|
537
|
+
return writeMergedConfig(configPath, 'User', createConfigDefaults(options.packageRoot), (content) => writeUserConfig(userRoot, peaksRoot, configPath, content));
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export function installProjectConfig(options = {}) {
|
|
541
|
+
if (process.env.PEAKS_SKIP_SKILL_INSTALL === '1' || process.env.PEAKS_SKIP_PROJECT_CONFIG_INSTALL === '1') {
|
|
542
|
+
return createConfigResult({ skipped: true });
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
const projectRoot = resolveProjectRoot(options);
|
|
546
|
+
if (!projectRoot) {
|
|
547
|
+
return createConfigResult({ skipped: true });
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
const peaksRoot = resolve(projectRoot, '.peaks');
|
|
551
|
+
const configPath = resolve(peaksRoot, 'config.json');
|
|
552
|
+
if (!isInsidePath(configPath, projectRoot)) {
|
|
553
|
+
throw new Error('Project config path must stay inside the project root');
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
if (!existsSync(peaksRoot)) {
|
|
557
|
+
mkdirSync(peaksRoot, { recursive: true });
|
|
558
|
+
}
|
|
559
|
+
validateProjectConfigPaths(projectRoot, peaksRoot, configPath);
|
|
560
|
+
|
|
561
|
+
return writeMergedConfig(configPath, 'Project', createConfigDefaults(options.packageRoot), (content) => writeProjectConfig(projectRoot, peaksRoot, configPath, content));
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
export function installBundledSkills(options = {}) {
|
|
565
|
+
const packageRoot = resolvePackageRoot(options);
|
|
566
|
+
const skillsRoot = join(packageRoot, 'skills');
|
|
567
|
+
|
|
568
|
+
if (process.env.PEAKS_SKIP_SKILL_INSTALL === '1' || !existsSync(skillsRoot)) {
|
|
569
|
+
return createInstallResult();
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// Slice #011: IDE-aware dispatch. Precedence (highest first):
|
|
573
|
+
// 1. explicit options.targetRoot (test / hook override)
|
|
574
|
+
// 2. options.ideId skillInstall.skillsDir (per-IDE dispatch)
|
|
575
|
+
// 3. PEAKS_CLAUDE_SKILLS_DIR env var (legacy back-compat)
|
|
576
|
+
// 4. detected IDE's skillInstall.skillsDir (auto-detect from projectRoot)
|
|
577
|
+
// 5. legacy default (~/.claude/skills) (no-IDE fallback)
|
|
578
|
+
const projectRoot = resolveProjectRoot(options);
|
|
579
|
+
const detectedIdeId = detectInstalledIdeId(projectRoot);
|
|
580
|
+
const detectedProfile = resolveIdeSkillInstallProfile(detectedIdeId);
|
|
581
|
+
|
|
582
|
+
if (options.targetRoot === undefined && options.ideId === undefined && detectedProfile === null && detectedIdeId !== null) {
|
|
583
|
+
warnUnverifiedIde(detectedIdeId, projectRoot ?? '(project root unknown)');
|
|
584
|
+
}
|
|
585
|
+
if (options.targetRoot === undefined && options.ideId === undefined && detectedIdeId === null && projectRoot !== null) {
|
|
586
|
+
warnNoIdeDetected(projectRoot);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
const profileSkillsDir = detectedProfile?.skillsDir ?? null;
|
|
590
|
+
const targetRoot = resolve(
|
|
591
|
+
options.targetRoot
|
|
592
|
+
?? (options.ideId !== undefined ? resolveIdeSkillInstallProfile(options.ideId)?.skillsDir ?? null : null)
|
|
593
|
+
?? process.env.PEAKS_CLAUDE_SKILLS_DIR
|
|
594
|
+
?? profileSkillsDir
|
|
595
|
+
?? join(homedir(), '.claude', 'skills')
|
|
596
|
+
);
|
|
597
|
+
|
|
598
|
+
const installed = [];
|
|
599
|
+
const skipped = [];
|
|
600
|
+
mkdirSync(targetRoot, { recursive: true });
|
|
601
|
+
const validateSkillsRoot = createInstallRootValidator(targetRoot, 'Peaks skills');
|
|
602
|
+
|
|
603
|
+
for (const skillName of readdirSync(skillsRoot)) {
|
|
604
|
+
const sourcePath = join(skillsRoot, skillName);
|
|
605
|
+
const skillFile = join(sourcePath, 'SKILL.md');
|
|
606
|
+
const targetPath = join(targetRoot, skillName);
|
|
607
|
+
|
|
608
|
+
if (!lstatSync(sourcePath).isDirectory() || !existsSync(skillFile)) {
|
|
609
|
+
continue;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
const current = getPathStats(targetPath);
|
|
613
|
+
if (current) {
|
|
614
|
+
const managedTarget = getManagedTarget(targetPath);
|
|
615
|
+
const linkTarget = current.isSymbolicLink() ? readlinkSync(targetPath) : null;
|
|
616
|
+
if (linkTarget === sourcePath) {
|
|
617
|
+
installed.push(skillName);
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
620
|
+
if ((current.isSymbolicLink() || isBrokenSymlink(current, targetPath)) && managedTarget === linkTarget) {
|
|
621
|
+
validateSkillsRoot();
|
|
622
|
+
unlinkSync(targetPath);
|
|
623
|
+
validateSkillsRoot();
|
|
624
|
+
unlinkSync(`${targetPath}.peaks-managed`);
|
|
625
|
+
} else {
|
|
626
|
+
skipped.push(skillName);
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
validateSkillsRoot();
|
|
632
|
+
symlinkSync(sourcePath, targetPath, process.platform === 'win32' ? 'junction' : 'dir');
|
|
633
|
+
try {
|
|
634
|
+
validateSkillsRoot();
|
|
635
|
+
markManagedPeaksLink(targetPath, sourcePath);
|
|
636
|
+
} catch (error) {
|
|
637
|
+
validateSkillsRoot();
|
|
638
|
+
const created = getPathStats(targetPath);
|
|
639
|
+
if (created?.isSymbolicLink() && readlinkSync(targetPath) === sourcePath) {
|
|
640
|
+
unlinkSync(targetPath);
|
|
641
|
+
}
|
|
642
|
+
throw error;
|
|
643
|
+
}
|
|
644
|
+
installed.push(skillName);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
return { installed, skipped };
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
export function installBundledOutputStyles(options = {}) {
|
|
651
|
+
const packageRoot = resolvePackageRoot(options);
|
|
652
|
+
const outputStylesRoot = join(packageRoot, 'output-styles');
|
|
653
|
+
|
|
654
|
+
if (process.env.PEAKS_SKIP_SKILL_INSTALL === '1' || !existsSync(outputStylesRoot)) {
|
|
655
|
+
return createInstallResult();
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
// Slice #011: IDE-aware dispatch. Same precedence as installBundledSkills.
|
|
659
|
+
const projectRoot = resolveProjectRoot(options);
|
|
660
|
+
const detectedIdeId = detectInstalledIdeId(projectRoot);
|
|
661
|
+
const detectedProfile = resolveIdeSkillInstallProfile(detectedIdeId);
|
|
662
|
+
|
|
663
|
+
const profileOutputStylesDir = detectedProfile?.outputStylesDir ?? null;
|
|
664
|
+
const targetRoot = resolve(
|
|
665
|
+
options.targetRoot
|
|
666
|
+
?? (options.ideId !== undefined ? resolveIdeSkillInstallProfile(options.ideId)?.outputStylesDir ?? null : null)
|
|
667
|
+
?? process.env.PEAKS_CLAUDE_OUTPUT_STYLES_DIR
|
|
668
|
+
?? profileOutputStylesDir
|
|
669
|
+
?? join(homedir(), '.claude', 'output-styles')
|
|
670
|
+
);
|
|
671
|
+
|
|
672
|
+
const installed = [];
|
|
673
|
+
const skipped = [];
|
|
674
|
+
mkdirSync(targetRoot, { recursive: true });
|
|
675
|
+
const validateOutputStylesRoot = createInstallRootValidator(targetRoot, 'Peaks output styles');
|
|
676
|
+
|
|
677
|
+
for (const outputStyleName of readdirSync(outputStylesRoot)) {
|
|
678
|
+
const sourcePath = join(outputStylesRoot, outputStyleName);
|
|
679
|
+
const targetPath = join(targetRoot, outputStyleName);
|
|
680
|
+
|
|
681
|
+
if (!lstatSync(sourcePath).isFile() || !outputStyleName.endsWith('.md')) {
|
|
682
|
+
continue;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
const current = getPathStats(targetPath);
|
|
686
|
+
if (current) {
|
|
687
|
+
const managedTarget = getManagedTarget(targetPath);
|
|
688
|
+
const managedTargetIdentity = getManagedPeaksOutputStyleIdentity(managedTarget, targetPath, sourcePath, outputStyleName);
|
|
689
|
+
if (isSameFileIdentity(targetPath, managedTargetIdentity)) {
|
|
690
|
+
validateOutputStylesRoot();
|
|
691
|
+
if (!isSameFileIdentity(targetPath, managedTargetIdentity)) {
|
|
692
|
+
throw new Error('Peaks output style path changed during unlink');
|
|
693
|
+
}
|
|
694
|
+
unlinkSync(targetPath);
|
|
695
|
+
validateOutputStylesRoot();
|
|
696
|
+
unlinkSync(`${targetPath}.peaks-managed`);
|
|
697
|
+
} else {
|
|
698
|
+
skipped.push(outputStyleName);
|
|
699
|
+
continue;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
const markerPath = `${targetPath}.peaks-managed`;
|
|
704
|
+
validateManagedMarkerPath(markerPath);
|
|
705
|
+
if (!current && existsSync(markerPath)) {
|
|
706
|
+
validateOutputStylesRoot();
|
|
707
|
+
unlinkSync(markerPath);
|
|
708
|
+
}
|
|
709
|
+
const createdTargetIdentity = writeFileExclusively(targetPath, readPackageSourceFile(sourcePath), 'Peaks output style path changed during write', validateOutputStylesRoot);
|
|
710
|
+
try {
|
|
711
|
+
writeFileExclusively(markerPath, createManagedOutputStyleMarker(sourcePath, outputStyleName), 'Peaks managed marker path changed during write', () => {
|
|
712
|
+
validateOutputStylesRoot();
|
|
713
|
+
validateManagedMarkerPath(markerPath);
|
|
714
|
+
});
|
|
715
|
+
} catch (error) {
|
|
716
|
+
validateOutputStylesRoot();
|
|
717
|
+
if (isSameFileIdentity(targetPath, createdTargetIdentity)) {
|
|
718
|
+
unlinkSync(targetPath);
|
|
719
|
+
}
|
|
720
|
+
throw error;
|
|
721
|
+
}
|
|
722
|
+
installed.push(outputStyleName);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
return { installed, skipped };
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Slice 7/7 — bundled agents (Claude Code sub-agent prompts).
|
|
730
|
+
*
|
|
731
|
+
* Mirrors `installBundledOutputStyles` but writes to
|
|
732
|
+
* `~/.claude/agents/` (Claude Code's sub-agent loader directory). Each
|
|
733
|
+
* agent file ships under `agents/*.md` in the peaks-cli tarball and is
|
|
734
|
+
* copied on `npm i -g peaks-cli@latest` with content-hash drift detection
|
|
735
|
+
* via a `.peaks-managed` marker (SHA-256 of the source content).
|
|
736
|
+
*
|
|
737
|
+
* Drift policy (mirrors output-styles):
|
|
738
|
+
* - file missing, marker missing → install (write file + marker)
|
|
739
|
+
* - file missing, marker present → install (replace stale marker)
|
|
740
|
+
* - file present, marker present,
|
|
741
|
+
* SHA matches, sourcePath matches → skip (idempotent re-install)
|
|
742
|
+
* - file present, marker present,
|
|
743
|
+
* SHA matches, sourcePath differs → skip (stale package path;
|
|
744
|
+
* preserve user's local file)
|
|
745
|
+
* - file present, marker present,
|
|
746
|
+
* SHA differs → overwrite (package upgrade)
|
|
747
|
+
* - file present, no marker → skip (user-authored file;
|
|
748
|
+
* preserve)
|
|
749
|
+
*/
|
|
750
|
+
function createManagedAgentMarker(sourcePath, agentName) {
|
|
751
|
+
const content = readPackageSourceFile(sourcePath);
|
|
752
|
+
return `${JSON.stringify({ version: 1, kind: 'agent', agentName, sourcePath, contentSha256: hashContent(content) })}\n`;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
function parseManagedAgentMarker(managedTarget) {
|
|
756
|
+
if (managedTarget === null) return null;
|
|
757
|
+
try {
|
|
758
|
+
const marker = JSON.parse(managedTarget);
|
|
759
|
+
if (marker?.version !== 1 || marker?.kind !== 'agent' || typeof marker.agentName !== 'string' || typeof marker.sourcePath !== 'string' || typeof marker.contentSha256 !== 'string') {
|
|
760
|
+
return null;
|
|
761
|
+
}
|
|
762
|
+
return marker;
|
|
763
|
+
} catch {
|
|
764
|
+
return null;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
function isTrustedAgentSource(marker, sourcePath, agentName) {
|
|
769
|
+
return marker.agentName === agentName && resolve(marker.sourcePath) === resolve(sourcePath) && basename(resolve(marker.sourcePath)) === agentName;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
function getManagedPeaksAgentIdentity(managedTarget, targetPath, sourcePath, agentName) {
|
|
773
|
+
const marker = parseManagedAgentMarker(managedTarget);
|
|
774
|
+
const sourceHash = hashContent(readPackageSourceFile(sourcePath));
|
|
775
|
+
if (marker === null || !isTrustedAgentSource(marker, sourcePath, agentName) || !existsSync(targetPath) || hashFileContent(targetPath) !== sourceHash || marker.contentSha256 !== sourceHash) {
|
|
776
|
+
return null;
|
|
777
|
+
}
|
|
778
|
+
return createFileIdentity(targetPath);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
export function installBundledAgents(options = {}) {
|
|
782
|
+
const packageRoot = resolvePackageRoot(options);
|
|
783
|
+
const agentsRoot = join(packageRoot, 'agents');
|
|
784
|
+
|
|
785
|
+
// Per-IDE env-var override (claude-code only today): PEAKS_CLAUDE_AGENTS_DIR.
|
|
786
|
+
// Universal escape hatch: PEAKS_SKIP_AGENT_INSTALL=1 (parallel to
|
|
787
|
+
// PEAKS_SKIP_SKILL_INSTALL).
|
|
788
|
+
if (process.env.PEAKS_SKIP_SKILL_INSTALL === '1' || process.env.PEAKS_SKIP_AGENT_INSTALL === '1' || !existsSync(agentsRoot)) {
|
|
789
|
+
return createInstallResult();
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// Slice #011: IDE-aware dispatch. Same precedence as installBundledOutputStyles.
|
|
793
|
+
const projectRoot = resolveProjectRoot(options);
|
|
794
|
+
const detectedIdeId = detectInstalledIdeId(projectRoot);
|
|
795
|
+
const detectedProfile = resolveIdeSkillInstallProfile(detectedIdeId);
|
|
796
|
+
|
|
797
|
+
const profileAgentsDir = detectedProfile?.agentsDir ?? null;
|
|
798
|
+
const targetRoot = resolve(
|
|
799
|
+
options.targetRoot
|
|
800
|
+
?? (options.ideId !== undefined ? resolveIdeSkillInstallProfile(options.ideId)?.agentsDir ?? null : null)
|
|
801
|
+
?? process.env.PEAKS_CLAUDE_AGENTS_DIR
|
|
802
|
+
?? profileAgentsDir
|
|
803
|
+
?? join(homedir(), '.claude', 'agents')
|
|
804
|
+
);
|
|
805
|
+
|
|
806
|
+
const installed = [];
|
|
807
|
+
const skipped = [];
|
|
808
|
+
mkdirSync(targetRoot, { recursive: true });
|
|
809
|
+
const validateAgentsRoot = createInstallRootValidator(targetRoot, 'Peaks agents');
|
|
810
|
+
|
|
811
|
+
for (const agentFileName of readdirSync(agentsRoot)) {
|
|
812
|
+
const sourcePath = join(agentsRoot, agentFileName);
|
|
813
|
+
const targetPath = join(targetRoot, agentFileName);
|
|
814
|
+
|
|
815
|
+
if (!lstatSync(sourcePath).isFile() || !agentFileName.endsWith('.md')) {
|
|
816
|
+
continue;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
const current = getPathStats(targetPath);
|
|
820
|
+
if (current) {
|
|
821
|
+
const managedTarget = getManagedTarget(targetPath);
|
|
822
|
+
const managedTargetIdentity = getManagedPeaksAgentIdentity(managedTarget, targetPath, sourcePath, agentFileName);
|
|
823
|
+
if (isSameFileIdentity(targetPath, managedTargetIdentity)) {
|
|
824
|
+
validateAgentsRoot();
|
|
825
|
+
if (!isSameFileIdentity(targetPath, managedTargetIdentity)) {
|
|
826
|
+
throw new Error('Peaks agent path changed during unlink');
|
|
827
|
+
}
|
|
828
|
+
unlinkSync(targetPath);
|
|
829
|
+
validateAgentsRoot();
|
|
830
|
+
unlinkSync(`${targetPath}.peaks-managed`);
|
|
831
|
+
} else {
|
|
832
|
+
skipped.push(agentFileName);
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
const markerPath = `${targetPath}.peaks-managed`;
|
|
838
|
+
validateManagedMarkerPath(markerPath);
|
|
839
|
+
if (!current && existsSync(markerPath)) {
|
|
840
|
+
validateAgentsRoot();
|
|
841
|
+
unlinkSync(markerPath);
|
|
842
|
+
}
|
|
843
|
+
const createdTargetIdentity = writeFileExclusively(targetPath, readPackageSourceFile(sourcePath), 'Peaks agent path changed during write', validateAgentsRoot);
|
|
844
|
+
try {
|
|
845
|
+
writeFileExclusively(markerPath, createManagedAgentMarker(sourcePath, agentFileName), 'Peaks managed marker path changed during write', () => {
|
|
846
|
+
validateAgentsRoot();
|
|
847
|
+
validateManagedMarkerPath(markerPath);
|
|
848
|
+
});
|
|
849
|
+
} catch (error) {
|
|
850
|
+
validateAgentsRoot();
|
|
851
|
+
if (isSameFileIdentity(targetPath, createdTargetIdentity)) {
|
|
852
|
+
unlinkSync(targetPath);
|
|
853
|
+
}
|
|
854
|
+
throw error;
|
|
855
|
+
}
|
|
856
|
+
installed.push(agentFileName);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
return { installed, skipped };
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* Per-platform fan-out — iterate ALL 8 IdeIds and call
|
|
864
|
+
* `installBundledAgents` for each platform that has an `agentsDir` profile
|
|
865
|
+
* field. Only `claude-code` ships with `agentsDir` set today; the other 7
|
|
866
|
+
* platforms return `installed: []` from their profile lookup. Future
|
|
867
|
+
* platforms can add an `agentsDir` field to their `IDE_SKILL_INSTALL_PROFILES`
|
|
868
|
+
* entry to opt in.
|
|
869
|
+
*
|
|
870
|
+
* Per peaks-cli tenet "minimal-user-operation" (2026-06-11): the user
|
|
871
|
+
* should never have to run a per-platform install command. Symlink /
|
|
872
|
+
* copy failures are soft (logged to stderr, never throw) so one platform's
|
|
873
|
+
* failure doesn't block the others.
|
|
874
|
+
*/
|
|
875
|
+
export function installBundledAgentsForAllPlatforms(options = {}) {
|
|
876
|
+
const platforms = Object.entries(IDE_SKILL_INSTALL_PROFILES)
|
|
877
|
+
.filter(([, profile]) => typeof profile.agentsDir === 'string');
|
|
878
|
+
const perPlatform = [];
|
|
879
|
+
for (const [ideId, profile] of platforms) {
|
|
880
|
+
try {
|
|
881
|
+
// Per-platform env-var override (claude-code only today):
|
|
882
|
+
// PEAKS_CLAUDE_AGENTS_DIR. This is the same precedence as
|
|
883
|
+
// installBundledSkillsForAllPlatforms (slice #011). For the
|
|
884
|
+
// claude-code iteration, if the env var is set, use it as
|
|
885
|
+
// `targetRoot` (so the env var takes priority over the profile).
|
|
886
|
+
// For test mode, options.targetRoot also wins.
|
|
887
|
+
const envOverride = ideId === 'claude-code'
|
|
888
|
+
? process.env.PEAKS_CLAUDE_AGENTS_DIR
|
|
889
|
+
: undefined;
|
|
890
|
+
const platformOpts = (envOverride !== undefined && envOverride.length > 0)
|
|
891
|
+
? { ...options, ideId, targetRoot: envOverride }
|
|
892
|
+
: (options.targetRoot !== undefined
|
|
893
|
+
? { ...options, ideId, targetRoot: options.targetRoot }
|
|
894
|
+
: { ...options, ideId });
|
|
895
|
+
const result = installBundledAgents(platformOpts);
|
|
896
|
+
perPlatform.push({
|
|
897
|
+
ideId,
|
|
898
|
+
agentsDir: profile.agentsDir,
|
|
899
|
+
installed: result.installed,
|
|
900
|
+
skipped: result.skipped,
|
|
901
|
+
});
|
|
902
|
+
} catch (err) {
|
|
903
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
904
|
+
process.stderr.write(
|
|
905
|
+
`peaks install-agents: ${ideId} platform failed (continuing): ${message}\n`
|
|
906
|
+
);
|
|
907
|
+
perPlatform.push({
|
|
908
|
+
ideId,
|
|
909
|
+
agentsDir: profile.agentsDir,
|
|
910
|
+
installed: [],
|
|
911
|
+
skipped: [],
|
|
912
|
+
error: message,
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
return perPlatform;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Per-platform fan-out — iterate ALL 8 IdeIds and call
|
|
921
|
+
* `installBundledSkills` for each. Per peaks-cli tenet
|
|
922
|
+
* "minimal-user-operation" (2026-06-11): the user should
|
|
923
|
+
* never have to run a per-platform install command. The
|
|
924
|
+
* 1.x postinstall only handled the auto-detected single
|
|
925
|
+
* IDE; 2.0 fixes this so the peaks-* skill family is
|
|
926
|
+
* symlinked to every platform the user might be on.
|
|
927
|
+
*
|
|
928
|
+
* Returns an array of { ideId, skillsDir, installed, skipped }
|
|
929
|
+
* per platform. Symlink failures are soft (logged to stderr,
|
|
930
|
+
* never throw) so one platform's failure doesn't block the
|
|
931
|
+
* other 7.
|
|
932
|
+
*/
|
|
933
|
+
export function installBundledSkillsForAllPlatforms(options = {}) {
|
|
934
|
+
const platforms = Object.keys(IDE_SKILL_INSTALL_PROFILES);
|
|
935
|
+
const perPlatform = [];
|
|
936
|
+
// Back-compat precedence (regression fix 2026-06-12,
|
|
937
|
+
// slice 2026-06-12-postinstall-1x-detector-tdd):
|
|
938
|
+
// when iterating the 8 platforms, the claude-code install
|
|
939
|
+
// must still honor the PEAKS_CLAUDE_SKILLS_DIR env var
|
|
940
|
+
// (the legacy back-compat surface from 1.x). The other 7
|
|
941
|
+
// platforms use their per-IDE profile paths unconditionally.
|
|
942
|
+
// Without this fix the 8-IDE fan-out regresses the
|
|
943
|
+
// `peaks install-skills` env-var override contract that
|
|
944
|
+
// user CI / 1.x → 2.0 migration scripts depend on.
|
|
945
|
+
const claudeEnv = process.env.PEAKS_CLAUDE_SKILLS_DIR;
|
|
946
|
+
for (const ideId of platforms) {
|
|
947
|
+
try {
|
|
948
|
+
const platformOpts =
|
|
949
|
+
ideId === 'claude-code' && claudeEnv !== undefined && claudeEnv.length > 0
|
|
950
|
+
? { ...options, ideId, targetRoot: claudeEnv }
|
|
951
|
+
: { ...options, ideId };
|
|
952
|
+
const result = installBundledSkills(platformOpts);
|
|
953
|
+
perPlatform.push({
|
|
954
|
+
ideId,
|
|
955
|
+
skillsDir: IDE_SKILL_INSTALL_PROFILES[ideId]?.skillsDir ?? '(unknown)',
|
|
956
|
+
installed: result.installed,
|
|
957
|
+
skipped: result.skipped,
|
|
958
|
+
});
|
|
959
|
+
} catch (err) {
|
|
960
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
961
|
+
process.stderr.write(
|
|
962
|
+
`peaks install-skills: ${ideId} platform failed (continuing): ${message}\n`
|
|
963
|
+
);
|
|
964
|
+
perPlatform.push({
|
|
965
|
+
ideId,
|
|
966
|
+
skillsDir: IDE_SKILL_INSTALL_PROFILES[ideId]?.skillsDir ?? '(unknown)',
|
|
967
|
+
installed: [],
|
|
968
|
+
skipped: [],
|
|
969
|
+
error: message,
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
return perPlatform;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* 1.x → 2.0 detection — sniff for legacy 1.x project state
|
|
978
|
+
* in `cwd`. Returns a 1.x detection envelope with the
|
|
979
|
+
* detected signals (so the postinstall can decide whether
|
|
980
|
+
* to auto-upgrade).
|
|
981
|
+
*
|
|
982
|
+
* 1.x signals (any one fires the detection):
|
|
983
|
+
* - `~/.peaks/config.json` exists with `version: '1.4.2'` (or
|
|
984
|
+
* any '1.x' version that predates the 2.0 schema)
|
|
985
|
+
* - `.claude/rules/common/dev-preference.md` exists and
|
|
986
|
+
* references "peaks progress" (the 1.x CLI surface
|
|
987
|
+
* removed in slice #014)
|
|
988
|
+
* - `<cwd>/.peaks/preferences.json` missing OR has no
|
|
989
|
+
* `schema_version: '2.0.0'` field
|
|
990
|
+
*
|
|
991
|
+
* Returns:
|
|
992
|
+
* { isOneX: boolean, signals: string[], projectRoot: string|null,
|
|
993
|
+
* configPath: string|null }
|
|
994
|
+
*/
|
|
995
|
+
export function detect1xProjectState(cwd = process.cwd()) {
|
|
996
|
+
const home = homedir();
|
|
997
|
+
const signals = [];
|
|
998
|
+
let projectRoot = null;
|
|
999
|
+
let configPath = null;
|
|
1000
|
+
|
|
1001
|
+
// Walk up from cwd looking for .peaks/_runtime (signals
|
|
1002
|
+
// we're inside a peaks project).
|
|
1003
|
+
let dir = cwd;
|
|
1004
|
+
for (let i = 0; i < 8; i += 1) {
|
|
1005
|
+
const peaksRuntime = join(dir, '.peaks', '_runtime');
|
|
1006
|
+
if (existsSync(peaksRuntime)) {
|
|
1007
|
+
projectRoot = dir;
|
|
1008
|
+
break;
|
|
1009
|
+
}
|
|
1010
|
+
const parent = dirname(dir);
|
|
1011
|
+
if (parent === dir) break;
|
|
1012
|
+
dir = parent;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// Signal 1: ~/.peaks/config.json with 1.x version
|
|
1016
|
+
const globalConfig = join(home, '.peaks', 'config.json');
|
|
1017
|
+
if (existsSync(globalConfig)) {
|
|
1018
|
+
try {
|
|
1019
|
+
const raw = JSON.parse(readFileSync(globalConfig, 'utf8'));
|
|
1020
|
+
if (typeof raw.version === 'string' && /^1\./.test(raw.version)) {
|
|
1021
|
+
signals.push(`global config at ${globalConfig} is 1.x (${raw.version})`);
|
|
1022
|
+
if (configPath === null) configPath = globalConfig;
|
|
1023
|
+
}
|
|
1024
|
+
} catch {
|
|
1025
|
+
// ignore parse error — the 1.x detection is best-effort
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
// Signal 2: .claude/rules/common/dev-preference.md with peaks progress
|
|
1030
|
+
if (projectRoot !== null) {
|
|
1031
|
+
const devPref = join(projectRoot, '.claude', 'rules', 'common', 'dev-preference.md');
|
|
1032
|
+
if (existsSync(devPref)) {
|
|
1033
|
+
try {
|
|
1034
|
+
const body = readFileSync(devPref, 'utf8');
|
|
1035
|
+
if (/peaks progress/i.test(body)) {
|
|
1036
|
+
signals.push(`${devPref} references "peaks progress" (1.x CLI surface, removed in slice #014)`);
|
|
1037
|
+
}
|
|
1038
|
+
} catch {
|
|
1039
|
+
// ignore
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
// Signal 3: project preferences.json missing or 1.x
|
|
1043
|
+
const prefs = join(projectRoot, '.peaks', 'preferences.json');
|
|
1044
|
+
if (!existsSync(prefs)) {
|
|
1045
|
+
signals.push(`${prefs} does not exist (1.x project never migrated)`);
|
|
1046
|
+
} else {
|
|
1047
|
+
try {
|
|
1048
|
+
const raw = JSON.parse(readFileSync(prefs, 'utf8'));
|
|
1049
|
+
if (raw.schema_version !== '2.0.0') {
|
|
1050
|
+
signals.push(`${prefs} has schema_version ${JSON.stringify(raw.schema_version)}, expected '2.0.0'`);
|
|
1051
|
+
}
|
|
1052
|
+
} catch {
|
|
1053
|
+
signals.push(`${prefs} exists but is not valid JSON`);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
return {
|
|
1059
|
+
isOneX: signals.length > 0,
|
|
1060
|
+
signals,
|
|
1061
|
+
projectRoot,
|
|
1062
|
+
configPath,
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
/**
|
|
1067
|
+
* Postinstall auto-upgrade — when the user just ran
|
|
1068
|
+
* `npm i -g peaks-cli@2.0` and `cwd` is a 1.x peaks-cli
|
|
1069
|
+
* project, this shells out to the installed `peaks`
|
|
1070
|
+
* binary to run the umbrella `peaks upgrade --to 2.0 --auto`.
|
|
1071
|
+
*
|
|
1072
|
+
* Per the "minimal-user-operation" tenet, the user should
|
|
1073
|
+
* never have to run a second command after `npm i -g`. The
|
|
1074
|
+
* upgrade CLI (if installed) is at the resolved `peaks`
|
|
1075
|
+
* binary path; if not, the user gets a hint to run it
|
|
1076
|
+
* manually.
|
|
1077
|
+
*
|
|
1078
|
+
* The auto-upgrade is opt-out via:
|
|
1079
|
+
* PEAKS_SKIP_AUTO_UPGRADE=1
|
|
1080
|
+
* (so a CI box that installs 2.0 but never wants the
|
|
1081
|
+
* project-level migration can suppress the auto-step).
|
|
1082
|
+
*/
|
|
1083
|
+
export async function autoUpgrade1xProjectIfPresent(options = {}) {
|
|
1084
|
+
if (process.env.PEAKS_SKIP_AUTO_UPGRADE === '1') {
|
|
1085
|
+
return { ran: false, reason: 'PEAKS_SKIP_AUTO_UPGRADE=1' };
|
|
1086
|
+
}
|
|
1087
|
+
const state = detect1xProjectState(options.cwd ?? process.cwd());
|
|
1088
|
+
if (!state.isOneX) {
|
|
1089
|
+
return { ran: false, reason: 'no 1.x project state detected' };
|
|
1090
|
+
}
|
|
1091
|
+
if (state.projectRoot === null) {
|
|
1092
|
+
return { ran: false, reason: 'cwd is not a peaks project (no .peaks/_runtime/)' };
|
|
1093
|
+
}
|
|
1094
|
+
// The peaks binary should be on PATH after `npm i -g`.
|
|
1095
|
+
// We shell out via spawnSync (synchronous; the postinstall
|
|
1096
|
+
// is already synchronous and the umbrella is fast).
|
|
1097
|
+
try {
|
|
1098
|
+
const result = spawnSync('peaks', ['upgrade', '--to', '2.0', '--auto', '--project', state.projectRoot], {
|
|
1099
|
+
encoding: 'utf8',
|
|
1100
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
1101
|
+
timeout: 120_000,
|
|
1102
|
+
});
|
|
1103
|
+
return {
|
|
1104
|
+
ran: true,
|
|
1105
|
+
reason: 'auto-upgrade dispatched',
|
|
1106
|
+
signals: state.signals,
|
|
1107
|
+
projectRoot: state.projectRoot,
|
|
1108
|
+
exitCode: result.status,
|
|
1109
|
+
stdout: result.stdout ?? '',
|
|
1110
|
+
stderr: result.stderr ?? '',
|
|
1111
|
+
};
|
|
1112
|
+
} catch (err) {
|
|
1113
|
+
return {
|
|
1114
|
+
ran: true,
|
|
1115
|
+
reason: 'auto-upgrade dispatched but failed',
|
|
1116
|
+
signals: state.signals,
|
|
1117
|
+
projectRoot: state.projectRoot,
|
|
1118
|
+
error: err instanceof Error ? err.message : String(err),
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
|
|
1124
|
+
try {
|
|
1125
|
+
// 2.0 fix for the 1.x Trae bug (per real user feedback
|
|
1126
|
+
// 2026-06-11): iterate ALL 8 platforms, not just the
|
|
1127
|
+
// auto-detected one. Per the "minimal-user-operation"
|
|
1128
|
+
// tenet, the user should never have to run a
|
|
1129
|
+
// per-platform install command.
|
|
1130
|
+
const perPlatform = installBundledSkillsForAllPlatforms();
|
|
1131
|
+
let totalInstalled = 0;
|
|
1132
|
+
for (const p of perPlatform) {
|
|
1133
|
+
totalInstalled += p.installed.length;
|
|
1134
|
+
}
|
|
1135
|
+
if (totalInstalled > 0) {
|
|
1136
|
+
process.stdout.write(
|
|
1137
|
+
`Peaks skills linked across ${perPlatform.length} platforms ` +
|
|
1138
|
+
`(${totalInstalled} total symlinks)\n`
|
|
1139
|
+
);
|
|
1140
|
+
}
|
|
1141
|
+
const outputStylesResult = installBundledOutputStyles();
|
|
1142
|
+
// Slice 7/7 — bundled agents (Claude Code sub-agent prompts) ship
|
|
1143
|
+
// under `agents/*.md` in the peaks-cli tarball and are auto-installed
|
|
1144
|
+
// to `~/.claude/agents/` on `npm i -g peaks-cli@latest`. Drift
|
|
1145
|
+
// detection is content-hash + `.peaks-managed` marker (mirrors the
|
|
1146
|
+
// output-styles contract).
|
|
1147
|
+
const agentsPerPlatform = installBundledAgentsForAllPlatforms();
|
|
1148
|
+
let totalAgentsInstalled = 0;
|
|
1149
|
+
for (const p of agentsPerPlatform) {
|
|
1150
|
+
totalAgentsInstalled += p.installed.length;
|
|
1151
|
+
}
|
|
1152
|
+
if (totalAgentsInstalled > 0) {
|
|
1153
|
+
process.stdout.write(
|
|
1154
|
+
`Peaks agents installed across ${agentsPerPlatform.length} platforms ` +
|
|
1155
|
+
`(${totalAgentsInstalled} total files)\n`
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1158
|
+
let userConfigResult = createConfigResult({ skipped: true });
|
|
1159
|
+
try {
|
|
1160
|
+
userConfigResult = installUserConfig();
|
|
1161
|
+
} catch (error) {
|
|
1162
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1163
|
+
process.stderr.write(`Peaks user config was not installed: ${message}\n`);
|
|
1164
|
+
}
|
|
1165
|
+
if (outputStylesResult.installed.length > 0) {
|
|
1166
|
+
process.stdout.write(`Peaks output styles installed: ${outputStylesResult.installed.join(', ')}\n`);
|
|
1167
|
+
}
|
|
1168
|
+
if (outputStylesResult.skipped.length > 0) {
|
|
1169
|
+
process.stderr.write(`Peaks output styles skipped because local files already exist: ${outputStylesResult.skipped.join(', ')}\n`);
|
|
1170
|
+
}
|
|
1171
|
+
if (userConfigResult.created) {
|
|
1172
|
+
process.stdout.write('Peaks user config created: ~/.peaks/config.json\n');
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
// 2.0 postinstall: auto-detect 1.x project state in cwd
|
|
1176
|
+
// and dispatch the upgrade umbrella. This makes the
|
|
1177
|
+
// user's `npm i -g peaks-cli@2.0` truly one-key.
|
|
1178
|
+
if (process.env.PEAKS_SKIP_AUTO_UPGRADE !== '1') {
|
|
1179
|
+
// Fire-and-forget; the upgrade is async by design so
|
|
1180
|
+
// the npm install output isn't blocked. We print a
|
|
1181
|
+
// one-line hint so the user knows the auto-step
|
|
1182
|
+
// happened.
|
|
1183
|
+
autoUpgrade1xProjectIfPresent().then((result) => {
|
|
1184
|
+
if (result.ran) {
|
|
1185
|
+
process.stdout.write(
|
|
1186
|
+
`\n✓ Detected 1.x peaks-cli project at ${result.projectRoot}\n` +
|
|
1187
|
+
` → auto-upgraded to 2.0 (${result.signals?.length ?? 0} signals resolved)\n` +
|
|
1188
|
+
` Run \`peaks audit red-lines --project .\` to verify.\n`
|
|
1189
|
+
);
|
|
1190
|
+
}
|
|
1191
|
+
// When !result.ran we say nothing — silent on success.
|
|
1192
|
+
});
|
|
1193
|
+
}
|
|
1194
|
+
if (userConfigResult.updated) {
|
|
1195
|
+
process.stdout.write('Peaks user config updated: ~/.peaks/config.json\n');
|
|
1196
|
+
}
|
|
1197
|
+
} catch (error) {
|
|
1198
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1199
|
+
process.stderr.write(`Peaks skills and output styles were not installed: ${message}\n`);
|
|
1200
|
+
process.exitCode = 1;
|
|
1201
|
+
}
|
|
1202
|
+
}
|