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

推荐订阅源

IT之家
IT之家
Y
Y Combinator Blog
月光博客
月光博客
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
博客园 - 司徒正美
V
Visual Studio Blog
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
The Cloudflare Blog

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
ci: guard plugin sdk wildcard reexports · openclaw/opencl...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -0,0 +1,85 @@

1+

#!/usr/bin/env node

2+3+

import fs from "node:fs/promises";

4+

import path from "node:path";

5+

import { fileURLToPath } from "node:url";

6+7+

const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");

8+

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

9+10+

const WILDCARD_PLUGIN_SDK_REEXPORT_PATTERN =

11+

/^\s*export\s+(?:type\s+)?\*\s+from\s+["']openclaw\/plugin-sdk\//u;

12+13+

async function listExtensionApiFiles(rootDir = extensionsRoot) {

14+

const entries = await fs.readdir(rootDir, { withFileTypes: true });

15+

const files = [];

16+

for (const entry of entries) {

17+

if (!entry.isDirectory()) {

18+

continue;

19+

}

20+

for (const fileName of ["api.ts", "runtime-api.ts"]) {

21+

const filePath = path.join(rootDir, entry.name, fileName);

22+

try {

23+

const stat = await fs.stat(filePath);

24+

if (stat.isFile()) {

25+

files.push(filePath);

26+

}

27+

} catch (error) {

28+

if (!error || typeof error !== "object" || !("code" in error) || error.code !== "ENOENT") {

29+

throw error;

30+

}

31+

}

32+

}

33+

}

34+

return files.toSorted((left, right) => left.localeCompare(right));

35+

}

36+37+

export function findPluginSdkWildcardReexports(source) {

38+

return source

39+

.split(/\r?\n/u)

40+

.map((text, index) => ({ line: index + 1, text }))

41+

.filter(({ text }) => WILDCARD_PLUGIN_SDK_REEXPORT_PATTERN.test(text));

42+

}

43+44+

export async function collectPluginSdkWildcardReexports(rootDir = repoRoot) {

45+

const files = await listExtensionApiFiles(path.join(rootDir, "extensions"));

46+

const violations = [];

47+

for (const filePath of files) {

48+

const source = await fs.readFile(filePath, "utf8");

49+

for (const match of findPluginSdkWildcardReexports(source)) {

50+

violations.push({

51+

file: path.relative(rootDir, filePath).split(path.sep).join("/"),

52+

line: match.line,

53+

text: match.text.trim(),

54+

});

55+

}

56+

}

57+

return violations;

58+

}

59+60+

export async function main(argv = process.argv.slice(2), io = process) {

61+

const json = argv.includes("--json");

62+

const violations = await collectPluginSdkWildcardReexports();

63+64+

if (json) {

65+

io.stdout.write(`${JSON.stringify(violations, null, 2)}\n`);

66+

return violations.length === 0 ? 0 : 1;

67+

}

68+69+

if (violations.length === 0) {

70+

io.stdout.write("No plugin-sdk wildcard re-exports found in extension API barrels.\n");

71+

return 0;

72+

}

73+74+

io.stderr.write("Found plugin-sdk wildcard re-exports in extension API barrels:\n");

75+

for (const violation of violations) {

76+

io.stderr.write(`- ${violation.file}:${violation.line} ${violation.text}\n`);

77+

}

78+

io.stderr.write("Use explicit named exports from the narrow SDK subpath instead.\n");

79+

return 1;

80+

}

81+82+

if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {

83+

const exitCode = await main();

84+

process.exit(exitCode);

85+

}