Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,50 @@ jobs:

- name: Clippy (windows-gnu)
run: cargo clippy --target x86_64-pc-windows-gnu --all-targets -- -D warnings

desktop-dev-build:
name: Desktop Dev Build (${{ matrix.os }})
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2025-vs2026]

steps:
- uses: actions/checkout@v6

- name: Install Linux desktop dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
patchelf

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry and target dir
uses: Swatinem/rust-cache@v2
with:
key: desktop-dev-${{ matrix.os }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: desktop/package-lock.json

- name: Install desktop dependencies
working-directory: desktop
run: npm ci

- name: Desktop build (no bundle)
working-directory: desktop
run: npm run build:no-bundle
55 changes: 55 additions & 0 deletions .github/workflows/desktop-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Desktop Dev Build

on:
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"

jobs:
desktop_dev:
name: Desktop no-bundle build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2025-vs2026]

steps:
- uses: actions/checkout@v6

- name: Install Linux desktop dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
patchelf

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry and target dir
uses: Swatinem/rust-cache@v2
with:
key: desktop-dev-${{ matrix.os }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: desktop/package-lock.json

- name: Install desktop dependencies
working-directory: desktop
run: npm ci

- name: Desktop build (no bundle)
working-directory: desktop
run: npm run build:no-bundle
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ Use it when you want:
## Status

BeforePaste is under active development. The macOS desktop tray app is the
primary product path today. The CLI, pipeline redactor, terminal paste guard,
and VS Code terminal bridge are available for development and advanced use.
primary published product path today. Windows and Linux tray support is in
source-level development, with Ctrl+V smart paste wired for VS Code AI terminal
targets. The CLI, pipeline redactor, terminal paste guard, and VS Code terminal
bridge are available for development and advanced use.

Platform scope today:

| Platform | Desktop tray | Normal paste protection | Safe paste shortcut | CLI |
|---|---:|---:|---:|---:|
| macOS | Yes | `Cmd+V` in AI targets | `Cmd+Ctrl+V` | Yes |
| Windows | Source/dev only | Not yet | CLI only | Yes |
| Linux | Source/dev only | Not yet | CLI only | Yes |
| Windows | Source/dev only | `Ctrl+V` for VS Code AI terminals | `Ctrl+Alt+V` | Yes |
| Linux | Source/dev only | `Ctrl+V` for VS Code AI terminals | `Ctrl+Alt+V` | Yes |

## Install

Expand Down Expand Up @@ -148,12 +150,14 @@ be granted while the selected paste mode is still off or needs attention.

| Mode | Shortcut | Behavior |
|---|---|---|
| Advanced | `Cmd+V` on macOS | Intercepts normal paste, checks whether the frontmost target is an AI target, redacts only for AI targets, then pastes. |
| Safe Paste Shortcut Only | `Cmd+Ctrl+V` on macOS | Leaves normal `Cmd+V` alone. The explicit shortcut always pastes a protected copy of the clipboard. |
| Advanced | `Cmd+V` on macOS, `Ctrl+V` on Windows/Linux desktop builds | Intercepts normal paste, checks whether the current target is an enabled AI target, redacts only for AI targets, then pastes. |
| Safe Paste Shortcut Only | `Cmd+Ctrl+V` on macOS, `Ctrl+Alt+V` on Windows/Linux | Leaves normal paste alone. The explicit shortcut always pastes a protected copy of the clipboard. |

Advanced mode is the recommended default for macOS because it protects the
normal paste habit in AI targets. Safe Paste Shortcut Only is useful when you
want an explicit action and no normal paste interception.
Advanced mode is the recommended default because it protects the normal paste
habit in AI targets. On Windows/Linux source desktop builds, Advanced mode is
currently limited to targets published by the VS Code extension or a manual
target override. Safe Paste Shortcut Only is useful when you want an explicit
action and no normal paste interception.

## Desktop Tray

Expand Down Expand Up @@ -191,6 +195,11 @@ Supported target types:
opencode.
- VS Code integrated terminals through the BeforePaste VS Code extension.

Native app and browser-tab detection are macOS-first today. Windows/Linux
desktop development builds use VS Code extension state and manual target
overrides for smart `Ctrl+V`; if no AI target is known, BeforePaste passes
through to normal paste.

Browser matching is positive-only. If BeforePaste cannot read the active tab URL
or cannot confirm an AI target, it performs a normal paste. This avoids
rewriting clipboard content in places like cloud console secret fields, GitHub
Expand Down
18 changes: 12 additions & 6 deletions desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ Feature scope by platform:

- macOS: tray, preferences, safe paste shortcut, target-aware Cmd+V protection,
browser/app/terminal detection.
- Windows: CLI is published. Desktop source builds remain available for
development, but public Windows desktop artifacts are paused while packaging
is stabilized.
- Linux: CLI is published. Desktop source builds remain available for
development, but public Linux desktop artifacts are paused pending the
upstream Tauri GTK dependency update.
- Windows: tray and preferences build from source. Advanced mode registers a
global Ctrl+V shortcut; VS Code AI terminal targets are detected through the
BeforePaste VS Code extension, and unknown targets pass through as normal
paste.
- Linux: tray and preferences build from source. Advanced mode registers a
global Ctrl+V shortcut; VS Code AI terminal targets are detected through the
BeforePaste VS Code extension. Pass-through paste requires one of `xdotool`,
`wtype`, or `ydotool` depending on the session.

Public Windows and Linux desktop artifacts remain paused until packaging,
code-signing, and Linux GTK dependency policy are finalized. The source-level
tray implementation is available for development builds.
Loading
Loading