Commit graph

19360 commits

Author SHA1 Message Date
Simon Klee
795f78fde3
wip: before the machine move 2026-11-05 12:36:11 +01:00
Simon Klee
ba712f9654
chore(cli-rs): drop an unused mini dependency 2026-11-05 01:03:59 +01:00
Simon Klee
c893a178db
refactor(cli-rs): drop not_built now that every command is built
mini was the last command stub; the helper was left unused and failed clippy's dead-code check.
2026-11-05 01:02:57 +01:00
Simon Klee
7d656b33a7
feat(cli-rs): add the mini shell (M.1)
opencode-rs mini runs in a split footer and writes the session's transcript to the scrollback above it: the flags, piped stdin, session resolution behind the first frame, replay on resume and resize with --replay-limit, the theme quantized to the palette and mono output, SIGUSR2 theme reload, OPENCODE_SHOW_TTFD and OPENCODE_DIRECT_TRACE. The prompt, request footers, and tool output are stubs for M.2 to M.4. P-PTY scenarios in parity/scenarios/M.1 match the TS mini.
2026-11-05 01:00:01 +01:00
Simon Klee
6b6caff206
test(cli-rs): record scrollback and resize the terminal in P-PTY
Mini writes its transcript into the terminal's scrollback, which the embedded terminal's screen() does not show. A checkpoint can now also record rows scrolled back above the screen, and a step can resize the pseudo-terminal and the emulator.
2026-11-05 01:00:01 +01:00
Simon Klee
5607de3a87
refactor(cli-rs): share the activity calendar with the stats poster
The TUI /stats poster had its own activityCalendar port and time zone
lookup. Move C.3's activity_calendar and time_zone, with the TS oracle
test, to opencode-ui and use them in both. Number formatting stays
apart: TS uses formatNumber in the CLI and statsNumber in the TUI.
2026-11-05 00:49:49 +01:00
Simon Klee
c873c5c556
fix(cli-rs): keep --print-logs records off the TUI screen
Capture stderr while the full-screen TUI runs. Records go to the
console and reach the real stderr once the terminal is restored. TS
draws them over the screen; see parity/deviations/G02-print-logs-tui.md.
2026-11-05 00:49:49 +01:00
Simon Klee
586360f821
refactor(cli-rs): delete unused prompt kit options
Every CLI step is merged, so drop the kit-wide dead_code allowance and
the builder options nothing calls: output on confirm, text, select,
multiselect, password and spinner; the spinner timer and messages;
password mask; multiselect max_items and cursor_at; autocomplete
placeholder and initial values. Options only the prompt demo uses keep
an item-level allowance. signals::on_shutdown had no allowance left.
2026-11-05 00:49:49 +01:00
Simon Klee
39c15c3516
docs(cli-rs): record the pair --remote channel deviation
TS writes the remote route into its own build channel's config, so
pair --remote times out when OPENCODE_CHANNEL differs (decision O-39).
2026-11-05 00:49:49 +01:00
Simon Klee
edb0cc9773
refactor(cli-rs): share the TS QR encoder with the pair dialog
The TUI /pair dialog drew its code with the qrcode crate, which picks
other masks than packages/util/src/qr.ts. Move the C.9 port to
opencode-ui so both use it, and drop the qrcode dependency.
2026-11-05 00:49:49 +01:00
Simon Klee
de9012540b
refactor(cli-rs): drop the C.12 notes from the filled ACP modules 2026-11-05 00:46:17 +01:00
Simon Klee
a90aa21263
test(cli-rs): compare acp --login with TS under a PTY
The scenario reuses C.8's sandbox registration of the fake server and C.5's
integration routes and URL sink, so no real service or account is touched.
2026-11-05 00:46:17 +01:00
Simon Klee
8828799341
test(cli-rs): port the remaining in-process ACP suites
permission, elicitation, config-option, replay, compaction,
additional-directories, and catalog, plus the location, diff, compaction,
replay, and permission-title cases C.11 left out of its ported files.
2026-11-05 00:46:17 +01:00
Simon Klee
e96e29c247
feat(cli-rs): fill in the ACP tools, permissions, forms, replay, compaction
Tool calls carry locations, read display text, and images. Permission asks get
the TS titles, previews, and locations, and completed edits get full-file diffs
(ports of the patch format and jsdiff's apply). Question forms go out as
elicitations, session/load replays history, and compactions report standard
updates or markers. acp --login runs auth login in-process.
2026-11-05 00:46:17 +01:00
Simon Klee
4caad4ba6f
docs(cli-rs): point test references at tests/all
The TUI and UI integration tests moved under tests/all; comments and
step docs name the new paths, and docs/H.2.md and AGENTS.md give the
--test all commands.
2026-11-05 00:34:34 +01:00
Simon Klee
7b85d84042
chore(cli-rs): apply cargo fmt
review_ms1.rs, root.rs and ui/src/theme/mod.rs differed from cargo fmt.
2026-11-05 00:34:34 +01:00
Simon Klee
e3b044de70
fix(cli-rs): open the terminal socket at the restarted service
pty::connect built the socket URL from the client's base URL, so after
the service restarted on a new port the ticket request followed it but
the socket went to the old port. Transport::route maps a URL to where a
request would go now; the following transport points it at the current
service, as the TS TUI rebuilds persistentPty with the new URL.
2026-11-05 00:34:34 +01:00
Simon Klee
2ec8021034
chore(cli-rs): keep dev debug info out of the link
split-debuginfo = "unpacked" and line tables only for dependencies cut
the TUI test link from 2.3 GB to 1.05 GB peak RSS and 0.8 s to 0.4 s.
Backtraces still show file and line.
2026-11-05 00:34:34 +01:00
Simon Klee
e631ec5fc1
test(cli-rs): link the TUI and UI integration tests as one binary each
Each tests/*.rs file linked its own binary with the static opentui and
tree-sitter set, about 2 GB per link. tests/all/main.rs now declares the
former files as modules, so a suite run links once per crate, and the
shared helpers compile once under support.
2026-11-05 00:34:34 +01:00
Simon Klee
e311b6949a
test(cli-rs): move TUI and UI integration tests under tests/all
A pure rename so rebases follow the files; the next commit adds the
single test crate root that declares them as modules.
2026-11-05 00:34:34 +01:00
Simon Klee
d8aa7485cb
refactor(cli-rs): keep app-wide key layers now that dropping unregisters
opentui-rust's keymap now undoes a registration when its Disposer drops
(G.13). The install functions that dropped their layer handles forget()
them, so those layers stay for the keymap's lifetime. Views drop their
handles instead of calling dispose(), and the comments that said a
dropped Disposer keeps its layer are gone. Views still defer their
release past the current event, because a command may drop its own view.

Needs opentui-rust keymap-disposer, which adds Disposer::forget.
2026-11-05 00:33:32 +01:00
Simon Klee
f926d9a0d5
test(cli-rs): compare the command wizard with TS
P-PTY over a group, the root, api, session list, mcp add, a cancel, an escape,
and an invalid value; P-CLI with keys and with nothing on a pipe.
2026-11-05 00:29:49 +01:00
Simon Klee
cbd79ff280
feat(cli-rs): add the --wizard command wizard
Port Effect CLI's wizard: it asks for the selected command's flags and arguments,
or for a subcommand, with Effect's select, confirm, toggle, integer, and text prompts,
prints the command line, and runs it after a confirmation by running the binary
again with it. Required arguments are not checked next to --wizard, so it can ask
for them. The prompts share the Clack kit's raw mode and key decoding.
2026-11-05 00:29:49 +01:00
Simon Klee
900b6e17d7
test(cli-rs): build Mermaid code blocks with the closed flag (P.3)
TS keeps the last good diagram whether or not the fence has closed (markdown.ts has no such check), so the renderer itself does not read CodeBlock::closed.
2026-11-05 00:27:20 +01:00
Simon Klee
0ac690511a
test(cli-rs): prove Mermaid fences render in the transcript (P.3) 2026-11-05 00:25:23 +01:00
Simon Klee
b0114b4687
feat(cli-rs): drag wide Mermaid diagrams sideways (P.3)
Port StaticDiagramRenderable's left-drag scrolling and horizontal-wheel capture, record the layout dead ends that show the code as a deviation, and bring the design note up to date.
2026-11-05 00:25:23 +01:00
Simon Klee
c6ddbf7c34
feat(cli-rs): render Mermaid state diagrams (P.3)
Port merman's state parser, layout, note placement, routing and drawing, with the spatial index they share. Measure text with string-width's wide set, so emoji arrows such as the fold check's count two cells as in TS. All 496 cases of the P-ORACLE corpus now match. Also applies cargo fmt to the crate.
2026-11-05 00:25:23 +01:00
Simon Klee
66617accc7
test(cli-rs): prove Mermaid fences in Markdown against the TS plugin (P.3)
P-COMP of TextPart's Markdown with a flowchart and a sequence fence matches every cell. The diagram drops TS's top margin, which the Rust Markdown widget already puts between blocks, and keeps TS's white default fg. A unit test covers the streaming fallbacks.
2026-11-05 00:25:23 +01:00
Simon Klee
fed4be1c06
feat(cli-rs): render Mermaid gantt, gitgraph and timeline diagrams (P.3)
Port the three small merman diagram kinds with the plugin's default options; every gantt, gitgraph and timeline case of the TS tests matches the P-ORACLE fixture. State diagrams come next.
2026-11-05 00:25:23 +01:00
Simon Klee
c691c855e9
feat(cli-rs): render Mermaid sequence diagrams (P.3)
Port merman's sequence parser, placement and drawing; all 96 sequence cases of the TS tests match the P-ORACLE fixture.
2026-11-05 00:25:23 +01:00
Simon Klee
940e1e7122
feat(cli-rs): render Mermaid flowcharts in the transcript (P.3)
Port merman's core grid, parser, layout, routing and drawing for flowcharts, register opencode.merman as a code-block renderer, and prove all 222 flowchart cases of the TS tests equal through a P-ORACLE fixture.
2026-11-05 00:25:23 +01:00
Simon Klee
6090315223
docs(cli-rs): design the Mermaid plugin (P.3)
Port the TS merman parser, layout and drawing: no Rust Mermaid crate draws cells close to TS, and the streaming fallback needs TS's line-numbered syntax errors.
2026-11-05 00:25:23 +01:00
Simon Klee
8f02fbf898
fix(cli-rs): drop a LaTeX preview when its fence closes
opentui-rust CodeBlock now says whether the closing fence arrived. The LaTeX renderer keeps its last formula only while the fence is open, as TS does, so broken math in a closed fence shows its source before the message completes. Removes F13-latex-closed-fence.
2026-11-05 00:23:31 +01:00
Simon Klee
b0d06260a1
refactor(cli-rs): let error and highlight scroll boxes size to content
opentui-rust scroll boxes now take their height from their content as Core does, so the error details and highlights dialogs use maxHeight with a zero content minimum height, as TS does, instead of counting wrapped lines. The height now follows a resize. DLG11 drops the part that came from the old layout.
2026-11-05 00:23:31 +01:00
Simon Klee
5c7858d747
fix(cli-rs): keep a dialog open after a drag inside it
The backdrop asked for selected text on press, which a drag has none of yet, so a drag that started on dialog text closed the dialog on release. It now also asks opentui-rust whether a selection drag is under way, as TS asks getSelection(). The link test now proves that a plain click opens a link: headless frames keep hyperlink ids.
2026-11-05 00:23:31 +01:00
Simon Klee
df2235886b
test(cli-rs): port the ACP session, turn, prompt, translate, and error cases
A fake server transport and an in-process client replace wire-fixture.ts. The agent also flushes queued answers when its input closes.
2026-11-05 00:18:24 +01:00
Simon Klee
ca755a464f
feat(cli-rs): add the ACP agent behind opencode-rs acp
Ports packages/cli/src/acp: JSON-RPC over stdio, sessions, catalog, prompt turns, content translation, and the private standalone server. Config options and directories are filled; tools, permission, elicitation, replay, compaction, and login are signatures with simple bodies for C.12.
2026-11-05 00:18:24 +01:00
Simon Klee
3564425e76
test(cli): let the ACP subprocess suites start another binary
OPENCODE_ACP_TEST_BIN runs the same suites against the Rust client (C.11).
2026-11-05 00:18:24 +01:00
Simon Klee
82cb5f8b4c
test(cli-rs): fit four TUI tests to the composer and the children read
The session route now reads its children as TS does, so terminal.rs and
root.rs route GET /api/session. Down past the newest history entry opens
the composer, and a child session's composer leaves leader keys out, as in
TS, so prompt.rs and actions.rs no longer rely on either.
2026-11-05 00:13:18 +01:00
Simon Klee
d77526b247
chore(cli-rs): format the composer and client MCP files 2026-11-05 00:08:20 +01:00
Simon Klee
3432fcdb0e
test(cli-rs): cover the client MCP tools and the composer tabs
TestApp tests for the client-mcp experiment and both tools, interrupting a
subagent, picking a terminal, and the shell output text. A key that opens
or closes the composer now syncs the session view, so the queued dock
hides under it.
2026-11-05 00:08:20 +01:00
Simon Klee
968e3c0f49
feat(cli-rs): add the composer, shell output dialog, and client MCP
The composer replaces the prompt with the Subagents, Shell, and Terminals
tabs: session.child.first opens it, terminal.select opens the terminal
list, and a child session shows it instead of a prompt. The Shell tab
opens the shell output dialog. With the client-mcp experiment on, the TUI
serves open_terminal and write_terminal over the client MCP socket.

The session route now reads its children, as TS does, and the queued dock
hides while the composer shows. P-APP E.13b/composer compares the tabs,
the dialog, the child session, and the kill request with TS.
2026-11-05 00:08:20 +01:00
Simon Klee
b813d593c2
feat(cli-rs): add the client MCP socket
A port of packages/client/src/mcp.ts: the client answers MCP JSON-RPC
over /api/experimental/client-mcp and reconnects with backoff until the
connection closes. The tests port packages/client/test/mcp.test.ts.
2026-11-05 00:08:20 +01:00
Simon Klee
41287ccc9b
refactor(cli-rs): rely on the kit's terminal restore in pair
main.rs now registers the prompt kit's restore step, so pair drops its
own. Also apply clippy and rustfmt to the C.8 and C.9 files, and name the
command when the service test cannot spawn opencode-rs.
2026-11-05 00:04:03 +01:00
Simon Klee
d28f4ac867
test(cli-rs): prove service and pair against fake and real TS services
Run opencode-rs against a fake TS binary and service for stop, restart,
set and pair --remote, and against the TS CLI from source in an isolated
sandbox for start, stop, restart and set in both directions.
2026-11-05 00:04:03 +01:00
Simon Klee
dd9b014763
feat(cli-rs): add the service and pair commands
Port the seven service subcommands and pair: stop and restart shut the
persistent terminals down first, set remote true and pair --remote turn
remote access on through the TS command, and pair prints its QR code with a
port of the TS encoder. P-CLI and P-PTY scenarios compare both clients; the
runners gain a setup hook that writes files into the sandbox.
2026-11-05 00:04:03 +01:00
Simon Klee
aa00379d35
feat(cli-rs): draw latex and math fences with the LaTeX plugin
opencode.latex replaces its empty built-in: a sideways-scrolling formula in the theme text colors, the source when the math does not parse, and the last formula that parsed while a fence streams. P-COMP fixtures of the TS renderer in the transcript Markdown match every cell; the remaining differences are under parity/deviations/F13-latex-*. The stop case needs opentui-rust rs-plugin-latex.
2026-11-05 00:01:16 +01:00
Simon Klee
4ca4db727d
feat(cli-rs): port the LaTeX parser and layout to opencode-latex
pulldown-latex fails on \left(A\rightarrow B\right), \displaylines, and \cfrac[l], so the crate ports the TS parser, layout, and tables (docs/P.2.md). A P-ORACLE over 207 sources from packages/latex tests matches TS exactly.
2026-11-05 00:01:16 +01:00
Simon Klee
6a34d09bd6
test(cli-rs): cancel the OAuth attempt on Ctrl+C like TS
A P-PTY case: Ctrl+C during the browser wait sends the cancel request,
prints Cancelled, and exits 130 on both sides.
2026-11-04 23:55:46 +01:00
Simon Klee
2c524fb424
refactor(cli-rs): narrow the prompt kit's unused allowance
auth and mcp use the remaining prompts, so the kit drops its
unused_imports allowance and the builder type re-exports nobody names.
dead_code stays for the options C.8, C.9 and C.15 may need; the demo
binary allows its own unused imports.
2026-11-04 23:55:46 +01:00