@staff0rd/assist 0.643.0 → 0.643.2

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.643.0",
9
+ version: "0.643.2",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -35481,11 +35481,17 @@ var ActiveSelection = class {
35481
35481
  byRepo = /* @__PURE__ */ new Map();
35482
35482
  set(cwd, sessionId) {
35483
35483
  if (!cwd) return;
35484
+ if (this.isAlreadySelected(cwd, sessionId)) return;
35484
35485
  this.byRepo.delete(cwd);
35485
35486
  this.byRepo.set(cwd, sessionId);
35487
+ daemonLog(`set-active: cwd=${cwd} id=${sessionId}`);
35486
35488
  saveActiveSelection(this.toJSON());
35487
35489
  this.onChange();
35488
35490
  }
35491
+ isAlreadySelected(cwd, sessionId) {
35492
+ if (this.byRepo.get(cwd) !== sessionId) return false;
35493
+ return [...this.byRepo.keys()].at(-1) === cwd;
35494
+ }
35489
35495
  // why: on daemon restart, reload persisted selections but drop any whose session was not restored
35490
35496
  restore(isLive) {
35491
35497
  for (const [cwd, sessionId] of Object.entries(loadActiveSelection()))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.643.0",
3
+ "version": "0.643.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {