@workbench-ai/workbench 0.0.55 → 0.0.56
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/index.js +19 -0
- package/dist/local-archive.d.ts.map +1 -1
- package/dist/local-archive.js +3 -18
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3003,6 +3003,11 @@ async function pushBenchmark(argv, io) {
|
|
|
3003
3003
|
throw new UsageError("Missing hosted benchmark. Run workbench push from a source directory.");
|
|
3004
3004
|
}
|
|
3005
3005
|
if (dryRun) {
|
|
3006
|
+
const remoteProject = await verifyLinkedPushDryRunTarget({
|
|
3007
|
+
baseUrl,
|
|
3008
|
+
origin,
|
|
3009
|
+
projectId,
|
|
3010
|
+
});
|
|
3006
3011
|
writeOutput({
|
|
3007
3012
|
ok: true,
|
|
3008
3013
|
dryRun: true,
|
|
@@ -3011,6 +3016,7 @@ async function pushBenchmark(argv, io) {
|
|
|
3011
3016
|
baseUrl,
|
|
3012
3017
|
benchmarkId: projectId,
|
|
3013
3018
|
remote: origin.remote,
|
|
3019
|
+
benchmark: remoteProject,
|
|
3014
3020
|
benchmarkName: source.spec.name,
|
|
3015
3021
|
visibility: visibility ?? "unchanged",
|
|
3016
3022
|
sourceFileCount: sourceFileCount(source),
|
|
@@ -3059,6 +3065,19 @@ async function pushBenchmark(argv, io) {
|
|
|
3059
3065
|
});
|
|
3060
3066
|
return 0;
|
|
3061
3067
|
}
|
|
3068
|
+
async function verifyLinkedPushDryRunTarget(args) {
|
|
3069
|
+
const response = await apiRequest(projectApiPath(args.projectId), {}, args.baseUrl);
|
|
3070
|
+
const expected = parseOriginRemote(args.origin);
|
|
3071
|
+
const actualOwner = response.benchmark.ownerUsername;
|
|
3072
|
+
const actualProject = response.benchmark.name;
|
|
3073
|
+
if (actualOwner !== expected.owner || actualProject !== expected.project) {
|
|
3074
|
+
const actualRemote = actualOwner && actualProject
|
|
3075
|
+
? `${actualOwner}/${actualProject}`
|
|
3076
|
+
: "unknown";
|
|
3077
|
+
throw new UsageError(`Workbench origin points to ${args.origin.remote}, but ${args.projectId} resolved to ${actualRemote}.`);
|
|
3078
|
+
}
|
|
3079
|
+
return response.benchmark;
|
|
3080
|
+
}
|
|
3062
3081
|
async function createHostedBenchmarkFromState(args) {
|
|
3063
3082
|
const result = await apiRequest("/api/workbench/benchmarks/state", {
|
|
3064
3083
|
method: "POST",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-archive.d.ts","sourceRoot":"","sources":["../src/local-archive.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"local-archive.d.ts","sourceRoot":"","sources":["../src/local-archive.ts"],"names":[],"mappings":"AAGA,OAAO,EAWL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,YAAY,EAEjB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAC;AAOtC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC;IACtD,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AA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B,EAAE,WAAW,EAAE,MAAM,GAAG,eAAe,CAMvG;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAGlH;AAqkBD,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,SAAS,mBAAmB,EAAE,GACpC,OAAO,CAAC,MAAM,EAAE,CAAC,CAOnB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,QAAQ,EAAE,MAAM,GACf,mBAAmB,GAAG,IAAI,CAG5B"}
|
package/dist/local-archive.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { promises as fs } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { buildWorkbenchTraceSessionsFromFiles, candidateRecordWithoutDerivedFields, sanitizeWorkbenchRuntimeCandidateForExchange, sanitizeWorkbenchRuntimeJobForExchange, selectExecutionOutputFilesForInspection, workbenchRuntimeExplicitActiveId, workbenchRuntimeBundleStats, workbenchSurfaceFilesEqualForExchange, } from "@workbench-ai/workbench-core";
|
|
3
|
+
import { buildWorkbenchTraceSessionsFromFiles, candidateRecordWithoutDerivedFields, mergeWorkbenchRuntimeCandidateForExchange, sanitizeWorkbenchRuntimeCandidateForExchange, sanitizeWorkbenchRuntimeJobForExchange, selectExecutionOutputFilesForInspection, workbenchRuntimeExplicitActiveId, workbenchRuntimeBundleStats, workbenchRuntimeCandidateIdentityForExchange, workbenchSurfaceFilesEqualForExchange, } from "@workbench-ai/workbench-core";
|
|
4
4
|
const RUNTIME_DIR = ".workbench/runtime";
|
|
5
5
|
const CANDIDATE_RECORDS_DIR = "candidates";
|
|
6
6
|
export function localRuntimeDir(workspace) {
|
|
@@ -113,7 +113,7 @@ export async function importLocalRuntimeBundle(workspace, bundle, currentBenchma
|
|
|
113
113
|
const incomingCandidates = bundle.candidates.map(sanitizeWorkbenchRuntimeCandidateForExchange);
|
|
114
114
|
const candidates = mergeRecordsById(existingCandidates, incomingCandidates, (candidate) => candidate.id, (didChange) => {
|
|
115
115
|
changed ||= didChange;
|
|
116
|
-
}, runtimeCandidatesCompatibleForExchange,
|
|
116
|
+
}, runtimeCandidatesCompatibleForExchange, mergeWorkbenchRuntimeCandidateForExchange).sort(compareLocalCandidateRecords);
|
|
117
117
|
const candidateFiles = { ...snapshot.candidateFiles };
|
|
118
118
|
for (const group of bundle.candidateFiles) {
|
|
119
119
|
const candidateId = localRecordName(group.candidateId);
|
|
@@ -394,22 +394,7 @@ function runtimeComparableJob(job) {
|
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
396
|
function runtimeCandidatesCompatibleForExchange(left, right) {
|
|
397
|
-
return runtimeRecordsEqual(
|
|
398
|
-
}
|
|
399
|
-
function runtimeCandidateIdentityForExchange(candidate) {
|
|
400
|
-
const { eval: _eval, prompt: _prompt, meta: _meta, status: _status, usage: _usage, visibility: _visibility, ownerUserId: _ownerUserId, ownerUsername: _ownerUsername, metrics: _metrics, candidateRunId: _candidateRunId, candidateRunName: _candidateRunName, ...identity } = candidate;
|
|
401
|
-
return identity;
|
|
402
|
-
}
|
|
403
|
-
function mergeRuntimeCandidateForExchange(left, right) {
|
|
404
|
-
return {
|
|
405
|
-
...left,
|
|
406
|
-
...right,
|
|
407
|
-
...(right.eval ? { eval: right.eval } : left.eval ? { eval: left.eval } : {}),
|
|
408
|
-
...(right.prompt ? { prompt: right.prompt } : left.prompt ? { prompt: left.prompt } : {}),
|
|
409
|
-
...(right.meta !== undefined ? { meta: right.meta } : left.meta !== undefined ? { meta: left.meta } : {}),
|
|
410
|
-
...(right.usage ? { usage: right.usage } : left.usage ? { usage: left.usage } : {}),
|
|
411
|
-
visibility: right.visibility ?? left.visibility,
|
|
412
|
-
};
|
|
397
|
+
return runtimeRecordsEqual(workbenchRuntimeCandidateIdentityForExchange(left), workbenchRuntimeCandidateIdentityForExchange(right));
|
|
413
398
|
}
|
|
414
399
|
function runtimeEvaluationsCompatibleForExchange(left, right) {
|
|
415
400
|
if (runtimeRecordsEqual(left, right)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workbench-ai/workbench",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.56",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"yaml": "^2.8.2",
|
|
24
|
-
"@workbench-ai/workbench-
|
|
25
|
-
"@workbench-ai/workbench-core": "0.0.
|
|
26
|
-
"@workbench-ai/workbench-
|
|
24
|
+
"@workbench-ai/workbench-built-in-adapters": "0.0.56",
|
|
25
|
+
"@workbench-ai/workbench-core": "0.0.56",
|
|
26
|
+
"@workbench-ai/workbench-protocol": "0.0.56"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@tailwindcss/postcss": "^4.2.2",
|