Skip to main content

harness_glob/
lib.rs

1//! Glob tool — Rust port of `@agent-sh/harness-glob`.
2//!
3//! Conforms to `agent-knowledge/design/glob.md` (language-neutral spec).
4//! Same two-stage pipeline as the TS version: `ignore` walker for
5//! gitignore-respecting enumeration, then in-process `globset` match
6//! with bash-glob semantics.
7
8mod constants;
9mod engine;
10mod fence;
11mod format;
12mod run;
13mod schema;
14mod suggest;
15mod types;
16
17pub use constants::*;
18pub use engine::{default_engine, GlobEngine, GlobEngineInput};
19pub use format::{format_paths, has_recursive_marker};
20pub use schema::{
21    safe_parse_glob_params, GlobParams, GlobParseError, GLOB_TOOL_DESCRIPTION,
22    GLOB_TOOL_NAME,
23};
24pub use suggest::suggest_siblings;
25pub use types::{
26    ErrorResult, GlobPathsMeta, GlobPathsResult, GlobResult, GlobSessionConfig,
27};
28
29pub async fn glob(
30    params: serde_json::Value,
31    session: &GlobSessionConfig,
32) -> GlobResult {
33    run::run(params, session).await
34}