Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
377 changes: 219 additions & 158 deletions src/apps/cli/src/agent/core_adapter.rs

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions src/apps/cli/src/agent/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/// Agent integration module
///
///
/// Wraps interaction with bitfun-core's Agent system


pub mod agentic_system;
pub mod core_adapter;

Expand All @@ -24,10 +22,7 @@ pub enum AgentEvent {
parameters: serde_json::Value,
},
/// Tool call in progress
ToolCallProgress {
tool_name: String,
message: String,
},
ToolCallProgress { tool_name: String, message: String },
/// Tool call completed
ToolCallComplete {
tool_name: String,
Expand Down
16 changes: 6 additions & 10 deletions src/apps/cli/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/// Configuration management module
///
///
/// CLI uses core's GlobalConfig system directly (same as tauri version)
/// Only CLI-specific configuration is kept here (UI, shortcuts, etc.)

use anyhow::Result;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use std::fs;
use std::path::PathBuf;

/// CLI configuration (contains only CLI-specific config)
/// AI model configuration uses core's GlobalConfig
Expand Down Expand Up @@ -107,14 +106,14 @@ impl CliConfig {
.join(".config")
.join("bitfun")
};

Ok(config_dir.join("config.toml"))
}

/// Load configuration
pub fn load() -> Result<Self> {
let config_path = Self::config_path()?;

if !config_path.exists() {
tracing::info!("Config file not found, using defaults");
let config = Self::default();
Expand All @@ -131,7 +130,7 @@ impl CliConfig {
/// Save configuration
pub fn save(&self) -> Result<()> {
let config_path = Self::config_path()?;

if let Some(parent) = config_path.parent() {
fs::create_dir_all(parent)?;
}
Expand All @@ -154,7 +153,7 @@ impl CliConfig {
.join(".config")
.join("bitfun")
};

fs::create_dir_all(&config_dir)?;
Ok(config_dir)
}
Expand All @@ -165,7 +164,4 @@ impl CliConfig {
fs::create_dir_all(&sessions_dir)?;
Ok(sessions_dir)
}

}


Loading
Loading