diff --git a/apps/gui/src/components/play/PlayView.tsx b/apps/gui/src/components/play/PlayView.tsx index ee971a9..dccd739 100644 --- a/apps/gui/src/components/play/PlayView.tsx +++ b/apps/gui/src/components/play/PlayView.tsx @@ -242,7 +242,8 @@ export function PlayView() { return; } setSnapshot(res.snapshot); - if (res.snapshot.status === "running") { + const hasPlayer = res.snapshot.entities.some((e) => e.isPlayer); + if (res.snapshot.status === "running" && hasPlayer) { await runSteps(res.snapshot.id); } else { setLoading(false); @@ -306,12 +307,26 @@ export function PlayView() { switch (snapshot.status) { case "waiting_player": return `Waiting for your input as "${snapshot.waitingEntity?.name}"...`; - case "done": - return "Simulation complete."; case "error": return `Error: ${snapshot.error}`; default: - return "Simulation running..."; + return null; + } + }; + + const getUnifiedStatus = () => { + if (!snapshot) return ""; + switch (snapshot.status) { + case "running": + return loading ? "RUNNING" : "PAUSED"; + case "waiting_player": + return "WAITING FOR INPUT"; + case "done": + return "COMPLETE"; + case "error": + return "ERROR"; + default: + return (snapshot.status as string).toUpperCase(); } }; @@ -449,7 +464,7 @@ export function PlayView() { Status:{" "} - {snapshot.status.toUpperCase()} + {getUnifiedStatus()} @@ -457,10 +472,12 @@ export function PlayView() { {snapshot.turn} -

- {loading && "⏳ "} - {statusMessage()} -

+ {statusMessage() && ( +

+ {loading && "⏳ "} + {statusMessage()} +

+ )} {/* Scrollable Center Viewport */} diff --git a/packages/memory/src/handoff.ts b/packages/memory/src/handoff.ts index e48ec68..20e7597 100644 --- a/packages/memory/src/handoff.ts +++ b/packages/memory/src/handoff.ts @@ -239,7 +239,7 @@ ${candidatesList} } const result = response.data; - const db = (this.bufferRepo as any).db; + const db = (this.bufferRepo as unknown as { db: Record }).db; const ledgerEntries: LedgerEntry[] = []; for (const chunk of result.chunks) { diff --git a/packages/memory/src/ledger.ts b/packages/memory/src/ledger.ts index 28ada5d..0a79fc5 100644 --- a/packages/memory/src/ledger.ts +++ b/packages/memory/src/ledger.ts @@ -182,7 +182,7 @@ export class LedgerRepository { `; params.push(limit); - const rows = this.db.prepare(query).all(...params) as Record[]; + const rows = this.db.prepare(query).all(...params) as Record[]; if (rows.length === 0) return [];