@damper/cli 0.5.17 → 0.6.0
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/index.js +1 -1
- package/dist/services/claude.js +5 -18
- package/dist/services/worktree.js +4 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { statusCommand } from './commands/status.js';
|
|
|
5
5
|
import { cleanupCommand } from './commands/cleanup.js';
|
|
6
6
|
import { setupCommand } from './commands/setup.js';
|
|
7
7
|
import { releaseCommand } from './commands/release.js';
|
|
8
|
-
const VERSION = '0.
|
|
8
|
+
const VERSION = '0.6.0';
|
|
9
9
|
function showHelp() {
|
|
10
10
|
console.log(`
|
|
11
11
|
${pc.bold('@damper/cli')} - Agent orchestration for Damper tasks
|
package/dist/services/claude.js
CHANGED
|
@@ -110,9 +110,11 @@ export async function launchClaude(options) {
|
|
|
110
110
|
}
|
|
111
111
|
console.log();
|
|
112
112
|
// Build prompt - context is in TASK_CONTEXT.md, MCP is in .claude/settings.json
|
|
113
|
-
const initialPrompt = `
|
|
113
|
+
const initialPrompt = `IMPORTANT: Start by reading TASK_CONTEXT.md completely. It contains the task description, implementation plan, critical rules, and architecture context. Follow the implementation plan if one exists - do NOT start exploring the codebase until you've read it. Task #${taskId}: ${taskTitle}`;
|
|
114
114
|
console.log(pc.dim(`Launching Claude in ${cwd}...`));
|
|
115
|
-
// Launch Claude Code
|
|
115
|
+
// Launch Claude Code
|
|
116
|
+
// Use spawn with stdio: 'inherit' for proper TTY passthrough
|
|
117
|
+
// Signals (Ctrl+C, Escape) are handled naturally since child inherits the terminal
|
|
116
118
|
await new Promise((resolve) => {
|
|
117
119
|
const child = spawn('claude', [initialPrompt], {
|
|
118
120
|
cwd,
|
|
@@ -122,15 +124,6 @@ export async function launchClaude(options) {
|
|
|
122
124
|
DAMPER_API_KEY: apiKey,
|
|
123
125
|
},
|
|
124
126
|
});
|
|
125
|
-
// Forward signals to child process
|
|
126
|
-
const forwardSignal = (signal) => {
|
|
127
|
-
if (!child.killed) {
|
|
128
|
-
child.kill(signal);
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
process.on('SIGINT', () => forwardSignal('SIGINT'));
|
|
132
|
-
process.on('SIGTERM', () => forwardSignal('SIGTERM'));
|
|
133
|
-
process.on('SIGHUP', () => forwardSignal('SIGHUP'));
|
|
134
127
|
child.on('error', (err) => {
|
|
135
128
|
if (err.code === 'ENOENT') {
|
|
136
129
|
console.log(pc.red('\nError: Claude Code CLI not found.'));
|
|
@@ -139,13 +132,7 @@ export async function launchClaude(options) {
|
|
|
139
132
|
}
|
|
140
133
|
resolve();
|
|
141
134
|
});
|
|
142
|
-
child.on('close', () =>
|
|
143
|
-
// Clean up signal listeners
|
|
144
|
-
process.removeAllListeners('SIGINT');
|
|
145
|
-
process.removeAllListeners('SIGTERM');
|
|
146
|
-
process.removeAllListeners('SIGHUP');
|
|
147
|
-
resolve();
|
|
148
|
-
});
|
|
135
|
+
child.on('close', () => resolve());
|
|
149
136
|
});
|
|
150
137
|
// Post-task flow
|
|
151
138
|
console.log(pc.dim('\n─────────────────────────────────────────'));
|
|
@@ -254,12 +254,8 @@ export async function createWorktree(options) {
|
|
|
254
254
|
await fs.promises.copyFile(source, target);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
// Create .
|
|
258
|
-
const
|
|
259
|
-
if (!fs.existsSync(claudeDir)) {
|
|
260
|
-
fs.mkdirSync(claudeDir, { recursive: true });
|
|
261
|
-
}
|
|
262
|
-
const claudeSettings = {
|
|
257
|
+
// Create .mcp.json with Damper MCP configured (project-level MCP config)
|
|
258
|
+
const mcpConfig = {
|
|
263
259
|
mcpServers: {
|
|
264
260
|
damper: {
|
|
265
261
|
command: 'npx',
|
|
@@ -270,8 +266,8 @@ export async function createWorktree(options) {
|
|
|
270
266
|
},
|
|
271
267
|
},
|
|
272
268
|
};
|
|
273
|
-
fs.writeFileSync(path.join(
|
|
274
|
-
console.log(pc.dim('Created .
|
|
269
|
+
fs.writeFileSync(path.join(worktreePath, '.mcp.json'), JSON.stringify(mcpConfig, null, 2));
|
|
270
|
+
console.log(pc.dim('Created .mcp.json with Damper MCP'));
|
|
275
271
|
// Save to state
|
|
276
272
|
const worktreeState = {
|
|
277
273
|
taskId,
|