
























@@ -32,6 +32,7 @@ import {
3232resolveProviderOwners,
3333resolveSetupProviderOwners,
3434} from "./plugin-registry.js";
35+import { resolvePluginPath } from "./registry.js";
3536import { cleanupTrackedTempDirs, makeTrackedTempDir } from "./test-helpers/fs-fixtures.js";
36373738const tempDirs: string[] = [];
@@ -144,6 +145,27 @@ function createIndex(
144145}
145146146147describe("plugin registry facade", () => {
148+it("resolves relative plugin API paths against the plugin root", () => {
149+const pluginRoot = path.join(makeTempDir(), "plugins", "demo");
150+151+expect(resolvePluginPath("data/cache.json", pluginRoot)).toBe(
152+path.join(pluginRoot, "data", "cache.json"),
153+);
154+expect(resolvePluginPath("./data/cache.json", pluginRoot)).toBe(
155+path.join(pluginRoot, "data", "cache.json"),
156+);
157+});
158+159+it("keeps absolute and home plugin API paths user-resolved", () => {
160+const pluginRoot = path.join(makeTempDir(), "plugins", "demo");
161+const absolute = path.resolve(pluginRoot, "..", "outside.txt");
162+163+expect(resolvePluginPath(absolute, pluginRoot)).toBe(resolvePluginPath(absolute, undefined));
164+expect(resolvePluginPath("~/openclaw/plugin.txt", pluginRoot)).toBe(
165+resolvePluginPath("~/openclaw/plugin.txt", undefined),
166+);
167+});
168+147169it("resolves cold plugin records and contribution owners without loading runtime", () => {
148170const rootDir = makeTempDir();
149171const candidate = createCandidate(rootDir);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。