@workbench-ai/workbench-built-in-adapters 0.0.50 → 0.0.52
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/execute.js +21 -8
- package/package.json +4 -4
package/dist/execute.js
CHANGED
|
@@ -101,7 +101,7 @@ async function executeWorkbenchEngineResolveRequest(request) {
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
async function executeWorkbenchEngineRunRequest(request) {
|
|
104
|
-
const outcome = workbenchEngineGradingIsolation(request) === "separate"
|
|
104
|
+
const outcome = await workbenchEngineGradingIsolation(request) === "separate"
|
|
105
105
|
? await runWorkbenchEngineSeparateGrading(request)
|
|
106
106
|
: await runWorkbenchEngineSharedGrading(request);
|
|
107
107
|
if (!outcome.result) {
|
|
@@ -176,16 +176,25 @@ function workbenchEngineCandidateInvocation(request) {
|
|
|
176
176
|
command: candidate.command,
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
function workbenchEngineGradingIsolation(request) {
|
|
179
|
+
async function workbenchEngineGradingIsolation(request) {
|
|
180
180
|
const grading = jsonRecord(adapterCommandConfigRecord(request).grading);
|
|
181
181
|
const isolation = grading?.isolation;
|
|
182
|
-
if (isolation
|
|
183
|
-
|
|
182
|
+
if (isolation !== undefined &&
|
|
183
|
+
isolation !== "shared" &&
|
|
184
|
+
isolation !== "separate") {
|
|
185
|
+
throw new Error("Workbench engine grading.isolation must be shared or separate.");
|
|
184
186
|
}
|
|
185
|
-
if (
|
|
186
|
-
return
|
|
187
|
+
if (await workbenchEnginePrivateFilesPresent(request)) {
|
|
188
|
+
return "separate";
|
|
187
189
|
}
|
|
188
|
-
|
|
190
|
+
return isolation ?? "shared";
|
|
191
|
+
}
|
|
192
|
+
async function workbenchEnginePrivateFilesPresent(request) {
|
|
193
|
+
if (!request.paths.enginePrivate) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
const files = await readOptionalSurfaceFiles(request.paths.enginePrivate);
|
|
197
|
+
return files.length > 0;
|
|
189
198
|
}
|
|
190
199
|
async function runWorkbenchEngineSharedGrading(request) {
|
|
191
200
|
const inputs = await workbenchEngineRuntimeInputs(request);
|
|
@@ -504,10 +513,13 @@ async function readWorkbenchEngineCase(args) {
|
|
|
504
513
|
throw new Error(`Task ${args.id} ${TASK_CONTROL_FILE} must include a task string.`);
|
|
505
514
|
}
|
|
506
515
|
const unsupportedTaskFields = Object.keys(taskRecord)
|
|
507
|
-
.filter((key) => !["version", "task", "files", "tests", "solution", "environment"].includes(key));
|
|
516
|
+
.filter((key) => !["version", "task", "split", "files", "tests", "solution", "environment"].includes(key));
|
|
508
517
|
if (unsupportedTaskFields.length > 0) {
|
|
509
518
|
throw new Error(`Task ${args.id} ${TASK_CONTROL_FILE} has unsupported field${unsupportedTaskFields.length === 1 ? "" : "s"}: ${unsupportedTaskFields.join(", ")}.`);
|
|
510
519
|
}
|
|
520
|
+
if (taskRecord.split !== undefined && (typeof taskRecord.split !== "string" || taskRecord.split.trim().length === 0)) {
|
|
521
|
+
throw new Error(`Task ${args.id} ${TASK_CONTROL_FILE} split must be a non-empty string when provided.`);
|
|
522
|
+
}
|
|
511
523
|
const publicPrefix = taskDirectoryPrefix(taskRecord.files, "files", args.id);
|
|
512
524
|
const testsPrefix = taskDirectoryPrefix(taskRecord.tests, "tests", args.id);
|
|
513
525
|
const solutionPrefix = taskDirectoryPrefix(taskRecord.solution, "solution", args.id);
|
|
@@ -527,6 +539,7 @@ async function readWorkbenchEngineCase(args) {
|
|
|
527
539
|
case: {
|
|
528
540
|
version: 3,
|
|
529
541
|
prompt: taskRecord.task,
|
|
542
|
+
...(typeof taskRecord.split === "string" ? { split: taskRecord.split.trim() } : {}),
|
|
530
543
|
...(taskRecord.environment !== undefined
|
|
531
544
|
? { environment: taskRecord.environment }
|
|
532
545
|
: {}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workbench-ai/workbench-built-in-adapters",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.52",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"yaml": "^2.8.2",
|
|
35
35
|
"@workbench-ai/agent-driver-anthropic-claude-code": "0.0.45",
|
|
36
36
|
"@workbench-ai/agent-driver-openai-codex": "0.0.45",
|
|
37
|
+
"@workbench-ai/workbench-contract": "0.0.52",
|
|
38
|
+
"@workbench-ai/workbench-core": "0.0.52",
|
|
37
39
|
"@workbench-ai/agent-driver": "0.0.45",
|
|
38
|
-
"@workbench-ai/workbench-
|
|
39
|
-
"@workbench-ai/workbench-protocol": "0.0.50",
|
|
40
|
-
"@workbench-ai/workbench-core": "0.0.50"
|
|
40
|
+
"@workbench-ai/workbench-protocol": "0.0.52"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^24.3.1",
|