Skip to main content

forge_agent/
env.rs

1//! Live environment - git context, cwd insights, OS-side
2//! observations the agent needs but the SDK doesn't.
3//!
4//! Distinct from `userdata` (on-disk Claude state) and `cloud`
5//! (network-side talk to api.anthropic.com): `env` is local-machine
6//! state about the project the user is working on right now.
7
8pub mod cli_version;
9pub mod config_watch;
10pub mod documents;
11pub mod file_index;
12pub mod git_command;
13pub mod git_diff;
14pub mod git_state;
15pub mod lsp_path;
16pub mod processes;
17pub mod timezone;
18pub mod token_usage;
19pub mod worktree;
20
21/// Whether an event kind can change a watched path's content. A read
22/// cannot, and it matters: on inotify a read of a watched path is itself
23/// an event, so a watcher that reacts to one feeds itself.
24pub(crate) fn is_content_change(kind: notify::EventKind) -> bool {
25    use notify::EventKind;
26    use notify::event::ModifyKind;
27
28    matches!(
29        kind,
30        EventKind::Create(_)
31            | EventKind::Remove(_)
32            | EventKind::Modify(ModifyKind::Any | ModifyKind::Data(_) | ModifyKind::Name(_))
33    )
34}