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

推荐订阅源

腾讯CDC
The Cloudflare Blog
IT之家
IT之家
V
V2EX
雷峰网
雷峰网
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
S
SegmentFault 最新的问题
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
小众软件
小众软件
博客园 - 叶小钗
Blog — PlanetScale
Blog — PlanetScale
C
Check Point Blog
A
About on SuperTechFans
B
Blog
月光博客
月光博客
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI

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(test): avoid scanning bundled source metadata · openc...
vincentkoc · 2026-05-16 · via Recent Commits to openclaw:main

@@ -1,3 +1,4 @@

1+

import { spawnSync } from "node:child_process";

12

import fs from "node:fs";

23

import path from "node:path";

34

@@ -9,36 +10,95 @@ export function readIfExists(filePath) {

910

}

1011

}

111212-

export function collectBundledPluginSources(params = {}) {

13-

const repoRoot = path.resolve(params.repoRoot ?? process.cwd());

13+

function collectTrackedBundledPluginSourceCandidates(repoRoot) {

14+

const result = spawnSync(

15+

"git",

16+

[

17+

"ls-files",

18+

"--",

19+

":(glob)extensions/*/openclaw.plugin.json",

20+

":(glob)extensions/*/package.json",

21+

],

22+

{

23+

cwd: repoRoot,

24+

encoding: "utf8",

25+

stdio: ["ignore", "pipe", "ignore"],

26+

},

27+

);

28+

if (result.status !== 0) {

29+

return null;

30+

}

31+32+

const candidatesByDir = new Map();

33+

for (const rawLine of result.stdout.split("\n")) {

34+

const line = rawLine.trim().replaceAll("\\", "/");

35+

const match = /^extensions\/([^/]+)\/(openclaw\.plugin\.json|package\.json)$/u.exec(line);

36+

if (!match?.[1] || !match[2]) {

37+

continue;

38+

}

39+

const current = candidatesByDir.get(match[1]) ?? {

40+

dirName: match[1],

41+

manifestPath: null,

42+

packageJsonPath: null,

43+

pluginDir: path.join(repoRoot, "extensions", match[1]),

44+

};

45+

if (match[2] === "openclaw.plugin.json") {

46+

current.manifestPath = path.join(repoRoot, line);

47+

} else {

48+

current.packageJsonPath = path.join(repoRoot, line);

49+

}

50+

candidatesByDir.set(match[1], current);

51+

}

52+53+

return [...candidatesByDir.values()].toSorted((left, right) =>

54+

left.dirName.localeCompare(right.dirName),

55+

);

56+

}

57+58+

function collectBundledPluginSourceCandidatesFromDirectory(repoRoot) {

1459

const extensionsRoot = path.join(repoRoot, "extensions");

1560

if (!fs.existsSync(extensionsRoot)) {

1661

return [];

1762

}

186364+

return fs

65+

.readdirSync(extensionsRoot, { withFileTypes: true })

66+

.filter((dirent) => dirent.isDirectory())

67+

.map((dirent) => {

68+

const pluginDir = path.join(extensionsRoot, dirent.name);

69+

const manifestPath = path.join(pluginDir, "openclaw.plugin.json");

70+

const packageJsonPath = path.join(pluginDir, "package.json");

71+

return {

72+

dirName: dirent.name,

73+

manifestPath: fs.existsSync(manifestPath) ? manifestPath : null,

74+

packageJsonPath: fs.existsSync(packageJsonPath) ? packageJsonPath : null,

75+

pluginDir,

76+

};

77+

})

78+

.toSorted((left, right) => left.dirName.localeCompare(right.dirName));

79+

}

80+81+

export function collectBundledPluginSources(params = {}) {

82+

const repoRoot = path.resolve(params.repoRoot ?? process.cwd());

1983

const requirePackageJson = params.requirePackageJson === true;

2084

const entries = [];

21-

for (const dirent of fs.readdirSync(extensionsRoot, { withFileTypes: true })) {

22-

if (!dirent.isDirectory()) {

23-

continue;

24-

}

25-26-

const pluginDir = path.join(extensionsRoot, dirent.name);

27-

const manifestPath = path.join(pluginDir, "openclaw.plugin.json");

28-

const packageJsonPath = path.join(pluginDir, "package.json");

29-

if (!fs.existsSync(manifestPath)) {

85+

const candidates =

86+

collectTrackedBundledPluginSourceCandidates(repoRoot) ??

87+

collectBundledPluginSourceCandidatesFromDirectory(repoRoot);

88+

for (const { dirName, manifestPath, packageJsonPath, pluginDir } of candidates) {

89+

if (!manifestPath) {

3090

continue;

3191

}

32-

if (requirePackageJson && !fs.existsSync(packageJsonPath)) {

92+

if (requirePackageJson && !packageJsonPath) {

3393

continue;

3494

}

35953696

entries.push({

37-

dirName: dirent.name,

97+

dirName,

3898

pluginDir,

3999

manifestPath,

40100

manifest: JSON.parse(fs.readFileSync(manifestPath, "utf8")),

41-

...(fs.existsSync(packageJsonPath)

101+

...(packageJsonPath

42102

? {

43103

packageJsonPath,

44104

packageJson: JSON.parse(fs.readFileSync(packageJsonPath, "utf8")),