Commit graph

28 commits

Author SHA1 Message Date
Simon Klee
795f78fde3
wip: before the machine move 2026-11-05 12:36:11 +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
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
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
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
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
2b78cc38b9
docs(cli-rs): lay out the E.12 tabs and panes
The pane layout for the tab strip, the vertical rail, the session frame, the panel host, and the pane resize, before the code.
2026-11-04 21:22:12 +01:00
Simon Klee
d5e36daf0c
test(cli-rs): add a click step to the P-APP runner
A scenario step { click: [x, y] } sends a left press and release: mockMouse.click on the TS side, TestApp::click on the Rust side. E.20 uses it to open the working directory dialog.
2026-11-04 21:16:06 +01:00
Simon Klee
52155952dc
docs(cli-rs): add the P.1 plugin API design note 2026-11-04 20:55:58 +01:00
Simon Klee
071941e7d8
docs(cli-rs): design the U.4b grammars
Lists the grammar crates per feature, the five opentui-rust already links, the substitutes, and the measured cost of the default grammars feature over the oc-rust tip.
2026-11-04 20:28:38 +01:00
Simon Klee
26cfacbbf9
fix(cli-rs): fix the API types carbon found wrong in F.2
carbon-1: a union member that is itself a union with several tags joins the
outer tag, so SessionLogItem routes log.synced to LogSynced and its tag()
delegates to the inner enum.
carbon-2: Schema.NonEmptyArray(T) is Vec<T>, so form fields and tool
content are typed (FormField, ToolContent).
carbon-3: Ref_1 twins that Rust decodes the same as Ref share its type
(FormInfo, ShellInfo, FormAnswer, the inbox payloads, message parts).
carbon-4: untagged unions get a generated Deserialize that skips a member
whose required literal field holds another value, so an LSP server entry
with disabled: false keeps its command.
carbon-5: generated errors implement TaggedError, and DeclaredError::decode
checks the tag.

Call sites in crates/store and crates/ui follow the renamed types.
2026-11-04 19:51:14 +01:00
Simon Klee
4e14ca4ac5
fix(cli-rs): make P-APP recordings stable across replays
The migration poll starts 1 s after mount, so a fast scenario sometimes missed it; the runner now stays open past it. The placeholder mask now runs to the end of the row, since placeholders differ in length. Six replays give the same files.
2026-11-04 19:29:11 +01:00
Simon Klee
0ad7f9d20b
docs(cli-rs): update the P-APP note to the runners as built 2026-11-04 19:29:11 +01:00
Simon Klee
7741baa8e3
docs(cli-rs): design the P-APP scenario format (H.2)
One small file per scenario, found by glob, so the MS1 steps can add theirs without a shared list. TS records cells and requests; Rust replays them over an in-memory transport.
2026-11-04 19:29:11 +01:00
Simon Klee
f3878a5b23
feat(cli-rs): keep app.exit keys off while the prompt has text
As app.tsx:1329-1335, the app.exit binding layer is enabled unless the focused prompt textarea holds text. E.2 only fills Tui::textarea.
2026-11-04 19:11:01 +01:00
Simon Klee
f408a0ced2
fix(cli-rs): register app commands in a global layer as TS does
The palette lists reachable commands while its dialog holds the modal mode, so base-mode commands never showed. Commands now sit in a global layer without bindings, and separate layers bind their keys (app.tsx:1303-1335).
2026-11-04 19:08:20 +01:00
Simon Klee
4e2da655fa
docs(cli-rs): add the T.1 TUI shell structure note
Threads, the shared context, routes and views, keys, theme, the module tree and its call-site stubs, and how the TUI is built over an injected client for tests.
2026-11-04 18:58:47 +01:00
Simon Klee
68b5cdcf67
docs(cli-rs): design the service lifecycle and spawn policy
F.9 starts the TypeScript service only when discovery finds none, and never replaces or stops a service it did not start.
2026-11-04 18:54:39 +01:00
Simon Klee
d8918d4a80
test(cli-rs): prove local config files against the TypeScript client
parity/oracle/F.5-config.ts drives the real jsonc-parser, Effect
decoder, Config layer, migration, model.json repository, storage, and
JSONL parsers. config_interop.rs compares 293 JSONC cases, 46 decode
and 20 resolve cases, the V1 migration, and byte-equal files over
seven cli.json scenarios with TS-only, Rust-only, and alternating
clients; TS also waits on the Rust locks. Fixes the array removal edge
the corpus found and records the remaining edge cases as deviations.
2026-11-04 18:52:53 +01:00
Simon Klee
7ffe40b1e1
docs(cli-rs): design JSONC editing and local config files (F.5) 2026-11-04 18:52:53 +01:00
Simon Klee
e8e040d5e1
docs(cli-rs): design the store core and its change tracking
F.7 design note: one locked state behind a cloneable handle, eager spawned reads, and revisioned change sets per session and message for the UI.
2026-11-04 18:48:52 +01:00
Simon Klee
5c873ff272
feat(cli-rs): add the P-CLI and P-PTY parity runners
A fake server serves a scenario's route table and logs requests. P-CLI runs the TS CLI from source and opencode-rs against it in isolated homes and compares exit code, stdout, stderr and requests. P-PTY runs both under a PTY through OpenTUI's embedded terminal and compares the OSC log and screen checkpoints.
2026-11-04 18:47:33 +01:00
Simon Klee
7e2aee9820
docs(cli-rs): design the TUI keymap layer (U.2)
The keymap layer on opentui::keymap: generated keybind names, config resolution, the Provider's addons, layers, modes, and the P-ORACLE against @opentui/keymap.
2026-11-04 18:25:27 +01:00
Simon Klee
6954ec9bf2
docs(cli-rs): add the F.2 API type mapping note
How script/gen/api.ts maps ClientApi schemas to Rust types, unions, and methods.
2026-11-04 18:20:48 +01:00
Simon Klee
01ab034b56
feat(cli-rs): add the command tree
All 48 commands of the TypeScript CLI with clap derive, proven against the dumped Spec tree. A pre-pass and a post-parse check keep the Effect CLI behaviors scripts see: --no-<flag>, boolean literals, repeated flags, k=v values, -w without a following value, the scope of --standalone and --server, and root flags before a subcommand. Help, version, completions for six shells, exit code 1 on usage errors, and stdout that ignores EPIPE. Handlers are stubs that name their step; the root command reports that the TUI is not built yet.
2026-11-04 18:19:21 +01:00
Simon Klee
73e4842f35
docs(cli-rs): design the command tree
C.0 design note: clap derive tree proven against a dump of the TypeScript Spec tree, and the Effect CLI parsing behaviors kept.
2026-11-04 18:19:21 +01:00