claude-code-remote-pilot 0.2.0 → 0.2.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/bin/claude-pilot.js +1 -0
- package/lib/SessionManager.js +8 -0
- package/package.json +1 -1
package/bin/claude-pilot.js
CHANGED
|
@@ -110,6 +110,7 @@ function renderTable(sessions) {
|
|
|
110
110
|
// ─── watch mode ───────────────────────────────────────────────────────────────
|
|
111
111
|
|
|
112
112
|
function startWatch(manager, rl) {
|
|
113
|
+
rl.removeAllListeners('close');
|
|
113
114
|
rl.close();
|
|
114
115
|
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
115
116
|
process.stdin.resume();
|
package/lib/SessionManager.js
CHANGED
|
@@ -4,6 +4,8 @@ const fs = require('fs');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const Watcher = require('./Watcher');
|
|
6
6
|
|
|
7
|
+
const RESERVED = new Set(['spawn', 'list', 'watch', 'attach', 'kill', 'help', 'exit', 'quit']);
|
|
8
|
+
|
|
7
9
|
function sanitizeName(name) {
|
|
8
10
|
return name.replace(/[.:\s]/g, '-');
|
|
9
11
|
}
|
|
@@ -19,8 +21,14 @@ class SessionManager {
|
|
|
19
21
|
if (!fs.existsSync(resolved)) throw new Error(`Path not found: ${resolved}`);
|
|
20
22
|
|
|
21
23
|
const sessionName = sanitizeName(name || path.basename(resolved));
|
|
24
|
+
if (RESERVED.has(sessionName)) throw new Error(`"${sessionName}" is a reserved command name. Choose a different session name.`);
|
|
22
25
|
if (this.sessions.has(sessionName)) throw new Error(`Session "${sessionName}" already exists.`);
|
|
23
26
|
|
|
27
|
+
// Kill stale tmux session from a previous crashed run
|
|
28
|
+
try { execSync(`tmux has-session -t "${sessionName}"`, { stdio: 'ignore' });
|
|
29
|
+
execSync(`tmux kill-session -t "${sessionName}"`, { stdio: 'ignore' });
|
|
30
|
+
} catch {}
|
|
31
|
+
|
|
24
32
|
execSync(`tmux new-session -d -s "${sessionName}" -c "${resolved}" "claude"`, { stdio: 'ignore' });
|
|
25
33
|
|
|
26
34
|
const session = { name: sessionName, path: resolved, status: 'running', startedAt: new Date(), resumeAt: null };
|
package/package.json
CHANGED