@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,1036 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MCP Server - Model Context Protocol server for dotcontext integration.
|
|
4
|
+
*
|
|
5
|
+
* Exposes consolidated gateway tools plus dedicated workflow entry points for
|
|
6
|
+
* reduced context and simpler tool selection for AI agents.
|
|
7
|
+
*
|
|
8
|
+
* Simplified workflow: context init → fillSingle → workflow-init
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.AIContextMCPServer = void 0;
|
|
45
|
+
exports.startMCPServer = startMCPServer;
|
|
46
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
47
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
48
|
+
const zod_1 = require("zod");
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
const fs = __importStar(require("fs-extra"));
|
|
51
|
+
const contextTools_1 = require("../harness/contextTools");
|
|
52
|
+
const pathSecurity_1 = require("../../utils/pathSecurity");
|
|
53
|
+
const contextBuilder_1 = require("../semantic/contextBuilder");
|
|
54
|
+
const contextCache_1 = require("../semantic/contextCache");
|
|
55
|
+
const version_1 = require("../../version");
|
|
56
|
+
const workflow_1 = require("../workflow");
|
|
57
|
+
const actionLogger_1 = require("./actionLogger");
|
|
58
|
+
const workflow_2 = require("../../workflow");
|
|
59
|
+
const gatewayTools_1 = require("./gatewayTools");
|
|
60
|
+
class AIContextMCPServer {
|
|
61
|
+
constructor(options = {}) {
|
|
62
|
+
this.transport = null;
|
|
63
|
+
this.initialRepoPath = null;
|
|
64
|
+
this.cachedRepoPath = null;
|
|
65
|
+
this.options = {
|
|
66
|
+
name: 'dotcontext',
|
|
67
|
+
verbose: false,
|
|
68
|
+
...options
|
|
69
|
+
};
|
|
70
|
+
this.server = new mcp_js_1.McpServer({
|
|
71
|
+
name: this.options.name,
|
|
72
|
+
version: version_1.VERSION
|
|
73
|
+
});
|
|
74
|
+
// Support dependency injection for testing, with default fallback
|
|
75
|
+
this.contextBuilder = options.contextBuilder ?? new contextBuilder_1.SemanticContextBuilder();
|
|
76
|
+
this.contextCache = new contextCache_1.ContextCache();
|
|
77
|
+
// Initialize and cache the correct repo path
|
|
78
|
+
void this.initializeRepoPath();
|
|
79
|
+
this.registerGatewayTools();
|
|
80
|
+
this.registerResources();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Register consolidated gateway tools and dedicated workflow tools.
|
|
84
|
+
*
|
|
85
|
+
* Project tools removed - use context({ action: "init" }) + workflow-init instead.
|
|
86
|
+
*
|
|
87
|
+
* NOTE: repoPath is determined dynamically via getRepoPath() at runtime,
|
|
88
|
+
* which uses smart initialization and client path caching.
|
|
89
|
+
*/
|
|
90
|
+
registerGatewayTools() {
|
|
91
|
+
const wrap = (toolName, handler) => this.wrapWithActionLogging(toolName, handler);
|
|
92
|
+
// Gateway 1: explore - File and code exploration
|
|
93
|
+
this.server.registerTool('explore', {
|
|
94
|
+
description: `File and code exploration. Actions:
|
|
95
|
+
- read: Read file contents (params: filePath, encoding?)
|
|
96
|
+
- list: List files matching pattern (params: pattern, cwd?, ignore?)
|
|
97
|
+
- analyze: Analyze symbols in a file (params: filePath, symbolTypes?)
|
|
98
|
+
- search: Search code with regex (params: pattern, fileGlob?, maxResults?, cwd?)
|
|
99
|
+
- getStructure: Get directory structure (params: rootPath?, maxDepth?, includePatterns?)`,
|
|
100
|
+
inputSchema: {
|
|
101
|
+
action: zod_1.z.enum(['read', 'list', 'analyze', 'search', 'getStructure'])
|
|
102
|
+
.describe('Action to perform'),
|
|
103
|
+
filePath: zod_1.z.string().optional()
|
|
104
|
+
.describe('(read, analyze) File path to read or analyze'),
|
|
105
|
+
pattern: zod_1.z.string().optional()
|
|
106
|
+
.describe('(list, search) Glob pattern for list, regex pattern for search'),
|
|
107
|
+
cwd: zod_1.z.string().optional()
|
|
108
|
+
.describe('(list, search) Working directory'),
|
|
109
|
+
encoding: zod_1.z.enum(['utf-8', 'ascii', 'binary']).optional()
|
|
110
|
+
.describe('(read) File encoding'),
|
|
111
|
+
ignore: zod_1.z.array(zod_1.z.string()).optional()
|
|
112
|
+
.describe('(list) Patterns to ignore'),
|
|
113
|
+
symbolTypes: zod_1.z.array(zod_1.z.enum(['class', 'interface', 'function', 'type', 'enum'])).optional()
|
|
114
|
+
.describe('(analyze) Types of symbols to extract'),
|
|
115
|
+
fileGlob: zod_1.z.string().optional()
|
|
116
|
+
.describe('(search) Glob pattern to filter files'),
|
|
117
|
+
maxResults: zod_1.z.number().optional()
|
|
118
|
+
.describe('(search) Maximum results to return'),
|
|
119
|
+
rootPath: zod_1.z.string().optional()
|
|
120
|
+
.describe('(getStructure) Root path for structure'),
|
|
121
|
+
maxDepth: zod_1.z.number().optional()
|
|
122
|
+
.describe('(getStructure) Maximum directory depth'),
|
|
123
|
+
includePatterns: zod_1.z.array(zod_1.z.string()).optional()
|
|
124
|
+
.describe('(getStructure) Include patterns'),
|
|
125
|
+
}
|
|
126
|
+
}, wrap('explore', async (params) => {
|
|
127
|
+
// explore uses cwd for file operations, not repoPath for context resolution
|
|
128
|
+
return (0, gatewayTools_1.handleExplore)(params, { repoPath: this.getRepoPath() });
|
|
129
|
+
}));
|
|
130
|
+
// Gateway 2: context - Context scaffolding and semantic context
|
|
131
|
+
this.server.registerTool('context', {
|
|
132
|
+
description: `Context scaffolding and semantic context. Actions:
|
|
133
|
+
- check: Check if .context scaffolding exists (params: repoPath?)
|
|
134
|
+
- bootstrapStatus: Summarize scaffold, workflow, and harness bootstrap readiness (params: repoPath?)
|
|
135
|
+
- init: Initialize .context scaffolding (params: repoPath?, type?, outputDir?, semantic?, autoFill?, skipContentGeneration?, generateQA?) Q&A helper docs are opt-in.
|
|
136
|
+
- fill: Fill scaffolding with AI content (params: repoPath?, outputDir?, target?, offset?, limit?) Generated Q&A helper docs under .context/docs/qa are only created when generateQA is enabled and are not returned unless you add custom unfilled docs there. Bootstrap .context/harness/sensors.json is returned until customized.
|
|
137
|
+
- fillSingle: Fill a single scaffold file (params: repoPath?, filePath)
|
|
138
|
+
- listToFill: List files that need filling (params: repoPath?, outputDir?, target?)
|
|
139
|
+
- getMap: Get codebase map section with on-read auto-refresh (params: repoPath?, section?)
|
|
140
|
+
- buildSemantic: Build semantic context (params: repoPath?, contextType?, targetFile?, options?)
|
|
141
|
+
- scaffoldPlan: Create a plan template (params: planName, repoPath?, title?, summary?, autoFill?) Plan creation does NOT start execution. For non-trivial work, immediately follow with workflow-init so PREVC starts on the harness and persists state under .context/harness/workflows/prevc.json.
|
|
142
|
+
- searchQA: Search generated Q&A helper docs with keyword ranking (params: repoPath?, query)
|
|
143
|
+
- generateQA: Generate optional Q&A helper docs from the codebase (params: repoPath?, options?)
|
|
144
|
+
- getFlow: Trace a code path from an entry file/function (params: repoPath?, entryFile, entryFunction?, options?)
|
|
145
|
+
- detectPatterns: Detect functional patterns in the codebase (params: repoPath?, options?)
|
|
146
|
+
|
|
147
|
+
**Important:** Agents should provide repoPath on the FIRST call, then it will be cached:
|
|
148
|
+
1. First call: context({ action: "check", repoPath: "/path/to/project" })
|
|
149
|
+
2. Subsequent calls can omit repoPath - it will use cached value from step 1
|
|
150
|
+
3. After context init, call fillSingle for each pending file
|
|
151
|
+
4. If you create a plan with scaffoldPlan, call workflow-init immediately after planning to start the harness-backed PREVC workflow (unless trivial change)`,
|
|
152
|
+
inputSchema: {
|
|
153
|
+
action: zod_1.z.enum(['check', 'bootstrapStatus', 'init', 'fill', 'fillSingle', 'listToFill', 'getMap', 'buildSemantic', 'scaffoldPlan', 'searchQA', 'generateQA', 'getFlow', 'detectPatterns'])
|
|
154
|
+
.describe('Action to perform'),
|
|
155
|
+
repoPath: zod_1.z.string().optional()
|
|
156
|
+
.describe('Repository path (defaults to cwd)'),
|
|
157
|
+
outputDir: zod_1.z.string().optional()
|
|
158
|
+
.describe('Output directory (default: ./.context)'),
|
|
159
|
+
type: zod_1.z.enum(['docs', 'agents', 'both']).optional()
|
|
160
|
+
.describe('(init) Type of scaffolding to create'),
|
|
161
|
+
semantic: zod_1.z.boolean().optional()
|
|
162
|
+
.describe('(init, scaffoldPlan) Enable semantic analysis'),
|
|
163
|
+
include: zod_1.z.array(zod_1.z.string()).optional()
|
|
164
|
+
.describe('(init) Include patterns'),
|
|
165
|
+
exclude: zod_1.z.array(zod_1.z.string()).optional()
|
|
166
|
+
.describe('(init) Exclude patterns'),
|
|
167
|
+
autoFill: zod_1.z.boolean().optional()
|
|
168
|
+
.describe('(init, scaffoldPlan) Auto-fill with codebase content'),
|
|
169
|
+
skipContentGeneration: zod_1.z.boolean().optional()
|
|
170
|
+
.describe('(init) Skip pre-generating content'),
|
|
171
|
+
generateQA: zod_1.z.boolean().optional()
|
|
172
|
+
.describe('(init) Generate optional Q&A helper docs under .context/docs/qa; these are pre-filled and do not require fillSingle'),
|
|
173
|
+
target: zod_1.z.enum(['docs', 'agents', 'skills', 'plans', 'sensors', 'all']).optional()
|
|
174
|
+
.describe('(fill, listToFill) Which scaffolding to target, including nested skills and harness sensors'),
|
|
175
|
+
offset: zod_1.z.number().optional()
|
|
176
|
+
.describe('(fill) Skip first N files'),
|
|
177
|
+
limit: zod_1.z.number().optional()
|
|
178
|
+
.describe('(fill) Max files to return'),
|
|
179
|
+
filePath: zod_1.z.string().optional()
|
|
180
|
+
.describe('(fillSingle) Absolute path to scaffold file'),
|
|
181
|
+
section: zod_1.z.enum([
|
|
182
|
+
'all', 'meta', 'stack', 'structure', 'architecture',
|
|
183
|
+
'functionalPatterns', 'dependencies', 'stats', 'keyFiles', 'navigation'
|
|
184
|
+
]).optional()
|
|
185
|
+
.describe('(getMap) Section to retrieve; the snapshot auto-refreshes on read'),
|
|
186
|
+
contextType: zod_1.z.enum(['documentation', 'playbook', 'plan', 'compact']).optional()
|
|
187
|
+
.describe('(buildSemantic) Type of context to build'),
|
|
188
|
+
targetFile: zod_1.z.string().optional()
|
|
189
|
+
.describe('(buildSemantic) Target file for focused context'),
|
|
190
|
+
options: zod_1.z.object({
|
|
191
|
+
useLSP: zod_1.z.boolean().optional(),
|
|
192
|
+
maxContextLength: zod_1.z.number().optional(),
|
|
193
|
+
includeDocumentation: zod_1.z.boolean().optional(),
|
|
194
|
+
includeSignatures: zod_1.z.boolean().optional()
|
|
195
|
+
}).optional()
|
|
196
|
+
.describe('(buildSemantic, generateQA, searchQA, getFlow, detectPatterns) Builder/analyzer options'),
|
|
197
|
+
planName: zod_1.z.string().optional()
|
|
198
|
+
.describe('(scaffoldPlan) Name of the plan'),
|
|
199
|
+
title: zod_1.z.string().optional()
|
|
200
|
+
.describe('(scaffoldPlan) Plan title'),
|
|
201
|
+
summary: zod_1.z.string().optional()
|
|
202
|
+
.describe('(scaffoldPlan) Plan summary/goal'),
|
|
203
|
+
query: zod_1.z.string().optional()
|
|
204
|
+
.describe('(searchQA) Query string used to rank generated Q&A helper docs'),
|
|
205
|
+
entryFile: zod_1.z.string().optional()
|
|
206
|
+
.describe('(getFlow) Entry file path for flow tracing'),
|
|
207
|
+
entryFunction: zod_1.z.string().optional()
|
|
208
|
+
.describe('(getFlow) Optional entry function for flow tracing'),
|
|
209
|
+
}
|
|
210
|
+
}, wrap('context', async (params) => {
|
|
211
|
+
return (0, gatewayTools_1.handleContext)(params, { repoPath: this.getRepoPath(params.repoPath), contextBuilder: this.contextBuilder });
|
|
212
|
+
}));
|
|
213
|
+
// Dedicated Workflow Tools (split from consolidated workflow gateway)
|
|
214
|
+
// Tool 3a: workflow-init - Initialize PREVC workflow
|
|
215
|
+
this.server.registerTool('workflow-init', {
|
|
216
|
+
description: `Initialize a PREVC workflow for structured development.
|
|
217
|
+
|
|
218
|
+
This is the harness-backed entry point for planned work. If the user asked to create a plan for non-trivial work, do not stop at scaffoldPlan: call workflow-init so the plan runs under PREVC with canonical state in .context/harness/workflows/prevc.json.
|
|
219
|
+
|
|
220
|
+
**What it does:**
|
|
221
|
+
- Creates .context/workflow/ folder (automatically, if it doesn't exist)
|
|
222
|
+
- Initializes workflow status file with phase tracking
|
|
223
|
+
- Creates canonical harness workflow state and session binding
|
|
224
|
+
- Detects project scale and configures gates
|
|
225
|
+
- Sets up PREVC phases (Plan → Review → Execute → Verify → Complete)
|
|
226
|
+
|
|
227
|
+
**Prerequisites:**
|
|
228
|
+
- .context/ folder must exist (use context with action "init" first)
|
|
229
|
+
- Scaffolding files should be filled (use context with action "fillSingle")
|
|
230
|
+
|
|
231
|
+
**When to use:**
|
|
232
|
+
- Starting a new feature or bug fix after scaffolding is set up
|
|
233
|
+
- Need structured, phase-gated development
|
|
234
|
+
- Working on non-trivial changes
|
|
235
|
+
|
|
236
|
+
**Don't use if:**
|
|
237
|
+
- Making trivial changes (typo fixes, single-line edits)
|
|
238
|
+
- Just exploring/researching code
|
|
239
|
+
- User explicitly wants to skip workflow`,
|
|
240
|
+
inputSchema: {
|
|
241
|
+
name: zod_1.z.string().describe('Workflow/feature name (required)'),
|
|
242
|
+
description: zod_1.z.string().optional()
|
|
243
|
+
.describe('Task description for scale detection'),
|
|
244
|
+
scale: zod_1.z.enum(['QUICK', 'SMALL', 'MEDIUM', 'LARGE']).optional()
|
|
245
|
+
.describe(`Project scale - AI should evaluate based on task characteristics:
|
|
246
|
+
|
|
247
|
+
SCALE EVALUATION CRITERIA:
|
|
248
|
+
• QUICK: Single file changes, bug fixes, typos (~5 min)
|
|
249
|
+
- Phases: E → V only
|
|
250
|
+
- Example: "Fix typo in button text"
|
|
251
|
+
|
|
252
|
+
• SMALL: Simple features, no architecture changes (~15 min)
|
|
253
|
+
- Phases: P → E → V
|
|
254
|
+
- Example: "Add email validation to form"
|
|
255
|
+
|
|
256
|
+
• MEDIUM: Regular features with design decisions (~30 min)
|
|
257
|
+
- Phases: P → R → E → V
|
|
258
|
+
- Example: "Implement user profile page"
|
|
259
|
+
|
|
260
|
+
• LARGE: Complex features, systems, compliance (~1+ hour)
|
|
261
|
+
- Phases: P → R → E → V → C (full workflow)
|
|
262
|
+
- Examples: "Build OAuth system", "Add GDPR compliance"
|
|
263
|
+
|
|
264
|
+
GUIDANCE:
|
|
265
|
+
- Analyze task complexity, architectural impact, and review needs
|
|
266
|
+
- Use LARGE for security/compliance requirements
|
|
267
|
+
- When uncertain, prefer MEDIUM
|
|
268
|
+
- Omit scale only if unable to evaluate (auto-detect fallback)`),
|
|
269
|
+
autonomous: zod_1.z.boolean().optional()
|
|
270
|
+
.describe('Skip all workflow gates (default: scale-dependent)'),
|
|
271
|
+
require_plan: zod_1.z.boolean().optional()
|
|
272
|
+
.describe('Require plan before P→R'),
|
|
273
|
+
require_approval: zod_1.z.boolean().optional()
|
|
274
|
+
.describe('Require approval before R→E'),
|
|
275
|
+
archive_previous: zod_1.z.boolean().optional()
|
|
276
|
+
.describe('Archive existing workflow'),
|
|
277
|
+
}
|
|
278
|
+
}, wrap('workflow-init', async (params) => {
|
|
279
|
+
return (0, gatewayTools_1.handleWorkflowInit)(params, { repoPath: this.getRepoPath(params.repoPath) });
|
|
280
|
+
}));
|
|
281
|
+
// Tool 3b: workflow-status - Get current workflow status
|
|
282
|
+
this.server.registerTool('workflow-status', {
|
|
283
|
+
description: `Get current PREVC workflow status including phase, gates, and linked plans.
|
|
284
|
+
|
|
285
|
+
Returns: Current phase, all phase statuses, gate settings, linked plans, agent activity.`,
|
|
286
|
+
inputSchema: {
|
|
287
|
+
// No required parameters
|
|
288
|
+
}
|
|
289
|
+
}, wrap('workflow-status', async (params) => {
|
|
290
|
+
return (0, gatewayTools_1.handleWorkflowStatus)(params, { repoPath: this.getRepoPath(params.repoPath) });
|
|
291
|
+
}));
|
|
292
|
+
// Tool 3c: workflow-advance - Advance to next phase
|
|
293
|
+
this.server.registerTool('workflow-advance', {
|
|
294
|
+
description: `Advance workflow to the next PREVC phase (P→R→E→V→C).
|
|
295
|
+
|
|
296
|
+
Enforces gates:
|
|
297
|
+
- P→R: Requires plan if require_plan=true
|
|
298
|
+
- R→E: Requires approval if require_approval=true
|
|
299
|
+
|
|
300
|
+
Use force=true to bypass gates, or use workflow-manage({ action: 'setAutonomous' }).`,
|
|
301
|
+
inputSchema: {
|
|
302
|
+
outputs: zod_1.z.array(zod_1.z.string()).optional()
|
|
303
|
+
.describe('Artifact paths produced in current phase'),
|
|
304
|
+
force: zod_1.z.boolean().optional()
|
|
305
|
+
.describe('Force advancement even if gates block'),
|
|
306
|
+
}
|
|
307
|
+
}, wrap('workflow-advance', async (params) => {
|
|
308
|
+
return (0, gatewayTools_1.handleWorkflowAdvance)(params, { repoPath: this.getRepoPath(params.repoPath) });
|
|
309
|
+
}));
|
|
310
|
+
// Tool 3d: workflow-manage - Manage workflow operations
|
|
311
|
+
this.server.registerTool('workflow-manage', {
|
|
312
|
+
description: `Manage workflow operations: handoffs, collaboration, documents, gates, approvals, and harness runtime state.
|
|
313
|
+
|
|
314
|
+
Actions:
|
|
315
|
+
- handoff: Transfer work between agents (params: from, to, artifacts)
|
|
316
|
+
- collaborate: Start collaboration session (params: topic, participants?)
|
|
317
|
+
- createDoc: Create workflow document (params: type, docName)
|
|
318
|
+
- getGates: Check gate status
|
|
319
|
+
- approvePlan: Approve linked plan (params: planSlug?, approver?, notes?)
|
|
320
|
+
- setAutonomous: Toggle autonomous mode (params: enabled, reason?)
|
|
321
|
+
- checkpoint: Record a harness checkpoint (params: notes?, data?, artifactIds?, pause?)
|
|
322
|
+
- recordArtifact: Attach an artifact to the active harness session (params: name, kind?, filePath?, content?)
|
|
323
|
+
- defineTask: Define the active harness task contract (params: taskTitle, taskDescription?, expectedOutputs?, acceptanceCriteria?, requiredSensors?, requiredArtifacts?)
|
|
324
|
+
- runSensors: Execute harness sensors for the active session (params: sensors)`,
|
|
325
|
+
inputSchema: {
|
|
326
|
+
action: zod_1.z.enum(['handoff', 'collaborate', 'createDoc', 'getGates', 'approvePlan', 'setAutonomous', 'checkpoint', 'recordArtifact', 'defineTask', 'runSensors'])
|
|
327
|
+
.describe('Action to perform'),
|
|
328
|
+
from: zod_1.z.string().optional()
|
|
329
|
+
.describe('(handoff) Agent handing off (e.g., feature-developer)'),
|
|
330
|
+
to: zod_1.z.string().optional()
|
|
331
|
+
.describe('(handoff) Agent receiving (e.g., code-reviewer)'),
|
|
332
|
+
artifacts: zod_1.z.array(zod_1.z.string()).optional()
|
|
333
|
+
.describe('(handoff) Artifacts to hand off'),
|
|
334
|
+
topic: zod_1.z.string().optional()
|
|
335
|
+
.describe('(collaborate) Collaboration topic'),
|
|
336
|
+
participants: zod_1.z.array(zod_1.z.enum(workflow_2.PREVC_ROLES)).optional()
|
|
337
|
+
.describe('(collaborate) Participating roles'),
|
|
338
|
+
type: zod_1.z.enum(['prd', 'tech-spec', 'architecture', 'adr', 'test-plan', 'changelog']).optional()
|
|
339
|
+
.describe('(createDoc) Document type'),
|
|
340
|
+
docName: zod_1.z.string().optional()
|
|
341
|
+
.describe('(createDoc) Document name'),
|
|
342
|
+
planSlug: zod_1.z.string().optional()
|
|
343
|
+
.describe('(approvePlan) Plan to approve'),
|
|
344
|
+
approver: zod_1.z.enum(workflow_2.PREVC_ROLES).optional()
|
|
345
|
+
.describe('(approvePlan) Approving role'),
|
|
346
|
+
notes: zod_1.z.string().optional()
|
|
347
|
+
.describe('(approvePlan) Approval notes'),
|
|
348
|
+
enabled: zod_1.z.boolean().optional()
|
|
349
|
+
.describe('(setAutonomous) Enable/disable'),
|
|
350
|
+
reason: zod_1.z.string().optional()
|
|
351
|
+
.describe('(setAutonomous) Reason for change'),
|
|
352
|
+
name: zod_1.z.string().optional()
|
|
353
|
+
.describe('(recordArtifact) Artifact name'),
|
|
354
|
+
kind: zod_1.z.enum(['text', 'json', 'file']).optional()
|
|
355
|
+
.describe('(recordArtifact) Artifact kind'),
|
|
356
|
+
content: zod_1.z.any().optional()
|
|
357
|
+
.describe('(recordArtifact, checkpoint) Structured content or payload'),
|
|
358
|
+
filePath: zod_1.z.string().optional()
|
|
359
|
+
.describe('(recordArtifact) Artifact file path'),
|
|
360
|
+
taskTitle: zod_1.z.string().optional()
|
|
361
|
+
.describe('(defineTask) Task title'),
|
|
362
|
+
taskDescription: zod_1.z.string().optional()
|
|
363
|
+
.describe('(defineTask) Task description'),
|
|
364
|
+
owner: zod_1.z.string().optional()
|
|
365
|
+
.describe('(defineTask) Task owner'),
|
|
366
|
+
inputs: zod_1.z.array(zod_1.z.string()).optional()
|
|
367
|
+
.describe('(defineTask) Required inputs'),
|
|
368
|
+
expectedOutputs: zod_1.z.array(zod_1.z.string()).optional()
|
|
369
|
+
.describe('(defineTask) Expected outputs'),
|
|
370
|
+
acceptanceCriteria: zod_1.z.array(zod_1.z.string()).optional()
|
|
371
|
+
.describe('(defineTask) Acceptance criteria'),
|
|
372
|
+
requiredSensors: zod_1.z.array(zod_1.z.string()).optional()
|
|
373
|
+
.describe('(defineTask) Required sensors'),
|
|
374
|
+
requiredArtifacts: zod_1.z.array(zod_1.z.string()).optional()
|
|
375
|
+
.describe('(defineTask) Required artifacts'),
|
|
376
|
+
sensors: zod_1.z.array(zod_1.z.string()).optional()
|
|
377
|
+
.describe('(runSensors) Sensors to execute'),
|
|
378
|
+
data: zod_1.z.any().optional()
|
|
379
|
+
.describe('(checkpoint) Optional checkpoint payload'),
|
|
380
|
+
artifactIds: zod_1.z.array(zod_1.z.string()).optional()
|
|
381
|
+
.describe('(checkpoint) Artifact IDs associated with the checkpoint'),
|
|
382
|
+
pause: zod_1.z.boolean().optional()
|
|
383
|
+
.describe('(checkpoint) Pause the active harness session after checkpoint'),
|
|
384
|
+
}
|
|
385
|
+
}, wrap('workflow-manage', async (params) => {
|
|
386
|
+
return (0, gatewayTools_1.handleWorkflowManage)(params, { repoPath: this.getRepoPath(params.repoPath) });
|
|
387
|
+
}));
|
|
388
|
+
// Gateway 5: sync - Import/export synchronization
|
|
389
|
+
this.server.registerTool('sync', {
|
|
390
|
+
description: `Import/export synchronization with AI tools. Actions:
|
|
391
|
+
- exportRules: Export rules to AI tools (params: preset?, force?, dryRun?)
|
|
392
|
+
- exportDocs: Export docs to AI tools (params: preset?, indexMode?, force?, dryRun?)
|
|
393
|
+
- exportAgents: Export agents to AI tools (params: preset?, mode?, force?, dryRun?)
|
|
394
|
+
- exportContext: Export all context (params: preset?, skipDocs?, skipAgents?, skipSkills?, docsIndexMode?, agentMode?, force?, dryRun?)
|
|
395
|
+
- exportSkills: Export skills to AI tools (params: preset?, includeBuiltIn?, force?)
|
|
396
|
+
- reverseSync: Import from AI tools to .context/ (params: skipRules?, skipAgents?, skipSkills?, mergeStrategy?, dryRun?, force?, addMetadata?)
|
|
397
|
+
- importDocs: Import docs from AI tools (params: autoDetect?, force?, dryRun?)
|
|
398
|
+
- importAgents: Import agents from AI tools (params: autoDetect?, force?, dryRun?)
|
|
399
|
+
- importSkills: Import skills from AI tools (params: autoDetect?, mergeStrategy?, force?, dryRun?)`,
|
|
400
|
+
inputSchema: {
|
|
401
|
+
action: zod_1.z.enum(['exportRules', 'exportDocs', 'exportAgents', 'exportContext', 'exportSkills', 'reverseSync', 'importDocs', 'importAgents', 'importSkills'])
|
|
402
|
+
.describe('Action to perform'),
|
|
403
|
+
preset: zod_1.z.string().optional()
|
|
404
|
+
.describe('Target AI tool preset'),
|
|
405
|
+
force: zod_1.z.boolean().optional()
|
|
406
|
+
.describe('Overwrite existing files'),
|
|
407
|
+
dryRun: zod_1.z.boolean().optional()
|
|
408
|
+
.describe('Preview without writing'),
|
|
409
|
+
indexMode: zod_1.z.enum(['readme', 'all']).optional()
|
|
410
|
+
.describe('(exportDocs) Index mode'),
|
|
411
|
+
mode: zod_1.z.enum(['symlink', 'markdown']).optional()
|
|
412
|
+
.describe('(exportAgents) Sync mode'),
|
|
413
|
+
skipDocs: zod_1.z.boolean().optional()
|
|
414
|
+
.describe('(exportContext) Skip docs'),
|
|
415
|
+
skipAgents: zod_1.z.boolean().optional()
|
|
416
|
+
.describe('(exportContext, reverseSync) Skip agents'),
|
|
417
|
+
skipSkills: zod_1.z.boolean().optional()
|
|
418
|
+
.describe('(exportContext, reverseSync) Skip skills'),
|
|
419
|
+
skipRules: zod_1.z.boolean().optional()
|
|
420
|
+
.describe('(reverseSync) Skip rules'),
|
|
421
|
+
docsIndexMode: zod_1.z.enum(['readme', 'all']).optional()
|
|
422
|
+
.describe('(exportContext) Docs index mode'),
|
|
423
|
+
agentMode: zod_1.z.enum(['symlink', 'markdown']).optional()
|
|
424
|
+
.describe('(exportContext) Agent sync mode'),
|
|
425
|
+
includeBuiltInSkills: zod_1.z.boolean().optional()
|
|
426
|
+
.describe('(exportContext) Include built-in skills'),
|
|
427
|
+
includeBuiltIn: zod_1.z.boolean().optional()
|
|
428
|
+
.describe('(exportSkills) Include built-in skills'),
|
|
429
|
+
mergeStrategy: zod_1.z.enum(['skip', 'overwrite', 'merge', 'rename']).optional()
|
|
430
|
+
.describe('(reverseSync, importSkills) Conflict handling'),
|
|
431
|
+
autoDetect: zod_1.z.boolean().optional()
|
|
432
|
+
.describe('(import*) Auto-detect files'),
|
|
433
|
+
addMetadata: zod_1.z.boolean().optional()
|
|
434
|
+
.describe('(reverseSync) Add frontmatter metadata'),
|
|
435
|
+
repoPath: zod_1.z.string().optional()
|
|
436
|
+
.describe('Repository path'),
|
|
437
|
+
}
|
|
438
|
+
}, wrap('sync', async (params) => {
|
|
439
|
+
return (0, gatewayTools_1.handleSync)(params, { repoPath: this.getRepoPath(params.repoPath) });
|
|
440
|
+
}));
|
|
441
|
+
// Gateway 6: plan - Plan management and execution tracking
|
|
442
|
+
this.server.registerTool('plan', {
|
|
443
|
+
description: `Plan management and execution tracking for PREVC workflows.
|
|
444
|
+
|
|
445
|
+
This tool does not start workflows. When a user asks for a plan for non-trivial work, start the harness-backed workflow with workflow-init first, or immediately after scaffoldPlan. If you link a plan before workflow-init, re-link it after workflow-init so PREVC gates and harness state use that plan.
|
|
446
|
+
|
|
447
|
+
Actions:
|
|
448
|
+
- link: Link plan to workflow (params: planSlug)
|
|
449
|
+
- getLinked: Get all linked plans
|
|
450
|
+
- getDetails: Get detailed plan info (params: planSlug)
|
|
451
|
+
- getForPhase: Get plans for PREVC phase (params: phase)
|
|
452
|
+
- updatePhase: Update plan phase status (params: planSlug, phaseId, status)
|
|
453
|
+
- recordDecision: Record a decision (params: planSlug, title, description, phase?, alternatives?)
|
|
454
|
+
- updateStep: Update step status (params: planSlug, phaseId, stepIndex, status, output?, notes?)
|
|
455
|
+
- getStatus: Get plan execution status (params: planSlug)
|
|
456
|
+
- syncMarkdown: Sync tracking to markdown (params: planSlug)
|
|
457
|
+
- commitPhase: Create git commit for completed phase (params: planSlug, phaseId, coAuthor?, stagePatterns?, dryRun?)`,
|
|
458
|
+
inputSchema: {
|
|
459
|
+
action: zod_1.z.enum(['link', 'getLinked', 'getDetails', 'getForPhase', 'updatePhase', 'recordDecision', 'updateStep', 'getStatus', 'syncMarkdown', 'commitPhase'])
|
|
460
|
+
.describe('Action to perform'),
|
|
461
|
+
planSlug: zod_1.z.string().optional()
|
|
462
|
+
.describe('Plan slug/identifier'),
|
|
463
|
+
phaseId: zod_1.z.string().optional()
|
|
464
|
+
.describe('(updatePhase, updateStep, commitPhase) Phase ID'),
|
|
465
|
+
status: zod_1.z.enum(['pending', 'in_progress', 'completed', 'skipped']).optional()
|
|
466
|
+
.describe('(updatePhase, updateStep) New status'),
|
|
467
|
+
phase: zod_1.z.enum(['P', 'R', 'E', 'V', 'C']).optional()
|
|
468
|
+
.describe('(getForPhase, recordDecision) PREVC phase'),
|
|
469
|
+
title: zod_1.z.string().optional()
|
|
470
|
+
.describe('(recordDecision) Decision title'),
|
|
471
|
+
description: zod_1.z.string().optional()
|
|
472
|
+
.describe('(recordDecision) Decision description'),
|
|
473
|
+
alternatives: zod_1.z.array(zod_1.z.string()).optional()
|
|
474
|
+
.describe('(recordDecision) Considered alternatives'),
|
|
475
|
+
stepIndex: zod_1.z.number().optional()
|
|
476
|
+
.describe('(updateStep) Step number (1-based)'),
|
|
477
|
+
output: zod_1.z.string().optional()
|
|
478
|
+
.describe('(updateStep) Step output artifact'),
|
|
479
|
+
notes: zod_1.z.string().optional()
|
|
480
|
+
.describe('(updateStep) Execution notes'),
|
|
481
|
+
coAuthor: zod_1.z.string().optional()
|
|
482
|
+
.describe('(commitPhase) Agent name for Co-Authored-By footer'),
|
|
483
|
+
stagePatterns: zod_1.z.array(zod_1.z.string()).optional()
|
|
484
|
+
.describe('(commitPhase) Patterns for files to stage (default: [".context/**"])'),
|
|
485
|
+
dryRun: zod_1.z.boolean().optional()
|
|
486
|
+
.describe('(commitPhase) Preview without committing'),
|
|
487
|
+
}
|
|
488
|
+
}, wrap('plan', async (params) => {
|
|
489
|
+
return (0, gatewayTools_1.handlePlan)(params, { repoPath: this.getRepoPath() });
|
|
490
|
+
}));
|
|
491
|
+
// Gateway 7: agent - Agent orchestration and discovery
|
|
492
|
+
this.server.registerTool('agent', {
|
|
493
|
+
description: `Agent orchestration and discovery. Actions:
|
|
494
|
+
- discover: Discover all agents (built-in + custom)
|
|
495
|
+
- getInfo: Get agent details (params: agentType)
|
|
496
|
+
- orchestrate: Select agents for task/phase/role (params: task?, phase?, role?)
|
|
497
|
+
- getSequence: Get agent handoff sequence (params: task, includeReview?, phases?)
|
|
498
|
+
- getDocs: Get agent documentation (params: agent)
|
|
499
|
+
- getPhaseDocs: Get phase documentation (params: phase)
|
|
500
|
+
- listTypes: List all agent types`,
|
|
501
|
+
inputSchema: {
|
|
502
|
+
action: zod_1.z.enum(['discover', 'getInfo', 'orchestrate', 'getSequence', 'getDocs', 'getPhaseDocs', 'listTypes'])
|
|
503
|
+
.describe('Action to perform'),
|
|
504
|
+
agentType: zod_1.z.string().optional()
|
|
505
|
+
.describe('(getInfo) Agent type identifier'),
|
|
506
|
+
task: zod_1.z.string().optional()
|
|
507
|
+
.describe('(orchestrate, getSequence) Task description'),
|
|
508
|
+
phase: zod_1.z.enum(['P', 'R', 'E', 'V', 'C']).optional()
|
|
509
|
+
.describe('(orchestrate, getPhaseDocs) PREVC phase'),
|
|
510
|
+
role: zod_1.z.enum(workflow_2.PREVC_ROLES).optional()
|
|
511
|
+
.describe('(orchestrate) PREVC role'),
|
|
512
|
+
includeReview: zod_1.z.boolean().optional()
|
|
513
|
+
.describe('(getSequence) Include code review'),
|
|
514
|
+
phases: zod_1.z.array(zod_1.z.enum(['P', 'R', 'E', 'V', 'C'])).optional()
|
|
515
|
+
.describe('(getSequence) Phases to include'),
|
|
516
|
+
agent: zod_1.z.enum(workflow_2.AGENT_TYPES).optional()
|
|
517
|
+
.describe('(getDocs) Agent type for docs'),
|
|
518
|
+
}
|
|
519
|
+
}, wrap('agent', async (params) => {
|
|
520
|
+
return (0, gatewayTools_1.handleAgent)(params, { repoPath: this.getRepoPath() });
|
|
521
|
+
}));
|
|
522
|
+
// Gateway 8: skill - Skill management
|
|
523
|
+
this.server.registerTool('skill', {
|
|
524
|
+
description: `Skill management for on-demand expertise. Actions:
|
|
525
|
+
- list: List all skills (params: includeContent?)
|
|
526
|
+
- getContent: Get skill content (params: skillSlug)
|
|
527
|
+
- getForPhase: Get skills for PREVC phase (params: phase)
|
|
528
|
+
- scaffold: Generate skill files (params: skills?, force?)
|
|
529
|
+
- export: Export skills to AI tools (params: preset?, includeBuiltIn?, force?)
|
|
530
|
+
- fill: Fill skills with codebase content (params: skills?, force?)`,
|
|
531
|
+
inputSchema: {
|
|
532
|
+
action: zod_1.z.enum(['list', 'getContent', 'getForPhase', 'scaffold', 'export', 'fill'])
|
|
533
|
+
.describe('Action to perform'),
|
|
534
|
+
skillSlug: zod_1.z.string().optional()
|
|
535
|
+
.describe('(getContent) Skill identifier'),
|
|
536
|
+
phase: zod_1.z.enum(['P', 'R', 'E', 'V', 'C']).optional()
|
|
537
|
+
.describe('(getForPhase) PREVC phase'),
|
|
538
|
+
skills: zod_1.z.array(zod_1.z.string()).optional()
|
|
539
|
+
.describe('(scaffold, fill) Specific skills to process'),
|
|
540
|
+
includeContent: zod_1.z.boolean().optional()
|
|
541
|
+
.describe('(list) Include full content'),
|
|
542
|
+
includeBuiltIn: zod_1.z.boolean().optional()
|
|
543
|
+
.describe('(export, fill) Include built-in skills'),
|
|
544
|
+
preset: zod_1.z.string().optional()
|
|
545
|
+
.describe('(export) Target AI tool preset'),
|
|
546
|
+
force: zod_1.z.boolean().optional()
|
|
547
|
+
.describe('(scaffold, export) Overwrite existing'),
|
|
548
|
+
}
|
|
549
|
+
}, wrap('skill', async (params) => {
|
|
550
|
+
return (0, gatewayTools_1.handleSkill)(params, { repoPath: this.getRepoPath() });
|
|
551
|
+
}));
|
|
552
|
+
// Gateway 9: harness - Explicit harness runtime operations
|
|
553
|
+
this.server.registerTool('harness', {
|
|
554
|
+
description: `Harness runtime operations. Actions:
|
|
555
|
+
- createSession: Create durable harness session (params: name, metadata?)
|
|
556
|
+
- listSessions: List harness sessions
|
|
557
|
+
- getSession: Get a harness session (params: sessionId)
|
|
558
|
+
- appendTrace: Append trace event (params: sessionId, level, event, message, data?)
|
|
559
|
+
- listTraces: List trace events for a session (params: sessionId)
|
|
560
|
+
- addArtifact: Add artifact to a session (params: sessionId, name, kind?, content?, path?, metadata?)
|
|
561
|
+
- listArtifacts: List session artifacts (params: sessionId)
|
|
562
|
+
- checkpoint: Record session checkpoint (params: sessionId, note?, data?, artifactIds?, pause?)
|
|
563
|
+
- resumeSession: Resume paused session (params: sessionId)
|
|
564
|
+
- completeSession: Complete session (params: sessionId, note?)
|
|
565
|
+
- failSession: Fail session (params: sessionId, message)
|
|
566
|
+
- recordSensor: Record sensor result for session (params: sessionId, sensorId, sensorStatus, summary, sensorSeverity?, sensorBlocking?, evidence?)
|
|
567
|
+
- getSessionQuality: Evaluate backpressure and task completion (params: sessionId, taskId?, blockOnWarnings?, requireEvidence?)
|
|
568
|
+
- createTask: Create task contract (params: title, sessionId?, expectedOutputs?, acceptanceCriteria?, requiredSensors?, requiredArtifacts?)
|
|
569
|
+
- listTasks: List task contracts
|
|
570
|
+
- evaluateTask: Evaluate task completion (params: taskId, sessionId?)
|
|
571
|
+
- createHandoff: Create handoff contract (params: from, to, sessionId?, taskId?, artifacts?, evidence?)
|
|
572
|
+
- listHandoffs: List handoff contracts
|
|
573
|
+
- replaySession: Replay a durable session timeline (params: sessionId, includePayloads?, maxEvents?)
|
|
574
|
+
- listReplays: List generated replays (params: sessionId?)
|
|
575
|
+
- getReplay: Get replay by id (params: replayId)
|
|
576
|
+
- buildDataset: Build a failure dataset from sessions (params: sessionIds?, includeSuccessfulSessions?)
|
|
577
|
+
- listDatasets: List failure datasets
|
|
578
|
+
- getDataset: Get failure dataset by id (params: datasetId)
|
|
579
|
+
- getFailureClusters: Get clusters for a dataset (params: datasetId)
|
|
580
|
+
- registerPolicy: Register policy rule (params: scope, effect, target?, pattern?, pathPattern?, risk?, description?)
|
|
581
|
+
- listPolicies: List policy rules
|
|
582
|
+
- getPolicy: Retrieve current policy document
|
|
583
|
+
- setPolicy: Replace policy document (params: policy)
|
|
584
|
+
- resetPolicy: Reset policy to bootstrap defaults
|
|
585
|
+
- evaluatePolicy: Evaluate policy against runtime input (params: scope, pattern?, target?, path?, pathPattern?, risk?, approvedBy?, approvalRole?, approvalNote?)`,
|
|
586
|
+
inputSchema: {
|
|
587
|
+
action: zod_1.z.enum([
|
|
588
|
+
'createSession',
|
|
589
|
+
'listSessions',
|
|
590
|
+
'getSession',
|
|
591
|
+
'appendTrace',
|
|
592
|
+
'listTraces',
|
|
593
|
+
'addArtifact',
|
|
594
|
+
'listArtifacts',
|
|
595
|
+
'checkpoint',
|
|
596
|
+
'resumeSession',
|
|
597
|
+
'completeSession',
|
|
598
|
+
'failSession',
|
|
599
|
+
'recordSensor',
|
|
600
|
+
'getSessionQuality',
|
|
601
|
+
'createTask',
|
|
602
|
+
'listTasks',
|
|
603
|
+
'evaluateTask',
|
|
604
|
+
'createHandoff',
|
|
605
|
+
'listHandoffs',
|
|
606
|
+
'replaySession',
|
|
607
|
+
'listReplays',
|
|
608
|
+
'getReplay',
|
|
609
|
+
'buildDataset',
|
|
610
|
+
'listDatasets',
|
|
611
|
+
'getDataset',
|
|
612
|
+
'getFailureClusters',
|
|
613
|
+
'registerPolicy',
|
|
614
|
+
'listPolicies',
|
|
615
|
+
'getPolicy',
|
|
616
|
+
'setPolicy',
|
|
617
|
+
'resetPolicy',
|
|
618
|
+
'evaluatePolicy',
|
|
619
|
+
]).describe('Action to perform'),
|
|
620
|
+
sessionId: zod_1.z.string().optional(),
|
|
621
|
+
taskId: zod_1.z.string().optional(),
|
|
622
|
+
name: zod_1.z.string().optional(),
|
|
623
|
+
title: zod_1.z.string().optional(),
|
|
624
|
+
description: zod_1.z.string().optional(),
|
|
625
|
+
owner: zod_1.z.string().optional(),
|
|
626
|
+
status: zod_1.z.enum(['draft', 'ready', 'in_progress', 'blocked', 'completed', 'failed']).optional(),
|
|
627
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
628
|
+
level: zod_1.z.enum(['debug', 'info', 'warn', 'error']).optional(),
|
|
629
|
+
event: zod_1.z.string().optional(),
|
|
630
|
+
message: zod_1.z.string().optional(),
|
|
631
|
+
data: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
632
|
+
kind: zod_1.z.enum(['text', 'json', 'file']).optional(),
|
|
633
|
+
content: zod_1.z.unknown().optional(),
|
|
634
|
+
path: zod_1.z.string().optional(),
|
|
635
|
+
note: zod_1.z.string().optional(),
|
|
636
|
+
artifactIds: zod_1.z.array(zod_1.z.string()).optional(),
|
|
637
|
+
pause: zod_1.z.boolean().optional(),
|
|
638
|
+
sensorId: zod_1.z.string().optional(),
|
|
639
|
+
sensorName: zod_1.z.string().optional(),
|
|
640
|
+
sensorSeverity: zod_1.z.enum(['info', 'warning', 'critical']).optional(),
|
|
641
|
+
sensorBlocking: zod_1.z.boolean().optional(),
|
|
642
|
+
sensorStatus: zod_1.z.enum(['passed', 'failed', 'skipped', 'blocked']).optional(),
|
|
643
|
+
summary: zod_1.z.string().optional(),
|
|
644
|
+
evidence: zod_1.z.array(zod_1.z.string()).optional(),
|
|
645
|
+
output: zod_1.z.unknown().optional(),
|
|
646
|
+
details: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
647
|
+
blockOnWarnings: zod_1.z.boolean().optional(),
|
|
648
|
+
requireEvidence: zod_1.z.boolean().optional(),
|
|
649
|
+
inputs: zod_1.z.array(zod_1.z.string()).optional(),
|
|
650
|
+
expectedOutputs: zod_1.z.array(zod_1.z.string()).optional(),
|
|
651
|
+
acceptanceCriteria: zod_1.z.array(zod_1.z.string()).optional(),
|
|
652
|
+
requiredSensors: zod_1.z.array(zod_1.z.string()).optional(),
|
|
653
|
+
requiredArtifacts: zod_1.z.array(zod_1.z.string()).optional(),
|
|
654
|
+
from: zod_1.z.string().optional(),
|
|
655
|
+
to: zod_1.z.string().optional(),
|
|
656
|
+
artifacts: zod_1.z.array(zod_1.z.string()).optional(),
|
|
657
|
+
replayId: zod_1.z.string().optional(),
|
|
658
|
+
includePayloads: zod_1.z.boolean().optional(),
|
|
659
|
+
maxEvents: zod_1.z.number().optional(),
|
|
660
|
+
datasetId: zod_1.z.string().optional(),
|
|
661
|
+
sessionIds: zod_1.z.array(zod_1.z.string()).optional(),
|
|
662
|
+
includeSuccessfulSessions: zod_1.z.boolean().optional(),
|
|
663
|
+
scope: zod_1.z.enum(['sensor', 'artifact', 'handoff', 'workflow', 'task', 'risk']).optional(),
|
|
664
|
+
effect: zod_1.z.enum(['allow', 'deny', 'require_approval']).optional(),
|
|
665
|
+
target: zod_1.z.enum(['tool', 'action', 'path', 'risk']).optional(),
|
|
666
|
+
pattern: zod_1.z.string().optional(),
|
|
667
|
+
pathPattern: zod_1.z.string().optional(),
|
|
668
|
+
approvalRole: zod_1.z.string().optional(),
|
|
669
|
+
approvedBy: zod_1.z.string().optional(),
|
|
670
|
+
approvalNote: zod_1.z.string().optional(),
|
|
671
|
+
risk: zod_1.z.enum(['low', 'medium', 'high', 'critical']).optional(),
|
|
672
|
+
policy: zod_1.z.object({
|
|
673
|
+
defaultEffect: zod_1.z.enum(['allow', 'deny']).optional(),
|
|
674
|
+
rules: zod_1.z.array(zod_1.z.object({
|
|
675
|
+
id: zod_1.z.string().optional(),
|
|
676
|
+
effect: zod_1.z.enum(['allow', 'deny', 'require_approval']),
|
|
677
|
+
target: zod_1.z.enum(['tool', 'action', 'path', 'risk']).optional(),
|
|
678
|
+
pattern: zod_1.z.string().optional(),
|
|
679
|
+
pathPattern: zod_1.z.string().optional(),
|
|
680
|
+
approvalRole: zod_1.z.string().optional(),
|
|
681
|
+
reason: zod_1.z.string().optional(),
|
|
682
|
+
description: zod_1.z.string().optional(),
|
|
683
|
+
scope: zod_1.z.enum(['sensor', 'artifact', 'handoff', 'workflow', 'task', 'risk']).optional(),
|
|
684
|
+
})).optional(),
|
|
685
|
+
}).optional(),
|
|
686
|
+
}
|
|
687
|
+
}, wrap('harness', async (params) => {
|
|
688
|
+
return (0, gatewayTools_1.handleHarness)(params, { repoPath: this.getRepoPath() });
|
|
689
|
+
}));
|
|
690
|
+
this.log('Registered consolidated MCP gateway and workflow tools');
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Register semantic context resources
|
|
694
|
+
* Uses initialRepoPath if found, otherwise process.cwd()
|
|
695
|
+
*/
|
|
696
|
+
registerResources() {
|
|
697
|
+
const repoPath = this.initialRepoPath ?? process.cwd();
|
|
698
|
+
// Register context resources as templates with URI patterns
|
|
699
|
+
this.server.registerResource('codebase-context', `context://codebase/{contextType}`, {
|
|
700
|
+
description: 'Semantic context for the codebase. Use contextType: documentation, playbook, plan, or compact',
|
|
701
|
+
mimeType: 'text/markdown'
|
|
702
|
+
}, async (uri) => {
|
|
703
|
+
// Extract context type from URI
|
|
704
|
+
const match = uri.pathname.match(/\/([^/]+)$/);
|
|
705
|
+
const contextType = (match?.[1] || 'compact');
|
|
706
|
+
let context;
|
|
707
|
+
// Check cache first
|
|
708
|
+
const cached = await this.contextCache.get(repoPath, contextType);
|
|
709
|
+
if (cached) {
|
|
710
|
+
context = cached;
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
switch (contextType) {
|
|
714
|
+
case 'documentation':
|
|
715
|
+
context = await this.contextBuilder.buildDocumentationContext(repoPath);
|
|
716
|
+
break;
|
|
717
|
+
case 'playbook':
|
|
718
|
+
context = await this.contextBuilder.buildPlaybookContext(repoPath, 'generic');
|
|
719
|
+
break;
|
|
720
|
+
case 'plan':
|
|
721
|
+
context = await this.contextBuilder.buildPlanContext(repoPath);
|
|
722
|
+
break;
|
|
723
|
+
case 'compact':
|
|
724
|
+
default:
|
|
725
|
+
context = await this.contextBuilder.buildCompactContext(repoPath);
|
|
726
|
+
break;
|
|
727
|
+
}
|
|
728
|
+
// Store in cache for subsequent calls
|
|
729
|
+
await this.contextCache.set(repoPath, contextType, context);
|
|
730
|
+
}
|
|
731
|
+
return {
|
|
732
|
+
contents: [{
|
|
733
|
+
uri: uri.href,
|
|
734
|
+
mimeType: 'text/markdown',
|
|
735
|
+
text: context
|
|
736
|
+
}]
|
|
737
|
+
};
|
|
738
|
+
});
|
|
739
|
+
// Register file resource template
|
|
740
|
+
this.server.registerResource('file-content', `file://{path}`, {
|
|
741
|
+
description: 'Read file contents from the repository',
|
|
742
|
+
mimeType: 'text/plain'
|
|
743
|
+
}, async (uri) => {
|
|
744
|
+
const filePath = uri.pathname;
|
|
745
|
+
const result = await contextTools_1.readFileTool.execute({ filePath }, { toolCallId: '', messages: [] });
|
|
746
|
+
if (!result.success) {
|
|
747
|
+
throw new Error(result.error || 'Failed to read file');
|
|
748
|
+
}
|
|
749
|
+
return {
|
|
750
|
+
contents: [{
|
|
751
|
+
uri: uri.href,
|
|
752
|
+
mimeType: 'text/plain',
|
|
753
|
+
text: result.content || ''
|
|
754
|
+
}]
|
|
755
|
+
};
|
|
756
|
+
});
|
|
757
|
+
this.log('Registered 2 resource templates');
|
|
758
|
+
// Register PREVC workflow resources
|
|
759
|
+
this.registerWorkflowResources();
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Register PREVC workflow resources
|
|
763
|
+
* Uses initialRepoPath if found, otherwise process.cwd()
|
|
764
|
+
*/
|
|
765
|
+
registerWorkflowResources() {
|
|
766
|
+
const repoPath = this.initialRepoPath ?? process.cwd();
|
|
767
|
+
// workflow://status - Current workflow status
|
|
768
|
+
this.server.registerResource('workflow-status', 'workflow://status', {
|
|
769
|
+
description: 'Current PREVC workflow status including phases, roles, and progress',
|
|
770
|
+
mimeType: 'application/json'
|
|
771
|
+
}, async () => {
|
|
772
|
+
try {
|
|
773
|
+
const service = new workflow_1.WorkflowService(repoPath);
|
|
774
|
+
if (!(await service.hasWorkflow())) {
|
|
775
|
+
return {
|
|
776
|
+
contents: [{
|
|
777
|
+
uri: 'workflow://status',
|
|
778
|
+
mimeType: 'application/json',
|
|
779
|
+
text: JSON.stringify({ error: 'No workflow found' }, null, 2)
|
|
780
|
+
}]
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
const summary = await service.getSummary();
|
|
784
|
+
const status = await service.getStatus();
|
|
785
|
+
return {
|
|
786
|
+
contents: [{
|
|
787
|
+
uri: 'workflow://status',
|
|
788
|
+
mimeType: 'application/json',
|
|
789
|
+
text: JSON.stringify({
|
|
790
|
+
name: summary.name,
|
|
791
|
+
scale: (0, workflow_2.getScaleName)(summary.scale),
|
|
792
|
+
currentPhase: summary.currentPhase,
|
|
793
|
+
progress: summary.progress,
|
|
794
|
+
isComplete: summary.isComplete,
|
|
795
|
+
phases: status.phases,
|
|
796
|
+
roles: status.roles,
|
|
797
|
+
}, null, 2)
|
|
798
|
+
}]
|
|
799
|
+
};
|
|
800
|
+
}
|
|
801
|
+
catch (error) {
|
|
802
|
+
return {
|
|
803
|
+
contents: [{
|
|
804
|
+
uri: 'workflow://status',
|
|
805
|
+
mimeType: 'application/json',
|
|
806
|
+
text: JSON.stringify({
|
|
807
|
+
error: error instanceof Error ? error.message : String(error)
|
|
808
|
+
}, null, 2)
|
|
809
|
+
}]
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
this.log('Registered 1 workflow resource');
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Initialize repo path with smart detection and caching
|
|
817
|
+
*
|
|
818
|
+
* Strategy:
|
|
819
|
+
* 1. If explicit options.repoPath provided, try to find project root from there
|
|
820
|
+
* 2. Otherwise search upward from process.cwd() for .context or .git
|
|
821
|
+
* 3. Set as initialRepoPath if found (for resources)
|
|
822
|
+
* 4. First valid repoPath from client gets cached for all subsequent tool calls
|
|
823
|
+
* 5. Fallback to process.cwd() if nothing found (allows flexible MCP usage)
|
|
824
|
+
*/
|
|
825
|
+
async initializeRepoPath() {
|
|
826
|
+
const startPath = this.options.repoPath || process.cwd();
|
|
827
|
+
const foundRoot = await this.findProjectRoot(startPath);
|
|
828
|
+
if (foundRoot) {
|
|
829
|
+
this.initialRepoPath = path.resolve(foundRoot);
|
|
830
|
+
this.log(`Server initialized with project root: ${this.initialRepoPath}`);
|
|
831
|
+
}
|
|
832
|
+
else {
|
|
833
|
+
// No project found - will use process.cwd() as fallback
|
|
834
|
+
// This allows flexible MCP server usage without strict project detection
|
|
835
|
+
this.initialRepoPath = null;
|
|
836
|
+
this.log(`No project root found. Will use process.cwd() or first valid client-provided path.`);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Find project root by searching upward for .context or .git
|
|
841
|
+
*/
|
|
842
|
+
async findProjectRoot(startPath) {
|
|
843
|
+
let currentPath = path.resolve(startPath);
|
|
844
|
+
const root = path.parse(currentPath).root;
|
|
845
|
+
// Search upward for .context or .git
|
|
846
|
+
while (currentPath !== root) {
|
|
847
|
+
if (await fs.pathExists(path.join(currentPath, '.context')) ||
|
|
848
|
+
await fs.pathExists(path.join(currentPath, '.git'))) {
|
|
849
|
+
return currentPath;
|
|
850
|
+
}
|
|
851
|
+
currentPath = path.dirname(currentPath);
|
|
852
|
+
}
|
|
853
|
+
// Not found
|
|
854
|
+
return null;
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Cache a valid repoPath from client
|
|
858
|
+
* Only cache if it contains .context and we haven't cached yet
|
|
859
|
+
*/
|
|
860
|
+
cacheRepoPathIfValid(repoPath) {
|
|
861
|
+
if (this.cachedRepoPath) {
|
|
862
|
+
return; // Already cached
|
|
863
|
+
}
|
|
864
|
+
const contextPath = path.join(repoPath, '.context');
|
|
865
|
+
if (fs.existsSync(contextPath)) {
|
|
866
|
+
this.cachedRepoPath = path.resolve(repoPath);
|
|
867
|
+
process.stderr.write(`[mcp] ✓ Cached repoPath for this session: ${this.cachedRepoPath}\n`);
|
|
868
|
+
this.log(`Cached valid repoPath: ${this.cachedRepoPath}`);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Get the effective repo path for a tool call
|
|
873
|
+
* Priority: 1) explicit param, 2) cached path, 3) initial path, 4) process.cwd()
|
|
874
|
+
*/
|
|
875
|
+
getRepoPath(paramsRepoPath) {
|
|
876
|
+
if (paramsRepoPath) {
|
|
877
|
+
const resolved = path.resolve(paramsRepoPath);
|
|
878
|
+
this.cacheRepoPathIfValid(resolved);
|
|
879
|
+
return resolved;
|
|
880
|
+
}
|
|
881
|
+
if (this.cachedRepoPath) {
|
|
882
|
+
this.log(`Using cached repoPath: ${this.cachedRepoPath}`);
|
|
883
|
+
return this.cachedRepoPath;
|
|
884
|
+
}
|
|
885
|
+
if (this.initialRepoPath) {
|
|
886
|
+
this.log(`Using initial repoPath: ${this.initialRepoPath}`);
|
|
887
|
+
return this.initialRepoPath;
|
|
888
|
+
}
|
|
889
|
+
// Fallback to current working directory
|
|
890
|
+
const cwd = process.cwd();
|
|
891
|
+
this.log(`Using fallback cwd: ${cwd}`);
|
|
892
|
+
return cwd;
|
|
893
|
+
}
|
|
894
|
+
wrapWithActionLogging(toolName, handler) {
|
|
895
|
+
return async (params) => {
|
|
896
|
+
const resolvedRepoPath = this.getRepoPath(params?.repoPath);
|
|
897
|
+
const action = typeof params?.action === 'string'
|
|
898
|
+
? params.action
|
|
899
|
+
: toolName;
|
|
900
|
+
// Validate file paths to prevent path traversal attacks
|
|
901
|
+
try {
|
|
902
|
+
this.validatePathParams(params, resolvedRepoPath);
|
|
903
|
+
}
|
|
904
|
+
catch (error) {
|
|
905
|
+
if (error instanceof pathSecurity_1.SecurityError) {
|
|
906
|
+
this.log(`[SECURITY] Path traversal blocked: ${error.message} (tool: ${toolName}, path: ${error.attemptedPath})`);
|
|
907
|
+
const errorResponse = {
|
|
908
|
+
content: [{ type: 'text', text: JSON.stringify({ success: false, error: `Security: ${error.message}` }) }],
|
|
909
|
+
isError: true,
|
|
910
|
+
};
|
|
911
|
+
await this.logToolError(resolvedRepoPath, toolName, action, params, error);
|
|
912
|
+
return errorResponse;
|
|
913
|
+
}
|
|
914
|
+
throw error;
|
|
915
|
+
}
|
|
916
|
+
try {
|
|
917
|
+
const response = await handler(params);
|
|
918
|
+
await this.logToolResponse(resolvedRepoPath, toolName, action, params, response);
|
|
919
|
+
return response;
|
|
920
|
+
}
|
|
921
|
+
catch (error) {
|
|
922
|
+
await this.logToolError(resolvedRepoPath, toolName, action, params, error);
|
|
923
|
+
throw error;
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Validate path-related parameters against the workspace boundary.
|
|
929
|
+
* Throws SecurityError if any path escapes the workspace.
|
|
930
|
+
*/
|
|
931
|
+
validatePathParams(params, repoPath) {
|
|
932
|
+
const validator = new pathSecurity_1.PathValidator(repoPath);
|
|
933
|
+
const pathKeys = ['filePath', 'rootPath', 'cwd'];
|
|
934
|
+
for (const key of pathKeys) {
|
|
935
|
+
const value = params[key];
|
|
936
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
937
|
+
validator.validatePath(value);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
async logToolResponse(repoPath, toolName, action, params, response) {
|
|
942
|
+
const payload = this.parseResponsePayload(response);
|
|
943
|
+
const success = typeof payload?.success === 'boolean'
|
|
944
|
+
? payload.success
|
|
945
|
+
: !response.isError;
|
|
946
|
+
const errorMessage = typeof payload?.error === 'string' ? payload.error : undefined;
|
|
947
|
+
const resultSummary = payload ? this.buildResultSummary(payload) : undefined;
|
|
948
|
+
await (0, actionLogger_1.logMcpAction)(repoPath, {
|
|
949
|
+
tool: toolName,
|
|
950
|
+
action,
|
|
951
|
+
status: success ? 'success' : 'error',
|
|
952
|
+
details: {
|
|
953
|
+
params,
|
|
954
|
+
...(resultSummary ? { result: resultSummary } : {}),
|
|
955
|
+
},
|
|
956
|
+
...(success ? {} : { error: errorMessage || 'Tool reported failure' }),
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
async logToolError(repoPath, toolName, action, params, error) {
|
|
960
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
961
|
+
await (0, actionLogger_1.logMcpAction)(repoPath, {
|
|
962
|
+
tool: toolName,
|
|
963
|
+
action,
|
|
964
|
+
status: 'error',
|
|
965
|
+
details: { params },
|
|
966
|
+
error: message,
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
parseResponsePayload(response) {
|
|
970
|
+
const text = response.content?.[0]?.text;
|
|
971
|
+
if (!text)
|
|
972
|
+
return null;
|
|
973
|
+
try {
|
|
974
|
+
const parsed = JSON.parse(text);
|
|
975
|
+
return parsed && typeof parsed === 'object' ? parsed : null;
|
|
976
|
+
}
|
|
977
|
+
catch {
|
|
978
|
+
return null;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
buildResultSummary(payload) {
|
|
982
|
+
const summaryKeys = [
|
|
983
|
+
'success',
|
|
984
|
+
'message',
|
|
985
|
+
'currentPhase',
|
|
986
|
+
'nextPhase',
|
|
987
|
+
'phase',
|
|
988
|
+
'scale',
|
|
989
|
+
'planSlug',
|
|
990
|
+
'count',
|
|
991
|
+
'total',
|
|
992
|
+
'status',
|
|
993
|
+
];
|
|
994
|
+
const summary = {};
|
|
995
|
+
for (const key of summaryKeys) {
|
|
996
|
+
if (key in payload) {
|
|
997
|
+
summary[key] = payload[key];
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
return Object.keys(summary).length > 0 ? summary : null;
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Start the MCP server with stdio transport
|
|
1004
|
+
*/
|
|
1005
|
+
async start() {
|
|
1006
|
+
this.transport = new stdio_js_1.StdioServerTransport();
|
|
1007
|
+
await this.server.connect(this.transport);
|
|
1008
|
+
this.log('MCP Server started on stdio');
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Stop the MCP server
|
|
1012
|
+
*/
|
|
1013
|
+
async stop() {
|
|
1014
|
+
await this.server.close();
|
|
1015
|
+
await this.contextBuilder.shutdown();
|
|
1016
|
+
this.log('MCP Server stopped');
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Log message to stderr (not stdout, to avoid polluting MCP messages)
|
|
1020
|
+
*/
|
|
1021
|
+
log(message) {
|
|
1022
|
+
if (this.options.verbose) {
|
|
1023
|
+
process.stderr.write(`[mcp] ${message}\n`);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
exports.AIContextMCPServer = AIContextMCPServer;
|
|
1028
|
+
/**
|
|
1029
|
+
* Create and start an MCP server
|
|
1030
|
+
*/
|
|
1031
|
+
async function startMCPServer(options = {}) {
|
|
1032
|
+
const server = new AIContextMCPServer(options);
|
|
1033
|
+
await server.start();
|
|
1034
|
+
return server;
|
|
1035
|
+
}
|
|
1036
|
+
//# sourceMappingURL=mcpServer.js.map
|