PikoAi 0.1.20__py3-none-any.whl → 0.1.22__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.
- Agents/Executor/executor.py +6 -4
- Tools/file_task.py +9 -1
- {pikoai-0.1.20.dist-info → pikoai-0.1.22.dist-info}/METADATA +1 -1
- {pikoai-0.1.20.dist-info → pikoai-0.1.22.dist-info}/RECORD +8 -8
- {pikoai-0.1.20.dist-info → pikoai-0.1.22.dist-info}/WHEEL +0 -0
- {pikoai-0.1.20.dist-info → pikoai-0.1.22.dist-info}/entry_points.txt +0 -0
- {pikoai-0.1.20.dist-info → pikoai-0.1.22.dist-info}/licenses/LICENSE +0 -0
- {pikoai-0.1.20.dist-info → pikoai-0.1.22.dist-info}/top_level.txt +0 -0
Agents/Executor/executor.py
CHANGED
@@ -21,8 +21,8 @@ class RateLimiter:
|
|
21
21
|
def wait_if_needed(self):
|
22
22
|
if self.last_call_time is not None:
|
23
23
|
elapsed = time.time() - self.last_call_time
|
24
|
-
if elapsed <
|
25
|
-
time.sleep(
|
24
|
+
if elapsed < self.wait_time:
|
25
|
+
time.sleep(self.wait_time - elapsed)
|
26
26
|
self.last_call_time = time.time()
|
27
27
|
|
28
28
|
class executor:
|
@@ -46,8 +46,10 @@ class executor:
|
|
46
46
|
self.llm = LiteLLMInterface()
|
47
47
|
|
48
48
|
def get_tool_dir(self):
|
49
|
-
|
50
|
-
|
49
|
+
# Use direct path resolution instead of pkg_resources
|
50
|
+
# pkg_resources is used for finding resources within installed packages,
|
51
|
+
# but since we're working with a local project structure, we can use direct paths
|
52
|
+
tool_dir_path = os.path.join(os.path.dirname(__file__), '../../Tools/tool_dir.json')
|
51
53
|
with open(tool_dir_path, "r") as file:
|
52
54
|
return file.read()
|
53
55
|
|
Tools/file_task.py
CHANGED
@@ -19,7 +19,8 @@ def file_reader(**kwargs) -> dict:
|
|
19
19
|
return {"success": False, "output": "Error: 'file_path' is required."}
|
20
20
|
|
21
21
|
file_path = kwargs["file_path"]
|
22
|
-
|
22
|
+
if not os.path.isabs(file_path):
|
23
|
+
file_path = os.path.abspath(file_path)
|
23
24
|
# Enhanced Security Checks (Primary Change Area)
|
24
25
|
abs_file_path = os.path.abspath(file_path)
|
25
26
|
normalized_abs_path = abs_file_path.lower()
|
@@ -147,6 +148,8 @@ def file_maker(**kwargs) -> dict:
|
|
147
148
|
return {"success": False, "output": "Error: 'file_path' is required."}
|
148
149
|
|
149
150
|
file_path = kwargs["file_path"]
|
151
|
+
if not os.path.isabs(file_path):
|
152
|
+
file_path = os.path.abspath(file_path)
|
150
153
|
|
151
154
|
# Security check: Prevent creation in sensitive directories
|
152
155
|
forbidden_dirs = ["/etc", "/root", "/sys", "/proc"]
|
@@ -184,6 +187,8 @@ def file_writer(**kwargs) -> dict:
|
|
184
187
|
return {"success": False, "output": "Error: 'file_path' and 'content' are required."}
|
185
188
|
|
186
189
|
file_path = kwargs["file_path"]
|
190
|
+
if not os.path.isabs(file_path):
|
191
|
+
file_path = os.path.abspath(file_path)
|
187
192
|
content = kwargs["content"]
|
188
193
|
append_mode = kwargs.get("append", False)
|
189
194
|
|
@@ -220,7 +225,10 @@ def directory_maker(**kwargs) -> dict:
|
|
220
225
|
if "dir_path" not in kwargs:
|
221
226
|
return {"success": False, "output": "Error: 'dir_path' is required."}
|
222
227
|
|
228
|
+
# Convert to absolute path if not already absolute
|
223
229
|
dir_path = kwargs["dir_path"]
|
230
|
+
if not os.path.isabs(dir_path):
|
231
|
+
dir_path = os.path.abspath(dir_path)
|
224
232
|
|
225
233
|
# Security check: Prevent creation in sensitive directories
|
226
234
|
forbidden_dirs = ["/etc", "/root", "/sys", "/proc"]
|
@@ -2,7 +2,7 @@ OpenCopilot.py,sha256=kPTs0-ly84h4dM7AmBlK4uwst5Sj2AM6UAlE3okkD8U,12157
|
|
2
2
|
cli.py,sha256=2UvmH74pcBFFezI0WHNyWTHMYasIM5NGnrUX6wsdveM,12945
|
3
3
|
Agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
Agents/Executor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
Agents/Executor/executor.py,sha256=
|
5
|
+
Agents/Executor/executor.py,sha256=S83Rc1JVWuGvgnhV_fPMoCp8V4wwitbWy2MO_yV22X4,7212
|
6
6
|
Agents/Executor/prompts.py,sha256=3GHNKArEe-pWucbZTgSeJ9yjk_HVhd6BapVpQNt_nEE,2890
|
7
7
|
Env/__init__.py,sha256=KLe7UcNV5L395SxhMwbYGyu7KPrSNaoV_9QJo3mLop0,196
|
8
8
|
Env/base_env.py,sha256=K4PoWwPXn3pKeu7_-JOlUuyNbyYQ9itMhQybFOm-3K4,1563
|
@@ -15,7 +15,7 @@ Env/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
Env/tests/test_python_executor.py,sha256=5kfs0cOf-RgWTOers_1wB0yvYSF-HrHPsraJ-PxgR50,3156
|
16
16
|
Env/tests/test_shell_executor.py,sha256=-RcCdSUMoRAXHISIh0IR5MCutco80fX2S3sQBcinc_Q,1034
|
17
17
|
Tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
|
-
Tools/file_task.py,sha256=
|
18
|
+
Tools/file_task.py,sha256=Sqn8GWB7UHljUmUniYbkTiC_63LkVIVU4aXgudtLNTI,12566
|
19
19
|
Tools/system_details.py,sha256=RScVnhTpUOlNG0g5bGnwmtNr5nSJzOec8HJSFpbicds,2651
|
20
20
|
Tools/tool_dir.json,sha256=RTawcanxIkJaUys6Y3yftXAT5uxMH0xPZYTtD1ilJl0,3119
|
21
21
|
Tools/tool_manager.py,sha256=xrjrGmLI1hXqCfALBRBuMFCgXwc7pb5TpKMBH_4tCzs,4106
|
@@ -27,9 +27,9 @@ Utils/executor_utils.py,sha256=WwK3TKgw_hG_crg7ijRaqfidYnnNXYbbs37vKZRYK-0,491
|
|
27
27
|
Utils/ter_interface.py,sha256=8Oe5818MAYC21SfUxtfnV9HQFcQ49z8Q030jjPqNP_g,3889
|
28
28
|
llm_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
29
|
llm_interface/llm.py,sha256=Am18eyEFYlgcackuYGz8_Y0L7lQ7SSUCpNAEjcyZaAU,5080
|
30
|
-
pikoai-0.1.
|
31
|
-
pikoai-0.1.
|
32
|
-
pikoai-0.1.
|
33
|
-
pikoai-0.1.
|
34
|
-
pikoai-0.1.
|
35
|
-
pikoai-0.1.
|
30
|
+
pikoai-0.1.22.dist-info/licenses/LICENSE,sha256=cELUVOboOAderKFp8bdtcM5VyJi61YH1oDbRhOuoQZw,1067
|
31
|
+
pikoai-0.1.22.dist-info/METADATA,sha256=zPCjowy7fdW0fEgpPXMWe1JqcfKf4_CUnthqd4eLy0k,2962
|
32
|
+
pikoai-0.1.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
33
|
+
pikoai-0.1.22.dist-info/entry_points.txt,sha256=xjZnheDymNDnQ0o84R0jZKEITrhNbzQWN-AhqfA_d6s,50
|
34
|
+
pikoai-0.1.22.dist-info/top_level.txt,sha256=hWzBNE7UQsuNcENIOksGcJED08k3ZGRRn2X5jnStICU,53
|
35
|
+
pikoai-0.1.22.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|