feat(ql3): expose run comparison over local mcp

This commit is contained in:
whyour
2026-08-14 16:23:22 +08:00
parent 3b0aa97303
commit a55613afaa
8 changed files with 285 additions and 11 deletions
@@ -45,6 +45,11 @@ import {
BUILTIN_RUN_STEP_LIST_TOOL_DEFINITION,
executeBuiltInRunStepListTool,
} from '../tool-projection/runStepList';
import {
BUILTIN_RUN_COMPARE_TOOL,
BUILTIN_RUN_COMPARE_TOOL_DEFINITION,
executeBuiltInRunCompareTool,
} from '@qinglong/runtime-core/builtin-run-compare-projection';
import {
BUILTIN_RUN_READ_TOOL,
BUILTIN_RUN_READ_TOOL_DEFINITION,
@@ -177,6 +182,18 @@ const LOCAL_MCP_READ_TOOLS: readonly LocalMcpReadToolDescriptor[] =
input: ToolJsonValue,
) => executeBuiltInRunReadTool(authority.runs, projectId, input),
}),
Object.freeze({
tool: BUILTIN_RUN_COMPARE_TOOL,
definition: BUILTIN_RUN_COMPARE_TOOL_DEFINITION,
title: 'Compare QingLong Runs',
auditReason: 'tool_qinglong_run_compare',
unavailableCode: 'run_compare_unavailable',
execute: (
authority: LocalMcpReadAuthority,
projectId: string,
input: ToolJsonValue,
) => executeBuiltInRunCompareTool(authority.runs, projectId, input),
}),
Object.freeze({
tool: BUILTIN_RUN_EVENT_LIST_TOOL,
definition: BUILTIN_RUN_EVENT_LIST_TOOL_DEFINITION,