diff --git a/build.ts b/build.ts index 27f57686..11c4a248 100644 --- a/build.ts +++ b/build.ts @@ -8,10 +8,15 @@ const outdir = "dist"; const { rmSync } = await import("fs"); rmSync(outdir, { recursive: true, force: true }); +// Default features that match the official CLI build. +// Additional features can be enabled via FEATURE_=1 env vars. +const DEFAULT_BUILD_FEATURES = ["AGENT_TRIGGERS_REMOTE"]; + // Collect FEATURE_* env vars → Bun.build features -const features = Object.keys(process.env) +const envFeatures = Object.keys(process.env) .filter(k => k.startsWith("FEATURE_")) .map(k => k.replace("FEATURE_", "")); +const features = [...new Set([...DEFAULT_BUILD_FEATURES, ...envFeatures])]; // Step 2: Bundle with splitting const result = await Bun.build({ diff --git a/scripts/dev.ts b/scripts/dev.ts index cdf658b4..43750898 100644 --- a/scripts/dev.ts +++ b/scripts/dev.ts @@ -15,7 +15,7 @@ const defineArgs = Object.entries(defines).flatMap(([k, v]) => [ // Bun --feature flags: enable feature() gates at runtime. // Default features enabled in dev mode. -const DEFAULT_FEATURES = ["BUDDY", "TRANSCRIPT_CLASSIFIER", "BRIDGE_MODE"]; +const DEFAULT_FEATURES = ["BUDDY", "TRANSCRIPT_CLASSIFIER", "BRIDGE_MODE", "AGENT_TRIGGERS_REMOTE"]; // Any env var matching FEATURE_=1 will also enable that feature. // e.g. FEATURE_PROACTIVE=1 bun run dev