pub enum Command {
Show 18 variants
Decide {
decision_id: String,
version: u64,
answer: Answer,
edited_args: Option<Value>,
reason: Option<String>,
expanded: bool,
evidence: Vec<String>,
},
ChangeImage {
decision_id: String,
version: u64,
from: String,
change: ImageChange,
preview: bool,
},
CancelAnswer {
decision_id: String,
},
Send {
session_id: String,
text: String,
images: Vec<ImageData>,
},
Steer {
session_id: String,
text: String,
},
StopTurn {
session_id: String,
},
Queue {
session_id: String,
text: String,
images: Vec<ImageData>,
},
StopAll {
reason: Option<String>,
},
ResumeAll,
SetMode {
session_id: String,
mode: Mode,
},
NewThread {
agent: String,
session_id: String,
text: String,
images: Vec<ImageData>,
},
AddAgent {
draft: Box<AgentDraft>,
digest: String,
replaces: Option<String>,
},
ChangeAgent {
agent: String,
version: u64,
draft: Box<AgentDraft>,
digest: String,
},
PauseAgent {
agent: String,
},
ResumeAgent {
agent: String,
},
RemoveAgent {
agent: String,
version: u64,
digest: String,
},
CopyRuleToAgent {
agent: String,
rule_id: String,
},
SubmitDrawn {
session_id: String,
surface_id: String,
version: u64,
action_id: String,
values: Map<String, Value>,
},
}surface only.Expand description
A command from a surface (spec 3.3 §6). Every command runs as an authenticated
Caller, whose subject, surface and Origin reach its audit record.
A message sent while a turn of its session runs reaches that turn (§6 “steer”): the
engine offers it through Source::steer, the runtime screens it as it screens a turn’s
own message, and the agent takes it at its next safe point. A turn that ends first hands
the message back, and it goes as the session’s next message, once.
| Command | A turn of the session runs | Answers |
|---|---|---|
Send | Offered to the turn; it waits in the session’s queue until the turn takes it or hands it back | At once: Queued |
Steer | The same | Once the message has a fate: Steered, or Queued when handed back |
Queue | Never offered: the session’s next message | At once: Queued |
§Example
use adk_surface::{Answer, Command};
let command: Command = serde_json::from_value(serde_json::json!({
"type": "decide",
"decisionId": "apr_1",
"version": 1,
"answer": "allowOnce",
}))
.unwrap();
assert!(matches!(command, Command::Decide { answer: Answer::AllowOnce, .. }));Variants§
Decide
Answers a decision at the version the surface saw (S-I2).
Fields
ChangeImage
Tightens the crop of one of a decision’s images or covers more of it, then holds the
call again with the new image in its place (spec 3.7 §8.2, board choice A8): the crop
only shrinks and covering only grows. The decision at version closes; the call with
the new image waits for the person’s answer.
Fields
change: ImageChangeThe change.
CancelAnswer
Cancels a spoken “allow once” inside its cancel window (§7.2).
Send
Sends a message; queued instead while a decision of the session is open (S-I4). A running turn of the session is offered it and takes it at its agent’s next safe point; a turn that ends first leaves it queued as the session’s next message.
Fields
images: Vec<ImageData>The images the person sent with it (spec 3.3 §5.1): at most
MAX_IMAGES. A message with images is never offered to a
running turn; it goes as the session’s next.
Steer
Sends a message to the running turn of the caller’s own session and waits for what
became of it (§6 “steer”): Steered when the turn took it,
Queued or Sent when it was handed
back and goes as the session’s next message. A person sends it, never an agent.
StopTurn
Stops the running turn of the caller’s own session (spec 3.3 §5.1): a person only; the agent waits for the next message, and nothing held for a decision is answered.
Queue
Queues a message as the session’s next, after its open decisions (S-I4): never offered to a running turn.
Fields
images: Vec<ImageData>The images the person sent with it (spec 3.3 §5.1): at most
MAX_IMAGES. A message with images is never offered to a
running turn; it goes as the session’s next.
StopAll
Stops every agent (S-I10).
ResumeAll
Resumes after a stop: the web home or a paired local terminal only (S-I10).
SetMode
Changes how much a session’s agent acts on its own.
NewThread
Starts a thread with agent: the session’s first message goes to it, and its
harness stamps the session as its own (spec 3.3 §5.7 “Threads”).
Fields
images: Vec<ImageData>The images the person sent with it (spec 3.3 §5.1): at most
MAX_IMAGES. A message with images is never offered to a
running turn; it goes as the session’s next.
AddAgent
Adds an agent by hand, previewed with digest (spec 3.3 §5.7).
Fields
draft: Box<AgentDraft>The definition.
ChangeAgent
Changes an agent at the version seen, previewed with digest (spec 3.3 §5.7).
Fields
draft: Box<AgentDraft>The definition after the change.
PauseAgent
Pauses an agent (spec 3.3 §5.7).
ResumeAgent
Resumes an agent paused by hand: the web home or a paired local terminal (S-I10).
RemoveAgent
Removes an agent at the version seen, previewed with digest (spec 3.3 §5.7).
Fields
CopyRuleToAgent
Copies one of the person’s standing rules to an agent, pinned to it (spec 3.3 §5.7 “Copy one of your rules”, S-I19).
SubmitDrawn
Sends a form an agent drew, from the version the person saw (spec 3.3 §7.4 rule 5):
never runs its tool, but asks for the call, which the drawing agent holds for the
person’s decision. Only a person at a screen sends one (keyboard, pointer,
touch). Feature genui.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Command, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Command, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Command
impl JsonSchema for Command
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for Command
impl Serialize for Command
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Forget for Command
impl Freeze for Commandwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
PhantomData<String>: Freeze,
PhantomData<[u32; 4]>: Freeze,
PhantomData<ImageData>: Freeze,
*const AgentDraft is !null: Freeze,
PhantomData<AgentDraft>: Freeze,
impl Move for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Commandwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<[u32; 4]>: UnsafeUnpin,
PhantomData<ImageData>: UnsafeUnpin,
*const AgentDraft is !null: UnsafeUnpin,
PhantomData<AgentDraft>: UnsafeUnpin,
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.