Reference
Application Bridge API
Reference for the communication layer between OOMU's interface (the Next.js/React front end) and its desktop engine (the Tauri/Rust back end).
The bridge is the boundary where the user-facing application asks the native engine to do work: read a file safely, save a configuration, install a capability package, run inference. This document describes how that boundary works and catalogues the commands most relevant to integrators.
1. How the bridge works
The front end never touches the filesystem, database, or models directly. It calls commands; named functions implemented in Rust and exposed through Tauri's IPC. The interface invokes them through a single typed wrapper.
1.1 The invoke wrapper
All calls go through the application's invoke helper (src/lib/invoke.ts), which wraps Tauri's core invoke:
import { invoke } from "@/lib/invoke";
const mods = await invoke<InstalledMod[]>("list_installed_mods");
- Signature:
invoke<T>(command: string, args?: Record<string, unknown>): Promise<T> - Generic
Tis the expected return type; the back-end result is deserialised into it. - Runtime detection: when running inside the Tauri runtime, the call is dispatched to the native engine. In browser-based development (no Tauri runtime), the same call is routed to a local mock endpoint so the UI can be developed without the desktop shell.
1.2 Argument naming
Command arguments are passed as a plain object using camelCase keys. Tauri maps them to the corresponding snake_case parameters on the Rust command:
// Front end (camelCase)
await invoke("set_mod_active_state", { modId, active: nextState });
// Back end (snake_case parameters)
// fn set_mod_active_state(mod_id: String, active: bool, ...)
1.3 Error model
When a command fails, invoke throws an InvokeError rather than a raw rejection:
| Property | Description |
|---|---|
message | A human-readable description, always populated. |
command | The command name that failed. |
code | A machine-readable error code when the back end supplied one (e.g. mod_picker_invalid_file, local_inference_cancelled). |
detail | The original rejection value, preserved for debugging. |
Expected cancellations (such as local_inference_cancelled) are surfaced distinctly from genuine failures, so the UI can treat a user-cancelled stream differently from an error.
2. Command reference
OOMU exposes a large command surface (roughly 290 commands as of the P1 expansion). This reference focuses on the categories an integrator works with most. Each command is a Tauri command invoked by name through the wrapper above. The full authoritative list is the set of #[tauri::command] functions registered in the Rust engine.
Convention: argument keys are shown in camelCase as the front end passes them. Return types describe the deserialised result.
2.1 Local context & path validation
These commands let the interface read user-selected files and folders safely, never by raw path access.
read_local_context
Reads a user file or directory into bounded text for use as conversation context, enforcing strict path safety.
- Args:
{ path: string }; must be an absolute path. A leading~is expanded to the user's home directory. - Returns:
{ name, path, mimeType, byteCount, text, truncated } - Safety behaviour:
- The path is canonicalised (aliases and symlinks are resolved to their real target) before any check, so a shortcut pointing outside the approved area is rejected on its real destination.
- The resolved path must fall within the approved roots: the user's home directory, the system temporary directory, or the current workspace directory. Anything outside is refused.
- Reads are bounded: per-file content is capped (96 KB per file), total context text is capped (128 KB), and directory walks are limited in depth (3 levels), entry count (240), and number of file excerpts (40). Oversized content is truncated and flagged with
truncated: true. - Directory mode: when
pathis a directory, the responsemimeTypeistext/x-directory-contextandtextcontains a structured, depth-limited listing with excerpts.
list_local_directory
Lists the contents of a directory within the approved roots, for building file pickers and workspace views without granting raw filesystem access.
choose_local_model_directory / get_local_model_directory
Open a native folder picker for the local model directory, and read the currently configured directory.
choose_mod_package_path
Opens a native file picker filtered to .oomu packages.
- Args: none
- Returns:
string | null; the chosen path, ornullif cancelled. Rejects non-.oomuselections with codemod_picker_invalid_file.
2.2 Configuration
Commands that persist user configuration to the encrypted local database.
| Command | Purpose | Args (camelCase) |
|---|---|---|
save_agent_config / update_agent_configuration | Create/update an assistant (name, role, provider, model, reasoning). | assistant config fields |
get_agent_config / list_agent_configs | Read one or all assistants. | { agentId } / none |
delete_agent_config | Remove an assistant. | { agentId } |
save_provider_config | Add/update a cloud provider (API key, base URL, model ids, auto-route target flag). | provider config fields |
list_provider_configs / delete_provider_config | Manage configured providers. | ; / { providerId } |
save_routing_preference / get_routing_preference | Persist primary/fallback route preference. | route fields |
set_routing_preference | Set the active routing preference. | route fields |
update_chat_session_dynamic_routing_override | Turn Auto-Route (dynamic routing) on/off for a specific session. | { sessionId, dynamicRoutingOverride } |
save_session_config / get_session_config | Per-session reasoning depth, context budget, model. | session fields |
get_default_prewarmed_model / set_default_prewarmed_model | Read/choose the local model pre-warmed on launch. | ; / { modelId } |
set_automated_web_grounding_enabled | Toggle automatic web grounding (Privacy setting; off by default). | { enabled } |
2.3 Capability packages (Mods)
| Command | Purpose | Args (camelCase) | Returns |
|---|---|---|---|
install_mod_from_path | Validate and install a .oomu package from disk. | { path } | InstalledMod |
list_installed_mods | List installed capabilities. | none | InstalledMod[] |
uninstall_mod | Remove an installed capability and its files. | { modId } | ; |
set_mod_active_state | Toggle a Mod's global active state. | { modId, active } | ; |
bind_mod_to_agent | Attach a Mod to an assistant. | { agentId, modId } | ; |
unbind_mod_to_agent | Detach a Mod from an assistant. | { agentId, modId } | ; |
get_agent_mods | List Mods bound to an assistant. | { agentId } | Mod list |
InstalledMod shape (camelCase over the IPC boundary):
type InstalledMod = {
id: string;
name: string;
description: string;
isActive: boolean;
version: string;
author: string;
category: string;
packageSize: string;
lastUpdated: string;
permissions: { label: string; detail: string }[];
endpoints: string[];
};
2.4 Conversation & inference
| Command | Purpose |
|---|---|
create_chat_session / list_chat_sessions / delete_chat_session / rename_chat_session | Manage chat sessions. |
list_chat_messages | Read messages in a session. |
chat_turn | Run a full chat turn through the router. Accepts automatedWebGroundingEnabled and dynamicRoutingOverride, and resolves Auto-Route (local vs. cloud) per turn. |
classify_chat_intent_route | Classify a prompt as conversational vs. local-action (see Smart Model Routing). |
stream_native_inference / cancel_native_inference | Start and cancel a local streaming inference. Cancellation surfaces as code local_inference_cancelled. |
run_provider_inference | Run inference against a configured cloud provider. |
sync_provider_models | Refresh the model list for a provider. |
get_session_context_status / execute_semantic_compaction | Report a session's context usage and compact history when it approaches the context horizon. |
infer | Lower-level single inference call. |
Auto-Route (dynamic routing). When a session is bound to the special
dynamicroute,chat_turnscores each prompt's complexity and selects the engine per turn: below threshold → local Gemma; at/above → the provider marked as the Auto-Route target (or a cost-efficient cloud fallback). The per-session toggle is set viaupdate_chat_session_dynamic_routing_override.
2.5 Workflows
| Command | Purpose | Args (camelCase) |
|---|---|---|
get_workflow_capability_catalog | List available workflow capabilities (agent, control, MCP tool, system action), merged with connected MCP tools. | ; |
compose_workflow | Draft a workflow from a natural-language prompt against the catalogue. | { prompt, capabilityCatalog, workflowId?, name? } |
edit_workflow | Revise an existing workflow from a natural-language instruction. | { prompt, capabilityCatalog, workflowId, name? } |
save_workflow | Persist a workflow (versioned). | workflow fields |
get_workflows / get_workflow_irs | List saved workflows / their compiled IR. | ; |
run_workflow | Execute a saved workflow. | workflow run fields |
resolve_workflow_permission | Approve or decline a paused permission gate mid-run. | { ... , approved } |
reveal_workflow_output_file | Open a workflow's output file. | { path } |
delete_workflow | Remove a saved workflow. | { ... } |
Workflow composition (compose_workflow / edit_workflow) is gated by a feature flag (OOMU_WORKFLOW_AUTHORING_P0), enabled by default; when disabled these return a disabled response.
2.6 Trust & sandbox
| Command | Purpose |
|---|---|
get_sandbox_status | Report the current sandbox state. |
get_sovereign_trust_dashboard | Read all directory trust policies and active trust sessions. |
upsert_sovereign_trust_policy / revoke_sovereign_trust_policy | Create/update or revoke a per-directory trust policy. |
activate_sovereign_trust_session / revoke_sovereign_trust_session | Start or end a time-boxed trust session. |
See Privacy & Sandboxing for what these govern.
2.7 Locale, models & diagnostics
| Command | Purpose |
|---|---|
get_locale_state / set_active_locale | Read and set the interface language (OOMU ships localised UI in multiple languages). |
list_local_models / get_local_model_status | Enumerate and check the local model(s). |
run_system_diagnostics / get_system_diagnostic_context | Produce a diagnostics report / context. |
get_launch_readiness | Report whether the workspace is ready to use. |
mcp_builtin_server_configs | List built-in MCP server configurations available to connect. |
2.8 Projects
| Command | Purpose |
|---|---|
create_project / list_projects / get_project / update_project | Manage Project workspaces. |
archive_project / preview_project_deletion / delete_project | Archive, preview the impact of, or permanently delete a Project. |
attach_project_source / list_project_sources / refresh_project_source / revoke_project_source | Manage a Project's knowledge folders and their indexing. |
set_project_instructions / set_project_policy / set_project_connector | Configure a Project's instructions, data policy, and connector bindings. |
project_policy_preflight | Evaluate a Project's data policy before a cloud/connector/remote transmission. |
get_project_memory_summary | Summarise Project-scoped memory with provenance. |
2.9 Tasks (the control plane)
| Command | Purpose |
|---|---|
list_task_runs / get_task_run | List/read canonical task runs across every runtime (workflow, agent, routine, browser, artifact, delegation). |
cancel_task_run / retry_task_run / resume_task_run / acknowledge_task_failure | Route lifecycle controls to the owning runtime; retries reuse idempotency records. |
reconcile_task_runs / get_recoverable_actions | Reconcile non-terminal tasks with their owning runtime on startup/refresh. |
reconnect_task_events | Resume the ordered task event stream from the last sequence number. |
reserve_task_effect / verify_task_effect | Reserve an idempotent effect and verify its observed postcondition. |
2.10 Routines, background helper & channels
| Command | Purpose |
|---|---|
propose_routine | Parse a natural-language schedule into a proposed Routine with normalized next runs. |
create_routine / list_routines / get_routine / update_routine / delete_routine / duplicate_routine | Manage Routines. |
pause_routine / resume_routine / run_routine_now / get_routine_history | Control and inspect Routine runs. |
grant_routine_authority | Grant task/project-scoped preauthorization for headless consequential actions. |
get_background_service_status / set_background_service_enabled | Read/toggle the macOS background helper (Login Item). |
list_channel_configs / save_channel_config / get_channel_statuses | Configure Signal/Telegram/WhatsApp/Discord delivery and control channels. |
queue_message / get_queued_messages / execute_queued_messages | The remote-control message queue. |
2.11 Connectors (work apps)
| Command | Purpose |
|---|---|
list_connector_manifests / list_connector_accounts | Enumerate available connectors and connected accounts. |
begin_connector_oauth | Start an OAuth (PKCE, loopback-bound) authorization for Google/Slack/Microsoft 365. |
test_connector / get_capability_health | Probe a connection's real health. |
execute_connector_operation | Run a connector tool (reads direct; writes are approval-gated). |
disconnect_connector | Revoke and remove a connected account. |
2.12 Documents & artifacts
| Command | Purpose |
|---|---|
create_artifact / list_artifacts / get_artifact / revise_artifact | Build and revise a DOCX/PDF artifact from the Artifact IR. |
create_workbook / create_workbook_from_template / revise_workbook_range | XLSX workbook pipeline. |
create_presentation / revise_presentation_scope / recheck_presentation_revision | PPTX presentation pipeline. |
get_artifact_preview_page / get_workbook_preview / get_presentation_preview | Rendered previews. |
export_artifact / export_workbook_revision / export_presentation_revision / choose_artifact_export_destination | Export with an explicit destination grant. |
sign_artifact / verify_artifact_signature / get_artifact_pipeline_health | Provenance signing and verification. |
2.13 Automation: browser & app control
| Command | Purpose |
|---|---|
start_browser_automation / get_browser_automation_session / control_browser_automation / close_native_browser | Guarded browser session lifecycle. |
execute_browser_action | Run one reference-based browser action (navigate, click, type, select, upload, download, wait). |
export_browser_download / choose_browser_upload | Quarantined download export / approved upload. |
start_app_control_session / observe_app_control_session / get_app_control_status | Observe a qualified macOS app before acting. |
review_and_execute_app_control_action / control_app_control_session | Execute a typed, approved app action; pause/take-over/return. |
2.14 Media, delegation, learning & remote
| Command | Purpose |
|---|---|
ingest_media_asset / list_media_assets / get_media_asset_data / delete_media_asset | Media asset pipeline (voice/image/screenshot). |
save_media_transcript / save_media_alt_text / analyze_media_image / sanitize_media_image | Transcription, vision, redaction. |
create_delegation_plan / execute_delegation_plan / cancel_delegation_child / retry_delegation_child | Bounded parallel read-only helpers, owned by the parent Task. |
prepare_learning_offer / review_learning_offer / list_saved_methods / edit_saved_method / set_saved_method_enabled / go_back_saved_method / forget_saved_method | Reviewable, reversible learned recipes. |
list_remote_devices / rename_remote_device / revoke_remote_device / execute_remote_command / retrieve_remote_artifact | Remote device management and scoped remote commands. |
2.15 Capability bundles
| Command | Purpose |
|---|---|
inspect_capability_bundle | Static inspection and capability diff before install. |
activate_capability_bundle / disable_capability_bundle / list_capability_bundles | Install/enable, disable, and list bundles. |
authorize_bundle_capability | Grant a declared capability at activation. |
list_capability_registry / refresh_capability_registry | Browse the curated registry (signing and review status are distinct). |
2.16 First-run setup
| Command | Purpose |
|---|---|
get_setup_state / save_setup_progress | Resumable first-run setup state machine. |
run_setup_sample_task | Run the guided end-to-end sample task. |
accept_license / decline_license | Mandatory license acceptance gate. |
get_weekly_decision_brief_status / create_decision_brief_from_delegation | The "Weekly brief" starter flow. |
3. Notes for integrators
- Treat every path through
read_local_context. Do not attempt to pass raw paths to other commands expecting filesystem access; the safe-path boundary is enforced centrally and exists for the user's protection. - Long-running work returns promptly. Heavy operations (installs, inference) run off the UI thread on the back end; the
invokepromise resolves when the work completes or streams. - Codes over messages for control flow. When you need to branch on a specific failure (cancellation, invalid file), check
InvokeError.code, not the message text.
Related
- Capability Package Specification: the
.oomuformat the Mod commands operate on. - Local Database Schema: where configuration commands persist their data.
- System Design Overview: how the front end and engine fit together.