specweave 0.21.2 → 0.22.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.md +429 -10
- package/README.md +33 -3
- package/dist/plugins/specweave-github/lib/CodeValidator.d.ts +101 -0
- package/dist/plugins/specweave-github/lib/CodeValidator.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/CodeValidator.js +219 -0
- package/dist/plugins/specweave-github/lib/CodeValidator.js.map +1 -0
- package/dist/plugins/specweave-github/lib/IssueStateManager.d.ts +98 -0
- package/dist/plugins/specweave-github/lib/IssueStateManager.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/IssueStateManager.js +146 -0
- package/dist/plugins/specweave-github/lib/IssueStateManager.js.map +1 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts +182 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js +603 -0
- package/dist/plugins/specweave-github/lib/ThreeLayerSyncManager.js.map +1 -0
- package/dist/plugins/specweave-github/lib/types.d.ts +34 -0
- package/dist/plugins/specweave-github/lib/types.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.js +6 -0
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.js.map +1 -1
- package/dist/src/cli/commands/check-hooks.d.ts +11 -0
- package/dist/src/cli/commands/check-hooks.d.ts.map +1 -0
- package/dist/src/cli/commands/check-hooks.js +144 -0
- package/dist/src/cli/commands/check-hooks.js.map +1 -0
- package/dist/src/cli/commands/cicd-monitor.js +3 -3
- package/dist/src/cli/commands/cicd-monitor.js.map +1 -1
- package/dist/src/cli/commands/import-docs.js +2 -2
- package/dist/src/cli/commands/import-docs.js.map +1 -1
- package/dist/src/cli/commands/init-multiproject.js +4 -4
- package/dist/src/cli/commands/init-multiproject.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +60 -5
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/migrate-to-multiproject.js +3 -3
- package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -1
- package/dist/src/cli/commands/plan/agent-invoker.d.ts +79 -0
- package/dist/src/cli/commands/plan/agent-invoker.d.ts.map +1 -0
- package/dist/src/cli/commands/plan/agent-invoker.js +383 -0
- package/dist/src/cli/commands/plan/agent-invoker.js.map +1 -0
- package/dist/src/cli/commands/plan/increment-detector.d.ts +27 -0
- package/dist/src/cli/commands/plan/increment-detector.d.ts.map +1 -0
- package/dist/src/cli/commands/plan/increment-detector.js +159 -0
- package/dist/src/cli/commands/plan/increment-detector.js.map +1 -0
- package/dist/src/cli/commands/plan/plan-orchestrator.d.ts +45 -0
- package/dist/src/cli/commands/plan/plan-orchestrator.d.ts.map +1 -0
- package/dist/src/cli/commands/plan/plan-orchestrator.js +229 -0
- package/dist/src/cli/commands/plan/plan-orchestrator.js.map +1 -0
- package/dist/src/cli/commands/plan/plan-validator.d.ts +36 -0
- package/dist/src/cli/commands/plan/plan-validator.d.ts.map +1 -0
- package/dist/src/cli/commands/plan/plan-validator.js +174 -0
- package/dist/src/cli/commands/plan/plan-validator.js.map +1 -0
- package/dist/src/cli/commands/plan/types.d.ts +170 -0
- package/dist/src/cli/commands/plan/types.d.ts.map +1 -0
- package/dist/src/cli/commands/plan/types.js +42 -0
- package/dist/src/cli/commands/plan/types.js.map +1 -0
- package/dist/src/cli/commands/plan-command.d.ts +16 -0
- package/dist/src/cli/commands/plan-command.d.ts.map +1 -0
- package/dist/src/cli/commands/plan-command.js +127 -0
- package/dist/src/cli/commands/plan-command.js.map +1 -0
- package/dist/src/cli/commands/switch-project.js +3 -3
- package/dist/src/cli/commands/switch-project.js.map +1 -1
- package/dist/src/cli/commands/validate-parent-repo.js +1 -1
- package/dist/src/cli/commands/validate-parent-repo.js.map +1 -1
- package/dist/src/config/ConfigManager.d.ts +69 -0
- package/dist/src/config/ConfigManager.d.ts.map +1 -0
- package/dist/src/config/ConfigManager.js +130 -0
- package/dist/src/config/ConfigManager.js.map +1 -0
- package/dist/src/config/types.d.ts +1357 -0
- package/dist/src/config/types.d.ts.map +1 -0
- package/dist/src/config/types.js +67 -0
- package/dist/src/config/types.js.map +1 -0
- package/dist/src/core/brownfield/importer.d.ts +1 -1
- package/dist/src/core/brownfield/importer.d.ts.map +1 -1
- package/dist/src/core/brownfield/importer.js +3 -3
- package/dist/src/core/brownfield/importer.js.map +1 -1
- package/dist/src/core/cicd/config-loader.d.ts +1 -1
- package/dist/src/core/cicd/config-loader.d.ts.map +1 -1
- package/dist/src/core/cicd/index.d.ts +6 -6
- package/dist/src/core/cicd/index.d.ts.map +1 -1
- package/dist/src/core/cicd/index.js +6 -6
- package/dist/src/core/cicd/index.js.map +1 -1
- package/dist/src/core/cicd/monitor-service.d.ts +3 -3
- package/dist/src/core/cicd/monitor-service.d.ts.map +1 -1
- package/dist/src/core/cicd/monitor-service.js +3 -3
- package/dist/src/core/cicd/monitor-service.js.map +1 -1
- package/dist/src/core/cicd/notifier.d.ts +1 -1
- package/dist/src/core/cicd/notifier.d.ts.map +1 -1
- package/dist/src/core/cicd/state-manager.d.ts +1 -1
- package/dist/src/core/cicd/state-manager.d.ts.map +1 -1
- package/dist/src/core/cicd/state-manager.js +1 -1
- package/dist/src/core/cicd/state-manager.js.map +1 -1
- package/dist/src/core/cicd/workflow-monitor.d.ts +1 -1
- package/dist/src/core/cicd/workflow-monitor.d.ts.map +1 -1
- package/dist/src/core/cicd/workflow-monitor.js +1 -1
- package/dist/src/core/cicd/workflow-monitor.js.map +1 -1
- package/dist/src/core/cost-tracker.d.ts +2 -2
- package/dist/src/core/cost-tracker.d.ts.map +1 -1
- package/dist/src/core/cost-tracker.js +1 -1
- package/dist/src/core/cost-tracker.js.map +1 -1
- package/dist/src/core/hooks/HealthReporter.d.ts +55 -0
- package/dist/src/core/hooks/HealthReporter.d.ts.map +1 -0
- package/dist/src/core/hooks/HealthReporter.js +268 -0
- package/dist/src/core/hooks/HealthReporter.js.map +1 -0
- package/dist/src/core/hooks/HookAutoFixer.d.ts +41 -0
- package/dist/src/core/hooks/HookAutoFixer.d.ts.map +1 -0
- package/dist/src/core/hooks/HookAutoFixer.js +222 -0
- package/dist/src/core/hooks/HookAutoFixer.js.map +1 -0
- package/dist/src/core/hooks/HookExecutor.d.ts +57 -0
- package/dist/src/core/hooks/HookExecutor.d.ts.map +1 -0
- package/dist/src/core/hooks/HookExecutor.js +287 -0
- package/dist/src/core/hooks/HookExecutor.js.map +1 -0
- package/dist/src/core/hooks/HookHealthChecker.d.ts +51 -0
- package/dist/src/core/hooks/HookHealthChecker.d.ts.map +1 -0
- package/dist/src/core/hooks/HookHealthChecker.js +212 -0
- package/dist/src/core/hooks/HookHealthChecker.js.map +1 -0
- package/dist/src/core/hooks/HookScanner.d.ts +65 -0
- package/dist/src/core/hooks/HookScanner.d.ts.map +1 -0
- package/dist/src/core/hooks/HookScanner.js +214 -0
- package/dist/src/core/hooks/HookScanner.js.map +1 -0
- package/dist/src/core/hooks/types.d.ts +281 -0
- package/dist/src/core/hooks/types.d.ts.map +1 -0
- package/dist/src/core/hooks/types.js +10 -0
- package/dist/src/core/hooks/types.js.map +1 -0
- package/dist/src/core/iac/index.d.ts +10 -0
- package/dist/src/core/iac/index.d.ts.map +1 -0
- package/dist/src/core/iac/index.js +11 -0
- package/dist/src/core/iac/index.js.map +1 -0
- package/dist/src/core/iac/template-engine.d.ts +77 -0
- package/dist/src/core/iac/template-engine.d.ts.map +1 -0
- package/dist/src/core/iac/template-engine.js +182 -0
- package/dist/src/core/iac/template-engine.js.map +1 -0
- package/dist/src/core/increment/ac-status-manager.d.ts +115 -0
- package/dist/src/core/increment/ac-status-manager.d.ts.map +1 -0
- package/dist/src/core/increment/ac-status-manager.js +343 -0
- package/dist/src/core/increment/ac-status-manager.js.map +1 -0
- package/dist/src/core/increment/auto-transition-manager.d.ts +60 -0
- package/dist/src/core/increment/auto-transition-manager.d.ts.map +1 -0
- package/dist/src/core/increment/auto-transition-manager.js +192 -0
- package/dist/src/core/increment/auto-transition-manager.js.map +1 -0
- package/dist/src/core/increment/limits.d.ts +1 -1
- package/dist/src/core/increment/limits.d.ts.map +1 -1
- package/dist/src/core/increment/limits.js +2 -2
- package/dist/src/core/increment/limits.js.map +1 -1
- package/dist/src/core/increment/spec-sync-manager.d.ts +177 -0
- package/dist/src/core/increment/spec-sync-manager.d.ts.map +1 -0
- package/dist/src/core/increment/spec-sync-manager.js +496 -0
- package/dist/src/core/increment/spec-sync-manager.js.map +1 -0
- package/dist/src/core/increment/status-auto-transition.d.ts +46 -0
- package/dist/src/core/increment/status-auto-transition.d.ts.map +1 -0
- package/dist/src/core/increment/status-auto-transition.js +178 -0
- package/dist/src/core/increment/status-auto-transition.js.map +1 -0
- package/dist/src/core/increment/task-state-manager.d.ts +75 -0
- package/dist/src/core/increment/task-state-manager.d.ts.map +1 -0
- package/dist/src/core/increment/task-state-manager.js +117 -0
- package/dist/src/core/increment/task-state-manager.js.map +1 -0
- package/dist/src/core/living-docs/CodeValidator.d.ts +68 -0
- package/dist/src/core/living-docs/CodeValidator.d.ts.map +1 -0
- package/dist/src/core/living-docs/CodeValidator.js +160 -0
- package/dist/src/core/living-docs/CodeValidator.js.map +1 -0
- package/dist/src/core/living-docs/CompletionPropagator.d.ts +84 -0
- package/dist/src/core/living-docs/CompletionPropagator.d.ts.map +1 -0
- package/dist/src/core/living-docs/CompletionPropagator.js +206 -0
- package/dist/src/core/living-docs/CompletionPropagator.js.map +1 -0
- package/dist/src/core/living-docs/ProjectDetector.d.ts +29 -0
- package/dist/src/core/living-docs/ProjectDetector.d.ts.map +1 -0
- package/dist/src/core/living-docs/ProjectDetector.js +94 -0
- package/dist/src/core/living-docs/ProjectDetector.js.map +1 -0
- package/dist/src/core/living-docs/SpecDistributor.d.ts +60 -0
- package/dist/src/core/living-docs/SpecDistributor.d.ts.map +1 -0
- package/dist/src/core/living-docs/SpecDistributor.js +228 -0
- package/dist/src/core/living-docs/SpecDistributor.js.map +1 -0
- package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts +116 -0
- package/dist/src/core/living-docs/ThreeLayerSyncManager.d.ts.map +1 -0
- package/dist/src/core/living-docs/ThreeLayerSyncManager.js +356 -0
- package/dist/src/core/living-docs/ThreeLayerSyncManager.js.map +1 -0
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts.map +1 -1
- package/dist/src/core/living-docs/hierarchy-mapper.js +2 -1
- package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -1
- package/dist/src/core/living-docs/index.d.ts +1 -1
- package/dist/src/core/living-docs/index.d.ts.map +1 -1
- package/dist/src/core/living-docs/index.js +5 -1
- package/dist/src/core/living-docs/index.js.map +1 -1
- package/dist/src/core/living-docs/project-detector.d.ts.map +1 -1
- package/dist/src/core/living-docs/project-detector.js +38 -0
- package/dist/src/core/living-docs/project-detector.js.map +1 -1
- package/dist/src/core/living-docs/types.d.ts +70 -300
- package/dist/src/core/living-docs/types.d.ts.map +1 -1
- package/dist/src/core/living-docs/types.js +2 -10
- package/dist/src/core/living-docs/types.js.map +1 -1
- package/dist/src/core/project-manager.d.ts +1 -1
- package/dist/src/core/project-manager.d.ts.map +1 -1
- package/dist/src/core/project-manager.js +2 -2
- package/dist/src/core/project-manager.js.map +1 -1
- package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
- package/dist/src/core/qa/quality-gate-decider.d.ts.map +1 -1
- package/dist/src/core/qa/risk-calculator.d.ts +1 -1
- package/dist/src/core/qa/risk-calculator.d.ts.map +1 -1
- package/dist/src/core/repo-structure/setup-summary.d.ts +1 -1
- package/dist/src/core/repo-structure/setup-summary.d.ts.map +1 -1
- package/dist/src/core/rfc-generator-v2.d.ts +1 -1
- package/dist/src/core/rfc-generator-v2.d.ts.map +1 -1
- package/dist/src/core/rfc-generator-v2.js +1 -1
- package/dist/src/core/rfc-generator-v2.js.map +1 -1
- package/dist/src/core/serverless/context-detector.d.ts +12 -0
- package/dist/src/core/serverless/context-detector.d.ts.map +1 -0
- package/dist/src/core/serverless/context-detector.js +213 -0
- package/dist/src/core/serverless/context-detector.js.map +1 -0
- package/dist/src/core/serverless/cost-comparison.d.ts +73 -0
- package/dist/src/core/serverless/cost-comparison.d.ts.map +1 -0
- package/dist/src/core/serverless/cost-comparison.js +198 -0
- package/dist/src/core/serverless/cost-comparison.js.map +1 -0
- package/dist/src/core/serverless/cost-estimator.d.ts +69 -0
- package/dist/src/core/serverless/cost-estimator.d.ts.map +1 -0
- package/dist/src/core/serverless/cost-estimator.js +127 -0
- package/dist/src/core/serverless/cost-estimator.js.map +1 -0
- package/dist/src/core/serverless/cost-optimizer.d.ts +57 -0
- package/dist/src/core/serverless/cost-optimizer.d.ts.map +1 -0
- package/dist/src/core/serverless/cost-optimizer.js +221 -0
- package/dist/src/core/serverless/cost-optimizer.js.map +1 -0
- package/dist/src/core/serverless/index.d.ts +20 -0
- package/dist/src/core/serverless/index.d.ts.map +1 -0
- package/dist/src/core/serverless/index.js +26 -0
- package/dist/src/core/serverless/index.js.map +1 -0
- package/dist/src/core/serverless/learning-path-recommender.d.ts +152 -0
- package/dist/src/core/serverless/learning-path-recommender.d.ts.map +1 -0
- package/dist/src/core/serverless/learning-path-recommender.js +389 -0
- package/dist/src/core/serverless/learning-path-recommender.js.map +1 -0
- package/dist/src/core/serverless/platform-data-loader.d.ts +22 -0
- package/dist/src/core/serverless/platform-data-loader.d.ts.map +1 -0
- package/dist/src/core/serverless/platform-data-loader.js +49 -0
- package/dist/src/core/serverless/platform-data-loader.js.map +1 -0
- package/dist/src/core/serverless/platform-selector.d.ts +20 -0
- package/dist/src/core/serverless/platform-selector.d.ts.map +1 -0
- package/dist/src/core/serverless/platform-selector.js +279 -0
- package/dist/src/core/serverless/platform-selector.js.map +1 -0
- package/dist/src/core/serverless/recommendation-formatter.d.ts +24 -0
- package/dist/src/core/serverless/recommendation-formatter.d.ts.map +1 -0
- package/dist/src/core/serverless/recommendation-formatter.js +70 -0
- package/dist/src/core/serverless/recommendation-formatter.js.map +1 -0
- package/dist/src/core/serverless/suitability-analyzer.d.ts +22 -0
- package/dist/src/core/serverless/suitability-analyzer.d.ts.map +1 -0
- package/dist/src/core/serverless/suitability-analyzer.js +262 -0
- package/dist/src/core/serverless/suitability-analyzer.js.map +1 -0
- package/dist/src/core/serverless/types.d.ts +96 -0
- package/dist/src/core/serverless/types.d.ts.map +1 -0
- package/dist/src/core/serverless/types.js +5 -0
- package/dist/src/core/serverless/types.js.map +1 -0
- package/dist/src/core/sync/bidirectional-engine.d.ts +1 -1
- package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
- package/dist/src/core/sync/enhanced-content-builder.d.ts +1 -1
- package/dist/src/core/sync/enhanced-content-builder.d.ts.map +1 -1
- package/dist/src/core/sync/profile-manager.d.ts +1 -1
- package/dist/src/core/sync/profile-manager.d.ts.map +1 -1
- package/dist/src/core/sync/profile-selector.d.ts +1 -1
- package/dist/src/core/sync/profile-selector.d.ts.map +1 -1
- package/dist/src/core/sync/profile-selector.js +1 -1
- package/dist/src/core/sync/profile-selector.js.map +1 -1
- package/dist/src/core/sync/project-context.d.ts +1 -1
- package/dist/src/core/sync/project-context.d.ts.map +1 -1
- package/dist/src/core/sync/rate-limiter.d.ts +1 -1
- package/dist/src/core/sync/rate-limiter.d.ts.map +1 -1
- package/dist/src/core/sync/status-sync-engine.d.ts +2 -2
- package/dist/src/core/sync/status-sync-engine.d.ts.map +1 -1
- package/dist/src/core/sync/status-sync-engine.js +2 -2
- package/dist/src/core/sync/status-sync-engine.js.map +1 -1
- package/dist/src/core/sync/time-range-selector.d.ts +1 -1
- package/dist/src/core/sync/time-range-selector.d.ts.map +1 -1
- package/dist/src/core/sync/time-range-selector.js +1 -1
- package/dist/src/core/sync/time-range-selector.js.map +1 -1
- package/dist/src/core/types/config.d.ts +23 -0
- package/dist/src/core/types/config.d.ts.map +1 -1
- package/dist/src/core/types/config.js +10 -0
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/core/types/increment-metadata.d.ts +27 -0
- package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
- package/dist/src/core/types/increment-metadata.js +45 -1
- package/dist/src/core/types/increment-metadata.js.map +1 -1
- package/dist/src/core/types/sync-profile.d.ts +2 -0
- package/dist/src/core/types/sync-profile.d.ts.map +1 -1
- package/dist/src/core/types/sync-profile.js.map +1 -1
- package/dist/src/core/validation/increment-structure-validator.d.ts +47 -0
- package/dist/src/core/validation/increment-structure-validator.d.ts.map +1 -0
- package/dist/src/core/validation/increment-structure-validator.js +187 -0
- package/dist/src/core/validation/increment-structure-validator.js.map +1 -0
- package/dist/src/core/validation/three-file-validator.d.ts +82 -0
- package/dist/src/core/validation/three-file-validator.d.ts.map +1 -0
- package/dist/src/core/validation/three-file-validator.js +320 -0
- package/dist/src/core/validation/three-file-validator.js.map +1 -0
- package/dist/src/core/workflow/phase-detector.d.ts +103 -0
- package/dist/src/core/workflow/phase-detector.d.ts.map +1 -0
- package/dist/src/core/workflow/phase-detector.js +704 -0
- package/dist/src/core/workflow/phase-detector.js.map +1 -0
- package/dist/src/core/workflow/types.d.ts +153 -0
- package/dist/src/core/workflow/types.d.ts.map +1 -0
- package/dist/src/core/workflow/types.js +47 -0
- package/dist/src/core/workflow/types.js.map +1 -0
- package/dist/src/init/ArchitecturePresenter.d.ts +47 -0
- package/dist/src/init/ArchitecturePresenter.d.ts.map +1 -0
- package/dist/src/init/ArchitecturePresenter.js +180 -0
- package/dist/src/init/ArchitecturePresenter.js.map +1 -0
- package/dist/src/init/InitFlow.d.ts +37 -0
- package/dist/src/init/InitFlow.d.ts.map +1 -0
- package/dist/src/init/InitFlow.js +238 -0
- package/dist/src/init/InitFlow.js.map +1 -0
- package/dist/src/init/architecture/ArchitectureDecisionEngine.d.ts +107 -0
- package/dist/src/init/architecture/ArchitectureDecisionEngine.d.ts.map +1 -0
- package/dist/src/init/architecture/ArchitectureDecisionEngine.js +405 -0
- package/dist/src/init/architecture/ArchitectureDecisionEngine.js.map +1 -0
- package/dist/src/init/architecture/CloudCreditsDatabase.d.ts +11 -0
- package/dist/src/init/architecture/CloudCreditsDatabase.d.ts.map +1 -0
- package/dist/src/init/architecture/CloudCreditsDatabase.js +92 -0
- package/dist/src/init/architecture/CloudCreditsDatabase.js.map +1 -0
- package/dist/src/init/architecture/CostEstimator.d.ts +52 -0
- package/dist/src/init/architecture/CostEstimator.d.ts.map +1 -0
- package/dist/src/init/architecture/CostEstimator.js +107 -0
- package/dist/src/init/architecture/CostEstimator.js.map +1 -0
- package/dist/src/init/architecture/InfrastructureMapper.d.ts +41 -0
- package/dist/src/init/architecture/InfrastructureMapper.d.ts.map +1 -0
- package/dist/src/init/architecture/InfrastructureMapper.js +140 -0
- package/dist/src/init/architecture/InfrastructureMapper.js.map +1 -0
- package/dist/src/init/architecture/ProjectGenerator.d.ts +44 -0
- package/dist/src/init/architecture/ProjectGenerator.d.ts.map +1 -0
- package/dist/src/init/architecture/ProjectGenerator.js +216 -0
- package/dist/src/init/architecture/ProjectGenerator.js.map +1 -0
- package/dist/src/init/architecture/types.d.ts +251 -0
- package/dist/src/init/architecture/types.d.ts.map +1 -0
- package/dist/src/init/architecture/types.js +54 -0
- package/dist/src/init/architecture/types.js.map +1 -0
- package/dist/src/init/compliance/ComplianceDetector.d.ts +17 -0
- package/dist/src/init/compliance/ComplianceDetector.d.ts.map +1 -0
- package/dist/src/init/compliance/ComplianceDetector.js +64 -0
- package/dist/src/init/compliance/ComplianceDetector.js.map +1 -0
- package/dist/src/init/compliance/standards-database.d.ts +48 -0
- package/dist/src/init/compliance/standards-database.d.ts.map +1 -0
- package/dist/src/init/compliance/standards-database.js +506 -0
- package/dist/src/init/compliance/standards-database.js.map +1 -0
- package/dist/src/init/compliance/types.d.ts +91 -0
- package/dist/src/init/compliance/types.d.ts.map +1 -0
- package/dist/src/init/compliance/types.js +43 -0
- package/dist/src/init/compliance/types.js.map +1 -0
- package/dist/src/init/repo/GitHubAPIClient.d.ts +51 -0
- package/dist/src/init/repo/GitHubAPIClient.d.ts.map +1 -0
- package/dist/src/init/repo/GitHubAPIClient.js +144 -0
- package/dist/src/init/repo/GitHubAPIClient.js.map +1 -0
- package/dist/src/init/repo/RepositorySelector.d.ts +45 -0
- package/dist/src/init/repo/RepositorySelector.d.ts.map +1 -0
- package/dist/src/init/repo/RepositorySelector.js +106 -0
- package/dist/src/init/repo/RepositorySelector.js.map +1 -0
- package/dist/src/init/repo/types.d.ts +95 -0
- package/dist/src/init/repo/types.d.ts.map +1 -0
- package/dist/src/init/repo/types.js +25 -0
- package/dist/src/init/repo/types.js.map +1 -0
- package/dist/src/init/research/CompetitorAnalyzer.d.ts +79 -0
- package/dist/src/init/research/CompetitorAnalyzer.d.ts.map +1 -0
- package/dist/src/init/research/CompetitorAnalyzer.js +265 -0
- package/dist/src/init/research/CompetitorAnalyzer.js.map +1 -0
- package/dist/src/init/research/MarketDetector.d.ts +62 -0
- package/dist/src/init/research/MarketDetector.d.ts.map +1 -0
- package/dist/src/init/research/MarketDetector.js +247 -0
- package/dist/src/init/research/MarketDetector.js.map +1 -0
- package/dist/src/init/research/OpportunityScorer.d.ts +58 -0
- package/dist/src/init/research/OpportunityScorer.d.ts.map +1 -0
- package/dist/src/init/research/OpportunityScorer.js +194 -0
- package/dist/src/init/research/OpportunityScorer.js.map +1 -0
- package/dist/src/init/research/QuestionGenerator.d.ts +68 -0
- package/dist/src/init/research/QuestionGenerator.d.ts.map +1 -0
- package/dist/src/init/research/QuestionGenerator.js +244 -0
- package/dist/src/init/research/QuestionGenerator.js.map +1 -0
- package/dist/src/init/research/ReportGenerator.d.ts +36 -0
- package/dist/src/init/research/ReportGenerator.d.ts.map +1 -0
- package/dist/src/init/research/ReportGenerator.js +125 -0
- package/dist/src/init/research/ReportGenerator.js.map +1 -0
- package/dist/src/init/research/VisionAnalyzer.d.ts +129 -0
- package/dist/src/init/research/VisionAnalyzer.d.ts.map +1 -0
- package/dist/src/init/research/VisionAnalyzer.js +212 -0
- package/dist/src/init/research/VisionAnalyzer.js.map +1 -0
- package/dist/src/init/research/keyword-extractor.d.ts +78 -0
- package/dist/src/init/research/keyword-extractor.d.ts.map +1 -0
- package/dist/src/init/research/keyword-extractor.js +230 -0
- package/dist/src/init/research/keyword-extractor.js.map +1 -0
- package/dist/src/init/research/src/config/ConfigManager.d.ts +14 -0
- package/dist/src/init/research/src/config/ConfigManager.d.ts.map +1 -0
- package/dist/src/init/research/src/config/ConfigManager.js +45 -0
- package/dist/src/init/research/src/config/ConfigManager.js.map +1 -0
- package/dist/src/init/research/src/config/types.d.ts +102 -0
- package/dist/src/init/research/src/config/types.d.ts.map +1 -0
- package/dist/src/init/research/src/config/types.js +24 -0
- package/dist/src/init/research/src/config/types.js.map +1 -0
- package/dist/src/init/research/types.d.ts +183 -0
- package/dist/src/init/research/types.d.ts.map +1 -0
- package/dist/src/init/research/types.js +65 -0
- package/dist/src/init/research/types.js.map +1 -0
- package/dist/src/init/team/ServerlessSavingsCalculator.d.ts +136 -0
- package/dist/src/init/team/ServerlessSavingsCalculator.d.ts.map +1 -0
- package/dist/src/init/team/ServerlessSavingsCalculator.js +360 -0
- package/dist/src/init/team/ServerlessSavingsCalculator.js.map +1 -0
- package/dist/src/init/team/TeamRecommender.d.ts +122 -0
- package/dist/src/init/team/TeamRecommender.d.ts.map +1 -0
- package/dist/src/init/team/TeamRecommender.js +405 -0
- package/dist/src/init/team/TeamRecommender.js.map +1 -0
- package/dist/src/init/team/types.d.ts +95 -0
- package/dist/src/init/team/types.d.ts.map +1 -0
- package/dist/src/init/team/types.js +23 -0
- package/dist/src/init/team/types.js.map +1 -0
- package/dist/src/integrations/jira/jira-mapper.d.ts +1 -1
- package/dist/src/integrations/jira/jira-mapper.d.ts.map +1 -1
- package/dist/src/types/cost-tracking.d.ts +1 -1
- package/dist/src/types/cost-tracking.d.ts.map +1 -1
- package/dist/src/utils/cost-reporter.d.ts +2 -2
- package/dist/src/utils/cost-reporter.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/config-generator.d.ts +1 -1
- package/dist/src/utils/docs-preview/config-generator.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/config-generator.js +1 -1
- package/dist/src/utils/docs-preview/docusaurus-setup.d.ts +1 -1
- package/dist/src/utils/docs-preview/docusaurus-setup.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/docusaurus-setup.js +4 -4
- package/dist/src/utils/docs-preview/docusaurus-setup.js.map +1 -1
- package/dist/src/utils/docs-preview/index.d.ts +6 -6
- package/dist/src/utils/docs-preview/index.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/index.js +6 -6
- package/dist/src/utils/docs-preview/index.js.map +1 -1
- package/dist/src/utils/docs-preview/package-installer.d.ts +1 -1
- package/dist/src/utils/docs-preview/package-installer.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/package-installer.js +1 -1
- package/dist/src/utils/docs-preview/package-installer.js.map +1 -1
- package/dist/src/utils/docs-preview/server-manager.d.ts +1 -1
- package/dist/src/utils/docs-preview/server-manager.d.ts.map +1 -1
- package/dist/src/utils/docs-preview/server-manager.js +1 -1
- package/dist/src/utils/docs-preview/server-manager.js.map +1 -1
- package/dist/src/utils/docs-preview/sidebar-builder.d.ts +1 -1
- package/dist/src/utils/docs-preview/sidebar-builder.d.ts.map +1 -1
- package/dist/src/utils/generate-skills-index.d.ts +1 -1
- package/dist/src/utils/generate-skills-index.js +1 -1
- package/dist/src/utils/project-detection.js +1 -1
- package/dist/src/utils/project-detection.js.map +1 -1
- package/package.json +17 -10
- package/plugins/specweave/agents/architect/AGENT.md +605 -0
- package/plugins/specweave/agents/infrastructure/AGENT.md +760 -0
- package/plugins/specweave/agents/pm/AGENT.md +14 -13
- package/plugins/specweave/commands/specweave-check-hooks.md +186 -0
- package/plugins/specweave/commands/specweave-plan.md +151 -0
- package/plugins/specweave/commands/specweave-sync-acs.md +342 -0
- package/plugins/specweave/commands/specweave-validate.md +60 -11
- package/plugins/specweave/hooks/lib/update-status-line.sh +8 -4
- package/plugins/specweave/hooks/post-increment-change.sh +4 -0
- package/plugins/specweave/hooks/post-increment-completion.sh +7 -1
- package/plugins/specweave/hooks/post-increment-planning.sh +4 -0
- package/plugins/specweave/hooks/post-increment-status-change.sh +4 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +78 -0
- package/plugins/specweave/iac-templates/aws-lambda/README.md.hbs +280 -0
- package/plugins/specweave/iac-templates/aws-lambda/defaults.json +118 -0
- package/plugins/specweave/iac-templates/aws-lambda/environments/dev.defaults.json +46 -0
- package/plugins/specweave/iac-templates/aws-lambda/environments/prod.defaults.json +67 -0
- package/plugins/specweave/iac-templates/aws-lambda/environments/staging.defaults.json +47 -0
- package/plugins/specweave/iac-templates/aws-lambda/main.tf.hbs +241 -0
- package/plugins/specweave/iac-templates/aws-lambda/outputs.tf.hbs +61 -0
- package/plugins/specweave/iac-templates/aws-lambda/provider.tf.hbs +15 -0
- package/plugins/specweave/iac-templates/aws-lambda/variables.tf.hbs +88 -0
- package/plugins/specweave/iac-templates/azure-functions/README.md.hbs +315 -0
- package/plugins/specweave/iac-templates/azure-functions/defaults.json +65 -0
- package/plugins/specweave/iac-templates/azure-functions/environments/dev.defaults.json +30 -0
- package/plugins/specweave/iac-templates/azure-functions/environments/prod.defaults.json +34 -0
- package/plugins/specweave/iac-templates/azure-functions/environments/staging.defaults.json +31 -0
- package/plugins/specweave/iac-templates/azure-functions/iam.tf.hbs +34 -0
- package/plugins/specweave/iac-templates/azure-functions/main.tf.hbs +247 -0
- package/plugins/specweave/iac-templates/azure-functions/outputs.tf.hbs +72 -0
- package/plugins/specweave/iac-templates/azure-functions/provider.tf.hbs +14 -0
- package/plugins/specweave/iac-templates/azure-functions/variables.tf.hbs +64 -0
- package/plugins/specweave/iac-templates/firebase/README.md.hbs +487 -0
- package/plugins/specweave/iac-templates/firebase/defaults.json +55 -0
- package/plugins/specweave/iac-templates/firebase/environments/dev.defaults.json +44 -0
- package/plugins/specweave/iac-templates/firebase/environments/prod.defaults.json +52 -0
- package/plugins/specweave/iac-templates/firebase/environments/staging.defaults.json +43 -0
- package/plugins/specweave/iac-templates/firebase/iam.tf.hbs +75 -0
- package/plugins/specweave/iac-templates/firebase/main.tf.hbs +297 -0
- package/plugins/specweave/iac-templates/firebase/outputs.tf.hbs +67 -0
- package/plugins/specweave/iac-templates/firebase/provider.tf.hbs +26 -0
- package/plugins/specweave/iac-templates/firebase/variables.tf.hbs +68 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/README.md.hbs +330 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/defaults.json +69 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/environments/dev.defaults.json +33 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/environments/prod.defaults.json +40 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/environments/staging.defaults.json +33 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/iam.tf.hbs +54 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/main.tf.hbs +211 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/outputs.tf.hbs +44 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/provider.tf.hbs +14 -0
- package/plugins/specweave/iac-templates/gcp-cloud-functions/variables.tf.hbs +82 -0
- package/plugins/specweave/iac-templates/supabase/README.md.hbs +534 -0
- package/plugins/specweave/iac-templates/supabase/defaults.json +69 -0
- package/plugins/specweave/iac-templates/supabase/environments/dev.defaults.json +55 -0
- package/plugins/specweave/iac-templates/supabase/environments/prod.defaults.json +75 -0
- package/plugins/specweave/iac-templates/supabase/environments/staging.defaults.json +54 -0
- package/plugins/specweave/iac-templates/supabase/iam.tf.hbs +146 -0
- package/plugins/specweave/iac-templates/supabase/main.tf.hbs +310 -0
- package/plugins/specweave/iac-templates/supabase/outputs.tf.hbs +74 -0
- package/plugins/specweave/iac-templates/supabase/provider.tf.hbs +19 -0
- package/plugins/specweave/iac-templates/supabase/variables.tf.hbs +78 -0
- package/plugins/specweave/knowledge-base/serverless/FRESHNESS.md +69 -0
- package/plugins/specweave/knowledge-base/serverless/learning-paths.json +865 -0
- package/plugins/specweave/knowledge-base/serverless/platforms/aws-lambda.json +41 -0
- package/plugins/specweave/knowledge-base/serverless/platforms/azure-functions.json +41 -0
- package/plugins/specweave/knowledge-base/serverless/platforms/firebase.json +46 -0
- package/plugins/specweave/knowledge-base/serverless/platforms/gcp-cloud-functions.json +41 -0
- package/plugins/specweave/knowledge-base/serverless/platforms/supabase.json +41 -0
- package/plugins/specweave/knowledge-base/serverless/schema.json +155 -0
- package/plugins/specweave/lib/hooks/auto-transition.js +50 -0
- package/plugins/specweave/lib/hooks/auto-transition.ts +84 -0
- package/plugins/specweave/lib/hooks/invoke-translator-skill.js +1 -1
- package/plugins/specweave/lib/hooks/invoke-translator-skill.ts +1 -1
- package/plugins/specweave/lib/hooks/sync-living-docs.js +4 -31
- package/plugins/specweave/lib/hooks/{sync-living-docs.ts → sync-living-docs.ts.DISABLED} +9 -48
- package/plugins/specweave/lib/hooks/translate-file.js +1 -1
- package/plugins/specweave/lib/hooks/translate-file.ts +1 -1
- package/plugins/specweave/lib/hooks/update-ac-status.js +24 -75
- package/plugins/specweave/lib/hooks/update-ac-status.ts +46 -135
- package/plugins/specweave/lib/hooks/update-tasks-md.js +115 -3
- package/plugins/specweave/lib/hooks/update-tasks-md.ts +182 -10
- package/plugins/specweave/lib/utils/validate-dev-setup.sh +133 -0
- package/plugins/specweave/skills/increment-planner/SKILL.md +25 -15
- package/plugins/specweave/skills/serverless-recommender/SKILL.md +368 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/iam.tf.hbs +137 -0
- package/plugins/specweave/templates/iac/aws-lambda/templates/main.tf.hbs +216 -0
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
- package/plugins/specweave-github/lib/CodeValidator.js +195 -0
- package/plugins/specweave-github/lib/CodeValidator.ts +284 -0
- package/plugins/specweave-github/lib/IssueStateManager.js +117 -0
- package/plugins/specweave-github/lib/IssueStateManager.ts +231 -0
- package/plugins/specweave-github/lib/ThreeLayerSyncManager.js +545 -0
- package/plugins/specweave-github/lib/ThreeLayerSyncManager.ts +809 -0
- package/plugins/specweave-github/lib/types.ts +38 -0
- package/plugins/specweave-github/lib/user-story-issue-builder.js +7 -0
- package/plugins/specweave-github/lib/user-story-issue-builder.ts +11 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +1200 -0
- package/plugins/specweave-ui/.mcp.json +0 -10
- package/plugins/specweave-ui/README.md +26 -26
- package/plugins/specweave-ui/skills/browser-automation/SKILL.md +31 -18
- package/src/templates/AGENTS.md.template +22 -1
- package/src/templates/tasks.md.template +51 -33
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts +0 -89
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js +0 -226
- package/dist/plugins/specweave/lib/hooks/git-diff-analyzer.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts +0 -60
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js +0 -201
- package/dist/plugins/specweave/lib/hooks/invoke-translator-skill.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts +0 -42
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js +0 -123
- package/dist/plugins/specweave/lib/hooks/prepare-reflection-context.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts +0 -45
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js +0 -132
- package/dist/plugins/specweave/lib/hooks/reflection-config-loader.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts +0 -33
- package/dist/plugins/specweave/lib/hooks/reflection-parser.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-parser.js +0 -419
- package/dist/plugins/specweave/lib/hooks/reflection-parser.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts +0 -56
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js +0 -239
- package/dist/plugins/specweave/lib/hooks/reflection-prompt-builder.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts +0 -64
- package/dist/plugins/specweave/lib/hooks/reflection-storage.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/reflection-storage.js +0 -305
- package/dist/plugins/specweave/lib/hooks/reflection-storage.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts +0 -43
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.js +0 -203
- package/dist/plugins/specweave/lib/hooks/run-self-reflection.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts +0 -32
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +0 -405
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/translate-file.d.ts +0 -59
- package/dist/plugins/specweave/lib/hooks/translate-file.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/translate-file.js +0 -350
- package/dist/plugins/specweave/lib/hooks/translate-file.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts +0 -13
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.js +0 -175
- package/dist/plugins/specweave/lib/hooks/translate-living-docs.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts +0 -164
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.js +0 -73
- package/dist/plugins/specweave/lib/hooks/types/reflection-types.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/update-ac-status.d.ts +0 -21
- package/dist/plugins/specweave/lib/hooks/update-ac-status.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/update-ac-status.js +0 -162
- package/dist/plugins/specweave/lib/hooks/update-ac-status.js.map +0 -1
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts +0 -29
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.d.ts.map +0 -1
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.js +0 -203
- package/dist/plugins/specweave/lib/hooks/update-tasks-md.js.map +0 -1
- package/dist/src/core/living-docs/spec-distributor.d.ts +0 -180
- package/dist/src/core/living-docs/spec-distributor.d.ts.map +0 -1
- package/dist/src/core/living-docs/spec-distributor.js +0 -1840
- package/dist/src/core/living-docs/spec-distributor.js.map +0 -1
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Validator
|
|
3
|
+
*
|
|
4
|
+
* Validates that completed tasks have actual code implementation.
|
|
5
|
+
* Prevents marking tasks as complete when:
|
|
6
|
+
* - Files don't exist
|
|
7
|
+
* - Files are empty or have trivial content
|
|
8
|
+
* - Implementation is incomplete
|
|
9
|
+
*
|
|
10
|
+
* Used by ThreeLayerSyncManager to enforce code-completion discipline.
|
|
11
|
+
*
|
|
12
|
+
* @module CodeValidator
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import fs from 'fs-extra';
|
|
16
|
+
import path from 'path';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* File validation result
|
|
20
|
+
*/
|
|
21
|
+
export interface FileValidationResult {
|
|
22
|
+
path: string;
|
|
23
|
+
exists: boolean;
|
|
24
|
+
hasContent: boolean;
|
|
25
|
+
lineCount: number;
|
|
26
|
+
reason?: string; // Why validation failed
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Task validation result
|
|
31
|
+
*/
|
|
32
|
+
export interface TaskValidationResult {
|
|
33
|
+
taskId: string;
|
|
34
|
+
valid: boolean;
|
|
35
|
+
files: FileValidationResult[];
|
|
36
|
+
reason?: string; // Summary of why task validation failed
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* CodeValidator options
|
|
41
|
+
*/
|
|
42
|
+
export interface CodeValidatorOptions {
|
|
43
|
+
minLines?: number; // Minimum lines for a file to be considered non-empty (default: 3)
|
|
44
|
+
minChars?: number; // Minimum characters for meaningful content (default: 50)
|
|
45
|
+
projectRoot?: string; // Project root for resolving relative paths
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export class CodeValidator {
|
|
49
|
+
private options: Required<CodeValidatorOptions>;
|
|
50
|
+
|
|
51
|
+
constructor(options: CodeValidatorOptions = {}) {
|
|
52
|
+
this.options = {
|
|
53
|
+
minLines: options.minLines ?? 3,
|
|
54
|
+
minChars: options.minChars ?? 50,
|
|
55
|
+
projectRoot: options.projectRoot ?? process.cwd()
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Validate that code exists for a task
|
|
61
|
+
*
|
|
62
|
+
* Extracts file paths from task description and verifies:
|
|
63
|
+
* 1. Files exist
|
|
64
|
+
* 2. Files have meaningful content
|
|
65
|
+
* 3. Files are not just stubs
|
|
66
|
+
*
|
|
67
|
+
* @param taskDescription - Task description with file paths
|
|
68
|
+
* @param taskId - Task ID for error messages
|
|
69
|
+
* @returns Validation result
|
|
70
|
+
*/
|
|
71
|
+
async validateTask(taskDescription: string, taskId: string): Promise<TaskValidationResult> {
|
|
72
|
+
const filePaths = this.extractFilePaths(taskDescription);
|
|
73
|
+
|
|
74
|
+
if (filePaths.length === 0) {
|
|
75
|
+
// No file paths specified - consider it valid (task might be non-code)
|
|
76
|
+
return {
|
|
77
|
+
taskId,
|
|
78
|
+
valid: true,
|
|
79
|
+
files: [],
|
|
80
|
+
reason: 'No file paths specified in task description'
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const fileResults: FileValidationResult[] = [];
|
|
85
|
+
let allValid = true;
|
|
86
|
+
const reasons: string[] = [];
|
|
87
|
+
|
|
88
|
+
for (const filePath of filePaths) {
|
|
89
|
+
const result = await this.validateFile(filePath);
|
|
90
|
+
fileResults.push(result);
|
|
91
|
+
|
|
92
|
+
if (!result.exists) {
|
|
93
|
+
allValid = false;
|
|
94
|
+
reasons.push(`File not found: ${filePath}`);
|
|
95
|
+
} else if (!result.hasContent) {
|
|
96
|
+
allValid = false;
|
|
97
|
+
reasons.push(`File has no meaningful content: ${filePath} (${result.reason})`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
taskId,
|
|
103
|
+
valid: allValid,
|
|
104
|
+
files: fileResults,
|
|
105
|
+
reason: reasons.length > 0 ? reasons.join('; ') : undefined
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Validate a single file
|
|
111
|
+
*
|
|
112
|
+
* @param filePath - Path to file (relative or absolute)
|
|
113
|
+
* @returns File validation result
|
|
114
|
+
*/
|
|
115
|
+
async validateFile(filePath: string): Promise<FileValidationResult> {
|
|
116
|
+
// Resolve relative paths
|
|
117
|
+
const absolutePath = path.isAbsolute(filePath)
|
|
118
|
+
? filePath
|
|
119
|
+
: path.join(this.options.projectRoot, filePath);
|
|
120
|
+
|
|
121
|
+
// Check if file exists
|
|
122
|
+
const exists = await fs.pathExists(absolutePath);
|
|
123
|
+
if (!exists) {
|
|
124
|
+
return {
|
|
125
|
+
path: filePath,
|
|
126
|
+
exists: false,
|
|
127
|
+
hasContent: false,
|
|
128
|
+
lineCount: 0,
|
|
129
|
+
reason: 'File does not exist'
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Read file content
|
|
134
|
+
const content = await fs.readFile(absolutePath, 'utf-8');
|
|
135
|
+
const lines = content.split('\n');
|
|
136
|
+
const nonEmptyLines = lines.filter(line => line.trim().length > 0);
|
|
137
|
+
|
|
138
|
+
// Check line count
|
|
139
|
+
if (nonEmptyLines.length < this.options.minLines) {
|
|
140
|
+
return {
|
|
141
|
+
path: filePath,
|
|
142
|
+
exists: true,
|
|
143
|
+
hasContent: false,
|
|
144
|
+
lineCount: nonEmptyLines.length,
|
|
145
|
+
reason: `Only ${nonEmptyLines.length} non-empty lines (minimum: ${this.options.minLines})`
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Check character count
|
|
150
|
+
const trimmedContent = content.trim();
|
|
151
|
+
if (trimmedContent.length < this.options.minChars) {
|
|
152
|
+
return {
|
|
153
|
+
path: filePath,
|
|
154
|
+
exists: true,
|
|
155
|
+
hasContent: false,
|
|
156
|
+
lineCount: nonEmptyLines.length,
|
|
157
|
+
reason: `Only ${trimmedContent.length} characters (minimum: ${this.options.minChars})`
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Check for stub patterns (common placeholder patterns)
|
|
162
|
+
const stubPatterns = [
|
|
163
|
+
/^\/\/\s*TODO:/i,
|
|
164
|
+
/^#\s*TODO:/i,
|
|
165
|
+
/^\s*throw new Error\(['"]Not implemented['"]\)/i,
|
|
166
|
+
/^\s*return null;?\s*$/m,
|
|
167
|
+
/^\s*pass\s*$/m, // Python
|
|
168
|
+
/^\s*\.\.\.$/m // TypeScript
|
|
169
|
+
];
|
|
170
|
+
|
|
171
|
+
const isStub = stubPatterns.some(pattern => pattern.test(trimmedContent));
|
|
172
|
+
if (isStub) {
|
|
173
|
+
return {
|
|
174
|
+
path: filePath,
|
|
175
|
+
exists: true,
|
|
176
|
+
hasContent: false,
|
|
177
|
+
lineCount: nonEmptyLines.length,
|
|
178
|
+
reason: 'File contains stub/placeholder code'
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// All checks passed
|
|
183
|
+
return {
|
|
184
|
+
path: filePath,
|
|
185
|
+
exists: true,
|
|
186
|
+
hasContent: true,
|
|
187
|
+
lineCount: nonEmptyLines.length
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Extract file paths from task description
|
|
193
|
+
*
|
|
194
|
+
* Supports multiple formats:
|
|
195
|
+
* - **Files**: src/foo.ts, src/bar.ts
|
|
196
|
+
* - **Files to create**: src/foo.ts
|
|
197
|
+
* - **Files to modify**: src/bar.ts
|
|
198
|
+
* - Inline code blocks with file paths
|
|
199
|
+
*
|
|
200
|
+
* @param description - Task description text
|
|
201
|
+
* @returns Array of file paths
|
|
202
|
+
*/
|
|
203
|
+
extractFilePaths(description: string): string[] {
|
|
204
|
+
const paths: Set<string> = new Set();
|
|
205
|
+
|
|
206
|
+
// Pattern 1: **Files**: path1, path2, path3
|
|
207
|
+
const filesMatch = description.match(/\*\*Files\*\*:\s*([^\n]+)/i);
|
|
208
|
+
if (filesMatch) {
|
|
209
|
+
const filePaths = filesMatch[1].split(',').map(p => p.trim());
|
|
210
|
+
filePaths.forEach(p => paths.add(p));
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Pattern 2: **Files to create**: path1, path2
|
|
214
|
+
const createMatch = description.match(/\*\*Files to create\*\*:\s*([^\n]+)/i);
|
|
215
|
+
if (createMatch) {
|
|
216
|
+
const filePaths = createMatch[1].split(',').map(p => p.trim());
|
|
217
|
+
filePaths.forEach(p => paths.add(p));
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Pattern 3: **Files to modify**: path1, path2
|
|
221
|
+
const modifyMatch = description.match(/\*\*Files to modify\*\*:\s*([^\n]+)/i);
|
|
222
|
+
if (modifyMatch) {
|
|
223
|
+
const filePaths = modifyMatch[1].split(',').map(p => p.trim());
|
|
224
|
+
filePaths.forEach(p => paths.add(p));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Pattern 4: Inline file references (e.g., `src/foo/bar.ts`)
|
|
228
|
+
const inlineMatches = description.matchAll(/`([a-zA-Z0-9_\-./]+\.(ts|js|tsx|jsx|py|java|go|rs|cpp|c|h))`/g);
|
|
229
|
+
for (const match of inlineMatches) {
|
|
230
|
+
paths.add(match[1]);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Pattern 5: Markdown list items with file paths
|
|
234
|
+
const listMatches = description.matchAll(/^[-*]\s+([a-zA-Z0-9_\-./]+\.(ts|js|tsx|jsx|py|java|go|rs|cpp|c|h))/gm);
|
|
235
|
+
for (const match of listMatches) {
|
|
236
|
+
paths.add(match[1]);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return Array.from(paths);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Batch validate multiple tasks
|
|
244
|
+
*
|
|
245
|
+
* @param tasks - Array of {taskId, description}
|
|
246
|
+
* @returns Array of validation results
|
|
247
|
+
*/
|
|
248
|
+
async validateTasks(tasks: Array<{ taskId: string; description: string }>): Promise<TaskValidationResult[]> {
|
|
249
|
+
// Use parallel validation for performance
|
|
250
|
+
const validationPromises = tasks.map(task =>
|
|
251
|
+
this.validateTask(task.description, task.taskId)
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
return Promise.all(validationPromises);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Get summary of validation results
|
|
259
|
+
*
|
|
260
|
+
* @param results - Array of task validation results
|
|
261
|
+
* @returns Summary statistics
|
|
262
|
+
*/
|
|
263
|
+
summarizeResults(results: TaskValidationResult[]): {
|
|
264
|
+
total: number;
|
|
265
|
+
valid: number;
|
|
266
|
+
invalid: number;
|
|
267
|
+
noFiles: number;
|
|
268
|
+
invalidTasks: string[];
|
|
269
|
+
} {
|
|
270
|
+
const total = results.length;
|
|
271
|
+
const valid = results.filter(r => r.valid).length;
|
|
272
|
+
const invalid = results.filter(r => !r.valid).length;
|
|
273
|
+
const noFiles = results.filter(r => r.files.length === 0).length;
|
|
274
|
+
const invalidTasks = results.filter(r => !r.valid).map(r => r.taskId);
|
|
275
|
+
|
|
276
|
+
return {
|
|
277
|
+
total,
|
|
278
|
+
valid,
|
|
279
|
+
invalid,
|
|
280
|
+
noFiles,
|
|
281
|
+
invalidTasks
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
class IssueStateManager {
|
|
2
|
+
/**
|
|
3
|
+
* Determine issue state based on progress
|
|
4
|
+
*
|
|
5
|
+
* @param progress - Progress information
|
|
6
|
+
* @param currentState - Current issue state
|
|
7
|
+
* @returns State change result
|
|
8
|
+
*/
|
|
9
|
+
static determineState(progress, currentState) {
|
|
10
|
+
const result = {
|
|
11
|
+
previousState: currentState,
|
|
12
|
+
newState: currentState,
|
|
13
|
+
changed: false,
|
|
14
|
+
labelsAdded: [],
|
|
15
|
+
labelsRemoved: []
|
|
16
|
+
};
|
|
17
|
+
if (progress.isComplete) {
|
|
18
|
+
result.newState = "closed";
|
|
19
|
+
result.labelsRemoved.push("in-progress");
|
|
20
|
+
} else if (progress.overallPercentage > 0) {
|
|
21
|
+
result.newState = "open";
|
|
22
|
+
result.labelsAdded.push("in-progress");
|
|
23
|
+
} else {
|
|
24
|
+
result.newState = "open";
|
|
25
|
+
result.labelsRemoved.push("in-progress");
|
|
26
|
+
}
|
|
27
|
+
result.changed = result.newState !== result.previousState;
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Calculate progress from acceptance criteria and tasks
|
|
32
|
+
*
|
|
33
|
+
* @param acs - Acceptance criteria
|
|
34
|
+
* @param tasks - Tasks
|
|
35
|
+
* @returns Progress information
|
|
36
|
+
*/
|
|
37
|
+
static calculateProgress(acs, tasks) {
|
|
38
|
+
const totalAcs = acs.length;
|
|
39
|
+
const completedAcs = acs.filter((ac) => ac.completed).length;
|
|
40
|
+
const acPercentage = totalAcs > 0 ? Math.round(completedAcs / totalAcs * 100) : 0;
|
|
41
|
+
const totalTasks = tasks.length;
|
|
42
|
+
const completedTasks = tasks.filter((t) => t.completed).length;
|
|
43
|
+
const taskPercentage = totalTasks > 0 ? Math.round(completedTasks / totalTasks * 100) : 0;
|
|
44
|
+
const overallPercentage = totalTasks > 0 ? Math.round((acPercentage + taskPercentage) / 2) : acPercentage;
|
|
45
|
+
const isComplete = totalAcs > 0 && completedAcs === totalAcs && (totalTasks === 0 || completedTasks === totalTasks);
|
|
46
|
+
return {
|
|
47
|
+
totalAcs,
|
|
48
|
+
completedAcs,
|
|
49
|
+
acPercentage,
|
|
50
|
+
totalTasks,
|
|
51
|
+
completedTasks,
|
|
52
|
+
taskPercentage,
|
|
53
|
+
overallPercentage,
|
|
54
|
+
isComplete
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Format progress as markdown
|
|
59
|
+
*
|
|
60
|
+
* @param progress - Progress information
|
|
61
|
+
* @returns Markdown string
|
|
62
|
+
*/
|
|
63
|
+
static formatProgressMarkdown(progress) {
|
|
64
|
+
const sections = [];
|
|
65
|
+
sections.push("## Progress");
|
|
66
|
+
sections.push("");
|
|
67
|
+
sections.push(`**Acceptance Criteria**: ${progress.completedAcs}/${progress.totalAcs} (${progress.acPercentage}%)`);
|
|
68
|
+
if (progress.totalTasks > 0) {
|
|
69
|
+
sections.push(`**Tasks**: ${progress.completedTasks}/${progress.totalTasks} (${progress.taskPercentage}%)`);
|
|
70
|
+
}
|
|
71
|
+
sections.push(`**Overall**: ${progress.overallPercentage}%`);
|
|
72
|
+
const progressBar = this.generateProgressBar(progress.overallPercentage);
|
|
73
|
+
sections.push("");
|
|
74
|
+
sections.push(progressBar);
|
|
75
|
+
return sections.join("\n");
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Generate ASCII progress bar
|
|
79
|
+
*
|
|
80
|
+
* @param percentage - Completion percentage (0-100)
|
|
81
|
+
* @returns Progress bar string
|
|
82
|
+
*/
|
|
83
|
+
static generateProgressBar(percentage) {
|
|
84
|
+
const total = 20;
|
|
85
|
+
const filled = Math.round(percentage / 100 * total);
|
|
86
|
+
const empty = total - filled;
|
|
87
|
+
const bar = "\u2588".repeat(filled) + "\u2591".repeat(empty);
|
|
88
|
+
return `\`${bar}\` ${percentage}%`;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Build GitHub CLI command to update issue state
|
|
92
|
+
*
|
|
93
|
+
* @param issueNumber - GitHub issue number
|
|
94
|
+
* @param state - New state
|
|
95
|
+
* @param labelsToAdd - Labels to add
|
|
96
|
+
* @param labelsToRemove - Labels to remove
|
|
97
|
+
* @returns gh CLI command
|
|
98
|
+
*/
|
|
99
|
+
static buildGitHubCommand(issueNumber, state, labelsToAdd, labelsToRemove) {
|
|
100
|
+
const commands = [];
|
|
101
|
+
if (state === "closed") {
|
|
102
|
+
commands.push(`gh issue close ${issueNumber}`);
|
|
103
|
+
} else {
|
|
104
|
+
commands.push(`gh issue reopen ${issueNumber}`);
|
|
105
|
+
}
|
|
106
|
+
if (labelsToAdd.length > 0) {
|
|
107
|
+
commands.push(`gh issue edit ${issueNumber} --add-label "${labelsToAdd.join(",")}"`);
|
|
108
|
+
}
|
|
109
|
+
if (labelsToRemove.length > 0) {
|
|
110
|
+
commands.push(`gh issue edit ${issueNumber} --remove-label "${labelsToRemove.join(",")}"`);
|
|
111
|
+
}
|
|
112
|
+
return commands.join(" && ");
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export {
|
|
116
|
+
IssueStateManager
|
|
117
|
+
};
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Issue State Manager - Auto-update GitHub issue state based on progress
|
|
3
|
+
*
|
|
4
|
+
* Rules:
|
|
5
|
+
* - 0% complete → State = open
|
|
6
|
+
* - 1-99% complete → State = open, label = in-progress
|
|
7
|
+
* - 100% complete → State = closed
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Issue state
|
|
12
|
+
*/
|
|
13
|
+
export type IssueState = 'open' | 'closed';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* State change result
|
|
17
|
+
*/
|
|
18
|
+
export interface StateChangeResult {
|
|
19
|
+
/** Previous state */
|
|
20
|
+
previousState: IssueState;
|
|
21
|
+
|
|
22
|
+
/** New state */
|
|
23
|
+
newState: IssueState;
|
|
24
|
+
|
|
25
|
+
/** State changed */
|
|
26
|
+
changed: boolean;
|
|
27
|
+
|
|
28
|
+
/** Labels added */
|
|
29
|
+
labelsAdded: string[];
|
|
30
|
+
|
|
31
|
+
/** Labels removed */
|
|
32
|
+
labelsRemoved: string[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Progress info
|
|
37
|
+
*/
|
|
38
|
+
export interface ProgressInfo {
|
|
39
|
+
/** Total ACs */
|
|
40
|
+
totalAcs: number;
|
|
41
|
+
|
|
42
|
+
/** Completed ACs */
|
|
43
|
+
completedAcs: number;
|
|
44
|
+
|
|
45
|
+
/** AC completion percentage */
|
|
46
|
+
acPercentage: number;
|
|
47
|
+
|
|
48
|
+
/** Total tasks */
|
|
49
|
+
totalTasks: number;
|
|
50
|
+
|
|
51
|
+
/** Completed tasks */
|
|
52
|
+
completedTasks: number;
|
|
53
|
+
|
|
54
|
+
/** Task completion percentage */
|
|
55
|
+
taskPercentage: number;
|
|
56
|
+
|
|
57
|
+
/** Overall completion percentage */
|
|
58
|
+
overallPercentage: number;
|
|
59
|
+
|
|
60
|
+
/** Is 100% complete */
|
|
61
|
+
isComplete: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* IssueStateManager - Manages GitHub issue state
|
|
66
|
+
*/
|
|
67
|
+
export class IssueStateManager {
|
|
68
|
+
/**
|
|
69
|
+
* Determine issue state based on progress
|
|
70
|
+
*
|
|
71
|
+
* @param progress - Progress information
|
|
72
|
+
* @param currentState - Current issue state
|
|
73
|
+
* @returns State change result
|
|
74
|
+
*/
|
|
75
|
+
static determineState(
|
|
76
|
+
progress: ProgressInfo,
|
|
77
|
+
currentState: IssueState
|
|
78
|
+
): StateChangeResult {
|
|
79
|
+
const result: StateChangeResult = {
|
|
80
|
+
previousState: currentState,
|
|
81
|
+
newState: currentState,
|
|
82
|
+
changed: false,
|
|
83
|
+
labelsAdded: [],
|
|
84
|
+
labelsRemoved: []
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// Determine new state based on progress
|
|
88
|
+
if (progress.isComplete) {
|
|
89
|
+
// 100% complete → Close issue
|
|
90
|
+
result.newState = 'closed';
|
|
91
|
+
result.labelsRemoved.push('in-progress');
|
|
92
|
+
} else if (progress.overallPercentage > 0) {
|
|
93
|
+
// 1-99% complete → Open with in-progress label
|
|
94
|
+
result.newState = 'open';
|
|
95
|
+
result.labelsAdded.push('in-progress');
|
|
96
|
+
} else {
|
|
97
|
+
// 0% complete → Open without in-progress label
|
|
98
|
+
result.newState = 'open';
|
|
99
|
+
result.labelsRemoved.push('in-progress');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Check if state changed
|
|
103
|
+
result.changed = result.newState !== result.previousState;
|
|
104
|
+
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Calculate progress from acceptance criteria and tasks
|
|
110
|
+
*
|
|
111
|
+
* @param acs - Acceptance criteria
|
|
112
|
+
* @param tasks - Tasks
|
|
113
|
+
* @returns Progress information
|
|
114
|
+
*/
|
|
115
|
+
static calculateProgress(
|
|
116
|
+
acs: Array<{ completed: boolean }>,
|
|
117
|
+
tasks: Array<{ completed: boolean }>
|
|
118
|
+
): ProgressInfo {
|
|
119
|
+
const totalAcs = acs.length;
|
|
120
|
+
const completedAcs = acs.filter(ac => ac.completed).length;
|
|
121
|
+
const acPercentage = totalAcs > 0 ? Math.round((completedAcs / totalAcs) * 100) : 0;
|
|
122
|
+
|
|
123
|
+
const totalTasks = tasks.length;
|
|
124
|
+
const completedTasks = tasks.filter(t => t.completed).length;
|
|
125
|
+
const taskPercentage = totalTasks > 0 ? Math.round((completedTasks / totalTasks) * 100) : 0;
|
|
126
|
+
|
|
127
|
+
// Overall percentage: average of AC and Task percentages
|
|
128
|
+
// If no tasks, use AC percentage only
|
|
129
|
+
const overallPercentage = totalTasks > 0
|
|
130
|
+
? Math.round((acPercentage + taskPercentage) / 2)
|
|
131
|
+
: acPercentage;
|
|
132
|
+
|
|
133
|
+
const isComplete = totalAcs > 0 && completedAcs === totalAcs &&
|
|
134
|
+
(totalTasks === 0 || completedTasks === totalTasks);
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
totalAcs,
|
|
138
|
+
completedAcs,
|
|
139
|
+
acPercentage,
|
|
140
|
+
totalTasks,
|
|
141
|
+
completedTasks,
|
|
142
|
+
taskPercentage,
|
|
143
|
+
overallPercentage,
|
|
144
|
+
isComplete
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Format progress as markdown
|
|
150
|
+
*
|
|
151
|
+
* @param progress - Progress information
|
|
152
|
+
* @returns Markdown string
|
|
153
|
+
*/
|
|
154
|
+
static formatProgressMarkdown(progress: ProgressInfo): string {
|
|
155
|
+
const sections: string[] = [];
|
|
156
|
+
|
|
157
|
+
sections.push('## Progress');
|
|
158
|
+
sections.push('');
|
|
159
|
+
|
|
160
|
+
// AC progress
|
|
161
|
+
sections.push(`**Acceptance Criteria**: ${progress.completedAcs}/${progress.totalAcs} (${progress.acPercentage}%)`);
|
|
162
|
+
|
|
163
|
+
// Task progress
|
|
164
|
+
if (progress.totalTasks > 0) {
|
|
165
|
+
sections.push(`**Tasks**: ${progress.completedTasks}/${progress.totalTasks} (${progress.taskPercentage}%)`);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Overall progress
|
|
169
|
+
sections.push(`**Overall**: ${progress.overallPercentage}%`);
|
|
170
|
+
|
|
171
|
+
// Progress bar
|
|
172
|
+
const progressBar = this.generateProgressBar(progress.overallPercentage);
|
|
173
|
+
sections.push('');
|
|
174
|
+
sections.push(progressBar);
|
|
175
|
+
|
|
176
|
+
return sections.join('\n');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Generate ASCII progress bar
|
|
181
|
+
*
|
|
182
|
+
* @param percentage - Completion percentage (0-100)
|
|
183
|
+
* @returns Progress bar string
|
|
184
|
+
*/
|
|
185
|
+
private static generateProgressBar(percentage: number): string {
|
|
186
|
+
const total = 20;
|
|
187
|
+
const filled = Math.round((percentage / 100) * total);
|
|
188
|
+
const empty = total - filled;
|
|
189
|
+
|
|
190
|
+
const bar = '█'.repeat(filled) + '░'.repeat(empty);
|
|
191
|
+
|
|
192
|
+
return `\`${bar}\` ${percentage}%`;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Build GitHub CLI command to update issue state
|
|
197
|
+
*
|
|
198
|
+
* @param issueNumber - GitHub issue number
|
|
199
|
+
* @param state - New state
|
|
200
|
+
* @param labelsToAdd - Labels to add
|
|
201
|
+
* @param labelsToRemove - Labels to remove
|
|
202
|
+
* @returns gh CLI command
|
|
203
|
+
*/
|
|
204
|
+
static buildGitHubCommand(
|
|
205
|
+
issueNumber: number,
|
|
206
|
+
state: IssueState,
|
|
207
|
+
labelsToAdd: string[],
|
|
208
|
+
labelsToRemove: string[]
|
|
209
|
+
): string {
|
|
210
|
+
const commands: string[] = [];
|
|
211
|
+
|
|
212
|
+
// Update state
|
|
213
|
+
if (state === 'closed') {
|
|
214
|
+
commands.push(`gh issue close ${issueNumber}`);
|
|
215
|
+
} else {
|
|
216
|
+
commands.push(`gh issue reopen ${issueNumber}`);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Add labels
|
|
220
|
+
if (labelsToAdd.length > 0) {
|
|
221
|
+
commands.push(`gh issue edit ${issueNumber} --add-label "${labelsToAdd.join(',')}"`);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Remove labels
|
|
225
|
+
if (labelsToRemove.length > 0) {
|
|
226
|
+
commands.push(`gh issue edit ${issueNumber} --remove-label "${labelsToRemove.join(',')}"`);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return commands.join(' && ');
|
|
230
|
+
}
|
|
231
|
+
}
|