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

推荐订阅源

J
Java Code Geeks
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
A
About on SuperTechFans
Vercel News
Vercel News
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
S
SegmentFault 最新的问题
V
Visual Studio Blog
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
美团技术团队

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: keep plugin sdk owner seams explicit · openclaw...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -4,12 +4,14 @@ import { fileURLToPath } from "node:url";

44

import { describe, expect, it } from "vitest";

55

import {

66

pluginSdkEntrypoints,

7+

publicPluginOwnedSdkEntrypoints,

78

reservedBundledPluginSdkEntrypoints,

89

supportedBundledFacadeSdkEntrypoints,

910

} from "../../plugin-sdk/entrypoints.js";

10111112

const ROOT_DIR = resolve(dirname(fileURLToPath(import.meta.url)), "../..");

1213

const REPO_ROOT = resolve(ROOT_DIR, "..");

14+

const SDK_SUBPATH_DOC_FILE = "docs/plugins/sdk-subpaths.md";

1315

const PUBLIC_CONTRACT_REFERENCE_FILES = [

1416

"docs/plugins/architecture.md",

1517

"src/plugins/contracts/plugin-sdk-subpaths.test.ts",

@@ -57,6 +59,48 @@ function collectPluginSdkSubpathReferences() {

5759

return references;

5860

}

596162+

function collectDocumentedSdkSubpaths(): Set<string> {

63+

const source = readFileSync(resolve(REPO_ROOT, SDK_SUBPATH_DOC_FILE), "utf8");

64+

return new Set(

65+

[...source.matchAll(/`plugin-sdk\/([a-z0-9][a-z0-9-]*)`/g)]

66+

.map((match) => match[1])

67+

.filter((subpath): subpath is string => Boolean(subpath)),

68+

);

69+

}

70+71+

function collectBundledPluginIds(): string[] {

72+

return readdirSync(resolve(REPO_ROOT, "extensions"), { withFileTypes: true })

73+

.filter((entry) => entry.isDirectory())

74+

.map((entry) => entry.name)

75+

.toSorted((a, b) => b.length - a.length || a.localeCompare(b));

76+

}

77+78+

function collectPluginOwnedSdkEntrypoints(): string[] {

79+

const pluginIds = collectBundledPluginIds();

80+

return pluginSdkEntrypoints

81+

.filter((entrypoint) =>

82+

pluginIds.some(

83+

(pluginId) => entrypoint === pluginId || entrypoint.startsWith(`${pluginId}-`),

84+

),

85+

)

86+

.toSorted();

87+

}

88+89+

function collectClassificationOverlaps(classifications: Record<string, readonly string[]>) {

90+

const seen = new Map<string, string[]>();

91+

for (const [classification, entrypoints] of Object.entries(classifications)) {

92+

for (const entrypoint of entrypoints) {

93+

const current = seen.get(entrypoint) ?? [];

94+

current.push(classification);

95+

seen.set(entrypoint, current);

96+

}

97+

}

98+

return [...seen.entries()]

99+

.filter(([, matches]) => matches.length > 1)

100+

.map(([entrypoint, matches]) => `${entrypoint}: ${matches.toSorted().join(", ")}`)

101+

.toSorted();

102+

}

103+60104

function collectBundledFacadeSdkEntrypoints(): string[] {

61105

const entrypoints: string[] = [];

62106

for (const entrypoint of pluginSdkEntrypoints) {

@@ -224,6 +268,43 @@ describe("plugin-sdk package contract guardrails", () => {

224268

});

225269

});

226270271+

it("keeps plugin-owned SDK subpaths explicitly classified and documented", () => {

272+

const entrypoints = new Set(pluginSdkEntrypoints);

273+

const reserved = new Set<string>(reservedBundledPluginSdkEntrypoints);

274+

const supported = new Set<string>(supportedBundledFacadeSdkEntrypoints);

275+

const publicOwned = new Set<string>(publicPluginOwnedSdkEntrypoints);

276+

const documented = collectDocumentedSdkSubpaths();

277+

const pluginOwnedEntrypoints = collectPluginOwnedSdkEntrypoints();

278+

const classified = new Set([...reserved, ...supported, ...publicOwned]);

279+280+

const unknownPublicOwned = [...publicOwned].filter(

281+

(entrypoint) => !entrypoints.has(entrypoint),

282+

);

283+

const classificationOverlaps = collectClassificationOverlaps({

284+

reserved: reservedBundledPluginSdkEntrypoints,

285+

supported: supportedBundledFacadeSdkEntrypoints,

286+

publicOwned: publicPluginOwnedSdkEntrypoints,

287+

});

288+

const unclassifiedPluginOwned = pluginOwnedEntrypoints.filter(

289+

(entrypoint) => !classified.has(entrypoint),

290+

);

291+

const undocumentedPluginOwned = pluginOwnedEntrypoints.filter(

292+

(entrypoint) => !documented.has(entrypoint),

293+

);

294+295+

expect({

296+

unknownPublicOwned,

297+

classificationOverlaps,

298+

unclassifiedPluginOwned,

299+

undocumentedPluginOwned,

300+

}).toEqual({

301+

unknownPublicOwned: [],

302+

classificationOverlaps: [],

303+

unclassifiedPluginOwned: [],

304+

undocumentedPluginOwned: [],

305+

});

306+

});

307+227308

it("keeps curated public plugin-sdk references on exported built subpaths", () => {

228309

const entrypoints = new Set(pluginSdkEntrypoints);

229310

const exports = new Set(collectPluginSdkPackageExports());