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

推荐订阅源

A
About on SuperTechFans
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
宝玉的分享
宝玉的分享
美团技术团队
量子位
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
IT之家
IT之家
爱范儿
爱范儿
J
Java Code Geeks
博客园 - Franky
Last Week in AI
Last Week in AI
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
GbyAI
GbyAI
Recent Announcements
Recent Announcements
小众软件
小众软件
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale 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
fix(sdk): tighten wildcard surface budget · openclaw/open...
vincentkoc · 2026-06-25 · via Recent Commits to openclaw:main

@@ -14,39 +14,57 @@ function runSurfaceReport(env: Record<string, string>) {

1414

});

1515

}

161617-

function readCurrentPublicFunctionExportCount() {

17+

type PublicSurfaceCounts = {

18+

callableExports: number;

19+

exports: number;

20+

wildcardReexports: number;

21+

};

22+23+

function readDefaultPublicSurfaceBudgets(): PublicSurfaceCounts {

24+

const source = readFileSync("scripts/plugin-sdk-surface-report.mjs", "utf8");

25+

const readFallback = (budgetKey: string) => {

26+

const match = new RegExp(

27+

`${budgetKey}:\\s*readBudgetEnv\\(\\s*"[^"]+",\\s*(\\d+)`,

28+

"u",

29+

).exec(source);

30+

if (match === null || match[1] === undefined) {

31+

throw new Error(`failed to read default ${budgetKey} budget`);

32+

}

33+

return Number(match[1]);

34+

};

35+

return {

36+

exports: readFallback("publicExports"),

37+

callableExports: readFallback("publicFunctionExports"),

38+

wildcardReexports: readFallback("publicWildcardReexports"),

39+

};

40+

}

41+42+

function readCurrentPublicSurfaceCounts(): PublicSurfaceCounts {

1843

const result = runSurfaceReport({});

1944

expect(result.status).toBe(0);

2045

expect(result.stderr).toBe("");

214622-

return parseCurrentPublicCounts(result.stdout).functionExports;

23-

}

24-25-

function parseCurrentPublicCounts(stdout: string) {

26-

const match = /public package SDK entrypoints:[\s\S]*?\n exports: (\d+)\n callable exports: (\d+)/u

27-

.exec(stdout);

28-

if (match === null || match[1] === undefined || match[2] === undefined) {

29-

throw new Error("failed to read current public export counts");

47+

const totalsMatch =

48+

/public package SDK entrypoints:[\s\S]*?\n exports: (\d+)\n callable exports: (\d+)/u.exec(

49+

result.stdout,

50+

);

51+

const wildcardsMatch = /public wildcard reexports: (\d+)/u.exec(result.stdout);

52+

if (

53+

totalsMatch === null ||

54+

totalsMatch[1] === undefined ||

55+

totalsMatch[2] === undefined ||

56+

wildcardsMatch === null ||

57+

wildcardsMatch[1] === undefined

58+

) {

59+

throw new Error("failed to read current public surface counts");

3060

}

3161

return {

32-

exports: Number(match[1]),

33-

functionExports: Number(match[2]),

62+

exports: Number(totalsMatch[1]),

63+

callableExports: Number(totalsMatch[2]),

64+

wildcardReexports: Number(wildcardsMatch[1]),

3465

};

3566

}

366737-

function readDefaultBudget(envName: string): number {

38-

const source = readFileSync("scripts/plugin-sdk-surface-report.mjs", "utf8");

39-

const match = new RegExp(

40-

`readBudgetEnv\\("${envName}",\\s*(\\d+)\\)`,

41-

"u",

42-

);

43-

const result = match.exec(source);

44-

if (result === null || result[1] === undefined) {

45-

throw new Error(`failed to read default budget for ${envName}`);

46-

}

47-

return Number(result[1]);

48-

}

49-5068

describe("plugin SDK surface report", () => {

5169

it("rejects unknown CLI options before collecting SDK stats", () => {

5270

const result = spawnSync(

@@ -115,20 +133,12 @@ describe("plugin SDK surface report", () => {

115133

expect(result.stderr).toBe("");

116134

});

117135118-

it("keeps default public budgets tight to the current source surface", () => {

119-

const result = runSurfaceReport({});

120-

expect(result.status).toBe(0);

121-

expect(result.stderr).toBe("");

122-123-

const counts = parseCurrentPublicCounts(result.stdout);

124-

expect(readDefaultBudget("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_EXPORTS")).toBe(counts.exports);

125-

expect(readDefaultBudget("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_FUNCTION_EXPORTS")).toBe(

126-

counts.functionExports,

127-

);

136+

it("keeps default public surface budgets pinned to current source counts", () => {

137+

expect(readDefaultPublicSurfaceBudgets()).toEqual(readCurrentPublicSurfaceCounts());

128138

});

129139130140

it("keeps generated package declarations out of source surface counts", () => {

131-

const budget = readCurrentPublicFunctionExportCount();

141+

const budget = readCurrentPublicSurfaceCounts().callableExports;

132142

const result = runSurfaceReport({

133143

OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_FUNCTION_EXPORTS: String(budget - 1),

134144

});