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
@@ -0,0 +1,475 @@
1
+ Metadata-Version: 2.4
2
+ Name: minion-code
3
+ Version: 0.1.1
4
+ Summary: A Python project depending on minion
5
+ Author-email: User <user@example.com>
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: minionx
10
+ Requires-Dist: typer>=0.9.0
11
+ Requires-Dist: Pillow>=10.0.0
12
+ Requires-Dist: nest-asyncio>=1.5.0
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest; extra == "dev"
15
+ Requires-Dist: black; extra == "dev"
16
+ Requires-Dist: flake8; extra == "dev"
17
+ Requires-Dist: mypy; extra == "dev"
18
+ Provides-Extra: tui
19
+ Requires-Dist: textual>=0.40.0; extra == "tui"
20
+ Requires-Dist: rich>=13.0.0; extra == "tui"
21
+ Provides-Extra: agent
22
+ Requires-Dist: openai>=1.0.0; extra == "agent"
23
+ Provides-Extra: web
24
+ Requires-Dist: fastapi>=0.100.0; extra == "web"
25
+ Requires-Dist: uvicorn>=0.20.0; extra == "web"
26
+ Requires-Dist: pydantic>=2.0.0; extra == "web"
27
+ Dynamic: license-file
28
+
29
+ # MinionCodeAgent
30
+
31
+ An enhanced AI code assistant built on the Minion framework, pre-configured with rich development tools, optimized for code development tasks.
32
+
33
+ ## Features
34
+
35
+ - 🤖 **Intelligent Code Assistant**: Pre-configured AI agent designed for programming tasks
36
+ - 🔧 **Rich Toolset**: Automatically includes 12+ tools for file operations, command execution, web search, etc.
37
+ - ⚡ **Ready to Use**: One-line creation, no complex configuration needed
38
+ - 📝 **Conversation History**: Built-in conversation history tracking and management
39
+ - 🎯 **Optimized Prompts**: System prompts optimized for code development tasks
40
+ - 🛡️ **Security by Design**: Built-in security checks to prevent dangerous operations
41
+ - 🔌 **ACP Protocol Support**: Seamless integration with ACP clients like Zed editor
42
+
43
+ ## Installation
44
+
45
+ ### Option 1: Install from source (recommended for development)
46
+
47
+ ```bash
48
+ # Clone the dependency repository
49
+ git clone https://github.com/femto/minion
50
+
51
+ # Clone this repository
52
+ git clone https://github.com/femto/minion-code
53
+
54
+ # Enter the directory
55
+ cd minion-code
56
+
57
+ # Install minion dependency
58
+ pip install -e ../minion
59
+
60
+ # Install minion-code
61
+ pip install -e .
62
+ ```
63
+
64
+ In this case, `MINION_ROOT` is located at `../minion`
65
+
66
+ ### Option 2: Direct installation (recommended for general use)
67
+
68
+ ```bash
69
+ # Clone this repository
70
+ git clone https://github.com/femto/minion-code
71
+ cd minion-code
72
+
73
+ # Install dependencies
74
+ pip install minionx
75
+
76
+ # Install minion-code
77
+ pip install -e .
78
+ ```
79
+
80
+ In this case, `MINION_ROOT` is located at the current startup location
81
+
82
+ On startup, the actual path of `MINION_ROOT` will be displayed:
83
+ ```
84
+ 2025-11-13 12:21:48.042 | INFO | minion.const:get_minion_root:44 - MINION_ROOT set to: <some_path>
85
+ ```
86
+
87
+ # LLM Configuration
88
+
89
+ Please refer to https://github.com/femto/minion?tab=readme-ov-file#get-started
90
+
91
+ Make sure the config file is in `MINION_ROOT/config/config.yaml` or `~/.minion/config.yaml`
92
+
93
+ ## Quick Start
94
+
95
+ ### CLI Usage
96
+
97
+ ```bash
98
+ # Basic usage
99
+ mcode
100
+
101
+ # Specify working directory
102
+ mcode --dir /path/to/project
103
+
104
+ # Specify LLM model
105
+ mcode --model gpt-4o
106
+ mcode --model claude-3-5-sonnet
107
+
108
+ # Enable verbose output
109
+ mcode --verbose
110
+
111
+ # Load additional tools using MCP config file
112
+ mcode --config mcp.json
113
+
114
+ # Combined usage
115
+ mcode --dir /path/to/project --model gpt-4o --config mcp.json --verbose
116
+ ```
117
+
118
+ ### Model Configuration
119
+
120
+ Configure the default LLM model used by minion-code:
121
+
122
+ ```bash
123
+ # View current default model
124
+ mcode model
125
+
126
+ # Set default model (saved to ~/.minion/minion-code.json)
127
+ mcode model gpt-4o
128
+ mcode model claude-3-5-sonnet
129
+
130
+ # Clear default model (use built-in default)
131
+ mcode model --clear
132
+ ```
133
+
134
+ **Model Priority:**
135
+ 1. CLI `--model` argument (highest priority)
136
+ 2. Config file `~/.minion/minion-code.json`
137
+ 3. Built-in default (lowest priority)
138
+
139
+ ### ACP Protocol Support
140
+
141
+ MinionCodeAgent supports the [ACP (Agent Communication Protocol)](https://agentcommunicationprotocol.dev/) protocol, enabling integration with ACP-compatible clients like Zed editor.
142
+
143
+ ```bash
144
+ # Start ACP server (stdio mode)
145
+ mcode acp
146
+
147
+ # Specify working directory
148
+ mcode acp --dir /path/to/project
149
+
150
+ # Specify LLM model
151
+ mcode acp --model gpt-4o
152
+
153
+ # Enable verbose logging
154
+ mcode acp --verbose
155
+
156
+ # Skip tool permission prompts (auto-allow all tools)
157
+ mcode acp --dangerously-skip-permissions
158
+
159
+ # Combined usage
160
+ mcode acp --dir /path/to/project --model claude-3-5-sonnet --verbose
161
+ ```
162
+
163
+ #### Using with Zed Editor
164
+
165
+ Add the following to Zed's `settings.json`:
166
+
167
+ ```json
168
+ {
169
+ "agent_servers": {
170
+
171
+ "minion-code": {
172
+ "type": "custom",
173
+ "command": "/path/to/mcode",
174
+ "args": [
175
+ "acp"
176
+ ],
177
+ "env": {}
178
+ }
179
+ }
180
+ }
181
+ ```
182
+
183
+ #### Permission Management
184
+
185
+ In ACP mode, tool calls will request user permission:
186
+ - **Allow once**: Allow this time only
187
+ - **Always allow**: Permanently allow this tool (saved to `~/.minion/sessions/`)
188
+ - **Reject**: Deny execution
189
+
190
+ ### Programming Interface
191
+
192
+ ```python
193
+ import asyncio
194
+ from minion_code import MinionCodeAgent
195
+
196
+ async def main():
197
+ # Create AI code assistant with all tools auto-configured
198
+ agent = await MinionCodeAgent.create(
199
+ name="My Code Assistant",
200
+ llm="gpt-4.1"
201
+ )
202
+
203
+ # Chat with the AI assistant
204
+ response = await agent.run_async("List files in current directory")
205
+ print(response.answer)
206
+
207
+ response = await agent.run_async("Read the README.md file")
208
+ print(response.answer)
209
+
210
+ asyncio.run(main())
211
+ ```
212
+
213
+ ### Custom Configuration
214
+
215
+ ```python
216
+ # Custom system prompt and working directory
217
+ agent = await MinionCodeAgent.create(
218
+ name="Python Expert",
219
+ llm="gpt-4.1",
220
+ system_prompt="You are a specialized Python developer assistant.",
221
+ workdir="/path/to/project",
222
+ additional_tools=[MyCustomTool()]
223
+ )
224
+ ```
225
+
226
+ ### View Available Tools
227
+
228
+ ```python
229
+ # Print tools summary
230
+ agent.print_tools_summary()
231
+
232
+ # Get tools info
233
+ tools_info = agent.get_tools_info()
234
+ for tool in tools_info:
235
+ print(f"{tool['name']}: {tool['description']}")
236
+ ```
237
+
238
+ ## Built-in Tools
239
+
240
+ MinionCodeAgent automatically includes the following tool categories:
241
+
242
+ ### 📁 File and Directory Tools
243
+ - **FileReadTool**: Read file contents
244
+ - **FileWriteTool**: Write files
245
+ - **GrepTool**: Search text in files
246
+ - **GlobTool**: File pattern matching
247
+ - **LsTool**: List directory contents
248
+
249
+ ### 💻 System and Execution Tools
250
+ - **BashTool**: Execute shell commands
251
+ - **PythonInterpreterTool**: Execute Python code
252
+
253
+ ### 🌐 Network and Search Tools
254
+ - **WebSearchTool**: Web search
255
+ - **WikipediaSearchTool**: Wikipedia search
256
+ - **VisitWebpageTool**: Visit webpages
257
+
258
+ ### 🔧 Other Tools
259
+ - **UserInputTool**: User input
260
+ - **TodoWriteTool**: Task management write
261
+ - **TodoReadTool**: Task management read
262
+
263
+ ## MCP Tool Integration
264
+
265
+ MinionCodeAgent supports loading additional tools via MCP (Model Context Protocol) configuration files.
266
+
267
+ ### MCP Configuration File Format
268
+
269
+ Create a JSON configuration file (e.g., `mcp.json`):
270
+
271
+ ```json
272
+ {
273
+ "mcpServers": {
274
+ "chrome-devtools": {
275
+ "command": "npx",
276
+ "args": ["-y", "chrome-devtools-mcp@latest"],
277
+ "env": {
278
+ "FASTMCP_LOG_LEVEL": "ERROR"
279
+ },
280
+ "disabled": false,
281
+ "autoApprove": []
282
+ },
283
+ "filesystem": {
284
+ "command": "uvx",
285
+ "args": ["mcp-server-filesystem", "/tmp"],
286
+ "disabled": true,
287
+ "autoApprove": ["read_file", "list_directory"]
288
+ },
289
+ "git": {
290
+ "command": "uvx",
291
+ "args": ["mcp-server-git"],
292
+ "disabled": false,
293
+ "autoApprove": ["git_status", "git_log"]
294
+ }
295
+ }
296
+ }
297
+ ```
298
+
299
+ ### Configuration Options
300
+
301
+ - `command`: Command to start the MCP server
302
+ - `args`: List of command arguments
303
+ - `env`: Environment variables (optional)
304
+ - `disabled`: Whether to disable this server (default: false)
305
+ - `autoApprove`: List of tool names to auto-approve (optional)
306
+
307
+ ### Using MCP Configuration
308
+
309
+ ```bash
310
+ # Use MCP config file
311
+ minion-code --config examples/mcp_config.json
312
+
313
+ # View loaded tools (including MCP tools)
314
+ # In CLI, type: tools
315
+ ```
316
+
317
+ ### Using MCP Tools in Programming Interface
318
+
319
+ ```python
320
+ from minion_code.utils.mcp_loader import load_mcp_tools
321
+ from pathlib import Path
322
+
323
+ async def main():
324
+ # Load MCP tools
325
+ mcp_tools = await load_mcp_tools(Path("mcp.json"))
326
+
327
+ # Create agent with MCP tools
328
+ agent = await MinionCodeAgent.create(
329
+ name="Enhanced Assistant",
330
+ llm="gpt-4o-mini",
331
+ additional_tools=mcp_tools
332
+ )
333
+ ```
334
+
335
+ ## Conversation History Management
336
+
337
+ ```python
338
+ # Get conversation history
339
+ history = agent.get_conversation_history()
340
+ for entry in history:
341
+ print(f"User: {entry['user_message']}")
342
+ print(f"Agent: {entry['agent_response']}")
343
+
344
+ # Clear history
345
+ agent.clear_conversation_history()
346
+ ```
347
+
348
+ ## Comparison with Original Implementation
349
+
350
+ ### Before (Complex manual configuration)
351
+ ```python
352
+ # Need to manually import and configure all tools
353
+ from minion_code.tools import (
354
+ FileReadTool, FileWriteTool, BashTool,
355
+ GrepTool, GlobTool, LsTool,
356
+ PythonInterpreterTool, WebSearchTool,
357
+ # ... more tools
358
+ )
359
+
360
+ # Manually create tool instances
361
+ custom_tools = [
362
+ FileReadTool(),
363
+ FileWriteTool(),
364
+ BashTool(),
365
+ # ... more tool configuration
366
+ ]
367
+
368
+ # Manually set system prompt
369
+ SYSTEM_PROMPT = "You are a coding agent..."
370
+
371
+ # Create agent (~50 lines of code)
372
+ agent = await CodeAgent.create(
373
+ name="Minion Code Assistant",
374
+ llm="gpt-4o-mini",
375
+ system_prompt=SYSTEM_PROMPT,
376
+ tools=custom_tools,
377
+ )
378
+ ```
379
+
380
+ ### Now (Using MinionCodeAgent)
381
+ ```python
382
+ # One line of code completes all setup
383
+ agent = await MinionCodeAgent.create(
384
+ name="Minion Code Assistant",
385
+ llm="gpt-4o-mini"
386
+ )
387
+ ```
388
+
389
+ ## API Reference
390
+
391
+ ### MinionCodeAgent.create()
392
+
393
+ ```python
394
+ async def create(
395
+ name: str = "Minion Code Assistant",
396
+ llm: str = "gpt-4o-mini",
397
+ system_prompt: Optional[str] = None,
398
+ workdir: Optional[Union[str, Path]] = None,
399
+ additional_tools: Optional[List[Any]] = None,
400
+ **kwargs
401
+ ) -> MinionCodeAgent
402
+ ```
403
+
404
+ **Parameters:**
405
+ - `name`: Agent name
406
+ - `llm`: LLM model to use
407
+ - `system_prompt`: Custom system prompt (optional)
408
+ - `workdir`: Working directory (optional, defaults to current directory)
409
+ - `additional_tools`: List of additional tools (optional)
410
+ - `**kwargs`: Other parameters passed to CodeAgent.create()
411
+
412
+ ### Instance Methods
413
+
414
+ - `run_async(message: str)`: Run agent asynchronously
415
+ - `run(message: str)`: Run agent synchronously
416
+ - `get_conversation_history()`: Get conversation history
417
+ - `clear_conversation_history()`: Clear conversation history
418
+ - `get_tools_info()`: Get tools info
419
+ - `print_tools_summary()`: Print tools summary
420
+
421
+ ### Properties
422
+
423
+ - `agent`: Access underlying CodeAgent instance
424
+ - `tools`: Get available tools list
425
+ - `name`: Get agent name
426
+
427
+ ## Security Features
428
+
429
+ - **Command Execution Safety**: BashTool prohibits dangerous commands (e.g., `rm -rf`, `sudo`, etc.)
430
+ - **Python Execution Restrictions**: PythonInterpreterTool runs in a restricted environment, allowing only safe built-in functions and specified modules
431
+ - **File Access Control**: All file operations have path validation and error handling
432
+
433
+ ## Examples
434
+
435
+ See complete examples in the `examples/` directory:
436
+
437
+ - `simple_code_agent.py`: Basic MinionCodeAgent usage example
438
+ - `simple_tui.py`: Simplified TUI implementation
439
+ - `advanced_textual_tui.py`: Advanced TUI interface (using Textual library)
440
+ - `minion_agent_tui.py`: Original complex implementation (for comparison)
441
+ - `mcp_config.json`: MCP configuration file example
442
+ - `test_mcp_config.py`: MCP configuration loading test
443
+ - `demo_mcp_cli.py`: MCP CLI feature demo
444
+
445
+ Run examples:
446
+
447
+ ```bash
448
+ # Basic usage example
449
+ python examples/simple_code_agent.py
450
+
451
+ # Simple TUI
452
+ python examples/simple_tui.py
453
+
454
+ # Advanced TUI (requires textual: pip install textual rich)
455
+ python examples/advanced_textual_tui.py
456
+
457
+ # Test MCP config loading
458
+ python examples/test_mcp_config.py
459
+
460
+ # MCP CLI feature demo
461
+ python examples/demo_mcp_cli.py
462
+ ```
463
+
464
+ ## Documentation
465
+
466
+ - [LLM Configuration Guide](LLM_CONFIG.md) - How to configure Large Language Models (LLM)
467
+ - [MCP Tool Integration Guide](docs/MCP_GUIDE.md) - Detailed MCP configuration and usage guide
468
+
469
+ ## Contributing
470
+
471
+ Issues and Pull Requests are welcome to improve this project!
472
+
473
+ ## License
474
+
475
+ MIT License
@@ -0,0 +1,111 @@
1
+ examples/cli_entrypoint.py,sha256=ORYijAJhw-3GrFDQs-VqUQEeI-YeNzfChOnfbTzHvX8,1305
2
+ examples/file_freshness_example.py,sha256=w1a-yY0FJckHbzaTsBXiDxk_kRmf4VlMP6hFsbnInTU,3210
3
+ examples/file_watching_example.py,sha256=7MlFaDFDxHzC-FfJkX8Hs8UpP9hpzn5w__U86cQpkAk,3281
4
+ examples/interruptible_tui.py,sha256=QZvA88EaMzNg2FCNU7GiZEHbWz0VJkL-m7HrHVBX5aU,34881
5
+ examples/repl_tui.py,sha256=30Lv8WOKSx4QgqKRU7MnBL9tcaTTGUly8Ihpyrpsp9o,3704
6
+ examples/start.py,sha256=f29gpJjfCmwEcaxVTIbdpq8OyptMNkTEwuLupnE0AjY,4633
7
+ examples/components/agent_with_todos.py,sha256=vNXxjhdFJgj3XX-7UL0Hsk53m-P16xakdcbtQEBVFig,5640
8
+ examples/components/message_response_children_demo.py,sha256=HOWwg6i4EGavX7V0yOYVDvX2EkFVgHyAH3n8IRnvNaA,8021
9
+ examples/components/messages_component.py,sha256=aesrr_PGPr6sR-o53H4mLkHxpJJFfyacbDNwmDCOIhM,6288
10
+ examples/skills/example_usage.py,sha256=nbWUrAL5TaGDHw8NaKGwBoP3XptSgqETQ5nrwPwgyac,1545
11
+ minion_code/__init__.py,sha256=8D9zwSIj1m-6QXNOZ69KnHoIhSjWEbQ_fT7DqiykCP8,487
12
+ minion_code/cli.py,sha256=Hqyk1TOlnDS9yg-n-X5LmXHnkmHKllos9kSjCzeKKQI,18997
13
+ minion_code/cli_simple.py,sha256=mVCTEKZT7Wh95XFqZwx54AIaqjCtpgtrdcNSwPVlkJ4,24503
14
+ minion_code/const.py,sha256=prF9XPwJiKs9KB0V-s6WRbRourJ715QGvR9p-OrHBQs,171
15
+ minion_code/type_defs.py,sha256=24xIAdgLfmpxWkSEFcfI9sF8oygS90cQS5eZqtkK8LI,2326
16
+ minion_code/acp_server/__init__.py,sha256=td1rf-m6o3P63Vrt8aDv1JC32OhVFeIkk5_xx2UzXnY,960
17
+ minion_code/acp_server/agent.py,sha256=VzmJCzTqVJcXLBj2uiB321U3zx4-Ww9ihsj2QJk-KY8,18283
18
+ minion_code/acp_server/hooks.py,sha256=gsNDrR4EaT6GvotCrc_4XhML8hCsZy6Fq_gtNkjO16E,11994
19
+ minion_code/acp_server/main.py,sha256=YNAOFNhdmnty-1DCKRrWf5Broh0TvnTAYeLBSYlad6k,5754
20
+ minion_code/acp_server/permissions.py,sha256=cpx7ADauAfzmX3bXmXFVrBhzG5C-7Q_f_b7KjwtGKFw,4366
21
+ minion_code/acp_server/test_client.py,sha256=EZsEQP1IyEOBQbPsY7O9cDErV1FBNhzpj5crJIQPWlE,3810
22
+ minion_code/adapters/__init__.py,sha256=ct4Ihcr-BH8AIVD-l5QVtZcI-OZ_6YDxX_59ccw85B4,658
23
+ minion_code/adapters/output_adapter.py,sha256=GaBQh8ZmaGnGRHJpvCNlmuxoUDVHms_Li_enHIaO2_c,4969
24
+ minion_code/adapters/rich_adapter.py,sha256=ZL2kFh1UpQQ5sLee7Pye6kXOflF0BWlWm1C8v4gJitg,5088
25
+ minion_code/adapters/textual_adapter.py,sha256=h-kY1Bb7Xl88j9AU181OATv6FwitPsHpRuyITKqwMwI,8243
26
+ minion_code/agents/__init__.py,sha256=mI6cteVpZZ9K5fImmhjd9pZs_4vUL2GflXsrVDNNYkE,282
27
+ minion_code/agents/code_agent.py,sha256=hcVr5PsItXrsUEFNA5YnJm4E3IDLIfxl-tCBkh4NkYU,28832
28
+ minion_code/agents/hooks.py,sha256=Ns4JX0hCAgeSe3OOoY4vOcD1YG18m7FedOAXQUvOwdM,12444
29
+ minion_code/commands/__init__.py,sha256=0zc-i7frVhfmIcFJ8KY29my7cA_ozcX1ZhgSR7Ci9sM,6674
30
+ minion_code/commands/clear_command.py,sha256=d1BBuKvyiLHP1TvhU6MNTFogarXfPSlkEaHtS2FmZWk,1217
31
+ minion_code/commands/help_command.py,sha256=lef2YGPAVY-q9Szqzj8sfaqTsNHTL24NyjciH8jQvO0,2442
32
+ minion_code/commands/history_command.py,sha256=gp9_N2F-wMha2BtG3lKdYhakFxpCOhsGS0R8xQik2NQ,2795
33
+ minion_code/commands/model_command.py,sha256=WtJb-blwOxdTTnT9ruETtulmgutzB47jd094JK_YB3Y,7093
34
+ minion_code/commands/quit_command.py,sha256=XxUU9gwquSk60IUNUo4d8Wp3p4hNH_LnDf0p9V__YYo,825
35
+ minion_code/commands/resume_command.py,sha256=OEqV9gFnPu01FNFg78RzMim14xMhs0xkEHbphI8D31M,6064
36
+ minion_code/commands/skill_command.py,sha256=FCTTtyDRPoeRHObWVdkh84oroFC_EoDAsobYF7c-LUU,2467
37
+ minion_code/commands/status_command.py,sha256=lFeM9NoE0U6JH3iFIq9QcMKHR4LkSe01uwtxK7GLCtE,2880
38
+ minion_code/commands/tools_command.py,sha256=8H3w60_1lFKC-T5tAzPZxHwXhieS-x0W6Ob_A94tYIA,2716
39
+ minion_code/commands/version_command.py,sha256=QokKNt8DJDfTk7eNUS0eWF30eFnxjzND3VUH5F9vi70,2088
40
+ minion_code/components/ConfirmDialog.py,sha256=2krLr-lDwMz5OZO7ZKUMVY1L0XHT5A0tP1ljzak34p0,12343
41
+ minion_code/components/Message.py,sha256=Js1hYQJaFbwHoS0XGjHxRaGyuCho0lXiqYEm68fUJ8w,17978
42
+ minion_code/components/MessageResponse.py,sha256=IXJUuksI1quW3mO4hlE-pQxsO9rUTZMSjC0zY-JnAks,5359
43
+ minion_code/components/Messages.py,sha256=uPFMeLcpkCSyTyXJZJdx94rBGsAvyXUpAThoqJ0TKv0,12247
44
+ minion_code/components/PromptInput.py,sha256=xYxMSX4jfgKOlTfUsJUrUtkoHViM3DikTarg99Jrwls,27938
45
+ minion_code/components/__init__.py,sha256=rZEd-o0NQ77CgZMv0Bm6wek1sRSr-wWNFY5txrBcU70,906
46
+ minion_code/screens/REPL.py,sha256=BqE6QhztpRxDtGAm-iFQa3JKoWye8yDxAM7LC_6LNro,70575
47
+ minion_code/screens/__init__.py,sha256=8YdR6KEAV1np5QaGZCbRQMtkrjoWMZiG5Ps2QnAblSs,83
48
+ minion_code/services/__init__.py,sha256=DkDf4w_ZHruJETqzTExm4nfdg_Wo-tG4WzsrLmRtawA,1146
49
+ minion_code/services/event_system.py,sha256=KvVlSTXEm5io4ZM37SNpC46NPkXUZySe7cngtIahjxs,3653
50
+ minion_code/services/file_freshness_service.py,sha256=Wv0Ry5TEfDoUWNbxHRu8ifvuN90xiA3ClxqEEb1ONAc,22637
51
+ minion_code/skills/__init__.py,sha256=4QSO3l0ZtqXznoQjRbA_pXimOJa5jUwIhazqNO9kr8A,639
52
+ minion_code/skills/skill.py,sha256=LxxDRKsxaYJQTs_CZ1vxbMt63Rjgf25ISs2TzkMz4UI,3582
53
+ minion_code/skills/skill_loader.py,sha256=q40Yh6KOpFfpPT5-uKoVyqvZhyhk_o2ZS-OJ2OkXzP8,5907
54
+ minion_code/skills/skill_registry.py,sha256=-LgQ5RyK1_EGPeBoTladWhx_P-RNDlz0HubgY1WTWv8,4542
55
+ minion_code/subagents/__init__.py,sha256=pr915Oq7TRf6MQVNYY0OyUqhS8rM-4kPQUo5eIU_CIQ,873
56
+ minion_code/subagents/subagent.py,sha256=6QJTtdEBLFQXGj_0ntquDIpEhMzsaJrVcN3X8EURTJg,3948
57
+ minion_code/subagents/subagent_loader.py,sha256=rcI1X_VFq590vFqjuXvWHHu1qlenqX_IckZFynz-O6s,5241
58
+ minion_code/subagents/subagent_registry.py,sha256=z89GurRAKMLV7Qvixy_H8KEKYoMUnLhFi902OwBqrEI,4568
59
+ minion_code/subagents/builtin/__init__.py,sha256=v8lMzIoA-VZV1m6yjjJeD8F531jMKGe2t1tUifl1djs,798
60
+ minion_code/subagents/builtin/claude_code_guide.py,sha256=5RIcLTpZSQt_ZL1AcHQoWpmzRoPBod7Eojj0MKhkgsM,1292
61
+ minion_code/subagents/builtin/explore.py,sha256=uiM8vSGSckOl731-lVPQOAoOHZitxAPkSOsVF2q8ljM,1527
62
+ minion_code/subagents/builtin/general_purpose.py,sha256=D57aGJ2BzacbWvL45IjJPCPqVs-Q77i4OeSnDyDpdL4,706
63
+ minion_code/subagents/builtin/plan.py,sha256=gWkXXNl5Z8qj5WfTbIaI0NTKs-qPCcNyjiD7PzJOppE,2266
64
+ minion_code/tools/__init__.py,sha256=0PFk7Xdor7TRgsvU4arYPqxIfOq6mHe1K4lx6YcATPE,1715
65
+ minion_code/tools/bash_tool.py,sha256=LuLrfWMZeCixCviehyT44A8Sy1WAbqrVxubosVbml7Q,2403
66
+ minion_code/tools/file_edit_tool.py,sha256=JeNotMx6_vdbat1bvFoS9fmesJFF2lot3HD3J1cY_3I,12300
67
+ minion_code/tools/file_read_tool.py,sha256=7rsdTHyuI4j6F4Gkh48gyZxgyosVwPw5sRl-kK8YsRQ,7695
68
+ minion_code/tools/file_write_tool.py,sha256=KO4xFBoLLyv2g_gRkKE4wUu6B7DHBj7p1rQsiMzKi6Q,1577
69
+ minion_code/tools/glob_tool.py,sha256=5WX-EErTP7iJVKX2yVnel-uMn3T1ZL4Tmm2b0K-YS7E,2695
70
+ minion_code/tools/grep_tool.py,sha256=J62BHVobVEKasnklm7efI3YpffybYghQT4Pqnzjk848,11333
71
+ minion_code/tools/ls_tool.py,sha256=NgUa9fbh2y_pQDoPunGkm5U1RFSpqTvwilQaQy63gao,3084
72
+ minion_code/tools/multi_edit_tool.py,sha256=PvQWh1zYjDf6UKPgCJshwvneI3S7NrEkDKk9fwmdX0U,10055
73
+ minion_code/tools/python_interpreter_tool.py,sha256=CejO0lR5IasMIeL627BOWFwmpC-TU3Q92hs67SmazCk,3533
74
+ minion_code/tools/skill_tool.py,sha256=1NmsNKpYwVN3gvU-QZWAk1Qk4HKO-D8hitk-tDxPd_o,6593
75
+ minion_code/tools/task_tool.py,sha256=ZC0NHEmjXEHqryYJqhTOIy-DGRdRTZ9guJ9FCJBDaPA,10117
76
+ minion_code/tools/todo_read_tool.py,sha256=vYjESEEcN9BNQXUtNJyJ92LA6-KZkSRpZwmjWUXdDBk,3492
77
+ minion_code/tools/todo_write_tool.py,sha256=riMYzWl8m0v1ydKlSoPuNnTBqsOLNcVTPytwvduEwUs,8747
78
+ minion_code/tools/user_input_tool.py,sha256=Ta-eOzDhNYo-PiZr3JX3JxiV0qQxQdpu-ObANOFTJfY,1633
79
+ minion_code/utils/__init__.py,sha256=EjY5EGi_3e04FxtapXZi4Gy4HU2vgGrkvupHu3iZmJA,1437
80
+ minion_code/utils/config.py,sha256=nrmeJSNIt0kZRpRKbac0Czyc_IbkVQzrwEiQ_pUHXLo,21912
81
+ minion_code/utils/history.py,sha256=sQv9ddgStX87yNRaeUi5eHzodB_MCeHWaQXVLQG-8-0,3087
82
+ minion_code/utils/logs.py,sha256=r0H4p3zZd1Zq3jn0aJrbJkw79_D1jV1lSeML2gxhBIE,1404
83
+ minion_code/utils/mcp_loader.py,sha256=QYcvnpN3Vx768xB_5WJIBLYYXwv4hn9eHQU4noohfaQ,9410
84
+ minion_code/utils/output_truncator.py,sha256=HjyUaLcIJezSP9Dx8_509kDBuJzOEFNFORclUDQ4Jmc,6892
85
+ minion_code/utils/session_storage.py,sha256=G0MS3OBlxC7AH7oq6VQvEtB5IRyWPtfUKv-L8PEQPTo,11630
86
+ minion_code/utils/todo_file_utils.py,sha256=KXMo4l7uLKtMsZzR2G50cIaFzikpH4S5c2rdoSym9do,2912
87
+ minion_code/utils/todo_storage.py,sha256=gECmTuWUWShI0BPI6HulLjfMmTg-BdGNXqnC26LaINE,4846
88
+ minion_code/web/__init__.py,sha256=ZjphQg60D1fvH4gtj9pfGccSztsQZgJZk9X2aX0mQgg,206
89
+ minion_code/web/server.py,sha256=nrmBjNvAudLe0ruRQlr8XUIHcjpPjMTPmVvPiz5euDE,3697
90
+ minion_code/web/adapters/__init__.py,sha256=iTc6JanCTOytgBCEXtgXHA1zT7osn5d77qHNeOv6ZXs,102
91
+ minion_code/web/adapters/web_adapter.py,sha256=hXCtaNbqsCTpDeHWVJXvKInodeZoTA8mrFDNo-F_17c,17247
92
+ minion_code/web/api/__init__.py,sha256=LLAyVHsqANEUpTrAn4_llADavY4jZIB46oDHA724D-o,247
93
+ minion_code/web/api/chat.py,sha256=KMCG7QVAw2smHBdc96LeYRErzPjIVhdJfEjff2kB5Jk,9598
94
+ minion_code/web/api/interactions.py,sha256=w07HLV4kYmlJqM_dzFPvZ5Kj4D7V9_6R_yxuUGgUGho,4257
95
+ minion_code/web/api/sessions.py,sha256=jGu6vSLRvqBSOn1QwR4O-Ub1ZV7oR2i7mbAScq07ntE,3808
96
+ minion_code/web/services/__init__.py,sha256=sJNm6URCvLBebW0GJ7JMQ_rjIKAiRBp12vn0qo3GVgY,131
97
+ minion_code/web/services/session_manager.py,sha256=z09CF4kWcAHSXnaCTEGQfUvhKDjAq7aw3H1VviVTsUI,13475
98
+ minion_code-0.1.1.dist-info/licenses/LICENSE,sha256=ILBn-G3jdarm2w8oOrLmXeJNU3czuJvVhDLBASWdhM8,34522
99
+ tests/__init__.py,sha256=Wk73Io62J15BtlLVIzxmASDWaaJkQLevS4BLK5LDAQg,16
100
+ tests/test_adapter.py,sha256=6DJOGgH1BXwwu725GuAlsZVQLzKzhPNnU07fkdVzm-k,2495
101
+ tests/test_adapter_simple.py,sha256=x1jkEjiaobR7M-5srOrl75EdyRPeW--BlsyRNvEOsYE,2587
102
+ tests/test_basic.py,sha256=7naqzwTF7zGSNPYObTfhD0GNCSBZ0E0vTSxoHtae4Ow,427
103
+ tests/test_file_read_tool.py,sha256=OMPluOG66uyyHXgatbb6pxgrl2js8bcRmc-HbPZnWWs,4653
104
+ tests/test_readonly_tools.py,sha256=-Y8JIVtk17gx-YfXkxu25_xWmbT6cN_KLD0quiZwFEk,2444
105
+ tests/test_skills.py,sha256=i_AWJGLbV9K2pmarHbbHFsMZe96UZhUkaM25eT27OSM,12042
106
+ tests/test_tools.py,sha256=37QOOVQ9KHRQpv6v2m0rBJ39KX0sB5QomhrSPiNxczs,2207
107
+ minion_code-0.1.1.dist-info/METADATA,sha256=rQdJouFDMGlPZlzGzxzhsFmlJnDREhUl0o-lHWaBFgw,11980
108
+ minion_code-0.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
109
+ minion_code-0.1.1.dist-info/entry_points.txt,sha256=W-MX70GjQhqa533jO4xQbpscEIJymRmEEaVQxxiD6_c,179
110
+ minion_code-0.1.1.dist-info/top_level.txt,sha256=L9ER44uG1buFZPVkazo5KUfNFewvi-raU-0kE_-EG6I,27
111
+ minion_code-0.1.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,6 @@
1
+ [console_scripts]
2
+ hi = minion_code.cli_simple:run
3
+ mc = minion_code.cli:run
4
+ mcode = minion_code.cli:run
5
+ mcode-simple = minion_code.cli_simple:run
6
+ minion-code = minion_code.cli:run
tests/test_adapter.py ADDED
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env python3
2
+ """Test script to verify OutputAdapter pattern works correctly"""
3
+
4
+ import asyncio
5
+ import pytest
6
+ from rich.console import Console
7
+ from minion_code.adapters import RichOutputAdapter
8
+ from minion_code.commands.clear_command import ClearCommand
9
+ from minion_code import MinionCodeAgent
10
+
11
+
12
+ @pytest.mark.asyncio
13
+ async def test_clear_command():
14
+ """Test the clear command with RichOutputAdapter"""
15
+ console = Console()
16
+ console.print("[bold blue]Testing Clear Command with OutputAdapter[/bold blue]\n")
17
+
18
+ # Create output adapter
19
+ output_adapter = RichOutputAdapter(console)
20
+ console.print("✅ Created RichOutputAdapter")
21
+
22
+ # Create a mock agent with some history
23
+ agent = await MinionCodeAgent.create(name="Test Agent", llm="sonnet")
24
+ console.print("✅ Created MinionCodeAgent")
25
+
26
+ # Add some fake history
27
+ agent._conversation_history = [
28
+ {"user_message": "Hello", "agent_response": "Hi there!"},
29
+ {"user_message": "How are you?", "agent_response": "I'm doing well!"},
30
+ {"user_message": "Test message", "agent_response": "Test response"},
31
+ ]
32
+ console.print(f"✅ Added {len(agent._conversation_history)} messages to history\n")
33
+
34
+ # Create command instance with adapter
35
+ clear_command = ClearCommand(output_adapter, agent)
36
+ console.print("✅ Created ClearCommand with OutputAdapter\n")
37
+
38
+ # Test 1: Clear with force flag (should not prompt)
39
+ console.print("[bold yellow]Test 1: Clear with --force flag[/bold yellow]")
40
+ await clear_command.execute("--force")
41
+ console.print(
42
+ f"History after force clear: {len(agent._conversation_history)} messages\n"
43
+ )
44
+
45
+ # Add history back for second test
46
+ agent._conversation_history = [
47
+ {"user_message": "Hello", "agent_response": "Hi there!"},
48
+ {"user_message": "How are you?", "agent_response": "I'm doing well!"},
49
+ ]
50
+
51
+ # Test 2: Clear without force (will prompt for confirmation)
52
+ console.print(
53
+ "[bold yellow]Test 2: Clear without force (with confirmation prompt)[/bold yellow]"
54
+ )
55
+ console.print(
56
+ "[dim]Note: This will wait for your input. Type 'y' to confirm or 'n' to cancel.[/dim]\n"
57
+ )
58
+ await clear_command.execute("")
59
+ console.print(
60
+ f"History after interactive clear: {len(agent._conversation_history)} messages\n"
61
+ )
62
+
63
+ console.print("[bold green]✅ All tests completed successfully![/bold green]")
64
+
65
+
66
+ if __name__ == "__main__":
67
+ asyncio.run(test_clear_command())