@karowanorg/orc-ops 0.1.0
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/LICENSE +14 -0
- package/README.md +5 -0
- package/dist/exec-harness.d.ts +2 -0
- package/dist/exec-harness.js +78 -0
- package/dist/guide.d.ts +6 -0
- package/dist/guide.js +145 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/ops.d.ts +234 -0
- package/dist/ops.js +678 -0
- package/dist/registry.d.ts +7 -0
- package/dist/registry.js +35 -0
- package/dist/supervisor-entry.d.ts +1 -0
- package/dist/supervisor-entry.js +15 -0
- package/dist/supervisor-run.d.ts +2 -0
- package/dist/supervisor-run.js +67 -0
- package/package.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
BSD Zero Clause License (0BSD)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kyle Rowan
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# @karowanorg/orc-ops
|
|
2
|
+
|
|
3
|
+
The zod-first operation registry orc's CLI, MCP server, and SDK all interpret.
|
|
4
|
+
|
|
5
|
+
Part of orc - model-authored promise-native agent programs with deterministic replay, live monitoring, and pluggable harnesses. See the orc repository README for the full picture.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The any-language plugin protocol: a config-registered executable that
|
|
3
|
+
* - answers `--capabilities` with a HarnessCapabilities JSON on stdout, and
|
|
4
|
+
* - accepts a LeafRequest JSON on stdin, emitting HarnessEvent NDJSON on stdout.
|
|
5
|
+
* Registered ONLY via orc.config — never discovered from PATH.
|
|
6
|
+
*/
|
|
7
|
+
import * as path from "node:path";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
const HarnessCapabilitiesSchema = z.object({
|
|
10
|
+
available: z.boolean(),
|
|
11
|
+
version: z.string().optional(),
|
|
12
|
+
models: z.array(z.object({
|
|
13
|
+
id: z.string(),
|
|
14
|
+
displayName: z.string().optional(),
|
|
15
|
+
reasoningEfforts: z.array(z.string()),
|
|
16
|
+
default: z.boolean().optional(),
|
|
17
|
+
})),
|
|
18
|
+
approvalModes: z.array(z.enum(["manual", "accept-edits", "auto", "bypass"])),
|
|
19
|
+
structuredOutput: z.boolean(),
|
|
20
|
+
sessions: z.boolean(),
|
|
21
|
+
detail: z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
export function makeExecHarness(execPath, name) {
|
|
24
|
+
const harnessName = name ?? path.basename(execPath).replace(/\.[^.]+$/, "");
|
|
25
|
+
return {
|
|
26
|
+
name: harnessName,
|
|
27
|
+
async discover({ executor }) {
|
|
28
|
+
try {
|
|
29
|
+
const res = await executor.run([execPath, "--capabilities"], { timeoutMs: 15_000 });
|
|
30
|
+
if (res.code !== 0)
|
|
31
|
+
throw new Error(res.stderr || `exit ${res.code}`);
|
|
32
|
+
return HarnessCapabilitiesSchema.parse(JSON.parse(res.stdout));
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
return {
|
|
36
|
+
available: false,
|
|
37
|
+
models: [],
|
|
38
|
+
approvalModes: [],
|
|
39
|
+
structuredOutput: false,
|
|
40
|
+
sessions: false,
|
|
41
|
+
detail: `exec harness unavailable: ${String(err instanceof Error ? err.message : err)}`,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
async *invoke(req, ctx) {
|
|
46
|
+
const proc = ctx.executor.spawn([execPath], { cwd: req.cwd, stdin: "pipe" });
|
|
47
|
+
const onAbort = () => proc.kill();
|
|
48
|
+
ctx.signal.addEventListener("abort", onAbort);
|
|
49
|
+
proc.stdin?.end(JSON.stringify(req) + "\n");
|
|
50
|
+
try {
|
|
51
|
+
let buf = "";
|
|
52
|
+
for await (const chunk of proc.stdout) {
|
|
53
|
+
buf += chunk.toString();
|
|
54
|
+
let idx;
|
|
55
|
+
while ((idx = buf.indexOf("\n")) >= 0) {
|
|
56
|
+
const line = buf.slice(0, idx).trim();
|
|
57
|
+
buf = buf.slice(idx + 1);
|
|
58
|
+
if (!line)
|
|
59
|
+
continue;
|
|
60
|
+
try {
|
|
61
|
+
yield JSON.parse(line);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
/* tolerate non-event noise */
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const code = await proc.exited;
|
|
69
|
+
if (code !== 0)
|
|
70
|
+
yield { kind: "error", message: `exec harness exited with code ${code}` };
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
ctx.signal.removeEventListener("abort", onAbort);
|
|
74
|
+
proc.kill();
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
package/dist/guide.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The orc authoring + usage guide. One source of truth surfaced by:
|
|
3
|
+
* - CLI: `orc guide`
|
|
4
|
+
* - MCP: the `orc_guide` tool
|
|
5
|
+
*/
|
|
6
|
+
export declare const GUIDE = "# orc \u2014 how to write and run a program\n\norc runs a \"program\": a script that fans out AI-agent subtasks (\"leaves\") and\nrecords each one, so a run is reproducible, resumable, and observable. You write\na program, launch it, then watch it and collect the result.\n\n## 1. Write a program\n\nA program is a `.orc.ts` file with a single default-exported async function.\nIt receives an api object and returns the run's result:\n\n import type { Program } from \"@karowanorg/orc-sdk/program\"; // optional, type-only\n\n const program: Program = async ({ agent, parallel, phase }) => {\n const inventory = await agent(\"List the modules in this repo.\", {\n schema: { type: \"object\",\n properties: { modules: { type: \"array\", items: { type: \"string\" } } },\n required: [\"modules\"] },\n });\n\n // Ordinary async/await controls the flow. Awaiting a result before the\n // next call makes it a dependency; independent calls run concurrently.\n const plans = await Promise.all((inventory.modules as string[]).map(async (m) => {\n const findings = await agent(`Audit module ${m}`, { id: `audit-${m}` });\n return agent(`Plan a fix for ${m}: ${JSON.stringify(findings)}`, { id: `plan-${m}` });\n }));\n\n return phase(\"synthesis\", () => agent(`Merge these plans: ${JSON.stringify(plans)}`, { id: \"merge\" }));\n };\n export default program;\n\n## The api\n\nIMPORTANT \u2014 leaves are isolated. Each agent() runs a FRESH subagent that shares\nNONE of your context: it cannot see this program, your conversation, other\nleaves' prompts or results, or anything you know that you haven't written into\nits prompt (plus the shared `--brief`).\n\n- agent(prompt, opts?) => Promise<result>\n Dispatch one agent. Returns its result (matching `schema` if you pass one).\n A failed leaf rejects the promise, so wrap it in try/catch if you want to\n handle failure. Options:\n id a label shown in the monitor\n schema JSON Schema; the result is structured output matching it\n harness \"claude\" | \"codex\" | a configured harness (default: auto)\n model e.g. \"claude-fable-5\", \"gpt-5.6-sol\"\n reasoningEffort \"low\" | \"medium\" | \"high\" | \"xhigh\" | \"max\"\n readOnly default true; set false for a leaf that edits files\n cwd working directory for this leaf (defaults to the run's)\n host SSH destination to run this leaf on a remote machine\n idleTimeout ms with no output before the leaf is killed (false = off)\n phase group this call under a phase label\n To see valid `harness`, `model`, and `reasoningEffort` values for your\n machine, run `orc capabilities` (or `orc capabilities --json`) \u2014 it lists\n each installed harness with its available models and reasoning levels.\n Omit any of them to use the default; an unknown value is rejected up front\n by `orc validate`.\n\n- parallel(specs[]) => Promise<outcomes[]>\n Run several agents at once from an array of option objects (each with a\n `prompt`). Every lane runs to completion INDEPENDENTLY \u2014 one lane failing\n never cancels the others. Outcomes come back in order as\n `{ status: \"ok\", value } | { status: \"error\", error }`, so you decide how to\n handle partial failure. (For fail-fast, use `Promise.all` over `agent()`,\n which rejects on the first failure.)\n\n- phase(name, fn) => Promise<result>\n Group every agent() call made inside `fn` under a phase, for a readable\n run timeline.\n\n- settle(promise) => { status: \"ok\", value } | { status: \"error\", error }\n Run a lane and capture its outcome instead of letting a failure stop the run\n \u2014 useful for \"do all of these, some may fail\" fan-outs.\n\n- log(message) \u2014 write a line to the run's live event feed.\n- ext.<name>(payload) \u2014 call a custom step you registered in orc.config.\n\nBecause leaves can't see each other, pass data between them as plain values:\nput a previous result into the next prompt with JSON.stringify so the receiving\nleaf actually has it. Use normal try/catch, Promise.all/allSettled, and bounded\nloops for control flow.\n\n## What a program may and may not do\n\n- No wall clock or randomness. `Date`, `Math.random`, timers, network, file\n access, and imports (beyond type-only) are unavailable \u2014 a program only\n decides which agents to run and how to combine their results.\n- Loops must be finite; an unbounded loop is stopped by a step limit.\n- These constraints let orc replay a program exactly when you resume it, so the\n same inputs always produce the same run.\n\n## Writing files\n\nBy default leaves are read-only. To let a leaf directly modify files or run\nmutating commands, set `readOnly: false` and launch the run with\n`--allow-writes`. Configured hooks and MCP tools are not disabled for read-only\nleaves; their side effects are outside this guarantee. A write leaf runs with\nwhatever permissions your own agent has; add `--sandbox` to confine its writes\nto the working directory. If a run stops on a write leaf, `orc resume` picks it\nback up (it re-checks the working-tree state first, never blindly redoing work).\n\n## 2. Validate and launch\n\n orc validate --program-path ./my.orc.ts # compile + preview, no run\n orc launch --program-path ./my.orc.ts --brief \"what this run is for\"\n\n`--brief` (required) is shared context added to every leaf. Common launch flags:\n`--allow-writes`, `--host <ssh>`, `--approval-mode manual|accept-edits|auto|bypass`,\n`--sandbox`, `--harness claude|codex`, `--budget <usd>` (fail the run after\nobserved estimated cost exceeds this; concurrent work may overshoot), `--wait`\n(block for the result instead of running in the background).\n\n## 3. Watch and collect\n\n orc status --run-id <id> # summary\n orc wait --run-id <id> # block until it finishes\n orc get-result --run-id <id> # the final result (or --seq N for one leaf)\n orc trace --run-id <id> # per-leaf and per-tool detail\n orc open --run-id <id> # open the live monitor, print its URL\n orc list # recent runs\n\n## 4. Approvals\n\nIn `manual` or `accept-edits` mode a leaf can pause to ask permission for a\ntool. Answer it from anywhere:\n\n orc approvals --run-id <id>\n orc respond --run-id <id> --approval-id <aid> --behavior allow|deny\n\n## Discover more\n\n orc --help # every command\n orc <command> --help # a command's flags\n orc commands # JSON catalog of all operations\n orc capabilities # available harnesses, models, and reasoning levels\n orc doctor --host <ssh> # check a local or remote machine is ready\n\nEvery command supports `--json`. Run state lives in `$ORC_HOME` (default\n`~/.orc`). Real runs need `claude` and/or `codex` installed and logged in.\n";
|
package/dist/guide.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The orc authoring + usage guide. One source of truth surfaced by:
|
|
3
|
+
* - CLI: `orc guide`
|
|
4
|
+
* - MCP: the `orc_guide` tool
|
|
5
|
+
*/
|
|
6
|
+
export const GUIDE = `# orc — how to write and run a program
|
|
7
|
+
|
|
8
|
+
orc runs a "program": a script that fans out AI-agent subtasks ("leaves") and
|
|
9
|
+
records each one, so a run is reproducible, resumable, and observable. You write
|
|
10
|
+
a program, launch it, then watch it and collect the result.
|
|
11
|
+
|
|
12
|
+
## 1. Write a program
|
|
13
|
+
|
|
14
|
+
A program is a \`.orc.ts\` file with a single default-exported async function.
|
|
15
|
+
It receives an api object and returns the run's result:
|
|
16
|
+
|
|
17
|
+
import type { Program } from "@karowanorg/orc-sdk/program"; // optional, type-only
|
|
18
|
+
|
|
19
|
+
const program: Program = async ({ agent, parallel, phase }) => {
|
|
20
|
+
const inventory = await agent("List the modules in this repo.", {
|
|
21
|
+
schema: { type: "object",
|
|
22
|
+
properties: { modules: { type: "array", items: { type: "string" } } },
|
|
23
|
+
required: ["modules"] },
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Ordinary async/await controls the flow. Awaiting a result before the
|
|
27
|
+
// next call makes it a dependency; independent calls run concurrently.
|
|
28
|
+
const plans = await Promise.all((inventory.modules as string[]).map(async (m) => {
|
|
29
|
+
const findings = await agent(\`Audit module \${m}\`, { id: \`audit-\${m}\` });
|
|
30
|
+
return agent(\`Plan a fix for \${m}: \${JSON.stringify(findings)}\`, { id: \`plan-\${m}\` });
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
return phase("synthesis", () => agent(\`Merge these plans: \${JSON.stringify(plans)}\`, { id: "merge" }));
|
|
34
|
+
};
|
|
35
|
+
export default program;
|
|
36
|
+
|
|
37
|
+
## The api
|
|
38
|
+
|
|
39
|
+
IMPORTANT — leaves are isolated. Each agent() runs a FRESH subagent that shares
|
|
40
|
+
NONE of your context: it cannot see this program, your conversation, other
|
|
41
|
+
leaves' prompts or results, or anything you know that you haven't written into
|
|
42
|
+
its prompt (plus the shared \`--brief\`).
|
|
43
|
+
|
|
44
|
+
- agent(prompt, opts?) => Promise<result>
|
|
45
|
+
Dispatch one agent. Returns its result (matching \`schema\` if you pass one).
|
|
46
|
+
A failed leaf rejects the promise, so wrap it in try/catch if you want to
|
|
47
|
+
handle failure. Options:
|
|
48
|
+
id a label shown in the monitor
|
|
49
|
+
schema JSON Schema; the result is structured output matching it
|
|
50
|
+
harness "claude" | "codex" | a configured harness (default: auto)
|
|
51
|
+
model e.g. "claude-fable-5", "gpt-5.6-sol"
|
|
52
|
+
reasoningEffort "low" | "medium" | "high" | "xhigh" | "max"
|
|
53
|
+
readOnly default true; set false for a leaf that edits files
|
|
54
|
+
cwd working directory for this leaf (defaults to the run's)
|
|
55
|
+
host SSH destination to run this leaf on a remote machine
|
|
56
|
+
idleTimeout ms with no output before the leaf is killed (false = off)
|
|
57
|
+
phase group this call under a phase label
|
|
58
|
+
To see valid \`harness\`, \`model\`, and \`reasoningEffort\` values for your
|
|
59
|
+
machine, run \`orc capabilities\` (or \`orc capabilities --json\`) — it lists
|
|
60
|
+
each installed harness with its available models and reasoning levels.
|
|
61
|
+
Omit any of them to use the default; an unknown value is rejected up front
|
|
62
|
+
by \`orc validate\`.
|
|
63
|
+
|
|
64
|
+
- parallel(specs[]) => Promise<outcomes[]>
|
|
65
|
+
Run several agents at once from an array of option objects (each with a
|
|
66
|
+
\`prompt\`). Every lane runs to completion INDEPENDENTLY — one lane failing
|
|
67
|
+
never cancels the others. Outcomes come back in order as
|
|
68
|
+
\`{ status: "ok", value } | { status: "error", error }\`, so you decide how to
|
|
69
|
+
handle partial failure. (For fail-fast, use \`Promise.all\` over \`agent()\`,
|
|
70
|
+
which rejects on the first failure.)
|
|
71
|
+
|
|
72
|
+
- phase(name, fn) => Promise<result>
|
|
73
|
+
Group every agent() call made inside \`fn\` under a phase, for a readable
|
|
74
|
+
run timeline.
|
|
75
|
+
|
|
76
|
+
- settle(promise) => { status: "ok", value } | { status: "error", error }
|
|
77
|
+
Run a lane and capture its outcome instead of letting a failure stop the run
|
|
78
|
+
— useful for "do all of these, some may fail" fan-outs.
|
|
79
|
+
|
|
80
|
+
- log(message) — write a line to the run's live event feed.
|
|
81
|
+
- ext.<name>(payload) — call a custom step you registered in orc.config.
|
|
82
|
+
|
|
83
|
+
Because leaves can't see each other, pass data between them as plain values:
|
|
84
|
+
put a previous result into the next prompt with JSON.stringify so the receiving
|
|
85
|
+
leaf actually has it. Use normal try/catch, Promise.all/allSettled, and bounded
|
|
86
|
+
loops for control flow.
|
|
87
|
+
|
|
88
|
+
## What a program may and may not do
|
|
89
|
+
|
|
90
|
+
- No wall clock or randomness. \`Date\`, \`Math.random\`, timers, network, file
|
|
91
|
+
access, and imports (beyond type-only) are unavailable — a program only
|
|
92
|
+
decides which agents to run and how to combine their results.
|
|
93
|
+
- Loops must be finite; an unbounded loop is stopped by a step limit.
|
|
94
|
+
- These constraints let orc replay a program exactly when you resume it, so the
|
|
95
|
+
same inputs always produce the same run.
|
|
96
|
+
|
|
97
|
+
## Writing files
|
|
98
|
+
|
|
99
|
+
By default leaves are read-only. To let a leaf directly modify files or run
|
|
100
|
+
mutating commands, set \`readOnly: false\` and launch the run with
|
|
101
|
+
\`--allow-writes\`. Configured hooks and MCP tools are not disabled for read-only
|
|
102
|
+
leaves; their side effects are outside this guarantee. A write leaf runs with
|
|
103
|
+
whatever permissions your own agent has; add \`--sandbox\` to confine its writes
|
|
104
|
+
to the working directory. If a run stops on a write leaf, \`orc resume\` picks it
|
|
105
|
+
back up (it re-checks the working-tree state first, never blindly redoing work).
|
|
106
|
+
|
|
107
|
+
## 2. Validate and launch
|
|
108
|
+
|
|
109
|
+
orc validate --program-path ./my.orc.ts # compile + preview, no run
|
|
110
|
+
orc launch --program-path ./my.orc.ts --brief "what this run is for"
|
|
111
|
+
|
|
112
|
+
\`--brief\` (required) is shared context added to every leaf. Common launch flags:
|
|
113
|
+
\`--allow-writes\`, \`--host <ssh>\`, \`--approval-mode manual|accept-edits|auto|bypass\`,
|
|
114
|
+
\`--sandbox\`, \`--harness claude|codex\`, \`--budget <usd>\` (fail the run after
|
|
115
|
+
observed estimated cost exceeds this; concurrent work may overshoot), \`--wait\`
|
|
116
|
+
(block for the result instead of running in the background).
|
|
117
|
+
|
|
118
|
+
## 3. Watch and collect
|
|
119
|
+
|
|
120
|
+
orc status --run-id <id> # summary
|
|
121
|
+
orc wait --run-id <id> # block until it finishes
|
|
122
|
+
orc get-result --run-id <id> # the final result (or --seq N for one leaf)
|
|
123
|
+
orc trace --run-id <id> # per-leaf and per-tool detail
|
|
124
|
+
orc open --run-id <id> # open the live monitor, print its URL
|
|
125
|
+
orc list # recent runs
|
|
126
|
+
|
|
127
|
+
## 4. Approvals
|
|
128
|
+
|
|
129
|
+
In \`manual\` or \`accept-edits\` mode a leaf can pause to ask permission for a
|
|
130
|
+
tool. Answer it from anywhere:
|
|
131
|
+
|
|
132
|
+
orc approvals --run-id <id>
|
|
133
|
+
orc respond --run-id <id> --approval-id <aid> --behavior allow|deny
|
|
134
|
+
|
|
135
|
+
## Discover more
|
|
136
|
+
|
|
137
|
+
orc --help # every command
|
|
138
|
+
orc <command> --help # a command's flags
|
|
139
|
+
orc commands # JSON catalog of all operations
|
|
140
|
+
orc capabilities # available harnesses, models, and reasoning levels
|
|
141
|
+
orc doctor --host <ssh> # check a local or remote machine is ready
|
|
142
|
+
|
|
143
|
+
Every command supports \`--json\`. Run state lives in \`$ORC_HOME\` (default
|
|
144
|
+
\`~/.orc\`). Real runs need \`claude\` and/or \`codex\` installed and logged in.
|
|
145
|
+
`;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/dist/ops.d.ts
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type Json, type Registry, type RunStatus } from "@karowanorg/orc-core";
|
|
3
|
+
export interface OpContext {
|
|
4
|
+
registry: Registry;
|
|
5
|
+
registryCwd?: string;
|
|
6
|
+
mcpClientName?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface OpDef<I extends z.ZodType = z.ZodType, O = unknown> {
|
|
9
|
+
name: string;
|
|
10
|
+
doc: string;
|
|
11
|
+
readOnly: boolean;
|
|
12
|
+
input: I;
|
|
13
|
+
handler(input: z.infer<I>, ctx: OpContext): Promise<O>;
|
|
14
|
+
}
|
|
15
|
+
interface FirstFrontierCall {
|
|
16
|
+
seq: number;
|
|
17
|
+
kind: string;
|
|
18
|
+
id?: string;
|
|
19
|
+
readOnly: boolean;
|
|
20
|
+
harness?: string;
|
|
21
|
+
host?: string;
|
|
22
|
+
model?: string;
|
|
23
|
+
reasoningEffort?: string;
|
|
24
|
+
schema?: Json;
|
|
25
|
+
promptPreview?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const launch: OpDef<z.ZodObject<{
|
|
28
|
+
programPath: z.ZodString;
|
|
29
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
30
|
+
host: z.ZodOptional<z.ZodString>;
|
|
31
|
+
brief: z.ZodString;
|
|
32
|
+
allowWrites: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
+
approvalMode: z.ZodDefault<z.ZodEnum<{
|
|
34
|
+
manual: "manual";
|
|
35
|
+
"accept-edits": "accept-edits";
|
|
36
|
+
auto: "auto";
|
|
37
|
+
bypass: "bypass";
|
|
38
|
+
}>>;
|
|
39
|
+
sandbox: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
sandboxDirs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
+
maxParallel: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
idleTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
budget: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
harness: z.ZodOptional<z.ZodString>;
|
|
46
|
+
wait: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
}, z.core.$strip>, {
|
|
48
|
+
runId: string;
|
|
49
|
+
requestsWrite: boolean;
|
|
50
|
+
monitorUrl: string;
|
|
51
|
+
reportPath: string;
|
|
52
|
+
status: RunStatus;
|
|
53
|
+
allowWrites?: undefined;
|
|
54
|
+
approvalMode?: undefined;
|
|
55
|
+
wait?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
runId: string;
|
|
58
|
+
requestsWrite: boolean;
|
|
59
|
+
allowWrites: boolean;
|
|
60
|
+
approvalMode: import("@karowanorg/orc-core").ApprovalMode;
|
|
61
|
+
monitorUrl: string;
|
|
62
|
+
reportPath: string;
|
|
63
|
+
wait: {
|
|
64
|
+
op: string;
|
|
65
|
+
input: {
|
|
66
|
+
runId: string;
|
|
67
|
+
timeoutSeconds: number;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
status?: undefined;
|
|
71
|
+
}>;
|
|
72
|
+
export declare const validate: OpDef<z.ZodObject<{
|
|
73
|
+
programPath: z.ZodString;
|
|
74
|
+
allowWrites: z.ZodDefault<z.ZodBoolean>;
|
|
75
|
+
approvalMode: z.ZodDefault<z.ZodEnum<{
|
|
76
|
+
manual: "manual";
|
|
77
|
+
"accept-edits": "accept-edits";
|
|
78
|
+
auto: "auto";
|
|
79
|
+
bypass: "bypass";
|
|
80
|
+
}>>;
|
|
81
|
+
harness: z.ZodOptional<z.ZodString>;
|
|
82
|
+
host: z.ZodOptional<z.ZodString>;
|
|
83
|
+
checkCapabilities: z.ZodDefault<z.ZodBoolean>;
|
|
84
|
+
}, z.core.$strip>, {
|
|
85
|
+
ok: boolean;
|
|
86
|
+
sha256: string;
|
|
87
|
+
requestsWrite: boolean;
|
|
88
|
+
firstCalls: FirstFrontierCall[];
|
|
89
|
+
problems: string[];
|
|
90
|
+
}>;
|
|
91
|
+
export declare const status: OpDef<z.ZodObject<{
|
|
92
|
+
runId: z.ZodString;
|
|
93
|
+
}, z.core.$strip>, RunStatus>;
|
|
94
|
+
export declare const wait: OpDef<z.ZodObject<{
|
|
95
|
+
runId: z.ZodString;
|
|
96
|
+
timeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
97
|
+
}, z.core.$strip>, {
|
|
98
|
+
outcome: "completed" | "failed" | "cancelled";
|
|
99
|
+
timedOut: boolean;
|
|
100
|
+
status: RunStatus;
|
|
101
|
+
retry?: undefined;
|
|
102
|
+
} | {
|
|
103
|
+
outcome: string;
|
|
104
|
+
timedOut: boolean;
|
|
105
|
+
status: RunStatus;
|
|
106
|
+
retry: {
|
|
107
|
+
op: string;
|
|
108
|
+
input: {
|
|
109
|
+
runId: string;
|
|
110
|
+
timeoutSeconds: number;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
}>;
|
|
114
|
+
export declare const getResult: OpDef<z.ZodObject<{
|
|
115
|
+
runId: z.ZodString;
|
|
116
|
+
seq: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
}, z.core.$strip>, {
|
|
118
|
+
body: Json;
|
|
119
|
+
sha256: string;
|
|
120
|
+
}>;
|
|
121
|
+
export declare const getTrace: OpDef<z.ZodObject<{
|
|
122
|
+
runId: z.ZodString;
|
|
123
|
+
}, z.core.$strip>, {
|
|
124
|
+
status: RunStatus;
|
|
125
|
+
traces: (import("@karowanorg/orc-core").RunEventRecord | import("@karowanorg/orc-core").HarnessLogRecord | {
|
|
126
|
+
prompt: string | undefined;
|
|
127
|
+
brief: string | undefined;
|
|
128
|
+
error: string | undefined;
|
|
129
|
+
t: "leaf";
|
|
130
|
+
seq: number;
|
|
131
|
+
attempt: number;
|
|
132
|
+
rev: number;
|
|
133
|
+
status: "running" | "ok" | "error";
|
|
134
|
+
id?: string;
|
|
135
|
+
phase?: string;
|
|
136
|
+
kind: string;
|
|
137
|
+
harness?: string;
|
|
138
|
+
model?: string;
|
|
139
|
+
reasoningEffort?: string;
|
|
140
|
+
host?: string;
|
|
141
|
+
cwd?: string;
|
|
142
|
+
readOnly: boolean;
|
|
143
|
+
startMs: number;
|
|
144
|
+
endMs?: number;
|
|
145
|
+
output?: Json;
|
|
146
|
+
sessionId?: string;
|
|
147
|
+
toolCalls?: import("@karowanorg/orc-core").ToolCallTrace[];
|
|
148
|
+
tokensIn?: number;
|
|
149
|
+
tokensOut?: number;
|
|
150
|
+
costUsd?: number;
|
|
151
|
+
costEstimated?: boolean;
|
|
152
|
+
reoriented?: boolean;
|
|
153
|
+
})[];
|
|
154
|
+
}>;
|
|
155
|
+
export declare const list: OpDef<z.ZodObject<{
|
|
156
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
157
|
+
}, z.core.$strip>, {
|
|
158
|
+
runId: string;
|
|
159
|
+
name: string | undefined;
|
|
160
|
+
state: string;
|
|
161
|
+
createdAtMs: number;
|
|
162
|
+
host: string | undefined;
|
|
163
|
+
cwd: string;
|
|
164
|
+
}[]>;
|
|
165
|
+
export declare const cancel: OpDef<z.ZodObject<{
|
|
166
|
+
runId: z.ZodString;
|
|
167
|
+
}, z.core.$strip>, {
|
|
168
|
+
enqueued: boolean;
|
|
169
|
+
}>;
|
|
170
|
+
export declare const resume: OpDef<z.ZodObject<{
|
|
171
|
+
runId: z.ZodString;
|
|
172
|
+
wait: z.ZodDefault<z.ZodBoolean>;
|
|
173
|
+
}, z.core.$strip>, {
|
|
174
|
+
runId: string;
|
|
175
|
+
status: RunStatus;
|
|
176
|
+
resumed?: undefined;
|
|
177
|
+
} | {
|
|
178
|
+
runId: string;
|
|
179
|
+
resumed: boolean;
|
|
180
|
+
status?: undefined;
|
|
181
|
+
}>;
|
|
182
|
+
export declare const listApprovals: OpDef<z.ZodObject<{
|
|
183
|
+
runId: z.ZodString;
|
|
184
|
+
}, z.core.$strip>, import("@karowanorg/orc-core").ApprovalRequest[]>;
|
|
185
|
+
export declare const respondApproval: OpDef<z.ZodObject<{
|
|
186
|
+
runId: z.ZodString;
|
|
187
|
+
approvalId: z.ZodString;
|
|
188
|
+
behavior: z.ZodEnum<{
|
|
189
|
+
allow: "allow";
|
|
190
|
+
deny: "deny";
|
|
191
|
+
}>;
|
|
192
|
+
message: z.ZodOptional<z.ZodString>;
|
|
193
|
+
}, z.core.$strip>, {
|
|
194
|
+
enqueued: boolean;
|
|
195
|
+
}>;
|
|
196
|
+
export declare const capabilities: OpDef<z.ZodObject<{
|
|
197
|
+
host: z.ZodOptional<z.ZodString>;
|
|
198
|
+
refresh: z.ZodDefault<z.ZodBoolean>;
|
|
199
|
+
}, z.core.$strip>, {
|
|
200
|
+
host: string;
|
|
201
|
+
defaultHarness: string;
|
|
202
|
+
harnesses: Record<string, unknown>;
|
|
203
|
+
extensions: string[];
|
|
204
|
+
}>;
|
|
205
|
+
export declare const openMonitor: OpDef<z.ZodObject<{
|
|
206
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
207
|
+
browser: z.ZodDefault<z.ZodBoolean>;
|
|
208
|
+
}, z.core.$strip>, {
|
|
209
|
+
url: string;
|
|
210
|
+
}>;
|
|
211
|
+
export declare const report: OpDef<z.ZodObject<{
|
|
212
|
+
runId: z.ZodString;
|
|
213
|
+
}, z.core.$strip>, {
|
|
214
|
+
path: string;
|
|
215
|
+
}>;
|
|
216
|
+
export declare const guide: OpDef<z.ZodObject<{
|
|
217
|
+
host: z.ZodOptional<z.ZodString>;
|
|
218
|
+
probe: z.ZodDefault<z.ZodBoolean>;
|
|
219
|
+
}, z.core.$strip>, {
|
|
220
|
+
guide: string;
|
|
221
|
+
}>;
|
|
222
|
+
export declare const doctor: OpDef<z.ZodObject<{
|
|
223
|
+
host: z.ZodOptional<z.ZodString>;
|
|
224
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, z.core.$strip>, {
|
|
226
|
+
host: string;
|
|
227
|
+
checks: Record<string, unknown>;
|
|
228
|
+
}>;
|
|
229
|
+
export declare const ALL_OPS: OpDef[];
|
|
230
|
+
/** Machine-readable catalog for `orc commands --json` and agent discovery. */
|
|
231
|
+
export declare function catalog(): Json;
|
|
232
|
+
/** Start the package-owned detached supervisor and wait for its startup signal. */
|
|
233
|
+
export declare function spawnDetachedSupervisor(runId: string, registryCwd?: string): Promise<void>;
|
|
234
|
+
export {};
|