Repository navigation
1.0.1
First published release of the fork, as @lenucksi/agentterm (the npm name
opencode-pty belongs to the upstream project). The plugin id, the daemon socket,
the state directory and the storage keys keep the old name on purpose: renaming
them would strand a running daemon and orphan the archive.
Added
Named keys, quiet waits, and an installer with both edges
pty_sendkeysends a key by name -Enter,Tab,Escape, arrows,
Home/End/PageUp/PageDown,C-a..C-z,F1..F12- withtimesto
repeat.pty_writemakes a model spell bytes, and a wrong byte is not an error,
it is a prompt that does not move. A name the terminal does not have is refused
with the list of names that exist; a command still goes throughpty_write,
where the permission policy sees it.pty_waittakesquietMs: return once the session has printed nothing for that
long, with the process still running. That is how a prompt is awaited without a
pty_readloop. The result says which ending it had (reason="quiet"or
"exit"), and a quiet one has noExit:line, because there is no exit status.agentterm-mcp installprints the two edges this package is reached through:
the OpenCode plugin entry (the one file--writetouches, merging into the
existingpluginarray with a.bakfirst) and the MCP server block for
everything else (mcpServers,claude mcp add, or a printed TOML block for
Codex). Nothing is written without--write.
Third-party notices in the docs dialog
The Docs dialog has a third tab, Licences. It lists every installed package
grouped by licence, with the package count per group and name@version under it,
plus four credits lines for the projects this repository is built on. The package
data is generated at build time from bun pm licenses --json into
dist/licenses.json and served by GET /api/licenses, so the tab cannot fall out
of step with the lockfile. The artifact is sorted and stripped of paths and other
machine metadata, which makes a rebuild on an unchanged lockfile byte-identical.
Rolling the daemon from both surfaces
The daemon is machine state that every OpenCode instance on the machine shares:
one socket, one pid file, one process that owns every PTY. Until now the only
way to roll it was the /pty-daemon-restart command, and only the server half
answered it - so a surface that is not the server could not ask.
There is now one roll, reachable from everywhere:
- the TUI sidebar footer grows a second line,
daemon · restart, with the
pid of the daemon that answered the last roll. Clicking it rolls the daemon;
the line saysdaemon · restarting…while the roll runs and the result
arrives as a toast. - the web interface gets a Restart the daemon button in the settings,
with the answer next to the button. The button is disabled while a roll runs:
two rolls at once are how a machine ends up with two daemons.
Both ask the half that owns the client - the server half, over the plugin's own
RPC and over POST /api/daemon/restart respectively - because the daemon
belongs to the server, not to the surface that asks.
A roll ends every session the daemon owns: the PTY masters belong to that
process. The archive on disk survives.
Every roll is announced to every surface, marked with the id of the action that
started it. The surface that started it recognises its own mark and stays quiet (it
already shows the answer); every other one shows it. So a roll from the browser
reaches the TUI's sidebar, and the other way round.
The sidebar's line now shows the running daemon's pid, refreshed by the panel's
poll rather than only by its own roll, so a roll started anywhere is visible there
within a tick.
Toasts in the web interface
The web interface shows what the server half says: a slash command's result, a roll
started in another surface. The notice arrives over the WebSocket the page already
holds, with the same shape the TUI half turns into a toast.
Failed actions are toasts now too — input the server could not write, a session it
refused to remove, a bulk removal that failed, an undo that did not restore. They
used to be a line in the browser's console, which is to say invisible.
The toolchain is Bun's wherever Bun can do the job
bun check replaced tsc --noEmit for type checking, bun fmt replaced Biome's
formatter (configured through a [fmt] section in bunfig.toml; Biome keeps the
lint), and copyfiles was replaced by scripts/copy-tool-texts.ts. tsc stays
only as the emitter, for the two things Bun does not do: .d.ts and rewriting
.ts import specifiers to .js. The tree is formatted by bun fmt; the web
interface's typecheck no longer needs a build in the tree.
Fixed
-
bun auditwas run to the end, and the gate had been red for longer than
anyone knew. Four transitive advisories are overridden inside their carriers'
declared ranges (body-parser, twoundicimajors,zod);tomlis the one
that leaves a range, because its fix is a major bump and the alternative was a
gate that ignores three high advisories. No--ignoreremains. -
The typecheck needed a build in the tree (TASK-12): the web client imported
its own shared types by package name, which resolves through the export map into
dist/. Those imports are relative now, andbun checkpasses withdist/
deleted. -
A rebuild no longer white-screens a running interface. The static route map is
built once, at start, whileindex.htmlis read per request — so a rebuiltdist/web
handed the browser content-hashed asset names the running server had never seen. The
miss fell through to the redirect, and the browser got HTML for a.jsmodule: a white
page with a MIME-type error. A missing asset is now read from disk, and one that is
really absent answers 404 instead of the shell. -
A path the app does not have lands on
/, not on/index.html.
Security
ip-addressis overridden past a moderate advisory.ip-address@10.7.3
(Address6 matching a zone identifier in quadratic time) reached the lockfile
throughexpress-rate-limit— in the MCP SDK's express stack — and through
socks. Neither is instantiated here: the MCP route is stdio-only. The override
is inside the contract, since both carriers declareip-addressas^10.x.