@karowanorg/orc-core 0.1.0 → 0.1.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/contracts.d.ts +0 -7
- package/dist/engine.js +0 -1
- package/dist/status.js +0 -1
- package/dist/supervisor.d.ts +1 -2
- package/dist/supervisor.js +5 -18
- package/package.json +1 -1
package/dist/contracts.d.ts
CHANGED
|
@@ -35,8 +35,6 @@ export interface Proc {
|
|
|
35
35
|
pid: number | undefined;
|
|
36
36
|
}
|
|
37
37
|
export interface Executor {
|
|
38
|
-
/** undefined for local; the ssh destination string otherwise (e.g. "build@ci-box"). */
|
|
39
|
-
readonly host: string | undefined;
|
|
40
38
|
spawn(cmd: string[], opts?: SpawnOptions): Proc;
|
|
41
39
|
/** Run a command to completion, capturing output. */
|
|
42
40
|
run(cmd: string[], opts?: SpawnOptions & {
|
|
@@ -80,7 +78,6 @@ export interface LeafRequest {
|
|
|
80
78
|
reasoningEffort?: string;
|
|
81
79
|
readOnly: boolean;
|
|
82
80
|
cwd: string;
|
|
83
|
-
host?: string;
|
|
84
81
|
approvalMode: ApprovalMode;
|
|
85
82
|
sessionId?: string;
|
|
86
83
|
idleTimeoutMs?: number | false;
|
|
@@ -175,7 +172,6 @@ export interface ThunkSpec {
|
|
|
175
172
|
schema?: Json;
|
|
176
173
|
readOnly: boolean;
|
|
177
174
|
cwd?: string;
|
|
178
|
-
host?: string;
|
|
179
175
|
phase?: string;
|
|
180
176
|
idleTimeoutMs?: number | false;
|
|
181
177
|
groupId?: string;
|
|
@@ -261,7 +257,6 @@ export interface LeafTraceRecord {
|
|
|
261
257
|
harness?: string;
|
|
262
258
|
model?: string;
|
|
263
259
|
reasoningEffort?: string;
|
|
264
|
-
host?: string;
|
|
265
260
|
cwd?: string;
|
|
266
261
|
readOnly: boolean;
|
|
267
262
|
startMs: number;
|
|
@@ -320,7 +315,6 @@ export interface RunManifest {
|
|
|
320
315
|
programPath: string;
|
|
321
316
|
programSha256: string;
|
|
322
317
|
cwd: string;
|
|
323
|
-
host?: string;
|
|
324
318
|
brief: string;
|
|
325
319
|
allowWrites: boolean;
|
|
326
320
|
approvalMode: ApprovalMode;
|
|
@@ -343,7 +337,6 @@ export interface LeafStatus {
|
|
|
343
337
|
status: "pending" | "running" | "ok" | "error";
|
|
344
338
|
readOnly: boolean;
|
|
345
339
|
harness?: string;
|
|
346
|
-
host?: string;
|
|
347
340
|
startMs?: number;
|
|
348
341
|
endMs?: number;
|
|
349
342
|
error?: string;
|
package/dist/engine.js
CHANGED
package/dist/status.js
CHANGED
|
@@ -61,7 +61,6 @@ export function projectStatus(manifest, journal, traces) {
|
|
|
61
61
|
if (tr.attempt < currentAttempt)
|
|
62
62
|
continue;
|
|
63
63
|
leaf.harness = tr.harness;
|
|
64
|
-
leaf.host = tr.host;
|
|
65
64
|
leaf.startMs = tr.startMs;
|
|
66
65
|
leaf.endMs = tr.endMs;
|
|
67
66
|
if (tr.status === "running" && (tr.attempt > currentAttempt || leaf.status === "pending")) {
|
package/dist/supervisor.d.ts
CHANGED
|
@@ -4,12 +4,11 @@ export interface Registry {
|
|
|
4
4
|
harnesses: Map<string, Harness>;
|
|
5
5
|
extensions: Map<string, ExtensionLeaf>;
|
|
6
6
|
defaultHarness: string;
|
|
7
|
-
|
|
7
|
+
executor: Executor;
|
|
8
8
|
}
|
|
9
9
|
export interface LaunchOptions {
|
|
10
10
|
programPath: string;
|
|
11
11
|
cwd?: string;
|
|
12
|
-
host?: string;
|
|
13
12
|
brief: string;
|
|
14
13
|
allowWrites?: boolean;
|
|
15
14
|
approvalMode?: RunManifest["approvalMode"];
|
package/dist/supervisor.js
CHANGED
|
@@ -22,18 +22,9 @@ export function sourceRequestsWrite(source) {
|
|
|
22
22
|
}
|
|
23
23
|
export async function prepareRun(opts, registry) {
|
|
24
24
|
const { bundle, sha256 } = await compileProgram(opts.programPath);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
let cwd;
|
|
29
|
-
if (opts.host) {
|
|
30
|
-
cwd = opts.cwd ?? ".";
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
cwd = fs.realpathSync(path.resolve(opts.cwd ?? process.cwd()));
|
|
34
|
-
if (!fs.statSync(cwd).isDirectory())
|
|
35
|
-
throw new Error(`cwd is not a directory: ${cwd}`);
|
|
36
|
-
}
|
|
25
|
+
const cwd = fs.realpathSync(path.resolve(opts.cwd ?? process.cwd()));
|
|
26
|
+
if (!fs.statSync(cwd).isDirectory())
|
|
27
|
+
throw new Error(`cwd is not a directory: ${cwd}`);
|
|
37
28
|
const brief = opts.brief?.trim();
|
|
38
29
|
if (!brief)
|
|
39
30
|
throw new Error("brief is required");
|
|
@@ -46,7 +37,6 @@ export async function prepareRun(opts, registry) {
|
|
|
46
37
|
programPath: path.resolve(opts.programPath),
|
|
47
38
|
programSha256: sha256,
|
|
48
39
|
cwd,
|
|
49
|
-
host: opts.host,
|
|
50
40
|
brief,
|
|
51
41
|
allowWrites: opts.allowWrites ?? false,
|
|
52
42
|
approvalMode: opts.approvalMode ?? "auto",
|
|
@@ -616,9 +606,8 @@ class Supervisor {
|
|
|
616
606
|
// -------------------------------------------------------------------------
|
|
617
607
|
async executeLeaf(leaf) {
|
|
618
608
|
const { spec, seq, attempt } = leaf;
|
|
619
|
-
const host = spec.host ?? this.manifest.host;
|
|
620
609
|
const cwd = spec.cwd ?? this.manifest.cwd;
|
|
621
|
-
const executor = this.registry.
|
|
610
|
+
const executor = this.registry.executor;
|
|
622
611
|
let rev = 0;
|
|
623
612
|
const startMs = Date.now();
|
|
624
613
|
const toolCalls = new Map();
|
|
@@ -637,7 +626,6 @@ class Supervisor {
|
|
|
637
626
|
phase: spec.phase,
|
|
638
627
|
kind: spec.kind,
|
|
639
628
|
harness: spec.kind === "agent" ? (spec.harness ?? this.manifest.defaultHarness) : undefined,
|
|
640
|
-
host,
|
|
641
629
|
cwd,
|
|
642
630
|
readOnly: spec.readOnly,
|
|
643
631
|
startMs,
|
|
@@ -704,7 +692,6 @@ class Supervisor {
|
|
|
704
692
|
reasoningEffort: spec.reasoningEffort,
|
|
705
693
|
readOnly: spec.readOnly,
|
|
706
694
|
cwd,
|
|
707
|
-
host,
|
|
708
695
|
approvalMode: this.manifest.approvalMode,
|
|
709
696
|
idleTimeoutMs: leaf.idleTimeoutMs,
|
|
710
697
|
sandbox: this.manifest.sandbox,
|
|
@@ -978,7 +965,7 @@ function isRetryable(error) {
|
|
|
978
965
|
// model call and delays the real failure. Config/routing errors plus the
|
|
979
966
|
// structured-output schema rejections (OpenAI/codex strict mode) are all
|
|
980
967
|
// author-fixable, not transient.
|
|
981
|
-
return !/unknown harness|unknown extension|unregistered extension|fails inputSchema|
|
|
968
|
+
return !/unknown harness|unknown extension|unregistered extension|fails inputSchema|allow_writes|invalid_json_schema|invalid schema|unsupported schema|additionalProperties|output[\s_-]?schema|result exceeds cap|result is not valid JSON/i.test(error);
|
|
982
969
|
}
|
|
983
970
|
function attemptKey(seq, attempt) {
|
|
984
971
|
return `${seq}:${attempt}`;
|