@blazingagents/sdk 0.53.0 → 0.54.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.
@@ -113,6 +113,7 @@ export declare const agentResponseSchema: z.ZodObject<{
113
113
  model: z.ZodNullable<z.ZodString>;
114
114
  thinkingLevel: z.ZodNullable<z.ZodString>;
115
115
  providerId: z.ZodNullable<z.ZodString>;
116
+ autoApprovalModel: z.ZodNullable<z.ZodString>;
116
117
  workspaceId: z.ZodString;
117
118
  autoCompaction: z.ZodBoolean;
118
119
  compactionReserveTokens: z.ZodNumber;
@@ -236,6 +237,7 @@ export declare const agentsResponseSchema: z.ZodObject<{
236
237
  model: z.ZodNullable<z.ZodString>;
237
238
  thinkingLevel: z.ZodNullable<z.ZodString>;
238
239
  providerId: z.ZodNullable<z.ZodString>;
240
+ autoApprovalModel: z.ZodNullable<z.ZodString>;
239
241
  workspaceId: z.ZodString;
240
242
  autoCompaction: z.ZodBoolean;
241
243
  compactionReserveTokens: z.ZodNumber;
@@ -364,6 +366,7 @@ export declare const agentConfigSchema: z.ZodObject<{
364
366
  model: z.ZodNullable<z.ZodString>;
365
367
  thinkingLevel: z.ZodNullable<z.ZodString>;
366
368
  providerId: z.ZodNullable<z.ZodString>;
369
+ autoApprovalModel: z.ZodNullable<z.ZodString>;
367
370
  autoCompaction: z.ZodBoolean;
368
371
  compactionReserveTokens: z.ZodNumber;
369
372
  memoryInjectionEnabled: z.ZodBoolean;
@@ -479,6 +482,7 @@ export declare const createAgentBodySchema: z.ZodObject<{
479
482
  model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
480
483
  thinkingLevel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
481
484
  providerId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
485
+ autoApprovalModel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
482
486
  workspaceId: z.ZodOptional<z.ZodString>;
483
487
  autoCompaction: z.ZodDefault<z.ZodBoolean>;
484
488
  compactionReserveTokens: z.ZodDefault<z.ZodNumber>;
@@ -592,6 +596,7 @@ export declare const updateAgentBodySchema: z.ZodObject<{
592
596
  model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
593
597
  thinkingLevel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
594
598
  providerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
599
+ autoApprovalModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
595
600
  workspaceId: z.ZodOptional<z.ZodString>;
596
601
  autoCompaction: z.ZodOptional<z.ZodBoolean>;
597
602
  compactionReserveTokens: z.ZodOptional<z.ZodNumber>;
@@ -36,12 +36,21 @@ export const agentMcpConnectionIdsSchema = z
36
36
  });
37
37
  export const agentStatusSchema = z.enum(["active", "disabled"]);
38
38
  const providerModelPairMessage = "Provider and model must either both be set or both be null.";
39
+ const autoApprovalModelMessage = "autoApprovalModel needs a provider and model on the agent.";
39
40
  /**
40
41
  * Checks that provider and model selections are both present or both absent.
41
42
  */
42
43
  function hasProviderModelPair(input) {
43
44
  return (input.model === null) === (input.providerId === null);
44
45
  }
46
+ /**
47
+ * Checks that an auto-approval model runs on a configured Provider and model.
48
+ */
49
+ function hasProviderForAutoApprovalModel(input) {
50
+ return (input.autoApprovalModel === undefined ||
51
+ input.autoApprovalModel === null ||
52
+ input.providerId !== null);
53
+ }
45
54
  export const agentResponseSchema = z
46
55
  .object({
47
56
  ...approvalFields,
@@ -51,6 +60,7 @@ export const agentResponseSchema = z
51
60
  model: agentModelIdSchema.nullable(),
52
61
  thinkingLevel: z.string().min(1).nullable(),
53
62
  providerId: providerIdSchema.nullable(),
63
+ autoApprovalModel: agentModelIdSchema.nullable(),
54
64
  workspaceId: workspaceIdSchema,
55
65
  autoCompaction: z.boolean(),
56
66
  compactionReserveTokens: z
@@ -74,6 +84,10 @@ export const agentResponseSchema = z
74
84
  .refine(hasProviderModelPair, {
75
85
  message: providerModelPairMessage,
76
86
  path: ["providerId"],
87
+ })
88
+ .refine(hasProviderForAutoApprovalModel, {
89
+ message: autoApprovalModelMessage,
90
+ path: ["autoApprovalModel"],
77
91
  });
78
92
  export const agentsResponseSchema = paginatedResponseSchema(agentResponseSchema);
79
93
  export const agentsListQuerySchema = z
@@ -103,6 +117,7 @@ export const agentConfigSchema = z
103
117
  model: agentResponseSchema.shape.model,
104
118
  thinkingLevel: agentResponseSchema.shape.thinkingLevel,
105
119
  providerId: agentResponseSchema.shape.providerId,
120
+ autoApprovalModel: agentResponseSchema.shape.autoApprovalModel,
106
121
  autoCompaction: agentResponseSchema.shape.autoCompaction,
107
122
  compactionReserveTokens: agentResponseSchema.shape.compactionReserveTokens,
108
123
  memoryInjectionEnabled: agentResponseSchema.shape.memoryInjectionEnabled,
@@ -115,6 +130,10 @@ export const agentConfigSchema = z
115
130
  .refine(hasProviderModelPair, {
116
131
  message: providerModelPairMessage,
117
132
  path: ["providerId"],
133
+ })
134
+ .refine(hasProviderForAutoApprovalModel, {
135
+ message: autoApprovalModelMessage,
136
+ path: ["autoApprovalModel"],
118
137
  });
119
138
  const agentFieldDescriptions = {
120
139
  approvalInChat: "Which tool calls need approval in sessions and stateless generation.",
@@ -123,6 +142,7 @@ const agentFieldDescriptions = {
123
142
  model: "The provider's own model ID, such as `openai/gpt-6-luna`. Send it together with `providerId`.",
124
143
  thinkingLevel: "How much reasoning to request from the model, such as `high`. Needs a provider and model, and must be a level the model supports.",
125
144
  providerId: "ID of the provider whose key runs the model. Send it together with `model`.",
145
+ autoApprovalModel: "Model ID, on the agent's provider, that reviews tool calls whose approval is `auto`. `null` uses the agent's model. Needs a provider and model. Changing `providerId` without sending this sets it to `null`.",
126
146
  workspaceId: "ID of the workspace the agent reads and writes files in.",
127
147
  autoCompaction: "Summarize older context automatically when a conversation nears the model's context limit.",
128
148
  compactionReserveTokens: "Tokens to keep free for the model's reply when deciding whether to compact.",
@@ -155,6 +175,10 @@ export const createAgentBodySchema = z
155
175
  .nullable()
156
176
  .default(null)
157
177
  .describe(agentFieldDescriptions.providerId),
178
+ autoApprovalModel: agentModelIdSchema
179
+ .nullable()
180
+ .default(null)
181
+ .describe(agentFieldDescriptions.autoApprovalModel),
158
182
  workspaceId: workspaceIdSchema
159
183
  .optional()
160
184
  .describe(`${agentFieldDescriptions.workspaceId} Leave it out to create a new workspace for the agent, or send an existing one to share it.`),
@@ -193,6 +217,10 @@ export const createAgentBodySchema = z
193
217
  .refine(hasProviderModelPair, {
194
218
  message: providerModelPairMessage,
195
219
  path: ["providerId"],
220
+ })
221
+ .refine(hasProviderForAutoApprovalModel, {
222
+ message: autoApprovalModelMessage,
223
+ path: ["autoApprovalModel"],
196
224
  });
197
225
  export const updateAgentBodySchema = z
198
226
  .object({
@@ -217,6 +245,10 @@ export const updateAgentBodySchema = z
217
245
  .nullable()
218
246
  .optional()
219
247
  .describe(agentFieldDescriptions.providerId),
248
+ autoApprovalModel: agentModelIdSchema
249
+ .nullable()
250
+ .optional()
251
+ .describe(agentFieldDescriptions.autoApprovalModel),
220
252
  workspaceId: workspaceIdSchema
221
253
  .optional()
222
254
  .describe(agentFieldDescriptions.workspaceId),
@@ -264,4 +296,8 @@ export const updateAgentBodySchema = z
264
296
  }, {
265
297
  message: providerModelPairMessage,
266
298
  path: ["providerId"],
299
+ })
300
+ .refine(hasProviderForAutoApprovalModel, {
301
+ message: autoApprovalModelMessage,
302
+ path: ["autoApprovalModel"],
267
303
  });
@@ -123,6 +123,7 @@ export declare const sessionResponseSchema: z.ZodObject<{
123
123
  model: z.ZodNullable<z.ZodString>;
124
124
  thinkingLevel: z.ZodNullable<z.ZodString>;
125
125
  providerId: z.ZodNullable<z.ZodString>;
126
+ autoApprovalModel: z.ZodNullable<z.ZodString>;
126
127
  autoCompaction: z.ZodBoolean;
127
128
  compactionReserveTokens: z.ZodNumber;
128
129
  memoryInjectionEnabled: z.ZodBoolean;
@@ -349,6 +349,7 @@ export declare const taskRunResponseSchema: z.ZodObject<{
349
349
  model: z.ZodNullable<z.ZodString>;
350
350
  thinkingLevel: z.ZodNullable<z.ZodString>;
351
351
  providerId: z.ZodNullable<z.ZodString>;
352
+ autoApprovalModel: z.ZodNullable<z.ZodString>;
352
353
  autoCompaction: z.ZodBoolean;
353
354
  compactionReserveTokens: z.ZodNumber;
354
355
  memoryInjectionEnabled: z.ZodBoolean;
@@ -487,6 +488,7 @@ export declare const taskRunsListResponseSchema: z.ZodObject<{
487
488
  model: z.ZodNullable<z.ZodString>;
488
489
  thinkingLevel: z.ZodNullable<z.ZodString>;
489
490
  providerId: z.ZodNullable<z.ZodString>;
491
+ autoApprovalModel: z.ZodNullable<z.ZodString>;
490
492
  autoCompaction: z.ZodBoolean;
491
493
  compactionReserveTokens: z.ZodNumber;
492
494
  memoryInjectionEnabled: z.ZodBoolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazingagents/sdk",
3
- "version": "0.53.0",
3
+ "version": "0.54.0",
4
4
  "description": "TypeScript SDK for the Blazing Agents API",
5
5
  "homepage": "https://docs.blazingagents.com",
6
6
  "bugs": {