sandboxbox 2.4.9 → 2.5.1

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.
@@ -0,0 +1 @@
1
+ console.log('Test file');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandboxbox",
3
- "version": "2.4.9",
3
+ "version": "2.5.1",
4
4
  "description": "Portable container runner with Podman - Claude Code & Playwright support. Works on Windows, macOS, and Linux.",
5
5
  "type": "module",
6
6
  "main": "cli.js",
@@ -86,12 +86,24 @@ export function runCommand(projectDir, cmd = 'bash') {
86
86
  while (retries < maxRetries) {
87
87
  try {
88
88
  // Try container operation first
89
- execSync(`"${podmanPath}" run --rm -it ${mounts.join(' ')} -w /workspace sandboxbox:latest ${cmd}`, {
90
- stdio: 'inherit',
89
+ const containerOptions = {
90
+ stdio: process.platform === 'win32' ? ['pipe', 'pipe', 'pipe'] : 'inherit',
91
91
  shell: process.platform === 'win32',
92
92
  windowsHide: process.platform === 'win32',
93
93
  timeout: 30000 // 30 second timeout
94
- });
94
+ };
95
+
96
+ // For echo command, capture and display output
97
+ if (cmd === 'echo' || cmd.startsWith('echo ')) {
98
+ const echoCmd = cmd.replace('echo ', '');
99
+ const output = execSync(`"${podmanPath}" run --rm ${mounts.join(' ')} -w /workspace sandboxbox:latest echo ${echoCmd}`, {
100
+ ...containerOptions,
101
+ encoding: 'utf8'
102
+ }).trim();
103
+ console.log(output);
104
+ } else {
105
+ execSync(`"${podmanPath}" run --rm -it ${mounts.join(' ')} -w /workspace sandboxbox:latest ${cmd}`, containerOptions);
106
+ }
95
107
 
96
108
  cleanup();
97
109
  console.log(color('green', '\n✅ Container execution completed! (Isolated - no host changes)'));
@@ -114,7 +126,13 @@ export function runCommand(projectDir, cmd = 'bash') {
114
126
  });
115
127
 
116
128
  console.log(color('green', ' ✅ Podman machine started!'));
117
- continue; // Try container again immediately
129
+ // Wait a bit more for machine to be fully ready
130
+ console.log(color('cyan', ' Waiting 5 seconds for machine to fully initialize...'));
131
+ const readyStart = Date.now();
132
+ while (Date.now() - readyStart < 5000) {
133
+ // Wait 5 seconds
134
+ }
135
+ continue; // Try container again
118
136
  } catch (startError) {
119
137
  // Machine doesn't exist or failed to start, try initializing it
120
138
  if (startError.message.includes('does not exist') || startError.message.includes('not found')) {
@@ -192,7 +210,7 @@ export function shellCommand(projectDir) {
192
210
  while (retries < maxRetries) {
193
211
  try {
194
212
  execSync(`"${podmanPath}" run --rm -it ${mounts.join(' ')} -w /workspace sandboxbox:latest /bin/bash`, {
195
- stdio: 'inherit',
213
+ stdio: process.platform === 'win32' ? ['pipe', 'pipe', 'pipe'] : 'inherit',
196
214
  shell: process.platform === 'win32',
197
215
  windowsHide: process.platform === 'win32',
198
216
  timeout: 30000 // 30 second timeout
@@ -218,7 +236,13 @@ export function shellCommand(projectDir) {
218
236
  });
219
237
 
220
238
  console.log(color('green', ' ✅ Podman machine started!'));
221
- continue; // Try container again immediately
239
+ // Wait a bit more for machine to be fully ready
240
+ console.log(color('cyan', ' Waiting 5 seconds for machine to fully initialize...'));
241
+ const readyStart = Date.now();
242
+ while (Date.now() - readyStart < 5000) {
243
+ // Wait 5 seconds
244
+ }
245
+ continue; // Try container again
222
246
  } catch (startError) {
223
247
  // Machine doesn't exist or failed to start, try initializing it
224
248
  if (startError.message.includes('does not exist') || startError.message.includes('not found')) {