codeam-cli 1.4.53 → 1.4.55
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/README.md +1 -1
- package/dist/index.js +58 -40
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,5 +21,5 @@ codeam logout # Remove all sessions
|
|
|
21
21
|
## Requirements
|
|
22
22
|
|
|
23
23
|
- Node.js 18+
|
|
24
|
-
- Claude Code installed
|
|
24
|
+
- Claude Code installed — see the [official quickstart](https://code.claude.com/docs/en/quickstart)
|
|
25
25
|
- [CodeAgent Mobile](https://www.codeagent-mobile.com) app on your phone
|
package/dist/index.js
CHANGED
|
@@ -116,7 +116,7 @@ var import_qrcode_terminal = __toESM(require("qrcode-terminal"));
|
|
|
116
116
|
// package.json
|
|
117
117
|
var package_default = {
|
|
118
118
|
name: "codeam-cli",
|
|
119
|
-
version: "1.4.
|
|
119
|
+
version: "1.4.55",
|
|
120
120
|
description: "Remote control Claude Code from your mobile device",
|
|
121
121
|
main: "dist/index.js",
|
|
122
122
|
bin: {
|
|
@@ -910,6 +910,8 @@ function isChromeLine(line) {
|
|
|
910
910
|
if (BULLET_TOOL_RE.test(t)) return true;
|
|
911
911
|
if (TREE_LINE_RE.test(t)) return true;
|
|
912
912
|
if (STATUS_LINE_RE.test(t) && /\d+\s*s\s*[·•]|\bthought\s+for\b|\d+\s*tokens|\(thinking\)/i.test(t)) return true;
|
|
913
|
+
if (/^↓\s*\d+\s*tokens/i.test(t)) return true;
|
|
914
|
+
if (/^\bthought\s+for\s+\d+/i.test(t)) return true;
|
|
913
915
|
if (/esc.{0,5}to.{0,5}interrupt/i.test(t)) return true;
|
|
914
916
|
if (/high\s*[·•]\s*\/effort/i.test(t)) return true;
|
|
915
917
|
if (/^[❯>]\s*$/.test(t)) return true;
|
|
@@ -1219,6 +1221,8 @@ function filterChrome(lines) {
|
|
|
1219
1221
|
continue;
|
|
1220
1222
|
if (/^└\s/.test(t)) continue;
|
|
1221
1223
|
if (/^\+\s/.test(t) && /\d+\s*s\s*[·•]|\bthought\s+for\b|\d+\s*tokens|\(thinking\)/i.test(t)) continue;
|
|
1224
|
+
if (/^↓\s*\d+\s*tokens/i.test(t)) continue;
|
|
1225
|
+
if (/^\bthought\s+for\s+\d+/i.test(t)) continue;
|
|
1222
1226
|
const stripped = t.replace(/^[│╭╰╮╯┌└┐┘├┤┬┴┼]\s?/, "");
|
|
1223
1227
|
if (/^[❯>]\s+\S/.test(stripped) && !/^[❯>]\s*\d+\./.test(stripped)) {
|
|
1224
1228
|
skipEchoContinuation = true;
|
|
@@ -1449,49 +1453,63 @@ var OutputService = class _OutputService {
|
|
|
1449
1453
|
});
|
|
1450
1454
|
}
|
|
1451
1455
|
postChunk(body) {
|
|
1456
|
+
const isCritical = body.clear === true || body.type === "new_turn" || body.type === "user_message" || body.done === true;
|
|
1457
|
+
const maxRetries = isCritical ? 3 : 0;
|
|
1458
|
+
const payload = JSON.stringify({
|
|
1459
|
+
sessionId: this.sessionId,
|
|
1460
|
+
pluginId: this.pluginId,
|
|
1461
|
+
...body
|
|
1462
|
+
});
|
|
1452
1463
|
return new Promise((resolve) => {
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
"Content-Length": Buffer.byteLength(payload)
|
|
1464
|
+
const attempt = (attemptsLeft) => {
|
|
1465
|
+
let settled = false;
|
|
1466
|
+
const u = new URL(`${API_BASE4}/api/commands/output`);
|
|
1467
|
+
const transport = u.protocol === "https:" ? https2 : http2;
|
|
1468
|
+
const req = transport.request(
|
|
1469
|
+
{
|
|
1470
|
+
hostname: u.hostname,
|
|
1471
|
+
port: u.port || (u.protocol === "https:" ? 443 : 80),
|
|
1472
|
+
path: u.pathname,
|
|
1473
|
+
method: "POST",
|
|
1474
|
+
headers: {
|
|
1475
|
+
"Content-Type": "application/json",
|
|
1476
|
+
"Content-Length": Buffer.byteLength(payload)
|
|
1477
|
+
},
|
|
1478
|
+
timeout: 8e3
|
|
1469
1479
|
},
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
+
(res) => {
|
|
1481
|
+
let resData = "";
|
|
1482
|
+
res.on("data", (c) => {
|
|
1483
|
+
resData += c.toString();
|
|
1484
|
+
});
|
|
1485
|
+
res.on("end", () => {
|
|
1486
|
+
if (settled) return;
|
|
1487
|
+
settled = true;
|
|
1488
|
+
if (res.statusCode && res.statusCode >= 400) {
|
|
1489
|
+
process.stderr.write(`[codeam] output API error ${res.statusCode}: ${resData}
|
|
1480
1490
|
`);
|
|
1481
|
-
|
|
1491
|
+
}
|
|
1492
|
+
resolve();
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1495
|
+
);
|
|
1496
|
+
req.on("error", () => {
|
|
1497
|
+
if (settled) return;
|
|
1498
|
+
settled = true;
|
|
1499
|
+
if (attemptsLeft > 0) {
|
|
1500
|
+
const delay = 200 * (maxRetries - attemptsLeft + 1);
|
|
1501
|
+
setTimeout(() => attempt(attemptsLeft - 1), delay);
|
|
1502
|
+
} else {
|
|
1482
1503
|
resolve();
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
});
|
|
1493
|
-
req.write(payload);
|
|
1494
|
-
req.end();
|
|
1504
|
+
}
|
|
1505
|
+
});
|
|
1506
|
+
req.on("timeout", () => {
|
|
1507
|
+
req.destroy();
|
|
1508
|
+
});
|
|
1509
|
+
req.write(payload);
|
|
1510
|
+
req.end();
|
|
1511
|
+
};
|
|
1512
|
+
attempt(maxRetries);
|
|
1495
1513
|
});
|
|
1496
1514
|
}
|
|
1497
1515
|
};
|