hyperhive/hive-sh4re
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 8b01dbeef1 permissions: give the built-in tool list one home, next to ToolGroup
The `--tools` list a harness session gets is not a constant: the base set
plus whatever the agent's `HIVE_TOOL_GROUPS` add (today, `web_tools` →
`WebFetch`/`WebSearch`). That resolution lived in `hive-agent`'s
`mcp_config`, which is fine while the harness is the only thing that
spawns a `claude` — and it is not: `hive-subagent-mcp` spawns one too.

`hive-agent` is binary-only (no `src/lib.rs`, no lib target), so nothing
can depend on it to reach `builtin_tools_arg`. The alternative to a
shared home is a second list in the subagent daemon, which diverges on
the first tool anyone adds to either — and diverging upward is a
subagent holding a built-in its parent does not have.

So move the base list, the `HIVE_TOOL_GROUPS` parse and the resolution
into `hive_sh4re::permissions`, beside `ToolGroup` — whose
`builtin_tools()` was already half of the answer. `hive-agent`
re-exports them, so `mcp_config::builtin_tools_arg()` still reads the
same at the call site, and `allowed_tools_arg` now derives its built-in
half from the same function rather than repeating the merge loop.

Behaviour is unchanged. The parse is `strum::EnumString` rather than a
`serde_json::from_value` round-trip through a `Value::String`: same
`snake_case` names (a test pins the two derives against each other),
without `hive-sh4re` needing `serde_json` outside its dev-dependencies.
It is now a pure function of its input, so the fallbacks are testable
without mutating the environment — which under edition 2024 is `unsafe`
and racy across a test binary's threads.

Refs #4416
2026-09-15 17:40:27 +02:00
..
src permissions: give the built-in tool list one home, next to ToolGroup 2026-09-15 17:40:27 +02:00
Cargo.toml permissions: give the built-in tool list one home, next to ToolGroup 2026-09-15 17:40:27 +02:00
README.md treefmt: apply prettier 2026-09-02 15:25:07 +02:00

hive-sh4re

The shared payload vocabulary between hive-c0re and the in-container harness — the common types (Message, Approval, LooseEnd, HelperEvent, …) that the per-socket wire protocols are built from. The request/response envelopes themselves now live in the per-socket crates (below); this crate holds the payloads they carry.

Where it sits

This is the shared payload crate; the per-socket protocol envelopes have been split into their own smaller crates so specialised binaries don't have to pull in all of hive-sh4re:

  • hive-host-sock — host admin socket (hivectlhive-c0re)
  • hive-core-agent-sock — per-agent/manager socket (/run/hive/mcp.sock)
  • hive-priv-sock — the privileged-helper socket

Those crates re-export or reference the payload types that still live here (Approval, Message, LooseEnd, …).

Modules

  • wire_time — the timestamp convention: wire fields are chrono::DateTime<Utc> (serialized RFC 3339), while sqlite storage + input args stay unix-epoch i64; this module owns the two boundary conversions.
  • paths — well-known on-disk path helpers.
  • assets — resolves bundled runtime asset paths (branding, prompts) under HIVE_ASSETS_DIR.

Agent-name fields are typed as hive_types::Ident for serde-validated parsing at the socket boundary.