pub struct Client {
pub commit_author_name: String,
pub commit_author_email: String,
/* private fields */
}Fields§
Implementations§
Source§impl Client
impl Client
pub fn new( base_dir: Option<impl Into<PathBuf>>, commit_author_name: Option<impl Into<String>>, commit_author_email: Option<impl Into<String>>, ) -> Self
pub fn base_dir(&self) -> &PathBuf
pub fn config_path(&self) -> PathBuf
pub fn db_path(&self) -> PathBuf
pub fn logs_dir(&self) -> PathBuf
Source§impl Client
impl Client
pub async fn list_agent_completions( &self, offset: usize, limit: usize, ) -> Result<Vec<ListItem>, Error>
pub async fn list_vector_completions( &self, offset: usize, limit: usize, ) -> Result<Vec<ListItem>, Error>
pub async fn list_function_executions( &self, offset: usize, limit: usize, ) -> Result<Vec<ListItem>, Error>
pub async fn list_function_inventions( &self, offset: usize, limit: usize, ) -> Result<Vec<ListItem>, Error>
pub async fn list_function_inventions_recursive( &self, offset: usize, limit: usize, ) -> Result<Vec<ListItem>, Error>
pub async fn list_laboratory_executions( &self, offset: usize, limit: usize, ) -> Result<Vec<ListItem>, Error>
pub async fn clear_agent_completions(&self) -> Result<u64, Error>
pub async fn clear_agent_completion_continuations(&self) -> Result<u64, Error>
pub async fn clear_agent_completion_messages(&self) -> Result<u64, Error>
pub async fn clear_agent_completion_message_logprobs( &self, ) -> Result<u64, Error>
pub async fn clear_agent_completion_message_images(&self) -> Result<u64, Error>
pub async fn clear_agent_completion_message_audio(&self) -> Result<u64, Error>
pub async fn clear_agent_completion_message_video(&self) -> Result<u64, Error>
pub async fn clear_agent_completion_message_files(&self) -> Result<u64, Error>
pub async fn clear_vector_completions(&self) -> Result<u64, Error>
pub async fn clear_function_executions(&self) -> Result<u64, Error>
pub async fn clear_function_execution_retry_tokens(&self) -> Result<u64, Error>
pub async fn clear_function_inventions(&self) -> Result<u64, Error>
pub async fn clear_function_inventions_recursive(&self) -> Result<u64, Error>
pub async fn clear_laboratory_executions(&self) -> Result<u64, Error>
pub fn write_agent_completion(&self) -> LogWriter<AgentCompletionChunk>
pub fn write_vector_completion(&self) -> LogWriter<VectorCompletionChunk>
pub fn write_function_execution(&self) -> LogWriter<FunctionExecutionChunk>
pub fn write_function_invention(&self) -> LogWriter<FunctionInventionChunk>
pub fn write_function_invention_recursive( &self, ) -> LogWriter<FunctionInventionRecursiveChunk>
pub fn write_laboratory_execution(&self) -> LogWriter<LaboratoryExecutionChunk>
pub async fn read_agent_completion( &self, id: &str, jq: Option<&str>, ) -> Result<Value, Error>
pub async fn read_agent_completion_continuation( &self, id: &str, jq: Option<&str>, ) -> Result<Value, Error>
pub async fn read_agent_completion_message( &self, id: &str, message_index: u64, jq: Option<&str>, ) -> Result<Value, Error>
pub async fn read_agent_completion_message_logprobs( &self, id: &str, message_index: u64, jq: Option<&str>, ) -> Result<Value, Error>
pub async fn read_agent_completion_message_image( &self, id: &str, message_index: u64, media_index: u64, ) -> Result<String, Error>
pub async fn read_agent_completion_message_audio( &self, id: &str, message_index: u64, media_index: u64, ) -> Result<String, Error>
pub async fn read_agent_completion_message_video( &self, id: &str, message_index: u64, media_index: u64, ) -> Result<String, Error>
pub async fn read_agent_completion_message_file( &self, id: &str, message_index: u64, media_index: u64, ) -> Result<String, Error>
pub async fn read_vector_completion( &self, id: &str, jq: Option<&str>, ) -> Result<Value, Error>
pub async fn read_function_execution( &self, id: &str, jq: Option<&str>, ) -> Result<Value, Error>
pub async fn read_function_execution_retry_token( &self, id: &str, jq: Option<&str>, ) -> Result<Value, Error>
pub async fn read_function_invention( &self, id: &str, jq: Option<&str>, ) -> Result<Value, Error>
pub async fn read_function_invention_recursive( &self, id: &str, jq: Option<&str>, ) -> Result<Value, Error>
pub async fn read_laboratory_execution( &self, id: &str, jq: Option<&str>, ) -> Result<Value, Error>
pub async fn subscribe_agent_completion( &self, id: &str, timeout: Duration, require_modification: bool, jq: Option<&str>, ) -> Result<Option<Value>, Error>
pub async fn subscribe_agent_completion_continuation( &self, id: &str, timeout: Duration, require_modification: bool, jq: Option<&str>, ) -> Result<Option<Value>, Error>
pub async fn subscribe_agent_completion_message( &self, id: &str, message_index: u64, timeout: Duration, require_modification: bool, jq: Option<&str>, ) -> Result<Option<Value>, Error>
pub async fn subscribe_agent_completion_message_logprobs( &self, id: &str, message_index: u64, timeout: Duration, require_modification: bool, jq: Option<&str>, ) -> Result<Option<Value>, Error>
pub async fn subscribe_agent_completion_message_image( &self, id: &str, message_index: u64, media_index: u64, timeout: Duration, require_modification: bool, ) -> Option<String>
pub async fn subscribe_agent_completion_message_audio( &self, id: &str, message_index: u64, media_index: u64, timeout: Duration, require_modification: bool, ) -> Option<String>
pub async fn subscribe_agent_completion_message_video( &self, id: &str, message_index: u64, media_index: u64, timeout: Duration, require_modification: bool, ) -> Option<String>
pub async fn subscribe_agent_completion_message_file( &self, id: &str, message_index: u64, media_index: u64, timeout: Duration, require_modification: bool, ) -> Option<String>
pub async fn subscribe_vector_completion( &self, id: &str, timeout: Duration, require_modification: bool, jq: Option<&str>, ) -> Result<Option<Value>, Error>
pub async fn subscribe_function_execution( &self, id: &str, timeout: Duration, require_modification: bool, jq: Option<&str>, ) -> Result<Option<Value>, Error>
pub async fn subscribe_function_execution_retry_token( &self, id: &str, timeout: Duration, require_modification: bool, jq: Option<&str>, ) -> Result<Option<Value>, Error>
pub async fn subscribe_function_invention( &self, id: &str, timeout: Duration, require_modification: bool, jq: Option<&str>, ) -> Result<Option<Value>, Error>
pub async fn subscribe_function_invention_recursive( &self, id: &str, timeout: Duration, require_modification: bool, jq: Option<&str>, ) -> Result<Option<Value>, Error>
pub async fn subscribe_laboratory_execution( &self, id: &str, timeout: Duration, require_modification: bool, jq: Option<&str>, ) -> Result<Option<Value>, Error>
Source§impl Client
impl Client
Sourcepub fn plugins_dir(&self) -> PathBuf
pub fn plugins_dir(&self) -> PathBuf
The plugins directory: <base_dir>/plugins.
Sourcepub fn plugin_dir(&self, name: &str) -> PathBuf
pub fn plugin_dir(&self, name: &str) -> PathBuf
The directory that holds a plugin’s installed artifacts:
<plugins_dir>/<name>/. Contains the binary, an optional
viewer/ bundle, and any runtime state the plugin writes.
Sourcepub fn plugin_binary_path(&self, name: &str) -> PathBuf
pub fn plugin_binary_path(&self, name: &str) -> PathBuf
Canonical path of a plugin’s binary:
<plugins_dir>/<name>/plugin on Unix, …/plugin.exe on
Windows. Used by both install_plugin (write target) and
resolve_plugin (read target) so the two cannot drift.
Sourcepub async fn resolve_plugin(&self, name: &str) -> Option<PathBuf>
pub async fn resolve_plugin(&self, name: &str) -> Option<PathBuf>
Resolve a plugin name to its executable path. Returns
Some(path) when Self::plugin_binary_path exists on disk
as a regular file, None otherwise.
Uses tokio::fs::metadata so it doesn’t block the runtime.
Sourcepub async fn get_plugin(&self, name: &str) -> Option<ManifestWithNameAndSource>
pub async fn get_plugin(&self, name: &str) -> Option<ManifestWithNameAndSource>
Look up a single plugin manifest by name. Reads
<base_dir>/plugins/<name>.json. If the file persists name
and source (as installed plugins do), they’re returned
verbatim; otherwise the wrapper is synthesized with
name = <name> and source = absolute_path. Returns None
if the file is missing, unreadable, or malformed.
Sourcepub async fn list_plugins(
&self,
offset: usize,
limit: usize,
) -> Vec<ManifestWithNameAndSource>
pub async fn list_plugins( &self, offset: usize, limit: usize, ) -> Vec<ManifestWithNameAndSource>
Enumerate plugin manifests in the plugins directory. Reads each
.json file in <base_dir>/plugins/, deserializes it as a
Manifest, and pairs it with the file’s stem (name) and
absolute path (source). Every failure mode — missing dir,
unreadable file, malformed JSON, missing required field — is
silently skipped; the return type is plain Vec rather than
Result to reflect that.
Results are sorted by manifest mtime descending (most recently
modified first), then skip(offset).take(limit) is applied —
matching the convention of the logs list endpoints. Pass
(0, usize::MAX) for an unbounded list.
The directory scan is sequential (intrinsic to read_dir) but
per-file read+parse runs concurrently via
futures::future::join_all.
Source§impl Client
impl Client
Sourcepub async fn install_plugin(
&self,
owner: &str,
repository: &str,
commit_sha: Option<&str>,
headers: Option<&IndexMap<String, String>>,
upgrade: bool,
) -> Result<bool, Error>
pub async fn install_plugin( &self, owner: &str, repository: &str, commit_sha: Option<&str>, headers: Option<&IndexMap<String, String>>, upgrade: bool, ) -> Result<bool, Error>
Install a plugin from a GitHub repository.
- Fetches
objectiveai.jsonfromraw.githubusercontent.comat the suppliedcommit_sha(or the default branch viaHEADwhen none). - Parses it as a
Manifest. - Looks up the current platform in
manifest.binaries. If absent (or this host’s platform isn’t recognized bysuper::Platform::current), returnsOk(false)— the plugin simply doesn’t support this host. - Downloads the matching release asset from
https://github.com/<owner>/<repository>/releases/download/v<version>/<asset>. - Writes it to
<base_dir>/plugins/<repository>/plugin(plugin.exeon Windows). Sets mode0o755on Unix so the binary is executable.
headers is an optional IndexMap<String, String> that gets
attached to both HTTP requests (e.g. Authorization for
private repos / higher rate limits). The cli always passes
None.
Failures past step 3 are returned as
super::InstallError wrapped by
super::super::Error::Install.
Sourcepub async fn fetch_plugin_manifest(
&self,
owner: &str,
repository: &str,
commit_sha: Option<&str>,
headers: Option<&IndexMap<String, String>>,
) -> Result<Manifest, Error>
pub async fn fetch_plugin_manifest( &self, owner: &str, repository: &str, commit_sha: Option<&str>, headers: Option<&IndexMap<String, String>>, ) -> Result<Manifest, Error>
Step 1 of install_plugin: fetch <owner>/<repo>/<ref>/objectiveai.json
from raw.githubusercontent.com and parse it as a Manifest.
Exposed publicly so callers can inspect the manifest before
committing to an install (e.g. for whitelist checks).
Sourcepub async fn install_plugin_from_manifest(
&self,
owner: &str,
repository: &str,
manifest: &Manifest,
source: &str,
headers: Option<&IndexMap<String, String>>,
upgrade: bool,
) -> Result<bool, Error>
pub async fn install_plugin_from_manifest( &self, owner: &str, repository: &str, manifest: &Manifest, source: &str, headers: Option<&IndexMap<String, String>>, upgrade: bool, ) -> Result<bool, Error>
Step 2 of install_plugin: given an already-parsed manifest,
pick the binary for the current platform (Ok(false) if
absent), download it from the corresponding release asset,
and write it to <plugins_dir>/<repository>/plugin[.exe].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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 more