@workbench-ai/workbench 0.0.89 → 0.0.91
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.d.ts.map +1 -1
- package/dist/index.js +38 -3
- package/package.json +6 -6
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiEA,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;CAC/B;AAuTD,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,GAAE,KAGzD,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiEA,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;CAC/B;AAuTD,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,GAAE,KAGzD,GAAG,OAAO,CAAC,MAAM,CAAC,CAmNlB"}
|
package/dist/index.js
CHANGED
|
@@ -415,12 +415,15 @@ export async function runCli(argv, io = {
|
|
|
415
415
|
return await handleAgent(parsed, io);
|
|
416
416
|
}
|
|
417
417
|
if (command === "sync") {
|
|
418
|
+
const beforeRuns = parsed.flags["dry-run"] === true
|
|
419
|
+
? undefined
|
|
420
|
+
: await runEvidenceFingerprints(core).catch(() => undefined);
|
|
418
421
|
const result = await syncWorkbenchRemote({
|
|
419
422
|
...core,
|
|
420
423
|
remote: optionalPositional(parsed, 1),
|
|
421
424
|
dryRun: parsed.flags["dry-run"] === true,
|
|
422
425
|
});
|
|
423
|
-
const next = result.dryRun ? null : await syncNextCommand(core);
|
|
426
|
+
const next = result.dryRun ? null : await syncNextCommand(core, beforeRuns);
|
|
424
427
|
return emitResult("workbench.cli.sync.v1", {
|
|
425
428
|
remote: result.remote,
|
|
426
429
|
status: result.dryRun ? "dry_run" : "synced",
|
|
@@ -1523,7 +1526,6 @@ function hostedImproveResult(started, artifactIds, switchedVersion) {
|
|
|
1523
1526
|
const runs = started.runs.map((run) => runSummary(run, artifactIds.get(run.id) ?? []));
|
|
1524
1527
|
return {
|
|
1525
1528
|
run: runs[0] ?? null,
|
|
1526
|
-
runs,
|
|
1527
1529
|
switched: Boolean(switchedVersion),
|
|
1528
1530
|
promoted: Boolean(switchedVersion),
|
|
1529
1531
|
...(switchedVersion ? { version: versionSummary(switchedVersion) } : {}),
|
|
@@ -1541,7 +1543,13 @@ function cloudSyncSummary(sync) {
|
|
|
1541
1543
|
function syncChanged(sync) {
|
|
1542
1544
|
return sync.pushed > 0 || sync.pulled > 0;
|
|
1543
1545
|
}
|
|
1544
|
-
async function syncNextCommand(core) {
|
|
1546
|
+
async function syncNextCommand(core, beforeRuns) {
|
|
1547
|
+
if (beforeRuns) {
|
|
1548
|
+
const changedRun = await latestChangedRunAfterSync(core, beforeRuns);
|
|
1549
|
+
if (changedRun) {
|
|
1550
|
+
return `workbench show ${displayRef(changedRun.id)}`;
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1545
1553
|
const status = await workbenchStatusSnapshot(core);
|
|
1546
1554
|
const auth = await workbenchCliAuthStatus();
|
|
1547
1555
|
const cliStatus = await statusWithCausalNext(status, auth, core, {
|
|
@@ -1551,6 +1559,33 @@ async function syncNextCommand(core) {
|
|
|
1551
1559
|
});
|
|
1552
1560
|
return cliStatus.next ?? null;
|
|
1553
1561
|
}
|
|
1562
|
+
async function latestChangedRunAfterSync(core, beforeRuns) {
|
|
1563
|
+
const snapshot = await createWorkbenchReadOnlyInspectionSnapshot(core).catch(() => null);
|
|
1564
|
+
const changedRuns = snapshot?.runs
|
|
1565
|
+
.filter((run) => beforeRuns.get(run.id) !== runEvidenceFingerprint(run))
|
|
1566
|
+
.sort((left, right) => runEvidenceTime(right).localeCompare(runEvidenceTime(left))) ?? [];
|
|
1567
|
+
return changedRuns[0] ?? null;
|
|
1568
|
+
}
|
|
1569
|
+
async function runEvidenceFingerprints(core) {
|
|
1570
|
+
const snapshot = await createWorkbenchReadOnlyInspectionSnapshot(core);
|
|
1571
|
+
return new Map(snapshot.runs.map((run) => [run.id, runEvidenceFingerprint(run)]));
|
|
1572
|
+
}
|
|
1573
|
+
function runEvidenceFingerprint(run) {
|
|
1574
|
+
return JSON.stringify({
|
|
1575
|
+
status: run.status,
|
|
1576
|
+
score: run.score,
|
|
1577
|
+
costUsd: run.costUsd,
|
|
1578
|
+
latencyMs: run.latencyMs,
|
|
1579
|
+
jobIds: run.jobIds ?? [],
|
|
1580
|
+
traceIds: run.traceIds,
|
|
1581
|
+
finishedAt: run.finishedAt,
|
|
1582
|
+
outputVersionId: run.outputVersionId,
|
|
1583
|
+
error: run.error,
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
function runEvidenceTime(run) {
|
|
1587
|
+
return run.finishedAt ?? run.createdAt;
|
|
1588
|
+
}
|
|
1554
1589
|
function writeCloudProgress(io, message, enabled = true) {
|
|
1555
1590
|
if (!enabled) {
|
|
1556
1591
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workbench-ai/workbench",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.91",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/workbench-ai/workbench.git",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"yaml": "^2.8.2",
|
|
24
|
-
"@workbench-ai/workbench-built-in-adapters": "0.0.
|
|
25
|
-
"@workbench-ai/workbench-
|
|
26
|
-
"@workbench-ai/workbench-
|
|
27
|
-
"@workbench-ai/workbench-protocol": "0.0.
|
|
24
|
+
"@workbench-ai/workbench-built-in-adapters": "0.0.91",
|
|
25
|
+
"@workbench-ai/workbench-contract": "0.0.91",
|
|
26
|
+
"@workbench-ai/workbench-core": "0.0.91",
|
|
27
|
+
"@workbench-ai/workbench-protocol": "0.0.91"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@tailwindcss/postcss": "^4.2.2",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-dom": "^19.2.0",
|
|
36
36
|
"typescript": "^5.9.2",
|
|
37
37
|
"vitest": "^3.2.4",
|
|
38
|
-
"@workbench-ai/workbench-ui": "0.0.
|
|
38
|
+
"@workbench-ai/workbench-ui": "0.0.91"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "rm -rf dist && tsc -p tsconfig.json && chmod 755 dist/workbench.js && node ./scripts/build-dev-open-assets.mjs",
|