Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/swarm-queue-client/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
..
agent_archetype.rs archetypes: create an agent from an archetype with no config repo 2026-10-17 16:27:21 +02:00
agent_icon.rs hive-c0re/swarm-*: drop clippy allows and dedupe unix_now + KV open_or_create 2026-10-09 10:25:48 +02:00
agent_inference.rs swarm-ui: per-agent cap on concurrently running subagents 2026-10-14 10:13:29 +02:00
agent_limits.rs swarm-controller: refuse a cap systemd would ignore; GET creates no bucket 2026-10-12 20:22:21 +02:00
agent_login.rs swarm UI: an agent that needs a Claude login shows it on its card 2026-10-14 20:07:46 +02:00
agent_permissions.rs grant manage_root_agent by stored permission only, not by the name ruth 2026-10-17 08:10:08 +02:00
agent_schedules.rs hive-c0re/swarm-*: drop clippy allows and dedupe unix_now + KV open_or_create 2026-10-09 10:25:48 +02:00
agent_status.rs hive-c0re/swarm-*: drop clippy allows and dedupe unix_now + KV open_or_create 2026-10-09 10:25:48 +02:00
agent_term.rs swarm-controller: replay a subagent's newest rows before its live tail 2026-10-18 03:00:08 +02:00
agent_token.rs swarm-queue-client: one agent-token spelling, and no hive in AgentCredential 2026-09-28 08:24:52 +02:00
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
archetypes.rs archetypes: prefill the create form from flake-declared agent archetypes 2026-10-17 12:57:20 +02:00
builder.rs swarm-builder: refuse a build that waited too long for the slot 2026-10-17 23:30:13 +02:00
claude_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
kv.rs hive-c0re/swarm-*: drop clippy allows and dedupe unix_now + KV open_or_create 2026-10-09 10:25:48 +02:00
lib.rs read an agent's agents.md through the swarm and edit it with git diffs 2026-10-18 12:35:11 +02:00
notices.rs swarm-queue-client: drop notices::PREFIX, reuse STREAM 2026-08-24 14:34:37 +02:00
operator_profiles.rs keep the operator list under one key and read it with one direct get 2026-10-17 13:10:05 +02:00
review_classifier.rs review-classifier: ask a check once more when its answer isn't valid JSON 2026-10-16 16:55:07 +02:00
startup_read.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
status.rs hive-c0re/swarm-*: drop clippy allows and dedupe unix_now + KV open_or_create 2026-10-09 10:25:48 +02:00
subagent_term.rs swarm-controller: replay a subagent's newest rows before its live tail 2026-10-18 03:00:08 +02:00
wanted.rs swarm-controller: refuse a cap systemd would ignore; GET creates no bucket 2026-10-12 20:22:21 +02:00