Add toolpath-desktop crate (Tauri 2 app)#20
Merged
eliothedeman merged 2 commits intomainfrom Apr 20, 2026
Merged
Conversation
|
🔍 Preview deployed: https://a7339a4e.toolpath.pages.dev |
Adds crates/toolpath-desktop — the non-technical-user entry point to Pathbase. Users pick a trace source (Claude Code, pi.dev, local git, GitHub PR), preview the provenance DAG, and export to `.path.json` or upload to Pathbase (stubbed until the service ships). Stack: Tauri 2 + Svelte 5 + TypeScript + Vite, bundled with bun. The frontend is structured as an Elm-architecture loop — `types.ts` holds `Model`/`Msg`/`Cmd`, `update.ts` is the pure reducer, `store.svelte.ts` is a reactive Svelte 5 wrapper, and `routes/*.svelte` are pure views. Streaming list commands (`list_*_projects_stream`, `list_*_sessions_stream`) emit events that components subscribe to via typed wrappers around `@tauri-apps/api`. Rust backend links toolpath / toolpath-claude / toolpath-git / toolpath-github / toolpath-pi directly — no CLI subprocess. 13 unit tests cover the IPC command surface (source listing, derive validation, export round-trip, upload stub, keychain input checks). Workspace plumbing per CLAUDE.md checklist: root Cargo.toml, CLAUDE.md layout + dependency graph, README.md, scripts/release.sh (tier 3), site/_data/crates.json, site/pages/crates.md, CHANGELOG.md. Dev loop: `cargo tauri dev` spawns `bun --cwd frontend run dev` (Vite on localhost:1420), then runs the Rust binary against that URL. Frontend edits hot-reload via Vite HMR; Rust edits trigger `cargo run` restart. Production: `cargo tauri build` bundles to `frontend/dist/` then packages native artefacts.
Tauri 2 pulls in glib-sys / webkit2gtk-sys on Linux, which need GTK system libraries not installed on the Ubuntu runner. The crate targets macOS primarily; excluding it from the workspace CI keeps the check fast and avoids a ~500MB apt install. Its own tests run on dev machines where Tauri's deps are already present.
65f6340 to
548f642
Compare
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.
Summary
Adds
crates/toolpath-desktop— a Tauri 2 companion app to Pathbase, aimed at users who won't open a terminal to runpath derive .... They pick a trace source, preview the provenance DAG, and export locally or upload to Pathbase.What's in it
Rust backend (
crates/toolpath-desktop/src/) — linkstoolpath,toolpath-claude,toolpath-git,toolpath-github,toolpath-pidirectly. No CLI subprocess.list_agentsauto-detects installed agents (Claude via~/.claude/, pi.dev via~/.pi/agent/sessions/) — ready-to-extend for future agents.list_claude_projects_stream,list_claude_sessions_stream,list_pi_projects_stream,list_pi_sessions_stream,claude_session_title.derive_claude,derive_pi,derive_git,derive_github.save_document(round-trips throughDocumentschema before writing) + stubbedupload_to_pathbase.dev.pathbase.toolpath-desktop.Frontend (
crates/toolpath-desktop/frontend/) — Svelte 5 + TypeScript + Vite, bundled withbun. Elm-architecture shape:src/lib/types.ts—Model,Msg,Cmd, and IPC payload types that mirror Rust serde definitions.src/lib/update.ts— pure(msg, model) -> [model, cmd]reducer.src/lib/store.svelte.ts— reactive Svelte 5 store wrapping the reducer.src/lib/ipc.ts— typedinvoke/listenwrappers around@tauri-apps/api.src/lib/viz.ts— dagre-d3 DAG renderer adapted fromsite/js/visualizer.js.src/routes/*.svelte— one component per route (Home, BrowseAgents, BrowseClaude, BrowsePi, BrowseGit, BrowseGithub, Preview, Result).Streaming events — Rust commands emit
<source>:project,<source>:session,<source>:projects-doneetc. Components subscribe-then-invoke so fast streams don't race with listener registration.Workspace plumbing per CLAUDE.md checklist: root
Cargo.toml,CLAUDE.mdlayout + dependency graph,README.md,scripts/release.sh(tier 3),site/_data/crates.json,site/pages/crates.md,CHANGELOG.md.Dev loop
cargo tauri devauto-starts Vite onlocalhost:1420(viabeforeDevCommand), Tauri's webview loads from that URL. Frontend edits hot-reload via Vite HMR — no Rust restart. Rust edits triggercargo runrestart.Scope
In: source discovery (Claude, pi.dev, git, GitHub PR), DAG preview, local export, stubbed upload.
Out (deliberate v1 scope): real Pathbase API integration, live/track mode, query UI, editing documents, multi-doc Graph merging, identity signing.
Test plan
cargo test -p toolpath-desktop(13 passing)cargo clippy --workspace -- -D warningscleanbun run check(0 errors, 9 a11y-related warnings — non-blocking)bun run buildproduces ~202 KB JS bundle (68 KB gzip)cargo tauri dev→ Agents → Claude / pi.dev / Git / GitHub PR → Preview → Export →path validateround-tripcargo tauri buildproduces signed.appunder 20 MB on macOS