@damper/cli 0.7.1 → 0.7.2
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/dist/services/worktree.js +18 -9
- package/package.json +1 -1
|
@@ -268,20 +268,29 @@ export async function createWorktree(options) {
|
|
|
268
268
|
};
|
|
269
269
|
fs.writeFileSync(path.join(worktreePath, '.mcp.json'), JSON.stringify(mcpConfig, null, 2));
|
|
270
270
|
console.log(pc.dim('Created .mcp.json with Damper MCP'));
|
|
271
|
-
// Create .claude/settings.local.json
|
|
271
|
+
// Create .claude/settings.local.json - copy root permissions and ensure Damper MCP is allowed
|
|
272
272
|
const claudeDir = path.join(worktreePath, '.claude');
|
|
273
273
|
if (!fs.existsSync(claudeDir)) {
|
|
274
274
|
fs.mkdirSync(claudeDir, { recursive: true });
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
276
|
+
// Read existing settings from root project
|
|
277
|
+
const rootSettingsPath = path.join(projectRoot, '.claude', 'settings.local.json');
|
|
278
|
+
let claudeSettings = {};
|
|
279
|
+
if (fs.existsSync(rootSettingsPath)) {
|
|
280
|
+
try {
|
|
281
|
+
claudeSettings = JSON.parse(fs.readFileSync(rootSettingsPath, 'utf-8'));
|
|
282
|
+
}
|
|
283
|
+
catch { }
|
|
284
|
+
}
|
|
285
|
+
// Ensure permissions.allow includes damper MCP
|
|
286
|
+
const permissions = (claudeSettings.permissions ?? {});
|
|
287
|
+
const allow = Array.isArray(permissions.allow) ? [...permissions.allow] : [];
|
|
288
|
+
if (!allow.includes('mcp__damper__*')) {
|
|
289
|
+
allow.unshift('mcp__damper__*');
|
|
290
|
+
}
|
|
291
|
+
claudeSettings.permissions = { ...permissions, allow };
|
|
283
292
|
fs.writeFileSync(path.join(claudeDir, 'settings.local.json'), JSON.stringify(claudeSettings, null, 2));
|
|
284
|
-
console.log(pc.dim('Created .claude/settings.local.json with
|
|
293
|
+
console.log(pc.dim('Created .claude/settings.local.json with root permissions + MCP'));
|
|
285
294
|
// Save to state
|
|
286
295
|
const worktreeState = {
|
|
287
296
|
taskId,
|