-
LLeMbas CLI 2.0.0-beta.18
Pre-Releaseci / check (push) Canceled after 0sreleased this
2026-12-01 21:35:42 +00:00 | -138 commits to main since this releaseTerminal — a terminal as the client
- A terminal as the client (harness spec 3.12.0). What a terminal emulator with LLeMbas
built in needs from the CLI, written into the spec first (harness/acp.md, A terminal as the
client;harness/context.md§12;harness/permission/rules.md§4) and implemented here.
Such a terminal setsLLEMBAS_TTY,LLEMBAS_TTY_PANEandLLEMBAS_TTY_EXECUTABLEin every
pane; withoutLLEMBAS_TTYnothing below applies and the CLI behaves exactly as before.- Session state for the terminal's bars. The TUI publishes its state as user vars
(OSC 1337 ; SetUserVar):lembas_session,lembas_title,lembas_model,lembas_mode,
lembas_effort,lembas_state(idle,waiting,thinking,tools,writing,
asking),lembas_context,lembas_tokens,lembas_spend— on start and on every change,
each one plain line of at most 200 bytes, and emptied on the way out. Not under tmux, screen
or zellij. - Terminal context.
lembas --terminal-context <file>(the TUI andlembas run) and
/terminal-context <file>in a running TUI: a JSON file the terminal wrote with what a pane
showed — commands with their exit status and the end of their output, or the screen. It is
read once and removed, checked (version 1, 256 KiB, 20 commands, plain text only), and
attached to your next message as one<terminal>block the model is told is data from your
screen, possibly stale, never instructions. The transcript shows one line —
terminal context: 3 commands from pane 7— not the content. Only a regular file of your
own in a runtime, temporary, state or data directory is read; anything else is refused in
words and left where it is. terminal_runandterminal_read— two tools, the main agent's alone, offered only in
such a terminal and usable once you have sent a context from a pane: type a command into
that pane and press Enter, and read what the pane shows. They run the terminal's own
command-line program with an argument list, never through a shell.terminal_runis its own
permission: whatbashwould refuse (the hardline, a written deny, plan mode) is refused,
and beyond that it asks every time in manual, edit and plan mode — once, never "always" —
and followsbashin auto mode. Whatterminal_readreturns is wrapped as untrusted
terminal text.lembas complete --shell <bash|zsh|fish> --cwd <dir> [--history <file>] [--timeout-ms <n>]: the rest of a shell command line. The line so far on standard input,
only the suggestion on standard output — from your autocomplete model, through the same
request the editors' autocomplete makes. Never executed; history lines that look like they
hold a secret are not sent; no suggestion (also: no model chosen, too slow) is empty output
and status 0.lembas sessions --json: the recent sessions as one JSON array of
{id, title, model, root, updated}, newest first, for a program that offers to resume one.lembas --version --json: one object with the version, the harness spec, and
terminal_contract: 1with the capabilitiesterminal_state,terminal_context,
terminal_tools,complete_shell.lembas --versionalone is unchanged.
- Session state for the terminal's bars. The TUI publishes its state as user vars
Connection — one way for every LLeMbas product to connect
- Harness: LLeMbas connection 1 (
harness/connection.md,harness/connection.json;
conformanceaddress,version,errors). The address rule and which address is stored,
discovery and its outcomes, how a product names itself, versions judged both ways and
min_clients, a refused token, the link's handshake, close codes and liveness, one reconnect
schedule, state between programs as codes, and the table of conditions, codes and sentences.
Added
codebeside the sentence, so no program reads English: in the service'sservice.json
(linked,connecting,unreachable,timeout,tls_untrusted,not_lembas,
server_error,server_too_old,client_too_old,signed_out,replaced,not_logged_in,
disabled,stopped, …) and in theerrorevent oflembas login --json.- A failed turn says so in the prompt's answer over ACP:
_meta.lembas.error = { code, message },
as well as theerrorevent (which now carriescodetoo). An editor that draws only the
answer no longer shows a turn that ended with nothing and no reason. User-Agent: llembas-cli/<version>on every request to the server and on the link's
upgrade request; the device code'sclient_idis the same string.serve --stdioreads and logs the client'sclientInfo, answers a client that says a
higher protocol with its own (and_meta.lembas.notice, one sentence), and passes on the
server's minimum version for the client's own product (_meta.lembas.min_client).min_clientsin the server's discovery is honoured: a CLI below the server's minimum is
told so at discovery, with both versions.- Liveness on the link: a WebSocket ping every 30 s; after 60 s with nothing heard the link
is closed and dialled again, instead of sayinglinkedfor ever on a dead connection. Retry-Afteris honoured on a 429: a model request is made again after it (twice at most,
capped at five minutes, given up when the turn is stopped), and a sign-in's poll waits it out.
Changed
lembas loginstores the address that was typed, normalised — not thebase_urlthe
server's discovery names, which is now only shown. An existing login keeps working untouched,
and signing in again at the server's real address replaces it rather than adding a second one.
An endpoint discovery names on another origin is not followed, and said.lembas serviceno longer exits when it is not logged in, its token is refused, or a newer
link of the same device took its place. It stays, saysstoppedwith the code, and links
again by itself oncelembas loginhas run — a machine nobody sits at recovers without a
restart. (The unit isRestart=on-failure: exiting 0 left it down for good, and a missing key
file exited 1 and restarted every ten seconds for ever.)linkedis said only after the server'sinitializewas answered, not at the open socket;
connect and handshake together get 30 s.- The link's backoff is 1 s doubling to 60 s with ±20 % jitter, and starts over only after a
link stayed healthy for 30 s: a server that accepts and drops is no longer dialled every second. - Close code 4409 (replaced by a newer link of the same device) stops the link with
replacedinstead of dialling again. - A discovery that fails is no longer followed by a socket dial that would fail the same way.
- The sentences for a server that cannot be reached, is not LLeMbas, fails, or is too old or too
new are the harness's own (connection.json); a 5xx from discovery is "answered N", never
"not a LLeMbas instance".
Fixed
- After
lembas loginreplaced the token, a running service stopped and stayed stopped. The
key file is read at every dial, and a refusal after the key changed dials again with the new one. - A 401 is a sign-out only when it is the server's own (
WWW-Authenticate: Bearer realm="lembas"): a model provider's 401, which the server's/v1passes through, is shown
in its own words and no longer reads as "sign in again". - One rule decides whether two addresses are the same server (
lembas loginagain, the token
hand-over, an earlier login to replace), instead of two different comparisons. - The service's lock file is created exclusively and no longer trusts a recycled pid; the status
file is replaced in one step. serve --stdiogives up a connection whose client sends a line of more than 64 MB without
ending it, instead of reading it into memory.
Display — the side pane and the two transcripts
Added
- Pictures in the display, by themselves. A new Images tab shows what the agent views
withview_image, whatshowshows when it is a picture, and the images you attach or paste
(@shot.png) — the newest first,Alt+←/→through the others. The pane goes to a picture a
tool has just viewed without being asked (unless you pinned a tab) and back to Live when the
agent moves on. Pictures are drawn with the kitty graphics protocol where the terminal is
found to support it (kitty, Ghostty — the terminal is asked, nothing is configured), with sixel
where that is what it has, and as coloured blocks anywhere else, inside tmux included. Setting
images: auto | on | off(defaultauto;onasks for kitty graphics whatever was detected,
offshows the name, size and path only). - Two transcripts: full and compact. Compact groups a round of tool calls into one line —
▸ 7 tools · read ×3 · bash ×2 · edit ×2 · 14.0s— with every failure and every refusal still
on a line of its own, a running call in sight while it runs, and a change as a stat line
(src/a.ts +12 −3) instead of its diff: the detail is in the display. Setting
transcript: auto | full | compact;auto(the default) is compact while the display stands
beside the conversation and full when it does not.Alt+Tor/transcript [auto|full|compact]
switches;Ctrl+Oopens the rounds. Switching keeps your place and runs nothing again. - The display has a header and a mouse. Its first rows say the session's model, mode and
effort, how full the context is, the rate, the month's spend and the project. A click on a tab
opens it, the wheel over the pane scrolls the pane, and every list tab counts its entries
(3/12). Files thatshowshowed are listed under Files.
Changed
- The display pane is the full height of the terminal. It stands at the right from the first
row to the last, beside the prompt and the status bar, instead of ending above them. - The display no longer needs a wide terminal. It stands beside the conversation from 80
columns (it needed 100, and below that showed nothing and said nothing). On a narrower terminal
the status bar saysalt+d display, andAlt+D— or/display— puts the display in the
transcript's place and brings the transcript back; the prompt and the status bar stay. - The status bar has a short form for a narrow column (mode, model, jobs, context); what it
leaves out is in the display's header.
Fixed
- The display's tab bar, title line and key line no longer run past a narrow pane or lose their
middle: each takes the longest form that fits its row. - The welcome box's key hints and the prompt box's placeholder no longer break in the middle of a
phrase in a narrow column; a placeholder that wrapped left the prompt box two rows high. - A word in the status bar that is longer than the bar is cut to it instead of running over the
mode and the model.
Downloads
- A terminal as the client (harness spec 3.12.0). What a terminal emulator with LLeMbas