codeam-cli 1.4.32 → 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 +17 -8
- 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,6 +1338,7 @@ function extractText(content) {
|
|
|
1338
1338
|
}
|
|
1339
1339
|
return "";
|
|
1340
1340
|
}
|
|
1341
|
+
var CONVERSATION_BATCH_SIZE = 30;
|
|
1341
1342
|
function parseJsonl(filePath) {
|
|
1342
1343
|
const messages = [];
|
|
1343
1344
|
let raw;
|
|
@@ -1382,7 +1383,7 @@ function post(endpoint, body) {
|
|
|
1382
1383
|
"Content-Type": "application/json",
|
|
1383
1384
|
"Content-Length": Buffer.byteLength(payload)
|
|
1384
1385
|
},
|
|
1385
|
-
timeout:
|
|
1386
|
+
timeout: 15e3
|
|
1386
1387
|
},
|
|
1387
1388
|
(res) => {
|
|
1388
1389
|
res.resume();
|
|
@@ -1666,17 +1667,25 @@ var HistoryService = class {
|
|
|
1666
1667
|
await post("/api/sessions/claude-sessions", { pluginId: this.pluginId, sessions: sessions2 });
|
|
1667
1668
|
}
|
|
1668
1669
|
/**
|
|
1669
|
-
* 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.
|
|
1670
1672
|
* Called before sending the resume signal so clients can fetch it immediately.
|
|
1671
1673
|
*/
|
|
1672
1674
|
async loadConversation(sessionId) {
|
|
1673
1675
|
const filePath = path4.join(this.projectDir, `${sessionId}.jsonl`);
|
|
1674
1676
|
const messages = parseJsonl(filePath);
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
messages
|
|
1679
|
-
|
|
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
|
+
}
|
|
1680
1689
|
}
|
|
1681
1690
|
};
|
|
1682
1691
|
|