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
49 changes: 0 additions & 49 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,13 @@ skill-registry = { package = "agentflare-skill-registry", path = "crates/skill-r
gateway-registry = { package = "agentflare-gateway-registry", path = "crates/gateway-registry" }
flare-output = { package = "agentflare-flare-output", path = "crates/flare-output" }
regex = "1"
sysinfo = { version = "0.34", optional = true, default-features = false, features = ["system"] }
agentflare-artifacts = { path = "crates/agentflare-artifacts" }
agentflare-backend = { package = "agentflare-backend", path = "crates/agentflare-backend" }
db_kit = { package = "agentflare-db-kit", path = "crates/agentflare-db-kit" }
agent-detector = "0.2.1"
flare-search-kit = { path = "crates/flare-search-kit" }
axum = "0.8"
fs2 = "0.4"
tower-http = { version = "0.6", features = ["trace"] }
rust-embed = "8"
tokio-stream = { version = "0.1", features = ["sync"] }
agentflare-store = { path = "crates/agentflare-store" }
Expand All @@ -93,7 +91,6 @@ windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_System_

[features]
default = []
process-tree = ["sysinfo"]
# Off by default, not part of released builds: syncs Claude Code's
# skillOverrides to suppress skill descriptions from the always-on listing.
# Measured to save ~900 tokens/turn of context-window space, but that's
Expand Down
2 changes: 0 additions & 2 deletions crates/agent-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ publish = false
[dependencies]
clap = { version = "4", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
dirs = "6"

[lints.rust]
unsafe_code = "warn"
Expand Down
4 changes: 0 additions & 4 deletions crates/agentflare-artifacts/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ impl ArtifactServer {
self.port
}

pub fn url_for(&self, id: &str) -> String {
format!("http://{}:{}/{id}", self.host, self.port)
}

pub fn base_url(&self) -> String {
format!("http://{}:{}", self.host, self.port)
}
Expand Down
3 changes: 1 addition & 2 deletions crates/agentflare-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ tracing = { version = "0.1", optional = true }
ureq = { version = "2", features = ["json"], optional = true }
sha2 = { version = "0.10", optional = true }
ndarray = { version = "0.17", optional = true }
rayon = { version = "1", optional = true }
ort = { version = "=2.0.0-rc.12", optional = true, default-features = true, features = ["ndarray"] }

[features]
default = []
embeddings = ["dep:anyhow", "dep:dirs", "dep:tracing", "dep:ureq", "dep:sha2", "dep:ndarray", "dep:rayon", "dep:ort"]
embeddings = ["dep:anyhow", "dep:dirs", "dep:tracing", "dep:ureq", "dep:sha2", "dep:ndarray", "dep:ort"]

[dev-dependencies]
tempfile = "3"
58 changes: 0 additions & 58 deletions crates/agentflare-store/src/documents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,36 +336,6 @@ impl Store {
}
}

pub fn doc_hard_delete(&self, id: &str) -> rusqlite::Result<bool> {
let conn = self.conn();
let tx =
rusqlite::Transaction::new_unchecked(&conn, rusqlite::TransactionBehavior::Immediate)?;
let Some(rowid) = tx
.query_row(
"SELECT rowid FROM store_documents WHERE id = ?1",
params![id],
|row| row.get::<_, i64>(0),
)
.optional()?
else {
return Ok(false);
};

// Delete dependents before the parent row, all in one transaction.
tx.execute(
"DELETE FROM store_doc_history WHERE doc_id = ?1",
params![id],
)?;
tx.execute("DELETE FROM store_docs_vec WHERE doc_id = ?1", params![id])?;
tx.execute(
"DELETE FROM store_docs_fts WHERE rowid = ?1",
params![rowid],
)?;
tx.execute("DELETE FROM store_documents WHERE id = ?1", params![id])?;
tx.commit()?;
Ok(true)
}

pub fn doc_history(&self, doc_id: &str) -> rusqlite::Result<Vec<DocVersion>> {
let conn = self.conn();
let mut stmt = conn.prepare(
Expand All @@ -391,34 +361,6 @@ impl Store {
rows.collect()
}

pub fn doc_get_version(
&self,
doc_id: &str,
version: i32,
) -> rusqlite::Result<Option<DocVersion>> {
let conn = self.conn();
conn.query_row(
"SELECT id, doc_id, version, content, blob_hash, mime, title, metadata, size, created_at
FROM store_doc_history WHERE doc_id = ?1 AND version = ?2",
params![doc_id, version],
|row| {
Ok(DocVersion {
id: row.get(0)?,
doc_id: row.get(1)?,
version: row.get(2)?,
content: row.get(3)?,
blob_hash: row.get(4)?,
mime: row.get(5)?,
title: row.get(6)?,
metadata: row.get(7)?,
size: row.get(8)?,
created_at: row.get(9)?,
})
},
)
.optional()
}

pub fn doc_search(
&self,
project_id: &str,
Expand Down
14 changes: 0 additions & 14 deletions crates/agentflare-store/src/embedding_pipeline/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,6 @@ fn write_lockfile(model_dir: &Path, lock: &BTreeMap<String, String>) -> anyhow::
Ok(())
}

pub fn clean_model(model_dir: &Path) -> anyhow::Result<()> {
for name in ["model.onnx", "vocab.txt", "tokenizer.json", LOCKFILE] {
let path = model_dir.join(name);
if path.exists() {
std::fs::remove_file(&path)?;
}
let tmp_path = model_dir.join(format!("{name}.tmp"));
if tmp_path.exists() {
std::fs::remove_file(&tmp_path)?;
}
}
Ok(())
}

#[cfg(all(test, feature = "embeddings"))]
mod tests {
use super::*;
Expand Down
1 change: 0 additions & 1 deletion crates/flare-git-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ publish = false
[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
chrono = "0.4"
rusqlite = { version = "0.40", features = ["bundled"] }
agentflare-backend = { package = "agentflare-backend", path = "../agentflare-backend" }
agentflare-shim = { path = "../agentflare-shim" }
Expand Down
3 changes: 0 additions & 3 deletions crates/flare-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ publish = false
[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["io-util", "sync", "net", "time"] }
axum = "0.8"
tower-http = "0.6"
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "stream", "json"] }
futures = "0.3"
base64 = "0.22"
regex = "1"
thiserror = "2"
nanoid = "0.5"
10 changes: 0 additions & 10 deletions crates/flare-proxy/src/think.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ pub fn strip_think_tags(text: &str) -> (String, Vec<String>) {
(cleaned, thoughts)
}

/// Check if output needs think-tag parsing (free-tier models sometimes emit them).
pub fn needs_think_parsing(model: &str) -> bool {
let model = model.to_lowercase();
model.contains("deepseek")
|| model.contains("qwen")
|| model.contains("llama")
|| model.contains("mistral")
|| model.contains("mixtral")
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
24 changes: 0 additions & 24 deletions src/daemon.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
use fs2::FileExt;
use std::path::PathBuf;
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::Duration;

use crate::ipc::{DaemonAddr, process};

// Scaffolding for the daemon HTTP server / foreground-daemon wiring,
// landing in a follow-up PR (see task-report.md). Not reachable yet.
#[allow(dead_code)]
static IS_FOREGROUND_DAEMON: AtomicBool = AtomicBool::new(false);

pub fn daemon_pid_path() -> PathBuf {
dirs::runtime_dir()
.map(|d| d.join("agentflare").join("daemon.pid"))
Expand All @@ -22,24 +16,6 @@ pub fn daemon_start_lock_path() -> PathBuf {
.unwrap_or_else(|| std::env::temp_dir().join("agentflare-daemon.start.lock"))
}

#[allow(dead_code)]
pub fn is_foreground_daemon() -> bool {
IS_FOREGROUND_DAEMON.load(Ordering::Relaxed)
}

#[allow(dead_code)]
pub fn init_foreground_daemon() -> Result<(), String> {
IS_FOREGROUND_DAEMON.store(true, Ordering::Relaxed);
let pid_path = daemon_pid_path();
if let Some(parent) = pid_path.parent() {
std::fs::create_dir_all(parent).map_err(|e| format!("create pid dir {parent:?}: {e}"))?;
}
let pid = std::process::id();
std::fs::write(&pid_path, pid.to_string())
.map_err(|e| format!("write pid file {pid_path:?}: {e}"))?;
Ok(())
}

pub fn cleanup_daemon_files() {
let pid_path = daemon_pid_path();
let _ = std::fs::remove_file(&pid_path);
Expand Down
16 changes: 0 additions & 16 deletions src/daemon_autostart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,6 @@ pub fn start() -> Result<(), String> {
}
}

#[allow(dead_code)]
pub fn is_installed() -> bool {
#[cfg(target_os = "macos")]
{
plist_path().exists()
}
#[cfg(target_os = "linux")]
{
service_path().exists()
}
#[cfg(not(any(target_os = "macos", target_os = "linux")))]
{
false
}
}

// Both only called from the macOS LaunchAgent / Linux systemd install paths
// below, which are themselves target_os-gated -- gate the helpers to match
// so non-macOS/Linux builds (e.g. Windows) don't see them as dead code.
Expand Down
20 changes: 0 additions & 20 deletions src/daemon_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// landing in a follow-up PR (see task-report.md). Not reachable yet.
#![allow(dead_code)]

use crate::daemon::{is_daemon_running, start_daemon};
use crate::ipc::{DaemonAddr, connect};

pub fn daemon_request(
Expand Down Expand Up @@ -63,22 +62,3 @@ pub fn daemon_tool_call(addr: &DaemonAddr, tool: &str, args: &str) -> Result<Str
let body = format!(r#"{{"tool":"{tool}","args":{args}}}"#);
daemon_request(addr, "POST", "/v1/tools/call", Some(&body))
}

pub fn try_daemon_tool_call_blocking(tool: &str, args: &str) -> Result<String, String> {
if let Some(pid) = is_daemon_running() {
let addr = DaemonAddr::default_for_pid(pid);
return daemon_tool_call(&addr, tool, args);
}

let pid = start_daemon()?;
let addr = DaemonAddr::default_for_pid(pid);

for _ in 0..10 {
if daemon_health_check(&addr).is_ok() {
return daemon_tool_call(&addr, tool, args);
}
std::thread::sleep(std::time::Duration::from_millis(300));
}

Err("daemon did not become healthy".to_string())
}
Loading
Loading