claude-remote-cli 1.9.3 → 1.9.5

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 +57 -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.5",
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,36 @@
1286
1286
  (function () {
1287
1287
  if (!isMobileDevice) return;
1288
1288
 
1289
+ // ── Debug Panel (hidden by default, toggle with button) ──
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 6px 6px 40px;z-index:9999;display:none;';
1293
+ document.body.appendChild(debugPanel);
1294
+
1295
+ var debugToggle = document.createElement('button');
1296
+ debugToggle.id = 'debug-toggle';
1297
+ debugToggle.textContent = 'dbg';
1298
+ debugToggle.style.cssText = 'position:fixed;bottom:60px;right:8px;z-index:10000;background:#333;color:#0f0;border:1px solid #0f0;border-radius:6px;font:12px monospace;padding:6px 10px;opacity:0.5;min-width:44px;min-height:44px;';
1299
+ document.body.appendChild(debugToggle);
1300
+
1301
+ var debugVisible = false;
1302
+ debugToggle.addEventListener('click', function (e) {
1303
+ e.preventDefault();
1304
+ e.stopPropagation();
1305
+ debugVisible = !debugVisible;
1306
+ debugPanel.style.display = debugVisible ? 'block' : 'none';
1307
+ debugToggle.style.opacity = debugVisible ? '1' : '0.6';
1308
+ });
1309
+
1310
+ var debugLines = [];
1311
+ function dbg(msg) {
1312
+ var t = performance.now().toFixed(1);
1313
+ debugLines.push('[' + t + '] ' + msg);
1314
+ if (debugLines.length > 200) debugLines.shift();
1315
+ debugPanel.innerHTML = debugLines.join('<br>');
1316
+ debugPanel.scrollTop = debugPanel.scrollHeight;
1317
+ }
1318
+
1289
1319
  var lastInputValue = '';
1290
1320
  var isComposing = false;
1291
1321
 
@@ -1332,13 +1362,18 @@
1332
1362
  // Send the diff between lastInputValue and currentValue to the terminal.
1333
1363
  // Handles autocorrect expansions, deletions, and same-length replacements.
1334
1364
  function sendInputDiff(currentValue) {
1335
- if (currentValue === lastInputValue) return;
1365
+ if (currentValue === lastInputValue) {
1366
+ dbg('sendInputDiff: NO-OP (same)');
1367
+ return;
1368
+ }
1336
1369
 
1337
1370
  var commonLen = commonPrefixLength(lastInputValue, currentValue);
1338
1371
  var deletedSlice = lastInputValue.slice(commonLen);
1339
1372
  var charsToDelete = codepointCount(deletedSlice);
1340
1373
  var newChars = currentValue.slice(commonLen);
1341
1374
 
1375
+ dbg('sendInputDiff: del=' + charsToDelete + ' "' + deletedSlice + '" add="' + newChars + '"');
1376
+
1342
1377
  for (var i = 0; i < charsToDelete; i++) {
1343
1378
  ws.send('\x7f'); // backspace
1344
1379
  }
@@ -1347,11 +1382,17 @@
1347
1382
  }
1348
1383
  }
1349
1384
 
1350
- mobileInput.addEventListener('compositionstart', function () {
1385
+ mobileInput.addEventListener('compositionstart', function (e) {
1386
+ dbg('COMP_START data="' + e.data + '" val="' + mobileInput.value + '" last="' + lastInputValue + '"');
1351
1387
  isComposing = true;
1352
1388
  });
1353
1389
 
1354
- mobileInput.addEventListener('compositionend', function () {
1390
+ mobileInput.addEventListener('compositionupdate', function (e) {
1391
+ dbg('COMP_UPDATE data="' + e.data + '" val="' + mobileInput.value + '"');
1392
+ });
1393
+
1394
+ mobileInput.addEventListener('compositionend', function (e) {
1395
+ dbg('COMP_END data="' + e.data + '" val="' + mobileInput.value + '" last="' + lastInputValue + '"');
1355
1396
  isComposing = false;
1356
1397
  if (ws && ws.readyState === WebSocket.OPEN) {
1357
1398
  var currentValue = mobileInput.value;
@@ -1393,17 +1434,27 @@
1393
1434
 
1394
1435
  // Handle text input with autocorrect
1395
1436
  var clearTimer = null;
1396
- mobileInput.addEventListener('input', function () {
1437
+ mobileInput.addEventListener('beforeinput', function (e) {
1438
+ dbg('BEFORE_INPUT type="' + e.inputType + '" data="' + (e.data || '') + '" composing=' + isComposing);
1439
+ });
1440
+
1441
+ mobileInput.addEventListener('input', function (e) {
1442
+ dbg('INPUT type="' + e.inputType + '" composing=' + isComposing + ' val="' + mobileInput.value + '" last="' + lastInputValue + '"');
1443
+
1397
1444
  // Reset the auto-clear timer to prevent unbounded growth
1398
1445
  if (clearTimer) clearTimeout(clearTimer);
1399
1446
  clearTimer = setTimeout(function () {
1447
+ dbg('TIMER_CLEAR val="' + mobileInput.value + '"');
1400
1448
  mobileInput.value = '';
1401
1449
  lastInputValue = '';
1402
1450
  }, 5000);
1403
1451
 
1404
1452
  if (!ws || ws.readyState !== WebSocket.OPEN) return;
1405
1453
 
1406
- if (isComposing) return;
1454
+ if (isComposing) {
1455
+ dbg(' INPUT: skipped (composing)');
1456
+ return;
1457
+ }
1407
1458
 
1408
1459
  var currentValue = mobileInput.value;
1409
1460
  sendInputDiff(currentValue);
@@ -1412,6 +1463,7 @@
1412
1463
 
1413
1464
  // Handle special keys (Enter, Backspace, Escape, arrows, Tab)
1414
1465
  mobileInput.addEventListener('keydown', function (e) {
1466
+ dbg('KEYDOWN key="' + e.key + '" shift=' + e.shiftKey + ' composing=' + isComposing + ' val="' + mobileInput.value + '"');
1415
1467
  if (!ws || ws.readyState !== WebSocket.OPEN) return;
1416
1468
 
1417
1469
  var handled = true;