sandboxbox 3.0.26 → 3.0.27

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 +16 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandboxbox",
3
- "version": "3.0.26",
3
+ "version": "3.0.27",
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
@@ -255,7 +255,22 @@ export function createSandbox(projectDir) {
255
255
  const pluginsDir = join(hostClaudeDir, 'plugins');
256
256
  if (existsSync(pluginsDir)) {
257
257
  const sandboxPluginsDir = join(sandboxClaudeDir, 'plugins');
258
- cpSync(pluginsDir, sandboxPluginsDir, { recursive: true });
258
+
259
+ // Check real paths to avoid copying directory to itself
260
+ let shouldCopyPlugins = true;
261
+ try {
262
+ const pluginsRealPath = realpathSync(pluginsDir);
263
+ const sandboxPluginsRealPath = realpathSync(sandboxPluginsDir);
264
+ if (pluginsRealPath === sandboxPluginsRealPath) {
265
+ shouldCopyPlugins = false;
266
+ }
267
+ } catch (e) {
268
+ // If we can't resolve real paths, proceed with copy attempt
269
+ }
270
+
271
+ if (shouldCopyPlugins) {
272
+ cpSync(pluginsDir, sandboxPluginsDir, { recursive: true });
273
+ }
259
274
  }
260
275
  }
261
276
  }