refactor: hide optional bundle helpers

This commit is contained in:
Peter Steinberger
2026-05-02 08:35:41 +01:00
parent bc77ab93ac
commit 8731820ba2
2 changed files with 6 additions and 12 deletions

View File

@@ -1,10 +1,4 @@
export const optionalBundledClusters: string[];
export const optionalBundledClusterSet: Set<string>;
export const OPTIONAL_BUNDLED_BUILD_ENV: "OPENCLAW_INCLUDE_OPTIONAL_BUNDLED";
export function isOptionalBundledCluster(cluster: string): boolean;
export function shouldIncludeOptionalBundledClusters(env?: NodeJS.ProcessEnv): boolean;
export function hasReleasedBundledInstall(packageJson: unknown): boolean;
export function isExplicitlyDownloadablePlugin(packageJson: unknown): boolean;
export function shouldBuildBundledCluster(
cluster: string,
env?: NodeJS.ProcessEnv,

View File

@@ -1,4 +1,4 @@
export const optionalBundledClusters = [
const optionalBundledClusters = [
"acpx",
"diagnostics-otel",
"diffs",
@@ -16,26 +16,26 @@ export const optionalBundledClusters = [
export const optionalBundledClusterSet = new Set(optionalBundledClusters);
export const OPTIONAL_BUNDLED_BUILD_ENV = "OPENCLAW_INCLUDE_OPTIONAL_BUNDLED";
const OPTIONAL_BUNDLED_BUILD_ENV = "OPENCLAW_INCLUDE_OPTIONAL_BUNDLED";
export function isOptionalBundledCluster(cluster) {
function isOptionalBundledCluster(cluster) {
return optionalBundledClusterSet.has(cluster);
}
export function shouldIncludeOptionalBundledClusters(env = process.env) {
function shouldIncludeOptionalBundledClusters(env = process.env) {
// Release artifacts should preserve the last shipped upgrade surface by
// default. Specific size-sensitive lanes can still opt out explicitly.
return env[OPTIONAL_BUNDLED_BUILD_ENV] !== "0";
}
export function hasReleasedBundledInstall(packageJson) {
function hasReleasedBundledInstall(packageJson) {
return (
typeof packageJson?.openclaw?.install?.npmSpec === "string" &&
packageJson.openclaw.install.npmSpec.trim().length > 0
);
}
export function isExplicitlyDownloadablePlugin(packageJson) {
function isExplicitlyDownloadablePlugin(packageJson) {
return packageJson?.openclaw?.bundle?.includeInCore === false;
}