@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
|
@@ -1967,7 +1967,8 @@ function codeSkill(opts) {
|
|
|
1967
1967
|
true
|
|
1968
1968
|
)
|
|
1969
1969
|
];
|
|
1970
|
-
const
|
|
1970
|
+
const runsRecipes = opts.recipes ?? !opts.readOnly;
|
|
1971
|
+
const effects = [...opts.readOnly ? [] : [applyPatch], ...runsRecipes ? [runRecipe] : []];
|
|
1971
1972
|
const tools = opts.surface === "v3" ? [...orientation, searchFiles, read2, ...opts.readOnly ? [] : [editFile], ...effects] : opts.surface === "v2" ? [listFiles, searchFiles, read2, ...effects] : [read2, ...effects];
|
|
1972
1973
|
return { name: "code", tools };
|
|
1973
1974
|
}
|
|
@@ -1977,6 +1978,10 @@ import {
|
|
|
1977
1978
|
keepRecentExchanges,
|
|
1978
1979
|
runAgent
|
|
1979
1980
|
} from "@odla-ai/ai";
|
|
1981
|
+
function readOnlyNotice(readOnly, recipes) {
|
|
1982
|
+
if (!readOnly) return "";
|
|
1983
|
+
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.";
|
|
1984
|
+
}
|
|
1980
1985
|
async function runCodeAgent(options) {
|
|
1981
1986
|
const toolCalls = [];
|
|
1982
1987
|
const surface = options.surface ?? "v1";
|
|
@@ -1986,6 +1991,7 @@ async function runCodeAgent(options) {
|
|
|
1986
1991
|
workspaceDir: options.workspaceDir,
|
|
1987
1992
|
surface,
|
|
1988
1993
|
...options.readOnly === void 0 ? {} : { readOnly: options.readOnly },
|
|
1994
|
+
...options.recipes === void 0 ? {} : { recipes: options.recipes },
|
|
1989
1995
|
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
1990
1996
|
onToolCall: (call) => {
|
|
1991
1997
|
toolCalls.push(call);
|
|
@@ -1998,7 +2004,7 @@ async function runCodeAgent(options) {
|
|
|
1998
2004
|
{
|
|
1999
2005
|
name: "odla-code",
|
|
2000
2006
|
model: options.model,
|
|
2001
|
-
system: options.system ?? `${SYSTEM_PROMPT_FOR[surface]}${options.readOnly
|
|
2007
|
+
system: options.system ?? `${SYSTEM_PROMPT_FOR[surface]}${readOnlyNotice(options.readOnly, options.recipes)}`,
|
|
2002
2008
|
skills: [skill, ...options.extraSkills ?? []],
|
|
2003
2009
|
maxSteps: options.maxSteps ?? 24,
|
|
2004
2010
|
maxTokens: options.maxTokens ?? 16384
|
|
@@ -2030,6 +2036,7 @@ async function runCodeAgentAttempt(options) {
|
|
|
2030
2036
|
model: "brokered",
|
|
2031
2037
|
surface,
|
|
2032
2038
|
...options.readOnly === void 0 ? {} : { readOnly: options.readOnly },
|
|
2039
|
+
...options.recipes === void 0 ? {} : { recipes: options.recipes },
|
|
2033
2040
|
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
2034
2041
|
...options.extraSkills ? { extraSkills: options.extraSkills } : {},
|
|
2035
2042
|
...options.maxSteps === void 0 ? {} : { maxSteps: options.maxSteps },
|
|
@@ -3152,16 +3159,17 @@ function createCodeRuntimeToolBroker(input, lease, role) {
|
|
|
3152
3159
|
readerId: `code-session:${lease.task.taskId}`,
|
|
3153
3160
|
readOnlyPrefixes: [".odla-references"]
|
|
3154
3161
|
});
|
|
3155
|
-
const
|
|
3162
|
+
const reviewTools = /* @__PURE__ */ new Set([
|
|
3156
3163
|
"sandbox.read",
|
|
3157
3164
|
"sandbox.list",
|
|
3158
3165
|
"sandbox.search",
|
|
3159
3166
|
"sandbox.overview",
|
|
3160
3167
|
"sandbox.where_is",
|
|
3161
3168
|
"sandbox.who_imports",
|
|
3162
|
-
"sandbox.who_touches"
|
|
3169
|
+
"sandbox.who_touches",
|
|
3170
|
+
"sandbox.run_recipe"
|
|
3163
3171
|
]);
|
|
3164
|
-
return role === "coding" ? broker : { execute: (context, request) =>
|
|
3172
|
+
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" }) };
|
|
3165
3173
|
}
|
|
3166
3174
|
|
|
3167
3175
|
// src/code-runtime-goal.ts
|
|
@@ -3618,6 +3626,9 @@ var TheseusRuntimeEngine = class {
|
|
|
3618
3626
|
prompt: metadata.prompt,
|
|
3619
3627
|
signal: active.abort.signal,
|
|
3620
3628
|
readOnly: metadata.readOnly,
|
|
3629
|
+
// A review-role session is read-only and still runs the proof; a planner
|
|
3630
|
+
// marked read-only by its payload runs nothing.
|
|
3631
|
+
recipes: metadata.role === "review" || !metadata.readOnly,
|
|
3621
3632
|
recipeIds: this.options.recipes.map((recipe2) => recipe2.id),
|
|
3622
3633
|
...extraSkills.length ? { extraSkills } : {}
|
|
3623
3634
|
});
|
|
@@ -3715,6 +3726,7 @@ export {
|
|
|
3715
3726
|
V3_SYSTEM_PROMPT,
|
|
3716
3727
|
SYSTEM_PROMPT_FOR,
|
|
3717
3728
|
codeSkill,
|
|
3729
|
+
readOnlyNotice,
|
|
3718
3730
|
runCodeAgent,
|
|
3719
3731
|
runCodeAgentAttempt,
|
|
3720
3732
|
createCodeRuntimeSessionSkillLoader,
|
|
@@ -3730,4 +3742,4 @@ export {
|
|
|
3730
3742
|
runGoal,
|
|
3731
3743
|
TheseusRuntimeEngine
|
|
3732
3744
|
};
|
|
3733
|
-
//# sourceMappingURL=chunk-
|
|
3745
|
+
//# sourceMappingURL=chunk-IV3VMKDV.js.map
|