sandboxbox 2.4.5 → 2.4.7
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/.vexify.db +0 -0
- package/package.json +1 -1
- package/utils/commands/claude.js +1 -1
- package/utils/commands/container.js +3 -8
- package/utils/podman.js +36 -9
package/.vexify.db
ADDED
|
Binary file
|
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,7 +84,6 @@ 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...`));
|
|
88
87
|
try {
|
|
89
88
|
execSync(`"${podmanPath}" run --rm -it ${mounts.join(' ')} -w /workspace sandboxbox:latest ${cmd}`, {
|
|
90
89
|
stdio: 'inherit',
|
|
@@ -98,11 +97,7 @@ export function runCommand(projectDir, cmd = 'bash') {
|
|
|
98
97
|
return true;
|
|
99
98
|
} catch (error) {
|
|
100
99
|
retries++;
|
|
101
|
-
|
|
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'))) {
|
|
100
|
+
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'))) {
|
|
106
101
|
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}), waiting 15 seconds...`));
|
|
107
102
|
const start = Date.now();
|
|
108
103
|
while (Date.now() - start < 15000) {
|
|
@@ -158,7 +153,7 @@ export function shellCommand(projectDir) {
|
|
|
158
153
|
return true;
|
|
159
154
|
} catch (error) {
|
|
160
155
|
retries++;
|
|
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'))) {
|
|
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') || error.message.includes('Command failed'))) {
|
|
162
157
|
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}), waiting 15 seconds...`));
|
|
163
158
|
const start = Date.now();
|
|
164
159
|
while (Date.now() - start < 15000) {
|
package/utils/podman.js
CHANGED
|
@@ -96,26 +96,53 @@ function setupMachineBackground(podmanPath) {
|
|
|
96
96
|
|
|
97
97
|
// Windows-specific: Use completely hidden process execution
|
|
98
98
|
const spawnOptions = process.platform === 'win32' ? {
|
|
99
|
-
stdio: ['
|
|
99
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
100
100
|
shell: true,
|
|
101
101
|
detached: true,
|
|
102
102
|
windowsHide: true, // Hide the console window on Windows
|
|
103
103
|
cwd: process.cwd() // Ensure working directory is set
|
|
104
104
|
} : {
|
|
105
|
-
stdio: ['
|
|
105
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
106
106
|
shell: true,
|
|
107
107
|
detached: true
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
const initProcess = spawn(initCmd, spawnOptions);
|
|
111
|
-
initProcess.unref();
|
|
112
111
|
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
// Handle init process completion/errors
|
|
113
|
+
initProcess.on('error', (error) => {
|
|
114
|
+
console.log(color('red', ` Init process error: ${error.message}`));
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
initProcess.on('exit', (code) => {
|
|
118
|
+
if (code === 0) {
|
|
119
|
+
console.log(color('green', ' Machine initialization completed, starting in 10 seconds...'));
|
|
120
|
+
|
|
121
|
+
// Start machine after init completes
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
const startCmd = `"${podmanPath}" machine start`;
|
|
124
|
+
const startProcess = spawn(startCmd, spawnOptions);
|
|
125
|
+
|
|
126
|
+
startProcess.on('error', (error) => {
|
|
127
|
+
console.log(color('red', ` Start process error: ${error.message}`));
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
startProcess.on('exit', (startCode) => {
|
|
131
|
+
if (startCode === 0) {
|
|
132
|
+
console.log(color('green', ' Podman machine started successfully!'));
|
|
133
|
+
} else {
|
|
134
|
+
console.log(color('red', ` Machine start failed with code: ${startCode}`));
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
startProcess.unref();
|
|
139
|
+
}, 10000); // Wait 10 seconds before starting
|
|
140
|
+
} else {
|
|
141
|
+
console.log(color('red', ` Machine initialization failed with code: ${code}`));
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
initProcess.unref();
|
|
119
146
|
|
|
120
147
|
console.log(color('yellow', ' Setup initiated in background (may take 2-3 minutes)'));
|
|
121
148
|
console.log(color('cyan', ' Container operations will work when setup completes\n'));
|