@openviking/openclaw-plugin 2026.5.21 → 2026.5.26
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/INSTALL-AGENT.md +355 -355
- package/INSTALL-ZH.md +345 -345
- package/INSTALL.md +362 -362
- package/README.md +338 -338
- package/auto-recall.ts +257 -257
- package/client.ts +939 -939
- package/commands/setup.ts +1002 -1002
- package/config.ts +476 -476
- package/context-engine.ts +1737 -1737
- package/dist/index.js +18 -18
- package/index.ts +1985 -1985
- package/install-manifest.json +47 -47
- package/memory-ranking.ts +267 -267
- package/openclaw.plugin.json +335 -335
- package/package.json +76 -76
- package/process-manager.ts +45 -45
- package/runtime-utils.ts +5 -5
- package/session-transcript-repair.ts +530 -530
- package/skills/install-openviking-memory/SKILL.md +665 -665
- package/text-utils.ts +507 -507
- package/tool-call-id.ts +331 -331
package/dist/index.js
CHANGED
|
@@ -205,13 +205,13 @@ export function parseAddSkillCommandArgs(args) {
|
|
|
205
205
|
timeout: getNumberFlag(parsed.flags, "timeout"),
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
-
export function
|
|
208
|
+
export function parseOVSearchCommandArgs(args) {
|
|
209
209
|
const parsed = parseFlagArgs(args);
|
|
210
|
-
// `/
|
|
210
|
+
// `/ov-search` only accepts a single query string, so positional segments are
|
|
211
211
|
// always re-joined to preserve unquoted multi-word searches.
|
|
212
212
|
const query = parsed.positionals.join(" ").trim();
|
|
213
213
|
if (!query) {
|
|
214
|
-
throw new Error('Usage: /
|
|
214
|
+
throw new Error('Usage: /ov-search "<query>" [--uri URI] [--limit N]');
|
|
215
215
|
}
|
|
216
216
|
return {
|
|
217
217
|
query,
|
|
@@ -482,7 +482,7 @@ const contextEnginePlugin = {
|
|
|
482
482
|
total: memories.length + resources.length + skills.length,
|
|
483
483
|
};
|
|
484
484
|
};
|
|
485
|
-
const
|
|
485
|
+
const formatOVSearchRows = (result) => {
|
|
486
486
|
const truncateSummary = (value, maxChars = 220) => {
|
|
487
487
|
const collapsed = value.replace(/\s+/g, " ").trim();
|
|
488
488
|
if (collapsed.length <= maxChars) {
|
|
@@ -519,7 +519,7 @@ const contextEnginePlugin = {
|
|
|
519
519
|
}),
|
|
520
520
|
];
|
|
521
521
|
};
|
|
522
|
-
const
|
|
522
|
+
const formatOVSearchText = (query, uri, result) => {
|
|
523
523
|
if ((result.total ?? 0) <= 0) {
|
|
524
524
|
const scope = uri ? ` under ${uri}` : "";
|
|
525
525
|
return `No OpenViking resource or skill results found for "${query}"${scope}.`;
|
|
@@ -528,11 +528,11 @@ const contextEnginePlugin = {
|
|
|
528
528
|
const lines = [
|
|
529
529
|
`Found ${result.total ?? 0} OpenViking results for "${query}"${scope}`,
|
|
530
530
|
"",
|
|
531
|
-
...
|
|
531
|
+
...formatOVSearchRows(result),
|
|
532
532
|
].filter((line, index, all) => line || (all[index - 1] && all[index + 1]));
|
|
533
533
|
return lines.join("\n");
|
|
534
534
|
};
|
|
535
|
-
const
|
|
535
|
+
const searchOpenViking = async (input, agentId) => {
|
|
536
536
|
const query = input.query.trim();
|
|
537
537
|
if (!query) {
|
|
538
538
|
throw new Error("query is required");
|
|
@@ -572,7 +572,7 @@ const contextEnginePlugin = {
|
|
|
572
572
|
result = mergeFindResults(successful);
|
|
573
573
|
}
|
|
574
574
|
return {
|
|
575
|
-
content: [{ type: "text", text:
|
|
575
|
+
content: [{ type: "text", text: formatOVSearchText(query, input.uri, result) }],
|
|
576
576
|
details: {
|
|
577
577
|
action: "searched",
|
|
578
578
|
query,
|
|
@@ -639,8 +639,8 @@ const contextEnginePlugin = {
|
|
|
639
639
|
},
|
|
640
640
|
}), { name: "add_skill" });
|
|
641
641
|
api.registerTool((ctx) => ({
|
|
642
|
-
name: "
|
|
643
|
-
label: "
|
|
642
|
+
name: "ov_search",
|
|
643
|
+
label: "Search (OpenViking)",
|
|
644
644
|
description: "Search OpenViking resources and skills. Use after importing, or when the user asks to search OpenViking resources or skills.",
|
|
645
645
|
parameters: Type.Object({
|
|
646
646
|
query: Type.String({ description: "Search query" }),
|
|
@@ -649,16 +649,16 @@ const contextEnginePlugin = {
|
|
|
649
649
|
}),
|
|
650
650
|
async execute(_toolCallId, params) {
|
|
651
651
|
if (isBypassedSession(ctx)) {
|
|
652
|
-
return makeBypassedToolResult("
|
|
652
|
+
return makeBypassedToolResult("ov_search");
|
|
653
653
|
}
|
|
654
654
|
const session = resolvePluginSessionRouting(ctx);
|
|
655
|
-
return
|
|
655
|
+
return searchOpenViking({
|
|
656
656
|
query: String(params.query ?? ""),
|
|
657
657
|
uri: typeof params.uri === "string" ? params.uri : undefined,
|
|
658
658
|
limit: typeof params.limit === "number" ? params.limit : undefined,
|
|
659
659
|
}, session.agentId);
|
|
660
660
|
},
|
|
661
|
-
}), { name: "
|
|
661
|
+
}), { name: "ov_search" });
|
|
662
662
|
api.registerCommand?.({
|
|
663
663
|
name: "add-resource",
|
|
664
664
|
description: "Add a resource into OpenViking.",
|
|
@@ -700,22 +700,22 @@ const contextEnginePlugin = {
|
|
|
700
700
|
},
|
|
701
701
|
});
|
|
702
702
|
api.registerCommand?.({
|
|
703
|
-
name: "
|
|
703
|
+
name: "ov-search",
|
|
704
704
|
description: "Search OpenViking resources and skills.",
|
|
705
705
|
acceptsArgs: true,
|
|
706
706
|
handler: async (ctx) => {
|
|
707
707
|
try {
|
|
708
708
|
if (isBypassedSession(ctx)) {
|
|
709
|
-
const bypassed = makeBypassedToolResult("
|
|
709
|
+
const bypassed = makeBypassedToolResult("ov_search");
|
|
710
710
|
return { text: bypassed.content[0].text, details: bypassed.details };
|
|
711
711
|
}
|
|
712
712
|
const session = resolvePluginSessionRouting(ctx);
|
|
713
|
-
const input =
|
|
714
|
-
const result = await
|
|
713
|
+
const input = parseOVSearchCommandArgs(ctx.args ?? "");
|
|
714
|
+
const result = await searchOpenViking(input, session.agentId);
|
|
715
715
|
return { text: result.content[0].text, details: result.details };
|
|
716
716
|
}
|
|
717
717
|
catch (err) {
|
|
718
|
-
return { text: `OpenViking
|
|
718
|
+
return { text: `OpenViking search failed: ${err instanceof Error ? err.message : String(err)}` };
|
|
719
719
|
}
|
|
720
720
|
},
|
|
721
721
|
});
|