@mclawnet/mcp-server 0.1.0
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/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +55 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/evolution.d.ts +76 -0
- package/dist/tools/evolution.d.ts.map +1 -0
- package/dist/tools/evolution.js +142 -0
- package/dist/tools/evolution.js.map +1 -0
- package/dist/tools/index.d.ts +229 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +26 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/memory.d.ts +137 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +221 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/skill.d.ts +36 -0
- package/dist/tools/skill.d.ts.map +1 -0
- package/dist/tools/skill.js +69 -0
- package/dist/tools/skill.js.map +1 -0
- package/package.json +33 -0
- package/src/__tests__/e2e-memory-pipeline.test.ts +627 -0
- package/src/__tests__/evolution-tools.test.ts +94 -0
- package/src/__tests__/memory-tools.test.ts +259 -0
- package/src/__tests__/skill-tools.test.ts +78 -0
- package/src/index.ts +3 -0
- package/src/server.ts +77 -0
- package/src/tools/evolution.ts +157 -0
- package/src/tools/index.ts +46 -0
- package/src/tools/memory.ts +280 -0
- package/src/tools/skill.ts +79 -0
- package/tsconfig.json +12 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vitest.config.ts +7 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { type EmbeddingService, type MemoryStore } from "@mclawnet/memory";
|
|
2
|
+
export interface MemoryToolContext {
|
|
3
|
+
store: MemoryStore;
|
|
4
|
+
embeddingService: EmbeddingService;
|
|
5
|
+
}
|
|
6
|
+
export declare function getMemoryToolDefinitions(): ({
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object";
|
|
11
|
+
properties: {
|
|
12
|
+
roleId: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
query: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
domain: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
limit: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
crossRole: {
|
|
29
|
+
type: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
content?: undefined;
|
|
33
|
+
type?: undefined;
|
|
34
|
+
tags?: undefined;
|
|
35
|
+
importance?: undefined;
|
|
36
|
+
scope?: undefined;
|
|
37
|
+
};
|
|
38
|
+
required: string[];
|
|
39
|
+
};
|
|
40
|
+
} | {
|
|
41
|
+
name: string;
|
|
42
|
+
description: string;
|
|
43
|
+
inputSchema: {
|
|
44
|
+
type: "object";
|
|
45
|
+
properties: {
|
|
46
|
+
roleId: {
|
|
47
|
+
type: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
content: {
|
|
51
|
+
type: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
type: {
|
|
55
|
+
type: string;
|
|
56
|
+
enum: string[];
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
tags: {
|
|
60
|
+
type: string;
|
|
61
|
+
items: {
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
domain: {
|
|
67
|
+
type: string;
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
importance: {
|
|
71
|
+
type: string;
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
query?: undefined;
|
|
75
|
+
limit?: undefined;
|
|
76
|
+
crossRole?: undefined;
|
|
77
|
+
scope?: undefined;
|
|
78
|
+
};
|
|
79
|
+
required: string[];
|
|
80
|
+
};
|
|
81
|
+
} | {
|
|
82
|
+
name: string;
|
|
83
|
+
description: string;
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: "object";
|
|
86
|
+
properties: {
|
|
87
|
+
roleId: {
|
|
88
|
+
type: string;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
query?: undefined;
|
|
92
|
+
domain?: undefined;
|
|
93
|
+
limit?: undefined;
|
|
94
|
+
crossRole?: undefined;
|
|
95
|
+
content?: undefined;
|
|
96
|
+
type?: undefined;
|
|
97
|
+
tags?: undefined;
|
|
98
|
+
importance?: undefined;
|
|
99
|
+
scope?: undefined;
|
|
100
|
+
};
|
|
101
|
+
required: string[];
|
|
102
|
+
};
|
|
103
|
+
} | {
|
|
104
|
+
name: string;
|
|
105
|
+
description: string;
|
|
106
|
+
inputSchema: {
|
|
107
|
+
type: "object";
|
|
108
|
+
properties: {
|
|
109
|
+
roleId: {
|
|
110
|
+
type: string;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
scope: {
|
|
114
|
+
type: string;
|
|
115
|
+
enum: string[];
|
|
116
|
+
description: string;
|
|
117
|
+
};
|
|
118
|
+
query?: undefined;
|
|
119
|
+
domain?: undefined;
|
|
120
|
+
limit?: undefined;
|
|
121
|
+
crossRole?: undefined;
|
|
122
|
+
content?: undefined;
|
|
123
|
+
type?: undefined;
|
|
124
|
+
tags?: undefined;
|
|
125
|
+
importance?: undefined;
|
|
126
|
+
};
|
|
127
|
+
required: string[];
|
|
128
|
+
};
|
|
129
|
+
})[];
|
|
130
|
+
export declare function handleMemoryToolCall(name: string, args: Record<string, unknown>, context: MemoryToolContext): Promise<{
|
|
131
|
+
content: Array<{
|
|
132
|
+
type: "text";
|
|
133
|
+
text: string;
|
|
134
|
+
}>;
|
|
135
|
+
isError?: boolean;
|
|
136
|
+
}>;
|
|
137
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/tools/memory.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAEjB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,WAAW,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED,wBAAgB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4EvC;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CA2BhF"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { createLogger } from "@mclawnet/logger";
|
|
2
|
+
import { EWCGuard, pruneMemories, recalculateAllImportance, storeWithFusion, } from "@mclawnet/memory";
|
|
3
|
+
const log = createLogger({ module: "mcp-server/tools/memory" });
|
|
4
|
+
export function getMemoryToolDefinitions() {
|
|
5
|
+
return [
|
|
6
|
+
{
|
|
7
|
+
name: "memory_search",
|
|
8
|
+
description: "Search role memories by semantic similarity. Returns the most relevant past experiences, patterns, and lessons.",
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object",
|
|
11
|
+
properties: {
|
|
12
|
+
roleId: { type: "string", description: "Role ID for memory scope" },
|
|
13
|
+
query: { type: "string", description: "Natural language search query" },
|
|
14
|
+
domain: { type: "string", description: "Filter by domain label" },
|
|
15
|
+
limit: { type: "number", description: "Max results to return (default 5)" },
|
|
16
|
+
crossRole: { type: "boolean", description: "Search across all roles (ignore roleId filter)" },
|
|
17
|
+
},
|
|
18
|
+
required: ["roleId", "query"],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "memory_store",
|
|
23
|
+
description: "Store a new memory entry for the specified role. Use this to persist valuable experiences, patterns, error lessons, or preferences.",
|
|
24
|
+
inputSchema: {
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
roleId: { type: "string", description: "Role ID for memory scope" },
|
|
28
|
+
content: { type: "string", description: "Memory content in natural language" },
|
|
29
|
+
type: {
|
|
30
|
+
type: "string",
|
|
31
|
+
enum: ["experience", "pattern", "error", "preference"],
|
|
32
|
+
description: "Type of memory",
|
|
33
|
+
},
|
|
34
|
+
tags: {
|
|
35
|
+
type: "array",
|
|
36
|
+
items: { type: "string" },
|
|
37
|
+
description: "Tags for categorisation",
|
|
38
|
+
},
|
|
39
|
+
domain: { type: "string", description: "Domain label (e.g. 'frontend', 'backend')" },
|
|
40
|
+
importance: {
|
|
41
|
+
type: "number",
|
|
42
|
+
description: "Importance score 0-1 (default 0.5)",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
required: ["roleId", "content", "type"],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "memory_stats",
|
|
50
|
+
description: "Get memory statistics for the specified role: total count, breakdown by type/level, top domains.",
|
|
51
|
+
inputSchema: {
|
|
52
|
+
type: "object",
|
|
53
|
+
properties: {
|
|
54
|
+
roleId: { type: "string", description: "Role ID for memory scope" },
|
|
55
|
+
},
|
|
56
|
+
required: ["roleId"],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "memory_reflect",
|
|
61
|
+
description: "Trigger a reflection pass over recent memories to consolidate patterns and prune low-value entries.",
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
roleId: { type: "string", description: "Role ID for memory scope" },
|
|
66
|
+
scope: {
|
|
67
|
+
type: "string",
|
|
68
|
+
enum: ["light", "full"],
|
|
69
|
+
description: "Reflection depth: light (quick) or full (thorough)",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
required: ["roleId"],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
export async function handleMemoryToolCall(name, args, context) {
|
|
78
|
+
try {
|
|
79
|
+
const roleId = args.roleId;
|
|
80
|
+
log.info({ tool: name, roleId }, "MCP tool called");
|
|
81
|
+
switch (name) {
|
|
82
|
+
case "memory_search":
|
|
83
|
+
return await handleMemorySearch(args, context);
|
|
84
|
+
case "memory_store":
|
|
85
|
+
return await handleMemoryStore(args, context);
|
|
86
|
+
case "memory_stats":
|
|
87
|
+
return await handleMemoryStats(args, context);
|
|
88
|
+
case "memory_reflect":
|
|
89
|
+
return await handleMemoryReflect(args, context);
|
|
90
|
+
default:
|
|
91
|
+
return {
|
|
92
|
+
content: [{ type: "text", text: JSON.stringify({ error: `Unknown tool: ${name}` }) }],
|
|
93
|
+
isError: true,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
99
|
+
log.error({ tool: name, err }, "MCP tool error");
|
|
100
|
+
return {
|
|
101
|
+
content: [{ type: "text", text: JSON.stringify({ error: message }) }],
|
|
102
|
+
isError: true,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async function handleMemorySearch(args, context) {
|
|
107
|
+
const query = args.query;
|
|
108
|
+
const crossRole = args.crossRole;
|
|
109
|
+
const roleId = crossRole ? undefined : args.roleId;
|
|
110
|
+
const domain = args.domain;
|
|
111
|
+
const limit = args.limit ?? 5;
|
|
112
|
+
const queryEmbedding = await context.embeddingService.embed(query);
|
|
113
|
+
const results = context.store.searchMemories(queryEmbedding, {
|
|
114
|
+
roleId,
|
|
115
|
+
domain,
|
|
116
|
+
limit,
|
|
117
|
+
crossRole,
|
|
118
|
+
});
|
|
119
|
+
const serialisable = results.map((m) => ({
|
|
120
|
+
id: m.id,
|
|
121
|
+
roleId: m.roleId,
|
|
122
|
+
content: m.content,
|
|
123
|
+
type: m.type,
|
|
124
|
+
level: m.level,
|
|
125
|
+
tags: m.tags,
|
|
126
|
+
domain: m.domain,
|
|
127
|
+
importance: m.importance,
|
|
128
|
+
accessCount: m.accessCount,
|
|
129
|
+
createdAt: m.createdAt,
|
|
130
|
+
}));
|
|
131
|
+
log.info({ query, roleId: args.roleId, crossRole, resultCount: serialisable.length }, "memory_search completed");
|
|
132
|
+
return {
|
|
133
|
+
content: [{ type: "text", text: JSON.stringify(serialisable, null, 2) }],
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
async function handleMemoryStore(args, context) {
|
|
137
|
+
const roleId = args.roleId;
|
|
138
|
+
const content = args.content;
|
|
139
|
+
const type = args.type;
|
|
140
|
+
const tags = args.tags ?? [];
|
|
141
|
+
const domain = args.domain;
|
|
142
|
+
const importance = args.importance;
|
|
143
|
+
const result = await storeWithFusion(context.store, context.embeddingService, {
|
|
144
|
+
roleId,
|
|
145
|
+
content,
|
|
146
|
+
type,
|
|
147
|
+
level: "long-term",
|
|
148
|
+
tags,
|
|
149
|
+
domain,
|
|
150
|
+
importance,
|
|
151
|
+
});
|
|
152
|
+
log.info({ id: result.memory.id, roleId, type, domain, importance, fusionAction: result.fusionAction }, "memory_store completed");
|
|
153
|
+
return {
|
|
154
|
+
content: [
|
|
155
|
+
{
|
|
156
|
+
type: "text",
|
|
157
|
+
text: JSON.stringify({
|
|
158
|
+
success: true,
|
|
159
|
+
id: result.memory.id,
|
|
160
|
+
fusionAction: result.fusionAction,
|
|
161
|
+
}),
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
async function handleMemoryStats(args, context) {
|
|
167
|
+
const roleId = args.roleId;
|
|
168
|
+
const stats = context.store.getStats(roleId);
|
|
169
|
+
return {
|
|
170
|
+
content: [{ type: "text", text: JSON.stringify(stats, null, 2) }],
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
async function handleMemoryReflect(args, context) {
|
|
174
|
+
const roleId = args.roleId;
|
|
175
|
+
const scope = args.scope ?? "light";
|
|
176
|
+
const db = context.store.getDb();
|
|
177
|
+
const vectorIndex = context.store.getVectorIndex();
|
|
178
|
+
if (scope === "light") {
|
|
179
|
+
const pruneResult = pruneMemories(roleId, db, vectorIndex);
|
|
180
|
+
log.info({ roleId, scope, ...pruneResult }, "memory_reflect completed");
|
|
181
|
+
return {
|
|
182
|
+
content: [{ type: "text", text: JSON.stringify({ scope, ...pruneResult }) }],
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
// scope === "full": re-embed if needed + recalculate all + prune all roles
|
|
186
|
+
const reembedResult = await context.store.reembedAll(context.embeddingService);
|
|
187
|
+
const recalculated = recalculateAllImportance(db);
|
|
188
|
+
const roleIds = db.prepare("SELECT DISTINCT role_id FROM memories").all().map((r) => r.role_id);
|
|
189
|
+
let totalDemotedToLongTerm = 0;
|
|
190
|
+
let totalDemotedToArchived = 0;
|
|
191
|
+
let totalDeleted = 0;
|
|
192
|
+
for (const rid of roleIds) {
|
|
193
|
+
const r = pruneMemories(rid, db, vectorIndex);
|
|
194
|
+
totalDemotedToLongTerm += r.demotedToLongTerm;
|
|
195
|
+
totalDemotedToArchived += r.demotedToArchived;
|
|
196
|
+
totalDeleted += r.deleted;
|
|
197
|
+
}
|
|
198
|
+
const ewcGuard = new EWCGuard(db);
|
|
199
|
+
let profilesRefreshed = 0;
|
|
200
|
+
for (const rid of roleIds) {
|
|
201
|
+
const profile = ewcGuard.computeProfile(rid);
|
|
202
|
+
if (profile)
|
|
203
|
+
profilesRefreshed++;
|
|
204
|
+
}
|
|
205
|
+
const result = {
|
|
206
|
+
scope,
|
|
207
|
+
reembedded: reembedResult.updated,
|
|
208
|
+
reembedFailed: reembedResult.failed,
|
|
209
|
+
recalculated,
|
|
210
|
+
rolesProcessed: roleIds.length,
|
|
211
|
+
demotedToLongTerm: totalDemotedToLongTerm,
|
|
212
|
+
demotedToArchived: totalDemotedToArchived,
|
|
213
|
+
deleted: totalDeleted,
|
|
214
|
+
profilesRefreshed,
|
|
215
|
+
};
|
|
216
|
+
log.info(result, "memory_reflect completed");
|
|
217
|
+
return {
|
|
218
|
+
content: [{ type: "text", text: JSON.stringify(result) }],
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/tools/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACL,QAAQ,EACR,aAAa,EACb,wBAAwB,EACxB,eAAe,GAIhB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;AAOhE,MAAM,UAAU,wBAAwB;IACtC,OAAO;QACL;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EACT,iHAAiH;YACnH,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE;oBACnE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE;oBACvE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;oBACjE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EAAE,CAAC;IACnC,CAAC;IAED,MAAM,MAAM,GAAG;QACb,KAAK;QACL,UAAU,EAAE,aAAa,CAAC,OAAO;QACjC,aAAa,EAAE,aAAa,CAAC,MAAM;QACnC,YAAY;QACZ,cAAc,EAAE,OAAO,CAAC,MAAM;QAC9B,iBAAiB,EAAE,sBAAsB;QACzC,iBAAiB,EAAE,sBAAsB;QACzC,OAAO,EAAE,YAAY;QACrB,iBAAiB;KAClB,CAAC;IAEF,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IAC7C,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;KAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SkillStore } from "@mclawnet/skill-manager";
|
|
2
|
+
export interface SkillToolContext {
|
|
3
|
+
store: SkillStore;
|
|
4
|
+
}
|
|
5
|
+
export declare function getSkillToolDefinitions(): ({
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object";
|
|
10
|
+
properties: {
|
|
11
|
+
name?: undefined;
|
|
12
|
+
};
|
|
13
|
+
required?: undefined;
|
|
14
|
+
};
|
|
15
|
+
} | {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: "object";
|
|
20
|
+
properties: {
|
|
21
|
+
name: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
required: string[];
|
|
27
|
+
};
|
|
28
|
+
})[];
|
|
29
|
+
export declare function handleSkillToolCall(name: string, args: Record<string, unknown>, context: SkillToolContext): Promise<{
|
|
30
|
+
content: Array<{
|
|
31
|
+
type: "text";
|
|
32
|
+
text: string;
|
|
33
|
+
}>;
|
|
34
|
+
isError?: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=skill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/tools/skill.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAI1D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,wBAAgB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;KAsBtC;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAyChF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createLogger } from "@mclawnet/logger";
|
|
2
|
+
const logger = createLogger({ module: "mcp-server/tools/skill" });
|
|
3
|
+
export function getSkillToolDefinitions() {
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
name: "skill_list",
|
|
7
|
+
description: "列出所有已安装的技能(skill)。用于了解当前可用的专业能力。",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "skill_read",
|
|
15
|
+
description: "读取指定技能的完整内容。",
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
name: { type: "string", description: "技能名称(kebab-case)" },
|
|
20
|
+
},
|
|
21
|
+
required: ["name"],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
export async function handleSkillToolCall(name, args, context) {
|
|
27
|
+
try {
|
|
28
|
+
switch (name) {
|
|
29
|
+
case "skill_list": {
|
|
30
|
+
const skills = context.store.scan();
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{ type: "text", text: JSON.stringify({ skills, total: skills.length }) },
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
case "skill_read": {
|
|
38
|
+
const skillName = args.name;
|
|
39
|
+
if (!skillName) {
|
|
40
|
+
return {
|
|
41
|
+
content: [{ type: "text", text: JSON.stringify({ error: "Missing 'name' argument" }) }],
|
|
42
|
+
isError: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const content = context.store.readSkill(skillName);
|
|
46
|
+
if (!content) {
|
|
47
|
+
return {
|
|
48
|
+
content: [{ type: "text", text: JSON.stringify({ error: `Skill "${skillName}" not found` }) }],
|
|
49
|
+
isError: true,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return { content: [{ type: "text", text: content }] };
|
|
53
|
+
}
|
|
54
|
+
default:
|
|
55
|
+
return {
|
|
56
|
+
content: [{ type: "text", text: JSON.stringify({ error: `Unknown skill tool: ${name}` }) }],
|
|
57
|
+
isError: true,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
logger.error({ err, tool: name }, "Skill tool error");
|
|
63
|
+
return {
|
|
64
|
+
content: [{ type: "text", text: JSON.stringify({ error: String(err) }) }],
|
|
65
|
+
isError: true,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../src/tools/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGh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
|
6
|
+
".": {
|
|
7
|
+
"import": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts"
|
|
9
|
+
},
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"bin": {
|
|
13
|
+
"clawnet-mcp": "dist/server.js"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
17
|
+
"@mclawnet/logger": "0.1.2",
|
|
18
|
+
"@mclawnet/skill-manager": "0.1.0",
|
|
19
|
+
"@mclawnet/memory": "0.1.1"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/better-sqlite3": "^7",
|
|
23
|
+
"@types/node": "^22.0.0",
|
|
24
|
+
"better-sqlite3": "^11.0.0",
|
|
25
|
+
"typescript": "^5.8.0",
|
|
26
|
+
"vitest": "^4.0.18"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc",
|
|
30
|
+
"clean": "rm -rf dist",
|
|
31
|
+
"test": "vitest run"
|
|
32
|
+
}
|
|
33
|
+
}
|