npcsh 1.0.10__tar.gz → 1.0.11__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.10 → npcsh-1.0.11}/PKG-INFO +1 -1
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/npcsh.py +19 -4
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/routes.py +5 -23
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh.egg-info/PKG-INFO +1 -1
- {npcsh-1.0.10 → npcsh-1.0.11}/setup.py +2 -2
- {npcsh-1.0.10 → npcsh-1.0.11}/LICENSE +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/README.md +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/__init__.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/_state.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/alicanto.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/guac.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/mcp_helpers.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/mcp_npcsh.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/mcp_server.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/npc.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/plonk.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/pti.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/spool.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/wander.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh/yap.py +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh.egg-info/SOURCES.txt +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh.egg-info/dependency_links.txt +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh.egg-info/entry_points.txt +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh.egg-info/requires.txt +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/npcsh.egg-info/top_level.txt +0 -0
- {npcsh-1.0.10 → npcsh-1.0.11}/setup.cfg +0 -0
|
@@ -561,6 +561,15 @@ def execute_slash_command(command: str, stdin_input: Optional[str], state: Shell
|
|
|
561
561
|
"""Executes slash commands using the router or checking NPC/Team jinxs."""
|
|
562
562
|
command_parts = command.split()
|
|
563
563
|
command_name = command_parts[0].lstrip('/')
|
|
564
|
+
|
|
565
|
+
if command_name in ['n', 'npc']:
|
|
566
|
+
npc_to_switch_to = command_parts[1] if len(command_parts) > 1 else None
|
|
567
|
+
if npc_to_switch_to and state.team and npc_to_switch_to in state.team.npcs:
|
|
568
|
+
state.npc = state.team.npcs[npc_to_switch_to]
|
|
569
|
+
return state, f"Switched to NPC: {npc_to_switch_to}"
|
|
570
|
+
else:
|
|
571
|
+
available_npcs = list(state.team.npcs.keys()) if state.team else []
|
|
572
|
+
return state, colored(f"NPC '{npc_to_switch_to}' not found. Available NPCs: {', '.join(available_npcs)}", "red")
|
|
564
573
|
handler = router.get_route(command_name)
|
|
565
574
|
#print(handler)
|
|
566
575
|
if handler:
|
|
@@ -1247,7 +1256,7 @@ def print_welcome_message():
|
|
|
1247
1256
|
print(
|
|
1248
1257
|
"""
|
|
1249
1258
|
Welcome to \033[1;94mnpc\033[0m\033[1;38;5;202msh\033[0m!
|
|
1250
|
-
\033[1;94m \033[0m\033[1;38;5;202m
|
|
1259
|
+
\033[1;94m \033[0m\033[1;38;5;202m _ \\\\
|
|
1251
1260
|
\033[1;94m _ __ _ __ ___ \033[0m\033[1;38;5;202m ___ | |___ \\\\
|
|
1252
1261
|
\033[1;94m| '_ \\ | ' \\ / __|\033[0m\033[1;38;5;202m / __/ | |_ _| \\\\
|
|
1253
1262
|
\033[1;94m| | | || |_) |( |__ \033[0m\033[1;38;5;202m \\_ \\ | | | | //
|
|
@@ -1392,6 +1401,7 @@ def process_result(
|
|
|
1392
1401
|
final_output_str = None
|
|
1393
1402
|
if user_input =='/help':
|
|
1394
1403
|
render_markdown(output)
|
|
1404
|
+
|
|
1395
1405
|
elif result_state.stream_output:
|
|
1396
1406
|
|
|
1397
1407
|
if isinstance(output, dict):
|
|
@@ -1410,7 +1420,7 @@ def process_result(
|
|
|
1410
1420
|
|
|
1411
1421
|
elif output is not None:
|
|
1412
1422
|
final_output_str = str(output)
|
|
1413
|
-
render_markdown(
|
|
1423
|
+
render_markdown( final_output_str)
|
|
1414
1424
|
if final_output_str and result_state.messages and result_state.messages[-1].get("role") != "assistant":
|
|
1415
1425
|
result_state.messages.append({"role": "assistant", "content": final_output_str})
|
|
1416
1426
|
|
|
@@ -1434,8 +1444,13 @@ def process_result(
|
|
|
1434
1444
|
def run_repl(command_history: CommandHistory, initial_state: ShellState):
|
|
1435
1445
|
state = initial_state
|
|
1436
1446
|
print_welcome_message()
|
|
1437
|
-
|
|
1438
|
-
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
render_markdown(f'- Using {state.current_mode} mode. Use /agent, /cmd, /chat, or /ride to switch to other modes')
|
|
1450
|
+
render_markdown(f'- To switch to a different NPC, type /npc <npc_name> or /n <npc_name> to switch to that NPC.')
|
|
1451
|
+
render_markdown('\n- Here are the current NPCs available in your team: ' + ', '.join([npc_name for npc_name in state.team.npcs.keys()]))
|
|
1452
|
+
|
|
1453
|
+
|
|
1439
1454
|
is_windows = platform.system().lower().startswith("win")
|
|
1440
1455
|
try:
|
|
1441
1456
|
completer = make_completer(state)
|
|
@@ -258,27 +258,7 @@ def init_handler(command: str, **kwargs):
|
|
|
258
258
|
traceback.print_exc()
|
|
259
259
|
output = f"Error initializing project: {e}"
|
|
260
260
|
return {"output": output, "messages": messages}
|
|
261
|
-
|
|
262
|
-
@router.route("n")
|
|
263
|
-
@router.route("npc")
|
|
264
|
-
def switch_npc_handler(command: str, **kwargs) -> dict:
|
|
265
|
-
"""Switch to a different NPC"""
|
|
266
|
-
team = kwargs.get('team')
|
|
267
|
-
parts = command.split()
|
|
268
|
-
|
|
269
|
-
if len(parts) < 2:
|
|
270
|
-
if team:
|
|
271
|
-
available_npcs = list(team.npcs.keys())
|
|
272
|
-
return {"output": f"Available NPCs: {', '.join(available_npcs)}"}
|
|
273
|
-
return {"output": "No team loaded or no NPC specified"}
|
|
274
|
-
|
|
275
|
-
npc_name = parts[1]
|
|
276
|
-
if team and npc_name in team.npcs:
|
|
277
|
-
# We can't directly modify the state here, so return a special signal
|
|
278
|
-
return {"output": f"SWITCH_NPC:{npc_name}"}
|
|
279
|
-
else:
|
|
280
|
-
available_npcs = list(team.npcs.keys()) if team else []
|
|
281
|
-
return {"output": f"NPC '{npc_name}' not found. Available: {', '.join(available_npcs)}"}
|
|
261
|
+
|
|
282
262
|
|
|
283
263
|
|
|
284
264
|
|
|
@@ -289,8 +269,10 @@ def ots_handler(command: str, **kwargs):
|
|
|
289
269
|
npc = safe_get(kwargs, 'npc')
|
|
290
270
|
vision_model = safe_get(kwargs, 'model', NPCSH_VISION_MODEL)
|
|
291
271
|
vision_provider = safe_get(kwargs, 'provider', NPCSH_VISION_PROVIDER)
|
|
292
|
-
if vision_model == NPCSH_CHAT_MODEL:
|
|
293
|
-
|
|
272
|
+
if vision_model == NPCSH_CHAT_MODEL:
|
|
273
|
+
vision_model = NPCSH_VISION_MODEL
|
|
274
|
+
if vision_provider == NPCSH_CHAT_PROVIDER:
|
|
275
|
+
vision_provider = NPCSH_VISION_PROVIDER
|
|
294
276
|
|
|
295
277
|
messages = safe_get(kwargs, 'messages', [])
|
|
296
278
|
stream = safe_get(kwargs, 'stream', NPCSH_STREAM_OUTPUT)
|
|
@@ -84,14 +84,14 @@ extra_files = package_files("npcpy/npc_team/")
|
|
|
84
84
|
|
|
85
85
|
setup(
|
|
86
86
|
name="npcsh",
|
|
87
|
-
version="1.0.
|
|
87
|
+
version="1.0.11",
|
|
88
88
|
packages=find_packages(exclude=["tests*"]),
|
|
89
89
|
install_requires=base_requirements, # Only install base requirements by default
|
|
90
90
|
extras_require={
|
|
91
91
|
"lite": api_requirements, # Just API integrations
|
|
92
92
|
"local": local_requirements, # Local AI/ML features
|
|
93
93
|
"yap": voice_requirements, # Voice/Audio features
|
|
94
|
-
|
|
94
|
+
"mcp": mcp_requirements, # MCP integration
|
|
95
95
|
"all": api_requirements + local_requirements + voice_requirements + mcp_requirements, # Everything
|
|
96
96
|
},
|
|
97
97
|
entry_points={
|
|
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
|