The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
docs: add README files for several crates and modules
Steven Enamakel765a9404a109
diff --git a/crates/openhuman-core/src/agent/harness/README.md b/crates/openhuman-core/src/agent/harness/README.mdindex 5dacbdf461..8e41455872 100644--- a/crates/openhuman-core/src/agent/harness/README.md+++ b/crates/openhuman-core/src/agent/harness/README.md@@ -35,27 +35,24 @@ used here (not defined here) by `agent_graph.rs` and `fork_context.rs`.- Offload oversized worker artifacts to the filesystem, and persist oversizedtool results as action-workspace artifacts (`artifact_offload/`,`tool_result_artifacts/`).-- Queue mid-turn messages into steer/followup/collect lanes without aborting- the in-flight turn (`run_queue/`).+- Run the channel/CLI turn graph (`graph.rs`) and let a built-in agent select+ a bespoke sub-agent turn graph (`agent_graph.rs`).## Key sub-modules| Module | Role || --- | --- |-| `session/` | `Agent`/`AgentBuilder`/`TurnOverrides` (`types.rs`), the fluent builder + `Agent::from_config` factory (`builder/`), the turn lifecycle (`turn/`: `context.rs`, `core*.rs`, `graph.rs`, `recall_lanes.rs`, `session_io*.rs`, `tools.rs`), host-side transcript persistence + legacy migration (`session_io/`, `migration.rs`, `turn_checkpoint.rs`). Durable transcript codecs and discovery live in `tinyagents_session::transcript`. |-| `../subagent_host/` | Direct OpenHuman planner/executor/persistence adapters for `tinyagents-orchestration::subagent`: model resolution, tool filtering, sandbox/action-root narrowing, checkpoint/handback and transcript mirroring. || `definition*.rs`, `builtin_definitions.rs`, `definition_loader.rs` | `AgentDefinition`/`AgentDefinitionRegistry`/`SandboxMode`/`ToolScope`/`PromptSource`/`ModelSpec`; loads built-ins from `crate::agent::registry::agents` and user TOML from the workspace/home `agents/` directory. |-| `fork_context.rs`, `sandbox_context.rs`, `spawn_depth_context.rs`, `task_recency_context.rs` | Transitional task-locals for legacy callers. Live TinyAgents tool dispatch receives `OpenHumanRunContext` directly for parent, attachments, dispatch, and usage. |+| `fork_context.rs`, `sandbox_context.rs`, `spawn_depth_context.rs`, `task_recency_context.rs` | Task-locals that let a spawned tool see its parent's runtime context: parent handle, sandbox mode, spawn depth, and task-recency window. `fork_context.rs` also carries the `RunQueue` handle (from `tinyagents_harness::run_queue`) down to a forked turn. || `graph.rs` | `run_channel_turn_via_graph` (`pub(crate)`) — the channel/CLI turn graph, thin over `run_turn_via_tinyagents_shared`; called by the `agent.run_turn` native-bus handler in `agent/bus.rs`. |-| `agent_graph.rs` | `AgentGraph` (`Default`/`Custom`), `AgentTurnRequest`, `AgentTurnResult`, `AgentTurnUsage` — per-agent sub-agent turn-graph selection consumed by `subagent_host`. Every built-in agent currently selects `Default`. |-| `archivist/` | `ArchivistHook` (`types.rs`, `PostTurnHook` impl in `hook_impl.rs`) — post-turn episodic insert, segment boundary detection + lifecycle, LLM recap with heuristic fallback, lesson extraction from tool failures, and raw-prose ingestion into the memory tree when `config.learning.chat_to_tree_enabled` (`boundary.rs`, `lifecycle.rs`, `recap.rs`, `resummarise.rs`, `store.rs`, `tree_ingest.rs`, `events_heuristic.rs`). |+| `agent_graph.rs` | `AgentGraph` (`Default`/`Custom`), `AgentTurnRequest`, `AgentTurnResult`, `AgentTurnUsage` — per-agent sub-agent turn-graph selection consumed by `../subagent_host/`. Every built-in agent currently selects `Default`. |+| `archivist/` | `ArchivistHook` (`types.rs`, `PostTurnHook` impl in `hook_impl.rs`) — post-turn episodic insert, segment boundary detection and lifecycle, LLM recap with heuristic fallback, lesson extraction from tool failures, and raw-prose ingestion into the memory tree when `config.learning.chat_to_tree_enabled` (`boundary.rs`, `lifecycle.rs`, `recap.rs`, `resummarise.rs`, `store.rs`, `tree_ingest.rs`, `events_heuristic.rs`). || `artifact_offload/` | The `outputs/` / `workspace/` convention under `action_dir`: prompt half (`contract.rs`) and host policy half (`policy.rs`); mechanics (thresholds, path resolution, pointer rendering, the writer) live in `tinyagents_harness::artifacts` and are re-exported here. |-| `run_queue/` | `RunQueue` and `QueuedMessage` — steer/followup/collect lanes wrapping `tinyagents_harness::run_queue`; `QueueStatus` is re-exported from the crate. || `tool_result_artifacts/` | Persists oversized individual and aggregate tool outputs under `action_dir/artifacts/tool-results/`, replacing them with a bounded `[tool_result_preview]` envelope pointing at the full, redacted file. |-| `memory_context.rs`, `memory_context_safety.rs`, `memory_protocol.rs` | Working-memory and `[Cross-chat context]` lines surfaced into the prompt (capped by `WORKING_MEMORY_LIMIT`); trust-tier wrapping of recalled entries that came from connectors (`wrap_untrusted_for_agent`); and the read-index → dedupe → write → update-index enforcement state machine for memory-mutating tools (issue #4116). |-| `instructions.rs`, `parse.rs`, `required_output.rs` | Text-mode `<tool_call>` protocol section (`build_tool_instructions*`), `parse_tool_calls_with_pformat`, and required structured-output validation/repair. |-| `credentials.rs` | `scrub_credentials` — regex scrubbing of credential-shaped text (key/value secrets, AWS access-key IDs, `sk-…` keys). Applied to every tool result by the middleware in `agent/tinyagents/`. |-| `tinyagents/host/run_context.rs` | Explicit turn-scoped dispatch refusal and `LastTurnUsage`/`SubagentUsageEntry` accounting shared by synchronous descendants. Detached work resets these turn-only handles. |+| `memory_context.rs`, `memory_context_safety.rs`, `memory_protocol.rs` | Working-memory and `[Cross-chat context]` lines surfaced into the prompt (capped by `WORKING_MEMORY_LIMIT`); trust-tier wrapping of recalled entries that came from connectors (`wrap_untrusted_for_agent`); and the read-index, dedupe, write, update-index enforcement state machine for memory-mutating tools (issue #4116). |+| `required_output.rs` | Pure validate/repair/synthesize primitives (issue #4117) that guarantee a required structured-output block (for example a `thoughts` JSON block) on every accepted turn. The orchestration that calls these lives on the session in `../session_host/turn/`. |+| `parse_wire_tests.rs` | Test-only fixtures for OpenHuman's own wire vocabulary (`inference::provider::ToolCall`, native-history JSON, OpenAI function-calling payloads). The actual `<tool_call>` parsing (tags, fenced blocks, bare JSON, `<invoke>` XML, GLM grammar, p-format) moved to the vendored `tinytools_agent` crate; nothing about recovering a tool call from model text stayed here. |+| `credentials.rs` | `scrub_credentials` — regex scrubbing of credential-shaped text (key/value secrets, AWS access-key IDs, `sk-...` keys). Applied to every tool result by `CredentialScrubMiddleware` in `agent/tinyagents/middleware/credential_scrub.rs`, installed as the innermost tool wrap so nothing downstream sees the raw secret. |## Public surfacediff --git a/crates/openhuman-embed/src/agent/README.md b/crates/openhuman-embed/src/agent/README.mdindex 082feef842..1e2301776e 100644--- a/crates/openhuman-embed/src/agent/README.md+++ b/crates/openhuman-embed/src/agent/README.md@@ -6,28 +6,28 @@ for how agents fit into the two-step library API.## Contents-- `mod.rs` — `Agent`, the cheap-to-clone handle a host holds: `run()` /+- `mod.rs`: `Agent`, the cheap-to-clone handle a host holds: `run()` /`turn()` to talk to it, `action_dir()` / `workspace_dir()` / `home_dir()` /`skills_dir()` / `transcripts_dir()` for its paths, `provider()` /`access()` / `config()` for inspection. `AgentInner` is the shared statebehind every clone, and `AgentError` covers the ways building or driving anagent can fail (duplicate id, invalid id, widening the runtime's surface, aworkspace I/O failure).-- `spec.rs` — `AgentSpec`, the pure-data description a host builds before an+- `spec.rs`: `AgentSpec`, the pure-data description a host builds before anagent exists: id, `AgentDefinitionSpec`, provider, access, tool groups,domains, MCP servers (`mcp` feature), a skills directory (`skills`feature), `action_dir`, trusted paths, an escape-hatch config closure, andan optional per-turn tool factory (`tools()`). `Runtime::agent` appliesthese, in order, onto a clone of the runtime's base config.-- `definition.rs` — `AgentDefinitionSpec`, `ToolScopeSpec` and+- `definition.rs`: `AgentDefinitionSpec`, `ToolScopeSpec` and`SandboxModeSpec`: a thin re-spelling of the core's `AgentDefinition` sothe library surface does not track that struct field by field. The defaultis the built-in orchestrator's definition under the agent's own id, withevery registered tool visible.-- `layout.rs` — `AgentLayout`: where one agent's files live under the+- `layout.rs`: `AgentLayout`: where one agent's files live under theruntime's workspace (`agents/<id>/` for its home and skills,`session_raw/` for transcripts, plus its resolved `action_dir`).-- `build.rs` — `instantiate`, the function that turns an `AgentSpec` plus a+- `build.rs`: `instantiate`, the function that turns an `AgentSpec` plus a`Runtime` into the assembled `AgentInner` (lays out directories, copiesskills, builds the `Config`, derives the `CoreContext`).@@ -49,7 +49,7 @@ belt bound to something shorter-lived than the agent can vary per turn).## Where to look next-- [`../runtime/README.md`](../runtime/README.md) — what instantiates an+- [`../runtime/README.md`](../runtime/README.md): what instantiates anagent and what stays runtime-wide instead of per-agent.-- [`../harness/README.md`](../harness/README.md) — the one-runtime,+- [`../harness/README.md`](../harness/README.md): the one-runtime,one-agent shorthand.diff --git a/crates/openhuman-embed/src/harness/README.md b/crates/openhuman-embed/src/harness/README.mdindex 20f0faf10f..b48dd8d9f3 100644--- a/crates/openhuman-embed/src/harness/README.md+++ b/crates/openhuman-embed/src/harness/README.md@@ -9,25 +9,25 @@ host needs more than one agent.## Contents-- `mod.rs` — `Harness` itself (`run()`, `turn()`, `runtime()`, `agent()`,+- `mod.rs`: `Harness` itself (`run()`, `turn()`, `runtime()`, `agent()`,`core()`, `workspace_dir()`, `action_dir()`) and `HarnessCore`, adeliberately narrow facade over non-turn domains (config, auth) thatexposes neither the raw runtime nor the orchestrator agent, so nothing canstart a turn that skips the harness's provider route and access tier.-- `builder.rs` — `HarnessBuilder`: provider, workspace, access, `backend_url`+- `builder.rs`: `HarnessBuilder`: provider, workspace, access, `backend_url`(for non-inference backend calls when the embedding product has its ownbackend), and `session` (installing a backend identity when required).-- `access.rs` — `Access`: the tier a turn runs under (`readonly`, `full`,+- `access.rs`: `Access`: the tier a turn runs under (`readonly`, `full`,`trust`).-- `provider.rs` — `Provider`: which model answers and where the request+- `provider.rs`: `Provider`: which model answers and where the requestgoes, including `Provider::openai_compatible` for a caller-suppliedendpoint and `Provider::inherit` to run exactly as the installed app does.-- `workspace.rs` — `Workspace`: `Ephemeral`, `dir(path)`, or `Inherit` (the+- `workspace.rs`: `Workspace`: `Ephemeral`, `dir(path)`, or `Inherit` (theoperator's real `~/.openhuman` workspace and session).-- `mcp.rs` (`mcp` feature) — `HttpHeader`, `McpAuthConfig`, `McpServer`.-- `skills.rs` (`skills` feature) — skill bundle discovery and copying for a+- `mcp.rs` (`mcp` feature): `HttpHeader`, `McpAuthConfig`, `McpServer`.+- `skills.rs` (`skills` feature): skill bundle discovery and copying for aharness-owned agent.-- `error.rs` — `HarnessError`.+- `error.rs`: `HarnessError`.## Running on your own endpoint@@ -56,5 +56,5 @@ runs exactly as the installed app does, session included.## Where to look next- [`../runtime/README.md`](../runtime/README.md) and- [`../agent/README.md`](../agent/README.md) — the two types `Harness`+ [`../agent/README.md`](../agent/README.md): the two types `Harness`wraps.diff --git a/crates/openhuman-embed/src/runtime/README.md b/crates/openhuman-embed/src/runtime/README.mdindex 34e5b3f2f6..89fd92db13 100644--- a/crates/openhuman-embed/src/runtime/README.md+++ b/crates/openhuman-embed/src/runtime/README.md@@ -8,15 +8,15 @@ for what running many agents on one runtime costs in memory.## Contents-- `mod.rs` — `Runtime` itself: `agent()` to instantiate an `Agent` from an+- `mod.rs`: `Runtime` itself: `agent()` to instantiate an `Agent` from an`AgentSpec`, `agent_ids()`, `core()` for non-turn access (config, auth),`root_dir()` / `workspace_dir()`, and the process-scoped `CoreGuard` thattears the embedded core down (and, for an ephemeral workspace, deletes it)once the last `Runtime` or `Agent` handle referencing it drops.-- `builder.rs` — `RuntimeBuilder`: workspace choice, feature/service/domain+- `builder.rs`: `RuntimeBuilder`: workspace choice, feature/service/domainselection, provider and access defaults, and `api_key()` for managedTinyHumans inference.-- `api_key.rs` — `ApiKey`, the newtype the builder stores the TinyHumans key+- `api_key.rs`: `ApiKey`, the newtype the builder stores the TinyHumans keyas before it reaches the credential store.## What is runtime-wide versus per-agent@@ -52,8 +52,8 @@ overflow.## Where to look next-- [`../agent/README.md`](../agent/README.md) — what `Runtime::agent` builds.-- [`../harness/README.md`](../harness/README.md) — the one-agent shorthand+- [`../agent/README.md`](../agent/README.md): what `Runtime::agent` builds.+- [`../harness/README.md`](../harness/README.md): the one-agent shorthandbuilt on top of a `Runtime` and an `Agent`.- `openhuman-tinyhumans`'s `RuntimeBuilder` extension(`crates/openhuman-tinyhumans/src/lib.rs`) boots a runtime already connecteddiff --git a/crates/openhuman-tinyhumans/src/hosted/README.md b/crates/openhuman-tinyhumans/src/hosted/README.mdindex c7cb49ca39..f4c6cb48a4 100644--- a/crates/openhuman-tinyhumans/src/hosted/README.md+++ b/crates/openhuman-tinyhumans/src/hosted/README.md@@ -8,13 +8,13 @@ connection has no use for them.## Contents-- [`billing/`](billing/README.md) — plans, Stripe/Coinbase purchase and+- [`billing/`](billing/README.md): plans, Stripe/Coinbase purchase andtop-up flows, credit balance and transactions, auto-recharge and savedcards, coupon redemption.-- [`team/`](team/README.md) — team CRUD, membership, role changes, invites,+- [`team/`](team/README.md): team CRUD, membership, role changes, invites,usage, active-team switching.-- [`referral/`](referral/README.md) — referral codes and reward claims.-- [`announcements/`](announcements/README.md) — the latest active product+- [`referral/`](referral/README.md): referral codes and reward claims.+- [`announcements/`](announcements/README.md): the latest active productannouncement, surfaced on harness init.Each domain follows the same shape: an `ops.rs` of async handlers that@@ -38,7 +38,7 @@ point; it never grows a `billing` or `team` branch of its own.## Where to look next- Each subdirectory's own README for its RPC surface and wire names.-- [`../transport/README.md`](../transport/README.md) — the+- [`../transport/README.md`](../transport/README.md): the`BackendTransport` these domains ultimately call through.-- `AGENTS.md`, "Backend API" — why hosted-only proxy domains belong here and+- `AGENTS.md`, "Backend API": why hosted-only proxy domains belong here andnot in the core.diff --git a/crates/openhuman-tinyhumans/src/jev/README.md b/crates/openhuman-tinyhumans/src/jev/README.mdindex da11796ce4..34157f3b51 100644--- a/crates/openhuman-tinyhumans/src/jev/README.md+++ b/crates/openhuman-tinyhumans/src/jev/README.md@@ -7,11 +7,11 @@ retrieval.## Contents-- `mod.rs` — `install_jev_ranker()`, the one entry point. It builds a+- `mod.rs`: `install_jev_ranker()`, the one entry point. It builds a`TinyHumansJevRanker` and registers it as the process-wide `tool_search`ranker through `openhuman_core::agent::tinyagents::discovery`. Idempotent:calling it again replaces the previous ranker in place.-- `ranker.rs` — `TinyHumansJevRanker`, the `ToolRanker` implementation. It+- `ranker.rs`: `TinyHumansJevRanker`, the `ToolRanker` implementation. Itresolves the current backend credential and base URL on every search(not once at install time, since a desktop process signs in and out whileit runs), embeds the tool catalogue through the process's own embedding@@ -19,7 +19,7 @@ retrieval.Choice evaluation to pick from it. The built Jev client is cached bycredential and base URL fingerprint so a stable session does not rebuildan HTTP client on every search.-- `evaluator.rs` — `TinyJevEvaluator`, the `tinytools_jev::JevEvaluator` that+- `evaluator.rs`: `TinyJevEvaluator`, the `tinytools_jev::JevEvaluator` thatreaches Jev through the backend's `/agent-integrations/openrouter/systemone`proxy with the same credential every other backend call uses.@@ -37,11 +37,11 @@ never makes a decision over a shortlist it distrusts.## Where to look next-- `vendor/tinyagents/vendor/tinytools/crates/tinytools-jev/` — the generic+- `vendor/tinyagents/vendor/tinytools/crates/tinytools-jev/`: the generic`JevRanker` / `JevEvaluator` / `JevStrategy` types this module configures.-- `crates/openhuman-core/src/config/schema/agent.rs` — `ToolSearchConfig`,+- `crates/openhuman-core/src/config/schema/agent.rs`: `ToolSearchConfig`,where a config chooses `ranker = "jev"` (the default), `"bm25"`,`"auto"`, or `"compare"`.-- `cargo run -p openhuman-cli --bin tool-search-bench` — the ranker+- `cargo run -p openhuman-cli --bin tool-search-bench`: the rankercomparison harness; see[`../../../openhuman-cli/src/bin/README.md`](../../../openhuman-cli/src/bin/README.md).diff --git a/crates/openhuman-tinyhumans/src/session/README.md b/crates/openhuman-tinyhumans/src/session/README.mdindex fcff774b2e..9c61f9b5a6 100644--- a/crates/openhuman-tinyhumans/src/session/README.md+++ b/crates/openhuman-tinyhumans/src/session/README.md@@ -11,26 +11,26 @@ crate; see `AGENTS.md`'s "Backend API" section for the boundary it keeps.## Contents-- `client.rs` — `SessionClient`: the actual backend calls, login-token+- `client.rs`: `SessionClient`: the actual backend calls, login-tokenexchange and `GET /auth/me`, plus `ClientHeaders`. Carries the store-timetimeout, retry and transient-failure policy. Errors are`SessionClientError` / `FetchMeError`.-- `cache.rs` — `CurrentUserCache` / `CachedUser`: the last `/auth/me` answer,+- `cache.rs`: `CurrentUserCache` / `CachedUser`: the last `/auth/me` answer,served fresh or stale-while-revalidate, with bounded backoff while thebackend is unreachable.-- `link.rs` — `CoreLink` / `CoreAuthState`: how a resolved credential is+- `link.rs`: `CoreLink` / `CoreAuthState`: how a resolved credential ispushed into whichever core the host owns, through `auth.set_credential` /`auth.clear_credential` / `auth.get_state`. This is the only door into acore from this module.-- `manager.rs` — `SessionManager`, the host-facing orchestration over the+- `manager.rs`: `SessionManager`, the host-facing orchestration over thethree pieces above: login, store, logout, current user, state, and changeevents (`SessionEvent`, `SessionState`, `SessionError`).-- `credential.rs` — `Credential` / `CredentialKind` and the JWT helpers+- `credential.rs`: `Credential` / `CredentialKind` and the JWT helpers(`decode_jwt_exp`, `jwt_is_live`, `user_id_from_jwt_claims`,`user_id_from_profile_payload`).-- `identity.rs` — process-global identity state read by synchronous Sentry+- `identity.rs`: process-global identity state read by synchronous Sentryhooks that cannot await a cache lookup.-- `test_support.rs` — fixtures shared by this module's own tests.+- `test_support.rs`: fixtures shared by this module's own tests.## What this module must not do@@ -44,7 +44,7 @@ host owns the login; the core only takes the resulting credential.- `AGENTS.md`, "Tool, harness, and runtime boundaries" and "Backend API" —why login ownership sits here and not in the core.- [`gitbooks/developing/tinyhumans-api-key.md`](../../../../gitbooks/developing/tinyhumans-api-key.md)- — the API-key alternative to a session login for library and headless+ : the API-key alternative to a session login for library and headlesshosts, which does not go through this module.-- [`../transport/README.md`](../transport/README.md) — the transport a+- [`../transport/README.md`](../transport/README.md): the transport aresolved credential ultimately authenticates.diff --git a/crates/openhuman-tinyhumans/src/transport/README.md b/crates/openhuman-tinyhumans/src/transport/README.mdindex aec5e7895b..1bbc27f8a9 100644--- a/crates/openhuman-tinyhumans/src/transport/README.md+++ b/crates/openhuman-tinyhumans/src/transport/README.md@@ -7,7 +7,7 @@ header shapes the backend expects.## Contents-- `mod.rs` — `SdkBackendTransport`. It holds one `reqwest::Client` per+- `mod.rs`: `SdkBackendTransport`. It holds one `reqwest::Client` per`TransportProfile` (`Api`, `Integrations`), each built from the core's`api::headers::build_backend_client` so TLS, timeouts and the attributionheaders (`x-core-version`, `x-tauri-version`, `x-sdk-name`) match exactly@@ -16,7 +16,7 @@ header shapes the backend expects.(`BackendCredential::Session` as a bearer token, `BackendCredential::ApiKey`as `x-api-key`), and forward to the SDK's `raw()` client. `name()` returns`"tinyhumans-sdk"`.-- `error.rs` — `map_sdk_error`, translating `tinyhumans_sdk::Error` into the+- `error.rs`: `map_sdk_error`, translating `tinyhumans_sdk::Error` into thecore's `BackendTransportError` variants.## Installing it@@ -41,9 +41,9 @@ route implementation of its own.## Where to look next-- `AGENTS.md`, "Backend API" — the full port/adapter boundary and the header+- `AGENTS.md`, "Backend API": the full port/adapter boundary and the headerrules every authenticated request must follow.-- [`../session/README.md`](../session/README.md) — where the credential this+- [`../session/README.md`](../session/README.md): where the credential thistransport attaches comes from.-- [`../hosted/README.md`](../hosted/README.md) — the RPC proxy domains built+- [`../hosted/README.md`](../hosted/README.md): the RPC proxy domains builton top of this transport.