@workbench-ai/workbench 0.0.87 → 0.0.88

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.
@@ -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,CAqMlB"}
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,CA2MlB"}
package/dist/index.js CHANGED
@@ -448,14 +448,21 @@ export async function runCli(argv, io = {
448
448
  `next: workbench install ${preview.installHandle}`,
449
449
  ].join("\n"));
450
450
  }
451
- const remote = await ensurePublishRemote(parsed);
452
- const result = await publishWorkbenchVersion({
453
- ...core,
454
- version: optionalPositional(parsed, 1),
455
- remote,
456
- dryRun: parsed.flags["dry-run"] === true,
457
- visibility: parsePublishVisibilityFlags(parsed),
458
- });
451
+ let remote;
452
+ let result;
453
+ try {
454
+ remote = await ensurePublishRemote(parsed);
455
+ result = await publishWorkbenchVersion({
456
+ ...core,
457
+ version: optionalPositional(parsed, 1),
458
+ remote,
459
+ dryRun: parsed.flags["dry-run"] === true,
460
+ visibility: parsePublishVisibilityFlags(parsed),
461
+ });
462
+ }
463
+ catch (error) {
464
+ throw await publishErrorWithCliContext(error, parsed, remote);
465
+ }
459
466
  return emitResult("workbench.cli.publish.v1", {
460
467
  remote: result.remote,
461
468
  version: versionSummary(result.version),
@@ -2638,6 +2645,33 @@ function installHandleFromCloudRemote(remote) {
2638
2645
  }
2639
2646
  return `${source.owner}/${source.skill}`;
2640
2647
  }
2648
+ async function publishErrorWithCliContext(error, parsed, remoteName) {
2649
+ if (!(error instanceof WorkbenchCodedError) || error.code !== "auth_required") {
2650
+ return error;
2651
+ }
2652
+ if (error.message.startsWith("workbench publish")) {
2653
+ return error;
2654
+ }
2655
+ return new WorkbenchCodedError("auth_required", "workbench publish requires Workbench Cloud auth.", {
2656
+ remediation: await publishAuthRemediation(parsed, remoteName, error.remediation),
2657
+ ...(error.subject ? { subject: error.subject } : {}),
2658
+ exitCode: error.exitCode,
2659
+ });
2660
+ }
2661
+ async function publishAuthRemediation(parsed, remoteName, fallback) {
2662
+ const root = path.resolve(dirFlag(parsed) ?? process.cwd());
2663
+ try {
2664
+ const snapshot = await createWorkbenchReadOnlyInspectionSnapshot({ dir: root });
2665
+ const remote = remoteName
2666
+ ? snapshot.remotes.find((entry) => entry.name === remoteName)
2667
+ : cloudRemoteLinkTargetFromRemotes(snapshot.remotes).existing;
2668
+ const source = remote ? parseWorkbenchInstallSource(remote.url) : undefined;
2669
+ return workbenchLoginRemediation(source?.baseUrl);
2670
+ }
2671
+ catch {
2672
+ return fallback ?? "Run workbench login.";
2673
+ }
2674
+ }
2641
2675
  function parseOwnerSkillHandle(input) {
2642
2676
  const handle = normalizedOwnerSkillHandle(input);
2643
2677
  if (!handle) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workbench-ai/workbench",
3
- "version": "0.0.87",
3
+ "version": "0.0.88",
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.87",
25
- "@workbench-ai/workbench-contract": "0.0.87",
26
- "@workbench-ai/workbench-protocol": "0.0.87",
27
- "@workbench-ai/workbench-core": "0.0.87"
24
+ "@workbench-ai/workbench-contract": "0.0.88",
25
+ "@workbench-ai/workbench-built-in-adapters": "0.0.88",
26
+ "@workbench-ai/workbench-protocol": "0.0.88",
27
+ "@workbench-ai/workbench-core": "0.0.88"
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.87"
38
+ "@workbench-ai/workbench-ui": "0.0.88"
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",