muuuuse 2.2.4 → 2.2.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/src/runtime.js +3 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muuuuse",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
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
@@ -42,7 +42,6 @@ const PENDING_RELAY_CONTEXT_TTL_MS = 2 * 60 * 1000;
42
42
  const EMITTED_ANSWER_TTL_MS = 5 * 60 * 1000;
43
43
  const MAX_RECENT_INBOUND_RELAYS = 12;
44
44
  const MAX_RECENT_EMITTED_ANSWERS = 48;
45
- const MAX_RELAY_CHAIN_HOP = 1;
46
45
  const STOP_FORCE_KILL_MS = 1200;
47
46
  const SEAT_JOIN_WAIT_MS = 3000;
48
47
  const SEAT_JOIN_POLL_MS = 60;
@@ -932,12 +931,6 @@ class ArmedSeat {
932
931
  return Boolean(partner?.pid && isPidAlive(partner.pid));
933
932
  }
934
933
 
935
- getPartnerFlowMode() {
936
- const partnerStatus = readJson(this.partnerPaths.statusPath, null);
937
- const partnerMeta = readJson(this.partnerPaths.metaPath, null);
938
- return normalizeFlowMode(partnerStatus?.flowMode || partnerMeta?.flowMode || "off");
939
- }
940
-
941
934
  stopRequested() {
942
935
  const request = readJson(this.sessionPaths.stopPath, null);
943
936
  if (!request?.requestedAt) {
@@ -1003,7 +996,6 @@ class ArmedSeat {
1003
996
  deliveredAtMs,
1004
997
  expiresAtMs: deliveredAtMs + PENDING_RELAY_CONTEXT_TTL_MS,
1005
998
  hop: Number.isInteger(entry.hop) ? entry.hop : 0,
1006
- relayUsed: false,
1007
999
  };
1008
1000
  this.relayCount += 1;
1009
1001
  this.rememberInboundRelay(payload);
@@ -1258,21 +1250,6 @@ class ArmedSeat {
1258
1250
  }
1259
1251
 
1260
1252
  const pendingInboundContext = this.getPendingInboundContext();
1261
- const partnerFlowMode = this.getPartnerFlowMode();
1262
- if (
1263
- this.flowMode !== "on" &&
1264
- partnerFlowMode !== "on" &&
1265
- pendingInboundContext &&
1266
- pendingInboundContext.hop >= MAX_RELAY_CHAIN_HOP
1267
- ) {
1268
- this.log(`[${this.seatId}] suppressed relay loop: ${previewText(payload)}`);
1269
- return;
1270
- }
1271
-
1272
- if (pendingInboundContext?.relayUsed) {
1273
- this.log(`[${this.seatId}] suppressed extra queued relay output: ${previewText(payload)}`);
1274
- return;
1275
- }
1276
1253
 
1277
1254
  const entryId = entry.id || createId(12);
1278
1255
  const signedEntry = {
@@ -1293,9 +1270,6 @@ class ArmedSeat {
1293
1270
  );
1294
1271
  appendJsonl(this.paths.eventsPath, signedEntry);
1295
1272
  this.rememberEmittedAnswer(answerKey);
1296
- if (pendingInboundContext) {
1297
- pendingInboundContext.relayUsed = true;
1298
- }
1299
1273
 
1300
1274
  this.log(`[${this.seatId}] ${previewText(payload)}`);
1301
1275
  }
@@ -1413,12 +1387,13 @@ function previewText(text, maxLength = 88) {
1413
1387
  function buildAnswerKey(entry, payload) {
1414
1388
  const origin = String(entry.origin || "unknown").trim() || "unknown";
1415
1389
  const id = typeof entry.id === "string" ? entry.id.trim() : "";
1390
+ const payloadHash = hashText(payload);
1416
1391
  if (id) {
1417
- return `${origin}:${id}`;
1392
+ return `${origin}:${id}:${payloadHash}`;
1418
1393
  }
1419
1394
 
1420
1395
  const createdAt = typeof entry.createdAt === "string" ? entry.createdAt : "";
1421
- return `${origin}:${createdAt}:${hashText(payload)}`;
1396
+ return `${origin}:${createdAt}:${payloadHash}`;
1422
1397
  }
1423
1398
 
1424
1399
  function buildSeatReport(sessionName, seatId) {