rohas_runtime/
lib.rs

1pub mod error;
2pub mod executor;
3pub mod handler;
4pub mod node_runtime;
5pub mod python_runtime;
6pub mod rust_runtime;
7
8pub use error::{Result, RuntimeError};
9pub use executor::Executor;
10pub use handler::{Handler, HandlerContext, HandlerResult};
11pub use rust_runtime::RustRuntime;
12
13#[derive(Debug, Clone)]
14pub struct RuntimeConfig {
15    pub language: Language,
16    pub project_root: std::path::PathBuf,
17    pub timeout_seconds: u64,
18}
19
20impl Default for RuntimeConfig {
21    fn default() -> Self {
22        Self {
23            language: Language::TypeScript,
24            project_root: std::env::current_dir().unwrap_or_default(),
25            timeout_seconds: 30,
26        }
27    }
28}
29
30#[derive(Debug, Clone, Copy, PartialEq, Eq)]
31pub enum Language {
32    TypeScript,
33    Python,
34    Rust,
35}
36
37impl Language {
38    pub fn as_str(&self) -> &'static str {
39        match self {
40            Language::TypeScript => "typescript",
41            Language::Python => "python",
42            Language::Rust => "rust",
43        }
44    }
45
46    pub fn file_extension(&self) -> &'static str {
47        match self {
48            Language::TypeScript => "ts",
49            Language::Python => "py",
50            Language::Rust => "rs",
51        }
52    }
53}