crates/jera/proto/agent.proto
// jera agent worker — the remote transport wire for the multi-machine Scheduler.
// A control-plane holds a GrpcAgent (client) per remote worker; the worker box
// runs an AgentWorker server over a LocalAgent. Same shape the LoopbackTransport
// proved in-process — just over a socket. See .nornir/agents-multimachine.md.
syntax = "proto3";
package jera.agent.v1;
message Empty {}
message StateReply { string state = 1; } // idle | busy | offline
// payload_json (field 4) carries the serde-encoded WorkPayload — *what* to run —
// or "" for a legacy payload-less unit. JSON on the wire keeps the proto lean +
// additive (an old peer that never sets it decodes as None). See src/agent.rs.
message WorkUnitMsg { string id = 1; string group = 2; repeated string required_caps = 3; string payload_json = 4; }
message DispatchReq { WorkUnitMsg unit = 1; }
message WorkId { string id = 1; }
message StatusReply { string status = 1; } // pending|running|done|failed|killed
service AgentWorker {
rpc State (Empty) returns (StateReply);
rpc Dispatch (DispatchReq) returns (WorkId);
rpc Poll (WorkId) returns (StatusReply);
rpc Kill (WorkId) returns (Empty);
rpc GoOffline (Empty) returns (Empty);
}