sandboxbox 2.4.4 → 2.4.6
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
package/utils/commands/claude.js
CHANGED
|
@@ -69,7 +69,7 @@ export function claudeCommand(projectDir, command = 'claude') {
|
|
|
69
69
|
return true;
|
|
70
70
|
} catch (error) {
|
|
71
71
|
retries++;
|
|
72
|
-
if (retries < maxRetries && (error.message.includes('Cannot connect to Podman') || error.message.includes('connectex') || error.message.includes('No connection could be made') || error.message.includes('actively refused'))) {
|
|
72
|
+
if (retries < maxRetries && (error.message.includes('Cannot connect to Podman') || error.message.includes('connectex') || error.message.includes('No connection could be made') || error.message.includes('actively refused') || error.message.includes('Command failed'))) {
|
|
73
73
|
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}), waiting 15 seconds...`));
|
|
74
74
|
const start = Date.now();
|
|
75
75
|
while (Date.now() - start < 15000) {
|
|
@@ -40,7 +40,7 @@ export function buildCommand(dockerfilePath) {
|
|
|
40
40
|
return true;
|
|
41
41
|
} catch (error) {
|
|
42
42
|
retries++;
|
|
43
|
-
if (retries < maxRetries && (error.message.includes('Cannot connect to Podman') || error.message.includes('connectex') || error.message.includes('No connection could be made') || error.message.includes('actively refused'))) {
|
|
43
|
+
if (retries < maxRetries && (error.message.includes('Cannot connect to Podman') || error.message.includes('connectex') || error.message.includes('No connection could be made') || error.message.includes('actively refused') || error.message.includes('Command failed'))) {
|
|
44
44
|
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}), waiting 15 seconds...`));
|
|
45
45
|
const start = Date.now();
|
|
46
46
|
while (Date.now() - start < 15000) {
|
|
@@ -84,6 +84,7 @@ export function runCommand(projectDir, cmd = 'bash') {
|
|
|
84
84
|
const maxRetries = process.platform === 'linux' ? 3 : 12; // More retries for Windows/macOS
|
|
85
85
|
|
|
86
86
|
while (retries < maxRetries) {
|
|
87
|
+
console.log(color('cyan', ` Debug: Attempt ${retries + 1}/${maxRetries} - running container command...`));
|
|
87
88
|
try {
|
|
88
89
|
execSync(`"${podmanPath}" run --rm -it ${mounts.join(' ')} -w /workspace sandboxbox:latest ${cmd}`, {
|
|
89
90
|
stdio: 'inherit',
|
|
@@ -97,7 +98,11 @@ export function runCommand(projectDir, cmd = 'bash') {
|
|
|
97
98
|
return true;
|
|
98
99
|
} catch (error) {
|
|
99
100
|
retries++;
|
|
100
|
-
|
|
101
|
+
// Debug: Log the actual error message
|
|
102
|
+
console.log(color('cyan', ` Debug: Error message: "${error.message}"`));
|
|
103
|
+
console.log(color('cyan', ` Debug: Checking retry patterns...`));
|
|
104
|
+
|
|
105
|
+
if (retries < maxRetries && (error.message.includes('Cannot connect to Podman') || error.message.includes('connectex') || error.message.includes('No connection could be made') || error.message.includes('actively refused') || error.message.includes('Command failed'))) {
|
|
101
106
|
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}), waiting 15 seconds...`));
|
|
102
107
|
const start = Date.now();
|
|
103
108
|
while (Date.now() - start < 15000) {
|
|
@@ -153,7 +158,7 @@ export function shellCommand(projectDir) {
|
|
|
153
158
|
return true;
|
|
154
159
|
} catch (error) {
|
|
155
160
|
retries++;
|
|
156
|
-
if (retries < maxRetries && (error.message.includes('Cannot connect to Podman') || error.message.includes('connectex') || error.message.includes('No connection could be made') || error.message.includes('actively refused'))) {
|
|
161
|
+
if (retries < maxRetries && (error.message.includes('Cannot connect to Podman') || error.message.includes('connectex') || error.message.includes('No connection could be made') || error.message.includes('actively refused') || error.message.includes('Command failed'))) {
|
|
157
162
|
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}), waiting 15 seconds...`));
|
|
158
163
|
const start = Date.now();
|
|
159
164
|
while (Date.now() - start < 15000) {
|
package/utils/podman.js
CHANGED
|
@@ -29,7 +29,7 @@ export function getPodmanPath() {
|
|
|
29
29
|
export function setupBackendNonBlocking(podmanPath) {
|
|
30
30
|
if (process.platform === 'linux') {
|
|
31
31
|
// Linux can run true rootless Podman
|
|
32
|
-
const execOptions = { encoding: 'utf-8', stdio: 'pipe', shell: true };
|
|
32
|
+
const execOptions = { encoding: 'utf-8', stdio: 'pipe', shell: true, windowsHide: process.platform === 'win32' };
|
|
33
33
|
try {
|
|
34
34
|
execSync(`"${podmanPath}" info`, execOptions);
|
|
35
35
|
return true;
|
|
@@ -48,7 +48,7 @@ export function setupBackendNonBlocking(podmanPath) {
|
|
|
48
48
|
|
|
49
49
|
// Windows: Implement completely silent automated setup
|
|
50
50
|
if (process.platform === 'win32') {
|
|
51
|
-
const execOptions = { encoding: 'utf-8', stdio: 'pipe', shell: true };
|
|
51
|
+
const execOptions = { encoding: 'utf-8', stdio: 'pipe', shell: true, windowsHide: process.platform === 'win32' };
|
|
52
52
|
|
|
53
53
|
try {
|
|
54
54
|
execSync(`"${podmanPath}" info`, execOptions);
|
|
@@ -68,7 +68,7 @@ export function setupBackendNonBlocking(podmanPath) {
|
|
|
68
68
|
|
|
69
69
|
// macOS: Similar automated approach
|
|
70
70
|
if (process.platform === 'darwin') {
|
|
71
|
-
const execOptions = { encoding: 'utf-8', stdio: 'pipe', shell: true };
|
|
71
|
+
const execOptions = { encoding: 'utf-8', stdio: 'pipe', shell: true, windowsHide: process.platform === 'win32' };
|
|
72
72
|
|
|
73
73
|
try {
|
|
74
74
|
execSync(`"${podmanPath}" info`, execOptions);
|
|
@@ -124,7 +124,7 @@ function setupMachineBackground(podmanPath) {
|
|
|
124
124
|
export function checkBackend(podmanPath) {
|
|
125
125
|
if (process.platform === 'linux') return true;
|
|
126
126
|
|
|
127
|
-
const execOptions = { encoding: 'utf-8', stdio: 'pipe', shell: true };
|
|
127
|
+
const execOptions = { encoding: 'utf-8', stdio: 'pipe', shell: true, windowsHide: process.platform === 'win32' };
|
|
128
128
|
|
|
129
129
|
try {
|
|
130
130
|
execSync(`"${podmanPath}" info`, execOptions);
|
|
@@ -154,7 +154,7 @@ export function checkPodman() {
|
|
|
154
154
|
shell: process.platform === 'win32'
|
|
155
155
|
};
|
|
156
156
|
|
|
157
|
-
const version = execSync(`"${podmanPath}" --version`,
|
|
157
|
+
const version = execSync(`"${podmanPath}" --version`, { encoding: 'utf-8', stdio: 'pipe', shell: process.platform === 'win32', windowsHide: process.platform === 'win32' }).trim();
|
|
158
158
|
console.log(color('green', `✅ ${version}${isBundled ? ' (bundled)' : ''}`));
|
|
159
159
|
return podmanPath;
|
|
160
160
|
} catch (error) {
|
|
@@ -163,7 +163,7 @@ export function checkPodman() {
|
|
|
163
163
|
|
|
164
164
|
try {
|
|
165
165
|
const scriptPath = resolve(__dirname, '..', 'scripts', 'download-podman.js');
|
|
166
|
-
execSync(`node "${scriptPath}"`, { stdio: 'inherit', cwd: __dirname, shell: process.platform === 'win32' });
|
|
166
|
+
execSync(`node "${scriptPath}"`, { stdio: 'inherit', cwd: __dirname, shell: process.platform === 'win32', windowsHide: process.platform === 'win32' });
|
|
167
167
|
|
|
168
168
|
const newPodmanPath = getPodmanPath();
|
|
169
169
|
if (!existsSync(newPodmanPath) && newPodmanPath !== 'podman') {
|
|
@@ -176,7 +176,7 @@ export function checkPodman() {
|
|
|
176
176
|
shell: process.platform === 'win32'
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
-
const newVersion = execSync(`"${newPodmanPath}" --version`,
|
|
179
|
+
const newVersion = execSync(`"${newPodmanPath}" --version`, { encoding: 'utf-8', stdio: 'pipe', shell: process.platform === 'win32', windowsHide: process.platform === 'win32' }).trim();
|
|
180
180
|
console.log(`\n✅ ${newVersion} (auto-downloaded)`);
|
|
181
181
|
console.log('✅ Portable Podman ready');
|
|
182
182
|
|