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.
Files changed (2) hide show
  1. package/dist/index.js +19 -12
  2. 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.33",
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 MAX_CONVERSATION_MESSAGES = 100;
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: text.slice(0, MAX_MESSAGE_TEXT_LENGTH), timestamp });
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: text.slice(0, MAX_MESSAGE_TEXT_LENGTH), timestamp });
1364
+ if (text) messages.push({ id: uuid, role: "agent", text, timestamp });
1366
1365
  }
1367
1366
  } catch {
1368
1367
  }
1369
1368
  }
1370
- return messages.slice(-MAX_CONVERSATION_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
- await post("/api/sessions/claude-conversation", {
1678
- pluginId: this.pluginId,
1679
- sessionId,
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "1.4.33",
3
+ "version": "1.4.34",
4
4
  "description": "Remote control Claude Code from your mobile device",
5
5
  "main": "dist/index.js",
6
6
  "bin": {