@fanchao8609/agent_brain_sync 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mcp.js +17 -9
- package/package.json +1 -1
package/bin/mcp.js
CHANGED
|
@@ -59,8 +59,16 @@ const server = new McpServer({
|
|
|
59
59
|
version: pkgVersion(),
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
+
// 统一注册入口(总是经 withTrace)。
|
|
63
|
+
// 坑: 以前 9 处工具各自直接调 server.tool(...) 而不包 withTrace, 导致 withTrace 定义了
|
|
64
|
+
// 但从未被调用 → mcp.log 永远不生成。可观测性静默缺失(无任何症状), 藏了很久。
|
|
65
|
+
// 现在工具只经本函数注册, 包 trace 这件事无法再被遗漏。
|
|
66
|
+
function tool(name, description, schema, handler) {
|
|
67
|
+
server.tool(name, description, schema, withTrace(name, handler));
|
|
68
|
+
}
|
|
69
|
+
|
|
62
70
|
// 工具面(narrow on purpose — 只暴露读/查/记状态,不做深提炼)
|
|
63
|
-
|
|
71
|
+
tool(
|
|
64
72
|
'abs_resolve_project',
|
|
65
73
|
'定位当前项目的 .brain 图谱根(从给定目录向上找最近 .brain/)。多项目隔离的唯一入口。',
|
|
66
74
|
{ cwd: z.string().describe('当前工作目录,默认进程 cwd') },
|
|
@@ -73,7 +81,7 @@ server.tool(
|
|
|
73
81
|
}
|
|
74
82
|
);
|
|
75
83
|
|
|
76
|
-
|
|
84
|
+
tool(
|
|
77
85
|
'abs_board',
|
|
78
86
|
'读取当前项目 todo 看板(含断点/Next-Step)。先 resolve 得到项目,再传其根目录。',
|
|
79
87
|
{ cwd: z.string().describe('项目内任意目录') },
|
|
@@ -84,7 +92,7 @@ server.tool(
|
|
|
84
92
|
}
|
|
85
93
|
);
|
|
86
94
|
|
|
87
|
-
|
|
95
|
+
tool(
|
|
88
96
|
'abs_load',
|
|
89
97
|
'开机读状态:index 路线 + todo 看板 + 最近 log。跨会话续接的入口。',
|
|
90
98
|
{ cwd: z.string().describe('项目内任意目录') },
|
|
@@ -95,7 +103,7 @@ server.tool(
|
|
|
95
103
|
}
|
|
96
104
|
);
|
|
97
105
|
|
|
98
|
-
|
|
106
|
+
tool(
|
|
99
107
|
'abs_task',
|
|
100
108
|
'任务实时落盘(幂等键 = id)。add/start 登记 / note 补断点(改到哪个文件哪行) / blocked 碰壁 / done 完成归位。',
|
|
101
109
|
{
|
|
@@ -113,7 +121,7 @@ server.tool(
|
|
|
113
121
|
}
|
|
114
122
|
);
|
|
115
123
|
|
|
116
|
-
|
|
124
|
+
tool(
|
|
117
125
|
'abs_status',
|
|
118
126
|
'当前项目 + 图谱概要(各类页数)。',
|
|
119
127
|
{ cwd: z.string().describe('项目内任意目录') },
|
|
@@ -124,7 +132,7 @@ server.tool(
|
|
|
124
132
|
}
|
|
125
133
|
);
|
|
126
134
|
|
|
127
|
-
|
|
135
|
+
tool(
|
|
128
136
|
'abs_query',
|
|
129
137
|
'检索当前项目 .brain/ 知识页(多词 OR):以前踩过什么坑、哪页记了 X。',
|
|
130
138
|
{ cwd: z.string().describe('项目内任意目录'), terms: z.array(z.string()).min(1).describe('检索词') },
|
|
@@ -135,7 +143,7 @@ server.tool(
|
|
|
135
143
|
}
|
|
136
144
|
);
|
|
137
145
|
|
|
138
|
-
|
|
146
|
+
tool(
|
|
139
147
|
'abs_lint',
|
|
140
148
|
'图谱体检:死链/孤岛/缺 frontmatter/超尺寸/sources 堆积/index 漏列。',
|
|
141
149
|
{ cwd: z.string().describe('项目内任意目录') },
|
|
@@ -146,7 +154,7 @@ server.tool(
|
|
|
146
154
|
}
|
|
147
155
|
);
|
|
148
156
|
|
|
149
|
-
|
|
157
|
+
tool(
|
|
150
158
|
'abs_note',
|
|
151
159
|
'经验实时暂存:把刚踩的坑/技巧/结论一句话落进 sources/(防 context 断了流失)。Teardown 时再提炼进 concepts/。',
|
|
152
160
|
{
|
|
@@ -161,7 +169,7 @@ server.tool(
|
|
|
161
169
|
}
|
|
162
170
|
);
|
|
163
171
|
|
|
164
|
-
|
|
172
|
+
tool(
|
|
165
173
|
'abs_wrapup',
|
|
166
174
|
'收尾保险:把当前 todo 未完成任务快照到 ~/.abs/log/wrapup.log(下会话 load 时展示滞留对账)。',
|
|
167
175
|
{ cwd: z.string().describe('项目内任意目录') },
|