pub struct LuaCallContext {Show 14 fields
pub cwd: PathBuf,
pub cancelled: Arc<AtomicBool>,
pub update_tx: Sender<ToolUpdate>,
pub command_tx: Sender<AgentCommand>,
pub ui: Arc<dyn UserInterface>,
pub file_cache: Arc<FileCache>,
pub checkpoint_state: Arc<CheckpointState>,
pub file_tracker: Arc<Mutex<FileTracker>>,
pub anchor_store: Arc<AnchorStore>,
pub lua_tool_loader: Option<LuaToolLoader>,
pub mode: AgentMode,
pub read_max_lines: usize,
pub run_policy: RunPolicy,
pub config: Arc<Config>,
}Expand description
Context passed to Lua host API functions during tool execution.
Mirrors ToolContext but is stored separately so the Lua
imp.tool() callback can construct a fresh ToolContext for
each native tool call.
Fields§
§cwd: PathBuf§cancelled: Arc<AtomicBool>§update_tx: Sender<ToolUpdate>§command_tx: Sender<AgentCommand>§ui: Arc<dyn UserInterface>§file_cache: Arc<FileCache>§checkpoint_state: Arc<CheckpointState>§file_tracker: Arc<Mutex<FileTracker>>§anchor_store: Arc<AnchorStore>§lua_tool_loader: Option<LuaToolLoader>§mode: AgentMode§read_max_lines: usize§run_policy: RunPolicy§config: Arc<Config>Implementations§
Source§impl LuaCallContext
impl LuaCallContext
Sourcepub fn to_tool_context(&self) -> ToolContext
pub fn to_tool_context(&self) -> ToolContext
Build a ToolContext from the stored fields.
Trait Implementations§
Source§impl From<ToolContext> for LuaCallContext
impl From<ToolContext> for LuaCallContext
Source§fn from(ctx: ToolContext) -> Self
fn from(ctx: ToolContext) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for LuaCallContext
impl !RefUnwindSafe for LuaCallContext
impl Send for LuaCallContext
impl Sync for LuaCallContext
impl Unpin for LuaCallContext
impl UnsafeUnpin for LuaCallContext
impl !UnwindSafe for LuaCallContext
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more