nimcode 0.4.2__tar.gz → 0.4.3__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 (48) hide show
  1. {nimcode-0.4.2 → nimcode-0.4.3}/PKG-INFO +1 -1
  2. nimcode-0.4.3/src/nimcode/__version__.py +1 -0
  3. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/agent.py +11 -4
  4. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/PKG-INFO +1 -1
  5. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_agent.py +2 -2
  6. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_version.py +3 -3
  7. nimcode-0.4.2/src/nimcode/__version__.py +0 -1
  8. {nimcode-0.4.2 → nimcode-0.4.3}/README.md +0 -0
  9. {nimcode-0.4.2 → nimcode-0.4.3}/setup.cfg +0 -0
  10. {nimcode-0.4.2 → nimcode-0.4.3}/setup.py +0 -0
  11. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/__init__.py +0 -0
  12. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/cli.py +0 -0
  13. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/config.py +0 -0
  14. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/lenient_parser.py +0 -0
  15. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/mcp_client.py +0 -0
  16. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/memory.py +0 -0
  17. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/model_registry.py +0 -0
  18. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/nim_client.py +0 -0
  19. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/permissions.py +0 -0
  20. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/plugin_manager.py +0 -0
  21. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/rag.py +0 -0
  22. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/repl.py +0 -0
  23. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/repo_map.py +0 -0
  24. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/tools.py +0 -0
  25. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/updater.py +0 -0
  26. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/watcher.py +0 -0
  27. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/SOURCES.txt +0 -0
  28. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/dependency_links.txt +0 -0
  29. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/entry_points.txt +0 -0
  30. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/requires.txt +0 -0
  31. {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/top_level.txt +0 -0
  32. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_cli.py +0 -0
  33. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_config.py +0 -0
  34. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_lenient_parser.py +0 -0
  35. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_mcp_client.py +0 -0
  36. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_memory.py +0 -0
  37. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_model_registry.py +0 -0
  38. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_nim_client.py +0 -0
  39. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_permissions.py +0 -0
  40. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_plan_injection.py +0 -0
  41. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_plugin_manager.py +0 -0
  42. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_repl.py +0 -0
  43. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_repl_extra.py +0 -0
  44. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_repl_fixes.py +0 -0
  45. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_repl_trust.py +0 -0
  46. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_repo_map.py +0 -0
  47. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_tools.py +0 -0
  48. {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_updater.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nimcode
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: A standalone, robust coding agent for NVIDIA NIM models.
5
5
  Home-page: https://github.com/Batunash/nimcode
6
6
  Author: Autonomous Agent
@@ -0,0 +1 @@
1
+ __version__ = "0.4.3"
@@ -327,7 +327,7 @@ class Agent:
327
327
  return "Subagent reached max turns before completing."
328
328
 
329
329
  async def _distill_memory(self) -> list:
330
- system_msg = self.messages[0]
330
+ system_msg = dict(self.messages[0])
331
331
  recent_msgs = self.messages[-4:] if len(self.messages) > 4 else self.messages[1:]
332
332
  old_msgs = self.messages[1:-4] if len(self.messages) > 4 else []
333
333
 
@@ -335,16 +335,23 @@ class Agent:
335
335
  return self.messages
336
336
 
337
337
  summary_prompt = "You are a summarization AI. Please summarize the following conversation concisely. Focus on the final state, any completed goals, and any context needed for the next steps:\n\n"
338
+
339
+ existing_summary_marker = "\n\n[PREVIOUS MEMORY SUMMARY]\n"
340
+ if existing_summary_marker in system_msg["content"]:
341
+ parts = system_msg["content"].split(existing_summary_marker, 1)
342
+ system_msg["content"] = parts[0]
343
+ summary_prompt += f"Previous summary to include:\n{parts[1]}\n\n"
344
+
338
345
  for m in old_msgs:
339
346
  summary_prompt += f"{m['role'].upper()}: {str(m['content'])[:500]}...\n"
340
347
 
341
348
  try:
342
349
  summary = await self.client.chat_one_shot(summary_prompt)
343
- system_msg["content"] += f"\n\n[PREVIOUS MEMORY SUMMARY]\n{summary}"
350
+ system_msg["content"] += f"{existing_summary_marker}{summary}"
351
+ return [system_msg] + recent_msgs
344
352
  except Exception as e:
345
353
  logger.error(f"Distillation failed: {e}")
346
-
347
- return [system_msg] + recent_msgs
354
+ return self.messages
348
355
 
349
356
  async def run(self, initial_prompt: str = None) -> None:
350
357
  """Main execution loop for NimCode agent."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nimcode
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: A standalone, robust coding agent for NVIDIA NIM models.
5
5
  Home-page: https://github.com/Batunash/nimcode
6
6
  Author: Autonomous Agent
@@ -99,8 +99,8 @@ async def test_distill_memory(agent):
99
99
  agent.client.chat_one_shot = AsyncMock(return_value="Summarized history")
100
100
 
101
101
  new_msgs = await agent._distill_memory()
102
- assert "[PREVIOUS MEMORY SUMMARY]" in agent.messages[0]["content"]
103
- assert "Summarized history" in agent.messages[0]["content"]
102
+ assert "[PREVIOUS MEMORY SUMMARY]" in new_msgs[0]["content"]
103
+ assert "Summarized history" in new_msgs[0]["content"]
104
104
  assert len(new_msgs) == 5
105
105
 
106
106
  @pytest.mark.asyncio
@@ -11,10 +11,10 @@ def test_version_format():
11
11
  assert part.isdigit(), f"Version part '{part}' is not a digit"
12
12
 
13
13
 
14
- def test_version_is_0_4_2():
15
- """Current version should be 0.4.2."""
14
+ def test_version_is_0_4_3():
15
+ """Current version should be 0.4.3."""
16
16
  from nimcode.__version__ import __version__
17
- assert __version__ == "0.4.2"
17
+ assert __version__ == "0.4.3"
18
18
 
19
19
 
20
20
  def test_updater_uses_version():
@@ -1 +0,0 @@
1
- __version__ = "0.4.2"
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