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
This commit is contained in:
24
packages/core/src/experimental-features.ts
Normal file
24
packages/core/src/experimental-features.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user