minion-code 0.1.0__py3-none-any.whl → 0.1.1__py3-none-any.whl

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 (115) hide show
  1. examples/cli_entrypoint.py +60 -0
  2. examples/{agent_with_todos.py → components/agent_with_todos.py} +58 -47
  3. examples/{message_response_children_demo.py → components/message_response_children_demo.py} +61 -55
  4. examples/components/messages_component.py +199 -0
  5. examples/file_freshness_example.py +22 -22
  6. examples/file_watching_example.py +32 -26
  7. examples/interruptible_tui.py +921 -3
  8. examples/repl_tui.py +129 -0
  9. examples/skills/example_usage.py +57 -0
  10. examples/start.py +173 -0
  11. minion_code/__init__.py +1 -1
  12. minion_code/acp_server/__init__.py +34 -0
  13. minion_code/acp_server/agent.py +539 -0
  14. minion_code/acp_server/hooks.py +354 -0
  15. minion_code/acp_server/main.py +194 -0
  16. minion_code/acp_server/permissions.py +142 -0
  17. minion_code/acp_server/test_client.py +104 -0
  18. minion_code/adapters/__init__.py +22 -0
  19. minion_code/adapters/output_adapter.py +207 -0
  20. minion_code/adapters/rich_adapter.py +169 -0
  21. minion_code/adapters/textual_adapter.py +254 -0
  22. minion_code/agents/__init__.py +2 -2
  23. minion_code/agents/code_agent.py +517 -104
  24. minion_code/agents/hooks.py +378 -0
  25. minion_code/cli.py +538 -429
  26. minion_code/cli_simple.py +665 -0
  27. minion_code/commands/__init__.py +136 -29
  28. minion_code/commands/clear_command.py +19 -46
  29. minion_code/commands/help_command.py +33 -49
  30. minion_code/commands/history_command.py +37 -55
  31. minion_code/commands/model_command.py +194 -0
  32. minion_code/commands/quit_command.py +9 -12
  33. minion_code/commands/resume_command.py +181 -0
  34. minion_code/commands/skill_command.py +89 -0
  35. minion_code/commands/status_command.py +48 -73
  36. minion_code/commands/tools_command.py +54 -52
  37. minion_code/commands/version_command.py +34 -69
  38. minion_code/components/ConfirmDialog.py +430 -0
  39. minion_code/components/Message.py +318 -97
  40. minion_code/components/MessageResponse.py +30 -29
  41. minion_code/components/Messages.py +351 -0
  42. minion_code/components/PromptInput.py +499 -245
  43. minion_code/components/__init__.py +24 -17
  44. minion_code/const.py +7 -0
  45. minion_code/screens/REPL.py +1453 -469
  46. minion_code/screens/__init__.py +1 -1
  47. minion_code/services/__init__.py +20 -20
  48. minion_code/services/event_system.py +19 -14
  49. minion_code/services/file_freshness_service.py +223 -170
  50. minion_code/skills/__init__.py +25 -0
  51. minion_code/skills/skill.py +128 -0
  52. minion_code/skills/skill_loader.py +198 -0
  53. minion_code/skills/skill_registry.py +177 -0
  54. minion_code/subagents/__init__.py +31 -0
  55. minion_code/subagents/builtin/__init__.py +30 -0
  56. minion_code/subagents/builtin/claude_code_guide.py +32 -0
  57. minion_code/subagents/builtin/explore.py +36 -0
  58. minion_code/subagents/builtin/general_purpose.py +19 -0
  59. minion_code/subagents/builtin/plan.py +61 -0
  60. minion_code/subagents/subagent.py +116 -0
  61. minion_code/subagents/subagent_loader.py +147 -0
  62. minion_code/subagents/subagent_registry.py +151 -0
  63. minion_code/tools/__init__.py +8 -2
  64. minion_code/tools/bash_tool.py +16 -3
  65. minion_code/tools/file_edit_tool.py +201 -104
  66. minion_code/tools/file_read_tool.py +183 -26
  67. minion_code/tools/file_write_tool.py +17 -3
  68. minion_code/tools/glob_tool.py +23 -2
  69. minion_code/tools/grep_tool.py +229 -21
  70. minion_code/tools/ls_tool.py +28 -3
  71. minion_code/tools/multi_edit_tool.py +89 -84
  72. minion_code/tools/python_interpreter_tool.py +9 -1
  73. minion_code/tools/skill_tool.py +210 -0
  74. minion_code/tools/task_tool.py +287 -0
  75. minion_code/tools/todo_read_tool.py +28 -24
  76. minion_code/tools/todo_write_tool.py +82 -65
  77. minion_code/{types.py → type_defs.py} +15 -2
  78. minion_code/utils/__init__.py +45 -17
  79. minion_code/utils/config.py +610 -0
  80. minion_code/utils/history.py +114 -0
  81. minion_code/utils/logs.py +53 -0
  82. minion_code/utils/mcp_loader.py +153 -55
  83. minion_code/utils/output_truncator.py +233 -0
  84. minion_code/utils/session_storage.py +369 -0
  85. minion_code/utils/todo_file_utils.py +26 -22
  86. minion_code/utils/todo_storage.py +43 -33
  87. minion_code/web/__init__.py +9 -0
  88. minion_code/web/adapters/__init__.py +5 -0
  89. minion_code/web/adapters/web_adapter.py +524 -0
  90. minion_code/web/api/__init__.py +7 -0
  91. minion_code/web/api/chat.py +277 -0
  92. minion_code/web/api/interactions.py +136 -0
  93. minion_code/web/api/sessions.py +135 -0
  94. minion_code/web/server.py +149 -0
  95. minion_code/web/services/__init__.py +5 -0
  96. minion_code/web/services/session_manager.py +420 -0
  97. minion_code-0.1.1.dist-info/METADATA +475 -0
  98. minion_code-0.1.1.dist-info/RECORD +111 -0
  99. {minion_code-0.1.0.dist-info → minion_code-0.1.1.dist-info}/WHEEL +1 -1
  100. minion_code-0.1.1.dist-info/entry_points.txt +6 -0
  101. tests/test_adapter.py +67 -0
  102. tests/test_adapter_simple.py +79 -0
  103. tests/test_file_read_tool.py +144 -0
  104. tests/test_readonly_tools.py +0 -2
  105. tests/test_skills.py +441 -0
  106. examples/advance_tui.py +0 -508
  107. examples/rich_example.py +0 -4
  108. examples/simple_file_watching.py +0 -57
  109. examples/simple_tui.py +0 -267
  110. examples/simple_usage.py +0 -69
  111. minion_code-0.1.0.dist-info/METADATA +0 -350
  112. minion_code-0.1.0.dist-info/RECORD +0 -59
  113. minion_code-0.1.0.dist-info/entry_points.txt +0 -4
  114. {minion_code-0.1.0.dist-info → minion_code-0.1.1.dist-info}/licenses/LICENSE +0 -0
  115. {minion_code-0.1.0.dist-info → minion_code-0.1.1.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
1
  """
2
2
  Screens module for minion_code
3
3
  Contains UI screen components using Textual
4
- """
4
+ """
@@ -27,24 +27,24 @@ from .file_freshness_service import (
27
27
 
28
28
  __all__ = [
29
29
  # Event system
30
- 'EventDispatcher',
31
- 'EventContext',
32
- 'EventType',
33
- 'EventCallback',
34
- 'global_event_dispatcher',
35
- 'add_event_listener',
36
- 'emit_event',
37
- 'remove_event_listener',
30
+ "EventDispatcher",
31
+ "EventContext",
32
+ "EventType",
33
+ "EventCallback",
34
+ "global_event_dispatcher",
35
+ "add_event_listener",
36
+ "emit_event",
37
+ "remove_event_listener",
38
38
  # File freshness service
39
- 'FileFreshnessService',
40
- 'FileTimestamp',
41
- 'FreshnessResult',
42
- 'file_freshness_service',
43
- 'record_file_read',
44
- 'record_file_edit',
45
- 'check_file_freshness',
46
- 'generate_file_modification_reminder',
47
- 'reset_file_freshness_session',
48
- 'start_watching_todo_file',
49
- 'stop_watching_todo_file',
50
- ]
39
+ "FileFreshnessService",
40
+ "FileTimestamp",
41
+ "FreshnessResult",
42
+ "file_freshness_service",
43
+ "record_file_read",
44
+ "record_file_edit",
45
+ "check_file_freshness",
46
+ "generate_file_modification_reminder",
47
+ "reset_file_freshness_session",
48
+ "start_watching_todo_file",
49
+ "stop_watching_todo_file",
50
+ ]
@@ -10,6 +10,7 @@ logger = logging.getLogger(__name__)
10
10
 
11
11
  class EventType(Enum):
12
12
  """Supported event types."""
13
+
13
14
  SESSION_STARTUP = "session:startup"
14
15
  TODO_CHANGED = "todo:changed"
15
16
  TODO_FILE_CHANGED = "todo:file_changed"
@@ -25,6 +26,7 @@ class EventType(Enum):
25
26
  @dataclass
26
27
  class EventContext:
27
28
  """Context data for events."""
29
+
28
30
  event_type: str
29
31
  timestamp: float
30
32
  data: Dict[str, Any]
@@ -35,17 +37,17 @@ EventCallback = Callable[[EventContext], None]
35
37
 
36
38
  class EventDispatcher:
37
39
  """Simple event dispatcher for handling system events."""
38
-
40
+
39
41
  def __init__(self):
40
42
  self._listeners: Dict[str, List[EventCallback]] = {}
41
-
43
+
42
44
  def add_event_listener(self, event_type: str, callback: EventCallback) -> None:
43
45
  """Add an event listener for a specific event type."""
44
46
  if event_type not in self._listeners:
45
47
  self._listeners[event_type] = []
46
48
  self._listeners[event_type].append(callback)
47
49
  logger.debug(f"Added event listener for {event_type}")
48
-
50
+
49
51
  def remove_event_listener(self, event_type: str, callback: EventCallback) -> bool:
50
52
  """Remove a specific event listener."""
51
53
  if event_type in self._listeners:
@@ -56,33 +58,36 @@ class EventDispatcher:
56
58
  except ValueError:
57
59
  pass
58
60
  return False
59
-
60
- def emit_event(self, event_type: str, data: Optional[Dict[str, Any]] = None) -> None:
61
+
62
+ def emit_event(
63
+ self, event_type: str, data: Optional[Dict[str, Any]] = None
64
+ ) -> None:
61
65
  """Emit an event to all registered listeners."""
62
66
  if event_type not in self._listeners:
63
67
  return
64
-
68
+
65
69
  import time
70
+
66
71
  context = EventContext(
67
- event_type=event_type,
68
- timestamp=time.time(),
69
- data=data or {}
72
+ event_type=event_type, timestamp=time.time(), data=data or {}
70
73
  )
71
-
72
- listeners = self._listeners[event_type].copy() # Avoid modification during iteration
74
+
75
+ listeners = self._listeners[
76
+ event_type
77
+ ].copy() # Avoid modification during iteration
73
78
  for callback in listeners:
74
79
  try:
75
80
  callback(context)
76
81
  except Exception as error:
77
82
  logger.error(f"Error in event listener for {event_type}: {error}")
78
-
83
+
79
84
  def clear_listeners(self, event_type: Optional[str] = None) -> None:
80
85
  """Clear listeners for a specific event type or all listeners."""
81
86
  if event_type:
82
87
  self._listeners.pop(event_type, None)
83
88
  else:
84
89
  self._listeners.clear()
85
-
90
+
86
91
  def get_listener_count(self, event_type: str) -> int:
87
92
  """Get the number of listeners for an event type."""
88
93
  return len(self._listeners.get(event_type, []))
@@ -105,4 +110,4 @@ def emit_event(event_type: str, data: Optional[Dict[str, Any]] = None) -> None:
105
110
 
106
111
  def remove_event_listener(event_type: str, callback: EventCallback) -> bool:
107
112
  """Remove an event listener using the global dispatcher."""
108
- return global_event_dispatcher.remove_event_listener(event_type, callback)
113
+ return global_event_dispatcher.remove_event_listener(event_type, callback)