refactor!: rebrand bterminal to agor (agents-orchestrator)
Rename Cargo crates (bterminal-core→agor-core, bterminal-relay→agor-relay), env vars (BTERMINAL_*→AGOR_*), config paths (~/.config/agor), CSS custom properties, plugin API object, package names, and all documentation. BREAKING CHANGE: config/data paths changed from bterminal to agor.
This commit is contained in:
parent
ef3548a569
commit
a63e6711ac
52 changed files with 3889 additions and 169 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// btmsg — Access to btmsg SQLite database
|
||||
// Database at ~/.local/share/bterminal/btmsg.db (created by btmsg CLI)
|
||||
// Database at ~/.local/share/agor/btmsg.db (created by btmsg CLI)
|
||||
// Path configurable via init() for test isolation.
|
||||
|
||||
use rusqlite::{params, Connection, OpenFlags};
|
||||
|
|
@ -19,7 +19,7 @@ fn db_path() -> PathBuf {
|
|||
DB_PATH.get().cloned().unwrap_or_else(|| {
|
||||
dirs::data_dir()
|
||||
.unwrap_or_else(|| PathBuf::from("."))
|
||||
.join("bterminal")
|
||||
.join("agor")
|
||||
.join("btmsg.db")
|
||||
})
|
||||
}
|
||||
|
|
@ -1897,7 +1897,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_checkpoint_wal_nonexistent_db_is_ok() {
|
||||
let result = crate::checkpoint_wal(std::path::Path::new("/tmp/nonexistent_bterminal_test.db"));
|
||||
let result = crate::checkpoint_wal(std::path::Path::new("/tmp/nonexistent_agor_test.db"));
|
||||
assert!(result.is_ok(), "checkpoint_wal should return Ok for missing DB");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ fn db_path() -> PathBuf {
|
|||
DB_PATH.get().cloned().unwrap_or_else(|| {
|
||||
dirs::data_dir()
|
||||
.unwrap_or_else(|| PathBuf::from("."))
|
||||
.join("bterminal")
|
||||
.join("agor")
|
||||
.join("btmsg.db")
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use tauri::State;
|
||||
use crate::AppState;
|
||||
use crate::sidecar::AgentQueryOptions;
|
||||
use bterminal_core::sandbox::SandboxConfig;
|
||||
use agor_core::sandbox::SandboxConfig;
|
||||
|
||||
#[tauri::command]
|
||||
#[tracing::instrument(skip(state, options), fields(session_id = %options.session_id))]
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ pub fn open_url(url: String) -> Result<(), String> {
|
|||
|
||||
#[tauri::command]
|
||||
pub fn is_test_mode() -> bool {
|
||||
std::env::var("BTERMINAL_TEST").map_or(false, |v| v == "1")
|
||||
std::env::var("AGOR_TEST").map_or(false, |v| v == "1")
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use bterminal_core::event::EventSink;
|
||||
use agor_core::event::EventSink;
|
||||
use tauri::{AppHandle, Emitter};
|
||||
|
||||
/// Bridges bterminal-core's EventSink trait to Tauri's event system.
|
||||
/// Bridges agor-core's EventSink trait to Tauri's event system.
|
||||
pub struct TauriEventSink(pub AppHandle);
|
||||
|
||||
impl EventSink for TauriEventSink {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ impl ProjectFsWatcher {
|
|||
cwd: &str,
|
||||
) -> Result<(), String> {
|
||||
// In test mode, skip inotify watchers to avoid resource contention and flaky events
|
||||
if std::env::var("BTERMINAL_TEST").map_or(false, |v| v == "1") {
|
||||
if std::env::var("AGOR_TEST").map_or(false, |v| v == "1") {
|
||||
log::info!("Test mode: skipping fs watcher for project {project_id}");
|
||||
return Ok(());
|
||||
}
|
||||
|
|
@ -333,7 +333,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_count_watched_dirs_tempdir() {
|
||||
let tmp = std::env::temp_dir().join("bterminal_test_count_dirs");
|
||||
let tmp = std::env::temp_dir().join("agor_test_count_dirs");
|
||||
let _ = std::fs::remove_dir_all(&tmp);
|
||||
std::fs::create_dir_all(tmp.join("src/lib")).unwrap();
|
||||
std::fs::create_dir_all(tmp.join("node_modules/pkg")).unwrap(); // should be skipped
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Project group configuration
|
||||
// Reads/writes ~/.config/bterminal/groups.json
|
||||
// Reads/writes ~/.config/agor/groups.json
|
||||
// Path configurable via init() for test isolation.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
@ -99,7 +99,7 @@ fn config_path() -> PathBuf {
|
|||
CONFIG_PATH.get().cloned().unwrap_or_else(|| {
|
||||
dirs::config_dir()
|
||||
.unwrap_or_else(|| PathBuf::from("."))
|
||||
.join("bterminal")
|
||||
.join("agor")
|
||||
.join("groups.json")
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ mod session;
|
|||
mod telemetry;
|
||||
mod watcher;
|
||||
|
||||
use bterminal_core::config::AppConfig;
|
||||
use agor_core::config::AppConfig;
|
||||
use event_sink::TauriEventSink;
|
||||
use pty::PtyManager;
|
||||
use remote::RemoteManager;
|
||||
|
|
@ -145,7 +145,7 @@ pub fn run() {
|
|||
// Force dark GTK theme for native dialogs (file chooser, etc.)
|
||||
std::env::set_var("GTK_THEME", "Adwaita:dark");
|
||||
|
||||
// Resolve all paths via AppConfig (respects BTERMINAL_TEST_* env vars)
|
||||
// Resolve all paths via AppConfig (respects AGOR_TEST_* env vars)
|
||||
let app_config = AppConfig::from_env();
|
||||
if app_config.is_test_mode() {
|
||||
log::info!(
|
||||
|
|
@ -319,6 +319,8 @@ pub fn run() {
|
|||
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.setup(move |app| {
|
||||
#[cfg(feature = "pro")]
|
||||
app.handle().plugin(agor_pro::init())?;
|
||||
// Note: tauri-plugin-log is NOT initialized here because telemetry::init()
|
||||
// already sets up tracing-subscriber (which bridges the `log` crate via
|
||||
// tracing's compatibility layer). Adding plugin-log would panic with
|
||||
|
|
@ -327,7 +329,7 @@ pub fn run() {
|
|||
let config = app_config_arc.clone();
|
||||
|
||||
// Create TauriEventSink for core managers
|
||||
let sink: Arc<dyn bterminal_core::event::EventSink> =
|
||||
let sink: Arc<dyn agor_core::event::EventSink> =
|
||||
Arc::new(TauriEventSink(app.handle().clone()));
|
||||
|
||||
// Build sidecar config from Tauri paths
|
||||
|
|
@ -351,12 +353,12 @@ pub fn run() {
|
|||
// Forward test mode env vars to sidecar processes
|
||||
let mut env_overrides = std::collections::HashMap::new();
|
||||
if config.is_test_mode() {
|
||||
env_overrides.insert("BTERMINAL_TEST".into(), "1".into());
|
||||
if let Ok(v) = std::env::var("BTERMINAL_TEST_DATA_DIR") {
|
||||
env_overrides.insert("BTERMINAL_TEST_DATA_DIR".into(), v);
|
||||
env_overrides.insert("AGOR_TEST".into(), "1".into());
|
||||
if let Ok(v) = std::env::var("AGOR_TEST_DATA_DIR") {
|
||||
env_overrides.insert("AGOR_TEST_DATA_DIR".into(), v);
|
||||
}
|
||||
if let Ok(v) = std::env::var("BTERMINAL_TEST_CONFIG_DIR") {
|
||||
env_overrides.insert("BTERMINAL_TEST_CONFIG_DIR".into(), v);
|
||||
if let Ok(v) = std::env::var("AGOR_TEST_CONFIG_DIR") {
|
||||
env_overrides.insert("AGOR_TEST_CONFIG_DIR".into(), v);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -366,7 +368,7 @@ pub fn run() {
|
|||
dev_root.join("sidecar"),
|
||||
],
|
||||
env_overrides,
|
||||
sandbox: bterminal_core::sandbox::SandboxConfig::default(),
|
||||
sandbox: agor_core::sandbox::SandboxConfig::default(),
|
||||
};
|
||||
|
||||
let pty_manager = Arc::new(PtyManager::new(sink.clone()));
|
||||
|
|
@ -384,7 +386,7 @@ pub fn run() {
|
|||
let remote_manager = Arc::new(RemoteManager::new());
|
||||
|
||||
// Initialize FTS5 search database
|
||||
let search_db_path = config.data_dir.join("bterminal").join("search.db");
|
||||
let search_db_path = config.data_dir.join("agor").join("search.db");
|
||||
let search_db = Arc::new(
|
||||
search::SearchDb::open(&search_db_path).expect("Failed to open search database"),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ pub fn send_desktop_notification(
|
|||
match Notification::new()
|
||||
.summary(title)
|
||||
.body(body)
|
||||
.appname("BTerminal")
|
||||
.appname("Agents Orchestrator")
|
||||
.urgency(urgency_level)
|
||||
.show()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Plugin discovery and file reading.
|
||||
// Scans ~/.config/bterminal/plugins/ for plugin.json manifest files.
|
||||
// Scans ~/.config/agor/plugins/ for plugin.json manifest files.
|
||||
// Each plugin lives in its own subdirectory with a plugin.json manifest.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Thin wrapper — re-exports bterminal_core::pty types.
|
||||
// PtyManager is now in bterminal-core; this module only re-exports for lib.rs.
|
||||
// Thin wrapper — re-exports agor_core::pty types.
|
||||
// PtyManager is now in agor-core; this module only re-exports for lib.rs.
|
||||
|
||||
pub use bterminal_core::pty::{PtyManager, PtyOptions};
|
||||
pub use agor_core::pty::{PtyManager, PtyOptions};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// Remote machine management — WebSocket client connections to bterminal-relay instances
|
||||
// Remote machine management — WebSocket client connections to agor-relay instances
|
||||
|
||||
use bterminal_core::pty::PtyOptions;
|
||||
use bterminal_core::sidecar::AgentQueryOptions;
|
||||
use agor_core::pty::PtyOptions;
|
||||
use agor_core::sidecar::AgentQueryOptions;
|
||||
use futures_util::{SinkExt, StreamExt};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha2::{Sha256, Digest};
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
use keyring::Entry;
|
||||
|
||||
const SERVICE: &str = "bterminal";
|
||||
const SERVICE: &str = "agor";
|
||||
const KEYS_META: &str = "__bterminal_keys__";
|
||||
|
||||
/// Known secret key identifiers.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Thin wrapper — re-exports bterminal_core::sidecar types.
|
||||
// SidecarManager is now in bterminal-core; this module only re-exports for lib.rs.
|
||||
// Thin wrapper — re-exports agor_core::sidecar types.
|
||||
// SidecarManager is now in agor-core; this module only re-exports for lib.rs.
|
||||
|
||||
pub use bterminal_core::sidecar::{AgentQueryOptions, SidecarConfig, SidecarManager};
|
||||
pub use agor_core::sidecar::{AgentQueryOptions, SidecarConfig, SidecarManager};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// OpenTelemetry telemetry — tracing spans + OTLP export to Tempo/Grafana
|
||||
//
|
||||
// Controlled by BTERMINAL_OTLP_ENDPOINT env var:
|
||||
// Controlled by AGOR_OTLP_ENDPOINT env var:
|
||||
// - Set (e.g. "http://localhost:4318") → export traces via OTLP/HTTP + console
|
||||
// - Absent → console-only (no network calls)
|
||||
|
||||
|
|
@ -28,16 +28,16 @@ impl Drop for TelemetryGuard {
|
|||
/// Call once at app startup, before any tracing macros fire.
|
||||
pub fn init() -> TelemetryGuard {
|
||||
let filter = EnvFilter::try_from_default_env()
|
||||
.unwrap_or_else(|_| EnvFilter::new("agent_orchestrator=info,agent_orchestrator_lib=info,bterminal_core=info"));
|
||||
.unwrap_or_else(|_| EnvFilter::new("agent_orchestrator=info,agent_orchestrator_lib=info,agor_core=info"));
|
||||
|
||||
let fmt_layer = tracing_subscriber::fmt::layer()
|
||||
.with_target(true)
|
||||
.compact();
|
||||
|
||||
// In test mode, never export telemetry (avoid contaminating production data)
|
||||
let is_test = std::env::var("BTERMINAL_TEST").map_or(false, |v| v == "1");
|
||||
let is_test = std::env::var("AGOR_TEST").map_or(false, |v| v == "1");
|
||||
|
||||
match std::env::var("BTERMINAL_OTLP_ENDPOINT") {
|
||||
match std::env::var("AGOR_OTLP_ENDPOINT") {
|
||||
Ok(endpoint) if !endpoint.is_empty() && !is_test => {
|
||||
match build_otlp_provider(&endpoint) {
|
||||
Ok(provider) => {
|
||||
|
|
@ -71,7 +71,7 @@ pub fn init() -> TelemetryGuard {
|
|||
.with(fmt_layer)
|
||||
.init();
|
||||
|
||||
log::info!("Telemetry: console-only (BTERMINAL_OTLP_ENDPOINT not set)");
|
||||
log::info!("Telemetry: console-only (AGOR_OTLP_ENDPOINT not set)");
|
||||
TelemetryGuard { provider: None }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ impl FileWatcherManager {
|
|||
path: &str,
|
||||
) -> Result<String, String> {
|
||||
// In test mode, skip file watching to avoid inotify noise and flaky events
|
||||
if std::env::var("BTERMINAL_TEST").map_or(false, |v| v == "1") {
|
||||
if std::env::var("AGOR_TEST").map_or(false, |v| v == "1") {
|
||||
return std::fs::read_to_string(path)
|
||||
.map_err(|e| format!("Failed to read file: {e}"));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue