cli-setu 0.2.3 → 0.2.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/src/supervisor.js +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cli-setu",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Bridge your terminal to your phone — run and approve Claude Code, Codex CLI and other AI coding agents from anywhere.",
5
5
  "type": "commonjs",
6
6
  "bin": {
package/src/supervisor.js CHANGED
@@ -545,12 +545,24 @@ function flushOutputBuffer() {
545
545
  // Still serialized against any send already in flight, so batches
546
546
  // themselves can never arrive out of order relative to each other.
547
547
  sendInFlight = sendInFlight.then(async () => {
548
+ // TEMPORARY diagnostic (remove once the real lag source is found):
549
+ // measures the full fetch() round trip to the Backend, isolating "is
550
+ // the laptop's own network connection to the Backend slow" from
551
+ // Azure's broadcast time (measured separately, server-side, in
552
+ // auth-server.js's /relay/terminal-output handler) and from this
553
+ // batch's own BATCH_WINDOW_MS wait (not included here - that delay is
554
+ // intentional, not a bug).
555
+ const sendStart = Date.now();
548
556
  try {
549
557
  await fetch(`${AUTH_SERVER}/relay/terminal-output`, {
550
558
  method: 'POST',
551
559
  headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${deviceToken}` },
552
560
  body: JSON.stringify({ sessionId: SESSION_ID, seq: ++outputSeq, data: batch }),
553
561
  });
562
+ const sendMs = Date.now() - sendStart;
563
+ if (sendMs > 150) {
564
+ log(`[perf] terminal-output POST took ${sendMs}ms (bytes=${batch.length})`);
565
+ }
554
566
  } catch (err) {
555
567
  // A dropped terminal.output batch isn't fatal the way a dropped
556
568
  // confirmation would be - the next batch (or a fresh session.attach