Skip to content

feat: paste-archive and send-archive actions - #65

Merged
backnotprop merged 3 commits into
plannotator:mainfrom
mshddev:feat/paste-send-actions
Sep 27, 2026
Merged

backnotprop merged 3 commits into
plannotator:mainfrom
mshddev:feat/paste-send-actions

Conversation

@mshddev

@mshddev mshddev commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Two actions that put the saved annotations straight into the focused agent's prompt, then archive them. Today that takes copy-archive and then Cmd+V in the agent pane.

  • paste-archive pastes without submitting, like Cmd+V, so you can add a line before sending.
  • send-archive pastes and submits, like E in the review window.

copy-archive and every other action are unchanged. terminal and last send from the review window; these two send what capture saved. They are in all three manifests, so Lite, which has no review window, gets a way to reach the agent without the clipboard.

What changed

  • send-archive calls herdr agent prompt, the same call as plannotator-tui's HerdrAgent. Herdr refuses by itself when the pane has no agent or the agent is at a dialog.
  • paste-archive has no Herdr command to lean on. agent prompt always presses Enter, and pane send-text writes raw bytes and ignores the pane's bracketed-paste mode. So it wraps the text in ESC[200~…ESC[201~ itself, and only after herdr agent get shows an agent that isn't blocked. A bare shell may not enable bracketed paste, and the markers would land as garbage.
  • Both strip ESC from the text first. Text holding ESC[201~ ends the paste early. I reproduced it with herdr agent prompt on Claude Code: the text before the marker was lost, nothing was submitted, and Herdr still exited 0. Without the strip, send-archive would archive notes the agent never got. That part looks like a Herdr bug worth its own issue.
  • Delivery goes through copy_and_archive_annotations, whose write_clipboard field is now deliver, so nothing is archived unless delivery succeeded. A refusal leaves the annotations active and says why. A send that lands but fails to archive gets its own message, so nobody sends twice.
  • The target is the focused pane: contexts = ["pane"] and focused_pane_id, the way capture reads it.
  • Neither action touches the clipboard, so the remote-workspace problem in copy-context writes the server's clipboard, unreachable from a remote client #40 doesn't reach them. Not tested on a remote workspace.
  • README: two rows in the Use table, example bindings prefix+ctrl+v and prefix+ctrl+s (clear of Herdr's defaults), and a line on refusals. The action lists in the smoke, lite-regression and windows-full checks follow.

Needs a release

The pinned herdr-annotate 0.1.0 has no paste-archive or send-archive. Merged alone, a fresh install lists both actions and they exit with the usage error until a rust-lite release carries them and herdr-annotate.version moves. copy-archive avoided this by landing before the first release.

I left the versions alone, since rust-lite-release.yml needs the tag, rust/Cargo.toml and herdr-annotate.version to agree, and cutting that release is yours. The bump also needs check_distributed in test-windows-full-manifest.py updated; it asserts 0.1.0.

Validation

  • cargo test: 103 pass, up from 84. cargo fmt --check and cargo clippy --all-targets -- -D warnings are clean.
  • I broke each guard on purpose (the ESC strip, the blocked check, the agent check before pasting), and each break failed two tests.
  • lite-regression.py, test-windows-full-manifest.py and test-fetch-plannotator-tui.sh pass.
  • Ran the built binary against throwaway Claude Code panes with a temp store. The paste lands as [Pasted text #1 +N lines] with the agent still idle, the send sets the agent working, and both refuse on a plain shell with the pane and store untouched.
  • Used both keys in Herdr with the plugin linked to this build.
  • Not run: smoke.sh, which installs and uninstalls the global plugin, and the Windows .ps1 scripts, for lack of a Windows machine. windows-full-ci is their first real run.

🤖 Generated with Claude Code

mshddev and others added 3 commits September 25, 2026 11:23
Two pane actions put the saved annotations straight into the focused agent's prompt, formatted as copy-archive copies them, then archive them through the same workflow: deliver first, archive only if delivery landed. send-archive submits through `herdr agent prompt`. paste-archive checks `herdr agent get` (a recognised agent, not blocked) and types one bracketed paste with `herdr pane send-text`, without submitting. ESC is stripped from the text on both paths, because an embedded paste end marker breaks out of the paste, and through `agent prompt` it also loses the submit. Neither action touches the clipboard; copy-archive is unchanged. Suggested bindings: prefix+ctrl+v and prefix+ctrl+s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Herdr before 0.8.2 lets agent prompt type into an approval dialog, and the manifests still accept 0.8.0, so send-archive now asks agent get first, like paste-archive. The readiness check mirrors agent prompt: not blocked, a running agent Herdr recognises (agent is cleared after the process exits), and no pending launch. Nothing is archived unless delivery succeeded.
@backnotprop
backnotprop merged commit 663b45a into plannotator:main Sep 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants