Watch
0
0
Fork
You've already forked hyperhive
0

set an agent's initial agents.md at create

This commit is contained in:
atlas 2026-10-18 06:39:19 +02:00 • committed by mara
commit 456cf9a7cb
19 changed files with 708 additions and 19 deletions

View file

@ -426,6 +426,13 @@ struct AgentCreateArgs {
/// hive roster and names the known hives if it misses.
#[arg(long, value_name = "HIVE")]
hive: String,
/// A text file the agent's `AGENTS.md` starts with.
///
/// The agent writes it on its first start, and only when it has no
/// `AGENTS.md` yet: re-creating an agent never replaces an existing file.
/// The controller refuses a file over 64 KiB.
#[arg(long, value_name = "FILE")]
agents_md: Option<PathBuf>,
/// swarm-controller's unix socket.
///
/// Supplied by the nix module that installs this binary, from the same
@ -668,7 +675,7 @@ fn main() -> Result<()> {
command: AgentVerb::Create(args),
} => {
let target = remote.target(args.controller_socket)?;
agent::create(&target, &args.name, &args.hive)
agent::create(&target, &args.name, &args.hive, args.agents_md.as_deref())
}
// Same socket-resolution reasoning as `Create` above.
Verb::Agent {