pub enum AgentRequest {
NewSession {
cwd: PathBuf,
},
SetMode {
session: SessionId,
mode: String,
},
Prompt {
session: SessionId,
text: String,
context: String,
},
FileContents {
session: SessionId,
request: ReadRequestId,
path: PathBuf,
contents: Option<String>,
},
Permission {
request: PermissionRequestId,
decision: PermissionDecision,
},
PermissionCancelled {
request: PermissionRequestId,
},
TerminalResponse {
request: AgentTerminalRequestId,
response: AgentTerminalResponse,
},
Cancel {
session: SessionId,
},
Shutdown,
}Expand description
Work sent to the agent.
Variants§
NewSession
SetMode
Move the session to one of the modes the agent offered (ADR-0015).
Only ever sent because a human asked for it. The agent’s default stands until then, including when that default forbids the edit the agent was just asked to make — a client that widens its own permissions on refusal is not asking.
Prompt
A user turn. context is the workspace snapshot rendered as text and prepended —
small and current, because everything bulky is pulled on demand instead
(ADR-0007 §4).
FileContents
Our answer to AgentEvent::ReadFileRequested, served from the live buffer.
None means we could not read it.
Carries the request it answers rather than only the path, so two reads of the
same file in one turn cannot be confused for each other.
Permission
PermissionCancelled
Cancel a permission prompt because its owning turn/session is no longer live.
Fields
request: PermissionRequestIdTerminalResponse
Cancel
Shutdown
Trait Implementations§
Source§impl Clone for AgentRequest
impl Clone for AgentRequest
Source§fn clone(&self) -> AgentRequest
fn clone(&self) -> AgentRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more