@blazingagents/sdk 0.19.0 → 0.20.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 +17 -1
- package/dist/approvals.d.ts +2 -14
- package/dist/approvals.js +10 -15
- package/dist/client.d.ts +4 -4
- package/dist/client.js +6 -6
- package/dist/contracts/api.d.ts +6 -6
- package/dist/contracts/api.js +2 -2
- package/dist/contracts/entities/chat.d.ts +8 -10
- package/dist/contracts/entities/chat.js +5 -7
- package/dist/contracts/entities/session-inputs.d.ts +29 -87
- package/dist/contracts/entities/session-inputs.js +18 -18
- package/dist/contracts/entities/sessions.d.ts +16 -17
- package/dist/contracts/entities/sessions.js +12 -7
- package/dist/contracts/index.d.ts +5 -5
- package/dist/contracts/index.js +3 -3
- package/dist/direct-chat-transport.d.ts +3 -2
- package/dist/direct-chat-transport.js +14 -35
- package/dist/generation.d.ts +2 -2
- package/dist/generation.js +14 -19
- package/dist/index.d.ts +3 -3
- package/dist/relay.d.ts +3 -3
- package/dist/relay.js +9 -10
- package/dist/resources/sessions.js +3 -40
- package/dist/types.d.ts +15 -41
- package/package.json +1 -1
|
@@ -216,14 +216,14 @@ export declare const sessionMessagesQuerySchema: z.ZodObject<{
|
|
|
216
216
|
cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
217
217
|
after: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
218
218
|
}, z.core.$strict>;
|
|
219
|
-
/**
|
|
220
|
-
export declare const
|
|
219
|
+
/** One decision in the current Tool approval round. */
|
|
220
|
+
export declare const toolApprovalDecisionSchema: z.ZodObject<{
|
|
221
|
+
approvalId: z.ZodString;
|
|
221
222
|
approved: z.ZodBoolean;
|
|
222
223
|
reason: z.ZodOptional<z.ZodString>;
|
|
223
224
|
}, z.core.$strict>;
|
|
224
225
|
export declare const toolApprovalContinuationStateSchema: z.ZodEnum<{
|
|
225
226
|
failed: "failed";
|
|
226
|
-
queued: "queued";
|
|
227
227
|
running: "running";
|
|
228
228
|
succeeded: "succeeded";
|
|
229
229
|
waiting: "waiting";
|
|
@@ -273,7 +273,6 @@ export declare const toolApprovalContinuationSchema: z.ZodObject<{
|
|
|
273
273
|
id: z.ZodString;
|
|
274
274
|
state: z.ZodEnum<{
|
|
275
275
|
failed: "failed";
|
|
276
|
-
queued: "queued";
|
|
277
276
|
running: "running";
|
|
278
277
|
succeeded: "succeeded";
|
|
279
278
|
waiting: "waiting";
|
|
@@ -325,23 +324,23 @@ export declare const toolApprovalsResponseSchema: z.ZodObject<{
|
|
|
325
324
|
id: z.ZodString;
|
|
326
325
|
state: z.ZodEnum<{
|
|
327
326
|
failed: "failed";
|
|
328
|
-
queued: "queued";
|
|
329
327
|
running: "running";
|
|
330
328
|
succeeded: "succeeded";
|
|
331
329
|
waiting: "waiting";
|
|
332
330
|
}>;
|
|
333
331
|
}, z.core.$strip>>;
|
|
334
332
|
}, z.core.$strip>;
|
|
335
|
-
export declare const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}, z.core.$
|
|
333
|
+
export declare const continueToolApprovalsBodySchema: z.ZodObject<{
|
|
334
|
+
decisions: z.ZodArray<z.ZodObject<{
|
|
335
|
+
approvalId: z.ZodString;
|
|
336
|
+
approved: z.ZodBoolean;
|
|
337
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
338
|
+
}, z.core.$strict>>;
|
|
339
|
+
functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
340
|
+
description: z.ZodString;
|
|
341
|
+
inputSchema: z.ZodCustom<z.core.JSONSchema.JSONSchema, z.core.JSONSchema.JSONSchema>;
|
|
342
|
+
}, z.core.$strict>>>;
|
|
343
|
+
}, z.core.$strict>;
|
|
345
344
|
export type SessionListItem = z.infer<typeof sessionListItemSchema>;
|
|
346
345
|
export type SessionResponse = z.infer<typeof sessionResponseSchema>;
|
|
347
346
|
export type SessionsListResponse = z.infer<typeof sessionsListResponseSchema>;
|
|
@@ -350,8 +349,8 @@ export type LatestSessionsListResponse = z.infer<typeof latestSessionsListRespon
|
|
|
350
349
|
export type SessionMessage = z.infer<typeof sessionMessageSchema>;
|
|
351
350
|
export type SessionMessagesResponse = z.infer<typeof sessionMessagesResponseSchema>;
|
|
352
351
|
export type SessionMessagesQuery = z.infer<typeof sessionMessagesQuerySchema>;
|
|
353
|
-
export type
|
|
352
|
+
export type ToolApprovalDecision = z.infer<typeof toolApprovalDecisionSchema>;
|
|
353
|
+
export type ContinueToolApprovalsBody = z.infer<typeof continueToolApprovalsBodySchema>;
|
|
354
354
|
export type ToolApprovalContinuationState = z.infer<typeof toolApprovalContinuationStateSchema>;
|
|
355
355
|
export type ToolApprovalState = z.infer<typeof toolApprovalStateSchema>;
|
|
356
356
|
export type ToolApprovalsResponse = z.infer<typeof toolApprovalsResponseSchema>;
|
|
357
|
-
export type ToolApprovalDecisionResponse = z.infer<typeof toolApprovalDecisionResponseSchema>;
|
|
@@ -5,6 +5,7 @@ import { DEFAULT_SESSION_MESSAGES_LIMIT, MAX_SESSION_MESSAGES_LIMIT, } from "../
|
|
|
5
5
|
import { toolExecutionReferenceSchema } from "./agent-approval.js";
|
|
6
6
|
import { agentConfigSchema, agentSchema } from "./agents.js";
|
|
7
7
|
import { metadataSchema, userIdSchema } from "./attribution.js";
|
|
8
|
+
import { chatFunctionDefinitionsSchema } from "./chat.js";
|
|
8
9
|
/**
|
|
9
10
|
* `GET /v1/agents/{agentId}/sessions` list item. `agentId`/`tenantId` never
|
|
10
11
|
* leak to the wire; `userId`/`metadata` come from the first successful Turn.
|
|
@@ -90,16 +91,16 @@ export const sessionMessagesQuerySchema = z
|
|
|
90
91
|
message: "cursor and after are mutually exclusive.",
|
|
91
92
|
path: ["after"],
|
|
92
93
|
});
|
|
93
|
-
/**
|
|
94
|
-
export const
|
|
94
|
+
/** One decision in the current Tool approval round. */
|
|
95
|
+
export const toolApprovalDecisionSchema = z
|
|
95
96
|
.object({
|
|
97
|
+
approvalId: z.string().min(1),
|
|
96
98
|
approved: z.boolean(),
|
|
97
99
|
reason: z.string().trim().min(1).max(1000).optional(),
|
|
98
100
|
})
|
|
99
101
|
.strict();
|
|
100
102
|
export const toolApprovalContinuationStateSchema = z.enum([
|
|
101
103
|
"waiting",
|
|
102
|
-
"queued",
|
|
103
104
|
"running",
|
|
104
105
|
"succeeded",
|
|
105
106
|
"failed",
|
|
@@ -130,9 +131,13 @@ export const toolApprovalsResponseSchema = z
|
|
|
130
131
|
continuation: toolApprovalContinuationSchema.nullable(),
|
|
131
132
|
})
|
|
132
133
|
.strip();
|
|
133
|
-
export const
|
|
134
|
+
export const continueToolApprovalsBodySchema = z
|
|
134
135
|
.object({
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
decisions: z
|
|
137
|
+
.array(toolApprovalDecisionSchema)
|
|
138
|
+
.min(1)
|
|
139
|
+
.refine((decisions) => new Set(decisions.map((decision) => decision.approvalId)).size ===
|
|
140
|
+
decisions.length, { message: "Approval IDs must be distinct." }),
|
|
141
|
+
functions: chatFunctionDefinitionsSchema.optional(),
|
|
137
142
|
})
|
|
138
|
-
.
|
|
143
|
+
.strict();
|
|
@@ -7,17 +7,17 @@ export { agentConfigSchema, agentResponseSchema, agentSchema, agentStatusSchema,
|
|
|
7
7
|
export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.ts";
|
|
8
8
|
export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.ts";
|
|
9
9
|
export type { ChatFunctionCallEvent, ChatFunctionDefinition, ChatFunctionDefinitions, ChatFunctionOutcome, ClaimChatFunctionBody, PromptVariables, ResolveChatFunctionBody, UsageSummary, } from "./entities/chat.ts";
|
|
10
|
-
export { blazingAgentsChatMessageMetadataSchema, chatFunctionCallEventSchema, chatFunctionDefinitionSchema, chatFunctionDefinitionsSchema, chatFunctionOutcomeSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, claimChatFunctionBodySchema, claimChatFunctionResponseSchema, generationRequestBodySchema, jsonSchemaShapeSchema, MAX_CHAT_FUNCTION_DEFINITIONS_BYTES, MAX_CHAT_FUNCTION_PAYLOAD_BYTES, MAX_CHAT_FUNCTIONS, promptVariablesSchema, resolveChatFunctionBodySchema, resolveChatFunctionResponseSchema,
|
|
10
|
+
export { blazingAgentsChatMessageMetadataSchema, chatFunctionCallEventSchema, chatFunctionDefinitionSchema, chatFunctionDefinitionsSchema, chatFunctionOutcomeSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, claimChatFunctionBodySchema, claimChatFunctionResponseSchema, generationRequestBodySchema, jsonSchemaShapeSchema, MAX_CHAT_FUNCTION_DEFINITIONS_BYTES, MAX_CHAT_FUNCTION_PAYLOAD_BYTES, MAX_CHAT_FUNCTIONS, promptVariablesSchema, resolveChatFunctionBodySchema, resolveChatFunctionResponseSchema, usageSummarySchema, } from "./entities/chat.ts";
|
|
11
11
|
export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatDeliveriesResponseSchema, chatDeliveryListStatusSchema, chatDeliverySchema, chatDeliveryStatusSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, tenantChatDeliverySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.ts";
|
|
12
12
|
export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.ts";
|
|
13
13
|
export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.ts";
|
|
14
14
|
export { createMerchantConnectionBodySchema, merchantBindingResponseSchema, merchantBindingsResponseSchema, merchantConnectionResponseSchema, merchantConnectionSchema, merchantConnectionStatusSchema, merchantCustomerBindingSchema, merchantEnvironmentSchema, merchantGuardSchema, merchantProviderSchema, merchantUsageEventNextAction, merchantUsageEventNextActionSchema, merchantUsageEventSchema, merchantUsageEventStatusSchema, merchantUsageEventsResponseSchema, merchantUsageSummaryQuerySchema, merchantUsageSummaryResponseSchema, merchantUsageSummarySchema, merchantWorkflowIssueSchema, updateMerchantConnectionBodySchema, upsertMerchantBindingBodySchema, } from "./entities/merchant.ts";
|
|
15
15
|
export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptSchema, promptsListQuerySchema, promptsResponseSchema, promptTemplateSchema, renderPromptTemplate, updatePromptBodySchema, } from "./entities/prompts.ts";
|
|
16
16
|
export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.ts";
|
|
17
|
-
export type {
|
|
18
|
-
export {
|
|
19
|
-
export type {
|
|
20
|
-
export {
|
|
17
|
+
export type { ChatSteerConsumedEvent, SessionActivity, SessionInput, SessionInputResponse, SessionInputState, SessionInputsQuery, SessionInputsResponse, StopSessionBody, StopSessionResponse, SubmitSessionInputBody, } from "./entities/session-inputs.ts";
|
|
18
|
+
export { chatSteerConsumedEventSchema, sessionActivitySchema, sessionInputRequestIdSchema, sessionInputResponseSchema, sessionInputSchema, sessionInputStateSchema, sessionInputsQuerySchema, sessionInputsResponseSchema, stopSessionBodySchema, stopSessionResponseSchema, submitSessionInputBodySchema, } from "./entities/session-inputs.ts";
|
|
19
|
+
export type { ContinueToolApprovalsBody, ToolApprovalContinuationState, ToolApprovalDecision, ToolApprovalsResponse, } from "./entities/sessions.ts";
|
|
20
|
+
export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.ts";
|
|
21
21
|
export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.ts";
|
|
22
22
|
export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, taskSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.ts";
|
|
23
23
|
export { quotaSchema, subscriptionStatusSchema, tenantDeletionSchema, tenantResponseSchema, tenantSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.ts";
|
package/dist/contracts/index.js
CHANGED
|
@@ -6,15 +6,15 @@ export { chatFunctionNameSchema } from "./entities/agent-tools.js";
|
|
|
6
6
|
export { agentConfigSchema, agentResponseSchema, agentSchema, agentStatusSchema, agentsListQuerySchema, agentsResponseSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.js";
|
|
7
7
|
export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.js";
|
|
8
8
|
export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.js";
|
|
9
|
-
export { blazingAgentsChatMessageMetadataSchema, chatFunctionCallEventSchema, chatFunctionDefinitionSchema, chatFunctionDefinitionsSchema, chatFunctionOutcomeSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, claimChatFunctionBodySchema, claimChatFunctionResponseSchema, generationRequestBodySchema, jsonSchemaShapeSchema, MAX_CHAT_FUNCTION_DEFINITIONS_BYTES, MAX_CHAT_FUNCTION_PAYLOAD_BYTES, MAX_CHAT_FUNCTIONS, promptVariablesSchema, resolveChatFunctionBodySchema, resolveChatFunctionResponseSchema,
|
|
9
|
+
export { blazingAgentsChatMessageMetadataSchema, chatFunctionCallEventSchema, chatFunctionDefinitionSchema, chatFunctionDefinitionsSchema, chatFunctionOutcomeSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, claimChatFunctionBodySchema, claimChatFunctionResponseSchema, generationRequestBodySchema, jsonSchemaShapeSchema, MAX_CHAT_FUNCTION_DEFINITIONS_BYTES, MAX_CHAT_FUNCTION_PAYLOAD_BYTES, MAX_CHAT_FUNCTIONS, promptVariablesSchema, resolveChatFunctionBodySchema, resolveChatFunctionResponseSchema, usageSummarySchema, } from "./entities/chat.js";
|
|
10
10
|
export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatDeliveriesResponseSchema, chatDeliveryListStatusSchema, chatDeliverySchema, chatDeliveryStatusSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, tenantChatDeliverySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.js";
|
|
11
11
|
export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.js";
|
|
12
12
|
export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.js";
|
|
13
13
|
export { createMerchantConnectionBodySchema, merchantBindingResponseSchema, merchantBindingsResponseSchema, merchantConnectionResponseSchema, merchantConnectionSchema, merchantConnectionStatusSchema, merchantCustomerBindingSchema, merchantEnvironmentSchema, merchantGuardSchema, merchantProviderSchema, merchantUsageEventNextAction, merchantUsageEventNextActionSchema, merchantUsageEventSchema, merchantUsageEventStatusSchema, merchantUsageEventsResponseSchema, merchantUsageSummaryQuerySchema, merchantUsageSummaryResponseSchema, merchantUsageSummarySchema, merchantWorkflowIssueSchema, updateMerchantConnectionBodySchema, upsertMerchantBindingBodySchema, } from "./entities/merchant.js";
|
|
14
14
|
export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptSchema, promptsListQuerySchema, promptsResponseSchema, promptTemplateSchema, renderPromptTemplate, updatePromptBodySchema, } from "./entities/prompts.js";
|
|
15
15
|
export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.js";
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
16
|
+
export { chatSteerConsumedEventSchema, sessionActivitySchema, sessionInputRequestIdSchema, sessionInputResponseSchema, sessionInputSchema, sessionInputStateSchema, sessionInputsQuerySchema, sessionInputsResponseSchema, stopSessionBodySchema, stopSessionResponseSchema, submitSessionInputBodySchema, } from "./entities/session-inputs.js";
|
|
17
|
+
export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.js";
|
|
18
18
|
export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.js";
|
|
19
19
|
export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, taskSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.js";
|
|
20
20
|
export { quotaSchema, subscriptionStatusSchema, tenantDeletionSchema, tenantResponseSchema, tenantSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.js";
|
|
@@ -22,9 +22,10 @@ export type BlazingAgentsDirectChatTransportOptions = {
|
|
|
22
22
|
export declare class BlazingAgentsDirectChatTransport<UI_MESSAGE extends UIMessage = UIMessage> extends DefaultChatTransport<UI_MESSAGE> {
|
|
23
23
|
#private;
|
|
24
24
|
constructor(options: BlazingAgentsDirectChatTransportOptions);
|
|
25
|
-
|
|
25
|
+
sendUserMessages(input: {
|
|
26
|
+
messages: UI_MESSAGE[];
|
|
26
27
|
abortSignal?: AbortSignal;
|
|
27
28
|
}): Promise<ReadableStream<import("ai").UIMessageChunk<unknown, import("ai").UIDataTypes>>>;
|
|
28
29
|
sendMessages(input: Parameters<ChatTransport<UI_MESSAGE>["sendMessages"]>[0]): Promise<ReadableStream<import("ai").UIMessageChunk<unknown, import("ai").UIDataTypes>>>;
|
|
29
|
-
reconnectToStream(_input: Parameters<ChatTransport<UI_MESSAGE>["reconnectToStream"]>[0]): Promise<
|
|
30
|
+
reconnectToStream(_input: Parameters<ChatTransport<UI_MESSAGE>["reconnectToStream"]>[0]): Promise<null>;
|
|
30
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DefaultChatTransport, lastAssistantMessageIsCompleteWithApprovalResponses, } from "ai";
|
|
2
|
-
import {
|
|
2
|
+
import { extractApprovalDecisions } from "./approvals.js";
|
|
3
3
|
import { sessionIdSchema } from "./contracts/ids.js";
|
|
4
4
|
/** Connects useChat directly to the SDK, including native streaming fetch clients. */
|
|
5
5
|
export class BlazingAgentsDirectChatTransport extends DefaultChatTransport {
|
|
@@ -13,18 +13,17 @@ export class BlazingAgentsDirectChatTransport extends DefaultChatTransport {
|
|
|
13
13
|
? undefined
|
|
14
14
|
: sessionIdSchema.parse(options.sessionId);
|
|
15
15
|
}
|
|
16
|
-
async
|
|
17
|
-
if (this.#sessionId === undefined) {
|
|
18
|
-
throw new Error("Input batch admission requires an existing Session.");
|
|
19
|
-
}
|
|
16
|
+
async sendUserMessages(input) {
|
|
20
17
|
const client = await this.#options.getClient();
|
|
21
|
-
const result = await client.
|
|
18
|
+
const result = await client.chat({
|
|
22
19
|
...input,
|
|
23
20
|
agentId: this.#options.agentId,
|
|
24
21
|
sessionId: this.#sessionId,
|
|
25
22
|
functions: this.#options.functions,
|
|
23
|
+
userId: this.#options.userId,
|
|
24
|
+
metadata: this.#options.metadata,
|
|
26
25
|
});
|
|
27
|
-
return this
|
|
26
|
+
return this.#processChatResult(result);
|
|
28
27
|
}
|
|
29
28
|
async sendMessages(input) {
|
|
30
29
|
if (input.trigger === "regenerate-message" && !this.#sessionId) {
|
|
@@ -79,6 +78,9 @@ export class BlazingAgentsDirectChatTransport extends DefaultChatTransport {
|
|
|
79
78
|
trigger: input.trigger,
|
|
80
79
|
});
|
|
81
80
|
}
|
|
81
|
+
return this.#processChatResult(result);
|
|
82
|
+
}
|
|
83
|
+
async #processChatResult(result) {
|
|
82
84
|
const stream = result.toStream();
|
|
83
85
|
try {
|
|
84
86
|
const sessionId = await result.sessionId;
|
|
@@ -93,25 +95,8 @@ export class BlazingAgentsDirectChatTransport extends DefaultChatTransport {
|
|
|
93
95
|
}
|
|
94
96
|
return this.processResponseStream(stream);
|
|
95
97
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
const client = await this.#options.getClient();
|
|
101
|
-
const { continuation } = await client.sessions.toolApprovals({
|
|
102
|
-
agentId: this.#options.agentId,
|
|
103
|
-
sessionId: this.#sessionId,
|
|
104
|
-
});
|
|
105
|
-
if (continuation?.state !== "queued" && continuation?.state !== "running") {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
const result = await client.resumeChat({
|
|
109
|
-
agentId: this.#options.agentId,
|
|
110
|
-
sessionId: this.#sessionId,
|
|
111
|
-
continuationId: continuation.id,
|
|
112
|
-
functions: this.#options.functions ?? {},
|
|
113
|
-
});
|
|
114
|
-
return this.processResponseStream(result.toStream());
|
|
98
|
+
reconnectToStream(_input) {
|
|
99
|
+
return Promise.resolve(null);
|
|
115
100
|
}
|
|
116
101
|
async #sendApprovalContinuation(input, last) {
|
|
117
102
|
if (this.#sessionId === undefined) {
|
|
@@ -123,16 +108,10 @@ export class BlazingAgentsDirectChatTransport extends DefaultChatTransport {
|
|
|
123
108
|
sessionId: this.#sessionId,
|
|
124
109
|
abortSignal: input.abortSignal,
|
|
125
110
|
};
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
message: last,
|
|
129
|
-
});
|
|
130
|
-
if (continuationId === undefined) {
|
|
131
|
-
throw new Error("Tool approval response is missing an approval.");
|
|
132
|
-
}
|
|
133
|
-
const continuation = await client.resumeChat({
|
|
111
|
+
const decisions = extractApprovalDecisions(last);
|
|
112
|
+
const continuation = await client.continueChat({
|
|
134
113
|
...target,
|
|
135
|
-
|
|
114
|
+
decisions,
|
|
136
115
|
functions: this.#options.functions ?? {},
|
|
137
116
|
});
|
|
138
117
|
return this.processResponseStream(continuation.toStream());
|
package/dist/generation.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ChatInput, ChatResult, CompletionInput, CompletionResult, HttpConfig, ObjectInput, ObjectResult,
|
|
1
|
+
import type { ChatInput, ChatResult, CompletionInput, CompletionResult, ContinueChatInput, HttpConfig, ObjectInput, ObjectResult, TerminalStreamResult } from "./types.ts";
|
|
2
2
|
export declare function chat(config: HttpConfig, input: ChatInput): Promise<ChatResult>;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function continueChat(config: HttpConfig, input: ContinueChatInput): Promise<ChatResult>;
|
|
4
4
|
/**
|
|
5
5
|
* Keeps status and headers while filtering the SSE body. Missing or locked
|
|
6
6
|
* bodies pass through so the stream result reports them as `stream_error`.
|
package/dist/generation.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createTextStreamResponse, parsePartialJson } from "ai";
|
|
2
|
-
import { toolApprovalsResponseSchema } from "./contracts/entities/sessions.js";
|
|
3
2
|
import { sessionIdSchema } from "./contracts/ids.js";
|
|
4
3
|
import { BlazingAgentsError } from "./errors.js";
|
|
5
4
|
import { dispatchChatFunctions, toChatFunctionDefinitions, } from "./functions.js";
|
|
6
|
-
import {
|
|
5
|
+
import { requestStream } from "./http.js";
|
|
7
6
|
export async function chat(config, input) {
|
|
8
7
|
const body = buildChatBody(input);
|
|
9
8
|
if (input.functions && Object.keys(input.functions).length > 0) {
|
|
@@ -30,14 +29,17 @@ export async function chat(config, input) {
|
|
|
30
29
|
abortSignal: input.abortSignal,
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
|
-
export async function
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
export async function continueChat(config, input) {
|
|
33
|
+
const response = await requestStream(config, `/v1/agents/${input.agentId}/sessions/${input.sessionId}/tool-approvals/continue`, {
|
|
34
|
+
json: {
|
|
35
|
+
decisions: input.decisions,
|
|
36
|
+
...(input.functions === undefined
|
|
37
|
+
? {}
|
|
38
|
+
: { functions: toChatFunctionDefinitions(input.functions) }),
|
|
39
|
+
},
|
|
38
40
|
method: "POST",
|
|
39
41
|
clientRequestId: input.clientRequestId,
|
|
40
|
-
|
|
42
|
+
signal: input.abortSignal,
|
|
41
43
|
});
|
|
42
44
|
return buildChatResult(config, response, input.sessionId, {
|
|
43
45
|
agentId: input.agentId,
|
|
@@ -45,16 +47,6 @@ export async function resumeChat(config, input) {
|
|
|
45
47
|
abortSignal: input.abortSignal,
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
|
-
async function activeContinuationId(config, { agentId, sessionId, abortSignal }) {
|
|
49
|
-
const { continuation } = await requestJson(config, `/v1/agents/${agentId}/sessions/${sessionId}/tool-approvals`, { signal: abortSignal }, toolApprovalsResponseSchema);
|
|
50
|
-
if (continuation?.state !== "queued" && continuation?.state !== "running") {
|
|
51
|
-
throw new BlazingAgentsError({
|
|
52
|
-
code: "not_found",
|
|
53
|
-
message: "The Session has no tool approval continuation to resume.",
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return continuation.id;
|
|
57
|
-
}
|
|
58
50
|
/**
|
|
59
51
|
* Keeps status and headers while filtering the SSE body. Missing or locked
|
|
60
52
|
* bodies pass through so the stream result reports them as `stream_error`.
|
|
@@ -80,7 +72,10 @@ function buildChatBody(input) {
|
|
|
80
72
|
base.messageId = input.messageId;
|
|
81
73
|
}
|
|
82
74
|
if ("message" in input) {
|
|
83
|
-
base.
|
|
75
|
+
base.messages = [input.message];
|
|
76
|
+
}
|
|
77
|
+
else if ("messages" in input) {
|
|
78
|
+
base.messages = input.messages;
|
|
84
79
|
}
|
|
85
80
|
else {
|
|
86
81
|
base.promptId = input.promptId;
|
package/dist/index.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export type { CreateMcpConnectionBody, McpAttachmentResponse, McpAttachmentsResp
|
|
|
15
15
|
export type { CreateMerchantConnectionBody, MerchantBindingResponse, MerchantBindingsResponse, MerchantConnection, MerchantConnectionResponse, MerchantCustomerBinding, MerchantGuard, MerchantProviderKind, MerchantUsageEvent, MerchantUsageEventResponse, MerchantUsageEventStatus, MerchantUsageEventsResponse, MerchantUsageSummary, MerchantUsageSummaryResponse, UpdateMerchantConnectionBody, UpsertMerchantBindingBody, } from "./contracts/entities/merchant.ts";
|
|
16
16
|
export type { CreatePromptBody, PromptResponse, PromptsListQuery, PromptsResponse, UpdatePromptBody, } from "./contracts/entities/prompts.ts";
|
|
17
17
|
export type { CreateProviderBody, ProviderListItem, ProviderModel, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ProviderType, ThinkingLevelsResponse, UpdateProviderBody, } from "./contracts/entities/providers.ts";
|
|
18
|
-
export type {
|
|
19
|
-
export type { SessionResponse,
|
|
18
|
+
export type { ChatSteerConsumedEvent, SessionActivity, SessionInput, SessionInputResponse, SessionInputState, SessionInputsQuery, SessionInputsResponse, StopSessionBody, StopSessionResponse, SubmitSessionInputBody, } from "./contracts/entities/session-inputs.ts";
|
|
19
|
+
export type { ContinueToolApprovalsBody, SessionResponse, ToolApprovalDecision, ToolApprovalState, ToolApprovalsResponse, } from "./contracts/entities/sessions.ts";
|
|
20
20
|
export { sessionResponseSchema } from "./contracts/entities/sessions.ts";
|
|
21
21
|
export type { CreateSkillBody, Skill, SkillArchiveType, SkillCopyResult, SkillCopyResults, SkillDetail, SkillFile, SkillsListResponse, } from "./contracts/entities/skills.ts";
|
|
22
22
|
export type { SessionUsageQuery, SessionUsageResponse, UsageBucket, UsageOverviewQuery, UsageOverviewResponse, UsageTotals, } from "./contracts/entities/usage.ts";
|
|
@@ -25,4 +25,4 @@ export { BlazingAgentsDirectChatTransport, type BlazingAgentsDirectChatTransport
|
|
|
25
25
|
export { BlazingAgentsError } from "./errors.ts";
|
|
26
26
|
export { type ChatFunction, type ChatFunctionContext, type ChatFunctions, defineFunction, } from "./functions.ts";
|
|
27
27
|
export { createChatRelay, createCompletionRelay, type RelayContext, type SessionOwnershipStore, } from "./relay.ts";
|
|
28
|
-
export type { AgentClient, AgentSkillsResource, AgentsListOptions, AgentsResource, ArtifactsResource, AttributionInput, BlazingAgentsErrorCode, BlazingAgentsOptions, BlazingAgentsRequestOptions, BlazingAgentsUIMessage, BlazingAgentsUIMessageChunk, ChatConnectionsResource, ChatDeliveriesListOptions, ChatDeliveriesResource, ChatInput, ChatMessageInput, ChatPromptInput, ChatResult, ChatTrigger, CompletionInput, CompletionPromptIdInput, CompletionPromptInput, CompletionResult, KnownBlazingAgentsErrorCode, LatestSessionsListOptions, McpConnectionsResource, MemoriesListOptions, MemoriesResource, MerchantBindingsListOptions, MerchantBindingsResource, MerchantConnectionResource, MerchantUsageEventsListOptions, MerchantUsageEventsResource, ObjectInput, ObjectPromptIdInput, ObjectPromptInput, ObjectResult, PromptsResource, ProvidersResource, ResourceRequestOptions, ResponseObservation,
|
|
28
|
+
export type { AgentClient, AgentSkillsResource, AgentsListOptions, AgentsResource, ArtifactsResource, AttributionInput, BlazingAgentsErrorCode, BlazingAgentsOptions, BlazingAgentsRequestOptions, BlazingAgentsUIMessage, BlazingAgentsUIMessageChunk, ChatConnectionsResource, ChatDeliveriesListOptions, ChatDeliveriesResource, ChatInput, ChatMessageInput, ChatMessagesInput, ChatPromptInput, ChatResult, ChatTrigger, CompletionInput, CompletionPromptIdInput, CompletionPromptInput, CompletionResult, ContinueChatInput, KnownBlazingAgentsErrorCode, LatestSessionsListOptions, McpConnectionsResource, MemoriesListOptions, MemoriesResource, MerchantBindingsListOptions, MerchantBindingsResource, MerchantConnectionResource, MerchantUsageEventsListOptions, MerchantUsageEventsResource, ObjectInput, ObjectPromptIdInput, ObjectPromptInput, ObjectResult, PromptsResource, ProvidersResource, ResourceRequestOptions, ResponseObservation, SessionsResource, SkillsListOptions, TasksResource, TenantResource, TerminalStreamResult, UsageResource, UserClient, WorkspacesListOptions, WorkspacesResource, } from "./types.ts";
|
package/dist/relay.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { BlazingAgents } from "./client.ts";
|
|
|
2
2
|
import type { ChatFunctions } from "./functions.ts";
|
|
3
3
|
export interface RelayContext {
|
|
4
4
|
agentId: string;
|
|
5
|
-
/** Handlers for this authenticated request
|
|
5
|
+
/** Handlers for this authenticated request and its approved continuation. */
|
|
6
6
|
functions?: ChatFunctions;
|
|
7
7
|
metadata?: Record<string, unknown>;
|
|
8
8
|
userId: string;
|
|
@@ -17,9 +17,9 @@ interface RelayOptions<Method extends keyof BlazingAgents> {
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Relays useChat submissions. An assistant message carrying approval
|
|
20
|
-
* responses
|
|
20
|
+
* responses submits the complete round and streams the continuation.
|
|
21
21
|
*/
|
|
22
|
-
export declare function createChatRelay(options: RelayOptions<"chat" | "
|
|
22
|
+
export declare function createChatRelay(options: RelayOptions<"chat" | "continueChat"> & {
|
|
23
23
|
sessions: SessionOwnershipStore;
|
|
24
24
|
}): (request: Request) => Promise<Response>;
|
|
25
25
|
export declare function createCompletionRelay(options: RelayOptions<"completion">): (request: Request) => Promise<Response>;
|
package/dist/relay.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { safeValidateUIMessages } from "ai";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import {
|
|
3
|
+
import { extractApprovalDecisions } from "./approvals.js";
|
|
4
4
|
import { sessionIdSchema } from "./contracts/ids.js";
|
|
5
5
|
import { BlazingAgentsError } from "./errors.js";
|
|
6
6
|
const chatBodySchema = z.object({
|
|
@@ -14,7 +14,7 @@ const chatBodySchema = z.object({
|
|
|
14
14
|
const completionBodySchema = z.object({ prompt: z.string().trim().min(1) });
|
|
15
15
|
/**
|
|
16
16
|
* Relays useChat submissions. An assistant message carrying approval
|
|
17
|
-
* responses
|
|
17
|
+
* responses submits the complete round and streams the continuation.
|
|
18
18
|
*/
|
|
19
19
|
export function createChatRelay(options) {
|
|
20
20
|
return async (request) => {
|
|
@@ -44,6 +44,9 @@ export function createChatRelay(options) {
|
|
|
44
44
|
sessionId: body.sessionId,
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
+
if (message.role !== "user") {
|
|
48
|
+
return errorResponse(400, "invalid_request", "Chat submission requires a user message.");
|
|
49
|
+
}
|
|
47
50
|
const chatInput = {
|
|
48
51
|
agentId: context.agentId,
|
|
49
52
|
functions: context.functions,
|
|
@@ -92,17 +95,13 @@ async function relayApprovalResponses(client, { functions, message, request, ...
|
|
|
92
95
|
sessionId: input.sessionId,
|
|
93
96
|
abortSignal: request.signal,
|
|
94
97
|
};
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
message,
|
|
98
|
-
});
|
|
99
|
-
if (continuationId === undefined) {
|
|
98
|
+
const decisions = extractApprovalDecisions(message);
|
|
99
|
+
if (decisions.length === 0) {
|
|
100
100
|
return errorResponse(400, "invalid_request", "The message has no tool approval responses.");
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
const continuation = await client.resumeChat({
|
|
102
|
+
const continuation = await client.continueChat({
|
|
104
103
|
...target,
|
|
105
|
-
|
|
104
|
+
decisions,
|
|
106
105
|
functions: functions ?? {},
|
|
107
106
|
});
|
|
108
107
|
return continuation.toResponse();
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { latestSessionsListResponseSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema,
|
|
1
|
+
import { sessionInputResponseSchema, sessionInputsResponseSchema, stopSessionResponseSchema, } from "../contracts/entities/session-inputs.js";
|
|
2
|
+
import { latestSessionsListResponseSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalsResponseSchema, } from "../contracts/entities/sessions.js";
|
|
3
3
|
import { agentIdSchema, sessionIdSchema, turnIdSchema, } from "../contracts/ids.js";
|
|
4
|
-
import {
|
|
5
|
-
import { buildTerminalStreamResult, withFilteredBody } from "../generation.js";
|
|
6
|
-
import { requestJson, requestStream } from "../http.js";
|
|
4
|
+
import { requestJson } from "../http.js";
|
|
7
5
|
/**
|
|
8
6
|
* `client.sessions` reads, paginates, and deletes Sessions under
|
|
9
7
|
* `/v1/agents/:agentId/sessions`. Pagination is manual: the SDK returns
|
|
@@ -12,32 +10,12 @@ import { requestJson, requestStream } from "../http.js";
|
|
|
12
10
|
*/
|
|
13
11
|
export function createSessionsResource(config) {
|
|
14
12
|
return {
|
|
15
|
-
async runInputs({ agentId, sessionId, functions, abortSignal }) {
|
|
16
|
-
const response = await requestStream(config, `/v1/agents/${agentIdSchema.parse(agentId)}/sessions/${sessionIdSchema.parse(sessionId)}/inputs/run`, {
|
|
17
|
-
method: "POST",
|
|
18
|
-
json: functions === undefined
|
|
19
|
-
? {}
|
|
20
|
-
: { functions: toChatFunctionDefinitions(functions) },
|
|
21
|
-
signal: abortSignal,
|
|
22
|
-
});
|
|
23
|
-
return buildTerminalStreamResult(response, "input Turn", (body) => functions
|
|
24
|
-
? dispatchChatFunctions(config, { agentId, sessionId, functions, abortSignal }, body)
|
|
25
|
-
: stripFunctionEvents(body));
|
|
26
|
-
},
|
|
27
13
|
async submitInput({ agentId, sessionId, abortSignal, ...body }) {
|
|
28
14
|
return await requestJson(config, `/v1/agents/${agentIdSchema.parse(agentId)}/sessions/${sessionIdSchema.parse(sessionId)}/inputs`, { method: "POST", json: body, signal: abortSignal }, sessionInputResponseSchema);
|
|
29
15
|
},
|
|
30
16
|
async inputs({ agentId, sessionId, abortSignal, ...query }) {
|
|
31
17
|
return await requestJson(config, `/v1/agents/${agentIdSchema.parse(agentId)}/sessions/${sessionIdSchema.parse(sessionId)}/inputs`, { query, signal: abortSignal }, sessionInputsResponseSchema);
|
|
32
18
|
},
|
|
33
|
-
async promoteInput({ agentId, sessionId, requestId, abortSignal }) {
|
|
34
|
-
const inputId = sessionInputRequestIdSchema.parse(requestId);
|
|
35
|
-
return await requestJson(config, `/v1/agents/${agentIdSchema.parse(agentId)}/sessions/${sessionIdSchema.parse(sessionId)}/inputs/${encodeURIComponent(inputId)}/promote`, { method: "POST", signal: abortSignal }, sessionInputResponseSchema);
|
|
36
|
-
},
|
|
37
|
-
async deleteInput({ agentId, sessionId, requestId, abortSignal }) {
|
|
38
|
-
const inputId = sessionInputRequestIdSchema.parse(requestId);
|
|
39
|
-
return await requestJson(config, `/v1/agents/${agentIdSchema.parse(agentId)}/sessions/${sessionIdSchema.parse(sessionId)}/inputs/${encodeURIComponent(inputId)}`, { method: "DELETE", signal: abortSignal }, sessionInputResponseSchema);
|
|
40
|
-
},
|
|
41
19
|
async stop({ agentId, sessionId, turnId, abortSignal }) {
|
|
42
20
|
return await requestJson(config, `/v1/agents/${agentIdSchema.parse(agentId)}/sessions/${sessionIdSchema.parse(sessionId)}/stop`, {
|
|
43
21
|
method: "POST",
|
|
@@ -45,19 +23,9 @@ export function createSessionsResource(config) {
|
|
|
45
23
|
signal: abortSignal,
|
|
46
24
|
}, stopSessionResponseSchema);
|
|
47
25
|
},
|
|
48
|
-
async resumeInputs({ agentId, sessionId, abortSignal }) {
|
|
49
|
-
return await requestJson(config, `/v1/agents/${agentIdSchema.parse(agentId)}/sessions/${sessionIdSchema.parse(sessionId)}/inputs/resume`, { method: "POST", signal: abortSignal }, resumeSessionInputsResponseSchema);
|
|
50
|
-
},
|
|
51
26
|
async get({ agentId, sessionId, abortSignal }) {
|
|
52
27
|
return await requestJson(config, `/v1/agents/${agentId}/sessions/${sessionId}`, { signal: abortSignal }, sessionResponseSchema);
|
|
53
28
|
},
|
|
54
|
-
async decideToolApproval({ agentId, sessionId, approvalId, abortSignal, ...decision }) {
|
|
55
|
-
return await requestJson(config, `/v1/agents/${agentId}/sessions/${sessionId}/tool-approvals/${approvalId}`, {
|
|
56
|
-
json: decision,
|
|
57
|
-
method: "POST",
|
|
58
|
-
signal: abortSignal,
|
|
59
|
-
}, toolApprovalDecisionResponseSchema);
|
|
60
|
-
},
|
|
61
29
|
async list({ agentId, ...options }) {
|
|
62
30
|
return await requestJson(config, `/v1/agents/${agentId}/sessions`, {
|
|
63
31
|
signal: options.abortSignal,
|
|
@@ -93,11 +61,6 @@ export function createSessionsResource(config) {
|
|
|
93
61
|
},
|
|
94
62
|
}, sessionMessagesResponseSchema);
|
|
95
63
|
},
|
|
96
|
-
async joinToolApprovalContinuation({ agentId, sessionId, continuationId, abortSignal, }) {
|
|
97
|
-
const response = await requestStream(config, `/v1/agents/${agentId}/sessions/${sessionId}/tool-approval-continuations/${continuationId}`, { signal: abortSignal });
|
|
98
|
-
/** Observers never execute calls; private events are removed unclaimed. */
|
|
99
|
-
return buildTerminalStreamResult(withFilteredBody(response, stripFunctionEvents), "continuation");
|
|
100
|
-
},
|
|
101
64
|
async toolApprovals({ agentId, sessionId, abortSignal }) {
|
|
102
65
|
return await requestJson(config, `/v1/agents/${agentId}/sessions/${sessionId}/tool-approvals`, { signal: abortSignal }, toolApprovalsResponseSchema);
|
|
103
66
|
},
|