@deepseek-ai/dsh-sandbox-windows-acl 0.1.6-alpha.1 → 0.1.6-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/lib/index.js +1 -1
- package/lib/runner.js +1 -1
- package/lib/{types-BYdUtsBr.js → types-CutH1Lgc.js} +21 -10
- package/package.json +8 -7
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as assertTempRootOutsideWorkspace, i as AclWriteGrant, n as tempWriteSid, r as workspaceWriteSid, t as AclSandbox } from "./types-
|
|
1
|
+
import { a as assertTempRootOutsideWorkspace, i as AclWriteGrant, n as tempWriteSid, r as workspaceWriteSid, t as AclSandbox } from "./types-CutH1Lgc.js";
|
|
2
2
|
export { AclSandbox, AclWriteGrant, assertTempRootOutsideWorkspace, tempWriteSid, workspaceWriteSid };
|
package/lib/runner.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as assertTempRootOutsideWorkspace, n as tempWriteSid, o as win32, r as workspaceWriteSid, t as AclSandbox } from "./types-
|
|
1
|
+
import { a as assertTempRootOutsideWorkspace, n as tempWriteSid, o as win32, r as workspaceWriteSid, t as AclSandbox } from "./types-CutH1Lgc.js";
|
|
2
2
|
import { closeSync, existsSync, mkdtempSync, rmSync, statSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { SUBPROCESS_CONTROL_ENV, SUBPROCESS_CONTROL_FD } from "@deepseek-ai/dsh-subprocess/control";
|
|
@@ -2,7 +2,7 @@ import { existsSync, mkdirSync, realpathSync, statSync } from "node:fs";
|
|
|
2
2
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
3
3
|
import { ERROR_INSUFFICIENT_BUFFER, Win32Error, allocPtrSlot, allocUint32, decodePtr, decodeUint32, drainPipe, extendWin32ProcessBindings, isNullPtr, isNullPtr as isNullPtr$1, spawnInheritedJobProcess, spawnPipedProcess, throwLastError, throwLastError as throwLastError$1, throwWin32, waitForProcessExit } from "@deepseek-ai/dsh-win32-process";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
|
-
import
|
|
5
|
+
import { createLazyRequire } from "@deepseek-ai/dsh-lazy-require";
|
|
6
6
|
//#region lib/types/win32-abi.js
|
|
7
7
|
/** ACL/token-specific Win32 constants. */
|
|
8
8
|
/** OpenProcess access required to query the current process token. */
|
|
@@ -20,8 +20,17 @@ const FILE_ALL_ACCESS = 2032127;
|
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region lib/types/ffi.js
|
|
22
22
|
/** ACL/token bindings layered on the shared Win32 process owner. */
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const requireKoffi = createLazyRequire("koffi", import.meta.url);
|
|
24
|
+
let cachedTypes;
|
|
25
|
+
function ffiTypes() {
|
|
26
|
+
if (cachedTypes !== void 0) return cachedTypes;
|
|
27
|
+
const koffi = requireKoffi();
|
|
28
|
+
const PVOID = koffi.pointer("void");
|
|
29
|
+
return cachedTypes = {
|
|
30
|
+
PVOID,
|
|
31
|
+
PPVOID: koffi.pointer(PVOID)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
25
34
|
/**
|
|
26
35
|
* Return whether CreateFileW produced INVALID_HANDLE_VALUE.
|
|
27
36
|
* @param handle - handle returned by CreateFileW.
|
|
@@ -37,7 +46,7 @@ function isInvalidHandle(handle) {
|
|
|
37
46
|
* @param value - unsigned value to store.
|
|
38
47
|
*/
|
|
39
48
|
function encodeUint32(slot, value) {
|
|
40
|
-
|
|
49
|
+
requireKoffi().encode(slot, "uint32", value);
|
|
41
50
|
}
|
|
42
51
|
/**
|
|
43
52
|
* Return a Koffi pointer's numeric address for struct packing.
|
|
@@ -45,7 +54,7 @@ function encodeUint32(slot, value) {
|
|
|
45
54
|
* @returns pointer address.
|
|
46
55
|
*/
|
|
47
56
|
function ptrAddress(ptr) {
|
|
48
|
-
return
|
|
57
|
+
return requireKoffi().address(ptr);
|
|
49
58
|
}
|
|
50
59
|
/**
|
|
51
60
|
* Allocate a raw byte block.
|
|
@@ -53,7 +62,7 @@ function ptrAddress(ptr) {
|
|
|
53
62
|
* @returns allocated pointer.
|
|
54
63
|
*/
|
|
55
64
|
function allocBytes(length) {
|
|
56
|
-
return
|
|
65
|
+
return requireKoffi().alloc("uint8", length);
|
|
57
66
|
}
|
|
58
67
|
/**
|
|
59
68
|
* Allocate one zeroed x64 OVERLAPPED record.
|
|
@@ -71,7 +80,7 @@ function allocOverlapped() {
|
|
|
71
80
|
* @returns decoded pointer, or null for address zero.
|
|
72
81
|
*/
|
|
73
82
|
function decodePtrAt(buffer, offset) {
|
|
74
|
-
const value =
|
|
83
|
+
const value = requireKoffi().decode(buffer, offset, ffiTypes().PVOID);
|
|
75
84
|
return isNullPtr(value) ? null : value;
|
|
76
85
|
}
|
|
77
86
|
/**
|
|
@@ -81,7 +90,7 @@ function decodePtrAt(buffer, offset) {
|
|
|
81
90
|
* @returns decoded value.
|
|
82
91
|
*/
|
|
83
92
|
function decodeUint8At(ptr, offset) {
|
|
84
|
-
return
|
|
93
|
+
return requireKoffi().decode(ptr, offset, "uint8");
|
|
85
94
|
}
|
|
86
95
|
/**
|
|
87
96
|
* Decode a uint16 field at a native pointer offset.
|
|
@@ -90,7 +99,7 @@ function decodeUint8At(ptr, offset) {
|
|
|
90
99
|
* @returns decoded value.
|
|
91
100
|
*/
|
|
92
101
|
function decodeUint16At(ptr, offset) {
|
|
93
|
-
return
|
|
102
|
+
return requireKoffi().decode(ptr, offset, "uint16");
|
|
94
103
|
}
|
|
95
104
|
/**
|
|
96
105
|
* Decode a uint32 field at a native pointer offset.
|
|
@@ -99,7 +108,7 @@ function decodeUint16At(ptr, offset) {
|
|
|
99
108
|
* @returns decoded value.
|
|
100
109
|
*/
|
|
101
110
|
function decodeUint32At(ptr, offset) {
|
|
102
|
-
return
|
|
111
|
+
return requireKoffi().decode(ptr, offset, "uint32");
|
|
103
112
|
}
|
|
104
113
|
/**
|
|
105
114
|
* Compare two in-memory SID records without allocating strings.
|
|
@@ -120,6 +129,8 @@ function sameSidAt(left, leftOffset, right, rightOffset) {
|
|
|
120
129
|
let cached;
|
|
121
130
|
function bindings() {
|
|
122
131
|
if (cached !== void 0) return cached;
|
|
132
|
+
const koffi = requireKoffi();
|
|
133
|
+
const { PVOID, PPVOID } = ffiTypes();
|
|
123
134
|
cached = extendWin32ProcessBindings(({ kernel32, advapi32, bind }) => ({
|
|
124
135
|
openProcess: bind(kernel32, "OpenProcess", PVOID, [
|
|
125
136
|
"uint32",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-sandbox-windows-acl",
|
|
3
3
|
"description": "Windows ACL write-restriction sandbox backend (restricted-token spawn with capability-SID write allowlist) for the DeepSeek Harness sandbox seam",
|
|
4
|
-
"version": "0.1.6-alpha.
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -34,17 +34,18 @@
|
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
37
|
-
"@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.
|
|
37
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"koffi": "^3.1.0",
|
|
41
|
-
"@deepseek-ai/dsh-
|
|
41
|
+
"@deepseek-ai/dsh-lazy-require": "^0.1.6-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-win32-process": "^0.1.6-alpha.2"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@deepseek-ai/dsh-pwsh-local": "^0.1.6-alpha.
|
|
45
|
-
"@deepseek-ai/dsh-sandbox-local": "^0.1.6-alpha.
|
|
45
|
+
"@deepseek-ai/dsh-pwsh-local": "^0.1.6-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-sandbox-local": "^0.1.6-alpha.2",
|
|
46
47
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
47
|
-
"@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.
|
|
48
|
-
"@deepseek-ai/dsh-subprocess-local": "^0.1.6-alpha.
|
|
48
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-subprocess-local": "^0.1.6-alpha.2"
|
|
49
50
|
}
|
|
50
51
|
}
|