pub struct AgentContext {
pub task_id: String,
pub item_id: String,
pub cycle: u32,
pub phase: String,
pub workspace_root: PathBuf,
pub workspace_id: String,
pub execution_history: Vec<PhaseRecord>,
pub upstream_outputs: Vec<AgentOutput>,
pub artifacts: ArtifactRegistry,
pub shared_state: SharedState,
}Expand description
Full agent context available during phase execution.
Fields§
§task_id: StringParent task identifier.
item_id: StringCurrent task-item identifier.
cycle: u32Execution cycle number.
phase: StringCurrent phase name.
workspace_root: PathBufAbsolute workspace root used for command execution.
workspace_id: StringWorkspace identifier from configuration.
execution_history: Vec<PhaseRecord>Historical phase executions accumulated so far.
upstream_outputs: Vec<AgentOutput>Outputs produced by upstream phases.
artifacts: ArtifactRegistryArtifact registry accumulated across phases.
Shared key-value state available to templates and follow-up steps.
Implementations§
Source§impl AgentContext
impl AgentContext
Sourcepub fn new(
task_id: String,
item_id: String,
cycle: u32,
phase: String,
workspace_root: PathBuf,
workspace_id: String,
) -> AgentContext
pub fn new( task_id: String, item_id: String, cycle: u32, phase: String, workspace_root: PathBuf, workspace_id: String, ) -> AgentContext
Creates a fresh execution context for an agent phase.
Sourcepub fn add_upstream_output(&mut self, output: AgentOutput)
pub fn add_upstream_output(&mut self, output: AgentOutput)
Adds an upstream output and merges its artifacts into the registry.
Sourcepub fn render_template(&self, template: &str) -> String
pub fn render_template(&self, template: &str) -> String
Renders a template using context variables only.
Note: Pipeline variable values are escaped for safe use inside bash double-quoted strings. This prevents content like markdown backticks from triggering shell command substitution.
Sourcepub fn render_template_with_pipeline(
&self,
template: &str,
pipeline: Option<&PipelineVariables>,
) -> String
pub fn render_template_with_pipeline( &self, template: &str, pipeline: Option<&PipelineVariables>, ) -> String
Renders a template using context variables and optional pipeline values.
Sourcepub fn to_ref(&self) -> AgentContextRef
pub fn to_ref(&self) -> AgentContextRef
Converts the full context into a lightweight serializable reference.
Trait Implementations§
Source§impl Clone for AgentContext
impl Clone for AgentContext
Source§fn clone(&self) -> AgentContext
fn clone(&self) -> AgentContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AgentContext
impl RefUnwindSafe for AgentContext
impl Send for AgentContext
impl Sync for AgentContext
impl Unpin for AgentContext
impl UnsafeUnpin for AgentContext
impl UnwindSafe for AgentContext
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request