syntax = "proto3"; package harness.v1; // HarnessService opens one duplex PTY session into a Kit container the daemon // owns. The dashboard's setup terminal consumes the setup target; the // run-scoped live view consumes the run target and is read-only. See // docs/prds/external-agent-harness.md, "Session contract". service HarnessService { // Open carries a session: the first request frame names the target, later // frames carry terminal input and sizing, and the response stream carries // terminal output until the command exits or the session ends. rpc Open(stream OpenRequest) returns (stream OpenResponse); } // OpenRequest is one client frame. The first frame must be target; a frame // with no field set is a keepalive the server ignores. message OpenRequest { oneof frame { // target names the session and must be the first frame. OpenTarget target = 1; // stdin is terminal input bytes. bytes stdin = 2; } // size is the terminal size the client wants, in character cells. The // dashboard sends it with the target frame so the PTY is created at the // right size; the daemon falls back to its own default when it is absent. ConsoleSize size = 3; } // OpenResponse is one server frame. message OpenResponse { oneof frame { // stdout is terminal output bytes. bytes stdout = 1; // exit_code ends the session: the command's exit status. int32 exit_code = 2; // error ends the session when it could not be opened or was aborted. string error = 3; } } // OpenTarget addresses one session. A setup session is addressed by Kit // profile and is ephemeral; a run session is addressed by task and attempt and // is bounded by the task. message OpenTarget { string org = 1; oneof target { SetupTarget setup = 2; RunTarget run = 3; } } // SetupTarget runs the CLI's own login in an ephemeral container built from // the named agent profile's Kit. message SetupTarget { string profile = 1; } // RunTarget is a running task's sandbox. The daemon follows its output // read-only and ignores stdin; a finished or unknown task or attempt is // NotFound, with the reason in the status message. message RunTarget { int64 task_id = 1; int64 attempt = 2; } // ConsoleSize is a terminal size in character cells. message ConsoleSize { uint32 rows = 1; uint32 cols = 2; }