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
29 lines
1.3 KiB
TypeScript
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,
|
|
};
|
|
}
|