Skip to content

About

Review a coding agent's output inside thurbox and send it numbered feedback — herdr-annotate, wired into thurbox's own panes.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

thurbox-annotate

CI thurbox v2.25.0 licence MIT

Review a coding agent's output inside thurbox and send it numbered feedback — the herdr-annotate idea, wired into thurbox's own panes. It comes in two tiers, like herdr:

  • Full — press a key on any session and its terminal output opens in plannotator-tui: drag to select a line, comment on it, and press E. The comments are delivered straight back into that agent's composer as a numbered list — as if you had typed the review yourself.
  • Lite — no external program. Drag to select a line in the agent, press F2, type a comment; repeat to build a list, then send it all back with E. A single small pane, entirely in Lua.

Either tier delivers the same thing: a numbered review typed into the agent's composer. Full renders the source as a document to annotate; Lite is a lighter in-terminal notepad against the live selection.

Reviewing a stub agent's plan and sending the feedback back

F5 opens the review, c comments on the flawed line, E sends it — and the numbered feedback lands in the agent's composer, which echoes it straight back.

Pane Slot What it draws
plugins/40_annotate.lua center (switch) Full tier. A program pane hosting plannotator-tui on the selected session's captured output. Brought forward by its Review pill or F5; delivers feedback with session send.
plugins/41_notes.lua center (switch) Lite tier. A notes pane: the selection (from thurbox.selection, or — over a tracking agent — the system clipboard, which needs the run capability), a comment on it, an accumulating list you classify (c), delete (x) and archive (a/Tab/u). Comment with F2 (a global chord, so it fires from the focused agent); send the list with E. No external program.

Both share the center slot with the agent pane and draw nothing until you bring one forward, so they add no column and need no layout.lua edit. Install only the tier you want — the two are independent.

How it works

A thurbox pane cannot spawn a process with a custom environment, so the herdr contract is assembled by two small shipped scripts instead:

  • bin/pt-launch.sh — the pane runs this as its program. It captures the session's output (thurbox-cli session capture) into a markdown file, sets the HERDR_* / PLANNOTATOR_TUI_* environment plannotator-tui reads, and execs it on that file.
  • bin/pt-deliver.sh — plannotator-tui delivers a review by running $HERDR_BIN_PATH agent prompt <pane> <feedback>. This shim is that binary; it translates the call into thurbox-cli session send <pane> <feedback>, which types the feedback into the target session as one bracketed paste.

Install

1. The plannotator-tui binary

scripts/install-plannotator.sh        # downloads + checksums the release binary → ~/.local/bin

It is a standalone MIT program; nothing is built here. ~/.local/bin must be on the PATH thurbox is started with, so the launcher can find it.

2. The pane

thurbox-cli plugin install git+https://github.com/spscream/thurbox-annotate --as plugins/40_annotate.lua

This clones the repository into ~/.config/thurbox/ui/thurbox-annotate/ — the pane, the launcher and the shim together — and writes one plugins.toml entry. No layout.lua edit is needed. thurbox-cli plugin check should then list annotate beside the panes thurbox ships.

Capability

40_annotate.lua declares program, because plannotator-tui is a program it runs. Grant it per file in settings → Interface (Ctrl+, → ] → select annotate → t); until then the pane draws an honest "trust me" state instead of a terminal.

Use

  1. Select a session in the list.
  2. Press F5 (or its Review pill) — plannotator-tui opens on that agent's captured output.
  3. Drag to select a line, comment, repeat.
  4. Press E — the numbered feedback lands in that agent's composer.
  5. F5 again closes the review and hands focus back.

Lite tier

plugins/41_notes.lua is the whole tier — no binary. Install it the same way:

thurbox-cli plugin install git+https://github.com/spscream/thurbox-annotate --as plugins/41_notes.lua

Then:

  1. Drag to select a line of the agent's output.
  2. Press F2 — the pane comes forward with that line quoted and a comment field. Type the comment, press Enter to save it. The chord is global, so it fires while the agent is focused; the selection is grabbed at the keypress. Long comments wrap and follow the caret vertically. Use Shift+Enter (or Alt+Enter) for a line break, arrows to move, and Escape to cancel editing. F2 while editing returns to the previous pane and keeps the draft; F2 from that pane resumes it. Enter still saves the complete comment.
  3. Repeat to build the list, then manage it — a cursor moves with j/k; c cycles the selected note's classification (Issue / Suggestion / Note / Praise); x deletes it; a archives it and Tab shows the archive, where u restores. d clears the current list. This mirrors herdr-annotate's Ctrl+B M manager, minus the clipboard export the Lua sandbox cannot reach. From either notes list, Escape or F2 returns to the previous pane (normally the agent). Alt+N opens/toggles the list without capturing a new selection; use it to manage saved notes.
  4. Press E — the active notes are typed into the selected session's composer as numbered, classified feedback ([Issue] > quote), the same delivery the Full tier uses. A single-line quote stays inline after >; a multi-line selection travels verbatim in a fenced block, so its line breaks and indentation reach the agent as selected. The archive stays behind; only the review is sent.

Where the selected text comes from

Lite gets the quote through two channels, the way herdr-annotate does — because the same obstacle applies here: a pane cannot read another terminal program's selection state.

  • What thurbox selected arrives instantly through the published thurbox.selection field (thurbox ≥ v2.25.0, #1151). This is a drag over a pane that does not track the mouse — a plain shell, static output. No capability, no wait.
  • What the agent selected arrives through the system clipboard. A mouse drag over a tracking agent (Claude Code and the like) is forwarded to that program, so thurbox never sees the selection — but the agent's own copy-on-select has already put the text on the clipboard, and Lite reads it from there, exactly as herdr-annotate does. This needs the run capability: grant it per file in settings → Interface (Ctrl+, → ] → select notes → t). Until then F2 over an agent says so. The read is asynchronous, so the compose row shows reading clipboard… for a moment. The clipboard tool is chosen by platform (PowerShell under WSL/Windows, wl-paste / xclip / xsel on Linux, pbpaste on macOS); a remote session's clipboard lives on the remote, the same limit herdr notes.

Checks

  • Lua and shell — selene against thurbox.yml (the plugin VM's real standard library, so a pane reaching for something the sandbox withholds is a lint failure); stylua --check; shellcheck on the two scripts.
  • Interface loads — ci/assemble-interface.sh builds the directory a real install produces (thurbox's ui/ as the base, this repository cloned beside it) and runs thurbox-cli plugin check. A pane that loads but that nothing places exits non-zero.

Both run against the release named by THURBOX_TAG in the workflow. Locally:

git clone --depth 1 --branch v2.25.0 https://github.com/Thurbeen/thurbox .thurbox
cp .thurbox/thurbox.yml .          # what selene.toml's `std = "thurbox"` resolves to
selene plugins && stylua --check plugins && shellcheck bin/*.sh scripts/*.sh
ci/assemble-interface.sh .thurbox build/ui
THURBOX_UI_DIR=$PWD/build/ui thurbox-cli plugin check

Licence

MIT. plannotator-tui is a separate MIT project; this repository ships none of its code, only downloads its released binary.

Native editor regression check

The test uses thurbox's LuaHost, real text-input library, node conversion and ratatui TestBackend, with synthetic text only. It asserts that the native caret is inside the editor and checks multiline/soft-wrap tails, Cyrillic, resize, navigation, save/cancel and the native focus-toggle commands emitted by the list. It does not drive a live terminal or prove a particular installed layout's focus history. In a disposable thurbox checkout at the CI tag:

ci/assemble-interface.sh "$THURBOX_CHECKOUT" build/ui
cp tests/native_notes.rs "$THURBOX_CHECKOUT/tests/annotate_notes.rs"
ANNOTATE_UI="$PWD/build/ui" cargo test --manifest-path "$THURBOX_CHECKOUT/Cargo.toml" \
  --test annotate_notes -- --nocapture

After merge, update the installed thurbox-annotate entries using the normal thurbox-cli plugin update command, run thurbox-cli plugin check, then use F10 if the watcher has not reloaded. Opening a PR alone does not update the running interface. To roll back, install the same plugin source pinned to the previous commit with the normal plugin installer; keep the existing grants and layout. Never edit the installed Git working copy or plugins.lock by hand.

About

Review a coding agent's output inside thurbox and send it numbered feedback — herdr-annotate, wired into thurbox's own panes.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages