@debugg-ai/debugg-ai-mcp
Version:
Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.
56 lines (55 loc) • 2.11 kB
JavaScript
import { buildTestPageChangesTool, buildValidatedTestPageChangesTool } from './testPageChanges.js';
import { buildTriggerCrawlTool, buildValidatedTriggerCrawlTool } from './triggerCrawl.js';
import { buildProbePageTool, buildValidatedProbePageTool } from './probePage.js';
import { buildProjectTool, buildValidatedProjectTool } from './project.js';
import { buildEnvironmentTool, buildValidatedEnvironmentTool } from './environment.js';
import { buildExecutionsTool, buildValidatedExecutionsTool } from './executions.js';
import { buildTestSuiteTool, buildValidatedTestSuiteTool } from './testSuite.js';
import { buildTestCaseTool, buildValidatedTestCaseTool } from './testCase.js';
let _tools = null;
let _validatedTools = null;
const toolRegistry = new Map();
/**
* Initialize tools with project context (call once after resolveProjectContext).
*
* The surface is 8 action-based tools (epic yg7o6): 3 browser tools plus one
* tool per managed entity (project/environment/test_suite/test_case/executions),
* each routing an `action` discriminator to its handler.
*/
export function initTools(ctx) {
const tools = [
buildTestPageChangesTool(ctx),
buildProbePageTool(),
buildTriggerCrawlTool(ctx),
buildProjectTool(),
buildEnvironmentTool(),
buildTestSuiteTool(),
buildTestCaseTool(),
buildExecutionsTool(),
];
const validated = [
buildValidatedTestPageChangesTool(ctx),
buildValidatedProbePageTool(),
buildValidatedTriggerCrawlTool(ctx),
buildValidatedProjectTool(),
buildValidatedEnvironmentTool(),
buildValidatedTestSuiteTool(),
buildValidatedTestCaseTool(),
buildValidatedExecutionsTool(),
];
_tools = tools;
_validatedTools = validated;
toolRegistry.clear();
for (const v of validated)
toolRegistry.set(v.name, v);
}
export function getTools() {
if (!_tools)
initTools(null);
return _tools;
}
export function getTool(name) {
if (!_validatedTools)
initTools(null);
return toolRegistry.get(name);
}