Application Framework
AppManifest structure, agent/tool/service specs, app lifecycle management, and CLI commands for WeftOS applications.
The application framework provides manifest-based packaging and lifecycle management for agent applications via weftapp.toml.
Source: crates/clawft-kernel/src/app.rs (~980 lines)
AppManifest
pub struct AppManifest {
pub name: String,
pub version: String,
pub description: Option<String>,
pub agents: Vec<AgentSpec>,
pub services: Vec<ServiceSpec>,
pub tools: Vec<ToolSpec>,
pub capabilities: AppCapabilities,
pub hooks: AppHooks,
}Component Specs
pub struct AgentSpec {
pub name: String,
pub agent_type: String,
pub capabilities: AgentCapabilities,
pub resource_limits: ResourceLimits,
}
pub struct ToolSpec {
pub name: String,
pub source: ToolSource, // Native, Wasm { module_path }, Api { endpoint }
pub description: String,
}App Lifecycle
pub enum AppState {
Installed, Starting, Running, Stopping, Stopped, Failed,
}AppManager API
impl AppManager {
pub fn install(&self, manifest: AppManifest) -> Result<(), AppError>;
pub fn start(&self, name: &str) -> Result<(), AppError>;
pub fn stop(&self, name: &str) -> Result<(), AppError>;
pub fn uninstall(&self, name: &str) -> Result<(), AppError>;
pub fn list(&self) -> Vec<(String, InstalledApp)>;
}Agent Spawning
When an app starts, the AppManager creates SpawnRequest entries from each AgentSpec, spawns through the AgentSupervisor, registers services, loads tools, and registers under /apps/{name}.
CLI
weft app list | install <manifest> | start <name> | stop <name> | uninstall <name>Container Integration
ContainerManager lifecycle, ContainerConfig validation, ContainerState state machine, health check propagation, and port mapping.
Self-Healing Supervisor
Erlang-inspired restart strategies, budget tracking, exponential backoff, and process supervision for fault-tolerant agent management.