codeam-cli 1.4.32 → 1.4.33
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 +7 -5
- package/package.json +1 -1
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.33",
|
|
120
120
|
description: "Remote control Claude Code from your mobile device",
|
|
121
121
|
main: "dist/index.js",
|
|
122
122
|
bin: {
|
|
@@ -1338,6 +1338,8 @@ function extractText(content) {
|
|
|
1338
1338
|
}
|
|
1339
1339
|
return "";
|
|
1340
1340
|
}
|
|
1341
|
+
var MAX_CONVERSATION_MESSAGES = 100;
|
|
1342
|
+
var MAX_MESSAGE_TEXT_LENGTH = 2e3;
|
|
1341
1343
|
function parseJsonl(filePath) {
|
|
1342
1344
|
const messages = [];
|
|
1343
1345
|
let raw;
|
|
@@ -1357,15 +1359,15 @@ function parseJsonl(filePath) {
|
|
|
1357
1359
|
const uuid = record["uuid"] ?? `${Date.now()}-${Math.random()}`;
|
|
1358
1360
|
if (type === "user" && msg) {
|
|
1359
1361
|
const text = extractText(msg["content"]).trim();
|
|
1360
|
-
if (text) messages.push({ id: uuid, role: "user", text, timestamp });
|
|
1362
|
+
if (text) messages.push({ id: uuid, role: "user", text: text.slice(0, MAX_MESSAGE_TEXT_LENGTH), timestamp });
|
|
1361
1363
|
} else if (type === "assistant" && msg) {
|
|
1362
1364
|
const text = extractText(msg["content"]).trim();
|
|
1363
|
-
if (text) messages.push({ id: uuid, role: "agent", text, timestamp });
|
|
1365
|
+
if (text) messages.push({ id: uuid, role: "agent", text: text.slice(0, MAX_MESSAGE_TEXT_LENGTH), timestamp });
|
|
1364
1366
|
}
|
|
1365
1367
|
} catch {
|
|
1366
1368
|
}
|
|
1367
1369
|
}
|
|
1368
|
-
return messages;
|
|
1370
|
+
return messages.slice(-MAX_CONVERSATION_MESSAGES);
|
|
1369
1371
|
}
|
|
1370
1372
|
function post(endpoint, body) {
|
|
1371
1373
|
return new Promise((resolve) => {
|
|
@@ -1382,7 +1384,7 @@ function post(endpoint, body) {
|
|
|
1382
1384
|
"Content-Type": "application/json",
|
|
1383
1385
|
"Content-Length": Buffer.byteLength(payload)
|
|
1384
1386
|
},
|
|
1385
|
-
timeout:
|
|
1387
|
+
timeout: 15e3
|
|
1386
1388
|
},
|
|
1387
1389
|
(res) => {
|
|
1388
1390
|
res.resume();
|