惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
D
Docker
J
Java Code Geeks
腾讯CDC
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
M
MIT News - Artificial intelligence
L
LangChain Blog
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
博客园 - Franky
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
aimingoo的专栏
aimingoo的专栏
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
N
Netflix TechBlog - Medium
B
Blog RSS Feed
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(plugins): alias bundled public surfaces in source loa...
vincentkoc · 2026-05-04 · via Recent Commits to openclaw:main

@@ -198,6 +198,39 @@ function createPluginSdkAliasTargetFixture(params?: {

198198

};

199199

}

200200201+

function createBundledPluginPackagePublicSurfaceAliasFixture() {

202+

const fixture = createPluginSdkAliasTargetFixture();

203+

const extensionRoot = path.join(fixture.fixture.root, bundledPluginRoot("slack"));

204+

const distExtensionRoot = path.join(fixture.fixture.root, "dist", "extensions", "slack");

205+

mkdirSafeDir(extensionRoot);

206+

mkdirSafeDir(distExtensionRoot);

207+

fs.writeFileSync(

208+

path.join(extensionRoot, "package.json"),

209+

JSON.stringify({ name: "@openclaw/slack", type: "module" }, null, 2),

210+

"utf-8",

211+

);

212+

const sourceApiPath = path.join(extensionRoot, "api.ts");

213+

const sourceRuntimeApiPath = path.join(extensionRoot, "runtime-api.ts");

214+

const distApiPath = path.join(distExtensionRoot, "api.js");

215+

const distRuntimeApiPath = path.join(distExtensionRoot, "runtime-api.js");

216+

fs.writeFileSync(sourceApiPath, "export const slackApi = 'source';\n", "utf-8");

217+

fs.writeFileSync(sourceRuntimeApiPath, "export const slackRuntimeApi = 'source';\n", "utf-8");

218+

fs.writeFileSync(distApiPath, "export const slackApi = 'dist';\n", "utf-8");

219+

fs.writeFileSync(distRuntimeApiPath, "export const slackRuntimeApi = 'dist';\n", "utf-8");

220+

fs.writeFileSync(

221+

path.join(extensionRoot, "internal.ts"),

222+

"export const internal = true;\n",

223+

"utf-8",

224+

);

225+

return {

226+

...fixture,

227+

distApiPath,

228+

distRuntimeApiPath,

229+

sourceApiPath,

230+

sourceRuntimeApiPath,

231+

};

232+

}

233+201234

function writePluginEntry(root: string, relativePath: string) {

202235

const pluginEntry = path.join(root, relativePath);

203236

fs.mkdirSync(path.dirname(pluginEntry), { recursive: true });

@@ -777,6 +810,47 @@ describe("plugin sdk alias helpers", () => {

777810

});

778811

});

779812813+

it("aliases bundled plugin package public surfaces for source plugin transforms", () => {

814+

const { fixture, sourceApiPath, sourceRuntimeApiPath } =

815+

createBundledPluginPackagePublicSurfaceAliasFixture();

816+

const sourcePluginEntry = writePluginEntry(

817+

fixture.root,

818+

bundledPluginFile("qa-lab", "src/live-transports/slack/slack-live.runtime.ts"),

819+

);

820+821+

const aliases = withEnv({ NODE_ENV: undefined }, () =>

822+

buildPluginLoaderAliasMap(sourcePluginEntry),

823+

);

824+825+

expect(fs.realpathSync(aliases["@openclaw/slack/api.js"] ?? "")).toBe(

826+

fs.realpathSync(sourceApiPath),

827+

);

828+

expect(fs.realpathSync(aliases["@openclaw/slack/runtime-api.js"] ?? "")).toBe(

829+

fs.realpathSync(sourceRuntimeApiPath),

830+

);

831+

expect(aliases["@openclaw/slack/internal.js"]).toBeUndefined();

832+

});

833+834+

it("aliases bundled plugin package public surfaces to dist when dist resolution is requested", () => {

835+

const { fixture, distApiPath, distRuntimeApiPath } =

836+

createBundledPluginPackagePublicSurfaceAliasFixture();

837+

const sourcePluginEntry = writePluginEntry(

838+

fixture.root,

839+

bundledPluginFile("qa-lab", "src/live-transports/slack/slack-live.runtime.ts"),

840+

);

841+842+

const aliases = withEnv({ NODE_ENV: undefined }, () =>

843+

buildPluginLoaderAliasMap(sourcePluginEntry, undefined, undefined, "dist"),

844+

);

845+846+

expect(fs.realpathSync(aliases["@openclaw/slack/api.js"] ?? "")).toBe(

847+

fs.realpathSync(distApiPath),

848+

);

849+

expect(fs.realpathSync(aliases["@openclaw/slack/runtime-api.js"] ?? "")).toBe(

850+

fs.realpathSync(distRuntimeApiPath),

851+

);

852+

});

853+780854

it("falls back to source plugin-sdk subpath aliases when dist chunks are stale", () => {

781855

const fixture = createPluginSdkAliasFixture({

782856

srcFile: "provider-entry.ts",