diff --git a/src/components/AiSettings.tsx b/src/components/AiSettings.tsx index ebd4af9..e304424 100644 --- a/src/components/AiSettings.tsx +++ b/src/components/AiSettings.tsx @@ -152,8 +152,14 @@ export function AiSettings({ webid }: { webid: string | null }) { if (!data) return null; if (data.summary.source === "user-pref") return `Right now your apps are built with ${data.summary.providerLabel} · ${data.summary.model}.`; - if (data.summary.source === "env-fallback") + if (data.summary.source === "env-fallback") { + const free = data.freeBalance; + if (typeof free === "number" && free <= 0) + return "You’ve used your free AI allotment. Add your own key below to keep building."; + if (typeof free === "number") + return `Right now your apps are built with the free built-in AI — ${free} free MIND left. Add your own key for a faster, smarter AI.`; return "Right now your apps are built with the free built-in AI."; + } return "No AI is set up yet — add a key below to start building."; })(); diff --git a/src/lib/builder/bridge-client.ts b/src/lib/builder/bridge-client.ts index 770ad34..a8eda94 100644 --- a/src/lib/builder/bridge-client.ts +++ b/src/lib/builder/bridge-client.ts @@ -298,6 +298,12 @@ export type AiSettings = { providers: AiConfiguredProvider[]; pref: AiPref; summary: AiSummary; + /** + * Remaining free MIND allotment, when the coder would run on the bridge's + * built-in key and the ledger is on. null when on the user's own key or the + * ledger is off — render the source-based copy unchanged. + */ + freeBalance?: number | null; catalog: AiCatalogEntry[]; };