codetool-explore 0.6.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/PKG-INFO +4 -2
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/README.md +3 -1
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/pyproject.toml +1 -1
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/explorer.py +21 -1
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test_api.py +35 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/uv.lock +1 -1
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/.gitignore +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/LICENSE +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/benchmarks/benchmark_output_lengths.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/benchmarks/benchmark_search.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/hatch_build.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/Cargo.lock +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/Cargo.toml +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/app.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/case.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/config.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/constants.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/file_search.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/ignore_rules.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/literal.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/main.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/matcher.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/models.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/output.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/path_utils.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/ranking.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/regex_search.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/search.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/text.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/rust/src/walker.rs +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/scripts/package_rust_binary.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/scripts/update_readme_benchmarks.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/__init__.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/api.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/cli.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/compression.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/cursor.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/errors.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/ignore.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/py.typed +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/__init__.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/case.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/config.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/constants.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/file_search.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/ignore_rules.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/literal.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/matcher.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/models.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/output.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/regex_search.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/search.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/text.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/walker.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/ranking.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/roots.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/rust_backend.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/text_output.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test___init__.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test_cli.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test_cursor.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test_hatch_build.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test_ignore.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test_packaged_binary.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test_python_backend.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test_ranking.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test_rust_backend.py +0 -0
- {codetool_explore-0.6.0 → codetool_explore-0.7.0}/tests/test_rust_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codetool-explore
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Fast, dependency-free workspace search, read, and list exploration for coding-agent tools with Rust backend
|
|
5
5
|
Project-URL: Homepage, https://github.com/pbi-agent/codetool-explore
|
|
6
6
|
Project-URL: Repository, https://github.com/pbi-agent/codetool-explore
|
|
@@ -114,7 +114,9 @@ than one file is read, each file is prefixed by a compact `path:` header. Use
|
|
|
114
114
|
`start_line` and `limit` to cap the returned line range; if more lines remain,
|
|
115
115
|
text output starts with `-- more: cursor=N`. CSV files are read as ordinary
|
|
116
116
|
text. Binary-looking, missing, unreadable, or directory paths fail with
|
|
117
|
-
controlled `ExploreError` subclasses.
|
|
117
|
+
controlled `ExploreError` subclasses. If `root` is already a file,
|
|
118
|
+
`target="read"` reads that file directly, so accidental search-like `pattern`
|
|
119
|
+
values from tool calls still produce the requested line range.
|
|
118
120
|
|
|
119
121
|
`target="list"` treats `pattern` as one file/directory path and returns one
|
|
120
122
|
directory level under each root. Text output uses the same compact tree display
|
|
@@ -84,7 +84,9 @@ than one file is read, each file is prefixed by a compact `path:` header. Use
|
|
|
84
84
|
`start_line` and `limit` to cap the returned line range; if more lines remain,
|
|
85
85
|
text output starts with `-- more: cursor=N`. CSV files are read as ordinary
|
|
86
86
|
text. Binary-looking, missing, unreadable, or directory paths fail with
|
|
87
|
-
controlled `ExploreError` subclasses.
|
|
87
|
+
controlled `ExploreError` subclasses. If `root` is already a file,
|
|
88
|
+
`target="read"` reads that file directly, so accidental search-like `pattern`
|
|
89
|
+
values from tool calls still produce the requested line range.
|
|
88
90
|
|
|
89
91
|
`target="list"` treats `pattern` as one file/directory path and returns one
|
|
90
92
|
directory level under each root. Text output uses the same compact tree display
|
|
@@ -252,7 +252,12 @@ def _resolve_explore_paths(
|
|
|
252
252
|
raise ExploreArgumentError(f"{target} path must not be empty")
|
|
253
253
|
|
|
254
254
|
return tuple(
|
|
255
|
-
_resolve_path_for_search_root(
|
|
255
|
+
_resolve_path_for_search_root(
|
|
256
|
+
query,
|
|
257
|
+
search_root=search_root,
|
|
258
|
+
root_set=root_set,
|
|
259
|
+
target=target,
|
|
260
|
+
)
|
|
256
261
|
for search_root in root_set.roots
|
|
257
262
|
)
|
|
258
263
|
|
|
@@ -262,10 +267,25 @@ def _resolve_path_for_search_root(
|
|
|
262
267
|
*,
|
|
263
268
|
search_root: SearchRoot,
|
|
264
269
|
root_set: NormalizedRoots,
|
|
270
|
+
target: str,
|
|
265
271
|
) -> ResolvedExplorePath:
|
|
266
272
|
root_abs = search_root.abs_path
|
|
267
273
|
root_is_file = os.path.isfile(root_abs)
|
|
268
274
|
root_base = root_abs if os.path.isdir(root_abs) else os.path.dirname(root_abs)
|
|
275
|
+
if target == "read" and root_is_file:
|
|
276
|
+
display_base = root_set.rel_base if root_set.has_multiple else root_base
|
|
277
|
+
display_path = _display_path(root_abs, display_base)
|
|
278
|
+
return ResolvedExplorePath(
|
|
279
|
+
query=query,
|
|
280
|
+
abs_path=root_abs,
|
|
281
|
+
display_path=display_path,
|
|
282
|
+
root_display=root_set.display,
|
|
283
|
+
display_base=display_base,
|
|
284
|
+
root_base=root_base,
|
|
285
|
+
search_root_abs=root_abs,
|
|
286
|
+
root_is_file=True,
|
|
287
|
+
rel_base_abs=root_set.rel_base,
|
|
288
|
+
)
|
|
269
289
|
if os.path.isabs(query):
|
|
270
290
|
abs_path = os.path.abspath(query)
|
|
271
291
|
base = root_set.rel_base if root_set.has_multiple else root_base
|
|
@@ -265,6 +265,41 @@ def test_read_target_defaults_to_plain_text_line_range(tmp_path):
|
|
|
265
265
|
assert "2:" not in result
|
|
266
266
|
|
|
267
267
|
|
|
268
|
+
def test_read_target_accepts_file_root_with_search_hint_pattern(tmp_path):
|
|
269
|
+
target = tmp_path / "webapp" / "src" / "styles" / "modal.css"
|
|
270
|
+
write(
|
|
271
|
+
target,
|
|
272
|
+
"one\n"
|
|
273
|
+
"two\n"
|
|
274
|
+
".task-form-dialog {\n"
|
|
275
|
+
" color: red;\n"
|
|
276
|
+
"}\n",
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
text = api.explore(
|
|
280
|
+
"task-form-dialog",
|
|
281
|
+
root=str(target),
|
|
282
|
+
target="read",
|
|
283
|
+
start_line=3,
|
|
284
|
+
limit=2,
|
|
285
|
+
)
|
|
286
|
+
full = api.explore(
|
|
287
|
+
"task-form-dialog",
|
|
288
|
+
root=str(target),
|
|
289
|
+
target="read",
|
|
290
|
+
start_line=3,
|
|
291
|
+
limit=2,
|
|
292
|
+
result_format="full",
|
|
293
|
+
)
|
|
294
|
+
|
|
295
|
+
assert text == "-- more: cursor=5\n.task-form-dialog {\n color: red;"
|
|
296
|
+
assert full["pattern"] == "task-form-dialog"
|
|
297
|
+
assert full["root"] == str(target)
|
|
298
|
+
assert full["path"] == "modal.css"
|
|
299
|
+
assert full["returned"] == 2
|
|
300
|
+
assert full["next_cursor"] == "5"
|
|
301
|
+
|
|
302
|
+
|
|
268
303
|
def test_read_target_reports_more_and_supports_csv_as_text(tmp_path):
|
|
269
304
|
write(tmp_path / "data.csv", "name,value\nalpha,1\nbeta,2\n")
|
|
270
305
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/__init__.py
RENAMED
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/case.py
RENAMED
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/config.py
RENAMED
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/constants.py
RENAMED
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/file_search.py
RENAMED
|
File without changes
|
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/literal.py
RENAMED
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/matcher.py
RENAMED
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/models.py
RENAMED
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/output.py
RENAMED
|
File without changes
|
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/search.py
RENAMED
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/text.py
RENAMED
|
File without changes
|
{codetool_explore-0.6.0 → codetool_explore-0.7.0}/src/codetool_explore/python_backend/walker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|