@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.
- package/dist/contracts/api.d.ts +0 -3
- package/dist/contracts/api.js +0 -1
- package/dist/contracts/entities/agents.d.ts +2 -118
- package/dist/contracts/entities/agents.js +2 -24
- package/dist/contracts/entities/chat.d.ts +0 -12
- package/dist/contracts/entities/chat.js +1 -4
- package/dist/contracts/entities/providers.d.ts +2 -6
- package/dist/contracts/entities/providers.js +2 -9
- package/dist/contracts/entities/sessions.d.ts +106 -5
- package/dist/contracts/entities/sessions.js +5 -3
- package/dist/contracts/entities/tasks.d.ts +285 -10
- package/dist/contracts/entities/tasks.js +2 -5
- package/dist/contracts/index.d.ts +2 -2
- package/dist/contracts/index.js +2 -2
- package/dist/contracts/limitations.d.ts +0 -2
- package/dist/contracts/limitations.js +0 -2
- package/dist/direct-chat-transport.d.ts +0 -1
- package/dist/direct-chat-transport.js +0 -1
- package/dist/generation.js +0 -8
- package/dist/index.d.ts +5 -3
- package/dist/index.js +2 -0
- package/dist/relay.d.ts +0 -1
- package/dist/relay.js +0 -2
- package/dist/resources/agents.js +1 -33
- package/dist/resources/providers.js +1 -1
- package/dist/resources/sessions.d.ts +1 -1
- package/dist/resources/sessions.js +5 -2
- package/dist/types.d.ts +7 -23
- package/package.json +1 -1
|
@@ -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`
|
|
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,
|
|
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
|
-
|
|
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;
|