feat: add pluggable Excel analyst report guard
Memind CI / Test, build, and release guards (push) Has been cancelled

This commit is contained in:
john
2026-07-17 11:52:21 +08:00
parent 75b32d959c
commit 0c1c0c3b48
20 changed files with 2099 additions and 8 deletions
+26
View File
@@ -48,6 +48,12 @@ export function resolveMindSearchMcpServerPath(overridePath) {
return path.join(path.dirname(fileURLToPath(import.meta.url)), 'tkmind-search-mcp.mjs');
}
export function resolveExcelMcpServerPath(overridePath) {
const normalized = String(overridePath ?? '').trim();
if (normalized) return normalized;
return path.join(path.dirname(fileURLToPath(import.meta.url)), 'tkmind-excel-mcp.mjs');
}
export const CAPABILITY_CATALOG = [
{
key: 'shell',
@@ -476,6 +482,26 @@ export function buildAgentExtensionPolicy(
if (searchEnabled && (!policies || policies.network_egress !== 'deny')) {
extensions.push({ type: 'stdio', name: 'tkmind-search', description: 'MindSearch 外部搜索增强(补充能力)', display_name: 'tkmind-search', bundled: false, cmd: resolveSandboxMcpNodeExecPath(process.env.GOOSED_MCP_NODE_PATH), args: [resolveMindSearchMcpServerPath(process.env.TKMIND_SEARCH_MCP_SERVER_PATH)], envs: { TKMIND_SEARCH_ENABLED: '1', TKMIND_SEARCH_MODE: mindSearchConfig.mode, TKMIND_SEARCH_PROVIDER_SEARXNG_ENABLED: mindSearchConfig.providers?.searxng ? '1' : '0', TKMIND_SEARCH_PROVIDER_GITHUB_ENABLED: mindSearchConfig.providers?.github ? '1' : '0', TKMIND_SEARCH_READER_ENABLED: mindSearchConfig.providers?.reader ? '1' : '0', TKMIND_SEARCH_SEARXNG_URL: mindSearchConfig.settings?.searxngEndpoint ?? '', TKMIND_SEARCH_MAX_RESULTS: String(mindSearchConfig.settings?.maxResults ?? 10), TKMIND_SEARCH_TIMEOUT_MS: String(mindSearchConfig.settings?.timeoutMs ?? 8000), TKMIND_SEARCH_READER_MAX_CHARS: String(mindSearchConfig.settings?.readerMaxChars ?? 12000) }, available_tools: ['tkmind_search', 'tkmind_read'] });
}
if (capabilities.excel_analysis) {
const excelWorkspaceRoot = resolveSandboxMcpLocalRoot(sandboxMcp);
if (excelWorkspaceRoot) {
extensions.push({
type: 'stdio',
name: 'tkmind-excel',
description: 'Excel Analyst:当前用户工作区内 .xlsx 的只读检查、统计分析、图表与一致性校验报告。',
display_name: 'Excel Analyst',
bundled: false,
cmd: resolveSandboxMcpNodeExecPath(sandboxMcp?.nodeExecPath),
args: [resolveExcelMcpServerPath(process.env.GOOSED_EXCEL_MCP_SERVER_PATH), excelWorkspaceRoot],
envs: {
EXCEL_ANALYST_ENABLED: '1',
MINDSPACE_WORKSPACE_ROOT: excelWorkspaceRoot,
...(sandboxMcp?.workspaceRef ? { MINDSPACE_WORKSPACE_REF: sandboxMcp.workspaceRef } : {}),
},
available_tools: ['excel_inspect', 'excel_analyze', 'excel_chart', 'excel_report'],
});
}
}
if (capabilities.computer) {
extensions.push(makeExtension('builtin', 'computercontroller', []));
}