Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/AiSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
})();

Expand Down
6 changes: 6 additions & 0 deletions src/lib/builder/bridge-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
};

Expand Down
Loading