Skip to main content

Invocation

Struct Invocation 

Source
pub struct Invocation<'a> {
    pub cwd: &'a Path,
    pub prompt: &'a str,
    pub timeout: Duration,
    pub allow_write: bool,
    pub sessions: bool,
    pub artifacts: &'a Path,
    pub stem: &'a str,
    pub run: &'a str,
    pub node: &'a str,
    pub cache_dir: Option<&'a Path>,
    pub attachments: &'a [PathBuf],
}
Expand description

One agent invocation.

Fields§

§cwd: &'a Path

Working directory. Always a real checkout, so every CLI can read the repository without per-vendor “extra directory” flags.

§prompt: &'a str

The full prompt.

§timeout: Duration

Wall-clock limit; the process tree is killed when it elapses.

§allow_write: bool

May the agent modify files? Judges and reviewers may not.

§sessions: bool

Continue this seat’s conversation when the CLI supports it.

§artifacts: &'a Path

Directory for prompt / stdout / stderr artifacts.

§stem: &'a str

Artifact filename stem.

§run: &'a str

Run this invocation belongs to. Exported as MAGI_RUN so an agent that files a task with magi task add is attributed to the run that was paying for it, rather than looking like a human wandered by.

§node: &'a str

Graph node being executed, e.g. implement or review. Exported as MAGI_NODE for the same reason: “who asked for this” is the first question about an autonomously created task.

§cache_dir: Option<&'a Path>

Shared build cache the seat should build into, from the rendered CARGO_TARGET_DIR= in the verify commands. Exported as CARGO_TARGET_DIR so the implementer’s compile lands inside the same directory verify reads back from - one cache, one prune, and the build the agent just paid for is the build the gate reuses.

§attachments: &'a [PathBuf]

Absolute paths of images the operator attached to this conversation, outside cwd - see chat/talk’s attachments_dir. Empty for every invocation that is not a chat or talk turn. [build_command] uses this only to decide whether a CLI’s sandbox needs widening to read them; the prompt text naming each path and its mime is built by the caller, not here.

Trait Implementations§

Source§

impl<'a> Debug for Invocation<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Invocation<'a>

§

impl<'a> RefUnwindSafe for Invocation<'a>

§

impl<'a> Send for Invocation<'a>

§

impl<'a> Sync for Invocation<'a>

§

impl<'a> Unpin for Invocation<'a>

§

impl<'a> UnsafeUnpin for Invocation<'a>

§

impl<'a> UnwindSafe for Invocation<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more