Merge feat/ui-polish: three-phase session model, plan graph, layout restructure

chat.tsx woven by hand: UI's session-surface layout (transcript column +
right sidebar as full-height siblings, h-10 header with PhaseChip) wrapped
in sub-agents' JobsContext.Provider; the message map carries both the
steer ternary (steers bypass the Message wrapper — the model-facing glue
text never renders) and UI's PhaseDivider emission (steers are verified
phase-boundary no-ops). Right sidebar = sub-agents' fleet panel column
(SubAgentsPanel above TreePanel, xl-only) carried onto UI's skeleton.
contracts.ts auto-merged (ChatSummary.phase/pendingQuestion + ChatListItem,
additive above the async-protocol section).

Smoke-verified on the merged tree: steer renders bare as its artifact
badge with no learner bubble, no rendered glue text, and no spurious
phase divider at the steer boundary.
This commit is contained in:
amosblomqvist
2026-09-02 16:40:47 +03:00
17 changed files with 1576 additions and 183 deletions
+11 -2
View File
@@ -1,7 +1,16 @@
import { createChat, listChats, titleFromPrompt } from "@/src/server";
import { createChat, isTurnRunning, listChats, listJobs, titleFromPrompt } from "@/src/server";
import type { ChatListItem } from "@/src/core";
/** The session picker's list: record-derived summaries (phase, pending
* question) + live liveness — a running turn OR a background job marks
* the session busy (contracts.ts ChatListItem; the store can't see
* liveness, the route is the merge point). */
export async function GET() {
return Response.json({ chats: listChats() });
const chats: ChatListItem[] = listChats().map((c) => ({
...c,
busy: isTurnRunning(c.id) || listJobs(c.id).some((j) => j.status === "running"),
}));
return Response.json({ chats });
}
export async function POST(req: Request) {