codeam-cli 1.4.33 → 1.4.34
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 +19 -12
- 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.34",
|
|
120
120
|
description: "Remote control Claude Code from your mobile device",
|
|
121
121
|
main: "dist/index.js",
|
|
122
122
|
bin: {
|
|
@@ -1338,8 +1338,7 @@ function extractText(content) {
|
|
|
1338
1338
|
}
|
|
1339
1339
|
return "";
|
|
1340
1340
|
}
|
|
1341
|
-
var
|
|
1342
|
-
var MAX_MESSAGE_TEXT_LENGTH = 2e3;
|
|
1341
|
+
var CONVERSATION_BATCH_SIZE = 30;
|
|
1343
1342
|
function parseJsonl(filePath) {
|
|
1344
1343
|
const messages = [];
|
|
1345
1344
|
let raw;
|
|
@@ -1359,15 +1358,15 @@ function parseJsonl(filePath) {
|
|
|
1359
1358
|
const uuid = record["uuid"] ?? `${Date.now()}-${Math.random()}`;
|
|
1360
1359
|
if (type === "user" && msg) {
|
|
1361
1360
|
const text = extractText(msg["content"]).trim();
|
|
1362
|
-
if (text) messages.push({ id: uuid, role: "user", text
|
|
1361
|
+
if (text) messages.push({ id: uuid, role: "user", text, timestamp });
|
|
1363
1362
|
} else if (type === "assistant" && msg) {
|
|
1364
1363
|
const text = extractText(msg["content"]).trim();
|
|
1365
|
-
if (text) messages.push({ id: uuid, role: "agent", text
|
|
1364
|
+
if (text) messages.push({ id: uuid, role: "agent", text, timestamp });
|
|
1366
1365
|
}
|
|
1367
1366
|
} catch {
|
|
1368
1367
|
}
|
|
1369
1368
|
}
|
|
1370
|
-
return messages
|
|
1369
|
+
return messages;
|
|
1371
1370
|
}
|
|
1372
1371
|
function post(endpoint, body) {
|
|
1373
1372
|
return new Promise((resolve) => {
|
|
@@ -1668,17 +1667,25 @@ var HistoryService = class {
|
|
|
1668
1667
|
await post("/api/sessions/claude-sessions", { pluginId: this.pluginId, sessions: sessions2 });
|
|
1669
1668
|
}
|
|
1670
1669
|
/**
|
|
1671
|
-
* Read a specific session's full conversation and POST it to the API.
|
|
1670
|
+
* Read a specific session's full conversation and POST it to the API in batches.
|
|
1671
|
+
* Batching avoids Vercel's 4.5 MB body limit for long sessions.
|
|
1672
1672
|
* Called before sending the resume signal so clients can fetch it immediately.
|
|
1673
1673
|
*/
|
|
1674
1674
|
async loadConversation(sessionId) {
|
|
1675
1675
|
const filePath = path4.join(this.projectDir, `${sessionId}.jsonl`);
|
|
1676
1676
|
const messages = parseJsonl(filePath);
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
messages
|
|
1681
|
-
|
|
1677
|
+
if (messages.length === 0) return;
|
|
1678
|
+
const totalBatches = Math.ceil(messages.length / CONVERSATION_BATCH_SIZE);
|
|
1679
|
+
for (let i = 0; i < totalBatches; i++) {
|
|
1680
|
+
const batch = messages.slice(i * CONVERSATION_BATCH_SIZE, (i + 1) * CONVERSATION_BATCH_SIZE);
|
|
1681
|
+
await post("/api/sessions/claude-conversation", {
|
|
1682
|
+
pluginId: this.pluginId,
|
|
1683
|
+
sessionId,
|
|
1684
|
+
messages: batch,
|
|
1685
|
+
batchIndex: i,
|
|
1686
|
+
totalBatches
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1682
1689
|
}
|
|
1683
1690
|
};
|
|
1684
1691
|
|