bonzai-burn 1.0.78 → 1.0.80

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.
@@ -1,7 +1,7 @@
1
1
  const path = require('path');
2
2
 
3
- // Root directory (one level up from templates/)
4
- const ROOT = path.join(__dirname, '..');
3
+ // Root directory - use BONZAI_REPO_DIR env var (set by bconfig.js when server starts)
4
+ const ROOT = process.env.BONZAI_REPO_DIR || path.join(__dirname, '..');
5
5
 
6
6
  // Initialize babelParser (optional dependency)
7
7
  let babelParser = null;
@@ -5,7 +5,10 @@ const { ROOT } = require('../config');
5
5
  function openCursorHandler(req, res) {
6
6
  try {
7
7
  const requestedPath = req.body.path || '';
8
-
8
+
9
+ console.log('[open-cursor] ROOT:', ROOT);
10
+ console.log('[open-cursor] requestedPath:', requestedPath);
11
+
9
12
  // Resolve path relative to ROOT (similar to other endpoints)
10
13
  // If path is absolute and within ROOT, use it directly
11
14
  // Otherwise, resolve it relative to ROOT
@@ -44,7 +47,9 @@ function openCursorHandler(req, res) {
44
47
  if (!filePath.startsWith(ROOT)) {
45
48
  return res.status(400).json({ error: 'Invalid path' });
46
49
  }
47
-
50
+
51
+ console.log('[open-cursor] resolved filePath:', filePath);
52
+
48
53
  const { line } = req.body;
49
54
 
50
55
  // Always use cursor CLI command first (it handles line numbers correctly)
@@ -93,7 +98,7 @@ function openCursorHandler(req, res) {
93
98
  }, 500);
94
99
  }
95
100
 
96
- res.json({ success: true, message: 'Cursor opened and focused successfully' });
101
+ res.json({ success: true, message: 'Cursor opened and focused successfully', openedPath: filePath });
97
102
  }
98
103
  });
99
104
  };
@@ -1,3 +1,5 @@
1
+ const { ROOT } = require('../config');
2
+
1
3
  let pty;
2
4
  try {
3
5
  pty = require('node-pty');
@@ -27,7 +29,7 @@ function createTerminal(sessionId, cols = 80, rows = 24) {
27
29
  }
28
30
 
29
31
  const shell = getDefaultShell();
30
- const cwd = process.env.BONZAI_REPO_DIR || process.cwd();
32
+ const cwd = ROOT;
31
33
 
32
34
  let ptyProcess;
33
35
  try {
@@ -5,6 +5,7 @@ const cors = require('./node_modules/cors');
5
5
  const http = require('http');
6
6
  const fs = require('fs');
7
7
  const path = require('path');
8
+ const { ROOT } = require('./config');
8
9
 
9
10
  const app = express();
10
11
  const server = http.createServer(app);
@@ -14,7 +15,7 @@ app.use(express.json());
14
15
 
15
16
  // Root route
16
17
  app.get('/', (req, res) => {
17
- const repoName = path.basename(process.env.BONZAI_REPO_DIR || process.cwd());
18
+ const repoName = path.basename(ROOT);
18
19
  res.json({ message: 'Bonzai Server', status: 'running', repoName });
19
20
  });
20
21
 
@@ -62,4 +63,5 @@ if (terminalHandlers) {
62
63
  const port = 3001;
63
64
  server.listen(port, () => {
64
65
  console.log('File server running on http://localhost:' + port);
66
+ console.log('ROOT directory:', ROOT);
65
67
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bonzai-burn",
3
- "version": "1.0.78",
3
+ "version": "1.0.80",
4
4
  "description": "Git branch-based cleanup tool with bburn, baccept, and brevert commands",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",