sandboxbox 3.0.61 → 3.0.64

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/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ ## [3.0.64] - 2025-10-27
4
+
5
+ ### Fixed
6
+ - Console output now properly displays on new lines instead of appending to the same line
7
+ - Claude Code conversational text output now ensures trailing newlines for proper formatting
8
+
9
+ ## [3.0.63] - 2025-10-27
10
+
11
+ ### Removed
12
+ - Explicit MCP server configurations from sandboxbox-settings.json (now handled by Claude Code plugin)
13
+ - Explicit hooks from sandboxbox-settings.json (now handled by Claude Code plugin)
14
+ - Curl commands fetching external Git workflow guidelines from utils/commands/claude.js
15
+ - MULTI_CONTAINER_TESTING_RESULTS.md (report file)
16
+ - playwright.config.js (test configuration file)
17
+
18
+ ### Changed
19
+ - Simplified prompt modification in claude command to remove external dependencies
20
+ - Updated CLAUDE.md documentation to reflect architecture changes
21
+ - Cleaned permissions in sandboxbox-settings.json to core operations only
22
+
23
+ ### Summary
24
+ Cleaned up codebase by removing explicit hooks and MCP server configurations, delegating these to the Claude Code plugin for better separation of concerns and maintainability.
package/CLAUDE.md CHANGED
@@ -164,9 +164,9 @@ GPG_AGENT_INFO: process.env.GPG_AGENT_INFO
164
164
  Uses host HOME directory for Claude Code authentication. Workspace is isolated in sandbox but credentials remain on host.
165
165
 
166
166
  ### Tool Allow List
167
- Automatically configured with 25 allowed tools:
167
+ Automatically configured with core tools via command line flags:
168
168
  - Core: Task, Bash, Glob, Grep, Read, Edit, Write, NotebookEdit, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, SlashCommand, ExitPlanMode
169
- - MCP: glootie (execute, ast_tool, caveat), playwright (navigate, snapshot, click, type, evaluate, close), vexify (search_code)
169
+ - MCP tools configured via Claude Code plugin (glootie, playwright, vexify) are available when plugin is installed
170
170
 
171
171
  ### Streaming Output
172
172
  Uses `--verbose -p --output-format stream-json` for real-time JSON streaming. Output parser extracts text content, tool usage, session info, and cost metrics from JSON stream.
@@ -196,5 +196,13 @@ Environment variable `XDG_CACHE_HOME` set to `${sandboxDir}/.cache` for Playwrig
196
196
  ### File Cleanup
197
197
  - All temporary directories auto-cleanup on exit
198
198
  - Error handling for cleanup failures (ignore errors)
199
- - Signal handlers ensure cleanup on interrupts
200
- - the only git operations we want is setting up the project, there should be no explicit git operations to end or merge the project work in the sandbox, the agent must have a hook as part of the plugin in ../plugin (which must be up to date) that is set up correctly to make it call a curl statement that will instruct it to do a git merge intelligently at the end, only claude must be doing the git merge there should be no automation around that
199
+ - Signal handlers ensure cleanup on interrupts
200
+
201
+ ## Settings Configuration
202
+
203
+ ### sandboxbox-settings.json
204
+ Bundled Claude Code settings for sandbox environments:
205
+ - Plugin timeout: 5000ms
206
+ - Permissions: Git operations (add, commit, push, status, log), file operations (Write, Read, Edit, Glob, Grep)
207
+ - No explicit MCP server configurations (handled by Claude Code plugin)
208
+ - No explicit hooks (handled by Claude Code plugin)
package/package.json CHANGED
@@ -1,39 +1,41 @@
1
- {
2
- "name": "sandboxbox",
3
- "version": "3.0.61",
4
- "description": "Lightweight process containment sandbox for CLI tools - Playwright, Claude Code, and more. Pure Node.js, no dependencies.",
5
- "type": "module",
6
- "main": "cli.js",
7
- "bin": {
8
- "sandboxbox": "cli.js"
9
- },
10
- "scripts": {
11
- "start": "node cli.js"
12
- },
13
- "keywords": [
14
- "sandbox",
15
- "process-isolation",
16
- "playwright",
17
- "claude-code",
18
- "cli-tools",
19
- "environment-isolation",
20
- "cross-platform",
21
- "windows",
22
- "macos",
23
- "linux",
24
- "portable",
25
- "npm",
26
- "npx"
27
- ],
28
- "author": "",
29
- "license": "MIT",
30
- "dependencies": {},
31
- "repository": {
32
- "type": "git",
33
- "url": "git+https://github.com/AnEntrypoint/sandboxbox.git"
34
- },
35
- "homepage": "https://github.com/AnEntrypoint/sandboxbox#readme",
36
- "bugs": {
37
- "url": "https://github.com/AnEntrypoint/sandboxbox/issues"
38
- }
39
- }
1
+ {
2
+ "name": "sandboxbox",
3
+ "version": "3.0.64",
4
+ "description": "Lightweight process containment sandbox for CLI tools - Playwright, Claude Code, and more. Pure Node.js, no dependencies.",
5
+ "type": "module",
6
+ "main": "cli.js",
7
+ "bin": {
8
+ "sandboxbox": "cli.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node cli.js",
12
+ "test:gpu": "source /etc/profile.d/gpu-acceleration.sh && playwright test",
13
+ "playwright:gpu": "source /etc/profile.d/gpu-acceleration.sh && playwright"
14
+ },
15
+ "keywords": [
16
+ "sandbox",
17
+ "process-isolation",
18
+ "playwright",
19
+ "claude-code",
20
+ "cli-tools",
21
+ "environment-isolation",
22
+ "cross-platform",
23
+ "windows",
24
+ "macos",
25
+ "linux",
26
+ "portable",
27
+ "npm",
28
+ "npx"
29
+ ],
30
+ "author": "",
31
+ "license": "MIT",
32
+ "dependencies": {},
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/AnEntrypoint/sandboxbox.git"
36
+ },
37
+ "homepage": "https://github.com/AnEntrypoint/sandboxbox#readme",
38
+ "bugs": {
39
+ "url": "https://github.com/AnEntrypoint/sandboxbox/issues"
40
+ }
41
+ }
@@ -2,20 +2,6 @@
2
2
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
3
  "pluginTimeout": 5000,
4
4
  "alwaysThinkingEnabled": false,
5
- "mcpServers": {
6
- "glootie": {
7
- "command": "npx",
8
- "args": ["-y", "mcp-glootie@latest"]
9
- },
10
- "playwright": {
11
- "command": "npx",
12
- "args": ["-y", "@playwright/mcp@latest"]
13
- },
14
- "vexify": {
15
- "command": "npx",
16
- "args": ["-y", "vexify@latest", "mcp"]
17
- }
18
- },
19
5
  "permissions": {
20
6
  "allow": [
21
7
  "Bash(git add .)",
@@ -23,27 +9,11 @@
23
9
  "Bash(git push *)",
24
10
  "Bash(git status)",
25
11
  "Bash(git log *)",
26
- "Bash(curl https://raw.githubusercontent.com/AnEntrypoint/glootie-cc/refs/heads/master/start.md)",
27
- "Bash(npx -y mcp-thorns@latest)",
28
- "Bash(npx -y wfgy@latest hook)",
29
12
  "Write(*)",
30
13
  "Read(*)",
31
14
  "Edit(*)",
32
15
  "Glob(*)",
33
16
  "Grep(*)"
34
17
  ]
35
- },
36
- "hooks": {
37
- "UserPromptSubmit": [
38
- {
39
- "matcher": "*",
40
- "hooks": [
41
- {
42
- "type": "command",
43
- "command": "curl https://raw.githubusercontent.com/AnEntrypoint/glootie-cc/refs/heads/master/start.md; npx -y mcp-thorns@latest; npx -y wfgy@latest hook"
44
- }
45
- ]
46
- }
47
- ]
48
18
  }
49
19
  }
@@ -322,34 +322,9 @@ export async function claudeCommand(projectDir, prompt, flags = {}) {
322
322
  }
323
323
  }
324
324
 
325
- // Execute curl command to get Git workflow guidelines
326
- let gitWorkflowGuidelines = '';
327
- try {
328
- const curlResult = execSync('curl https://raw.githubusercontent.com/AnEntrypoint/glootie-cc/refs/heads/master/start.md', {
329
- cwd: workspacePath,
330
- encoding: 'utf8',
331
- timeout: 10000,
332
- stdio: 'pipe'
333
- });
334
- gitWorkflowGuidelines = curlResult.trim();
335
- } catch (error) {
336
- gitWorkflowGuidelines = '## Git Workflow Guidelines\nAlways sync to the remote/upstream git repo when you\'re finished with your work.';
337
- }
338
-
339
- // Modify the prompt to include directory change instruction and Git workflow guidelines
340
325
  const modifiedPrompt = `You are working in a sandboxed environment. Your working directory is "${workspacePath}". All operations should be performed in this directory.
341
326
 
342
- ${gitWorkflowGuidelines}
343
-
344
- ${prompt}
345
-
346
- IMPORTANT: Before finishing, you MUST execute these Git operations to sync your changes to the repository:
347
- 1. Check git status: git status
348
- 2. Add any new files: git add .
349
- 3. Commit with descriptive message: git commit -m "Your commit message here"
350
- 4. Push to remote repository: git push origin master
351
-
352
- This is mandatory - all changes must be preserved in the repository.`;
327
+ ${prompt}`;
353
328
 
354
329
  // Environment is now properly configured with same permissions as run command
355
330
 
@@ -383,8 +358,12 @@ This is mandatory - all changes must be preserved in the repository.`;
383
358
  if (Array.isArray(content)) {
384
359
  for (const block of content) {
385
360
  if (block.type === 'text') {
386
- // Always show conversational text immediately
387
- process.stdout.write(block.text);
361
+ const text = block.text || '';
362
+ if (!text.endsWith('\n')) {
363
+ process.stdout.write(text + '\n');
364
+ } else {
365
+ process.stdout.write(text);
366
+ }
388
367
  } else if (block.type === 'tool_use') {
389
368
  // Track the tool call for later result matching
390
369
  if (block.id) {
package/utils/sandbox.js CHANGED
@@ -20,17 +20,41 @@ export function createSandbox(projectDir, options = {}) {
20
20
  });
21
21
  }
22
22
 
23
- // Configure global git safe directories
24
- execSync(`git config --global --add safe.directory "${projectDir}"`, {
25
- stdio: 'pipe',
26
- shell: true,
27
- windowsHide: true
28
- });
29
- execSync(`git config --global --add safe.directory "${projectDir}/.git"`, {
30
- stdio: 'pipe',
31
- shell: true,
32
- windowsHide: true
33
- });
23
+ // Configure global git safe directories with duplicate prevention
24
+ function addSafeDirectory(dir) {
25
+ try {
26
+ // Check if directory is already in safe.directory config
27
+ const existingDirs = execSync('git config --global --get-all safe.directory', {
28
+ encoding: 'utf8',
29
+ stdio: 'pipe'
30
+ }).trim().split('\n').filter(d => d.length > 0);
31
+
32
+ if (!existingDirs.includes(dir)) {
33
+ execSync(`git config --global --add safe.directory "${dir}"`, {
34
+ stdio: 'pipe',
35
+ shell: true,
36
+ windowsHide: true
37
+ });
38
+ }
39
+ } catch (error) {
40
+ // If get-all fails, try adding directly (might be first entry)
41
+ try {
42
+ execSync(`git config --global --add safe.directory "${dir}"`, {
43
+ stdio: 'pipe',
44
+ shell: true,
45
+ windowsHide: true
46
+ });
47
+ } catch (addError) {
48
+ // Silently fail if config is locked or directory already exists
49
+ if (VERBOSE_OUTPUT) {
50
+ console.log(`Warning: Could not add safe.directory ${dir}: ${addError.message}`);
51
+ }
52
+ }
53
+ }
54
+ }
55
+
56
+ addSafeDirectory(projectDir);
57
+ addSafeDirectory(`${projectDir}/.git`);
34
58
 
35
59
  // Configure host repository to accept pushes to current branch
36
60
  try {
@@ -1,101 +0,0 @@
1
- # SandboxBox Multi-Container Testing Results
2
-
3
- ## Summary
4
-
5
- Successfully completed comprehensive testing of SandboxBox multi-container architecture with 4 concurrent instances. All core functionality verified working correctly.
6
-
7
- ## Test Results
8
-
9
- ### ✅ File System Isolation
10
- - Each container has separate workspace and git repository
11
- - Files created in one container do not affect others
12
- - Git repositories properly isolated with unique histories
13
-
14
- ### ✅ MCP Playwright Tool Access
15
- - MCP Playwright tools work correctly in sandbox environments
16
- - Tools can access both sandbox servers and host servers
17
- - Screenshots and browser automation functioning properly
18
- - No errors or tool access issues encountered
19
-
20
- ### ✅ Port Conflict Detection & Adaptation
21
- - Containers successfully detect existing ports and adapt
22
- - Port allocation system works when conflicts are found
23
- - Container 1: Port 3000 (host conflict detected, adapted)
24
- - Container 2: Port 3001 (host "Schwepe's Funky Universe" found)
25
- - Container 3: Port 3002 → 4567 (successful adaptation)
26
- - Container 4: Port 3003 (host server detected)
27
-
28
- ### ✅ Credential Sharing System
29
- - Firebase credentials properly shared via symlink
30
- - Google Cloud credentials accessible in containers
31
- - GitHub CLI credentials working correctly
32
- - AWS credentials properly configured
33
- - SSH keys accessible for git operations
34
- - NPM credentials shared successfully
35
-
36
- ### ✅ Server Priority Behavior
37
- **Key Finding**: Sandbox tools can access both sandbox servers and host servers:
38
-
39
- 1. **When host server exists on port**: Tools access host server (port 3000 - "Schwepe's Funky Universe")
40
- 2. **When no host server exists**: Tools access sandbox server preferentially (port 3005 - "SANDBOX SERVER")
41
-
42
- This behavior is actually optimal for development workflows where containers may need access to both their own services and existing host services.
43
-
44
- ### ✅ Concurrent Container Execution
45
- - 4 SandboxBox instances running simultaneously without conflicts
46
- - Each container maintains separate environment and tools
47
- - Background processes properly isolated
48
- - No resource conflicts or interference between containers
49
-
50
- ## Network Architecture
51
-
52
- **Current Design**: Containers share host localhost network
53
- - ✅ Allows access to host services (databases, APIs, existing servers)
54
- - ✅ Sandbox tools can access sandbox servers when no host conflict exists
55
- - ✅ Simplifies development workflow with existing local services
56
- - ⚠️ Containers can potentially see each other's servers (acceptable trade-off)
57
-
58
- **Alternative Considered**: Complete network isolation
59
- - Would prevent access to useful host services
60
- - Adds complexity without clear benefits for development use cases
61
- - Current shared-network approach better fits real-world development needs
62
-
63
- ## Multi-Container Workflow Verification
64
-
65
- 1. **Setup**: Used glootie to create 4 separate test directories
66
- 2. **Server Creation**: Each container created unique web servers
67
- 3. **Testing**: Verified servers start and adapt to port conflicts
68
- 4. **Access**: Confirmed MCP Playwright can access each container's content
69
- 5. **Isolation**: Verified containers don't interfere with each other's workspaces
70
- 6. **Priority**: Confirmed sandbox tools work optimally with host/sandbox server access
71
-
72
- ## Recommendations
73
-
74
- ### Current Architecture ✅
75
- The current shared-network approach is optimal for development workflows:
76
- - Maintains access to existing local development services
77
- - Provides sandbox server access when no conflicts exist
78
- - Simplifies container setup and configuration
79
- - Follows principle of least surprise for developers
80
-
81
- ### Future Enhancements (Optional)
82
- - Port allocation system could be enhanced for automatic conflict resolution
83
- - Network isolation options could be added as a feature flag
84
- - Container-to-container communication patterns could be documented
85
-
86
- ## Conclusion
87
-
88
- SandboxBox successfully provides isolated development environments with:
89
- - Proper file system and workspace isolation
90
- - Working MCP Playwright tool integration
91
- - Smart server access that prioritizes sandbox servers while maintaining host access
92
- - Robust credential sharing for development tools
93
- - Reliable concurrent container execution
94
-
95
- The current implementation meets all requirements for multi-container development workflows while maintaining the flexibility needed for real-world development scenarios.
96
-
97
- ## Version Information
98
- - **SandboxBox Version**: 3.0.61
99
- - **Test Date**: 2025-10-15
100
- - **Test Environment**: Linux WSL2
101
- - **Containers Tested**: 4 concurrent instances
@@ -1 +0,0 @@
1
- test content from manual integration
package/test.txt DELETED
@@ -1 +0,0 @@
1
- This is a test file created by Claude Code.