pub struct LocalSourceBuilder { /* private fields */ }surface only.Expand description
Builds a LocalSource.
Implementations§
Source§impl LocalSourceBuilder
impl LocalSourceBuilder
Sourcepub fn sessions(self, sessions: Arc<dyn SessionService>) -> LocalSourceBuilder
pub fn sessions(self, sessions: Arc<dyn SessionService>) -> LocalSourceBuilder
The session store the agents write.
Sourcepub fn approvals(
self,
approvals: Arc<dyn ApprovalService>,
) -> LocalSourceBuilder
pub fn approvals( self, approvals: Arc<dyn ApprovalService>, ) -> LocalSourceBuilder
The approval service held calls are submitted to.
Sourcepub fn kernel(
self,
kernel: Kernel,
target: impl Into<String>,
) -> LocalSourceBuilder
pub fn kernel( self, kernel: Kernel, target: impl Into<String>, ) -> LocalSourceBuilder
An in-process kernel, whose processes of target run the turns surfaces send.
Sourcepub fn harness(self, harness: Arc<Harness>) -> LocalSourceBuilder
pub fn harness(self, harness: Arc<Harness>) -> LocalSourceBuilder
A harness: its runner’s sessions and kill switch unless set, its modes and standing rules.
Sourcepub fn runner(self, runner: Arc<Runner>) -> LocalSourceBuilder
pub fn runner(self, runner: Arc<Runner>) -> LocalSourceBuilder
A runner for apps without a harness: its sessions and kill switch unless set.
Sourcepub fn governance(self, governance: GovernanceControl) -> LocalSourceBuilder
pub fn governance(self, governance: GovernanceControl) -> LocalSourceBuilder
The kill switch “Stop all” freezes when there is no kernel.
Sourcepub fn daily_limit(self, micro_usd: u64) -> LocalSourceBuilder
pub fn daily_limit(self, micro_usd: u64) -> LocalSourceBuilder
The daily spending limit in micro-USD, over the one in force in the kernel’s area of this source’s turns.
Sourcepub fn agents(self, agents: AgentsHandle) -> LocalSourceBuilder
pub fn agents(self, agents: AgentsHandle) -> LocalSourceBuilder
The agent table of a kernel this source does not run turns on — a kernel built after
the source, such as the one adk-rust up serves the terminal’s commands for — so
“Always allow” on an added agent’s card makes a rule for that agent alone (spec 3.3
S-I19). A kernel brings its own.
§Example
use adk_kernel::agents::AgentsHandle;
use adk_session::InMemorySessionService;
let source = adk_surface::LocalSource::builder("adk-rust")
.sessions(std::sync::Arc::new(InMemorySessionService::new()))
.agents(AgentsHandle::new())
.build()
.unwrap();Sourcepub fn artifacts(
self,
artifacts: Arc<dyn ArtifactService>,
) -> LocalSourceBuilder
pub fn artifacts( self, artifacts: Arc<dyn ArtifactService>, ) -> LocalSourceBuilder
The artifact service a held call’s evidence images live in (spec 3.7 §8.2): cards show them, each checked against its digest, and a person may cut one smaller or cover more of it before it leaves.
§Example
use std::sync::Arc;
use adk_artifact::InMemoryArtifactService;
use adk_session::InMemorySessionService;
let source = adk_surface::LocalSource::builder("desk")
.sessions(Arc::new(InMemorySessionService::new()))
.artifacts(Arc::new(InMemoryArtifactService::new()))
.build()
.unwrap();Sourcepub fn runs(self, runs: Arc<dyn DurableRunStore>) -> LocalSourceBuilder
pub fn runs(self, runs: Arc<dyn DurableRunStore>) -> LocalSourceBuilder
The durable run store whose runs wait on decisions: a decision whose run ended while it waits says its answer is used when the agent picks the thread up again (spec 3.7 §8.2, board choice A12).
Sourcepub fn eval_fixtures(self, root: impl Into<PathBuf>) -> LocalSourceBuilder
pub fn eval_fixtures(self, root: impl Into<PathBuf>) -> LocalSourceBuilder
The folder labelled examples are saved under (spec 3.7 §8.2, board choice V13): the
annotated viewer writes adk-eval cases to the .test.json files in it, and each
case’s image beside its file, so cargo adk eval reads them. Without it, the viewer
shows answers and exports them but saves no examples.
§Example
use std::sync::Arc;
use adk_artifact::InMemoryArtifactService;
use adk_session::InMemorySessionService;
let source = adk_surface::LocalSource::builder("desk")
.sessions(Arc::new(InMemorySessionService::new()))
.artifacts(Arc::new(InMemoryArtifactService::new()))
.eval_fixtures(std::env::temp_dir().join("evals"))
.build()
.unwrap();Sourcepub fn build(self) -> Result<LocalSource, SurfaceError>
pub fn build(self) -> Result<LocalSource, SurfaceError>
The source.
§Errors
Returns surface.invalid when no session store was given and no harness or runner
brings one.
Trait Implementations§
Source§impl Debug for LocalSourceBuilder
impl Debug for LocalSourceBuilder
Source§impl Default for LocalSourceBuilder
impl Default for LocalSourceBuilder
Source§fn default() -> LocalSourceBuilder
fn default() -> LocalSourceBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for LocalSourceBuilder
impl !UnwindSafe for LocalSourceBuilder
impl Forget for LocalSourceBuilder
impl Freeze for LocalSourceBuilderwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<dyn SessionService> is !null: Freeze,
PhantomData<ArcInner<dyn SessionService>>: Freeze,
*const ArcInner<dyn ApprovalService> is !null: Freeze,
PhantomData<ArcInner<dyn ApprovalService>>: Freeze,
*const ArcInner<KernelInner> is !null: Freeze,
PhantomData<ArcInner<KernelInner>>: Freeze,
*const ArcInner<Harness> is !null: Freeze,
PhantomData<ArcInner<Harness>>: Freeze,
*const ArcInner<Runner> is !null: Freeze,
PhantomData<ArcInner<Runner>>: Freeze,
*const ArcInner<ControlState> is !null: Freeze,
PhantomData<ArcInner<ControlState>>: Freeze,
*const ArcInner<RwLock<Weak<AgentsInner>>> is !null: Freeze,
PhantomData<ArcInner<RwLock<Weak<AgentsInner>>>>: Freeze,
*const ArcInner<dyn ArtifactService> is !null: Freeze,
PhantomData<ArcInner<dyn ArtifactService>>: Freeze,
*const ArcInner<dyn DurableRunStore> is !null: Freeze,
PhantomData<ArcInner<dyn DurableRunStore>>: Freeze,
impl Move for LocalSourceBuilder
impl Send for LocalSourceBuilder
impl Sync for LocalSourceBuilder
impl Unpin for LocalSourceBuilder
impl UnsafeUnpin for LocalSourceBuilderwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<dyn SessionService> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn SessionService>>: UnsafeUnpin,
*const ArcInner<dyn ApprovalService> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ApprovalService>>: UnsafeUnpin,
*const ArcInner<KernelInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<KernelInner>>: UnsafeUnpin,
*const ArcInner<Harness> is !null: UnsafeUnpin,
PhantomData<ArcInner<Harness>>: UnsafeUnpin,
*const ArcInner<Runner> is !null: UnsafeUnpin,
PhantomData<ArcInner<Runner>>: UnsafeUnpin,
*const ArcInner<ControlState> is !null: UnsafeUnpin,
PhantomData<ArcInner<ControlState>>: UnsafeUnpin,
*const ArcInner<RwLock<Weak<AgentsInner>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RwLock<Weak<AgentsInner>>>>: UnsafeUnpin,
*const ArcInner<dyn ArtifactService> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ArtifactService>>: UnsafeUnpin,
*const ArcInner<dyn DurableRunStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn DurableRunStore>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.