Files
openclaw/scripts/lib/plugin-sdk-declaration-budget.mjs
Peter Steinberger dce8eed0b9 ci(deadcode): restore enforced unused-export ratchet (#105826)
* ci(deadcode): restore export ratchet

* chore(deadcode): refresh export baseline

* refactor(sessions): remove obsolete patch writer

* refactor(deadcode): classify current export residue

* fix(deadcode): preserve exported signature types

* chore(deadcode): sync export baseline after rebase

* chore(deadcode): classify pairing test exports

* fix(ci): refresh plugin SDK declaration budget
2026-07-12 19:58:38 -07:00

22 lines
998 B
JavaScript

// Raised for the plugins.uninstall/catalog actions and current session/plugin protocol surfaces;
// the cap exists to force a conscious decision on published declaration growth.
export const MAX_PUBLIC_PLUGIN_SDK_DECLARATION_BYTES = 5_200_000;
// Private-only entrypoints reshape chunks reachable from public roots but are never published.
// Bound that topology overhead without counting local-only declarations as package surface.
export const MAX_PRIVATE_QA_PUBLIC_PLUGIN_SDK_DECLARATION_BYTES = 5_225_000;
export function isPrivateQaPluginSdkBuild(env) {
return env.OPENCLAW_BUILD_PRIVATE_QA === "1";
}
export function evaluatePluginSdkDeclarationBudget({ declarationBytes, buildPrivateQa }) {
const budgetBytes = buildPrivateQa
? MAX_PRIVATE_QA_PUBLIC_PLUGIN_SDK_DECLARATION_BYTES
: MAX_PUBLIC_PLUGIN_SDK_DECLARATION_BYTES;
return {
budgetBytes,
budgetKind: buildPrivateQa ? "private-qa-public-entry" : "public",
shouldFail: declarationBytes > budgetBytes,
};
}