gitarsenal-cli 1.7.7 โ†’ 1.7.9

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/bin/gitarsenal.js CHANGED
@@ -41,7 +41,7 @@ program
41
41
  const containerCmd = program
42
42
  .command('container')
43
43
  .description('Create a container with a GitHub repository')
44
- .option('-g, --gpu <type>', 'GPU type (A10G, A100, H100, T4, L4, L40S, V100)', 'A10G')
44
+ .option('-g, --gpu <type>', 'GPU type (A10G, A100, H100, T4, L4, L40S, V100)')
45
45
  .option('-r, --repo-url <url>', 'GitHub repository URL')
46
46
  .option('-v, --volume-name <n>', 'Name of persistent volume')
47
47
  .option('-s, --setup-commands <commands...>', 'Setup commands to run in the container')
@@ -92,7 +92,7 @@ keysCmd
92
92
  // For backward compatibility, support running without a subcommand
93
93
  program
94
94
  .option('-r, --repo <url>', 'GitHub repository URL')
95
- .option('-g, --gpu <type>', 'GPU type (A10G, A100, H100, T4, L4, L40S, V100)', 'A10G')
95
+ .option('-g, --gpu <type>', 'GPU type (A10G, A100, H100, T4, L4, L40S, V100)')
96
96
  .option('-v, --volume <n>', 'Name of persistent volume')
97
97
  .option('-y, --yes', 'Skip confirmation prompts')
98
98
  .option('-m, --manual', 'Disable automatic setup command detection')
@@ -154,13 +154,15 @@ async function runContainerCommand(options) {
154
154
  name: 'gpuType',
155
155
  message: 'Select GPU type:',
156
156
  choices: [
157
- { name: 'A10G (24GB VRAM)', value: 'A10G' },
158
- { name: 'A100 (40GB VRAM)', value: 'A100' },
159
- { name: 'H100 (80GB VRAM)', value: 'H100' },
160
157
  { name: 'T4 (16GB VRAM)', value: 'T4' },
161
158
  { name: 'L4 (24GB VRAM)', value: 'L4' },
159
+ { name: 'A10G (24GB VRAM)', value: 'A10G' },
160
+ { name: 'A100-40 (40GB VRAM)', value: 'A100-40' },
161
+ { name: 'A100-80 (80GB VRAM)', value: 'A100-80' },
162
162
  { name: 'L40S (48GB VRAM)', value: 'L40S' },
163
- { name: 'V100 (16GB VRAM)', value: 'V100' }
163
+ { name: 'H100 (80GB VRAM)', value: 'H100' },
164
+ { name: 'H200 (141GB VRAM)', value: 'H200' },
165
+ { name: 'B200 (141GB VRAM)', value: 'B200' }
164
166
  ],
165
167
  default: 'A10G'
166
168
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitarsenal-cli",
3
- "version": "1.7.7",
3
+ "version": "1.7.9",
4
4
  "description": "CLI tool for creating Modal sandboxes with GitHub repositories",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -0,0 +1,147 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Test script for the dynamic command list functionality.
4
+ This demonstrates how the CommandListManager works with setup commands.
5
+ """
6
+
7
+ import sys
8
+ import os
9
+ import time
10
+
11
+ # Add the current directory to the path so we can import from test_modalSandboxScript
12
+ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
13
+
14
+ from test_modalSandboxScript import CommandListManager
15
+
16
+ def simulate_command_execution(command, success_rate=0.8):
17
+ """Simulate command execution with a given success rate."""
18
+ import random
19
+ time.sleep(0.1) # Simulate execution time
20
+
21
+ success = random.random() < success_rate
22
+ stdout = f"Simulated output for: {command}"
23
+ stderr = "" if success else f"Simulated error for: {command}"
24
+
25
+ return success, stdout, stderr
26
+
27
+ def test_dynamic_command_list():
28
+ """Test the dynamic command list functionality."""
29
+ print("๐Ÿงช Testing Dynamic Command List Manager")
30
+ print("=" * 60)
31
+
32
+ # Initialize with some setup commands
33
+ initial_commands = [
34
+ "echo 'Starting setup...'",
35
+ "pwd",
36
+ "ls -la",
37
+ "which python",
38
+ "python --version"
39
+ ]
40
+
41
+ print(f"๐Ÿ“‹ Initial commands: {len(initial_commands)}")
42
+ for i, cmd in enumerate(initial_commands, 1):
43
+ print(f" {i}. {cmd}")
44
+
45
+ # Create command list manager
46
+ cmd_manager = CommandListManager(initial_commands)
47
+
48
+ print(f"\n๐Ÿ”„ Starting command execution simulation...")
49
+
50
+ # Simulate command execution
51
+ while cmd_manager.has_pending_commands():
52
+ next_cmd, cmd_type = cmd_manager.get_next_command()
53
+
54
+ if not next_cmd:
55
+ break
56
+
57
+ # Print current status
58
+ cmd_manager.print_status()
59
+
60
+ if cmd_type == 'main':
61
+ cmd_text = next_cmd['command']
62
+ cmd_index = next_cmd['index']
63
+
64
+ print(f"\n๐Ÿ“‹ Executing: {cmd_text}")
65
+
66
+ # Simulate execution
67
+ start_time = time.time()
68
+ success, stdout, stderr = simulate_command_execution(cmd_text, success_rate=0.7)
69
+ execution_time = time.time() - start_time
70
+
71
+ # Mark as executed
72
+ cmd_manager.mark_command_executed(
73
+ cmd_index, 'main', success, stdout, stderr, execution_time
74
+ )
75
+
76
+ # If command failed, simulate adding a fix
77
+ if not success:
78
+ print(f"โš ๏ธ Command failed, adding simulated fix...")
79
+
80
+ # Simulate LLM suggesting a fix
81
+ fix_command = f"echo 'Fix for: {cmd_text}'"
82
+ fix_index = cmd_manager.add_suggested_fix(cmd_text, fix_command, "Simulated LLM fix")
83
+
84
+ print(f"๐Ÿ”ง Added fix: {fix_command}")
85
+
86
+ elif cmd_type == 'fix':
87
+ cmd_text = next_cmd['fix_command']
88
+ cmd_index = next_cmd['index']
89
+
90
+ print(f"\n๐Ÿ”ง Executing fix: {cmd_text}")
91
+
92
+ # Simulate execution
93
+ start_time = time.time()
94
+ success, stdout, stderr = simulate_command_execution(cmd_text, success_rate=0.9)
95
+ execution_time = time.time() - start_time
96
+
97
+ # Mark as executed
98
+ cmd_manager.mark_command_executed(
99
+ cmd_index, 'fix', success, stdout, stderr, execution_time
100
+ )
101
+
102
+ # Demonstrate dynamic command addition
103
+ print(f"\n๐Ÿ“‹ Adding dynamic commands...")
104
+ cmd_manager.add_command_dynamically("echo 'Dynamic command 1'", priority='normal')
105
+ cmd_manager.add_command_dynamically("echo 'High priority command'", priority='high')
106
+ cmd_manager.add_command_dynamically("echo 'Dynamic command 2'", priority='normal')
107
+
108
+ # Execute the new commands
109
+ print(f"\n๐Ÿ”„ Executing dynamic commands...")
110
+ while cmd_manager.has_pending_commands():
111
+ next_cmd, cmd_type = cmd_manager.get_next_command()
112
+
113
+ if not next_cmd:
114
+ break
115
+
116
+ cmd_text = next_cmd['command']
117
+ cmd_index = next_cmd['index']
118
+
119
+ print(f"๐Ÿ“‹ Executing dynamic command: {cmd_text}")
120
+
121
+ # Simulate execution
122
+ start_time = time.time()
123
+ success, stdout, stderr = simulate_command_execution(cmd_text, success_rate=0.9)
124
+ execution_time = time.time() - start_time
125
+
126
+ # Mark as executed
127
+ cmd_manager.mark_command_executed(
128
+ cmd_index, 'main', success, stdout, stderr, execution_time
129
+ )
130
+
131
+ # Print final status
132
+ print(f"\n" + "=" * 60)
133
+ print("๐ŸŽ‰ FINAL STATUS")
134
+ print("=" * 60)
135
+ cmd_manager.print_status()
136
+
137
+ # Show all commands with their status
138
+ print(f"\n๐Ÿ“‹ All Commands Summary:")
139
+ all_commands = cmd_manager.get_all_commands()
140
+ for i, cmd in enumerate(all_commands, 1):
141
+ status_icon = "โœ…" if cmd['status'] == 'success' else "โŒ" if cmd['status'] == 'failed' else "โณ"
142
+ cmd_type = cmd.get('type', 'main')
143
+ cmd_text = cmd.get('command', cmd.get('fix_command', 'Unknown command'))
144
+ print(f" {i}. {status_icon} [{cmd_type}] {cmd_text}")
145
+
146
+ if __name__ == "__main__":
147
+ test_dynamic_command_list()