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

推荐订阅源

Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
爱范儿
爱范儿
D
Docker
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
D
DataBreaches.Net
月光博客
月光博客
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Visual Studio Blog
MyScale Blog
MyScale Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Recent Announcements
Recent Announcements
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学

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): validate plugin npm verifier args · opencla...
vincentkoc · 2026-06-21 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -358,6 +358,28 @@ function readPackedPackageReadme(packageDir, files) {

358358

return fs.readFileSync(path.join(packageDir, readmePath), "utf8").trim();

359359

}

360360
361+

export function usage() {

362+

return "Usage: node scripts/verify-plugin-npm-published-runtime.mjs <package-spec>";

363+

}

364+
365+

export function parseVerifyPublishedPluginRuntimeArgs(argv) {

366+

const args = argv[0] === "--" ? argv.slice(1) : argv;

367+

const first = args[0]?.trim();

368+

if (first === "--help" || first === "-h") {

369+

return { help: true, spec: "" };

370+

}

371+

if (!first) {

372+

throw new Error(usage());

373+

}

374+

if (first.startsWith("-")) {

375+

throw new Error(`Unknown plugin npm verifier option: ${first}`);

376+

}

377+

if (args.length > 1) {

378+

throw new Error(`Unexpected plugin npm verifier argument: ${args[1]}`);

379+

}

380+

return { help: false, spec: first };

381+

}

382+
361383

export async function verifyPublishedPluginRuntime(spec) {

362384

const workingDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-plugin-npm-runtime."));

363385

try {

@@ -396,11 +418,12 @@ export async function verifyPublishedPluginRuntime(spec) {

396418

}

397419
398420

async function main(argv) {

399-

const spec = argv[0]?.trim();

400-

if (!spec) {

401-

throw new Error("Usage: node scripts/verify-plugin-npm-published-runtime.mjs <package-spec>");

421+

const args = parseVerifyPublishedPluginRuntimeArgs(argv);

422+

if (args.help) {

423+

console.log(usage());

424+

return;

402425

}

403-

const result = await verifyPublishedPluginRuntime(spec);

426+

const result = await verifyPublishedPluginRuntime(args.spec);

404427

console.log(

405428

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

406429

);

Original file line numberDiff line numberDiff line change

@@ -3,13 +3,35 @@ import { describe, expect, it } from "vitest";

33

import {

44

collectPluginNpmPublishedRuntimeErrors,

55

findPackedPackageReadmePath,

6+

parseVerifyPublishedPluginRuntimeArgs,

67

parseNpmReadmeMetadata,

78

readPluginNpmCommandOptions,

89

readPositiveIntEnv,

910

resolveNpmPackFilename,

1011

runPluginNpmCommand,

12+

usage,

1113

} from "../../scripts/verify-plugin-npm-published-runtime.mjs";

1214
15+

describe("plugin npm publish verifier args", () => {

16+

it("parses help and package specs before npm calls", () => {

17+

expect(parseVerifyPublishedPluginRuntimeArgs(["--help"])).toEqual({ help: true, spec: "" });

18+

expect(parseVerifyPublishedPluginRuntimeArgs(["--", "@openclaw/discord@2026.5.2"])).toEqual({

19+

help: false,

20+

spec: "@openclaw/discord@2026.5.2",

21+

});

22+

});

23+
24+

it("rejects unknown and extra args before npm calls", () => {

25+

expect(() => parseVerifyPublishedPluginRuntimeArgs([])).toThrow(usage());

26+

expect(() => parseVerifyPublishedPluginRuntimeArgs(["--wat"])).toThrow(

27+

"Unknown plugin npm verifier option: --wat",

28+

);

29+

expect(() =>

30+

parseVerifyPublishedPluginRuntimeArgs(["@openclaw/discord@2026.5.2", "extra"]),

31+

).toThrow("Unexpected plugin npm verifier argument: extra");

32+

});

33+

});

34+
1335

describe("plugin npm publish verifier retry limits", () => {

1436

it("rejects loose numeric retry env values instead of parsing prefixes", () => {

1537

expect(() =>