Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore(web3): add README files for web3 and x402 modules

Steven Enamakele5e51f52c740
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
index a693665963..01719f265a 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs
@@ -24,7 +24,7 @@ use crate::tools::http_request_tool;
use tinytools::Tool as _;
/// [`HttpClient`] adapter over `HttpRequestTool`
-/// (`crates/openhuman-core/src/tools/impl/network/http_request.rs`). Allowlist + DNS-rebind
+/// (`tinytools_std::network::HttpRequestTool`, built by `tools/impl/network/host.rs`). Allowlist + DNS-rebind
/// guard live inside `execute`, so this adapter gets them for free.
///
/// **B2:** also routes through the OpenHuman `ApprovalGate` before dispatch
diff --git a/crates/openhuman-core/src/tools/impl/README.md b/crates/openhuman-core/src/tools/impl/README.md
index c89537bb54..00adace626 100644
--- a/crates/openhuman-core/src/tools/impl/README.md
+++ b/crates/openhuman-core/src/tools/impl/README.md
@@ -29,10 +29,10 @@ tested but no production assembly site constructs it today.
| Family | Tools | Registration gate |
| --- | --- | --- |
-| `system/` | `ShellTool`, `NodeExecTool`, `NpmExecTool`, `PythonExecTool`, `InstallToolTool`, `DetectToolsTool` (from `tinytools_std`), `CurrentTimeTool` and `ResolveTimeTool` (imported directly from `tinyagents_harness::tools` at their call sites; no local copy), `ScheduleTool`, `ProxyConfigTool`, `PushoverTool`, `LspTool`, `ToolStatsTool`, `UpdateCheckTool`, `UpdateApplyTool`, `InsertSqlRecordTool`, `WorkspaceStateTool`, `RetrieveToolOutputTool`; shell failure rendering lives in `tinytools_std::command_output` | `node_exec`/`npm_exec` and `shell`'s PATH injection need the `runtime-node` Cargo feature plus `node.enabled`; `python_exec` needs `runtime_python.enabled`; `LspTool` needs `OPENHUMAN_LSP_ENABLED` (`lsp_capability_enabled`); `ToolStatsTool` needs `learning.enabled` and `learning.tool_tracking_enabled`; `InsertSqlRecordTool` is exported, not registered; the rest are always registered |
-| `filesystem/` | Host adapter only: `SecurityPolicy` implements `tinytools_std::filesystem::FsGate`. The tools (`FileReadTool`, `FileWriteTool`, `EditFileTool`, `ApplyPatchTool`, `GrepTool`, `GlobTool`, `ListFilesTool`, `ReadDiffTool`, `CsvExportTool`, `GitOperationsTool`, `RunLinterTool`, `RunTestsTool`, `UpdateMemoryMdTool`) live in `tinytools_std::filesystem` and are imported directly by `tools/ops.rs` | always registered, except `ReadDiffTool`, `RunLinterTool`, and `RunTestsTool`, which are exported, not registered |
-| `browser/` | `BrowserTool` (TinyComputer browser members and tasks), `BrowserOpenTool` (simple TinyComputer navigation), `ImageInfoTool` | Both browser tools need `browser.enabled` and the `modules` feature, and are deferred until `tool_search`; `ImageInfoTool` remains direct. Browser navigation uses the shared `http_request.allowed_domains` policy, and the checksum-pinned TinyComputer release module. |
-| `network/` | `HttpRequestTool`, `WebFetchTool`, `CurlTool`, `GitbooksSearchTool`, `GitbooksGetPageTool`, `GmailUnsubscribeTool`, and under the `mcp` Cargo feature `McpListServersTool`, `McpListToolsTool`, `McpCallTool`; `url_guard.rs` is the shared SSRF/allowlist validator, not a tool | `http_request`, `web_fetch`, `curl`, `gmail_unsubscribe` always registered; `gitbooks_*` need `gitbooks.enabled` and, when the active profile sets an `mcp_allowlist`, an entry named `gitbooks`; `mcp_list_servers`/`mcp_list_tools`/`mcp_call_tool` register only when the static `[[mcp_client.servers]]` registry (after the profile allowlist) is non-empty |
+| `system/` | `ShellTool`, `NodeExecTool`, `NpmExecTool`, `PythonExecTool`, `InstallToolTool`, `DetectToolsTool` (from `tinytools_std`), `CurrentTimeTool` and `ResolveTimeTool` (imported directly from `tinyagents_harness::tools` at their call sites; no local copy), `ScheduleTool`, `ProxyConfigTool`, `LspTool`, `ToolStatsTool`, `UpdateCheckTool`, `UpdateApplyTool`, `InsertSqlRecordTool`, `RetrieveToolOutputTool`; shell failure rendering lives in `tinytools_std::command_output` | `node_exec`/`npm_exec` and `shell`'s PATH injection need the `runtime-node` Cargo feature plus `node.enabled`; `python_exec` needs `runtime_python.enabled`; `LspTool` needs `OPENHUMAN_LSP_ENABLED` (`lsp_capability_enabled`); `ToolStatsTool` needs `learning.enabled` and `learning.tool_tracking_enabled`; `InsertSqlRecordTool` is exported, not registered; the rest are always registered |
+| `filesystem/` | Host adapter only: `SecurityPolicy` implements `tinytools_std::filesystem::FsGate`. The tools (`FileReadTool`, `FileWriteTool`, `ImageInfoTool`, `WorkspaceStateTool`, `EditFileTool`, `ApplyPatchTool`, `GrepTool`, `GlobTool`, `ListFilesTool`, `ReadDiffTool`, `CsvExportTool`, `GitOperationsTool`, `RunLinterTool`, `RunTestsTool`, `UpdateMemoryMdTool`) live in `tinytools_std::filesystem` and are imported directly by `tools/ops.rs` | always registered, except `ReadDiffTool`, `RunLinterTool`, and `RunTestsTool`, which are exported, not registered |
+| `browser/` | `BrowserTool` (TinyComputer browser members and tasks), `BrowserOpenTool` (simple TinyComputer navigation) | Both browser tools need `browser.enabled` and the `modules` feature, and are deferred until `tool_search`. Browser navigation uses the shared `http_request.allowed_domains` policy, and the checksum-pinned TinyComputer release module. |
+| `network/` | Host adapter for the tools in `tinytools_std::network` (`HttpRequestTool`, `WebFetchTool`, `CurlTool`, `PushoverTool`): `SecurityPolicy` implements `NetGate`, `host.rs` supplies the `[http_request]` limit defaults, the TinyJuice HTML engine and the x402 `PaymentHook`. `GitbooksSearchTool`, `GitbooksGetPageTool`, `GmailUnsubscribeTool`, and under the `mcp` Cargo feature `McpListServersTool`, `McpListToolsTool`, `McpCallTool`; `url_guard.rs` is the shared SSRF/allowlist validator, not a tool | `http_request`, `web_fetch`, `curl`, `pushover`, `gmail_unsubscribe` always registered; `gitbooks_*` need `gitbooks.enabled` and, when the active profile sets an `mcp_allowlist`, an entry named `gitbooks`; `mcp_list_servers`/`mcp_list_tools`/`mcp_call_tool` register only when the static `[[mcp_client.servers]]` registry (after the profile allowlist) is non-empty |
| `document/` (feature `documents`) | `DocumentTool` (`generate_document`) | always registered when compiled. Builds `.docx` bytes via the pure-Rust `engine` module (`docx-rs`, no subprocess) inside `spawn_blocking` + `tokio::time::timeout`; allocates the artifact with `agent::artifacts::create_artifact` (kind `Document`), persists `args.json` next to it for the failed-card Retry path, then `finalize_artifact` or `fail_artifact` |
| `presentation/` (feature `documents`) | `PresentationTool` (`generate_presentation`) | always registered when compiled. Same shape as `document/` with `ppt-rs` producing `.pptx` and kind `Presentation` |
| `meta/` | `deferred` (`strip_deferred_from_visible`, `deferred_tool_names`, the `TOOL_SEARCH_NAME` belt opt-in constant); `collapse` helpers (`resolve`, `merge_action_schemas`, `args_without_action`, `strictest_permission`, `any_external_effect`, `unknown_action_message`, `CollapsedAction`) | not registered: `deferred` is the host's half of `ToolExposure::Deferred`: the session builder (`agent/session_host/builder/builder_build.rs`) uses it to split a belt into the advertised set and the still-registered deferred set, and the tinyagents harness advertises its intrinsic `tool_search` / `tool_call` bridge over the latter (ranked per `agent/tinyagents/discovery`). The `collapse` helpers are used by `cron/tools/collapsed.rs` and `memory/tools/collapsed.rs` to merge a multi-action tool's per-action schemas and permissions into one entry |
diff --git a/crates/openhuman-core/src/web3/README.md b/crates/openhuman-core/src/web3/README.md
index d83bc5990e..0ef7c75f28 100644
--- a/crates/openhuman-core/src/web3/README.md
+++ b/crates/openhuman-core/src/web3/README.md
@@ -33,7 +33,7 @@ Three members (`swap`, `bridge`, `dapp`) are documented here; `wallet` and
> Ungated family members: `wallet` and `x402` are facades in their own right.
> Each keeps its own `stub.rs` and gates its real submodules on the same
> default-ON `web3` feature. Always-compiled callers resolve through those
-> stubs (`tools/impl/network/http_request.rs` calls into `x402`), so these
+> stubs (`tools/impl/network/host.rs` calls into `x402`), so these
> declarations must NOT carry a `#[cfg]`.
## Compile-time gate (`web3` feature)
diff --git a/crates/openhuman-core/src/web3/mod.rs b/crates/openhuman-core/src/web3/mod.rs
index 443fb64211..8940b8dd51 100644
--- a/crates/openhuman-core/src/web3/mod.rs
+++ b/crates/openhuman-core/src/web3/mod.rs
@@ -41,7 +41,7 @@ pub use tinywallet_web3::crypto::service as types;
// Ungated family members: `wallet` and `x402` are facades in their own right —
// each keeps its own `stub.rs` and gates its real submodules on the same
// default-ON `web3` feature. Always-compiled callers resolve through those
-// stubs (`tools/impl/network/http_request.rs` -> `x402`), so these
+// stubs (`tools/impl/network/host.rs` -> `x402`), so these
// declarations must NOT carry a `#[cfg]`.
pub mod wallet;
pub mod x402;
diff --git a/crates/openhuman-core/src/web3/x402/README.md b/crates/openhuman-core/src/web3/x402/README.md
index 3c6b19ceaf..8e0049aa22 100644
--- a/crates/openhuman-core/src/web3/x402/README.md
+++ b/crates/openhuman-core/src/web3/x402/README.md
@@ -75,7 +75,7 @@ behavior: it sends the initial request, requires a `PAYMENT-REQUIRED` /
`X-PAYMENT-REQUIRED` header on a 402, pays via `handle_402_and_pay`, records a
`Pending` ledger entry, retries with `PAYMENT-SIGNATURE`, and settles the entry
from the retry's outcome and the `PAYMENT-RESPONSE` header. It differs from the
-generic `http_request` tool (`tools/impl/network/http_request.rs`), which
+generic `http_request` tool (`tinytools_std::network::HttpRequestTool`, with its payment hook in `tools/impl/network/host.rs`), which
handles a 402 only as a silent fallback.
The tool is built with `TaskLocalThread` (`seams.rs`), the host's
@@ -119,10 +119,11 @@ its record with `pending_record` (`records.rs`), which applies the same rule.
## Used by
-- `crates/openhuman-core/src/tools/impl/network/http_request.rs`:
- `handle_x402_payment`, gated `#[cfg(feature = "web3")]`, is the 402 fallback
- path any HTTP tool call can hit. It calls `x402::handle_402_and_pay` and
- records to the same ledger via `x402::store::with_ledger_mut`.
+- `crates/openhuman-core/src/tools/impl/network/host.rs`:
+ `X402PaymentHook`, gated `#[cfg(feature = "web3")]` and installed on
+ `http_request` as its `PaymentHook`, is the 402 fallback path any HTTP tool
+ call can hit. It calls `x402::handle_402_and_pay` and records to the same
+ ledger via `x402::store::with_ledger_mut`.
- `crates/openhuman-core/src/tools/ops.rs`: registers `x402::request_tool()` as
an agent tool.
- `crates/openhuman-core/src/core/all.rs`: wires `all_x402_registered_controllers`