@dotcontext/cli 0.8.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/LICENSE +21 -0
- package/README.md +566 -0
- package/dist/generators/agents/agentConfig.d.ts +4 -0
- package/dist/generators/agents/agentConfig.d.ts.map +1 -0
- package/dist/generators/agents/agentConfig.js +180 -0
- package/dist/generators/agents/agentConfig.js.map +1 -0
- package/dist/generators/agents/agentGenerator.d.ts +36 -0
- package/dist/generators/agents/agentGenerator.d.ts.map +1 -0
- package/dist/generators/agents/agentGenerator.js +304 -0
- package/dist/generators/agents/agentGenerator.js.map +1 -0
- package/dist/generators/agents/agentTypes.d.ts +4 -0
- package/dist/generators/agents/agentTypes.d.ts.map +1 -0
- package/dist/generators/agents/agentTypes.js +25 -0
- package/dist/generators/agents/agentTypes.js.map +1 -0
- package/dist/generators/agents/index.d.ts +4 -0
- package/dist/generators/agents/index.d.ts.map +1 -0
- package/dist/generators/agents/index.js +12 -0
- package/dist/generators/agents/index.js.map +1 -0
- package/dist/generators/agents/templates/index.d.ts +3 -0
- package/dist/generators/agents/templates/index.d.ts.map +1 -0
- package/dist/generators/agents/templates/index.js +6 -0
- package/dist/generators/agents/templates/index.js.map +1 -0
- package/dist/generators/agents/templates/indexTemplate.d.ts +3 -0
- package/dist/generators/agents/templates/indexTemplate.d.ts.map +1 -0
- package/dist/generators/agents/templates/indexTemplate.js +36 -0
- package/dist/generators/agents/templates/indexTemplate.js.map +1 -0
- package/dist/generators/agents/templates/types.d.ts +22 -0
- package/dist/generators/agents/templates/types.d.ts.map +1 -0
- package/dist/generators/agents/templates/types.js +3 -0
- package/dist/generators/agents/templates/types.js.map +1 -0
- package/dist/generators/documentation/codebaseMapGenerator.d.ts +143 -0
- package/dist/generators/documentation/codebaseMapGenerator.d.ts.map +1 -0
- package/dist/generators/documentation/codebaseMapGenerator.js +666 -0
- package/dist/generators/documentation/codebaseMapGenerator.js.map +1 -0
- package/dist/generators/documentation/documentationGenerator.d.ts +22 -0
- package/dist/generators/documentation/documentationGenerator.d.ts.map +1 -0
- package/dist/generators/documentation/documentationGenerator.js +263 -0
- package/dist/generators/documentation/documentationGenerator.js.map +1 -0
- package/dist/generators/documentation/guideRegistry.d.ts +6 -0
- package/dist/generators/documentation/guideRegistry.d.ts.map +1 -0
- package/dist/generators/documentation/guideRegistry.js +74 -0
- package/dist/generators/documentation/guideRegistry.js.map +1 -0
- package/dist/generators/documentation/index.d.ts +4 -0
- package/dist/generators/documentation/index.d.ts.map +1 -0
- package/dist/generators/documentation/index.js +8 -0
- package/dist/generators/documentation/index.js.map +1 -0
- package/dist/generators/documentation/templates/common.d.ts +42 -0
- package/dist/generators/documentation/templates/common.d.ts.map +1 -0
- package/dist/generators/documentation/templates/common.js +194 -0
- package/dist/generators/documentation/templates/common.js.map +1 -0
- package/dist/generators/documentation/templates/index.d.ts +3 -0
- package/dist/generators/documentation/templates/index.d.ts.map +1 -0
- package/dist/generators/documentation/templates/index.js +6 -0
- package/dist/generators/documentation/templates/index.js.map +1 -0
- package/dist/generators/documentation/templates/indexTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/indexTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/indexTemplate.js +25 -0
- package/dist/generators/documentation/templates/indexTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/types.d.ts +24 -0
- package/dist/generators/documentation/templates/types.d.ts.map +1 -0
- package/dist/generators/documentation/templates/types.js +3 -0
- package/dist/generators/documentation/templates/types.js.map +1 -0
- package/dist/generators/plans/index.d.ts +2 -0
- package/dist/generators/plans/index.d.ts.map +1 -0
- package/dist/generators/plans/index.js +6 -0
- package/dist/generators/plans/index.js.map +1 -0
- package/dist/generators/plans/planGenerator.d.ts +26 -0
- package/dist/generators/plans/planGenerator.d.ts.map +1 -0
- package/dist/generators/plans/planGenerator.js +137 -0
- package/dist/generators/plans/planGenerator.js.map +1 -0
- package/dist/generators/plans/templates/indexTemplate.d.ts +3 -0
- package/dist/generators/plans/templates/indexTemplate.d.ts.map +1 -0
- package/dist/generators/plans/templates/indexTemplate.js +28 -0
- package/dist/generators/plans/templates/indexTemplate.js.map +1 -0
- package/dist/generators/plans/templates/planTemplate.d.ts +14 -0
- package/dist/generators/plans/templates/planTemplate.d.ts.map +1 -0
- package/dist/generators/plans/templates/planTemplate.js +270 -0
- package/dist/generators/plans/templates/planTemplate.js.map +1 -0
- package/dist/generators/plans/templates/types.d.ts +29 -0
- package/dist/generators/plans/templates/types.d.ts.map +1 -0
- package/dist/generators/plans/templates/types.js +3 -0
- package/dist/generators/plans/templates/types.js.map +1 -0
- package/dist/generators/shared/contextGenerator.d.ts +7 -0
- package/dist/generators/shared/contextGenerator.d.ts.map +1 -0
- package/dist/generators/shared/contextGenerator.js +13 -0
- package/dist/generators/shared/contextGenerator.js.map +1 -0
- package/dist/generators/shared/directoryTemplateHelpers.d.ts +2 -0
- package/dist/generators/shared/directoryTemplateHelpers.d.ts.map +1 -0
- package/dist/generators/shared/directoryTemplateHelpers.js +12 -0
- package/dist/generators/shared/directoryTemplateHelpers.js.map +1 -0
- package/dist/generators/shared/generatorUtils.d.ts +16 -0
- package/dist/generators/shared/generatorUtils.d.ts.map +1 -0
- package/dist/generators/shared/generatorUtils.js +116 -0
- package/dist/generators/shared/generatorUtils.js.map +1 -0
- package/dist/generators/shared/index.d.ts +5 -0
- package/dist/generators/shared/index.d.ts.map +1 -0
- package/dist/generators/shared/index.js +26 -0
- package/dist/generators/shared/index.js.map +1 -0
- package/dist/generators/shared/scaffoldStructures.d.ts +13 -0
- package/dist/generators/shared/scaffoldStructures.d.ts.map +1 -0
- package/dist/generators/shared/scaffoldStructures.js +30 -0
- package/dist/generators/shared/scaffoldStructures.js.map +1 -0
- package/dist/generators/shared/structures/agents/definitions.d.ts +18 -0
- package/dist/generators/shared/structures/agents/definitions.d.ts.map +1 -0
- package/dist/generators/shared/structures/agents/definitions.js +561 -0
- package/dist/generators/shared/structures/agents/definitions.js.map +1 -0
- package/dist/generators/shared/structures/agents/factory.d.ts +25 -0
- package/dist/generators/shared/structures/agents/factory.d.ts.map +1 -0
- package/dist/generators/shared/structures/agents/factory.js +138 -0
- package/dist/generators/shared/structures/agents/factory.js.map +1 -0
- package/dist/generators/shared/structures/agents/index.d.ts +6 -0
- package/dist/generators/shared/structures/agents/index.d.ts.map +1 -0
- package/dist/generators/shared/structures/agents/index.js +24 -0
- package/dist/generators/shared/structures/agents/index.js.map +1 -0
- package/dist/generators/shared/structures/documentation/apiReference.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/apiReference.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/apiReference.js +100 -0
- package/dist/generators/shared/structures/documentation/apiReference.js.map +1 -0
- package/dist/generators/shared/structures/documentation/architecture.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/architecture.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/architecture.js +176 -0
- package/dist/generators/shared/structures/documentation/architecture.js.map +1 -0
- package/dist/generators/shared/structures/documentation/dataFlow.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/dataFlow.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/dataFlow.js +107 -0
- package/dist/generators/shared/structures/documentation/dataFlow.js.map +1 -0
- package/dist/generators/shared/structures/documentation/glossary.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/glossary.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/glossary.js +91 -0
- package/dist/generators/shared/structures/documentation/glossary.js.map +1 -0
- package/dist/generators/shared/structures/documentation/index.d.ts +16 -0
- package/dist/generators/shared/structures/documentation/index.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/index.js +31 -0
- package/dist/generators/shared/structures/documentation/index.js.map +1 -0
- package/dist/generators/shared/structures/documentation/migration.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/migration.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/migration.js +113 -0
- package/dist/generators/shared/structures/documentation/migration.js.map +1 -0
- package/dist/generators/shared/structures/documentation/onboarding.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/onboarding.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/onboarding.js +99 -0
- package/dist/generators/shared/structures/documentation/onboarding.js.map +1 -0
- package/dist/generators/shared/structures/documentation/projectOverview.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/projectOverview.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/projectOverview.js +163 -0
- package/dist/generators/shared/structures/documentation/projectOverview.js.map +1 -0
- package/dist/generators/shared/structures/documentation/security.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/security.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/security.js +100 -0
- package/dist/generators/shared/structures/documentation/security.js.map +1 -0
- package/dist/generators/shared/structures/documentation/testing.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/testing.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/testing.js +130 -0
- package/dist/generators/shared/structures/documentation/testing.js.map +1 -0
- package/dist/generators/shared/structures/documentation/tooling.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/tooling.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/tooling.js +114 -0
- package/dist/generators/shared/structures/documentation/tooling.js.map +1 -0
- package/dist/generators/shared/structures/documentation/troubleshooting.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/troubleshooting.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/troubleshooting.js +91 -0
- package/dist/generators/shared/structures/documentation/troubleshooting.js.map +1 -0
- package/dist/generators/shared/structures/documentation/workflow.d.ts +3 -0
- package/dist/generators/shared/structures/documentation/workflow.d.ts.map +1 -0
- package/dist/generators/shared/structures/documentation/workflow.js +116 -0
- package/dist/generators/shared/structures/documentation/workflow.js.map +1 -0
- package/dist/generators/shared/structures/index.d.ts +15 -0
- package/dist/generators/shared/structures/index.d.ts.map +1 -0
- package/dist/generators/shared/structures/index.js +37 -0
- package/dist/generators/shared/structures/index.js.map +1 -0
- package/dist/generators/shared/structures/plans/index.d.ts +5 -0
- package/dist/generators/shared/structures/plans/index.d.ts.map +1 -0
- package/dist/generators/shared/structures/plans/index.js +9 -0
- package/dist/generators/shared/structures/plans/index.js.map +1 -0
- package/dist/generators/shared/structures/plans/planStructure.d.ts +6 -0
- package/dist/generators/shared/structures/plans/planStructure.d.ts.map +1 -0
- package/dist/generators/shared/structures/plans/planStructure.js +65 -0
- package/dist/generators/shared/structures/plans/planStructure.js.map +1 -0
- package/dist/generators/shared/structures/registry.d.ts +18 -0
- package/dist/generators/shared/structures/registry.d.ts.map +1 -0
- package/dist/generators/shared/structures/registry.js +104 -0
- package/dist/generators/shared/structures/registry.js.map +1 -0
- package/dist/generators/shared/structures/serialization.d.ts +15 -0
- package/dist/generators/shared/structures/serialization.d.ts.map +1 -0
- package/dist/generators/shared/structures/serialization.js +124 -0
- package/dist/generators/shared/structures/serialization.js.map +1 -0
- package/dist/generators/shared/structures/skills/definitions.d.ts +25 -0
- package/dist/generators/shared/structures/skills/definitions.d.ts.map +1 -0
- package/dist/generators/shared/structures/skills/definitions.js +427 -0
- package/dist/generators/shared/structures/skills/definitions.js.map +1 -0
- package/dist/generators/shared/structures/skills/factory.d.ts +18 -0
- package/dist/generators/shared/structures/skills/factory.d.ts.map +1 -0
- package/dist/generators/shared/structures/skills/factory.js +75 -0
- package/dist/generators/shared/structures/skills/factory.js.map +1 -0
- package/dist/generators/shared/structures/skills/index.d.ts +6 -0
- package/dist/generators/shared/structures/skills/index.d.ts.map +1 -0
- package/dist/generators/shared/structures/skills/index.js +30 -0
- package/dist/generators/shared/structures/skills/index.js.map +1 -0
- package/dist/generators/shared/structures/types.d.ts +61 -0
- package/dist/generators/shared/structures/types.d.ts.map +1 -0
- package/dist/generators/shared/structures/types.js +6 -0
- package/dist/generators/shared/structures/types.js.map +1 -0
- package/dist/generators/shared/structures/validation.d.ts +13 -0
- package/dist/generators/shared/structures/validation.d.ts.map +1 -0
- package/dist/generators/shared/structures/validation.js +51 -0
- package/dist/generators/shared/structures/validation.js.map +1 -0
- package/dist/generators/skills/index.d.ts +7 -0
- package/dist/generators/skills/index.d.ts.map +1 -0
- package/dist/generators/skills/index.js +15 -0
- package/dist/generators/skills/index.js.map +1 -0
- package/dist/generators/skills/skillGenerator.d.ts +58 -0
- package/dist/generators/skills/skillGenerator.d.ts.map +1 -0
- package/dist/generators/skills/skillGenerator.js +158 -0
- package/dist/generators/skills/skillGenerator.js.map +1 -0
- package/dist/generators/skills/templates/indexTemplate.d.ts +13 -0
- package/dist/generators/skills/templates/indexTemplate.d.ts.map +1 -0
- package/dist/generators/skills/templates/indexTemplate.js +102 -0
- package/dist/generators/skills/templates/indexTemplate.js.map +1 -0
- package/dist/generators/skills/templates/skillTemplate.d.ts +30 -0
- package/dist/generators/skills/templates/skillTemplate.d.ts.map +1 -0
- package/dist/generators/skills/templates/skillTemplate.js +95 -0
- package/dist/generators/skills/templates/skillTemplate.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1179 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/defaults.d.ts +8 -0
- package/dist/prompts/defaults.d.ts.map +1 -0
- package/dist/prompts/defaults.js +108 -0
- package/dist/prompts/defaults.js.map +1 -0
- package/dist/services/ai/aiSdkClient.d.ts +67 -0
- package/dist/services/ai/aiSdkClient.d.ts.map +1 -0
- package/dist/services/ai/aiSdkClient.js +143 -0
- package/dist/services/ai/aiSdkClient.js.map +1 -0
- package/dist/services/ai/index.d.ts +5 -0
- package/dist/services/ai/index.d.ts.map +1 -0
- package/dist/services/ai/index.js +40 -0
- package/dist/services/ai/index.js.map +1 -0
- package/dist/services/ai/providerFactory.d.ts +35 -0
- package/dist/services/ai/providerFactory.d.ts.map +1 -0
- package/dist/services/ai/providerFactory.js +107 -0
- package/dist/services/ai/providerFactory.js.map +1 -0
- package/dist/services/ai/schemas.d.ts +557 -0
- package/dist/services/ai/schemas.d.ts.map +1 -0
- package/dist/services/ai/schemas.js +357 -0
- package/dist/services/ai/schemas.js.map +1 -0
- package/dist/services/ai/toolRegistry.d.ts +27 -0
- package/dist/services/ai/toolRegistry.d.ts.map +1 -0
- package/dist/services/ai/toolRegistry.js +151 -0
- package/dist/services/ai/toolRegistry.js.map +1 -0
- package/dist/services/ai/tools/analyzeSymbolsTool.d.ts +33 -0
- package/dist/services/ai/tools/analyzeSymbolsTool.d.ts.map +1 -0
- package/dist/services/ai/tools/analyzeSymbolsTool.js +57 -0
- package/dist/services/ai/tools/analyzeSymbolsTool.js.map +1 -0
- package/dist/services/ai/tools/checkScaffoldingTool.d.ts +18 -0
- package/dist/services/ai/tools/checkScaffoldingTool.d.ts.map +1 -0
- package/dist/services/ai/tools/checkScaffoldingTool.js +89 -0
- package/dist/services/ai/tools/checkScaffoldingTool.js.map +1 -0
- package/dist/services/ai/tools/fillScaffoldingTool.d.ts +124 -0
- package/dist/services/ai/tools/fillScaffoldingTool.d.ts.map +1 -0
- package/dist/services/ai/tools/fillScaffoldingTool.js +397 -0
- package/dist/services/ai/tools/fillScaffoldingTool.js.map +1 -0
- package/dist/services/ai/tools/getCodebaseMapTool.d.ts +17 -0
- package/dist/services/ai/tools/getCodebaseMapTool.d.ts.map +1 -0
- package/dist/services/ai/tools/getCodebaseMapTool.js +122 -0
- package/dist/services/ai/tools/getCodebaseMapTool.js.map +1 -0
- package/dist/services/ai/tools/getFileStructureTool.d.ts +29 -0
- package/dist/services/ai/tools/getFileStructureTool.d.ts.map +1 -0
- package/dist/services/ai/tools/getFileStructureTool.js +48 -0
- package/dist/services/ai/tools/getFileStructureTool.js.map +1 -0
- package/dist/services/ai/tools/index.d.ts +21 -0
- package/dist/services/ai/tools/index.d.ts.map +1 -0
- package/dist/services/ai/tools/index.js +75 -0
- package/dist/services/ai/tools/index.js.map +1 -0
- package/dist/services/ai/tools/initializeContextTool.d.ts +135 -0
- package/dist/services/ai/tools/initializeContextTool.d.ts.map +1 -0
- package/dist/services/ai/tools/initializeContextTool.js +447 -0
- package/dist/services/ai/tools/initializeContextTool.js.map +1 -0
- package/dist/services/ai/tools/listFilesTool.d.ts +18 -0
- package/dist/services/ai/tools/listFilesTool.d.ts.map +1 -0
- package/dist/services/ai/tools/listFilesTool.js +34 -0
- package/dist/services/ai/tools/listFilesTool.js.map +1 -0
- package/dist/services/ai/tools/readFileTool.d.ts +17 -0
- package/dist/services/ai/tools/readFileTool.d.ts.map +1 -0
- package/dist/services/ai/tools/readFileTool.js +63 -0
- package/dist/services/ai/tools/readFileTool.js.map +1 -0
- package/dist/services/ai/tools/scaffoldPlanTool.d.ts +41 -0
- package/dist/services/ai/tools/scaffoldPlanTool.d.ts.map +1 -0
- package/dist/services/ai/tools/scaffoldPlanTool.js +183 -0
- package/dist/services/ai/tools/scaffoldPlanTool.js.map +1 -0
- package/dist/services/ai/tools/searchCodeTool.d.ts +25 -0
- package/dist/services/ai/tools/searchCodeTool.d.ts.map +1 -0
- package/dist/services/ai/tools/searchCodeTool.js +96 -0
- package/dist/services/ai/tools/searchCodeTool.js.map +1 -0
- package/dist/services/autoFill/autoFillService.d.ts +52 -0
- package/dist/services/autoFill/autoFillService.d.ts.map +1 -0
- package/dist/services/autoFill/autoFillService.js +473 -0
- package/dist/services/autoFill/autoFillService.js.map +1 -0
- package/dist/services/autoFill/index.d.ts +2 -0
- package/dist/services/autoFill/index.d.ts.map +1 -0
- package/dist/services/autoFill/index.js +6 -0
- package/dist/services/autoFill/index.js.map +1 -0
- package/dist/services/baseLLMClient.d.ts +12 -0
- package/dist/services/baseLLMClient.d.ts.map +1 -0
- package/dist/services/baseLLMClient.js +80 -0
- package/dist/services/baseLLMClient.js.map +1 -0
- package/dist/services/export/contextExportService.d.ts +45 -0
- package/dist/services/export/contextExportService.d.ts.map +1 -0
- package/dist/services/export/contextExportService.js +161 -0
- package/dist/services/export/contextExportService.js.map +1 -0
- package/dist/services/export/exportRulesService.d.ts +76 -0
- package/dist/services/export/exportRulesService.d.ts.map +1 -0
- package/dist/services/export/exportRulesService.js +306 -0
- package/dist/services/export/exportRulesService.js.map +1 -0
- package/dist/services/export/index.d.ts +7 -0
- package/dist/services/export/index.d.ts.map +1 -0
- package/dist/services/export/index.js +12 -0
- package/dist/services/export/index.js.map +1 -0
- package/dist/services/export/skillExportService.d.ts +69 -0
- package/dist/services/export/skillExportService.d.ts.map +1 -0
- package/dist/services/export/skillExportService.js +262 -0
- package/dist/services/export/skillExportService.js.map +1 -0
- package/dist/services/import/agentsDetector.d.ts +12 -0
- package/dist/services/import/agentsDetector.d.ts.map +1 -0
- package/dist/services/import/agentsDetector.js +183 -0
- package/dist/services/import/agentsDetector.js.map +1 -0
- package/dist/services/import/importAgentsService.d.ts +14 -0
- package/dist/services/import/importAgentsService.d.ts.map +1 -0
- package/dist/services/import/importAgentsService.js +194 -0
- package/dist/services/import/importAgentsService.js.map +1 -0
- package/dist/services/import/importRulesService.d.ts +17 -0
- package/dist/services/import/importRulesService.d.ts.map +1 -0
- package/dist/services/import/importRulesService.js +221 -0
- package/dist/services/import/importRulesService.js.map +1 -0
- package/dist/services/import/index.d.ts +7 -0
- package/dist/services/import/index.d.ts.map +1 -0
- package/dist/services/import/index.js +28 -0
- package/dist/services/import/index.js.map +1 -0
- package/dist/services/import/presets.d.ts +20 -0
- package/dist/services/import/presets.d.ts.map +1 -0
- package/dist/services/import/presets.js +56 -0
- package/dist/services/import/presets.js.map +1 -0
- package/dist/services/import/rulesDetector.d.ts +16 -0
- package/dist/services/import/rulesDetector.d.ts.map +1 -0
- package/dist/services/import/rulesDetector.js +278 -0
- package/dist/services/import/rulesDetector.js.map +1 -0
- package/dist/services/import/types.d.ts +72 -0
- package/dist/services/import/types.d.ts.map +1 -0
- package/dist/services/import/types.js +3 -0
- package/dist/services/import/types.js.map +1 -0
- package/dist/services/mcp/actionLogger.d.ts +19 -0
- package/dist/services/mcp/actionLogger.d.ts.map +1 -0
- package/dist/services/mcp/actionLogger.js +128 -0
- package/dist/services/mcp/actionLogger.js.map +1 -0
- package/dist/services/mcp/gateway/agent.d.ts +17 -0
- package/dist/services/mcp/gateway/agent.d.ts.map +1 -0
- package/dist/services/mcp/gateway/agent.js +147 -0
- package/dist/services/mcp/gateway/agent.js.map +1 -0
- package/dist/services/mcp/gateway/context.d.ts +21 -0
- package/dist/services/mcp/gateway/context.d.ts.map +1 -0
- package/dist/services/mcp/gateway/context.js +249 -0
- package/dist/services/mcp/gateway/context.js.map +1 -0
- package/dist/services/mcp/gateway/explore.d.ts +16 -0
- package/dist/services/mcp/gateway/explore.d.ts.map +1 -0
- package/dist/services/mcp/gateway/explore.js +60 -0
- package/dist/services/mcp/gateway/explore.js.map +1 -0
- package/dist/services/mcp/gateway/index.d.ts +24 -0
- package/dist/services/mcp/gateway/index.d.ts.map +1 -0
- package/dist/services/mcp/gateway/index.js +53 -0
- package/dist/services/mcp/gateway/index.js.map +1 -0
- package/dist/services/mcp/gateway/metrics.d.ts +56 -0
- package/dist/services/mcp/gateway/metrics.d.ts.map +1 -0
- package/dist/services/mcp/gateway/metrics.js +153 -0
- package/dist/services/mcp/gateway/metrics.js.map +1 -0
- package/dist/services/mcp/gateway/plan.d.ts +18 -0
- package/dist/services/mcp/gateway/plan.d.ts.map +1 -0
- package/dist/services/mcp/gateway/plan.js +273 -0
- package/dist/services/mcp/gateway/plan.js.map +1 -0
- package/dist/services/mcp/gateway/response.d.ts +45 -0
- package/dist/services/mcp/gateway/response.d.ts.map +1 -0
- package/dist/services/mcp/gateway/response.js +111 -0
- package/dist/services/mcp/gateway/response.js.map +1 -0
- package/dist/services/mcp/gateway/shared.d.ts +38 -0
- package/dist/services/mcp/gateway/shared.d.ts.map +1 -0
- package/dist/services/mcp/gateway/shared.js +39 -0
- package/dist/services/mcp/gateway/shared.js.map +1 -0
- package/dist/services/mcp/gateway/skill.d.ts +17 -0
- package/dist/services/mcp/gateway/skill.d.ts.map +1 -0
- package/dist/services/mcp/gateway/skill.js +323 -0
- package/dist/services/mcp/gateway/skill.js.map +1 -0
- package/dist/services/mcp/gateway/sync.d.ts +17 -0
- package/dist/services/mcp/gateway/sync.d.ts.map +1 -0
- package/dist/services/mcp/gateway/sync.js +219 -0
- package/dist/services/mcp/gateway/sync.js.map +1 -0
- package/dist/services/mcp/gateway/types.d.ts +116 -0
- package/dist/services/mcp/gateway/types.d.ts.map +1 -0
- package/dist/services/mcp/gateway/types.js +12 -0
- package/dist/services/mcp/gateway/types.js.map +1 -0
- package/dist/services/mcp/gateway/workflowAdvance.d.ts +25 -0
- package/dist/services/mcp/gateway/workflowAdvance.d.ts.map +1 -0
- package/dist/services/mcp/gateway/workflowAdvance.js +133 -0
- package/dist/services/mcp/gateway/workflowAdvance.js.map +1 -0
- package/dist/services/mcp/gateway/workflowInit.d.ts +28 -0
- package/dist/services/mcp/gateway/workflowInit.d.ts.map +1 -0
- package/dist/services/mcp/gateway/workflowInit.js +213 -0
- package/dist/services/mcp/gateway/workflowInit.js.map +1 -0
- package/dist/services/mcp/gateway/workflowManage.d.ts +31 -0
- package/dist/services/mcp/gateway/workflowManage.d.ts.map +1 -0
- package/dist/services/mcp/gateway/workflowManage.js +222 -0
- package/dist/services/mcp/gateway/workflowManage.js.map +1 -0
- package/dist/services/mcp/gateway/workflowStatus.d.ts +17 -0
- package/dist/services/mcp/gateway/workflowStatus.d.ts.map +1 -0
- package/dist/services/mcp/gateway/workflowStatus.js +91 -0
- package/dist/services/mcp/gateway/workflowStatus.js.map +1 -0
- package/dist/services/mcp/gatewayTools.d.ts +15 -0
- package/dist/services/mcp/gatewayTools.d.ts.map +1 -0
- package/dist/services/mcp/gatewayTools.js +38 -0
- package/dist/services/mcp/gatewayTools.js.map +1 -0
- package/dist/services/mcp/index.d.ts +9 -0
- package/dist/services/mcp/index.d.ts.map +1 -0
- package/dist/services/mcp/index.js +28 -0
- package/dist/services/mcp/index.js.map +1 -0
- package/dist/services/mcp/mcpInstallService.d.ts +56 -0
- package/dist/services/mcp/mcpInstallService.d.ts.map +1 -0
- package/dist/services/mcp/mcpInstallService.js +603 -0
- package/dist/services/mcp/mcpInstallService.js.map +1 -0
- package/dist/services/mcp/mcpServer.d.ts +101 -0
- package/dist/services/mcp/mcpServer.d.ts.map +1 -0
- package/dist/services/mcp/mcpServer.js +844 -0
- package/dist/services/mcp/mcpServer.js.map +1 -0
- package/dist/services/qa/index.d.ts +9 -0
- package/dist/services/qa/index.d.ts.map +1 -0
- package/dist/services/qa/index.js +15 -0
- package/dist/services/qa/index.js.map +1 -0
- package/dist/services/qa/patternInferer.d.ts +41 -0
- package/dist/services/qa/patternInferer.d.ts.map +1 -0
- package/dist/services/qa/patternInferer.js +366 -0
- package/dist/services/qa/patternInferer.js.map +1 -0
- package/dist/services/qa/qaService.d.ts +107 -0
- package/dist/services/qa/qaService.d.ts.map +1 -0
- package/dist/services/qa/qaService.js +874 -0
- package/dist/services/qa/qaService.js.map +1 -0
- package/dist/services/qa/topicDetector.d.ts +54 -0
- package/dist/services/qa/topicDetector.d.ts.map +1 -0
- package/dist/services/qa/topicDetector.js +306 -0
- package/dist/services/qa/topicDetector.js.map +1 -0
- package/dist/services/quickSync/index.d.ts +3 -0
- package/dist/services/quickSync/index.d.ts.map +1 -0
- package/dist/services/quickSync/index.js +7 -0
- package/dist/services/quickSync/index.js.map +1 -0
- package/dist/services/quickSync/quickSyncService.d.ts +70 -0
- package/dist/services/quickSync/quickSyncService.d.ts.map +1 -0
- package/dist/services/quickSync/quickSyncService.js +263 -0
- package/dist/services/quickSync/quickSyncService.js.map +1 -0
- package/dist/services/report/index.d.ts +3 -0
- package/dist/services/report/index.d.ts.map +1 -0
- package/dist/services/report/index.js +6 -0
- package/dist/services/report/index.js.map +1 -0
- package/dist/services/report/reportService.d.ts +131 -0
- package/dist/services/report/reportService.d.ts.map +1 -0
- package/dist/services/report/reportService.js +372 -0
- package/dist/services/report/reportService.js.map +1 -0
- package/dist/services/reverseSync/importSkillsService.d.ts +47 -0
- package/dist/services/reverseSync/importSkillsService.d.ts.map +1 -0
- package/dist/services/reverseSync/importSkillsService.js +362 -0
- package/dist/services/reverseSync/importSkillsService.js.map +1 -0
- package/dist/services/reverseSync/index.d.ts +12 -0
- package/dist/services/reverseSync/index.d.ts.map +1 -0
- package/dist/services/reverseSync/index.js +49 -0
- package/dist/services/reverseSync/index.js.map +1 -0
- package/dist/services/reverseSync/presets.d.ts +51 -0
- package/dist/services/reverseSync/presets.d.ts.map +1 -0
- package/dist/services/reverseSync/presets.js +77 -0
- package/dist/services/reverseSync/presets.js.map +1 -0
- package/dist/services/reverseSync/reverseQuickSyncService.d.ts +37 -0
- package/dist/services/reverseSync/reverseQuickSyncService.d.ts.map +1 -0
- package/dist/services/reverseSync/reverseQuickSyncService.js +265 -0
- package/dist/services/reverseSync/reverseQuickSyncService.js.map +1 -0
- package/dist/services/reverseSync/skillsDetector.d.ts +36 -0
- package/dist/services/reverseSync/skillsDetector.d.ts.map +1 -0
- package/dist/services/reverseSync/skillsDetector.js +287 -0
- package/dist/services/reverseSync/skillsDetector.js.map +1 -0
- package/dist/services/reverseSync/toolDetector.d.ts +36 -0
- package/dist/services/reverseSync/toolDetector.d.ts.map +1 -0
- package/dist/services/reverseSync/toolDetector.js +174 -0
- package/dist/services/reverseSync/toolDetector.js.map +1 -0
- package/dist/services/reverseSync/types.d.ts +203 -0
- package/dist/services/reverseSync/types.d.ts.map +1 -0
- package/dist/services/reverseSync/types.js +9 -0
- package/dist/services/reverseSync/types.js.map +1 -0
- package/dist/services/semantic/codebaseAnalyzer.d.ts +62 -0
- package/dist/services/semantic/codebaseAnalyzer.d.ts.map +1 -0
- package/dist/services/semantic/codebaseAnalyzer.js +1071 -0
- package/dist/services/semantic/codebaseAnalyzer.js.map +1 -0
- package/dist/services/semantic/contextBuilder.d.ts +86 -0
- package/dist/services/semantic/contextBuilder.d.ts.map +1 -0
- package/dist/services/semantic/contextBuilder.js +641 -0
- package/dist/services/semantic/contextBuilder.js.map +1 -0
- package/dist/services/semantic/contextCache.d.ts +67 -0
- package/dist/services/semantic/contextCache.d.ts.map +1 -0
- package/dist/services/semantic/contextCache.js +158 -0
- package/dist/services/semantic/contextCache.js.map +1 -0
- package/dist/services/semantic/index.d.ts +12 -0
- package/dist/services/semantic/index.d.ts.map +1 -0
- package/dist/services/semantic/index.js +33 -0
- package/dist/services/semantic/index.js.map +1 -0
- package/dist/services/semantic/lsp/index.d.ts +2 -0
- package/dist/services/semantic/lsp/index.d.ts.map +1 -0
- package/dist/services/semantic/lsp/index.js +6 -0
- package/dist/services/semantic/lsp/index.js.map +1 -0
- package/dist/services/semantic/lsp/lspLayer.d.ts +32 -0
- package/dist/services/semantic/lsp/lspLayer.d.ts.map +1 -0
- package/dist/services/semantic/lsp/lspLayer.js +378 -0
- package/dist/services/semantic/lsp/lspLayer.js.map +1 -0
- package/dist/services/semantic/treeSitter/index.d.ts +2 -0
- package/dist/services/semantic/treeSitter/index.d.ts.map +1 -0
- package/dist/services/semantic/treeSitter/index.js +6 -0
- package/dist/services/semantic/treeSitter/index.js.map +1 -0
- package/dist/services/semantic/treeSitter/treeSitterLayer.d.ts +37 -0
- package/dist/services/semantic/treeSitter/treeSitterLayer.d.ts.map +1 -0
- package/dist/services/semantic/treeSitter/treeSitterLayer.js +518 -0
- package/dist/services/semantic/treeSitter/treeSitterLayer.js.map +1 -0
- package/dist/services/semantic/types.d.ts +172 -0
- package/dist/services/semantic/types.d.ts.map +1 -0
- package/dist/services/semantic/types.js +33 -0
- package/dist/services/semantic/types.js.map +1 -0
- package/dist/services/shared/contentTypeRegistry.d.ts +66 -0
- package/dist/services/shared/contentTypeRegistry.d.ts.map +1 -0
- package/dist/services/shared/contentTypeRegistry.js +113 -0
- package/dist/services/shared/contentTypeRegistry.js.map +1 -0
- package/dist/services/shared/contextRootResolver.d.ts +57 -0
- package/dist/services/shared/contextRootResolver.d.ts.map +1 -0
- package/dist/services/shared/contextRootResolver.js +102 -0
- package/dist/services/shared/contextRootResolver.js.map +1 -0
- package/dist/services/shared/globPatterns.d.ts +48 -0
- package/dist/services/shared/globPatterns.d.ts.map +1 -0
- package/dist/services/shared/globPatterns.js +110 -0
- package/dist/services/shared/globPatterns.js.map +1 -0
- package/dist/services/shared/index.d.ts +13 -0
- package/dist/services/shared/index.d.ts.map +1 -0
- package/dist/services/shared/index.js +84 -0
- package/dist/services/shared/index.js.map +1 -0
- package/dist/services/shared/pathHelpers.d.ts +85 -0
- package/dist/services/shared/pathHelpers.d.ts.map +1 -0
- package/dist/services/shared/pathHelpers.js +187 -0
- package/dist/services/shared/pathHelpers.js.map +1 -0
- package/dist/services/shared/toolRegistry.d.ts +135 -0
- package/dist/services/shared/toolRegistry.d.ts.map +1 -0
- package/dist/services/shared/toolRegistry.js +545 -0
- package/dist/services/shared/toolRegistry.js.map +1 -0
- package/dist/services/shared/types.d.ts +68 -0
- package/dist/services/shared/types.d.ts.map +1 -0
- package/dist/services/shared/types.js +44 -0
- package/dist/services/shared/types.js.map +1 -0
- package/dist/services/shared/uiHelpers.d.ts +70 -0
- package/dist/services/shared/uiHelpers.d.ts.map +1 -0
- package/dist/services/shared/uiHelpers.js +131 -0
- package/dist/services/shared/uiHelpers.js.map +1 -0
- package/dist/services/stack/index.d.ts +6 -0
- package/dist/services/stack/index.d.ts.map +1 -0
- package/dist/services/stack/index.js +25 -0
- package/dist/services/stack/index.js.map +1 -0
- package/dist/services/stack/projectTypeClassifier.d.ts +59 -0
- package/dist/services/stack/projectTypeClassifier.d.ts.map +1 -0
- package/dist/services/stack/projectTypeClassifier.js +242 -0
- package/dist/services/stack/projectTypeClassifier.js.map +1 -0
- package/dist/services/stack/scaffoldFilter.d.ts +75 -0
- package/dist/services/stack/scaffoldFilter.d.ts.map +1 -0
- package/dist/services/stack/scaffoldFilter.js +222 -0
- package/dist/services/stack/scaffoldFilter.js.map +1 -0
- package/dist/services/stack/stackDetector.d.ts +43 -0
- package/dist/services/stack/stackDetector.d.ts.map +1 -0
- package/dist/services/stack/stackDetector.js +406 -0
- package/dist/services/stack/stackDetector.js.map +1 -0
- package/dist/services/state/index.d.ts +2 -0
- package/dist/services/state/index.d.ts.map +1 -0
- package/dist/services/state/index.js +6 -0
- package/dist/services/state/index.js.map +1 -0
- package/dist/services/state/stateDetector.d.ts +53 -0
- package/dist/services/state/stateDetector.d.ts.map +1 -0
- package/dist/services/state/stateDetector.js +189 -0
- package/dist/services/state/stateDetector.js.map +1 -0
- package/dist/services/sync/index.d.ts +6 -0
- package/dist/services/sync/index.d.ts.map +1 -0
- package/dist/services/sync/index.js +16 -0
- package/dist/services/sync/index.js.map +1 -0
- package/dist/services/sync/markdownReferenceHandler.d.ts +3 -0
- package/dist/services/sync/markdownReferenceHandler.d.ts.map +1 -0
- package/dist/services/sync/markdownReferenceHandler.js +133 -0
- package/dist/services/sync/markdownReferenceHandler.js.map +1 -0
- package/dist/services/sync/presets.d.ts +9 -0
- package/dist/services/sync/presets.d.ts.map +1 -0
- package/dist/services/sync/presets.js +52 -0
- package/dist/services/sync/presets.js.map +1 -0
- package/dist/services/sync/symlinkHandler.d.ts +7 -0
- package/dist/services/sync/symlinkHandler.d.ts.map +1 -0
- package/dist/services/sync/symlinkHandler.js +129 -0
- package/dist/services/sync/symlinkHandler.js.map +1 -0
- package/dist/services/sync/syncService.d.ts +23 -0
- package/dist/services/sync/syncService.d.ts.map +1 -0
- package/dist/services/sync/syncService.js +240 -0
- package/dist/services/sync/syncService.js.map +1 -0
- package/dist/services/sync/types.d.ts +62 -0
- package/dist/services/sync/types.d.ts.map +1 -0
- package/dist/services/sync/types.js +3 -0
- package/dist/services/sync/types.js.map +1 -0
- package/dist/services/workflow/autoAdvance.d.ts +38 -0
- package/dist/services/workflow/autoAdvance.d.ts.map +1 -0
- package/dist/services/workflow/autoAdvance.js +219 -0
- package/dist/services/workflow/autoAdvance.js.map +1 -0
- package/dist/services/workflow/index.d.ts +6 -0
- package/dist/services/workflow/index.d.ts.map +1 -0
- package/dist/services/workflow/index.js +11 -0
- package/dist/services/workflow/index.js.map +1 -0
- package/dist/services/workflow/workflowService.d.ts +151 -0
- package/dist/services/workflow/workflowService.d.ts.map +1 -0
- package/dist/services/workflow/workflowService.js +283 -0
- package/dist/services/workflow/workflowService.js.map +1 -0
- package/dist/types/scaffoldFrontmatter.d.ts +145 -0
- package/dist/types/scaffoldFrontmatter.d.ts.map +1 -0
- package/dist/types/scaffoldFrontmatter.js +172 -0
- package/dist/types/scaffoldFrontmatter.js.map +1 -0
- package/dist/types.d.ts +61 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/cliUI.d.ts +26 -0
- package/dist/utils/cliUI.d.ts.map +1 -0
- package/dist/utils/cliUI.js +216 -0
- package/dist/utils/cliUI.js.map +1 -0
- package/dist/utils/fileMapper.d.ts +13 -0
- package/dist/utils/fileMapper.d.ts.map +1 -0
- package/dist/utils/fileMapper.js +165 -0
- package/dist/utils/fileMapper.js.map +1 -0
- package/dist/utils/frontMatter.d.ts +104 -0
- package/dist/utils/frontMatter.d.ts.map +1 -0
- package/dist/utils/frontMatter.js +325 -0
- package/dist/utils/frontMatter.js.map +1 -0
- package/dist/utils/gitService.d.ts +76 -0
- package/dist/utils/gitService.d.ts.map +1 -0
- package/dist/utils/gitService.js +564 -0
- package/dist/utils/gitService.js.map +1 -0
- package/dist/utils/gitignoreManager.d.ts +61 -0
- package/dist/utils/gitignoreManager.d.ts.map +1 -0
- package/dist/utils/gitignoreManager.js +171 -0
- package/dist/utils/gitignoreManager.js.map +1 -0
- package/dist/utils/i18n.d.ts +530 -0
- package/dist/utils/i18n.d.ts.map +1 -0
- package/dist/utils/i18n.js +1179 -0
- package/dist/utils/i18n.js.map +1 -0
- package/dist/utils/pathSecurity.d.ts +55 -0
- package/dist/utils/pathSecurity.d.ts.map +1 -0
- package/dist/utils/pathSecurity.js +132 -0
- package/dist/utils/pathSecurity.js.map +1 -0
- package/dist/utils/prompts/configSummary.d.ts +7 -0
- package/dist/utils/prompts/configSummary.d.ts.map +1 -0
- package/dist/utils/prompts/configSummary.js +35 -0
- package/dist/utils/prompts/configSummary.js.map +1 -0
- package/dist/utils/prompts/index.d.ts +27 -0
- package/dist/utils/prompts/index.d.ts.map +1 -0
- package/dist/utils/prompts/index.js +114 -0
- package/dist/utils/prompts/index.js.map +1 -0
- package/dist/utils/prompts/smartDefaults.d.ts +15 -0
- package/dist/utils/prompts/smartDefaults.d.ts.map +1 -0
- package/dist/utils/prompts/smartDefaults.js +105 -0
- package/dist/utils/prompts/smartDefaults.js.map +1 -0
- package/dist/utils/prompts/types.d.ts +38 -0
- package/dist/utils/prompts/types.d.ts.map +1 -0
- package/dist/utils/prompts/types.js +3 -0
- package/dist/utils/prompts/types.js.map +1 -0
- package/dist/utils/splashScreen.d.ts +14 -0
- package/dist/utils/splashScreen.d.ts.map +1 -0
- package/dist/utils/splashScreen.js +106 -0
- package/dist/utils/splashScreen.js.map +1 -0
- package/dist/utils/theme.d.ts +69 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +97 -0
- package/dist/utils/theme.js.map +1 -0
- package/dist/utils/themedPrompt.d.ts +46 -0
- package/dist/utils/themedPrompt.d.ts.map +1 -0
- package/dist/utils/themedPrompt.js +47 -0
- package/dist/utils/themedPrompt.js.map +1 -0
- package/dist/utils/versionChecker.d.ts +15 -0
- package/dist/utils/versionChecker.d.ts.map +1 -0
- package/dist/utils/versionChecker.js +49 -0
- package/dist/utils/versionChecker.js.map +1 -0
- package/dist/version.d.ts +8 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +15 -0
- package/dist/version.js.map +1 -0
- package/dist/workflow/agents/agentRegistry.d.ts +82 -0
- package/dist/workflow/agents/agentRegistry.d.ts.map +1 -0
- package/dist/workflow/agents/agentRegistry.js +205 -0
- package/dist/workflow/agents/agentRegistry.js.map +1 -0
- package/dist/workflow/agents/index.d.ts +7 -0
- package/dist/workflow/agents/index.d.ts.map +1 -0
- package/dist/workflow/agents/index.js +14 -0
- package/dist/workflow/agents/index.js.map +1 -0
- package/dist/workflow/collaboration.d.ts +110 -0
- package/dist/workflow/collaboration.d.ts.map +1 -0
- package/dist/workflow/collaboration.js +301 -0
- package/dist/workflow/collaboration.js.map +1 -0
- package/dist/workflow/errors.d.ts +48 -0
- package/dist/workflow/errors.d.ts.map +1 -0
- package/dist/workflow/errors.js +52 -0
- package/dist/workflow/errors.js.map +1 -0
- package/dist/workflow/gates/gateChecker.d.ts +93 -0
- package/dist/workflow/gates/gateChecker.d.ts.map +1 -0
- package/dist/workflow/gates/gateChecker.js +197 -0
- package/dist/workflow/gates/gateChecker.js.map +1 -0
- package/dist/workflow/gates/index.d.ts +7 -0
- package/dist/workflow/gates/index.d.ts.map +1 -0
- package/dist/workflow/gates/index.js +13 -0
- package/dist/workflow/gates/index.js.map +1 -0
- package/dist/workflow/index.d.ts +27 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +135 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/orchestration/agentOrchestrator.d.ts +68 -0
- package/dist/workflow/orchestration/agentOrchestrator.d.ts.map +1 -0
- package/dist/workflow/orchestration/agentOrchestrator.js +280 -0
- package/dist/workflow/orchestration/agentOrchestrator.js.map +1 -0
- package/dist/workflow/orchestration/documentLinker.d.ts +100 -0
- package/dist/workflow/orchestration/documentLinker.d.ts.map +1 -0
- package/dist/workflow/orchestration/documentLinker.js +266 -0
- package/dist/workflow/orchestration/documentLinker.js.map +1 -0
- package/dist/workflow/orchestration/index.d.ts +9 -0
- package/dist/workflow/orchestration/index.d.ts.map +1 -0
- package/dist/workflow/orchestration/index.js +25 -0
- package/dist/workflow/orchestration/index.js.map +1 -0
- package/dist/workflow/orchestrator.d.ts +188 -0
- package/dist/workflow/orchestrator.d.ts.map +1 -0
- package/dist/workflow/orchestrator.js +506 -0
- package/dist/workflow/orchestrator.js.map +1 -0
- package/dist/workflow/phases.d.ts +64 -0
- package/dist/workflow/phases.d.ts.map +1 -0
- package/dist/workflow/phases.js +151 -0
- package/dist/workflow/phases.js.map +1 -0
- package/dist/workflow/plans/index.d.ts +8 -0
- package/dist/workflow/plans/index.d.ts.map +1 -0
- package/dist/workflow/plans/index.js +27 -0
- package/dist/workflow/plans/index.js.map +1 -0
- package/dist/workflow/plans/planLinker.d.ts +195 -0
- package/dist/workflow/plans/planLinker.d.ts.map +1 -0
- package/dist/workflow/plans/planLinker.js +1018 -0
- package/dist/workflow/plans/planLinker.js.map +1 -0
- package/dist/workflow/plans/types.d.ts +231 -0
- package/dist/workflow/plans/types.d.ts.map +1 -0
- package/dist/workflow/plans/types.js +25 -0
- package/dist/workflow/plans/types.js.map +1 -0
- package/dist/workflow/prevcConfig.d.ts +27 -0
- package/dist/workflow/prevcConfig.d.ts.map +1 -0
- package/dist/workflow/prevcConfig.js +153 -0
- package/dist/workflow/prevcConfig.js.map +1 -0
- package/dist/workflow/roles.d.ts +50 -0
- package/dist/workflow/roles.d.ts.map +1 -0
- package/dist/workflow/roles.js +118 -0
- package/dist/workflow/roles.js.map +1 -0
- package/dist/workflow/scaling.d.ts +45 -0
- package/dist/workflow/scaling.d.ts.map +1 -0
- package/dist/workflow/scaling.js +215 -0
- package/dist/workflow/scaling.js.map +1 -0
- package/dist/workflow/skills/frontmatter.d.ts +23 -0
- package/dist/workflow/skills/frontmatter.d.ts.map +1 -0
- package/dist/workflow/skills/frontmatter.js +101 -0
- package/dist/workflow/skills/frontmatter.js.map +1 -0
- package/dist/workflow/skills/index.d.ts +10 -0
- package/dist/workflow/skills/index.d.ts.map +1 -0
- package/dist/workflow/skills/index.js +22 -0
- package/dist/workflow/skills/index.js.map +1 -0
- package/dist/workflow/skills/skillRegistry.d.ts +67 -0
- package/dist/workflow/skills/skillRegistry.d.ts.map +1 -0
- package/dist/workflow/skills/skillRegistry.js +276 -0
- package/dist/workflow/skills/skillRegistry.js.map +1 -0
- package/dist/workflow/skills/skillTemplates.d.ts +20 -0
- package/dist/workflow/skills/skillTemplates.d.ts.map +1 -0
- package/dist/workflow/skills/skillTemplates.js +111 -0
- package/dist/workflow/skills/skillTemplates.js.map +1 -0
- package/dist/workflow/skills/types.d.ts +72 -0
- package/dist/workflow/skills/types.d.ts.map +1 -0
- package/dist/workflow/skills/types.js +48 -0
- package/dist/workflow/skills/types.js.map +1 -0
- package/dist/workflow/status/statusManager.d.ts +137 -0
- package/dist/workflow/status/statusManager.d.ts.map +1 -0
- package/dist/workflow/status/statusManager.js +932 -0
- package/dist/workflow/status/statusManager.js.map +1 -0
- package/dist/workflow/status/templates.d.ts +49 -0
- package/dist/workflow/status/templates.d.ts.map +1 -0
- package/dist/workflow/status/templates.js +162 -0
- package/dist/workflow/status/templates.js.map +1 -0
- package/dist/workflow/types.d.ts +314 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/types.js +24 -0
- package/dist/workflow/types.js.map +1 -0
- package/package.json +85 -0
- package/prompts/update_plan_prompt.md +41 -0
- package/prompts/update_scaffold_prompt.md +27 -0
|
@@ -0,0 +1,1018 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Plan Linker
|
|
4
|
+
*
|
|
5
|
+
* Links implementation plans to the PREVC workflow system.
|
|
6
|
+
* Provides bidirectional sync between plan progress and workflow phases.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.PlanLinker = void 0;
|
|
43
|
+
exports.createPlanLinker = createPlanLinker;
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
const fs = __importStar(require("fs-extra"));
|
|
46
|
+
const types_1 = require("./types");
|
|
47
|
+
const agents_1 = require("../agents");
|
|
48
|
+
const gitService_1 = require("../../utils/gitService");
|
|
49
|
+
/**
|
|
50
|
+
* Plan Linker class
|
|
51
|
+
*
|
|
52
|
+
* Responsible for:
|
|
53
|
+
* - Linking plans to PREVC workflow
|
|
54
|
+
* - Parsing plan frontmatter and content
|
|
55
|
+
* - Tracking plan progress
|
|
56
|
+
* - Recording decisions
|
|
57
|
+
*
|
|
58
|
+
* Agent discovery is delegated to AgentRegistry (SRP).
|
|
59
|
+
*/
|
|
60
|
+
class PlanLinker {
|
|
61
|
+
constructor(repoPath, statusManager, autoCommitOnPhaseComplete = true) {
|
|
62
|
+
this.repoPath = repoPath;
|
|
63
|
+
this.contextPath = path.join(repoPath, '.context');
|
|
64
|
+
this.plansPath = path.join(this.contextPath, 'plans');
|
|
65
|
+
this.workflowPath = path.join(this.contextPath, 'workflow');
|
|
66
|
+
this.agentRegistry = (0, agents_1.createAgentRegistry)(repoPath);
|
|
67
|
+
this.statusManager = statusManager;
|
|
68
|
+
this.autoCommitOnPhaseComplete = autoCommitOnPhaseComplete;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Create a PlanLinker with the given repository path
|
|
72
|
+
*/
|
|
73
|
+
static async create(repoPath = process.cwd(), statusManager, autoCommitOnPhaseComplete = true) {
|
|
74
|
+
return new PlanLinker(repoPath, statusManager, autoCommitOnPhaseComplete);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Ensure workflow plan index exists
|
|
78
|
+
*/
|
|
79
|
+
async ensureWorkflowPlanIndex() {
|
|
80
|
+
const plansFile = path.join(this.workflowPath, 'plans.json');
|
|
81
|
+
if (await fs.pathExists(plansFile)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
await fs.ensureDir(this.workflowPath);
|
|
85
|
+
const initialPlans = { active: [], completed: [] };
|
|
86
|
+
await fs.writeFile(plansFile, JSON.stringify(initialPlans, null, 2), 'utf-8');
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Discover all available agents (built-in + custom)
|
|
90
|
+
* Delegates to AgentRegistry
|
|
91
|
+
*/
|
|
92
|
+
async discoverAgents() {
|
|
93
|
+
const discovered = await this.agentRegistry.discoverAll();
|
|
94
|
+
return discovered.all.map(a => ({
|
|
95
|
+
type: a.type,
|
|
96
|
+
path: a.path,
|
|
97
|
+
isCustom: a.isCustom,
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get agent info including custom agents
|
|
102
|
+
* Delegates to AgentRegistry
|
|
103
|
+
*/
|
|
104
|
+
async getAgentInfo(agentType) {
|
|
105
|
+
return this.agentRegistry.getAgentMetadata(agentType);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Link a plan to the current workflow
|
|
109
|
+
*/
|
|
110
|
+
async linkPlan(planSlug) {
|
|
111
|
+
const planPath = path.join(this.plansPath, `${planSlug}.md`);
|
|
112
|
+
if (!await fs.pathExists(planPath)) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const content = await fs.readFile(planPath, 'utf-8');
|
|
116
|
+
const planInfo = this.parsePlanFile(content, planSlug);
|
|
117
|
+
const ref = {
|
|
118
|
+
slug: planSlug,
|
|
119
|
+
path: `plans/${planSlug}.md`,
|
|
120
|
+
title: planInfo.title,
|
|
121
|
+
summary: planInfo.summary,
|
|
122
|
+
linkedAt: new Date().toISOString(),
|
|
123
|
+
status: 'active',
|
|
124
|
+
};
|
|
125
|
+
// Update workflow plans tracking
|
|
126
|
+
await this.addPlanToWorkflow(ref);
|
|
127
|
+
return ref;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Get all linked plans for the current workflow
|
|
131
|
+
*/
|
|
132
|
+
async getLinkedPlans() {
|
|
133
|
+
const plansFile = path.join(this.workflowPath, 'plans.json');
|
|
134
|
+
if (!await fs.pathExists(plansFile)) {
|
|
135
|
+
return { active: [], completed: [] };
|
|
136
|
+
}
|
|
137
|
+
const content = await fs.readFile(plansFile, 'utf-8');
|
|
138
|
+
try {
|
|
139
|
+
return JSON.parse(content) || { active: [], completed: [] };
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
return { active: [], completed: [] };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get detailed plan with workflow mapping
|
|
147
|
+
*/
|
|
148
|
+
async getLinkedPlan(planSlug) {
|
|
149
|
+
const plans = await this.getLinkedPlans();
|
|
150
|
+
const ref = [...plans.active, ...plans.completed].find(p => p.slug === planSlug);
|
|
151
|
+
if (!ref) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
const planPath = path.join(this.contextPath, ref.path);
|
|
155
|
+
if (!await fs.pathExists(planPath)) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
const content = await fs.readFile(planPath, 'utf-8');
|
|
159
|
+
return this.parsePlanToLinked(content, ref);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Get plans for a specific PREVC phase
|
|
163
|
+
*/
|
|
164
|
+
async getPlansForPhase(phase) {
|
|
165
|
+
const plans = await this.getLinkedPlans();
|
|
166
|
+
const linkedPlans = [];
|
|
167
|
+
for (const ref of plans.active) {
|
|
168
|
+
const plan = await this.getLinkedPlan(ref.slug);
|
|
169
|
+
if (plan) {
|
|
170
|
+
const hasPhase = plan.phases.some(p => p.prevcPhase === phase);
|
|
171
|
+
if (hasPhase) {
|
|
172
|
+
linkedPlans.push(plan);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return linkedPlans;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Update plan phase status and sync with workflow
|
|
180
|
+
*/
|
|
181
|
+
async updatePlanPhase(planSlug, phaseId, status) {
|
|
182
|
+
const trackingFile = path.join(this.workflowPath, 'plan-tracking', `${planSlug}.json`);
|
|
183
|
+
let tracking = {};
|
|
184
|
+
if (await fs.pathExists(trackingFile)) {
|
|
185
|
+
const content = await fs.readFile(trackingFile, 'utf-8');
|
|
186
|
+
try {
|
|
187
|
+
tracking = JSON.parse(content) || {};
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
tracking = {};
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// Update phase tracking
|
|
194
|
+
if (!tracking.phases) {
|
|
195
|
+
tracking.phases = {};
|
|
196
|
+
}
|
|
197
|
+
tracking.phases[phaseId] = {
|
|
198
|
+
status,
|
|
199
|
+
updatedAt: new Date().toISOString(),
|
|
200
|
+
};
|
|
201
|
+
// Calculate progress
|
|
202
|
+
const plan = await this.getLinkedPlan(planSlug);
|
|
203
|
+
if (plan) {
|
|
204
|
+
const totalPhases = plan.phases.length;
|
|
205
|
+
const completedPhases = plan.phases.filter(p => tracking.phases?.[p.id]?.status === 'completed').length;
|
|
206
|
+
tracking.progress = totalPhases > 0 ? Math.round((completedPhases / totalPhases) * 100) : 0;
|
|
207
|
+
}
|
|
208
|
+
// Save tracking
|
|
209
|
+
await fs.ensureDir(path.dirname(trackingFile));
|
|
210
|
+
await fs.writeFile(trackingFile, JSON.stringify(tracking, null, 2), 'utf-8');
|
|
211
|
+
// Log phase update to workflow execution history
|
|
212
|
+
if (this.statusManager) {
|
|
213
|
+
const currentPhase = await this.statusManager.getCurrentPhase();
|
|
214
|
+
await this.statusManager.addHistoryEntry({
|
|
215
|
+
phase: currentPhase,
|
|
216
|
+
action: 'plan_phase_updated',
|
|
217
|
+
plan: planSlug,
|
|
218
|
+
description: `Plan phase ${phaseId} updated to ${status}`,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Record a decision in the plan
|
|
225
|
+
*/
|
|
226
|
+
async recordDecision(planSlug, decision) {
|
|
227
|
+
const trackingFile = path.join(this.workflowPath, 'plan-tracking', `${planSlug}.json`);
|
|
228
|
+
let tracking = {};
|
|
229
|
+
if (await fs.pathExists(trackingFile)) {
|
|
230
|
+
const content = await fs.readFile(trackingFile, 'utf-8');
|
|
231
|
+
try {
|
|
232
|
+
tracking = JSON.parse(content) || {};
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
tracking = {};
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
if (!tracking.decisions) {
|
|
239
|
+
tracking.decisions = [];
|
|
240
|
+
}
|
|
241
|
+
const fullDecision = {
|
|
242
|
+
...decision,
|
|
243
|
+
id: `dec-${Date.now()}`,
|
|
244
|
+
decidedAt: new Date().toISOString(),
|
|
245
|
+
};
|
|
246
|
+
tracking.decisions.push(fullDecision);
|
|
247
|
+
await fs.ensureDir(path.dirname(trackingFile));
|
|
248
|
+
await fs.writeFile(trackingFile, JSON.stringify(tracking, null, 2), 'utf-8');
|
|
249
|
+
// Log decision to workflow execution history
|
|
250
|
+
if (this.statusManager) {
|
|
251
|
+
const currentPhase = await this.statusManager.getCurrentPhase();
|
|
252
|
+
await this.statusManager.addHistoryEntry({
|
|
253
|
+
phase: decision.phase || currentPhase,
|
|
254
|
+
action: 'decision_recorded',
|
|
255
|
+
plan: planSlug,
|
|
256
|
+
description: `Decision recorded: ${decision.title}`,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
return fullDecision;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Get current phase mapping for workflow
|
|
263
|
+
*/
|
|
264
|
+
getPhaseMappingForWorkflow(plan, currentPrevcPhase) {
|
|
265
|
+
return plan.phases.filter(p => p.prevcPhase === currentPrevcPhase);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Check if plan has pending work for a PREVC phase
|
|
269
|
+
*/
|
|
270
|
+
hasPendingWorkForPhase(plan, phase) {
|
|
271
|
+
const phasesInPrevc = plan.phases.filter(p => p.prevcPhase === phase);
|
|
272
|
+
return phasesInPrevc.some(p => p.status === 'pending' || p.status === 'in_progress');
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Get plan progress summary
|
|
276
|
+
*/
|
|
277
|
+
async getPlanProgress(planSlug) {
|
|
278
|
+
const plan = await this.getLinkedPlan(planSlug);
|
|
279
|
+
if (!plan) {
|
|
280
|
+
return { overall: 0, byPhase: {} };
|
|
281
|
+
}
|
|
282
|
+
const byPhase = {
|
|
283
|
+
P: { total: 0, completed: 0, percentage: 0 },
|
|
284
|
+
R: { total: 0, completed: 0, percentage: 0 },
|
|
285
|
+
E: { total: 0, completed: 0, percentage: 0 },
|
|
286
|
+
V: { total: 0, completed: 0, percentage: 0 },
|
|
287
|
+
C: { total: 0, completed: 0, percentage: 0 },
|
|
288
|
+
};
|
|
289
|
+
for (const phase of plan.phases) {
|
|
290
|
+
byPhase[phase.prevcPhase].total++;
|
|
291
|
+
if (phase.status === 'completed') {
|
|
292
|
+
byPhase[phase.prevcPhase].completed++;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
// Calculate percentages
|
|
296
|
+
for (const key of Object.keys(byPhase)) {
|
|
297
|
+
const { total, completed } = byPhase[key];
|
|
298
|
+
byPhase[key].percentage = total > 0 ? Math.round((completed / total) * 100) : 0;
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
overall: plan.progress,
|
|
302
|
+
byPhase,
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Update individual step status within a plan phase
|
|
307
|
+
*/
|
|
308
|
+
async updatePlanStep(planSlug, phaseId, stepIndex, status, options) {
|
|
309
|
+
const trackingFile = path.join(this.workflowPath, 'plan-tracking', `${planSlug}.json`);
|
|
310
|
+
const now = new Date().toISOString();
|
|
311
|
+
// Load existing tracking or create new
|
|
312
|
+
let tracking = await this.loadPlanTracking(planSlug);
|
|
313
|
+
if (!tracking) {
|
|
314
|
+
tracking = {
|
|
315
|
+
planSlug,
|
|
316
|
+
progress: 0,
|
|
317
|
+
phases: {},
|
|
318
|
+
decisions: [],
|
|
319
|
+
lastUpdated: now,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
// Ensure phase exists in tracking
|
|
323
|
+
if (!tracking.phases[phaseId]) {
|
|
324
|
+
tracking.phases[phaseId] = {
|
|
325
|
+
phaseId,
|
|
326
|
+
status: 'in_progress',
|
|
327
|
+
startedAt: now,
|
|
328
|
+
steps: [],
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
// Find or create step entry
|
|
332
|
+
let step = tracking.phases[phaseId].steps.find(s => s.stepIndex === stepIndex);
|
|
333
|
+
if (!step) {
|
|
334
|
+
// Get step description from the plan if possible
|
|
335
|
+
const plan = await this.getLinkedPlan(planSlug);
|
|
336
|
+
const planPhase = plan?.phases.find(p => p.id === phaseId);
|
|
337
|
+
const planStep = planPhase?.steps.find(s => s.order === stepIndex);
|
|
338
|
+
step = {
|
|
339
|
+
stepIndex,
|
|
340
|
+
description: planStep?.description || `Step ${stepIndex}`,
|
|
341
|
+
status: 'pending',
|
|
342
|
+
};
|
|
343
|
+
tracking.phases[phaseId].steps.push(step);
|
|
344
|
+
}
|
|
345
|
+
// Update step status and timestamps
|
|
346
|
+
step.status = status;
|
|
347
|
+
if (status === 'in_progress' && !step.startedAt) {
|
|
348
|
+
step.startedAt = now;
|
|
349
|
+
}
|
|
350
|
+
if (status === 'completed') {
|
|
351
|
+
step.completedAt = now;
|
|
352
|
+
}
|
|
353
|
+
if (options?.output) {
|
|
354
|
+
step.output = options.output;
|
|
355
|
+
}
|
|
356
|
+
if (options?.notes) {
|
|
357
|
+
step.notes = options.notes;
|
|
358
|
+
}
|
|
359
|
+
// Update phase status based on steps
|
|
360
|
+
const phaseSteps = tracking.phases[phaseId].steps;
|
|
361
|
+
const allStepsCompleted = phaseSteps.length > 0 && phaseSteps.every(s => s.status === 'completed');
|
|
362
|
+
const anyStepInProgress = phaseSteps.some(s => s.status === 'in_progress');
|
|
363
|
+
if (allStepsCompleted) {
|
|
364
|
+
tracking.phases[phaseId].status = 'completed';
|
|
365
|
+
tracking.phases[phaseId].completedAt = now;
|
|
366
|
+
// Auto-commit on phase completion
|
|
367
|
+
if (this.autoCommitOnPhaseComplete) {
|
|
368
|
+
await this.autoCommitPhase(planSlug, phaseId);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
else if (anyStepInProgress || phaseSteps.some(s => s.status === 'completed')) {
|
|
372
|
+
tracking.phases[phaseId].status = 'in_progress';
|
|
373
|
+
}
|
|
374
|
+
// Recalculate overall progress
|
|
375
|
+
tracking.progress = this.calculateStepProgress(tracking);
|
|
376
|
+
tracking.lastUpdated = now;
|
|
377
|
+
// Save tracking
|
|
378
|
+
await fs.ensureDir(path.dirname(trackingFile));
|
|
379
|
+
await fs.writeFile(trackingFile, JSON.stringify(tracking, null, 2), 'utf-8');
|
|
380
|
+
// Log step to workflow execution history (breadcrumb trail)
|
|
381
|
+
if (this.statusManager) {
|
|
382
|
+
const action = status === 'completed' ? 'step_completed' :
|
|
383
|
+
status === 'in_progress' ? 'step_started' :
|
|
384
|
+
status === 'skipped' ? 'step_skipped' : null;
|
|
385
|
+
if (action) {
|
|
386
|
+
await this.statusManager.addStepHistoryEntry({
|
|
387
|
+
action,
|
|
388
|
+
plan: planSlug,
|
|
389
|
+
planPhase: phaseId,
|
|
390
|
+
stepIndex,
|
|
391
|
+
stepDescription: step.description,
|
|
392
|
+
output: options?.output,
|
|
393
|
+
notes: options?.notes,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
// Auto-sync to markdown
|
|
398
|
+
await this.syncPlanMarkdown(planSlug);
|
|
399
|
+
return true;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Get detailed execution status for a plan including all steps
|
|
403
|
+
*/
|
|
404
|
+
async getPlanExecutionStatus(planSlug) {
|
|
405
|
+
return this.loadPlanTracking(planSlug);
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Sync tracking data back to the plan markdown file
|
|
409
|
+
* Updates checkboxes, timestamps, and adds execution history section
|
|
410
|
+
*/
|
|
411
|
+
async syncPlanMarkdown(planSlug) {
|
|
412
|
+
const planPath = path.join(this.plansPath, `${planSlug}.md`);
|
|
413
|
+
const tracking = await this.loadPlanTracking(planSlug);
|
|
414
|
+
if (!tracking || !await fs.pathExists(planPath)) {
|
|
415
|
+
return false;
|
|
416
|
+
}
|
|
417
|
+
let content = await fs.readFile(planPath, 'utf-8');
|
|
418
|
+
// Update frontmatter with progress and phase statuses
|
|
419
|
+
content = this.updateFrontmatterProgress(content, tracking);
|
|
420
|
+
// Update step checkboxes in markdown body
|
|
421
|
+
content = this.updateStepCheckboxes(content, tracking);
|
|
422
|
+
// Add/update execution history section
|
|
423
|
+
content = this.updateExecutionHistorySection(content, tracking);
|
|
424
|
+
await fs.writeFile(planPath, content, 'utf-8');
|
|
425
|
+
return true;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Record commit information for a completed phase
|
|
429
|
+
*/
|
|
430
|
+
async recordPhaseCommit(planSlug, phaseId, commitInfo) {
|
|
431
|
+
const trackingFile = path.join(this.workflowPath, 'plan-tracking', `${planSlug}.json`);
|
|
432
|
+
const now = new Date().toISOString();
|
|
433
|
+
// Load existing tracking
|
|
434
|
+
let tracking = await this.loadPlanTracking(planSlug);
|
|
435
|
+
if (!tracking) {
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
// Ensure phase exists in tracking
|
|
439
|
+
if (!tracking.phases[phaseId]) {
|
|
440
|
+
return false;
|
|
441
|
+
}
|
|
442
|
+
// Record commit info
|
|
443
|
+
tracking.phases[phaseId].commitHash = commitInfo.hash;
|
|
444
|
+
tracking.phases[phaseId].commitShortHash = commitInfo.shortHash;
|
|
445
|
+
tracking.phases[phaseId].committedAt = now;
|
|
446
|
+
if (commitInfo.committedBy) {
|
|
447
|
+
tracking.phases[phaseId].committedBy = commitInfo.committedBy;
|
|
448
|
+
}
|
|
449
|
+
tracking.lastUpdated = now;
|
|
450
|
+
// Save tracking
|
|
451
|
+
await fs.ensureDir(path.dirname(trackingFile));
|
|
452
|
+
await fs.writeFile(trackingFile, JSON.stringify(tracking, null, 2), 'utf-8');
|
|
453
|
+
// Sync to markdown
|
|
454
|
+
await this.syncPlanMarkdown(planSlug);
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Load plan tracking from JSON file
|
|
459
|
+
*/
|
|
460
|
+
async loadPlanTracking(planSlug) {
|
|
461
|
+
const trackingFile = path.join(this.workflowPath, 'plan-tracking', `${planSlug}.json`);
|
|
462
|
+
if (!await fs.pathExists(trackingFile)) {
|
|
463
|
+
return null;
|
|
464
|
+
}
|
|
465
|
+
try {
|
|
466
|
+
const content = await fs.readFile(trackingFile, 'utf-8');
|
|
467
|
+
const data = JSON.parse(content);
|
|
468
|
+
// Migrate old format to new format if needed
|
|
469
|
+
if (!data.phases || typeof data.phases !== 'object') {
|
|
470
|
+
// Old format had phases as simple status objects
|
|
471
|
+
const migratedPhases = {};
|
|
472
|
+
if (data.phases) {
|
|
473
|
+
for (const [phaseId, phaseData] of Object.entries(data.phases)) {
|
|
474
|
+
migratedPhases[phaseId] = {
|
|
475
|
+
phaseId,
|
|
476
|
+
status: phaseData.status,
|
|
477
|
+
startedAt: phaseData.updatedAt,
|
|
478
|
+
completedAt: phaseData.status === 'completed' ? phaseData.updatedAt : undefined,
|
|
479
|
+
steps: [],
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
return {
|
|
484
|
+
planSlug,
|
|
485
|
+
progress: data.progress || 0,
|
|
486
|
+
phases: migratedPhases,
|
|
487
|
+
decisions: data.decisions || [],
|
|
488
|
+
lastUpdated: data.lastUpdated || new Date().toISOString(),
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
return data;
|
|
492
|
+
}
|
|
493
|
+
catch {
|
|
494
|
+
return null;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Calculate progress based on completed steps across all phases
|
|
499
|
+
*/
|
|
500
|
+
calculateStepProgress(tracking) {
|
|
501
|
+
let totalSteps = 0;
|
|
502
|
+
let completedSteps = 0;
|
|
503
|
+
for (const phase of Object.values(tracking.phases)) {
|
|
504
|
+
totalSteps += phase.steps.length;
|
|
505
|
+
completedSteps += phase.steps.filter(s => s.status === 'completed').length;
|
|
506
|
+
}
|
|
507
|
+
return totalSteps > 0 ? Math.round((completedSteps / totalSteps) * 100) : 0;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Update frontmatter with progress percentage
|
|
511
|
+
*/
|
|
512
|
+
updateFrontmatterProgress(content, tracking) {
|
|
513
|
+
// Check if frontmatter exists
|
|
514
|
+
if (!content.startsWith('---')) {
|
|
515
|
+
return content;
|
|
516
|
+
}
|
|
517
|
+
const endIndex = content.indexOf('---', 3);
|
|
518
|
+
if (endIndex === -1) {
|
|
519
|
+
return content;
|
|
520
|
+
}
|
|
521
|
+
let frontmatter = content.slice(0, endIndex);
|
|
522
|
+
const body = content.slice(endIndex);
|
|
523
|
+
// Update or add progress field
|
|
524
|
+
if (frontmatter.includes('progress:')) {
|
|
525
|
+
frontmatter = frontmatter.replace(/progress:\s*\d+/, `progress: ${tracking.progress}`);
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
// Add progress after status line or at end of frontmatter
|
|
529
|
+
if (frontmatter.includes('status:')) {
|
|
530
|
+
frontmatter = frontmatter.replace(/(status:\s*\w+)/, `$1\nprogress: ${tracking.progress}`);
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
frontmatter = frontmatter.trimEnd() + `\nprogress: ${tracking.progress}\n`;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
// Update or add lastUpdated field
|
|
537
|
+
if (frontmatter.includes('lastUpdated:')) {
|
|
538
|
+
frontmatter = frontmatter.replace(/lastUpdated:\s*"[^"]*"/, `lastUpdated: "${tracking.lastUpdated}"`);
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
frontmatter = frontmatter.trimEnd() + `\nlastUpdated: "${tracking.lastUpdated}"\n`;
|
|
542
|
+
}
|
|
543
|
+
return frontmatter + body;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Update step checkboxes in markdown body
|
|
547
|
+
*/
|
|
548
|
+
updateStepCheckboxes(content, tracking) {
|
|
549
|
+
// Match numbered steps with optional existing checkboxes
|
|
550
|
+
// Patterns like: "1. **Step text**" or "1. [ ] **Step text**" or "1. [x] **Step text**"
|
|
551
|
+
const stepPattern = /^(\d+)\.\s*(?:\[[ x]\]\s*)?(.+?)(?:\s*\*\([^)]*\)\*)?$/gm;
|
|
552
|
+
// Track which phase we're currently in by finding phase headers
|
|
553
|
+
let currentPhaseId = null;
|
|
554
|
+
// Split content into lines for processing
|
|
555
|
+
const lines = content.split('\n');
|
|
556
|
+
const updatedLines = [];
|
|
557
|
+
for (const line of lines) {
|
|
558
|
+
// Check for phase header
|
|
559
|
+
const phaseMatch = line.match(/^###\s+Phase\s+(\d+)/);
|
|
560
|
+
if (phaseMatch) {
|
|
561
|
+
currentPhaseId = `phase-${phaseMatch[1]}`;
|
|
562
|
+
updatedLines.push(line);
|
|
563
|
+
continue;
|
|
564
|
+
}
|
|
565
|
+
// Check for numbered step
|
|
566
|
+
const stepMatch = line.match(/^(\d+)\.\s*(?:\[[ x]\]\s*)?(.+?)(?:\s*\*\([^)]*\)\*)?$/);
|
|
567
|
+
if (stepMatch && currentPhaseId) {
|
|
568
|
+
const stepNum = parseInt(stepMatch[1], 10);
|
|
569
|
+
const stepText = stepMatch[2].trim();
|
|
570
|
+
// Find step in tracking
|
|
571
|
+
const phaseTracking = tracking.phases[currentPhaseId];
|
|
572
|
+
const stepTracking = phaseTracking?.steps.find(s => s.stepIndex === stepNum);
|
|
573
|
+
if (stepTracking) {
|
|
574
|
+
const checkMark = stepTracking.status === 'completed' ? '[x]' : '[ ]';
|
|
575
|
+
let timestamp = '';
|
|
576
|
+
if (stepTracking.completedAt) {
|
|
577
|
+
timestamp = ` *(completed: ${stepTracking.completedAt})*`;
|
|
578
|
+
}
|
|
579
|
+
else if (stepTracking.startedAt && stepTracking.status === 'in_progress') {
|
|
580
|
+
timestamp = ` *(in progress since: ${stepTracking.startedAt})*`;
|
|
581
|
+
}
|
|
582
|
+
updatedLines.push(`${stepNum}. ${checkMark} ${stepText}${timestamp}`);
|
|
583
|
+
continue;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
updatedLines.push(line);
|
|
587
|
+
}
|
|
588
|
+
return updatedLines.join('\n');
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Add or update execution history section in markdown
|
|
592
|
+
*/
|
|
593
|
+
updateExecutionHistorySection(content, tracking) {
|
|
594
|
+
const historySection = this.generateExecutionHistoryMarkdown(tracking);
|
|
595
|
+
// Check if section exists
|
|
596
|
+
const historyMarker = '## Execution History';
|
|
597
|
+
const existingIndex = content.indexOf(historyMarker);
|
|
598
|
+
if (existingIndex > -1) {
|
|
599
|
+
// Find the end of the section (next ## header or end of file)
|
|
600
|
+
const afterHistory = content.slice(existingIndex);
|
|
601
|
+
const nextSectionMatch = afterHistory.match(/\n## [^E]/);
|
|
602
|
+
if (nextSectionMatch && nextSectionMatch.index) {
|
|
603
|
+
const endIndex = existingIndex + nextSectionMatch.index;
|
|
604
|
+
content = content.slice(0, existingIndex) + historySection + content.slice(endIndex);
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
// History is the last section
|
|
608
|
+
content = content.slice(0, existingIndex) + historySection;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
else {
|
|
612
|
+
// Add before "## Evidence" or "## Rollback" or at end
|
|
613
|
+
const insertPoints = ['## Evidence', '## Rollback'];
|
|
614
|
+
let insertIndex = -1;
|
|
615
|
+
for (const marker of insertPoints) {
|
|
616
|
+
const idx = content.indexOf(marker);
|
|
617
|
+
if (idx > -1) {
|
|
618
|
+
insertIndex = idx;
|
|
619
|
+
break;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if (insertIndex > -1) {
|
|
623
|
+
content = content.slice(0, insertIndex) + historySection + '\n\n' + content.slice(insertIndex);
|
|
624
|
+
}
|
|
625
|
+
else {
|
|
626
|
+
content = content.trimEnd() + '\n\n' + historySection;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
return content;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Generate execution history markdown section
|
|
633
|
+
*/
|
|
634
|
+
generateExecutionHistoryMarkdown(tracking) {
|
|
635
|
+
const lines = [
|
|
636
|
+
'## Execution History',
|
|
637
|
+
'',
|
|
638
|
+
`> Last updated: ${tracking.lastUpdated} | Progress: ${tracking.progress}%`,
|
|
639
|
+
'',
|
|
640
|
+
];
|
|
641
|
+
// Sort phases by ID
|
|
642
|
+
const sortedPhases = Object.entries(tracking.phases).sort(([a], [b]) => a.localeCompare(b));
|
|
643
|
+
for (const [phaseId, phase] of sortedPhases) {
|
|
644
|
+
const statusIcon = phase.status === 'completed' ? '[DONE]' :
|
|
645
|
+
phase.status === 'in_progress' ? '[IN PROGRESS]' :
|
|
646
|
+
phase.status === 'skipped' ? '[SKIPPED]' :
|
|
647
|
+
'[PENDING]';
|
|
648
|
+
lines.push(`### ${phaseId} ${statusIcon}`);
|
|
649
|
+
if (phase.startedAt) {
|
|
650
|
+
lines.push(`- Started: ${phase.startedAt}`);
|
|
651
|
+
}
|
|
652
|
+
if (phase.completedAt) {
|
|
653
|
+
lines.push(`- Completed: ${phase.completedAt}`);
|
|
654
|
+
}
|
|
655
|
+
if (phase.steps.length > 0) {
|
|
656
|
+
lines.push('');
|
|
657
|
+
const sortedSteps = [...phase.steps].sort((a, b) => a.stepIndex - b.stepIndex);
|
|
658
|
+
for (const step of sortedSteps) {
|
|
659
|
+
const check = step.status === 'completed' ? 'x' : ' ';
|
|
660
|
+
let line = `- [${check}] Step ${step.stepIndex}: ${step.description}`;
|
|
661
|
+
if (step.completedAt) {
|
|
662
|
+
line += ` *(${step.completedAt})*`;
|
|
663
|
+
}
|
|
664
|
+
else if (step.startedAt && step.status === 'in_progress') {
|
|
665
|
+
line += ` *(in progress)*`;
|
|
666
|
+
}
|
|
667
|
+
lines.push(line);
|
|
668
|
+
if (step.output) {
|
|
669
|
+
lines.push(` - Output: ${step.output}`);
|
|
670
|
+
}
|
|
671
|
+
if (step.notes) {
|
|
672
|
+
lines.push(` - Notes: ${step.notes}`);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
lines.push('');
|
|
677
|
+
}
|
|
678
|
+
return lines.join('\n');
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Parse plan markdown file to extract info
|
|
682
|
+
*/
|
|
683
|
+
parsePlanFile(content, slug) {
|
|
684
|
+
const titleMatch = content.match(/^#\s+(.+?)(?:\s+Plan)?$/m);
|
|
685
|
+
const summaryMatch = content.match(/^>\s*(.+)$/m);
|
|
686
|
+
return {
|
|
687
|
+
title: titleMatch?.[1] || slug,
|
|
688
|
+
summary: summaryMatch?.[1],
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Parse frontmatter from plan content
|
|
693
|
+
*/
|
|
694
|
+
parseFrontMatter(content) {
|
|
695
|
+
// Check if content starts with frontmatter
|
|
696
|
+
if (!content.startsWith('---')) {
|
|
697
|
+
return null;
|
|
698
|
+
}
|
|
699
|
+
const endIndex = content.indexOf('---', 3);
|
|
700
|
+
if (endIndex === -1) {
|
|
701
|
+
return null;
|
|
702
|
+
}
|
|
703
|
+
const frontMatterContent = content.slice(3, endIndex).trim();
|
|
704
|
+
const result = {
|
|
705
|
+
agents: [],
|
|
706
|
+
docs: [],
|
|
707
|
+
phases: [],
|
|
708
|
+
};
|
|
709
|
+
// Parse agents section
|
|
710
|
+
const agentsMatch = frontMatterContent.match(/agents:\s*\n((?:\s+-[^\n]+\n?)+)/);
|
|
711
|
+
if (agentsMatch) {
|
|
712
|
+
const agentLines = agentsMatch[1].split('\n').filter(l => l.trim());
|
|
713
|
+
let currentAgent = null;
|
|
714
|
+
for (const line of agentLines) {
|
|
715
|
+
const typeMatch = line.match(/type:\s*"([^"]+)"/);
|
|
716
|
+
const roleMatch = line.match(/role:\s*"([^"]+)"/);
|
|
717
|
+
if (typeMatch) {
|
|
718
|
+
if (currentAgent) {
|
|
719
|
+
result.agents.push(currentAgent);
|
|
720
|
+
}
|
|
721
|
+
currentAgent = { type: typeMatch[1] };
|
|
722
|
+
}
|
|
723
|
+
if (roleMatch && currentAgent) {
|
|
724
|
+
currentAgent.role = roleMatch[1];
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
if (currentAgent) {
|
|
728
|
+
result.agents.push(currentAgent);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
// Parse docs section
|
|
732
|
+
const docsMatch = frontMatterContent.match(/docs:\s*\n((?:\s+-[^\n]+\n?)+)/);
|
|
733
|
+
if (docsMatch) {
|
|
734
|
+
const docLines = docsMatch[1].split('\n').filter(l => l.trim());
|
|
735
|
+
for (const line of docLines) {
|
|
736
|
+
const docMatch = line.match(/-\s*"([^"]+)"/);
|
|
737
|
+
if (docMatch) {
|
|
738
|
+
result.docs.push(docMatch[1]);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
// Parse phases section
|
|
743
|
+
const phasesMatch = frontMatterContent.match(/phases:\s*\n((?:\s+-[^\n]+\n?)+)/);
|
|
744
|
+
if (phasesMatch) {
|
|
745
|
+
const phaseLines = phasesMatch[1].split('\n').filter(l => l.trim());
|
|
746
|
+
let currentPhase = null;
|
|
747
|
+
for (const line of phaseLines) {
|
|
748
|
+
const idMatch = line.match(/id:\s*"([^"]+)"/);
|
|
749
|
+
const nameMatch = line.match(/name:\s*"([^"]+)"/);
|
|
750
|
+
const prevcMatch = line.match(/prevc:\s*"([^"]+)"/);
|
|
751
|
+
if (idMatch) {
|
|
752
|
+
if (currentPhase && currentPhase.id && currentPhase.name && currentPhase.prevc) {
|
|
753
|
+
result.phases.push(currentPhase);
|
|
754
|
+
}
|
|
755
|
+
currentPhase = { id: idMatch[1], name: '', prevc: '' };
|
|
756
|
+
}
|
|
757
|
+
if (nameMatch && currentPhase) {
|
|
758
|
+
currentPhase.name = nameMatch[1];
|
|
759
|
+
}
|
|
760
|
+
if (prevcMatch && currentPhase) {
|
|
761
|
+
currentPhase.prevc = prevcMatch[1];
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
if (currentPhase && currentPhase.id && currentPhase.name && currentPhase.prevc) {
|
|
765
|
+
result.phases.push(currentPhase);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
return result;
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Parse plan file into LinkedPlan structure
|
|
772
|
+
*/
|
|
773
|
+
parsePlanToLinked(content, ref) {
|
|
774
|
+
// Try frontmatter first, then fallback to body parsing
|
|
775
|
+
const frontMatter = this.parseFrontMatter(content);
|
|
776
|
+
const phases = frontMatter?.phases.length
|
|
777
|
+
? frontMatter.phases.map(p => ({
|
|
778
|
+
id: p.id,
|
|
779
|
+
name: p.name,
|
|
780
|
+
prevcPhase: p.prevc,
|
|
781
|
+
steps: [],
|
|
782
|
+
status: 'pending',
|
|
783
|
+
}))
|
|
784
|
+
: this.extractPhasesFromBody(content);
|
|
785
|
+
const agents = frontMatter?.agents.length
|
|
786
|
+
? frontMatter.agents.map(a => a.type)
|
|
787
|
+
: this.extractAgentsFromBody(content);
|
|
788
|
+
const docs = frontMatter?.docs.length
|
|
789
|
+
? frontMatter.docs
|
|
790
|
+
: this.extractDocsFromBody(content);
|
|
791
|
+
const decisions = this.extractDecisions();
|
|
792
|
+
const completedPhases = phases.filter(p => p.status === 'completed').length;
|
|
793
|
+
const progress = phases.length > 0 ? Math.round((completedPhases / phases.length) * 100) : 0;
|
|
794
|
+
const currentPhase = phases.find(p => p.status === 'in_progress')?.id;
|
|
795
|
+
return {
|
|
796
|
+
ref,
|
|
797
|
+
phases,
|
|
798
|
+
decisions,
|
|
799
|
+
risks: [],
|
|
800
|
+
agents,
|
|
801
|
+
docs,
|
|
802
|
+
progress,
|
|
803
|
+
currentPhase,
|
|
804
|
+
// Include full agent lineup with roles from frontmatter
|
|
805
|
+
agentLineup: frontMatter?.agents || agents.map(a => ({ type: a })),
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Extract phases from plan markdown body (fallback)
|
|
810
|
+
*/
|
|
811
|
+
extractPhasesFromBody(content) {
|
|
812
|
+
const phases = [];
|
|
813
|
+
// Match "### Phase N — Name" or "### Phase N - Name"
|
|
814
|
+
const phaseRegex = /###\s+Phase\s+(\d+)\s*[—-]\s*(.+)/g;
|
|
815
|
+
let match;
|
|
816
|
+
while ((match = phaseRegex.exec(content)) !== null) {
|
|
817
|
+
const phaseNum = match[1];
|
|
818
|
+
const phaseName = match[2].trim();
|
|
819
|
+
const phaseId = `phase-${phaseNum}`;
|
|
820
|
+
// Determine PREVC mapping based on phase name
|
|
821
|
+
const lowerName = phaseName.toLowerCase();
|
|
822
|
+
let prevcPhase = 'E'; // Default to Execution
|
|
823
|
+
for (const [keyword, phase] of Object.entries(types_1.PLAN_PHASE_TO_PREVC)) {
|
|
824
|
+
if (lowerName.includes(keyword)) {
|
|
825
|
+
prevcPhase = phase;
|
|
826
|
+
break;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
phases.push({
|
|
830
|
+
id: phaseId,
|
|
831
|
+
name: phaseName,
|
|
832
|
+
prevcPhase,
|
|
833
|
+
steps: [],
|
|
834
|
+
status: 'pending',
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
// If no phases found, create default structure
|
|
838
|
+
if (phases.length === 0) {
|
|
839
|
+
phases.push({ id: 'phase-1', name: 'Discovery & Alignment', prevcPhase: 'P', steps: [], status: 'pending' }, { id: 'phase-2', name: 'Implementation', prevcPhase: 'E', steps: [], status: 'pending' }, { id: 'phase-3', name: 'Validation & Handoff', prevcPhase: 'V', steps: [], status: 'pending' });
|
|
840
|
+
}
|
|
841
|
+
return phases;
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* Extract decisions from plan content
|
|
845
|
+
*/
|
|
846
|
+
extractDecisions() {
|
|
847
|
+
// Decisions are typically recorded during execution, start empty
|
|
848
|
+
return [];
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Extract agents from plan body (fallback)
|
|
852
|
+
*/
|
|
853
|
+
extractAgentsFromBody(content) {
|
|
854
|
+
const agents = [];
|
|
855
|
+
// Match agent references in table rows
|
|
856
|
+
const agentRegex = /\[([^\]]+)\]\(\.\.\/agents\/([^)]+)\.md\)/g;
|
|
857
|
+
let match;
|
|
858
|
+
while ((match = agentRegex.exec(content)) !== null) {
|
|
859
|
+
const agentType = match[2];
|
|
860
|
+
if (!agents.includes(agentType)) {
|
|
861
|
+
agents.push(agentType);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
return agents;
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* Extract documentation references from plan body (fallback)
|
|
868
|
+
*/
|
|
869
|
+
extractDocsFromBody(content) {
|
|
870
|
+
const docs = [];
|
|
871
|
+
// Match doc references
|
|
872
|
+
const docRegex = /\[([^\]]+)\]\(\.\.\/docs\/([^)]+)\)/g;
|
|
873
|
+
let match;
|
|
874
|
+
while ((match = docRegex.exec(content)) !== null) {
|
|
875
|
+
const docPath = match[2];
|
|
876
|
+
if (!docs.includes(docPath)) {
|
|
877
|
+
docs.push(docPath);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
return docs;
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Add plan reference to workflow tracking
|
|
884
|
+
*/
|
|
885
|
+
async addPlanToWorkflow(ref) {
|
|
886
|
+
const plansFile = path.join(this.workflowPath, 'plans.json');
|
|
887
|
+
let plans = { active: [], completed: [] };
|
|
888
|
+
if (await fs.pathExists(plansFile)) {
|
|
889
|
+
const content = await fs.readFile(plansFile, 'utf-8');
|
|
890
|
+
try {
|
|
891
|
+
plans = JSON.parse(content) || { active: [], completed: [] };
|
|
892
|
+
}
|
|
893
|
+
catch {
|
|
894
|
+
plans = { active: [], completed: [] };
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
// Remove if already exists
|
|
898
|
+
plans.active = plans.active.filter(p => p.slug !== ref.slug);
|
|
899
|
+
plans.completed = plans.completed.filter(p => p.slug !== ref.slug);
|
|
900
|
+
// Add to active
|
|
901
|
+
plans.active.push(ref);
|
|
902
|
+
// Set as primary if first plan
|
|
903
|
+
if (!plans.primary) {
|
|
904
|
+
plans.primary = ref.slug;
|
|
905
|
+
}
|
|
906
|
+
await fs.ensureDir(this.workflowPath);
|
|
907
|
+
await fs.writeFile(plansFile, JSON.stringify(plans, null, 2), 'utf-8');
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* Clear all plans and tracking data
|
|
911
|
+
* Used when deleting/resetting a workflow
|
|
912
|
+
*/
|
|
913
|
+
async clearAllPlans() {
|
|
914
|
+
const plansFile = path.join(this.workflowPath, 'plans.json');
|
|
915
|
+
const trackingDir = path.join(this.workflowPath, 'plan-tracking');
|
|
916
|
+
// Remove plans.json
|
|
917
|
+
if (await fs.pathExists(plansFile)) {
|
|
918
|
+
await fs.remove(plansFile);
|
|
919
|
+
}
|
|
920
|
+
// Remove plan-tracking directory
|
|
921
|
+
if (await fs.pathExists(trackingDir)) {
|
|
922
|
+
await fs.remove(trackingDir);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Archive all plans and tracking data
|
|
927
|
+
* Moves files to .context/workflow/archive/{timestamp}/
|
|
928
|
+
*/
|
|
929
|
+
async archivePlans() {
|
|
930
|
+
const plansFile = path.join(this.workflowPath, 'plans.json');
|
|
931
|
+
const trackingDir = path.join(this.workflowPath, 'plan-tracking');
|
|
932
|
+
// Check if there's anything to archive
|
|
933
|
+
const hasPlans = await fs.pathExists(plansFile);
|
|
934
|
+
const hasTracking = await fs.pathExists(trackingDir);
|
|
935
|
+
if (!hasPlans && !hasTracking) {
|
|
936
|
+
return;
|
|
937
|
+
}
|
|
938
|
+
// Create archive directory with timestamp
|
|
939
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
940
|
+
const archiveDir = path.join(this.workflowPath, 'archive', `plans-${timestamp}`);
|
|
941
|
+
await fs.ensureDir(archiveDir);
|
|
942
|
+
// Move plans.json to archive
|
|
943
|
+
if (hasPlans) {
|
|
944
|
+
await fs.move(plansFile, path.join(archiveDir, 'plans.json'));
|
|
945
|
+
}
|
|
946
|
+
// Move plan-tracking directory to archive
|
|
947
|
+
if (hasTracking) {
|
|
948
|
+
await fs.move(trackingDir, path.join(archiveDir, 'plan-tracking'));
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* Automatically create a git commit when a phase completes
|
|
953
|
+
* @param planSlug Plan identifier
|
|
954
|
+
* @param phaseId Phase identifier
|
|
955
|
+
* @returns true if commit was created, false if skipped or failed
|
|
956
|
+
*/
|
|
957
|
+
async autoCommitPhase(planSlug, phaseId) {
|
|
958
|
+
try {
|
|
959
|
+
// Load plan to get phase details
|
|
960
|
+
const plan = await this.getLinkedPlan(planSlug);
|
|
961
|
+
if (!plan) {
|
|
962
|
+
console.warn(`[AutoCommit] Plan not found: ${planSlug}`);
|
|
963
|
+
return false;
|
|
964
|
+
}
|
|
965
|
+
const phase = plan.phases.find(p => p.id === phaseId);
|
|
966
|
+
if (!phase) {
|
|
967
|
+
console.warn(`[AutoCommit] Phase not found: ${phaseId} in plan ${planSlug}`);
|
|
968
|
+
return false;
|
|
969
|
+
}
|
|
970
|
+
// Initialize git service
|
|
971
|
+
const gitService = new gitService_1.GitService(this.repoPath);
|
|
972
|
+
// Check if this is a git repository
|
|
973
|
+
if (!gitService.isGitRepository()) {
|
|
974
|
+
console.warn('[AutoCommit] Not a git repository - skipping auto-commit');
|
|
975
|
+
return false;
|
|
976
|
+
}
|
|
977
|
+
// Default commit message from phase's commitCheckpoint or generate one
|
|
978
|
+
const commitMessage = phase.commitCheckpoint ||
|
|
979
|
+
`chore(plan): complete ${phase.name} for ${planSlug}`;
|
|
980
|
+
// Stage .context/** files (plan tracking and markdown updates)
|
|
981
|
+
const stagePatterns = ['.context/**'];
|
|
982
|
+
try {
|
|
983
|
+
const stagedFiles = gitService.stageFiles(stagePatterns);
|
|
984
|
+
if (stagedFiles.length === 0) {
|
|
985
|
+
console.info('[AutoCommit] No files to commit - skipping');
|
|
986
|
+
return false;
|
|
987
|
+
}
|
|
988
|
+
// Create the commit with AI Context Agent as co-author
|
|
989
|
+
const coAuthor = 'AI Context Agent';
|
|
990
|
+
const commitResult = gitService.commit(commitMessage, coAuthor);
|
|
991
|
+
// Record the commit in plan tracking
|
|
992
|
+
await this.recordPhaseCommit(planSlug, phaseId, {
|
|
993
|
+
hash: commitResult.hash,
|
|
994
|
+
shortHash: commitResult.shortHash,
|
|
995
|
+
committedBy: coAuthor,
|
|
996
|
+
});
|
|
997
|
+
console.info(`[AutoCommit] Created commit ${commitResult.shortHash} for phase ${phaseId}`);
|
|
998
|
+
return true;
|
|
999
|
+
}
|
|
1000
|
+
catch (error) {
|
|
1001
|
+
// Non-critical failure - log but don't throw
|
|
1002
|
+
console.warn(`[AutoCommit] Failed to create commit for phase ${phaseId}:`, error);
|
|
1003
|
+
return false;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
catch (error) {
|
|
1007
|
+
// Catch-all to prevent breaking the main updatePlanStep flow
|
|
1008
|
+
console.error('[AutoCommit] Unexpected error in autoCommitPhase:', error);
|
|
1009
|
+
return false;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
exports.PlanLinker = PlanLinker;
|
|
1014
|
+
// Export singleton factory
|
|
1015
|
+
function createPlanLinker(repoPath, statusManager, autoCommitOnPhaseComplete = true) {
|
|
1016
|
+
return new PlanLinker(repoPath, statusManager, autoCommitOnPhaseComplete);
|
|
1017
|
+
}
|
|
1018
|
+
//# sourceMappingURL=planLinker.js.map
|