gitarsenal-cli 1.6.2 → 1.6.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitarsenal-cli",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "CLI tool for creating Modal sandboxes with GitHub repositories",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1640,15 +1640,6 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
1640
1640
  print(f"❌ Error running container: {e}")
1641
1641
  return None
1642
1642
 
1643
- def is_local_server_running(url, timeout=2):
1644
- """Check if a local server is running by attempting a connection."""
1645
- import requests
1646
- try:
1647
- response = requests.get(url, timeout=timeout)
1648
- return True
1649
- except requests.exceptions.RequestException:
1650
- return False
1651
-
1652
1643
  def fetch_setup_commands_from_api(repo_url):
1653
1644
  """Fetch setup commands from the GitIngest API using real repository analysis."""
1654
1645
  import tempfile
@@ -2258,74 +2249,6 @@ def find_entry_point(repo_dir):
2258
2249
 
2259
2250
  return None
2260
2251
 
2261
- def analyze_directory_navigation_with_llm(current_dir, target_dir, current_contents, target_contents, api_key=None):
2262
- """Use LLM to analyze if directory navigation makes sense"""
2263
- if not api_key:
2264
- # Try to get API key from environment
2265
- api_key = os.environ.get("OPENAI_API_KEY")
2266
-
2267
- if not api_key:
2268
- print("⚠️ No OpenAI API key available for directory analysis")
2269
- return None
2270
-
2271
- # Create analysis prompt
2272
- analysis_prompt = f"""
2273
- I'm trying to determine if a 'cd {target_dir}' command makes sense.
2274
-
2275
- CURRENT DIRECTORY: {current_dir}
2276
- Current directory contents:
2277
- {current_contents}
2278
-
2279
- TARGET DIRECTORY: {target_dir}
2280
- Target directory contents:
2281
- {target_contents}
2282
-
2283
- Please analyze if navigating to the target directory makes sense by considering:
2284
- 1. Are the contents significantly different?
2285
- 2. Does the target directory contain important files (like source code, config files, etc.)?
2286
- 3. Is this likely a nested project directory or just a duplicate?
2287
- 4. Would navigating provide access to different functionality or files?
2288
-
2289
- Respond with only 'NAVIGATE' if navigation makes sense, or 'SKIP' if it's redundant.
2290
- """
2291
-
2292
- # Prepare the API request
2293
- headers = {
2294
- "Content-Type": "application/json",
2295
- "Authorization": f"Bearer {api_key}"
2296
- }
2297
-
2298
- payload = {
2299
- "model": "gpt-4",
2300
- "messages": [
2301
- {"role": "system", "content": "You are a directory navigation assistant. Analyze if navigating to a target directory makes sense based on the contents of both directories. Respond with only 'NAVIGATE' or 'SKIP'."},
2302
- {"role": "user", "content": analysis_prompt}
2303
- ],
2304
- "temperature": 0.1,
2305
- "max_tokens": 50
2306
- }
2307
-
2308
- try:
2309
- print("🤖 Calling OpenAI for directory navigation analysis...")
2310
- response = requests.post(
2311
- "https://api.openai.com/v1/chat/completions",
2312
- headers=headers,
2313
- json=payload,
2314
- timeout=30
2315
- )
2316
-
2317
- if response.status_code == 200:
2318
- result = response.json()
2319
- llm_response = result["choices"][0]["message"]["content"].strip()
2320
- print(f"🤖 LLM Response: {llm_response}")
2321
- return llm_response
2322
- else:
2323
- print(f"❌ OpenAI API error: {response.status_code} - {response.text}")
2324
- return None
2325
- except Exception as e:
2326
- print(f"❌ Error calling OpenAI API: {e}")
2327
- return None
2328
-
2329
2252
  def cleanup_modal_token():
2330
2253
  """Delete token files and environment variables after SSH container is started"""
2331
2254
  print("🧹 Cleaning up tokens for security...")
@@ -1640,15 +1640,6 @@ def create_modal_ssh_container(gpu_type, repo_url=None, repo_name=None, setup_co
1640
1640
  print(f"❌ Error running container: {e}")
1641
1641
  return None
1642
1642
 
1643
- def is_local_server_running(url, timeout=2):
1644
- """Check if a local server is running by attempting a connection."""
1645
- import requests
1646
- try:
1647
- response = requests.get(url, timeout=timeout)
1648
- return True
1649
- except requests.exceptions.RequestException:
1650
- return False
1651
-
1652
1643
  def fetch_setup_commands_from_api(repo_url):
1653
1644
  """Fetch setup commands from the GitIngest API using real repository analysis."""
1654
1645
  import tempfile
@@ -2258,74 +2249,6 @@ def find_entry_point(repo_dir):
2258
2249
 
2259
2250
  return None
2260
2251
 
2261
- def analyze_directory_navigation_with_llm(current_dir, target_dir, current_contents, target_contents, api_key=None):
2262
- """Use LLM to analyze if directory navigation makes sense"""
2263
- if not api_key:
2264
- # Try to get API key from environment
2265
- api_key = os.environ.get("OPENAI_API_KEY")
2266
-
2267
- if not api_key:
2268
- print("⚠️ No OpenAI API key available for directory analysis")
2269
- return None
2270
-
2271
- # Create analysis prompt
2272
- analysis_prompt = f"""
2273
- I'm trying to determine if a 'cd {target_dir}' command makes sense.
2274
-
2275
- CURRENT DIRECTORY: {current_dir}
2276
- Current directory contents:
2277
- {current_contents}
2278
-
2279
- TARGET DIRECTORY: {target_dir}
2280
- Target directory contents:
2281
- {target_contents}
2282
-
2283
- Please analyze if navigating to the target directory makes sense by considering:
2284
- 1. Are the contents significantly different?
2285
- 2. Does the target directory contain important files (like source code, config files, etc.)?
2286
- 3. Is this likely a nested project directory or just a duplicate?
2287
- 4. Would navigating provide access to different functionality or files?
2288
-
2289
- Respond with only 'NAVIGATE' if navigation makes sense, or 'SKIP' if it's redundant.
2290
- """
2291
-
2292
- # Prepare the API request
2293
- headers = {
2294
- "Content-Type": "application/json",
2295
- "Authorization": f"Bearer {api_key}"
2296
- }
2297
-
2298
- payload = {
2299
- "model": "gpt-4",
2300
- "messages": [
2301
- {"role": "system", "content": "You are a directory navigation assistant. Analyze if navigating to a target directory makes sense based on the contents of both directories. Respond with only 'NAVIGATE' or 'SKIP'."},
2302
- {"role": "user", "content": analysis_prompt}
2303
- ],
2304
- "temperature": 0.1,
2305
- "max_tokens": 50
2306
- }
2307
-
2308
- try:
2309
- print("🤖 Calling OpenAI for directory navigation analysis...")
2310
- response = requests.post(
2311
- "https://api.openai.com/v1/chat/completions",
2312
- headers=headers,
2313
- json=payload,
2314
- timeout=30
2315
- )
2316
-
2317
- if response.status_code == 200:
2318
- result = response.json()
2319
- llm_response = result["choices"][0]["message"]["content"].strip()
2320
- print(f"🤖 LLM Response: {llm_response}")
2321
- return llm_response
2322
- else:
2323
- print(f"❌ OpenAI API error: {response.status_code} - {response.text}")
2324
- return None
2325
- except Exception as e:
2326
- print(f"❌ Error calling OpenAI API: {e}")
2327
- return None
2328
-
2329
2252
  def cleanup_modal_token():
2330
2253
  """Delete token files and environment variables after SSH container is started"""
2331
2254
  print("🧹 Cleaning up tokens for security...")