@salesforce/sfdx-agent-sdk 0.82.0 → 0.84.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to `@salesforce/sfdx-agent-sdk` are documented in this file.
4
4
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
+ ## [0.84.0] - 2026-09-16
7
+
8
+ ### Fixes
9
+ - **agentic-common**: bypass /ide/auth mint when the credential is already a JWT @W-23616439@ ([#822](https://github.com/forcedotcom/agentic-dx/pull/822))
10
+
11
+ ## [0.83.0] - 2026-09-16
12
+
13
+ ### Features
14
+ - **harness-mastra**: stream tool-call argument deltas from pass-through builders @W-23954558@ ([#824](https://github.com/forcedotcom/agentic-dx/pull/824))
15
+
6
16
  ## [0.82.0] - 2026-09-15
7
17
 
8
18
  _No changes — released alongside dependent packages._
package/README.md CHANGED
@@ -1296,6 +1296,7 @@ const manager = await createAgentManager('/path/to/storage', new MastraHarnessFa
1296
1296
  | `providerHint` | `ProviderHint` | Wire shape. Must be one a harness in the consumer's setup advertises via `HarnessFactory.supportedProviderHints`. |
1297
1297
  | `nativeModelIdFor?` | `(model: Model) => string` | Optional translator from canonical `model.name` to the endpoint-native model id. Direct-provider endpoints expect their own naming (`claude-sonnet-4-6`); gateway-shaped endpoints accept the canonical `sfdc_ai__Default*` id verbatim. Defaults to `model.name`. |
1298
1298
  | `connectionFactory?` | `OrgConnectionFactory` | Optional. When supplied, the resolver mints an org connection + JWT alongside the api-key bag — the BYOK shape (api-key authenticates the LLM; org JWT authenticates MCP servers / identity). Without it, `orgConnection` and `orgJwt` are omitted from `ResolvedConnectivity`. |
1299
+ | `logBus?` | `LogBus` | Optional. When set (with `connectionFactory`), routes the org-JWT bypass/mint logs onto the bus so the BYOK org-gateway first-token acquisition is observable via `manager.onLog`. |
1299
1300
 
1300
1301
  The resolver throws `AgentSDKError(NOT_SUPPORTED)` when `getApiKey()` returns empty / nullish so consumers see "the
1301
1302
  resolver returned an empty key" rather than chasing a 401 through provider logs after `Authorization: Bearer ` (no key)
@@ -1,5 +1,5 @@
1
1
  import { Model } from './models/index.js';
2
- import { type JSONWebToken, type OrgConnection, type OrgConnectionFactory, SfApiEnv } from '@salesforce/agentic-common';
2
+ import { type JSONWebToken, type LogBus, type OrgConnection, type OrgConnectionFactory, SfApiEnv } from '@salesforce/agentic-common';
3
3
  import type { AgentConfig } from './harness/harness-config.js';
4
4
  import type { ModelConnectivityInfo, ProviderHint } from './types/model-connectivity-info.js';
5
5
  /**
@@ -65,10 +65,13 @@ export interface AgentConnectivityResolver {
65
65
  */
66
66
  export declare class DefaultAgentConnectivityResolver implements AgentConnectivityResolver {
67
67
  private readonly connectionFactory;
68
+ private readonly logBus?;
68
69
  /**
69
70
  * @param connectionFactory - Creates authenticated Salesforce org connections.
71
+ * @param logBus - Optional root {@link LogBus} the JWT mint + injected-JWT-bypass logs are
72
+ * forwarded onto, so first-token acquisition is observable via `manager.onLog` / `onBootLog`.
70
73
  */
71
- constructor(connectionFactory?: OrgConnectionFactory);
74
+ constructor(connectionFactory?: OrgConnectionFactory, logBus?: LogBus | undefined);
72
75
  /**
73
76
  * Resolves the org and produces the harness-facing `ModelConnectivityInfo` bag.
74
77
  *
@@ -13,11 +13,15 @@ import { connectionProviderFor, createJWTFromConnection, RealOrgConnectionFactor
13
13
  */
14
14
  export class DefaultAgentConnectivityResolver {
15
15
  connectionFactory;
16
+ logBus;
16
17
  /**
17
18
  * @param connectionFactory - Creates authenticated Salesforce org connections.
19
+ * @param logBus - Optional root {@link LogBus} the JWT mint + injected-JWT-bypass logs are
20
+ * forwarded onto, so first-token acquisition is observable via `manager.onLog` / `onBootLog`.
18
21
  */
19
- constructor(connectionFactory = new RealOrgConnectionFactory()) {
22
+ constructor(connectionFactory = new RealOrgConnectionFactory(), logBus) {
20
23
  this.connectionFactory = connectionFactory;
24
+ this.logBus = logBus;
21
25
  }
22
26
  /**
23
27
  * Resolves the org and produces the harness-facing `ModelConnectivityInfo` bag.
@@ -41,7 +45,9 @@ export class DefaultAgentConnectivityResolver {
41
45
  });
42
46
  const orgConnection = await reresolve();
43
47
  const env = orgConnection.getInferredSfApiEnv();
44
- const orgJwt = await createJWTFromConnection(reuseThenReresolve(orgConnection, reresolve));
48
+ const orgJwt = await createJWTFromConnection(reuseThenReresolve(orgConnection, reresolve), {
49
+ logBus: this.logBus,
50
+ });
45
51
  const model = resolveAgentConfigModel(config.modelId);
46
52
  const modelConnectivityInfo = {
47
53
  model,
@@ -456,10 +456,13 @@ export async function createAgentManager(storageRootFolder, harnessFactory, opti
456
456
  `advertised version ${factoryVersion} (SDK supports: ${SUPPORTED_PROTOCOL_VERSIONS.join(', ')}). ` +
457
457
  `Update the SDK or harness package.`, AgentSDKErrorType.INCOMPATIBLE_HARNESS);
458
458
  }
459
- const agentConnectivityResolver = options?.connectivityResolver ?? new DefaultAgentConnectivityResolver();
460
459
  const clock = new RealClock();
461
460
  // The manager's root log bus shares the manager clock and self-reads the process environment context.
462
461
  const logBus = new LogBus(clock);
462
+ // The default resolver forwards JWT-mint + injected-JWT-bypass logs onto the manager's root bus
463
+ // so first-token acquisition is observable via onBootLog / manager.onLog; a consumer-supplied
464
+ // resolver owns its own logging.
465
+ const agentConnectivityResolver = options?.connectivityResolver ?? new DefaultAgentConnectivityResolver(undefined, logBus);
463
466
  return DefaultAgentManager.__build(harness, harnessFactory.supportedProviderHints, agentConnectivityResolver, { hooksForAgent: options?.hooksForAgent, mcpAuthProviderResolver: options?.mcpAuthProviderResolver }, storageRootFolder, new UUIDGenerator(), clock, logBus, options?.onBootLog);
464
467
  }
465
468
  function isSupportedProtocolVersion(version) {
@@ -1,5 +1,5 @@
1
1
  import { Model } from './models/index.js';
2
- import { type OrgConnectionFactory } from '@salesforce/agentic-common';
2
+ import { type LogBus, type OrgConnectionFactory } from '@salesforce/agentic-common';
3
3
  import { type AgentConnectivityResolver, type ResolvedConnectivity } from './agent-connectivity-resolver.js';
4
4
  import type { AgentConfig } from './harness/harness-config.js';
5
5
  import type { ProviderHint } from './types/model-connectivity-info.js';
@@ -52,6 +52,8 @@ export type ApiKeyConnectivityResolverConfig = {
52
52
  * omitted from `ResolvedConnectivity`.
53
53
  */
54
54
  connectionFactory?: OrgConnectionFactory;
55
+ /** Optional bus to route the org-JWT bypass/mint logs onto (used only with `connectionFactory`). */
56
+ logBus?: LogBus;
55
57
  };
56
58
  /**
57
59
  * Generic api-key {@link AgentConnectivityResolver}. Covers every named
@@ -112,7 +112,9 @@ export class ApiKeyConnectivityResolver {
112
112
  projectRoot,
113
113
  });
114
114
  const orgConnection = await reresolve();
115
- const orgJwt = await createJWTFromConnection(reuseThenReresolve(orgConnection, reresolve));
115
+ const orgJwt = await createJWTFromConnection(reuseThenReresolve(orgConnection, reresolve), {
116
+ logBus: this.cfg.logBus,
117
+ });
116
118
  return { orgConnection, orgJwt };
117
119
  }
118
120
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/sfdx-agent-sdk",
3
- "version": "0.82.0",
3
+ "version": "0.84.0",
4
4
  "description": "Harness-agnostic agentic infrastructure for Salesforce developer experience tooling",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -43,14 +43,14 @@
43
43
  "LICENSE.txt"
44
44
  ],
45
45
  "dependencies": {
46
- "@salesforce/agentic-common": "0.19.0",
46
+ "@salesforce/agentic-common": "0.20.0",
47
47
  "ajv": "^8.20.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@eslint/js": "^10.0.1",
51
- "@salesforce/sfdx-agent-harness-claude": "0.78.0",
52
- "@salesforce/sfdx-agent-harness-mastra": "0.81.0",
53
- "@salesforce/sfdx-agent-harness-openai": "0.47.0",
51
+ "@salesforce/sfdx-agent-harness-claude": "0.80.0",
52
+ "@salesforce/sfdx-agent-harness-mastra": "0.83.0",
53
+ "@salesforce/sfdx-agent-harness-openai": "0.49.0",
54
54
  "@types/node": "^22.20.1",
55
55
  "@vitest/coverage-istanbul": "^4.1.11",
56
56
  "@vitest/eslint-plugin": "^1.6.27",