




















@@ -603,6 +603,50 @@ describe("ensureBundledPluginRuntimeDeps", () => {
603603expect(resolveBundledRuntimeDependencyInstallRoot(pluginRoot, { env: {} })).toBe(pluginRoot);
604604});
605605606+it("treats Docker build source trees without .git as source checkouts", () => {
607+const packageRoot = makeTempDir();
608+fs.mkdirSync(path.join(packageRoot, "src"), { recursive: true });
609+fs.writeFileSync(path.join(packageRoot, "pnpm-workspace.yaml"), "packages:\n - .\n");
610+const pluginRoot = path.join(packageRoot, "extensions", "acpx");
611+fs.mkdirSync(pluginRoot, { recursive: true });
612+fs.writeFileSync(
613+path.join(pluginRoot, "package.json"),
614+JSON.stringify({
615+dependencies: {
616+acpx: "0.5.3",
617+},
618+devDependencies: {
619+"@openclaw/plugin-sdk": "workspace:*",
620+},
621+}),
622+);
623+624+const calls: BundledRuntimeDepsInstallParams[] = [];
625+const result = ensureBundledPluginRuntimeDeps({
626+env: {},
627+installDeps: (params) => {
628+calls.push(params);
629+},
630+pluginId: "acpx",
631+ pluginRoot,
632+});
633+634+expect(result).toEqual({
635+installedSpecs: ["acpx@0.5.3"],
636+retainSpecs: ["acpx@0.5.3"],
637+});
638+expect(calls).toEqual([
639+{
640+installRoot: pluginRoot,
641+installExecutionRoot: expect.stringContaining(
642+path.join(".local", "bundled-plugin-runtime-deps"),
643+),
644+missingSpecs: ["acpx@0.5.3"],
645+installSpecs: ["acpx@0.5.3"],
646+},
647+]);
648+});
649+606650it("does not trust package-root runtime deps for source-checkout bundled plugins", () => {
607651const packageRoot = makeTempDir();
608652const stageDir = makeTempDir();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。