Commit Graph
40 Commits
Author SHA1 Message Date
kosmos d310735c71 room: steer mid-turn chat to the next step boundary
ci / test (pull_request) Successful in 54s
ci / chart (pull_request) Successful in 4s
ci / web (pull_request) Successful in 16s
ci / docker (pull_request) Successful in 1m42s
ci / publish-edge-image (pull_request) Skipped
ci / publish-edge-chart (pull_request) Skipped
ci / checks (pull_request) Successful in 51s
A message posted without a mention while the agent worked waited for the
next turn, so the model read it only once the work the line was about was
finished. The spec's turn rules already promised the mid-turn half ("the
next step of the running turn"); the runner implemented the turn-boundary
half only.

The turn now hands the framework a steering source. The driver drains it
between two steps and appends one User-role message per drain, so the line
lands in the history without the step in flight dying. The drain stops at
the first line it cannot carry -- a mention, which the drop path owns, or a
message with images, which a line cannot -- and leaves the cursor there, so
the boundary pass appends them in the log's order. What it drains advances
`absorbed_seq`, so nothing is appended twice.

A mention still drops the turn: that is the only way to stop a running
command, and this change does not touch it.
2026-12-02 13:18:14 +00:00
vhaudiquet 2e17e7463c feat: add image attachments for vision models
ci / checks (push) Successful in 56s
ci / test (push) Successful in 1m1s
ci / chart (push) Successful in 6s
ci / web (push) Successful in 29s
ci / docker (push) Successful in 2m37s
ci / publish-edge-image (push) Successful in 11s
ci / publish-edge-chart (push) Successful in 4s
A chat line can carry up to four images, each capped at 5 MB and
sniffed from its bytes. Uploads go to a room route first, the message
references the ids, and the bytes are served back to members; an
upload no message claims within an hour is swept on the next send.

Images only make sense when the model can look at them, and the
catalog's answer is tri-state, so the gate is a stored fact, not a
guess: the provider listing remembers supports_vision per kind and
model, the upload and send routes refuse when the room's effective
model is not a known vision model, and the composer hides the attach
button on the same fact, which rides the room payload. At turn time
the fact goes to the host agent, which sends the blocks on a vision
model and leaves a note where each image was on the rest.
2026-12-01 21:59:53 +01:00
vhaudiquet acc545ede7 feat(web): color the file viewer with highlight.js
ci / checks (push) Successful in 50s
ci / test (push) Successful in 55s
ci / chart (push) Successful in 6s
ci / web (push) Successful in 19s
ci / docker (push) Successful in 14s
ci / publish-edge-image (push) Successful in 9s
ci / publish-edge-chart (push) Successful in 4s
The viewer rendered every file as plain text, so keywords, strings, and
comments in Rust, TypeScript, and the rest read as one color. Replace
the hand-written scanner explored for this with highlight.js, pinned to
the seventeen languages the viewer can open, so the client bundle stays
near 28KB gzip and unknown files still render as escaped text.

The output is class names only. The .hljs-* classes map onto the
--syntax-* tokens from the palette, so light and dark follow the
existing media query and no color bypasses the stylesheet.
2026-12-01 19:33:16 +01:00
vhaudiquet 880f4e2d87 feat(web): list the room's people and let the owner remove them
ci / checks (push) Successful in 54s
ci / test (push) Successful in 58s
ci / chart (push) Successful in 5s
ci / web (push) Successful in 21s
ci / docker (push) Successful in 11s
ci / publish-edge-image (push) Successful in 10s
ci / publish-edge-chart (push) Successful in 3s
The invite dialog was reachable only from the invite button, and who was
in the room showed only as avatars in the top bar. Selecting an avatar,
the member count, or the People button now opens one dialog: a
scrollable member list with the invite link below it.

The owner removes a member from the row after a confirmation, and the
top bar drops them without reloading the room. The server already
refuses to remove the owner. Invite link creation is unchanged.
2026-12-01 10:34:46 +01:00
vhaudiquet 7d98b04d63 feat(web): expand folders in place in the file browser
ci / checks (push) Successful in 53s
ci / web (push) Successful in 18s
ci / publish-edge-image (push) Successful in 9s
ci / publish-edge-chart (push) Successful in 3s
ci / test (push) Successful in 56s
ci / chart (push) Successful in 4s
ci / docker (push) Successful in 10s
Opening a folder replaced the root listing, so every step inward lost
the way back and the tree above it. A folder now opens under its
parent, nested folders open under theirs, and the root stays visible.

Each folder is read again when it is expanded, so files a turn added or
removed show up the next time the folder opens. The size column hides
below 260px of list width, where the indent leaves no room for both a
name and a size.
2026-12-01 01:09:12 +01:00
vhaudiquet b5babb682e build: depend on the Rhema crates by version
ci / chart (push) Successful in 5s
ci / checks (push) Successful in 55s
ci / test (push) Successful in 1m1s
ci / web (push) Successful in 18s
ci / docker (push) Successful in 2m1s
ci / publish-edge-image (push) Successful in 11s
ci / publish-edge-chart (push) Successful in 3s
The manifest pointed at `../rhema`, so a build needed that checkout
beside the repository. CI cloned it in two jobs and the Dockerfile
cloned a tag and rewrote the paths. The committed lock had drifted to
0.5.1 entries after the framework bumped to 0.5.2, so the first cargo
command in a clean tree rewrote it.

All twelve crates are on crates.io at 0.5.2, so the manifest names that
version and the lock pins it. The clone steps, the `RHEMA_REF`
argument, and the path rewrite are gone from the workflows and the
image. Moving the framework now means `cargo update` on the `rhema-*`
packages.
2026-11-30 22:42:01 +01:00
vhaudiquet 89aca58364 feat(web): open the side pane on Preview
Files was the first tab and the one selected when the pane opened. The
preview is what a room looks at while the agent works, so it comes
first and is selected on open. Files is second and Terminal last.

The panel order in the body follows the tabs, so the tablist, the DOM
order, and arrow-key navigation stay in step.
2026-11-30 22:38:31 +01:00
vhaudiquet 4d9530cc34 Revert "feat: add reverse ssh sandbox targets"
This reverts commit d85f68a176.
2026-11-29 21:34:09 +01:00
vhaudiquet d85f68a176 feat: add reverse ssh sandbox targets
A sandbox behind NAT could not reach the room. A reverse target dials a tunnel-only sshd on the server, forwards localhost:22 to a loopback port, and the worker connects there.

The server assigns the port and writes one authorized_keys line per tunnel target. The key carries permitlisten for that port; the sshd allows remote forwarding only, with no shell or local forwarding. The tunnel private key is shown once and never stored; rotating it rewrites the file. The target list and setup dialog carry the command, and the docs include the sshd config and sidecar requirements.
2026-11-29 19:25:14 +01:00
vhaudiquet fc684115b5 feat: run sandbox transports in disposable workers
The control plane opened ssh connections itself, so a malicious ssh
server attacked the process that held the database, the master key, and
every room's keys. It now starts one worker per target and workspace.
The worker gets one target key on stdin, binds loopback behind a random
token, and serves exec, files, the pty, and the preview proxy. It has no
database and no master key, and a closed stdin ends it.

The preview HTTP client moved into the worker too. The app sees a typed
response, and the worker caps bodies, output tails, handshakes, and
transport waits.

Direct targets now reject loopback, private, link-local, multicast,
unspecified, carrier-grade NAT, and documentation addresses when a
target is created and again when its worker starts.
TOGETHER_ALLOW_PRIVATE_TARGETS=1 lifts the check for a server that runs
on one private network.
2026-11-29 18:22:44 +01:00
vhaudiquet a8f7e74ba0 feat(web): render messages as markdown
ci / docker (push) Successful in 16s
ci / checks (push) Successful in 1m58s
ci / test (push) Successful in 1m54s
ci / chart (push) Successful in 5s
ci / web (push) Successful in 18s
ci / publish-edge-image (push) Successful in 9s
ci / publish-edge-chart (push) Successful in 3s
Messages were plain text, so headings, lists, code, tables, and links
from people and the agent showed as literal markup. Render them with
markdown-it, with raw HTML off and unsafe link schemes blocked.
External links open in a new tab, and @rhema stays highlighted.

Code, tables, quotes, and images get styles that fit the message body.
2026-11-28 22:23:41 +01:00
vhaudiquet d4aac727ad feat(web): resize the file list in the Files pane
ci / publish-edge-image (push) Successful in 11s
ci / checks (push) Successful in 1m58s
ci / test (push) Successful in 2m1s
ci / chart (push) Successful in 6s
ci / web (push) Successful in 16s
ci / docker (push) Successful in 1m45s
ci / publish-edge-chart (push) Successful in 4s
The split between the file browser and viewer was fixed. A separator
now drags it, with a 140px minimum and a 55% cap, and the arrow keys,
Home, and End do the same. The width survives a reload.

When the pane stacks the list above the viewer, the separator turns
horizontal and saves a separate height.
2026-11-28 19:20:07 +01:00
vhaudiquet ca333509a2 fix(web): stop the chat scroll bouncing on multiline input
The auto-resize reset the textarea to auto before measuring, which
collapsed it to one row for a frame. That resized the chat viewport,
the browser clamped its scroll to the old bottom, and the next input
scrolled back.

Measure the content in a hidden copy instead. The composer reports a
height change, and the room keeps the chat at the bottom only when the
reader is already there.

Typing and deleting lines now keeps the chat at the bottom without the
jump.
2026-11-28 19:00:56 +01:00
vhaudiquet f5087220da feat: sign in to Copilot, ChatGPT, and Mistral Vibe
Three provider kinds have a browser sign-in, but the add-provider
dialog only accepted a pasted key. A per-account login record now runs
the adapter's InteractiveLogin on the server, reports the instruction,
URL, and code to the dialog, and stores the credential before the
browser sees completion. The credential never reaches the client.

The dialog gets a sign-in stage for flow kinds, with a link, a
copyable code, and retry after failure. Closing the dialog cancels the
flow. ChatGPT's callback lands on the server's loopback port, and the
instruction names the port to forward.
2026-11-28 18:06:21 +01:00
vhaudiquet 369075a842 feat: add providers without a default model
The add-provider form asked for a model even though the room owns that choice. It now asks for a name, kind, base URL, and key. New providers store no default, and New room requires a model before it can submit.

Existing providers keep their model as an optional default. The model picker hides the Provider default row when there is none, and a room with no usable model gets a clear error instead of an empty model reaching the provider.
2026-11-28 17:31:52 +01:00
vhaudiquet 2216f37422 feat: pick the room model from a catalog dialog
The room model was a free-text field. It now opens a dialog that lists the provider's live catalog through the same adapter a turn uses, with context, output, price, and vision from models.dev. Rows filter by text, vision, or free price, and a custom id remains available when the provider lists nothing.

The dialog is nested over room settings, so BaseDialog now gives Escape and the focus trap to the top dialog only. Clearing the model stores NULL, which returns the room to the provider's default.
2026-11-28 17:21:48 +01:00
vhaudiquet 2d36790fe1 prompt: ask for shorter, conversational room messages
ci / test (push) Successful in 2m0s
ci / chart (push) Successful in 5s
ci / checks (push) Successful in 1m53s
ci / web (push) Successful in 16s
ci / publish-edge-image (push) Successful in 10s
ci / docker (push) Successful in 1m44s
ci / publish-edge-chart (push) Successful in 4s
Replace the generic "something to say" rule with a length and
conversation-style rule, allow "Ack." or "Done." before the last message,
and drop the request for a file and check summary at the end of a turn.
2026-11-28 16:37:44 +01:00
vhaudiquet 09b7c9822e fix(web): show an icon-only settings link on mobile
ci / test (push) Successful in 1m58s
ci / docker (push) Successful in 10s
ci / checks (push) Successful in 1m57s
ci / chart (push) Successful in 6s
ci / web (push) Successful in 17s
ci / publish-edge-image (push) Successful in 9s
ci / publish-edge-chart (push) Successful in 3s
2026-11-28 16:07:25 +01:00
vhaudiquet 697f8de69d fix: serve static previews past the exec output cap
ci / chart (push) Successful in 5s
ci / web (push) Successful in 16s
ci / publish-edge-image (push) Successful in 10s
ci / checks (push) Successful in 1m51s
ci / test (push) Successful in 1m59s
ci / docker (push) Successful in 1m44s
ci / publish-edge-chart (push) Successful in 4s
The exec tail keeps only its last 50 KiB, so a larger file arrived
without the probe's status line. Probe for existence and size, then read
the file through the sandbox's read_file route, which captures up to
32 MiB.
2026-11-28 12:35:37 +01:00
vhaudiquet aab0d0a2ec ci: authenticate package pushes with a repository secret
ci / checks (push) Successful in 1m49s
ci / test (push) Successful in 1m56s
ci / chart (push) Successful in 5s
ci / docker (push) Successful in 6s
ci / web (push) Successful in 16s
ci / publish-edge-image (push) Successful in 11s
ci / publish-edge-chart (push) Successful in 4s
Gitea's job token is not accepted by the container registry. Use the PACKAGES_TOKEN repository secret for the image and chart logins.
2026-11-28 12:03:05 +01:00
vhaudiquet 135dd3143c ci: run the image smoke test in the job network
ci / test (push) Successful in 2m3s
ci / web (push) Successful in 16s
ci / checks (push) Successful in 1m48s
ci / chart (push) Successful in 6s
ci / docker (push) Successful in 6s
ci / publish-edge-image (push) Failing after 4s
ci / publish-edge-chart (push) Skipped
The job container cannot reach a port published on the Docker host loopback. Start the app in the job's network namespace and check it on localhost.
2026-11-28 11:57:37 +01:00
vhaudiquet 22c838eafe ci: use the job token for package pushes
ci / checks (push) Successful in 1m52s
ci / test (push) Successful in 1m57s
ci / web (push) Successful in 16s
ci / chart (push) Successful in 5s
ci / docker (push) Failing after 2m14s
ci / publish-edge-image (push) Skipped
ci / publish-edge-chart (push) Skipped
The workflow already requests packages: write, so the built-in Gitea token can log in to the container and Helm registries. This avoids a repository secret that does not exist yet.
2026-11-28 11:48:48 +01:00
vhaudiquet 3c19c1b5db ci: pin the Rust toolchain for CI
ci / web (push) Successful in 18s
ci / publish-edge-image (push) Canceled after 0s
ci / publish-edge-chart (push) Canceled after 0s
ci / checks (push) Successful in 1m57s
ci / test (push) Successful in 2m0s
ci / chart (push) Successful in 5s
ci / docker (push) Canceled after 18s
The setup action installs only the compiler by default. Declare rustfmt and clippy so the format and lint steps find them, and pin the version the image uses.
2026-11-28 11:43:37 +01:00
vhaudiquet 51b7a5e80b ci: publish the image and chart from CI
ci / chart (push) Canceled after 0s
ci / web (push) Canceled after 0s
ci / checks (push) Failing after 1m26s
ci / docker (push) Canceled after 0s
ci / publish-edge-image (push) Canceled after 0s
ci / publish-edge-chart (push) Canceled after 0s
ci / test (push) Canceled after 1m26s
Build and test the server, client, and chart on every push. Main pushes publish the rolling image and a timestamped chart whose appVersion is the commit; v* tags publish exact and stable image tags.
2026-11-28 11:41:11 +01:00
vhaudiquet 7f494b28de feat(web): add live activity status and collapse turn details
The composer now has one status line for `Rhema is working...` and
typing peers. It replaces the separate typing paragraph.

A running turn no longer adds a transcript card. When it ends, the log
shows a collapsed `rhema finished · N steps` line. Thinking, draft text,
tool calls, and usage live inside it. The event replay starts at the
oldest loaded message so completed turns rebuild after a reload.
2026-11-28 11:35:21 +01:00
vhaudiquet 36de0aace7 feat: add static previews to the room pane
The preview tool could only name a port, so a static build needed a
server the terminal had to keep alive. `preview` now accepts a path:
the app reads the file or folder over the room's ssh sandbox and serves
it from a signed host, with `..` and dotfiles refused and a 16 MiB cap.

The target is stored with the room and replayed as a durable event. The
pane shows a static path with a reload control and keeps the port field
as a local fallback.
2026-11-28 11:24:57 +01:00
vhaudiquet 5be17cf4ef feat(web): make the room panes resizable
Drag the divider between the conversation and the workspace, or focus
it and use the arrow keys. The width stays between 380px and enough
room for a 420px conversation, and is stored in localStorage so it
survives reloads.

Below 1100px the workspace remains a fixed overlay, so the divider is
hidden there.
2026-11-28 10:53:30 +01:00
vhaudiquet e579653f75 feat(web): bundle Fira Code Nerd Font for the terminal
Use Fira Code Nerd Font Mono in the monospace UI, including the
terminal. The font carries Nerd Font glyphs for prompts and tools, and
Fira Code's contextual ligatures apply in xterm's DOM renderer because
it groups same-style cells into spans.

The terminal waits for the regular and bold faces before opening so
xterm measures cell widths with the final font.
2026-11-28 10:48:10 +01:00
vhaudiquet 05660a244b revert: keep xterm.js for the terminal
ghostty-web 0.4.0 corrupts cell positions after the pane resizes or remounts. In testing, seq output became a diagonal staircase and reopening at a new width mixed the prompt with old output. The release also has open bugs for Alt-key input and idle repainting. Keep xterm.js until those are fixed.
2026-11-28 10:37:57 +01:00
vhaudiquet 3f61dd4db8 feat: render the terminal with ghostty-web
ghostty-web runs Ghostty's VT parser as WebAssembly behind an xterm-compatible API. The component keeps its lifecycle; the imports and the WASM bootstrap change. The emulator imports on demand, so the 624 KB chunk loads only when the terminal pane opens.

The CSP needs wasm-unsafe-eval for WebAssembly compilation and data: in connect-src for the inlined module the library fetches. The terminal renders to a canvas, so the xterm stylesheet and FitAddon package are gone.
2026-11-28 10:36:17 +01:00
vhaudiquet 808a78afa8 test: build config values with struct update
Clippy rejects assigning fields after Config::default(). Initialize the preview and public URL fields in the struct literal instead. No behavior changes.
2026-11-28 10:36:17 +01:00
vhaudiquet f21fdfd729 fix: accept either the page host or the public url
An upstream proxy may rewrite Host to its own address. Keep the
configured public_url as a fallback so the terminal and presence
sockets still pass in that setup, while the Host check covers localhost
and LAN addresses.
2026-11-28 02:19:44 +01:00
vhaudiquet be04a6cf90 fix: accept terminal sockets from the page host
The origin check compared the browser's Origin with the configured
public_url. Reaching the app through localhost or another LAN address
then rejected the terminal and presence sockets even though the page
and the socket were on the same origin.

Compare the Origin authority with the request's Host header instead.
That is the address the browser actually used, so the check still
refuses another site while working behind a proxy and on every local
address.
2026-11-28 02:18:22 +01:00
vhaudiquet d7aa268ae0 feat: fold the sidebar to a rail
A toggle at the top of the sidebar collapses it from 232px to a 64px
rail with the logo, room initials, and the bottom actions. Opening it
again restores the room names. The choice is stored in localStorage and
restored on the next visit.

The toggle is hidden on the horizontal mobile bar, where the sidebar
already runs as a single row.
2026-11-28 02:12:10 +01:00
vhaudiquet 3b82719d56 feat: add account avatars and a deployable image
Accounts get a profile page with an uploaded picture, shown in the
sidebar, the room bar, and every human message. Pictures live in the
SQLite database and are served through an authenticated route.

Hardening from the security audit: preview hosts expire after 24 hours
and carry no-referrer; removing a member or archiving a room ends their
event feed, presence socket, and terminal within seconds; previews and
the terminal pin the SSH host key; invites are claimed atomically;
missing accounts spend the same argon2 time as wrong passwords;
registration is closed by default; WebSockets check the origin; and the
master key is created with mode 0600.

The Dockerfile builds one image with the static client and the server.
The Helm chart runs a single replica with a SQLite volume, a wildcard
preview ingress, and the proxy settings the event feed and uploads
need. It refuses more than one replica because state is in process.
2026-11-28 02:07:26 +01:00
vhaudiquet 7e7a1d2bb6 feat: use the Rhema logo and capitalize the brand 2026-11-28 01:36:29 +01:00
vhaudiquet 5237a477d7 feat: open provider and sandbox forms in dialogs 2026-11-28 01:36:29 +01:00
vhaudiquet bd3aed67b4 docs: describe a local-network run 2026-11-28 01:17:12 +01:00
vhaudiquet 0035f4e031 feat: add the multiplayer room server and client
A room is one conversation, one ssh sandbox, and one agent. Accounts
create rooms; friends join through a single-use invite link and a
display name; the agent speaks only through the message tool.

The server is Axum and SQLite. It serves the built Nuxt client, streams
room events over SSE, and runs one serialized turn loop per room with
turn-level steering copied from rhema-code. The client has the chat,
preview iframe, read-only file pane, xterm terminal, and presence.

Preview URLs are signed wildcard hosts, and the proxy tunnels HTTP over
ssh direct-tcpip. HostAgent::step remains deferred in the framework.
2026-11-28 01:09:37 +01:00
vhaudiquet 04dd63c4ca docs: add the rhema-together spec 2026-11-28 00:36:45 +01:00