@blazingagents/sdk 0.5.1 → 0.7.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/README.md CHANGED
@@ -169,3 +169,18 @@ Stop requests cancellation; a lost response can hide a saved exchange. Reuse the
169
169
  returned Session ID and load history normally on return. No outcome polling or
170
170
  automatic generation retry is needed. See the [chatbot guide](https://docs.blazingagents.com/getting-started/chatbot)
171
171
  and [working examples](https://github.com/blazingagents/examples).
172
+
173
+ ## Automatic context compaction
174
+
175
+ Agents enable automatic compaction by default with a 16,384-token reserve.
176
+ A larger reserve compacts earlier. Settings are included in Agent Versions.
177
+ Compaction summarizes older history for the model while retaining the full
178
+ Session transcript; summarization calls contribute to token usage.
179
+
180
+ ```ts
181
+ await client.agents.update({
182
+ agentId: "ag_...",
183
+ autoCompaction: true,
184
+ compactionReserveTokens: 32768,
185
+ });
186
+ ```
@@ -21,6 +21,8 @@ export declare const agentSchema: z.ZodObject<{
21
21
  thinkingLevel: z.ZodNullable<z.ZodString>;
22
22
  providerId: z.ZodNullable<z.ZodString>;
23
23
  workspaceId: z.ZodString;
24
+ autoCompaction: z.ZodBoolean;
25
+ compactionReserveTokens: z.ZodNumber;
24
26
  memoryInjectionEnabled: z.ZodBoolean;
25
27
  tools: z.ZodArray<z.ZodEnum<{
26
28
  memory: "memory";
@@ -49,6 +51,8 @@ export declare const agentsResponseSchema: z.ZodObject<{
49
51
  thinkingLevel: z.ZodNullable<z.ZodString>;
50
52
  providerId: z.ZodNullable<z.ZodString>;
51
53
  workspaceId: z.ZodString;
54
+ autoCompaction: z.ZodBoolean;
55
+ compactionReserveTokens: z.ZodNumber;
52
56
  memoryInjectionEnabled: z.ZodBoolean;
53
57
  tools: z.ZodArray<z.ZodEnum<{
54
58
  memory: "memory";
@@ -77,6 +81,8 @@ export declare const agentResponseSchema: z.ZodObject<{
77
81
  thinkingLevel: z.ZodNullable<z.ZodString>;
78
82
  providerId: z.ZodNullable<z.ZodString>;
79
83
  workspaceId: z.ZodString;
84
+ autoCompaction: z.ZodBoolean;
85
+ compactionReserveTokens: z.ZodNumber;
80
86
  memoryInjectionEnabled: z.ZodBoolean;
81
87
  tools: z.ZodArray<z.ZodEnum<{
82
88
  memory: "memory";
@@ -108,6 +114,8 @@ export declare const agentVersionSchema: z.ZodObject<{
108
114
  model: z.ZodNullable<z.ZodString>;
109
115
  thinkingLevel: z.ZodNullable<z.ZodString>;
110
116
  providerId: z.ZodNullable<z.ZodString>;
117
+ autoCompaction: z.ZodBoolean;
118
+ compactionReserveTokens: z.ZodNumber;
111
119
  memoryInjectionEnabled: z.ZodBoolean;
112
120
  tools: z.ZodArray<z.ZodEnum<{
113
121
  memory: "memory";
@@ -132,6 +140,8 @@ export declare const agentVersionsResponseSchema: z.ZodObject<{
132
140
  model: z.ZodNullable<z.ZodString>;
133
141
  thinkingLevel: z.ZodNullable<z.ZodString>;
134
142
  providerId: z.ZodNullable<z.ZodString>;
143
+ autoCompaction: z.ZodBoolean;
144
+ compactionReserveTokens: z.ZodNumber;
135
145
  memoryInjectionEnabled: z.ZodBoolean;
136
146
  tools: z.ZodArray<z.ZodEnum<{
137
147
  memory: "memory";
@@ -151,6 +161,8 @@ export declare const createAgentBodySchema: z.ZodObject<{
151
161
  thinkingLevel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
152
162
  providerId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
153
163
  workspaceId: z.ZodOptional<z.ZodString>;
164
+ autoCompaction: z.ZodDefault<z.ZodBoolean>;
165
+ compactionReserveTokens: z.ZodDefault<z.ZodNumber>;
154
166
  memoryInjectionEnabled: z.ZodDefault<z.ZodBoolean>;
155
167
  tools: z.ZodDefault<z.ZodArray<z.ZodEnum<{
156
168
  memory: "memory";
@@ -168,6 +180,8 @@ export declare const updateAgentBodySchema: z.ZodObject<{
168
180
  thinkingLevel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
169
181
  providerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
170
182
  workspaceId: z.ZodOptional<z.ZodString>;
183
+ autoCompaction: z.ZodOptional<z.ZodBoolean>;
184
+ compactionReserveTokens: z.ZodOptional<z.ZodNumber>;
171
185
  memoryInjectionEnabled: z.ZodOptional<z.ZodBoolean>;
172
186
  tools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
173
187
  memory: "memory";
@@ -41,6 +41,12 @@ export const agentSchema = z
41
41
  thinkingLevel: z.string().min(1).nullable(),
42
42
  providerId: providerIdSchema.nullable(),
43
43
  workspaceId: workspaceIdSchema,
44
+ autoCompaction: z.boolean(),
45
+ compactionReserveTokens: z
46
+ .number()
47
+ .int()
48
+ .nonnegative()
49
+ .max(Number.MAX_SAFE_INTEGER),
44
50
  memoryInjectionEnabled: z.boolean(),
45
51
  tools: agentToolsSchema,
46
52
  instructions: agentInstructionsSchema,
@@ -80,6 +86,8 @@ export const agentVersionSchema = z
80
86
  model: agentSchema.shape.model,
81
87
  thinkingLevel: agentSchema.shape.thinkingLevel,
82
88
  providerId: agentSchema.shape.providerId,
89
+ autoCompaction: agentSchema.shape.autoCompaction,
90
+ compactionReserveTokens: agentSchema.shape.compactionReserveTokens,
83
91
  memoryInjectionEnabled: agentSchema.shape.memoryInjectionEnabled,
84
92
  tools: agentSchema.shape.tools,
85
93
  instructions: agentSchema.shape.instructions,
@@ -111,6 +119,8 @@ export const createAgentBodySchema = z
111
119
  thinkingLevel: z.string().min(1).nullable().default(null),
112
120
  providerId: providerIdSchema.nullable().default(null),
113
121
  workspaceId: workspaceIdSchema.optional(),
122
+ autoCompaction: z.boolean().default(true),
123
+ compactionReserveTokens: agentSchema.shape.compactionReserveTokens.default(16_384),
114
124
  memoryInjectionEnabled: z.boolean().default(false),
115
125
  tools: agentToolsSchema.default([]),
116
126
  instructions: agentInstructionsSchema.default(""),
@@ -130,6 +140,8 @@ export const updateAgentBodySchema = z
130
140
  thinkingLevel: z.string().min(1).nullable().optional(),
131
141
  providerId: providerIdSchema.nullable().optional(),
132
142
  workspaceId: workspaceIdSchema.optional(),
143
+ autoCompaction: z.boolean().optional(),
144
+ compactionReserveTokens: agentSchema.shape.compactionReserveTokens.optional(),
133
145
  memoryInjectionEnabled: z.boolean().optional(),
134
146
  tools: agentToolsSchema.optional(),
135
147
  instructions: agentInstructionsSchema.optional(),
@@ -36,7 +36,7 @@ export declare const providerSchema: z.ZodObject<{
36
36
  updatedAt: z.ZodISODateTime;
37
37
  }, z.core.$strict>;
38
38
  /**
39
- * Wire response — `GET /v1/providers` and `GET /v1/providers/{id}` shape per
39
+ * Wire response — `GET /v1/providers/{id}` shape per
40
40
  * ticket 12: `{ id, name, providerType, baseUrl, keyFragment, createdAt,
41
41
  * updatedAt }`. The Vault pointer and tenant id are write-only/internal.
42
42
  */
@@ -56,6 +56,21 @@ export declare const providerResponseSchema: z.ZodObject<{
56
56
  createdAt: z.ZodISODateTime;
57
57
  updatedAt: z.ZodISODateTime;
58
58
  }, z.core.$strip>;
59
+ export declare const providerListItemSchema: z.ZodObject<{
60
+ id: z.ZodString;
61
+ name: z.ZodString;
62
+ providerType: z.ZodEnum<{
63
+ anthropic: "anthropic";
64
+ custom: "custom";
65
+ google: "google";
66
+ openai: "openai";
67
+ openrouter: "openrouter";
68
+ vercel_ai_gateway: "vercel_ai_gateway";
69
+ }>;
70
+ createdAt: z.ZodISODateTime;
71
+ updatedAt: z.ZodISODateTime;
72
+ }, z.core.$strip>;
73
+ export type ProviderListItem = z.infer<typeof providerListItemSchema>;
59
74
  export declare const providersResponseSchema: z.ZodObject<{
60
75
  providers: z.ZodArray<z.ZodObject<{
61
76
  id: z.ZodString;
@@ -68,8 +83,6 @@ export declare const providersResponseSchema: z.ZodObject<{
68
83
  openrouter: "openrouter";
69
84
  vercel_ai_gateway: "vercel_ai_gateway";
70
85
  }>;
71
- baseUrl: z.ZodNullable<z.ZodString>;
72
- keyFragment: z.ZodString;
73
86
  createdAt: z.ZodISODateTime;
74
87
  updatedAt: z.ZodISODateTime;
75
88
  }, z.core.$strip>>;
@@ -39,7 +39,7 @@ export const providerSchema = z
39
39
  })
40
40
  .strict();
41
41
  /**
42
- * Wire response — `GET /v1/providers` and `GET /v1/providers/{id}` shape per
42
+ * Wire response — `GET /v1/providers/{id}` shape per
43
43
  * ticket 12: `{ id, name, providerType, baseUrl, keyFragment, createdAt,
44
44
  * updatedAt }`. The Vault pointer and tenant id are write-only/internal.
45
45
  */
@@ -54,9 +54,13 @@ export const providerResponseSchema = z
54
54
  updatedAt: z.iso.datetime({ offset: true }),
55
55
  })
56
56
  .strip();
57
+ export const providerListItemSchema = providerResponseSchema.omit({
58
+ baseUrl: true,
59
+ keyFragment: true,
60
+ });
57
61
  export const providersResponseSchema = z
58
62
  .object({
59
- providers: z.array(providerResponseSchema),
63
+ providers: z.array(providerListItemSchema),
60
64
  })
61
65
  .strip();
62
66
  export const providerModelsResponseSchema = z
@@ -8,7 +8,7 @@ export { blazingAgentsChatMessageMetadataSchema, chatModeSchema, chatRequestBody
8
8
  export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.ts";
9
9
  export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.ts";
10
10
  export { createPromptBodySchema, promptResponseSchema, promptSchema, promptsResponseSchema, updatePromptBodySchema, } from "./entities/prompts.ts";
11
- export { createProviderBodySchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.ts";
11
+ export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.ts";
12
12
  export type { ToolApprovalDecisionResponse, ToolApprovalsResponse, } from "./entities/sessions.ts";
13
13
  export { decideToolApprovalBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionResponseSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.ts";
14
14
  export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.ts";
@@ -8,7 +8,7 @@ export { blazingAgentsChatMessageMetadataSchema, chatModeSchema, chatRequestBody
8
8
  export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.js";
9
9
  export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.js";
10
10
  export { createPromptBodySchema, promptResponseSchema, promptSchema, promptsResponseSchema, updatePromptBodySchema, } from "./entities/prompts.js";
11
- export { createProviderBodySchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.js";
11
+ export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.js";
12
12
  export { decideToolApprovalBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionResponseSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.js";
13
13
  export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.js";
14
14
  export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskListItemSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleKindSchema, taskSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.js";
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ export { BlazingAgents } from "./client.ts";
12
12
  export type { Agent, AgentResponse, AgentsResponse, AgentVersion, AgentVersionsListQuery, AgentVersionsResponse, CreateAgentBody, UpdateAgentBody, } from "./contracts/entities/agents.ts";
13
13
  export type { ArtifactDownloadUrlResponse, ArtifactListItem, ArtifactsListResponse, } from "./contracts/entities/artifacts.ts";
14
14
  export type { CreateMcpConnectionBody, McpAttachmentResponse, McpAttachmentsResponse, McpConnectionAuthType, McpConnectionOauthConnectResponse, McpConnectionReconnectResult, McpConnectionResponse, McpConnectionStatus, McpConnectionTestResponse, ReconnectMcpConnectionBody, UpdateMcpAttachmentBody, UpdateMcpConnectionBody, } from "./contracts/entities/mcp-connections.ts";
15
- export type { CreateProviderBody, ProviderModel, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ProviderType, ThinkingLevelsResponse, UpdateProviderBody, } from "./contracts/entities/providers.ts";
15
+ export type { CreateProviderBody, ProviderListItem, ProviderModel, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ProviderType, ThinkingLevelsResponse, UpdateProviderBody, } from "./contracts/entities/providers.ts";
16
16
  export type { CreateSkillBody, Skill, SkillArchiveType, SkillCopyResult, SkillCopyResults, SkillDetail, SkillFile, SkillsListResponse, } from "./contracts/entities/skills.ts";
17
17
  export type { CreateWorkspaceBody, UpdateWorkspaceBody, Workspace, WorkspaceNetworkPolicy, WorkspacesListResponse, } from "./contracts/entities/workspaces.ts";
18
18
  export { BlazingAgentsDirectChatTransport, type BlazingAgentsDirectChatTransportOptions, } from "./direct-chat-transport.ts";
@@ -62,6 +62,8 @@ export function createAgentsResource(config) {
62
62
  name: version.name,
63
63
  model: version.model,
64
64
  thinkingLevel: version.thinkingLevel,
65
+ autoCompaction: version.autoCompaction,
66
+ compactionReserveTokens: version.compactionReserveTokens,
65
67
  providerId: version.providerId,
66
68
  memoryInjectionEnabled: version.memoryInjectionEnabled,
67
69
  tools: version.tools,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazingagents/sdk",
3
- "version": "0.5.1",
3
+ "version": "0.7.0",
4
4
  "description": "TypeScript SDK for the Blazing Agents API",
5
5
  "homepage": "https://docs.blazingagents.com",
6
6
  "bugs": {