pub struct Context { /* private fields */ }Expand description
Ephemeral current state owned exclusively by one subagent run.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new(
root_node_ids: Vec<String>,
load_fixed_connections: bool,
provider: AgentProvider,
codex_harness_prompt: String,
selected_node_descriptions: Vec<String>,
) -> Result<Self>
pub fn new( root_node_ids: Vec<String>, load_fixed_connections: bool, provider: AgentProvider, codex_harness_prompt: String, selected_node_descriptions: Vec<String>, ) -> Result<Self>
Creates a child context with provider-appropriate immutable opening sections.
Sourcepub fn initial_sections(&self) -> &[String]
pub fn initial_sections(&self) -> &[String]
Immutable provider-specific prompt and selected node descriptions, in model order.
Sourcepub fn kweb(&self) -> &KwebContext
pub fn kweb(&self) -> &KwebContext
The independent Kweb state used by child LoadNodes and Kmap tools.
Sourcepub fn kweb_mut(&mut self) -> &mut KwebContext
pub fn kweb_mut(&mut self) -> &mut KwebContext
Mutable access for an atomic child Kweb load.
Sourcepub fn include_staged_nodes(&mut self, ids: impl IntoIterator<Item = String>)
pub fn include_staged_nodes(&mut self, ids: impl IntoIterator<Item = String>)
Makes explicitly referenced pending nodes visible to this child.
Sourcepub fn reconcile_kweb(
&mut self,
updates: &BTreeMap<String, NodeDraft>,
creates: &[StagedCreate],
) -> Result<StateChanges>
pub fn reconcile_kweb( &mut self, updates: &BTreeMap<String, NodeDraft>, creates: &[StagedCreate], ) -> Result<StateChanges>
Reconciles the child’s complete Kweb state without touching Chatend.
Sourcepub fn apply_source_snapshot(&mut self, snapshot: SourceSnapshot) -> SourceState
pub fn apply_source_snapshot(&mut self, snapshot: SourceSnapshot) -> SourceState
Installs one current managed-source value in the child context.
Sourcepub fn source_state(&self, snapshot: &SourceSnapshot) -> SourceState
pub fn source_state(&self, snapshot: &SourceSnapshot) -> SourceState
Renders a prospective managed-source value without applying it.
Sourcepub fn source_is_open(&self, kind: ManagedSourceKind, name: &str) -> bool
pub fn source_is_open(&self, kind: ManagedSourceKind, name: &str) -> bool
Whether this exact source kind and project is open in the child.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
Blanket Implementations§
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
Mutably borrows from an owned value. Read more