PikoAi 0.1.4__py3-none-any.whl → 0.1.6__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.
- OpenCopilot.py +14 -13
- {pikoai-0.1.4.dist-info → pikoai-0.1.6.dist-info}/METADATA +1 -1
- {pikoai-0.1.4.dist-info → pikoai-0.1.6.dist-info}/RECORD +7 -7
- {pikoai-0.1.4.dist-info → pikoai-0.1.6.dist-info}/entry_points.txt +1 -0
- {pikoai-0.1.4.dist-info → pikoai-0.1.6.dist-info}/WHEEL +0 -0
- {pikoai-0.1.4.dist-info → pikoai-0.1.6.dist-info}/licenses/LICENSE +0 -0
- {pikoai-0.1.4.dist-info → pikoai-0.1.6.dist-info}/top_level.txt +0 -0
OpenCopilot.py
CHANGED
@@ -7,13 +7,8 @@ from prompt_toolkit.completion import Completer, Completion
|
|
7
7
|
from prompt_toolkit.shortcuts import print_formatted_text
|
8
8
|
from prompt_toolkit.formatted_text import FormattedText
|
9
9
|
|
10
|
-
# Add the parent directory to the path to enable imports
|
11
|
-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../')))
|
12
|
-
|
13
10
|
from Agents.Executor.executor import executor
|
14
11
|
|
15
|
-
# sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../')))
|
16
|
-
|
17
12
|
class FilePathCompleter(Completer):
|
18
13
|
def get_completions(self, document, complete_event):
|
19
14
|
text_before_cursor = document.text_before_cursor
|
@@ -34,7 +29,9 @@ class FilePathCompleter(Completer):
|
|
34
29
|
dir_path = os.path.abspath(dir_path)
|
35
30
|
try:
|
36
31
|
items = os.listdir(dir_path)
|
37
|
-
|
32
|
+
# Filter out hidden files and folders (those starting with .)
|
33
|
+
visible_items = [item for item in items if not item.startswith('.')]
|
34
|
+
matching_items = [item for item in visible_items if item.lower().startswith(base_name.lower())]
|
38
35
|
matching_items.sort(key=lambda x: (not os.path.isdir(os.path.join(dir_path, x)), x.lower()))
|
39
36
|
for item in matching_items:
|
40
37
|
yield self._create_completion(text_before_cursor,dir_path, item)
|
@@ -48,21 +45,26 @@ class FilePathCompleter(Completer):
|
|
48
45
|
def _create_completion(self, text_before_cursor, dir_path, item):
|
49
46
|
"""Create a Completion object for a given item in the current directory."""
|
50
47
|
full_path = os.path.join(dir_path, item)
|
48
|
+
# Get relative path from current working directory
|
49
|
+
rel_path = os.path.relpath(full_path)
|
50
|
+
|
51
51
|
# Only the completed path after '@' should be inserted
|
52
52
|
if os.path.isdir(full_path):
|
53
|
-
completion_text = f"{
|
53
|
+
completion_text = f"{rel_path}/"
|
54
54
|
display_text = f"{item}/ (directory)"
|
55
55
|
else:
|
56
56
|
_, ext = os.path.splitext(item)
|
57
|
-
completion_text = f"{
|
57
|
+
completion_text = f"{rel_path}"
|
58
58
|
if ext:
|
59
59
|
display_text = f"{item} ({ext[1:]} file)"
|
60
60
|
else:
|
61
61
|
display_text = f"{item}"
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
|
63
|
+
# if '/' in text_before_cursor[text_before_cursor.rindex('@'):]:
|
64
|
+
# start_position = -(len(text_before_cursor) - text_before_cursor.rindex('/') - 1)
|
65
|
+
# else:
|
66
|
+
start_position = -(len(text_before_cursor) - text_before_cursor.rindex('@') - 1)
|
67
|
+
|
66
68
|
return Completion(
|
67
69
|
text=completion_text,
|
68
70
|
start_position=start_position,
|
@@ -97,7 +99,6 @@ class OpenCopilot:
|
|
97
99
|
|
98
100
|
# Add file content with clear formatting
|
99
101
|
file_contents.append(f"=== Content of file: {expanded_path} ===\n{content}\n=== End of file: {expanded_path} ===\n")
|
100
|
-
print(f"=== Content of file: {expanded_path} ===\n{content}\n=== End of file: {expanded_path} ===\n")
|
101
102
|
# Remove the @file pattern from the processed prompt
|
102
103
|
processed_prompt = processed_prompt.replace(f"@{file_path}", "")
|
103
104
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
OpenCopilot.py,sha256=
|
1
|
+
OpenCopilot.py,sha256=6210OONj0yV-LPzkCdZ1RUiHC5NZvLsD-y93Y1zurX0,10687
|
2
2
|
cli.py,sha256=o2V_DETYXEiYm6617Xg8rDcAgb0ofmojPvdlOpNHwMY,11809
|
3
3
|
Agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
Agents/Executor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -24,9 +24,9 @@ Utils/executor_utils.py,sha256=eVVxZDcAGxENRV5DhCkgh1AKiJEgfV_1q-iSQNWR5kI,1180
|
|
24
24
|
Utils/ter_interface.py,sha256=Zay9mwyAyKYTNQAKOWXHAa3upo9TWprSf26STiHXk0g,6255
|
25
25
|
llm_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
26
|
llm_interface/llm.py,sha256=tI_KDOW14QLWowA7bB3GPe2qjlk0sjS5fBavs9XD1fo,5185
|
27
|
-
pikoai-0.1.
|
28
|
-
pikoai-0.1.
|
29
|
-
pikoai-0.1.
|
30
|
-
pikoai-0.1.
|
31
|
-
pikoai-0.1.
|
32
|
-
pikoai-0.1.
|
27
|
+
pikoai-0.1.6.dist-info/licenses/LICENSE,sha256=cELUVOboOAderKFp8bdtcM5VyJi61YH1oDbRhOuoQZw,1067
|
28
|
+
pikoai-0.1.6.dist-info/METADATA,sha256=3EMhRNO8Abcy9dy0QUJEwYYJvajnvbqCmqqhccpD8es,2961
|
29
|
+
pikoai-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
30
|
+
pikoai-0.1.6.dist-info/entry_points.txt,sha256=xjZnheDymNDnQ0o84R0jZKEITrhNbzQWN-AhqfA_d6s,50
|
31
|
+
pikoai-0.1.6.dist-info/top_level.txt,sha256=hWzBNE7UQsuNcENIOksGcJED08k3ZGRRn2X5jnStICU,53
|
32
|
+
pikoai-0.1.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|