Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hive-agent/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 88674eb63a read an agent's agents.md through the swarm and edit it with git diffs
The agent's state/AGENTS.md stays the truth and its harness the only
writer. The harness mirrors the file into a new `agents-md` KV bucket,
and swarm-controller serves that copy, so a read works while the agent is
stopped. An edit is a unified diff plus the revision it was made against,
sent over the agent's existing control subject; the harness refuses a
stale base, applies the diff with `git apply --check` then `git apply` to
a temp copy, and writes the file only when both pass. Fixes #5519.

Files:
- swarm-queue-client/src/agents_md.rs, lib.rs: the bucket name and
  subject, the mirror value, the `ApplyAgentsMd` control command and its
  reply. `AgentControl` loses `Copy` because the new variant carries text.
- hive-agent/src/swarm_agents_md.rs, main.rs: the mirror task (start,
  10 s re-read, immediate republish after an edit) and the apply.
- hive-agent/src/swarm_input.rs: the control loop answers both commands.
- hive-agent/src/claude_md_watch.rs: its AGENTS.md path is shared.
- hive-agent/Cargo.toml, Cargo.lock: sha1 for the git blob id (already in
  the lock), tempfile moves from dev to runtime for the apply directory.
- swarm-controller/src/agents_md.rs, main.rs: the bucket reader and
  GET/PUT /api/agents/{name}/agents-md; test AppState literals get the
  new field.
- swarm-controller/src/agent_control.rs: the sink hands back raw reply
  bytes, so each command decodes its own reply type.
- swarm-controller-api/src/agents_md.rs: the route bodies, shared with
  swarmctl.
- swarmctl/src/agents_md.rs, main.rs: `swarmctl agent agents-md get|apply`.
- nix/host-modules/swarm-nats.nix, nix/module-eval/nats-authelia.nix: the
  agent's publish grant on its own `$KV.agents-md.<agent>` key.

git needs no new package: agent containers enable programs.git, and the
harness unit's PATH includes /run/current-system/sw.
2026-10-18 12:35:11 +02:00
..
web_ui retry: replace three hand-rolled doubling loops with backon 2026-10-17 10:14:35 +02:00
agents_md_migrate.rs rename claude.md to agents.md for agents and the repo 2026-10-18 02:33:06 +02:00
boot_announce.rs hive-agent: only wake the boot-announce todo when it actually changed 2026-10-04 19:16:59 +02:00
claude_credentials.rs swarm UI: log an agent into claude from its card; the credentials go to bao and the agent picks them up 2026-10-15 13:26:29 +02:00
claude_md_watch.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
claude_usage_watch.rs hive-agent: warn on usage responses with no recognisable windows 2026-09-30 20:53:03 +02:00
db_migrate.rs todos: reopen an acked keyed row when the caller says so 2026-08-13 12:55:20 +02:00
disk_watch.rs disk_watch: drop bare tracker tag from test doc-comment 2026-10-04 15:18:32 +02:00
events.rs remove c0re.operatorPronouns and c0re.contextWindowTokens 2026-10-17 08:00:14 +02:00
harness_state.rs remove c0re.operatorPronouns and c0re.contextWindowTokens 2026-10-17 08:00:14 +02:00
identity.rs agents: login shells read the hive facts too; test the readers 2026-10-12 10:52:21 +02:00
login.rs swarm UI: log an agent into claude from its card; the credentials go to bao and the agent picks them up 2026-10-15 13:26:29 +02:00
login_session.rs refactor(#2464): rename hive-ag3nt crate to hive-agent, collapse lib into main 2026-07-15 16:09:39 +02:00
main.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
mcp_config.rs agent permissions: one set, tool groups included, set at agent creation 2026-10-15 18:01:40 +02:00
otel_turn_metrics.rs rename claude.md to agents.md for agents and the repo 2026-10-18 02:33:06 +02:00
paths.rs hive-agent: compact tests set the harness dir like the other Bus tests 2026-10-11 03:36:34 +02:00
plugins.rs hive-agent: cap the whole plugin install sequence, not just each call 2026-10-16 11:40:59 +02:00
prompt.rs archetypes: build an archetype agent from its archetype's module on the hive 2026-10-17 16:27:21 +02:00
reminder_timer.rs docs/hive-c0re: fix ask/answer removal doc gaps argus caught on #3741 2026-08-30 03:02:31 +02:00
reminders.rs hive-c0re: remove the approvals subsystem 2026-10-04 23:55:32 +02:00
schedule_timer.rs hive-agent: the swarm queue connection is required; retry, then exit 2026-10-04 22:24:51 +02:00
serve_common.rs hive-agent: dashboard Cancel and idle stalls for ACP agents 2026-09-29 23:25:48 +02:00
state_entry_watch.rs fix hint text per argus review: group into subdirs, not split into more top-level files 2026-08-18 22:07:05 +02:00
stats.rs rename claude.md to agents.md for agents and the repo 2026-10-18 02:33:06 +02:00
subagent_role_watch.rs hive-agent: export a per-file line count for subagent role files 2026-10-14 13:53:20 +02:00
swarm_agent_icon.rs retry: replace three hand-rolled doubling loops with backon 2026-10-17 10:14:35 +02:00
swarm_agent_state.rs swarm UI: an agent that needs a Claude login shows it on its card 2026-10-14 20:07:46 +02:00
swarm_agents_md.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
swarm_inference.rs swarm-ui: name the subagent cap in the three descriptions that list inference fields 2026-10-14 10:13:29 +02:00
swarm_input.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
swarm_permissions.rs grant manage_root_agent by stored permission only, not by the name ruth 2026-10-17 08:10:08 +02:00
swarm_queue.rs retry: share one backon helper for the client secret reads and convert the remaining doubling tables 2026-10-17 12:31:29 +02:00
swarm_term.rs swarm: keep an agent's terminal rows and replay them on attach 2026-10-11 12:35:31 +02:00
term_msg.rs swarm: show subagent terminals in the swarm UI 2026-10-03 01:34:01 +02:00
todo_server.rs bound the request line on the host admin and in-agent sockets 2026-10-17 09:09:20 +02:00
todos.rs todos: reopen an acked keyed row when the caller says so 2026-08-13 12:55:20 +02:00
turn.rs rename claude.md to agents.md for agents and the repo 2026-10-18 02:33:06 +02:00
turn_stats.rs swap hive-claude to the crates.io registry dependency (#2931) 2026-08-02 14:19:26 +02:00
vacuum.rs docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00