




















@@ -6231,6 +6231,91 @@ module.exports = {
62316231expectDuplicateWarning: false,
62326232assert: expectPluginSourcePrecedence,
62336233},
6234+{
6235+label: "transient installed memory plugin beats bundled duplicate",
6236+pluginId: "memory-lancedb",
6237+bundledFilename: "index.cjs",
6238+loadRegistry: () => {
6239+writeBundledPlugin({
6240+id: "memory-lancedb",
6241+body: memoryPluginBody("memory-lancedb"),
6242+});
6243+return withStateDir((stateDir) => {
6244+const globalDir = path.join(stateDir, "node_modules", "@openclaw", "memory-lancedb");
6245+mkdirSafe(globalDir);
6246+const globalPlugin = writePlugin({
6247+id: "memory-lancedb",
6248+body: `module.exports = {
6249+ id: "memory-lancedb",
6250+ kind: "memory",
6251+ register(api) {
6252+ api.registerTool({
6253+ name: "memory_recall",
6254+ description: "Recall memories",
6255+ parameters: {},
6256+ execute: async () => ({ content: [{ type: "text", text: "ok" }] }),
6257+ });
6258+ },
6259+ };`,
6260+dir: globalDir,
6261+filename: "index.cjs",
6262+});
6263+updatePluginManifest(globalPlugin, {
6264+kind: "memory",
6265+contracts: { tools: ["memory_recall"] },
6266+});
6267+fs.writeFileSync(
6268+path.join(globalDir, "package.json"),
6269+JSON.stringify(
6270+{
6271+name: "@openclaw/memory-lancedb",
6272+version: "2026.5.12-beta.1",
6273+openclaw: { extensions: ["./index.cjs"] },
6274+},
6275+null,
6276+2,
6277+),
6278+"utf-8",
6279+);
6280+6281+return loadOpenClawPlugins({
6282+cache: false,
6283+config: {
6284+plugins: {
6285+allow: ["memory-lancedb"],
6286+slots: { memory: "memory-lancedb" },
6287+entries: {
6288+"memory-lancedb": { enabled: true },
6289+},
6290+installs: {
6291+"memory-lancedb": {
6292+source: "npm",
6293+spec: "@openclaw/memory-lancedb",
6294+resolvedName: "@openclaw/memory-lancedb",
6295+resolvedVersion: "2026.5.12-beta.1",
6296+installPath: globalDir,
6297+},
6298+},
6299+},
6300+},
6301+});
6302+});
6303+},
6304+expectedLoadedOrigin: "global",
6305+expectedDisabledOrigin: "bundled",
6306+expectedDisabledError: "overridden by global plugin",
6307+expectDuplicateWarning: false,
6308+assert: (
6309+registry: PluginRegistry,
6310+scenario: Parameters<typeof expectPluginSourcePrecedence>[1],
6311+) => {
6312+expectPluginSourcePrecedence(registry, scenario);
6313+expect(
6314+registry.tools.flatMap((entry) => entry.names),
6315+scenario.label,
6316+).toContain("memory_recall");
6317+},
6318+},
62346319] as const;
6235632062366321runRegistryScenarios(scenarios, (scenario) => scenario.loadRegistry());
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。