Skip to main content

CoreCli

Struct CoreCli 

Source
pub struct CoreCli {
    pub bin: PathBuf,
    pub chat_bin: Option<PathBuf>,
    pub chat_from_path: bool,
}

Fields§

§bin: PathBuf§chat_bin: Option<PathBuf>

abstractcore-chat — the one-shot generation lane (M3 test verbs). Resolved beside bin (same venv/bin dir) or on PATH; None = generation tests refuse with a teaching message.

§chat_from_path: bool

True when chat_bin came from the PATH fallback rather than beside bin — a different install may answer the generation test than the one serving discovery, and silence about it would contradict the sibling rationale (M3 review P3-2).

Implementations§

Source§

impl CoreCli

Source

pub fn new(bin: PathBuf) -> CoreCli

Source

pub fn run_chat( &self, args: &[&str], timeout: Duration, ) -> Result<(String, Vec<String>), CliError>

Run abstractcore-chat <args> and return raw stdout + the stderr #FALLBACK lines. Exit-code truth only — the stdout verdict (reply vs ❌ Error:) is the caller’s fold (probes::fold_generation); this lane’s argv never carries secrets (provider/model/prompt only).

Source

pub fn run_setter( &self, args: &[&str], redacted_label: &str, timeout: Duration, ) -> Result<Vec<String>, CliError>

Run a SETTER invocation (human output, no JSON). The flags CLI exits 0 on refused writes (live-probed: --set-server-port 99999 prints ❌ Error: and exits 0) — so an error line on stdout is a failure REGARDLESS of the exit code. Returns the stderr #FALLBACK lines like the JSON lane. redacted_label names the invocation in error messages — argv may carry secrets here, so the label comes from the caller’s already-redacted rendering, never from the args.

Source

pub fn run_json( &self, args: &[&str], timeout: Duration, ) -> Result<CliOutput, CliError>

Run abstractcore <args> and parse stdout as JSON.

Body over transport: a nonzero exit still tries to surface the CLI’s own ❌ Error: line (config subcommands print errors to stdout, main.py:1753-1760). Stdout/stderr are drained on reader threads so a large payload can never deadlock the pipe.

Source

pub fn run_json_last( &self, args: &[&str], timeout: Duration, ) -> Result<CliOutput, CliError>

Run a streaming abstractcore <args> --json verb and return its FINAL document.

models download <p> <a> --json (and engines install --json) print one host_job_v1 object per line while the job runs and the final job last; that last line also carries the legacy ok/results keys of the older one-document shape. A pretty-printed single document is accepted too. A nonzero exit reports the final job’s own error/message when the last line is a job, else the CLI’s error line.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.