{
  "schema_version": 1,
  "type": "app",
  "slug": "adom-desktop-hello-rust-bridge",
  "title": "Sample bridge: hello-rust",
  "brief": "Minimal third-party Adom Desktop bridge in ~140 lines of Rust (tiny_http + serde, single static binary). Fork this when you want a no-runtime native bridge.",
  "version": "1.0.0",
  "tags": [],
  "license": "MIT",
  "sample_prompts": [
    {
      "label": "Install hello-rust",
      "prompt": "Install the hello-rust sample bridge from the wiki"
    },
    {
      "label": "Try the verbs",
      "prompt": "Run hellors_ping and hellors_echo to see how bridge verbs work"
    },
    {
      "label": "Fork to build my own",
      "prompt": "Get the hello-rust source so I can fork it as my own single-binary bridge"
    }
  ],
  "install": {
    "binary_name": "adom-desktop-hello-rust-bridge",
    "install_dir": "",
    "install_hint": "",
    "version_cmd": ""
  },
  "readme": "# Sample bridge: hello-rust\n\n## What this is\n\n`hello-rust` is a **minimal third-party bridge** for Adom Desktop, written in ~140 lines of Rust using `tiny_http` + `serde`. It builds to a **single static 300-KB binary** — no runtime install on the user's machine. Use this as your starting point when:\n\n- You don't want to require Python (or any runtime) on your end users' boxes\n- You want type-safe verb dispatch\n- The work is CPU-bound and you want native speed\n- You're more comfortable in Rust than Python\n\nPair it with its twin [`hello-python`](https://wiki-ufypy5dpx93o.adom.cloud/apps/adom-desktop-hello-python-bridge) (same surface, different language) for a side-by-side comparison of `kind: \"exe\"` (native single-binary) vs. `kind: \"python\"` (interpreted).\n\nIf you're getting started, also read the [bridge SDK guide](https://wiki-ufypy5dpx93o.adom.cloud/apps/adom-desktop-bridges) for the `bridge.json` schema and packaging conventions.\n\n## Try it in 30 seconds\n\n```bash\n# 1. Install from the wiki (anonymous, no GitHub account needed)\nadom-desktop bridge_install '{\"manifestUrl\":\"https://wiki-ufypy5dpx93o.adom.cloud/static/apps/adom-desktop/hello-rust-bridge-manifest.json\"}'\n\n# 2. Ping it (auto-spawns the bridge process)\nadom-desktop hellors_ping\n# → {\"success\":true,\"output\":\"Hello from the Rust sample bridge v1.2.0!\",\"language\":\"rust\",...}\n\n# 3. Echo something back\nadom-desktop hellors_echo '{\"message\":\"world\"}'\n# → {\"success\":true,\"output\":\"echo (rust): world\",\"echoed\":\"world\",\"language\":\"rust\"}\n\n# 4. Confirm it's registered\nadom-desktop bridge_list   # look for \"hello-rust\" with verbs hellors_*\n\n# 5. Uninstall when done\nadom-desktop bridge_uninstall '{\"name\":\"hello-rust\"}'\n```\n\n`hello-python` and `hello-rust` use different verb prefixes (`hellopy_` vs `hellors_`) so both can be installed at the same time without collision — useful for an A/B comparison.\n\n## What's in the box\n\n```\nhello-rust/\n├── bridge.json         ← manifest (verb prefixes, spawn config, platforms)\n├── BRIDGE_VERSION      ← semver\n├── Cargo.toml          ← single dep: tiny_http + serde\n├── src/main.rs         ← ~140 lines\n├── hello-rust.exe      ← pre-built x64 Windows binary (~300 KB)\n└── README.md           ← lifecycle notes\n```\n\nThe pre-built `hello-rust.exe` ships in the zip so end users don't need a Rust toolchain. For macOS/Linux you'd rebuild with `cargo build --release` and re-zip.\n\n## The two endpoints every bridge exposes\n\nIdentical to the Python flavor:\n\n| Endpoint | When | What it returns |\n|---|---|---|\n| `GET /status` | Adom Desktop polls this after spawn to confirm the bridge is alive | `{\"ok\": true, \"bridge\": \"hello-rust\", \"version\": \"...\", \"uptimeSec\": N}` |\n| `POST /command` | Every CLI verb call routes through here | `{\"success\": bool, \"output\": ..., \"error\": ...}` |\n\n## How verb routing works\n\n1. `bridge.json` declares `verbPrefixes: [\"hellors_\"]` and `spawn.kind: \"exe\"`\n2. Adom Desktop's registry records that `hellors_*` belongs to this bridge\n3. When you type `adom-desktop hellors_ping`, the Tauri runtime:\n   - Spawns `hello-rust.exe --port <ephemeral>` if not already running\n   - Polls `/status` until ready\n   - POSTs `{\"command\":\"hellors_ping\",\"args\":{}}` to `/command`\n   - Streams the JSON response back through the CLI\n\nFor `kind: \"exe\"` bridges, Adom Desktop runs the entrypoint directly — no Python/Node lookup needed.\n\n## The two verbs\n\n| Verb | Args | Returns |\n|---|---|---|\n| `hellors_ping` | (none) | `{success, output, bridge, language: \"rust\", version, uptimeSec, _hint}` |\n| `hellors_echo` | `{\"message\": \"<str>\"}` | `{success, output, echoed, language: \"rust\"}` |\n\n## Forking for your own bridge\n\n```bash\n# 1. Get the source (anonymous — no GitHub account needed)\ncurl -O https://wiki-ufypy5dpx93o.adom.cloud/static/apps/adom-desktop/hello-rust-bridge.zip\nunzip hello-rust-bridge.zip && cd hello-rust\n\n# 2. Rename the crate + bridge\n#    - Cargo.toml: change \"name\" + \"version\"\n#    - bridge.json: change \"name\", \"displayName\", \"verbPrefixes\", \"verbs\"\n#    - bridge.json: change spawn.entrypoint + spawn.killImageName to your exe name\n#    - src/main.rs: rename the match arms in handle_command()\n\n# 3. Replace the verb implementations with calls into your tool's SDK\n#    (vendor C lib via FFI, instrument driver, your REST API, etc.)\n\n# 4. Build + test\ncargo build --release\ntarget/release/your-bridge.exe --port 8891   # in one terminal\nadom-desktop bridge_install '{\"manifestUrl\":\"file:///abs/path/to/your/bridge.json\"}'\n\n# 5. Package + ship — see the SDK guide\n```\n\nThe full source tree is at [`scripts/sample-bridges/hello-rust/`](https://github.com/adom-inc/adom-desktop/tree/main/scripts/sample-bridges/hello-rust) in the Adom Desktop repo.\n\n## When Rust is the right choice\n\nPick `hello-rust` (vs. the Python flavor) when:\n\n- **Zero runtime install.** Your users don't need Python/Node/Java/.NET to be on the machine. The bridge is a single executable.\n- **Native speed.** CPU-bound verbs (image processing, large data parsing, real-time instrument control) benefit from compilation.\n- **Type safety.** `serde`'s `Deserialize` makes ill-formed args fail at parse time, not deep inside your handler.\n- **Cross-compile to anywhere.** `cargo build --target x86_64-pc-windows-msvc` from Linux, etc.\n\nPick [`hello-python`](https://wiki-ufypy5dpx93o.adom.cloud/apps/adom-desktop-hello-python-bridge) when you need fast dev-iter loops, Python ecosystem libraries, or your tool's SDK is Python-first.\n\n## Platform notes\n\n| Platform | Status | Notes |\n|---|---|---|\n| Windows x64 | ✅ supported | Pre-built `hello-rust.exe` ships in the zip |\n| macOS | rebuild required | `cargo build --release` on a Mac, then re-zip |\n| Linux | rebuild required | `cargo build --release` on Linux, then re-zip |\n\nFor a forked third-party bridge that needs multi-OS distribution, the recommended pattern is GitHub Actions building per-target binaries on tag push, then a single zip with all three.\n\n## License\n\nMIT. Fork freely, sell what you build on top.\n\n## See also\n\n- [Adom Desktop bridge SDK guide](https://wiki-ufypy5dpx93o.adom.cloud/apps/adom-desktop-bridges) — `bridge.json` schema, packaging, lifecycle\n- [`hello-python`](https://wiki-ufypy5dpx93o.adom.cloud/apps/adom-desktop-hello-python-bridge) — Python port of this same surface\n- [Bridges registry](https://wiki-ufypy5dpx93o.adom.cloud/apps/adom-desktop-bridges-registry) — community-maintained list of installable bridges\n- [Reference bridges: KiCad, Fusion 360, Puppeteer](https://wiki-ufypy5dpx93o.adom.cloud/apps/adom-desktop-bridges-registry) — full-complexity production examples\n",
  "author": {
    "id": "695820315b5f1e4db2fcf602",
    "name": "Kyle Bergstedt",
    "email": "[email protected]"
  },
  "visibility": {
    "public": true
  },
  "hero": null,
  "discovery_triggers": [],
  "discovery_pitch": null,
  "metadata": {},
  "created_at": "2026-05-28T05:28:41.949Z",
  "updated_at": "2026-05-28T05:28:41.949Z",
  "skills": []
}