Expand description
Shared bob CLI integration logic.
Two consumers:
src-tauri(production desktop runtime, via Tauri commands)bob-api(axum HTTP server used by browser-preview dev)
Both call into this crate’s public API directly. Streaming
operations (install, run_bob) take callback closures so each
consumer can adapt to its own transport — Tauri Channel<T>
on one side, axum SSE on the other.
Wire shapes (InstallEvent, BobReadinessSnapshot, etc.) are
#[derive(Serialize)] so both transports emit identical JSON.
Keep their field names stable — the TypeScript front-end
consumes them verbatim and doesn’t reach back through TS-→Rust
type generation today.
Re-exports§
pub use check::get_readiness;pub use check::BobReadinessSnapshot;pub use error::BobError;pub use install::install_bob;pub use keychain::auth_source;pub use keychain::delete_api_key;pub use keychain::read_api_key;pub use keychain::resolve_api_key;pub use keychain::write_api_key;pub use keychain::KeySource;pub use run::spawn_bob;pub use run::spawn_bob_raw;pub use run::BobApprovalMode;pub use run::BobChatMode;pub use run::RunBobOptions;
Modules§
- check
- Readiness probe for the bob CLI + its dependencies.
- error
- Typed errors for the bob SDK.
- install
- Streaming installer for the bob CLI + nvm + Node.
- keychain
- OS-keychain storage for the Bob API key.
- run
- Build the bob CLI argv and spawn it via the shared streaming engine.
Structs§
- Process
Handle - Handle to an in-flight streaming run. Caller stores it (e.g. in a
runId-keyed map) so a later
cancel()can find it.
Enums§
- Install
Event - Process
Event - Raw events emitted to the caller’s callback during a streaming run.
JSON-tagged so axum SSE and Tauri Channel render identical payloads
on the wire. Harness-neutral: a process-backed adapter parses the
Stdoutlines into a normalized event vocabulary (e.g.agent-harness’sRunEvent).
Constants§
- BOB_
MIN_ NODE_ VERSION - Bob’s documented minimum Node.js version. Mirrored in
scripts/install-bob.sh’sREQUIRED_NODE_MAJORdefault. Bumping this string also requires updating the bob installer. - KEYCHAIN_
ACCOUNT - KEYCHAIN_
SERVICE - Service + account keys used to identify the bob API-key entry in
the OS keychain. The service is
"bob"(this is the bob SDK; the slot belongs to the bob tool, not to any host product), the account is bob’s documented env var name. Both transports hit the exact same slot — switching either string orphans stored keys.
Functions§
- augmented_
node_ path - A PATH that resolves Node-based CLIs (bob, claude, codex) even from a
process launched by Finder/Launchpad, which inherits only the minimal
launchd PATH (
/usr/bin:/bin:/usr/sbin:/sbin) rather than the user’s shell PATH. - spawn_
streaming - Spawn an arbitrary streaming child process — the generic engine behind every process-backed harness (bob, Claude Code, Codex).