feat: implement local deep search engine

This commit is contained in:
john
2026-07-23 22:27:07 +08:00
parent 4e36b98c9e
commit be1e4c18c0
12 changed files with 1717 additions and 16 deletions
+17 -2
View File
@@ -401,7 +401,14 @@ function sandboxMcpEnvs(sandboxMcp, mcpTools) {
*/
export function buildAgentExtensionPolicy(
capabilities,
{ unrestricted = false, policies = null, sandboxMcp = null, toolMode = 'chat', mindSearchConfig = null } = {},
{
unrestricted = false,
policies = null,
sandboxMcp = null,
toolMode = 'chat',
mindSearchConfig = null,
userId = null,
} = {},
) {
if (unrestricted) {
return { extensionOverrides: null, enableContextMemory: true, gooseMode: 'auto' };
@@ -518,8 +525,16 @@ export function buildAgentExtensionPolicy(
TKMIND_SEARCH_READER_MAX_CHARS: String(mindSearchConfig.settings?.readerMaxChars ?? 12000),
TKMIND_SEARCH_SERVICES_JSON: JSON.stringify(mindSearchConfig.services ?? []),
TKMIND_SEARCH_ROUTES_JSON: JSON.stringify(mindSearchConfig.routes ?? {}),
TKMIND_SEARCH_USER_ID: userId ? String(userId) : '',
TKMIND_DEEP_SEARCH_SECRET: process.env.TKMIND_DEEP_SEARCH_SECRET ?? '',
},
available_tools: ['tkmind_search', 'tkmind_read', ...(hasResearchService ? ['tkmind_research'] : [])],
available_tools: [
'tkmind_search',
'tkmind_read',
...(hasResearchService
? ['tkmind_research', 'tkmind_research_status', 'tkmind_research_cancel']
: []),
],
});
}
if (capabilities.excel_analysis) {