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

推荐订阅源

博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
aimingoo的专栏
aimingoo的专栏
腾讯CDC
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
F
Fortinet All Blogs
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
Engineering at Meta
Engineering at Meta
博客园_首页
B
Blog RSS Feed
D
Docker
M
MIT News - Artificial intelligence
爱范儿
爱范儿
I
InfoQ

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(release): verify plugin npm readmes · openclaw/opencl...
steipete · 2026-05-30 · via Recent Commits to openclaw:main

@@ -212,6 +212,23 @@ function npmPack(spec, destinationDir) {

212212

return path.isAbsolute(filename) ? filename : path.join(destinationDir, filename);

213213

}

214214215+

export function parseNpmReadmeMetadata(raw) {

216+

let parsed;

217+

try {

218+

parsed = JSON.parse(raw);

219+

} catch {

220+

return "";

221+

}

222+

return typeof parsed === "string" ? parsed.trim() : "";

223+

}

224+225+

function npmViewReadme(spec) {

226+

return execFileSync("npm", ["view", spec, "readme", "--json", "--prefer-online"], {

227+

encoding: "utf8",

228+

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

229+

});

230+

}

231+215232

function sleep(ms) {

216233

return new Promise((resolve) => setTimeout(resolve, ms));

217234

}

@@ -236,6 +253,36 @@ async function packPublishedPackage(spec, destinationDir) {

236253

throw lastError;

237254

}

238255256+

async function verifyPublishedPackageReadme(spec) {

257+

const attempts = Number.parseInt(

258+

process.env.OPENCLAW_PLUGIN_NPM_README_VERIFY_ATTEMPTS ?? "6",

259+

10,

260+

);

261+

const delayMs = Number.parseInt(

262+

process.env.OPENCLAW_PLUGIN_NPM_README_VERIFY_DELAY_MS ?? "10000",

263+

10,

264+

);

265+

let lastError;

266+

for (let attempt = 1; attempt <= attempts; attempt += 1) {

267+

try {

268+

const readme = parseNpmReadmeMetadata(npmViewReadme(spec));

269+

if (readme) {

270+

return readme;

271+

}

272+

lastError = new Error(`npm view ${spec} readme returned empty metadata`);

273+

} catch (error) {

274+

lastError = error;

275+

}

276+

if (attempt < attempts) {

277+

console.error(

278+

`npm readme metadata for ${spec} not ready (attempt ${attempt}/${attempts}); retrying in ${delayMs}ms...`,

279+

);

280+

await sleep(delayMs);

281+

}

282+

}

283+

throw lastError;

284+

}

285+239286

function listFiles(rootDir, prefix = "") {

240287

const files = [];

241288

for (const entry of fs.readdirSync(path.join(rootDir, prefix), { withFileTypes: true })) {

@@ -273,10 +320,12 @@ export async function verifyPublishedPluginRuntime(spec) {

273320

if (errors.length > 0) {

274321

throw new Error(errors.join("\n"));

275322

}

323+

const readme = await verifyPublishedPackageReadme(spec);

276324

return {

277325

packageName: packedPackage.packageJson.name,

278326

version: packedPackage.packageJson.version,

279327

fileCount: packedPackage.files.length,

328+

readmeLength: readme.length,

280329

};

281330

} finally {

282331

fs.rmSync(workingDir, { force: true, recursive: true });

@@ -290,7 +339,7 @@ async function main(argv) {

290339

}

291340

const result = await verifyPublishedPluginRuntime(spec);

292341

console.log(

293-

`plugin-npm-published-runtime-check: ${result.packageName}@${result.version} OK (${result.fileCount} files)`,

342+

`plugin-npm-published-runtime-check: ${result.packageName}@${result.version} OK (${result.fileCount} files, ${result.readmeLength} readme chars)`,

294343

);

295344

}

296345