swap hive-claude to the crates.io registry dependency (#2931)

This commit is contained in:
damocles 2026-08-02 13:55:26 +02:00 committed by mara
commit 42fdd98a7a
4 changed files with 26 additions and 21 deletions

15
Cargo.lock generated
View file

@ -1170,7 +1170,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -1687,7 +1687,8 @@ dependencies = [
[[package]] [[package]]
name = "hive-claude" name = "hive-claude"
version = "0.1.0" version = "0.1.0"
source = "git+https://forge.darkest.space/hyperhive/hive-claude?branch=main#4ee1940e91b0f713f1767fc5ba84426a82d562f8" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d540ef2338fc071b60e69cac345cb5ec04627c4ef11c49138d1c39d4f687f254"
dependencies = [ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
@ -3409,7 +3410,7 @@ dependencies = [
"once_cell", "once_cell",
"socket2", "socket2",
"tracing", "tracing",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -3982,7 +3983,7 @@ dependencies = [
"errno", "errno",
"libc", "libc",
"linux-raw-sys", "linux-raw-sys",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -4041,7 +4042,7 @@ dependencies = [
"security-framework", "security-framework",
"security-framework-sys", "security-framework-sys",
"webpki-root-certs", "webpki-root-certs",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -4532,7 +4533,7 @@ dependencies = [
"getrandom 0.4.3", "getrandom 0.4.3",
"once_cell", "once_cell",
"rustix", "rustix",
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -5360,7 +5361,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.52.0",
] ]
[[package]] [[package]]

View file

@ -57,7 +57,7 @@ hive-sh4re = { path = "hive-sh4re" }
hive-agent-sock = { path = "hive-agent-sock" } hive-agent-sock = { path = "hive-agent-sock" }
hive-jobq = { path = "hive-jobq" } hive-jobq = { path = "hive-jobq" }
hive-core-agent-sock = { path = "hive-core-agent-sock" } hive-core-agent-sock = { path = "hive-core-agent-sock" }
hive-claude = { git = "https://forge.darkest.space/hyperhive/hive-claude", branch = "main" } hive-claude = "0.1"
hive-host-sock = { path = "hive-host-sock" } hive-host-sock = { path = "hive-host-sock" }
hive-priv-sock = { path = "hive-priv-sock" } hive-priv-sock = { path = "hive-priv-sock" }
hive-sock-client = { path = "hive-sock-client" } hive-sock-client = { path = "hive-sock-client" }

View file

@ -572,7 +572,7 @@ fn claude_config(bus: &Bus, files: &TurnFiles) -> Config {
state_dir.is_dir().then_some(state_dir) state_dir.is_dir().then_some(state_dir)
}; };
Config { Config {
model: bus.model(), model: Some(bus.model()),
effort: Some(bus.effort()), effort: Some(bus.effort()),
cwd, cwd,
system_prompt_file: Some(files.system_prompt.clone()), system_prompt_file: Some(files.system_prompt.clone()),

View file

@ -299,18 +299,22 @@ impl TurnStats {
let g = |i: usize| -> rusqlite::Result<u64> { let g = |i: usize| -> rusqlite::Result<u64> {
Ok(u64::try_from(row.get::<_, i64>(i)?).unwrap_or(0)) Ok(u64::try_from(row.get::<_, i64>(i)?).unwrap_or(0))
}; };
let cost = hive_claude::TokenUsage { // `TokenUsage` is `#[non_exhaustive]` (hive-claude 0.1.0+) —
input_tokens: g(0)?, // struct-expression construction is blocked for downstream
output_tokens: g(1)?, // crates entirely, even with a `..base` (functional update
cache_read_input_tokens: g(2)?, // doesn't carve out an exception, per the non_exhaustive
cache_creation_input_tokens: g(3)?, // reference semantics). Build off `Default` and assign the
}; // (all-`pub`) fields instead.
let last = hive_claude::TokenUsage { let mut cost = hive_claude::TokenUsage::default();
input_tokens: g(4)?, cost.input_tokens = g(0)?;
output_tokens: g(5)?, cost.output_tokens = g(1)?;
cache_read_input_tokens: g(6)?, cost.cache_read_input_tokens = g(2)?;
cache_creation_input_tokens: g(7)?, cost.cache_creation_input_tokens = g(3)?;
}; let mut last = hive_claude::TokenUsage::default();
last.input_tokens = g(4)?;
last.output_tokens = g(5)?;
last.cache_read_input_tokens = g(6)?;
last.cache_creation_input_tokens = g(7)?;
let ctx = if last == hive_claude::TokenUsage::default() { let ctx = if last == hive_claude::TokenUsage::default() {
None None
} else { } else {