npcsh 1.1.6__tar.gz → 1.1.7__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 (78) hide show
  1. {npcsh-1.1.6 → npcsh-1.1.7}/PKG-INFO +1 -1
  2. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/_state.py +46 -18
  3. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh.egg-info/PKG-INFO +1 -1
  4. {npcsh-1.1.6 → npcsh-1.1.7}/setup.py +1 -1
  5. {npcsh-1.1.6 → npcsh-1.1.7}/LICENSE +0 -0
  6. {npcsh-1.1.6 → npcsh-1.1.7}/README.md +0 -0
  7. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/__init__.py +0 -0
  8. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/alicanto.py +0 -0
  9. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/build.py +0 -0
  10. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/corca.py +0 -0
  11. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/guac.py +0 -0
  12. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/mcp_helpers.py +0 -0
  13. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/mcp_server.py +0 -0
  14. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc.py +0 -0
  15. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/alicanto.npc +0 -0
  16. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/alicanto.png +0 -0
  17. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/corca.npc +0 -0
  18. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/corca.png +0 -0
  19. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/corca_example.png +0 -0
  20. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/foreman.npc +0 -0
  21. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/frederic.npc +0 -0
  22. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/frederic4.png +0 -0
  23. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/guac.png +0 -0
  24. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/code/python.jinx +0 -0
  25. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/code/sh.jinx +0 -0
  26. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/code/sql.jinx +0 -0
  27. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/modes/alicanto.jinx +0 -0
  28. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/modes/corca.jinx +0 -0
  29. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/modes/guac.jinx +0 -0
  30. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/modes/plonk.jinx +0 -0
  31. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/modes/pti.jinx +0 -0
  32. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/modes/spool.jinx +0 -0
  33. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/modes/wander.jinx +0 -0
  34. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/modes/yap.jinx +0 -0
  35. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/breathe.jinx +0 -0
  36. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/core/build.jinx +0 -0
  37. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/core/compile.jinx +0 -0
  38. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/core/help.jinx +0 -0
  39. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/core/init.jinx +0 -0
  40. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/core/jinxs.jinx +0 -0
  41. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/core/set.jinx +0 -0
  42. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/edit_file.jinx +0 -0
  43. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/flush.jinx +0 -0
  44. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/npc-studio.jinx +0 -0
  45. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/ots.jinx +0 -0
  46. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/plan.jinx +0 -0
  47. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/roll.jinx +0 -0
  48. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/sample.jinx +0 -0
  49. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/search.jinx +0 -0
  50. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/serve.jinx +0 -0
  51. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/sleep.jinx +0 -0
  52. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/trigger.jinx +0 -0
  53. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/jinxs/utils/vixynt.jinx +0 -0
  54. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/kadiefa.npc +0 -0
  55. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/kadiefa.png +0 -0
  56. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/npcsh.ctx +0 -0
  57. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/npcsh_sibiji.png +0 -0
  58. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/plonk.npc +0 -0
  59. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/plonk.png +0 -0
  60. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/plonkjr.npc +0 -0
  61. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/plonkjr.png +0 -0
  62. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/sibiji.npc +0 -0
  63. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/sibiji.png +0 -0
  64. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/spool.png +0 -0
  65. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npc_team/yap.png +0 -0
  66. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/npcsh.py +0 -0
  67. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/plonk.py +0 -0
  68. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/pti.py +0 -0
  69. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/routes.py +0 -0
  70. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/spool.py +0 -0
  71. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/wander.py +0 -0
  72. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh/yap.py +0 -0
  73. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh.egg-info/SOURCES.txt +0 -0
  74. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh.egg-info/dependency_links.txt +0 -0
  75. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh.egg-info/entry_points.txt +0 -0
  76. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh.egg-info/requires.txt +0 -0
  77. {npcsh-1.1.6 → npcsh-1.1.7}/npcsh.egg-info/top_level.txt +0 -0
  78. {npcsh-1.1.6 → npcsh-1.1.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npcsh
3
- Version: 1.1.6
3
+ Version: 1.1.7
4
4
  Summary: npcsh is a command-line toolkit for using AI agents in novel ways.
5
5
  Home-page: https://github.com/NPC-Worldwide/npcsh
6
6
  Author: Christopher Agostino
@@ -317,7 +317,6 @@ def get_npc_path(npc_name: str, db_path: str) -> str:
317
317
 
318
318
  raise ValueError(f"NPC file not found: {npc_name}")
319
319
 
320
-
321
320
  def initialize_base_npcs_if_needed(db_path: str) -> None:
322
321
  """
323
322
  Function Description:
@@ -337,7 +336,7 @@ def initialize_base_npcs_if_needed(db_path: str) -> None:
337
336
  conn = sqlite3.connect(db_path)
338
337
  cursor = conn.cursor()
339
338
 
340
-
339
+ # Create table
341
340
  cursor.execute(
342
341
  """
343
342
  CREATE TABLE IF NOT EXISTS compiled_npcs (
@@ -348,7 +347,7 @@ def initialize_base_npcs_if_needed(db_path: str) -> None:
348
347
  """
349
348
  )
350
349
 
351
-
350
+ # Package directories
352
351
  package_dir = os.path.dirname(__file__)
353
352
  package_npc_team_dir = os.path.join(package_dir, "npc_team")
354
353
 
@@ -360,6 +359,7 @@ def initialize_base_npcs_if_needed(db_path: str) -> None:
360
359
  os.makedirs(user_jinxs_dir, exist_ok=True)
361
360
  os.makedirs(user_templates_dir, exist_ok=True)
362
361
 
362
+ # Copy .npc and .ctx files
363
363
  for filename in os.listdir(package_npc_team_dir):
364
364
  if filename.endswith(".npc"):
365
365
  source_path = os.path.join(package_npc_team_dir, filename)
@@ -378,19 +378,33 @@ def initialize_base_npcs_if_needed(db_path: str) -> None:
378
378
  shutil.copy2(source_path, destination_path)
379
379
  print(f"Copied ctx {filename} to {destination_path}")
380
380
 
381
-
381
+ # Copy jinxs directory RECURSIVELY
382
382
  package_jinxs_dir = os.path.join(package_npc_team_dir, "jinxs")
383
383
  if os.path.exists(package_jinxs_dir):
384
- for filename in os.listdir(package_jinxs_dir):
385
- if filename.endswith(".jinx"):
386
- source_jinx_path = os.path.join(package_jinxs_dir, filename)
387
- destination_jinx_path = os.path.join(user_jinxs_dir, filename)
388
- if (not os.path.exists(destination_jinx_path)) or file_has_changed(
389
- source_jinx_path, destination_jinx_path
390
- ):
391
- shutil.copy2(source_jinx_path, destination_jinx_path)
392
- print(f"Copied jinx {filename} to {destination_jinx_path}")
384
+ for root, dirs, files in os.walk(package_jinxs_dir):
385
+ # Calculate relative path from package_jinxs_dir
386
+ rel_path = os.path.relpath(root, package_jinxs_dir)
387
+
388
+ # Create corresponding directory in user jinxs
389
+ if rel_path == '.':
390
+ dest_dir = user_jinxs_dir
391
+ else:
392
+ dest_dir = os.path.join(user_jinxs_dir, rel_path)
393
+ os.makedirs(dest_dir, exist_ok=True)
394
+
395
+ # Copy all .jinx files in this directory
396
+ for filename in files:
397
+ if filename.endswith(".jinx"):
398
+ source_jinx_path = os.path.join(root, filename)
399
+ destination_jinx_path = os.path.join(dest_dir, filename)
400
+
401
+ if not os.path.exists(destination_jinx_path) or file_has_changed(
402
+ source_jinx_path, destination_jinx_path
403
+ ):
404
+ shutil.copy2(source_jinx_path, destination_jinx_path)
405
+ print(f"Copied jinx {os.path.join(rel_path, filename)} to {destination_jinx_path}")
393
406
 
407
+ # Copy templates directory
394
408
  templates = os.path.join(package_npc_team_dir, "templates")
395
409
  if os.path.exists(templates):
396
410
  for folder in os.listdir(templates):
@@ -414,6 +428,7 @@ def initialize_base_npcs_if_needed(db_path: str) -> None:
414
428
  set_npcsh_initialized()
415
429
  add_npcshrc_to_shell_config()
416
430
 
431
+
417
432
  def get_shell_config_file() -> str:
418
433
  """
419
434
 
@@ -2563,7 +2578,6 @@ def execute_command(
2563
2578
  state.messages = response['messages']
2564
2579
  return state, response['response']
2565
2580
 
2566
-
2567
2581
  def setup_shell() -> Tuple[CommandHistory, Team, Optional[NPC]]:
2568
2582
  setup_npcsh_config()
2569
2583
 
@@ -2586,9 +2600,13 @@ def setup_shell() -> Tuple[CommandHistory, Team, Optional[NPC]]:
2586
2600
 
2587
2601
  project_team_path = os.path.abspath(PROJECT_NPC_TEAM_PATH)
2588
2602
  global_team_path = os.path.expanduser(DEFAULT_NPC_TEAM_PATH)
2603
+
2589
2604
  team_dir = None
2590
2605
  default_forenpc_name = None
2591
-
2606
+ global_team_path = os.path.expanduser(DEFAULT_NPC_TEAM_PATH)
2607
+ if not os.path.exists(global_team_path):
2608
+ print(f"Global NPC team directory doesn't exist. Initializing...")
2609
+ initialize_base_npcs_if_needed(db_path)
2592
2610
  if os.path.exists(project_team_path):
2593
2611
  team_dir = project_team_path
2594
2612
  default_forenpc_name = "forenpc"
@@ -2635,9 +2653,17 @@ def setup_shell() -> Tuple[CommandHistory, Team, Optional[NPC]]:
2635
2653
  pass
2636
2654
  team_dir = global_team_path
2637
2655
  default_forenpc_name = "sibiji"
2638
- elif os.path.exists(global_team_path):
2656
+ else:
2639
2657
  team_dir = global_team_path
2640
- default_forenpc_name = "sibiji"
2658
+ default_forenpc_name = "sibiji"
2659
+
2660
+ if team_dir is None:
2661
+ team_dir = global_team_path
2662
+ default_forenpc_name = "sibiji"
2663
+
2664
+ if not os.path.exists(team_dir):
2665
+ print(f"Creating team directory: {team_dir}")
2666
+ os.makedirs(team_dir, exist_ok=True)
2641
2667
 
2642
2668
  team_ctx = {}
2643
2669
  team_ctx_path = get_team_ctx_path(team_dir)
@@ -2647,7 +2673,10 @@ def setup_shell() -> Tuple[CommandHistory, Team, Optional[NPC]]:
2647
2673
  team_ctx = yaml.safe_load(f) or {}
2648
2674
  except Exception as e:
2649
2675
  print(f"Warning: Could not load context file {os.path.basename(team_ctx_path)}: {e}")
2676
+
2650
2677
  forenpc_name = team_ctx.get("forenpc", default_forenpc_name)
2678
+ if forenpc_name is None:
2679
+ forenpc_name = "sibiji"
2651
2680
 
2652
2681
  print('forenpc_name:', forenpc_name)
2653
2682
 
@@ -2684,7 +2713,6 @@ def setup_shell() -> Tuple[CommandHistory, Team, Optional[NPC]]:
2684
2713
  team.name = "npcsh"
2685
2714
 
2686
2715
  return command_history, team, forenpc_obj
2687
-
2688
2716
  def initialize_router_with_jinxs(team, router):
2689
2717
  """Load global and team Jinxs into router"""
2690
2718
  global_jinxs_dir = os.path.expanduser("~/.npcsh/npc_team/jinxs")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npcsh
3
- Version: 1.1.6
3
+ Version: 1.1.7
4
4
  Summary: npcsh is a command-line toolkit for using AI agents in novel ways.
5
5
  Home-page: https://github.com/NPC-Worldwide/npcsh
6
6
  Author: Christopher Agostino
@@ -78,7 +78,7 @@ extra_files = package_files("npcsh/npc_team/")
78
78
 
79
79
  setup(
80
80
  name="npcsh",
81
- version="1.1.6",
81
+ version="1.1.7",
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