fix(tui): add type annotation to _catalog_lock
CI / build (pull_request) Waiting to run
CI / docker (pull_request) Blocked by required conditions
CI / helm (pull_request) Waiting to run
CI / push-validation (pull_request) Waiting to run
CI / status-check (pull_request) Blocked by required conditions
CI / lint (pull_request) Waiting to run
CI / typecheck (pull_request) Waiting to run
CI / security (pull_request) Waiting to run
CI / quality (pull_request) Waiting to run
CI / unit_tests (pull_request) Waiting to run
CI / integration_tests (pull_request) Waiting to run
CI / e2e_tests (pull_request) Waiting to run
CI / coverage (pull_request) Blocked by required conditions
CI / benchmark-regression (pull_request) Blocked by required conditions
CI / benchmark-publish (pull_request) Waiting to run
CI / build (pull_request) Waiting to run
CI / docker (pull_request) Blocked by required conditions
CI / helm (pull_request) Waiting to run
CI / push-validation (pull_request) Waiting to run
CI / status-check (pull_request) Blocked by required conditions
CI / lint (pull_request) Waiting to run
CI / typecheck (pull_request) Waiting to run
CI / security (pull_request) Waiting to run
CI / quality (pull_request) Waiting to run
CI / unit_tests (pull_request) Waiting to run
CI / integration_tests (pull_request) Waiting to run
CI / e2e_tests (pull_request) Waiting to run
CI / coverage (pull_request) Blocked by required conditions
CI / benchmark-regression (pull_request) Blocked by required conditions
CI / benchmark-publish (pull_request) Waiting to run
- Add explicit type annotation: _catalog_lock: Lock = threading.Lock() - Import Lock from threading module - Ensures proper type checking and IDE support
This commit is contained in:
@@ -7,6 +7,7 @@ import threading
|
||||
import time
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from threading import Lock
|
||||
|
||||
from cleveragents.tui.search.fuzzy import rank_candidates
|
||||
|
||||
@@ -14,7 +15,7 @@ _REFERENCE_TYPES = ("project", "plan", "resource", "actor", "tool", "skill")
|
||||
_IGNORED_DIRS = {".git", ".venv", "node_modules", "__pycache__", ".mypy_cache"}
|
||||
_CATALOG_LIMIT = 400
|
||||
_CATALOG_CACHE_TTL_SECONDS = 5.0
|
||||
_catalog_lock = threading.Lock()
|
||||
_catalog_lock: Lock = threading.Lock()
|
||||
_catalog_cache: dict[str, object] = {"cwd": None, "created_at": 0.0, "catalog": None}
|
||||
|
||||
|
||||
@@ -77,8 +78,7 @@ def _catalog() -> dict[str, list[str]]:
|
||||
if (cwd / "examples" / "actors").is_dir()
|
||||
else [],
|
||||
"tool": sorted(
|
||||
f"local/{file.stem}"
|
||||
for file in (cwd / "examples" / "tools").glob("*.y*ml")
|
||||
f"local/{file.stem}" for file in (cwd / "examples" / "tools").glob("*.y*ml")
|
||||
)
|
||||
if (cwd / "examples" / "tools").is_dir()
|
||||
else [],
|
||||
|
||||
Reference in New Issue
Block a user