feat: expand magic notes MCP tools

This commit is contained in:
lofyer
2026-08-10 23:02:45 +08:00
parent cb0319c4d1
commit 5cb99f3097
16 changed files with 1282 additions and 75 deletions
+7 -4
View File
@@ -7,7 +7,10 @@ import type {
} from '../../shared/contracts'
import type { ResolvedMcpServer } from '../capabilities/capability-service'
import type { BrowserToolService } from '../browser/browser-model-tools'
import type { KnowledgeMcpGateway } from './knowledge-mcp-gateway'
import {
scopedReadToolNames,
type KnowledgeMcpGateway
} from './knowledge-mcp-gateway'
import { createAnthropicMessagesUrl } from './anthropic-endpoint'
import {
ModelToolProvider,
@@ -40,6 +43,8 @@ type ConversationMessage = {
content: string
}
const scopedReadToolNameSet = new Set<string>(scopedReadToolNames)
type AnthropicApiMessage = {
role: 'user' | 'assistant'
content:
@@ -1588,9 +1593,7 @@ export class ModelAgentRuntime implements AgentRuntime {
let decision: ApprovalDecision
try {
if (
(tool.name === 'knowledge_list' ||
tool.name === 'knowledge_search' ||
tool.name === 'note_search') &&
scopedReadToolNameSet.has(tool.name) &&
Boolean(request.knowledgeCapabilityToken)
) {
decision = 'once'