Skip to main content

AppService

Struct AppService 

Source
pub struct AppService { /* private fields */ }

Implementations§

Source§

impl AppService

Source

pub async fn eval( &self, scenario: Option<String>, scenario_file: Option<String>, scenario_name: Option<String>, strategy: &str, strategy_opts: Option<Value>, ) -> Result<String, String>

Run an evalframe evaluation suite.

Accepts a scenario (bindings + cases) and a strategy name. Automatically wires the strategy as the provider and executes the evalframe suite, returning the report (summary, scores, failures).

Injects a std global (mlua-batteries compatible shim) so evalframe’s std.lua can resolve json/fs/time from algocline’s built-in primitives.

§Security: strategy is not sanitized

strategy is interpolated into a Lua string literal without escaping. This is intentional — same rationale as [make_require_code]: algocline runs Lua in the caller’s own process with full ambient authority, so Lua injection does not cross a trust boundary.

Source

pub fn eval_history( &self, strategy: Option<&str>, limit: usize, ) -> Result<String, String>

List eval history, optionally filtered by strategy.

Source

pub fn eval_detail(&self, eval_id: &str) -> Result<String, String>

View a specific eval result by ID.

Source

pub async fn eval_compare( &self, eval_id_a: &str, eval_id_b: &str, ) -> Result<String, String>

Compare two eval results with statistical significance testing.

Delegates to evalframe’s stats.welch_t (single source of truth for t-distribution table and test logic). Reads persisted aggregated.scores from each eval result — no re-computation of descriptive statistics.

The comparison result is persisted to ~/.algocline/evals/ so repeated lookups of the same pair are file reads only.

Source§

impl AppService

Source

pub async fn add_note( &self, session_id: &str, content: &str, title: Option<&str>, ) -> Result<String, String>

Append a note to a session’s log file.

Source

pub async fn log_view( &self, session_id: Option<&str>, limit: Option<usize>, ) -> Result<String, String>

View session logs.

Source

pub fn info(&self) -> String

Return diagnostic info about the current configuration (mise doctor style).

Source

pub fn stats( &self, strategy_filter: Option<&str>, days: Option<u64>, ) -> Result<String, String>

Aggregate stats across all logged sessions.

Scans .meta.json files (with .json fallback for legacy logs). Optional filters: strategy (exact match), days (last N days).

Source§

impl AppService

Source

pub async fn pkg_list(&self) -> Result<String, String>

List installed packages with metadata, showing the full override chain.

Scans all search paths in priority order. For each package:

  • source: the path it was found in
  • active: whether this is the effective version (highest priority wins)
  • overrides: if active and a lower-priority copy exists, shows what it overrides
Source

pub async fn pkg_install( &self, url: String, name: Option<String>, ) -> Result<String, String>

Install a package from a Git URL or local path.

Source

pub async fn pkg_remove(&self, name: &str) -> Result<String, String>

Remove an installed package.

Source§

impl AppService

Source

pub async fn run( &self, code: Option<String>, code_file: Option<String>, ctx: Option<Value>, ) -> Result<String, String>

Execute Lua code with optional JSON context.

Source

pub async fn advice( &self, strategy: &str, task: String, opts: Option<Value>, ) -> Result<String, String>

Apply a built-in strategy to a task.

If the requested package is not installed, automatically installs the bundled package collection from GitHub before executing.

Source

pub async fn continue_batch( &self, session_id: &str, responses: Vec<QueryResponse>, ) -> Result<String, String>

Continue a paused execution — batch feed.

Source

pub async fn continue_single( &self, session_id: &str, response: String, query_id: Option<&str>, ) -> Result<String, String>

Continue a paused execution — single response (with optional query_id).

Source§

impl AppService

Source

pub fn scenario_list(&self) -> Result<String, String>

List available scenarios in ~/.algocline/scenarios/.

Per-entry I/O errors are collected in "failures" rather than aborting.

Source

pub fn scenario_show(&self, name: &str) -> Result<String, String>

Show the content of a named scenario.

Source

pub async fn scenario_install(&self, url: String) -> Result<String, String>

Install scenarios from a Git URL or local path into ~/.algocline/scenarios/.

Expects the source to contain .lua files (at root or in a scenarios/ subdirectory).

Source§

impl AppService

Source

pub async fn status(&self, session_id: Option<&str>) -> Result<String, String>

Snapshot of all active sessions for external observation.

Returns JSON with session status, metrics, progress, and strategy name. Only includes sessions currently held in the registry (paused, awaiting host LLM responses). Completed sessions are not listed here — use alc_log_view for historical data.

Source§

impl AppService

Source

pub fn new( executor: Arc<Executor>, log_config: AppConfig, search_paths: Vec<SearchPath>, ) -> Self

Trait Implementations§

Source§

impl Clone for AppService

Source§

fn clone(&self) -> AppService

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> MaybeSend for T
where T: Send,