// What the generation policy's chip says (components/piece/PolicyChip.tsx). // Without local only it is exactly what it always was: the preset, the Claude // API's model and the day's API spend. On a local-only EDITOR -- its own // answer (generation-usage's `localOnly`, the flag in the editor's // environment, demo epic D5), never umtool's environment -- it says the local // model, "local only", and no spend. Pure. export type PolicyChipInput = { preset: string; models: { api: string; local: string }; }; export type PolicyChipLabel = { preset: string; model: string; // Show the day's Claude API spend beside it. spend: boolean; localOnly: boolean; }; const shortModel = (m: string) => m.replace(/^claude-/, ""); export function policyChipLabel(g: PolicyChipInput, editorLocalOnly: boolean): PolicyChipLabel { if (!editorLocalOnly) return { preset: g.preset, model: shortModel(g.models.api), spend: true, localOnly: false }; return { preset: g.preset, model: g.models.local, spend: false, localOnly: true }; }