janito 1.5.1__py3-none-any.whl → 1.5.2__py3-none-any.whl
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.
- janito/agent/tools/find_files.py +8 -2
- janito/agent/tools/search_files.py +12 -3
- {janito-1.5.1.dist-info → janito-1.5.2.dist-info}/METADATA +1 -1
- {janito-1.5.1.dist-info → janito-1.5.2.dist-info}/RECORD +8 -8
- {janito-1.5.1.dist-info → janito-1.5.2.dist-info}/WHEEL +0 -0
- {janito-1.5.1.dist-info → janito-1.5.2.dist-info}/entry_points.txt +0 -0
- {janito-1.5.1.dist-info → janito-1.5.2.dist-info}/licenses/LICENSE +0 -0
- {janito-1.5.1.dist-info → janito-1.5.2.dist-info}/top_level.txt +0 -0
janito/agent/tools/find_files.py
CHANGED
@@ -43,8 +43,14 @@ class FindFilesTool(ToolBase):
|
|
43
43
|
if len(matches) >= max_results:
|
44
44
|
break
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
warning = ""
|
47
|
+
if len(matches) >= max_results:
|
48
|
+
warning = "\n⚠️ Warning: Maximum result limit reached. Some matches may not be shown."
|
49
|
+
suffix = " (Max Reached)"
|
50
|
+
else:
|
51
|
+
suffix = ""
|
52
|
+
self.report_success(f" ✅ {len(matches)} {pluralize('file', len(matches))}{suffix}")
|
53
|
+
return "\n".join(matches) + warning
|
48
54
|
|
49
55
|
|
50
56
|
from janito.agent.tools.tools_utils import pluralize
|
@@ -7,13 +7,14 @@ from janito.agent.tools.gitignore_utils import filter_ignored
|
|
7
7
|
@register_tool(name="search_files")
|
8
8
|
class SearchFilesTool(ToolBase):
|
9
9
|
"""Search for a text pattern in all files within a directory and return matching lines. Respects .gitignore."""
|
10
|
-
def call(self, directories: list[str], pattern: str) -> str:
|
10
|
+
def call(self, directories: list[str], pattern: str, max_results: int=100) -> str:
|
11
11
|
"""
|
12
12
|
Search for a text pattern in all files within one or more directories and return matching lines.
|
13
13
|
|
14
14
|
Args:
|
15
15
|
directories (list[str]): List of directories to search in.
|
16
16
|
pattern (str): Plain text substring to search for in files. (Not a regular expression or glob pattern.)
|
17
|
+
max_results (int): Maximum number of results to return. Defaults to 100.
|
17
18
|
|
18
19
|
Returns:
|
19
20
|
str: Matching lines from files as a newline-separated string, each formatted as 'filepath:lineno: line'. Example:
|
@@ -35,11 +36,19 @@ class SearchFilesTool(ToolBase):
|
|
35
36
|
for lineno, line in enumerate(f, 1):
|
36
37
|
if pattern in line:
|
37
38
|
matches.append(f"{path}:{lineno}: {line.strip()}")
|
39
|
+
if len(matches) >= max_results:
|
40
|
+
break
|
38
41
|
except Exception:
|
39
42
|
continue
|
40
43
|
|
41
|
-
|
42
|
-
|
44
|
+
warning = ""
|
45
|
+
if len(matches) >= max_results:
|
46
|
+
warning = "\n⚠️ Warning: Maximum result limit reached. Some matches may not be shown."
|
47
|
+
suffix = " (Max Reached)"
|
48
|
+
else:
|
49
|
+
suffix = ""
|
50
|
+
self.report_success(f" ✅ {len(matches)} {pluralize('line', len(matches))}{suffix}")
|
51
|
+
return '\n'.join(matches) + warning
|
43
52
|
|
44
53
|
|
45
54
|
from janito.agent.tools.tools_utils import pluralize
|
@@ -24,7 +24,7 @@ janito/agent/tools/ask_user.py,sha256=36pZLy3WPEIQyKKallbH9Bq-8ASLWb-Eza4g1VbYZ-
|
|
24
24
|
janito/agent/tools/create_directory.py,sha256=fFMXIqSFRx6NyRtbJvgUId-rN83mYHsAQqP-2sBjGMA,1340
|
25
25
|
janito/agent/tools/create_file.py,sha256=YQISWGBUOMFTFA_hKqanYjXNJMHK22jDSrGIxOAMWDY,2551
|
26
26
|
janito/agent/tools/fetch_url.py,sha256=RuicvHm8uQJSCPwfLv6KV9my1HCJd0ehl3yutjKyd3g,2068
|
27
|
-
janito/agent/tools/find_files.py,sha256=
|
27
|
+
janito/agent/tools/find_files.py,sha256=14iUSLPzqycuZpRkCNpS8hoa7KvGlotogMYQc4yFobo,2547
|
28
28
|
janito/agent/tools/get_file_outline.py,sha256=NwyIY2XAJr9REmeyX6Lyd6SyQiLdAiSzN4dii_iltM0,1447
|
29
29
|
janito/agent/tools/get_lines.py,sha256=Y7tHnHZB0PFylcRIXtDvmFPXdoWTeXUmVrENpBgVBdM,3364
|
30
30
|
janito/agent/tools/gitignore_utils.py,sha256=z_IYilabTD_-c14aRxuVasojOzTsg-11xJPJqudWIKA,1306
|
@@ -36,7 +36,7 @@ janito/agent/tools/remove_file.py,sha256=qVfuAJXThA4UR7iCU5DLc_UMY81iextp0_zXTgH
|
|
36
36
|
janito/agent/tools/replace_text_in_file.py,sha256=0w5cG_MvXcxwQI-i8hX-GedW0qnEwn-eYXYaNlv4NxA,4969
|
37
37
|
janito/agent/tools/rich_live.py,sha256=cuZ3-ZxpuHxR1TvIcp0bi9F3QM1M6Ms0XiOMd8If8gU,1161
|
38
38
|
janito/agent/tools/run_bash_command.py,sha256=1LcoNNhRHH65tCmGmdEFtpA5S4L1kmODuvBQUl7LGnA,5246
|
39
|
-
janito/agent/tools/search_files.py,sha256=
|
39
|
+
janito/agent/tools/search_files.py,sha256=5ZTGB6adWO8OafGLZHGjnhUaW5IE4IfM1BSVxzNwNeI,2710
|
40
40
|
janito/agent/tools/tool_base.py,sha256=ch08PaWMEC8hC0UmWC7fEXmRBdnsmqXn6pXhoXbGXFU,1898
|
41
41
|
janito/agent/tools/tools_utils.py,sha256=G_Ib8QamhHbBzpKDW3TeoaxGDQgjs8_Zj8TFUInl78k,354
|
42
42
|
janito/agent/tools/utils.py,sha256=cKPE9HVA1yHmKzML8Uz4YCVLNDK13MQw9ThvhC9COCI,1101
|
@@ -58,9 +58,9 @@ janito/cli_chat_shell/ui.py,sha256=-HrX7aOivKUaDdZh0_FWSbHGSRPbhVyVuKyqcbvKFmQ,6
|
|
58
58
|
janito/web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
59
59
|
janito/web/__main__.py,sha256=oPXNF332aCeI7aUWr7_8M57oOKugw422VrEubxFp0P4,354
|
60
60
|
janito/web/app.py,sha256=kJhrKDI7X2Ujzk_SVxctvq1loiAXHil0ckn3RQ8e3gg,6549
|
61
|
-
janito-1.5.
|
62
|
-
janito-1.5.
|
63
|
-
janito-1.5.
|
64
|
-
janito-1.5.
|
65
|
-
janito-1.5.
|
66
|
-
janito-1.5.
|
61
|
+
janito-1.5.2.dist-info/licenses/LICENSE,sha256=sHBqv0bvtrb29H7WRR-Z603YHm9pLtJIo3nHU_9cmgE,1091
|
62
|
+
janito-1.5.2.dist-info/METADATA,sha256=Oz8I9ZTvqWPvxsSbBhNKNufJT2olOf56MWEpj1CnyCQ,7539
|
63
|
+
janito-1.5.2.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
|
64
|
+
janito-1.5.2.dist-info/entry_points.txt,sha256=wIo5zZxbmu4fC-ZMrsKD0T0vq7IqkOOLYhrqRGypkx4,48
|
65
|
+
janito-1.5.2.dist-info/top_level.txt,sha256=m0NaVCq0-ivxbazE2-ND0EA9Hmuijj_OGkmCbnBcCig,7
|
66
|
+
janito-1.5.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|