gitarsenal-cli 1.9.12 โ†’ 1.9.14

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.
package/.venv_status.json CHANGED
@@ -1 +1 @@
1
- {"created":"2025-08-05T14:22:25.927Z","packages":["modal","gitingest","requests"],"uv_version":"uv 0.8.4 (Homebrew 2025-07-30)"}
1
+ {"created":"2025-08-06T07:28:37.576Z","packages":["modal","gitingest","requests","anthropic"],"uv_version":"uv 0.8.4 (Homebrew 2025-07-30)"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitarsenal-cli",
3
- "version": "1.9.12",
3
+ "version": "1.9.14",
4
4
  "description": "CLI tool for creating Modal sandboxes with GitHub repositories",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -4,4 +4,5 @@ pathlib>=1.0.1
4
4
  python-dotenv>=1.0.0
5
5
  flask>=2.0.0
6
6
  flask-cors>=3.0.0
7
- pexpect>=4.8.0
7
+ pexpect>=4.8.0
8
+ anthropic>=0.18.0
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Test script to verify Claude fallback functionality
4
+ """
5
+
6
+ import os
7
+ import sys
8
+
9
+ # Add the current directory to the path so we can import the main module
10
+ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
11
+
12
+ def test_claude_fallback():
13
+ """Test the Claude fallback functionality"""
14
+ print("๐Ÿงช Testing Claude fallback functionality...")
15
+
16
+ # Test 1: Check if anthropic is imported correctly
17
+ try:
18
+ from test_modalSandboxScript import anthropic
19
+ if anthropic is not None:
20
+ print("โœ… Anthropic library imported successfully")
21
+ else:
22
+ print("โš ๏ธ Anthropic library not available")
23
+ except ImportError as e:
24
+ print(f"โŒ Failed to import anthropic: {e}")
25
+ return False
26
+
27
+ # Test 2: Check if ANTHROPIC_API_KEY is set
28
+ anthropic_api_key = os.environ.get("ANTHROPIC_API_KEY")
29
+ if anthropic_api_key:
30
+ print("โœ… ANTHROPIC_API_KEY found in environment")
31
+ else:
32
+ print("โš ๏ธ ANTHROPIC_API_KEY not found in environment")
33
+ print("๐Ÿ’ก Set ANTHROPIC_API_KEY to test Claude functionality")
34
+
35
+ # Test 3: Test a simple Claude API call
36
+ if anthropic is not None and anthropic_api_key:
37
+ try:
38
+ client = anthropic.Anthropic(api_key=anthropic_api_key)
39
+ message = client.messages.create(
40
+ model="claude-3-5-sonnet-20241022",
41
+ max_tokens=50,
42
+ messages=[
43
+ {"role": "user", "content": "Hello, please respond with 'Claude is working!'"}
44
+ ]
45
+ )
46
+ response = message.content[0].text.strip()
47
+ print(f"โœ… Claude API test successful: {response}")
48
+ return True
49
+ except Exception as e:
50
+ print(f"โŒ Claude API test failed: {e}")
51
+ return False
52
+ else:
53
+ print("โš ๏ธ Skipping Claude API test (missing library or API key)")
54
+ return False
55
+
56
+ def test_openai_fallback():
57
+ """Test the OpenAI fallback functionality"""
58
+ print("\n๐Ÿงช Testing OpenAI fallback functionality...")
59
+
60
+ # Test 1: Check if OpenAI API key is set
61
+ openai_api_key = os.environ.get("OPENAI_API_KEY")
62
+ if openai_api_key:
63
+ print("โœ… OPENAI_API_KEY found in environment")
64
+ else:
65
+ print("โš ๏ธ OPENAI_API_KEY not found in environment")
66
+ print("๐Ÿ’ก Set OPENAI_API_KEY to test OpenAI functionality")
67
+
68
+ # Test 2: Test a simple OpenAI API call
69
+ if openai_api_key:
70
+ try:
71
+ import openai
72
+ client = openai.OpenAI(api_key=openai_api_key)
73
+ response = client.chat.completions.create(
74
+ model="gpt-3.5-turbo",
75
+ messages=[
76
+ {"role": "user", "content": "Hello, please respond with 'OpenAI is working!'"}
77
+ ],
78
+ max_tokens=50
79
+ )
80
+ response_text = response.choices[0].message.content.strip()
81
+ print(f"โœ… OpenAI API test successful: {response_text}")
82
+ return True
83
+ except Exception as e:
84
+ print(f"โŒ OpenAI API test failed: {e}")
85
+ return False
86
+ else:
87
+ print("โš ๏ธ Skipping OpenAI API test (missing API key)")
88
+ return False
89
+
90
+ def main():
91
+ """Main test function"""
92
+ print("๐Ÿš€ Starting Claude fallback tests...")
93
+ print("=" * 50)
94
+
95
+ claude_success = test_claude_fallback()
96
+ openai_success = test_openai_fallback()
97
+
98
+ print("\n" + "=" * 50)
99
+ print("๐Ÿ“Š Test Results:")
100
+ print(f"Claude API: {'โœ… Working' if claude_success else 'โŒ Failed'}")
101
+ print(f"OpenAI API: {'โœ… Working' if openai_success else 'โŒ Failed'}")
102
+
103
+ if claude_success and openai_success:
104
+ print("\n๐ŸŽ‰ Both APIs are working! Claude fallback is ready.")
105
+ elif claude_success:
106
+ print("\nโœ… Claude API is working! Can be used as fallback.")
107
+ elif openai_success:
108
+ print("\nโœ… OpenAI API is working! Claude fallback will be used when OpenAI fails.")
109
+ else:
110
+ print("\nโŒ Neither API is working. Please check your API keys.")
111
+
112
+ print("\n๐Ÿ’ก To test the fallback functionality:")
113
+ print("1. Set both OPENAI_API_KEY and ANTHROPIC_API_KEY")
114
+ print("2. Run the main script with a failing command")
115
+ print("3. Watch for '๐Ÿ”„ Trying Claude-4-Sonnet as fallback...' messages")
116
+
117
+ if __name__ == "__main__":
118
+ main()