Skip to main content

MissionsApi

Struct MissionsApi 

Source
pub struct MissionsApi { /* private fields */ }
Expand description

Mission Execution Framework: goal → objectives → authorization gate → execution → after-action review

Implementations§

Source§

impl MissionsApi

Source

pub async fn abort_mission( &self, mission_id: &str, body: &AbortMissionRequest, ) -> Result<Mission>

Abort a mission

Terminal and not resumable. The in-flight walk is signalled to stop between objectives, so an abort ends spending rather than only marking the record. The body is optional.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

POST /api/v1/missions/{missionId}/abort

Required scopes: agents:write.

Source

pub async fn authorize_mission(&self, mission_id: &str) -> Result<Mission>

Pass the authorization gate

Moves a mission held at awaiting_authorization on to executing. It does not start the walk — call /run after this.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

POST /api/v1/missions/{missionId}/authorize

Required scopes: agents:write.

Source

pub async fn get(&self, mission_id: &str) -> Result<Mission>

Read a mission

The record as stored. Poll this alongside the event stream — the stream is the fast path, this is the authoritative one.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

GET /api/v1/missions/{missionId}

Required scopes: agents:read.

Source

pub async fn get_mission_aar(&self, mission_id: &str) -> Result<Aar>

Read the after-action review

Available once the mission is terminal. Before that the answer is 404 — the review is built, not partially accumulated, so there is nothing truthful to return early.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

GET /api/v1/missions/{missionId}/aar

Required scopes: agents:read.

Source

pub async fn list( &self, params: &ListMissionsParams, ) -> Result<ListMissionsResponse>

List missions

Most recent first. Without session_id this is the tenant-wide list.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

GET /api/v1/missions

Required scopes: agents:read.

Source

pub async fn list_mission_objectives( &self, mission_id: &str, ) -> Result<ListMissionObjectivesResponse>

List a mission’s objectives

Full objective records, including budgets spent so far — Mission.objective_ids carries only the ids.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

GET /api/v1/missions/{missionId}/objectives

Required scopes: agents:read.

Source

pub async fn pause_mission( &self, mission_id: &str, ) -> Result<PauseMissionResponse>

Pause a running mission

Cooperative: the walk is asked to hold at the next safe point, so the record reaches paused after the current objective settles, not at the moment of the call — poll for the status change. Only a mission running in this process can be paused; anything else is 409.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

POST /api/v1/missions/{missionId}/pause

Required scopes: agents:write.

Source

pub async fn resume(&self, mission_id: &str) -> Result<ResumeMissionResponse>

Resume a paused mission

Returns the mission to executing and relaunches the walk. Verified objectives are reloaded from their checkpoints and the blocked objective continues against its persisted budget, so a resume does not re-spend what a completed objective already cost. A mission already running answers 409.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

POST /api/v1/missions/{missionId}/resume

Required scopes: agents:write.

Source

pub async fn run(&self, mission_id: &str) -> Result<RunMissionResponse>

Start executing a mission

Answers immediately; the executor walk is detached. Watch progress on the event stream or by polling the mission — this endpoint used to run the walk synchronously and was killed by the edge proxy’s two-minute timeout before a multi-objective mission could finish.

A second call while a walk is in flight is a no-op that answers 200 with accepted: false and already_running: true, not 202 and not an error: the executor is not safe under concurrent walks over one mission. Requires status executing — anything else is 409, including a mission still waiting on its authorization gate.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

POST /api/v1/missions/{missionId}/run

Required scopes: agents:write.

Source

pub async fn start_mission( &self, body: &StartMissionRequest, ) -> Result<MissionStartResponse>

Start a mission

Two ways in. Supply plan and it is used as written. Omit it and the server’s LLM planner decomposes goal, which requires available_agents and a planner wired on the server — without one the request is rejected with 400 rather than silently producing an empty mission.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

POST /api/v1/missions

Required scopes: agents:write.

Source

pub fn stream_mission_events(&self, mission_id: &str) -> EventStream

Stream mission progress (SSE)

Server-sent events, poll-backed. Event names: connected (handshake), mission (snapshot on connect), status_change, checkpoint_added (one per new checkpoint id), aar_finalized, and terminal as the last event before the server closes. The stream closes itself on a terminal status so a client stops reconnecting, and is capped at 15 minutes per connection regardless — a long mission is expected to reconnect.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

GET /api/v1/missions/{missionId}/events

Required scopes: agents:read.

Returns a server-sent event stream.

Source

pub async fn update_mission_objective( &self, mission_id: &str, objective_id: &str, body: &UpdateMissionObjectiveRequest, ) -> Result<Objective>

Edit one objective’s configuration

Configuration only: assignment, budget ceilings, deadline, rules of engagement, commander’s intent, decision points, priority and text. Lifecycle stays with the executor — there is no way to set status from here. An empty patch is rejected with 400 rather than answering 200 for a write that did nothing. Sending assigned_agent_id or assigned_team_id as an empty string clears the assignment.

MEF is gated twice: globally by the server flag and per tenant by mef_config.enabled. When either is off the route answers 404 with a plain body — deliberately the same answer as a mission that does not exist, so an opted-out tenant cannot discover the surface.

PATCH /api/v1/missions/{missionId}/objectives/{objectiveId}

Required scopes: agents:write.

Trait Implementations§

Source§

impl Clone for MissionsApi

Source§

fn clone(&self) -> MissionsApi

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MissionsApi

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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