pub struct App { /* private fields */ }Expand description
Application state and entry point.
Holds an Oxi engine (composition root) and a single Agent built
from it. The legacy App::new(settings) constructor is gone;
use App::from_oxi with a wired Oxi from
build_oxi_engine.
Implementations§
Source§impl App
impl App
Sourcepub async fn from_oxi(
oxi: Oxi,
settings: Settings,
ownership_session_id: String,
) -> Result<Self>
pub async fn from_oxi( oxi: Oxi, settings: Settings, ownership_session_id: String, ) -> Result<Self>
Build an App from a wired Oxi engine and a settings object.
The Oxi should be created via build_oxi_engine (or
services::build_oxi) so that all 11 ports are wired. The
settings hold the user’s runtime configuration (model, thinking
level, etc.).
ownership_session_id is the per-process liveness identity used by
the agent’s issue tool (ToolContext.session_id), the TUI panel,
and the /issue slash command. In TUI mode this MUST equal
crate::store::issues::liveness::TUI_OWNERSHIP_ID so the panel and
agent see the same flock holder. In print / RPC mode, a stable
process-scoped id (e.g. proc-<pid>-<uuid>) is appropriate.
When issue_store is available, an flock is acquired under this
id for the lifetime of the returned App.
Sourcepub fn ownership_session_id(&self) -> &str
pub fn ownership_session_id(&self) -> &str
Per-process liveness identity. Used by the agent’s issue tool and any
other surface that gates on is_session_alive.
Sourcepub fn has_liveness_lock(&self) -> bool
pub fn has_liveness_lock(&self) -> bool
True iff App holds a live liveness flock under ownership_session_id.
False when there is no issue_store (e.g. headless test) or when another
live process already holds the lock (the assignment feature will surface
Assigned errors in that case — by design).
Sourcepub fn set_wasm_ext(&mut self, ext: Option<Arc<WasmExtensionManager>>)
pub fn set_wasm_ext(&mut self, ext: Option<Arc<WasmExtensionManager>>)
Set the WASM extension manager
Sourcepub fn wasm_ext(&self) -> Option<&Arc<WasmExtensionManager>>
pub fn wasm_ext(&self) -> Option<&Arc<WasmExtensionManager>>
Get the WASM extension manager
Sourcepub fn issue_store(&self) -> Option<FileIssueStore>
pub fn issue_store(&self) -> Option<FileIssueStore>
Get a clone of the local issue store, if one was opened successfully.
Sourcepub fn oxi(&self) -> &Oxi
pub fn oxi(&self) -> &Oxi
Get a reference to the underlying Oxi engine. The catalog port and
other ports are accessible through it.
Sourcepub fn agent_tools(&self) -> Arc<ToolRegistry> ⓘ
pub fn agent_tools(&self) -> Arc<ToolRegistry> ⓘ
Get the tool registry (for registering extension tools)
Sourcepub fn questionnaire_bridge(&self) -> Option<&Arc<QuestionnaireBridge>>
pub fn questionnaire_bridge(&self) -> Option<&Arc<QuestionnaireBridge>>
Get the questionnaire bridge, if initialized.
Sourcepub fn skills(&self) -> RwLockReadGuard<'_, SkillManager>
pub fn skills(&self) -> RwLockReadGuard<'_, SkillManager>
Get a reference to the skill manager
Sourcepub fn activate_skill(&self, name: &str) -> Result<(), String>
pub fn activate_skill(&self, name: &str) -> Result<(), String>
Activate a skill by name. Returns an error string if not found.
Sourcepub fn deactivate_skill(&self, name: &str)
pub fn deactivate_skill(&self, name: &str)
Deactivate a skill by name.
Sourcepub fn active_skills(&self) -> Vec<String>
pub fn active_skills(&self) -> Vec<String>
List currently active skill names
Sourcepub fn agent_state(&self) -> AgentState
pub fn agent_state(&self) -> AgentState
Get a clone of the current state
Sourcepub async fn run_prompt(&self, prompt: String) -> Result<String>
pub async fn run_prompt(&self, prompt: String) -> Result<String>
Run a single prompt and return the response
Sourcepub async fn run_prompt_with_events<F>(
&self,
prompt: String,
on_event: F,
) -> Result<String>
pub async fn run_prompt_with_events<F>( &self, prompt: String, on_event: F, ) -> Result<String>
Run a prompt with event callback
Sourcepub async fn switch_model(&self, model_id: &str) -> Result<()>
pub async fn switch_model(&self, model_id: &str) -> Result<()>
Switch the model used for future LLM calls.
Auto Trait Implementations§
impl !Freeze for App
impl !RefUnwindSafe for App
impl !UnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin for App
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§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>
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>
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 moreimpl<T> MaybeSendSync for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.