ragent-cli 1.11.16 → 1.11.17

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.
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var require_package = __commonJS({
31
31
  "package.json"(exports2, module2) {
32
32
  module2.exports = {
33
33
  name: "ragent-cli",
34
- version: "1.11.16",
34
+ version: "1.11.17",
35
35
  description: "CLI agent for rAgent Live \u2014 browser-first terminal control plane for AI coding agents",
36
36
  main: "dist/index.js",
37
37
  bin: {
@@ -11266,6 +11266,33 @@ var SessionStreamer = class {
11266
11266
  this.disconnectBufferBytes.delete(sessionId);
11267
11267
  return result;
11268
11268
  }
11269
+ /**
11270
+ * #556: recover active streams after a relay reconnect.
11271
+ *
11272
+ * For tmux-pipe streams the disconnect-buffered deltas are stale AND
11273
+ * redundant: the portal requests a capture-pane resync on reconnect, and the
11274
+ * capture reflects everything tmux applied to the pane during the disconnect.
11275
+ * Replaying the buffered deltas instead (a) paints stale bytes over the fresh
11276
+ * capture → interleaved garble, and (b) re-floods the relay immediately after
11277
+ * a reconnect, helping trigger Azure's next close — the reconnect churn loop
11278
+ * behind the terminal artifacting. So we DISCARD the buffer and resync.
11279
+ *
11280
+ * pty-attach / process-trace streams have no capture-pane resync, so their
11281
+ * buffered output IS replayed via `replay`.
11282
+ */
11283
+ recoverStreamsAfterReconnect(replay) {
11284
+ for (const stream of this.active.values()) {
11285
+ if (stream.stopped) continue;
11286
+ if (stream.streamType === "tmux-pipe") {
11287
+ this.drainBuffer(stream.sessionId);
11288
+ this.resyncStream(stream.sessionId);
11289
+ } else {
11290
+ for (const chunk of this.drainBuffer(stream.sessionId)) {
11291
+ replay(stream.sessionId, chunk);
11292
+ }
11293
+ }
11294
+ }
11295
+ }
11269
11296
  /**
11270
11297
  * Re-send capture-pane data for an already-active tmux stream.
11271
11298
  * Used when a viewer missed the initial burst (e.g. joinGroup race),
@@ -14749,19 +14776,16 @@ async function runAgent(rawOptions) {
14749
14776
  }
14750
14777
  }
14751
14778
  });
14752
- for (const [sessionId] of sessionStreamer.activeStreams()) {
14753
- const buffered = sessionStreamer.drainBuffer(sessionId);
14754
- for (const chunk of buffered) {
14755
- for (const outputChunk of splitTransportChunks(chunk)) {
14756
- if (conn.sessionKey) {
14757
- const { enc, iv, seq } = encryptPayload(outputChunk, conn.sessionKey, conn.txSeq.next());
14758
- sendToGroup(ws, groups.privateGroup, { type: "output", enc, iv, seq, sessionId });
14759
- } else {
14760
- sendToGroup(ws, groups.privateGroup, { type: "output", data: outputChunk, sessionId });
14761
- }
14779
+ sessionStreamer.recoverStreamsAfterReconnect((sessionId, chunk) => {
14780
+ for (const outputChunk of splitTransportChunks(chunk)) {
14781
+ if (conn.sessionKey) {
14782
+ const { enc, iv, seq } = encryptPayload(outputChunk, conn.sessionKey, conn.txSeq.next());
14783
+ sendToGroup(ws, groups.privateGroup, { type: "output", enc, iv, seq, sessionId });
14784
+ } else {
14785
+ sendToGroup(ws, groups.privateGroup, { type: "output", data: outputChunk, sessionId });
14762
14786
  }
14763
14787
  }
14764
- }
14788
+ });
14765
14789
  await inventory.syncInventory(ws, groups, true);
14766
14790
  conn.startTimers(
14767
14791
  () => inventory.announceToRegistry(ws, groups.registryGroup, "heartbeat"),
package/dist/sbom.json CHANGED
@@ -1299,8 +1299,8 @@
1299
1299
  {
1300
1300
  "type": "library",
1301
1301
  "name": "ragent-cli",
1302
- "version": "1.11.16",
1303
- "bom-ref": "ragent-live|ragent-cli@1.11.16",
1302
+ "version": "1.11.17",
1303
+ "bom-ref": "ragent-live|ragent-cli@1.11.17",
1304
1304
  "author": "Intellimetrics",
1305
1305
  "description": "CLI agent for rAgent Live — browser-first terminal control plane for AI coding agents",
1306
1306
  "licenses": [
@@ -1311,7 +1311,7 @@
1311
1311
  }
1312
1312
  }
1313
1313
  ],
1314
- "purl": "pkg:npm/ragent-cli@1.11.16",
1314
+ "purl": "pkg:npm/ragent-cli@1.11.17",
1315
1315
  "externalReferences": [
1316
1316
  {
1317
1317
  "url": "https://github.com/chadlindell/ragent-live/issues",
@@ -1436,7 +1436,7 @@
1436
1436
  "ragent-live|@emnapi/wasi-threads@1.2.1",
1437
1437
  "ragent-live|@pkgjs/parseargs@0.11.0",
1438
1438
  "ragent-live|@tybys/wasm-util@0.10.1",
1439
- "ragent-live|ragent-cli@1.11.16"
1439
+ "ragent-live|ragent-cli@1.11.17"
1440
1440
  ]
1441
1441
  },
1442
1442
  {
@@ -1584,7 +1584,7 @@
1584
1584
  ]
1585
1585
  },
1586
1586
  {
1587
- "ref": "ragent-live|ragent-cli@1.11.16",
1587
+ "ref": "ragent-live|ragent-cli@1.11.17",
1588
1588
  "dependsOn": [
1589
1589
  "ragent-live|@azure/web-pubsub-client@1.0.4",
1590
1590
  "ragent-live|@openai/codex-sdk@0.130.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ragent-cli",
3
- "version": "1.11.16",
3
+ "version": "1.11.17",
4
4
  "description": "CLI agent for rAgent Live — browser-first terminal control plane for AI coding agents",
5
5
  "main": "dist/index.js",
6
6
  "bin": {