pub struct ServerConfig {Show 23 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 blank_frame_max_stddev: BlankFrameBound,
pub obico_ml_api_url: Option<WebAddress>,
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 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.
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.
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.
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 ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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,
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