- 22 AI providers (OpenRouter, Anthropic, OpenAI, Mistral, etc.) - 7 channels (CLI, Telegram, Discord, Slack, iMessage, Matrix, Webhook) - 5-step onboarding wizard with Project Context personalization - OpenClaw-aligned system prompt (SOUL.md, IDENTITY.md, USER.md, AGENTS.md, etc.) - SQLite memory backend with auto-save - Skills system with on-demand loading - Security: autonomy levels, command allowlists, cost limits - 532 tests passing, 0 clippy warnings
72 lines
1.5 KiB
Rust
72 lines
1.5 KiB
Rust
use super::traits::RuntimeAdapter;
|
|
use std::path::PathBuf;
|
|
|
|
/// Native runtime — full access, runs on Mac/Linux/Docker/Raspberry Pi
|
|
pub struct NativeRuntime;
|
|
|
|
impl NativeRuntime {
|
|
pub fn new() -> Self {
|
|
Self
|
|
}
|
|
}
|
|
|
|
impl RuntimeAdapter for NativeRuntime {
|
|
fn name(&self) -> &str {
|
|
"native"
|
|
}
|
|
|
|
fn has_shell_access(&self) -> bool {
|
|
true
|
|
}
|
|
|
|
fn has_filesystem_access(&self) -> bool {
|
|
true
|
|
}
|
|
|
|
fn storage_path(&self) -> PathBuf {
|
|
directories::UserDirs::new().map_or_else(
|
|
|| PathBuf::from(".zeroclaw"),
|
|
|u| u.home_dir().join(".zeroclaw"),
|
|
)
|
|
}
|
|
|
|
fn supports_long_running(&self) -> bool {
|
|
true
|
|
}
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::*;
|
|
|
|
#[test]
|
|
fn native_name() {
|
|
assert_eq!(NativeRuntime::new().name(), "native");
|
|
}
|
|
|
|
#[test]
|
|
fn native_has_shell_access() {
|
|
assert!(NativeRuntime::new().has_shell_access());
|
|
}
|
|
|
|
#[test]
|
|
fn native_has_filesystem_access() {
|
|
assert!(NativeRuntime::new().has_filesystem_access());
|
|
}
|
|
|
|
#[test]
|
|
fn native_supports_long_running() {
|
|
assert!(NativeRuntime::new().supports_long_running());
|
|
}
|
|
|
|
#[test]
|
|
fn native_memory_budget_unlimited() {
|
|
assert_eq!(NativeRuntime::new().memory_budget(), 0);
|
|
}
|
|
|
|
#[test]
|
|
fn native_storage_path_contains_zeroclaw() {
|
|
let path = NativeRuntime::new().storage_path();
|
|
assert!(path.to_string_lossy().contains("zeroclaw"));
|
|
}
|
|
}
|