@dotcontext/mcp 0.9.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 +22 -0
- package/dist/cli/index.d.ts +15 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +27 -0
- package/dist/cli/index.js.map +1 -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 +126 -0
- package/dist/generators/documentation/codebaseMapGenerator.d.ts.map +1 -0
- package/dist/generators/documentation/codebaseMapGenerator.js +570 -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 +268 -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 +162 -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 +79 -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 +59 -0
- package/dist/generators/skills/skillGenerator.d.ts.map +1 -0
- package/dist/generators/skills/skillGenerator.js +199 -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 +109 -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/harness/index.d.ts +11 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +33 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1205 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/bin.d.ts +19 -0
- package/dist/mcp/bin.d.ts.map +1 -0
- package/dist/mcp/bin.js +189 -0
- package/dist/mcp/bin.js.map +1 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +28 -0
- package/dist/mcp/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/autoFill/autoFillService.d.ts +52 -0
- package/dist/services/autoFill/autoFillService.d.ts.map +1 -0
- package/dist/services/autoFill/autoFillService.js +474 -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/cli/index.d.ts +8 -0
- package/dist/services/cli/index.d.ts.map +1 -0
- package/dist/services/cli/index.js +17 -0
- package/dist/services/cli/index.js.map +1 -0
- package/dist/services/cli/mcpInstallService.d.ts +57 -0
- package/dist/services/cli/mcpInstallService.d.ts.map +1 -0
- package/dist/services/cli/mcpInstallService.js +607 -0
- package/dist/services/cli/mcpInstallService.js.map +1 -0
- package/dist/services/cli/stateDetector.d.ts +55 -0
- package/dist/services/cli/stateDetector.d.ts.map +1 -0
- package/dist/services/cli/stateDetector.js +191 -0
- package/dist/services/cli/stateDetector.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 +77 -0
- package/dist/services/export/exportRulesService.d.ts.map +1 -0
- package/dist/services/export/exportRulesService.js +318 -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 +265 -0
- package/dist/services/export/skillExportService.js.map +1 -0
- package/dist/services/harness/agentsService.d.ts +31 -0
- package/dist/services/harness/agentsService.d.ts.map +1 -0
- package/dist/services/harness/agentsService.js +135 -0
- package/dist/services/harness/agentsService.js.map +1 -0
- package/dist/services/harness/contextService.d.ts +167 -0
- package/dist/services/harness/contextService.d.ts.map +1 -0
- package/dist/services/harness/contextService.js +403 -0
- package/dist/services/harness/contextService.js.map +1 -0
- package/dist/services/harness/contextTools.d.ts +95 -0
- package/dist/services/harness/contextTools.d.ts.map +1 -0
- package/dist/services/harness/contextTools.js +990 -0
- package/dist/services/harness/contextTools.js.map +1 -0
- package/dist/services/harness/datasetService.d.ts +63 -0
- package/dist/services/harness/datasetService.d.ts.map +1 -0
- package/dist/services/harness/datasetService.js +261 -0
- package/dist/services/harness/datasetService.js.map +1 -0
- package/dist/services/harness/executionService.d.ts +74 -0
- package/dist/services/harness/executionService.d.ts.map +1 -0
- package/dist/services/harness/executionService.js +213 -0
- package/dist/services/harness/executionService.js.map +1 -0
- package/dist/services/harness/index.d.ts +21 -0
- package/dist/services/harness/index.d.ts.map +1 -0
- package/dist/services/harness/index.js +52 -0
- package/dist/services/harness/index.js.map +1 -0
- package/dist/services/harness/plansService.d.ts +45 -0
- package/dist/services/harness/plansService.d.ts.map +1 -0
- package/dist/services/harness/plansService.js +251 -0
- package/dist/services/harness/plansService.js.map +1 -0
- package/dist/services/harness/policyService.d.ts +116 -0
- package/dist/services/harness/policyService.d.ts.map +1 -0
- package/dist/services/harness/policyService.js +510 -0
- package/dist/services/harness/policyService.js.map +1 -0
- package/dist/services/harness/replayService.d.ts +63 -0
- package/dist/services/harness/replayService.d.ts.map +1 -0
- package/dist/services/harness/replayService.js +242 -0
- package/dist/services/harness/replayService.js.map +1 -0
- package/dist/services/harness/runtimeStateService.d.ts +120 -0
- package/dist/services/harness/runtimeStateService.d.ts.map +1 -0
- package/dist/services/harness/runtimeStateService.js +316 -0
- package/dist/services/harness/runtimeStateService.js.map +1 -0
- package/dist/services/harness/sensorCatalogService.d.ts +50 -0
- package/dist/services/harness/sensorCatalogService.d.ts.map +1 -0
- package/dist/services/harness/sensorCatalogService.js +308 -0
- package/dist/services/harness/sensorCatalogService.js.map +1 -0
- package/dist/services/harness/sensorsService.d.ts +64 -0
- package/dist/services/harness/sensorsService.d.ts.map +1 -0
- package/dist/services/harness/sensorsService.js +88 -0
- package/dist/services/harness/sensorsService.js.map +1 -0
- package/dist/services/harness/skillsService.d.ts +31 -0
- package/dist/services/harness/skillsService.d.ts.map +1 -0
- package/dist/services/harness/skillsService.js +296 -0
- package/dist/services/harness/skillsService.js.map +1 -0
- package/dist/services/harness/taskContractsService.d.ts +88 -0
- package/dist/services/harness/taskContractsService.d.ts.map +1 -0
- package/dist/services/harness/taskContractsService.js +210 -0
- package/dist/services/harness/taskContractsService.js.map +1 -0
- package/dist/services/harness/workflowStateService.d.ts +51 -0
- package/dist/services/harness/workflowStateService.d.ts.map +1 -0
- package/dist/services/harness/workflowStateService.js +215 -0
- package/dist/services/harness/workflowStateService.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 +189 -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 +201 -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 +228 -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 +293 -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 +20 -0
- package/dist/services/mcp/actionLogger.d.ts.map +1 -0
- package/dist/services/mcp/actionLogger.js +189 -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 +58 -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 +137 -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/harness.d.ts +7 -0
- package/dist/services/mcp/gateway/harness.d.ts.map +1 -0
- package/dist/services/mcp/gateway/harness.js +337 -0
- package/dist/services/mcp/gateway/harness.js.map +1 -0
- package/dist/services/mcp/gateway/index.d.ts +25 -0
- package/dist/services/mcp/gateway/index.d.ts.map +1 -0
- package/dist/services/mcp/gateway/index.js +55 -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 +85 -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 +7 -0
- package/dist/services/mcp/gateway/shared.d.ts.map +1 -0
- package/dist/services/mcp/gateway/shared.js +13 -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 +56 -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 +187 -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 +161 -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 +219 -0
- package/dist/services/mcp/gateway/workflowInit.js.map +1 -0
- package/dist/services/mcp/gateway/workflowManage.d.ts +47 -0
- package/dist/services/mcp/gateway/workflowManage.d.ts.map +1 -0
- package/dist/services/mcp/gateway/workflowManage.js +367 -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 +93 -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 +39 -0
- package/dist/services/mcp/gatewayTools.js.map +1 -0
- package/dist/services/mcp/index.d.ts +15 -0
- package/dist/services/mcp/index.d.ts.map +1 -0
- package/dist/services/mcp/index.js +34 -0
- package/dist/services/mcp/index.js.map +1 -0
- package/dist/services/mcp/mcpInstallService.d.ts +8 -0
- package/dist/services/mcp/mcpInstallService.d.ts.map +1 -0
- package/dist/services/mcp/mcpInstallService.js +12 -0
- package/dist/services/mcp/mcpInstallService.js.map +1 -0
- package/dist/services/mcp/mcpServer.d.ts +100 -0
- package/dist/services/mcp/mcpServer.d.ts.map +1 -0
- package/dist/services/mcp/mcpServer.js +1036 -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 +12 -0
- package/dist/services/qa/patternInferer.d.ts.map +1 -0
- package/dist/services/qa/patternInferer.js +17 -0
- package/dist/services/qa/patternInferer.js.map +1 -0
- package/dist/services/qa/qaService.d.ts +103 -0
- package/dist/services/qa/qaService.d.ts.map +1 -0
- package/dist/services/qa/qaService.js +838 -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 +365 -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 +269 -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 +177 -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 +13 -0
- package/dist/services/semantic/index.d.ts.map +1 -0
- package/dist/services/semantic/index.js +35 -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/semanticSnapshotService.d.ts +86 -0
- package/dist/services/semantic/semanticSnapshotService.d.ts.map +1 -0
- package/dist/services/semantic/semanticSnapshotService.js +573 -0
- package/dist/services/semantic/semanticSnapshotService.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 +122 -0
- package/dist/services/shared/contentTypeRegistry.js.map +1 -0
- package/dist/services/shared/contextLayout.d.ts +18 -0
- package/dist/services/shared/contextLayout.d.ts.map +1 -0
- package/dist/services/shared/contextLayout.js +139 -0
- package/dist/services/shared/contextLayout.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/executionContext.d.ts +38 -0
- package/dist/services/shared/executionContext.d.ts.map +1 -0
- package/dist/services/shared/executionContext.js +39 -0
- package/dist/services/shared/executionContext.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 +15 -0
- package/dist/services/shared/index.d.ts.map +1 -0
- package/dist/services/shared/index.js +94 -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 +141 -0
- package/dist/services/shared/toolRegistry.d.ts.map +1 -0
- package/dist/services/shared/toolRegistry.js +559 -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 +8 -0
- package/dist/services/state/stateDetector.d.ts.map +1 -0
- package/dist/services/state/stateDetector.js +16 -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 +138 -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 +53 -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 +134 -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 +254 -0
- package/dist/services/sync/syncService.js.map +1 -0
- package/dist/services/sync/types.d.ts +70 -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 +12 -0
- package/dist/services/workflow/index.js.map +1 -0
- package/dist/services/workflow/workflowService.d.ts +219 -0
- package/dist/services/workflow/workflowService.d.ts.map +1 -0
- package/dist/services/workflow/workflowService.js +698 -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 +69 -0
- package/dist/utils/gitignoreManager.d.ts.map +1 -0
- package/dist/utils/gitignoreManager.js +211 -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/processShutdown.d.ts +20 -0
- package/dist/utils/processShutdown.d.ts.map +1 -0
- package/dist/utils/processShutdown.js +47 -0
- package/dist/utils/processShutdown.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 +112 -0
- package/dist/utils/prompts/index.js.map +1 -0
- package/dist/utils/prompts/smartDefaults.d.ts +6 -0
- package/dist/utils/prompts/smartDefaults.d.ts.map +1 -0
- package/dist/utils/prompts/smartDefaults.js +82 -0
- package/dist/utils/prompts/smartDefaults.js.map +1 -0
- package/dist/utils/prompts/types.d.ts +27 -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 +58 -0
- package/dist/utils/versionChecker.js.map +1 -0
- package/dist/version.d.ts +10 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +50 -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 +140 -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 +495 -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 +208 -0
- package/dist/workflow/plans/planLinker.d.ts.map +1 -0
- package/dist/workflow/plans/planLinker.js +1093 -0
- package/dist/workflow/plans/planLinker.js.map +1 -0
- package/dist/workflow/plans/types.d.ts +237 -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 +32 -0
- package/dist/workflow/skills/frontmatter.d.ts.map +1 -0
- package/dist/workflow/skills/frontmatter.js +117 -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 +24 -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 +279 -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 +150 -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 +142 -0
- package/dist/workflow/status/statusManager.d.ts.map +1 -0
- package/dist/workflow/status/statusManager.js +971 -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 +45 -0
|
@@ -0,0 +1,838 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Q&A Service
|
|
4
|
+
*
|
|
5
|
+
* Generates and manages Q&A content for the codebase.
|
|
6
|
+
* Pre-answers common questions to reduce token usage during sessions.
|
|
7
|
+
*
|
|
8
|
+
* OPTIMIZATION: Uses a persisted semantic snapshot when available to avoid
|
|
9
|
+
* re-analyzing the codebase.
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.QAService = void 0;
|
|
46
|
+
const fs = __importStar(require("fs-extra"));
|
|
47
|
+
const path = __importStar(require("path"));
|
|
48
|
+
const codebaseAnalyzer_1 = require("../semantic/codebaseAnalyzer");
|
|
49
|
+
const semanticSnapshotService_1 = require("../semantic/semanticSnapshotService");
|
|
50
|
+
const stackDetector_1 = require("../stack/stackDetector");
|
|
51
|
+
const topicDetector_1 = require("./topicDetector");
|
|
52
|
+
/**
|
|
53
|
+
* Q&A Service for generating and searching Q&A content
|
|
54
|
+
*/
|
|
55
|
+
class QAService {
|
|
56
|
+
constructor(options) {
|
|
57
|
+
this.analyzer = new codebaseAnalyzer_1.CodebaseAnalyzer(options);
|
|
58
|
+
this.stackDetector = new stackDetector_1.StackDetector();
|
|
59
|
+
this.topicDetector = new topicDetector_1.TopicDetector();
|
|
60
|
+
this.snapshotService = new semanticSnapshotService_1.SemanticSnapshotService();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Generate Q&A from codebase analysis
|
|
64
|
+
*
|
|
65
|
+
* OPTIMIZATION: Uses a persisted semantic snapshot when available.
|
|
66
|
+
* If the snapshot doesn't exist or is stale, falls back to full analysis.
|
|
67
|
+
*/
|
|
68
|
+
async generateFromCodebase(repoPath) {
|
|
69
|
+
const absolutePath = path.resolve(repoPath);
|
|
70
|
+
let stack;
|
|
71
|
+
let patterns;
|
|
72
|
+
try {
|
|
73
|
+
const snapshot = await this.snapshotService.ensureFreshSummary(absolutePath);
|
|
74
|
+
stack = this.convertMapStackToStackInfo(snapshot.summary);
|
|
75
|
+
patterns = snapshot.summary.functionalPatterns;
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
stack = await this.stackDetector.detect(absolutePath);
|
|
79
|
+
patterns = await this.analyzer.detectFunctionalPatterns(absolutePath);
|
|
80
|
+
}
|
|
81
|
+
// Determine relevant topics
|
|
82
|
+
const topicDetection = this.topicDetector.detectTopics(stack, patterns);
|
|
83
|
+
// Generate Q&A for each topic
|
|
84
|
+
const generated = [];
|
|
85
|
+
const skipped = [];
|
|
86
|
+
for (const topic of topicDetection.topics) {
|
|
87
|
+
try {
|
|
88
|
+
const entry = await this.generateQAForTopic(absolutePath, topic, stack, patterns, topicDetection);
|
|
89
|
+
if (entry) {
|
|
90
|
+
generated.push(entry);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
skipped.push(topic.slug);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
skipped.push(topic.slug);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Save generated Q&A
|
|
101
|
+
await this.saveQAEntries(absolutePath, generated, topicDetection);
|
|
102
|
+
return {
|
|
103
|
+
generated,
|
|
104
|
+
skipped,
|
|
105
|
+
topicDetection,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Search Q&A entries for a query
|
|
110
|
+
*/
|
|
111
|
+
async search(repoPath, query) {
|
|
112
|
+
const qaDir = path.join(repoPath, '.context', 'docs', 'qa');
|
|
113
|
+
if (!(await fs.pathExists(qaDir))) {
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
const results = [];
|
|
117
|
+
const files = await fs.readdir(qaDir);
|
|
118
|
+
const queryLower = query.toLowerCase();
|
|
119
|
+
const queryWords = queryLower.split(/\s+/).filter((w) => w.length > 2);
|
|
120
|
+
for (const file of files) {
|
|
121
|
+
if (!file.endsWith('.md') || file === 'README.md')
|
|
122
|
+
continue;
|
|
123
|
+
try {
|
|
124
|
+
const content = await fs.readFile(path.join(qaDir, file), 'utf-8');
|
|
125
|
+
const entry = this.parseQAEntry(content, file);
|
|
126
|
+
if (!entry)
|
|
127
|
+
continue;
|
|
128
|
+
// Calculate relevance score
|
|
129
|
+
const { score, reason } = this.calculateRelevance(entry, queryLower, queryWords);
|
|
130
|
+
if (score > 0) {
|
|
131
|
+
results.push({
|
|
132
|
+
entry,
|
|
133
|
+
score,
|
|
134
|
+
matchReason: reason,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
// Skip files that can't be read
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// Sort by score descending
|
|
143
|
+
results.sort((a, b) => b.score - a.score);
|
|
144
|
+
return results.slice(0, 10);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get all Q&A entries
|
|
148
|
+
*/
|
|
149
|
+
async getAll(repoPath) {
|
|
150
|
+
const qaDir = path.join(repoPath, '.context', 'docs', 'qa');
|
|
151
|
+
if (!(await fs.pathExists(qaDir))) {
|
|
152
|
+
return [];
|
|
153
|
+
}
|
|
154
|
+
const entries = [];
|
|
155
|
+
const files = await fs.readdir(qaDir);
|
|
156
|
+
for (const file of files) {
|
|
157
|
+
if (!file.endsWith('.md') || file === 'README.md')
|
|
158
|
+
continue;
|
|
159
|
+
try {
|
|
160
|
+
const content = await fs.readFile(path.join(qaDir, file), 'utf-8');
|
|
161
|
+
const entry = this.parseQAEntry(content, file);
|
|
162
|
+
if (entry) {
|
|
163
|
+
entries.push(entry);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
// Skip files that can't be read
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return entries;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Get a specific Q&A entry by slug
|
|
174
|
+
*/
|
|
175
|
+
async getBySlug(repoPath, slug) {
|
|
176
|
+
const qaFile = path.join(repoPath, '.context', 'docs', 'qa', `${slug}.md`);
|
|
177
|
+
if (!(await fs.pathExists(qaFile))) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
try {
|
|
181
|
+
const content = await fs.readFile(qaFile, 'utf-8');
|
|
182
|
+
return this.parseQAEntry(content, `${slug}.md`);
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Generate Q&A entry for a specific topic
|
|
190
|
+
*/
|
|
191
|
+
async generateQAForTopic(repoPath, topic, stack, patterns, topicResult) {
|
|
192
|
+
const relevantFiles = [];
|
|
193
|
+
let answer = '';
|
|
194
|
+
switch (topic.slug) {
|
|
195
|
+
case 'getting-started':
|
|
196
|
+
answer = this.generateGettingStartedAnswer(stack, repoPath);
|
|
197
|
+
break;
|
|
198
|
+
case 'project-structure':
|
|
199
|
+
answer = await this.generateProjectStructureAnswer(repoPath, stack);
|
|
200
|
+
relevantFiles.push(...(await this.findRelevantFiles(repoPath, ['src/', 'lib/', 'app/'])));
|
|
201
|
+
break;
|
|
202
|
+
case 'cli-commands':
|
|
203
|
+
answer = this.generateCLICommandsAnswer(stack);
|
|
204
|
+
relevantFiles.push(...(await this.findRelevantFiles(repoPath, ['bin/', 'cli', 'commands/'])));
|
|
205
|
+
break;
|
|
206
|
+
case 'cli-arguments':
|
|
207
|
+
answer = this.generateCLIArgumentsAnswer(stack);
|
|
208
|
+
break;
|
|
209
|
+
case 'routing':
|
|
210
|
+
answer = await this.generateRoutingAnswer(repoPath, stack, patterns);
|
|
211
|
+
relevantFiles.push(...(await this.findRelevantFiles(repoPath, ['routes/', 'api/', 'pages/'])));
|
|
212
|
+
break;
|
|
213
|
+
case 'middleware':
|
|
214
|
+
answer = await this.generateMiddlewareAnswer(repoPath, patterns);
|
|
215
|
+
relevantFiles.push(...(await this.findRelevantFiles(repoPath, ['middleware/', 'middlewares/'])));
|
|
216
|
+
break;
|
|
217
|
+
case 'authentication':
|
|
218
|
+
answer = this.generateAuthAnswer(patterns);
|
|
219
|
+
relevantFiles.push(...this.getPatternFiles(patterns, 'auth', repoPath));
|
|
220
|
+
break;
|
|
221
|
+
case 'database':
|
|
222
|
+
answer = this.generateDatabaseAnswer(patterns);
|
|
223
|
+
relevantFiles.push(...this.getPatternFiles(patterns, 'database', repoPath));
|
|
224
|
+
break;
|
|
225
|
+
case 'api-endpoints':
|
|
226
|
+
answer = await this.generateAPIEndpointsAnswer(repoPath, patterns);
|
|
227
|
+
relevantFiles.push(...this.getPatternFiles(patterns, 'api', repoPath));
|
|
228
|
+
break;
|
|
229
|
+
case 'testing':
|
|
230
|
+
answer = this.generateTestingAnswer(stack, patterns);
|
|
231
|
+
relevantFiles.push(...(await this.findRelevantFiles(repoPath, ['test/', 'tests/', '__tests__/', '*.test.', '*.spec.'])));
|
|
232
|
+
break;
|
|
233
|
+
case 'error-handling':
|
|
234
|
+
answer = this.generateErrorHandlingAnswer(patterns);
|
|
235
|
+
relevantFiles.push(...this.getPatternFiles(patterns, 'error-handling', repoPath));
|
|
236
|
+
break;
|
|
237
|
+
case 'caching':
|
|
238
|
+
answer = this.generateCachingAnswer(patterns);
|
|
239
|
+
relevantFiles.push(...this.getPatternFiles(patterns, 'cache', repoPath));
|
|
240
|
+
break;
|
|
241
|
+
case 'realtime':
|
|
242
|
+
answer = this.generateRealtimeAnswer(patterns);
|
|
243
|
+
relevantFiles.push(...this.getPatternFiles(patterns, 'websocket', repoPath));
|
|
244
|
+
break;
|
|
245
|
+
case 'background-jobs':
|
|
246
|
+
answer = this.generateBackgroundJobsAnswer(patterns);
|
|
247
|
+
relevantFiles.push(...this.getPatternFiles(patterns, 'queue', repoPath));
|
|
248
|
+
break;
|
|
249
|
+
case 'deployment':
|
|
250
|
+
answer = this.generateDeploymentAnswer(stack);
|
|
251
|
+
relevantFiles.push(...(await this.findRelevantFiles(repoPath, ['Dockerfile', 'docker-compose', '.github/workflows/'])));
|
|
252
|
+
break;
|
|
253
|
+
default:
|
|
254
|
+
return null;
|
|
255
|
+
}
|
|
256
|
+
if (!answer)
|
|
257
|
+
return null;
|
|
258
|
+
return {
|
|
259
|
+
slug: topic.slug,
|
|
260
|
+
question: topic.question,
|
|
261
|
+
answer,
|
|
262
|
+
category: topic.category,
|
|
263
|
+
generatedAt: new Date().toISOString(),
|
|
264
|
+
relevantFiles: [...new Set(relevantFiles)].slice(0, 10),
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
// Answer generation methods
|
|
268
|
+
generateGettingStartedAnswer(stack, repoPath) {
|
|
269
|
+
const lines = [];
|
|
270
|
+
lines.push('## Getting Started\n');
|
|
271
|
+
// Prerequisites
|
|
272
|
+
lines.push('### Prerequisites\n');
|
|
273
|
+
if (stack.primaryLanguage === 'typescript' || stack.primaryLanguage === 'javascript') {
|
|
274
|
+
lines.push('- Node.js (LTS version recommended)');
|
|
275
|
+
if (stack.packageManager) {
|
|
276
|
+
lines.push(`- ${stack.packageManager}`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
else if (stack.primaryLanguage === 'python') {
|
|
280
|
+
lines.push('- Python 3.8+');
|
|
281
|
+
if (stack.packageManager === 'poetry') {
|
|
282
|
+
lines.push('- Poetry');
|
|
283
|
+
}
|
|
284
|
+
else if (stack.packageManager === 'pipenv') {
|
|
285
|
+
lines.push('- Pipenv');
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
lines.push('');
|
|
289
|
+
// Installation
|
|
290
|
+
lines.push('### Installation\n');
|
|
291
|
+
lines.push('```bash');
|
|
292
|
+
lines.push('# Clone the repository');
|
|
293
|
+
lines.push('git clone <repository-url>');
|
|
294
|
+
lines.push(`cd ${path.basename(repoPath)}`);
|
|
295
|
+
lines.push('');
|
|
296
|
+
// Install dependencies
|
|
297
|
+
if (stack.packageManager === 'yarn') {
|
|
298
|
+
lines.push('# Install dependencies');
|
|
299
|
+
lines.push('yarn install');
|
|
300
|
+
}
|
|
301
|
+
else if (stack.packageManager === 'pnpm') {
|
|
302
|
+
lines.push('# Install dependencies');
|
|
303
|
+
lines.push('pnpm install');
|
|
304
|
+
}
|
|
305
|
+
else if (stack.packageManager === 'bun') {
|
|
306
|
+
lines.push('# Install dependencies');
|
|
307
|
+
lines.push('bun install');
|
|
308
|
+
}
|
|
309
|
+
else if (stack.primaryLanguage === 'typescript' || stack.primaryLanguage === 'javascript') {
|
|
310
|
+
lines.push('# Install dependencies');
|
|
311
|
+
lines.push('npm install');
|
|
312
|
+
}
|
|
313
|
+
else if (stack.packageManager === 'poetry') {
|
|
314
|
+
lines.push('# Install dependencies');
|
|
315
|
+
lines.push('poetry install');
|
|
316
|
+
}
|
|
317
|
+
else if (stack.packageManager === 'pipenv') {
|
|
318
|
+
lines.push('# Install dependencies');
|
|
319
|
+
lines.push('pipenv install');
|
|
320
|
+
}
|
|
321
|
+
else if (stack.primaryLanguage === 'python') {
|
|
322
|
+
lines.push('# Install dependencies');
|
|
323
|
+
lines.push('pip install -r requirements.txt');
|
|
324
|
+
}
|
|
325
|
+
lines.push('```\n');
|
|
326
|
+
// Running
|
|
327
|
+
lines.push('### Running\n');
|
|
328
|
+
lines.push('```bash');
|
|
329
|
+
if (stack.buildTools.includes('vite')) {
|
|
330
|
+
lines.push('# Development');
|
|
331
|
+
lines.push('npm run dev');
|
|
332
|
+
}
|
|
333
|
+
else if (stack.frameworks.includes('nextjs')) {
|
|
334
|
+
lines.push('# Development');
|
|
335
|
+
lines.push('npm run dev');
|
|
336
|
+
}
|
|
337
|
+
else if (stack.frameworks.includes('express') || stack.frameworks.includes('nestjs') || stack.frameworks.includes('fastify')) {
|
|
338
|
+
lines.push('# Development');
|
|
339
|
+
lines.push('npm run dev');
|
|
340
|
+
lines.push('');
|
|
341
|
+
lines.push('# Production');
|
|
342
|
+
lines.push('npm run build && npm start');
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
lines.push('# See package.json for available scripts');
|
|
346
|
+
lines.push('npm run <script-name>');
|
|
347
|
+
}
|
|
348
|
+
lines.push('```');
|
|
349
|
+
return lines.join('\n');
|
|
350
|
+
}
|
|
351
|
+
async generateProjectStructureAnswer(repoPath, stack) {
|
|
352
|
+
const lines = [];
|
|
353
|
+
lines.push('## Project Structure\n');
|
|
354
|
+
// Try to read actual directory structure
|
|
355
|
+
try {
|
|
356
|
+
const entries = await fs.readdir(repoPath, { withFileTypes: true });
|
|
357
|
+
const dirs = entries
|
|
358
|
+
.filter((e) => e.isDirectory() && !e.name.startsWith('.') && e.name !== 'node_modules')
|
|
359
|
+
.map((e) => e.name)
|
|
360
|
+
.slice(0, 15);
|
|
361
|
+
if (dirs.length > 0) {
|
|
362
|
+
lines.push('```');
|
|
363
|
+
for (const dir of dirs) {
|
|
364
|
+
lines.push(`${dir}/`);
|
|
365
|
+
}
|
|
366
|
+
lines.push('```\n');
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
catch {
|
|
370
|
+
// Ignore errors
|
|
371
|
+
}
|
|
372
|
+
// Add framework-specific structure hints
|
|
373
|
+
if (stack.frameworks.includes('nextjs')) {
|
|
374
|
+
lines.push('### Next.js Structure\n');
|
|
375
|
+
lines.push('- `app/` or `pages/` - Routes and pages');
|
|
376
|
+
lines.push('- `components/` - Reusable UI components');
|
|
377
|
+
lines.push('- `lib/` - Utility functions');
|
|
378
|
+
lines.push('- `public/` - Static assets');
|
|
379
|
+
}
|
|
380
|
+
else if (stack.frameworks.includes('nestjs')) {
|
|
381
|
+
lines.push('### NestJS Structure\n');
|
|
382
|
+
lines.push('- `src/` - Source code');
|
|
383
|
+
lines.push(' - `modules/` - Feature modules');
|
|
384
|
+
lines.push(' - `common/` - Shared code');
|
|
385
|
+
lines.push(' - `main.ts` - Application entry');
|
|
386
|
+
}
|
|
387
|
+
else if (stack.frameworks.includes('express')) {
|
|
388
|
+
lines.push('### Express Structure\n');
|
|
389
|
+
lines.push('- `src/` - Source code');
|
|
390
|
+
lines.push('- `routes/` - Route handlers');
|
|
391
|
+
lines.push('- `middleware/` - Express middleware');
|
|
392
|
+
lines.push('- `controllers/` - Request handlers');
|
|
393
|
+
}
|
|
394
|
+
return lines.join('\n');
|
|
395
|
+
}
|
|
396
|
+
generateCLICommandsAnswer(stack) {
|
|
397
|
+
const lines = [];
|
|
398
|
+
lines.push('## CLI Commands\n');
|
|
399
|
+
if (stack.cliLibraries?.includes('commander')) {
|
|
400
|
+
lines.push('This CLI is built with Commander.js.\n');
|
|
401
|
+
lines.push('Run `<command> --help` to see available commands and options.\n');
|
|
402
|
+
}
|
|
403
|
+
else if (stack.cliLibraries?.includes('yargs')) {
|
|
404
|
+
lines.push('This CLI is built with Yargs.\n');
|
|
405
|
+
lines.push('Run `<command> --help` to see available commands and options.\n');
|
|
406
|
+
}
|
|
407
|
+
else if (stack.cliLibraries?.includes('oclif')) {
|
|
408
|
+
lines.push('This CLI is built with oclif.\n');
|
|
409
|
+
lines.push('Run `<command> help` to see available commands.\n');
|
|
410
|
+
}
|
|
411
|
+
lines.push('### Common Commands\n');
|
|
412
|
+
lines.push('See the documentation or source code for specific commands.');
|
|
413
|
+
return lines.join('\n');
|
|
414
|
+
}
|
|
415
|
+
generateCLIArgumentsAnswer(stack) {
|
|
416
|
+
const lines = [];
|
|
417
|
+
lines.push('## CLI Arguments and Options\n');
|
|
418
|
+
if (stack.cliLibraries?.includes('commander')) {
|
|
419
|
+
lines.push('### Commander.js Pattern\n');
|
|
420
|
+
lines.push('```bash');
|
|
421
|
+
lines.push('command [options] <required-arg> [optional-arg]');
|
|
422
|
+
lines.push('```\n');
|
|
423
|
+
lines.push('- Options: `--flag` or `-f`');
|
|
424
|
+
lines.push('- Option with value: `--name <value>`');
|
|
425
|
+
}
|
|
426
|
+
else if (stack.cliLibraries?.includes('yargs')) {
|
|
427
|
+
lines.push('### Yargs Pattern\n');
|
|
428
|
+
lines.push('```bash');
|
|
429
|
+
lines.push('command <positional> --flag --option=value');
|
|
430
|
+
lines.push('```');
|
|
431
|
+
}
|
|
432
|
+
return lines.join('\n');
|
|
433
|
+
}
|
|
434
|
+
async generateRoutingAnswer(repoPath, stack, patterns) {
|
|
435
|
+
const lines = [];
|
|
436
|
+
lines.push('## Routing\n');
|
|
437
|
+
if (stack.frameworks.includes('nextjs')) {
|
|
438
|
+
lines.push('### Next.js App Router\n');
|
|
439
|
+
lines.push('Routes are defined by the folder structure in `app/`:\n');
|
|
440
|
+
lines.push('- `app/page.tsx` → `/`');
|
|
441
|
+
lines.push('- `app/about/page.tsx` → `/about`');
|
|
442
|
+
lines.push('- `app/blog/[slug]/page.tsx` → `/blog/:slug`');
|
|
443
|
+
}
|
|
444
|
+
else if (stack.frameworks.includes('express') || stack.frameworks.includes('fastify')) {
|
|
445
|
+
lines.push(`### ${stack.frameworks.includes('express') ? 'Express' : 'Fastify'} Routing\n`);
|
|
446
|
+
lines.push('Routes are typically defined in route files:\n');
|
|
447
|
+
lines.push('```typescript');
|
|
448
|
+
lines.push('router.get(\'/path\', handler);');
|
|
449
|
+
lines.push('router.post(\'/path\', handler);');
|
|
450
|
+
lines.push('```');
|
|
451
|
+
}
|
|
452
|
+
else if (stack.frameworks.includes('nestjs')) {
|
|
453
|
+
lines.push('### NestJS Routing\n');
|
|
454
|
+
lines.push('Routes are defined using decorators:\n');
|
|
455
|
+
lines.push('```typescript');
|
|
456
|
+
lines.push('@Controller(\'users\')');
|
|
457
|
+
lines.push('class UsersController {');
|
|
458
|
+
lines.push(' @Get()');
|
|
459
|
+
lines.push(' findAll() { }');
|
|
460
|
+
lines.push('}');
|
|
461
|
+
lines.push('```');
|
|
462
|
+
}
|
|
463
|
+
// Add API pattern indicators
|
|
464
|
+
if (patterns.hasApiPattern) {
|
|
465
|
+
const apiIndicators = patterns.patterns.find((p) => p.type === 'api')?.indicators;
|
|
466
|
+
if (apiIndicators?.length) {
|
|
467
|
+
lines.push('\n### Detected Route Files\n');
|
|
468
|
+
for (const ind of apiIndicators.slice(0, 5)) {
|
|
469
|
+
if (ind.file) {
|
|
470
|
+
lines.push(`- \`${path.relative(repoPath, ind.file)}\``);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return lines.join('\n');
|
|
476
|
+
}
|
|
477
|
+
async generateMiddlewareAnswer(repoPath, patterns) {
|
|
478
|
+
const lines = [];
|
|
479
|
+
lines.push('## Middleware\n');
|
|
480
|
+
lines.push('Middleware functions process requests before they reach route handlers.\n');
|
|
481
|
+
if (patterns.hasAuthPattern) {
|
|
482
|
+
lines.push('### Authentication Middleware');
|
|
483
|
+
lines.push('The codebase includes authentication middleware.');
|
|
484
|
+
}
|
|
485
|
+
if (patterns.hasValidationPattern) {
|
|
486
|
+
lines.push('\n### Validation Middleware');
|
|
487
|
+
lines.push('Request validation is implemented using middleware.');
|
|
488
|
+
}
|
|
489
|
+
if (patterns.hasLoggingPattern) {
|
|
490
|
+
lines.push('\n### Logging Middleware');
|
|
491
|
+
lines.push('Request logging is handled by middleware.');
|
|
492
|
+
}
|
|
493
|
+
return lines.join('\n');
|
|
494
|
+
}
|
|
495
|
+
generateAuthAnswer(patterns) {
|
|
496
|
+
const lines = [];
|
|
497
|
+
lines.push('## Authentication\n');
|
|
498
|
+
const authPattern = patterns.patterns.find((p) => p.type === 'auth');
|
|
499
|
+
if (!authPattern) {
|
|
500
|
+
lines.push('Authentication patterns detected in the codebase.');
|
|
501
|
+
return lines.join('\n');
|
|
502
|
+
}
|
|
503
|
+
lines.push('### Implementation Details\n');
|
|
504
|
+
for (const ind of authPattern.indicators.slice(0, 5)) {
|
|
505
|
+
lines.push(`- ${ind.reason}`);
|
|
506
|
+
}
|
|
507
|
+
return lines.join('\n');
|
|
508
|
+
}
|
|
509
|
+
generateDatabaseAnswer(patterns) {
|
|
510
|
+
const lines = [];
|
|
511
|
+
lines.push('## Database\n');
|
|
512
|
+
const dbPattern = patterns.patterns.find((p) => p.type === 'database');
|
|
513
|
+
if (!dbPattern) {
|
|
514
|
+
lines.push('Database patterns detected in the codebase.');
|
|
515
|
+
return lines.join('\n');
|
|
516
|
+
}
|
|
517
|
+
lines.push('### Implementation Details\n');
|
|
518
|
+
for (const ind of dbPattern.indicators.slice(0, 5)) {
|
|
519
|
+
lines.push(`- ${ind.reason}`);
|
|
520
|
+
}
|
|
521
|
+
return lines.join('\n');
|
|
522
|
+
}
|
|
523
|
+
async generateAPIEndpointsAnswer(repoPath, patterns) {
|
|
524
|
+
const lines = [];
|
|
525
|
+
lines.push('## API Endpoints\n');
|
|
526
|
+
const apiPattern = patterns.patterns.find((p) => p.type === 'api');
|
|
527
|
+
if (!apiPattern) {
|
|
528
|
+
lines.push('API patterns detected in the codebase.');
|
|
529
|
+
return lines.join('\n');
|
|
530
|
+
}
|
|
531
|
+
lines.push('### Detected API Files\n');
|
|
532
|
+
for (const ind of apiPattern.indicators.slice(0, 8)) {
|
|
533
|
+
if (ind.file) {
|
|
534
|
+
lines.push(`- \`${path.relative(repoPath, ind.file)}\` - ${ind.reason}`);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
return lines.join('\n');
|
|
538
|
+
}
|
|
539
|
+
generateTestingAnswer(stack, patterns) {
|
|
540
|
+
const lines = [];
|
|
541
|
+
lines.push('## Testing\n');
|
|
542
|
+
if (stack.testFrameworks.length > 0) {
|
|
543
|
+
lines.push(`### Test Frameworks: ${stack.testFrameworks.join(', ')}\n`);
|
|
544
|
+
}
|
|
545
|
+
lines.push('### Running Tests\n');
|
|
546
|
+
lines.push('```bash');
|
|
547
|
+
if (stack.testFrameworks.includes('jest')) {
|
|
548
|
+
lines.push('npm test');
|
|
549
|
+
lines.push('npm test -- --watch');
|
|
550
|
+
lines.push('npm test -- --coverage');
|
|
551
|
+
}
|
|
552
|
+
else if (stack.testFrameworks.includes('vitest')) {
|
|
553
|
+
lines.push('npm test');
|
|
554
|
+
lines.push('npm test -- --watch');
|
|
555
|
+
}
|
|
556
|
+
else if (stack.testFrameworks.includes('pytest')) {
|
|
557
|
+
lines.push('pytest');
|
|
558
|
+
lines.push('pytest --cov');
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
lines.push('npm test');
|
|
562
|
+
}
|
|
563
|
+
lines.push('```');
|
|
564
|
+
return lines.join('\n');
|
|
565
|
+
}
|
|
566
|
+
generateErrorHandlingAnswer(patterns) {
|
|
567
|
+
const lines = [];
|
|
568
|
+
lines.push('## Error Handling\n');
|
|
569
|
+
const errorPattern = patterns.patterns.find((p) => p.type === 'error-handling');
|
|
570
|
+
if (!errorPattern) {
|
|
571
|
+
lines.push('Error handling patterns detected in the codebase.');
|
|
572
|
+
return lines.join('\n');
|
|
573
|
+
}
|
|
574
|
+
lines.push('### Implementation Details\n');
|
|
575
|
+
for (const ind of errorPattern.indicators.slice(0, 5)) {
|
|
576
|
+
lines.push(`- ${ind.reason}`);
|
|
577
|
+
}
|
|
578
|
+
return lines.join('\n');
|
|
579
|
+
}
|
|
580
|
+
generateCachingAnswer(patterns) {
|
|
581
|
+
const lines = [];
|
|
582
|
+
lines.push('## Caching\n');
|
|
583
|
+
const cachePattern = patterns.patterns.find((p) => p.type === 'cache');
|
|
584
|
+
if (!cachePattern) {
|
|
585
|
+
lines.push('Caching patterns detected in the codebase.');
|
|
586
|
+
return lines.join('\n');
|
|
587
|
+
}
|
|
588
|
+
lines.push('### Implementation Details\n');
|
|
589
|
+
for (const ind of cachePattern.indicators.slice(0, 5)) {
|
|
590
|
+
lines.push(`- ${ind.reason}`);
|
|
591
|
+
}
|
|
592
|
+
return lines.join('\n');
|
|
593
|
+
}
|
|
594
|
+
generateRealtimeAnswer(patterns) {
|
|
595
|
+
const lines = [];
|
|
596
|
+
lines.push('## Real-time Features\n');
|
|
597
|
+
const wsPattern = patterns.patterns.find((p) => p.type === 'websocket');
|
|
598
|
+
if (!wsPattern) {
|
|
599
|
+
lines.push('WebSocket patterns detected in the codebase.');
|
|
600
|
+
return lines.join('\n');
|
|
601
|
+
}
|
|
602
|
+
lines.push('### Implementation Details\n');
|
|
603
|
+
for (const ind of wsPattern.indicators.slice(0, 5)) {
|
|
604
|
+
lines.push(`- ${ind.reason}`);
|
|
605
|
+
}
|
|
606
|
+
return lines.join('\n');
|
|
607
|
+
}
|
|
608
|
+
generateBackgroundJobsAnswer(patterns) {
|
|
609
|
+
const lines = [];
|
|
610
|
+
lines.push('## Background Jobs\n');
|
|
611
|
+
const queuePattern = patterns.patterns.find((p) => p.type === 'queue');
|
|
612
|
+
if (!queuePattern) {
|
|
613
|
+
lines.push('Queue/job patterns detected in the codebase.');
|
|
614
|
+
return lines.join('\n');
|
|
615
|
+
}
|
|
616
|
+
lines.push('### Implementation Details\n');
|
|
617
|
+
for (const ind of queuePattern.indicators.slice(0, 5)) {
|
|
618
|
+
lines.push(`- ${ind.reason}`);
|
|
619
|
+
}
|
|
620
|
+
return lines.join('\n');
|
|
621
|
+
}
|
|
622
|
+
generateDeploymentAnswer(stack) {
|
|
623
|
+
const lines = [];
|
|
624
|
+
lines.push('## Deployment\n');
|
|
625
|
+
if (stack.hasDocker) {
|
|
626
|
+
lines.push('### Docker\n');
|
|
627
|
+
lines.push('This project includes Docker configuration.\n');
|
|
628
|
+
lines.push('```bash');
|
|
629
|
+
lines.push('docker build -t app .');
|
|
630
|
+
lines.push('docker run -p 3000:3000 app');
|
|
631
|
+
lines.push('```\n');
|
|
632
|
+
}
|
|
633
|
+
if (stack.hasCI) {
|
|
634
|
+
lines.push('### CI/CD\n');
|
|
635
|
+
lines.push('CI/CD pipelines are configured for this project.');
|
|
636
|
+
lines.push('Check `.github/workflows/` or equivalent for pipeline configuration.');
|
|
637
|
+
}
|
|
638
|
+
return lines.join('\n');
|
|
639
|
+
}
|
|
640
|
+
// Helper methods
|
|
641
|
+
getPatternFiles(patterns, type, repoPath) {
|
|
642
|
+
const pattern = patterns.patterns.find((p) => p.type === type);
|
|
643
|
+
if (!pattern)
|
|
644
|
+
return [];
|
|
645
|
+
return pattern.indicators
|
|
646
|
+
.filter((i) => i.file)
|
|
647
|
+
.map((i) => path.relative(repoPath, i.file))
|
|
648
|
+
.slice(0, 5);
|
|
649
|
+
}
|
|
650
|
+
async findRelevantFiles(repoPath, patterns) {
|
|
651
|
+
const results = [];
|
|
652
|
+
const excludeDirs = ['node_modules', '.git', 'dist', 'build', '.next', '.nuxt', 'coverage', '__pycache__', 'vendor'];
|
|
653
|
+
try {
|
|
654
|
+
const entries = await fs.readdir(repoPath, { withFileTypes: true, recursive: true });
|
|
655
|
+
for (const entry of entries) {
|
|
656
|
+
const relativePath = path.relative(repoPath, path.join(entry.parentPath || '', entry.name));
|
|
657
|
+
// Skip excluded directories
|
|
658
|
+
if (excludeDirs.some((dir) => relativePath.startsWith(dir + path.sep) || relativePath === dir)) {
|
|
659
|
+
continue;
|
|
660
|
+
}
|
|
661
|
+
for (const pattern of patterns) {
|
|
662
|
+
if (relativePath.includes(pattern)) {
|
|
663
|
+
results.push(relativePath);
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
if (results.length >= 10)
|
|
668
|
+
break;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
catch {
|
|
672
|
+
// Ignore errors
|
|
673
|
+
}
|
|
674
|
+
return results;
|
|
675
|
+
}
|
|
676
|
+
async saveQAEntries(repoPath, entries, topicResult) {
|
|
677
|
+
const qaDir = path.join(repoPath, '.context', 'docs', 'qa');
|
|
678
|
+
await fs.ensureDir(qaDir);
|
|
679
|
+
// Save individual entries
|
|
680
|
+
for (const entry of entries) {
|
|
681
|
+
const content = this.formatQAEntry(entry);
|
|
682
|
+
await fs.writeFile(path.join(qaDir, `${entry.slug}.md`), content);
|
|
683
|
+
}
|
|
684
|
+
// Generate README index
|
|
685
|
+
const readme = this.generateQAReadme(entries, topicResult);
|
|
686
|
+
await fs.writeFile(path.join(qaDir, 'README.md'), readme);
|
|
687
|
+
}
|
|
688
|
+
formatQAEntry(entry) {
|
|
689
|
+
const lines = [];
|
|
690
|
+
lines.push('---');
|
|
691
|
+
lines.push(`slug: ${entry.slug}`);
|
|
692
|
+
lines.push(`category: ${entry.category}`);
|
|
693
|
+
lines.push(`generatedAt: ${entry.generatedAt}`);
|
|
694
|
+
if (entry.relevantFiles.length > 0) {
|
|
695
|
+
lines.push(`relevantFiles:`);
|
|
696
|
+
for (const file of entry.relevantFiles) {
|
|
697
|
+
lines.push(` - ${file}`);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
lines.push('---\n');
|
|
701
|
+
lines.push(`# ${entry.question}\n`);
|
|
702
|
+
lines.push(entry.answer);
|
|
703
|
+
return lines.join('\n');
|
|
704
|
+
}
|
|
705
|
+
generateQAReadme(entries, topicResult) {
|
|
706
|
+
const lines = [];
|
|
707
|
+
lines.push('# Q&A Index\n');
|
|
708
|
+
lines.push(`Project type: **${topicResult.projectType}**\n`);
|
|
709
|
+
lines.push(`Generated: ${new Date().toISOString()}\n`);
|
|
710
|
+
// Group by category
|
|
711
|
+
const byCategory = new Map();
|
|
712
|
+
for (const entry of entries) {
|
|
713
|
+
if (!byCategory.has(entry.category)) {
|
|
714
|
+
byCategory.set(entry.category, []);
|
|
715
|
+
}
|
|
716
|
+
byCategory.get(entry.category).push(entry);
|
|
717
|
+
}
|
|
718
|
+
for (const [category, catEntries] of byCategory) {
|
|
719
|
+
lines.push(`## ${category.charAt(0).toUpperCase() + category.slice(1)}\n`);
|
|
720
|
+
for (const entry of catEntries) {
|
|
721
|
+
lines.push(`- [${entry.question}](./${entry.slug}.md)`);
|
|
722
|
+
}
|
|
723
|
+
lines.push('');
|
|
724
|
+
}
|
|
725
|
+
return lines.join('\n');
|
|
726
|
+
}
|
|
727
|
+
parseQAEntry(content, filename) {
|
|
728
|
+
try {
|
|
729
|
+
const slug = filename.replace('.md', '');
|
|
730
|
+
// Parse frontmatter
|
|
731
|
+
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
732
|
+
let category = 'general';
|
|
733
|
+
let generatedAt = '';
|
|
734
|
+
const relevantFiles = [];
|
|
735
|
+
if (frontmatterMatch) {
|
|
736
|
+
const fm = frontmatterMatch[1];
|
|
737
|
+
const categoryMatch = fm.match(/category:\s*(.+)/);
|
|
738
|
+
if (categoryMatch)
|
|
739
|
+
category = categoryMatch[1].trim();
|
|
740
|
+
const dateMatch = fm.match(/generatedAt:\s*(.+)/);
|
|
741
|
+
if (dateMatch)
|
|
742
|
+
generatedAt = dateMatch[1].trim();
|
|
743
|
+
const filesMatch = fm.match(/relevantFiles:\n([\s\S]*?)(?=\n\w|$)/);
|
|
744
|
+
if (filesMatch) {
|
|
745
|
+
const files = filesMatch[1].match(/- (.+)/g);
|
|
746
|
+
if (files) {
|
|
747
|
+
relevantFiles.push(...files.map((f) => f.replace('- ', '').trim()));
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
// Parse question from first heading
|
|
752
|
+
const questionMatch = content.match(/^#\s+(.+)/m);
|
|
753
|
+
const question = questionMatch ? questionMatch[1] : slug;
|
|
754
|
+
// Get answer (everything after the first heading)
|
|
755
|
+
const answerStart = content.indexOf('\n', content.indexOf('# '));
|
|
756
|
+
const answer = answerStart > 0 ? content.slice(answerStart).trim() : '';
|
|
757
|
+
return {
|
|
758
|
+
slug,
|
|
759
|
+
question,
|
|
760
|
+
answer,
|
|
761
|
+
category,
|
|
762
|
+
generatedAt,
|
|
763
|
+
relevantFiles,
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
catch {
|
|
767
|
+
return null;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
calculateRelevance(entry, queryLower, queryWords) {
|
|
771
|
+
let score = 0;
|
|
772
|
+
const reasons = [];
|
|
773
|
+
// Exact slug match
|
|
774
|
+
if (entry.slug.toLowerCase().includes(queryLower.replace(/\s+/g, '-'))) {
|
|
775
|
+
score += 10;
|
|
776
|
+
reasons.push('slug match');
|
|
777
|
+
}
|
|
778
|
+
// Question match
|
|
779
|
+
const questionLower = entry.question.toLowerCase();
|
|
780
|
+
if (questionLower.includes(queryLower)) {
|
|
781
|
+
score += 8;
|
|
782
|
+
reasons.push('question match');
|
|
783
|
+
}
|
|
784
|
+
// Word matches in question
|
|
785
|
+
for (const word of queryWords) {
|
|
786
|
+
if (questionLower.includes(word)) {
|
|
787
|
+
score += 2;
|
|
788
|
+
reasons.push(`word "${word}" in question`);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
// Answer match
|
|
792
|
+
const answerLower = entry.answer.toLowerCase();
|
|
793
|
+
for (const word of queryWords) {
|
|
794
|
+
if (answerLower.includes(word)) {
|
|
795
|
+
score += 1;
|
|
796
|
+
reasons.push(`word "${word}" in answer`);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
// Category match
|
|
800
|
+
if (entry.category.toLowerCase().includes(queryLower)) {
|
|
801
|
+
score += 3;
|
|
802
|
+
reasons.push('category match');
|
|
803
|
+
}
|
|
804
|
+
return {
|
|
805
|
+
score,
|
|
806
|
+
reason: reasons.slice(0, 3).join(', ') || 'partial match',
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Convert persisted summary stack section to StackInfo format
|
|
811
|
+
*/
|
|
812
|
+
convertMapStackToStackInfo(map) {
|
|
813
|
+
return {
|
|
814
|
+
primaryLanguage: map.stack.primaryLanguage,
|
|
815
|
+
languages: map.stack.languages,
|
|
816
|
+
frameworks: map.stack.frameworks,
|
|
817
|
+
buildTools: map.stack.buildTools,
|
|
818
|
+
testFrameworks: map.stack.testFrameworks,
|
|
819
|
+
packageManager: map.stack.packageManager,
|
|
820
|
+
isMonorepo: map.stack.isMonorepo,
|
|
821
|
+
hasDocker: map.stack.hasDocker,
|
|
822
|
+
hasCI: map.stack.hasCI,
|
|
823
|
+
files: [],
|
|
824
|
+
hasBinField: map.stack.hasBinField,
|
|
825
|
+
cliLibraries: map.stack.cliLibraries || [],
|
|
826
|
+
hasMainExport: map.stack.hasMainExport,
|
|
827
|
+
hasTypesField: map.stack.hasTypesField,
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Shutdown analyzer resources
|
|
832
|
+
*/
|
|
833
|
+
async shutdown() {
|
|
834
|
+
await this.analyzer.shutdown();
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
exports.QAService = QAService;
|
|
838
|
+
//# sourceMappingURL=qaService.js.map
|