@odla-ai/harness 0.10.3 → 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.
@@ -2244,6 +2244,10 @@ function codeSkill(opts) {
2244
2244
  }
2245
2245
 
2246
2246
  // src/code-agent.ts
2247
+ function readOnlyNotice(readOnly, recipes) {
2248
+ if (!readOnly) return "";
2249
+ 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.";
2250
+ }
2247
2251
  async function runCodeAgent(options) {
2248
2252
  const toolCalls = [];
2249
2253
  const surface = options.surface ?? "v1";
@@ -2253,6 +2257,7 @@ async function runCodeAgent(options) {
2253
2257
  workspaceDir: options.workspaceDir,
2254
2258
  surface,
2255
2259
  ...options.readOnly === void 0 ? {} : { readOnly: options.readOnly },
2260
+ ...options.recipes === void 0 ? {} : { recipes: options.recipes },
2256
2261
  ...options.recipeIds ? { recipeIds: options.recipeIds } : {},
2257
2262
  onToolCall: (call) => {
2258
2263
  toolCalls.push(call);
@@ -2265,7 +2270,7 @@ async function runCodeAgent(options) {
2265
2270
  {
2266
2271
  name: "odla-code",
2267
2272
  model: options.model,
2268
- system: options.system ?? `${SYSTEM_PROMPT_FOR[surface]}${options.readOnly ? "\n\nThis session is read-only. Inspect and report; repository mutation and recipe execution are intentionally unavailable." : ""}`,
2273
+ system: options.system ?? `${SYSTEM_PROMPT_FOR[surface]}${readOnlyNotice(options.readOnly, options.recipes)}`,
2269
2274
  skills: [skill, ...options.extraSkills ?? []],
2270
2275
  maxSteps: options.maxSteps ?? 24,
2271
2276
  maxTokens: options.maxTokens ?? 16384
@@ -3418,16 +3423,17 @@ function createCodeRuntimeToolBroker(input, lease, role) {
3418
3423
  readerId: `code-session:${lease.task.taskId}`,
3419
3424
  readOnlyPrefixes: [".odla-references"]
3420
3425
  });
3421
- const reviewReads = /* @__PURE__ */ new Set([
3426
+ const reviewTools = /* @__PURE__ */ new Set([
3422
3427
  "sandbox.read",
3423
3428
  "sandbox.list",
3424
3429
  "sandbox.search",
3425
3430
  "sandbox.overview",
3426
3431
  "sandbox.where_is",
3427
3432
  "sandbox.who_imports",
3428
- "sandbox.who_touches"
3433
+ "sandbox.who_touches",
3434
+ "sandbox.run_recipe"
3429
3435
  ]);
3430
- return role === "coding" ? broker : { execute: (context, request) => reviewReads.has(request.tool) ? broker.execute(context, request) : Promise.resolve({ requestId: request.requestId, ok: false, content: "review sessions are read-only" }) };
3436
+ 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" }) };
3431
3437
  }
3432
3438
 
3433
3439
  // src/code-memory.ts