drt-method 1.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/AGENTS.md +45 -0
- package/GETTING-STARTED.md +269 -0
- package/README.md +233 -0
- package/drt-method-1.0.0.tgz +0 -0
- package/drt-modules.yaml +1 -0
- package/package.json +51 -0
- package/scripts/install-from-github.ps1 +22 -0
- package/scripts/install-from-github.sh +17 -0
- package/src/core-skills/drt-advanced-elicitation/SKILL.md +142 -0
- package/src/core-skills/drt-advanced-elicitation/methods.csv +72 -0
- package/src/core-skills/drt-brainstorming/SKILL.md +80 -0
- package/src/core-skills/drt-brainstorming/assets/brain-icons.json +166 -0
- package/src/core-skills/drt-brainstorming/assets/brain-methods.csv +109 -0
- package/src/core-skills/drt-brainstorming/assets/brain-selector.html +326 -0
- package/src/core-skills/drt-brainstorming/customize.toml +84 -0
- package/src/core-skills/drt-brainstorming/references/converge.md +24 -0
- package/src/core-skills/drt-brainstorming/references/finalize.md +26 -0
- package/src/core-skills/drt-brainstorming/references/headless.md +54 -0
- package/src/core-skills/drt-brainstorming/references/in-chat-techniques.md +18 -0
- package/src/core-skills/drt-brainstorming/references/mode-autonomous.md +10 -0
- package/src/core-skills/drt-brainstorming/references/mode-facilitator.md +11 -0
- package/src/core-skills/drt-brainstorming/references/mode-partner.md +16 -0
- package/src/core-skills/drt-brainstorming/references/resume.md +5 -0
- package/src/core-skills/drt-brainstorming/scripts/brain.py +740 -0
- package/src/core-skills/drt-customize/SKILL.md +111 -0
- package/src/core-skills/drt-customize/scripts/list_customizable_skills.py +231 -0
- package/src/core-skills/drt-editorial-review-prose/SKILL.md +86 -0
- package/src/core-skills/drt-editorial-review-structure/SKILL.md +179 -0
- package/src/core-skills/drt-forge-idea/SKILL.md +107 -0
- package/src/core-skills/drt-forge-idea/customize.toml +42 -0
- package/src/core-skills/drt-forge-idea/scripts/resolve_personas.py +270 -0
- package/src/core-skills/drt-help/SKILL.md +75 -0
- package/src/core-skills/drt-index-docs/SKILL.md +66 -0
- package/src/core-skills/drt-party-mode/SKILL.md +60 -0
- package/src/core-skills/drt-party-mode/customize.toml +211 -0
- package/src/core-skills/drt-party-mode/references/create-party.md +70 -0
- package/src/core-skills/drt-party-mode/references/mode-agent-team.md +13 -0
- package/src/core-skills/drt-party-mode/references/mode-auto.md +13 -0
- package/src/core-skills/drt-party-mode/references/mode-subagent.md +31 -0
- package/src/core-skills/drt-party-mode/references/party-memory.md +51 -0
- package/src/core-skills/drt-party-mode/scripts/resolve_party.py +272 -0
- package/src/core-skills/drt-review-adversarial-general/SKILL.md +37 -0
- package/src/core-skills/drt-review-edge-case-hunter/SKILL.md +73 -0
- package/src/core-skills/drt-review-edge-case-hunter/references/deletion-check.md +14 -0
- package/src/core-skills/drt-review-verification-gap/SKILL.md +106 -0
- package/src/core-skills/drt-shard-doc/SKILL.md +105 -0
- package/src/core-skills/drt-spec/SKILL.md +160 -0
- package/src/core-skills/drt-spec/assets/headless-schemas.md +33 -0
- package/src/core-skills/drt-spec/assets/spec-template.md +49 -0
- package/src/core-skills/drt-spec/assets/stories-schema.md +44 -0
- package/src/core-skills/drt-spec/customize.toml +53 -0
- package/src/core-skills/module-help.csv +14 -0
- package/src/core-skills/module.yaml +33 -0
- package/src/drt-skills/1-analysis/drt-agent-analyst/SKILL.md +76 -0
- package/src/drt-skills/1-analysis/drt-agent-analyst/customize.toml +90 -0
- package/src/drt-skills/1-analysis/drt-agent-tech-writer/SKILL.md +76 -0
- package/src/drt-skills/1-analysis/drt-agent-tech-writer/customize.toml +81 -0
- package/src/drt-skills/1-analysis/drt-agent-tech-writer/explain-concept.md +20 -0
- package/src/drt-skills/1-analysis/drt-agent-tech-writer/mermaid-gen.md +20 -0
- package/src/drt-skills/1-analysis/drt-agent-tech-writer/validate-doc.md +19 -0
- package/src/drt-skills/1-analysis/drt-agent-tech-writer/write-document.md +20 -0
- package/src/drt-skills/1-analysis/drt-document-project/SKILL.md +62 -0
- package/src/drt-skills/1-analysis/drt-document-project/checklist.md +245 -0
- package/src/drt-skills/1-analysis/drt-document-project/customize.toml +41 -0
- package/src/drt-skills/1-analysis/drt-document-project/documentation-requirements.csv +12 -0
- package/src/drt-skills/1-analysis/drt-document-project/instructions.md +128 -0
- package/src/drt-skills/1-analysis/drt-document-project/templates/deep-dive-template.md +345 -0
- package/src/drt-skills/1-analysis/drt-document-project/templates/index-template.md +169 -0
- package/src/drt-skills/1-analysis/drt-document-project/templates/project-overview-template.md +103 -0
- package/src/drt-skills/1-analysis/drt-document-project/templates/project-scan-report-schema.json +160 -0
- package/src/drt-skills/1-analysis/drt-document-project/templates/source-tree-template.md +135 -0
- package/src/drt-skills/1-analysis/drt-document-project/workflows/deep-dive-instructions.md +300 -0
- package/src/drt-skills/1-analysis/drt-document-project/workflows/deep-dive-workflow.md +34 -0
- package/src/drt-skills/1-analysis/drt-document-project/workflows/full-scan-instructions.md +1111 -0
- package/src/drt-skills/1-analysis/drt-document-project/workflows/full-scan-workflow.md +34 -0
- package/src/drt-skills/1-analysis/drt-prfaq/SKILL.md +135 -0
- package/src/drt-skills/1-analysis/drt-prfaq/agents/artifact-analyzer.md +60 -0
- package/src/drt-skills/1-analysis/drt-prfaq/agents/web-researcher.md +49 -0
- package/src/drt-skills/1-analysis/drt-prfaq/assets/prfaq-template.md +62 -0
- package/src/drt-skills/1-analysis/drt-prfaq/bmad-manifest.json +16 -0
- package/src/drt-skills/1-analysis/drt-prfaq/customize.toml +41 -0
- package/src/drt-skills/1-analysis/drt-prfaq/references/customer-faq.md +55 -0
- package/src/drt-skills/1-analysis/drt-prfaq/references/internal-faq.md +51 -0
- package/src/drt-skills/1-analysis/drt-prfaq/references/press-release.md +60 -0
- package/src/drt-skills/1-analysis/drt-prfaq/references/verdict.md +83 -0
- package/src/drt-skills/1-analysis/drt-product-brief/SKILL.md +91 -0
- package/src/drt-skills/1-analysis/drt-product-brief/assets/brief-template.md +41 -0
- package/src/drt-skills/1-analysis/drt-product-brief/customize.toml +99 -0
- package/src/drt-skills/1-analysis/research/drt-domain-research/SKILL.md +96 -0
- package/src/drt-skills/1-analysis/research/drt-domain-research/customize.toml +41 -0
- package/src/drt-skills/1-analysis/research/drt-domain-research/domain-steps/step-01-init.md +137 -0
- package/src/drt-skills/1-analysis/research/drt-domain-research/domain-steps/step-02-domain-analysis.md +229 -0
- package/src/drt-skills/1-analysis/research/drt-domain-research/domain-steps/step-03-competitive-landscape.md +238 -0
- package/src/drt-skills/1-analysis/research/drt-domain-research/domain-steps/step-04-regulatory-focus.md +206 -0
- package/src/drt-skills/1-analysis/research/drt-domain-research/domain-steps/step-05-technical-trends.md +234 -0
- package/src/drt-skills/1-analysis/research/drt-domain-research/domain-steps/step-06-research-synthesis.md +450 -0
- package/src/drt-skills/1-analysis/research/drt-domain-research/research.template.md +29 -0
- package/src/drt-skills/1-analysis/research/drt-market-research/SKILL.md +96 -0
- package/src/drt-skills/1-analysis/research/drt-market-research/customize.toml +41 -0
- package/src/drt-skills/1-analysis/research/drt-market-research/research.template.md +29 -0
- package/src/drt-skills/1-analysis/research/drt-market-research/steps/step-01-init.md +184 -0
- package/src/drt-skills/1-analysis/research/drt-market-research/steps/step-02-customer-behavior.md +239 -0
- package/src/drt-skills/1-analysis/research/drt-market-research/steps/step-03-customer-pain-points.md +251 -0
- package/src/drt-skills/1-analysis/research/drt-market-research/steps/step-04-customer-decisions.md +261 -0
- package/src/drt-skills/1-analysis/research/drt-market-research/steps/step-05-competitive-analysis.md +173 -0
- package/src/drt-skills/1-analysis/research/drt-market-research/steps/step-06-research-completion.md +484 -0
- package/src/drt-skills/1-analysis/research/drt-technical-research/SKILL.md +96 -0
- package/src/drt-skills/1-analysis/research/drt-technical-research/customize.toml +41 -0
- package/src/drt-skills/1-analysis/research/drt-technical-research/research.template.md +29 -0
- package/src/drt-skills/1-analysis/research/drt-technical-research/technical-steps/step-01-init.md +137 -0
- package/src/drt-skills/1-analysis/research/drt-technical-research/technical-steps/step-02-technical-overview.md +239 -0
- package/src/drt-skills/1-analysis/research/drt-technical-research/technical-steps/step-03-integration-patterns.md +248 -0
- package/src/drt-skills/1-analysis/research/drt-technical-research/technical-steps/step-04-architectural-patterns.md +202 -0
- package/src/drt-skills/1-analysis/research/drt-technical-research/technical-steps/step-05-implementation-research.md +233 -0
- package/src/drt-skills/1-analysis/research/drt-technical-research/technical-steps/step-06-research-synthesis.md +493 -0
- package/src/drt-skills/2-plan-workflows/drt-agent-pm/SKILL.md +76 -0
- package/src/drt-skills/2-plan-workflows/drt-agent-pm/customize.toml +75 -0
- package/src/drt-skills/2-plan-workflows/drt-agent-ux-designer/SKILL.md +76 -0
- package/src/drt-skills/2-plan-workflows/drt-agent-ux-designer/customize.toml +60 -0
- package/src/drt-skills/2-plan-workflows/drt-create-prd/SKILL.md +30 -0
- package/src/drt-skills/2-plan-workflows/drt-create-prd/customize.toml +41 -0
- package/src/drt-skills/2-plan-workflows/drt-edit-prd/SKILL.md +30 -0
- package/src/drt-skills/2-plan-workflows/drt-edit-prd/customize.toml +42 -0
- package/src/drt-skills/2-plan-workflows/drt-prd/SKILL.md +92 -0
- package/src/drt-skills/2-plan-workflows/drt-prd/assets/headless-schemas.md +76 -0
- package/src/drt-skills/2-plan-workflows/drt-prd/assets/prd-template.md +165 -0
- package/src/drt-skills/2-plan-workflows/drt-prd/assets/prd-validation-checklist.md +135 -0
- package/src/drt-skills/2-plan-workflows/drt-prd/assets/validation-report-template.html +325 -0
- package/src/drt-skills/2-plan-workflows/drt-prd/customize.toml +147 -0
- package/src/drt-skills/2-plan-workflows/drt-prd/references/headless.md +39 -0
- package/src/drt-skills/2-plan-workflows/drt-prd/references/validate.md +97 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/SKILL.md +90 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/color-themes.md +9 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/design-directions.md +9 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/design-example-editorial.md +158 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/design-example-mobile.md +93 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/design-example-shadcn.md +109 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/excalidraw-wireframe.md +19 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/experience-example-mobile.md +112 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/experience-example-shadcn.md +133 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/headless-schemas.md +84 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/key-screens.md +29 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/assets/validation-report-template.html +319 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/customize.toml +100 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/references/creative-tools.md +19 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/references/design-md-spec.md +50 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/references/headless.md +37 -0
- package/src/drt-skills/2-plan-workflows/drt-ux/references/validate.md +115 -0
- package/src/drt-skills/2-plan-workflows/drt-validate-prd/SKILL.md +30 -0
- package/src/drt-skills/2-plan-workflows/drt-validate-prd/customize.toml +42 -0
- package/src/drt-skills/3-solutioning/drt-agent-architect/SKILL.md +76 -0
- package/src/drt-skills/3-solutioning/drt-agent-architect/customize.toml +65 -0
- package/src/drt-skills/3-solutioning/drt-architecture/SKILL.md +85 -0
- package/src/drt-skills/3-solutioning/drt-architecture/assets/spine-template.md +79 -0
- package/src/drt-skills/3-solutioning/drt-architecture/customize.toml +100 -0
- package/src/drt-skills/3-solutioning/drt-architecture/references/headless.md +26 -0
- package/src/drt-skills/3-solutioning/drt-architecture/references/reviewer-gate.md +13 -0
- package/src/drt-skills/3-solutioning/drt-architecture/scripts/lint_spine.py +257 -0
- package/src/drt-skills/3-solutioning/drt-check-implementation-readiness/SKILL.md +91 -0
- package/src/drt-skills/3-solutioning/drt-check-implementation-readiness/customize.toml +41 -0
- package/src/drt-skills/3-solutioning/drt-check-implementation-readiness/steps/step-01-document-discovery.md +179 -0
- package/src/drt-skills/3-solutioning/drt-check-implementation-readiness/steps/step-02-prd-analysis.md +168 -0
- package/src/drt-skills/3-solutioning/drt-check-implementation-readiness/steps/step-03-epic-coverage-validation.md +169 -0
- package/src/drt-skills/3-solutioning/drt-check-implementation-readiness/steps/step-04-ux-alignment.md +129 -0
- package/src/drt-skills/3-solutioning/drt-check-implementation-readiness/steps/step-05-epic-quality-review.md +241 -0
- package/src/drt-skills/3-solutioning/drt-check-implementation-readiness/steps/step-06-final-assessment.md +132 -0
- package/src/drt-skills/3-solutioning/drt-check-implementation-readiness/templates/readiness-report-template.md +4 -0
- package/src/drt-skills/3-solutioning/drt-create-architecture/SKILL.md +30 -0
- package/src/drt-skills/3-solutioning/drt-create-architecture/customize.toml +41 -0
- package/src/drt-skills/3-solutioning/drt-create-epics-and-stories/SKILL.md +93 -0
- package/src/drt-skills/3-solutioning/drt-create-epics-and-stories/customize.toml +41 -0
- package/src/drt-skills/3-solutioning/drt-create-epics-and-stories/steps/step-01-validate-prerequisites.md +263 -0
- package/src/drt-skills/3-solutioning/drt-create-epics-and-stories/steps/step-02-design-epics.md +242 -0
- package/src/drt-skills/3-solutioning/drt-create-epics-and-stories/steps/step-03-create-stories.md +255 -0
- package/src/drt-skills/3-solutioning/drt-create-epics-and-stories/steps/step-04-final-validation.md +143 -0
- package/src/drt-skills/3-solutioning/drt-create-epics-and-stories/templates/epics-template.md +61 -0
- package/src/drt-skills/3-solutioning/drt-generate-project-context/SKILL.md +81 -0
- package/src/drt-skills/3-solutioning/drt-generate-project-context/customize.toml +41 -0
- package/src/drt-skills/3-solutioning/drt-generate-project-context/project-context-template.md +21 -0
- package/src/drt-skills/3-solutioning/drt-generate-project-context/steps/step-01-discover.md +186 -0
- package/src/drt-skills/3-solutioning/drt-generate-project-context/steps/step-02-generate.md +321 -0
- package/src/drt-skills/3-solutioning/drt-generate-project-context/steps/step-03-complete.md +284 -0
- package/src/drt-skills/4-implementation/drt-agent-dev/SKILL.md +76 -0
- package/src/drt-skills/4-implementation/drt-agent-dev/customize.toml +95 -0
- package/src/drt-skills/4-implementation/drt-checkpoint-preview/SKILL.md +68 -0
- package/src/drt-skills/4-implementation/drt-checkpoint-preview/customize.toml +41 -0
- package/src/drt-skills/4-implementation/drt-checkpoint-preview/generate-trail.md +38 -0
- package/src/drt-skills/4-implementation/drt-checkpoint-preview/step-01-orientation.md +105 -0
- package/src/drt-skills/4-implementation/drt-checkpoint-preview/step-02-walkthrough.md +89 -0
- package/src/drt-skills/4-implementation/drt-checkpoint-preview/step-03-detail-pass.md +106 -0
- package/src/drt-skills/4-implementation/drt-checkpoint-preview/step-04-testing.md +74 -0
- package/src/drt-skills/4-implementation/drt-checkpoint-preview/step-05-wrapup.md +30 -0
- package/src/drt-skills/4-implementation/drt-code-review/SKILL.md +90 -0
- package/src/drt-skills/4-implementation/drt-code-review/customize.toml +93 -0
- package/src/drt-skills/4-implementation/drt-code-review/steps/step-01-gather-context.md +84 -0
- package/src/drt-skills/4-implementation/drt-code-review/steps/step-02-review.md +32 -0
- package/src/drt-skills/4-implementation/drt-code-review/steps/step-03-triage.md +50 -0
- package/src/drt-skills/4-implementation/drt-code-review/steps/step-04-present.md +132 -0
- package/src/drt-skills/4-implementation/drt-correct-course/SKILL.md +301 -0
- package/src/drt-skills/4-implementation/drt-correct-course/checklist.md +288 -0
- package/src/drt-skills/4-implementation/drt-correct-course/customize.toml +41 -0
- package/src/drt-skills/4-implementation/drt-create-story/SKILL.md +432 -0
- package/src/drt-skills/4-implementation/drt-create-story/checklist.md +357 -0
- package/src/drt-skills/4-implementation/drt-create-story/customize.toml +41 -0
- package/src/drt-skills/4-implementation/drt-create-story/discover-inputs.md +88 -0
- package/src/drt-skills/4-implementation/drt-create-story/template.md +49 -0
- package/src/drt-skills/4-implementation/drt-dev-auto/SKILL.md +123 -0
- package/src/drt-skills/4-implementation/drt-dev-auto/compile-epic-context.md +62 -0
- package/src/drt-skills/4-implementation/drt-dev-auto/customize.toml +108 -0
- package/src/drt-skills/4-implementation/drt-dev-auto/spec-template.md +98 -0
- package/src/drt-skills/4-implementation/drt-dev-auto/step-01-clarify-and-route.md +84 -0
- package/src/drt-skills/4-implementation/drt-dev-auto/step-02-plan.md +31 -0
- package/src/drt-skills/4-implementation/drt-dev-auto/step-03-implement.md +42 -0
- package/src/drt-skills/4-implementation/drt-dev-auto/step-04-review.md +95 -0
- package/src/drt-skills/4-implementation/drt-dev-story/SKILL.md +500 -0
- package/src/drt-skills/4-implementation/drt-dev-story/checklist.md +80 -0
- package/src/drt-skills/4-implementation/drt-dev-story/customize.toml +41 -0
- package/src/drt-skills/4-implementation/drt-implement-task/SKILL.md +101 -0
- package/src/drt-skills/4-implementation/drt-implement-task/assets/task-spec-template.md +60 -0
- package/src/drt-skills/4-implementation/drt-implement-task/customize.toml +17 -0
- package/src/drt-skills/4-implementation/drt-implement-task/steps/step-01-gather-intent.md +42 -0
- package/src/drt-skills/4-implementation/drt-implement-task/steps/step-02-plan-and-approve.md +43 -0
- package/src/drt-skills/4-implementation/drt-implement-task/steps/step-03-confirm-dependencies.md +38 -0
- package/src/drt-skills/4-implementation/drt-implement-task/steps/step-04-implement.md +42 -0
- package/src/drt-skills/4-implementation/drt-implement-task/steps/step-05-qc-test.md +31 -0
- package/src/drt-skills/4-implementation/drt-implement-task/steps/step-06-quality-review.md +30 -0
- package/src/drt-skills/4-implementation/drt-implement-task/steps/step-07-fix-findings.md +33 -0
- package/src/drt-skills/4-implementation/drt-implement-task/steps/step-08-complete.md +35 -0
- package/src/drt-skills/4-implementation/drt-qa-generate-e2e-tests/SKILL.md +176 -0
- package/src/drt-skills/4-implementation/drt-qa-generate-e2e-tests/checklist.md +33 -0
- package/src/drt-skills/4-implementation/drt-qa-generate-e2e-tests/customize.toml +41 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/SKILL.md +13 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/compile-epic-context.md +62 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/customize.toml +83 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/render.js +206 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/spec-template.md +89 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/step-01-clarify-and-route.md +103 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/step-02-plan.md +47 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/step-03-implement.md +45 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/step-04-review.md +55 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/step-05-present.md +78 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/step-oneshot.md +78 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/sync-sprint-status.md +19 -0
- package/src/drt-skills/4-implementation/drt-quick-dev/workflow.md +85 -0
- package/src/drt-skills/4-implementation/drt-retrospective/SKILL.md +1527 -0
- package/src/drt-skills/4-implementation/drt-retrospective/customize.toml +41 -0
- package/src/drt-skills/4-implementation/drt-sprint-planning/SKILL.md +319 -0
- package/src/drt-skills/4-implementation/drt-sprint-planning/checklist.md +34 -0
- package/src/drt-skills/4-implementation/drt-sprint-planning/customize.toml +41 -0
- package/src/drt-skills/4-implementation/drt-sprint-planning/sprint-status-template.yaml +69 -0
- package/src/drt-skills/4-implementation/drt-sprint-status/SKILL.md +311 -0
- package/src/drt-skills/4-implementation/drt-sprint-status/customize.toml +41 -0
- package/src/drt-skills/module-help.csv +32 -0
- package/src/drt-skills/module.yaml +95 -0
- package/src/scripts/lib/load-toml.js +43 -0
- package/src/scripts/lib/merge-utils.js +89 -0
- package/src/scripts/memlog.js +184 -0
- package/src/scripts/package.json +7 -0
- package/src/scripts/resolve-config.js +56 -0
- package/src/scripts/resolve-customization.js +77 -0
- package/tools/installer/cli-utils.js +53 -0
- package/tools/installer/commands/install.js +149 -0
- package/tools/installer/commands/status.js +65 -0
- package/tools/installer/commands/uninstall.js +167 -0
- package/tools/installer/core/config.js +73 -0
- package/tools/installer/core/existing-install.js +121 -0
- package/tools/installer/core/install-paths.js +132 -0
- package/tools/installer/core/installer.js +1762 -0
- package/tools/installer/core/legacy-warnings.js +151 -0
- package/tools/installer/core/manifest-generator.js +859 -0
- package/tools/installer/core/manifest.js +433 -0
- package/tools/installer/core/uv-check.js +97 -0
- package/tools/installer/core/wsl-node-check.js +109 -0
- package/tools/installer/drt-cli.js +104 -0
- package/tools/installer/file-ops.js +204 -0
- package/tools/installer/fs-native.js +116 -0
- package/tools/installer/ide/_config-driven.js +972 -0
- package/tools/installer/ide/manager.js +324 -0
- package/tools/installer/ide/platform-codes.js +80 -0
- package/tools/installer/ide/platform-codes.yaml +343 -0
- package/tools/installer/ide/shared/installed-skills.js +50 -0
- package/tools/installer/ide/shared/path-utils.js +217 -0
- package/tools/installer/ide/shared/skill-manifest.js +57 -0
- package/tools/installer/install-messages.yaml +29 -0
- package/tools/installer/list-options.js +210 -0
- package/tools/installer/message-loader.js +83 -0
- package/tools/installer/modules/channel-plan.js +203 -0
- package/tools/installer/modules/channel-resolver.js +241 -0
- package/tools/installer/modules/custom-module-manager.js +918 -0
- package/tools/installer/modules/external-manager.js +667 -0
- package/tools/installer/modules/module-help-schema.js +13 -0
- package/tools/installer/modules/official-modules.js +2257 -0
- package/tools/installer/modules/plugin-resolver.js +398 -0
- package/tools/installer/modules/version-resolver.js +336 -0
- package/tools/installer/project-root.js +224 -0
- package/tools/installer/prompts.js +852 -0
- package/tools/installer/set-overrides.js +330 -0
- package/tools/installer/ui.js +2090 -0
- package/tools/installer/yaml-format.js +245 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
const path = require('node:path');
|
|
2
|
+
const fs = require('./fs-native');
|
|
3
|
+
const yaml = require('yaml');
|
|
4
|
+
const { getProjectRoot, getModulePath, getExternalModuleCachePath } = require('./project-root');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Read a module.yaml and return its declared `code:` field, or null if missing/unparseable.
|
|
8
|
+
*/
|
|
9
|
+
async function readModuleCode(yamlPath) {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = yaml.parse(await fs.readFile(yamlPath, 'utf8'));
|
|
12
|
+
if (parsed && typeof parsed === 'object' && typeof parsed.code === 'string') {
|
|
13
|
+
return parsed.code;
|
|
14
|
+
}
|
|
15
|
+
} catch {
|
|
16
|
+
// fall through
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Discover module.yaml files for officials we can read locally:
|
|
23
|
+
* - core, bmm: bundled in src/ (always present)
|
|
24
|
+
* - external officials: only if previously cloned to ~/.drt/cache/external-modules/
|
|
25
|
+
*
|
|
26
|
+
* Each result's `code` is the `code:` field from the module.yaml when present;
|
|
27
|
+
* that's the value `--set <module>.<key>=<value>` matches against.
|
|
28
|
+
*
|
|
29
|
+
* Community/custom modules are not enumerated; users reference their own
|
|
30
|
+
* module.yaml directly per the design (see issue #1663).
|
|
31
|
+
*
|
|
32
|
+
* @returns {Promise<Array<{code: string, yamlPath: string, source: string}>>}
|
|
33
|
+
*/
|
|
34
|
+
async function discoverOfficialModuleYamls() {
|
|
35
|
+
const found = [];
|
|
36
|
+
// Dedupe is case-insensitive because module caches occasionally retain a
|
|
37
|
+
// legacy UPPERCASE-named directory alongside the canonical lowercase one
|
|
38
|
+
// (same module, different cache key from an older schema). We pick whichever
|
|
39
|
+
// entry we see first and skip the alternate-case duplicate. NOTE: `--set`
|
|
40
|
+
// matching itself is case-sensitive (it keys on `moduleName` from the install
|
|
41
|
+
// flow's selected list, which is always lowercase short codes), so the
|
|
42
|
+
// surfaced `code` here is what users should type. Don't change to
|
|
43
|
+
// case-sensitive dedupe without revisiting that contract.
|
|
44
|
+
const seenCodes = new Set();
|
|
45
|
+
|
|
46
|
+
const addFound = async (yamlPath, source, fallbackCode) => {
|
|
47
|
+
const declaredCode = await readModuleCode(yamlPath);
|
|
48
|
+
const code = declaredCode || fallbackCode;
|
|
49
|
+
if (!code) return;
|
|
50
|
+
const lower = code.toLowerCase();
|
|
51
|
+
if (seenCodes.has(lower)) return;
|
|
52
|
+
seenCodes.add(lower);
|
|
53
|
+
found.push({ code, yamlPath, source });
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Built-ins.
|
|
57
|
+
for (const code of ['core', 'drt']) {
|
|
58
|
+
const yamlPath = path.join(getModulePath(code), 'module.yaml');
|
|
59
|
+
if (await fs.pathExists(yamlPath)) {
|
|
60
|
+
// Built-ins use their well-known short codes regardless of what the
|
|
61
|
+
// module.yaml `code:` says, since the install flow keys on these.
|
|
62
|
+
seenCodes.add(code.toLowerCase());
|
|
63
|
+
found.push({ code, yamlPath, source: 'built-in' });
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Bundled in src/modules/<code>/module.yaml (rare, but supported by getModulePath).
|
|
68
|
+
const srcModulesDir = path.join(getProjectRoot(), 'src', 'modules');
|
|
69
|
+
if (await fs.pathExists(srcModulesDir)) {
|
|
70
|
+
const entries = await fs.readdir(srcModulesDir, { withFileTypes: true });
|
|
71
|
+
for (const entry of entries) {
|
|
72
|
+
if (!entry.isDirectory()) continue;
|
|
73
|
+
const yamlPath = path.join(srcModulesDir, entry.name, 'module.yaml');
|
|
74
|
+
if (await fs.pathExists(yamlPath)) {
|
|
75
|
+
await addFound(yamlPath, 'bundled', entry.name);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// External cache (~/.drt/cache/external-modules/<code>/...).
|
|
81
|
+
const cacheRoot = getExternalModuleCachePath('').replace(/\/$/, '');
|
|
82
|
+
if (await fs.pathExists(cacheRoot)) {
|
|
83
|
+
const rawEntries = await fs.readdir(cacheRoot, { withFileTypes: true });
|
|
84
|
+
for (const entry of rawEntries) {
|
|
85
|
+
if (!entry.isDirectory()) continue;
|
|
86
|
+
const candidates = [
|
|
87
|
+
path.join(cacheRoot, entry.name, 'module.yaml'),
|
|
88
|
+
path.join(cacheRoot, entry.name, 'src', 'module.yaml'),
|
|
89
|
+
path.join(cacheRoot, entry.name, 'skills', 'module.yaml'),
|
|
90
|
+
];
|
|
91
|
+
for (const candidate of candidates) {
|
|
92
|
+
if (await fs.pathExists(candidate)) {
|
|
93
|
+
await addFound(candidate, 'cached', entry.name);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return found;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function formatPromptText(item) {
|
|
104
|
+
if (Array.isArray(item.prompt)) return item.prompt.join(' ');
|
|
105
|
+
return String(item.prompt || '').trim();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function inferType(item) {
|
|
109
|
+
if (item['single-select']) return 'single-select';
|
|
110
|
+
if (item['multi-select']) return 'multi-select';
|
|
111
|
+
if (typeof item.default === 'boolean') return 'boolean';
|
|
112
|
+
if (typeof item.default === 'number') return 'number';
|
|
113
|
+
return 'string';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function formatModuleOptions(code, parsed, source) {
|
|
117
|
+
const lines = [];
|
|
118
|
+
const header = source === 'built-in' ? code : `${code} (${source})`;
|
|
119
|
+
lines.push(header + ':');
|
|
120
|
+
|
|
121
|
+
let count = 0;
|
|
122
|
+
for (const [key, item] of Object.entries(parsed)) {
|
|
123
|
+
if (!item || typeof item !== 'object' || !('prompt' in item)) continue;
|
|
124
|
+
count++;
|
|
125
|
+
const type = inferType(item);
|
|
126
|
+
const scope = item.scope === 'user' ? ' [user-scope]' : '';
|
|
127
|
+
const defaultStr = item.default === undefined || item.default === null ? '(none)' : String(item.default);
|
|
128
|
+
lines.push(` ${code}.${key} (${type}${scope}) default: ${defaultStr}`);
|
|
129
|
+
const promptText = formatPromptText(item);
|
|
130
|
+
if (promptText) lines.push(` ${promptText}`);
|
|
131
|
+
if (Array.isArray(item['single-select'])) {
|
|
132
|
+
const values = item['single-select'].map((v) => (typeof v === 'object' ? v.value : v)).filter((v) => v !== undefined);
|
|
133
|
+
if (values.length > 0) lines.push(` values: ${values.join(' | ')}`);
|
|
134
|
+
}
|
|
135
|
+
lines.push('');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (count === 0) {
|
|
139
|
+
lines.push(' (no configurable options)', '');
|
|
140
|
+
}
|
|
141
|
+
return lines.join('\n');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Render `--list-options` output.
|
|
146
|
+
*
|
|
147
|
+
* Returns `{ text, ok }` so callers can surface a non-zero exit code on
|
|
148
|
+
* a typo'd module-code lookup. Discovery dedupes case-insensitively, so
|
|
149
|
+
* the lookup is also case-insensitive — typing `--list-options BMM` and
|
|
150
|
+
* `--list-options bmm` both find the bmm built-in.
|
|
151
|
+
*
|
|
152
|
+
* @param {string|null} moduleCode - if non-null, restrict to this module
|
|
153
|
+
* @returns {Promise<{text: string, ok: boolean}>}
|
|
154
|
+
*/
|
|
155
|
+
async function formatOptionsList(moduleCode) {
|
|
156
|
+
const discovered = await discoverOfficialModuleYamls();
|
|
157
|
+
const needle = moduleCode ? moduleCode.toLowerCase() : null;
|
|
158
|
+
const filtered = needle ? discovered.filter((d) => d.code.toLowerCase() === needle) : discovered;
|
|
159
|
+
|
|
160
|
+
if (filtered.length === 0) {
|
|
161
|
+
if (moduleCode) {
|
|
162
|
+
const text = [
|
|
163
|
+
`No locally-known module.yaml for '${moduleCode}'.`,
|
|
164
|
+
'',
|
|
165
|
+
'Built-in modules (core, bmm) are always available. External officials',
|
|
166
|
+
'appear here after they have been installed at least once on this machine',
|
|
167
|
+
'(they are cached under ~/.drt/cache/external-modules/).',
|
|
168
|
+
'',
|
|
169
|
+
'For community or custom modules, read the module.yaml file in that',
|
|
170
|
+
"module's source repository directly.",
|
|
171
|
+
].join('\n');
|
|
172
|
+
return { text, ok: false };
|
|
173
|
+
}
|
|
174
|
+
return { text: 'No modules found.', ok: false };
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const sections = [];
|
|
178
|
+
// Track when a module-scoped lookup couldn't actually be rendered (yaml
|
|
179
|
+
// unparseable or empty after parse). The full `--list-options` output is
|
|
180
|
+
// tolerant of one bad entry, but `--list-options <module>` against a single
|
|
181
|
+
// unreadable module should still fail tooling so a CI script catches it.
|
|
182
|
+
let moduleScopedFailure = false;
|
|
183
|
+
sections.push('Available --set keys', 'Format: --set <module>.<key>=<value> (repeatable)', '');
|
|
184
|
+
for (const { code, yamlPath, source } of filtered) {
|
|
185
|
+
let parsed;
|
|
186
|
+
try {
|
|
187
|
+
parsed = yaml.parse(await fs.readFile(yamlPath, 'utf8'));
|
|
188
|
+
} catch {
|
|
189
|
+
sections.push(`${code} (${source}): could not parse module.yaml`, '');
|
|
190
|
+
if (moduleCode) moduleScopedFailure = true;
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
194
|
+
sections.push(`${code} (${source}): module.yaml is not a valid object (got ${Array.isArray(parsed) ? 'array' : typeof parsed})`, '');
|
|
195
|
+
if (moduleCode) moduleScopedFailure = true;
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
sections.push(formatModuleOptions(code, parsed, source));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (!moduleCode) {
|
|
202
|
+
sections.push(
|
|
203
|
+
'Community and custom modules are not listed here — read their module.yaml directly. Unknown keys still persist with a warning.',
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return { text: sections.join('\n'), ok: !moduleScopedFailure };
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
module.exports = { formatOptionsList, discoverOfficialModuleYamls };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const fs = require('./fs-native');
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
const yaml = require('yaml');
|
|
4
|
+
const prompts = require('./prompts');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Load and display installer messages from messages.yaml
|
|
8
|
+
*/
|
|
9
|
+
class MessageLoader {
|
|
10
|
+
constructor() {}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Load messages from the YAML file
|
|
14
|
+
* @returns {Object|null} Messages object or null if not found
|
|
15
|
+
*/
|
|
16
|
+
load() {
|
|
17
|
+
if (this.messages) {
|
|
18
|
+
return this.messages;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const messagesPath = path.join(__dirname, 'install-messages.yaml');
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const content = fs.readFileSync(messagesPath, 'utf8');
|
|
25
|
+
this.messages = yaml.parse(content);
|
|
26
|
+
return this.messages;
|
|
27
|
+
} catch {
|
|
28
|
+
// File doesn't exist or is invalid - return null
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get the start message for display
|
|
35
|
+
* @returns {string|null} Start message or null
|
|
36
|
+
*/
|
|
37
|
+
getStartMessage() {
|
|
38
|
+
const messages = this.load();
|
|
39
|
+
return messages?.startMessage || null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get the end message for display
|
|
44
|
+
* @returns {string|null} End message or null
|
|
45
|
+
*/
|
|
46
|
+
getEndMessage() {
|
|
47
|
+
const messages = this.load();
|
|
48
|
+
return messages?.endMessage || null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Display the start message (after logo, before prompts)
|
|
53
|
+
*/
|
|
54
|
+
async displayStartMessage() {
|
|
55
|
+
const message = this.getStartMessage();
|
|
56
|
+
if (message) {
|
|
57
|
+
await prompts.log.info(message);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Display the end message (after installation completes)
|
|
63
|
+
*/
|
|
64
|
+
async displayEndMessage() {
|
|
65
|
+
const message = this.getEndMessage();
|
|
66
|
+
if (message) {
|
|
67
|
+
await prompts.log.info(message);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Check if messages exist for the current version
|
|
73
|
+
* @param {string} currentVersion - Current package version
|
|
74
|
+
* @returns {boolean} True if messages match current version
|
|
75
|
+
*/
|
|
76
|
+
isCurrent(currentVersion) {
|
|
77
|
+
const messages = this.load();
|
|
78
|
+
return messages && messages.version === currentVersion;
|
|
79
|
+
}
|
|
80
|
+
messages = null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
module.exports = { MessageLoader };
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel plan: the per-module resolution decision applied at install time.
|
|
3
|
+
*
|
|
4
|
+
* A "plan entry" for a module is:
|
|
5
|
+
* { channel: 'stable'|'next'|'pinned', pin?: string }
|
|
6
|
+
*
|
|
7
|
+
* We build the plan from:
|
|
8
|
+
* 1. CLI flags (--channel / --all-* / --next=CODE / --pin CODE=TAG)
|
|
9
|
+
* 2. Interactive answers (the "all stable?" gate + per-module picker)
|
|
10
|
+
* 3. Registry defaults (default_channel from drt-modules.yaml)
|
|
11
|
+
* 4. Hardcoded fallback 'stable'
|
|
12
|
+
*
|
|
13
|
+
* Precedence: --pin > --next=CODE > --channel (global) > registry default > 'stable'.
|
|
14
|
+
*
|
|
15
|
+
* This module is pure. No prompts, no git, no filesystem.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const VALID_CHANNELS = new Set(['stable', 'next']);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Parse raw commander options into a structured channel options object.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} options - raw command-line options
|
|
24
|
+
* @returns {{
|
|
25
|
+
* global: 'stable'|'next'|null,
|
|
26
|
+
* nextSet: Set<string>,
|
|
27
|
+
* pins: Map<string, string>,
|
|
28
|
+
* warnings: string[]
|
|
29
|
+
* }}
|
|
30
|
+
*/
|
|
31
|
+
function parseChannelOptions(options = {}) {
|
|
32
|
+
const warnings = [];
|
|
33
|
+
|
|
34
|
+
// Global channel from --channel / --all-stable / --all-next.
|
|
35
|
+
let global = null;
|
|
36
|
+
const aliases = [];
|
|
37
|
+
if (options.channel) aliases.push({ flag: '--channel', value: normalizeChannel(options.channel, warnings, '--channel') });
|
|
38
|
+
if (options.allStable) aliases.push({ flag: '--all-stable', value: 'stable' });
|
|
39
|
+
if (options.allNext) aliases.push({ flag: '--all-next', value: 'next' });
|
|
40
|
+
|
|
41
|
+
const distinct = new Set(aliases.map((a) => a.value).filter(Boolean));
|
|
42
|
+
if (distinct.size > 1) {
|
|
43
|
+
warnings.push(
|
|
44
|
+
`Conflicting channel flags: ${aliases
|
|
45
|
+
.filter((a) => a.value)
|
|
46
|
+
.map((a) => a.flag + '=' + a.value)
|
|
47
|
+
.join(', ')}. Using first: ${aliases.find((a) => a.value).flag}.`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
const firstValid = aliases.find((a) => a.value);
|
|
51
|
+
if (firstValid) global = firstValid.value;
|
|
52
|
+
|
|
53
|
+
// --next=CODE (repeatable)
|
|
54
|
+
const nextSet = new Set();
|
|
55
|
+
for (const code of options.next || []) {
|
|
56
|
+
const trimmed = String(code).trim();
|
|
57
|
+
if (!trimmed) continue;
|
|
58
|
+
nextSet.add(trimmed);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// --pin CODE=TAG (repeatable)
|
|
62
|
+
const pins = new Map();
|
|
63
|
+
for (const spec of options.pin || []) {
|
|
64
|
+
const parsed = parsePinSpec(spec);
|
|
65
|
+
if (!parsed) {
|
|
66
|
+
warnings.push(`Ignoring malformed --pin value '${spec}'. Expected CODE=TAG.`);
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (pins.has(parsed.code)) {
|
|
70
|
+
warnings.push(`--pin specified multiple times for '${parsed.code}'. Using last: ${parsed.tag}.`);
|
|
71
|
+
}
|
|
72
|
+
pins.set(parsed.code, parsed.tag);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// --yes auto-confirms the community-module curator-bypass prompt so
|
|
76
|
+
// headless installs with --next=/--pin for a community module don't hang.
|
|
77
|
+
const acceptBypass = options.yes === true || options.acceptBypass === true;
|
|
78
|
+
|
|
79
|
+
return { global, nextSet, pins, warnings, acceptBypass };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function normalizeChannel(raw, warnings, flagName) {
|
|
83
|
+
if (typeof raw !== 'string') return null;
|
|
84
|
+
const lower = raw.trim().toLowerCase();
|
|
85
|
+
if (VALID_CHANNELS.has(lower)) return lower;
|
|
86
|
+
warnings.push(`Ignoring invalid ${flagName} value '${raw}'. Expected one of: stable, next.`);
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function parsePinSpec(spec) {
|
|
91
|
+
if (typeof spec !== 'string') return null;
|
|
92
|
+
const idx = spec.indexOf('=');
|
|
93
|
+
if (idx <= 0 || idx === spec.length - 1) return null;
|
|
94
|
+
const code = spec.slice(0, idx).trim();
|
|
95
|
+
const tag = spec.slice(idx + 1).trim();
|
|
96
|
+
if (!code || !tag) return null;
|
|
97
|
+
return { code, tag };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Build a per-module plan entry, applying precedence.
|
|
102
|
+
*
|
|
103
|
+
* @param {Object} args
|
|
104
|
+
* @param {string} args.code
|
|
105
|
+
* @param {Object} args.channelOptions - from parseChannelOptions
|
|
106
|
+
* @param {string} [args.registryDefault] - module's default_channel, if any
|
|
107
|
+
* @returns {{channel: 'stable'|'next'|'pinned', pin?: string, source: string}}
|
|
108
|
+
* source describes where the decision came from, for logging / debugging.
|
|
109
|
+
*/
|
|
110
|
+
function decideChannelForModule({ code, channelOptions, registryDefault }) {
|
|
111
|
+
const { global, nextSet, pins } = channelOptions || { nextSet: new Set(), pins: new Map() };
|
|
112
|
+
|
|
113
|
+
if (pins && pins.has(code)) {
|
|
114
|
+
return { channel: 'pinned', pin: pins.get(code), source: 'flag:--pin' };
|
|
115
|
+
}
|
|
116
|
+
if (nextSet && nextSet.has(code)) {
|
|
117
|
+
return { channel: 'next', source: 'flag:--next' };
|
|
118
|
+
}
|
|
119
|
+
if (global) {
|
|
120
|
+
return { channel: global, source: 'flag:--channel' };
|
|
121
|
+
}
|
|
122
|
+
if (registryDefault && VALID_CHANNELS.has(registryDefault)) {
|
|
123
|
+
return { channel: registryDefault, source: 'registry' };
|
|
124
|
+
}
|
|
125
|
+
return { channel: 'stable', source: 'default' };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Build a full channel plan map for a set of modules.
|
|
130
|
+
*
|
|
131
|
+
* @param {Object} args
|
|
132
|
+
* @param {Array<{code: string, defaultChannel?: string, builtIn?: boolean}>} args.modules
|
|
133
|
+
* Only the modules that need a channel entry; callers should filter out
|
|
134
|
+
* bundled modules (core/bmm) before calling.
|
|
135
|
+
* @param {Object} args.channelOptions - from parseChannelOptions
|
|
136
|
+
* @returns {Map<string, {channel: string, pin?: string, source: string}>}
|
|
137
|
+
*/
|
|
138
|
+
function buildPlan({ modules, channelOptions }) {
|
|
139
|
+
const plan = new Map();
|
|
140
|
+
for (const mod of modules || []) {
|
|
141
|
+
plan.set(
|
|
142
|
+
mod.code,
|
|
143
|
+
decideChannelForModule({
|
|
144
|
+
code: mod.code,
|
|
145
|
+
channelOptions,
|
|
146
|
+
registryDefault: mod.defaultChannel,
|
|
147
|
+
}),
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
return plan;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Report any --pin CODE=TAG entries that don't correspond to a selected module.
|
|
155
|
+
* These get warned about but don't abort the install.
|
|
156
|
+
*/
|
|
157
|
+
function orphanPinWarnings(channelOptions, selectedCodes) {
|
|
158
|
+
const warnings = [];
|
|
159
|
+
const selected = new Set(selectedCodes || []);
|
|
160
|
+
for (const code of channelOptions?.pins?.keys() || []) {
|
|
161
|
+
if (!selected.has(code)) {
|
|
162
|
+
warnings.push(`--pin for '${code}' has no effect (module not selected).`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
for (const code of channelOptions?.nextSet || []) {
|
|
166
|
+
if (!selected.has(code)) {
|
|
167
|
+
warnings.push(`--next for '${code}' has no effect (module not selected).`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return warnings;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Warn when --pin / --next targets a bundled module (core, bmm). Those are
|
|
175
|
+
* shipped inside the installer binary — there's no git clone to override, so
|
|
176
|
+
* the flag has no effect. Users who actually want a prerelease core/bmm
|
|
177
|
+
* should use `npx drt-method@next install`.
|
|
178
|
+
*/
|
|
179
|
+
function bundledTargetWarnings(channelOptions, bundledCodes) {
|
|
180
|
+
const warnings = [];
|
|
181
|
+
const bundled = new Set(bundledCodes || []);
|
|
182
|
+
const hint = '(bundled module; use `npx drt-method@next install` for a prerelease)';
|
|
183
|
+
for (const code of channelOptions?.pins?.keys() || []) {
|
|
184
|
+
if (bundled.has(code)) {
|
|
185
|
+
warnings.push(`--pin for '${code}' has no effect ${hint}.`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
for (const code of channelOptions?.nextSet || []) {
|
|
189
|
+
if (bundled.has(code)) {
|
|
190
|
+
warnings.push(`--next for '${code}' has no effect ${hint}.`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return warnings;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
module.exports = {
|
|
197
|
+
parseChannelOptions,
|
|
198
|
+
decideChannelForModule,
|
|
199
|
+
buildPlan,
|
|
200
|
+
orphanPinWarnings,
|
|
201
|
+
bundledTargetWarnings,
|
|
202
|
+
parsePinSpec,
|
|
203
|
+
};
|