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: boolTrue 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
impl CoreCli
pub fn new(bin: PathBuf) -> CoreCli
Sourcepub fn run_chat(
&self,
args: &[&str],
timeout: Duration,
) -> Result<(String, Vec<String>), CliError>
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).
Sourcepub fn run_setter(
&self,
args: &[&str],
redacted_label: &str,
timeout: Duration,
) -> Result<Vec<String>, CliError>
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.
Sourcepub fn run_json(
&self,
args: &[&str],
timeout: Duration,
) -> Result<CliOutput, CliError>
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.
Sourcepub fn run_json_last(
&self,
args: &[&str],
timeout: Duration,
) -> Result<CliOutput, CliError>
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.