claude-code-remote-pilot 0.2.1 → 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/lib/SessionManager.js +3 -0
- package/package.json +1 -1
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,6 +21,7 @@ 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
|
|
|
24
27
|
// Kill stale tmux session from a previous crashed run
|
package/package.json
CHANGED