@workbench-ai/workbench-built-in-adapters 0.0.110 → 0.0.112

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":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,IAAI,EAKL,MAAM,kCAAkC,CAAC;AAqB1C,OAAO,KAAK,EAEV,0BAA0B,EAG3B,MAAM,iBAAiB,CAAC;AAOzB,MAAM,WAAW,4CAA4C;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,0BAA0B,CAAC;IAC3C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AA2DD,wBAAsB,qCAAqC,CACzD,IAAI,GAAE,4CAAiD,GACtD,OAAO,CAAC,IAAI,CAAC,CAyDf"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,IAAI,EAKL,MAAM,kCAAkC,CAAC;AAsB1C,OAAO,KAAK,EAEV,0BAA0B,EAG3B,MAAM,iBAAiB,CAAC;AAOzB,MAAM,WAAW,4CAA4C;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,0BAA0B,CAAC;IAC3C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AA2DD,wBAAsB,qCAAqC,CACzD,IAAI,GAAE,4CAAiD,GACtD,OAAO,CAAC,IAAI,CAAC,CAyDf"}
package/dist/execute.js CHANGED
@@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
2
2
  import { promises as fs } from "node:fs";
3
3
  import os from "node:os";
4
4
  import path from "node:path";
5
- import { createWorkbenchExecutionEventPublisher, jsonRecord, normalizeRelativePath, publishCommandStepEvent, readSurfaceFiles, writeSurfaceFiles, } from "@workbench-ai/workbench-core";
5
+ import { createWorkbenchExecutionEventPublisher, jsonRecord, normalizeRelativePath, publishCommandStepEvent, readSurfaceFiles, workbenchProviderAuthSetupCommand, writeSurfaceFiles, } from "@workbench-ai/workbench-core";
6
6
  import { ensureWorkbenchAdapterOutputDir, readWorkbenchAdapterOperationResult, readWorkbenchAdapterOperationRequest, writeWorkbenchAdapterOperationResult, workbenchAdapterOperationResultPath, } from "@workbench-ai/workbench-protocol";
7
7
  import YAML from "yaml";
8
8
  import { isWorkbenchBuiltInAdapterId, } from "./manifests.js";
@@ -672,9 +672,30 @@ function eventPublisherForAdapterRequest(request) {
672
672
  });
673
673
  }
674
674
  async function executeBuiltInAgentTurn(executor, request) {
675
+ requireWorkbenchAdapterAuthForProviderTurn(request.provider, request.adapterAuthRequest);
675
676
  const { defaultWorkbenchAgentTurnExecutor, executeWorkbenchAgentTurn, } = await import("./agent-turn.js");
676
677
  return await executeWorkbenchAgentTurn(executor ?? defaultWorkbenchAgentTurnExecutor, request);
677
678
  }
679
+ function requireWorkbenchAdapterAuthForProviderTurn(provider, auth) {
680
+ if (providerAuthRequestEntry(auth, provider.use)) {
681
+ return;
682
+ }
683
+ throw new Error(`ADAPTER_AUTH_REQUIRED: ${provider.use} disconnected. Next: ${workbenchProviderAuthSetupCommand(provider.use)}.`);
684
+ }
685
+ function providerAuthRequestEntry(auth, providerName) {
686
+ const record = authObject(auth);
687
+ const self = authObject(record?.self);
688
+ const adapters = authObject(record?.adapters);
689
+ const provider = authObject(adapters?.[providerName]);
690
+ return authObject(self?.default) ??
691
+ authObject(provider?.default) ??
692
+ authObject(record?.default);
693
+ }
694
+ function authObject(value) {
695
+ return value && typeof value === "object" && !Array.isArray(value)
696
+ ? value
697
+ : null;
698
+ }
678
699
  async function writeAgentSkillOutput(request, workload, adapter, options = {}) {
679
700
  if (request.operation !== "skill.run") {
680
701
  throw new Error("Agent skill execution results can only complete skill.run operations.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workbench-ai/workbench-built-in-adapters",
3
- "version": "0.0.110",
3
+ "version": "0.0.112",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/workbench-ai/workbench.git",
@@ -33,11 +33,11 @@
33
33
  "dependencies": {
34
34
  "yaml": "^2.8.2",
35
35
  "@workbench-ai/agent-driver-anthropic-claude-code": "0.0.49",
36
- "@workbench-ai/workbench-core": "0.0.110",
37
- "@workbench-ai/workbench-contract": "0.0.110",
36
+ "@workbench-ai/workbench-protocol": "0.0.112",
37
+ "@workbench-ai/workbench-contract": "0.0.112",
38
+ "@workbench-ai/workbench-core": "0.0.112",
38
39
  "@workbench-ai/agent-driver-openai-codex": "0.0.49",
39
- "@workbench-ai/agent-driver": "0.0.49",
40
- "@workbench-ai/workbench-protocol": "0.0.110"
40
+ "@workbench-ai/agent-driver": "0.0.49"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^24.3.1",