@odla-ai/harness 0.9.3 → 0.9.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.
@@ -1489,7 +1489,8 @@ function codeSkill(opts) {
1489
1489
  true
1490
1490
  )
1491
1491
  ];
1492
- const tools = opts.surface === "v3" ? [...orientation, searchFiles, read2, applyPatch, runRecipe] : opts.surface === "v2" ? [listFiles, searchFiles, read2, applyPatch, runRecipe] : [read2, applyPatch, runRecipe];
1492
+ const effects = opts.readOnly ? [] : [applyPatch, runRecipe];
1493
+ const tools = opts.surface === "v3" ? [...orientation, searchFiles, read2, ...effects] : opts.surface === "v2" ? [listFiles, searchFiles, read2, ...effects] : [read2, ...effects];
1493
1494
  return { name: "code", tools };
1494
1495
  }
1495
1496
 
@@ -1506,6 +1507,7 @@ async function runCodeAgent(options) {
1506
1507
  lease: options.lease,
1507
1508
  workspaceDir: options.workspaceDir,
1508
1509
  surface,
1510
+ ...options.readOnly === void 0 ? {} : { readOnly: options.readOnly },
1509
1511
  ...options.recipeIds ? { recipeIds: options.recipeIds } : {},
1510
1512
  onToolCall: (call) => {
1511
1513
  toolCalls.push(call);
@@ -1518,7 +1520,7 @@ async function runCodeAgent(options) {
1518
1520
  {
1519
1521
  name: "odla-code",
1520
1522
  model: options.model,
1521
- system: options.system ?? SYSTEM_PROMPT_FOR[surface],
1523
+ 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." : ""}`,
1522
1524
  skills: [skill, ...options.extraSkills ?? []],
1523
1525
  maxSteps: options.maxSteps ?? 24,
1524
1526
  maxTokens: options.maxTokens ?? 16384
@@ -1549,6 +1551,7 @@ async function runCodeAgentAttempt(options) {
1549
1551
  // id only labels the request the control plane is about to rewrite.
1550
1552
  model: "brokered",
1551
1553
  surface,
1554
+ ...options.readOnly === void 0 ? {} : { readOnly: options.readOnly },
1552
1555
  ...options.recipeIds ? { recipeIds: options.recipeIds } : {},
1553
1556
  ...options.extraSkills ? { extraSkills: options.extraSkills } : {},
1554
1557
  ...options.maxSteps === void 0 ? {} : { maxSteps: options.maxSteps },
@@ -2573,7 +2576,16 @@ function createCodeRuntimeToolBroker(input, lease, role) {
2573
2576
  readerId: `code-session:${lease.task.taskId}`,
2574
2577
  readOnlyPrefixes: [".odla-references"]
2575
2578
  });
2576
- return role === "coding" ? broker : { execute: (context, request) => request.tool === "sandbox.read" ? broker.execute(context, request) : Promise.resolve({ requestId: request.requestId, ok: false, content: "review sessions are read-only" }) };
2579
+ const reviewReads = /* @__PURE__ */ new Set([
2580
+ "sandbox.read",
2581
+ "sandbox.list",
2582
+ "sandbox.search",
2583
+ "sandbox.overview",
2584
+ "sandbox.where_is",
2585
+ "sandbox.who_imports",
2586
+ "sandbox.who_touches"
2587
+ ]);
2588
+ 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" }) };
2577
2589
  }
2578
2590
 
2579
2591
  // src/code-runtime-goal.ts
@@ -3022,6 +3034,7 @@ var TheseusRuntimeEngine = class {
3022
3034
  workspaceDir: active.workspace.workspaceDir,
3023
3035
  prompt: metadata.prompt,
3024
3036
  signal: active.abort.signal,
3037
+ readOnly: metadata.role === "review",
3025
3038
  recipeIds: this.options.recipes.map((recipe2) => recipe2.id),
3026
3039
  ...extraSkills.length ? { extraSkills } : {}
3027
3040
  });
@@ -3133,4 +3146,4 @@ export {
3133
3146
  runGoal,
3134
3147
  TheseusRuntimeEngine
3135
3148
  };
3136
- //# sourceMappingURL=chunk-AEAISFY3.js.map
3149
+ //# sourceMappingURL=chunk-XSUUHWNX.js.map