gitarsenal-cli 1.9.95 → 1.9.97

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 (37) hide show
  1. package/.venv_status.json +1 -1
  2. package/README.md +29 -0
  3. package/bin/gitarsenal.js +220 -127
  4. package/kill_claude/requirements.txt +1 -1
  5. package/lib/dependencies.js +130 -4
  6. package/lib/e2b-sandbox.js +158 -0
  7. package/lib/execAsync.js +12 -0
  8. package/lib/sandbox.js +97 -113
  9. package/package.json +2 -1
  10. package/python/__pycache__/credentials_manager.cpython-312.pyc +0 -0
  11. package/python/__pycache__/e2b_sandbox_agent.cpython-313.pyc +0 -0
  12. package/python/__pycache__/fetch_modal_tokens.cpython-312.pyc +0 -0
  13. package/python/credentials_manager.py +2 -1
  14. package/python/e2b_sandbox_agent.py +787 -0
  15. package/python/fetch_modal_tokens.py +47 -25
  16. package/python/requirements.txt +2 -1
  17. package/python/test_enhanced_sandbox_script.py +1429 -0
  18. package/python/test_modalSandboxScript.py +42 -6
  19. package/scripts/setup_e2b.js +162 -0
  20. package/kill_claude/.claude/settings.local.json +0 -9
  21. package/kill_claude/__pycache__/bash_output_tool.cpython-313.pyc +0 -0
  22. package/kill_claude/__pycache__/bash_tool.cpython-313.pyc +0 -0
  23. package/kill_claude/__pycache__/claude_code_agent.cpython-313.pyc +0 -0
  24. package/kill_claude/__pycache__/edit_tool.cpython-313.pyc +0 -0
  25. package/kill_claude/__pycache__/exit_plan_mode_tool.cpython-313.pyc +0 -0
  26. package/kill_claude/__pycache__/glob_tool.cpython-313.pyc +0 -0
  27. package/kill_claude/__pycache__/grep_tool.cpython-313.pyc +0 -0
  28. package/kill_claude/__pycache__/kill_bash_tool.cpython-313.pyc +0 -0
  29. package/kill_claude/__pycache__/ls_tool.cpython-313.pyc +0 -0
  30. package/kill_claude/__pycache__/multiedit_tool.cpython-313.pyc +0 -0
  31. package/kill_claude/__pycache__/notebook_edit_tool.cpython-313.pyc +0 -0
  32. package/kill_claude/__pycache__/read_tool.cpython-313.pyc +0 -0
  33. package/kill_claude/__pycache__/task_tool.cpython-313.pyc +0 -0
  34. package/kill_claude/__pycache__/todo_write_tool.cpython-313.pyc +0 -0
  35. package/kill_claude/__pycache__/web_fetch_tool.cpython-313.pyc +0 -0
  36. package/kill_claude/__pycache__/web_search_tool.cpython-313.pyc +0 -0
  37. package/kill_claude/__pycache__/write_tool.cpython-313.pyc +0 -0
@@ -17,9 +17,9 @@ def fetch_default_tokens_from_gitarsenal():
17
17
  Fetch default Modal tokens and OpenAI API key from gitarsenal.dev API.
18
18
 
19
19
  Returns:
20
- tuple: (token_id, token_secret, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key) if successful, (None, None, None, None, None, None) otherwise
20
+ tuple: (token_id, token_secret, e2b_api_key, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key) if successful, (None, None, None, None, None, None, None) otherwise
21
21
  """
22
- endpoint = "https://gitarsenal.dev/api/credentials"
22
+ endpoint = "https://www.gitarsenal.dev/api/credentials" # Updated to use www subdomain
23
23
 
24
24
  try:
25
25
  headers = {
@@ -27,44 +27,45 @@ def fetch_default_tokens_from_gitarsenal():
27
27
  'Accept': 'application/json'
28
28
  }
29
29
 
30
- # print(f"šŸ”— Fetching default tokens from: {endpoint}")
30
+ print(f"šŸ”— Fetching default tokens from: {endpoint}")
31
31
 
32
32
  response = requests.get(endpoint, headers=headers, timeout=30)
33
33
 
34
- # print(f"šŸ“Š Status: {response.status_code}")
34
+ print(f"šŸ“Š Status: {response.status_code}")
35
35
 
36
36
  if response.status_code == 200:
37
37
  try:
38
38
  data = response.json()
39
+
39
40
  token_id = data.get("modalTokenId")
40
41
  token_secret = data.get("modalTokenSecret")
42
+ e2b_api_key = data.get("e2bApiKey") # This is the key from the server
41
43
  openai_api_key = data.get("openaiApiKey")
42
44
  anthropic_api_key = data.get("anthropicApiKey")
43
45
  openrouter_api_key = data.get("openrouterApiKey")
44
46
  groq_api_key = data.get("groqApiKey")
45
47
 
46
48
  if token_id and token_secret:
47
- # print("āœ… Successfully fetched default tokens from gitarsenal.dev")
48
- return token_id, token_secret, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key
49
+ return token_id, token_secret, e2b_api_key, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key
49
50
  else:
50
51
  print("āŒ Modal tokens not found in gitarsenal.dev response")
51
- return None, None, None, None, None, None
52
+ return None, None, None, None, None, None, None
52
53
  except json.JSONDecodeError:
53
54
  print("āŒ Invalid JSON response from gitarsenal.dev")
54
- return None, None, None, None, None, None
55
+ return None, None, None, None, None, None, None
55
56
  else:
56
57
  print(f"āŒ Failed to fetch from gitarsenal.dev: {response.status_code} - {response.text[:200]}")
57
- return None, None, None, None, None, None
58
+ return None, None, None, None, None, None, None
58
59
 
59
60
  except requests.exceptions.Timeout:
60
61
  print("āŒ Request timeout when fetching from gitarsenal.dev")
61
- return None, None, None, None, None, None
62
+ return None, None, None, None, None, None, None
62
63
  except requests.exceptions.ConnectionError:
63
64
  print("āŒ Connection failed to gitarsenal.dev")
64
- return None, None, None, None, None, None
65
+ return None, None, None, None, None, None, None
65
66
  except requests.exceptions.RequestException as e:
66
67
  print(f"āŒ Request failed to gitarsenal.dev: {e}")
67
- return None, None, None, None, None, None
68
+ return None, None, None, None, None, None, None
68
69
 
69
70
  def fetch_tokens_from_proxy(proxy_url=None, api_key=None):
70
71
  """
@@ -75,7 +76,7 @@ def fetch_tokens_from_proxy(proxy_url=None, api_key=None):
75
76
  api_key: API key for authentication
76
77
 
77
78
  Returns:
78
- tuple: (token_id, token_secret, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key) if successful, (None, None, None, None, None, None) otherwise
79
+ tuple: (token_id, token_secret, e2b_api_key, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key) if successful, (None, None, None, None, None, None, None) otherwise
79
80
  """
80
81
  # Use environment variables if not provided
81
82
  if not proxy_url:
@@ -92,12 +93,12 @@ def fetch_tokens_from_proxy(proxy_url=None, api_key=None):
92
93
  if not proxy_url:
93
94
  # print("āŒ No proxy URL provided or found in environment")
94
95
  # print("šŸ’” Set MODAL_PROXY_URL environment variable or use --proxy-url argument")
95
- return None, None, None, None, None, None
96
+ return None, None, None, None, None, None, None
96
97
 
97
98
  if not api_key:
98
99
  print("āŒ No API key provided or found in environment")
99
100
  print("šŸ’” Set MODAL_PROXY_API_KEY environment variable or use --proxy-api-key argument")
100
- return None, None, None, None, None, None
101
+ return None, None, None, None, None, None, None
101
102
 
102
103
  # Ensure the URL ends with a slash
103
104
  if not proxy_url.endswith("/"):
@@ -119,22 +120,23 @@ def fetch_tokens_from_proxy(proxy_url=None, api_key=None):
119
120
  data = response.json()
120
121
  token_id = data.get("token_id")
121
122
  token_secret = data.get("token_secret")
123
+ e2b_api_key = data.get("e2b_api_key")
122
124
  openai_api_key = data.get("openai_api_key")
123
125
  anthropic_api_key = data.get("anthropic_api_key")
124
126
  openrouter_api_key = data.get("openrouter_api_key")
125
127
  groq_api_key = data.get("groq_api_key")
126
128
  if token_id and token_secret:
127
129
  print("āœ… Successfully fetched tokens from proxy server")
128
- return token_id, token_secret, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key
130
+ return token_id, token_secret, e2b_api_key, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key
129
131
  else:
130
132
  print("āŒ Tokens not found in response")
131
- return None, None, None, None, None, None
133
+ return None, None, None, None, None, None, None
132
134
  else:
133
135
  print(f"āŒ Failed to fetch tokens: {response.status_code} - {response.text}")
134
- return None, None, None, None, None, None
136
+ return None, None, None, None, None, None, None
135
137
  except Exception as e:
136
138
  print(f"āŒ Error fetching tokens: {e}")
137
- return None, None, None, None, None, None
139
+ return None, None, None, None, None, None, None
138
140
 
139
141
  def get_tokens():
140
142
  """
@@ -142,27 +144,31 @@ def get_tokens():
142
144
  Also sets the tokens in environment variables.
143
145
 
144
146
  Returns:
145
- tuple: (token_id, token_secret, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key)
147
+ tuple: (token_id, token_secret, e2b_api_key, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key)
146
148
  """
147
149
  # Try to fetch from the proxy server
148
- token_id, token_secret, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key = fetch_tokens_from_proxy()
150
+ token_id, token_secret, e2b_api_key, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key = fetch_tokens_from_proxy()
149
151
 
150
152
  # If we couldn't fetch from the server, try to get default tokens from gitarsenal.dev
151
153
  if not token_id or not token_secret:
152
154
  # print("āš ļø Proxy server failed, trying to fetch default tokens from gitarsenal.dev")
153
- token_id, token_secret, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key = fetch_default_tokens_from_gitarsenal()
155
+ token_id, token_secret, e2b_api_key, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key = fetch_default_tokens_from_gitarsenal()
154
156
 
155
157
  # If we still don't have tokens, we can't proceed
156
158
  if not token_id or not token_secret:
157
159
  print("āŒ Failed to fetch tokens from both proxy server and gitarsenal.dev")
158
160
  print("šŸ’” Please check your network connection and API endpoints")
159
- return None, None, None, None, None, None
161
+ return None, None, None, None, None, None, None
160
162
 
161
163
  # Set the tokens in environment variables
162
164
  os.environ["MODAL_TOKEN_ID"] = token_id
163
165
  os.environ["MODAL_TOKEN_SECRET"] = token_secret
164
166
  # print(f"āœ… Set MODAL_TOKEN_ID and MODAL_TOKEN_SECRET environment variables")
165
167
 
168
+ # Set E2B API key if available
169
+ if e2b_api_key:
170
+ os.environ["E2B_API_KEY"] = e2b_api_key
171
+
166
172
  # Set OpenAI API key if available
167
173
  if openai_api_key:
168
174
  os.environ["OPENAI_API_KEY"] = openai_api_key
@@ -179,7 +185,7 @@ def get_tokens():
179
185
  if groq_api_key:
180
186
  os.environ["GROQ_API_KEY"] = groq_api_key
181
187
 
182
- return token_id, token_secret, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key
188
+ return token_id, token_secret, e2b_api_key, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key
183
189
 
184
190
  if __name__ == "__main__":
185
191
  # Parse command-line arguments if run directly
@@ -200,9 +206,10 @@ if __name__ == "__main__":
200
206
  print(f"āœ… Set MODAL_PROXY_API_KEY from command line")
201
207
 
202
208
  # Get tokens
203
- token_id, token_secret, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key = get_tokens()
209
+ token_id, token_secret, e2b_api_key, openai_api_key, anthropic_api_key, openrouter_api_key, groq_api_key = get_tokens()
204
210
  print(f"Token ID: {token_id}")
205
211
  print(f"Token Secret: {token_secret}")
212
+ print(f"E2B API Key: {e2b_api_key[:5] + '...' if e2b_api_key else None}")
206
213
  print(f"OpenAI API Key: {openai_api_key[:5] + '...' if openai_api_key else None}")
207
214
  print(f"Anthropic API Key: {anthropic_api_key[:5] + '...' if anthropic_api_key else None}")
208
215
  print(f"OpenRouter API Key: {openrouter_api_key[:5] + '...' if openrouter_api_key else None}")
@@ -212,6 +219,7 @@ if __name__ == "__main__":
212
219
  # print(f"\nšŸ” DEBUG: Checking environment variables")
213
220
  print(f"šŸ” MODAL_TOKEN_ID exists: {'Yes' if os.environ.get('MODAL_TOKEN_ID') else 'No'}")
214
221
  print(f"šŸ” MODAL_TOKEN_SECRET exists: {'Yes' if os.environ.get('MODAL_TOKEN_SECRET') else 'No'}")
222
+ print(f"šŸ” E2B_API_KEY exists: {'Yes' if os.environ.get('E2B_API_KEY') else 'No'}")
215
223
  print(f"šŸ” OPENAI_API_KEY exists: {'Yes' if os.environ.get('OPENAI_API_KEY') else 'No'}")
216
224
  print(f"šŸ” ANTHROPIC_API_KEY exists: {'Yes' if os.environ.get('ANTHROPIC_API_KEY') else 'No'}")
217
225
  print(f"šŸ” OPENROUTER_API_KEY exists: {'Yes' if os.environ.get('OPENROUTER_API_KEY') else 'No'}")
@@ -220,6 +228,8 @@ if __name__ == "__main__":
220
228
  print(f"šŸ” MODAL_TOKEN_ID length: {len(os.environ.get('MODAL_TOKEN_ID'))}")
221
229
  if os.environ.get('MODAL_TOKEN_SECRET'):
222
230
  print(f"šŸ” MODAL_TOKEN_SECRET length: {len(os.environ.get('MODAL_TOKEN_SECRET'))}")
231
+ if os.environ.get('E2B_API_KEY'):
232
+ print(f"šŸ” E2B_API_KEY length: {len(os.environ.get('E2B_API_KEY'))}")
223
233
  if os.environ.get('OPENAI_API_KEY'):
224
234
  print(f"šŸ” OPENAI_API_KEY length: {len(os.environ.get('OPENAI_API_KEY'))}")
225
235
  if os.environ.get('ANTHROPIC_API_KEY'):
@@ -235,6 +245,7 @@ if __name__ == "__main__":
235
245
  json.dump({
236
246
  "token_id": token_id,
237
247
  "token_secret": token_secret,
248
+ "e2b_api_key": e2b_api_key,
238
249
  "openai_api_key": openai_api_key,
239
250
  "anthropic_api_key": anthropic_api_key,
240
251
  "openrouter_api_key": openrouter_api_key,
@@ -266,6 +277,17 @@ if __name__ == "__main__":
266
277
  with open(env_file, 'r') as f:
267
278
  env_content = f.read()
268
279
 
280
+ # Update or add E2B_API_KEY
281
+ if e2b_api_key:
282
+ if "E2B_API_KEY" in env_content:
283
+ import re
284
+ env_content = re.sub(r'E2B_API_KEY=.*\n', f'E2B_API_KEY={e2b_api_key}\n', env_content)
285
+ else:
286
+ env_content += f'\nE2B_API_KEY={e2b_api_key}\n'
287
+ with open(env_file, 'w') as f:
288
+ f.write(env_content)
289
+ print(f"āœ… Updated E2B API key in {env_file}")
290
+
269
291
  # Update or add OPENAI_API_KEY
270
292
  if openai_api_key:
271
293
  if "OPENAI_API_KEY" in env_content:
@@ -7,4 +7,5 @@ flask-cors
7
7
  pexpect
8
8
  anthropic
9
9
  gitingest
10
- exa-py
10
+ exa-py
11
+ e2b-code-interpreter