fix(x): grant first_app_built credit for copilot-built apps

The reward only fired in the apps:create IPC handler, which no UI path
invokes — the copilot builds apps by writing the folder directly, so the
credit never triggered. Fire it from apps:list instead, off observed
state: any valid non-installed (kind=local) app counts as built.
Catalog installs (.rowboat-install.json present) don't count.
This commit is contained in:
Gagan 2026-07-20 16:15:41 +05:30
parent 033cc6d351
commit a2971a08f9

View file

@ -1814,6 +1814,13 @@ export function setupIpcHandlers() {
lastAppsFingerprint = fingerprint;
invalidateCopilotInstructionsCache();
}
// The copilot builds apps by writing the folder directly — apps:create is
// never on that path — so the first-app reward triggers off observed
// state instead: a valid non-installed app means the user built one.
// Cheap on repeat polls (maybeActivateCredit short-circuits once claimed).
if (apps.some((a) => a.kind === 'local' && a.status === 'ok')) {
void maybeActivateCredit('first_app_built');
}
return {
serverRunning: status.running,
...(status.error ? { serverError: status.error } : {}),