Files
fusion/packages/core/src/experimental-features.ts
Fusion c38b7cd002 feat(FN-3706): gate research tools behind experimental feature
The merge introduces a research tool surface gating mechanism: shared availability helpers in core and engine, applied to the executor and triage agent so research prompts and tool exposure are gated behind experimental-feature flags, with tests covering the new logic.

Fusion-Task-Id: FN-3706
2026-05-07 15:53:58 -07:00

25 lines
717 B
TypeScript

import type { Settings } from "./types.js";
const LEGACY_EXPERIMENTAL_FEATURE_ALIASES: Record<string, string> = {
devServer: "devServerView",
};
export function isExperimentalFeatureEnabled(
settings: Pick<Settings, "experimentalFeatures"> | undefined,
key: string,
): boolean {
const features = settings?.experimentalFeatures;
if (!features) return false;
const canonicalKey = LEGACY_EXPERIMENTAL_FEATURE_ALIASES[key] ?? key;
if (features[canonicalKey] === true) return true;
for (const [legacyKey, aliasCanonical] of Object.entries(LEGACY_EXPERIMENTAL_FEATURE_ALIASES)) {
if (aliasCanonical === canonicalKey && features[legacyKey] === true) {
return true;
}
}
return false;
}