convoke-agents 2.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/CHANGELOG.md +920 -0
- package/INSTALLATION.md +230 -0
- package/LICENSE +21 -0
- package/README.md +330 -0
- package/UPDATE-GUIDE.md +220 -0
- package/_bmad/bme/_vortex/README.md +150 -0
- package/_bmad/bme/_vortex/agents/contextualization-expert.md +100 -0
- package/_bmad/bme/_vortex/agents/discovery-empathy-expert.md +117 -0
- package/_bmad/bme/_vortex/agents/hypothesis-engineer.md +117 -0
- package/_bmad/bme/_vortex/agents/lean-experiments-specialist.md +118 -0
- package/_bmad/bme/_vortex/agents/learning-decision-expert.md +117 -0
- package/_bmad/bme/_vortex/agents/production-intelligence-specialist.md +117 -0
- package/_bmad/bme/_vortex/agents/research-convergence-specialist.md +117 -0
- package/_bmad/bme/_vortex/compass-routing-reference.md +312 -0
- package/_bmad/bme/_vortex/config.yaml +46 -0
- package/_bmad/bme/_vortex/contracts/hc1-empathy-artifacts.md +152 -0
- package/_bmad/bme/_vortex/contracts/hc2-problem-definition.md +125 -0
- package/_bmad/bme/_vortex/contracts/hc3-hypothesis-contract.md +112 -0
- package/_bmad/bme/_vortex/contracts/hc4-experiment-context.md +140 -0
- package/_bmad/bme/_vortex/contracts/hc5-signal-report.md +130 -0
- package/_bmad/bme/_vortex/examples/hc2-example-problem-definition.md +85 -0
- package/_bmad/bme/_vortex/examples/hc3-example-hypothesis-contract.md +103 -0
- package/_bmad/bme/_vortex/examples/hc5-example-signal-report.md +76 -0
- package/_bmad/bme/_vortex/guides/EMMA-USER-GUIDE.md +232 -0
- package/_bmad/bme/_vortex/guides/ISLA-USER-GUIDE.md +208 -0
- package/_bmad/bme/_vortex/guides/LIAM-USER-GUIDE.md +255 -0
- package/_bmad/bme/_vortex/guides/MAX-USER-GUIDE.md +213 -0
- package/_bmad/bme/_vortex/guides/MILA-USER-GUIDE.md +235 -0
- package/_bmad/bme/_vortex/guides/NOAH-USER-GUIDE.md +258 -0
- package/_bmad/bme/_vortex/guides/WADE-USER-GUIDE.md +245 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/empathy-map/empathy-map.template.md +143 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/empathy-map/steps/step-01-define-user.md +60 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/empathy-map/steps/step-02-says-thinks.md +67 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/empathy-map/steps/step-03-does-feels.md +79 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/empathy-map/steps/step-04-pain-points.md +87 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/empathy-map/steps/step-05-gains.md +103 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/empathy-map/steps/step-06-synthesize.md +104 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/empathy-map/validate.md +117 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/empathy-map/workflow.md +44 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/wireframe/steps/step-01-define-requirements.md +85 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/wireframe/steps/step-02-user-flows.md +59 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/wireframe/steps/step-03-information-architecture.md +68 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/wireframe/steps/step-04-wireframe-sketch.md +97 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/wireframe/steps/step-05-components.md +128 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/wireframe/steps/step-06-synthesize.md +83 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/wireframe/wireframe.template.md +287 -0
- package/_bmad/bme/_vortex/workflows/_deprecated/wireframe/workflow.md +44 -0
- package/_bmad/bme/_vortex/workflows/assumption-mapping/steps/step-01-setup.md +66 -0
- package/_bmad/bme/_vortex/workflows/assumption-mapping/steps/step-02-context.md +93 -0
- package/_bmad/bme/_vortex/workflows/assumption-mapping/steps/step-03-risk-mapping.md +103 -0
- package/_bmad/bme/_vortex/workflows/assumption-mapping/steps/step-04-synthesize.md +101 -0
- package/_bmad/bme/_vortex/workflows/assumption-mapping/workflow.md +49 -0
- package/_bmad/bme/_vortex/workflows/behavior-analysis/steps/step-01-setup.md +81 -0
- package/_bmad/bme/_vortex/workflows/behavior-analysis/steps/step-02-context.md +67 -0
- package/_bmad/bme/_vortex/workflows/behavior-analysis/steps/step-03-classification.md +98 -0
- package/_bmad/bme/_vortex/workflows/behavior-analysis/steps/step-04-evidence.md +100 -0
- package/_bmad/bme/_vortex/workflows/behavior-analysis/steps/step-05-synthesize.md +174 -0
- package/_bmad/bme/_vortex/workflows/behavior-analysis/workflow.md +52 -0
- package/_bmad/bme/_vortex/workflows/contextualize-scope/contextualize-scope.template.md +67 -0
- package/_bmad/bme/_vortex/workflows/contextualize-scope/steps/step-01-list-opportunities.md +47 -0
- package/_bmad/bme/_vortex/workflows/contextualize-scope/steps/step-02-define-criteria.md +36 -0
- package/_bmad/bme/_vortex/workflows/contextualize-scope/steps/step-03-evaluate-opportunities.md +30 -0
- package/_bmad/bme/_vortex/workflows/contextualize-scope/steps/step-04-define-boundaries.md +32 -0
- package/_bmad/bme/_vortex/workflows/contextualize-scope/steps/step-05-validate-fit.md +28 -0
- package/_bmad/bme/_vortex/workflows/contextualize-scope/steps/step-06-synthesize.md +36 -0
- package/_bmad/bme/_vortex/workflows/contextualize-scope/validate.md +30 -0
- package/_bmad/bme/_vortex/workflows/contextualize-scope/workflow.md +59 -0
- package/_bmad/bme/_vortex/workflows/empathy-map/empathy-map.template.md +143 -0
- package/_bmad/bme/_vortex/workflows/empathy-map/steps/step-01-define-user.md +60 -0
- package/_bmad/bme/_vortex/workflows/empathy-map/steps/step-02-says-thinks.md +67 -0
- package/_bmad/bme/_vortex/workflows/empathy-map/steps/step-03-does-feels.md +79 -0
- package/_bmad/bme/_vortex/workflows/empathy-map/steps/step-04-pain-points.md +87 -0
- package/_bmad/bme/_vortex/workflows/empathy-map/steps/step-05-gains.md +103 -0
- package/_bmad/bme/_vortex/workflows/empathy-map/steps/step-06-synthesize.md +107 -0
- package/_bmad/bme/_vortex/workflows/empathy-map/validate.md +117 -0
- package/_bmad/bme/_vortex/workflows/empathy-map/workflow.md +45 -0
- package/_bmad/bme/_vortex/workflows/experiment-design/steps/step-01-setup.md +66 -0
- package/_bmad/bme/_vortex/workflows/experiment-design/steps/step-02-context.md +77 -0
- package/_bmad/bme/_vortex/workflows/experiment-design/steps/step-03-design.md +114 -0
- package/_bmad/bme/_vortex/workflows/experiment-design/steps/step-04-synthesize.md +128 -0
- package/_bmad/bme/_vortex/workflows/experiment-design/workflow.md +51 -0
- package/_bmad/bme/_vortex/workflows/hypothesis-engineering/steps/step-01-setup.md +66 -0
- package/_bmad/bme/_vortex/workflows/hypothesis-engineering/steps/step-02-context.md +80 -0
- package/_bmad/bme/_vortex/workflows/hypothesis-engineering/steps/step-03-brainwriting.md +79 -0
- package/_bmad/bme/_vortex/workflows/hypothesis-engineering/steps/step-04-assumption-mapping.md +102 -0
- package/_bmad/bme/_vortex/workflows/hypothesis-engineering/steps/step-05-synthesize.md +130 -0
- package/_bmad/bme/_vortex/workflows/hypothesis-engineering/workflow.md +52 -0
- package/_bmad/bme/_vortex/workflows/lean-experiment/lean-experiment.template.md +29 -0
- package/_bmad/bme/_vortex/workflows/lean-experiment/steps/step-01-hypothesis.md +58 -0
- package/_bmad/bme/_vortex/workflows/lean-experiment/steps/step-02-design.md +68 -0
- package/_bmad/bme/_vortex/workflows/lean-experiment/steps/step-03-metrics.md +73 -0
- package/_bmad/bme/_vortex/workflows/lean-experiment/steps/step-04-run.md +75 -0
- package/_bmad/bme/_vortex/workflows/lean-experiment/steps/step-05-analyze.md +84 -0
- package/_bmad/bme/_vortex/workflows/lean-experiment/steps/step-06-decide.md +111 -0
- package/_bmad/bme/_vortex/workflows/lean-experiment/validate.md +30 -0
- package/_bmad/bme/_vortex/workflows/lean-experiment/workflow.md +26 -0
- package/_bmad/bme/_vortex/workflows/lean-persona/lean-persona.template.md +163 -0
- package/_bmad/bme/_vortex/workflows/lean-persona/steps/step-01-define-job.md +72 -0
- package/_bmad/bme/_vortex/workflows/lean-persona/steps/step-02-current-solution.md +83 -0
- package/_bmad/bme/_vortex/workflows/lean-persona/steps/step-03-problem-contexts.md +90 -0
- package/_bmad/bme/_vortex/workflows/lean-persona/steps/step-04-forces-anxieties.md +98 -0
- package/_bmad/bme/_vortex/workflows/lean-persona/steps/step-05-success-criteria.md +103 -0
- package/_bmad/bme/_vortex/workflows/lean-persona/steps/step-06-synthesize.md +129 -0
- package/_bmad/bme/_vortex/workflows/lean-persona/validate.md +30 -0
- package/_bmad/bme/_vortex/workflows/lean-persona/workflow.md +50 -0
- package/_bmad/bme/_vortex/workflows/learning-card/learning-card.template.md +179 -0
- package/_bmad/bme/_vortex/workflows/learning-card/steps/step-01-experiment-context.md +100 -0
- package/_bmad/bme/_vortex/workflows/learning-card/steps/step-02-raw-results.md +125 -0
- package/_bmad/bme/_vortex/workflows/learning-card/steps/step-03-analysis.md +125 -0
- package/_bmad/bme/_vortex/workflows/learning-card/steps/step-04-validated-learning.md +139 -0
- package/_bmad/bme/_vortex/workflows/learning-card/steps/step-05-implications.md +134 -0
- package/_bmad/bme/_vortex/workflows/learning-card/steps/step-06-synthesize.md +121 -0
- package/_bmad/bme/_vortex/workflows/learning-card/validate.md +134 -0
- package/_bmad/bme/_vortex/workflows/learning-card/workflow.md +51 -0
- package/_bmad/bme/_vortex/workflows/mvp/mvp.template.md +40 -0
- package/_bmad/bme/_vortex/workflows/mvp/steps/step-01-riskiest-assumption.md +17 -0
- package/_bmad/bme/_vortex/workflows/mvp/steps/step-02-success-criteria.md +13 -0
- package/_bmad/bme/_vortex/workflows/mvp/steps/step-03-smallest-test.md +13 -0
- package/_bmad/bme/_vortex/workflows/mvp/steps/step-04-scope-features.md +13 -0
- package/_bmad/bme/_vortex/workflows/mvp/steps/step-05-build-measure-learn.md +13 -0
- package/_bmad/bme/_vortex/workflows/mvp/steps/step-06-synthesize.md +28 -0
- package/_bmad/bme/_vortex/workflows/mvp/validate.md +30 -0
- package/_bmad/bme/_vortex/workflows/mvp/workflow.md +36 -0
- package/_bmad/bme/_vortex/workflows/pattern-mapping/steps/step-01-setup.md +102 -0
- package/_bmad/bme/_vortex/workflows/pattern-mapping/steps/step-02-context.md +81 -0
- package/_bmad/bme/_vortex/workflows/pattern-mapping/steps/step-03-pattern-identification.md +88 -0
- package/_bmad/bme/_vortex/workflows/pattern-mapping/steps/step-04-theme-clustering.md +100 -0
- package/_bmad/bme/_vortex/workflows/pattern-mapping/steps/step-05-synthesize.md +135 -0
- package/_bmad/bme/_vortex/workflows/pattern-mapping/workflow.md +58 -0
- package/_bmad/bme/_vortex/workflows/pivot-patch-persevere/pivot-patch-persevere.template.md +201 -0
- package/_bmad/bme/_vortex/workflows/pivot-patch-persevere/steps/step-01-evidence-review.md +125 -0
- package/_bmad/bme/_vortex/workflows/pivot-patch-persevere/steps/step-02-hypothesis-assessment.md +132 -0
- package/_bmad/bme/_vortex/workflows/pivot-patch-persevere/steps/step-03-option-analysis.md +167 -0
- package/_bmad/bme/_vortex/workflows/pivot-patch-persevere/steps/step-04-stakeholder-input.md +141 -0
- package/_bmad/bme/_vortex/workflows/pivot-patch-persevere/steps/step-05-decision.md +161 -0
- package/_bmad/bme/_vortex/workflows/pivot-patch-persevere/steps/step-06-action-plan.md +188 -0
- package/_bmad/bme/_vortex/workflows/pivot-patch-persevere/validate.md +159 -0
- package/_bmad/bme/_vortex/workflows/pivot-patch-persevere/workflow.md +51 -0
- package/_bmad/bme/_vortex/workflows/pivot-resynthesis/steps/step-01-setup.md +97 -0
- package/_bmad/bme/_vortex/workflows/pivot-resynthesis/steps/step-02-context.md +86 -0
- package/_bmad/bme/_vortex/workflows/pivot-resynthesis/steps/step-03-jtbd-reframing.md +88 -0
- package/_bmad/bme/_vortex/workflows/pivot-resynthesis/steps/step-04-pains-gains-revision.md +76 -0
- package/_bmad/bme/_vortex/workflows/pivot-resynthesis/steps/step-05-synthesize.md +158 -0
- package/_bmad/bme/_vortex/workflows/pivot-resynthesis/workflow.md +52 -0
- package/_bmad/bme/_vortex/workflows/product-vision/product-vision.template.md +147 -0
- package/_bmad/bme/_vortex/workflows/product-vision/steps/step-01-define-problem.md +89 -0
- package/_bmad/bme/_vortex/workflows/product-vision/steps/step-02-target-market.md +91 -0
- package/_bmad/bme/_vortex/workflows/product-vision/steps/step-03-unique-approach.md +87 -0
- package/_bmad/bme/_vortex/workflows/product-vision/steps/step-04-future-state.md +100 -0
- package/_bmad/bme/_vortex/workflows/product-vision/steps/step-05-principles.md +92 -0
- package/_bmad/bme/_vortex/workflows/product-vision/steps/step-06-synthesize.md +170 -0
- package/_bmad/bme/_vortex/workflows/product-vision/validate.md +30 -0
- package/_bmad/bme/_vortex/workflows/product-vision/workflow.md +55 -0
- package/_bmad/bme/_vortex/workflows/production-monitoring/steps/step-01-setup.md +84 -0
- package/_bmad/bme/_vortex/workflows/production-monitoring/steps/step-02-context.md +66 -0
- package/_bmad/bme/_vortex/workflows/production-monitoring/steps/step-03-monitoring.md +74 -0
- package/_bmad/bme/_vortex/workflows/production-monitoring/steps/step-04-prioritization.md +97 -0
- package/_bmad/bme/_vortex/workflows/production-monitoring/steps/step-05-synthesize.md +183 -0
- package/_bmad/bme/_vortex/workflows/production-monitoring/workflow.md +52 -0
- package/_bmad/bme/_vortex/workflows/proof-of-concept/proof-of-concept.template.md +25 -0
- package/_bmad/bme/_vortex/workflows/proof-of-concept/steps/step-01-risk.md +79 -0
- package/_bmad/bme/_vortex/workflows/proof-of-concept/steps/step-02-scope.md +105 -0
- package/_bmad/bme/_vortex/workflows/proof-of-concept/steps/step-03-build.md +92 -0
- package/_bmad/bme/_vortex/workflows/proof-of-concept/steps/step-04-test.md +103 -0
- package/_bmad/bme/_vortex/workflows/proof-of-concept/steps/step-05-evaluate.md +114 -0
- package/_bmad/bme/_vortex/workflows/proof-of-concept/steps/step-06-document.md +125 -0
- package/_bmad/bme/_vortex/workflows/proof-of-concept/validate.md +30 -0
- package/_bmad/bme/_vortex/workflows/proof-of-concept/workflow.md +26 -0
- package/_bmad/bme/_vortex/workflows/proof-of-value/proof-of-value.template.md +29 -0
- package/_bmad/bme/_vortex/workflows/proof-of-value/steps/step-01-value-hypothesis.md +75 -0
- package/_bmad/bme/_vortex/workflows/proof-of-value/steps/step-02-validation-design.md +94 -0
- package/_bmad/bme/_vortex/workflows/proof-of-value/steps/step-03-willingness.md +96 -0
- package/_bmad/bme/_vortex/workflows/proof-of-value/steps/step-04-test.md +107 -0
- package/_bmad/bme/_vortex/workflows/proof-of-value/steps/step-05-analyze.md +116 -0
- package/_bmad/bme/_vortex/workflows/proof-of-value/steps/step-06-document.md +147 -0
- package/_bmad/bme/_vortex/workflows/proof-of-value/validate.md +30 -0
- package/_bmad/bme/_vortex/workflows/proof-of-value/workflow.md +26 -0
- package/_bmad/bme/_vortex/workflows/research-convergence/steps/step-01-setup.md +69 -0
- package/_bmad/bme/_vortex/workflows/research-convergence/steps/step-02-context.md +70 -0
- package/_bmad/bme/_vortex/workflows/research-convergence/steps/step-03-jtbd-framing.md +81 -0
- package/_bmad/bme/_vortex/workflows/research-convergence/steps/step-04-pains-gains.md +77 -0
- package/_bmad/bme/_vortex/workflows/research-convergence/steps/step-05-synthesize.md +147 -0
- package/_bmad/bme/_vortex/workflows/research-convergence/workflow.md +50 -0
- package/_bmad/bme/_vortex/workflows/signal-interpretation/steps/step-01-setup.md +68 -0
- package/_bmad/bme/_vortex/workflows/signal-interpretation/steps/step-02-context.md +67 -0
- package/_bmad/bme/_vortex/workflows/signal-interpretation/steps/step-03-signal-analysis.md +85 -0
- package/_bmad/bme/_vortex/workflows/signal-interpretation/steps/step-04-anomaly-detection.md +93 -0
- package/_bmad/bme/_vortex/workflows/signal-interpretation/steps/step-05-synthesize.md +163 -0
- package/_bmad/bme/_vortex/workflows/signal-interpretation/workflow.md +52 -0
- package/_bmad/bme/_vortex/workflows/user-discovery/steps/step-01-discovery-scope.md +77 -0
- package/_bmad/bme/_vortex/workflows/user-discovery/steps/step-02-research-methods.md +152 -0
- package/_bmad/bme/_vortex/workflows/user-discovery/steps/step-03-research-plan.md +159 -0
- package/_bmad/bme/_vortex/workflows/user-discovery/steps/step-04-execute.md +169 -0
- package/_bmad/bme/_vortex/workflows/user-discovery/steps/step-05-organize-data.md +149 -0
- package/_bmad/bme/_vortex/workflows/user-discovery/steps/step-06-synthesize.md +159 -0
- package/_bmad/bme/_vortex/workflows/user-discovery/user-discovery.template.md +231 -0
- package/_bmad/bme/_vortex/workflows/user-discovery/validate.md +153 -0
- package/_bmad/bme/_vortex/workflows/user-discovery/workflow.md +45 -0
- package/_bmad/bme/_vortex/workflows/user-interview/steps/step-01-research-goals.md +100 -0
- package/_bmad/bme/_vortex/workflows/user-interview/steps/step-02-interview-script.md +123 -0
- package/_bmad/bme/_vortex/workflows/user-interview/steps/step-03-recruitment.md +144 -0
- package/_bmad/bme/_vortex/workflows/user-interview/steps/step-04-conduct.md +154 -0
- package/_bmad/bme/_vortex/workflows/user-interview/steps/step-05-findings.md +163 -0
- package/_bmad/bme/_vortex/workflows/user-interview/steps/step-06-synthesize.md +171 -0
- package/_bmad/bme/_vortex/workflows/user-interview/user-interview.template.md +250 -0
- package/_bmad/bme/_vortex/workflows/user-interview/validate.md +142 -0
- package/_bmad/bme/_vortex/workflows/user-interview/workflow.md +51 -0
- package/_bmad/bme/_vortex/workflows/vortex-navigation/steps/step-01-current-state.md +56 -0
- package/_bmad/bme/_vortex/workflows/vortex-navigation/steps/step-02-evidence-inventory.md +70 -0
- package/_bmad/bme/_vortex/workflows/vortex-navigation/steps/step-03-gap-analysis.md +76 -0
- package/_bmad/bme/_vortex/workflows/vortex-navigation/steps/step-04-stream-evaluation.md +57 -0
- package/_bmad/bme/_vortex/workflows/vortex-navigation/steps/step-05-recommendation.md +65 -0
- package/_bmad/bme/_vortex/workflows/vortex-navigation/steps/step-06-navigation-plan.md +72 -0
- package/_bmad/bme/_vortex/workflows/vortex-navigation/validate.md +75 -0
- package/_bmad/bme/_vortex/workflows/vortex-navigation/vortex-navigation.template.md +105 -0
- package/_bmad/bme/_vortex/workflows/vortex-navigation/workflow.md +54 -0
- package/index.js +56 -0
- package/package.json +77 -0
- package/scripts/README.md +226 -0
- package/scripts/convoke-doctor.js +322 -0
- package/scripts/docs-audit.js +584 -0
- package/scripts/install-all-agents.js +9 -0
- package/scripts/install-vortex-agents.js +208 -0
- package/scripts/postinstall.js +104 -0
- package/scripts/update/convoke-migrate.js +169 -0
- package/scripts/update/convoke-update.js +272 -0
- package/scripts/update/convoke-version.js +134 -0
- package/scripts/update/lib/agent-registry.js +144 -0
- package/scripts/update/lib/backup-manager.js +243 -0
- package/scripts/update/lib/config-merger.js +242 -0
- package/scripts/update/lib/migration-runner.js +367 -0
- package/scripts/update/lib/refresh-installation.js +171 -0
- package/scripts/update/lib/utils.js +96 -0
- package/scripts/update/lib/validator.js +360 -0
- package/scripts/update/lib/version-detector.js +241 -0
- package/scripts/update/migrations/1.0.x-to-1.3.0.js +128 -0
- package/scripts/update/migrations/1.1.x-to-1.3.0.js +29 -0
- package/scripts/update/migrations/1.2.x-to-1.3.0.js +29 -0
- package/scripts/update/migrations/1.3.x-to-1.5.0.js +29 -0
- package/scripts/update/migrations/1.4.x-to-1.5.0.js +29 -0
- package/scripts/update/migrations/1.5.x-to-1.6.0.js +95 -0
- package/scripts/update/migrations/1.6.x-to-1.7.0.js +29 -0
- package/scripts/update/migrations/1.7.x-to-2.0.0.js +31 -0
- package/scripts/update/migrations/registry.js +194 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs-extra');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const yaml = require('js-yaml');
|
|
6
|
+
const configMerger = require('./config-merger');
|
|
7
|
+
const { countUserDataFiles } = require('./utils');
|
|
8
|
+
const { AGENT_FILES, AGENT_IDS, WORKFLOW_NAMES, WAVE3_WORKFLOW_NAMES } = require('./agent-registry');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Validator for Convoke
|
|
12
|
+
* Verifies installation integrity post-migration
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Validate entire installation
|
|
17
|
+
* @param {object} preMigrationData - Data from before migration for comparison
|
|
18
|
+
* @param {string} projectRoot - Absolute path to project root
|
|
19
|
+
* @returns {Promise<object>} Validation result
|
|
20
|
+
*/
|
|
21
|
+
async function validateInstallation(preMigrationData = {}, projectRoot) {
|
|
22
|
+
const checks = [];
|
|
23
|
+
|
|
24
|
+
// 1. Config structure validation
|
|
25
|
+
checks.push(await validateConfigStructure(projectRoot));
|
|
26
|
+
|
|
27
|
+
// 2. Agent files validation
|
|
28
|
+
checks.push(await validateAgentFiles(projectRoot));
|
|
29
|
+
|
|
30
|
+
// 3. Workflow files validation
|
|
31
|
+
checks.push(await validateWorkflows(projectRoot));
|
|
32
|
+
|
|
33
|
+
// 4. Manifest consistency validation
|
|
34
|
+
checks.push(await validateManifest(projectRoot));
|
|
35
|
+
|
|
36
|
+
// 5. User data integrity validation
|
|
37
|
+
if (preMigrationData.user_data_count) {
|
|
38
|
+
checks.push(await validateUserDataIntegrity(preMigrationData.user_data_count, projectRoot));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 6. Deprecated workflows validation (if applicable)
|
|
42
|
+
checks.push(await validateDeprecatedWorkflows(projectRoot));
|
|
43
|
+
|
|
44
|
+
// 7. Workflow step structure validation (P17 count + P20 filenames)
|
|
45
|
+
checks.push(await validateWorkflowStepStructure(projectRoot));
|
|
46
|
+
|
|
47
|
+
const allPassed = checks.every(c => c.passed);
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
valid: allPassed,
|
|
51
|
+
checks
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Validate config.yaml structure
|
|
57
|
+
* @param {string} projectRoot - Absolute path to project root
|
|
58
|
+
* @returns {Promise<object>} Validation check result
|
|
59
|
+
*/
|
|
60
|
+
async function validateConfigStructure(projectRoot) {
|
|
61
|
+
const check = {
|
|
62
|
+
name: 'Config structure',
|
|
63
|
+
passed: false,
|
|
64
|
+
error: null
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
try {
|
|
68
|
+
const configPath = path.join(projectRoot, '_bmad/bme/_vortex/config.yaml');
|
|
69
|
+
|
|
70
|
+
if (!fs.existsSync(configPath)) {
|
|
71
|
+
check.error = 'config.yaml not found';
|
|
72
|
+
return check;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const configContent = fs.readFileSync(configPath, 'utf8');
|
|
76
|
+
const config = yaml.load(configContent);
|
|
77
|
+
|
|
78
|
+
// Validate using config-merger
|
|
79
|
+
const validation = configMerger.validateConfig(config);
|
|
80
|
+
|
|
81
|
+
if (!validation.valid) {
|
|
82
|
+
check.error = validation.errors.join(', ');
|
|
83
|
+
return check;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
check.passed = true;
|
|
87
|
+
} catch (error) {
|
|
88
|
+
check.error = error.message;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return check;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Validate agent files exist
|
|
96
|
+
* @param {string} projectRoot - Absolute path to project root
|
|
97
|
+
* @returns {Promise<object>} Validation check result
|
|
98
|
+
*/
|
|
99
|
+
async function validateAgentFiles(projectRoot) {
|
|
100
|
+
const check = {
|
|
101
|
+
name: 'Agent files',
|
|
102
|
+
passed: false,
|
|
103
|
+
error: null
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
const agentsDir = path.join(projectRoot, '_bmad/bme/_vortex/agents');
|
|
108
|
+
const requiredAgents = AGENT_FILES;
|
|
109
|
+
|
|
110
|
+
if (!fs.existsSync(agentsDir)) {
|
|
111
|
+
check.error = 'agents/ directory not found';
|
|
112
|
+
return check;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const missingAgents = [];
|
|
116
|
+
for (const agent of requiredAgents) {
|
|
117
|
+
const agentPath = path.join(agentsDir, agent);
|
|
118
|
+
if (!fs.existsSync(agentPath)) {
|
|
119
|
+
missingAgents.push(agent);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (missingAgents.length > 0) {
|
|
124
|
+
check.error = `Missing agent files: ${missingAgents.join(', ')}`;
|
|
125
|
+
return check;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
check.passed = true;
|
|
129
|
+
} catch (error) {
|
|
130
|
+
check.error = error.message;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return check;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Validate workflow files exist
|
|
138
|
+
* @param {string} projectRoot - Absolute path to project root
|
|
139
|
+
* @returns {Promise<object>} Validation check result
|
|
140
|
+
*/
|
|
141
|
+
async function validateWorkflows(projectRoot) {
|
|
142
|
+
const check = {
|
|
143
|
+
name: 'Workflow files',
|
|
144
|
+
passed: false,
|
|
145
|
+
error: null
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
try {
|
|
149
|
+
const workflowsDir = path.join(projectRoot, '_bmad/bme/_vortex/workflows');
|
|
150
|
+
const requiredWorkflows = WORKFLOW_NAMES;
|
|
151
|
+
|
|
152
|
+
if (!fs.existsSync(workflowsDir)) {
|
|
153
|
+
check.error = 'workflows/ directory not found';
|
|
154
|
+
return check;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const missingWorkflows = [];
|
|
158
|
+
for (const workflow of requiredWorkflows) {
|
|
159
|
+
const workflowFile = path.join(workflowsDir, workflow, 'workflow.md');
|
|
160
|
+
if (!fs.existsSync(workflowFile)) {
|
|
161
|
+
missingWorkflows.push(workflow);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (missingWorkflows.length > 0) {
|
|
166
|
+
check.error = `Missing workflows: ${missingWorkflows.join(', ')}`;
|
|
167
|
+
return check;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
check.passed = true;
|
|
171
|
+
} catch (error) {
|
|
172
|
+
check.error = error.message;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return check;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Validate agent manifest consistency
|
|
180
|
+
* @param {string} projectRoot - Absolute path to project root
|
|
181
|
+
* @returns {Promise<object>} Validation check result
|
|
182
|
+
*/
|
|
183
|
+
async function validateManifest(projectRoot) {
|
|
184
|
+
const check = {
|
|
185
|
+
name: 'Agent manifest',
|
|
186
|
+
passed: false,
|
|
187
|
+
error: null
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
try {
|
|
191
|
+
const manifestPath = path.join(projectRoot, '_bmad/_config/agent-manifest.csv');
|
|
192
|
+
|
|
193
|
+
if (!fs.existsSync(manifestPath)) {
|
|
194
|
+
// Manifest is optional, so this is not a failure
|
|
195
|
+
check.passed = true;
|
|
196
|
+
check.warning = 'agent-manifest.csv not found (optional)';
|
|
197
|
+
return check;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const manifestContent = fs.readFileSync(manifestPath, 'utf8');
|
|
201
|
+
|
|
202
|
+
// Check for all Convoke agents
|
|
203
|
+
const missingFromManifest = AGENT_IDS.filter(id => !manifestContent.includes(id));
|
|
204
|
+
|
|
205
|
+
if (missingFromManifest.length > 0) {
|
|
206
|
+
check.error = `Agent manifest missing: ${missingFromManifest.join(', ')}`;
|
|
207
|
+
return check;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
check.passed = true;
|
|
211
|
+
} catch (error) {
|
|
212
|
+
check.error = error.message;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return check;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Validate user data integrity
|
|
220
|
+
* @param {number} expectedCount - Expected file count
|
|
221
|
+
* @param {string} projectRoot - Absolute path to project root
|
|
222
|
+
* @returns {Promise<object>} Validation check result
|
|
223
|
+
*/
|
|
224
|
+
async function validateUserDataIntegrity(expectedCount, projectRoot) {
|
|
225
|
+
const check = {
|
|
226
|
+
name: 'User data preserved',
|
|
227
|
+
passed: false,
|
|
228
|
+
error: null
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
try {
|
|
232
|
+
const outputDir = path.join(projectRoot, '_bmad-output');
|
|
233
|
+
|
|
234
|
+
if (!fs.existsSync(outputDir)) {
|
|
235
|
+
check.error = '_bmad-output/ directory not found';
|
|
236
|
+
return check;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const currentCount = await countUserDataFiles(projectRoot);
|
|
240
|
+
|
|
241
|
+
// Allow for slight variation (user guides may have been updated)
|
|
242
|
+
if (currentCount >= expectedCount - 2) {
|
|
243
|
+
check.passed = true;
|
|
244
|
+
check.info = `Files: ${currentCount} (expected: ${expectedCount})`;
|
|
245
|
+
} else {
|
|
246
|
+
check.error = `User data count mismatch: ${currentCount} (expected: ${expectedCount})`;
|
|
247
|
+
}
|
|
248
|
+
} catch (error) {
|
|
249
|
+
check.error = error.message;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return check;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Validate deprecated workflows structure
|
|
257
|
+
* @param {string} projectRoot - Absolute path to project root
|
|
258
|
+
* @returns {Promise<object>} Validation check result
|
|
259
|
+
*/
|
|
260
|
+
async function validateDeprecatedWorkflows(projectRoot) {
|
|
261
|
+
const check = {
|
|
262
|
+
name: 'Deprecated workflows',
|
|
263
|
+
passed: true, // Not required, so pass by default
|
|
264
|
+
error: null
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
try {
|
|
268
|
+
const deprecatedDir = path.join(projectRoot, '_bmad/bme/_vortex/workflows/_deprecated');
|
|
269
|
+
|
|
270
|
+
if (!fs.existsSync(deprecatedDir)) {
|
|
271
|
+
check.info = 'No deprecated workflows (fresh installation)';
|
|
272
|
+
return check;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// If deprecated dir exists, check for expected workflows
|
|
276
|
+
const empathyMapDir = path.join(deprecatedDir, 'empathy-map');
|
|
277
|
+
const wireframeDir = path.join(deprecatedDir, 'wireframe');
|
|
278
|
+
|
|
279
|
+
if (!fs.existsSync(empathyMapDir) && !fs.existsSync(wireframeDir)) {
|
|
280
|
+
check.warning = '_deprecated/ directory exists but is empty';
|
|
281
|
+
} else {
|
|
282
|
+
check.info = 'Deprecated workflows preserved in _deprecated/';
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
check.passed = true;
|
|
286
|
+
} catch (error) {
|
|
287
|
+
check.error = error.message;
|
|
288
|
+
check.passed = false;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return check;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Validate workflow step structure (P17 count + P20 filenames)
|
|
296
|
+
* @param {string} projectRoot - Absolute path to project root
|
|
297
|
+
* @returns {Promise<object>} Validation check result
|
|
298
|
+
*/
|
|
299
|
+
async function validateWorkflowStepStructure(projectRoot) {
|
|
300
|
+
const check = {
|
|
301
|
+
name: 'Workflow step structure',
|
|
302
|
+
passed: true,
|
|
303
|
+
error: null
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
try {
|
|
307
|
+
const workflowsDir = path.join(projectRoot, '_bmad/bme/_vortex/workflows');
|
|
308
|
+
const issues = [];
|
|
309
|
+
|
|
310
|
+
for (const workflow of WORKFLOW_NAMES) {
|
|
311
|
+
const stepsDir = path.join(workflowsDir, workflow, 'steps');
|
|
312
|
+
|
|
313
|
+
if (!fs.existsSync(stepsDir)) {
|
|
314
|
+
continue; // Placeholder workflows without steps/ are valid
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const files = fs.readdirSync(stepsDir).filter(f => f.endsWith('.md'));
|
|
318
|
+
|
|
319
|
+
// P17: step count must be 4-6
|
|
320
|
+
if (files.length < 4 || files.length > 6) {
|
|
321
|
+
issues.push(`${workflow}: ${files.length} step files (expected 4-6)`);
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// P20: standardized filenames (Wave 3 workflows only)
|
|
326
|
+
if (WAVE3_WORKFLOW_NAMES.has(workflow)) {
|
|
327
|
+
if (!files.includes('step-01-setup.md')) {
|
|
328
|
+
issues.push(`${workflow}: missing step-01-setup.md`);
|
|
329
|
+
}
|
|
330
|
+
if (!files.includes('step-02-context.md')) {
|
|
331
|
+
issues.push(`${workflow}: missing step-02-context.md`);
|
|
332
|
+
}
|
|
333
|
+
if (!files.some(f => f.endsWith('-synthesize.md'))) {
|
|
334
|
+
issues.push(`${workflow}: missing *-synthesize.md final step`);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (issues.length > 0) {
|
|
340
|
+
check.passed = false;
|
|
341
|
+
check.error = `Step structure issues: ${issues.join('; ')}`;
|
|
342
|
+
}
|
|
343
|
+
} catch (error) {
|
|
344
|
+
check.error = error.message;
|
|
345
|
+
check.passed = false;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return check;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
module.exports = {
|
|
352
|
+
validateInstallation,
|
|
353
|
+
validateConfigStructure,
|
|
354
|
+
validateAgentFiles,
|
|
355
|
+
validateWorkflows,
|
|
356
|
+
validateManifest,
|
|
357
|
+
validateUserDataIntegrity,
|
|
358
|
+
validateDeprecatedWorkflows,
|
|
359
|
+
validateWorkflowStepStructure
|
|
360
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs-extra');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const yaml = require('js-yaml');
|
|
6
|
+
const { findProjectRoot, compareVersions, getPackageVersion } = require('./utils');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Version Detector for Convoke
|
|
10
|
+
* Reliably detects current installed version and determines migration path
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Get current installed version from config.yaml
|
|
15
|
+
* @param {string} [projectRoot] - Project root (auto-detected if omitted)
|
|
16
|
+
* @returns {string|null} Version string or null if not found
|
|
17
|
+
*/
|
|
18
|
+
function getCurrentVersion(projectRoot) {
|
|
19
|
+
if (!projectRoot) {
|
|
20
|
+
projectRoot = findProjectRoot();
|
|
21
|
+
}
|
|
22
|
+
if (!projectRoot) {
|
|
23
|
+
return null; // Not in a BMAD project
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const configPath = path.join(projectRoot, '_bmad/bme/_vortex/config.yaml');
|
|
28
|
+
|
|
29
|
+
if (!fs.existsSync(configPath)) {
|
|
30
|
+
return null; // No config = fresh install
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const configContent = fs.readFileSync(configPath, 'utf8');
|
|
34
|
+
const config = yaml.load(configContent);
|
|
35
|
+
|
|
36
|
+
if (config && config.version) {
|
|
37
|
+
return config.version;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Fallback: Check for deprecated folder structure to guess version
|
|
41
|
+
console.warn('Warning: config.yaml exists but has no version field');
|
|
42
|
+
return guessVersionFromFileStructure(projectRoot);
|
|
43
|
+
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.warn('Warning: Could not read config.yaml:', error.message);
|
|
46
|
+
return guessVersionFromFileStructure(projectRoot);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Guess version from file structure (fallback method)
|
|
52
|
+
* @param {string} [projectRoot] - Project root (auto-detected if omitted)
|
|
53
|
+
* @returns {string|null} Guessed version or null
|
|
54
|
+
*/
|
|
55
|
+
function guessVersionFromFileStructure(projectRoot) {
|
|
56
|
+
if (!projectRoot) {
|
|
57
|
+
projectRoot = findProjectRoot();
|
|
58
|
+
}
|
|
59
|
+
if (!projectRoot) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const vortexDir = path.join(projectRoot, '_bmad/bme/_vortex');
|
|
64
|
+
|
|
65
|
+
if (!fs.existsSync(vortexDir)) {
|
|
66
|
+
return null; // No installation
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Check for deprecated folder (exists in v1.1.0+)
|
|
70
|
+
const deprecatedDir = path.join(vortexDir, 'workflows/_deprecated');
|
|
71
|
+
if (fs.existsSync(deprecatedDir)) {
|
|
72
|
+
return '1.1.0'; // Has deprecated folder = v1.1.0+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Check for old empathy-map workflow (v1.0.0)
|
|
76
|
+
const empathyMapDir = path.join(vortexDir, 'workflows/empathy-map');
|
|
77
|
+
if (fs.existsSync(empathyMapDir)) {
|
|
78
|
+
return '1.0.0'; // Has empathy-map in workflows = v1.0.0
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Has vortex dir but can't determine version - return null instead of guessing
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Get target version from package.json
|
|
87
|
+
* @returns {string} Target version
|
|
88
|
+
*/
|
|
89
|
+
function getTargetVersion() {
|
|
90
|
+
return getPackageVersion();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Determine migration path based on versions
|
|
95
|
+
* @param {string|null} currentVersion - Current installed version
|
|
96
|
+
* @param {string} targetVersion - Target version from package
|
|
97
|
+
* @returns {object} Migration path info
|
|
98
|
+
*/
|
|
99
|
+
function getMigrationPath(currentVersion, targetVersion) {
|
|
100
|
+
// Fresh install (no current version)
|
|
101
|
+
if (!currentVersion) {
|
|
102
|
+
return {
|
|
103
|
+
type: 'fresh-install',
|
|
104
|
+
needsMigration: false,
|
|
105
|
+
breaking: false
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Already up to date
|
|
110
|
+
if (currentVersion === targetVersion) {
|
|
111
|
+
return {
|
|
112
|
+
type: 'up-to-date',
|
|
113
|
+
needsMigration: false,
|
|
114
|
+
breaking: false
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Downgrade attempt (not supported)
|
|
119
|
+
if (compareVersions(currentVersion, targetVersion) > 0) {
|
|
120
|
+
return {
|
|
121
|
+
type: 'downgrade',
|
|
122
|
+
needsMigration: false,
|
|
123
|
+
breaking: false,
|
|
124
|
+
fromVersion: currentVersion,
|
|
125
|
+
toVersion: targetVersion
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Upgrade needed
|
|
130
|
+
const breaking = isBreakingChange(currentVersion, targetVersion);
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
type: 'upgrade-needed',
|
|
134
|
+
needsMigration: true,
|
|
135
|
+
breaking,
|
|
136
|
+
fromVersion: currentVersion,
|
|
137
|
+
toVersion: targetVersion
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Detect installation scenario
|
|
143
|
+
* @param {string} [projectRoot] - Project root (auto-detected if omitted)
|
|
144
|
+
* @returns {string} Scenario: 'fresh' | 'partial' | 'complete' | 'corrupted'
|
|
145
|
+
*/
|
|
146
|
+
function detectInstallationScenario(projectRoot) {
|
|
147
|
+
if (!projectRoot) {
|
|
148
|
+
projectRoot = findProjectRoot();
|
|
149
|
+
}
|
|
150
|
+
if (!projectRoot) {
|
|
151
|
+
return 'fresh';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const vortexDir = path.join(projectRoot, '_bmad/bme/_vortex');
|
|
155
|
+
const configPath = path.join(vortexDir, 'config.yaml');
|
|
156
|
+
const agentsDir = path.join(vortexDir, 'agents');
|
|
157
|
+
const workflowsDir = path.join(vortexDir, 'workflows');
|
|
158
|
+
|
|
159
|
+
// No vortex directory = fresh install
|
|
160
|
+
if (!fs.existsSync(vortexDir)) {
|
|
161
|
+
return 'fresh';
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// No config.yaml = partial installation
|
|
165
|
+
if (!fs.existsSync(configPath)) {
|
|
166
|
+
return 'partial';
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Check agent files
|
|
170
|
+
const requiredAgents = [
|
|
171
|
+
'contextualization-expert.md',
|
|
172
|
+
'lean-experiments-specialist.md'
|
|
173
|
+
];
|
|
174
|
+
|
|
175
|
+
if (!fs.existsSync(agentsDir)) {
|
|
176
|
+
return 'corrupted';
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const missingAgents = requiredAgents.filter(agent =>
|
|
180
|
+
!fs.existsSync(path.join(agentsDir, agent))
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
if (missingAgents.length > 0) {
|
|
184
|
+
return 'corrupted';
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Check workflows directory
|
|
188
|
+
if (!fs.existsSync(workflowsDir)) {
|
|
189
|
+
return 'corrupted';
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return 'complete';
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Determine if upgrade involves breaking changes
|
|
197
|
+
* @param {string} fromVersion - Current version
|
|
198
|
+
* @param {string} toVersion - Target version
|
|
199
|
+
* @returns {boolean} True if breaking changes exist
|
|
200
|
+
*/
|
|
201
|
+
function isBreakingChange(fromVersion, toVersion) {
|
|
202
|
+
// v1.0.x → any later version = breaking (empathy-map removed)
|
|
203
|
+
if (fromVersion.startsWith('1.0.')) {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// v1.1.x → v1.2.0 = not breaking (just updates)
|
|
208
|
+
if (fromVersion.startsWith('1.1.') && toVersion.startsWith('1.2.')) {
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Major version change = breaking
|
|
213
|
+
const fromMajor = parseInt(fromVersion.split('.')[0]);
|
|
214
|
+
const toMajor = parseInt(toVersion.split('.')[0]);
|
|
215
|
+
|
|
216
|
+
if (fromMajor < toMajor) {
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Get version range pattern for migrations (e.g., "1.0.x")
|
|
225
|
+
* @param {string} version - Full version string
|
|
226
|
+
* @returns {string} Version range pattern
|
|
227
|
+
*/
|
|
228
|
+
function getVersionRange(version) {
|
|
229
|
+
const parts = version.split('.');
|
|
230
|
+
return `${parts[0]}.${parts[1]}.x`;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
module.exports = {
|
|
234
|
+
getCurrentVersion,
|
|
235
|
+
getTargetVersion,
|
|
236
|
+
getMigrationPath,
|
|
237
|
+
detectInstallationScenario,
|
|
238
|
+
isBreakingChange,
|
|
239
|
+
getVersionRange,
|
|
240
|
+
guessVersionFromFileStructure
|
|
241
|
+
};
|