@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/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 parseMemorySearchCommandArgs(args) {
208
+ export function parseOVSearchCommandArgs(args) {
209
209
  const parsed = parseFlagArgs(args);
210
- // `/memory-search` only accepts a single query string, so positional segments are
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: /memory-search "<query>" [--uri URI] [--limit N]');
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 formatMemorySearchRows = (result) => {
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 formatMemorySearchText = (query, uri, result) => {
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
- ...formatMemorySearchRows(result),
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 memorySearchOpenViking = async (input, agentId) => {
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: formatMemorySearchText(query, input.uri, result) }],
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: "memory_search",
643
- label: "Memory Search (OpenViking)",
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("memory_search");
652
+ return makeBypassedToolResult("ov_search");
653
653
  }
654
654
  const session = resolvePluginSessionRouting(ctx);
655
- return memorySearchOpenViking({
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: "memory_search" });
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: "memory-search",
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("memory_search");
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 = parseMemorySearchCommandArgs(ctx.args ?? "");
714
- const result = await memorySearchOpenViking(input, session.agentId);
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 memory search failed: ${err instanceof Error ? err.message : String(err)}` };
718
+ return { text: `OpenViking search failed: ${err instanceof Error ? err.message : String(err)}` };
719
719
  }
720
720
  },
721
721
  });