@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
|
@@ -1149,7 +1149,7 @@ var CodeRuntimeCheckpointManager = class {
|
|
|
1149
1149
|
await this.options.event(command, { type: "message", actor: "system", body: prepared.note }, active.conversationRefs).catch(() => void 0);
|
|
1150
1150
|
await active.workspace.cleanup();
|
|
1151
1151
|
await this.options.event(command, { type: "status", status: "checkpointed" }, active.conversationRefs).catch(() => void 0);
|
|
1152
|
-
return { status: "checkpointed", checkpoint: prepared.checkpoint, message: "
|
|
1152
|
+
return { status: "checkpointed", checkpoint: prepared.checkpoint, message: "Theseus stopped at a portable checkpoint" };
|
|
1153
1153
|
}
|
|
1154
1154
|
async acknowledged(command, result) {
|
|
1155
1155
|
if (command.kind !== "checkpoint_stop" || result.status !== "checkpointed") return false;
|
|
@@ -1391,7 +1391,7 @@ var import_ai2 = require("@odla-ai/ai");
|
|
|
1391
1391
|
var import_ai = require("@odla-ai/ai");
|
|
1392
1392
|
|
|
1393
1393
|
// src/code-agent-skill.ts
|
|
1394
|
-
var V1_SYSTEM_PROMPT = `You are
|
|
1394
|
+
var V1_SYSTEM_PROMPT = `You are Theseus, the coding agent inside an odla Code harness.
|
|
1395
1395
|
Use only the odla_read, odla_apply_git_diff, and odla_run_recipe tools.
|
|
1396
1396
|
For mutations, call odla_apply_git_diff with raw git diff text. It must start
|
|
1397
1397
|
with "diff --git a/<path> b/<path>", include matching "---" and "+++" file
|
|
@@ -1474,11 +1474,17 @@ function codeSkill(opts) {
|
|
|
1474
1474
|
};
|
|
1475
1475
|
const runRecipe = {
|
|
1476
1476
|
name: "odla_run_recipe",
|
|
1477
|
-
description:
|
|
1477
|
+
description: `Run one app-registered build or test recipe through CaMeL policy.${opts.recipeIds?.length ? ` Available recipes: ${opts.recipeIds.join(", ")}.` : ""}`,
|
|
1478
1478
|
inputSchema: {
|
|
1479
1479
|
type: "object",
|
|
1480
1480
|
required: ["recipeId"],
|
|
1481
|
-
properties: { recipeId: {
|
|
1481
|
+
properties: { recipeId: {
|
|
1482
|
+
type: "string",
|
|
1483
|
+
minLength: 1,
|
|
1484
|
+
maxLength: 120,
|
|
1485
|
+
pattern: "^[a-zA-Z0-9._:-]+$",
|
|
1486
|
+
...opts.recipeIds?.length ? { enum: [...opts.recipeIds] } : {}
|
|
1487
|
+
} },
|
|
1482
1488
|
additionalProperties: false
|
|
1483
1489
|
},
|
|
1484
1490
|
handler: (input, ctx) => call("sandbox.run_recipe", input, ctx.signal)
|
|
@@ -1562,6 +1568,7 @@ async function runCodeAgent(options) {
|
|
|
1562
1568
|
lease: options.lease,
|
|
1563
1569
|
workspaceDir: options.workspaceDir,
|
|
1564
1570
|
surface,
|
|
1571
|
+
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
1565
1572
|
onToolCall: (call) => {
|
|
1566
1573
|
toolCalls.push(call);
|
|
1567
1574
|
options.onToolCall?.(call);
|
|
@@ -1592,7 +1599,7 @@ async function runCodeAgent(options) {
|
|
|
1592
1599
|
// src/code-runtime-attempt.ts
|
|
1593
1600
|
async function runCodeAgentAttempt(options) {
|
|
1594
1601
|
try {
|
|
1595
|
-
const surface = options.surface ?? "
|
|
1602
|
+
const surface = options.surface ?? "v3";
|
|
1596
1603
|
const { run } = await runCodeAgent({
|
|
1597
1604
|
inference: options.inference,
|
|
1598
1605
|
broker: options.broker,
|
|
@@ -1603,6 +1610,7 @@ async function runCodeAgentAttempt(options) {
|
|
|
1603
1610
|
// id only labels the request the control plane is about to rewrite.
|
|
1604
1611
|
model: "brokered",
|
|
1605
1612
|
surface,
|
|
1613
|
+
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
1606
1614
|
...options.maxSteps === void 0 ? {} : { maxSteps: options.maxSteps },
|
|
1607
1615
|
...options.budget ? { budget: options.budget } : {},
|
|
1608
1616
|
...options.signal ? { signal: options.signal } : {},
|
|
@@ -2579,7 +2587,7 @@ var digestRuntimeValue = (value) => `sha256:${(0, import_node_crypto4.createHash
|
|
|
2579
2587
|
var runtimeErrorMessage = (value) => value instanceof Error ? value.message : String(value);
|
|
2580
2588
|
|
|
2581
2589
|
// src/code-runtime-engine.ts
|
|
2582
|
-
var
|
|
2590
|
+
var TheseusRuntimeEngine = class {
|
|
2583
2591
|
constructor(options) {
|
|
2584
2592
|
this.options = options;
|
|
2585
2593
|
this.#attempt = options.runAgentAttempt ?? runCodeAgentAttempt;
|
|
@@ -2665,7 +2673,7 @@ var CodePiRuntimeEngine = class {
|
|
|
2665
2673
|
await this.#failure(command, active, detail);
|
|
2666
2674
|
return null;
|
|
2667
2675
|
});
|
|
2668
|
-
return { status: "running", message: resume ? "
|
|
2676
|
+
return { status: "running", message: resume ? "Theseus resumed from a portable checkpoint" : "Theseus started" };
|
|
2669
2677
|
}
|
|
2670
2678
|
/**
|
|
2671
2679
|
* Pursue a goal: attempt, judge with the clean verifier, re-prompt from what
|
|
@@ -2753,7 +2761,7 @@ var CodePiRuntimeEngine = class {
|
|
|
2753
2761
|
await this.#failure(command, active, detail);
|
|
2754
2762
|
return null;
|
|
2755
2763
|
});
|
|
2756
|
-
return { status: "running", message: "
|
|
2764
|
+
return { status: "running", message: "Theseus accepted the owner prompt" };
|
|
2757
2765
|
}
|
|
2758
2766
|
async #runAttempt(command, metadata, active) {
|
|
2759
2767
|
const lease = fakeCodeLease(command, metadata);
|
|
@@ -2778,7 +2786,8 @@ var CodePiRuntimeEngine = class {
|
|
|
2778
2786
|
lease,
|
|
2779
2787
|
workspaceDir: active.workspace.workspaceDir,
|
|
2780
2788
|
prompt: metadata.prompt,
|
|
2781
|
-
signal: active.abort.signal
|
|
2789
|
+
signal: active.abort.signal,
|
|
2790
|
+
recipeIds: this.options.recipes.map((recipe2) => recipe2.id)
|
|
2782
2791
|
});
|
|
2783
2792
|
const closing = result.finalText.trim();
|
|
2784
2793
|
const completed = result.status === "completed" && Boolean(closing);
|
|
@@ -2842,7 +2851,7 @@ var CodePiRuntimeEngine = class {
|
|
|
2842
2851
|
}
|
|
2843
2852
|
}
|
|
2844
2853
|
async #diagnostic(command, active, value) {
|
|
2845
|
-
const detail = value.trim().slice(0, 2e3) || "
|
|
2854
|
+
const detail = value.trim().slice(0, 2e3) || "Theseus runtime failed";
|
|
2846
2855
|
this.options.onDiagnostic?.(detail);
|
|
2847
2856
|
await this.#event(
|
|
2848
2857
|
command,
|
|
@@ -2924,8 +2933,8 @@ async function main() {
|
|
|
2924
2933
|
};
|
|
2925
2934
|
const controller = new AbortController();
|
|
2926
2935
|
for (const signal of ["SIGINT", "SIGTERM"]) process.once(signal, () => controller.abort(signal));
|
|
2927
|
-
const control = createCodeRuntimeControlClient({ endpoint: options.endpoint, token
|
|
2928
|
-
const commandEngine = new
|
|
2936
|
+
const control = createCodeRuntimeControlClient({ endpoint: options.endpoint, token });
|
|
2937
|
+
const commandEngine = new TheseusRuntimeEngine({
|
|
2929
2938
|
control,
|
|
2930
2939
|
engine,
|
|
2931
2940
|
recipes: policy.recipes,
|