@deepseek-ai/dsh-host-directory-picker-native 0.1.2-alpha.5 → 0.1.3-alpha.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/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/host/directory-picker-native/README.md
5
- README.md: 9c1fb7d742fcd5481aa6ee30f2de3d9e670c09d5
6
- README.zh.md: 4b47358cdc0c787eefccd2d330c1055dd6278453
5
+ README.md: a432bdc19175c690287745cc9c2df004d03b7478
6
+ README.zh.md: 98ea9a033dbf6720fa08fbb068e243371998dab6
package/README.md CHANGED
@@ -73,7 +73,7 @@ Platform tools run without a shell: `osascript` on macOS, and Zenity with a KDia
73
73
  Read these when the backend contract is not enough: the seam definition first, then the alternative backend and the chooser that selects between them.
74
74
 
75
75
  - [Directory-picker seam](../directory-picker/README.md) — the `native` capability contract and the typed error vocabulary.
76
- - [Directory-picker capability seam decision](../../../.agents/notes/implemented/architecture/2026-07-28-directory-picker-capability-seam.md) — why backends differ in interaction shape.
76
+ - [Directory-picker capability seam decision](../../../.agents/notes/archived/architecture/2026-07-28-directory-picker-capability-seam.md) — why backends differ in interaction shape.
77
77
  - [Browse backend](../directory-picker-browse/README.md) — the in-app alternative for remote clients.
78
78
  - [Adaptive chooser](../directory-picker-auto/README.md) — boot-time resolution between native and browse.
79
79
  - [No-shell subprocess runner](../../util/native-command/README.md) — the shared subprocess primitive the chooser runs on.
package/README.zh.md CHANGED
@@ -73,7 +73,7 @@ kind: "package-reference"
73
73
  当后端约定不够用时阅读以下内容:先看 seam 定义,再看替代后端与在两者之间选择的那个选择器。
74
74
 
75
75
  - [目录选择 seam](../directory-picker/README.zh.md)——`native` 能力约定与类型化错误词汇。
76
- - [目录选择能力 seam 决策](../../../.agents/notes/implemented/architecture/2026-07-28-directory-picker-capability-seam.zh.md)——后端为何在交互形态上彼此不同。
76
+ - [目录选择能力 seam 决策](../../../.agents/notes/archived/architecture/2026-07-28-directory-picker-capability-seam.md)——后端为何在交互形态上彼此不同。
77
77
  - [浏览后端](../directory-picker-browse/README.zh.md)——面向远程客户端的应用内替代方案。
78
78
  - [自适应选择器](../directory-picker-auto/README.zh.md)——native 与 browse 之间的启动时判定。
79
79
  - [免 shell 子进程运行器](../../util/native-command/README.zh.md)——选择器运行所依赖的共享子进程原语。
package/lib/worker.cjs CHANGED
@@ -13,16 +13,18 @@
13
13
  * object's first pointer.
14
14
  */
15
15
  /**
16
- * Read a NUL-terminated UTF-16 string at a native address. koffi's
17
- * `_Out_ void **` out-params surface a raw address, and
18
- * `koffi.decode(addr, 'str16')` would dereference it as a pointer crash
19
- * on real Windows — so view the memory directly instead.
16
+ * Read a valid NUL-terminated UTF-16 allocation without an external buffer.
17
+ * Generic `koffi.decode(..., 'str16')` expects a pointer variable, so the
18
+ * buffer holds the string address rather than the string bytes.
19
+ * @param koffi - the loaded koffi binding.
20
+ * @param address - the string address surfaced by the `_Out_ void **` param.
21
+ * @param pointerSize - the process's pointer width (`koffi.sizeof('void *')`).
22
+ * @returns the decoded UTF-16 path.
20
23
  */
21
- function readUtf16(koffi, address) {
22
- const bytes = Buffer.from(koffi.view(address, 32768));
23
- let end = 0;
24
- while (end + 1 < bytes.length && !(bytes[end] === 0 && bytes[end + 1] === 0)) end += 2;
25
- return bytes.toString("utf16le", 0, end);
24
+ function readUtf16(koffi, address, pointerSize) {
25
+ const pointer = Buffer.alloc(8);
26
+ pointer.writeBigUInt64LE(BigInt(address));
27
+ return koffi.decode(pointer.subarray(0, pointerSize), "str16");
26
28
  }
27
29
  const COINIT_APARTMENTTHREADED = 2;
28
30
  const CLSCTX_INPROC_SERVER = 1;
@@ -129,7 +131,7 @@ async function loadWin32DialogBindings() {
129
131
  const nameOut = [null];
130
132
  const gotName = method(item, SLOT_GET_DISPLAY_NAME, protoGetDisplayName)(SIGDN_FILESYSPATH, nameOut);
131
133
  if (gotName < 0) return { hr: gotName };
132
- const path = readUtf16(koffi, nameOut[0]);
134
+ const path = readUtf16(koffi, nameOut[0], pointerSize);
133
135
  coTaskMemFree(nameOut[0]);
134
136
  return {
135
137
  hr: gotName,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-host-directory-picker-native",
3
3
  "description": "Native-OS-chooser backend of the directory-picker seam for the DeepSeek Harness web GUI host",
4
- "version": "0.1.2-alpha.5",
4
+ "version": "0.1.3-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -33,8 +33,8 @@
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
35
  "koffi": "^3.1.0",
36
- "@deepseek-ai/dsh-host-directory-picker": "^0.1.2-alpha.5",
37
- "@deepseek-ai/dsh-native-command": "^0.1.2-alpha.5"
36
+ "@deepseek-ai/dsh-host-directory-picker": "^0.1.3-alpha.2",
37
+ "@deepseek-ai/dsh-native-command": "^0.1.3-alpha.2"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/cordis": "^4.0.2"