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
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: CI

# Fast checks for pull requests and branch pushes. Release builds, packaging
# and publishing stay in build.yml (tags) and pages.yml.
on:
pull_request:
push:
branches-ignore:
- main
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
native:
name: Desktop check and tests (Linux)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7

- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
build-essential pkg-config libx11-dev libxcb1-dev \
libxkbcommon-dev libwayland-dev libegl1-mesa-dev

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

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
key: ci-native

- name: Check all targets
run: cargo check --workspace --all-targets --locked

- name: Test geometry core
run: cargo test -p benchup-core --locked

- name: Test shared tool layer and MCP server
# Loopback and temp directories only; no outside network.
run: |
cargo test -p benchup-tools --locked
cargo test -p benchup-mcp --locked

- name: Test agent connection
run: cargo test -p benchup-app --lib --locked 'agent'

- name: Check add-on feature combinations
# Each add-on must build with the other compiled out.
run: |
cargo check -p benchup-app --locked --no-default-features
cargo check -p benchup-app --locked --no-default-features --features assistant
cargo check -p benchup-app --locked --no-default-features --features agent-link

- name: Test assistant
# The substring filters also select the assistant_ui tests, the docking
# test and the sharing test for the running MIRA turn, which a
# module-path filter such as 'assistant::' would skip.
run: |
cargo test -p benchup-app --lib --locked 'assistant'
cargo test -p benchup-app --lib --locked 'mira'

- name: Test release-critical modules
run: |
cargo test -p benchup-app --lib --locked updates::
cargo test -p benchup-app --lib --locked identity::
cargo test -p benchup-app --lib --locked storage::
cargo test -p benchup-app --lib --locked project_files::

web:
name: Browser check (wasm32)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
key: ci-wasm

- name: Check browser build
run: cargo check -p benchup-app --locked --target wasm32-unknown-unknown

- name: Check browser build without add-ons
run: cargo check -p benchup-app --locked --target wasm32-unknown-unknown --no-default-features

- name: Check the tool layer for the browser
run: cargo check -p benchup-tools --locked --target wasm32-unknown-unknown
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/.local/

/.env
/.env.local
27 changes: 27 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["crates/benchup-core", "crates/benchup-app"]
members = ["crates/benchup-core", "crates/benchup-app", "crates/benchup-tools", "crates/benchup-mcp"]
default-members = ["crates/benchup-app"]
resolver = "2"

Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@ Create mortise-and-tenon, half-lap, tongue-and-groove, rabbet, dovetail, and fin

Set the grain direction on groups and components and show grain-direction guides directly on the model. Review how the grain runs across each board and through the full assembly before building. Grain orientation is saved with the project and follows the parts when they rotate.

### Build with MIRA

Describe a change in plain language, such as "make the left leg 40 mm thicker", and the Build with MIRA assistant applies it with BenchUp's own tools. Refer to parts with @, by dragging from the Outliner, or from the right-click menu. Each request is one undo step, with a review card to jump to what changed. The panel can be detached into its own window on a second monitor. See the [assistant guide](docs/assistant.md).

### Use your own AI agent (MCP)

The `benchup-mcp` server lets Claude Code, Cursor, or any MCP client read and edit a BenchUp project, either a file on disk or the project open in the desktop or browser app. Every change is one undo step. It is a separate add-on from Build with MIRA, and agent control is off until you turn it on in Settings → Add-ons → Agent connection. See the [MCP guide](docs/mcp.md).

### Plan materials and workshop work

Assign stock materials and wood types to parts, configure sanding and finishing products, and prepare cut lists, cutting plans, and workshop labels. Export cutting plans and time and cost estimates to PDF to take the design into the workshop.

## Documentation

This README covers developer installation, building, verification, and deployment.
For instructions on using BenchUp, see the [user documentation](docs/README.md).
For instructions on using BenchUp, see the [user documentation](docs/README.md). To drive BenchUp from an AI agent, see the [MCP guide](docs/mcp.md).

## Prerequisites

Expand Down Expand Up @@ -353,6 +361,8 @@ Verified during implementation: native Linux and browser WASM Cargo checks; core
## Layout

- `crates/benchup-core`: double-precision document geometry, planar face discovery/triangulation, inference, picking, camera, tool definitions, and bounded history. It has no GUI or GPU dependencies.
- `crates/benchup-tools`: the tools an AI agent can call (create, move, join and so on), the scene summary, and `.bup` file reading and writing. It has no GUI or network dependencies and builds for the browser. Build with MIRA and the MCP server both use it.
- `crates/benchup-mcp`: the `benchup-mcp` MCP server (native only), with a file mode and a live mode that drives the open app. See [docs/mcp.md](docs/mcp.md).
- `crates/benchup-app`: egui workspace, gesture routing, local persistence, native/browser launchers, and the wgpu/WGSL edge renderer. Model coordinates remain independent of GPU resources.
- `index.html` and `Trunk.toml`: static browser host and WASM development configuration.

Expand Down
140 changes: 139 additions & 1 deletion assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,31 @@
"app_updates.software_updates": "Software updates",
"app_updates.your_model_could_not_be_saved_benchup_will": "Your model could not be saved. BenchUp will stay open: {error}",
"app_updates.your_previous_workspace_could_not_be_restored_make": "Your previous workspace could not be restored. Make an edit and wait for local autosave to keep this workspace before restarting.",
"assistant.name": "Build with MIRA",
"assistant.default_summary": "Done.",
"assistant.history_label": "MIRA: {summary}",
"assistant.history_stopped": "MIRA (stopped)",
"assistant.error.invalid_server_address": "The assistant server address must use https, or http on localhost.",
"assistant.error.invalid_api_key": "Invalid API key",
"assistant.error.tools_unsupported": "This model doesn't support tool calls. Pick another model.",
"assistant.error.network": "Cannot reach the assistant server: {e}",
"assistant.error.cannot_reach_server": "Cannot reach the assistant server",
"assistant.error.http": "The assistant server returned an error ({status}): {message}",
"assistant.error.bad_response": "Unexpected response from the assistant server: {e}",
"assistant.error.no_model_list": "The server did not return a model list",
"assistant.error.no_choices": "The server returned no answer",
"assistant.error.interrupted": "The request was interrupted",
"assistant.error.round_limit": "MIRA stopped after {count} steps without finishing. Ask for the remaining work in a new message.",
"assistant.error.busy": "MIRA is still working on the previous request",
"assistant.error.rolled_back": "MIRA's changes were rolled back because you no longer have edit access to this shared project.",
"assistant.error.shared_changed": "The shared project changed; MIRA stopped",
"assistant.error.empty_prompt": "Type what you want to build or change",
"assistant.error.not_connected": "Connect to the assistant server with an API key first",
"assistant.error.no_model": "Choose a model first",
"assistant.error.no_browser": "No browser is available",
"assistant.error.storage_unavailable": "Browser storage is unavailable",
"assistant.error.cannot_save_key": "Cannot save the API key in this browser",
"assistant.error.cannot_save_key_detail": "Connected, but the API key could not be saved on this device: {e}",
"common.add": "Add",
"common.apply": "Apply",
"common.cancel": "Cancel",
Expand Down Expand Up @@ -1924,5 +1949,118 @@
"web.loading.09": "Rolling out the welcome grid…",
"web.loading.10": "Adding a dash of possibility…",
"web.loading.11": "Pull up a chair and a fresh canvas…",
"web.loading.12": "Almost thyme to create…"
"web.loading.12": "Almost thyme to create…",
"assistant.advanced": "Advanced",
"assistant.api_key": "API key",
"assistant.api_key_hint": "Paste your API key",
"assistant.ask_about_this": "Ask MIRA about this",
"assistant.banner": "MIRA is editing…",
"assistant.base_url": "Server address",
"assistant.bring_to_front": "Bring to front",
"assistant.busy_blocked": "MIRA is editing the model. Wait for it to finish or press Stop.",
"assistant.card.created": "Created",
"assistant.card.erased": "Erased",
"assistant.card.joint": "Joint",
"assistant.card.modified": "Modified",
"assistant.card.more": "+{count} more",
"assistant.card.row_help": "Select this {kind} and zoom to it",
"assistant.card.stopped": "stopped",
"assistant.card.summary": "Created {created} · Modified {modified} · Erased {erased} · Joints {joints}",
"assistant.card.undo_turn": "Undo turn",
"assistant.card.undo_turn_disabled": "Only the most recent change can be undone here. Use History for earlier ones.",
"assistant.card.undo_turn_help": "Undo everything MIRA changed in this turn",
"assistant.change_endpoint": "Change endpoint…",
"assistant.choose_model": "Choose a model",
"assistant.connect": "Connect",
"assistant.connect_subtitle": "Your key is stored only on this device.",
"assistant.connect_title": "Connect to endlesstokens",
"assistant.connecting": "Checking your key…",
"assistant.detached_floating": "Build with MIRA is open in a floating window.",
"assistant.detached_window": "Build with MIRA is open in a separate window.",
"assistant.dont_show_again": "Don't show again",
"assistant.empty_transcript": "Describe what you want to build or change. Type @ to refer to a part of your design.",
"assistant.error_label": "Problem",
"assistant.explainer": "Describe a change in plain language and MIRA builds it in your model. Each request is one undo step. Connect an API key to start.",
"assistant.forget_key": "Forget API key",
"assistant.get_a_key": "Get a key",
"assistant.include_selection": "Include selection",
"assistant.include_selection_help": "Send the objects you have selected along with your request",
"assistant.kind_component": "component",
"assistant.kind_group": "group",
"assistant.latch": "Latch back into the sidebar",
"assistant.latch_back": "Latch back",
"assistant.menu_help": "Show or hide the Build with MIRA assistant",
"assistant.more": "More",
"assistant.new_chat": "New chat",
"assistant.no_models_match": "No models match your search",
"assistant.not_connected": "Not connected",
"assistant.privacy": "A summary of your model (names and dimensions) is sent to {host}.",
"assistant.prompt.also_referenced": "Also referenced: {list}",
"assistant.prompt_hint": "What should MIRA build or change? Type @ to refer to a part.",
"assistant.reload_models": "Reload the model list",
"assistant.remove_reference": "Remove this reference",
"assistant.search_models": "Search or type a model",
"assistant.selection_chip": "Selection ({count})",
"assistant.selection_chip_help": "Your current selection is sent with the request",
"assistant.send": "Send",
"assistant.send_help": "Send (Enter). Shift+Enter adds a new line.",
"assistant.shortcut_label": "{name} ({modifier} + key)",
"assistant.shortcut_reserved": "{key} is already used by another Ctrl/Cmd+Shift shortcut. Choose a different key.",
"assistant.stop": "Stop",
"assistant.unlatch": "Open in a separate window",
"assistant.use_model": "Use \"{model}\"",
"assistant.working": "Working… {seconds} s",
"assistant.you": "You",
"settings.add_ons": "Add-ons",
"agent_link.title": "Agent connection",
"agent_link.help": "Let an external AI agent (for example Claude Code through the benchup-mcp server) edit this project while BenchUp is open. Every agent call is one undo step. Nothing is sent over the internet: BenchUp connects only to your own computer.",
"agent_link.allow": "Allow agent control",
"agent_link.allow_help": "Connect to a local benchup-mcp bridge so an agent can read and edit the open project.",
"agent_link.port": "Port",
"agent_link.port_help": "The local port the bridge listens on (default 47615).",
"agent_link.status.off": "Agent control is off.",
"agent_link.status.connecting": "Connecting to the agent bridge…",
"agent_link.status.waiting": "Connected to the bridge. Waiting for an agent.",
"agent_link.status.connected": "Connected to {client}.",
"agent_link.status.error": "Not connected: {message}. Retrying.",
"agent_link.status_bar": "Agent connected",
"agent_link.token": "Pairing token",
"agent_link.token_none": "No token yet. One is created when you allow agent control.",
"agent_link.token_help": "Only an agent that knows this token can control BenchUp. It stays on this device and is never saved in projects or settings.",
"agent_link.token_save_failed": "Could not save the pairing token on this device: {error}",
"agent_link.show": "Show",
"agent_link.hide": "Hide",
"agent_link.copy_token": "Copy token",
"agent_link.generate": "Generate token",
"agent_link.regenerate": "Regenerate",
"agent_link.regenerate_help": "Create a new token. Agents using the old one are disconnected.",
"agent_link.setup": "Set up your agent",
"agent_link.copy_command": "Copy Claude Code command",
"agent_link.copy_json": "Copy MCP config (JSON)",
"agent_link.copied": "Copied to the clipboard.",
"agent_link.activity": "Agent activity",
"agent_link.activity_entry": "{client}: {tool}",
"agent_link.unnamed_client": "Agent",
"agent_link.history_label": "Agent: {summary}",
"agent_link.summary": "{tool} ({created} new, {modified} changed)",
"agent_link.queued_status": "Waiting for BenchUp to finish the current edit.",
"agent_link.error.busy": "BenchUp is busy with a MIRA turn, retry",
"agent_link.error.queue_full": "Too many agent calls are waiting, retry",
"agent_link.error.arguments_not_object": "arguments must be a JSON object",
"agent_link.error.missing_tool": "the call has no tool name",
"agent_link.error.disabled": "Agent control was turned off",
"agent_link.error.disconnected": "The connection was lost before the call ran",
"agent_link.error.connect_timeout": "The bridge did not answer",
"agent_link.error.bridge": "The bridge refused the connection: {message}",
"settings.add_on_mira_help": "The in-app design assistant. It sends nothing until you connect a server.",
"settings.add_on_mira_toggle": "Build with MIRA",
"settings.add_on_mira_toggle_help": "Show the MIRA panel, menu items and shortcut. Turning it off stops a running request and keeps what it already changed.",
"settings.no_add_ons": "No add-ons are included in this build.",
"agent_link.error.protocol": "The agent bridge uses an incompatible protocol. Update benchup-mcp to the version that matches this BenchUp.",
"agent_link.error.unproven": "The program on this port did not prove the pairing token",
"agent_link.error.handshake": "The agent bridge broke the pairing protocol",
"agent_link.error.document_changed": "The open project changed before this call ran",
"agent_link.error.document_changed_hint": "Call get_scene to see the project that is open now.",
"agent_link.command_help": "The command hands the token to the bridge through its environment, not its command line.",
"agent_link.error.no_randomness": "This device could not provide secure random numbers, so no pairing token was created"
}
13 changes: 12 additions & 1 deletion crates/benchup-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ edition.workspace = true
license.workspace = true
rust-version.workspace = true

[features]
default = ["assistant", "agent-link"]
# "Build with MIRA": the in-app LLM design assistant.
assistant = []
# "Agent connection": lets an external agent (benchup-mcp) edit the project.
agent-link = []

[dependencies]
benchup-core = { path = "../benchup-core" }
serde.workspace = true
serde_json.workspace = true
flate2 = { version = "1", default-features = false, features = ["rust_backend"] }
uuid = { version = "1", features = ["v4", "js"] }
benchup-tools = { path = "../benchup-tools" }
skrifa = "0.44"
glam.workspace = true
eframe = { version = "0.37", default-features = false, features = ["default_fonts", "wgpu", "x11", "wayland", "accesskit", "persistence", "links"] }
Expand All @@ -36,6 +44,9 @@ velopack = "=1.2.161"
rayon = "1.12"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
# End-to-end tests of the agent link against the real bridge.
benchup-mcp = { path = "../benchup-mcp" }
flate2 = { version = "1", default-features = false, features = ["rust_backend"] }
pollster = "0.4"
png = "0.18"

Expand Down
Loading