@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.
- package/dist/{chunk-AEAISFY3.js → chunk-XSUUHWNX.js} +17 -4
- package/dist/chunk-XSUUHWNX.js.map +1 -0
- package/dist/code-runtime-cli.cjs +16 -3
- package/dist/code-runtime-cli.cjs.map +1 -1
- package/dist/code-runtime-cli.js +1 -1
- package/dist/node.cjs +16 -3
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +8 -0
- package/dist/node.d.ts +8 -0
- package/dist/node.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-AEAISFY3.js.map +0 -1
package/dist/code-runtime-cli.js
CHANGED
package/dist/node.cjs
CHANGED
|
@@ -2345,7 +2345,8 @@ function codeSkill(opts) {
|
|
|
2345
2345
|
true
|
|
2346
2346
|
)
|
|
2347
2347
|
];
|
|
2348
|
-
const
|
|
2348
|
+
const effects = opts.readOnly ? [] : [applyPatch, runRecipe];
|
|
2349
|
+
const tools = opts.surface === "v3" ? [...orientation, searchFiles, read2, ...effects] : opts.surface === "v2" ? [listFiles, searchFiles, read2, ...effects] : [read2, ...effects];
|
|
2349
2350
|
return { name: "code", tools };
|
|
2350
2351
|
}
|
|
2351
2352
|
|
|
@@ -2358,6 +2359,7 @@ async function runCodeAgent(options) {
|
|
|
2358
2359
|
lease: options.lease,
|
|
2359
2360
|
workspaceDir: options.workspaceDir,
|
|
2360
2361
|
surface,
|
|
2362
|
+
...options.readOnly === void 0 ? {} : { readOnly: options.readOnly },
|
|
2361
2363
|
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
2362
2364
|
onToolCall: (call) => {
|
|
2363
2365
|
toolCalls.push(call);
|
|
@@ -2370,7 +2372,7 @@ async function runCodeAgent(options) {
|
|
|
2370
2372
|
{
|
|
2371
2373
|
name: "odla-code",
|
|
2372
2374
|
model: options.model,
|
|
2373
|
-
system: options.system ?? SYSTEM_PROMPT_FOR[surface]
|
|
2375
|
+
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." : ""}`,
|
|
2374
2376
|
skills: [skill, ...options.extraSkills ?? []],
|
|
2375
2377
|
maxSteps: options.maxSteps ?? 24,
|
|
2376
2378
|
maxTokens: options.maxTokens ?? 16384
|
|
@@ -2400,6 +2402,7 @@ async function runCodeAgentAttempt(options) {
|
|
|
2400
2402
|
// id only labels the request the control plane is about to rewrite.
|
|
2401
2403
|
model: "brokered",
|
|
2402
2404
|
surface,
|
|
2405
|
+
...options.readOnly === void 0 ? {} : { readOnly: options.readOnly },
|
|
2403
2406
|
...options.recipeIds ? { recipeIds: options.recipeIds } : {},
|
|
2404
2407
|
...options.extraSkills ? { extraSkills: options.extraSkills } : {},
|
|
2405
2408
|
...options.maxSteps === void 0 ? {} : { maxSteps: options.maxSteps },
|
|
@@ -3417,7 +3420,16 @@ function createCodeRuntimeToolBroker(input, lease, role) {
|
|
|
3417
3420
|
readerId: `code-session:${lease.task.taskId}`,
|
|
3418
3421
|
readOnlyPrefixes: [".odla-references"]
|
|
3419
3422
|
});
|
|
3420
|
-
|
|
3423
|
+
const reviewReads = /* @__PURE__ */ new Set([
|
|
3424
|
+
"sandbox.read",
|
|
3425
|
+
"sandbox.list",
|
|
3426
|
+
"sandbox.search",
|
|
3427
|
+
"sandbox.overview",
|
|
3428
|
+
"sandbox.where_is",
|
|
3429
|
+
"sandbox.who_imports",
|
|
3430
|
+
"sandbox.who_touches"
|
|
3431
|
+
]);
|
|
3432
|
+
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" }) };
|
|
3421
3433
|
}
|
|
3422
3434
|
|
|
3423
3435
|
// src/code-memory.ts
|
|
@@ -4018,6 +4030,7 @@ var TheseusRuntimeEngine = class {
|
|
|
4018
4030
|
workspaceDir: active.workspace.workspaceDir,
|
|
4019
4031
|
prompt: metadata.prompt,
|
|
4020
4032
|
signal: active.abort.signal,
|
|
4033
|
+
readOnly: metadata.role === "review",
|
|
4021
4034
|
recipeIds: this.options.recipes.map((recipe2) => recipe2.id),
|
|
4022
4035
|
...extraSkills.length ? { extraSkills } : {}
|
|
4023
4036
|
});
|