sandboxbox 3.0.33 → 3.0.35

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/CLAUDE.md CHANGED
@@ -196,4 +196,5 @@ 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
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sandboxbox",
3
- "version": "3.0.33",
3
+ "version": "3.0.35",
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",
@@ -18,33 +18,6 @@
18
18
  }
19
19
  ]
20
20
  }
21
- ],
22
- "Stop": [
23
- {
24
- "matcher": "*",
25
- "hooks": [
26
- {
27
- "type": "command",
28
- "command": "echo 'SESSION_END: Intelligently analyze all changes made during this session and prepare to commit them back to the host repository if they represent meaningful progress.'"
29
- },
30
- {
31
- "type": "command",
32
- "command": "echo 'GIT_INTEGRATION: Review modified files, stage appropriate changes, and create an intelligent commit message that describes the work accomplished. Push to host repository if changes are ready.'"
33
- },
34
- {
35
- "type": "command",
36
- "command": "git status --porcelain"
37
- },
38
- {
39
- "type": "command",
40
- "command": "if [ -n \"$(git status --porcelain)\" ]; then echo 'Changes detected - preparing intelligent Git operations...'; git add -A; echo 'Changes staged. Ready for intelligent commit analysis.'; else echo 'No changes detected in working directory.'; fi"
41
- },
42
- {
43
- "type": "command",
44
- "command": "echo 'Please intelligently analyze the staged changes and create an appropriate commit message, then commit and push if the changes are ready.'"
45
- }
46
- ]
47
- }
48
21
  ]
49
22
  }
50
23
  }
package/utils/sandbox.js CHANGED
@@ -66,6 +66,25 @@ export function createSandbox(projectDir, options = {}) {
66
66
  });
67
67
  }
68
68
 
69
+ // Ensure .claude is in .gitignore in the sandbox workspace
70
+ const gitignorePath = join(workspaceDir, '.gitignore');
71
+ if (!existsSync(gitignorePath)) {
72
+ writeFileSync(gitignorePath, `# Claude Code settings (project-specific, not to be committed)
73
+ .claude/
74
+
75
+ # Dependencies
76
+ node_modules/
77
+ *.log
78
+ .DS_Store
79
+ `);
80
+ } else {
81
+ // Add .claude to existing .gitignore if not already present
82
+ const gitignoreContent = readFileSync(gitignorePath, 'utf8');
83
+ if (!gitignoreContent.includes('.claude/')) {
84
+ writeFileSync(gitignorePath, gitignoreContent + '\n# Claude Code settings (project-specific, not to be committed)\n.claude/\n');
85
+ }
86
+ }
87
+
69
88
  // Set up host repo as origin in sandbox (pointing to host directory)
70
89
  try {
71
90
  execSync(`git remote add origin "${projectDir}"`, {
@@ -114,6 +133,18 @@ export function createSandbox(projectDir, options = {}) {
114
133
  // Upstream may not exist yet, ignore error
115
134
  }
116
135
 
136
+ // Copy project's .claude/settings.json if it exists (project-level Claude settings)
137
+ const projectClaudeSettingsPath = join(projectDir, '.claude', 'settings.json');
138
+ if (existsSync(projectClaudeSettingsPath)) {
139
+ const sandboxClaudeSettingsPath = join(workspaceDir, '.claude', 'settings.json');
140
+ mkdirSync(join(workspaceDir, '.claude'), { recursive: true });
141
+ cpSync(projectClaudeSettingsPath, sandboxClaudeSettingsPath);
142
+
143
+ if (VERBOSE_OUTPUT) {
144
+ console.log('✅ Copied project Claude settings to sandbox');
145
+ }
146
+ }
147
+
117
148
  // Batch fetch git identity settings for efficiency
118
149
  const gitSettings = execSync(`git config --global --get user.name && git config --global --get user.email && git config --global --get color.ui`, {
119
150
  stdio: 'pipe',
@@ -130,6 +161,34 @@ export function createSandbox(projectDir, options = {}) {
130
161
  shell: true
131
162
  });
132
163
 
164
+ // Configure Git remote to host for bidirectional synchronization
165
+ try {
166
+ execSync(`cd "${workspaceDir}" && git remote add host "${projectDir}"`, {
167
+ stdio: 'pipe',
168
+ shell: true
169
+ });
170
+
171
+ if (VERBOSE_OUTPUT) {
172
+ console.log('✅ Configured Git remote to host repository');
173
+ }
174
+ } catch (error) {
175
+ // Remote might already exist, try to update it
176
+ try {
177
+ execSync(`cd "${workspaceDir}" && git remote set-url host "${projectDir}"`, {
178
+ stdio: 'pipe',
179
+ shell: true
180
+ });
181
+
182
+ if (VERBOSE_OUTPUT) {
183
+ console.log('✅ Updated Git remote to host repository');
184
+ }
185
+ } catch (updateError) {
186
+ if (VERBOSE_OUTPUT) {
187
+ console.log('⚠️ Could not configure Git remote to host');
188
+ }
189
+ }
190
+ }
191
+
133
192
  // Setup Claude settings in sandbox
134
193
  const hostClaudeDir = join(homedir(), '.claude');
135
194
  const sandboxClaudeDir = join(sandboxDir, '.claude');