claude-remote-cli 1.9.3 → 1.9.4

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/package.json +1 -1
  2. package/public/app.js +41 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-remote-cli",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "description": "Remote web interface for Claude Code CLI sessions",
5
5
  "type": "module",
6
6
  "main": "dist/server/index.js",
package/public/app.js CHANGED
@@ -1286,6 +1286,20 @@
1286
1286
  (function () {
1287
1287
  if (!isMobileDevice) return;
1288
1288
 
1289
+ // ── Debug Panel (temporary) ──
1290
+ var debugPanel = document.createElement('div');
1291
+ debugPanel.id = 'debug-panel';
1292
+ debugPanel.style.cssText = 'position:fixed;top:0;left:0;right:0;height:30vh;overflow-y:auto;background:rgba(0,0,0,0.92);color:#0f0;font:11px/1.4 monospace;padding:6px;z-index:9999;pointer-events:auto;';
1293
+ document.body.appendChild(debugPanel);
1294
+ var debugLines = [];
1295
+ function dbg(msg) {
1296
+ var t = performance.now().toFixed(1);
1297
+ debugLines.push('[' + t + '] ' + msg);
1298
+ if (debugLines.length > 60) debugLines.shift();
1299
+ debugPanel.innerHTML = debugLines.join('<br>');
1300
+ debugPanel.scrollTop = debugPanel.scrollHeight;
1301
+ }
1302
+
1289
1303
  var lastInputValue = '';
1290
1304
  var isComposing = false;
1291
1305
 
@@ -1332,13 +1346,18 @@
1332
1346
  // Send the diff between lastInputValue and currentValue to the terminal.
1333
1347
  // Handles autocorrect expansions, deletions, and same-length replacements.
1334
1348
  function sendInputDiff(currentValue) {
1335
- if (currentValue === lastInputValue) return;
1349
+ if (currentValue === lastInputValue) {
1350
+ dbg(' sendInputDiff: NO-OP (same)');
1351
+ return;
1352
+ }
1336
1353
 
1337
1354
  var commonLen = commonPrefixLength(lastInputValue, currentValue);
1338
1355
  var deletedSlice = lastInputValue.slice(commonLen);
1339
1356
  var charsToDelete = codepointCount(deletedSlice);
1340
1357
  var newChars = currentValue.slice(commonLen);
1341
1358
 
1359
+ dbg(' sendInputDiff: del=' + charsToDelete + ' "' + deletedSlice + '" add="' + newChars + '"');
1360
+
1342
1361
  for (var i = 0; i < charsToDelete; i++) {
1343
1362
  ws.send('\x7f'); // backspace
1344
1363
  }
@@ -1347,11 +1366,17 @@
1347
1366
  }
1348
1367
  }
1349
1368
 
1350
- mobileInput.addEventListener('compositionstart', function () {
1369
+ mobileInput.addEventListener('compositionstart', function (e) {
1370
+ dbg('COMP_START data="' + e.data + '" val="' + mobileInput.value + '" last="' + lastInputValue + '"');
1351
1371
  isComposing = true;
1352
1372
  });
1353
1373
 
1354
- mobileInput.addEventListener('compositionend', function () {
1374
+ mobileInput.addEventListener('compositionupdate', function (e) {
1375
+ dbg('COMP_UPDATE data="' + e.data + '" val="' + mobileInput.value + '"');
1376
+ });
1377
+
1378
+ mobileInput.addEventListener('compositionend', function (e) {
1379
+ dbg('COMP_END data="' + e.data + '" val="' + mobileInput.value + '" last="' + lastInputValue + '"');
1355
1380
  isComposing = false;
1356
1381
  if (ws && ws.readyState === WebSocket.OPEN) {
1357
1382
  var currentValue = mobileInput.value;
@@ -1393,25 +1418,36 @@
1393
1418
 
1394
1419
  // Handle text input with autocorrect
1395
1420
  var clearTimer = null;
1396
- mobileInput.addEventListener('input', function () {
1421
+ mobileInput.addEventListener('input', function (e) {
1422
+ dbg('INPUT type="' + e.inputType + '" composing=' + isComposing + ' val="' + mobileInput.value + '" last="' + lastInputValue + '"');
1423
+
1397
1424
  // Reset the auto-clear timer to prevent unbounded growth
1398
1425
  if (clearTimer) clearTimeout(clearTimer);
1399
1426
  clearTimer = setTimeout(function () {
1427
+ dbg('TIMER_CLEAR val="' + mobileInput.value + '"');
1400
1428
  mobileInput.value = '';
1401
1429
  lastInputValue = '';
1402
1430
  }, 5000);
1403
1431
 
1404
1432
  if (!ws || ws.readyState !== WebSocket.OPEN) return;
1405
1433
 
1406
- if (isComposing) return;
1434
+ if (isComposing) {
1435
+ dbg(' INPUT: skipped (composing)');
1436
+ return;
1437
+ }
1407
1438
 
1408
1439
  var currentValue = mobileInput.value;
1409
1440
  sendInputDiff(currentValue);
1410
1441
  lastInputValue = currentValue;
1411
1442
  });
1412
1443
 
1444
+ mobileInput.addEventListener('beforeinput', function (e) {
1445
+ dbg('BEFORE_INPUT type="' + e.inputType + '" data="' + (e.data || '') + '" composing=' + isComposing);
1446
+ });
1447
+
1413
1448
  // Handle special keys (Enter, Backspace, Escape, arrows, Tab)
1414
1449
  mobileInput.addEventListener('keydown', function (e) {
1450
+ dbg('KEYDOWN key="' + e.key + '" shift=' + e.shiftKey + ' composing=' + isComposing + ' val="' + mobileInput.value + '"');
1415
1451
  if (!ws || ws.readyState !== WebSocket.OPEN) return;
1416
1452
 
1417
1453
  var handled = true;