ragent-cli 1.11.5 → 1.11.6

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.5",
34
+ version: "1.11.6",
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: {
@@ -3782,6 +3782,10 @@ var SequenceTracker = class {
3782
3782
  var import_node_child_process3 = require("child_process");
3783
3783
  var pty2 = __toESM(require("node-pty"));
3784
3784
  var log9 = createLogger("pty");
3785
+ var MIN_TMUX_COLS = 20;
3786
+ var MAX_TMUX_COLS = 500;
3787
+ var MIN_TMUX_ROWS = 5;
3788
+ var MAX_TMUX_ROWS = 200;
3785
3789
  var ANSI_KEY_SEQUENCES = /* @__PURE__ */ new Map([
3786
3790
  ["\x1B[A", "Up"],
3787
3791
  ["\x1B[B", "Down"],
@@ -3881,6 +3885,13 @@ function execTmuxSendKeys(args) {
3881
3885
  });
3882
3886
  });
3883
3887
  }
3888
+ function isValidTmuxSessionName(target) {
3889
+ const sessionName = target.split(":")[0].split(".")[0];
3890
+ return /^[a-zA-Z0-9_][a-zA-Z0-9_.-]*$/.test(sessionName);
3891
+ }
3892
+ function clampDimension(value, min, max) {
3893
+ return Math.max(min, Math.min(max, Math.floor(value)));
3894
+ }
3884
3895
  function isInteractiveShell(command) {
3885
3896
  const trimmed = String(command).trim();
3886
3897
  return ["bash", "sh", "zsh", "fish"].includes(trimmed);
@@ -3911,8 +3922,8 @@ async function sendInputToTmux(sessionId, data) {
3911
3922
  if (!sessionId.startsWith("tmux:")) return;
3912
3923
  const target = sessionId.slice("tmux:".length).trim();
3913
3924
  if (!target) return;
3914
- const sessionName = target.split(":")[0].split(".")[0];
3915
- if (!/^[a-zA-Z0-9_][a-zA-Z0-9_.-]*$/.test(sessionName)) {
3925
+ if (!isValidTmuxSessionName(target)) {
3926
+ const sessionName = target.split(":")[0].split(".")[0];
3916
3927
  log9.warn("invalid tmux session name", { sessionName });
3917
3928
  return;
3918
3929
  }
@@ -3929,6 +3940,35 @@ async function sendInputToTmux(sessionId, data) {
3929
3940
  log9.warn("failed to send input", { sessionId, error: message });
3930
3941
  }
3931
3942
  }
3943
+ async function resizeTmuxPaneBySessionId(sessionId, cols, rows) {
3944
+ if (!sessionId.startsWith("tmux:")) return false;
3945
+ const target = sessionId.slice("tmux:".length).trim();
3946
+ if (!target) return false;
3947
+ if (!isValidTmuxSessionName(target)) {
3948
+ const sessionName = target.split(":")[0].split(".")[0];
3949
+ log9.warn("invalid tmux session name", { sessionName });
3950
+ return false;
3951
+ }
3952
+ if (!Number.isFinite(cols) || !Number.isFinite(rows)) return false;
3953
+ const safeCols = clampDimension(cols, MIN_TMUX_COLS, MAX_TMUX_COLS);
3954
+ const safeRows = clampDimension(rows, MIN_TMUX_ROWS, MAX_TMUX_ROWS);
3955
+ return new Promise((resolve) => {
3956
+ (0, import_node_child_process3.execFile)(
3957
+ "tmux",
3958
+ ["resize-pane", "-t", target, "-x", String(safeCols), "-y", String(safeRows)],
3959
+ { timeout: 5e3 },
3960
+ (err) => {
3961
+ if (err) {
3962
+ const message = err instanceof Error ? err.message : String(err);
3963
+ log9.warn("failed to resize tmux pane", { sessionId, error: message });
3964
+ resolve(false);
3965
+ return;
3966
+ }
3967
+ resolve(true);
3968
+ }
3969
+ );
3970
+ });
3971
+ }
3932
3972
  async function stopAllDetachedTmuxSessions() {
3933
3973
  try {
3934
3974
  const raw = await execAsync(
@@ -5246,10 +5286,17 @@ var ControlDispatcher = class {
5246
5286
  this.streamer.writeInput(sessionId, data);
5247
5287
  }
5248
5288
  }
5249
- /** Handle resize routing (PTY and screen/zellij only — tmux panes are never resized by the portal). */
5289
+ /** Handle resize routing. */
5250
5290
  handleResize(cols, rows, sessionId) {
5251
5291
  if (!sessionId || sessionId.startsWith("pty:")) {
5252
5292
  this.shell.resize(cols, rows);
5293
+ } else if (sessionId.startsWith("tmux:")) {
5294
+ resizeTmuxPaneBySessionId(sessionId, cols, rows).then((resized) => {
5295
+ if (resized) this.streamer.resyncStream(sessionId);
5296
+ }).catch((error) => {
5297
+ const message = error instanceof Error ? error.message : String(error);
5298
+ log13.warn("tmux resize failed", { sessionId, error: message });
5299
+ });
5253
5300
  } else if (sessionId.startsWith("screen:") || sessionId.startsWith("zellij:")) {
5254
5301
  this.streamer.resize(sessionId, cols, rows);
5255
5302
  }
package/dist/sbom.json CHANGED
@@ -1166,8 +1166,8 @@
1166
1166
  {
1167
1167
  "type": "library",
1168
1168
  "name": "ragent-cli",
1169
- "version": "1.11.5",
1170
- "bom-ref": "ragent-live|ragent-cli@1.11.5",
1169
+ "version": "1.11.6",
1170
+ "bom-ref": "ragent-live|ragent-cli@1.11.6",
1171
1171
  "author": "Intellimetrics",
1172
1172
  "description": "CLI agent for rAgent Live — browser-first terminal control plane for AI coding agents",
1173
1173
  "licenses": [
@@ -1178,7 +1178,7 @@
1178
1178
  }
1179
1179
  }
1180
1180
  ],
1181
- "purl": "pkg:npm/ragent-cli@1.11.5",
1181
+ "purl": "pkg:npm/ragent-cli@1.11.6",
1182
1182
  "externalReferences": [
1183
1183
  {
1184
1184
  "url": "https://github.com/chadlindell/ragent-live/issues",
@@ -1303,7 +1303,7 @@
1303
1303
  "ragent-live|@emnapi/wasi-threads@1.2.1",
1304
1304
  "ragent-live|@pkgjs/parseargs@0.11.0",
1305
1305
  "ragent-live|@tybys/wasm-util@0.10.1",
1306
- "ragent-live|ragent-cli@1.11.5"
1306
+ "ragent-live|ragent-cli@1.11.6"
1307
1307
  ]
1308
1308
  },
1309
1309
  {
@@ -1436,7 +1436,7 @@
1436
1436
  ]
1437
1437
  },
1438
1438
  {
1439
- "ref": "ragent-live|ragent-cli@1.11.5",
1439
+ "ref": "ragent-live|ragent-cli@1.11.6",
1440
1440
  "dependsOn": [
1441
1441
  "ragent-live|@azure/web-pubsub-client@1.0.4",
1442
1442
  "ragent-live|commander@14.0.3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ragent-cli",
3
- "version": "1.11.5",
3
+ "version": "1.11.6",
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": {