1pub mod display;
11pub mod net;
12pub mod registry;
13pub mod voice;
14pub mod wait;
15
16use async_trait::async_trait;
17use glyph_types::Value;
18use thiserror::Error;
19
20#[derive(Debug, Error)]
21pub enum IntrinsicError {
22 #[error("capability not granted: {0}")]
23 CapabilityNotGranted(String),
24
25 #[error("invalid argument: {0}")]
26 InvalidArgument(String),
27
28 #[error("runtime error: {0}")]
29 RuntimeError(String),
30}
31
32#[async_trait]
33pub trait Intrinsic: Send + Sync {
34 async fn execute(&self, args: Vec<Value>) -> Result<Value, IntrinsicError>;
36
37 fn required_capability(&self) -> Option<&str>;
39}
40
41pub use registry::IntrinsicRegistry;