@salesforce/sfdx-agent-harness-mastra 0.32.0 → 0.34.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,23 @@
|
|
|
3
3
|
All notable changes to `@salesforce/sfdx-agent-harness-mastra` are documented in this file.
|
|
4
4
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
5
|
|
|
6
|
+
## [0.34.0] - 2026-07-22
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
- **harness-openai**: scaffold OpenAI Agents SDK harness with connectivity + streamed turn @W-23447570@ ([#675](https://github.com/forcedotcom/agentic-dx/pull/675))
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
- **ci**: bump openai harness off seed version so it can publish @W-23447579@ ([#686](https://github.com/forcedotcom/agentic-dx/pull/686))
|
|
13
|
+
|
|
14
|
+
### Chores
|
|
15
|
+
- **deps**: bump @anthropic-ai/sdk from 0.106.0 to 0.111.0 ([#682](https://github.com/forcedotcom/agentic-dx/pull/682))
|
|
16
|
+
- **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))
|
|
17
|
+
|
|
18
|
+
## [0.33.0] - 2026-07-15
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
- **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))
|
|
22
|
+
|
|
6
23
|
## [0.32.0] - 2026-07-14
|
|
7
24
|
|
|
8
25
|
### Features
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { AnthropicBedrock } from '@anthropic-ai/bedrock-sdk';
|
|
6
6
|
import Anthropic from '@anthropic-ai/sdk';
|
|
7
|
-
import { TextSpanLifecycle, createGatewayFetch, isEmptyUsage, mapAnthropicFinishReason, mapAnthropicUsage, toolResultOutputToString, } from './v3-stream-mapping.js';
|
|
7
|
+
import { TextSpanLifecycle, createGatewayFetch, isEmptyUsage, isParameterExcluded, mapAnthropicFinishReason, mapAnthropicUsage, toolResultOutputToString, } from './v3-stream-mapping.js';
|
|
8
8
|
/**
|
|
9
9
|
* Builds the in-process `LanguageModelV3` impl for the Salesforce LLM Gateway's
|
|
10
10
|
* `/invoke-with-response-stream` (Bedrock-Anthropic pass-through) endpoint.
|
|
@@ -156,8 +156,11 @@ async function buildAnthropicRequest(ctx, options) {
|
|
|
156
156
|
commonParams.system = system;
|
|
157
157
|
if (tools.length > 0)
|
|
158
158
|
commonParams.tools = tools;
|
|
159
|
-
|
|
159
|
+
// The gateway deprecated `temperature` for Claude Opus 4.7+ and rejects the
|
|
160
|
+
// request if it's present; drop it when the bound model excludes it.
|
|
161
|
+
if (options.temperature !== undefined && !isParameterExcluded(info.model, 'temperature')) {
|
|
160
162
|
commonParams.temperature = options.temperature;
|
|
163
|
+
}
|
|
161
164
|
if (options.stopSequences !== undefined)
|
|
162
165
|
commonParams.stop_sequences = [...options.stopSequences];
|
|
163
166
|
return { client, commonParams };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.txt for license terms.
|
|
4
4
|
*/
|
|
5
5
|
import OpenAI from 'openai';
|
|
6
|
-
import { TextSpanLifecycle, createGatewayFetch, isEmptyUsage, mapOpenAIUsage, toolResultOutputToString, } from './v3-stream-mapping.js';
|
|
6
|
+
import { TextSpanLifecycle, createGatewayFetch, isEmptyUsage, isParameterExcluded, mapOpenAIUsage, toolResultOutputToString, } from './v3-stream-mapping.js';
|
|
7
7
|
/**
|
|
8
8
|
* Builds the in-process `LanguageModelV3` impl that drives the `openai` SDK's
|
|
9
9
|
* `chat.completions.create({ stream: true })` against an OpenAI-compatible
|
|
@@ -62,7 +62,11 @@ async function buildRequest(ctx, options) {
|
|
|
62
62
|
model: info.nativeModelId,
|
|
63
63
|
messages,
|
|
64
64
|
...(tools.length > 0 ? { tools } : {}),
|
|
65
|
-
|
|
65
|
+
// The gateway deprecated `temperature` for Claude Opus 4.7+ and rejects
|
|
66
|
+
// the request if it's present; drop it when the bound model excludes it.
|
|
67
|
+
...(options.temperature !== undefined && !isParameterExcluded(info.model, 'temperature')
|
|
68
|
+
? { temperature: options.temperature }
|
|
69
|
+
: {}),
|
|
66
70
|
...(options.maxOutputTokens !== undefined ? { max_tokens: options.maxOutputTokens } : {}),
|
|
67
71
|
...(options.stopSequences !== undefined && options.stopSequences.length > 0
|
|
68
72
|
? { stop: [...options.stopSequences] }
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* See LICENSE.txt for license terms.
|
|
4
4
|
*/
|
|
5
5
|
import OpenAI from 'openai';
|
|
6
|
-
import { TextSpanLifecycle, createGatewayFetch, isEmptyUsage, mapOpenAIFinishReason, mapOpenAIUsage, toolResultOutputToString, } from './v3-stream-mapping.js';
|
|
6
|
+
import { TextSpanLifecycle, createGatewayFetch, isEmptyUsage, isParameterExcluded, mapOpenAIFinishReason, mapOpenAIUsage, toolResultOutputToString, } from './v3-stream-mapping.js';
|
|
7
7
|
/**
|
|
8
8
|
* Builds the in-process `LanguageModelV3` impl that drives the `openai` SDK's
|
|
9
9
|
* `responses.create({ stream: true })` against the Salesforce LLM Gateway's
|
|
@@ -63,7 +63,11 @@ async function buildOpenAIRequest(ctx, options) {
|
|
|
63
63
|
input,
|
|
64
64
|
...(instructions !== undefined ? { instructions } : {}),
|
|
65
65
|
...(tools.length > 0 ? { tools } : {}),
|
|
66
|
-
|
|
66
|
+
// The gateway deprecated `temperature` for Claude Opus 4.7+ and rejects
|
|
67
|
+
// the request if it's present; drop it when the bound model excludes it.
|
|
68
|
+
...(options.temperature !== undefined && !isParameterExcluded(info.model, 'temperature')
|
|
69
|
+
? { temperature: options.temperature }
|
|
70
|
+
: {}),
|
|
67
71
|
...(options.maxOutputTokens !== undefined ? { max_output_tokens: options.maxOutputTokens } : {}),
|
|
68
72
|
};
|
|
69
73
|
return { client, commonParams };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LanguageModelV3FinishReason, LanguageModelV3StreamPart, LanguageModelV3ToolResultOutput, LanguageModelV3Usage } from '@ai-sdk/provider';
|
|
2
2
|
import { Clock } from '@salesforce/agentic-common';
|
|
3
|
+
import type { Model } from '@salesforce/sfdx-agent-sdk';
|
|
3
4
|
/**
|
|
4
5
|
* Shared V3 helpers for the Mastra harness's `LanguageModelV3` implementations
|
|
5
6
|
* — stream-shaping primitives, finish-reason / usage mappers, prompt-translation
|
|
@@ -11,6 +12,21 @@ import { Clock } from '@salesforce/agentic-common';
|
|
|
11
12
|
* the lifecycle invariants those parts have to honor — drift between any two
|
|
12
13
|
* paths is a TS compile error rather than a silent wire-shape divergence.
|
|
13
14
|
*/
|
|
15
|
+
/**
|
|
16
|
+
* Whether a generation parameter must be stripped from the outbound request
|
|
17
|
+
* for this model.
|
|
18
|
+
*
|
|
19
|
+
* `Model.excludedParameters` is a denylist of generation parameters the LLM
|
|
20
|
+
* Gateway rejects for the model. The pass-through builders consult it before
|
|
21
|
+
* forwarding a parameter — today only `temperature`, which the gateway
|
|
22
|
+
* deprecated for Claude Opus 4.7+ and now rejects. A model that lists a
|
|
23
|
+
* parameter here has it dropped from the request.
|
|
24
|
+
*
|
|
25
|
+
* `undefined` (the default) means nothing is excluded — every parameter the
|
|
26
|
+
* harness would send is forwarded. Only models that need to suppress a
|
|
27
|
+
* deprecated parameter declare `excludedParameters`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isParameterExcluded(model: Model, parameter: string): boolean;
|
|
14
30
|
/**
|
|
15
31
|
* Encodes the AI SDK V3 text-span lifecycle (`text-start` / `text-delta` /
|
|
16
32
|
* `text-end`) and the rotation that must happen around tool calls.
|
|
@@ -14,6 +14,23 @@ import { Clock, RealClock } from '@salesforce/agentic-common';
|
|
|
14
14
|
* the lifecycle invariants those parts have to honor — drift between any two
|
|
15
15
|
* paths is a TS compile error rather than a silent wire-shape divergence.
|
|
16
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* Whether a generation parameter must be stripped from the outbound request
|
|
19
|
+
* for this model.
|
|
20
|
+
*
|
|
21
|
+
* `Model.excludedParameters` is a denylist of generation parameters the LLM
|
|
22
|
+
* Gateway rejects for the model. The pass-through builders consult it before
|
|
23
|
+
* forwarding a parameter — today only `temperature`, which the gateway
|
|
24
|
+
* deprecated for Claude Opus 4.7+ and now rejects. A model that lists a
|
|
25
|
+
* parameter here has it dropped from the request.
|
|
26
|
+
*
|
|
27
|
+
* `undefined` (the default) means nothing is excluded — every parameter the
|
|
28
|
+
* harness would send is forwarded. Only models that need to suppress a
|
|
29
|
+
* deprecated parameter declare `excludedParameters`.
|
|
30
|
+
*/
|
|
31
|
+
export function isParameterExcluded(model, parameter) {
|
|
32
|
+
return model.excludedParameters?.includes(parameter) ?? false;
|
|
33
|
+
}
|
|
17
34
|
/**
|
|
18
35
|
* Encodes the AI SDK V3 text-span lifecycle (`text-start` / `text-delta` /
|
|
19
36
|
* `text-end`) and the rotation that must happen around tool calls.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/sfdx-agent-harness-mastra",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Mastra-backed AgentHarness implementation for @salesforce/sfdx-agent-sdk",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@ai-sdk/provider": "^3.0.10",
|
|
33
33
|
"@anthropic-ai/bedrock-sdk": "^0.32.0",
|
|
34
|
-
"@anthropic-ai/sdk": "^0.
|
|
34
|
+
"@anthropic-ai/sdk": "^0.111.0",
|
|
35
35
|
"@mastra/core": "^1.50.1",
|
|
36
36
|
"@mastra/libsql": "^1.15.1",
|
|
37
37
|
"@mastra/mcp": "^1.13.1",
|
|
@@ -41,20 +41,20 @@
|
|
|
41
41
|
"openai": "^6.0.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@salesforce/sfdx-agent-sdk": "0.
|
|
44
|
+
"@salesforce/sfdx-agent-sdk": "0.35.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@eslint/js": "^10.0.1",
|
|
48
48
|
"@salesforce/harness-conformance": "0.0.1",
|
|
49
|
-
"@salesforce/sfdx-agent-sdk": "0.
|
|
49
|
+
"@salesforce/sfdx-agent-sdk": "0.35.0",
|
|
50
50
|
"@types/node": "^22.20.0",
|
|
51
51
|
"@vitest/coverage-istanbul": "^4.1.10",
|
|
52
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
52
|
+
"@vitest/eslint-plugin": "^1.6.22",
|
|
53
53
|
"eslint": "^10.7.0",
|
|
54
54
|
"eslint-config-prettier": "^10.1.8",
|
|
55
55
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
56
56
|
"eslint-plugin-import": "^2.32.0",
|
|
57
|
-
"eslint-plugin-n": "^18.2.
|
|
57
|
+
"eslint-plugin-n": "^18.2.1",
|
|
58
58
|
"globals": "^17.6.0",
|
|
59
59
|
"lint-staged": "^17.0.7",
|
|
60
60
|
"prettier": "^3.9.4",
|