@lone-wolf-akela/dsh-sandboxie-redirect 0.3.2 → 0.3.3

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
@@ -3,6 +3,26 @@
3
3
  Notable changes per release. The format is loose; the version numbers are what
4
4
  the DSH compatibility gate reads.
5
5
 
6
+ ## 0.3.3 — 2026-10-13
7
+
8
+ **`sandbox_clear` mode `status` never worked**
9
+
10
+ - `execute` referenced `workspace` in the `status` early return while the
11
+ `const workspace = …` that names it was declared below, in the same function
12
+ body. A `const` in its temporal dead zone throws on *any* earlier reference, so
13
+ `mode: "status"` failed on every call with `ReferenceError: Cannot access
14
+ 'workspace' before initialization`. The declaration now precedes every use,
15
+ which is also what `status` was always meant to report: the canonical workspace
16
+ alongside the projection registry's state for the calling session.
17
+ - The defect came in with the 0.2.1 import, so it shipped in 0.3.0, 0.3.1 and
18
+ 0.3.2; `inspect` and `clear` were unaffected, because they use `workspace`
19
+ after the declaration.
20
+ - New `test/tool-execute.mjs` drives all three modes of the real tool offline
21
+ (only the harness loader, the Node lookup and `spawnSync` are redirected), so
22
+ this — and any future runtime failure in a mode nobody exercises by hand — is a
23
+ failed test rather than a report from a user. It reproduces the
24
+ `ReferenceError` on the pre-fix source.
25
+
6
26
  ## 0.3.2 — 2026-10-13
7
27
 
8
28
  **DeepSeek Harness installation lookup**
package/README.md CHANGED
@@ -94,7 +94,7 @@ The preset carries an icon (two overlapping sheets) in the dropdown and the bott
94
94
 
95
95
  ### The `sandbox_clear` tool
96
96
 
97
- In-session, `sandbox_clear` inspects or discards this workspace's copy: `mode: "inspect"` reports (file count, size), `mode: "clear"` deletes the copy and its configuration. It works in every permission mode, and can only ever touch boxes Sandboxie attributes to *this* workspace.
97
+ In-session, `sandbox_clear` inspects or discards this workspace's copy: `mode: "inspect"` reports (file count, size), `mode: "clear"` deletes the copy and its configuration. It works in every permission mode, and can only ever touch boxes Sandboxie attributes to *this* workspace. A diagnostic `mode: "status"` reports what the session projection registry holds for the calling session — it separates "the fold never ran" from "the client never got it", so it is the first thing to look at when the title-bar box name is missing (it only actually worked from 0.3.3 on).
98
98
 
99
99
  ## Notes for users
100
100
 
package/README.zh.md CHANGED
@@ -93,7 +93,7 @@ DSH 的文件工具(读/写/编辑)在盒外运行,仍按「仅工作区
93
93
 
94
94
  ### sandbox_clear 工具
95
95
 
96
- 会话内可用 `sandbox_clear` 查看或清除本工作区的副本:`mode: "inspect"` 仅查看(文件数、占用),`mode: "clear"` 删除副本与配置。任何权限模式下都可用,且只能操作 Sandboxie 认定属于**本工作区**的沙盒。
96
+ 会话内可用 `sandbox_clear` 查看或清除本工作区的副本:`mode: "inspect"` 仅查看(文件数、占用),`mode: "clear"` 删除副本与配置。任何权限模式下都可用,且只能操作 Sandboxie 认定属于**本工作区**的沙盒。另有诊断用的 `mode: "status"`:它报告本会话投影登记的状态,用来分辨"投影没被驱动"和"客户端没收到"——标题栏的沙箱名称不显示时先看它(0.3.3 起才真正可用)。
97
97
 
98
98
  ## 用户注意事项
99
99
 
package/lib/tool.mjs CHANGED
@@ -220,6 +220,13 @@ export async function apply(ctx) {
220
220
  if (typeof cwd !== "string" || cwd.length === 0) {
221
221
  throw new Error("sandbox_clear needs the calling session's workspace, and this caller has none");
222
222
  }
223
+ // Declared before ANY use. It used to sit below the `status` early
224
+ // return, inside the same function body — a temporal dead zone, so
225
+ // `mode: "status"` threw `ReferenceError: Cannot access 'workspace'
226
+ // before initialization` on every single call. test/tool-execute.mjs
227
+ // drives all three modes, so this class of failure is now a failed
228
+ // test rather than a bug report from a user.
229
+ const workspace = naming.canonicalWorkspace(cwd);
223
230
  if (args.mode === "status") {
224
231
  // Ask the projection registry what it holds for THIS session. The
225
232
  // header chip reads that value, so this separates "the fold never
@@ -236,7 +243,8 @@ export async function apply(ctx) {
236
243
  }
237
244
  log(`status: ${detail}`);
238
245
  return Promise.resolve({ action: "status", workspace, copies: [], cleared: [], note: detail });
239
- } const workspace = naming.canonicalWorkspace(cwd);
246
+ }
247
+
240
248
  const before = copiesFor(host, naming, workspace);
241
249
  if (before === null) {
242
250
  throw new Error(`cannot read ${host.sandboxIniPath()}, so the sandbox state is unknown; refusing to act`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lone-wolf-akela/dsh-sandboxie-redirect",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "DSH bundle adding a copy-on-write permission preset: shell commands run inside a per-workspace Sandboxie box, so writes outside the workspace land in the box's copy while the real disk is untouched.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -76,10 +76,11 @@
76
76
  }
77
77
  },
78
78
  "scripts": {
79
- "test": "node test/unit.mjs && node test/sbie-locate.mjs && node test/dsh-locate.mjs && node test/host-projection.mjs && node test/validate-patch.mjs",
79
+ "test": "node test/unit.mjs && node test/sbie-locate.mjs && node test/dsh-locate.mjs && node test/tool-execute.mjs && node test/host-projection.mjs && node test/validate-patch.mjs",
80
80
  "test:acceptance": "node test/run-tests.mjs",
81
81
  "test:soak": "node test/soak.mjs 30",
82
82
  "test:locate": "node test/sbie-locate.mjs && node test/dsh-locate.mjs",
83
+ "test:tool": "node test/tool-execute.mjs",
83
84
  "validate:patch": "node test/validate-patch.mjs",
84
85
  "pack:check": "npm pack --dry-run"
85
86
  },