@odla-ai/harness 0.6.0 → 0.7.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/README.md +12 -12
- package/dist/{chunk-ZYNGL5SC.js → chunk-QZXCQSPZ.js} +21 -12
- package/dist/chunk-QZXCQSPZ.js.map +1 -0
- package/dist/code-runtime-cli.cjs +21 -12
- package/dist/code-runtime-cli.cjs.map +1 -1
- package/dist/code-runtime-cli.js +4 -4
- package/dist/code-runtime-cli.js.map +1 -1
- package/dist/node.cjs +21 -12
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +18 -12
- package/dist/node.d.ts +18 -12
- package/dist/node.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-ZYNGL5SC.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
@odla-ai/harness is the experimental coding-task boundary shared by odla
|
|
4
4
|
Studio, a trusted Mac/Linux runner, and an untrusted coding-agent container.
|
|
5
|
-
It owns the protocol and safe runner defaults; agent implementations such as
|
|
5
|
+
It owns the protocol and safe runner defaults; agent implementations such as Theseus
|
|
6
6
|
remain replaceable adapters.
|
|
7
7
|
|
|
8
8
|
Harness can stage a bounded, secret-filtered copy of a local checkout. The
|
|
9
|
-
brokered
|
|
9
|
+
brokered Theseus agent receives no workspace mount at all: reads and mutations cross
|
|
10
10
|
the typed tool channel into that disposable snapshot. The original checkout,
|
|
11
11
|
terminal credential, provider credentials, container-engine socket, and
|
|
12
|
-
network are never available to
|
|
12
|
+
network are never available to Theseus. Inference requests cross the same JSONL
|
|
13
13
|
channel and are fulfilled by the control plane through @odla-ai/ai.
|
|
14
14
|
|
|
15
15
|
> **Ask the runbooks first.** odla's operational procedures live in a database,
|
|
@@ -32,7 +32,7 @@ npx @odla-ai/cli code connect \
|
|
|
32
32
|
--env dev
|
|
33
33
|
~~~
|
|
34
34
|
|
|
35
|
-
The terminal verifies the checkout and isolation engine, builds the
|
|
35
|
+
The terminal verifies the checkout and isolation engine, builds the Theseus adapter
|
|
36
36
|
bundled with the exact CLI release into a content-addressed local image, prepares
|
|
37
37
|
each digest-pinned recipe image, and sends the connection request outbound to odla. The signed-in app
|
|
38
38
|
owner approves it; no bearer is copied from the browser. The process stays in
|
|
@@ -49,20 +49,20 @@ otherwise Harness receives the immutable sources from the Registry. References
|
|
|
49
49
|
are materialized under `.odla-references/<alias>` and the broker rejects every
|
|
50
50
|
attempt to patch them. A checkpoint patch is computed against the selected
|
|
51
51
|
primary Git base, so local developer changes remain explicit provenance
|
|
52
|
-
alongside
|
|
52
|
+
alongside Theseus's changes.
|
|
53
53
|
|
|
54
54
|
On Apple Silicon with macOS 26, install Apple's lightweight runtime once with
|
|
55
55
|
`brew install container`; `code connect` selects it and starts its user service.
|
|
56
56
|
On Linux, auto requires rootless Podman. Podman Machine is the macOS fallback;
|
|
57
57
|
Docker is an explicit compatibility adapter only. Recipe images must be
|
|
58
|
-
digest-pinned; the
|
|
59
|
-
and requires no registry credential. All adapters run
|
|
60
|
-
non-root with bounded CPU/memory;
|
|
58
|
+
digest-pinned; the Theseus adapter's local tag contains the SHA-256 of its CLI bundle
|
|
59
|
+
and requires no registry credential. All adapters run Theseus networkless and
|
|
60
|
+
non-root with bounded CPU/memory; Theseus has no
|
|
61
61
|
checkout or engine-socket mount.
|
|
62
62
|
|
|
63
63
|
## Experimental task runner
|
|
64
64
|
|
|
65
|
-
The older generic task queue is separate from the personal
|
|
65
|
+
The older generic task queue is separate from the personal Theseus terminal flow.
|
|
66
66
|
It lives under **Code → Task runners · advanced**. To exercise it, register a
|
|
67
67
|
workspace and keep its runner token outside shell history:
|
|
68
68
|
|
|
@@ -93,7 +93,7 @@ new copy.
|
|
|
93
93
|
## Build recipes
|
|
94
94
|
|
|
95
95
|
The Code terminal advertises a closed recipe catalog. The content-addressed,
|
|
96
|
-
CLI-embedded
|
|
96
|
+
CLI-embedded Theseus adapter and every registry-digest-pinned recipe are prepared
|
|
97
97
|
before approval:
|
|
98
98
|
|
|
99
99
|
~~~json
|
|
@@ -111,7 +111,7 @@ before approval:
|
|
|
111
111
|
|
|
112
112
|
The runtime validates HTTPS, never places its credential in a request body,
|
|
113
113
|
never opens a listener, and rejects malformed or cross-host binding responses.
|
|
114
|
-
|
|
114
|
+
Theseus reads, patches, and runs only registered build recipes through the typed
|
|
115
115
|
CaMeL broker. Checkpoint-stop captures a bounded combined patch; resume verifies
|
|
116
116
|
it against the same selected Git base and exact local source descriptor.
|
|
117
117
|
|
|
@@ -128,7 +128,7 @@ attempt.cancel, and attempt.complete.
|
|
|
128
128
|
|
|
129
129
|
## CaMeL tool and build boundary
|
|
130
130
|
|
|
131
|
-
`createCodeToolBroker` is the trusted implementation for the three
|
|
131
|
+
`createCodeToolBroker` is the trusted implementation for the three Theseus tools:
|
|
132
132
|
registered staged-file reads, confined unified patches, and app-registered
|
|
133
133
|
build recipes. Each request is labelled and evaluated by @odla-ai/camel before
|
|
134
134
|
an effect. Patch data remains Prompt-Unsafe payload; file and recipe selectors
|
|
@@ -882,7 +882,7 @@ var CodeRuntimeCheckpointManager = class {
|
|
|
882
882
|
await this.options.event(command, { type: "message", actor: "system", body: prepared.note }, active.conversationRefs).catch(() => void 0);
|
|
883
883
|
await active.workspace.cleanup();
|
|
884
884
|
await this.options.event(command, { type: "status", status: "checkpointed" }, active.conversationRefs).catch(() => void 0);
|
|
885
|
-
return { status: "checkpointed", checkpoint: prepared.checkpoint, message: "
|
|
885
|
+
return { status: "checkpointed", checkpoint: prepared.checkpoint, message: "Theseus stopped at a portable checkpoint" };
|
|
886
886
|
}
|
|
887
887
|
async acknowledged(command, result) {
|
|
888
888
|
if (command.kind !== "checkpoint_stop" || result.status !== "checkpointed") return false;
|
|
@@ -1118,7 +1118,7 @@ async function materializeCommandWorkspace(input) {
|
|
|
1118
1118
|
}
|
|
1119
1119
|
|
|
1120
1120
|
// src/code-agent-skill.ts
|
|
1121
|
-
var V1_SYSTEM_PROMPT = `You are
|
|
1121
|
+
var V1_SYSTEM_PROMPT = `You are Theseus, the coding agent inside an odla Code harness.
|
|
1122
1122
|
Use only the odla_read, odla_apply_git_diff, and odla_run_recipe tools.
|
|
1123
1123
|
For mutations, call odla_apply_git_diff with raw git diff text. It must start
|
|
1124
1124
|
with "diff --git a/<path> b/<path>", include matching "---" and "+++" file
|
|
@@ -1201,11 +1201,17 @@ function codeSkill(opts) {
|
|
|
1201
1201
|
};
|
|
1202
1202
|
const runRecipe = {
|
|
1203
1203
|
name: "odla_run_recipe",
|
|
1204
|
-
description:
|
|
1204
|
+
description: `Run one app-registered build or test recipe through CaMeL policy.${opts.recipeIds?.length ? ` Available recipes: ${opts.recipeIds.join(", ")}.` : ""}`,
|
|
1205
1205
|
inputSchema: {
|
|
1206
1206
|
type: "object",
|
|
1207
1207
|
required: ["recipeId"],
|
|
1208
|
-
properties: { recipeId: {
|
|
1208
|
+
properties: { recipeId: {
|
|
1209
|
+
type: "string",
|
|
1210
|
+
minLength: 1,
|
|
1211
|
+
maxLength: 120,
|
|
1212
|
+
pattern: "^[a-zA-Z0-9._:-]+$",
|
|
1213
|
+
...opts.recipeIds?.length ? { enum: [...opts.recipeIds] } : {}
|
|
1214
|
+
} },
|
|
1209
1215
|
additionalProperties: false
|
|
1210
1216
|
},
|
|
1211
1217
|
handler: (input, ctx) => call("sandbox.run_recipe", input, ctx.signal)
|
|
@@ -1293,6 +1299,7 @@ async function runCodeAgent(options) {
|
|
|
1293
1299
|
lease: options.lease,
|
|
1294
1300
|
workspaceDir: options.workspaceDir,
|
|
1295
1301
|
surface,
|
|
1302
|
+
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
1296
1303
|
onToolCall: (call) => {
|
|
1297
1304
|
toolCalls.push(call);
|
|
1298
1305
|
options.onToolCall?.(call);
|
|
@@ -1324,7 +1331,7 @@ async function runCodeAgent(options) {
|
|
|
1324
1331
|
import { extractText } from "@odla-ai/ai";
|
|
1325
1332
|
async function runCodeAgentAttempt(options) {
|
|
1326
1333
|
try {
|
|
1327
|
-
const surface = options.surface ?? "
|
|
1334
|
+
const surface = options.surface ?? "v3";
|
|
1328
1335
|
const { run } = await runCodeAgent({
|
|
1329
1336
|
inference: options.inference,
|
|
1330
1337
|
broker: options.broker,
|
|
@@ -1335,6 +1342,7 @@ async function runCodeAgentAttempt(options) {
|
|
|
1335
1342
|
// id only labels the request the control plane is about to rewrite.
|
|
1336
1343
|
model: "brokered",
|
|
1337
1344
|
surface,
|
|
1345
|
+
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
1338
1346
|
...options.maxSteps === void 0 ? {} : { maxSteps: options.maxSteps },
|
|
1339
1347
|
...options.budget ? { budget: options.budget } : {},
|
|
1340
1348
|
...options.signal ? { signal: options.signal } : {},
|
|
@@ -2349,7 +2357,7 @@ var digestRuntimeValue = (value) => `sha256:${createHash3("sha256").update(value
|
|
|
2349
2357
|
var runtimeErrorMessage = (value) => value instanceof Error ? value.message : String(value);
|
|
2350
2358
|
|
|
2351
2359
|
// src/code-runtime-engine.ts
|
|
2352
|
-
var
|
|
2360
|
+
var TheseusRuntimeEngine = class {
|
|
2353
2361
|
constructor(options) {
|
|
2354
2362
|
this.options = options;
|
|
2355
2363
|
this.#attempt = options.runAgentAttempt ?? runCodeAgentAttempt;
|
|
@@ -2435,7 +2443,7 @@ var CodePiRuntimeEngine = class {
|
|
|
2435
2443
|
await this.#failure(command, active, detail);
|
|
2436
2444
|
return null;
|
|
2437
2445
|
});
|
|
2438
|
-
return { status: "running", message: resume ? "
|
|
2446
|
+
return { status: "running", message: resume ? "Theseus resumed from a portable checkpoint" : "Theseus started" };
|
|
2439
2447
|
}
|
|
2440
2448
|
/**
|
|
2441
2449
|
* Pursue a goal: attempt, judge with the clean verifier, re-prompt from what
|
|
@@ -2523,7 +2531,7 @@ var CodePiRuntimeEngine = class {
|
|
|
2523
2531
|
await this.#failure(command, active, detail);
|
|
2524
2532
|
return null;
|
|
2525
2533
|
});
|
|
2526
|
-
return { status: "running", message: "
|
|
2534
|
+
return { status: "running", message: "Theseus accepted the owner prompt" };
|
|
2527
2535
|
}
|
|
2528
2536
|
async #runAttempt(command, metadata, active) {
|
|
2529
2537
|
const lease = fakeCodeLease(command, metadata);
|
|
@@ -2548,7 +2556,8 @@ var CodePiRuntimeEngine = class {
|
|
|
2548
2556
|
lease,
|
|
2549
2557
|
workspaceDir: active.workspace.workspaceDir,
|
|
2550
2558
|
prompt: metadata.prompt,
|
|
2551
|
-
signal: active.abort.signal
|
|
2559
|
+
signal: active.abort.signal,
|
|
2560
|
+
recipeIds: this.options.recipes.map((recipe2) => recipe2.id)
|
|
2552
2561
|
});
|
|
2553
2562
|
const closing = result.finalText.trim();
|
|
2554
2563
|
const completed = result.status === "completed" && Boolean(closing);
|
|
@@ -2612,7 +2621,7 @@ var CodePiRuntimeEngine = class {
|
|
|
2612
2621
|
}
|
|
2613
2622
|
}
|
|
2614
2623
|
async #diagnostic(command, active, value) {
|
|
2615
|
-
const detail = value.trim().slice(0, 2e3) || "
|
|
2624
|
+
const detail = value.trim().slice(0, 2e3) || "Theseus runtime failed";
|
|
2616
2625
|
this.options.onDiagnostic?.(detail);
|
|
2617
2626
|
await this.#event(
|
|
2618
2627
|
command,
|
|
@@ -2666,6 +2675,6 @@ export {
|
|
|
2666
2675
|
renderMemories,
|
|
2667
2676
|
hazardFromAttempt,
|
|
2668
2677
|
runGoal,
|
|
2669
|
-
|
|
2678
|
+
TheseusRuntimeEngine
|
|
2670
2679
|
};
|
|
2671
|
-
//# sourceMappingURL=chunk-
|
|
2680
|
+
//# sourceMappingURL=chunk-QZXCQSPZ.js.map
|