@workbench-ai/workbench-built-in-adapters 0.0.131 → 0.0.133
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 +48 -1
- package/package.json +5 -5
package/dist/execute.js
CHANGED
|
@@ -708,6 +708,7 @@ async function writeAgentSkillOutput(request, workload, adapter, options = {}) {
|
|
|
708
708
|
if (request.operation !== "skill.run") {
|
|
709
709
|
throw new Error("Agent skill execution results can only complete skill.run operations.");
|
|
710
710
|
}
|
|
711
|
+
await sealProviderSkillRunWorkspace(request);
|
|
711
712
|
const traceRoot = path.join(request.paths.output, ".workbench", "internal", "agent-skill");
|
|
712
713
|
const agentResult = await executeBuiltInAgentTurn(options.agentExecutor, {
|
|
713
714
|
role: "runner",
|
|
@@ -740,7 +741,11 @@ async function writeAgentSkillOutput(request, workload, adapter, options = {}) {
|
|
|
740
741
|
metadata: agentResult.metadata,
|
|
741
742
|
}, null, 2)}\n`,
|
|
742
743
|
};
|
|
743
|
-
await writeSurfaceFiles(request.paths.output, [
|
|
744
|
+
await writeSurfaceFiles(request.paths.output, [
|
|
745
|
+
...agentSessionEvidenceFiles(workload.job.id, adapter.agent.use, agentResult.metadata),
|
|
746
|
+
trace,
|
|
747
|
+
...agentResult.traceFiles,
|
|
748
|
+
]);
|
|
744
749
|
const runtime = await importWorkbenchRuntime();
|
|
745
750
|
const usage = runtime.assignUsageRole("runner", agentResult.usage);
|
|
746
751
|
await writeWorkbenchAdapterOperationResult(request.paths.output, {
|
|
@@ -756,6 +761,47 @@ async function writeAgentSkillOutput(request, workload, adapter, options = {}) {
|
|
|
756
761
|
...(usage ? { usage } : {}),
|
|
757
762
|
});
|
|
758
763
|
}
|
|
764
|
+
async function sealProviderSkillRunWorkspace(request) {
|
|
765
|
+
await Promise.all([
|
|
766
|
+
fs.rm(path.join(request.paths.workspace, ".workbench"), { recursive: true, force: true }),
|
|
767
|
+
request.paths.enginePrivate
|
|
768
|
+
? fs.rm(request.paths.enginePrivate, { recursive: true, force: true })
|
|
769
|
+
: Promise.resolve(),
|
|
770
|
+
request.paths.traces
|
|
771
|
+
? fs.rm(request.paths.traces, { recursive: true, force: true })
|
|
772
|
+
: Promise.resolve(),
|
|
773
|
+
]);
|
|
774
|
+
}
|
|
775
|
+
function agentSessionEvidenceFiles(jobId, provider, metadata) {
|
|
776
|
+
const record = metadata && typeof metadata === "object" && !Array.isArray(metadata)
|
|
777
|
+
? metadata
|
|
778
|
+
: {};
|
|
779
|
+
const sessionId = typeof record.sessionId === "string" && record.sessionId.trim()
|
|
780
|
+
? record.sessionId.trim()
|
|
781
|
+
: undefined;
|
|
782
|
+
const providerId = typeof record.providerId === "string" && record.providerId.trim()
|
|
783
|
+
? record.providerId.trim()
|
|
784
|
+
: provider;
|
|
785
|
+
const model = typeof record.model === "string" && record.model.trim()
|
|
786
|
+
? record.model.trim()
|
|
787
|
+
: undefined;
|
|
788
|
+
if (!sessionId && !providerId && !model) {
|
|
789
|
+
return [];
|
|
790
|
+
}
|
|
791
|
+
return [
|
|
792
|
+
jsonSurfaceFile("agent-session.json", {
|
|
793
|
+
schema: "workbench.agent.session.v1",
|
|
794
|
+
jobId,
|
|
795
|
+
provider,
|
|
796
|
+
providerId,
|
|
797
|
+
...(model ? { model } : {}),
|
|
798
|
+
...(sessionId ? {
|
|
799
|
+
sessionId,
|
|
800
|
+
ref: `${provider}:${sessionId}`,
|
|
801
|
+
} : {}),
|
|
802
|
+
}),
|
|
803
|
+
];
|
|
804
|
+
}
|
|
759
805
|
function buildAgentSkillPrompt(workload, adapter) {
|
|
760
806
|
return [
|
|
761
807
|
...(adapter.instructions ? ["Instructions:", adapter.instructions, ""] : []),
|
|
@@ -937,6 +983,7 @@ async function writeRubricEvidenceFiles(args) {
|
|
|
937
983
|
...(args.usage ? { usage: args.usage } : {}),
|
|
938
984
|
};
|
|
939
985
|
await writeSurfaceFiles(args.request.paths.output, [
|
|
986
|
+
jsonSurfaceFile("rubric-scorecard.json", scorecard),
|
|
940
987
|
jsonSurfaceFile(`${root}/scorecard.json`, scorecard),
|
|
941
988
|
...args.criterionRuns.map((run) => jsonSurfaceFile(`${root}/criteria/${safeInternalPathSegment(run.result.criterion_id)}/result.json`, {
|
|
942
989
|
schema: "workbench.engine.rubric.criterion-evidence.v1",
|
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.133",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/workbench-ai/workbench.git",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"yaml": "^2.8.2",
|
|
35
35
|
"@workbench-ai/agent-driver-anthropic-claude-code": "0.0.49",
|
|
36
|
-
"@workbench-ai/agent-driver-openai-codex": "0.0.49",
|
|
37
|
-
"@workbench-ai/workbench-core": "0.0.131",
|
|
38
|
-
"@workbench-ai/workbench-protocol": "0.0.131",
|
|
39
36
|
"@workbench-ai/agent-driver": "0.0.49",
|
|
40
|
-
"@workbench-ai/workbench-contract": "0.0.
|
|
37
|
+
"@workbench-ai/workbench-contract": "0.0.133",
|
|
38
|
+
"@workbench-ai/workbench-protocol": "0.0.133",
|
|
39
|
+
"@workbench-ai/agent-driver-openai-codex": "0.0.49",
|
|
40
|
+
"@workbench-ai/workbench-core": "0.0.133"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^24.3.1",
|