mars_agents/build/
bundle.rs1use std::collections::BTreeMap;
2
3use serde::Serialize;
4
5pub const SLOT_PLACEHOLDER: &str = "###SLOT###";
6
7#[derive(Debug, Clone, Serialize)]
8pub struct LaunchBundle {
9 pub version: u32,
10 pub agent: Option<String>,
11 #[serde(skip_serializing_if = "Option::is_none")]
12 pub agent_body: Option<String>,
13 pub routing: Routing,
14 pub execution_policy: ExecutionPolicy,
15 pub prompt_surface: PromptSurface,
16 pub scaffold_slots: ScaffoldSlots,
17 pub tools: ToolsSpec,
18 pub skills_metadata: SkillsMetadata,
19 pub provenance: BTreeMap<String, String>,
20 pub warnings: Vec<String>,
21}
22
23#[derive(Debug, Clone, Serialize)]
24pub struct Routing {
25 pub model: String,
26 pub model_token: String,
27 pub harness: String,
28 pub selection_kind: String,
29 pub match_evidence: String,
30 pub harness_model: String,
31 pub harness_model_source: String,
32 pub harness_model_confidence: String,
33 pub candidate_slugs: Vec<String>,
36 pub route_trace: crate::routing::report::RouteDecisionReport,
37}
38
39#[derive(Debug, Clone, Serialize)]
40pub struct CodexRule {
41 pub name: String,
42 pub content: String,
43}
44
45#[derive(Debug, Clone, Serialize)]
46pub struct ExecutionPolicy {
47 pub effort: Option<String>,
48 pub approval: Option<String>,
49 pub sandbox: Option<String>,
50 pub autocompact: Option<u32>,
51 pub autocompact_pct: Option<u8>,
52 pub timeout: Option<u32>,
53 #[serde(skip_serializing_if = "Option::is_none")]
54 pub native_config: Option<serde_json::Map<String, serde_json::Value>>,
55 #[serde(skip_serializing_if = "Option::is_none")]
56 pub codex_rules: Option<Vec<CodexRule>>,
57}
58
59#[derive(Debug, Clone, Serialize)]
60pub struct PromptSurface {
61 pub system_instruction: String,
62 pub supplemental_documents: Vec<SupplementalDoc>,
63 pub inventory_prompt: String,
64}
65
66#[derive(Debug, Clone, Serialize)]
67pub struct ScaffoldSlots {
68 pub completion_contract: String,
69 pub context_prompt: String,
70 pub user_prompt_file: String,
71 pub context_files: String,
72 pub prior_session_context: String,
73 pub spawn_metadata: String,
74}
75
76impl ScaffoldSlots {
77 pub fn placeholders() -> Self {
78 Self {
79 completion_contract: SLOT_PLACEHOLDER.to_string(),
80 context_prompt: SLOT_PLACEHOLDER.to_string(),
81 user_prompt_file: SLOT_PLACEHOLDER.to_string(),
82 context_files: SLOT_PLACEHOLDER.to_string(),
83 prior_session_context: SLOT_PLACEHOLDER.to_string(),
84 spawn_metadata: SLOT_PLACEHOLDER.to_string(),
85 }
86 }
87}
88
89#[derive(Debug, Clone, Serialize)]
90pub struct SupplementalDoc {
91 pub kind: String,
92 pub name: String,
93 pub content: String,
94 pub skill_type: String,
95}
96
97#[derive(Debug, Clone, Serialize)]
98pub struct ToolsSpec {
99 pub allowed: Vec<String>,
100 pub disallowed: Vec<String>,
101 pub mcp: Vec<String>,
102}
103
104#[derive(Debug, Clone, Serialize)]
105pub struct SkillsMetadata {
106 pub loaded: Vec<String>,
107 pub missing: Vec<String>,
108}