@minns/openclaw-minns 0.6.5 → 0.6.6
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.js +5 -5
- package/dist/tools.js +22 -22
- package/openclaw.plugin.json +0 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ export default {
|
|
|
55
55
|
return { text: "pong" };
|
|
56
56
|
if (arg === "health") {
|
|
57
57
|
try {
|
|
58
|
-
const result = await dispatch(minnsClient, "
|
|
58
|
+
const result = await dispatch(minnsClient, "health_check", {});
|
|
59
59
|
return { text: JSON.stringify(result, null, 2) };
|
|
60
60
|
}
|
|
61
61
|
catch (err) {
|
|
@@ -114,7 +114,7 @@ export default {
|
|
|
114
114
|
const parts = [];
|
|
115
115
|
const queryId = `recall_${Date.now()}`;
|
|
116
116
|
try {
|
|
117
|
-
const memories = await dispatch(minnsClient, "
|
|
117
|
+
const memories = await dispatch(minnsClient, "memory_search", {
|
|
118
118
|
query: prompt,
|
|
119
119
|
limit: cfg.topK,
|
|
120
120
|
agent_id: OBS_AGENT_ID,
|
|
@@ -378,7 +378,7 @@ export default {
|
|
|
378
378
|
.option("--limit <n>", "Max results", String(cfg.topK))
|
|
379
379
|
.action(async (query, opts) => {
|
|
380
380
|
try {
|
|
381
|
-
const result = await dispatch(minnsClient, "
|
|
381
|
+
const result = await dispatch(minnsClient, "memory_search", {
|
|
382
382
|
query,
|
|
383
383
|
limit: parseInt(opts.limit, 10),
|
|
384
384
|
agent_id: OBS_AGENT_ID,
|
|
@@ -394,7 +394,7 @@ export default {
|
|
|
394
394
|
.description("Show system statistics")
|
|
395
395
|
.action(async () => {
|
|
396
396
|
try {
|
|
397
|
-
const result = await dispatch(minnsClient, "
|
|
397
|
+
const result = await dispatch(minnsClient, "stats_get", {});
|
|
398
398
|
console.log(JSON.stringify(result, null, 2));
|
|
399
399
|
}
|
|
400
400
|
catch (err) {
|
|
@@ -406,7 +406,7 @@ export default {
|
|
|
406
406
|
.description("Check EventGraphDB health")
|
|
407
407
|
.action(async () => {
|
|
408
408
|
try {
|
|
409
|
-
const result = await dispatch(minnsClient, "
|
|
409
|
+
const result = await dispatch(minnsClient, "health_check", {});
|
|
410
410
|
console.log(JSON.stringify(result, null, 2));
|
|
411
411
|
}
|
|
412
412
|
catch (err) {
|
package/dist/tools.js
CHANGED
|
@@ -156,57 +156,57 @@ function zodFieldToJson(field) {
|
|
|
156
156
|
// ---------------------------------------------------------------------------
|
|
157
157
|
export const TOOL_DEFS = [
|
|
158
158
|
{
|
|
159
|
-
name: "
|
|
159
|
+
name: "memory_search",
|
|
160
160
|
description: "Search memories by semantic similarity to a query string. Returns the most relevant memories.",
|
|
161
161
|
inputSchema: zodToJsonSchema(MemorySearchSchema),
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
|
-
name: "
|
|
164
|
+
name: "memory_capture",
|
|
165
165
|
description: "Capture a new memory via the fluent event builder. Sends a Context event with semantic indexing enabled. Optionally attach goals.",
|
|
166
166
|
inputSchema: zodToJsonSchema(MemoryCaptureSchema),
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
|
-
name: "
|
|
169
|
+
name: "memory_memories",
|
|
170
170
|
description: "List memories for a specific agent, sorted by strength.",
|
|
171
171
|
inputSchema: zodToJsonSchema(MemoryMemoriesSchema),
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
|
-
name: "
|
|
174
|
+
name: "memory_strategies",
|
|
175
175
|
description: "List strategies learned by a specific agent, sorted by quality score.",
|
|
176
176
|
inputSchema: zodToJsonSchema(MemoryStrategiesSchema),
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
|
-
name: "
|
|
179
|
+
name: "strategy_similar",
|
|
180
180
|
description: "Find strategies similar to a given signature (goals, tools, results, context).",
|
|
181
181
|
inputSchema: zodToJsonSchema(StrategySimilarSchema),
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
|
-
name: "
|
|
184
|
+
name: "strategy_suggest_next_action",
|
|
185
185
|
description: "Get action suggestions for a context hash based on learned strategies.",
|
|
186
186
|
inputSchema: zodToJsonSchema(StrategySuggestSchema),
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
|
-
name: "
|
|
189
|
+
name: "claims_search",
|
|
190
190
|
description: "Search claims extracted from events via semantic similarity.",
|
|
191
191
|
inputSchema: zodToJsonSchema(ClaimsSearchSchema),
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
|
-
name: "
|
|
194
|
+
name: "stats_get",
|
|
195
195
|
description: "Get system-wide statistics about EventGraphDB.",
|
|
196
196
|
inputSchema: zodToJsonSchema(StatsGetSchema),
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
|
-
name: "
|
|
199
|
+
name: "health_check",
|
|
200
200
|
description: "Health check -- verify that EventGraphDB is running.",
|
|
201
201
|
inputSchema: zodToJsonSchema(HealthCheckSchema),
|
|
202
202
|
},
|
|
203
203
|
{
|
|
204
|
-
name: "
|
|
204
|
+
name: "intent_instruction",
|
|
205
205
|
description: "Get the sidecar instruction prompt for a given agent type. Inject this into your system prompt so the LLM outputs structured intent JSON alongside its response.",
|
|
206
206
|
inputSchema: zodToJsonSchema(IntentInstructionSchema),
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
|
-
name: "
|
|
209
|
+
name: "intent_parse",
|
|
210
210
|
description: "Parse raw LLM output into a structured intent + assistant response using the sidecar extractor. Returns the parsed intent (with slots, goal_updates, claims_hint) and the clean assistant text.",
|
|
211
211
|
inputSchema: zodToJsonSchema(IntentParseSchema),
|
|
212
212
|
},
|
|
@@ -223,7 +223,7 @@ function resolveSpec(agentType, goals) {
|
|
|
223
223
|
export async function dispatch(client, toolName, rawArgs) {
|
|
224
224
|
switch (toolName) {
|
|
225
225
|
// ---- Memory tools ---------------------------------------------------
|
|
226
|
-
case "
|
|
226
|
+
case "memory_search": {
|
|
227
227
|
const args = MemorySearchSchema.parse(rawArgs);
|
|
228
228
|
// Use the fluent builder to construct a minimal search context,
|
|
229
229
|
// then extract the built EventContext for the query API.
|
|
@@ -242,7 +242,7 @@ export async function dispatch(client, toolName, rawArgs) {
|
|
|
242
242
|
session_id: args.session_id,
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
-
case "
|
|
245
|
+
case "memory_capture": {
|
|
246
246
|
const args = MemoryCaptureSchema.parse(rawArgs);
|
|
247
247
|
const builder = client
|
|
248
248
|
.event(args.agent_type, {
|
|
@@ -261,16 +261,16 @@ export async function dispatch(client, toolName, rawArgs) {
|
|
|
261
261
|
}
|
|
262
262
|
return builder.send();
|
|
263
263
|
}
|
|
264
|
-
case "
|
|
264
|
+
case "memory_memories": {
|
|
265
265
|
const args = MemoryMemoriesSchema.parse(rawArgs);
|
|
266
266
|
return client.getAgentMemories(args.agent_id, args.limit);
|
|
267
267
|
}
|
|
268
|
-
case "
|
|
268
|
+
case "memory_strategies": {
|
|
269
269
|
const args = MemoryStrategiesSchema.parse(rawArgs);
|
|
270
270
|
return client.getAgentStrategies(args.agent_id, args.limit);
|
|
271
271
|
}
|
|
272
272
|
// ---- Strategy tools -------------------------------------------------
|
|
273
|
-
case "
|
|
273
|
+
case "strategy_similar": {
|
|
274
274
|
const args = StrategySimilarSchema.parse(rawArgs);
|
|
275
275
|
return client.getSimilarStrategies({
|
|
276
276
|
agent_id: args.agent_id,
|
|
@@ -282,12 +282,12 @@ export async function dispatch(client, toolName, rawArgs) {
|
|
|
282
282
|
limit: args.limit,
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
|
-
case "
|
|
285
|
+
case "strategy_suggest_next_action": {
|
|
286
286
|
const args = StrategySuggestSchema.parse(rawArgs);
|
|
287
287
|
return client.getActionSuggestions(args.context_hash, args.last_action_node, args.limit);
|
|
288
288
|
}
|
|
289
289
|
// ---- Claims ---------------------------------------------------------
|
|
290
|
-
case "
|
|
290
|
+
case "claims_search": {
|
|
291
291
|
const args = ClaimsSearchSchema.parse(rawArgs);
|
|
292
292
|
return client.searchClaims({
|
|
293
293
|
query_text: args.query_text,
|
|
@@ -296,16 +296,16 @@ export async function dispatch(client, toolName, rawArgs) {
|
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
// ---- System ---------------------------------------------------------
|
|
299
|
-
case "
|
|
299
|
+
case "stats_get": {
|
|
300
300
|
StatsGetSchema.parse(rawArgs);
|
|
301
301
|
return client.getStats();
|
|
302
302
|
}
|
|
303
|
-
case "
|
|
303
|
+
case "health_check": {
|
|
304
304
|
HealthCheckSchema.parse(rawArgs);
|
|
305
305
|
return client.healthCheck();
|
|
306
306
|
}
|
|
307
307
|
// ---- Intent sidecar tools -------------------------------------------
|
|
308
|
-
case "
|
|
308
|
+
case "intent_instruction": {
|
|
309
309
|
const args = IntentInstructionSchema.parse(rawArgs);
|
|
310
310
|
const spec = resolveSpec(args.agent_type, args.goals);
|
|
311
311
|
return {
|
|
@@ -314,7 +314,7 @@ export async function dispatch(client, toolName, rawArgs) {
|
|
|
314
314
|
intents: spec.intents.map((i) => i.name),
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
|
-
case "
|
|
317
|
+
case "intent_parse": {
|
|
318
318
|
const args = IntentParseSchema.parse(rawArgs);
|
|
319
319
|
const spec = resolveSpec(args.agent_type, args.goals);
|
|
320
320
|
const { intent, assistantResponse } = extractIntentAndResponse(args.model_text, args.user_message, spec);
|
package/openclaw.plugin.json
CHANGED