@twinsearth/ai-prison-dsh-plugin 1.4.0 → 1.4.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to `@twinsearth/ai-prison-dsh-plugin` are recorded here.
4
4
 
5
+ ## [1.4.1] — 2026-11-18
6
+
7
+ ### Fixed — tools vanished after switching the host to the real-Node runtime
8
+
9
+ - `lib/harness.js` resolved `@deepseek-ai/dsh-tools` only from paths next to
10
+ `process.execPath`. When the desktop host runs on the bundled Node with the
11
+ runtime extracted to `resources/dsh-runtime/dsh`, `execPath` no longer sits
12
+ next to the app, so `defineTool` was unavailable and `ai_prison_*` tools were
13
+ never registered (the watchdog row kept running).
14
+ - `installationAnchors` now also checks `DSH_INSTALL_DIR` and the host's second
15
+ argument (the runtime root) before the legacy desktop paths.
16
+ - New `test/harness.test.mjs` covers extracted-runtime, argument fallback and
17
+ Electron-as-Node layouts.
18
+
19
+ ## [1.4.0] — 2026-11-18
5
20
  ## [1.4.0] — 2026-11-18
6
21
 
7
22
  ### Added — P2 crash enforcement + per-plugin budgets, P3 external guard
package/lib/harness.js CHANGED
@@ -8,10 +8,17 @@ import { pathToFileURL } from 'node:url'
8
8
  * candidate is tried with createRequire because module resolution inside an asar
9
9
  * only works in the Electron-as-Node runtime that launched DSH.
10
10
  */
11
- export function installationAnchors({ execPath = process.execPath, env = process.env } = {}) {
11
+ export function installationAnchors({ execPath = process.execPath, env = process.env, argv = process.argv } = {}) {
12
12
  const dir = path.dirname(execPath)
13
+ // The desktop host may run on the bundled Node (real 6 GB heap) with the
14
+ // runtime extracted to disk. Then execPath no longer sits next to the app and
15
+ // the installation root arrives as DSH_INSTALL_DIR or as the host's second
16
+ // argument (after the entry module).
17
+ const argvRoot = typeof argv[2] === 'string' && argv[2].endsWith('package.json') === false ? argv[2] : undefined
13
18
  return [
14
19
  env.DSH_APP_ANCHOR,
20
+ env.DSH_INSTALL_DIR ? path.join(env.DSH_INSTALL_DIR, 'package.json') : undefined,
21
+ argvRoot && path.basename(argvRoot) === 'dsh' ? path.join(argvRoot, 'package.json') : undefined,
15
22
  path.join(dir, 'resources', 'app.asar', 'dsh', 'package.json'),
16
23
  path.join(dir, 'resources', 'app', 'dsh', 'package.json'),
17
24
  path.join(dir, '..', 'Resources', 'app.asar', 'dsh', 'package.json'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinsearth/ai-prison-dsh-plugin",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "AI Prison for DSH: six governance tools wrapping the aiprison CLI (levels, demo, drill, inspect, verify, repair-tail) plus a panel for the L0–L5 matrix and the audit-chain state. The CLI ships bundled for Windows, macOS and Linux; every capability-removal backend stays simulated.",
5
5
  "type": "module",
6
6
  "main": "index.js",