Fold fabro-beastie into fabro-cli as internal sleep_inhibitor module

fabro-beastie had no consumers other than fabro-cli behind a feature
flag. Absorbing it as an internal module reduces workspace crate count
without changing any behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-27 15:08:55 -04:00
parent 30faaebe2f
commit 72acee6c8a
12 changed files with 11 additions and 34 deletions

11
Cargo.lock generated
View file

@ -1308,15 +1308,6 @@ dependencies = [
"x509-parser",
]
[[package]]
name = "fabro-beastie"
version = "0.176.2"
dependencies = [
"core-foundation 0.9.4",
"libc",
"tracing",
]
[[package]]
name = "fabro-cli"
version = "0.176.2"
@ -1330,13 +1321,13 @@ dependencies = [
"clap",
"cli-table",
"console 0.15.11",
"core-foundation 0.9.4",
"daytona-sdk",
"dialoguer",
"dirs",
"dotenvy",
"fabro-agent",
"fabro-api",
"fabro-beastie",
"fabro-config",
"fabro-devcontainer",
"fabro-git-storage",

View file

@ -1,18 +0,0 @@
[package]
name = "fabro-beastie"
edition.workspace = true
version.workspace = true
license.workspace = true
description = "Cross-platform idle sleep prevention (No Sleep Till Brooklyn)"
[lib]
doctest = false
[dependencies]
tracing.workspace = true
[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = "0.9"
[target.'cfg(target_os = "linux")'.dependencies]
libc = "0.2"

View file

@ -13,7 +13,7 @@ path = "src/main.rs"
default = []
server = ["dep:fabro-api"]
exedev = ["fabro-sandbox/exe", "fabro-config/exedev", "fabro-workflows/exedev"]
sleep_inhibitor = ["dep:fabro-beastie"]
sleep_inhibitor = ["dep:core-foundation"]
[dependencies]
fabro-config = { path = "../fabro-config" }
@ -33,7 +33,6 @@ fabro-graphviz = { path = "../fabro-graphviz" }
fabro-validate = { path = "../fabro-validate" }
fabro-workflows = { path = "../fabro-workflows" }
fabro-api = { path = "../fabro-api", optional = true }
fabro-beastie = { path = "../fabro-beastie", optional = true }
fabro-telemetry = { path = "../fabro-telemetry" }
fabro-util = { path = "../fabro-util" }
clap.workspace = true
@ -78,6 +77,9 @@ walkdir.workspace = true
[target.'cfg(unix)'.dependencies]
libc = "0.2"
[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = { version = "0.9", optional = true }
[build-dependencies]
chrono = { workspace = true }

View file

@ -6,7 +6,7 @@ use crate::cli_config;
pub async fn execute(mut args: fabro_agent::cli::AgentArgs, globals: &GlobalArgs) -> Result<()> {
let cli_config = cli_config::load_cli_config(None)?;
#[cfg(feature = "sleep_inhibitor")]
let _sleep_guard = fabro_beastie::guard(cli_config.prevent_idle_sleep_enabled());
let _sleep_guard = crate::sleep_inhibitor::guard(cli_config.prevent_idle_sleep_enabled());
let exec_defaults = cli_config.exec.as_ref();
args.apply_cli_defaults(
exec_defaults.and_then(|a| a.provider.as_deref()),

View file

@ -780,7 +780,7 @@ pub async fn execute(mut args: RunArgs, _globals: &GlobalArgs) -> anyhow::Result
let (run_id, run_dir) = super::create::create_run(&args, cli_defaults, styles, quiet).await?;
#[cfg(feature = "sleep_inhibitor")]
let _sleep_guard = fabro_beastie::guard(_prevent_idle_sleep);
let _sleep_guard = crate::sleep_inhibitor::guard(_prevent_idle_sleep);
let child = super::start::start_run(&run_dir, false)?;

View file

@ -68,7 +68,7 @@ pub async fn dispatch(cmd: RunCommands, globals: &GlobalArgs) -> Result<()> {
#[cfg(feature = "sleep_inhibitor")]
let _sleep_guard = {
let cli_config = crate::cli_config::load_cli_config(None)?;
fabro_beastie::guard(cli_config.prevent_idle_sleep_enabled())
crate::sleep_inhibitor::guard(cli_config.prevent_idle_sleep_enabled())
};
resume::resume_command(args, styles).await
}

View file

@ -3,6 +3,8 @@ mod cli_config;
mod commands;
mod logging;
mod shared;
#[cfg(feature = "sleep_inhibitor")]
mod sleep_inhibitor;
use anyhow::Result;
use args::*;

View file

@ -1,7 +1,7 @@
use core_foundation::base::TCFType;
use tracing::{debug, warn};
use crate::iokit_bindings::*;
use super::iokit_bindings::*;
pub(crate) struct MacOSSleepInhibitor {
assertion_id: IOPMAssertionID,