pub struct ServerConfig {Show 27 fields
pub state_dir: PathBuf,
pub listen: SocketAddr,
pub octoprint: OctoPrintConfig,
pub safety: SafetyEnvelope,
pub harness: HarnessIdentity,
pub model: Option<ModelName>,
pub skill_path: PathBuf,
pub prompt_template_path: Option<PathBuf>,
pub observation_interval: Duration,
pub printer_poll: Duration,
pub unattended_window: Duration,
pub auto_compact_tokens: Option<NonZeroU64>,
pub idle_compact_tokens: Option<NonZeroU64>,
pub blank_frame_max_stddev: BlankFrameBound,
pub obico_ml_api_url: Option<WebAddress>,
pub obico_printer_id: Option<ObicoPrinterId>,
pub ingress_answer_bound: Duration,
pub ingress_shared_secret: SharedSecret,
pub api_credential: Option<ApiCredential>,
pub api_credential_verifier: Option<CredentialVerifier>,
pub camera_snapshot_url: Option<WebAddress>,
pub camera_calibration: Option<Arc<CameraCalibration>>,
pub obico_api: Option<ObicoApi>,
pub spools: SpoolPolicy,
pub sheets: SheetTable,
pub recovery: Option<RecoveryConfig>,
pub recovery_grants: RecoveryGrants,
}Expand description
One running server’s validated configuration.
Every value here is one no later step has to re-examine, and where a
validated type for one already exists it is that type rather than the text
it was written as: the OctoPrint instance is the adapter’s own
configuration, which redacts the key it carries; the harness and the model
are the supervisor adapter’s own names; and the ingress secret is a value
neither rendering of which shows.
Fields§
§state_dir: PathBufWhere the store, the images and the sessions live.
listen: SocketAddrThe address the API and the ingress are served on.
octoprint: OctoPrintConfigEverything the printer adapter needs to reach the instance.
safety: SafetyEnvelopeThe operator’s safety envelope.
harness: HarnessIdentityThe harness identity turns run on.
model: Option<ModelName>The model turns are pinned to, when one is pinned.
skill_path: PathBufThe installed skill’s SKILL.md, whose prose is sent as every turn’s
system prompt. The agent runs from the directory holding it, which is
where the skill’s own reference/ documents sit.
prompt_template_path: Option<PathBuf>The prompt template one turn fills, when the operator supplied one.
observation_interval: DurationHow often every active print is given a periodic observation.
printer_poll: DurationHow often the printer watch reads the machine.
unattended_window: DurationHow long after an unfinished ending the printer acting on its own is recorded.
auto_compact_tokens: Option<NonZeroU64>The conversation size at which the harness compacts a session during a turn, when one is set.
idle_compact_tokens: Option<NonZeroU64>The conversation size at or above which a session is compacted while idle, when one is set.
blank_frame_max_stddev: BlankFrameBoundThe grey-level spread at or below which a camera frame is blank.
obico_ml_api_url: Option<WebAddress>Where the failure detector’s own service answers its health check, when configured.
obico_printer_id: Option<ObicoPrinterId>Which of Obico’s printers its record of the print is read from, when
configured.
ingress_answer_bound: DurationHow long the ingress may take to answer.
The shared secret every post to the ingress must carry.
api_credential: Option<ApiCredential>A plaintext operator credential the configuration still carries, which is admitted — with a warning on every start — until it is replaced by its verifier.
api_credential_verifier: Option<CredentialVerifier>The verifier the operator’s credential is checked against, when the configuration names one. Absent, the composition root reads the one in the state directory.
camera_snapshot_url: Option<WebAddress>Where a fresh frame of the print is fetched from, when configured.
camera_calibration: Option<Arc<CameraCalibration>>The camera’s calibration, read and validated at start, when one is configured.
obico_api: Option<ObicoApi>Obico’s own API, when configured; its debug form omits the token.
spools: SpoolPolicyHow spools are checked before a print, and the margin asked for.
sheets: SheetTableWhich build sheets each material may be printed on.
recovery: Option<RecoveryConfig>The printer’s own facts a recovery is checked against, when stated.
recovery_grants: RecoveryGrantsWho may ask for which recovery action.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self, ConfigError>
pub fn load(path: impl AsRef<Path>) -> Result<Self, ConfigError>
Read and validate the one configuration file this program takes.
§Errors
Returns ConfigError::Unreadable when the file is not there,
ConfigError::Unparsable when it is not this program’s configuration,
and ConfigError::Field naming the one field whose value cannot be
accepted. The two values only the machine can rule on — the OctoPrint
address and key — are ruled on by crate::Server::start, which is
where a printer exists to ask.
Sourcepub fn parse(text: &str, path: &Path) -> Result<Self, ConfigError>
pub fn parse(text: &str, path: &Path) -> Result<Self, ConfigError>
The same, over a document already read.
§Errors
The same as ServerConfig::load, less the unreadable file.
Sourcepub fn assets_dir(&self) -> PathBuf
pub fn assets_dir(&self) -> PathBuf
Where this server materializes the agent’s prompt template and
assessment schema. The skill is not among them: it is the installed one
skill_path names.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl PartialEq for ServerConfig
impl PartialEq for ServerConfig
impl StructuralPartialEq for ServerConfig
Auto Trait Implementations§
impl Forget for ServerConfig
impl Freeze for ServerConfigwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<Adjustable, Range> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(Adjustable, Range)>>: Freeze,
*const LeafNode<ActorClass, Vec<ActionKind>> is !null: Freeze,
PhantomData<Box<(ActorClass, Vec<ActionKind>)>>: Freeze,
NonZero<u64>: Freeze,
*const ArcInner<CameraCalibration> is !null: Freeze,
PhantomData<ArcInner<CameraCalibration>>: Freeze,
*const LeafNode<MaterialName, Vec<SheetId>> is !null: Freeze,
PhantomData<Box<(MaterialName, Vec<SheetId>)>>: Freeze,
PhantomData<RecoveryActionKind>: Freeze,
PhantomData<ActorClass>: Freeze,
impl Move for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfigwhere
RawVecInner: Send,
NodeRef<Owned, Adjustable, Range, LeafOrInternal>: Send,
BoxRaw<(Adjustable, Range)>: Send,
NodeRef<Owned, ActorClass, Vec<ActionKind>, LeafOrInternal>: Send,
BoxRaw<(ActorClass, Vec<ActionKind>)>: Send,
NonZero<u64>: Send,
Arc<CameraCalibration>: Send,
NodeRef<Owned, MaterialName, Vec<SheetId>, LeafOrInternal>: Send,
BoxRaw<(MaterialName, Vec<SheetId>)>: Send,
impl Sync for ServerConfigwhere
RawVecInner: Sync,
NodeRef<Owned, Adjustable, Range, LeafOrInternal>: Sync,
BoxRaw<(Adjustable, Range)>: Sync,
NodeRef<Owned, ActorClass, Vec<ActionKind>, LeafOrInternal>: Sync,
BoxRaw<(ActorClass, Vec<ActionKind>)>: Sync,
NonZero<u64>: Sync,
Arc<CameraCalibration>: Sync,
NodeRef<Owned, MaterialName, Vec<SheetId>, LeafOrInternal>: Sync,
BoxRaw<(MaterialName, Vec<SheetId>)>: Sync,
impl Unpin for ServerConfigwhere
*const u8 is !null: Unpin,
*const LeafNode<Adjustable, Range> is !null: Unpin,
Box<(Adjustable, Range)>: Unpin,
*const LeafNode<ActorClass, Vec<ActionKind>> is !null: Unpin,
Box<(ActorClass, Vec<ActionKind>)>: Unpin,
NonZero<u64>: Unpin,
Arc<CameraCalibration>: Unpin,
*const LeafNode<MaterialName, Vec<SheetId>> is !null: Unpin,
Box<(MaterialName, Vec<SheetId>)>: Unpin,
impl UnsafeUnpin for ServerConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<Adjustable, Range> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(Adjustable, Range)>>: UnsafeUnpin,
*const LeafNode<ActorClass, Vec<ActionKind>> is !null: UnsafeUnpin,
PhantomData<Box<(ActorClass, Vec<ActionKind>)>>: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
*const ArcInner<CameraCalibration> is !null: UnsafeUnpin,
PhantomData<ArcInner<CameraCalibration>>: UnsafeUnpin,
*const LeafNode<MaterialName, Vec<SheetId>> is !null: UnsafeUnpin,
PhantomData<Box<(MaterialName, Vec<SheetId>)>>: UnsafeUnpin,
PhantomData<RecoveryActionKind>: UnsafeUnpin,
PhantomData<ActorClass>: UnsafeUnpin,
impl UnwindSafe for ServerConfigwhere
RawVecInner: UnwindSafe,
BTreeMap<Adjustable, Range>: UnwindSafe,
BTreeMap<ActorClass, Vec<ActionKind>>: UnwindSafe,
NonZero<u64>: UnwindSafe,
Arc<CameraCalibration>: UnwindSafe,
BTreeMap<MaterialName, Vec<SheetId>>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
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.