nimcode 0.1.10__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 (33) hide show
  1. {nimcode-0.1.10 → nimcode-0.1.12}/PKG-INFO +1 -1
  2. {nimcode-0.1.10 → nimcode-0.1.12}/setup.py +1 -1
  3. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/repl.py +57 -47
  4. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/PKG-INFO +1 -1
  5. {nimcode-0.1.10 → nimcode-0.1.12}/README.md +0 -0
  6. {nimcode-0.1.10 → nimcode-0.1.12}/setup.cfg +0 -0
  7. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/__init__.py +0 -0
  8. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/agent.py +0 -0
  9. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/cli.py +0 -0
  10. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/config.py +0 -0
  11. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/lenient_parser.py +0 -0
  12. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/mcp_client.py +0 -0
  13. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/memory.py +0 -0
  14. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/nim_client.py +0 -0
  15. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/permissions.py +0 -0
  16. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/tools.py +0 -0
  17. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/SOURCES.txt +0 -0
  18. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/dependency_links.txt +0 -0
  19. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/entry_points.txt +0 -0
  20. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/requires.txt +0 -0
  21. {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/top_level.txt +0 -0
  22. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_agent.py +0 -0
  23. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_cli.py +0 -0
  24. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_config.py +0 -0
  25. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_lenient_parser.py +0 -0
  26. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_mcp_client.py +0 -0
  27. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_memory.py +0 -0
  28. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_nim_client.py +0 -0
  29. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_permissions.py +0 -0
  30. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_repl.py +0 -0
  31. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_repl_extra.py +0 -0
  32. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_repl_trust.py +0 -0
  33. {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nimcode
3
- Version: 0.1.10
3
+ Version: 0.1.12
4
4
  Summary: A standalone, robust coding agent for NVIDIA NIM models.
5
5
  Author: Autonomous Agent
6
6
  Requires-Dist: httpx>=0.27.0
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="nimcode",
5
- version="0.1.10",
5
+ version="0.1.12",
6
6
  packages=find_packages(where="src"),
7
7
  package_dir={"": "src"},
8
8
  install_requires=[
@@ -1,5 +1,6 @@
1
1
  import os
2
2
  import sys
3
+ import asyncio
3
4
  import shutil
4
5
  import json
5
6
  import logging
@@ -238,51 +239,60 @@ class NimcodeREPL:
238
239
  ('class:toolbar_text', f' Model: {self.model} | Mode: {mode} | Tokens: {tokens} | Cost: ${cost:.4f} | Effort: {effort}{goal_ui}'),
239
240
  ('class:toolbar_shortcut', ' [Alt+Enter] multiline '),
240
241
  ]
241
- from prompt_toolkit.completion import NestedCompleter, WordCompleter, PathCompleter
242
+ from prompt_toolkit.completion import Completer, Completion, PathCompleter
242
243
 
243
- command_completer = NestedCompleter.from_nested_dict({
244
- '/help': None,
245
- '/plan': None,
246
- '/code': None,
247
- '/models': None,
248
- '/theme': WordCompleter(['monokai', 'dracula', 'nord', 'github']),
249
- '/clear': None,
250
- '/compact': None,
251
- '/commit': None,
252
- '/fix': None,
253
- '/testgen': PathCompleter(),
254
- '/vision': None,
255
- '/voice': None,
256
- '/index': None,
257
- '/exit': None,
258
- '/quit': None,
259
- '/learn': None,
260
- '/cost': None,
261
- '/effort': WordCompleter(['Low', 'Medium', 'High']),
262
- '/thinking': None,
263
- '/add': PathCompleter(),
264
- '/research': None,
265
- '/swarm': None,
266
- '/tdd': None,
267
- '/mcp': WordCompleter(['install']),
268
- '/rewind': None,
269
- '/fork': None,
270
- '/grill-me': None,
271
- '/teleport': PathCompleter(),
272
- '/buddy': None,
273
- '/ultraplan': None,
274
- '/bughunter': None,
275
- '/security-review': None,
276
- '/doctor': None,
277
- '/permissions': WordCompleter(['auto', 'bypass', 'default']),
278
- '/graph': None,
279
- '/guardian': None,
280
- '/thinkback': None,
281
- '/autofix-pr': None,
282
- '/terraform-god': None,
283
- '/sql-tune': None,
284
- '/decompile': PathCompleter(),
285
- })
244
+ class SlashCompleter(Completer):
245
+ def __init__(self):
246
+ self.commands = [
247
+ '/help', '/plan', '/code', '/models', '/theme', '/clear', '/compact',
248
+ '/commit', '/fix', '/testgen', '/vision', '/voice', '/index', '/exit',
249
+ '/quit', '/learn', '/cost', '/effort', '/thinking', '/add', '/research',
250
+ '/swarm', '/tdd', '/mcp', '/rewind', '/fork', '/grill-me', '/teleport',
251
+ '/buddy', '/ultraplan', '/bughunter', '/security-review', '/doctor',
252
+ '/permissions', '/graph', '/guardian', '/thinkback', '/autofix-pr',
253
+ '/terraform-god', '/sql-tune', '/decompile'
254
+ ]
255
+ self.subcommands = {
256
+ '/theme': ['monokai', 'dracula', 'nord', 'github'],
257
+ '/effort': ['Low', 'Medium', 'High'],
258
+ '/mcp': ['install'],
259
+ '/permissions': ['auto', 'bypass', 'default']
260
+ }
261
+ self.path_completer = PathCompleter()
262
+
263
+ def get_completions(self, document, complete_event):
264
+ text = document.text_before_cursor
265
+ parts = text.split()
266
+
267
+ if not parts:
268
+ return
269
+
270
+ if len(parts) == 1 or (len(parts) == 2 and text.endswith(' ')):
271
+ if not text.endswith(' '):
272
+ word = parts[0]
273
+ for c in self.commands:
274
+ if c.startswith(word):
275
+ yield Completion(c, start_position=-len(word))
276
+ else:
277
+ cmd = parts[0]
278
+ if cmd in self.subcommands:
279
+ for sub in self.subcommands[cmd]:
280
+ yield Completion(sub, start_position=0)
281
+ elif cmd in ['/testgen', '/add', '/teleport', '/decompile']:
282
+ yield from self.path_completer.get_completions(document, complete_event)
283
+
284
+ elif len(parts) >= 2:
285
+ cmd = parts[0]
286
+ word = parts[-1] if not text.endswith(' ') else ''
287
+
288
+ if cmd in self.subcommands:
289
+ for sub in self.subcommands[cmd]:
290
+ if sub.startswith(word):
291
+ yield Completion(sub, start_position=-len(word))
292
+ elif cmd in ['/testgen', '/add', '/teleport', '/decompile']:
293
+ yield from self.path_completer.get_completions(document, complete_event)
294
+
295
+ command_completer = SlashCompleter()
286
296
 
287
297
  from prompt_toolkit.lexers import PygmentsLexer
288
298
  from pygments.lexers.shell import BashLexer
@@ -897,7 +907,6 @@ class NimcodeREPL:
897
907
  console.print(f"\n\n[bold magenta]🔬 Subagent Research Complete for '{q}'![/bold magenta]\n{result}\n")
898
908
  self.messages.append({"role": "system", "content": f"A background subagent completed research on '{q}'. Result:\n{result}"})
899
909
 
900
- import asyncio
901
910
  asyncio.create_task(bg_research(query))
902
911
  console.print("[dim italic]Subagent spawned in background. You can continue chatting![/dim italic]")
903
912
  continue
@@ -955,7 +964,6 @@ class NimcodeREPL:
955
964
 
956
965
  console.print(f"\n[bold magenta]🐝 Swarm Finished![/bold magenta]\n[bold]Review:[/bold]\n{review}")
957
966
 
958
- import asyncio
959
967
  asyncio.create_task(run_swarm(task))
960
968
  continue
961
969
  elif user_input.strip().startswith("/tdd "):
@@ -973,7 +981,6 @@ class NimcodeREPL:
973
981
  result = await tdd_agent.run_headless(feat, max_turns=10)
974
982
  console.print(f"\n[bold green]🧪 TDD Completed![/bold green]\n{result}")
975
983
 
976
- import asyncio
977
984
  asyncio.create_task(run_tdd(feature))
978
985
  continue
979
986
  elif user_input.strip().startswith("/"):
@@ -999,6 +1006,9 @@ class NimcodeREPL:
999
1006
  except KeyboardInterrupt:
1000
1007
  console.print("\n[bold yellow]⚠ Operation cancelled by user. (Press Ctrl+D to exit)[/bold yellow]")
1001
1008
  continue
1009
+ except asyncio.CancelledError:
1010
+ console.print("\n[bold yellow]⚠ Operation cancelled by user. (Press Ctrl+D to exit)[/bold yellow]")
1011
+ continue
1002
1012
  except EOFError:
1003
1013
  break
1004
1014
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nimcode
3
- Version: 0.1.10
3
+ Version: 0.1.12
4
4
  Summary: A standalone, robust coding agent for NVIDIA NIM models.
5
5
  Author: Autonomous Agent
6
6
  Requires-Dist: httpx>=0.27.0
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