@salesforce/sfdx-agent-sdk 0.33.0 → 0.35.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 +20 -0
- package/README.md +21 -16
- package/dist/agent-connectivity-resolver.d.ts +40 -6
- package/dist/agent-connectivity-resolver.js +47 -18
- package/dist/index.d.ts +1 -1
- package/dist/models/claude-opus-4-5.d.ts +2 -1
- package/dist/models/claude-opus-4-5.js +4 -0
- package/dist/models/claude-opus-4-6.d.ts +2 -1
- package/dist/models/claude-opus-4-6.js +4 -0
- package/dist/models/claude-opus-4-7.d.ts +3 -1
- package/dist/models/claude-opus-4-7.js +7 -0
- package/dist/models/claude-opus-4-8.d.ts +3 -1
- package/dist/models/claude-opus-4-8.js +7 -0
- package/dist/models/claude-sonnet-4-5.d.ts +2 -1
- package/dist/models/claude-sonnet-4-5.js +4 -0
- package/dist/models/claude-sonnet-4-6.d.ts +2 -1
- package/dist/models/claude-sonnet-4-6.js +4 -0
- package/dist/models/create-claude-model.d.ts +12 -5
- package/dist/models/create-claude-model.js +6 -4
- package/dist/models/{gpt-5-1-geo.d.ts → gpt-5-1.d.ts} +1 -1
- package/dist/models/{gpt-5-1-geo.js → gpt-5-1.js} +4 -4
- package/dist/models/{gpt-5-2-geo.d.ts → gpt-5-2.d.ts} +1 -1
- package/dist/models/{gpt-5-2-geo.js → gpt-5-2.js} +4 -4
- package/dist/models/gpt-5-4.d.ts +5 -0
- package/dist/models/gpt-5-4.js +5 -0
- package/dist/models/gpt-5.d.ts +5 -0
- package/dist/models/gpt-5.js +5 -0
- package/dist/models/index.d.ts +13 -5
- package/dist/models/index.js +39 -25
- package/dist/models/model.d.ts +65 -14
- package/dist/models/model.js +49 -17
- package/package.json +7 -5
- package/dist/models/gpt-5-4-geo.d.ts +0 -16
- package/dist/models/gpt-5-4-geo.js +0 -26
- package/dist/models/gpt-5-geo.d.ts +0 -17
- package/dist/models/gpt-5-geo.js +0 -28
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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.35.0] - 2026-07-22
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
- **harness-openai**: full conformance gate + e2e closeout @W-23447579@ ([#684](https://github.com/forcedotcom/agentic-dx/pull/684))
|
|
10
|
+
- **harness-openai**: scaffold OpenAI Agents SDK harness with connectivity + streamed turn @W-23447570@ ([#675](https://github.com/forcedotcom/agentic-dx/pull/675))
|
|
11
|
+
|
|
12
|
+
### Fixes
|
|
13
|
+
- **ci**: bump openai harness off seed version so it can publish @W-23447579@ ([#686](https://github.com/forcedotcom/agentic-dx/pull/686))
|
|
14
|
+
|
|
15
|
+
### Tests
|
|
16
|
+
- **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))
|
|
17
|
+
|
|
18
|
+
### Chores
|
|
19
|
+
- **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))
|
|
20
|
+
|
|
21
|
+
## [0.34.0] - 2026-07-15
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
- **agent-sdk,harness-claude,harness-mastra**: per-model gateway config — geo-aware ids, thinking mode, param exclusion @W-23447370@ ([#672](https://github.com/forcedotcom/agentic-dx/pull/672))
|
|
25
|
+
|
|
6
26
|
## [0.33.0] - 2026-07-14
|
|
7
27
|
|
|
8
28
|
### Features
|
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ for (const failure of manager.getRestoreFailures()) {
|
|
|
34
34
|
// storage folder will replay this agent automatically.
|
|
35
35
|
const agent = await manager.createAgent('/path/to/project', {
|
|
36
36
|
agentId: 'developer-assistant',
|
|
37
|
-
modelId: '
|
|
37
|
+
modelId: 'sfdc_ai__DefaultGPT5',
|
|
38
38
|
instructions: 'You are a helpful Salesforce developer assistant.',
|
|
39
39
|
});
|
|
40
40
|
|
|
@@ -232,19 +232,19 @@ function onApprovalRequest(event: ToolApprovalRequestEvent): Promise<boolean> {
|
|
|
232
232
|
|
|
233
233
|
#### `AgentConfig`
|
|
234
234
|
|
|
235
|
-
| Field | Type | Description
|
|
236
|
-
| ---------------------- | -------------------- |
|
|
237
|
-
| `orgAlias?` | `string` | Salesforce org alias or username. Falls back to project/default org.
|
|
238
|
-
| `modelId?` | `ModelName \| Model` | LLM model selector. Pass a `ModelName` enum value for an in-tree model (e.g. `'
|
|
239
|
-
| `name?` | `string` | Human-readable agent name.
|
|
240
|
-
| `description?` | `string` | Agent purpose description.
|
|
241
|
-
| `instructions?` | `string` | System instructions for the agent.
|
|
242
|
-
| `tools?` | `ToolDefinition[]` | Consumer-executed tool schemas.
|
|
243
|
-
| `mcpServers?` | `MCPConfiguration` | MCP server connections.
|
|
244
|
-
| `skills?` | `string[]` | Each entry is either an individual skill folder (containing `SKILL.md`) or a parent folder containing skill subfolders. Relative and absolute paths supported; forms can be mixed in the same array.
|
|
245
|
-
| `rules?` | `string[]` | Each entry is either an individual `.md` rule file or a directory of `.md` rule files (scanned one level deep, alphabetical, non-`.md` skipped). Bodies are composed verbatim into the agent's effective system prompt; YAML frontmatter is optional and stripped if present. Matches Claude Code's `.claude/rules/*.md` convention.
|
|
246
|
-
| `toolPolicies?` | `ToolPolicyRule[]` | Ordered per-tool approval rules resolved by `resolveToolApprovalPolicy` (cross-tier deny-wins / within-tier last-wins). Author directly or via `definePolicy(...)`. See "Tool Approval Policy" below.
|
|
247
|
-
| `defaultToolDecision?` | `Decision` | Fallback decision when no rule matches. Defaults to `'allow'` (no policy ⇒ no gating). Set to `'require-approval'` for a fail-closed posture (recommended for catalogs with un-annotated MCP servers).
|
|
235
|
+
| Field | Type | Description |
|
|
236
|
+
| ---------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
237
|
+
| `orgAlias?` | `string` | Salesforce org alias or username. Falls back to project/default org. |
|
|
238
|
+
| `modelId?` | `ModelName \| Model` | LLM model selector. Pass a `ModelName` enum value for an in-tree model (e.g. `'sfdc_ai__DefaultGPT5'`), or a pre-built `Model` instance to opt into a Bedrock-Anthropic Claude variant the SDK has not yet released — see `createClaudeModel(gatewayId, overrides)` exported from this package. Legacy pinned `llmgateway__*` ids still resolve via a back-compat alias map. |
|
|
239
|
+
| `name?` | `string` | Human-readable agent name. |
|
|
240
|
+
| `description?` | `string` | Agent purpose description. |
|
|
241
|
+
| `instructions?` | `string` | System instructions for the agent. |
|
|
242
|
+
| `tools?` | `ToolDefinition[]` | Consumer-executed tool schemas. |
|
|
243
|
+
| `mcpServers?` | `MCPConfiguration` | MCP server connections. |
|
|
244
|
+
| `skills?` | `string[]` | Each entry is either an individual skill folder (containing `SKILL.md`) or a parent folder containing skill subfolders. Relative and absolute paths supported; forms can be mixed in the same array. |
|
|
245
|
+
| `rules?` | `string[]` | Each entry is either an individual `.md` rule file or a directory of `.md` rule files (scanned one level deep, alphabetical, non-`.md` skipped). Bodies are composed verbatim into the agent's effective system prompt; YAML frontmatter is optional and stripped if present. Matches Claude Code's `.claude/rules/*.md` convention. |
|
|
246
|
+
| `toolPolicies?` | `ToolPolicyRule[]` | Ordered per-tool approval rules resolved by `resolveToolApprovalPolicy` (cross-tier deny-wins / within-tier last-wins). Author directly or via `definePolicy(...)`. See "Tool Approval Policy" below. |
|
|
247
|
+
| `defaultToolDecision?` | `Decision` | Fallback decision when no rule matches. Defaults to `'allow'` (no policy ⇒ no gating). Set to `'require-approval'` for a fail-closed posture (recommended for catalogs with un-annotated MCP servers). |
|
|
248
248
|
|
|
249
249
|
#### `StreamOptions`
|
|
250
250
|
|
|
@@ -1037,7 +1037,7 @@ The connectivity facts a harness needs to make an LLM request. Five fields. Auth
|
|
|
1037
1037
|
| --------------- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1038
1038
|
| `model` | `Model` | Capability descriptor used for pre-flight multimodal validation and SDK-side context-usage reporting. |
|
|
1039
1039
|
| `baseUrl` | `string` | Provider-native or gateway base URL (no trailing slash, no path beyond the API root). Harnesses concat the wire-shape-specific path. |
|
|
1040
|
-
| `nativeModelId` | `string` | Wire id the provider SDK sets on the request body's `model` field. May differ from `model.name` (e.g. Anthropic-direct expects `claude-sonnet-4-6`; the Salesforce gateway expects `
|
|
1040
|
+
| `nativeModelId` | `string` | Wire id the provider SDK sets on the request body's `model` field. May differ from `model.name` (e.g. Anthropic-direct expects `claude-sonnet-4-6`; the Salesforce gateway expects `sfdc_ai__DefaultBedrockAnthropicClaude46Sonnet`). |
|
|
1041
1041
|
| `providerHint` | `ProviderHint` | Wire shape the harness should speak. The manager validates this against the harness's `supportedProviderHints` before any harness work begins; a harness only sees hints it recognizes. |
|
|
1042
1042
|
| `getHeaders` | `() => Promise<Record<string, string>>` | Returns the FULL header set (Authorization included) for the NEXT outbound request. **Per-call invocation contract.** Mastra harnesses MUST call this on every HTTP call (inside their fetch wrapper); Claude harnesses MUST call this once per subprocess spawn. Caching the returned map across requests is a bug. |
|
|
1043
1043
|
|
|
@@ -1084,7 +1084,7 @@ const manager = await createAgentManager('/path/to/storage', new MastraHarnessFa
|
|
|
1084
1084
|
| `getApiKey` | `() => string \| Promise<string>` | Returns the API key. Re-evaluated on every `resolve()` call, and the resulting `getHeaders()` re-invokes it on every header read so a rotating key source (env var, secret store, BYOK toggle) lands without reconstructing the resolver. |
|
|
1085
1085
|
| `baseUrl` | `string` | Fully-qualified provider URL with API version segment (e.g. `https://api.openai.com/v1`, not `https://api.openai.com`). |
|
|
1086
1086
|
| `providerHint` | `ProviderHint` | Wire shape. Must be one a harness in the consumer's setup advertises via `HarnessFactory.supportedProviderHints`. |
|
|
1087
|
-
| `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 `
|
|
1087
|
+
| `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`. |
|
|
1088
1088
|
| `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`. |
|
|
1089
1089
|
|
|
1090
1090
|
The resolver throws `AgentSDKError(NOT_SUPPORTED)` when `getApiKey()` returns empty / nullish so consumers see "the
|
|
@@ -1096,6 +1096,11 @@ header bag. **Reserved auth headers are not overridable**: the resolver spreads
|
|
|
1096
1096
|
`Authorization` / `Content-Type` last, so a `Model` instance whose `customHeaders` includes an `Authorization` key
|
|
1097
1097
|
silently shadows nothing — the resolver wins.
|
|
1098
1098
|
|
|
1099
|
+
`Model.excludedParameters` is an optional denylist of generation parameters the LLM Gateway rejects for the model.
|
|
1100
|
+
Harnesses consult it before forwarding a generation parameter — currently only `temperature`, which the gateway
|
|
1101
|
+
deprecated for Claude Opus 4.7+ and now rejects. A model that lists `temperature` (the in-tree Opus 4.7 / 4.8 models do)
|
|
1102
|
+
has it stripped from the request; leaving `excludedParameters` unset (the default) forwards every parameter unchanged.
|
|
1103
|
+
|
|
1099
1104
|
#### `HarnessAgentConfig`
|
|
1100
1105
|
|
|
1101
1106
|
Harness-facing configuration derived from `AgentConfig`. Strips `orgAlias` (resolved above the harness) and adds:
|
|
@@ -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
|
/**
|
|
@@ -90,11 +90,17 @@ export declare class DefaultAgentConnectivityResolver implements AgentConnectivi
|
|
|
90
90
|
* its `name` — a programming error worth surfacing eagerly rather than silently
|
|
91
91
|
* defaulting.
|
|
92
92
|
*
|
|
93
|
-
* **Scope:** This helper is for the Salesforce gateway path only
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
93
|
+
* **Scope:** This helper is for the Salesforce gateway path only. It keys on the
|
|
94
|
+
* model FAMILY segment, not the namespace prefix, because the geo-aware
|
|
95
|
+
* `sfdc_ai__Default*` prefix is shared across families: `sfdc_ai__DefaultBedrockAnthropic*`
|
|
96
|
+
* is a Claude model that must reach the Bedrock pass-through, while
|
|
97
|
+
* `sfdc_ai__DefaultGPT*` is an OpenAI model that must reach the Responses endpoint.
|
|
98
|
+
* Matching on the bare `sfdc_ai__Default` prefix alone would mis-route every geo
|
|
99
|
+
* Claude id onto the OpenAI wire path (wire-observed 500/502 — W-23256760). Both
|
|
100
|
+
* `BedrockAnthropic*` and `Anthropic*` families collapse to `'bedrock-anthropic'`
|
|
101
|
+
* (the gateway's Bedrock pass-through) under either namespace prefix. A consumer
|
|
102
|
+
* wanting direct-Anthropic auth (`providerHint: 'anthropic'`) drives that path
|
|
103
|
+
* through {@link ApiKeyConnectivityResolver} with an explicit `providerHint`
|
|
98
104
|
* argument, not through this resolver.
|
|
99
105
|
*
|
|
100
106
|
* Exported (module-path only, not on the public `index.ts` surface) so e2e test
|
|
@@ -103,6 +109,34 @@ export declare class DefaultAgentConnectivityResolver implements AgentConnectivi
|
|
|
103
109
|
* `sfdc_ai__Default*` geo ids to `bedrock-anthropic` (W-23292476).
|
|
104
110
|
*/
|
|
105
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>>;
|
|
106
140
|
/**
|
|
107
141
|
* Resolves an `AgentConfig.modelId` value (which may be a {@link ModelName} enum value, a
|
|
108
142
|
* pre-built {@link Model} instance, or `undefined`) to a concrete {@link Model}.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright 2026, Salesforce, Inc. All rights reserved.
|
|
3
3
|
* See LICENSE.txt for license terms.
|
|
4
4
|
*/
|
|
5
|
-
import { Model, ModelName, Models, createClaudeModel } from './models/index.js';
|
|
5
|
+
import { Model, ModelName, Models, createClaudeModel, LEGACY_MODEL_ID_ALIASES, } from './models/index.js';
|
|
6
6
|
import { createJWTFromConnection, RealOrgConnectionFactory, SfApiEnv, } from '@salesforce/agentic-common';
|
|
7
7
|
// TODO(@W-22782317): Temporary workaround — only on prod orgs the LLM Gateway must
|
|
8
8
|
// route requests through AgentforceVibes rather than the default VibesService. Remove once a
|
|
@@ -63,11 +63,17 @@ export class DefaultAgentConnectivityResolver {
|
|
|
63
63
|
* its `name` — a programming error worth surfacing eagerly rather than silently
|
|
64
64
|
* defaulting.
|
|
65
65
|
*
|
|
66
|
-
* **Scope:** This helper is for the Salesforce gateway path only
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
66
|
+
* **Scope:** This helper is for the Salesforce gateway path only. It keys on the
|
|
67
|
+
* model FAMILY segment, not the namespace prefix, because the geo-aware
|
|
68
|
+
* `sfdc_ai__Default*` prefix is shared across families: `sfdc_ai__DefaultBedrockAnthropic*`
|
|
69
|
+
* is a Claude model that must reach the Bedrock pass-through, while
|
|
70
|
+
* `sfdc_ai__DefaultGPT*` is an OpenAI model that must reach the Responses endpoint.
|
|
71
|
+
* Matching on the bare `sfdc_ai__Default` prefix alone would mis-route every geo
|
|
72
|
+
* Claude id onto the OpenAI wire path (wire-observed 500/502 — W-23256760). Both
|
|
73
|
+
* `BedrockAnthropic*` and `Anthropic*` families collapse to `'bedrock-anthropic'`
|
|
74
|
+
* (the gateway's Bedrock pass-through) under either namespace prefix. A consumer
|
|
75
|
+
* wanting direct-Anthropic auth (`providerHint: 'anthropic'`) drives that path
|
|
76
|
+
* through {@link ApiKeyConnectivityResolver} with an explicit `providerHint`
|
|
71
77
|
* argument, not through this resolver.
|
|
72
78
|
*
|
|
73
79
|
* Exported (module-path only, not on the public `index.ts` surface) so e2e test
|
|
@@ -77,16 +83,20 @@ export class DefaultAgentConnectivityResolver {
|
|
|
77
83
|
*/
|
|
78
84
|
export function pickProviderHintForGatewayModel(model) {
|
|
79
85
|
const name = model.name;
|
|
80
|
-
if (name.startsWith('llmgateway__BedrockAnthropic') ||
|
|
86
|
+
if (name.startsWith('llmgateway__BedrockAnthropic') ||
|
|
87
|
+
name.startsWith('llmgateway__Anthropic') ||
|
|
88
|
+
name.startsWith('sfdc_ai__DefaultBedrockAnthropic') ||
|
|
89
|
+
name.startsWith('sfdc_ai__DefaultAnthropic')) {
|
|
81
90
|
return 'bedrock-anthropic';
|
|
82
91
|
}
|
|
83
92
|
if (name.startsWith('llmgateway__OpenAI') || name.startsWith('sfdc_ai__Default')) {
|
|
84
|
-
// `sfdc_ai__Default*`
|
|
85
|
-
//
|
|
86
|
-
// OpenAI Responses, so it resolves
|
|
93
|
+
// `sfdc_ai__Default*` (minus the Anthropic families handled above) is the
|
|
94
|
+
// geo-aware OpenAI route (W-23256760): the gateway selects the regional
|
|
95
|
+
// deployment, but the wire shape is still OpenAI Responses, so it resolves
|
|
96
|
+
// to the same providerHint.
|
|
87
97
|
return 'openai-responses';
|
|
88
98
|
}
|
|
89
|
-
throw new Error(`Cannot infer providerHint for model "${name}". Salesforce gateway models must start with "
|
|
99
|
+
throw new Error(`Cannot infer providerHint for model "${name}". Salesforce gateway models must start with "sfdc_ai__DefaultBedrockAnthropic*", "sfdc_ai__DefaultGPT*", or a legacy "llmgateway__BedrockAnthropic*" / "llmgateway__OpenAI*" id.`);
|
|
90
100
|
}
|
|
91
101
|
/**
|
|
92
102
|
* Returns the Salesforce LLM Gateway base URL for the given environment.
|
|
@@ -96,8 +106,13 @@ export function pickProviderHintForGatewayModel(model) {
|
|
|
96
106
|
* for Bedrock-Anthropic) live under this prefix, and provider SDKs
|
|
97
107
|
* (`@anthropic-ai/bedrock-sdk`, `openai`) construct their per-model paths by
|
|
98
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}.
|
|
99
114
|
*/
|
|
100
|
-
function salesforceGatewayBaseUrl(env) {
|
|
115
|
+
export function salesforceGatewayBaseUrl(env) {
|
|
101
116
|
switch (env) {
|
|
102
117
|
case SfApiEnv.Dev:
|
|
103
118
|
return 'https://dev.api.salesforce.com/ai/gpt/v1';
|
|
@@ -117,8 +132,14 @@ function salesforceGatewayBaseUrl(env) {
|
|
|
117
132
|
* Authorization Bearer JWT, tenant-key, feature-id, and any model-specific custom
|
|
118
133
|
* headers. Re-evaluated on every harness call so JWT rotations land on the next
|
|
119
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.
|
|
120
141
|
*/
|
|
121
|
-
async function buildSalesforceGatewayHeaders(orgJwt, model) {
|
|
142
|
+
export async function buildSalesforceGatewayHeaders(orgJwt, model) {
|
|
122
143
|
const [jwtValue, tenantKey] = await Promise.all([orgJwt.getValue(), orgJwt.getTenantKey()]);
|
|
123
144
|
// Order matters: spread `customHeaders` FIRST so the resolver-set auth /
|
|
124
145
|
// tenant / feature-id headers win on conflict. `customHeaders` is for
|
|
@@ -168,12 +189,19 @@ function rehydratePersistedModel(persisted) {
|
|
|
168
189
|
if (typeof obj.name !== 'string') {
|
|
169
190
|
throw new Error(`Cannot resolve modelId: missing string "name" on persisted object.`);
|
|
170
191
|
}
|
|
171
|
-
// If the persisted name matches an in-tree model
|
|
172
|
-
//
|
|
173
|
-
|
|
192
|
+
// If the persisted name matches an in-tree model — a current `ModelName` value OR a
|
|
193
|
+
// legacy pinned id the alias map remaps (e.g. an `AgentConfig` written before the
|
|
194
|
+
// geo-aware rename) — prefer the strict registry, which returns an instance with the
|
|
195
|
+
// correct prototype and canonical caps. `getByName` consults the alias map itself.
|
|
196
|
+
if (Object.values(ModelName).includes(obj.name) || obj.name in LEGACY_MODEL_ID_ALIASES) {
|
|
174
197
|
return Models.getByName(obj.name);
|
|
175
198
|
}
|
|
176
|
-
|
|
199
|
+
// Escape-hatch rehydration (consumer-built Claude variants via createClaudeModel):
|
|
200
|
+
// accept both the geo-aware `sfdc_ai__DefaultBedrockAnthropic*` prefix and the legacy
|
|
201
|
+
// pinned `llmgateway__BedrockAnthropic*` prefix so instances persisted under either
|
|
202
|
+
// scheme rehydrate during the deprecation window.
|
|
203
|
+
if (!obj.name.startsWith('sfdc_ai__DefaultBedrockAnthropic') &&
|
|
204
|
+
!obj.name.startsWith('llmgateway__BedrockAnthropic')) {
|
|
177
205
|
throw new Error(`Cannot rehydrate persisted model "${obj.name}". Only Bedrock-Anthropic Claude variants are supported via the consumer-built Model escape hatch.`);
|
|
178
206
|
}
|
|
179
207
|
return createClaudeModel(obj.name, {
|
|
@@ -183,7 +211,8 @@ function rehydratePersistedModel(persisted) {
|
|
|
183
211
|
contextWindow: obj.contextWindow,
|
|
184
212
|
supportsPromptCache: obj.supportsPromptCache,
|
|
185
213
|
supportedFormats: obj.supportedFormats,
|
|
186
|
-
|
|
214
|
+
excludedParameters: obj.excludedParameters,
|
|
215
|
+
thinkingMode: obj.thinkingMode,
|
|
187
216
|
customHeaders: obj.customHeaders,
|
|
188
217
|
});
|
|
189
218
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { DEFAULT_MAX_STEPS } from './harness/harness-config.js';
|
|
|
10
10
|
export type { MCPConfiguration, MCPServerConfig, MCPStdioServerConfig, MCPRemoteServerConfig, McpServerInfo, McpServerErrorCategory, McpServerErrorDetail, McpToolInfo, McpToolAnnotations, } from './mcp-config.js';
|
|
11
11
|
export { McpServerStatus, mcpServerConfigEqual } from './mcp-config.js';
|
|
12
12
|
export { Model, ModelName, createClaudeModel, Models, validateMultimodalFiles } from './models/index.js';
|
|
13
|
-
export type { ClaudeModelOverrides, MultimodalFile, SupportedFileFormat } from './models/index.js';
|
|
13
|
+
export type { ClaudeModelOverrides, MultimodalFile, SupportedFileFormat, ThinkingMode } from './models/index.js';
|
|
14
14
|
export { MimeType } from './models/index.js';
|
|
15
15
|
export { inferSfApiEnv, SfApiEnv } from '@salesforce/agentic-common';
|
|
16
16
|
export { type AgentManager, type RestoreFailure, createAgentManager } from './agent-manager.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Model, ModelName } from './model.js';
|
|
1
|
+
import { Model, ModelName, type ThinkingMode } from './model.js';
|
|
2
2
|
import { type SupportedFileFormat } from './types.js';
|
|
3
3
|
export declare class ClaudeOpus45 extends Model {
|
|
4
4
|
readonly name: ModelName;
|
|
@@ -7,5 +7,6 @@ export declare class ClaudeOpus45 extends Model {
|
|
|
7
7
|
readonly maxOutputTokens: number;
|
|
8
8
|
readonly contextWindow: number;
|
|
9
9
|
readonly supportsPromptCache: boolean;
|
|
10
|
+
readonly thinkingMode: ThinkingMode;
|
|
10
11
|
readonly supportedFormats: readonly SupportedFileFormat[];
|
|
11
12
|
}
|
|
@@ -12,6 +12,10 @@ export class ClaudeOpus45 extends Model {
|
|
|
12
12
|
maxOutputTokens = 64000;
|
|
13
13
|
contextWindow = 200000;
|
|
14
14
|
supportsPromptCache = true;
|
|
15
|
+
// The Bedrock 4.5 backend accepts only the legacy `thinking.type: "enabled"`
|
|
16
|
+
// shape and rejects `"adaptive"` (which arrives with 4.6+). Verified on the
|
|
17
|
+
// wire; see the harness thinking-mode probe.
|
|
18
|
+
thinkingMode = 'enabled';
|
|
15
19
|
supportedFormats = [
|
|
16
20
|
{ name: 'png', mimeType: MimeType.Png, maxBytesPerFile: 3.75 * 1024 * 1024 },
|
|
17
21
|
{ name: 'jpeg', mimeType: MimeType.Jpeg, maxBytesPerFile: 3.75 * 1024 * 1024 },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Model, ModelName } from './model.js';
|
|
1
|
+
import { Model, ModelName, type ThinkingMode } from './model.js';
|
|
2
2
|
import { type SupportedFileFormat } from './types.js';
|
|
3
3
|
export declare class ClaudeOpus46 extends Model {
|
|
4
4
|
readonly name: ModelName;
|
|
@@ -7,5 +7,6 @@ export declare class ClaudeOpus46 extends Model {
|
|
|
7
7
|
readonly maxOutputTokens: number;
|
|
8
8
|
readonly contextWindow: number;
|
|
9
9
|
readonly supportsPromptCache: boolean;
|
|
10
|
+
readonly thinkingMode: ThinkingMode;
|
|
10
11
|
readonly supportedFormats: readonly SupportedFileFormat[];
|
|
11
12
|
}
|
|
@@ -13,6 +13,10 @@ export class ClaudeOpus46 extends Model {
|
|
|
13
13
|
maxOutputTokens = 128_000;
|
|
14
14
|
contextWindow = 1_000_000;
|
|
15
15
|
supportsPromptCache = true;
|
|
16
|
+
// The Bedrock 4.6+ backend requires the `thinking.type: "adaptive"` shape and
|
|
17
|
+
// rejects the legacy `"enabled"`. Verified on the wire; see the harness
|
|
18
|
+
// thinking-mode probe.
|
|
19
|
+
thinkingMode = 'adaptive';
|
|
16
20
|
supportedFormats = [
|
|
17
21
|
{ name: 'png', mimeType: MimeType.Png, maxBytesPerFile: 3.75 * 1024 * 1024 },
|
|
18
22
|
{ name: 'jpeg', mimeType: MimeType.Jpeg, maxBytesPerFile: 3.75 * 1024 * 1024 },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Model, ModelName } from './model.js';
|
|
1
|
+
import { Model, ModelName, type ThinkingMode } from './model.js';
|
|
2
2
|
import { type SupportedFileFormat } from './types.js';
|
|
3
3
|
export declare class ClaudeOpus47 extends Model {
|
|
4
4
|
readonly name: ModelName;
|
|
@@ -7,5 +7,7 @@ export declare class ClaudeOpus47 extends Model {
|
|
|
7
7
|
readonly maxOutputTokens: number;
|
|
8
8
|
readonly contextWindow: number;
|
|
9
9
|
readonly supportsPromptCache: boolean;
|
|
10
|
+
readonly excludedParameters: string[];
|
|
11
|
+
readonly thinkingMode: ThinkingMode;
|
|
10
12
|
readonly supportedFormats: readonly SupportedFileFormat[];
|
|
11
13
|
}
|
|
@@ -13,6 +13,13 @@ export class ClaudeOpus47 extends Model {
|
|
|
13
13
|
maxOutputTokens = 128_000;
|
|
14
14
|
contextWindow = 1_000_000;
|
|
15
15
|
supportsPromptCache = true;
|
|
16
|
+
// The gateway deprecated `temperature` for Opus 4.7+ and rejects requests
|
|
17
|
+
// that include it, so the harness strips it before the request is sent.
|
|
18
|
+
excludedParameters = ['temperature'];
|
|
19
|
+
// The Bedrock 4.6+ backend requires the `thinking.type: "adaptive"` shape and
|
|
20
|
+
// rejects the legacy `"enabled"` the bundled CLI defaults to for this model.
|
|
21
|
+
// Verified on the wire; see the harness thinking-mode probe.
|
|
22
|
+
thinkingMode = 'adaptive';
|
|
16
23
|
supportedFormats = [
|
|
17
24
|
{ name: 'png', mimeType: MimeType.Png, maxBytesPerFile: 3.75 * 1024 * 1024 },
|
|
18
25
|
{ name: 'jpeg', mimeType: MimeType.Jpeg, maxBytesPerFile: 3.75 * 1024 * 1024 },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Model, ModelName } from './model.js';
|
|
1
|
+
import { Model, ModelName, type ThinkingMode } from './model.js';
|
|
2
2
|
import { type SupportedFileFormat } from './types.js';
|
|
3
3
|
export declare class ClaudeOpus48 extends Model {
|
|
4
4
|
readonly name: ModelName;
|
|
@@ -7,5 +7,7 @@ export declare class ClaudeOpus48 extends Model {
|
|
|
7
7
|
readonly maxOutputTokens: number;
|
|
8
8
|
readonly contextWindow: number;
|
|
9
9
|
readonly supportsPromptCache: boolean;
|
|
10
|
+
readonly excludedParameters: string[];
|
|
11
|
+
readonly thinkingMode: ThinkingMode;
|
|
10
12
|
readonly supportedFormats: readonly SupportedFileFormat[];
|
|
11
13
|
}
|
|
@@ -13,6 +13,13 @@ export class ClaudeOpus48 extends Model {
|
|
|
13
13
|
maxOutputTokens = 128_000;
|
|
14
14
|
contextWindow = 1_000_000;
|
|
15
15
|
supportsPromptCache = true;
|
|
16
|
+
// The gateway deprecated `temperature` for Opus 4.7+ and rejects requests
|
|
17
|
+
// that include it, so the harness strips it before the request is sent.
|
|
18
|
+
excludedParameters = ['temperature'];
|
|
19
|
+
// The Bedrock 4.6+ backend requires the `thinking.type: "adaptive"` shape and
|
|
20
|
+
// rejects the legacy `"enabled"` the bundled CLI defaults to for this model.
|
|
21
|
+
// Verified on the wire; see the harness thinking-mode probe.
|
|
22
|
+
thinkingMode = 'adaptive';
|
|
16
23
|
supportedFormats = [
|
|
17
24
|
{ name: 'png', mimeType: MimeType.Png, maxBytesPerFile: 3.75 * 1024 * 1024 },
|
|
18
25
|
{ name: 'jpeg', mimeType: MimeType.Jpeg, maxBytesPerFile: 3.75 * 1024 * 1024 },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Model, ModelName } from './model.js';
|
|
1
|
+
import { Model, ModelName, type ThinkingMode } from './model.js';
|
|
2
2
|
import { type SupportedFileFormat } from './types.js';
|
|
3
3
|
export declare class ClaudeSonnet45 extends Model {
|
|
4
4
|
readonly name: ModelName;
|
|
@@ -7,5 +7,6 @@ export declare class ClaudeSonnet45 extends Model {
|
|
|
7
7
|
readonly maxOutputTokens: number;
|
|
8
8
|
readonly contextWindow: number;
|
|
9
9
|
readonly supportsPromptCache: boolean;
|
|
10
|
+
readonly thinkingMode: ThinkingMode;
|
|
10
11
|
readonly supportedFormats: readonly SupportedFileFormat[];
|
|
11
12
|
}
|
|
@@ -12,6 +12,10 @@ export class ClaudeSonnet45 extends Model {
|
|
|
12
12
|
maxOutputTokens = 8192;
|
|
13
13
|
contextWindow = 200000;
|
|
14
14
|
supportsPromptCache = true;
|
|
15
|
+
// The Bedrock 4.5 backend accepts only the legacy `thinking.type: "enabled"`
|
|
16
|
+
// shape and rejects `"adaptive"` (which arrives with 4.6+). Verified on the
|
|
17
|
+
// wire; see the harness thinking-mode probe.
|
|
18
|
+
thinkingMode = 'enabled';
|
|
15
19
|
// Multimodal limits: 3.75 MiB / image, 4.5 MiB / PDF, 5 PDFs / request
|
|
16
20
|
// Reference: https://help.salesforce.com/s/articleView?id=ai.generative_ai_llm_multimodal_support.htm&type=5
|
|
17
21
|
supportedFormats = [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Model, ModelName } from './model.js';
|
|
1
|
+
import { Model, ModelName, type ThinkingMode } from './model.js';
|
|
2
2
|
import { type SupportedFileFormat } from './types.js';
|
|
3
3
|
export declare class ClaudeSonnet46 extends Model {
|
|
4
4
|
readonly name: ModelName;
|
|
@@ -7,5 +7,6 @@ export declare class ClaudeSonnet46 extends Model {
|
|
|
7
7
|
readonly maxOutputTokens: number;
|
|
8
8
|
readonly contextWindow: number;
|
|
9
9
|
readonly supportsPromptCache: boolean;
|
|
10
|
+
readonly thinkingMode: ThinkingMode;
|
|
10
11
|
readonly supportedFormats: readonly SupportedFileFormat[];
|
|
11
12
|
}
|
|
@@ -12,6 +12,10 @@ export class ClaudeSonnet46 extends Model {
|
|
|
12
12
|
maxOutputTokens = 16384;
|
|
13
13
|
contextWindow = 200000;
|
|
14
14
|
supportsPromptCache = true;
|
|
15
|
+
// The Bedrock 4.6+ backend requires the `thinking.type: "adaptive"` shape and
|
|
16
|
+
// rejects the legacy `"enabled"`. Verified on the wire; see the harness
|
|
17
|
+
// thinking-mode probe.
|
|
18
|
+
thinkingMode = 'adaptive';
|
|
15
19
|
// Multimodal limits: 3.75 MiB / image, 4.5 MiB / PDF, 5 PDFs / request
|
|
16
20
|
supportedFormats = [
|
|
17
21
|
{ name: 'png', mimeType: MimeType.Png, maxBytesPerFile: 3.75 * 1024 * 1024 },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Model } from './model.js';
|
|
1
|
+
import { Model, type ThinkingMode } from './model.js';
|
|
2
2
|
import { type SupportedFileFormat } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Optional overrides for {@link createClaudeModel}. Any field omitted falls back to a conservative
|
|
@@ -19,8 +19,15 @@ export type ClaudeModelOverrides = {
|
|
|
19
19
|
supportsPromptCache?: boolean;
|
|
20
20
|
/** Multimodal file format caps. Defaults to the Claude image+PDF caps. */
|
|
21
21
|
supportedFormats?: readonly SupportedFileFormat[];
|
|
22
|
-
/**
|
|
23
|
-
|
|
22
|
+
/** Generation parameters the gateway rejects for this model and the harness must strip. */
|
|
23
|
+
excludedParameters?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* How this model expects extended thinking to be requested on the wire
|
|
26
|
+
* (`'enabled'` for Claude 4.5, `'adaptive'` for 4.6+). Omit unless the
|
|
27
|
+
* harness's default thinking shape is wrong for this variant's gateway
|
|
28
|
+
* backend. See {@link Model.thinkingMode}.
|
|
29
|
+
*/
|
|
30
|
+
thinkingMode?: ThinkingMode;
|
|
24
31
|
/**
|
|
25
32
|
* Extra HTTP headers to attach to chat requests for this model. Use for vendor
|
|
26
33
|
* labels (`anthropic-version`, model-tag opt-in headers) only — reserved
|
|
@@ -42,8 +49,8 @@ export type ClaudeModelOverrides = {
|
|
|
42
49
|
*
|
|
43
50
|
* @example
|
|
44
51
|
* ```ts
|
|
45
|
-
* const model = createClaudeModel('
|
|
46
|
-
* displayId: 'Claude Opus 4.
|
|
52
|
+
* const model = createClaudeModel('sfdc_ai__DefaultBedrockAnthropicClaude49Opus', {
|
|
53
|
+
* displayId: 'Claude Opus 4.9',
|
|
47
54
|
* maxInputTokens: 1_000_000,
|
|
48
55
|
* contextWindow: 1_000_000,
|
|
49
56
|
* maxOutputTokens: 128_000,
|
|
@@ -24,8 +24,8 @@ const DEFAULT_CLAUDE_SUPPORTED_FORMATS = [
|
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```ts
|
|
27
|
-
* const model = createClaudeModel('
|
|
28
|
-
* displayId: 'Claude Opus 4.
|
|
27
|
+
* const model = createClaudeModel('sfdc_ai__DefaultBedrockAnthropicClaude49Opus', {
|
|
28
|
+
* displayId: 'Claude Opus 4.9',
|
|
29
29
|
* maxInputTokens: 1_000_000,
|
|
30
30
|
* contextWindow: 1_000_000,
|
|
31
31
|
* maxOutputTokens: 128_000,
|
|
@@ -44,7 +44,8 @@ class InlineClaudeModel extends Model {
|
|
|
44
44
|
contextWindow;
|
|
45
45
|
supportsPromptCache;
|
|
46
46
|
supportedFormats;
|
|
47
|
-
|
|
47
|
+
excludedParameters;
|
|
48
|
+
thinkingMode;
|
|
48
49
|
customHeaders;
|
|
49
50
|
constructor(gatewayId, overrides) {
|
|
50
51
|
super();
|
|
@@ -55,7 +56,8 @@ class InlineClaudeModel extends Model {
|
|
|
55
56
|
this.contextWindow = overrides.contextWindow ?? 200_000;
|
|
56
57
|
this.supportsPromptCache = overrides.supportsPromptCache ?? true;
|
|
57
58
|
this.supportedFormats = overrides.supportedFormats ?? DEFAULT_CLAUDE_SUPPORTED_FORMATS;
|
|
58
|
-
this.
|
|
59
|
+
this.excludedParameters = overrides.excludedParameters;
|
|
60
|
+
this.thinkingMode = overrides.thinkingMode;
|
|
59
61
|
this.customHeaders = overrides.customHeaders;
|
|
60
62
|
}
|
|
61
63
|
}
|
|
@@ -4,7 +4,7 @@ import { type SupportedFileFormat } from './types.js';
|
|
|
4
4
|
* GPT-5.1 on the geo-aware `sfdc_ai__Default*` gateway route — routes to the
|
|
5
5
|
* OpenAI Responses wire shape (Mastra harness). See W-23256760.
|
|
6
6
|
*/
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class GPT51 extends Model {
|
|
8
8
|
readonly name: ModelName;
|
|
9
9
|
readonly displayId: string;
|
|
10
10
|
readonly maxInputTokens: number;
|
|
@@ -8,9 +8,9 @@ import { MimeType } from './types.js';
|
|
|
8
8
|
* GPT-5.1 on the geo-aware `sfdc_ai__Default*` gateway route — routes to the
|
|
9
9
|
* OpenAI Responses wire shape (Mastra harness). See W-23256760.
|
|
10
10
|
*/
|
|
11
|
-
export class
|
|
12
|
-
name = ModelName.
|
|
13
|
-
displayId = 'GPT-5.1
|
|
11
|
+
export class GPT51 extends Model {
|
|
12
|
+
name = ModelName.GPT_5_1;
|
|
13
|
+
displayId = 'GPT-5.1';
|
|
14
14
|
// source of truth: https://git.soma.salesforce.com/a360/file-metadata/blob/master/fm-model-config/src/main/resources/ai/file-metadata/model/openai/llmgateway/OpenAIGPT51.yml
|
|
15
15
|
maxInputTokens = 272000;
|
|
16
16
|
maxOutputTokens = 128000;
|
|
@@ -22,4 +22,4 @@ export class GPT51Geo extends Model {
|
|
|
22
22
|
{ name: 'pdf', mimeType: MimeType.Pdf },
|
|
23
23
|
];
|
|
24
24
|
}
|
|
25
|
-
//# sourceMappingURL=gpt-5-1
|
|
25
|
+
//# sourceMappingURL=gpt-5-1.js.map
|
|
@@ -4,7 +4,7 @@ import { type SupportedFileFormat } from './types.js';
|
|
|
4
4
|
* GPT-5.2 on the geo-aware `sfdc_ai__Default*` gateway route — routes to the
|
|
5
5
|
* OpenAI Responses wire shape (Mastra harness). See W-23256760.
|
|
6
6
|
*/
|
|
7
|
-
export declare class
|
|
7
|
+
export declare class GPT52 extends Model {
|
|
8
8
|
readonly name: ModelName;
|
|
9
9
|
readonly displayId: string;
|
|
10
10
|
readonly maxInputTokens: number;
|
|
@@ -8,9 +8,9 @@ import { MimeType } from './types.js';
|
|
|
8
8
|
* GPT-5.2 on the geo-aware `sfdc_ai__Default*` gateway route — routes to the
|
|
9
9
|
* OpenAI Responses wire shape (Mastra harness). See W-23256760.
|
|
10
10
|
*/
|
|
11
|
-
export class
|
|
12
|
-
name = ModelName.
|
|
13
|
-
displayId = 'GPT-5.2
|
|
11
|
+
export class GPT52 extends Model {
|
|
12
|
+
name = ModelName.GPT_5_2;
|
|
13
|
+
displayId = 'GPT-5.2';
|
|
14
14
|
maxInputTokens = 272000;
|
|
15
15
|
maxOutputTokens = 128000;
|
|
16
16
|
contextWindow = 272000;
|
|
@@ -21,4 +21,4 @@ export class GPT52Geo extends Model {
|
|
|
21
21
|
{ name: 'pdf', mimeType: MimeType.Pdf },
|
|
22
22
|
];
|
|
23
23
|
}
|
|
24
|
-
//# sourceMappingURL=gpt-5-2
|
|
24
|
+
//# sourceMappingURL=gpt-5-2.js.map
|
package/dist/models/gpt-5-4.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Model, ModelName } from './model.js';
|
|
2
2
|
import { type SupportedFileFormat } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* GPT-5.4 on the geo-aware `sfdc_ai__DefaultGPT54` gateway route — routes to the
|
|
5
|
+
* OpenAI Responses wire shape (Mastra harness). The pinned `llmgateway__OpenAIGPT54`
|
|
6
|
+
* route was collapsed onto this geo id (W-23256760).
|
|
7
|
+
*/
|
|
3
8
|
export declare class GPT54 extends Model {
|
|
4
9
|
readonly name: ModelName;
|
|
5
10
|
readonly displayId: string;
|
package/dist/models/gpt-5-4.js
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Model, ModelName } from './model.js';
|
|
6
6
|
import { MimeType } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* GPT-5.4 on the geo-aware `sfdc_ai__DefaultGPT54` gateway route — routes to the
|
|
9
|
+
* OpenAI Responses wire shape (Mastra harness). The pinned `llmgateway__OpenAIGPT54`
|
|
10
|
+
* route was collapsed onto this geo id (W-23256760).
|
|
11
|
+
*/
|
|
7
12
|
export class GPT54 extends Model {
|
|
8
13
|
name = ModelName.GPT_5_4;
|
|
9
14
|
displayId = 'GPT-5.4';
|
package/dist/models/gpt-5.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Model, ModelName } from './model.js';
|
|
2
2
|
import { type SupportedFileFormat } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* GPT-5 on the geo-aware `sfdc_ai__DefaultGPT5` gateway route — routes to the
|
|
5
|
+
* OpenAI Responses wire shape (Mastra harness). The pinned `llmgateway__OpenAIGPT5`
|
|
6
|
+
* route was collapsed onto this geo id (W-23256760).
|
|
7
|
+
*/
|
|
3
8
|
export declare class GPT5 extends Model {
|
|
4
9
|
readonly name: ModelName;
|
|
5
10
|
readonly displayId: string;
|
package/dist/models/gpt-5.js
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Model, ModelName } from './model.js';
|
|
6
6
|
import { MimeType } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* GPT-5 on the geo-aware `sfdc_ai__DefaultGPT5` gateway route — routes to the
|
|
9
|
+
* OpenAI Responses wire shape (Mastra harness). The pinned `llmgateway__OpenAIGPT5`
|
|
10
|
+
* route was collapsed onto this geo id (W-23256760).
|
|
11
|
+
*/
|
|
7
12
|
export class GPT5 extends Model {
|
|
8
13
|
name = ModelName.GPT_5;
|
|
9
14
|
displayId = 'GPT-5';
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Model, ModelName } from './model.js';
|
|
2
|
-
export { Model, ModelName } from './model.js';
|
|
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
5
|
export { GPT5 } from './gpt-5.js';
|
|
6
|
+
export { GPT51 } from './gpt-5-1.js';
|
|
7
|
+
export { GPT52 } from './gpt-5-2.js';
|
|
6
8
|
export { GPT54 } from './gpt-5-4.js';
|
|
7
9
|
export { GPT55 } from './gpt-5-5.js';
|
|
8
|
-
export { GPT5Geo } from './gpt-5-geo.js';
|
|
9
|
-
export { GPT51Geo } from './gpt-5-1-geo.js';
|
|
10
|
-
export { GPT52Geo } from './gpt-5-2-geo.js';
|
|
11
|
-
export { GPT54Geo } from './gpt-5-4-geo.js';
|
|
12
10
|
export { ClaudeSonnet45 } from './claude-sonnet-4-5.js';
|
|
13
11
|
export { ClaudeSonnet46 } from './claude-sonnet-4-6.js';
|
|
14
12
|
export { ClaudeOpus45 } from './claude-opus-4-5.js';
|
|
@@ -16,6 +14,16 @@ export { ClaudeOpus46 } from './claude-opus-4-6.js';
|
|
|
16
14
|
export { ClaudeOpus47 } from './claude-opus-4-7.js';
|
|
17
15
|
export { ClaudeOpus48 } from './claude-opus-4-8.js';
|
|
18
16
|
export { createClaudeModel, type ClaudeModelOverrides } from './create-claude-model.js';
|
|
17
|
+
/**
|
|
18
|
+
* Legacy pinned wire-ids that predate the geo-aware `sfdc_ai__Default*` rename,
|
|
19
|
+
* mapped to their canonical {@link ModelName}. Consulted by {@link getByName} so an
|
|
20
|
+
* `AgentConfig` persisted before the rename still resolves to the current in-tree
|
|
21
|
+
* model — with canonical caps and prototype — instead of throwing on restore.
|
|
22
|
+
*
|
|
23
|
+
* Only the pinned ids that were REPLACED need entries; the geo GPT ids
|
|
24
|
+
* (`sfdc_ai__DefaultGPT5` etc.) are already live `ModelName` values.
|
|
25
|
+
*/
|
|
26
|
+
export declare const LEGACY_MODEL_ID_ALIASES: Readonly<Record<string, ModelName>>;
|
|
19
27
|
export declare function getDefault(): Model;
|
|
20
28
|
export declare function getByName(modelName: ModelName): Model;
|
|
21
29
|
export declare const Models: {
|
package/dist/models/index.js
CHANGED
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Model, ModelName } from './model.js';
|
|
6
6
|
import { GPT5 } from './gpt-5.js';
|
|
7
|
+
import { GPT51 } from './gpt-5-1.js';
|
|
8
|
+
import { GPT52 } from './gpt-5-2.js';
|
|
7
9
|
import { GPT54 } from './gpt-5-4.js';
|
|
8
10
|
import { GPT55 } from './gpt-5-5.js';
|
|
9
|
-
import { GPT5Geo } from './gpt-5-geo.js';
|
|
10
|
-
import { GPT51Geo } from './gpt-5-1-geo.js';
|
|
11
|
-
import { GPT52Geo } from './gpt-5-2-geo.js';
|
|
12
|
-
import { GPT54Geo } from './gpt-5-4-geo.js';
|
|
13
11
|
import { ClaudeSonnet45 } from './claude-sonnet-4-5.js';
|
|
14
12
|
import { ClaudeSonnet46 } from './claude-sonnet-4-6.js';
|
|
15
13
|
import { ClaudeOpus45 } from './claude-opus-4-5.js';
|
|
@@ -20,12 +18,10 @@ export { Model, ModelName } from './model.js';
|
|
|
20
18
|
export { MimeType } from './types.js';
|
|
21
19
|
export { validateMultimodalFiles, MAX_FILES_PER_REQUEST, MAX_TOTAL_FILE_BYTES } from './multimodal.js';
|
|
22
20
|
export { GPT5 } from './gpt-5.js';
|
|
21
|
+
export { GPT51 } from './gpt-5-1.js';
|
|
22
|
+
export { GPT52 } from './gpt-5-2.js';
|
|
23
23
|
export { GPT54 } from './gpt-5-4.js';
|
|
24
24
|
export { GPT55 } from './gpt-5-5.js';
|
|
25
|
-
export { GPT5Geo } from './gpt-5-geo.js';
|
|
26
|
-
export { GPT51Geo } from './gpt-5-1-geo.js';
|
|
27
|
-
export { GPT52Geo } from './gpt-5-2-geo.js';
|
|
28
|
-
export { GPT54Geo } from './gpt-5-4-geo.js';
|
|
29
25
|
export { ClaudeSonnet45 } from './claude-sonnet-4-5.js';
|
|
30
26
|
export { ClaudeSonnet46 } from './claude-sonnet-4-6.js';
|
|
31
27
|
export { ClaudeOpus45 } from './claude-opus-4-5.js';
|
|
@@ -33,35 +29,53 @@ export { ClaudeOpus46 } from './claude-opus-4-6.js';
|
|
|
33
29
|
export { ClaudeOpus47 } from './claude-opus-4-7.js';
|
|
34
30
|
export { ClaudeOpus48 } from './claude-opus-4-8.js';
|
|
35
31
|
export { createClaudeModel } from './create-claude-model.js';
|
|
32
|
+
/**
|
|
33
|
+
* Legacy pinned wire-ids that predate the geo-aware `sfdc_ai__Default*` rename,
|
|
34
|
+
* mapped to their canonical {@link ModelName}. Consulted by {@link getByName} so an
|
|
35
|
+
* `AgentConfig` persisted before the rename still resolves to the current in-tree
|
|
36
|
+
* model — with canonical caps and prototype — instead of throwing on restore.
|
|
37
|
+
*
|
|
38
|
+
* Only the pinned ids that were REPLACED need entries; the geo GPT ids
|
|
39
|
+
* (`sfdc_ai__DefaultGPT5` etc.) are already live `ModelName` values.
|
|
40
|
+
*/
|
|
41
|
+
export const LEGACY_MODEL_ID_ALIASES = {
|
|
42
|
+
llmgateway__OpenAIGPT5: ModelName.GPT_5,
|
|
43
|
+
llmgateway__OpenAIGPT54: ModelName.GPT_5_4,
|
|
44
|
+
llmgateway__OpenAIGPT55: ModelName.GPT_5_5,
|
|
45
|
+
llmgateway__BedrockAnthropicClaude45Sonnet: ModelName.CLAUDE_SONNET_4_5,
|
|
46
|
+
llmgateway__BedrockAnthropicClaude46Sonnet: ModelName.CLAUDE_SONNET_4_6,
|
|
47
|
+
llmgateway__BedrockAnthropicClaude45Opus: ModelName.CLAUDE_OPUS_4_5,
|
|
48
|
+
llmgateway__BedrockAnthropicClaude46Opus: ModelName.CLAUDE_OPUS_4_6,
|
|
49
|
+
llmgateway__BedrockAnthropicClaude47Opus: ModelName.CLAUDE_OPUS_4_7,
|
|
50
|
+
llmgateway__BedrockAnthropicClaude48Opus: ModelName.CLAUDE_OPUS_4_8,
|
|
51
|
+
};
|
|
36
52
|
export function getDefault() {
|
|
37
53
|
return new ClaudeSonnet46();
|
|
38
54
|
}
|
|
39
55
|
export function getByName(modelName) {
|
|
40
|
-
|
|
56
|
+
// Map a legacy pinned id to its canonical member; leave canonical ids untouched.
|
|
57
|
+
const canonical = LEGACY_MODEL_ID_ALIASES[modelName] ?? modelName;
|
|
58
|
+
if (canonical === ModelName.GPT_5)
|
|
41
59
|
return new GPT5();
|
|
42
|
-
if (
|
|
60
|
+
if (canonical === ModelName.GPT_5_1)
|
|
61
|
+
return new GPT51();
|
|
62
|
+
if (canonical === ModelName.GPT_5_2)
|
|
63
|
+
return new GPT52();
|
|
64
|
+
if (canonical === ModelName.GPT_5_4)
|
|
43
65
|
return new GPT54();
|
|
44
|
-
if (
|
|
66
|
+
if (canonical === ModelName.GPT_5_5)
|
|
45
67
|
return new GPT55();
|
|
46
|
-
if (
|
|
47
|
-
return new GPT5Geo();
|
|
48
|
-
if (modelName === ModelName.GPT_5_1_GEO)
|
|
49
|
-
return new GPT51Geo();
|
|
50
|
-
if (modelName === ModelName.GPT_5_2_GEO)
|
|
51
|
-
return new GPT52Geo();
|
|
52
|
-
if (modelName === ModelName.GPT_5_4_GEO)
|
|
53
|
-
return new GPT54Geo();
|
|
54
|
-
if (modelName === ModelName.CLAUDE_SONNET_4_5)
|
|
68
|
+
if (canonical === ModelName.CLAUDE_SONNET_4_5)
|
|
55
69
|
return new ClaudeSonnet45();
|
|
56
|
-
if (
|
|
70
|
+
if (canonical === ModelName.CLAUDE_SONNET_4_6)
|
|
57
71
|
return new ClaudeSonnet46();
|
|
58
|
-
if (
|
|
72
|
+
if (canonical === ModelName.CLAUDE_OPUS_4_5)
|
|
59
73
|
return new ClaudeOpus45();
|
|
60
|
-
if (
|
|
74
|
+
if (canonical === ModelName.CLAUDE_OPUS_4_6)
|
|
61
75
|
return new ClaudeOpus46();
|
|
62
|
-
if (
|
|
76
|
+
if (canonical === ModelName.CLAUDE_OPUS_4_7)
|
|
63
77
|
return new ClaudeOpus47();
|
|
64
|
-
if (
|
|
78
|
+
if (canonical === ModelName.CLAUDE_OPUS_4_8)
|
|
65
79
|
return new ClaudeOpus48();
|
|
66
80
|
throw new Error(`No model mapping exists for "${modelName}".`);
|
|
67
81
|
}
|
package/dist/models/model.d.ts
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import type { SupportedFileFormat } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* How a model expects extended-thinking / reasoning to be requested on the wire.
|
|
4
|
+
* Mirrors the Anthropic thinking-config discriminator:
|
|
5
|
+
*
|
|
6
|
+
* - `'enabled'` — the legacy fixed-budget shape (`thinking.type: "enabled"`).
|
|
7
|
+
* Required by the Bedrock-Anthropic Claude 4.5 generation; the 4.6+ backends
|
|
8
|
+
* reject it.
|
|
9
|
+
* - `'adaptive'` — the newer "model decides how much to think" shape
|
|
10
|
+
* (`thinking.type: "adaptive"`). Required by Claude Opus 4.6+ / Sonnet 4.6+;
|
|
11
|
+
* the 4.5 backends reject it.
|
|
12
|
+
* - `'disabled'` — no extended thinking.
|
|
13
|
+
*
|
|
14
|
+
* The two shapes are NOT interchangeable across model versions — see
|
|
15
|
+
* {@link Model.thinkingMode}.
|
|
16
|
+
*/
|
|
17
|
+
export type ThinkingMode = 'enabled' | 'adaptive' | 'disabled';
|
|
2
18
|
/**
|
|
3
19
|
* The canonical Salesforce LLM-Gateway model ids the SDK ships in-tree.
|
|
20
|
+
*
|
|
21
|
+
* The ids use the geo-aware `sfdc_ai__Default*` prefix: the gateway resolves
|
|
22
|
+
* the regional deployment for data-residency, latency, and failover, rather
|
|
23
|
+
* than pinning a single deployment. This replaced the older pinned
|
|
24
|
+
* `llmgateway__*` prefix, which the gateway advised against because it may not
|
|
25
|
+
* honor fallback (W-23256760). The pinned OpenAI + geo OpenAI members that used
|
|
26
|
+
* to coexist were collapsed onto their single geo id. Legacy pinned strings
|
|
27
|
+
* still resolve via {@link Models.getByName} through a back-compat alias map so
|
|
28
|
+
* persisted `AgentConfig`s keep restoring.
|
|
29
|
+
*
|
|
4
30
|
* Consumer-built variants via {@link createClaudeModel} carry an arbitrary
|
|
5
31
|
* gateway id string (the escape hatch for Bedrock-Anthropic Claude
|
|
6
32
|
* variants the SDK has not released yet); cross-harness code that
|
|
@@ -10,19 +36,17 @@ import type { SupportedFileFormat } from './types.js';
|
|
|
10
36
|
* silently miss escape-hatch ids.
|
|
11
37
|
*/
|
|
12
38
|
export declare enum ModelName {
|
|
13
|
-
GPT_5 = "
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
CLAUDE_OPUS_4_7 = "llmgateway__BedrockAnthropicClaude47Opus",
|
|
25
|
-
CLAUDE_OPUS_4_8 = "llmgateway__BedrockAnthropicClaude48Opus"
|
|
39
|
+
GPT_5 = "sfdc_ai__DefaultGPT5",
|
|
40
|
+
GPT_5_1 = "sfdc_ai__DefaultGPT51",
|
|
41
|
+
GPT_5_2 = "sfdc_ai__DefaultGPT52",
|
|
42
|
+
GPT_5_4 = "sfdc_ai__DefaultGPT54",
|
|
43
|
+
GPT_5_5 = "sfdc_ai__DefaultGPT55",
|
|
44
|
+
CLAUDE_SONNET_4_5 = "sfdc_ai__DefaultBedrockAnthropicClaude45Sonnet",
|
|
45
|
+
CLAUDE_SONNET_4_6 = "sfdc_ai__DefaultBedrockAnthropicClaude46Sonnet",
|
|
46
|
+
CLAUDE_OPUS_4_5 = "sfdc_ai__DefaultBedrockAnthropicClaude45Opus",
|
|
47
|
+
CLAUDE_OPUS_4_6 = "sfdc_ai__DefaultBedrockAnthropicClaude46Opus",
|
|
48
|
+
CLAUDE_OPUS_4_7 = "sfdc_ai__DefaultBedrockAnthropicClaude47Opus",
|
|
49
|
+
CLAUDE_OPUS_4_8 = "sfdc_ai__DefaultBedrockAnthropicClaude48Opus"
|
|
26
50
|
}
|
|
27
51
|
/**
|
|
28
52
|
* Abstract description of a model the SDK / harness can talk to. Used for:
|
|
@@ -55,7 +79,34 @@ export declare abstract class Model {
|
|
|
55
79
|
* empty array means the model is text-only.
|
|
56
80
|
*/
|
|
57
81
|
abstract readonly supportedFormats: readonly SupportedFileFormat[];
|
|
58
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Denylist of generation parameters the LLM Gateway rejects for this
|
|
84
|
+
* model. Harnesses consult it before forwarding a generation parameter —
|
|
85
|
+
* currently only `temperature`, which the gateway deprecated for Claude
|
|
86
|
+
* Opus 4.7+ and now rejects. A model that lists a parameter here has it
|
|
87
|
+
* stripped from the outbound request.
|
|
88
|
+
*
|
|
89
|
+
* `undefined` (the default) means nothing is excluded: every parameter the
|
|
90
|
+
* harness would send is forwarded. Set it only for models that must
|
|
91
|
+
* suppress a parameter the gateway no longer accepts.
|
|
92
|
+
*/
|
|
93
|
+
readonly excludedParameters?: string[];
|
|
94
|
+
/**
|
|
95
|
+
* How this model expects extended thinking to be requested on the wire, when
|
|
96
|
+
* a harness that drives reasoning models (e.g. the Claude harness) would
|
|
97
|
+
* otherwise send a thinking config. The two Anthropic shapes are not
|
|
98
|
+
* interchangeable across model generations — the Bedrock-Anthropic backend
|
|
99
|
+
* rejects `thinking.type: "enabled"` for Claude 4.6+ and rejects
|
|
100
|
+
* `thinking.type: "adaptive"` for Claude 4.5 — so the accepted shape is a
|
|
101
|
+
* per-model property the harness must consult rather than assume.
|
|
102
|
+
*
|
|
103
|
+
* `undefined` (the default) means the harness uses whatever thinking config
|
|
104
|
+
* it would natively send (for the Claude harness, the bundled CLI's per-model
|
|
105
|
+
* default). Set it only for models where that default is wrong for the
|
|
106
|
+
* gateway — currently the in-tree Claude models, which pin `'enabled'` (4.5)
|
|
107
|
+
* or `'adaptive'` (4.6+).
|
|
108
|
+
*/
|
|
109
|
+
readonly thinkingMode?: ThinkingMode;
|
|
59
110
|
/**
|
|
60
111
|
* Vendor-specific HTTP headers to add to every outbound request for this model
|
|
61
112
|
* (e.g. `anthropic-version`, model-tag opt-in headers). Merged with the
|
package/dist/models/model.js
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* The canonical Salesforce LLM-Gateway model ids the SDK ships in-tree.
|
|
7
|
+
*
|
|
8
|
+
* The ids use the geo-aware `sfdc_ai__Default*` prefix: the gateway resolves
|
|
9
|
+
* the regional deployment for data-residency, latency, and failover, rather
|
|
10
|
+
* than pinning a single deployment. This replaced the older pinned
|
|
11
|
+
* `llmgateway__*` prefix, which the gateway advised against because it may not
|
|
12
|
+
* honor fallback (W-23256760). The pinned OpenAI + geo OpenAI members that used
|
|
13
|
+
* to coexist were collapsed onto their single geo id. Legacy pinned strings
|
|
14
|
+
* still resolve via {@link Models.getByName} through a back-compat alias map so
|
|
15
|
+
* persisted `AgentConfig`s keep restoring.
|
|
16
|
+
*
|
|
7
17
|
* Consumer-built variants via {@link createClaudeModel} carry an arbitrary
|
|
8
18
|
* gateway id string (the escape hatch for Bedrock-Anthropic Claude
|
|
9
19
|
* variants the SDK has not released yet); cross-harness code that
|
|
@@ -14,22 +24,17 @@
|
|
|
14
24
|
*/
|
|
15
25
|
export var ModelName;
|
|
16
26
|
(function (ModelName) {
|
|
17
|
-
ModelName["GPT_5"] = "
|
|
18
|
-
ModelName["
|
|
19
|
-
ModelName["
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
ModelName["
|
|
24
|
-
ModelName["
|
|
25
|
-
ModelName["
|
|
26
|
-
ModelName["
|
|
27
|
-
ModelName["
|
|
28
|
-
ModelName["CLAUDE_SONNET_4_6"] = "llmgateway__BedrockAnthropicClaude46Sonnet";
|
|
29
|
-
ModelName["CLAUDE_OPUS_4_5"] = "llmgateway__BedrockAnthropicClaude45Opus";
|
|
30
|
-
ModelName["CLAUDE_OPUS_4_6"] = "llmgateway__BedrockAnthropicClaude46Opus";
|
|
31
|
-
ModelName["CLAUDE_OPUS_4_7"] = "llmgateway__BedrockAnthropicClaude47Opus";
|
|
32
|
-
ModelName["CLAUDE_OPUS_4_8"] = "llmgateway__BedrockAnthropicClaude48Opus";
|
|
27
|
+
ModelName["GPT_5"] = "sfdc_ai__DefaultGPT5";
|
|
28
|
+
ModelName["GPT_5_1"] = "sfdc_ai__DefaultGPT51";
|
|
29
|
+
ModelName["GPT_5_2"] = "sfdc_ai__DefaultGPT52";
|
|
30
|
+
ModelName["GPT_5_4"] = "sfdc_ai__DefaultGPT54";
|
|
31
|
+
ModelName["GPT_5_5"] = "sfdc_ai__DefaultGPT55";
|
|
32
|
+
ModelName["CLAUDE_SONNET_4_5"] = "sfdc_ai__DefaultBedrockAnthropicClaude45Sonnet";
|
|
33
|
+
ModelName["CLAUDE_SONNET_4_6"] = "sfdc_ai__DefaultBedrockAnthropicClaude46Sonnet";
|
|
34
|
+
ModelName["CLAUDE_OPUS_4_5"] = "sfdc_ai__DefaultBedrockAnthropicClaude45Opus";
|
|
35
|
+
ModelName["CLAUDE_OPUS_4_6"] = "sfdc_ai__DefaultBedrockAnthropicClaude46Opus";
|
|
36
|
+
ModelName["CLAUDE_OPUS_4_7"] = "sfdc_ai__DefaultBedrockAnthropicClaude47Opus";
|
|
37
|
+
ModelName["CLAUDE_OPUS_4_8"] = "sfdc_ai__DefaultBedrockAnthropicClaude48Opus";
|
|
33
38
|
})(ModelName || (ModelName = {}));
|
|
34
39
|
/**
|
|
35
40
|
* Abstract description of a model the SDK / harness can talk to. Used for:
|
|
@@ -51,7 +56,34 @@ export var ModelName;
|
|
|
51
56
|
* Reference: https://docs.internal.salesforce.com/ai/einstein/gateway/models-and-providers/
|
|
52
57
|
*/
|
|
53
58
|
export class Model {
|
|
54
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Denylist of generation parameters the LLM Gateway rejects for this
|
|
61
|
+
* model. Harnesses consult it before forwarding a generation parameter —
|
|
62
|
+
* currently only `temperature`, which the gateway deprecated for Claude
|
|
63
|
+
* Opus 4.7+ and now rejects. A model that lists a parameter here has it
|
|
64
|
+
* stripped from the outbound request.
|
|
65
|
+
*
|
|
66
|
+
* `undefined` (the default) means nothing is excluded: every parameter the
|
|
67
|
+
* harness would send is forwarded. Set it only for models that must
|
|
68
|
+
* suppress a parameter the gateway no longer accepts.
|
|
69
|
+
*/
|
|
70
|
+
excludedParameters;
|
|
71
|
+
/**
|
|
72
|
+
* How this model expects extended thinking to be requested on the wire, when
|
|
73
|
+
* a harness that drives reasoning models (e.g. the Claude harness) would
|
|
74
|
+
* otherwise send a thinking config. The two Anthropic shapes are not
|
|
75
|
+
* interchangeable across model generations — the Bedrock-Anthropic backend
|
|
76
|
+
* rejects `thinking.type: "enabled"` for Claude 4.6+ and rejects
|
|
77
|
+
* `thinking.type: "adaptive"` for Claude 4.5 — so the accepted shape is a
|
|
78
|
+
* per-model property the harness must consult rather than assume.
|
|
79
|
+
*
|
|
80
|
+
* `undefined` (the default) means the harness uses whatever thinking config
|
|
81
|
+
* it would natively send (for the Claude harness, the bundled CLI's per-model
|
|
82
|
+
* default). Set it only for models where that default is wrong for the
|
|
83
|
+
* gateway — currently the in-tree Claude models, which pin `'enabled'` (4.5)
|
|
84
|
+
* or `'adaptive'` (4.6+).
|
|
85
|
+
*/
|
|
86
|
+
thinkingMode;
|
|
55
87
|
/**
|
|
56
88
|
* Vendor-specific HTTP headers to add to every outbound request for this model
|
|
57
89
|
* (e.g. `anthropic-version`, model-tag opt-in headers). Merged with the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/sfdx-agent-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.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.
|
|
50
|
-
"@salesforce/sfdx-agent-harness-mastra": "0.
|
|
50
|
+
"@salesforce/sfdx-agent-harness-claude": "0.31.0",
|
|
51
|
+
"@salesforce/sfdx-agent-harness-mastra": "0.34.0",
|
|
52
|
+
"@salesforce/sfdx-agent-harness-openai": "0.0.1",
|
|
51
53
|
"@types/node": "^22.20.0",
|
|
52
54
|
"@vitest/coverage-istanbul": "^4.1.10",
|
|
53
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
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.
|
|
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",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Model, ModelName } from './model.js';
|
|
2
|
-
import { type SupportedFileFormat } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* GPT-5.4 on the geo-aware `sfdc_ai__Default*` gateway route — the regional
|
|
5
|
-
* counterpart to the pinned `llmgateway__OpenAIGPT54` route ({@link GPT54}).
|
|
6
|
-
* Routes to the OpenAI Responses wire shape (Mastra harness). See W-23256760.
|
|
7
|
-
*/
|
|
8
|
-
export declare class GPT54Geo extends Model {
|
|
9
|
-
readonly name: ModelName;
|
|
10
|
-
readonly displayId: string;
|
|
11
|
-
readonly maxInputTokens: number;
|
|
12
|
-
readonly maxOutputTokens: number;
|
|
13
|
-
readonly contextWindow: number;
|
|
14
|
-
readonly supportsPromptCache: boolean;
|
|
15
|
-
readonly supportedFormats: readonly SupportedFileFormat[];
|
|
16
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
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-5.4 on the geo-aware `sfdc_ai__Default*` gateway route — the regional
|
|
9
|
-
* counterpart to the pinned `llmgateway__OpenAIGPT54` route ({@link GPT54}).
|
|
10
|
-
* Routes to the OpenAI Responses wire shape (Mastra harness). See W-23256760.
|
|
11
|
-
*/
|
|
12
|
-
export class GPT54Geo extends Model {
|
|
13
|
-
name = ModelName.GPT_5_4_GEO;
|
|
14
|
-
displayId = 'GPT-5.4 (geo-aware)';
|
|
15
|
-
// Source of truth: https://git.soma.salesforce.com/a360/file-metadata/blob/master/fm-model-config/src/main/resources/ai/file-metadata/model/openai/llmgateway/OpenAIGPT54.yml
|
|
16
|
-
maxInputTokens = 1050000;
|
|
17
|
-
maxOutputTokens = 128000;
|
|
18
|
-
contextWindow = 1050000;
|
|
19
|
-
supportsPromptCache = false;
|
|
20
|
-
supportedFormats = [
|
|
21
|
-
{ name: 'png', mimeType: MimeType.Png },
|
|
22
|
-
{ name: 'jpeg', mimeType: MimeType.Jpeg },
|
|
23
|
-
{ name: 'pdf', mimeType: MimeType.Pdf },
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=gpt-5-4-geo.js.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Model, ModelName } from './model.js';
|
|
2
|
-
import { type SupportedFileFormat } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* GPT-5 on the geo-aware `sfdc_ai__Default*` gateway route — the gateway
|
|
5
|
-
* picks the regional OpenAI deployment, distinct from the pinned
|
|
6
|
-
* `llmgateway__OpenAIGPT5` route ({@link GPT5}). Routes to the OpenAI
|
|
7
|
-
* Responses wire shape (Mastra harness). See W-23256760.
|
|
8
|
-
*/
|
|
9
|
-
export declare class GPT5Geo 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
|
-
}
|
package/dist/models/gpt-5-geo.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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-5 on the geo-aware `sfdc_ai__Default*` gateway route — the gateway
|
|
9
|
-
* picks the regional OpenAI deployment, distinct from the pinned
|
|
10
|
-
* `llmgateway__OpenAIGPT5` route ({@link GPT5}). Routes to the OpenAI
|
|
11
|
-
* Responses wire shape (Mastra harness). See W-23256760.
|
|
12
|
-
*/
|
|
13
|
-
export class GPT5Geo extends Model {
|
|
14
|
-
name = ModelName.GPT_5_GEO;
|
|
15
|
-
displayId = 'GPT-5 (geo-aware)';
|
|
16
|
-
// Reference: https://git.soma.salesforce.com/a360/file-metadata/blob/master/fm-model-config/src/main/resources/ai/file-metadata/model/openai/sfdc_ai/DefaultOpenAIGPT5.yml
|
|
17
|
-
maxInputTokens = 272000;
|
|
18
|
-
maxOutputTokens = 128000;
|
|
19
|
-
contextWindow = 272000;
|
|
20
|
-
supportsPromptCache = false;
|
|
21
|
-
// same as gpt-5
|
|
22
|
-
supportedFormats = [
|
|
23
|
-
{ name: 'png', mimeType: MimeType.Png },
|
|
24
|
-
{ name: 'jpeg', mimeType: MimeType.Jpeg },
|
|
25
|
-
{ name: 'pdf', mimeType: MimeType.Pdf },
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=gpt-5-geo.js.map
|