Skip to content

feat(vault): M5 slice 2 — TUI reveal + agent-side clipboard copy#1

Merged
UnbreakableMJ merged 1 commit into
mainfrom
m5-slice2-tui-reveal-copy
Jun 9, 2026
Merged

feat(vault): M5 slice 2 — TUI reveal + agent-side clipboard copy#1
UnbreakableMJ merged 1 commit into
mainfrom
m5-slice2-tui-reveal-copy

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

Summary

Wires the vault-tui detail pane to reveal and copy secrets, gated on a new agent-side copy path so plaintext never crosses the socket and the auto-clear survives the TUI quitting. Also closes a duplicate-name targeting footgun.

Protocol (vault-ipc)

  • Request::Get gains id: Option<String> (serde-defaulted, forward-compatible).
  • New Request::Copy { id, name, field, clear_after_secs }Response::Ok. The plaintext stays in the agent.

Agent (vault-agent)

  • get_item targets an exact cipher id when given (name becomes the fallback/label), so reveal/copy always hit the selected row even when names collide.
  • New default-on clipboard feature holds an arboard handle. The Copy arm decrypts the field, places it on the agent's own clipboard, and schedules a 30s auto-clear that wipes only if the clipboard still holds what we wrote (or can't be read — fail-safe).
  • --no-default-features drops the X11/Wayland tree and declines Copy cleanly.

CLI (vault-cli)

  • cmd_get passes id: None — behavior unchanged.

TUI (vault-tui)

  • Space reveals the selected login's password (id-targeted Get, re-masked on any navigation, held in a zeroizing/Debug-redacted RevealedSecret).
  • c / u / o copy password / username / URI via Copy, with a status-bar toast.
  • Reveal/copy act only when the item list is focused.

Tests

id-targeting-among-duplicates regression, should_clear_clipboard + clipboard_set-when-None units, a dispatch-level Copy-while-locked test, and TUI reveal/re-mask/toast/Debug-redaction units plus TestBackend smokes for masked/revealed/toast states.

Supply-chain

arboard pulls error-code (BSL-1.0, via Windows-only clipboard-win) — added to deny.toml's allow-list (FSF GPL-compatible). No new advisories.

Known limitation (tracked)

On Quit/stop-agent a pending clear task dies with the runtime, so a just-copied secret can linger until overwritten. A clear-on-shutdown sweep is a tracked follow-up.

🤖 Generated with Claude Code

Wire the TUI's detail pane to show and copy secrets, gated on a new
agent-side copy path so the plaintext never crosses the socket and the
auto-clear survives the TUI quitting.

Protocol (vault-ipc): Request::Get gains `id: Option<String>`; new
Request::Copy { id, name, field, clear_after_secs } returns Response::Ok.

Agent: get_item targets an exact cipher id when given (name is the
fallback/label), closing the duplicate-name footgun where copy/reveal
could hit the wrong item. New default-on `clipboard` feature holds an
arboard handle; the Copy arm decrypts the field, places it on the agent's
own clipboard, and schedules a 30s auto-clear that wipes only if the
clipboard still holds what we wrote (or can't be read — fail-safe).
--no-default-features drops the X11/Wayland tree and declines Copy cleanly.

CLI: cmd_get passes `id: None` (behavior unchanged).

TUI: Space reveals the selected login's password (id-targeted Get,
re-masked on any navigation, held in a zeroizing/Debug-redacted
RevealedSecret); c/u/o copy password/username/URI via Copy with a
status-bar toast. Copy/reveal act only when the item list is focused.

Tests: id-targeting-among-duplicates regression, should_clear_clipboard
and clipboard_set-when-None units, a dispatch-level Copy-while-locked
test, and TUI reveal/re-mask/toast/Debug-redaction units plus TestBackend
smokes for masked/revealed/toast states.

Supply-chain: arboard pulls error-code (BSL-1.0, via Windows-only
clipboard-win) — added to deny.toml's allow-list (FSF GPL-compatible).
No new advisories.

Known limitation (tracked): on Quit/stop-agent a pending clear task dies
with the runtime, so a just-copied secret can linger until overwritten.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@UnbreakableMJ UnbreakableMJ merged commit 0e67b6c into main Jun 9, 2026
7 checks passed
@UnbreakableMJ UnbreakableMJ deleted the m5-slice2-tui-reveal-copy branch June 12, 2026 09:09
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.

1 participant