refactor: simplify scoped data tools

This commit is contained in:
lofyer
2026-08-13 01:32:43 +08:00
parent 04a260133a
commit fd1ff92927
6 changed files with 450 additions and 678 deletions
+15 -59
View File
@@ -1,5 +1,10 @@
import type { RuntimeTarget } from './capability-contracts'
import {
knowledgeScopedDataTools,
magicNoteScopedDataTools
} from './scoped-data-tools'
export type BuiltinMcpServerSummary = {
id: string
name: string
@@ -21,18 +26,11 @@ export const builtinMcpServers = [
name: '知识库',
description:
'列出并搜索当前对话明确选择的知识库,返回可核验的来源与证据引用。',
tools: [
{
name: 'knowledge_list',
description: '列出当前对话已授权的知识库及其说明。',
access: 'read'
},
{
name: 'knowledge_search',
description: '搜索当前对话已授权的知识库并返回来源引用。',
access: 'read'
}
],
tools: knowledgeScopedDataTools.map(({ name, summary, access }) => ({
name,
description: summary,
access
})),
assignments: ['model', 'opencode', 'continue'],
access: 'read',
authorization: 'conversation-scoped'
@@ -42,53 +40,11 @@ export const builtinMcpServers = [
name: '笔记',
description:
'读取全局魔法笔记,并在 Execute 模式下创建、修改或删除笔记与记录。',
tools: [
{
name: 'note_list',
description: '列出全局魔法笔记及其版本信息。',
access: 'read'
},
{
name: 'note_get',
description: '读取一篇笔记的记录正文与版本信息。',
access: 'read'
},
{
name: 'note_search',
description: '搜索全局魔法笔记中的标题和记录正文。',
access: 'read'
},
{
name: 'note_create',
description: '创建一篇全局魔法笔记。',
access: 'write'
},
{
name: 'note_update',
description: '修改笔记标题或置顶状态。',
access: 'write'
},
{
name: 'note_entry_create',
description: '向指定笔记追加纯文本记录。',
access: 'write'
},
{
name: 'note_entry_update',
description: '使用当前版本修改一条笔记记录。',
access: 'write'
},
{
name: 'note_entry_delete',
description: '永久删除一条笔记记录及其派生待办。',
access: 'write'
},
{
name: 'note_delete',
description: '永久删除整篇笔记、全部记录及派生待办。',
access: 'write'
}
],
tools: magicNoteScopedDataTools.map(({ name, summary, access }) => ({
name,
description: summary,
access
})),
assignments: ['model', 'opencode', 'continue'],
access: 'mixed',
authorization: 'conversation-scoped',