muuuuse 2.2.2 → 2.2.3

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/runtime.js +2 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muuuuse",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "🔌Muuuuse arms two regular terminals and relays assistant output between them.",
5
5
  "type": "commonjs",
6
6
  "bin": {
package/src/runtime.js CHANGED
@@ -35,9 +35,8 @@ const {
35
35
  writeJson,
36
36
  } = require("./util");
37
37
 
38
- const TYPE_CHUNK_DELAY_MS = 12;
39
- const TYPE_CHUNK_SIZE = 6;
40
- const ESCAPE_RELAY_GUARD_MS = 180;
38
+ const TYPE_CHUNK_DELAY_MS = 18;
39
+ const TYPE_CHUNK_SIZE = 24;
41
40
  const MIRROR_SUPPRESSION_WINDOW_MS = 30 * 1000;
42
41
  const PENDING_RELAY_CONTEXT_TTL_MS = 2 * 60 * 1000;
43
42
  const EMITTED_ANSWER_TTL_MS = 5 * 60 * 1000;
@@ -479,19 +478,6 @@ function isMeaningfulTerminalInput(input) {
479
478
  return stripPassiveTerminalInput(input).length > 0;
480
479
  }
481
480
 
482
- function getEscapeRelayDelayMs(lastEscapeAtMs, now = Date.now()) {
483
- if (!Number.isFinite(lastEscapeAtMs) || lastEscapeAtMs <= 0) {
484
- return 0;
485
- }
486
-
487
- const elapsedMs = now - lastEscapeAtMs;
488
- if (elapsedMs >= ESCAPE_RELAY_GUARD_MS) {
489
- return 0;
490
- }
491
-
492
- return ESCAPE_RELAY_GUARD_MS - elapsedMs;
493
- }
494
-
495
481
  async function sendTextAndEnter(child, text, shouldAbort = () => false) {
496
482
  const payload = normalizeRelayPayloadForTyping(text);
497
483
 
@@ -551,7 +537,6 @@ class ArmedSeat {
551
537
  this.forceKillTimer = null;
552
538
  this.identity = null;
553
539
  this.lastUserInputAtMs = 0;
554
- this.lastEscapeAtMs = 0;
555
540
  this.pendingInboundContext = null;
556
541
  this.recentInboundRelays = [];
557
542
  this.recentEmittedAnswers = [];
@@ -829,9 +814,6 @@ class ArmedSeat {
829
814
  installStdinProxy() {
830
815
  const handleData = (chunk) => {
831
816
  const chunkText = chunk.toString("utf8");
832
- if (isBareEscapeInput(chunkText)) {
833
- this.lastEscapeAtMs = Date.now();
834
- }
835
817
  if (isMeaningfulTerminalInput(chunkText)) {
836
818
  this.lastUserInputAtMs = Date.now();
837
819
  this.pendingInboundContext = null;
@@ -994,11 +976,6 @@ class ArmedSeat {
994
976
  continue;
995
977
  }
996
978
 
997
- const escapeRelayDelayMs = getEscapeRelayDelayMs(this.lastEscapeAtMs);
998
- if (escapeRelayDelayMs > 0) {
999
- await sleep(escapeRelayDelayMs);
1000
- }
1001
-
1002
979
  const delivered = await sendTextAndEnter(
1003
980
  this.child,
1004
981
  payload,
@@ -1543,7 +1520,6 @@ module.exports = {
1543
1520
  ArmedSeat,
1544
1521
  buildChildEnv,
1545
1522
  chunkRelayPayloadForTyping,
1546
- getEscapeRelayDelayMs,
1547
1523
  getStatusReport,
1548
1524
  isBareEscapeInput,
1549
1525
  isMeaningfulTerminalInput,