Commit Graph

26 Commits

Author SHA1 Message Date
alan 0b8595f16e feat(web): display reported chat throughput tokens context and cost 2026-10-21 00:27:12 +01:00
alan e504780976 fix(chat): settle authoritative turns and make capabilities explicit 2026-10-20 15:45:44 +01:00
alan 9f29f387ba web: filter the chat model picker
Add a search field that narrows models by name, id or provider in place, keeps
focus while typing, and reports when nothing matches.
2026-10-20 15:04:10 +01:00
alan 4b20be6ea3 web: add chat model picker, agent badges and a preloaded brief
Show the current model under the chat title with an OpenCode-backed picker,
put an agent mark on the right of every chat row, simplify the tool summary to
'N tools', and give the reasoning and tool controls one symmetric hover box.
New chats preload an editable behavior brief, and the activity spinner remains
the turn's single live progress indicator.
2026-10-20 14:58:26 +01:00
alan f982c0b712 web: abbreviate the home directory in chat group labels
Use ~ for the server home prefix in directory bands and row meta, with the
full path still in the band's tooltip. Keeps long repository paths readable
inside the centred collapsible header.
2026-10-20 14:39:21 +01:00
alan 3799d37d7c web: one chat activity line, clearer groups and paste attachments
Replace the reasoning, tool and bottom thinking rows with one stable activity
line and refresh Stop on the step frame. Make directory and Closed bands share
an elevated square surface, centred text and a collapse toggle. Read pasted
files into the composer attachment path and show sent files in user bubbles.
2026-10-20 14:30:57 +01:00
alan f7a3a49f94 chat: add the Codex backend
Store a chat's harness with its operator session, expose chat_backends and a
backend choice in New chat, and route each session through a manager. The Codex
adapter uses the App Server's Unix WebSocket for threads, turns, history,
questions and interrupt; OpenCode remains the default and Claude is not
advertised until its sidecar and login are wired.
2026-10-20 12:10:39 +01:00
alan 3f8eefe06e web: unify detail headers, queue follow-ups, move thinking outside bubbles
Every detail screen now owns one 44px chevron Back control beside its title.
Sending appends the user's message immediately and keeps Send available beside
Stop so a follow-up can be queued. Reasoning renders above the answer bubble
rather than inside it.
2026-10-20 10:37:57 +01:00
alan ff36e777c9 web: compose with Enter, share chat titles, reserve the star
Enter inserts a newline and Ctrl/Cmd+Enter sends; slash commands still run on
Enter. Chat renames are stored in the server registry so every device sees the
same title, with a one-time upload of old local titles. The star no longer
covers the row status, and shell frames patch the background bar in place so the
composer stays mounted while streaming.
2026-10-20 03:44:16 +01:00
alan 526c19fc21 web: shared chat stars, pipeline mini graphs and agent questions
- Persist chat stars in the operator-session registry (chat_star) so every
  browser/device shows the same Starred group; migrate old local stars once.
- Add a compact pipeline graph shape to list responses and draw a lightweight
  list miniature; replace the cryptic id/version line with the stage count.
- Surface OpenCode form questions as a chat card (chat_answer), replay a
  pending form to late subscribers, and notify for background questions.
- Make the mobile dock's Search cell equal to every destination, keep the
  tab row visible with 100svh, and let Source use the full pane height.
- Let a fresh sign-in auto-connect to its own origin; use a Lax session cookie
  with Expires so Remember me survives app/link launches.
- Keep shipped starters and the skill agnostic: no repository paths, project
  areas or personal device commands; add Diagnose/Fix and Research starters.
- Refresh the installed skill and document the new browser conventions.
2026-10-20 03:11:37 +01:00
alan d130615fae web: put the work first and the audit evidence behind a door
- Turn files (input/memory/output/session) are system artifacts now: they are
  never tiles in the run or stage galleries. Shared public files are attributed
  to the visit that first recorded them, so a run counts 3 stage artifacts, not
  one copy of each per later stage.
- Audit & debug opens a dialog with vertical Input / Output / Memory / Session /
  Definition tabs, for a visit from the stage pane or the run Summary.
- Run tabs are Summary / Graph / Timeline; Input and Output are Summary sections
  with Artifacts, Files changed and Audit. Each stage pane gains Files changed.
- Artifacts gain a gallery/list switch (remembered) and full-name wrapping; the
  copy/share actions are hover-or-focus icon buttons.
- Status badge above the run title; no live badges on the run surfaces. The runs
  list leads with the pipeline name and the stored task title beneath it.
- Chat rows: title + coloured status word only, then directory, then model; no
  operator or closed chips, no dot. The more/star cluster is a hover/focus
  overlay so the title uses the row's width, and an open menu stacks above rows.
  Closed chats collapse behind a chevron. Sessions can be starred locally and
  sort in a Starred group. The chat header no longer repeats status/dir/model.
- A visible rail divider separates Search from the destinations; the page has a
  real favicon/apple-touch icon and the rail brand wears it.
- Smoke updated: no live badges, 3 detail tabs, field hits open Summary sections,
  closed chats expand for checks, the fixture viewer uses shot.png/missing.txt
  and the audit for markdown.
2026-10-20 01:00:01 +01:00
alan ccb97e424b web: a running chat reads Thinking… until a tool starts
The indicator called a silent turn "Waiting…" after 2.5s without a delta, so a
model reasoning for a minute looked idle. A running turn is now thinking for as
long as it is silent; Waiting… is reserved for a prompt queued behind the turn in
flight.
2026-10-19 23:22:33 +01:00
alan f3f800c02c Merge branch 'main' into web-chat-create
# Conflicts:
#	web/PARITY.md
#	web/src/app.js
#	web/test/chat.test.mjs
#	web/test/ui-smoke.mjs
2026-10-19 14:31:08 +01:00
alan a7872c3f31 web: create a chat through the directory picker (C2) 2026-10-19 14:25:42 +01:00
alan e514083cda Merge branch 'main' into web-chat-local
Resolve the C11/C12 vs C13 overlap in the chat work:
- PARITY: keep main's done C11/C12 rows and this branch's done C13 row.
- app.js/chat tests: keep both import/helper sets (notices and overrides/seen).
- ui-smoke: keep main's C11 background-task bar, C12 notice checks and the
  shared composer throwaway, and C13's row-menu rename/hide/seen checks.
  The composer throwaway stays a listed server session: C12 switches away
  and back to it and C13 reads its row, which an ephemeral create (2fe6301)
  deliberately hides from chat_sessions. The live-run graph halo check is
  best effort as its own comment says, so a run with no stage in flight at
  capture time skips instead of failing the whole smoke.
2026-10-19 14:07:28 +01:00
alan 3d7ad54e68 web: local rename/hide, seen markers and per-device persistence (C13) 2026-10-19 13:50:13 +01:00
alan 9231236f83 web: local command notices in chat, individually dismissible (C12) 2026-10-19 11:58:55 +01:00
alan c2db3e4966 Merge branch 'main' into web-chat-approvals
Resolve C10 vs C11 in the shared shell:
- keep both send hooks in the smoke's WebSocket shim (recording +
  scripted replies + synthetic approval acknowledgement) instead of the
  second assignment overwriting the first;
- close the .chat-approval CSS rule so the C11 background-task rules are
  not swallowed by it (the list lost its 3-row cap and scrolling);
- assert the folding invariant directly (no adjacent agent bubbles)
  instead of 'agent bubbles <= user prompts', which the growing operator
  session now legitimately breaks;
- exercise the resource clamp by scroll overflow instead of a clone
  measurement that the clamped frame makes unreliable.
2026-10-19 11:26:26 +01:00
alan 5eb13968e3 web: approval cards for chat permission requests (C10)
Completes the item the pipeline could not land: the C10 diff its own
implementer and probe assertions already verified is committed as-is.
The resource block is a padding-free six-line clamp inside a padded frame
(the app's maxLines = 6 + ellipsis) and the primary control is filled.
2026-10-19 11:08:53 +01:00
alan 8e5ce8494b web: background-tasks bar — running shells, capped list, bounded output (C11)
Add the background-tasks bar to an open conversation: heading
"Background tasks" plus "{n} running", shown only while at least one
shell is running. Rows are capped at 3 (BACKGROUND_TASK_VISIBLE_ROWS)
and the list scrolls beyond; each row is a play glyph, "Running", a
one-line shellCommandSummary and "Details" while selected. Tapping a
row toggles its detail pane ("Command"/"Task identity"/"Status:
running" plus the bounded output: spinner, error + "Retry",
"Output unavailable for this task.", "No output yet.", or the
monospace output and "Output is bounded to 64 KiB." with "Refresh").

Fold shell frames without ever marking the turn running, merge a blank
command from the previous frame, list only running shells (an exited
shell is never a task) and drop/relearn shells on reconnect via
chat_shells. Refresh always rereads the bounded 64 KiB page from cursor
0. Update PARITY.md C11 with its captures and the replayed-vs-real note.

Checks: node --check on every touched file; cd web && node --test test/
(456 pass).
2026-10-19 08:22:16 +01:00
alan 672c988136 Merge branch 'main' into web-chat-composer
# Conflicts:
#	web/src/app.js
#	web/src/client.js
#	web/src/protocol.js
#	web/test/chat.test.mjs
#	web/test/repository.test.mjs
#	web/test/ui-smoke.mjs
2026-10-19 07:33:49 +01:00
alan d9f5ba6f75 web: chat composer review fixes — real Stop, /close leaves the pane
Address the review of C8/C9: the composer's Stop control now routes to
`chat_interrupt` (`onStop`) instead of the inert submit path, and the smoke
clicks it and asserts the page's own "Stopping the running turn…" notice with
no `Action failed` dialog (captures/63b). Accepting `/close` finishes the
session locally — the running/queued bits clear and the conversation leaves
the pane for the list, mirroring Android's `finishSession` — and the smoke
asserts the select hint returns. A command notice draws the one terminal
glyph (`CHAT_COMMAND_GLYPH`, `>_`) for both states, tinted only; the growing
textarea accounts for its padding and border so six rows are six whole lines;
remove a shadowed duplicate `chatSessionById`. Wording unchanged; every pure
helper and the wire shapes remain unit-tested.

The smoke creates a throwaway session via `/new`, really prompts, really
interrupts and closes it; the operator's session is never prompted.
2026-10-19 07:26:25 +01:00
alan 7b578498ae web: live chat transcript over chat_event (C5) 2026-10-19 07:01:00 +01:00
alan f660078173 web: chat composer — send, stop, attachments, draft and slash commands (C8/C9)
Add the composer at the foot of an open conversation: a growing 1–6-row
textarea (Enter sends, Shift+Enter newline), an Attach file control with
removable attachment chips (25 MiB limit, failed attachments block sending),
one send/stop control that turns to Stop while a turn runs, and the queued
notice cleared on any incoming frame. Add the five slash commands with the
palette, the pure chatCommand* helpers and the command notices. The prompt
carries native_message_id so OpenCode accepts it, and a rejected prompt
restores the draft and attachments with the server's message. Drafts persist
per chat in memory and localStorage; attachments stay memory-only.

Tests cover every pure helper and the exact chat_prompt/chat_interrupt/
chat_create wire shapes; ui-smoke captures the composer, palette, a failed
command notice, the attachment chips and the Stop control (a real prompt to a
throwaway session that is closed in cleanup).
2026-10-19 06:53:30 +01:00
alan 7df4891f14 web: chat reasoning block and tool calls for the whole lifecycle (C6) 2026-10-19 06:14:48 +01:00
alan 0688127253 web: chat — session list, open/close, history paging, markdown, scroll (C1/C3/C4/C7/C14)
Browser Chat destination for parity with the Android app:
- session list grouped by directory (closed grouped under "Closed"), kind
  chip, activity badge, work-label meta line, "Search chats" filter (C1)
- open/close/reopen with the Android copy verbatim (C3)
- conversation history paging via the opaque next_cursor (C4)
- markdown subset renderer + code blocks (C7)
- scroll follow / "Jump to latest" / per-session saved position (C14)

Request builders in src/repository.js; pure merge/format/markdown/paging
logic in src/chat.js and src/markdown.js; view in app.js. Every server
string set with textContent, markdown built as DOM nodes.
2026-10-19 05:39:29 +01:00