pub struct MissionsApi { /* private fields */ }Expand description
Mission Execution Framework: goal → objectives → authorization gate → execution → after-action review
Implementations§
Source§impl MissionsApi
impl MissionsApi
Sourcepub async fn abort_mission(
&self,
mission_id: &str,
body: &AbortMissionRequest,
) -> Result<Mission>
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.
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.
Sourcepub async fn get(&self, mission_id: &str) -> Result<Mission>
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.
Sourcepub async fn get_mission_aar(&self, mission_id: &str) -> Result<Aar>
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.
Sourcepub async fn list(
&self,
params: &ListMissionsParams,
) -> Result<ListMissionsResponse>
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.
Sourcepub async fn list_mission_objectives(
&self,
mission_id: &str,
) -> Result<ListMissionObjectivesResponse>
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.
Sourcepub async fn pause_mission(
&self,
mission_id: &str,
) -> Result<PauseMissionResponse>
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.
Sourcepub async fn resume(&self, mission_id: &str) -> Result<ResumeMissionResponse>
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.
Sourcepub async fn run(&self, mission_id: &str) -> Result<RunMissionResponse>
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.
Sourcepub async fn start_mission(
&self,
body: &StartMissionRequest,
) -> Result<MissionStartResponse>
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.
Sourcepub fn stream_mission_events(&self, mission_id: &str) -> EventStream
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.
Sourcepub async fn update_mission_objective(
&self,
mission_id: &str,
objective_id: &str,
body: &UpdateMissionObjectiveRequest,
) -> Result<Objective>
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
impl Clone for MissionsApi
Source§fn clone(&self) -> MissionsApi
fn clone(&self) -> MissionsApi
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more