ninja-terminals 2.4.2 → 2.4.4
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/cli.js +22 -12
- package/mcp-server.js +4 -1
- package/package.json +1 -1
- package/server.js +4 -1
package/cli.js
CHANGED
|
@@ -92,7 +92,10 @@ if (hasFlag('--setup')) {
|
|
|
92
92
|
fs.writeFileSync(mcpPath, JSON.stringify(mcpConfig, null, 2) + '\n');
|
|
93
93
|
console.log(`✅ Added ninja-terminals to ${mcpPath}`);
|
|
94
94
|
|
|
95
|
-
// 3. Copy orchestrator prompt to CLAUDE.md
|
|
95
|
+
// 3. Copy orchestrator prompt to CLAUDE.md in the current directory.
|
|
96
|
+
// Wrapped in try/catch: running from a protected dir (e.g. an Admin shell
|
|
97
|
+
// sitting in C:\Windows\System32) makes this write fail with EPERM. Warn
|
|
98
|
+
// and guide instead of crashing — .mcp.json is already configured.
|
|
96
99
|
const claudeMd = path.join(process.cwd(), 'CLAUDE.md');
|
|
97
100
|
const orchestratorPrompt = path.join(npmRoot, 'ORCHESTRATOR-PROMPT.md');
|
|
98
101
|
|
|
@@ -100,19 +103,26 @@ if (hasFlag('--setup')) {
|
|
|
100
103
|
const prompt = fs.readFileSync(orchestratorPrompt, 'utf-8');
|
|
101
104
|
const marker = '<!-- NINJA TERMINALS ORCHESTRATOR -->';
|
|
102
105
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
try {
|
|
107
|
+
let claudeContent = '';
|
|
108
|
+
if (fs.existsSync(claudeMd)) {
|
|
109
|
+
claudeContent = fs.readFileSync(claudeMd, 'utf-8');
|
|
110
|
+
if (claudeContent.includes(marker)) {
|
|
111
|
+
console.log(`✅ Orchestrator prompt already in CLAUDE.md`);
|
|
112
|
+
} else {
|
|
113
|
+
fs.writeFileSync(claudeMd, claudeContent + `\n\n${marker}\n${prompt}`);
|
|
114
|
+
console.log(`✅ Added orchestrator prompt to ${claudeMd}`);
|
|
115
|
+
}
|
|
108
116
|
} else {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
console.log(`✅ Added orchestrator prompt to CLAUDE.md`);
|
|
117
|
+
fs.writeFileSync(claudeMd, `${marker}\n${prompt}`);
|
|
118
|
+
console.log(`✅ Created ${claudeMd}`);
|
|
112
119
|
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
console.log(
|
|
120
|
+
} catch (e) {
|
|
121
|
+
console.log(`⚠️ Couldn't write CLAUDE.md in ${process.cwd()} (${e.code || e.message}).`);
|
|
122
|
+
console.log(` This usually means you're in a protected folder (e.g. C:\\Windows\\System32).`);
|
|
123
|
+
console.log(` Re-run setup from your project folder, e.g.:`);
|
|
124
|
+
console.log(` cd <your-project> && npx ninja-terminals --setup`);
|
|
125
|
+
console.log(` (.mcp.json is already configured, so MCP tools will still load.)`);
|
|
116
126
|
}
|
|
117
127
|
}
|
|
118
128
|
|
package/mcp-server.js
CHANGED
|
@@ -42,7 +42,10 @@ const {
|
|
|
42
42
|
// ── Config ──────────────────────────────────────────────────
|
|
43
43
|
const PREFERRED_HTTP_PORT = parseInt(process.env.HTTP_PORT || process.env.PORT || '3300', 10);
|
|
44
44
|
let HTTP_PORT = PREFERRED_HTTP_PORT;
|
|
45
|
-
|
|
45
|
+
// Default to plain `claude` so workers use the account's current default model
|
|
46
|
+
// (no stale pinned model that breaks when retired). Override flags/model via
|
|
47
|
+
// CLAUDE_CMD env if needed.
|
|
48
|
+
const CLAUDE_CMD = process.env.CLAUDE_CMD || process.env.CLAUDE_CHROME_CMD || 'claude';
|
|
46
49
|
// Windows has no $SHELL / /bin/zsh — default to PowerShell (handles drive
|
|
47
50
|
// changes via `cd` and emits clean ANSI for status detection).
|
|
48
51
|
const IS_WIN = process.platform === 'win32';
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -38,7 +38,10 @@ const {
|
|
|
38
38
|
const PREFERRED_PORT = parseInt(process.env.PORT || process.env.HTTP_PORT || '3300', 10);
|
|
39
39
|
const BIND_HOST = process.env.NINJA_BIND_HOST || '127.0.0.1';
|
|
40
40
|
const DEFAULT_TERMINALS = parseInt(process.env.DEFAULT_TERMINALS || '4', 10);
|
|
41
|
-
|
|
41
|
+
// Default to plain `claude` so workers use the account's current default model
|
|
42
|
+
// (no stale pinned model that breaks when retired). Override flags/model via
|
|
43
|
+
// CLAUDE_CMD env if needed.
|
|
44
|
+
const CLAUDE_CMD = process.env.CLAUDE_CMD || process.env.CLAUDE_CHROME_CMD || 'claude';
|
|
42
45
|
// Windows has no $SHELL / /bin/zsh — default to PowerShell (handles drive
|
|
43
46
|
// changes via `cd` and emits clean ANSI for status detection).
|
|
44
47
|
const IS_WIN = process.platform === 'win32';
|