oorja-harness-host 0.2.0 → 0.2.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/dist/harnesses/doctor.js +4 -3
- package/dist/sandbox/local.d.ts +5 -2
- package/dist/sandbox/local.js +11 -5
- package/package.json +8 -7
package/dist/harnesses/doctor.js
CHANGED
|
@@ -10,12 +10,13 @@ export const runHarnessDoctor = async (cwd, harnessName) => {
|
|
|
10
10
|
home ? canAccess(home, constants.R_OK | constants.W_OK) : false,
|
|
11
11
|
checkLoopbackPort().then(() => true, () => false),
|
|
12
12
|
]);
|
|
13
|
-
const nodeMajor =
|
|
13
|
+
const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(Number);
|
|
14
|
+
const nodeIsSupported = nodeMajor > 24 || (nodeMajor === 24 && nodeMinor >= 15);
|
|
14
15
|
return [
|
|
15
16
|
{
|
|
16
17
|
name: 'node',
|
|
17
|
-
ok:
|
|
18
|
-
detail: `Node ${process.versions.node}; requires Node
|
|
18
|
+
ok: nodeIsSupported,
|
|
19
|
+
detail: `Node ${process.versions.node}; requires Node 24.15 or newer`,
|
|
19
20
|
},
|
|
20
21
|
{
|
|
21
22
|
name: 'pnpm',
|
package/dist/sandbox/local.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Experimental_SandboxSession } from 'ai';
|
|
1
|
+
import type { Experimental_SandboxProcess, Experimental_SandboxSession } from 'ai';
|
|
2
|
+
import type { Experimental_SandboxSpawnOptions as SandboxSpawnOptions, Experimental_SandboxSpawnOptionsWithStdin as SandboxSpawnOptionsWithStdin, Experimental_SandboxSpawnOptionsWithoutStdin as SandboxSpawnOptionsWithoutStdin, Experimental_WritableSandboxProcess as WritableSandboxProcess } from '@ai-sdk/provider-utils';
|
|
2
3
|
export declare class LocalSandboxSession implements Experimental_SandboxSession {
|
|
3
4
|
private readonly cwd;
|
|
4
5
|
readonly description: string;
|
|
@@ -10,6 +11,8 @@ export declare class LocalSandboxSession implements Experimental_SandboxSession
|
|
|
10
11
|
writeBinaryFile: Experimental_SandboxSession['writeBinaryFile'];
|
|
11
12
|
writeFile: Experimental_SandboxSession['writeFile'];
|
|
12
13
|
writeTextFile: Experimental_SandboxSession['writeTextFile'];
|
|
13
|
-
spawn:
|
|
14
|
+
spawn(options: SandboxSpawnOptionsWithStdin): Promise<WritableSandboxProcess>;
|
|
15
|
+
spawn(options: SandboxSpawnOptionsWithoutStdin): Promise<Experimental_SandboxProcess>;
|
|
16
|
+
spawn(options: SandboxSpawnOptions): Promise<Experimental_SandboxProcess | WritableSandboxProcess>;
|
|
14
17
|
run: Experimental_SandboxSession['run'];
|
|
15
18
|
}
|
package/dist/sandbox/local.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawn as spawnChild } from 'node:child_process';
|
|
2
2
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { Readable } from 'node:stream';
|
|
4
|
+
import { Readable, Writable } from 'node:stream';
|
|
5
5
|
export class LocalSandboxSession {
|
|
6
6
|
cwd;
|
|
7
7
|
description;
|
|
@@ -63,7 +63,7 @@ export class LocalSandboxSession {
|
|
|
63
63
|
abortSignal,
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
|
-
|
|
66
|
+
async spawn({ command, workingDirectory, env, abortSignal, stdin = false, }) {
|
|
67
67
|
if (abortSignal?.aborted)
|
|
68
68
|
throw abortSignal.reason;
|
|
69
69
|
const child = spawnChild(command, {
|
|
@@ -72,7 +72,7 @@ export class LocalSandboxSession {
|
|
|
72
72
|
shell: true,
|
|
73
73
|
// Terminal Ctrl-C must reach the host first so it can save the harness session.
|
|
74
74
|
detached: process.platform !== 'win32',
|
|
75
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
75
|
+
stdio: [stdin ? 'pipe' : 'ignore', 'pipe', 'pipe'],
|
|
76
76
|
});
|
|
77
77
|
const stdout = Readable.toWeb(child.stdout);
|
|
78
78
|
const stderr = Readable.toWeb(child.stderr);
|
|
@@ -111,8 +111,14 @@ export class LocalSandboxSession {
|
|
|
111
111
|
};
|
|
112
112
|
abortSignal?.addEventListener('abort', handleAbort, { once: true });
|
|
113
113
|
void wait.finally(() => abortSignal?.removeEventListener('abort', handleAbort)).catch(() => { });
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
const sandboxProcess = { pid: child.pid, stdout, stderr, wait: () => wait, kill };
|
|
115
|
+
if (!stdin)
|
|
116
|
+
return sandboxProcess;
|
|
117
|
+
return {
|
|
118
|
+
...sandboxProcess,
|
|
119
|
+
stdin: Writable.toWeb(child.stdin),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
116
122
|
run = async (options) => {
|
|
117
123
|
const process = await this.spawn(options);
|
|
118
124
|
const [stdout, stderr, result] = await Promise.all([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oorja-harness-host",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Host AI coding harness sessions on a Supakit-connected computer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
"prepack": "pnpm run build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@ai-sdk/harness": "1.0.
|
|
23
|
-
"@ai-sdk/harness-claude-code": "1.0.
|
|
24
|
-
"@ai-sdk/harness-codex": "1.0.
|
|
25
|
-
"@ai-sdk/harness-opencode": "1.0.
|
|
26
|
-
"ai": "
|
|
22
|
+
"@ai-sdk/harness": "1.0.167",
|
|
23
|
+
"@ai-sdk/harness-claude-code": "1.0.171",
|
|
24
|
+
"@ai-sdk/harness-codex": "1.0.169",
|
|
25
|
+
"@ai-sdk/harness-opencode": "1.0.169",
|
|
26
|
+
"@ai-sdk/provider-utils": "5.0.70",
|
|
27
|
+
"ai": "7.0.156"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@types/node": "^22.10.2",
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"typescript": "^5.9.2"
|
|
33
34
|
},
|
|
34
35
|
"engines": {
|
|
35
|
-
"node": ">=
|
|
36
|
+
"node": ">=24.15.0"
|
|
36
37
|
},
|
|
37
38
|
"packageManager": "pnpm@11.5.2"
|
|
38
39
|
}
|