@staff0rd/assist 0.966.2 → 0.967.0

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.966.2",
9
+ version: "0.967.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -47162,6 +47162,7 @@ function createRunSession(id, { runName, runArgs, cwd, meta }) {
47162
47162
  import { existsSync as existsSync90, rmSync as rmSync12, writeFileSync as writeFileSync56 } from "fs";
47163
47163
  var paused;
47164
47164
  var wake;
47165
+ var holdReleased = false;
47165
47166
  function persist2(value) {
47166
47167
  try {
47167
47168
  if (value) writeFileSync56(daemonPaths.autoUpdatePaused, "");
@@ -47188,7 +47189,16 @@ var autoUpdateControl = {
47188
47189
  const timer = setTimeout(done2, ms);
47189
47190
  wake = done2;
47190
47191
  }),
47191
- wake: () => wake?.()
47192
+ wake: () => wake?.(),
47193
+ releaseHold: () => {
47194
+ holdReleased = true;
47195
+ wake?.();
47196
+ },
47197
+ takeHoldRelease: () => {
47198
+ const released = holdReleased;
47199
+ holdReleased = false;
47200
+ return released;
47201
+ }
47192
47202
  };
47193
47203
 
47194
47204
  // src/commands/sessions/daemon/autoUpdate/autoUpdateEnabled.ts
@@ -47232,9 +47242,16 @@ async function backOff(reason4, deps2) {
47232
47242
  // src/commands/sessions/daemon/autoUpdate/holdForEscalation.ts
47233
47243
  var ESCALATION_POLL_MS = 5e3;
47234
47244
  async function holdForEscalation(sessionId, deps2) {
47245
+ deps2.takeHoldRelease();
47235
47246
  deps2.enter("diverged", { escalationId: sessionId });
47236
47247
  deps2.note(`paused while session ${sessionId} reconciles the divergence`);
47237
- while (deps2.isLive(sessionId)) await deps2.sleep(ESCALATION_POLL_MS);
47248
+ while (deps2.isLive(sessionId)) {
47249
+ await deps2.sleep(ESCALATION_POLL_MS);
47250
+ if (deps2.takeHoldRelease()) {
47251
+ deps2.note(`check requested while session ${sessionId} is open; resuming`);
47252
+ return;
47253
+ }
47254
+ }
47238
47255
  deps2.note(`session ${sessionId} ended; resuming`);
47239
47256
  }
47240
47257
 
@@ -47627,6 +47644,7 @@ function loopDeps(installDir, ctx) {
47627
47644
  const status2 = ctx().sessions.get(sessionId)?.status;
47628
47645
  return status2 !== void 0 && status2 !== "done" && status2 !== "error";
47629
47646
  },
47647
+ takeHoldRelease: autoUpdateControl.takeHoldRelease,
47630
47648
  paused: autoUpdateControl.paused,
47631
47649
  sleep: autoUpdateControl.sleep
47632
47650
  };
@@ -52581,6 +52599,14 @@ function applyAutoUpdateAction(action) {
52581
52599
  }
52582
52600
  if (autoUpdateControl.paused())
52583
52601
  return "auto-update is paused; resume it first";
52602
+ if (loop2.phase === "diverged") {
52603
+ autoUpdateControl.releaseHold();
52604
+ noteAutoUpdate(
52605
+ installDir,
52606
+ `check requested from Updates; releasing the hold for session ${loop2.escalationId}`
52607
+ );
52608
+ return void 0;
52609
+ }
52584
52610
  signalLap(installDir, "check");
52585
52611
  autoUpdateControl.wake();
52586
52612
  noteAutoUpdate(installDir, "check requested from Updates");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.966.2",
3
+ "version": "0.967.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {