@blazingagents/sdk 0.16.0 → 0.17.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.
@@ -1,15 +1,18 @@
1
- import { latestSessionsListResponseSchema, sessionMessagesResponseSchema, sessionsListResponseSchema, toolApprovalDecisionResponseSchema, toolApprovalsResponseSchema, } from "../contracts/entities/sessions.js";
1
+ import { latestSessionsListResponseSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalDecisionResponseSchema, toolApprovalsResponseSchema, } from "../contracts/entities/sessions.js";
2
2
  import { stripFunctionEvents } from "../functions.js";
3
3
  import { buildTerminalStreamResult, withFilteredBody } from "../generation.js";
4
4
  import { requestJson, requestStream } from "../http.js";
5
5
  /**
6
- * `client.sessions` — list/get-messages/delete over
6
+ * `client.sessions` reads, paginates, and deletes Sessions under
7
7
  * `/v1/agents/:agentId/sessions`. Pagination is manual: the SDK returns
8
8
  * the page as-is (`{ data, nextCursor }` verbatim); the caller passes
9
9
  * `nextCursor` back as `cursor` on the next call.
10
10
  */
11
11
  export function createSessionsResource(config) {
12
12
  return {
13
+ async get({ agentId, sessionId, abortSignal }) {
14
+ return await requestJson(config, `/v1/agents/${agentId}/sessions/${sessionId}`, { signal: abortSignal }, sessionResponseSchema);
15
+ },
13
16
  async decideToolApproval({ agentId, sessionId, approvalId, abortSignal, ...decision }) {
14
17
  return await requestJson(config, `/v1/agents/${agentId}/sessions/${sessionId}/tool-approvals/${approvalId}`, {
15
18
  json: decision,
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { UIMessage, UIMessageChunk } from "ai";
2
2
  import type { ApiErrorCode } from "./contracts/api.ts";
3
- import type { Agent, AgentsResponse, AgentVersion, AgentVersionsResponse, CreateAgentBody, UpdateAgentBody } from "./contracts/entities/agents.ts";
3
+ import type { Agent, AgentsResponse, CreateAgentBody, UpdateAgentBody } from "./contracts/entities/agents.ts";
4
4
  import type { ArtifactDownloadUrlResponse, ArtifactListItem, ArtifactsListResponse } from "./contracts/entities/artifacts.ts";
5
5
  import type { BlazingAgentsChatMessageMetadata } from "./contracts/entities/chat.ts";
6
6
  import type { ChatConnection, ChatConnectionsResponse, ChatDeliveriesResponse, ChatDeliveryListStatus, CreateChatConnectionBody, RotateChatConnectionBody, UpdateChatConnectionBody } from "./contracts/entities/chat-connections.ts";
@@ -9,7 +9,7 @@ import type { CreateMemoryBody, MemoriesListResponse, MemoryResponse, UpdateMemo
9
9
  import type { CreateMerchantConnectionBody, MerchantBindingResponse, MerchantBindingsResponse, MerchantConnectionResponse, MerchantUsageEventResponse, MerchantUsageEventStatus, MerchantUsageEventsResponse, MerchantUsageSummaryResponse, UpdateMerchantConnectionBody, UpsertMerchantBindingBody } from "./contracts/entities/merchant.ts";
10
10
  import type { CreatePromptBody, PromptResponse, PromptsResponse, UpdatePromptBody } from "./contracts/entities/prompts.ts";
11
11
  import type { CreateProviderBody, DeleteProviderOptions, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ThinkingLevelsResponse, UpdateProviderBody } from "./contracts/entities/providers.ts";
12
- import type { DecideToolApprovalBody, LatestSessionsListResponse, SessionMessagesResponse, SessionsListResponse, ToolApprovalDecisionResponse, ToolApprovalsResponse } from "./contracts/entities/sessions.ts";
12
+ import type { DecideToolApprovalBody, LatestSessionsListResponse, SessionMessagesResponse, SessionResponse, SessionsListResponse, ToolApprovalDecisionResponse, ToolApprovalsResponse } from "./contracts/entities/sessions.ts";
13
13
  import type { CreateSkillBody, SkillArchiveType, SkillCopyResults, SkillDetail, SkillsListResponse } from "./contracts/entities/skills.ts";
14
14
  import type { CreateTaskBody, CreateTaskResponse, CreateTaskRunBody, CreateTaskRunResponse, TaskResponse, TaskRunMessagesResponse, TaskRunResponse, TaskRunsListResponse, TasksListResponse, UpdateTaskBody } from "./contracts/entities/tasks.ts";
15
15
  import type { TenantSettingsResponse, UpdateTenantSettingsBody } from "./contracts/entities/tenants.ts";
@@ -103,12 +103,10 @@ interface CorrelatedRequestInput {
103
103
  interface NewSessionInput {
104
104
  sessionId?: never;
105
105
  trigger?: "submit-message";
106
- version?: number;
107
106
  }
108
107
  interface ExistingSessionInput {
109
108
  sessionId: string;
110
109
  trigger?: ChatTrigger;
111
- version?: never;
112
110
  }
113
111
  type ChatSessionInput = NewSessionInput | ExistingSessionInput;
114
112
  interface ChatMessageContentInput extends AttributionInput, CorrelatedRequestInput {
@@ -162,9 +160,7 @@ export interface TerminalStreamResult {
162
160
  /** Claims the SSE bytes once, without constructing a Response. Shares ownership with toResponse(). */
163
161
  toStream: () => ReadableStream<Uint8Array>;
164
162
  }
165
- interface StatelessGenerationInput extends AttributionInput, CorrelatedRequestInput {
166
- version?: number;
167
- }
163
+ type StatelessGenerationInput = AttributionInput & CorrelatedRequestInput;
168
164
  export interface CompletionPromptInput extends StatelessGenerationInput {
169
165
  abortSignal?: AbortSignal;
170
166
  agentId: string;
@@ -231,25 +227,13 @@ export interface AgentsResource {
231
227
  get(input: {
232
228
  agentId: string;
233
229
  } & ResourceRequestOptions): Promise<Agent>;
234
- getVersion(input: {
235
- agentId: string;
236
- version: number;
237
- } & ResourceRequestOptions): Promise<AgentVersion>;
238
230
  list(input?: AgentsListOptions): Promise<AgentsResponse>;
239
231
  listMcpAttachments(input: {
240
232
  agentId: string;
241
233
  } & ResourceRequestOptions): Promise<McpAttachmentsResponse>;
242
- listVersions(input: {
243
- agentId: string;
244
- } & AgentVersionsListOptions): Promise<AgentVersionsResponse>;
245
234
  removeAvatar(input: {
246
235
  agentId: string;
247
236
  } & ResourceRequestOptions): Promise<Agent>;
248
- /** Copies an immutable Version into the Agent, creating a new latest Version. */
249
- restoreVersion(input: {
250
- agentId: string;
251
- version: number;
252
- } & ResourceRequestOptions): Promise<Agent>;
253
237
  /** A concrete `workspaceId` switches the Agent; detachment is unsupported. */
254
238
  update(input: UpdateAgentBody & {
255
239
  agentId: string;
@@ -290,10 +274,6 @@ export interface WorkspacesListOptions extends ResourceRequestOptions {
290
274
  limit?: number;
291
275
  userId?: string;
292
276
  }
293
- export interface AgentVersionsListOptions extends ResourceRequestOptions {
294
- cursor?: string;
295
- limit?: number;
296
- }
297
277
  export interface ArtifactsListOptions extends ResourceRequestOptions {
298
278
  agentId?: string;
299
279
  cursor?: string;
@@ -424,6 +404,10 @@ export interface SessionsResource {
424
404
  sessionId: string;
425
405
  deleteArtifacts: boolean;
426
406
  } & ResourceRequestOptions): Promise<void>;
407
+ get(input: {
408
+ agentId: string;
409
+ sessionId: string;
410
+ } & ResourceRequestOptions): Promise<SessionResponse>;
427
411
  joinToolApprovalContinuation(input: {
428
412
  agentId: string;
429
413
  sessionId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazingagents/sdk",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "TypeScript SDK for the Blazing Agents API",
5
5
  "homepage": "https://docs.blazingagents.com",
6
6
  "bugs": {