Skip to main content

astrid_core/
lib.rs

1//! Astrid Core - Foundation types for the Astrid secure agent runtime.
2//!
3//! This crate provides:
4//! - Identity management across platforms
5//! - Uplink types for capsule integration
6//! - Approval and elicitation primitives
7//! - Common types used throughout the runtime
8//! - Retry configuration with exponential backoff
9
10#![deny(unsafe_code)]
11#![deny(missing_docs)]
12#![deny(clippy::all)]
13#![deny(unreachable_pub)]
14#![deny(clippy::unwrap_used)]
15#![cfg_attr(test, allow(clippy::unwrap_used))]
16
17pub mod prelude;
18
19pub mod capability_grammar;
20pub mod dirs;
21pub mod elicitation;
22pub mod env_policy;
23pub mod groups;
24pub mod identity;
25pub mod kernel_api;
26pub mod principal;
27pub mod profile;
28pub mod retry;
29pub mod session_token;
30pub mod types;
31pub mod uplink;
32pub(crate) mod utils;
33
34pub use capability_grammar::{
35    CAP_NET_BIND, CAP_RESOURCES_UNBOUNDED, CAP_UPLINK, CapabilityGrammarError, EXEMPT_CAPABILITIES,
36    MAX_CAPABILITY_LEN, capability_matches, validate_capability,
37};
38pub use elicitation::{
39    ElicitationAction, ElicitationRequest, ElicitationResponse, ElicitationSchema, SelectOption,
40    UrlElicitationRequest, UrlElicitationResponse, UrlElicitationType,
41};
42pub use groups::{
43    BUILTIN_ADMIN, BUILTIN_AGENT, BUILTIN_RESTRICTED, Group, GroupConfig, GroupConfigError,
44    GroupConfigResult,
45};
46pub use principal::{PrincipalId, PrincipalIdError};
47pub use profile::{
48    AuthConfig, AuthMethod, BACKGROUND_PROCESSES_UPPER_BOUND, CURRENT_PROFILE_VERSION,
49    DEFAULT_MAX_BACKGROUND_PROCESSES, DEFAULT_MAX_IPC_THROUGHPUT_BYTES, DEFAULT_MAX_MEMORY_BYTES,
50    DEFAULT_MAX_STORAGE_BYTES, DEFAULT_MAX_TIMEOUT_SECS, MAX_GROUP_NAME_LEN, NetworkConfig,
51    PrincipalProfile, ProcessConfig, ProfileError, ProfileResult, Quotas, TIMEOUT_SECS_UPPER_BOUND,
52};
53pub use retry::RetryConfig;
54pub use types::{
55    AgentId, ApprovalDecision, ApprovalOption, ApprovalRequest, Permission, SessionId, Timestamp,
56    TokenId,
57};
58pub use utils::truncate_to_boundary;
59
60// Identity types
61pub use identity::{AstridUserId, FrontendLink, normalize_platform};
62
63// Uplink types
64pub use uplink::{
65    InboundMessage, MAX_UPLINKS_PER_CAPSULE, UplinkCapabilities, UplinkDescriptor, UplinkError,
66    UplinkId, UplinkProfile, UplinkResult, UplinkSource,
67};