feat(ai-tools): 新增AI配置体检探针并拆分本地快照执行器

- 新增 inspect_ai_setup_health 统一诊断供应商、聊天前置、MCP 接入和提示词技能状态
- 拆分 AI 配置类本地快照执行器与共享运行时类型,收缩 aiSnapshotInspectionToolExecutor 体积
- 补充内置工具目录、系统提示链路、定向测试与构建验证
This commit is contained in:
Syngnat
2026-06-09 04:56:30 +08:00
parent 6e7b8ceb39
commit 25fb3502e1
13 changed files with 714 additions and 126 deletions

View File

@@ -307,6 +307,23 @@ export const BUILTIN_AI_TOOL_INFO: AIBuiltinToolInfo[] = [
},
},
},
{
name: "inspect_ai_setup_health",
icon: "🩺",
desc: "一键体检当前 AI 配置健康度",
detail:
"汇总当前 AI 供应商、聊天发送前置、MCP 服务与外部客户端接入、提示词与 Skills、上下文挂载情况并给出阻塞项、告警项和下一步建议。适合用户说“AI 为什么不好用”“帮我看下 AI 整体有没有问题”“现在这套 AI 配置还缺什么”时先做一次总览诊断。",
params: "无参数",
tool: {
type: "function",
function: {
name: "inspect_ai_setup_health",
description:
"体检当前 AI 配置健康度返回供应商、模型、聊天发送前置、MCP 接入、提示词与 Skills、表结构上下文挂载等整体快照并给出阻塞项、建议项和下一步动作。适用于用户提到 AI 为什么不好用、当前 AI 配置哪里还缺、是否已经能稳定工作时,优先读取这份总览诊断,不要拆成多次猜测。",
parameters: { type: "object", properties: {} },
},
},
},
{
name: "inspect_ai_runtime",
icon: "🎛️",

View File

@@ -10,6 +10,13 @@ describe('aiToolRegistry', () => {
expect(info?.tool.function.description).toContain('当前供应商');
});
it('registers the ai-setup-health inspector as a builtin tool', () => {
const info = BUILTIN_AI_TOOL_INFO.find((item) => item.name === 'inspect_ai_setup_health');
expect(info).toBeTruthy();
expect(info?.desc).toContain('体检当前 AI 配置');
expect(info?.tool.function.description).toContain('聊天发送前置');
});
it('registers the ai-safety inspector as a builtin tool', () => {
const info = BUILTIN_AI_TOOL_INFO.find((item) => item.name === 'inspect_ai_safety');
expect(info).toBeTruthy();
@@ -113,6 +120,7 @@ describe('aiToolRegistry', () => {
}]);
expect(tools.some((item) => item.function.name === 'inspect_ai_runtime')).toBe(true);
expect(tools.some((item) => item.function.name === 'inspect_ai_setup_health')).toBe(true);
expect(tools.some((item) => item.function.name === 'inspect_ai_safety')).toBe(true);
expect(tools.some((item) => item.function.name === 'inspect_ai_providers')).toBe(true);
expect(tools.some((item) => item.function.name === 'inspect_ai_chat_readiness')).toBe(true);