codeam-cli 1.0.5 → 1.0.6
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 +21 -26
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -110,7 +110,7 @@ var import_picocolors = __toESM(require("picocolors"));
|
|
|
110
110
|
// package.json
|
|
111
111
|
var package_default = {
|
|
112
112
|
name: "codeam-cli",
|
|
113
|
-
version: "1.0.
|
|
113
|
+
version: "1.0.6",
|
|
114
114
|
description: "Remote control Claude Code from your mobile device",
|
|
115
115
|
main: "dist/index.js",
|
|
116
116
|
bin: {
|
|
@@ -147,7 +147,6 @@ var package_default = {
|
|
|
147
147
|
},
|
|
148
148
|
dependencies: {
|
|
149
149
|
"@clack/prompts": "^0.10.0",
|
|
150
|
-
"node-pty": "^1.0.0",
|
|
151
150
|
picocolors: "^1.1.0",
|
|
152
151
|
ws: "^8.18.0"
|
|
153
152
|
},
|
|
@@ -509,7 +508,7 @@ var CommandRelayService = class {
|
|
|
509
508
|
};
|
|
510
509
|
|
|
511
510
|
// src/services/claude.service.ts
|
|
512
|
-
var
|
|
511
|
+
var import_child_process = require("child_process");
|
|
513
512
|
var fs2 = __toESM(require("fs"));
|
|
514
513
|
var path2 = __toESM(require("path"));
|
|
515
514
|
var ClaudeService = class {
|
|
@@ -532,55 +531,51 @@ var ClaudeService = class {
|
|
|
532
531
|
}
|
|
533
532
|
const claudeCmd = findInPath("claude") ? "claude" : "claude-code";
|
|
534
533
|
const shell = process.env.SHELL || "/bin/sh";
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
env: process.env
|
|
542
|
-
});
|
|
543
|
-
} catch (err) {
|
|
544
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
534
|
+
this.proc = (0, import_child_process.spawn)(shell, ["-c", `exec ${claudeCmd}`], {
|
|
535
|
+
stdio: ["pipe", "inherit", "inherit"],
|
|
536
|
+
cwd: this.opts.cwd,
|
|
537
|
+
env: process.env
|
|
538
|
+
});
|
|
539
|
+
this.proc.on("error", (err) => {
|
|
545
540
|
console.error(
|
|
546
541
|
`
|
|
547
|
-
\u2717 Failed to launch Claude Code: ${
|
|
542
|
+
\u2717 Failed to launch Claude Code: ${err.message}
|
|
548
543
|
Make sure claude is correctly installed: npm install -g @anthropic-ai/claude-code
|
|
549
|
-
If the issue persists, try: npm rebuild node-pty
|
|
550
544
|
`
|
|
551
545
|
);
|
|
552
546
|
process.exit(1);
|
|
553
|
-
}
|
|
554
|
-
this.proc.onData((data) => {
|
|
555
|
-
process.stdout.write(data);
|
|
556
|
-
this.opts.onData?.(data);
|
|
557
547
|
});
|
|
558
548
|
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
559
549
|
process.stdin.resume();
|
|
560
550
|
process.stdin.on("data", this.stdinHandler);
|
|
561
551
|
process.on("SIGWINCH", this.handleResize);
|
|
562
|
-
this.proc.
|
|
552
|
+
this.proc.on("exit", (code) => {
|
|
563
553
|
this.cleanup();
|
|
564
|
-
this.opts.onExit(
|
|
554
|
+
this.opts.onExit(code ?? 0);
|
|
565
555
|
});
|
|
566
556
|
}
|
|
567
|
-
/** Send a command to Claude's stdin (remote control) */
|
|
557
|
+
/** Send a command to Claude's stdin (remote control from mobile) */
|
|
568
558
|
sendCommand(text) {
|
|
569
|
-
this.proc?.write(text + "\r");
|
|
559
|
+
this.proc?.stdin?.write(text + "\r");
|
|
570
560
|
}
|
|
571
561
|
/** Send Ctrl+C to Claude */
|
|
572
562
|
interrupt() {
|
|
573
|
-
this.proc?.write("");
|
|
563
|
+
this.proc?.stdin?.write("");
|
|
574
564
|
}
|
|
575
565
|
kill() {
|
|
576
566
|
this.proc?.kill();
|
|
577
567
|
this.cleanup();
|
|
578
568
|
}
|
|
579
569
|
stdinHandler = (chunk) => {
|
|
580
|
-
this.proc?.write(chunk
|
|
570
|
+
this.proc?.stdin?.write(chunk);
|
|
581
571
|
};
|
|
582
572
|
handleResize = () => {
|
|
583
|
-
this.proc?.
|
|
573
|
+
if (this.proc?.pid) {
|
|
574
|
+
try {
|
|
575
|
+
process.kill(this.proc.pid, "SIGWINCH");
|
|
576
|
+
} catch {
|
|
577
|
+
}
|
|
578
|
+
}
|
|
584
579
|
};
|
|
585
580
|
cleanup() {
|
|
586
581
|
process.removeListener("SIGWINCH", this.handleResize);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeam-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Remote control Claude Code from your mobile device",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@clack/prompts": "^0.10.0",
|
|
40
|
-
"node-pty": "^1.0.0",
|
|
41
40
|
"picocolors": "^1.1.0",
|
|
42
41
|
"ws": "^8.18.0"
|
|
43
42
|
},
|