npcsh 1.0.27__tar.gz → 1.0.28__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.
- {npcsh-1.0.27 → npcsh-1.0.28}/PKG-INFO +1 -1
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/_state.py +10 -6
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/corca.py +1 -15
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npcsh.py +10 -4
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh.egg-info/PKG-INFO +1 -1
- {npcsh-1.0.27 → npcsh-1.0.28}/setup.py +1 -1
- {npcsh-1.0.27 → npcsh-1.0.28}/LICENSE +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/README.md +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/__init__.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/alicanto.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/guac.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/mcp_helpers.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/mcp_server.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/alicanto.npc +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/alicanto.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/corca.npc +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/corca.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/foreman.npc +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/frederic.npc +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/frederic4.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/guac.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/jinxs/bash_executer.jinx +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/jinxs/edit_file.jinx +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/jinxs/image_generation.jinx +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/jinxs/internet_search.jinx +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/jinxs/python_executor.jinx +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/jinxs/screen_cap.jinx +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/kadiefa.npc +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/kadiefa.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/npcsh.ctx +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/npcsh_sibiji.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/plonk.npc +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/plonk.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/plonkjr.npc +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/plonkjr.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/sibiji.npc +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/sibiji.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/spool.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/npc_team/yap.png +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/plonk.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/pti.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/routes.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/spool.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/wander.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh/yap.py +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh.egg-info/SOURCES.txt +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh.egg-info/dependency_links.txt +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh.egg-info/entry_points.txt +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh.egg-info/requires.txt +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/npcsh.egg-info/top_level.txt +0 -0
- {npcsh-1.0.27 → npcsh-1.0.28}/setup.cfg +0 -0
|
@@ -5,11 +5,18 @@ import filecmp
|
|
|
5
5
|
import os
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
import platform
|
|
8
|
-
import pty
|
|
9
8
|
try:
|
|
9
|
+
import pty
|
|
10
|
+
import tty
|
|
11
|
+
|
|
12
|
+
import termios
|
|
13
|
+
|
|
10
14
|
import readline
|
|
11
15
|
except:
|
|
12
|
-
|
|
16
|
+
readline = None
|
|
17
|
+
pty = None
|
|
18
|
+
tty = None
|
|
19
|
+
|
|
13
20
|
import re
|
|
14
21
|
import select
|
|
15
22
|
import shlex
|
|
@@ -18,11 +25,8 @@ import signal
|
|
|
18
25
|
import sqlite3
|
|
19
26
|
import subprocess
|
|
20
27
|
import sys
|
|
21
|
-
from termcolor import colored
|
|
22
|
-
import termios
|
|
23
28
|
import time
|
|
24
29
|
from typing import Dict, List, Any, Tuple, Union, Optional
|
|
25
|
-
import tty
|
|
26
30
|
import logging
|
|
27
31
|
import textwrap
|
|
28
32
|
from termcolor import colored
|
|
@@ -765,7 +769,7 @@ def start_interactive_session(command: str) -> int:
|
|
|
765
769
|
Starts an interactive session. Only works on Unix. On Windows, print a message and return 1.
|
|
766
770
|
"""
|
|
767
771
|
ON_WINDOWS = platform.system().lower().startswith("win")
|
|
768
|
-
if ON_WINDOWS or termios is None or tty is None or pty is None or select is None or signal is None:
|
|
772
|
+
if ON_WINDOWS or termios is None or tty is None or pty is None or select is None or signal is None or tty is None:
|
|
769
773
|
print("Interactive terminal sessions are not supported on Windows.")
|
|
770
774
|
return 1
|
|
771
775
|
|
|
@@ -500,7 +500,6 @@ def process_corca_result(
|
|
|
500
500
|
tool_args = {}
|
|
501
501
|
|
|
502
502
|
try:
|
|
503
|
-
print(f" Calling MCP tool: {tool_name} with args: {tool_args}")
|
|
504
503
|
|
|
505
504
|
loop = asyncio.get_event_loop()
|
|
506
505
|
if loop.is_closed():
|
|
@@ -511,9 +510,6 @@ def process_corca_result(
|
|
|
511
510
|
result_state.mcp_client.session.call_tool(tool_name, tool_args)
|
|
512
511
|
)
|
|
513
512
|
|
|
514
|
-
print(f"DEBUG: MCP result type: {type(mcp_result)}")
|
|
515
|
-
print(f"DEBUG: MCP result: {mcp_result}")
|
|
516
|
-
print(f"DEBUG: MCP result attributes: {dir(mcp_result)}")
|
|
517
513
|
|
|
518
514
|
tool_content = ""
|
|
519
515
|
if hasattr(mcp_result, 'content') and mcp_result.content:
|
|
@@ -615,26 +611,16 @@ def process_corca_result(
|
|
|
615
611
|
result_state.mcp_client.session.call_tool(tool_name, tool_args)
|
|
616
612
|
)
|
|
617
613
|
|
|
618
|
-
print(f"DEBUG: MCP result type: {type(mcp_result)}")
|
|
619
|
-
print(f"DEBUG: MCP result: {mcp_result}")
|
|
620
|
-
print(f"DEBUG: MCP result.isError: {mcp_result.isError}")
|
|
621
|
-
print(f"DEBUG: MCP result.meta: {mcp_result.meta}")
|
|
622
|
-
print(f"DEBUG: MCP result.content length: {len(mcp_result.content)}")
|
|
623
614
|
|
|
624
615
|
tool_content = ""
|
|
625
616
|
if hasattr(mcp_result, 'content') and mcp_result.content:
|
|
626
617
|
for i, content_item in enumerate(mcp_result.content):
|
|
627
|
-
print(f"DEBUG: content_item[{i}] full object: {repr(content_item)}")
|
|
628
|
-
print(f"DEBUG: content_item[{i}] text attribute: '{content_item.text}'")
|
|
629
|
-
print(f"DEBUG: content_item[{i}] text length: {len(content_item.text) if content_item.text else 0}")
|
|
630
618
|
|
|
631
619
|
if hasattr(content_item, 'text') and content_item.text:
|
|
632
620
|
tool_content += content_item.text
|
|
633
621
|
elif hasattr(content_item, 'data'):
|
|
634
|
-
print(f"DEBUG: content_item[{i}] has data: {content_item.data}")
|
|
635
622
|
tool_content += str(content_item.data)
|
|
636
623
|
else:
|
|
637
|
-
print(f"DEBUG: content_item[{i}] converting to string: {str(content_item)}")
|
|
638
624
|
tool_content += str(content_item)
|
|
639
625
|
result_state.messages.append({
|
|
640
626
|
"role": "tool",
|
|
@@ -1063,6 +1049,6 @@ def main():
|
|
|
1063
1049
|
}
|
|
1064
1050
|
|
|
1065
1051
|
enter_corca_mode(**kwargs)
|
|
1066
|
-
|
|
1052
|
+
|
|
1067
1053
|
if __name__ == "__main__":
|
|
1068
1054
|
main()
|
|
@@ -213,13 +213,19 @@ def run_repl(command_history: CommandHistory, initial_state: ShellState):
|
|
|
213
213
|
)
|
|
214
214
|
|
|
215
215
|
except KeyboardInterrupt:
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
continue
|
|
219
|
-
else:
|
|
216
|
+
print("^C")
|
|
217
|
+
if input("\nExit? (y/n): ").lower().startswith('y'):
|
|
220
218
|
exit_shell(state)
|
|
219
|
+
continue
|
|
220
|
+
|
|
221
221
|
except EOFError:
|
|
222
222
|
exit_shell(state)
|
|
223
|
+
except Exception as e:
|
|
224
|
+
if is_windows and "EOF" in str(e).lower():
|
|
225
|
+
print("\nHint: On Windows, use Ctrl+Z then Enter for EOF, or type 'exit'")
|
|
226
|
+
continue
|
|
227
|
+
raise # Re-raise if it's not the expected case
|
|
228
|
+
|
|
223
229
|
def main() -> None:
|
|
224
230
|
parser = argparse.ArgumentParser(description="npcsh - An NPC-powered shell.")
|
|
225
231
|
parser.add_argument(
|
|
@@ -78,7 +78,7 @@ extra_files = package_files("npcsh/npc_team/")
|
|
|
78
78
|
|
|
79
79
|
setup(
|
|
80
80
|
name="npcsh",
|
|
81
|
-
version="1.0.
|
|
81
|
+
version="1.0.28",
|
|
82
82
|
packages=find_packages(exclude=["tests*"]),
|
|
83
83
|
install_requires=base_requirements, # Only install base requirements by default
|
|
84
84
|
extras_require={
|
|
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
|
|
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
|