Repository navigation
Live bridge and in-app agent connection (#55) - #73
Merged
Merged
Conversation
Agents can now edit the project open in BenchUp, on the desktop and on the web, without a central server. BenchUp connects out to a local bridge, because a browser tab cannot listen on a port. benchup bridge (CLI): - Listens on 127.0.0.1 only, with challenge-response pairing (HMAC-SHA256; the token is never sent), an Origin allowlist, pre-authentication limits and call deadlines. One BenchUp window per bridge. - Serves MCP on stdio. When another bridge holds the port it forwards to it, and takes the port over if that bridge exits. - scene, get, call (--batch, --dry-run), undo, redo and render take --live. The first one starts a background bridge, which exits after 30 minutes without calls. - Batch references and reports move to benchup_tools::batch, so files, MCP and the app answer the same way. Agent connection (app): - Settings -> Agent connection: off by default; the setting and the port persist. The pairing token stays in this device's private storage, with copy buttons for the token and setup snippets. - Each changing call, and each batch, is one undo step "Agent: ...", recorded like the designer's own edits, so shared projects keep their read-only state and edit leases. - Reads always run. A changing call asks the designer to grant or deny access when they are mid-operation or have taken control; granting cancels their operation. The status bar offers Take control. - Calls run from App::logic, so a minimized window or hidden tab still answers. Renders run off the UI thread on the desktop. - eframe's clipboard feature is enabled so copied text reaches the system clipboard on the desktop. - All text is translated in every catalog; docs and the skill cover live mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ue-55 # Conflicts: # docs/cli.md
Collaborator
Collaborator
Author
|
Cant see the gif ! :)
… Message ID: ***@***.***>
|
Collaborator
untitled.mp4 |
Collaborator
|
The CLI/MCP is such a nice feature! I spent a good hour playing around with it yesterday.
As you saw in the video, I took the initiative to make the process a little more visible directly in the viewport, without making it too overwhelming. If you think it's too much, feel free to adjust! Alright, I'm merging this! Awesome work! |
Collaborator
Author
|
Great!!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Implements items 1 and 2 of #55: agents can edit the project open in BenchUp, on the desktop and on the web, without a central server. It ports the bridge from #3 (
live.rs,protocol.rs,pairing.rs) onto current main, as a subcommand of the existing CLI rather than a separatebenchup-mcpbinary. The add-on system and MIRA from #3 are left out.1.
benchup bridge127.0.0.1only. Pairing is a challenge-response with HMAC-SHA256 over fresh nonces from both sides, so the token is never sent; proofs are separated by role (app, client, bridge).https://benchup3d.github.ioor a local dev server (--allow-originadds more); anything else gets HTTP 403.scene,get,call(--batch,--dry-run),undo,redoandrendertake--live. The first one starts a background bridge, which exits after 30 minutes without calls. The token comes only fromBENCHUP_AGENT_TOKEN, never from arguments.$Nreferences and reports move from the CLI tobenchup_tools::batch, so files, MCP and the app answer the same way.2. Agent connection in the app
GeneralSettings, with older preferences loading as off). The pairing token is generated by the app and kept in this device's private storage (0600 file on the desktop,localStorageon the web), with buttons to copy the token, the Claude Code command, an MCP config or shell lines.Agent: <tool>, and a batch is one step. Edits go through the same commit path as the designer's, so shared projects keep their read-only state and leases, and the agent is treated like any other user (as suggested in the issue). An edit waits for a selection lease on its way to the server instead of failing.App::logic, so a minimized window or hidden tab still answers. Renders run off the UI thread on the desktop. A call queued before another project was opened is refused.clipboardfeature is enabled: without it, copied text (the token, but also geometry and text fields) only reached BenchUp's internal clipboard on the desktop.docs/cli.md,docs/agent-guide.mdand the skill cover live mode.Testing
--liveagainst a stand-in app; app handshake, undo steps, batches and dry runs, grant/deny/take control, shared read-only and leases (including an agent selection requesting its lease), result size limits, token storage, preference persistence.cargo test --locked -p benchup-core -p benchup-tools -p benchup-clipasses. Inbenchup-app --lib, the only failures are 11 that already fail ona9d9c65(Chinese strings, thedimension_input_overlayrender audit, move/copy arrays…), unrelated to this change.--livecalls, MCP, undo steps, the grant/deny prompt and Take control. The web build compiles forwasm32with no warnings and is served bytrunk serve.Not done yet
ws://127.0.0.1from anhttpspage.benchupcommand to use the bridge, which today meanscargo install --path crates/benchup-cli. Shipping it with the desktop packages would be a follow-up.Closes items 1 and 2 of #55.
🤖 Generated with Claude Code