@tangle-network/agent-runtime 0.85.0 → 0.86.0
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/agent.js +2 -2
- package/dist/{chunk-DLAEEF26.js → chunk-3TZOXS7B.js} +59 -40
- package/dist/chunk-3TZOXS7B.js.map +1 -0
- package/dist/{chunk-QSYPMMWS.js → chunk-EJ7MAQN4.js} +3 -3
- package/dist/{chunk-XN5TIJGP.js → chunk-F7OO2SKB.js} +22 -2
- package/dist/chunk-F7OO2SKB.js.map +1 -0
- package/dist/{chunk-G7HQI6DB.js → chunk-U4TS65XZ.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/loop-runner-bin.js +3 -3
- package/dist/loops.d.ts +60 -25
- package/dist/loops.js +2 -2
- package/dist/mcp/bin.js +1 -1
- package/dist/mcp/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-DLAEEF26.js.map +0 -1
- package/dist/chunk-XN5TIJGP.js.map +0 -1
- /package/dist/{chunk-QSYPMMWS.js.map → chunk-EJ7MAQN4.js.map} +0 -0
- /package/dist/{chunk-G7HQI6DB.js.map → chunk-U4TS65XZ.js.map} +0 -0
package/dist/agent.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
settledToIteration,
|
|
16
16
|
supervise,
|
|
17
17
|
withDriverExecutor
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-F7OO2SKB.js";
|
|
19
19
|
import {
|
|
20
20
|
addTokenUsage,
|
|
21
21
|
isAbortError,
|
|
@@ -977,49 +977,68 @@ function defineLeaderboard(spec) {
|
|
|
977
977
|
return p;
|
|
978
978
|
};
|
|
979
979
|
let shotNonce = 0;
|
|
980
|
-
const dispatch = spec.dispatch ??
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
980
|
+
const dispatch = spec.dispatch ?? ((profile, scenario, dispatchCtx) => {
|
|
981
|
+
const cellDispatch = loopDispatch({
|
|
982
|
+
sandboxClient,
|
|
983
|
+
toLoopOptions: (cellScenario, cellProfile) => {
|
|
984
|
+
const axis = harnessAxisOf(cellProfile);
|
|
985
|
+
const modelId = bareModel(axis?.model ?? models[0] ?? "");
|
|
986
|
+
return {
|
|
987
|
+
// naiveDriver = the no-signal retry floor: re-run the same case as
|
|
988
|
+
// an independent attempt until one scores (>0) or the shot cap.
|
|
989
|
+
driver: naiveDriver({
|
|
990
|
+
continuation: "",
|
|
991
|
+
applyContinuation: (task) => task,
|
|
992
|
+
maxIterations: shots
|
|
993
|
+
}),
|
|
994
|
+
agentRun: {
|
|
995
|
+
profile: cellProfile,
|
|
996
|
+
taskToPrompt: (s) => `${promptOf(s)}
|
|
996
997
|
|
|
997
998
|
<!-- independent-attempt:${shotNonce++} -->`,
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
999
|
+
...axis ? {
|
|
1000
|
+
sandboxOverrides: {
|
|
1001
|
+
backend: {
|
|
1002
|
+
type: axis.harness,
|
|
1003
|
+
model: { ...spec.modelBackend, model: modelId }
|
|
1004
|
+
}
|
|
1003
1005
|
}
|
|
1006
|
+
} : {}
|
|
1007
|
+
},
|
|
1008
|
+
output: {
|
|
1009
|
+
parse: (events) => spec.parseOutput ? spec.parseOutput(events, cellScenario.case) : (
|
|
1010
|
+
// The default decode produces string — the TArtifact
|
|
1011
|
+
// default. A structured-TArtifact spec supplies parseOutput
|
|
1012
|
+
// (documented on the field), so this cast never lies.
|
|
1013
|
+
collectAgentResponseText(events) ?? ""
|
|
1014
|
+
)
|
|
1015
|
+
},
|
|
1016
|
+
validator: {
|
|
1017
|
+
validate: async (output) => {
|
|
1018
|
+
const s = normalizeScore(spec.score(output, cellScenario.case));
|
|
1019
|
+
return { valid: s.composite > 0, score: s.composite };
|
|
1004
1020
|
}
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1021
|
+
},
|
|
1022
|
+
task: cellScenario,
|
|
1023
|
+
maxIterations: shots
|
|
1024
|
+
};
|
|
1025
|
+
},
|
|
1026
|
+
toArtifact: (result) => {
|
|
1027
|
+
for (const iter of result.iterations) {
|
|
1028
|
+
spec.onCellEvents?.(iter.events, scenario.case, {
|
|
1029
|
+
index: iter.index,
|
|
1030
|
+
...iter.error ? { error: iter.error.message } : {},
|
|
1031
|
+
...iter.verdict ? { verdict: { score: iter.verdict.score } } : {}
|
|
1032
|
+
});
|
|
1033
|
+
if (spec.resolveModel) {
|
|
1034
|
+
const served = spec.resolveModel(iter.events);
|
|
1035
|
+
if (served !== void 0) dispatchCtx.cost.observeModel?.(served);
|
|
1017
1036
|
}
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1037
|
+
}
|
|
1038
|
+
return result.winner?.output;
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
return cellDispatch(profile, scenario, dispatchCtx);
|
|
1023
1042
|
});
|
|
1024
1043
|
await spec.setup?.(ctx);
|
|
1025
1044
|
try {
|
|
@@ -5851,4 +5870,4 @@ export {
|
|
|
5851
5870
|
computeFindingId,
|
|
5852
5871
|
makeFinding2 as makeFinding
|
|
5853
5872
|
};
|
|
5854
|
-
//# sourceMappingURL=chunk-
|
|
5873
|
+
//# sourceMappingURL=chunk-3TZOXS7B.js.map
|