Files
fusion/packages/core/src/eval-settings.ts
Fusion cafaa68a5f feat(FN-3738): add fusion-plugin-even-realities-glasses plugin package with
Implements a new Fusion plugin package (`fusion-plugin-even-realities-glasses`) providing settings schema, a Fusion HTTP API client, cards, quick capture actions, a notifier, and transport stub — plus plugin routes and lifecycle hooks wired into the pi extension. The branch concludes with a small fi

Fusion-Task-Id: FN-3738
2026-05-08 12:05:46 -07:00

29 lines
1.3 KiB
TypeScript

import { isExperimentalFeatureEnabled } from "./experimental-features.js";
import { resolveValidatorSettingsModel } from "./model-resolution.js";
import type { ResolvedEvalSettings, Settings } from "./types.js";
const DEFAULT_EVAL_SETTINGS: Omit<ResolvedEvalSettings, "evaluatorProvider" | "evaluatorModelId"> = {
enabled: false,
intervalMs: 86_400_000,
followUpPolicy: "suggest-only",
retentionDays: 30,
};
export function isEvalsExperimentalEnabled(settings: Partial<Settings> | undefined): boolean {
return isExperimentalFeatureEnabled(settings, "evalsView");
}
export function resolveEvalSettings(settings: Partial<Settings> | undefined): ResolvedEvalSettings {
const scopedSettings = settings?.evalSettings;
const validatorModel = resolveValidatorSettingsModel(settings);
return {
enabled: scopedSettings?.enabled ?? DEFAULT_EVAL_SETTINGS.enabled,
intervalMs: scopedSettings?.intervalMs ?? DEFAULT_EVAL_SETTINGS.intervalMs,
evaluatorProvider: scopedSettings?.evaluatorProvider ?? validatorModel.provider,
evaluatorModelId: scopedSettings?.evaluatorModelId ?? validatorModel.modelId,
followUpPolicy: scopedSettings?.followUpPolicy ?? DEFAULT_EVAL_SETTINGS.followUpPolicy,
retentionDays: scopedSettings?.retentionDays ?? DEFAULT_EVAL_SETTINGS.retentionDays,
};
}