@odla-ai/harness 0.10.2 → 0.10.4
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/{chunk-VIZALA6O.js → chunk-IV3VMKDV.js} +18 -6
- package/dist/chunk-IV3VMKDV.js.map +1 -0
- package/dist/code-runtime-cli.cjs +16 -5
- package/dist/code-runtime-cli.cjs.map +1 -1
- package/dist/code-runtime-cli.js +1 -1
- package/dist/node.cjs +18 -5
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +22 -1
- package/dist/node.d.ts +22 -1
- package/dist/node.js +3 -1
- package/dist/node.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-VIZALA6O.js.map +0 -1
package/dist/code-runtime-cli.js
CHANGED
package/dist/node.cjs
CHANGED
|
@@ -66,6 +66,7 @@ __export(node_exports, {
|
|
|
66
66
|
planReachCollisions: () => planReachCollisions,
|
|
67
67
|
prepareRuntimeCheckpoint: () => prepareRuntimeCheckpoint,
|
|
68
68
|
racedAttempt: () => racedAttempt,
|
|
69
|
+
readOnlyNotice: () => readOnlyNotice,
|
|
69
70
|
recallAbout: () => recallAbout,
|
|
70
71
|
registeredFiles: () => registeredFiles,
|
|
71
72
|
renderMemories: () => renderMemories,
|
|
@@ -2824,12 +2825,17 @@ function codeSkill(opts) {
|
|
|
2824
2825
|
true
|
|
2825
2826
|
)
|
|
2826
2827
|
];
|
|
2827
|
-
const
|
|
2828
|
+
const runsRecipes = opts.recipes ?? !opts.readOnly;
|
|
2829
|
+
const effects = [...opts.readOnly ? [] : [applyPatch], ...runsRecipes ? [runRecipe] : []];
|
|
2828
2830
|
const tools = opts.surface === "v3" ? [...orientation, searchFiles, read2, ...opts.readOnly ? [] : [editFile], ...effects] : opts.surface === "v2" ? [listFiles, searchFiles, read2, ...effects] : [read2, ...effects];
|
|
2829
2831
|
return { name: "code", tools };
|
|
2830
2832
|
}
|
|
2831
2833
|
|
|
2832
2834
|
// src/code-agent.ts
|
|
2835
|
+
function readOnlyNotice(readOnly, recipes) {
|
|
2836
|
+
if (!readOnly) return "";
|
|
2837
|
+
return recipes ? "\n\nThis session is read-only: inspect and report; repository mutation is intentionally unavailable. The registered proof recipes are available through odla_run_recipe and must be run before any verdict." : "\n\nThis session is read-only. Inspect and report; repository mutation and recipe execution are intentionally unavailable.";
|
|
2838
|
+
}
|
|
2833
2839
|
async function runCodeAgent(options) {
|
|
2834
2840
|
const toolCalls = [];
|
|
2835
2841
|
const surface = options.surface ?? "v1";
|
|
@@ -2839,6 +2845,7 @@ async function runCodeAgent(options) {
|
|
|
2839
2845
|
workspaceDir: options.workspaceDir,
|
|
2840
2846
|
surface,
|
|
2841
2847
|
...options.readOnly === void 0 ? {} : { readOnly: options.readOnly },
|
|
2848
|
+
...options.recipes === void 0 ? {} : { recipes: options.recipes },
|
|
2842
2849
|
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
2843
2850
|
onToolCall: (call) => {
|
|
2844
2851
|
toolCalls.push(call);
|
|
@@ -2851,7 +2858,7 @@ async function runCodeAgent(options) {
|
|
|
2851
2858
|
{
|
|
2852
2859
|
name: "odla-code",
|
|
2853
2860
|
model: options.model,
|
|
2854
|
-
system: options.system ?? `${SYSTEM_PROMPT_FOR[surface]}${options.readOnly
|
|
2861
|
+
system: options.system ?? `${SYSTEM_PROMPT_FOR[surface]}${readOnlyNotice(options.readOnly, options.recipes)}`,
|
|
2855
2862
|
skills: [skill, ...options.extraSkills ?? []],
|
|
2856
2863
|
maxSteps: options.maxSteps ?? 24,
|
|
2857
2864
|
maxTokens: options.maxTokens ?? 16384
|
|
@@ -2882,6 +2889,7 @@ async function runCodeAgentAttempt(options) {
|
|
|
2882
2889
|
model: "brokered",
|
|
2883
2890
|
surface,
|
|
2884
2891
|
...options.readOnly === void 0 ? {} : { readOnly: options.readOnly },
|
|
2892
|
+
...options.recipes === void 0 ? {} : { recipes: options.recipes },
|
|
2885
2893
|
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
2886
2894
|
...options.extraSkills ? { extraSkills: options.extraSkills } : {},
|
|
2887
2895
|
...options.maxSteps === void 0 ? {} : { maxSteps: options.maxSteps },
|
|
@@ -4003,16 +4011,17 @@ function createCodeRuntimeToolBroker(input, lease, role) {
|
|
|
4003
4011
|
readerId: `code-session:${lease.task.taskId}`,
|
|
4004
4012
|
readOnlyPrefixes: [".odla-references"]
|
|
4005
4013
|
});
|
|
4006
|
-
const
|
|
4014
|
+
const reviewTools = /* @__PURE__ */ new Set([
|
|
4007
4015
|
"sandbox.read",
|
|
4008
4016
|
"sandbox.list",
|
|
4009
4017
|
"sandbox.search",
|
|
4010
4018
|
"sandbox.overview",
|
|
4011
4019
|
"sandbox.where_is",
|
|
4012
4020
|
"sandbox.who_imports",
|
|
4013
|
-
"sandbox.who_touches"
|
|
4021
|
+
"sandbox.who_touches",
|
|
4022
|
+
"sandbox.run_recipe"
|
|
4014
4023
|
]);
|
|
4015
|
-
return role === "coding" ? broker : { execute: (context, request) =>
|
|
4024
|
+
return role === "coding" ? broker : { execute: (context, request) => reviewTools.has(request.tool) ? broker.execute(context, request) : Promise.resolve({ requestId: request.requestId, ok: false, content: "review sessions are read-only" }) };
|
|
4016
4025
|
}
|
|
4017
4026
|
|
|
4018
4027
|
// src/code-memory.ts
|
|
@@ -4621,6 +4630,9 @@ var TheseusRuntimeEngine = class {
|
|
|
4621
4630
|
prompt: metadata.prompt,
|
|
4622
4631
|
signal: active.abort.signal,
|
|
4623
4632
|
readOnly: metadata.readOnly,
|
|
4633
|
+
// A review-role session is read-only and still runs the proof; a planner
|
|
4634
|
+
// marked read-only by its payload runs nothing.
|
|
4635
|
+
recipes: metadata.role === "review" || !metadata.readOnly,
|
|
4624
4636
|
recipeIds: this.options.recipes.map((recipe2) => recipe2.id),
|
|
4625
4637
|
...extraSkills.length ? { extraSkills } : {}
|
|
4626
4638
|
});
|
|
@@ -5033,6 +5045,7 @@ async function installedDependencies(repoRoot) {
|
|
|
5033
5045
|
planReachCollisions,
|
|
5034
5046
|
prepareRuntimeCheckpoint,
|
|
5035
5047
|
racedAttempt,
|
|
5048
|
+
readOnlyNotice,
|
|
5036
5049
|
recallAbout,
|
|
5037
5050
|
registeredFiles,
|
|
5038
5051
|
renderMemories,
|