-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
134 lines (123 loc) · 2.98 KB
/
Copy pathutils.py
File metadata and controls
134 lines (123 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
"""Deprecated compatibility facade for legacy imports.
Use focused public APIs instead:
- ``core.paths_api``
- ``core.discovery_api``
- ``core.output_api``
- ``core.tooling``
- ``core.skill_docs``
Compatibility exports remain for downstream callers and tests.
Planned removal: 2026-09-30 (or later major version).
"""
from __future__ import annotations
from pathlib import Path
from core.discovery_api import (
DEFAULT_EXCLUSIONS,
clear_source_file_cache_for_tests,
disable_file_cache,
enable_file_cache,
find_py_files,
find_source_files,
find_ts_files,
find_tsx_files,
get_exclusions,
is_file_cache_enabled,
matches_exclusion,
read_file_text,
rel,
resolve_path,
safe_write_text,
set_exclusions,
)
from core.grep import grep_count_files, grep_files, grep_files_containing
from core.output_api import (
COLORS,
LOC_COMPACT_THRESHOLD,
NO_COLOR,
colorize,
display_entries,
log,
print_table,
)
from core.paths_api import (
DEFAULT_PATH,
PROJECT_ROOT,
SRC_PATH,
get_default_path,
get_project_root,
get_src_path,
read_code_snippet,
)
from core.skill_docs import (
SKILL_BEGIN,
SKILL_END,
SKILL_OVERLAY_RE,
SKILL_SEARCH_PATHS,
SKILL_TARGETS,
SKILL_VERSION,
SKILL_VERSION_RE,
SkillInstall,
check_skill_version,
find_installed_skill,
)
from core import tooling as _tooling
TOOL_DIR = _tooling.TOOL_DIR
def compute_tool_hash() -> str:
"""Compatibility wrapper honoring ``utils.TOOL_DIR`` test overrides."""
return _tooling.compute_tool_hash(tool_dir=Path(TOOL_DIR))
def check_tool_staleness(state: dict) -> str | None:
"""Compatibility wrapper honoring ``utils.TOOL_DIR`` test overrides."""
return _tooling.check_tool_staleness(state, tool_dir=Path(TOOL_DIR))
__all__ = [
# Path constants + helpers
"PROJECT_ROOT",
"DEFAULT_PATH",
"SRC_PATH",
"get_project_root",
"get_default_path",
"get_src_path",
"read_code_snippet",
# Discovery helpers retained for legacy callsites
"DEFAULT_EXCLUSIONS",
"set_exclusions",
"get_exclusions",
"matches_exclusion",
"rel",
"resolve_path",
"safe_write_text",
"enable_file_cache",
"disable_file_cache",
"is_file_cache_enabled",
"read_file_text",
"clear_source_file_cache_for_tests",
"find_source_files",
"find_ts_files",
"find_tsx_files",
"find_py_files",
# Grep helpers
"grep_files",
"grep_files_containing",
"grep_count_files",
# Output formatting
"LOC_COMPACT_THRESHOLD",
"COLORS",
"NO_COLOR",
"colorize",
"log",
"print_table",
"display_entries",
# Tool staleness
"TOOL_DIR",
"compute_tool_hash",
"check_tool_staleness",
# Skill document tracking
"SKILL_VERSION",
"SKILL_VERSION_RE",
"SKILL_OVERLAY_RE",
"SKILL_BEGIN",
"SKILL_END",
"SKILL_SEARCH_PATHS",
"SKILL_TARGETS",
"SkillInstall",
"find_installed_skill",
"check_skill_version",
]