From 8731820ba276512a71a56c1459a5e26d4cf94cf8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 08:35:41 +0100 Subject: [PATCH] refactor: hide optional bundle helpers --- scripts/lib/optional-bundled-clusters-types.d.ts | 6 ------ scripts/lib/optional-bundled-clusters.mjs | 12 ++++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/scripts/lib/optional-bundled-clusters-types.d.ts b/scripts/lib/optional-bundled-clusters-types.d.ts index 8deff6cad4e..0b8633423a2 100644 --- a/scripts/lib/optional-bundled-clusters-types.d.ts +++ b/scripts/lib/optional-bundled-clusters-types.d.ts @@ -1,10 +1,4 @@ -export const optionalBundledClusters: string[]; export const optionalBundledClusterSet: Set; -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, diff --git a/scripts/lib/optional-bundled-clusters.mjs b/scripts/lib/optional-bundled-clusters.mjs index 95c4c6d57dc..df5a06f7cdd 100644 --- a/scripts/lib/optional-bundled-clusters.mjs +++ b/scripts/lib/optional-bundled-clusters.mjs @@ -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; }