@staff0rd/assist 0.689.4 → 0.689.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
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.689.4",
9
+ version: "0.689.6",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -43234,6 +43234,9 @@ var WindowsConnection = class {
43234
43234
  }
43235
43235
  };
43236
43236
 
43237
+ // src/commands/sessions/daemon/WindowsVersionHealer.ts
43238
+ import semver2 from "semver";
43239
+
43237
43240
  // src/commands/sessions/daemon/autoHealWindowsDaemon.ts
43238
43241
  async function autoHealWindowsDaemon(conn, state, heal, version2) {
43239
43242
  daemonLog(`windows proxy: auto-healing windows daemon (mismatch ${version2})`);
@@ -43261,6 +43264,12 @@ function notifyHealing(state) {
43261
43264
 
43262
43265
  // src/commands/sessions/daemon/WindowsVersionHealer.ts
43263
43266
  var UNRECOVERABLE_MESSAGE = "Windows host is on an incompatible version that auto-update could not resolve; not reconnecting. Update the Windows host manually, then restart.";
43267
+ function wslStaleMessage(windowsVersion) {
43268
+ return `The WSL daemon (${ASSIST_VERSION}) is older than the Windows host (${windowsVersion}); not reconnecting. Update assist in WSL and restart the daemon.`;
43269
+ }
43270
+ function windowsIsNewer(windowsVersion) {
43271
+ return semver2.valid(windowsVersion) !== null && semver2.valid(ASSIST_VERSION) !== null && semver2.gt(windowsVersion, ASSIST_VERSION);
43272
+ }
43264
43273
  var HEALED_MESSAGE = "Windows host is up to date \u2014 you can reselect the repo now.";
43265
43274
  var WindowsVersionHealer = class {
43266
43275
  constructor(conn, state, heal) {
@@ -43272,11 +43281,12 @@ var WindowsVersionHealer = class {
43272
43281
  healing = false;
43273
43282
  unrecoverable = false;
43274
43283
  awaitingConfirmation = false;
43284
+ refusalMessage = UNRECOVERABLE_MESSAGE;
43275
43285
  get blocked() {
43276
43286
  return this.unrecoverable;
43277
43287
  }
43278
43288
  refusal() {
43279
- return { type: "error", message: UNRECOVERABLE_MESSAGE };
43289
+ return { type: "error", message: this.refusalMessage };
43280
43290
  }
43281
43291
  async onMismatch(version2) {
43282
43292
  if (this.healing || this.unrecoverable) return;
@@ -43301,8 +43311,10 @@ var WindowsVersionHealer = class {
43301
43311
  giveUp(version2) {
43302
43312
  this.unrecoverable = true;
43303
43313
  this.awaitingConfirmation = false;
43314
+ const wslStale = windowsIsNewer(version2);
43315
+ if (wslStale) this.refusalMessage = wslStaleMessage(version2);
43304
43316
  daemonLog(
43305
- `windows proxy: version mismatch ${version2} persists after heal; not reconnecting until the WSL daemon restarts`
43317
+ `windows proxy: version mismatch ${version2} persists after heal${wslStale ? ` (wsl ${ASSIST_VERSION} is the older side)` : ""}; not reconnecting until the WSL daemon restarts`
43306
43318
  );
43307
43319
  this.conn.dispose();
43308
43320
  this.state.broadcast(this.refusal());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.689.4",
3
+ "version": "0.689.6",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {