dsh-deja 0.18.3 → 0.19.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.
Files changed (2) hide show
  1. package/index.js +22 -6
  2. package/package.json +4 -5
package/index.js CHANGED
@@ -26,16 +26,32 @@ try {
26
26
  const PLATFORM = process.platform === "win32" ? "windows" : process.platform;
27
27
  const ARCH = process.arch === "x64" ? "amd64" : process.arch;
28
28
 
29
- // resolveDeja finds the binary: an explicit override first, then the platform
30
- // package npm installed next to this one, then whatever is on PATH.
29
+ // resolveDeja picks the binary in the order a user would expect: what they
30
+ // pointed at, then the deja they installed themselves and keep current with
31
+ // `deja update` or a package manager, and only then the copy npm brought along
32
+ // with this plugin. Each candidate is asked for its version rather than
33
+ // trusted, because a name on PATH that does not run is worse than no name.
31
34
  function resolveDeja() {
32
- if (process.env.DEJA_BIN) return process.env.DEJA_BIN;
33
35
  const exe = PLATFORM === "windows" ? "deja.exe" : "deja";
36
+ const candidates = [process.env.DEJA_BIN, exe];
34
37
  try {
35
- return require.resolve(`@vshulcz/deja-vu-${PLATFORM}-${ARCH}/bin/${exe}`);
36
- } catch {
37
- return exe;
38
+ candidates.push(require.resolve(`@vshulcz/deja-vu-${PLATFORM}-${ARCH}/bin/${exe}`));
39
+ } catch {}
40
+
41
+ for (const candidate of candidates) {
42
+ if (!candidate) continue;
43
+ try {
44
+ execFileSync(candidate, ["version"], {
45
+ encoding: "utf8",
46
+ timeout: 5000,
47
+ stdio: ["ignore", "pipe", "ignore"],
48
+ });
49
+ return candidate;
50
+ } catch {}
38
51
  }
52
+ // Nothing answered. Keep the plain name so the failure a user sees names the
53
+ // thing that is missing.
54
+ return exe;
39
55
  }
40
56
 
41
57
  const DEJA = resolveDeja();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-deja",
3
- "version": "0.18.3",
3
+ "version": "0.19.0",
4
4
  "description": "Brings the session history of nineteen other coding agents into DeepSeek Harness: recall, session digest and per-file history tools over a local index, plus optional automatic recall before each step.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -18,10 +18,9 @@
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "git+https://github.com/vshulcz/deja-vu.git",
22
- "directory": "packages/dsh-deja"
21
+ "url": "git+https://github.com/vshulcz/dsh-deja.git"
23
22
  },
24
- "homepage": "https://github.com/vshulcz/deja-vu/tree/main/packages/dsh-deja",
23
+ "homepage": "https://github.com/vshulcz/dsh-deja",
25
24
  "bugs": {
26
25
  "url": "https://github.com/vshulcz/deja-vu/issues"
27
26
  },
@@ -43,6 +42,6 @@
43
42
  }
44
43
  },
45
44
  "dependencies": {
46
- "@vshulcz/deja-vu": "0.18.0"
45
+ "@vshulcz/deja-vu": "^0.18.0"
47
46
  }
48
47
  }