From fb52a989b22b0123b4df7211931919f19d33a4f7 Mon Sep 17 00:00:00 2001 From: pengxuewu-lab Date: Thu, 9 Jul 2026 19:20:18 +0800 Subject: [PATCH] fix(plugin-sdk): update ssrf-runtime import path in cdp-proxy-bypass (#96994) * fix(plugin-sdk): update ssrf-runtime import path in cdp-proxy-bypass.ts The import path `openclaw/plugin-sdk/ssrf-runtime-internal` was renamed to `openclaw/plugin-sdk/ssrf-runtime` in a previous version, but cdp-proxy-bypass.ts still referenced the old path. The neighbouring cdp.helpers.ts already uses the correct path. This caused the browser plugin to fail to load with "Package subpath is not defined by exports". Fixes #96639 Co-Authored-By: Claude Opus 4.7 * fix(plugin-sdk): update ssrf-runtime import path in cdp-proxy-bypass The import path `openclaw/plugin-sdk/ssrf-runtime-internal` was renamed to `openclaw/plugin-sdk/ssrf-runtime` in a previous version, but cdp-proxy-bypass.ts still referenced the old path. The neighbouring cdp.helpers.ts already uses the correct path. This caused the browser plugin to fail to load with "Package subpath is not defined by exports". Update the corresponding vi.mock path in the test file to match. Fixes #96639 Co-Authored-By: Claude Opus 4.7 * fix(plugin-sdk): promote managed-proxy bypass exports to public ssrf-runtime Export registerManagedProxyBrowserCdpBypass and fetchConfiguredLocalOriginWithSsrFGuard from the public ssrf-runtime path so that the browser plugin and ollama embedding provider can lazy-load without hitting the private ssrf-runtime-internal subpath that is excluded from package.json exports. Fixes #96639 Co-Authored-By: Claude Opus 4.7 * fix(build): bundle private SSRF runtime for packaged plugins --------- Co-authored-by: Claude Opus 4.7 Co-authored-by: Peter Steinberger --- extensions/ollama/src/embedding-provider.test.ts | 1 + src/infra/tsdown-config.test.ts | 2 ++ tsdown.config.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/extensions/ollama/src/embedding-provider.test.ts b/extensions/ollama/src/embedding-provider.test.ts index 52957c2792b..ef2c445ada8 100644 --- a/extensions/ollama/src/embedding-provider.test.ts +++ b/extensions/ollama/src/embedding-provider.test.ts @@ -26,6 +26,7 @@ vi.mock("openclaw/plugin-sdk/ssrf-runtime-internal", () => ({ fetchConfiguredLocalOriginWithSsrFGuard: fetchConfiguredLocalOriginWithSsrFGuardMock, })); + let createOllamaEmbeddingProvider: typeof import("./embedding-provider.js").createOllamaEmbeddingProvider; let ollamaMemoryEmbeddingProviderAdapter: typeof import("./memory-embedding-adapter.js").ollamaMemoryEmbeddingProviderAdapter; diff --git a/src/infra/tsdown-config.test.ts b/src/infra/tsdown-config.test.ts index 102ff19054e..04cf3d97ecc 100644 --- a/src/infra/tsdown-config.test.ts +++ b/src/infra/tsdown-config.test.ts @@ -268,6 +268,8 @@ describe("tsdown config", () => { expect(alwaysBundle("@openclaw/fs-safe")).toBe(true); expect(alwaysBundle("@openclaw/fs-safe/path")).toBe(true); + expect(alwaysBundle("openclaw/plugin-sdk/ssrf-runtime-internal")).toBe(true); + expect(alwaysBundle("openclaw/plugin-sdk/ssrf-runtime")).toBe(false); expect(alwaysBundle("zod")).toBe(true); expect(alwaysBundle("zod/v4/core")).toBe(true); expect(alwaysBundle("not-a-runtime-dependency")).toBe(false); diff --git a/tsdown.config.ts b/tsdown.config.ts index 9b762362a9a..dccae106f9a 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -219,6 +219,7 @@ function shouldNeverBundleDependency(id: string): boolean { function shouldAlwaysBundleDependency(id: string): boolean { return ( + id === "openclaw/plugin-sdk/ssrf-runtime-internal" || id === "@openclaw/fs-safe" || id.startsWith("@openclaw/fs-safe/") || id === "@openclaw/normalization-core" ||