sandboxbox 3.0.21 → 3.0.23

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/sandbox.js +24 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandboxbox",
3
- "version": "3.0.21",
3
+ "version": "3.0.23",
4
4
  "description": "Lightweight process containment sandbox for CLI tools - Playwright, Claude Code, and more. Pure Node.js, no dependencies.",
5
5
  "type": "module",
6
6
  "main": "cli.js",
package/utils/sandbox.js CHANGED
@@ -167,6 +167,7 @@ export function createSandbox(projectDir) {
167
167
  const VERBOSE_OUTPUT = process.env.SANDBOX_VERBOSE === 'true' || process.argv.includes('--verbose');
168
168
  if (VERBOSE_OUTPUT) {
169
169
  console.log('⚠️ Could not create symlink, copying Claude settings instead');
170
+ console.log(` Symlink error: ${error.code} - ${error.message}`);
170
171
  }
171
172
 
172
173
  // Copy only essential files (avoid large files like history)
@@ -180,7 +181,10 @@ export function createSandbox(projectDir) {
180
181
  const hostFile = join(hostClaudeDir, file);
181
182
  const sandboxFile = join(sandboxClaudeDir, file);
182
183
 
183
- if (existsSync(hostFile)) {
184
+ if (existsSync(hostFile) && hostFile !== sandboxFile) {
185
+ if (VERBOSE_OUTPUT) {
186
+ console.log(` Copying ${file}: ${hostFile} -> ${sandboxFile}`);
187
+ }
184
188
  cpSync(hostFile, sandboxFile);
185
189
  if (VERBOSE_OUTPUT && file === 'settings.json') {
186
190
  // Show hook information for copied settings
@@ -197,6 +201,25 @@ export function createSandbox(projectDir) {
197
201
  });
198
202
  }
199
203
  }
204
+ } else if (existsSync(hostFile) && hostFile === sandboxFile) {
205
+ if (VERBOSE_OUTPUT) {
206
+ console.log(` Skipping copy of ${file} - source and destination are the same`);
207
+ }
208
+ if (VERBOSE_OUTPUT && file === 'settings.json') {
209
+ // Show hook information for existing settings
210
+ const settings = JSON.parse(require('fs').readFileSync(hostFile, 'utf8'));
211
+ if (settings.hooks) {
212
+ console.log('📋 Hooks configured in existing settings:');
213
+ Object.keys(settings.hooks).forEach(hookType => {
214
+ const hookCount = settings.hooks[hookType].length;
215
+ console.log(` ${hookType}: ${hookCount} hook(s)`);
216
+ settings.hooks[hookType].forEach((hook, index) => {
217
+ const commandCount = hook.hooks ? hook.hooks.length : 0;
218
+ console.log(` ${index + 1}. ${hook.matcher || '*'} (${commandCount} commands)`);
219
+ });
220
+ });
221
+ }
222
+ }
200
223
  }
201
224
  }
202
225