bonzai-burn 1.0.17 → 1.0.19
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,14 +1,7 @@
|
|
|
1
|
-
console.log(`[Terminal] Node version: ${process.version}`);
|
|
2
|
-
console.log(`[Terminal] Platform: ${process.platform} ${process.arch}`);
|
|
3
|
-
|
|
4
1
|
let pty;
|
|
5
2
|
try {
|
|
6
3
|
pty = require('node-pty');
|
|
7
|
-
console.log('[Terminal] node-pty loaded successfully');
|
|
8
4
|
} catch (err) {
|
|
9
|
-
console.error('[Terminal] Failed to load node-pty:', err.message);
|
|
10
|
-
console.error('[Terminal] This usually means node-pty native binaries failed to install.');
|
|
11
|
-
console.error('[Terminal] Try running: cd bonzai && npm rebuild node-pty');
|
|
12
5
|
pty = null;
|
|
13
6
|
}
|
|
14
7
|
|
|
@@ -20,9 +13,7 @@ function getDefaultShell() {
|
|
|
20
13
|
if (process.platform === 'win32') {
|
|
21
14
|
return process.env.COMSPEC || 'powershell.exe';
|
|
22
15
|
}
|
|
23
|
-
// Prefer SHELL env var, but always use full path
|
|
24
16
|
const shell = process.env.SHELL || '/bin/bash';
|
|
25
|
-
// Ensure we have a full path
|
|
26
17
|
if (!shell.startsWith('/')) {
|
|
27
18
|
return '/bin/bash';
|
|
28
19
|
}
|
|
@@ -36,11 +27,7 @@ function createTerminal(sessionId, cols = 80, rows = 24) {
|
|
|
36
27
|
}
|
|
37
28
|
|
|
38
29
|
const shell = getDefaultShell();
|
|
39
|
-
const cwd = process.env.
|
|
40
|
-
|
|
41
|
-
console.log(`[Terminal] Spawning shell: ${shell}`);
|
|
42
|
-
console.log(`[Terminal] Working directory: ${cwd}`);
|
|
43
|
-
console.log(`[Terminal] PATH: ${process.env.PATH}`);
|
|
30
|
+
const cwd = process.env.BONZAI_REPO_DIR || process.cwd();
|
|
44
31
|
|
|
45
32
|
let ptyProcess;
|
|
46
33
|
try {
|
|
@@ -56,11 +43,6 @@ function createTerminal(sessionId, cols = 80, rows = 24) {
|
|
|
56
43
|
}
|
|
57
44
|
});
|
|
58
45
|
} catch (spawnErr) {
|
|
59
|
-
console.error('[Terminal] pty.spawn failed:', spawnErr);
|
|
60
|
-
console.error('[Terminal] Error code:', spawnErr.code);
|
|
61
|
-
console.error('[Terminal] Error errno:', spawnErr.errno);
|
|
62
|
-
// Try with /bin/bash as fallback
|
|
63
|
-
console.log('[Terminal] Retrying with /bin/bash...');
|
|
64
46
|
try {
|
|
65
47
|
ptyProcess = pty.spawn('/bin/bash', [], {
|
|
66
48
|
name: 'xterm-256color',
|
|
@@ -74,8 +56,7 @@ function createTerminal(sessionId, cols = 80, rows = 24) {
|
|
|
74
56
|
}
|
|
75
57
|
});
|
|
76
58
|
} catch (bashErr) {
|
|
77
|
-
|
|
78
|
-
throw spawnErr; // throw original error
|
|
59
|
+
throw spawnErr;
|
|
79
60
|
}
|
|
80
61
|
}
|
|
81
62
|
|
|
@@ -110,9 +91,7 @@ function setupTerminalWebSocket(wss) {
|
|
|
110
91
|
|
|
111
92
|
try {
|
|
112
93
|
ptyProcess = createTerminal(sessionId);
|
|
113
|
-
console.log(`Terminal session ${sessionId} started`);
|
|
114
94
|
} catch (err) {
|
|
115
|
-
console.error('Failed to create terminal:', err.message);
|
|
116
95
|
ws.send(JSON.stringify({ type: 'error', message: 'Failed to create terminal: ' + err.message }));
|
|
117
96
|
ws.close();
|
|
118
97
|
return;
|
|
@@ -146,13 +125,12 @@ function setupTerminalWebSocket(wss) {
|
|
|
146
125
|
break;
|
|
147
126
|
}
|
|
148
127
|
} catch (e) {
|
|
149
|
-
|
|
128
|
+
// Parse error
|
|
150
129
|
}
|
|
151
130
|
});
|
|
152
131
|
|
|
153
132
|
// Cleanup on disconnect
|
|
154
133
|
ws.on('close', () => {
|
|
155
|
-
console.log(`Terminal session ${sessionId} closed`);
|
|
156
134
|
ptyProcess.kill();
|
|
157
135
|
terminals.delete(sessionId);
|
|
158
136
|
});
|
package/src/bgraph.js
CHANGED
|
@@ -149,7 +149,11 @@ async function main() {
|
|
|
149
149
|
// Start the server automatically
|
|
150
150
|
const server = spawn('node', ['receiver.js'], {
|
|
151
151
|
stdio: 'inherit',
|
|
152
|
-
cwd: bonzaiDir
|
|
152
|
+
cwd: bonzaiDir,
|
|
153
|
+
env: {
|
|
154
|
+
...process.env,
|
|
155
|
+
BONZAI_REPO_DIR: currentDir
|
|
156
|
+
}
|
|
153
157
|
});
|
|
154
158
|
|
|
155
159
|
// Open browser automatically
|