codeam-cli 1.4.43 → 1.4.44

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 +24 -15
  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.43",
119
+ version: "1.4.44",
120
120
  description: "Remote control Claude Code from your mobile device",
121
121
  main: "dist/index.js",
122
122
  bin: {
@@ -1178,14 +1178,26 @@ var OutputService = class _OutputService {
1178
1178
  /** Max idle with no visible content (spinner only) before finalizing. */
1179
1179
  static EMPTY_TIMEOUT_MS = 6e4;
1180
1180
  static MAX_MS = 12e4;
1181
- /** Called by the terminal-turn callback after posting the user message. */
1182
- startTerminalTurn() {
1181
+ /**
1182
+ * Called by the terminal-turn callback once the user message is known.
1183
+ * Sequences: clear → user_message (if any) → new_turn → start timer.
1184
+ * This guarantees the user message appears before the typing placeholder
1185
+ * in the apps, with no race against the clear event.
1186
+ */
1187
+ async startTerminalTurn(userText) {
1183
1188
  this.terminalTurnPending = false;
1184
- this.newTurn();
1185
- }
1186
- /** Post a user_message chunk so apps display what was typed in the terminal. */
1187
- postUserMessage(text) {
1188
- return this.postChunk({ type: "user_message", content: text, done: true });
1189
+ this.stopPoll();
1190
+ this.rawBuffer = "";
1191
+ this.lastSentContent = "";
1192
+ this.lastPushTime = 0;
1193
+ this.active = true;
1194
+ this.startTime = Date.now();
1195
+ await this.postChunk({ clear: true });
1196
+ if (userText) {
1197
+ await this.postChunk({ type: "user_message", content: userText, done: true });
1198
+ }
1199
+ await this.postChunk({ type: "new_turn", content: "", done: false });
1200
+ this.pollTimer = setInterval(() => this.tick(), _OutputService.POLL_MS);
1189
1201
  }
1190
1202
  newTurn() {
1191
1203
  this.stopPoll();
@@ -1886,13 +1898,10 @@ except Exception:sys.exit(0)
1886
1898
  fetchQuotaUsage();
1887
1899
  }
1888
1900
  }, () => {
1889
- setTimeout(async () => {
1890
- const userText = historySvc.getLastUserMessage();
1891
- if (userText) {
1892
- await outputSvc.postUserMessage(userText).catch(() => {
1893
- });
1894
- }
1895
- outputSvc.startTerminalTurn();
1901
+ setTimeout(() => {
1902
+ const userText = historySvc.getLastUserMessage() ?? void 0;
1903
+ outputSvc.startTerminalTurn(userText).catch(() => {
1904
+ });
1896
1905
  }, 300);
1897
1906
  });
1898
1907
  function sendPrompt(prompt) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeam-cli",
3
- "version": "1.4.43",
3
+ "version": "1.4.44",
4
4
  "description": "Remote control Claude Code from your mobile device",
5
5
  "main": "dist/index.js",
6
6
  "bin": {