@odla-ai/harness 0.5.2 → 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-5HX5LWTG.js → chunk-QZXCQSPZ.js} +27 -13
- package/dist/chunk-QZXCQSPZ.js.map +1 -0
- package/dist/code-runtime-cli.cjs +27 -13
- 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 +27 -13
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +23 -12
- package/dist/node.d.ts +23 -12
- package/dist/node.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-5HX5LWTG.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
|
|
@@ -1165,7 +1165,12 @@ function codeSkill(opts) {
|
|
|
1165
1165
|
{ lease: opts.lease, workspaceDir: opts.workspaceDir, signal },
|
|
1166
1166
|
{ requestId: `bench-${tool}-${++seq}`, tool, input }
|
|
1167
1167
|
);
|
|
1168
|
-
opts.onToolCall?.({
|
|
1168
|
+
opts.onToolCall?.({
|
|
1169
|
+
tool,
|
|
1170
|
+
ok: response2.ok,
|
|
1171
|
+
durationMs: Date.now() - startedAt,
|
|
1172
|
+
...response2.ok ? {} : { error: String(response2.content).slice(0, 300) }
|
|
1173
|
+
});
|
|
1169
1174
|
return { content: response2.content, isError: !response2.ok };
|
|
1170
1175
|
};
|
|
1171
1176
|
const read2 = {
|
|
@@ -1196,11 +1201,17 @@ function codeSkill(opts) {
|
|
|
1196
1201
|
};
|
|
1197
1202
|
const runRecipe = {
|
|
1198
1203
|
name: "odla_run_recipe",
|
|
1199
|
-
description:
|
|
1204
|
+
description: `Run one app-registered build or test recipe through CaMeL policy.${opts.recipeIds?.length ? ` Available recipes: ${opts.recipeIds.join(", ")}.` : ""}`,
|
|
1200
1205
|
inputSchema: {
|
|
1201
1206
|
type: "object",
|
|
1202
1207
|
required: ["recipeId"],
|
|
1203
|
-
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
|
+
} },
|
|
1204
1215
|
additionalProperties: false
|
|
1205
1216
|
},
|
|
1206
1217
|
handler: (input, ctx) => call("sandbox.run_recipe", input, ctx.signal)
|
|
@@ -1288,6 +1299,7 @@ async function runCodeAgent(options) {
|
|
|
1288
1299
|
lease: options.lease,
|
|
1289
1300
|
workspaceDir: options.workspaceDir,
|
|
1290
1301
|
surface,
|
|
1302
|
+
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
1291
1303
|
onToolCall: (call) => {
|
|
1292
1304
|
toolCalls.push(call);
|
|
1293
1305
|
options.onToolCall?.(call);
|
|
@@ -1319,7 +1331,7 @@ async function runCodeAgent(options) {
|
|
|
1319
1331
|
import { extractText } from "@odla-ai/ai";
|
|
1320
1332
|
async function runCodeAgentAttempt(options) {
|
|
1321
1333
|
try {
|
|
1322
|
-
const surface = options.surface ?? "
|
|
1334
|
+
const surface = options.surface ?? "v3";
|
|
1323
1335
|
const { run } = await runCodeAgent({
|
|
1324
1336
|
inference: options.inference,
|
|
1325
1337
|
broker: options.broker,
|
|
@@ -1330,6 +1342,7 @@ async function runCodeAgentAttempt(options) {
|
|
|
1330
1342
|
// id only labels the request the control plane is about to rewrite.
|
|
1331
1343
|
model: "brokered",
|
|
1332
1344
|
surface,
|
|
1345
|
+
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
1333
1346
|
...options.maxSteps === void 0 ? {} : { maxSteps: options.maxSteps },
|
|
1334
1347
|
...options.budget ? { budget: options.budget } : {},
|
|
1335
1348
|
...options.signal ? { signal: options.signal } : {},
|
|
@@ -2344,7 +2357,7 @@ var digestRuntimeValue = (value) => `sha256:${createHash3("sha256").update(value
|
|
|
2344
2357
|
var runtimeErrorMessage = (value) => value instanceof Error ? value.message : String(value);
|
|
2345
2358
|
|
|
2346
2359
|
// src/code-runtime-engine.ts
|
|
2347
|
-
var
|
|
2360
|
+
var TheseusRuntimeEngine = class {
|
|
2348
2361
|
constructor(options) {
|
|
2349
2362
|
this.options = options;
|
|
2350
2363
|
this.#attempt = options.runAgentAttempt ?? runCodeAgentAttempt;
|
|
@@ -2430,7 +2443,7 @@ var CodePiRuntimeEngine = class {
|
|
|
2430
2443
|
await this.#failure(command, active, detail);
|
|
2431
2444
|
return null;
|
|
2432
2445
|
});
|
|
2433
|
-
return { status: "running", message: resume ? "
|
|
2446
|
+
return { status: "running", message: resume ? "Theseus resumed from a portable checkpoint" : "Theseus started" };
|
|
2434
2447
|
}
|
|
2435
2448
|
/**
|
|
2436
2449
|
* Pursue a goal: attempt, judge with the clean verifier, re-prompt from what
|
|
@@ -2518,7 +2531,7 @@ var CodePiRuntimeEngine = class {
|
|
|
2518
2531
|
await this.#failure(command, active, detail);
|
|
2519
2532
|
return null;
|
|
2520
2533
|
});
|
|
2521
|
-
return { status: "running", message: "
|
|
2534
|
+
return { status: "running", message: "Theseus accepted the owner prompt" };
|
|
2522
2535
|
}
|
|
2523
2536
|
async #runAttempt(command, metadata, active) {
|
|
2524
2537
|
const lease = fakeCodeLease(command, metadata);
|
|
@@ -2543,7 +2556,8 @@ var CodePiRuntimeEngine = class {
|
|
|
2543
2556
|
lease,
|
|
2544
2557
|
workspaceDir: active.workspace.workspaceDir,
|
|
2545
2558
|
prompt: metadata.prompt,
|
|
2546
|
-
signal: active.abort.signal
|
|
2559
|
+
signal: active.abort.signal,
|
|
2560
|
+
recipeIds: this.options.recipes.map((recipe2) => recipe2.id)
|
|
2547
2561
|
});
|
|
2548
2562
|
const closing = result.finalText.trim();
|
|
2549
2563
|
const completed = result.status === "completed" && Boolean(closing);
|
|
@@ -2607,7 +2621,7 @@ var CodePiRuntimeEngine = class {
|
|
|
2607
2621
|
}
|
|
2608
2622
|
}
|
|
2609
2623
|
async #diagnostic(command, active, value) {
|
|
2610
|
-
const detail = value.trim().slice(0, 2e3) || "
|
|
2624
|
+
const detail = value.trim().slice(0, 2e3) || "Theseus runtime failed";
|
|
2611
2625
|
this.options.onDiagnostic?.(detail);
|
|
2612
2626
|
await this.#event(
|
|
2613
2627
|
command,
|
|
@@ -2661,6 +2675,6 @@ export {
|
|
|
2661
2675
|
renderMemories,
|
|
2662
2676
|
hazardFromAttempt,
|
|
2663
2677
|
runGoal,
|
|
2664
|
-
|
|
2678
|
+
TheseusRuntimeEngine
|
|
2665
2679
|
};
|
|
2666
|
-
//# sourceMappingURL=chunk-
|
|
2680
|
+
//# sourceMappingURL=chunk-QZXCQSPZ.js.map
|