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.
- {nimcode-0.1.10 → nimcode-0.1.12}/PKG-INFO +1 -1
- {nimcode-0.1.10 → nimcode-0.1.12}/setup.py +1 -1
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/repl.py +57 -47
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/PKG-INFO +1 -1
- {nimcode-0.1.10 → nimcode-0.1.12}/README.md +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/setup.cfg +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/__init__.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/agent.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/cli.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/config.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/lenient_parser.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/mcp_client.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/memory.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/nim_client.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/permissions.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode/tools.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/SOURCES.txt +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/dependency_links.txt +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/entry_points.txt +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/requires.txt +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/src/nimcode.egg-info/top_level.txt +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_agent.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_cli.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_config.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_lenient_parser.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_mcp_client.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_memory.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_nim_client.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_permissions.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_repl.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_repl_extra.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_repl_trust.py +0 -0
- {nimcode-0.1.10 → nimcode-0.1.12}/tests/test_tools.py +0 -0
|
@@ -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
|
|
242
|
+
from prompt_toolkit.completion import Completer, Completion, PathCompleter
|
|
242
243
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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
|
|
|
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
|