@x1a0f3n9/dsh-subprocess-local 0.1.5-rc.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.
@@ -0,0 +1,30 @@
1
+ /** Windows parent-side launch and ownership for the private Job runner. */
2
+ import { spawn } from 'node:child_process';
3
+ import type { SubprocessSpawnSpec } from '@x1a0f3n9/dsh-subprocess';
4
+ import { loadWin32ProcessBindings, probeCurrentTokenJobSupport } from '@x1a0f3n9/dsh-win32-process';
5
+ import type { ManagedProcessLaunch } from './managed-owner.ts';
6
+ import type { RunnerInvocation } from './runner-launch.ts';
7
+ /** Test seams for runner launch and dynamic capability checks. */
8
+ export interface WindowsJobInternals {
9
+ spawn?: typeof spawn;
10
+ runnerInvocation?: RunnerInvocation;
11
+ resolveRunnerInvocation?: () => RunnerInvocation;
12
+ runnerAvailable?: (invocation: RunnerInvocation) => boolean;
13
+ loadWin32ProcessBindings?: typeof loadWin32ProcessBindings;
14
+ probeCurrentTokenJobSupport?: typeof probeCurrentTokenJobSupport;
15
+ }
16
+ /**
17
+ * Re-check the runner entry, bindings, and current Job capability for every spawn.
18
+ * @param internals - optional runner and Win32 capability seams used by tests.
19
+ * @returns whether the Windows native containment path is currently available.
20
+ */
21
+ export declare function probeWindowsJob(internals?: WindowsJobInternals): boolean;
22
+ /**
23
+ * Launch one target through a runner that uniquely owns its Job handle.
24
+ * @param spec - ordinary target request.
25
+ * @param targetEnv - validated complete target environment.
26
+ * @param internals - optional runner launch seams used by tests.
27
+ * @returns direct streams, result, and runner-owned managed range.
28
+ */
29
+ export declare function launchWindowsJob(spec: SubprocessSpawnSpec, targetEnv: Record<string, string>, internals?: WindowsJobInternals): ManagedProcessLaunch;
30
+ //# sourceMappingURL=windows-job.d.ts.map
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@x1a0f3n9/dsh-subprocess-local",
3
+ "description": "Local-subprocess implementation of the DeepSeek Harness subprocess seam",
4
+ "version": "0.1.5-rc.2",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
11
+ "directory": "packages/subprocess/subprocess-local"
12
+ },
13
+ "type": "module",
14
+ "main": "lib/index.js",
15
+ "types": "lib/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./lib/types/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "./runner": {
22
+ "types": "./lib/types/bin.d.ts",
23
+ "default": "./lib/runner.js"
24
+ },
25
+ "./src/*": "./src/*",
26
+ "./package.json": "./package.json"
27
+ },
28
+ "files": [
29
+ "lib/index.js",
30
+ "lib/runner.js",
31
+ "lib/runner-*.js",
32
+ "scripts/ensure-spawn-helper.mjs",
33
+ "lib/types/**/*.d.ts"
34
+ ],
35
+ "license": "MIT",
36
+ "peerDependencies": {
37
+ "@x1a0f3n9/dsh-subprocess": "^0.1.5-rc.2",
38
+ "@deepseek-ai/cordis": "^4.0.2",
39
+ "@x1a0f3n9/dsh-timeout": "^0.1.5-rc.2"
40
+ },
41
+ "dependencies": {
42
+ "koffi": "^3.1.0",
43
+ "node-pty": "1.2.0-beta.15",
44
+ "@x1a0f3n9/dsh-win32-process": "^0.1.5-rc.2"
45
+ },
46
+ "devDependencies": {
47
+ "@x1a0f3n9/dsh-subprocess": "^0.1.5-rc.2",
48
+ "@deepseek-ai/cordis": "^4.0.2",
49
+ "@x1a0f3n9/dsh-loader-smoke": "^0.1.5-rc.2",
50
+ "@x1a0f3n9/dsh-timeout": "^0.1.5-rc.2"
51
+ },
52
+ "scripts": {
53
+ "postinstall": "node scripts/ensure-spawn-helper.mjs"
54
+ }
55
+ }
@@ -0,0 +1,16 @@
1
+ /** Restore the executable bit stripped from node-pty's prebuilt helper. */
2
+
3
+ import { chmodSync, existsSync } from 'node:fs'
4
+ import { dirname, join } from 'node:path'
5
+ import { fileURLToPath } from 'node:url'
6
+
7
+ const entry = fileURLToPath(import.meta.resolve('node-pty'))
8
+ const packageRoot = dirname(dirname(entry))
9
+ const candidates = [
10
+ join(packageRoot, 'prebuilds', `${process.platform}-${process.arch}`, 'spawn-helper'),
11
+ join(packageRoot, 'build', 'Release', 'spawn-helper'),
12
+ ]
13
+
14
+ for (const helper of candidates) {
15
+ if (existsSync(helper)) chmodSync(helper, 0o755)
16
+ }