pub struct Surface { /* private fields */ }Expand description
The catalog bound to a store, a default repo and optional providers.
Implementations§
Source§impl Surface
impl Surface
Sourcepub fn new(
store: Store,
default_repo: &str,
provider: Option<Box<dyn EmbeddingProvider>>,
) -> Self
pub fn new( store: Store, default_repo: &str, provider: Option<Box<dyn EmbeddingProvider>>, ) -> Self
A surface over store whose default repo is default_repo (an id).
Mutations derive each repo’s root from its fs source.
Sourcepub fn with_actor(self, actor: &str) -> Self
pub fn with_actor(self, actor: &str) -> Self
Record actor on every write instead of ACTOR (the CLI’s
human:<user> / --actor; the MCP server keeps the default).
Sourcepub fn with_doc_store(self, doc_store: Box<dyn DocStore>) -> Self
pub fn with_doc_store(self, doc_store: Box<dyn DocStore>) -> Self
Route every mutation’s file writes through doc_store regardless of
the repo’s sources (a runner’s in-memory store).
Sourcepub fn with_clock(self, clock: impl FnMut() -> String + 'static) -> Self
pub fn with_clock(self, clock: impl FnMut() -> String + 'static) -> Self
Stamp commits with clock() instead of the wall clock.
Sourcepub fn with_mutation_hook(self, hook: impl FnMut() + 'static) -> Self
pub fn with_mutation_hook(self, hook: impl FnMut() + 'static) -> Self
Called after every successful write (never after a dry run).
Sourcepub fn with_config(self, config: Config) -> Self
pub fn with_config(self, config: Config) -> Self
The matcher thresholds the observe tools pass through.
Sourcepub fn with_build_info(self, build_info: BuildInfo) -> Self
pub fn with_build_info(self, build_info: BuildInfo) -> Self
The serving binary’s identity for the version tool (§4, 1.4): its
own version, spec/cli version, build commit and time, compiler. A
library embedding keeps the default (this crate’s version, nulls).
pub fn store(&self) -> &Store
pub fn store_mut(&mut self) -> &mut Store
pub fn default_repo(&self) -> &str
Sourcepub fn is_write_tool(name: &str) -> bool
pub fn is_write_tool(name: &str) -> bool
Whether name is a tool that can commit (a host serializes these
under the writer lock of spec/sync §7; dry_run calls still count
here — only the mutation hook knows a write actually happened).
Sourcepub fn call(&mut self, name: &str, args: Json) -> ToolOutcome
pub fn call(&mut self, name: &str, args: Json) -> ToolOutcome
Run a tool: its JSON result, or the error envelope.