ragent-cli 1.11.7 → 1.11.8

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.7",
34
+ version: "1.11.8",
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: {
@@ -4691,6 +4691,26 @@ function requestStopSelfService() {
4691
4691
  }
4692
4692
  }
4693
4693
  }
4694
+ function requestRestartSelfService() {
4695
+ const backend = getConfiguredServiceBackend();
4696
+ if (backend === "systemd") {
4697
+ const child = (0, import_child_process3.spawn)("systemctl", ["--user", "restart", SERVICE_NAME], {
4698
+ detached: true,
4699
+ stdio: "ignore"
4700
+ });
4701
+ child.unref();
4702
+ return;
4703
+ }
4704
+ if (backend === "pidfile") {
4705
+ const child = (0, import_child_process3.spawn)(process.execPath, [__filename, "service", "restart"], {
4706
+ detached: true,
4707
+ stdio: "ignore",
4708
+ cwd: os7.homedir(),
4709
+ env: process.env
4710
+ });
4711
+ child.unref();
4712
+ }
4713
+ }
4694
4714
 
4695
4715
  // src/provisioner.ts
4696
4716
  var import_child_process4 = require("child_process");
@@ -4994,6 +5014,14 @@ function isSafeWorkingDir(raw) {
4994
5014
  return true;
4995
5015
  }
4996
5016
 
5017
+ // src/updater.ts
5018
+ async function installLatestCliFromNpm() {
5019
+ await execAsync(`npm install -g ${shellQuote(`${PACKAGE_NAME}@latest`)}`, {
5020
+ timeout: 5 * 60 * 1e3,
5021
+ maxBuffer: 10 * 1024 * 1024
5022
+ });
5023
+ }
5024
+
4997
5025
  // src/control-dispatcher.ts
4998
5026
  var log13 = createLogger("control");
4999
5027
  var TMUX_RESYNC_DEBOUNCE_MS = 150;
@@ -5104,6 +5132,7 @@ var ControlDispatcher = class {
5104
5132
  "stop-agent",
5105
5133
  "restart-agent",
5106
5134
  "restart-shell",
5135
+ "update-agent",
5107
5136
  "stop-session",
5108
5137
  "stop-detached",
5109
5138
  "disconnect",
@@ -5131,6 +5160,9 @@ var ControlDispatcher = class {
5131
5160
  this.connection.activeSocket.close();
5132
5161
  }
5133
5162
  return;
5163
+ case "update-agent":
5164
+ await this.updateAgentFromNpm();
5165
+ return;
5134
5166
  case "stop-agent":
5135
5167
  this.shouldRun = false;
5136
5168
  this.streamer.stopAll();
@@ -5329,6 +5361,24 @@ var ControlDispatcher = class {
5329
5361
  this.streamer.resize(sessionId, cols, rows);
5330
5362
  }
5331
5363
  }
5364
+ /** Update the installed connector package, then restart when a service backend exists. */
5365
+ async updateAgentFromNpm() {
5366
+ log13.info("updating ragent CLI", { current: CURRENT_VERSION });
5367
+ try {
5368
+ await installLatestCliFromNpm();
5369
+ } catch (error) {
5370
+ const message = error instanceof Error ? error.message : String(error);
5371
+ log13.error("failed to update ragent CLI", { error: message });
5372
+ return;
5373
+ }
5374
+ const backend = getConfiguredServiceBackend();
5375
+ if (!backend) {
5376
+ log13.warn("ragent CLI updated, but no service backend is configured; restart the connector manually to use the new version");
5377
+ return;
5378
+ }
5379
+ log13.info("ragent CLI updated; restarting connector service", { backend });
5380
+ requestRestartSelfService();
5381
+ }
5332
5382
  /** Handle provision request from dashboard. */
5333
5383
  async handleProvision(payload) {
5334
5384
  const provReq = validateProvisionRequest(payload);
@@ -6625,10 +6675,7 @@ function registerUpdateCommand(program2) {
6625
6675
  }
6626
6676
  log19.info("update available", { current: CURRENT_VERSION, latest: latestVersion });
6627
6677
  if (opts.check) return;
6628
- await execAsync(`npm install -g ${shellQuote(PACKAGE_NAME)}`, {
6629
- timeout: 5 * 60 * 1e3,
6630
- maxBuffer: 10 * 1024 * 1024
6631
- });
6678
+ await installLatestCliFromNpm();
6632
6679
  log19.info("updated", { version: latestVersion });
6633
6680
  const backend = getConfiguredServiceBackend();
6634
6681
  if (backend && opts.restart) {
package/dist/sbom.json CHANGED
@@ -1166,8 +1166,8 @@
1166
1166
  {
1167
1167
  "type": "library",
1168
1168
  "name": "ragent-cli",
1169
- "version": "1.11.7",
1170
- "bom-ref": "ragent-live|ragent-cli@1.11.7",
1169
+ "version": "1.11.8",
1170
+ "bom-ref": "ragent-live|ragent-cli@1.11.8",
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.7",
1181
+ "purl": "pkg:npm/ragent-cli@1.11.8",
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.7"
1306
+ "ragent-live|ragent-cli@1.11.8"
1307
1307
  ]
1308
1308
  },
1309
1309
  {
@@ -1436,7 +1436,7 @@
1436
1436
  ]
1437
1437
  },
1438
1438
  {
1439
- "ref": "ragent-live|ragent-cli@1.11.7",
1439
+ "ref": "ragent-live|ragent-cli@1.11.8",
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.7",
3
+ "version": "1.11.8",
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": {