pub struct Context {
pub cwd: PathBuf,
pub agent_dir: PathBuf,
pub project_dir: PathBuf,
pub project_trusted: bool,
pub project_only_mcp: Option<Vec<String>>,
pub mode: Mode,
pub ui: Arc<dyn ExtensionUi>,
pub tools: Tools,
pub cancel: CancellationToken,
pub session: WeakSession,
}Expand description
What an extension can reach while handling an event or command.
Fields§
§cwd: PathBufThe session’s working directory.
agent_dir: PathBufThe agent directory.
project_dir: PathBufThe directory the session’s project files come from: the working directory unless the run names another.
project_trusted: boolWhether the project’s resources are trusted.
project_only_mcp: Option<Vec<String>>In a project-only run, the patterns of the user’s MCP servers it
keeps, from the projectOnly setting. The user’s others stay out.
mode: ModeThe mode.
ui: Arc<dyn ExtensionUi>Dialogs and notifications.
tools: ToolsThe session’s tools.
cancel: CancellationTokenCancelled when the current run is aborted.
session: WeakSessionThe session, for extensions that act on it later.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Context
impl !UnwindSafe for Context
impl Forget for Context
impl Freeze for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin 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