nat.plugins.fastmcp.cli.utils#
CLI helper utilities for FastMCP commands.
Attributes#
Functions#
|
Return True when a path matches a glob pattern. |
|
Filter change events using include and exclude glob rules. |
|
Yield filtered file change sets using watchfiles with debounce. |
Module Contents#
- _glob_matches(path: str, pattern: str) bool#
Return True when a path matches a glob pattern.
Matching is performed against both the normalized full path and basename so patterns like
*.pywork regardless of directory depth.
- _filter_change_set(
- changes: set[tuple[watchfiles.Change, str]],
- include_globs: tuple[str, Ellipsis],
- exclude_globs: tuple[str, Ellipsis],
Filter change events using include and exclude glob rules.
- iter_file_changes(
- paths: collections.abc.Iterable[pathlib.Path],
- debounce_ms: int = 750,
- include_globs: collections.abc.Iterable[str] = (),
- exclude_globs: collections.abc.Iterable[str] = (),
Yield filtered file change sets using watchfiles with debounce.
- Parameters:
paths – File or directory paths to watch for changes.
debounce_ms – Debounce interval in milliseconds passed to
watchfiles.include_globs – Optional include patterns. When provided, only matching paths trigger reload checks.
exclude_globs – Optional exclude patterns. These are merged with
DEFAULT_RELOAD_EXCLUDE_GLOBSonly when include patterns are not provided.
- Returns:
Iterator yielding sets of
(Change, path)tuples that pass include/exclude filtering.