@workbench-ai/workbench 0.0.88 → 0.0.89
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 +64 -5
- 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,CAgNlB"}
|
package/dist/index.js
CHANGED
|
@@ -420,6 +420,7 @@ export async function runCli(argv, io = {
|
|
|
420
420
|
remote: optionalPositional(parsed, 1),
|
|
421
421
|
dryRun: parsed.flags["dry-run"] === true,
|
|
422
422
|
});
|
|
423
|
+
const next = result.dryRun ? null : await syncNextCommand(core);
|
|
423
424
|
return emitResult("workbench.cli.sync.v1", {
|
|
424
425
|
remote: result.remote,
|
|
425
426
|
status: result.dryRun ? "dry_run" : "synced",
|
|
@@ -427,8 +428,12 @@ export async function runCli(argv, io = {
|
|
|
427
428
|
pulled: result.pulled,
|
|
428
429
|
changed: syncChanged(result),
|
|
429
430
|
publication: result.publication,
|
|
431
|
+
next: next,
|
|
430
432
|
...(result.dryRun ? { dryRun: true } : {}),
|
|
431
|
-
}, parsed, io, () =>
|
|
433
|
+
}, parsed, io, () => [
|
|
434
|
+
`${result.dryRun ? "Would sync" : "Synced"} ${result.remote.name}: pushed ${result.pushed}, pulled ${result.pulled}${result.upToDate ? " (up to date)" : ""}.`,
|
|
435
|
+
...(next ? [`next: ${next}`] : []),
|
|
436
|
+
].join("\n"));
|
|
432
437
|
}
|
|
433
438
|
if (command === "publish") {
|
|
434
439
|
const preview = parsed.flags["dry-run"] === true
|
|
@@ -614,12 +619,14 @@ async function handleAgent(parsed, io) {
|
|
|
614
619
|
if (!adapter) {
|
|
615
620
|
throw new WorkbenchUserError("workbench agent add requires --adapter ADAPTER.");
|
|
616
621
|
}
|
|
622
|
+
const config = parseWithFlags(parsed);
|
|
623
|
+
validateAgentCommandConfig(config);
|
|
617
624
|
const agent = await addWorkbenchAgent({
|
|
618
625
|
...(await coreOptions(parsed)),
|
|
619
626
|
name,
|
|
620
627
|
adapter,
|
|
621
628
|
model: stringFlag(parsed, "model"),
|
|
622
|
-
config
|
|
629
|
+
config,
|
|
623
630
|
});
|
|
624
631
|
return output(agent, parsed, io, () => `Added agent ${formatAgent(agent)}.`);
|
|
625
632
|
}
|
|
@@ -656,7 +663,17 @@ async function handleAdapterLogin(provider, parsed, io) {
|
|
|
656
663
|
async function handleAdapterLogout(provider, parsed, io) {
|
|
657
664
|
const target = parseAuthTarget(provider, authProfileFlag(parsed));
|
|
658
665
|
await localWorkbenchAdapterAuthStore(adapterAuthStoreRoot()).disconnect(target);
|
|
659
|
-
const remote = await deleteAdapterConnectionRemote(target, parsed)
|
|
666
|
+
const remote = await deleteAdapterConnectionRemote(target, parsed).catch((error) => {
|
|
667
|
+
if (error instanceof WorkbenchCodedError && error.code === "auth_required") {
|
|
668
|
+
return {
|
|
669
|
+
status: "not_authenticated",
|
|
670
|
+
sync: "skipped",
|
|
671
|
+
reason: "not_authenticated",
|
|
672
|
+
remediation: "Run workbench login.",
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
throw error;
|
|
676
|
+
});
|
|
660
677
|
return emitResult("workbench.cli.logout.v1", {
|
|
661
678
|
provider: target.adapterId,
|
|
662
679
|
localAdapter: {
|
|
@@ -1061,7 +1078,6 @@ async function startCloudExecution(command, parsed, io) {
|
|
|
1061
1078
|
const showProgress = true;
|
|
1062
1079
|
const interrupt = createCloudInterruptController(command, io, showProgress);
|
|
1063
1080
|
try {
|
|
1064
|
-
writeCloudProgress(io, `workbench cloud: preparing hosted ${command}.`, showProgress);
|
|
1065
1081
|
const remote = await cloudPreScheduleStep(command, interrupt, ensureCloudRemoteForExecution(root, parsed));
|
|
1066
1082
|
const source = parseWorkbenchInstallSource(remote.url);
|
|
1067
1083
|
if (!source) {
|
|
@@ -1079,6 +1095,7 @@ async function startCloudExecution(command, parsed, io) {
|
|
|
1079
1095
|
});
|
|
1080
1096
|
}
|
|
1081
1097
|
const core = { dir: root, authToken: token };
|
|
1098
|
+
writeCloudProgress(io, `workbench cloud: preparing hosted ${command}.`, showProgress);
|
|
1082
1099
|
writeCloudProgress(io, "workbench cloud: preparing current source.", showProgress);
|
|
1083
1100
|
const request = command === "eval"
|
|
1084
1101
|
? await cloudPreScheduleStep(command, interrupt, prepareWorkbenchCloudEvalRequest({
|
|
@@ -1524,6 +1541,16 @@ function cloudSyncSummary(sync) {
|
|
|
1524
1541
|
function syncChanged(sync) {
|
|
1525
1542
|
return sync.pushed > 0 || sync.pulled > 0;
|
|
1526
1543
|
}
|
|
1544
|
+
async function syncNextCommand(core) {
|
|
1545
|
+
const status = await workbenchStatusSnapshot(core);
|
|
1546
|
+
const auth = await workbenchCliAuthStatus();
|
|
1547
|
+
const cliStatus = await statusWithCausalNext(status, auth, core, {
|
|
1548
|
+
installedSkillCount: 0,
|
|
1549
|
+
stores: [],
|
|
1550
|
+
connectedProviders: [],
|
|
1551
|
+
});
|
|
1552
|
+
return cliStatus.next ?? null;
|
|
1553
|
+
}
|
|
1527
1554
|
function writeCloudProgress(io, message, enabled = true) {
|
|
1528
1555
|
if (!enabled) {
|
|
1529
1556
|
return;
|
|
@@ -2741,6 +2768,33 @@ function parseWithFlags(parsed) {
|
|
|
2741
2768
|
return [entry.slice(0, eq), parseScalar(entry.slice(eq + 1))];
|
|
2742
2769
|
}));
|
|
2743
2770
|
}
|
|
2771
|
+
function validateAgentCommandConfig(config) {
|
|
2772
|
+
for (const key of ["command", "improveCommand"]) {
|
|
2773
|
+
const value = config[key];
|
|
2774
|
+
if (typeof value !== "string") {
|
|
2775
|
+
continue;
|
|
2776
|
+
}
|
|
2777
|
+
const expanded = expandedRuntimeEnvPath(value);
|
|
2778
|
+
if (!expanded) {
|
|
2779
|
+
continue;
|
|
2780
|
+
}
|
|
2781
|
+
throw new WorkbenchCodedError("usage", `--with ${key}=... contains ${expanded.path}, which usually means the shell expanded a Workbench runtime variable before Workbench received it.`, {
|
|
2782
|
+
remediation: `Wrap the assignment in single quotes, for example --with '${key}=... >> "${expanded.replacement}"'.`,
|
|
2783
|
+
exitCode: 2,
|
|
2784
|
+
});
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
function expandedRuntimeEnvPath(value) {
|
|
2788
|
+
for (const entry of [
|
|
2789
|
+
{ path: "/SKILL.md", replacement: "$SKILL_DIR/SKILL.md", pattern: /(^|[\s"'=])\/SKILL\.md(?=$|[\s"'])/u },
|
|
2790
|
+
{ path: "/result.json", replacement: "$OUTPUT_DIR/result.json", pattern: /(^|[\s"'=])\/result\.json(?=$|[\s"'])/u },
|
|
2791
|
+
]) {
|
|
2792
|
+
if (entry.pattern.test(value)) {
|
|
2793
|
+
return entry;
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
return null;
|
|
2797
|
+
}
|
|
2744
2798
|
function parseScalar(value) {
|
|
2745
2799
|
if (value === "true") {
|
|
2746
2800
|
return true;
|
|
@@ -3692,7 +3746,7 @@ function formatTraceDetail(detail, refs = {}) {
|
|
|
3692
3746
|
return detail.executions.map((execution) => {
|
|
3693
3747
|
const sessionLabels = execution.sessions.map((session) => session.label).join(",");
|
|
3694
3748
|
return [
|
|
3695
|
-
`${execution
|
|
3749
|
+
`${formatExecutionEvidenceLabel(detail, execution)}\trun=${refs.runRefs?.get(detail.runId) ?? displayRef(detail.runId)}\tjobs=${execution.jobIds.map((id) => refs.jobRefs?.get(id) ?? displayRef(id)).join(",")}\tstatus=${execution.status}`,
|
|
3696
3750
|
`events=${execution.trace.events.length}`,
|
|
3697
3751
|
`spans=${execution.trace.spans.length}`,
|
|
3698
3752
|
`summaries=${execution.trace.summaries.length}`,
|
|
@@ -3700,6 +3754,11 @@ function formatTraceDetail(detail, refs = {}) {
|
|
|
3700
3754
|
].filter(Boolean).join("\t");
|
|
3701
3755
|
}).join("\n");
|
|
3702
3756
|
}
|
|
3757
|
+
function formatExecutionEvidenceLabel(detail, execution) {
|
|
3758
|
+
return execution.jobIds.length === 1 && execution.id === `job:${detail.runId}:${execution.jobIds[0]}`
|
|
3759
|
+
? "evidence"
|
|
3760
|
+
: execution.id;
|
|
3761
|
+
}
|
|
3703
3762
|
function formatArtifact(artifact) {
|
|
3704
3763
|
return `${displayRef(artifact.id)}\trun=${displayRef(artifact.runId)}\tjob=${displayRef(artifact.jobId)}\t${artifact.kind}\tfiles=${artifact.files.length}`;
|
|
3705
3764
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workbench-ai/workbench",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.89",
|
|
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-
|
|
25
|
-
"@workbench-ai/workbench-
|
|
26
|
-
"@workbench-ai/workbench-
|
|
27
|
-
"@workbench-ai/workbench-
|
|
24
|
+
"@workbench-ai/workbench-built-in-adapters": "0.0.89",
|
|
25
|
+
"@workbench-ai/workbench-core": "0.0.89",
|
|
26
|
+
"@workbench-ai/workbench-contract": "0.0.89",
|
|
27
|
+
"@workbench-ai/workbench-protocol": "0.0.89"
|
|
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.89"
|
|
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",
|