@ai-sdk/harness-deepagents 1.0.101 → 1.0.103

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
@@ -1,5 +1,26 @@
1
1
  # @ai-sdk/harness-deepagents
2
2
 
3
+ ## 1.0.103
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9e1d1b2]
8
+ - Updated dependencies [a495511]
9
+ - @ai-sdk/provider-utils@5.0.37
10
+ - @ai-sdk/harness@1.0.103
11
+
12
+ ## 1.0.102
13
+
14
+ ### Patch Changes
15
+
16
+ - eeed977: feat(harness): allow passing arbitrary headers with inference requests via `headers` property in `HarnessAgentSettings`
17
+ - a39c8bf: chore(harness): clarify `writeSkills` helper intent to require materializing skills in HOME directory
18
+ - Updated dependencies [fe86f8f]
19
+ - Updated dependencies [255cccf]
20
+ - Updated dependencies [eeed977]
21
+ - Updated dependencies [a39c8bf]
22
+ - @ai-sdk/harness@1.0.102
23
+
3
24
  ## 1.0.101
4
25
 
5
26
  ### Patch Changes
@@ -2135,7 +2135,8 @@ function parseArgs(rawArgs) {
2135
2135
  function buildModel({
2136
2136
  rawModel,
2137
2137
  thinking,
2138
- effort
2138
+ effort,
2139
+ headers
2139
2140
  }) {
2140
2141
  if (!rawModel) return void 0;
2141
2142
  const baseUrl = procEnv2.ANTHROPIC_BASE_URL;
@@ -2146,11 +2147,14 @@ function buildModel({
2146
2147
  ...effort ? { outputConfig: { effort } } : {},
2147
2148
  ...procEnv2.ANTHROPIC_API_KEY ? { apiKey: procEnv2.ANTHROPIC_API_KEY } : {},
2148
2149
  ...baseUrl ? { anthropicApiUrl: baseUrl } : {},
2149
- ...procEnv2.AI_GATEWAY_API_KEY && HARNESS_CLIENT_APP ? {
2150
+ ...headers != null || procEnv2.AI_GATEWAY_API_KEY ? {
2150
2151
  clientOptions: {
2151
2152
  defaultHeaders: {
2152
- "User-Agent": HARNESS_CLIENT_APP,
2153
- "x-client-app": HARNESS_CLIENT_APP
2153
+ ...headers,
2154
+ ...procEnv2.AI_GATEWAY_API_KEY && HARNESS_CLIENT_APP ? {
2155
+ "User-Agent": HARNESS_CLIENT_APP,
2156
+ "x-client-app": HARNESS_CLIENT_APP
2157
+ } : {}
2154
2158
  }
2155
2159
  }
2156
2160
  } : {}
@@ -2160,14 +2164,15 @@ function createModelMiddleware() {
2160
2164
  return createMiddleware({
2161
2165
  name: "harnessModel",
2162
2166
  wrapModelCall: async (request, handler) => {
2163
- if (!activeModel && !activeThinking && !activeEffort) {
2167
+ if (!activeModel && !activeThinking && !activeEffort && !activeHeaders) {
2164
2168
  return handler(request);
2165
2169
  }
2166
2170
  if (activeModel) {
2167
2171
  const configuredModel2 = buildModel({
2168
2172
  rawModel: activeModel,
2169
2173
  thinking: activeThinking,
2170
- effort: activeEffort
2174
+ effort: activeEffort,
2175
+ headers: activeHeaders
2171
2176
  });
2172
2177
  if (!configuredModel2) throw new Error("Deep Agents model is missing");
2173
2178
  return handler({ ...request, model: configuredModel2 });
@@ -2182,7 +2187,8 @@ function createModelMiddleware() {
2182
2187
  const configuredModel = buildModel({
2183
2188
  rawModel: model.model,
2184
2189
  thinking: activeThinking,
2185
- effort: activeEffort
2190
+ effort: activeEffort,
2191
+ headers: activeHeaders
2186
2192
  });
2187
2193
  if (!configuredModel) throw new Error("Deep Agents model is missing");
2188
2194
  return handler({ ...request, model: configuredModel });
@@ -2215,6 +2221,7 @@ var agentConfigurationSignature;
2215
2221
  var activeModel;
2216
2222
  var activeThinking;
2217
2223
  var activeEffort;
2224
+ var activeHeaders;
2218
2225
  var modelMiddleware = createModelMiddleware();
2219
2226
  var responseFormatMiddleware = createMiddleware({
2220
2227
  name: "HarnessResponseFormat",
@@ -2255,6 +2262,7 @@ async function runTurn(start, turn) {
2255
2262
  if (start.model) activeModel = start.model;
2256
2263
  activeThinking = start.thinking;
2257
2264
  activeEffort = start.effort;
2265
+ activeHeaders = start.headers;
2258
2266
  currentResponseFormat = start.responseFormat?.type === "json" && start.responseFormat.schema != null ? toolStrategy(start.responseFormat.schema) : void 0;
2259
2267
  const emit = (event) => turn.emit(event);
2260
2268
  const interruptOn = buildInterruptOn(