pub struct InteractionRequest {
pub id: String,
pub kind: InteractionKind,
pub prompt: String,
pub options: Vec<String>,
pub tool_name: Option<String>,
pub tool_arguments: Option<Value>,
pub required: bool,
pub stage_name: String,
pub body: Option<String>,
pub body_format: BodyFormat,
}Expand description
A pending interaction request written by the worker.
Fields§
§id: StringUnique ID for this request (uuid-lite: timestamp + stage index).
kind: InteractionKindWhat kind of answer is expected.
prompt: StringPrompt text to display to the user.
options: Vec<String>Options for MultipleChoice (index-labelled).
tool_name: Option<String>For ToolApproval: the tool name.
tool_arguments: Option<Value>For ToolApproval: the tool arguments (JSON).
required: boolWhether an answer is mandatory (empty/cancel not allowed).
stage_name: StringStage name that triggered this request.
body: Option<String>Optional rich body (markdown document, plan, etc.) for the user to review.
body_format: BodyFormatFormat of the body content.
Implementations§
Source§impl InteractionRequest
impl InteractionRequest
Sourcepub fn free_text(
id: impl Into<String>,
prompt: impl Into<String>,
stage: impl Into<String>,
required: bool,
) -> Self
pub fn free_text( id: impl Into<String>, prompt: impl Into<String>, stage: impl Into<String>, required: bool, ) -> Self
Create a new free-text request.
Sourcepub fn review(
id: impl Into<String>,
title: impl Into<String>,
markdown: impl Into<String>,
stage: impl Into<String>,
) -> Self
pub fn review( id: impl Into<String>, title: impl Into<String>, markdown: impl Into<String>, stage: impl Into<String>, ) -> Self
Create a “present for review” request: pauses the run and shows a rich markdown document to the user before accepting feedback.
Sourcepub fn edit_text(
id: impl Into<String>,
prompt: impl Into<String>,
stage: impl Into<String>,
initial_content: impl Into<String>,
) -> Self
pub fn edit_text( id: impl Into<String>, prompt: impl Into<String>, stage: impl Into<String>, initial_content: impl Into<String>, ) -> Self
Create an “edit document” request: shows initial_content in an
editable field pre-seeded with it (via body); the user edits it and
the modified text is returned as the response text.
Sourcepub fn multiple_choice(
id: impl Into<String>,
prompt: impl Into<String>,
options: Vec<String>,
stage: impl Into<String>,
) -> Self
pub fn multiple_choice( id: impl Into<String>, prompt: impl Into<String>, options: Vec<String>, stage: impl Into<String>, ) -> Self
Create a new multiple-choice request.
Sourcepub fn confirm(
id: impl Into<String>,
prompt: impl Into<String>,
stage: impl Into<String>,
) -> Self
pub fn confirm( id: impl Into<String>, prompt: impl Into<String>, stage: impl Into<String>, ) -> Self
Create a new confirm request.
Sourcepub fn gate_approval(
id: impl Into<String>,
tool_name: impl Into<String>,
arguments: Value,
stage: impl Into<String>,
) -> Self
pub fn gate_approval( id: impl Into<String>, tool_name: impl Into<String>, arguments: Value, stage: impl Into<String>, ) -> Self
Build a taint-gate approval request.
Shaped like a tool approval - it is the same yes/no with a scope - but worded for the decision actually being made. A gate approval clears the tool to carry the data, which is not a grant keyed on what the call runs, so it offers no per-stage scope and names no keys.
Sourcepub fn tool_approval(
id: impl Into<String>,
tool_name: impl Into<String>,
arguments: Value,
stage: impl Into<String>,
grant_keys: &[String],
) -> Self
pub fn tool_approval( id: impl Into<String>, tool_name: impl Into<String>, arguments: Value, stage: impl Into<String>, grant_keys: &[String], ) -> Self
Build a tool-approval request.
grant_keys is what a Stage or Run approval would be remembered
under, and it goes in the option labels rather than in body because
the dashboard renders only prompt and options for this kind. Naming
it matters: the old wording offered “Allow for this session” on calls
the dispatcher then silently degraded to once, so the user chose a grant
they did not get.
The options are fixed-position - every client maps an index to a scope
through approval_choice - so the wording varies and the length does
not.
Trait Implementations§
Source§impl Clone for InteractionRequest
impl Clone for InteractionRequest
Source§fn clone(&self) -> InteractionRequest
fn clone(&self) -> InteractionRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more