PikoAi 0.1.11__tar.gz → 0.1.12__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.
Files changed (45) hide show
  1. {pikoai-0.1.11/Src/PikoAi.egg-info → pikoai-0.1.12}/PKG-INFO +1 -1
  2. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Env/shell.py +19 -8
  3. {pikoai-0.1.11 → pikoai-0.1.12/Src/PikoAi.egg-info}/PKG-INFO +1 -1
  4. {pikoai-0.1.11 → pikoai-0.1.12}/setup.py +1 -1
  5. {pikoai-0.1.11 → pikoai-0.1.12}/LICENSE +0 -0
  6. {pikoai-0.1.11 → pikoai-0.1.12}/README.md +0 -0
  7. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Agents/Executor/__init__.py +0 -0
  8. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Agents/Executor/executor.py +0 -0
  9. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Agents/Executor/prompts.py +0 -0
  10. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Agents/__init__.py +0 -0
  11. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Env/__init__.py +0 -0
  12. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Env/base_env.py +0 -0
  13. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Env/base_executor.py +0 -0
  14. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Env/env.py +0 -0
  15. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Env/js_executor.py +0 -0
  16. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Env/python_executor.py +0 -0
  17. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Env/tests/__init__.py +0 -0
  18. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Env/tests/test_python_executor.py +0 -0
  19. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Env/tests/test_shell_executor.py +0 -0
  20. {pikoai-0.1.11 → pikoai-0.1.12}/Src/OpenCopilot.py +0 -0
  21. {pikoai-0.1.11 → pikoai-0.1.12}/Src/PikoAi.egg-info/SOURCES.txt +0 -0
  22. {pikoai-0.1.11 → pikoai-0.1.12}/Src/PikoAi.egg-info/dependency_links.txt +0 -0
  23. {pikoai-0.1.11 → pikoai-0.1.12}/Src/PikoAi.egg-info/entry_points.txt +0 -0
  24. {pikoai-0.1.11 → pikoai-0.1.12}/Src/PikoAi.egg-info/requires.txt +0 -0
  25. {pikoai-0.1.11 → pikoai-0.1.12}/Src/PikoAi.egg-info/top_level.txt +0 -0
  26. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Tools/__init__.py +0 -0
  27. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Tools/file_task.py +0 -0
  28. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Tools/system_details.py +0 -0
  29. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Tools/tool_dir.json +0 -0
  30. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Tools/tool_manager.py +0 -0
  31. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Tools/userinp.py +0 -0
  32. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Tools/web_loader.py +0 -0
  33. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Tools/web_search.py +0 -0
  34. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Utils/__init__.py +0 -0
  35. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Utils/executor_utils.py +0 -0
  36. {pikoai-0.1.11 → pikoai-0.1.12}/Src/Utils/ter_interface.py +0 -0
  37. {pikoai-0.1.11 → pikoai-0.1.12}/Src/cli.py +0 -0
  38. {pikoai-0.1.11 → pikoai-0.1.12}/Src/llm_interface/__init__.py +0 -0
  39. {pikoai-0.1.11 → pikoai-0.1.12}/Src/llm_interface/llm.py +0 -0
  40. {pikoai-0.1.11 → pikoai-0.1.12}/setup.cfg +0 -0
  41. {pikoai-0.1.11 → pikoai-0.1.12}/test/test.py +0 -0
  42. {pikoai-0.1.11 → pikoai-0.1.12}/test/test_file_task.py +0 -0
  43. {pikoai-0.1.11 → pikoai-0.1.12}/test/test_opencopilot_file_integration.py +0 -0
  44. {pikoai-0.1.11 → pikoai-0.1.12}/test/testjs.py +0 -0
  45. {pikoai-0.1.11 → pikoai-0.1.12}/test/testscript.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PikoAi
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: An AI-powered task automation tool
5
5
  Home-page: https://github.com/nihaaaar22/OS-Assistant
6
6
  Author: Nihar S
@@ -78,15 +78,26 @@ class ShellExecutor(BaseEnv):
78
78
  'output': 'Blocked potentially harmful command.',
79
79
  'error': f'Command matches forbidden pattern: {pattern}'
80
80
  }
81
- # Check for sensitive directory access
81
+ # Improved check for sensitive directory access
82
82
  for sensitive_dir in sensitive_dirs:
83
- # Only block if the command is trying to directly access or operate on the sensitive dir
84
- if re.search(rf'\b{sensitive_dir}\b', code_or_command, re.IGNORECASE):
85
- return {
86
- 'success': False,
87
- 'output': f'Blocked access to sensitive directory: {sensitive_dir}',
88
- 'error': f'Attempted access to sensitive directory: {sensitive_dir}'
89
- }
83
+ # Only block if the command is trying to directly operate on the sensitive dir itself (not subpaths)
84
+ # For '/', block only if the command is exactly '/' or has a space and then '/'
85
+ if sensitive_dir == '/':
86
+ if re.search(r'(\s|^)/($|\s)', code_or_command):
87
+ return {
88
+ 'success': False,
89
+ 'output': f'Blocked access to sensitive directory: {sensitive_dir}',
90
+ 'error': f'Attempted access to sensitive directory: {sensitive_dir}'
91
+ }
92
+ else:
93
+ # Block if the command is operating on the directory itself, not a subpath (e.g., 'ls /root' but not 'ls /root/somefile')
94
+ pattern = rf'(\s|^)({re.escape(sensitive_dir)})(\s|$)'
95
+ if re.search(pattern, code_or_command, re.IGNORECASE):
96
+ return {
97
+ 'success': False,
98
+ 'output': f'Blocked access to sensitive directory: {sensitive_dir}',
99
+ 'error': f'Attempted access to sensitive directory: {sensitive_dir}'
100
+ }
90
101
 
91
102
  # Execute the command in a subprocess
92
103
  self.process = subprocess.Popen(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PikoAi
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: An AI-powered task automation tool
5
5
  Home-page: https://github.com/nihaaaar22/OS-Assistant
6
6
  Author: Nihar S
@@ -3,7 +3,7 @@ from pathlib import Path
3
3
 
4
4
  setup(
5
5
  name="PikoAi",
6
- version="0.1.11",
6
+ version="0.1.12",
7
7
  packages=find_packages(where="Src"),
8
8
  py_modules=["cli", "OpenCopilot"],
9
9
  package_dir={"": "Src"},
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