gitarsenal-cli 1.9.65 → 1.9.67

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 (72) hide show
  1. package/.venv_status.json +1 -1
  2. package/bin/gitarsenal.js +24 -0
  3. package/kill_claude/.claude/settings.local.json +9 -0
  4. package/kill_claude/README.md +265 -0
  5. package/kill_claude/__pycache__/bash_output_tool.cpython-313.pyc +0 -0
  6. package/kill_claude/__pycache__/bash_tool.cpython-313.pyc +0 -0
  7. package/kill_claude/__pycache__/claude_code_agent.cpython-313.pyc +0 -0
  8. package/kill_claude/__pycache__/edit_tool.cpython-313.pyc +0 -0
  9. package/kill_claude/__pycache__/exit_plan_mode_tool.cpython-313.pyc +0 -0
  10. package/kill_claude/__pycache__/glob_tool.cpython-313.pyc +0 -0
  11. package/kill_claude/__pycache__/grep_tool.cpython-313.pyc +0 -0
  12. package/kill_claude/__pycache__/kill_bash_tool.cpython-313.pyc +0 -0
  13. package/kill_claude/__pycache__/ls_tool.cpython-313.pyc +0 -0
  14. package/kill_claude/__pycache__/multiedit_tool.cpython-313.pyc +0 -0
  15. package/kill_claude/__pycache__/notebook_edit_tool.cpython-313.pyc +0 -0
  16. package/kill_claude/__pycache__/read_tool.cpython-313.pyc +0 -0
  17. package/kill_claude/__pycache__/task_tool.cpython-313.pyc +0 -0
  18. package/kill_claude/__pycache__/todo_write_tool.cpython-313.pyc +0 -0
  19. package/kill_claude/__pycache__/web_fetch_tool.cpython-313.pyc +0 -0
  20. package/kill_claude/__pycache__/web_search_tool.cpython-313.pyc +0 -0
  21. package/kill_claude/__pycache__/write_tool.cpython-313.pyc +0 -0
  22. package/kill_claude/claude_code_agent.py +848 -0
  23. package/kill_claude/prompts/claude-code-agent-prompts.md +65 -0
  24. package/kill_claude/prompts/claude-code-environment-context.md +100 -0
  25. package/kill_claude/prompts/claude-code-git-workflows.md +151 -0
  26. package/kill_claude/prompts/claude-code-hook-system.md +94 -0
  27. package/kill_claude/prompts/claude-code-response-formatting.md +79 -0
  28. package/kill_claude/prompts/claude-code-security-constraints.md +87 -0
  29. package/kill_claude/prompts/claude-code-system-prompt.md +136 -0
  30. package/kill_claude/prompts/claude-code-system-reminders.md +50 -0
  31. package/kill_claude/prompts/claude-code-task-workflows.md +114 -0
  32. package/kill_claude/prompts/claude-code-thinking-mode-prompts.md +39 -0
  33. package/kill_claude/prompts/claude-code-tool-prompts.md +339 -0
  34. package/kill_claude/prompts/claude-code-tool-usage-policies.md +87 -0
  35. package/kill_claude/requirements.txt +1 -0
  36. package/kill_claude/tools/__init__.py +1 -0
  37. package/kill_claude/tools/__pycache__/bash_output_tool.cpython-313.pyc +0 -0
  38. package/kill_claude/tools/__pycache__/bash_tool.cpython-313.pyc +0 -0
  39. package/kill_claude/tools/__pycache__/edit_tool.cpython-313.pyc +0 -0
  40. package/kill_claude/tools/__pycache__/exit_plan_mode_tool.cpython-313.pyc +0 -0
  41. package/kill_claude/tools/__pycache__/glob_tool.cpython-313.pyc +0 -0
  42. package/kill_claude/tools/__pycache__/grep_tool.cpython-313.pyc +0 -0
  43. package/kill_claude/tools/__pycache__/kill_bash_tool.cpython-313.pyc +0 -0
  44. package/kill_claude/tools/__pycache__/ls_tool.cpython-313.pyc +0 -0
  45. package/kill_claude/tools/__pycache__/multiedit_tool.cpython-313.pyc +0 -0
  46. package/kill_claude/tools/__pycache__/notebook_edit_tool.cpython-313.pyc +0 -0
  47. package/kill_claude/tools/__pycache__/read_tool.cpython-313.pyc +0 -0
  48. package/kill_claude/tools/__pycache__/task_tool.cpython-313.pyc +0 -0
  49. package/kill_claude/tools/__pycache__/todo_write_tool.cpython-313.pyc +0 -0
  50. package/kill_claude/tools/__pycache__/web_fetch_tool.cpython-313.pyc +0 -0
  51. package/kill_claude/tools/__pycache__/web_search_tool.cpython-313.pyc +0 -0
  52. package/kill_claude/tools/__pycache__/write_tool.cpython-313.pyc +0 -0
  53. package/kill_claude/tools/bash_output_tool.py +47 -0
  54. package/kill_claude/tools/bash_tool.py +79 -0
  55. package/kill_claude/tools/edit_tool.py +60 -0
  56. package/kill_claude/tools/exit_plan_mode_tool.py +42 -0
  57. package/kill_claude/tools/glob_tool.py +46 -0
  58. package/kill_claude/tools/grep_tool.py +105 -0
  59. package/kill_claude/tools/kill_bash_tool.py +38 -0
  60. package/kill_claude/tools/ls_tool.py +44 -0
  61. package/kill_claude/tools/multiedit_tool.py +111 -0
  62. package/kill_claude/tools/notebook_edit_tool.py +64 -0
  63. package/kill_claude/tools/read_tool.py +61 -0
  64. package/kill_claude/tools/task_tool.py +67 -0
  65. package/kill_claude/tools/todo_write_tool.py +114 -0
  66. package/kill_claude/tools/web_fetch_tool.py +55 -0
  67. package/kill_claude/tools/web_search_tool.py +58 -0
  68. package/kill_claude/tools/write_tool.py +46 -0
  69. package/lib/sandbox.js +3 -0
  70. package/package.json +1 -1
  71. package/python/test_modalSandboxScript.py +144 -295
  72. package/python/gitarsenal.py +0 -488
package/.venv_status.json CHANGED
@@ -1 +1 @@
1
- {"created":"2025-08-14T08:39:09.974Z","packages":["modal","gitingest","requests","anthropic"],"uv_version":"uv 0.8.4 (Homebrew 2025-07-30)"}
1
+ {"created":"2025-08-14T20:59:50.666Z","packages":["modal","gitingest","requests","anthropic"],"uv_version":"uv 0.8.4 (Homebrew 2025-07-30)"}
package/bin/gitarsenal.js CHANGED
@@ -695,6 +695,7 @@ keysCmd
695
695
  program
696
696
  .option('-r, --repo <url>', 'GitHub repository URL')
697
697
  .option('-g, --gpu <type>', 'GPU type (A10G, A100, H100, T4, L4, L40S, V100)')
698
+ .option('-c, --gpu-count <number>', 'Number of GPUs to use (1-8)', '1')
698
699
  .option('-v, --volume <n>', 'Name of persistent volume')
699
700
  .option('-y, --yes', 'Skip confirmation prompts')
700
701
  .option('-m, --manual', 'Disable automatic setup command detection')
@@ -743,6 +744,7 @@ async function runContainerCommand(options) {
743
744
  // If repo URL not provided, prompt for it
744
745
  let repoUrl = options.repoUrl || options.repo;
745
746
  let gpuType = options.gpu;
747
+ let gpuCount = parseInt(options.gpuCount) || 1;
746
748
  let volumeName = options.volumeName || options.volume;
747
749
  let skipConfirmation = options.yes;
748
750
  let useApi = !options.manual;
@@ -830,6 +832,27 @@ async function runContainerCommand(options) {
830
832
  gpuType = gpuAnswers.gpuType;
831
833
  }
832
834
 
835
+ // Prompt for GPU count if not already specified via CLI
836
+ if (!options.gpuCount || gpuCount === 1) {
837
+ const gpuCountAnswers = await inquirer.prompt([
838
+ {
839
+ type: 'list',
840
+ name: 'gpuCount',
841
+ message: 'How many GPUs do you need?',
842
+ choices: [
843
+ { name: '1 GPU', value: 1 },
844
+ { name: '2 GPUs', value: 2 },
845
+ { name: '3 GPUs', value: 3 },
846
+ { name: '4 GPUs', value: 4 },
847
+ { name: '6 GPUs', value: 6 },
848
+ { name: '8 GPUs', value: 8 }
849
+ ],
850
+ default: gpuCount
851
+ }
852
+ ]);
853
+ gpuCount = gpuCountAnswers.gpuCount;
854
+ }
855
+
833
856
  // Prompt for persistent volume
834
857
  if (!volumeName && !skipConfirmation) {
835
858
  const volumeAnswers = await inquirer.prompt([
@@ -927,6 +950,7 @@ async function runContainerCommand(options) {
927
950
  await runContainer({
928
951
  repoUrl,
929
952
  gpuType,
953
+ gpuCount,
930
954
  volumeName,
931
955
  setupCommands,
932
956
  useApi,
@@ -0,0 +1,9 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(python test:*)",
5
+ "Bash(python:*)"
6
+ ],
7
+ "defaultMode": "acceptEdits"
8
+ }
9
+ }
@@ -0,0 +1,265 @@
1
+ # Claude Code Agent
2
+
3
+ A comprehensive Python implementation that replicates Claude Code's functionality by orchestrating all available tools to handle user queries intelligently.
4
+
5
+ ## 🎯 Overview
6
+
7
+ This project contains:
8
+ - **All 16 Claude Code tool definitions** as individual Python modules
9
+ - **Main orchestrator** (`claude_code_agent.py`) that handles user queries
10
+ - **Query parsing and intent recognition** system
11
+ - **Task management** with automatic todo list creation
12
+ - **Interactive CLI mode** similar to Claude Code's interface
13
+
14
+ ## 📁 Project Structure
15
+
16
+ ```
17
+ kill_claude/
18
+ ├── claude_code_agent.py # Main orchestrator file
19
+ ├── example_usage.py # Usage examples and demos
20
+ ├── README.md # This file
21
+ ├──
22
+ ├── Tool Definitions:
23
+ ├── task_tool.py # Task/Agent management
24
+ ├── bash_tool.py # Command execution
25
+ ├── glob_tool.py # File pattern matching
26
+ ├── grep_tool.py # Content search
27
+ ├── ls_tool.py # Directory listing
28
+ ├── read_tool.py # File reading
29
+ ├── edit_tool.py # File editing
30
+ ├── multiedit_tool.py # Multiple file edits
31
+ ├── write_tool.py # File writing
32
+ ├── notebook_edit_tool.py # Jupyter notebook editing
33
+ ├── web_fetch_tool.py # Web content fetching
34
+ ├── web_search_tool.py # Web searching
35
+ ├── todo_write_tool.py # Task management
36
+ ├── bash_output_tool.py # Background shell output
37
+ ├── kill_bash_tool.py # Shell termination
38
+ ├── exit_plan_mode_tool.py # Plan mode management
39
+ └──
40
+ └── Documentation (from Claude Code):
41
+ ├── claude-code-*.md # Claude Code internal docs
42
+ └── ...
43
+ ```
44
+
45
+ ## 🚀 Features
46
+
47
+ ### Core Capabilities
48
+ - **File Operations**: Read, write, edit, list files and directories
49
+ - **Search**: Content search in files, web search, pattern matching
50
+ - **Code Execution**: Run bash commands, package managers, git operations
51
+ - **Web Access**: Fetch web content, search the internet
52
+ - **Task Management**: Automatic todo list creation for complex tasks
53
+ - **Planning**: Support for multi-step task planning and execution
54
+
55
+ ### Intelligent Query Processing
56
+ - **Intent Recognition**: Automatically detects what the user wants to do
57
+ - **Tool Selection**: Chooses appropriate tools based on query analysis
58
+ - **Parameter Extraction**: Extracts relevant parameters from natural language
59
+ - **Context Awareness**: Maintains conversation context and task state
60
+
61
+ ### Interactive Features
62
+ - **CLI Mode**: Interactive command-line interface
63
+ - **Help System**: Built-in help and tool documentation
64
+ - **Error Handling**: Graceful error handling and user feedback
65
+ - **Task Tracking**: Visual task management with status updates
66
+
67
+ ## 🛠️ Installation
68
+
69
+ 1. **Clone or download** all the files to a directory
70
+ 2. **Install dependencies** (if needed):
71
+ ```bash
72
+ pip install dataclasses # Python 3.6 only, built-in for 3.7+
73
+ ```
74
+ 3. **Make the main script executable**:
75
+ ```bash
76
+ chmod +x claude_code_agent.py
77
+ ```
78
+
79
+ ## 💻 Usage
80
+
81
+ ### Interactive Mode
82
+ Launch the interactive CLI:
83
+ ```bash
84
+ python claude_code_agent.py
85
+ ```
86
+
87
+ Example interaction:
88
+ ```
89
+ 🤖 Claude Code Agent - Interactive Mode
90
+ Type 'help' for available commands, 'exit' to quit
91
+ --------------------------------------------------
92
+
93
+ 👤 You: read main.py
94
+ 🤖 Claude Code Agent:
95
+ Processing query: read main.py
96
+ Detected intent: file_operation (confidence: 0.80)
97
+ Suggested tools: Read
98
+
99
+ Reading file: main.py
100
+ [file contents...]
101
+
102
+ 👤 You: implement user authentication system
103
+ 🤖 Claude Code Agent:
104
+ Processing query: implement user authentication system
105
+ Detected intent: complex_task (confidence: 0.90)
106
+ Suggested tools: TodoWrite, Task
107
+
108
+ Complex task identified. I've created a todo list to track progress...
109
+ ```
110
+
111
+ ### Single Query Mode
112
+ Process a single query from command line:
113
+ ```bash
114
+ python claude_code_agent.py "search for TODO comments"
115
+ python claude_code_agent.py "run pytest tests/"
116
+ python claude_code_agent.py "list all Python files"
117
+ ```
118
+
119
+ ### Example Usage
120
+ Run the examples to see all capabilities:
121
+ ```bash
122
+ python example_usage.py
123
+ ```
124
+
125
+ ## 📋 Supported Query Types
126
+
127
+ ### File Operations
128
+ - `"read main.py"` - Read file contents
129
+ - `"list files"` - List directory contents
130
+ - `"find *.py"` - Find files matching patterns
131
+ - `"edit config.json"` - Edit file contents
132
+
133
+ ### Search Operations
134
+ - `"search for TODO comments"` - Search in file contents
135
+ - `"find functions named login"` - Search for specific patterns
136
+ - `"web search Python best practices"` - Search the web
137
+
138
+ ### Code Execution
139
+ - `"run pytest"` - Execute commands
140
+ - `"git status"` - Git operations
141
+ - `"npm install express"` - Package management
142
+
143
+ ### Web Access
144
+ - `"fetch https://api.github.com"` - Fetch web content
145
+ - `"search web for AI news"` - Web search
146
+
147
+ ### Complex Tasks
148
+ - `"implement REST API"` - Multi-step development tasks
149
+ - `"build chat application"` - Complex project creation
150
+ - `"setup CI/CD pipeline"` - Infrastructure tasks
151
+
152
+ ## 🧠 How It Works
153
+
154
+ ### 1. Query Parsing
155
+ The agent analyzes user input using:
156
+ - **Pattern matching** against common command structures
157
+ - **Keyword detection** for intent classification
158
+ - **Parameter extraction** from natural language
159
+ - **Confidence scoring** for tool selection
160
+
161
+ ### 2. Intent Recognition
162
+ Classifies queries into categories:
163
+ - `FILE_OPERATION` - File and directory operations
164
+ - `SEARCH` - Content and web searching
165
+ - `CODE_EXECUTION` - Running commands and scripts
166
+ - `WEB_ACCESS` - Web content and APIs
167
+ - `COMPLEX_TASK` - Multi-step development tasks
168
+ - `TASK_MANAGEMENT` - Todo and planning operations
169
+
170
+ ### 3. Tool Orchestration
171
+ - **Automatic tool selection** based on intent and patterns
172
+ - **Parameter mapping** from parsed query to tool arguments
173
+ - **Sequential execution** for multi-step operations
174
+ - **Error handling** with user-friendly messages
175
+
176
+ ### 4. Task Management
177
+ For complex queries, automatically:
178
+ - **Creates todo lists** to track progress
179
+ - **Breaks down tasks** into manageable steps
180
+ - **Updates status** as work progresses
181
+ - **Manages context** across tool executions
182
+
183
+ ## 🎨 Customization
184
+
185
+ ### Adding New Tools
186
+ 1. Create a new tool file following the existing pattern:
187
+ ```python
188
+ class MyNewTool:
189
+ name = "MyNewTool"
190
+
191
+ @staticmethod
192
+ def schema():
193
+ return { /* JSON schema */ }
194
+
195
+ def execute(self, **kwargs):
196
+ # Tool implementation
197
+ pass
198
+ ```
199
+
200
+ 2. Import and register in `claude_code_agent.py`:
201
+ ```python
202
+ from my_new_tool import MyNewTool
203
+
204
+ # In ClaudeCodeAgent.__init__:
205
+ self.tools['MyNewTool'] = MyNewTool()
206
+ ```
207
+
208
+ ### Adding Query Patterns
209
+ Add new patterns to `tool_patterns` in `ClaudeCodeAgent`:
210
+ ```python
211
+ self.tool_patterns = {
212
+ r'\b(my|custom)\s+pattern\b': 'MyNewTool',
213
+ # ... existing patterns
214
+ }
215
+ ```
216
+
217
+ ### Customizing Intent Recognition
218
+ Modify the `parse_query` method to add new intents or improve classification logic.
219
+
220
+ ## 🔧 Technical Details
221
+
222
+ ### Architecture
223
+ - **Modular design** with separate tool definitions
224
+ - **Plugin-style architecture** for easy tool addition
225
+ - **State management** for conversation context
226
+ - **Event-driven execution** based on query parsing
227
+
228
+ ### Error Handling
229
+ - **Graceful degradation** when tools fail
230
+ - **User-friendly error messages**
231
+ - **Logging and debugging** support
232
+ - **Recovery mechanisms** for common issues
233
+
234
+ ### Performance
235
+ - **Lazy loading** of tool resources
236
+ - **Caching** for repeated operations
237
+ - **Parallel execution** where possible
238
+ - **Memory-efficient** query processing
239
+
240
+ ## 📖 Examples
241
+
242
+ See `example_usage.py` for comprehensive examples of:
243
+ - File operations workflow
244
+ - Development task management
245
+ - Debugging procedures
246
+ - Research and learning workflows
247
+ - Interactive feature demonstrations
248
+
249
+ ## 🤝 Contributing
250
+
251
+ This project replicates Claude Code's functionality for educational and research purposes. To contribute:
252
+
253
+ 1. **Add new tools** following the existing patterns
254
+ 2. **Improve query parsing** with better pattern recognition
255
+ 3. **Enhance error handling** for edge cases
256
+ 4. **Add more examples** and use cases
257
+ 5. **Optimize performance** for large codebases
258
+
259
+ ## 📄 License
260
+
261
+ This project is for educational purposes and demonstrates how Claude Code's functionality can be replicated using Python. Please respect Claude Code's actual terms of service when using this educational implementation.
262
+
263
+ ---
264
+
265
+ **Built with ❤️ to understand and replicate Claude Code's powerful agent capabilities**