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

推荐订阅源

云风的 BLOG
云风的 BLOG
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
F
Fortinet All Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 叶小钗
爱范儿
爱范儿
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
有赞技术团队
有赞技术团队
博客园_首页
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
V
Visual Studio Blog
Jina AI
Jina AI
博客园 - Franky
量子位
MongoDB | Blog
MongoDB | Blog
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
aimingoo的专栏
aimingoo的专栏
M
MIT News - Artificial intelligence

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
refactor(plugins): share public artifact candidate loadin...
vincentkoc · 2026-06-23 · via Recent Commits to openclaw:main

@@ -7,7 +7,10 @@ const { loadPluginManifestRegistryMock } = vi.hoisted(() => ({

77

}),

88

}));

9910-

const { loadBundledPluginPublicArtifactModuleSyncMock } = vi.hoisted(() => {

10+

const {

11+

loadBundledPluginPublicArtifactModuleFromCandidatesSyncMock,

12+

loadBundledPluginPublicArtifactModuleSyncMock,

13+

} = vi.hoisted(() => {

1114

const providerBase = {

1215

label: "Fixture",

1316

hint: "fixture",

@@ -18,49 +21,74 @@ const { loadBundledPluginPublicArtifactModuleSyncMock } = vi.hoisted(() => {

1821

getCredentialValue: () => undefined,

1922

setCredentialValue: () => ({}),

2023

};

24+

const lowLevelLoaderMock = vi.fn(

25+

({ dirName, artifactBasename }: { dirName: string; artifactBasename: string }) => {

26+

if (dirName === "brave" && artifactBasename === "web-search-contract-api.js") {

27+

return {

28+

createBraveWebSearchProvider: () => ({

29+

...providerBase,

30+

id: "brave",

31+

createTool: () => null,

32+

}),

33+

};

34+

}

35+

if (dirName === "mockplugin" && artifactBasename === "web-search-contract-api.js") {

36+

return {

37+

createFuzzpluginWebSearchProvider: () => {

38+

throw new Error("fuzzplugin web provider factory failed");

39+

},

40+

createMockpluginWebSearchProvider: () => ({

41+

...providerBase,

42+

id: "mockplugin",

43+

createTool: () => null,

44+

}),

45+

};

46+

}

47+

if (dirName === "fuzzplugin" && artifactBasename === "web-search-contract-api.js") {

48+

return {

49+

createFuzzpluginWebSearchProvider: () => {

50+

throw new Error("fuzzplugin web provider factory failed");

51+

},

52+

};

53+

}

54+

if (dirName === "firecrawl" && artifactBasename === "web-fetch-contract-api.js") {

55+

return {

56+

createFirecrawlWebFetchProvider: () => ({

57+

...providerBase,

58+

id: "firecrawl",

59+

createTool: () => null,

60+

}),

61+

};

62+

}

63+

throw new Error(

64+

`Unable to resolve bundled plugin public surface ${dirName}/${artifactBasename}`,

65+

);

66+

},

67+

);

2168

return {

22-

loadBundledPluginPublicArtifactModuleSyncMock: vi.fn(

23-

({ dirName, artifactBasename }: { dirName: string; artifactBasename: string }) => {

24-

if (dirName === "brave" && artifactBasename === "web-search-contract-api.js") {

25-

return {

26-

createBraveWebSearchProvider: () => ({

27-

...providerBase,

28-

id: "brave",

29-

createTool: () => null,

30-

}),

31-

};

69+

loadBundledPluginPublicArtifactModuleSyncMock: lowLevelLoaderMock,

70+

loadBundledPluginPublicArtifactModuleFromCandidatesSyncMock: vi.fn(

71+

({

72+

dirName,

73+

artifactCandidates,

74+

}: {

75+

dirName: string;

76+

artifactCandidates: readonly string[];

77+

}) => {

78+

for (const artifactBasename of artifactCandidates) {

79+

try {

80+

return lowLevelLoaderMock({ dirName, artifactBasename });

81+

} catch (error) {

82+

if (

83+

error instanceof Error &&

84+

error.message.startsWith("Unable to resolve bundled plugin public surface ")

85+

) {

86+

continue;

87+

}

88+

throw error;

89+

}

3290

}

33-

if (dirName === "mockplugin" && artifactBasename === "web-search-contract-api.js") {

34-

return {

35-

createFuzzpluginWebSearchProvider: () => {

36-

throw new Error("fuzzplugin web provider factory failed");

37-

},

38-

createMockpluginWebSearchProvider: () => ({

39-

...providerBase,

40-

id: "mockplugin",

41-

createTool: () => null,

42-

}),

43-

};

44-

}

45-

if (dirName === "fuzzplugin" && artifactBasename === "web-search-contract-api.js") {

46-

return {

47-

createFuzzpluginWebSearchProvider: () => {

48-

throw new Error("fuzzplugin web provider factory failed");

49-

},

50-

};

51-

}

52-

if (dirName === "firecrawl" && artifactBasename === "web-fetch-contract-api.js") {

53-

return {

54-

createFirecrawlWebFetchProvider: () => ({

55-

...providerBase,

56-

id: "firecrawl",

57-

createTool: () => null,

58-

}),

59-

};

60-

}

61-

throw new Error(

62-

`Unable to resolve bundled plugin public surface ${dirName}/${artifactBasename}`,

63-

);

91+

return null;

6492

},

6593

),

6694

};

@@ -78,6 +106,8 @@ vi.mock("./public-surface-loader.js", async (importOriginal) => {

78106

const actual = await importOriginal<typeof import("./public-surface-loader.js")>();

79107

return {

80108

...actual,

109+

loadBundledPluginPublicArtifactModuleFromCandidatesSync:

110+

loadBundledPluginPublicArtifactModuleFromCandidatesSyncMock,

81111

loadBundledPluginPublicArtifactModuleSync: loadBundledPluginPublicArtifactModuleSyncMock,

82112

};

83113

});

@@ -99,6 +129,7 @@ function expectSingleProvider<T>(providers: T[] | null | undefined): T {

99129

describe("web provider public artifacts explicit fast path", () => {

100130

beforeEach(() => {

101131

loadPluginManifestRegistryMock.mockClear();

132+

loadBundledPluginPublicArtifactModuleFromCandidatesSyncMock.mockClear();

102133

loadBundledPluginPublicArtifactModuleSyncMock.mockClear();

103134

});

104135