@salesforce/sfdx-agent-sdk 0.34.0 → 0.36.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,29 @@
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.36.0] - 2026-07-27
7
+
8
+ ### Features
9
+ - **harness-openai**: skills bridge (AgentConfig.skills + multi-file skills) @W-23546666 ([#694](https://github.com/forcedotcom/agentic-dx/pull/694))
10
+ - **agent-sdk**: add GPT-4.1 model (sfdc_ai__DefaultGPT41) @W-23564468@ ([#690](https://github.com/forcedotcom/agentic-dx/pull/690))
11
+ - **harness-openai**: rules loader (AgentConfig.rules support) @W-23546667@ ([#689](https://github.com/forcedotcom/agentic-dx/pull/689))
12
+ - **harness-openai**: MCP-tool approval gating @W-23546664@ ([#688](https://github.com/forcedotcom/agentic-dx/pull/688))
13
+
14
+ ## [0.35.0] - 2026-07-22
15
+
16
+ ### Features
17
+ - **harness-openai**: full conformance gate + e2e closeout @W-23447579@ ([#684](https://github.com/forcedotcom/agentic-dx/pull/684))
18
+ - **harness-openai**: scaffold OpenAI Agents SDK harness with connectivity + streamed turn @W-23447570@ ([#675](https://github.com/forcedotcom/agentic-dx/pull/675))
19
+
20
+ ### Fixes
21
+ - **ci**: bump openai harness off seed version so it can publish @W-23447579@ ([#686](https://github.com/forcedotcom/agentic-dx/pull/686))
22
+
23
+ ### Tests
24
+ - **agent-sdk**: add raw-gateway fetch probe to isolate SDK/harness bugs from gateway failures @W-23477193@ ([#674](https://github.com/forcedotcom/agentic-dx/pull/674))
25
+
26
+ ### Chores
27
+ - **deps-dev**: bump eslint from 10.6.0 to 10.7.0 in the eslint group ([#680](https://github.com/forcedotcom/agentic-dx/pull/680))
28
+
6
29
  ## [0.34.0] - 2026-07-15
7
30
 
8
31
  ### Features
@@ -1,5 +1,5 @@
1
1
  import { Model } from './models/index.js';
2
- import { type JSONWebToken, type OrgConnection, type OrgConnectionFactory } from '@salesforce/agentic-common';
2
+ import { type JSONWebToken, 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
  /**
@@ -109,6 +109,34 @@ export declare class DefaultAgentConnectivityResolver implements AgentConnectivi
109
109
  * `sfdc_ai__Default*` geo ids to `bedrock-anthropic` (W-23292476).
110
110
  */
111
111
  export declare function pickProviderHintForGatewayModel(model: Model): ProviderHint;
112
+ /**
113
+ * Returns the Salesforce LLM Gateway base URL for the given environment.
114
+ *
115
+ * Includes the `/ai/gpt/v1` API root: the pass-through endpoints
116
+ * (`/responses` for OpenAI Responses, `/model/<id>/invoke-with-response-stream`
117
+ * for Bedrock-Anthropic) live under this prefix, and provider SDKs
118
+ * (`@anthropic-ai/bedrock-sdk`, `openai`) construct their per-model paths by
119
+ * concatenation onto the base URL the consumer supplies.
120
+ *
121
+ * Exported (module-path only, not on the public `index.ts` surface) so the
122
+ * `test/smoke/raw-gateway-probe.ts` diagnostic targets the exact same gateway
123
+ * URL production does, rather than re-stating the env→URL switch (which drifted
124
+ * before — W-23292476). Same rationale as {@link pickProviderHintForGatewayModel}.
125
+ */
126
+ export declare function salesforceGatewayBaseUrl(env: SfApiEnv): string;
127
+ /**
128
+ * Builds the full header set for a Salesforce LLM Gateway request, including the
129
+ * Authorization Bearer JWT, tenant-key, feature-id, and any model-specific custom
130
+ * headers. Re-evaluated on every harness call so JWT rotations land on the next
131
+ * request without rebuilding the bag.
132
+ *
133
+ * Exported (module-path only, not on the public `index.ts` surface) so the
134
+ * `test/smoke/raw-gateway-probe.ts` diagnostic sends the exact same header bag
135
+ * production does — the minted `Bearer <jwt>` + tenant-key + feature-id is the
136
+ * one part a hand-rolled request gets wrong, and duplicating it would let the
137
+ * probe silently drift from the real auth shape.
138
+ */
139
+ export declare function buildSalesforceGatewayHeaders(orgJwt: JSONWebToken, model: Model): Promise<Record<string, string>>;
112
140
  /**
113
141
  * Resolves an `AgentConfig.modelId` value (which may be a {@link ModelName} enum value, a
114
142
  * pre-built {@link Model} instance, or `undefined`) to a concrete {@link Model}.
@@ -106,8 +106,13 @@ export function pickProviderHintForGatewayModel(model) {
106
106
  * for Bedrock-Anthropic) live under this prefix, and provider SDKs
107
107
  * (`@anthropic-ai/bedrock-sdk`, `openai`) construct their per-model paths by
108
108
  * concatenation onto the base URL the consumer supplies.
109
+ *
110
+ * Exported (module-path only, not on the public `index.ts` surface) so the
111
+ * `test/smoke/raw-gateway-probe.ts` diagnostic targets the exact same gateway
112
+ * URL production does, rather than re-stating the env→URL switch (which drifted
113
+ * before — W-23292476). Same rationale as {@link pickProviderHintForGatewayModel}.
109
114
  */
110
- function salesforceGatewayBaseUrl(env) {
115
+ export function salesforceGatewayBaseUrl(env) {
111
116
  switch (env) {
112
117
  case SfApiEnv.Dev:
113
118
  return 'https://dev.api.salesforce.com/ai/gpt/v1';
@@ -127,8 +132,14 @@ function salesforceGatewayBaseUrl(env) {
127
132
  * Authorization Bearer JWT, tenant-key, feature-id, and any model-specific custom
128
133
  * headers. Re-evaluated on every harness call so JWT rotations land on the next
129
134
  * request without rebuilding the bag.
135
+ *
136
+ * Exported (module-path only, not on the public `index.ts` surface) so the
137
+ * `test/smoke/raw-gateway-probe.ts` diagnostic sends the exact same header bag
138
+ * production does — the minted `Bearer <jwt>` + tenant-key + feature-id is the
139
+ * one part a hand-rolled request gets wrong, and duplicating it would let the
140
+ * probe silently drift from the real auth shape.
130
141
  */
131
- async function buildSalesforceGatewayHeaders(orgJwt, model) {
142
+ export async function buildSalesforceGatewayHeaders(orgJwt, model) {
132
143
  const [jwtValue, tenantKey] = await Promise.all([orgJwt.getValue(), orgJwt.getTenantKey()]);
133
144
  // Order matters: spread `customHeaders` FIRST so the resolver-set auth /
134
145
  // tenant / feature-id headers win on conflict. `customHeaders` is for
@@ -0,0 +1,17 @@
1
+ import { Model, ModelName } from './model.js';
2
+ import { type SupportedFileFormat } from './types.js';
3
+ /**
4
+ * GPT-4.1 on the geo-aware `sfdc_ai__DefaultGPT41` gateway route — the gateway
5
+ * resolves the regional deployment (parent `llmgateway__GPT41`) while the wire
6
+ * shape stays OpenAI Responses (Mastra harness). See W-23256760 for the
7
+ * geo-aware `sfdc_ai__Default*` rename.
8
+ */
9
+ export declare class GPT41 extends Model {
10
+ readonly name: ModelName;
11
+ readonly displayId: string;
12
+ readonly maxInputTokens: number;
13
+ readonly maxOutputTokens: number;
14
+ readonly contextWindow: number;
15
+ readonly supportsPromptCache: boolean;
16
+ readonly supportedFormats: readonly SupportedFileFormat[];
17
+ }
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright 2026, Salesforce, Inc. All rights reserved.
3
+ * See LICENSE.txt for license terms.
4
+ */
5
+ import { Model, ModelName } from './model.js';
6
+ import { MimeType } from './types.js';
7
+ /**
8
+ * GPT-4.1 on the geo-aware `sfdc_ai__DefaultGPT41` gateway route — the gateway
9
+ * resolves the regional deployment (parent `llmgateway__GPT41`) while the wire
10
+ * shape stays OpenAI Responses (Mastra harness). See W-23256760 for the
11
+ * geo-aware `sfdc_ai__Default*` rename.
12
+ */
13
+ export class GPT41 extends Model {
14
+ name = ModelName.GPT_4_1;
15
+ displayId = 'GPT-4.1';
16
+ // Source of truth: hawking-public/shared-public-inference-models `llmgateway/GPT41.yml`
17
+ // (text inputType.maxInputToken = 128000, max_tokens.maxRangeValue = 32768). GPT-4.1's
18
+ // context is markedly smaller than the GPT-5.x long-context variants.
19
+ maxInputTokens = 128000;
20
+ maxOutputTokens = 32768;
21
+ contextWindow = 128000;
22
+ supportsPromptCache = false;
23
+ // png/jpeg only — `GPT41.yml` declares no pdf input type (unlike the GPT-5.x models). The
24
+ // registry allows 20 MB / 50 images per format, but the SDK's global 15 MiB total / 10-file
25
+ // caps bind first, so no per-format caps.
26
+ supportedFormats = [
27
+ { name: 'png', mimeType: MimeType.Png },
28
+ { name: 'jpeg', mimeType: MimeType.Jpeg },
29
+ ];
30
+ }
31
+ //# sourceMappingURL=gpt-4-1.js.map
@@ -2,6 +2,7 @@ import { Model, ModelName } from './model.js';
2
2
  export { Model, ModelName, type ThinkingMode } from './model.js';
3
3
  export { MimeType, type SupportedFileFormat, type MultimodalFile } from './types.js';
4
4
  export { validateMultimodalFiles, MAX_FILES_PER_REQUEST, MAX_TOTAL_FILE_BYTES } from './multimodal.js';
5
+ export { GPT41 } from './gpt-4-1.js';
5
6
  export { GPT5 } from './gpt-5.js';
6
7
  export { GPT51 } from './gpt-5-1.js';
7
8
  export { GPT52 } from './gpt-5-2.js';
@@ -3,6 +3,7 @@
3
3
  * See LICENSE.txt for license terms.
4
4
  */
5
5
  import { Model, ModelName } from './model.js';
6
+ import { GPT41 } from './gpt-4-1.js';
6
7
  import { GPT5 } from './gpt-5.js';
7
8
  import { GPT51 } from './gpt-5-1.js';
8
9
  import { GPT52 } from './gpt-5-2.js';
@@ -17,6 +18,7 @@ import { ClaudeOpus48 } from './claude-opus-4-8.js';
17
18
  export { Model, ModelName } from './model.js';
18
19
  export { MimeType } from './types.js';
19
20
  export { validateMultimodalFiles, MAX_FILES_PER_REQUEST, MAX_TOTAL_FILE_BYTES } from './multimodal.js';
21
+ export { GPT41 } from './gpt-4-1.js';
20
22
  export { GPT5 } from './gpt-5.js';
21
23
  export { GPT51 } from './gpt-5-1.js';
22
24
  export { GPT52 } from './gpt-5-2.js';
@@ -55,6 +57,8 @@ export function getDefault() {
55
57
  export function getByName(modelName) {
56
58
  // Map a legacy pinned id to its canonical member; leave canonical ids untouched.
57
59
  const canonical = LEGACY_MODEL_ID_ALIASES[modelName] ?? modelName;
60
+ if (canonical === ModelName.GPT_4_1)
61
+ return new GPT41();
58
62
  if (canonical === ModelName.GPT_5)
59
63
  return new GPT5();
60
64
  if (canonical === ModelName.GPT_5_1)
@@ -36,6 +36,7 @@ export type ThinkingMode = 'enabled' | 'adaptive' | 'disabled';
36
36
  * silently miss escape-hatch ids.
37
37
  */
38
38
  export declare enum ModelName {
39
+ GPT_4_1 = "sfdc_ai__DefaultGPT41",
39
40
  GPT_5 = "sfdc_ai__DefaultGPT5",
40
41
  GPT_5_1 = "sfdc_ai__DefaultGPT51",
41
42
  GPT_5_2 = "sfdc_ai__DefaultGPT52",
@@ -24,6 +24,7 @@
24
24
  */
25
25
  export var ModelName;
26
26
  (function (ModelName) {
27
+ ModelName["GPT_4_1"] = "sfdc_ai__DefaultGPT41";
27
28
  ModelName["GPT_5"] = "sfdc_ai__DefaultGPT5";
28
29
  ModelName["GPT_5_1"] = "sfdc_ai__DefaultGPT51";
29
30
  ModelName["GPT_5_2"] = "sfdc_ai__DefaultGPT52";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/sfdx-agent-sdk",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "description": "Harness-agnostic agentic infrastructure for Salesforce developer experience tooling",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -31,6 +31,7 @@
31
31
  "test:e2e:local:cleanup": "node scripts/local-e2e-cleanup.mjs",
32
32
  "test:smoke": "tsc --build ./test/tsconfig.json && vitest run -c ./test/smoke/vitest.config.ts",
33
33
  "test:smoke:local": "node scripts/local-smoke.mjs",
34
+ "test:raw-probe:local": "node scripts/local-raw-probe.mjs",
34
35
  "verify": "tsx scripts/verify.ts"
35
36
  },
36
37
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -46,16 +47,17 @@
46
47
  },
47
48
  "devDependencies": {
48
49
  "@eslint/js": "^10.0.1",
49
- "@salesforce/sfdx-agent-harness-claude": "0.30.0",
50
- "@salesforce/sfdx-agent-harness-mastra": "0.33.0",
50
+ "@salesforce/sfdx-agent-harness-claude": "0.32.0",
51
+ "@salesforce/sfdx-agent-harness-mastra": "0.35.0",
52
+ "@salesforce/sfdx-agent-harness-openai": "0.1.0",
51
53
  "@types/node": "^22.20.0",
52
54
  "@vitest/coverage-istanbul": "^4.1.10",
53
- "@vitest/eslint-plugin": "^1.6.23",
55
+ "@vitest/eslint-plugin": "^1.6.22",
54
56
  "eslint": "^10.7.0",
55
57
  "eslint-config-prettier": "^10.1.8",
56
58
  "eslint-import-resolver-typescript": "^4.4.5",
57
59
  "eslint-plugin-import": "^2.32.0",
58
- "eslint-plugin-n": "^18.2.2",
60
+ "eslint-plugin-n": "^18.2.1",
59
61
  "globals": "^17.6.0",
60
62
  "lint-staged": "^17.0.7",
61
63
  "prettier": "^3.9.4",