@blazingagents/sdk 0.11.0 → 0.13.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 +47 -16
- package/dist/client.d.ts +2 -1
- package/dist/client.js +3 -0
- package/dist/contracts/entities/chat-connections.d.ts +102 -0
- package/dist/contracts/entities/chat-connections.js +37 -1
- package/dist/contracts/entities/chat.d.ts +8 -13
- package/dist/contracts/entities/chat.js +8 -18
- package/dist/contracts/entities/providers.d.ts +2 -3
- package/dist/contracts/entities/providers.js +2 -3
- package/dist/contracts/entities/sessions.d.ts +2 -5
- package/dist/contracts/entities/sessions.js +2 -6
- package/dist/contracts/entities/tasks.d.ts +10 -0
- package/dist/contracts/entities/tasks.js +10 -8
- package/dist/contracts/ids.d.ts +1 -0
- package/dist/contracts/ids.js +1 -0
- package/dist/contracts/index.d.ts +2 -2
- package/dist/contracts/index.js +2 -2
- package/dist/contracts/limitations.d.ts +1 -6
- package/dist/contracts/limitations.js +1 -6
- package/dist/direct-chat-transport.d.ts +13 -4
- package/dist/direct-chat-transport.js +93 -12
- package/dist/generation.js +0 -9
- package/dist/http.js +0 -6
- package/dist/index.d.ts +2 -5
- package/dist/index.js +0 -3
- package/dist/resources/chat-deliveries.d.ts +6 -0
- package/dist/resources/chat-deliveries.js +20 -0
- package/dist/types.d.ts +17 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,40 +87,59 @@ use `result.toStream()` on chat or terminal continuation results to read the
|
|
|
87
87
|
original SSE bytes. It shares one-shot ownership with `toResponse()`; choose one
|
|
88
88
|
accessor per result. Stream errors and cancellation retain the same behavior.
|
|
89
89
|
|
|
90
|
-
###
|
|
90
|
+
### Relay browser chat
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
Tenant browser apps use `BlazingAgentsChatTransport` with their own backend.
|
|
93
|
+
The backend holds the Tenant API key and authorizes each Session. The transport
|
|
94
|
+
sends the newest user message and resumes with the server-minted Session ID.
|
|
95
|
+
|
|
96
|
+
### Direct chat with the SDK
|
|
97
|
+
|
|
98
|
+
For the platform dashboard or another runtime with an authorized credential,
|
|
99
|
+
use `BlazingAgentsDirectChatTransport` with AI SDK `useChat`. It sends through
|
|
100
|
+
`client.chat()` and decodes the stream without constructing a streaming
|
|
101
|
+
`Response`. Inject a native streaming fetch implementation into `BlazingAgents`
|
|
102
|
+
when the runtime requires one.
|
|
96
103
|
|
|
97
104
|
```tsx
|
|
98
105
|
import { useMemo } from "react";
|
|
99
106
|
import { useChat } from "@ai-sdk/react";
|
|
100
|
-
import { BlazingAgentsDirectChatTransport } from "@blazingagents/sdk";
|
|
107
|
+
import { BlazingAgents, BlazingAgentsDirectChatTransport } from "@blazingagents/sdk";
|
|
101
108
|
|
|
102
|
-
function Chat({
|
|
109
|
+
function Chat({ getCredential, agentId, initialSessionId, saveSessionId }) {
|
|
103
110
|
const transport = useMemo(
|
|
104
111
|
() => new BlazingAgentsDirectChatTransport({
|
|
105
|
-
|
|
112
|
+
getClient: async () => new BlazingAgents({ apiKey: await getCredential() }),
|
|
106
113
|
agentId,
|
|
107
114
|
sessionId: initialSessionId,
|
|
108
115
|
onSessionId: saveSessionId,
|
|
109
116
|
}),
|
|
110
|
-
[
|
|
117
|
+
[getCredential, agentId, initialSessionId, saveSessionId],
|
|
111
118
|
);
|
|
112
119
|
const chat = useChat({ transport });
|
|
113
120
|
// Render chat.messages and submit using chat.sendMessage({ text }).
|
|
114
121
|
}
|
|
115
122
|
```
|
|
116
123
|
|
|
117
|
-
Install `@ai-sdk/react` for the React hook. Keep the transport stable for one
|
|
118
|
-
remount the chat with a new transport when switching
|
|
119
|
-
Sessions. `
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
Install `@ai-sdk/react` for the React hook. Keep the transport stable for one
|
|
125
|
+
Session; remount the chat with a new transport when switching Agents or
|
|
126
|
+
Sessions. `getClient` runs before each request, so it can read a current
|
|
127
|
+
dashboard credential. Return a `BlazingAgents` client with that credential.
|
|
128
|
+
|
|
129
|
+
On Session creation, `version` pins the Agent Version, and `userId` and
|
|
130
|
+
`metadata` set attribution. To invoke a stored Prompt, pass `promptId` and
|
|
131
|
+
optional `variables` to the transport. Its first Turn sends those fields in
|
|
132
|
+
place of the `useChat` user message. Later Turns send user messages and omit
|
|
133
|
+
the create options, including `version`.
|
|
134
|
+
|
|
135
|
+
`onSessionId` runs once for a newly created Session before stream consumption,
|
|
136
|
+
so it can be saved even if streaming later fails. The transport preserves user
|
|
137
|
+
message IDs, regeneration targets, and `useChat` cancellation. Regeneration
|
|
138
|
+
requires an existing Session. When `useChat` submits tool approval responses,
|
|
139
|
+
the transport sends each decision in order and streams the continuation. After
|
|
140
|
+
reload, `reconnectToStream` joins a queued or running continuation for the
|
|
141
|
+
supplied `sessionId`. It returns `null` when there is no active continuation.
|
|
142
|
+
It does not retry an interrupted ordinary Turn.
|
|
124
143
|
|
|
125
144
|
### Cancel requests
|
|
126
145
|
|
|
@@ -239,6 +258,18 @@ Use the [connection example](https://github.com/blazingagents/typescript-sdk/blo
|
|
|
239
258
|
Agent through REST. BA hosts the Chat SDK runtime, conversation history, and
|
|
240
259
|
approval cards; no additional SDK resource is required.
|
|
241
260
|
|
|
261
|
+
`client.chatDeliveries.list` reads the Tenant-wide delivery feed across all
|
|
262
|
+
Chat Connections, newest first. `status` accepts `failed` and/or `ambiguous`;
|
|
263
|
+
omitting it returns both. For example, the failed and ambiguous deliveries
|
|
264
|
+
since a timestamp:
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
const page = await client.chatDeliveries.list({
|
|
268
|
+
status: ["failed", "ambiguous"],
|
|
269
|
+
since: "2026-09-01T00:00:00.000Z",
|
|
270
|
+
});
|
|
271
|
+
```
|
|
272
|
+
|
|
242
273
|
## Merchant monetization
|
|
243
274
|
|
|
244
275
|
Bill your own customers for model-token usage through your Polar or Dodo
|
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { AgentClient, AgentsResource, ArtifactsResource, BlazingAgentsOptions, BlazingAgentsRequestOptions, ChatConnectionsResource, ChatInput, ChatResult, CompletionInput, CompletionResult, McpConnectionsResource, MemoriesResource, MerchantBindingsResource, MerchantConnectionResource, MerchantUsageEventsResource, ObjectInput, ObjectResult, PromptsResource, ProvidersResource, SessionsResource, TasksResource, TenantResource, UsageResource, WorkspacesResource } from "./types.ts";
|
|
1
|
+
import type { AgentClient, AgentsResource, ArtifactsResource, BlazingAgentsOptions, BlazingAgentsRequestOptions, ChatConnectionsResource, ChatDeliveriesResource, ChatInput, ChatResult, CompletionInput, CompletionResult, McpConnectionsResource, MemoriesResource, MerchantBindingsResource, MerchantConnectionResource, MerchantUsageEventsResource, ObjectInput, ObjectResult, PromptsResource, ProvidersResource, SessionsResource, TasksResource, TenantResource, UsageResource, WorkspacesResource } from "./types.ts";
|
|
2
2
|
export declare class BlazingAgents {
|
|
3
3
|
private readonly config;
|
|
4
4
|
readonly chatConnections: ChatConnectionsResource;
|
|
5
|
+
readonly chatDeliveries: ChatDeliveriesResource;
|
|
5
6
|
readonly agents: AgentsResource;
|
|
6
7
|
readonly sessions: SessionsResource;
|
|
7
8
|
readonly providers: ProvidersResource;
|
package/dist/client.js
CHANGED
|
@@ -2,6 +2,7 @@ import { chat, completion, objectGeneration } from "./generation.js";
|
|
|
2
2
|
import { createAgentsResource } from "./resources/agents.js";
|
|
3
3
|
import { createArtifactsResource } from "./resources/artifacts.js";
|
|
4
4
|
import { createChatConnectionsResource } from "./resources/chat-connections.js";
|
|
5
|
+
import { createChatDeliveriesResource } from "./resources/chat-deliveries.js";
|
|
5
6
|
import { createMcpConnectionsResource } from "./resources/mcp-connections.js";
|
|
6
7
|
import { createMemoriesResource } from "./resources/memories.js";
|
|
7
8
|
import { createMerchantBindingsResource } from "./resources/merchant-bindings.js";
|
|
@@ -20,6 +21,7 @@ const TRAILING_SLASH_RE = /\/+$/;
|
|
|
20
21
|
export class BlazingAgents {
|
|
21
22
|
config;
|
|
22
23
|
chatConnections;
|
|
24
|
+
chatDeliveries;
|
|
23
25
|
agents;
|
|
24
26
|
sessions;
|
|
25
27
|
providers;
|
|
@@ -45,6 +47,7 @@ export class BlazingAgents {
|
|
|
45
47
|
onResponse: options.onResponse,
|
|
46
48
|
};
|
|
47
49
|
this.chatConnections = createChatConnectionsResource(this.config);
|
|
50
|
+
this.chatDeliveries = createChatDeliveriesResource(this.config);
|
|
48
51
|
this.agents = createAgentsResource(this.config);
|
|
49
52
|
this.sessions = createSessionsResource(this.config);
|
|
50
53
|
this.providers = createProvidersResource(this.config);
|
|
@@ -187,3 +187,105 @@ export declare const chatConnectionsResponseSchema: z.ZodObject<{
|
|
|
187
187
|
}, z.core.$strip>;
|
|
188
188
|
export type ChatConnectionsResponse = z.output<typeof chatConnectionsResponseSchema>;
|
|
189
189
|
export type RotateChatConnectionBody = z.input<typeof rotateChatConnectionBodySchema>;
|
|
190
|
+
export declare const chatDeliveryStatusSchema: z.ZodEnum<{
|
|
191
|
+
ambiguous: "ambiguous";
|
|
192
|
+
confirmed: "confirmed";
|
|
193
|
+
failed: "failed";
|
|
194
|
+
pending: "pending";
|
|
195
|
+
}>;
|
|
196
|
+
export type ChatDeliveryStatus = z.infer<typeof chatDeliveryStatusSchema>;
|
|
197
|
+
export declare const chatDeliveryListStatusSchema: z.ZodEnum<{
|
|
198
|
+
ambiguous: "ambiguous";
|
|
199
|
+
failed: "failed";
|
|
200
|
+
}>;
|
|
201
|
+
export type ChatDeliveryListStatus = z.infer<typeof chatDeliveryListStatusSchema>;
|
|
202
|
+
export declare const chatDeliverySchema: z.ZodObject<{
|
|
203
|
+
id: z.ZodString;
|
|
204
|
+
kind: z.ZodEnum<{
|
|
205
|
+
card: "card";
|
|
206
|
+
reply: "reply";
|
|
207
|
+
}>;
|
|
208
|
+
status: z.ZodEnum<{
|
|
209
|
+
ambiguous: "ambiguous";
|
|
210
|
+
confirmed: "confirmed";
|
|
211
|
+
failed: "failed";
|
|
212
|
+
pending: "pending";
|
|
213
|
+
}>;
|
|
214
|
+
attempt: z.ZodNumber;
|
|
215
|
+
credentialVersion: z.ZodNumber;
|
|
216
|
+
representation: z.ZodString;
|
|
217
|
+
diagnostic: z.ZodNullable<z.ZodString>;
|
|
218
|
+
receipts: z.ZodOptional<z.ZodUnknown>;
|
|
219
|
+
sessionId: z.ZodString;
|
|
220
|
+
messageId: z.ZodNullable<z.ZodString>;
|
|
221
|
+
approvalId: z.ZodNullable<z.ZodString>;
|
|
222
|
+
threadId: z.ZodString;
|
|
223
|
+
createdAt: z.ZodString;
|
|
224
|
+
updatedAt: z.ZodString;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
export type ChatDelivery = z.infer<typeof chatDeliverySchema>;
|
|
227
|
+
export declare const tenantChatDeliverySchema: z.ZodObject<{
|
|
228
|
+
id: z.ZodString;
|
|
229
|
+
kind: z.ZodEnum<{
|
|
230
|
+
card: "card";
|
|
231
|
+
reply: "reply";
|
|
232
|
+
}>;
|
|
233
|
+
status: z.ZodEnum<{
|
|
234
|
+
ambiguous: "ambiguous";
|
|
235
|
+
confirmed: "confirmed";
|
|
236
|
+
failed: "failed";
|
|
237
|
+
pending: "pending";
|
|
238
|
+
}>;
|
|
239
|
+
attempt: z.ZodNumber;
|
|
240
|
+
credentialVersion: z.ZodNumber;
|
|
241
|
+
representation: z.ZodString;
|
|
242
|
+
diagnostic: z.ZodNullable<z.ZodString>;
|
|
243
|
+
receipts: z.ZodOptional<z.ZodUnknown>;
|
|
244
|
+
sessionId: z.ZodString;
|
|
245
|
+
messageId: z.ZodNullable<z.ZodString>;
|
|
246
|
+
approvalId: z.ZodNullable<z.ZodString>;
|
|
247
|
+
threadId: z.ZodString;
|
|
248
|
+
createdAt: z.ZodString;
|
|
249
|
+
updatedAt: z.ZodString;
|
|
250
|
+
connectionId: z.ZodString;
|
|
251
|
+
agentId: z.ZodString;
|
|
252
|
+
platform: z.ZodEnum<{
|
|
253
|
+
slack: "slack";
|
|
254
|
+
telegram: "telegram";
|
|
255
|
+
}>;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
export type TenantChatDelivery = z.infer<typeof tenantChatDeliverySchema>;
|
|
258
|
+
export declare const chatDeliveriesResponseSchema: z.ZodObject<{
|
|
259
|
+
data: z.ZodArray<z.ZodObject<{
|
|
260
|
+
id: z.ZodString;
|
|
261
|
+
kind: z.ZodEnum<{
|
|
262
|
+
card: "card";
|
|
263
|
+
reply: "reply";
|
|
264
|
+
}>;
|
|
265
|
+
status: z.ZodEnum<{
|
|
266
|
+
ambiguous: "ambiguous";
|
|
267
|
+
confirmed: "confirmed";
|
|
268
|
+
failed: "failed";
|
|
269
|
+
pending: "pending";
|
|
270
|
+
}>;
|
|
271
|
+
attempt: z.ZodNumber;
|
|
272
|
+
credentialVersion: z.ZodNumber;
|
|
273
|
+
representation: z.ZodString;
|
|
274
|
+
diagnostic: z.ZodNullable<z.ZodString>;
|
|
275
|
+
receipts: z.ZodOptional<z.ZodUnknown>;
|
|
276
|
+
sessionId: z.ZodString;
|
|
277
|
+
messageId: z.ZodNullable<z.ZodString>;
|
|
278
|
+
approvalId: z.ZodNullable<z.ZodString>;
|
|
279
|
+
threadId: z.ZodString;
|
|
280
|
+
createdAt: z.ZodString;
|
|
281
|
+
updatedAt: z.ZodString;
|
|
282
|
+
connectionId: z.ZodString;
|
|
283
|
+
agentId: z.ZodString;
|
|
284
|
+
platform: z.ZodEnum<{
|
|
285
|
+
slack: "slack";
|
|
286
|
+
telegram: "telegram";
|
|
287
|
+
}>;
|
|
288
|
+
}, z.core.$strip>>;
|
|
289
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
export type ChatDeliveriesResponse = z.infer<typeof chatDeliveriesResponseSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { agentIdSchema, chatConnectionIdSchema, tenantIdSchema, } from "../ids.js";
|
|
2
|
+
import { agentIdSchema, chatConnectionIdSchema, chatDeliveryIdSchema, tenantIdSchema, } from "../ids.js";
|
|
3
3
|
const secret = z
|
|
4
4
|
.string()
|
|
5
5
|
.min(8)
|
|
@@ -140,3 +140,39 @@ export const chatConnectionSchema = z
|
|
|
140
140
|
export const chatConnectionsResponseSchema = z
|
|
141
141
|
.object({ chatConnections: z.array(chatConnectionSchema) })
|
|
142
142
|
.strip();
|
|
143
|
+
export const chatDeliveryStatusSchema = z.enum([
|
|
144
|
+
"pending",
|
|
145
|
+
"confirmed",
|
|
146
|
+
"failed",
|
|
147
|
+
"ambiguous",
|
|
148
|
+
]);
|
|
149
|
+
export const chatDeliveryListStatusSchema = z.enum(["failed", "ambiguous"]);
|
|
150
|
+
export const chatDeliverySchema = z
|
|
151
|
+
.object({
|
|
152
|
+
id: chatDeliveryIdSchema,
|
|
153
|
+
kind: z.enum(["reply", "card"]),
|
|
154
|
+
status: chatDeliveryStatusSchema,
|
|
155
|
+
attempt: z.number().int().nonnegative(),
|
|
156
|
+
credentialVersion: z.number().int().nonnegative(),
|
|
157
|
+
representation: z.string(),
|
|
158
|
+
diagnostic: z.string().nullable(),
|
|
159
|
+
receipts: z.unknown().optional(),
|
|
160
|
+
sessionId: z.string(),
|
|
161
|
+
messageId: z.string().nullable(),
|
|
162
|
+
approvalId: z.string().nullable(),
|
|
163
|
+
threadId: z.string(),
|
|
164
|
+
createdAt: z.string(),
|
|
165
|
+
updatedAt: z.string(),
|
|
166
|
+
})
|
|
167
|
+
.strip();
|
|
168
|
+
export const tenantChatDeliverySchema = chatDeliverySchema.extend({
|
|
169
|
+
connectionId: chatConnectionIdSchema,
|
|
170
|
+
agentId: agentIdSchema,
|
|
171
|
+
platform: z.enum(["slack", "telegram"]),
|
|
172
|
+
});
|
|
173
|
+
export const chatDeliveriesResponseSchema = z
|
|
174
|
+
.object({
|
|
175
|
+
data: z.array(tenantChatDeliverySchema),
|
|
176
|
+
nextCursor: z.string().nullable(),
|
|
177
|
+
})
|
|
178
|
+
.strip();
|
|
@@ -30,11 +30,13 @@ export declare const usageSummarySchema: z.ZodObject<{
|
|
|
30
30
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
31
31
|
modelId: z.ZodString;
|
|
32
32
|
outputTokens: z.ZodNumber;
|
|
33
|
+
reasoningTokens: z.ZodNullable<z.ZodNumber>;
|
|
33
34
|
turnId: z.ZodString;
|
|
34
35
|
sessionId: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"">]>;
|
|
35
36
|
stepUsages: z.ZodArray<z.ZodObject<{
|
|
36
37
|
inputTokens: z.ZodNumber;
|
|
37
38
|
outputTokens: z.ZodNumber;
|
|
39
|
+
reasoningTokens: z.ZodNullable<z.ZodNumber>;
|
|
38
40
|
stepNumber: z.ZodNumber;
|
|
39
41
|
}, z.core.$strip>>;
|
|
40
42
|
startedAt: z.ZodISODateTime;
|
|
@@ -61,11 +63,13 @@ export declare const blazingAgentsChatMessageMetadataSchema: z.ZodObject<{
|
|
|
61
63
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
62
64
|
modelId: z.ZodString;
|
|
63
65
|
outputTokens: z.ZodNumber;
|
|
66
|
+
reasoningTokens: z.ZodNullable<z.ZodNumber>;
|
|
64
67
|
turnId: z.ZodString;
|
|
65
68
|
sessionId: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"">]>;
|
|
66
69
|
stepUsages: z.ZodArray<z.ZodObject<{
|
|
67
70
|
inputTokens: z.ZodNumber;
|
|
68
71
|
outputTokens: z.ZodNumber;
|
|
72
|
+
reasoningTokens: z.ZodNullable<z.ZodNumber>;
|
|
69
73
|
stepNumber: z.ZodNumber;
|
|
70
74
|
}, z.core.$strip>>;
|
|
71
75
|
startedAt: z.ZodISODateTime;
|
|
@@ -96,19 +100,10 @@ type ExclusivePromptInput<Literal extends object> = (Literal & {
|
|
|
96
100
|
/**
|
|
97
101
|
* `POST /v1/agents/{agentId}/sessions` (create) and
|
|
98
102
|
* `POST /v1/agents/{agentId}/sessions/{sessionId}` (resume) request body.
|
|
99
|
-
* The platform mints the `ss_`
|
|
100
|
-
* it
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* (`promptId` + `variables`) is mutually exclusive with `message` — both
|
|
104
|
-
* present or neither → 400 invalid_request. `variables` is only allowed
|
|
105
|
-
* on the prompt-invocation path: a request carrying both `message` and
|
|
106
|
-
* `variables` (without `promptId`) is a mixed shape and is rejected
|
|
107
|
-
* (strict both ways). The route layer resolves the prompt template,
|
|
108
|
-
* renders, and substitutes a server-constructed user `UIMessage` with a
|
|
109
|
-
* single text part carrying the rendered string. `trigger` /
|
|
110
|
-
* `messageId` are turn-level concerns (regenerate rides on the resume
|
|
111
|
-
* route only — enforced by the route layer, not the schema).
|
|
103
|
+
* The URL selects the mode; on create the platform mints the `ss_` id and
|
|
104
|
+
* returns it in `Location`. Exactly one of `message` or `promptId` is
|
|
105
|
+
* required, and `variables` requires `promptId`. Regenerate is resume-only,
|
|
106
|
+
* enforced by the route layer rather than this schema.
|
|
112
107
|
*/
|
|
113
108
|
export declare const chatRequestBodySchema: z.ZodObject<{
|
|
114
109
|
message: z.ZodOptional<z.ZodUnknown>;
|
|
@@ -31,12 +31,14 @@ export const usageSummarySchema = z
|
|
|
31
31
|
metadata: z.record(z.string(), z.unknown()),
|
|
32
32
|
modelId: agentModelIdSchema,
|
|
33
33
|
outputTokens: z.number().int().min(0),
|
|
34
|
+
reasoningTokens: z.number().int().min(0).nullable(),
|
|
34
35
|
turnId: turnIdSchema,
|
|
35
36
|
sessionId: z.union([sessionIdSchema, z.literal("")]),
|
|
36
37
|
stepUsages: z.array(z
|
|
37
38
|
.object({
|
|
38
39
|
inputTokens: z.number().int().min(0),
|
|
39
40
|
outputTokens: z.number().int().min(0),
|
|
41
|
+
reasoningTokens: z.number().int().min(0).nullable(),
|
|
40
42
|
stepNumber: z.number().int().min(0),
|
|
41
43
|
})
|
|
42
44
|
.strip()),
|
|
@@ -61,19 +63,10 @@ export const promptVariablesSchema = z.record(z.string(), z.string());
|
|
|
61
63
|
/**
|
|
62
64
|
* `POST /v1/agents/{agentId}/sessions` (create) and
|
|
63
65
|
* `POST /v1/agents/{agentId}/sessions/{sessionId}` (resume) request body.
|
|
64
|
-
* The platform mints the `ss_`
|
|
65
|
-
* it
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* (`promptId` + `variables`) is mutually exclusive with `message` — both
|
|
69
|
-
* present or neither → 400 invalid_request. `variables` is only allowed
|
|
70
|
-
* on the prompt-invocation path: a request carrying both `message` and
|
|
71
|
-
* `variables` (without `promptId`) is a mixed shape and is rejected
|
|
72
|
-
* (strict both ways). The route layer resolves the prompt template,
|
|
73
|
-
* renders, and substitutes a server-constructed user `UIMessage` with a
|
|
74
|
-
* single text part carrying the rendered string. `trigger` /
|
|
75
|
-
* `messageId` are turn-level concerns (regenerate rides on the resume
|
|
76
|
-
* route only — enforced by the route layer, not the schema).
|
|
66
|
+
* The URL selects the mode; on create the platform mints the `ss_` id and
|
|
67
|
+
* returns it in `Location`. Exactly one of `message` or `promptId` is
|
|
68
|
+
* required, and `variables` requires `promptId`. Regenerate is resume-only,
|
|
69
|
+
* enforced by the route layer rather than this schema.
|
|
77
70
|
*/
|
|
78
71
|
export const chatRequestBodySchema = z
|
|
79
72
|
.object({
|
|
@@ -89,11 +82,8 @@ export const chatRequestBodySchema = z
|
|
|
89
82
|
messageId: z.string().min(1).optional(),
|
|
90
83
|
version: agentVersionNumberSchema.optional(),
|
|
91
84
|
/**
|
|
92
|
-
* End-user attribution
|
|
93
|
-
*
|
|
94
|
-
* the session row at lazy materialization (create path) and every
|
|
95
|
-
* `token_usage_*` row this turn records. `metadata` is a mutable jsonb
|
|
96
|
-
* object carried onto the same rows. Both default to tenant-level.
|
|
85
|
+
* End-user attribution (ADR-0001), stamped on the Session at lazy
|
|
86
|
+
* materialization and on every usage row this Turn records.
|
|
97
87
|
*/
|
|
98
88
|
userId: userIdSchema.default(""),
|
|
99
89
|
metadata: metadataSchema.default({}),
|
|
@@ -36,9 +36,8 @@ export declare const providerSchema: z.ZodObject<{
|
|
|
36
36
|
updatedAt: z.ZodISODateTime;
|
|
37
37
|
}, z.core.$strict>;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* updatedAt }`. The Vault pointer and tenant id are write-only/internal.
|
|
39
|
+
* `GET /v1/providers/{id}` wire response. The Vault pointer and tenant id
|
|
40
|
+
* stay internal.
|
|
42
41
|
*/
|
|
43
42
|
export declare const providerResponseSchema: z.ZodObject<{
|
|
44
43
|
id: z.ZodString;
|
|
@@ -39,9 +39,8 @@ export const providerSchema = z
|
|
|
39
39
|
})
|
|
40
40
|
.strict();
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* updatedAt }`. The Vault pointer and tenant id are write-only/internal.
|
|
42
|
+
* `GET /v1/providers/{id}` wire response. The Vault pointer and tenant id
|
|
43
|
+
* stay internal.
|
|
45
44
|
*/
|
|
46
45
|
export const providerResponseSchema = z
|
|
47
46
|
.object({
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
|
-
* `GET /v1/agents/{agentId}/sessions` list item
|
|
4
|
-
* `
|
|
5
|
-
* lastMessagePreview, userId, metadata }`. `agentId`/`tenantId` are internal
|
|
6
|
-
* (used for filtering) and never leak to the wire. `userId`/`metadata` are
|
|
7
|
-
* stamped at lazy materialization (the first successful turn's attribution).
|
|
3
|
+
* `GET /v1/agents/{agentId}/sessions` list item. `agentId`/`tenantId` never
|
|
4
|
+
* leak to the wire; `userId`/`metadata` come from the first successful Turn.
|
|
8
5
|
*/
|
|
9
6
|
export declare const sessionListItemSchema: z.ZodObject<{
|
|
10
7
|
agentVersion: z.ZodNullable<z.ZodNumber>;
|
|
@@ -6,11 +6,8 @@ import { toolReferenceSchema } from "./agent-approval.js";
|
|
|
6
6
|
import { agentSchema, agentVersionNumberSchema } from "./agents.js";
|
|
7
7
|
import { metadataSchema, userIdSchema } from "./attribution.js";
|
|
8
8
|
/**
|
|
9
|
-
* `GET /v1/agents/{agentId}/sessions` list item
|
|
10
|
-
* `
|
|
11
|
-
* lastMessagePreview, userId, metadata }`. `agentId`/`tenantId` are internal
|
|
12
|
-
* (used for filtering) and never leak to the wire. `userId`/`metadata` are
|
|
13
|
-
* stamped at lazy materialization (the first successful turn's attribution).
|
|
9
|
+
* `GET /v1/agents/{agentId}/sessions` list item. `agentId`/`tenantId` never
|
|
10
|
+
* leak to the wire; `userId`/`metadata` come from the first successful Turn.
|
|
14
11
|
*/
|
|
15
12
|
export const sessionListItemSchema = z
|
|
16
13
|
.object({
|
|
@@ -75,7 +72,6 @@ export const sessionMessagesResponseSchema = z
|
|
|
75
72
|
latestCursor: z.string().nullable(),
|
|
76
73
|
})
|
|
77
74
|
.strip();
|
|
78
|
-
// Query params for the messages endpoint.
|
|
79
75
|
export const sessionMessagesQuerySchema = z
|
|
80
76
|
.object({
|
|
81
77
|
limit: z
|
|
@@ -212,6 +212,7 @@ export declare const taskListItemSchema: z.ZodObject<{
|
|
|
212
212
|
}>;
|
|
213
213
|
finishedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
214
214
|
}, z.core.$strip>>;
|
|
215
|
+
nextFireAt: z.ZodNullable<z.ZodISODateTime>;
|
|
215
216
|
}, z.core.$strip>;
|
|
216
217
|
export declare const tasksListResponseSchema: z.ZodObject<{
|
|
217
218
|
data: z.ZodArray<z.ZodObject<{
|
|
@@ -259,6 +260,7 @@ export declare const tasksListResponseSchema: z.ZodObject<{
|
|
|
259
260
|
}>;
|
|
260
261
|
finishedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
261
262
|
}, z.core.$strip>>;
|
|
263
|
+
nextFireAt: z.ZodNullable<z.ZodISODateTime>;
|
|
262
264
|
}, z.core.$strip>>;
|
|
263
265
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
264
266
|
}, z.core.$strip>;
|
|
@@ -301,6 +303,10 @@ export declare const taskResponseSchema: z.ZodObject<{
|
|
|
301
303
|
createdAt: z.ZodISODateTime;
|
|
302
304
|
updatedAt: z.ZodISODateTime;
|
|
303
305
|
}, z.core.$strip>;
|
|
306
|
+
/**
|
|
307
|
+
* Task run record. `userId`/`metadata` are copied from the task at enqueue
|
|
308
|
+
* and carried onto the run's Session and usage facts.
|
|
309
|
+
*/
|
|
304
310
|
export declare const taskRunSchema: z.ZodObject<{
|
|
305
311
|
id: z.ZodString;
|
|
306
312
|
taskId: z.ZodString;
|
|
@@ -422,6 +428,10 @@ export declare const createTaskResponseSchema: z.ZodObject<{
|
|
|
422
428
|
export declare const createTaskRunResponseSchema: z.ZodObject<{
|
|
423
429
|
runId: z.ZodString;
|
|
424
430
|
}, z.core.$strip>;
|
|
431
|
+
/**
|
|
432
|
+
* `GET .../runs/{runId}/messages` — the run transcript plus `status`,
|
|
433
|
+
* `error`, and `finishedAt`, so one poll loop can follow the run.
|
|
434
|
+
*/
|
|
425
435
|
export declare const taskRunMessagesResponseSchema: z.ZodObject<{
|
|
426
436
|
data: z.ZodArray<z.ZodObject<{
|
|
427
437
|
id: z.ZodString;
|
|
@@ -126,8 +126,7 @@ export const createTaskBodySchema = z
|
|
|
126
126
|
metadata: metadataSchema.default({}),
|
|
127
127
|
})
|
|
128
128
|
.strict();
|
|
129
|
-
// `PATCH /v1/tasks/{taskId}` —
|
|
130
|
-
// agentId + userId immutable.
|
|
129
|
+
// `PATCH /v1/tasks/{taskId}` — `agentId` and `userId` are immutable.
|
|
131
130
|
export const updateTaskBodySchema = z
|
|
132
131
|
.object({
|
|
133
132
|
agentVersion: agentVersionNumberSchema.nullable().optional(),
|
|
@@ -200,6 +199,7 @@ export const taskLatestRunSchema = z
|
|
|
200
199
|
.strip();
|
|
201
200
|
export const taskListItemSchema = taskSchema.extend({
|
|
202
201
|
latestRun: taskLatestRunSchema.nullable(),
|
|
202
|
+
nextFireAt: z.iso.datetime({ offset: true }).nullable(),
|
|
203
203
|
});
|
|
204
204
|
export const tasksListResponseSchema = paginatedResponseSchema(taskListItemSchema);
|
|
205
205
|
export const tasksListQuerySchema = z
|
|
@@ -210,9 +210,10 @@ export const tasksListQuerySchema = z
|
|
|
210
210
|
})
|
|
211
211
|
.strict();
|
|
212
212
|
export const taskResponseSchema = taskSchema;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
/**
|
|
214
|
+
* Task run record. `userId`/`metadata` are copied from the task at enqueue
|
|
215
|
+
* and carried onto the run's Session and usage facts.
|
|
216
|
+
*/
|
|
216
217
|
export const taskRunSchema = z
|
|
217
218
|
.object({
|
|
218
219
|
id: taskRunIdSchema,
|
|
@@ -249,9 +250,10 @@ export const createTaskRunResponseSchema = z
|
|
|
249
250
|
runId: taskRunIdSchema,
|
|
250
251
|
})
|
|
251
252
|
.strip();
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
/**
|
|
254
|
+
* `GET .../runs/{runId}/messages` — the run transcript plus `status`,
|
|
255
|
+
* `error`, and `finishedAt`, so one poll loop can follow the run.
|
|
256
|
+
*/
|
|
255
257
|
export const taskRunMessagesResponseSchema = sessionMessagesResponseSchema
|
|
256
258
|
.extend({
|
|
257
259
|
error: z.string().nullable(),
|
package/dist/contracts/ids.d.ts
CHANGED
|
@@ -58,3 +58,4 @@ export declare const apiKeyFragmentSchema: z.ZodString;
|
|
|
58
58
|
export declare const providerKeyFragmentSchema: z.ZodString;
|
|
59
59
|
export type TurnId = z.infer<typeof turnIdSchema>;
|
|
60
60
|
export declare const chatConnectionIdSchema: z.ZodString;
|
|
61
|
+
export declare const chatDeliveryIdSchema: z.ZodString;
|
package/dist/contracts/ids.js
CHANGED
|
@@ -84,3 +84,4 @@ export const apiKeyFragmentSchema = z.string().regex(/^ba_[0-9A-Za-z]{2}$/);
|
|
|
84
84
|
// Provider key fragment — last 4 chars of the secret, display-only.
|
|
85
85
|
export const providerKeyFragmentSchema = z.string().min(1).max(4);
|
|
86
86
|
export const chatConnectionIdSchema = z.string().regex(/^cc_[0-9A-Za-z]{16}$/);
|
|
87
|
+
export const chatDeliveryIdSchema = z.string().regex(/^cd_[0-9A-Za-z]{16}$/);
|
|
@@ -7,11 +7,11 @@ export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsLis
|
|
|
7
7
|
export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.ts";
|
|
8
8
|
export type { PromptVariables, UsageSummary } from "./entities/chat.ts";
|
|
9
9
|
export { blazingAgentsChatMessageMetadataSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, generationRequestBodySchema, jsonSchemaShapeSchema, promptVariablesSchema, usageSummarySchema, } from "./entities/chat.ts";
|
|
10
|
-
export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.ts";
|
|
10
|
+
export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatDeliveriesResponseSchema, chatDeliveryListStatusSchema, chatDeliverySchema, chatDeliveryStatusSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, tenantChatDeliverySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.ts";
|
|
11
11
|
export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.ts";
|
|
12
12
|
export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.ts";
|
|
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.ts";
|
|
14
|
-
export { createPromptBodySchema, promptResponseSchema, promptSchema, promptsResponseSchema, updatePromptBodySchema, } from "./entities/prompts.ts";
|
|
14
|
+
export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptSchema, promptsResponseSchema, promptTemplateSchema, renderPromptTemplate, updatePromptBodySchema, } from "./entities/prompts.ts";
|
|
15
15
|
export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.ts";
|
|
16
16
|
export type { ToolApprovalDecisionResponse, ToolApprovalsResponse, } from "./entities/sessions.ts";
|
|
17
17
|
export { decideToolApprovalBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionResponseSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.ts";
|
package/dist/contracts/index.js
CHANGED
|
@@ -6,11 +6,11 @@ export { agentResponseSchema, agentSchema, agentStatusSchema, agentsResponseSche
|
|
|
6
6
|
export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.js";
|
|
7
7
|
export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.js";
|
|
8
8
|
export { blazingAgentsChatMessageMetadataSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, generationRequestBodySchema, jsonSchemaShapeSchema, promptVariablesSchema, usageSummarySchema, } from "./entities/chat.js";
|
|
9
|
-
export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.js";
|
|
9
|
+
export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatDeliveriesResponseSchema, chatDeliveryListStatusSchema, chatDeliverySchema, chatDeliveryStatusSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, tenantChatDeliverySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.js";
|
|
10
10
|
export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.js";
|
|
11
11
|
export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.js";
|
|
12
12
|
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";
|
|
13
|
-
export { createPromptBodySchema, promptResponseSchema, promptSchema, promptsResponseSchema, updatePromptBodySchema, } from "./entities/prompts.js";
|
|
13
|
+
export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptSchema, promptsResponseSchema, promptTemplateSchema, renderPromptTemplate, updatePromptBodySchema, } from "./entities/prompts.js";
|
|
14
14
|
export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.js";
|
|
15
15
|
export { decideToolApprovalBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionResponseSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.js";
|
|
16
16
|
export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.js";
|
|
@@ -7,14 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const MAX_API_KEYS_PER_TENANT = 5;
|
|
9
9
|
export declare const MAX_API_KEY_NAME_LENGTH = 80;
|
|
10
|
-
/**
|
|
11
|
-
* API key token shape — `ba_` + 40 base62 chars (~230 bits entropy).
|
|
12
|
-
* The prefix and body/fragment lengths live in `ids.ts` alongside the
|
|
13
|
-
* generators and schemas.
|
|
14
|
-
*/
|
|
10
|
+
/** API key token shape — `ba_` + 40 base62 chars (~230 bits entropy). */
|
|
15
11
|
export declare const API_KEY_BODY_LENGTH = 40;
|
|
16
12
|
export declare const API_KEY_FRAGMENT_BODY_LENGTH = 2;
|
|
17
|
-
/** Workspaces. */
|
|
18
13
|
export declare const MAX_WORKSPACE_NAME_LENGTH = 80;
|
|
19
14
|
export declare const MAX_WORKSPACE_ARCHIVE_ENTRIES = 16384;
|
|
20
15
|
export declare const DEFAULT_WORKSPACES_LIST_LIMIT = 50;
|
|
@@ -7,15 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export const MAX_API_KEYS_PER_TENANT = 5;
|
|
9
9
|
export const MAX_API_KEY_NAME_LENGTH = 80;
|
|
10
|
-
/**
|
|
11
|
-
* API key token shape — `ba_` + 40 base62 chars (~230 bits entropy).
|
|
12
|
-
* The prefix and body/fragment lengths live in `ids.ts` alongside the
|
|
13
|
-
* generators and schemas.
|
|
14
|
-
*/
|
|
10
|
+
/** API key token shape — `ba_` + 40 base62 chars (~230 bits entropy). */
|
|
15
11
|
export const API_KEY_BODY_LENGTH = 40;
|
|
16
12
|
// Display fragment — `ba_` + first 2 chars of the random body.
|
|
17
13
|
export const API_KEY_FRAGMENT_BODY_LENGTH = 2;
|
|
18
|
-
/** Workspaces. */
|
|
19
14
|
export const MAX_WORKSPACE_NAME_LENGTH = 80;
|
|
20
15
|
export const MAX_WORKSPACE_ARCHIVE_ENTRIES = 16_384;
|
|
21
16
|
export const DEFAULT_WORKSPACES_LIST_LIMIT = 50;
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { type ChatTransport, DefaultChatTransport, type UIMessage } from "ai";
|
|
2
2
|
import type { BlazingAgents } from "./client.ts";
|
|
3
|
-
export
|
|
3
|
+
export type BlazingAgentsDirectChatTransportOptions = {
|
|
4
4
|
agentId: string;
|
|
5
|
-
|
|
5
|
+
getClient: () => BlazingAgents | Promise<BlazingAgents>;
|
|
6
|
+
metadata?: Record<string, unknown>;
|
|
6
7
|
/** Receives the Session ID before the response stream is consumed. */
|
|
7
8
|
onSessionId?: (sessionId: string) => Promise<void> | void;
|
|
8
9
|
sessionId?: string;
|
|
9
|
-
|
|
10
|
+
userId?: string;
|
|
11
|
+
version?: number;
|
|
12
|
+
} & ({
|
|
13
|
+
promptId: string;
|
|
14
|
+
variables?: Record<string, string>;
|
|
15
|
+
} | {
|
|
16
|
+
promptId?: never;
|
|
17
|
+
variables?: never;
|
|
18
|
+
});
|
|
10
19
|
/** Connects useChat directly to the SDK, including native streaming fetch clients. */
|
|
11
20
|
export declare class BlazingAgentsDirectChatTransport<UI_MESSAGE extends UIMessage = UIMessage> extends DefaultChatTransport<UI_MESSAGE> {
|
|
12
21
|
#private;
|
|
13
22
|
constructor(options: BlazingAgentsDirectChatTransportOptions);
|
|
14
23
|
sendMessages(input: Parameters<ChatTransport<UI_MESSAGE>["sendMessages"]>[0]): Promise<ReadableStream<import("ai").UIMessageChunk<unknown, import("ai").UIDataTypes>>>;
|
|
15
|
-
reconnectToStream(_input: Parameters<ChatTransport<UI_MESSAGE>["reconnectToStream"]>[0]): Promise<null>;
|
|
24
|
+
reconnectToStream(_input: Parameters<ChatTransport<UI_MESSAGE>["reconnectToStream"]>[0]): Promise<ReadableStream<import("ai").UIMessageChunk<unknown, import("ai").UIDataTypes>> | null>;
|
|
16
25
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultChatTransport } from "ai";
|
|
1
|
+
import { DefaultChatTransport, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, } from "ai";
|
|
2
2
|
import { sessionIdSchema } from "./contracts/ids.js";
|
|
3
3
|
/** Connects useChat directly to the SDK, including native streaming fetch clients. */
|
|
4
4
|
export class BlazingAgentsDirectChatTransport extends DefaultChatTransport {
|
|
@@ -16,19 +16,55 @@ export class BlazingAgentsDirectChatTransport extends DefaultChatTransport {
|
|
|
16
16
|
if (input.trigger === "regenerate-message" && !this.#sessionId) {
|
|
17
17
|
throw new Error("Regeneration requires an existing Session.");
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
|
|
19
|
+
const last = input.messages.at(-1);
|
|
20
|
+
if (last?.role === "assistant" &&
|
|
21
|
+
lastAssistantMessageIsCompleteWithApprovalResponses({
|
|
22
|
+
messages: input.messages,
|
|
23
|
+
})) {
|
|
24
|
+
return await this.#sendApprovalContinuation(input, last);
|
|
22
25
|
}
|
|
23
|
-
const
|
|
26
|
+
const client = await this.#options.getClient();
|
|
27
|
+
const common = {
|
|
24
28
|
agentId: this.#options.agentId,
|
|
25
|
-
message,
|
|
26
29
|
messageId: input.messageId,
|
|
27
|
-
...(this.#sessionId === undefined
|
|
28
|
-
? { trigger: "submit-message" }
|
|
29
|
-
: { sessionId: this.#sessionId, trigger: input.trigger }),
|
|
30
30
|
abortSignal: input.abortSignal,
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
|
+
let result;
|
|
33
|
+
if (this.#sessionId === undefined) {
|
|
34
|
+
const create = {
|
|
35
|
+
...common,
|
|
36
|
+
trigger: "submit-message",
|
|
37
|
+
version: this.#options.version,
|
|
38
|
+
userId: this.#options.userId,
|
|
39
|
+
metadata: this.#options.metadata,
|
|
40
|
+
};
|
|
41
|
+
if (this.#options.promptId === undefined) {
|
|
42
|
+
const message = input.messages.findLast((item) => item.role === "user");
|
|
43
|
+
if (!message) {
|
|
44
|
+
throw new Error("Chat submission requires a user message.");
|
|
45
|
+
}
|
|
46
|
+
result = await client.chat({ ...create, message });
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
result = await client.chat({
|
|
50
|
+
...create,
|
|
51
|
+
promptId: this.#options.promptId,
|
|
52
|
+
variables: this.#options.variables,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const message = input.messages.findLast((item) => item.role === "user");
|
|
58
|
+
if (!message) {
|
|
59
|
+
throw new Error("Chat submission requires a user message.");
|
|
60
|
+
}
|
|
61
|
+
result = await client.chat({
|
|
62
|
+
...common,
|
|
63
|
+
message,
|
|
64
|
+
sessionId: this.#sessionId,
|
|
65
|
+
trigger: input.trigger,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
32
68
|
const stream = result.toStream();
|
|
33
69
|
try {
|
|
34
70
|
const sessionId = await result.sessionId;
|
|
@@ -43,7 +79,52 @@ export class BlazingAgentsDirectChatTransport extends DefaultChatTransport {
|
|
|
43
79
|
}
|
|
44
80
|
return this.processResponseStream(stream);
|
|
45
81
|
}
|
|
46
|
-
reconnectToStream(_input) {
|
|
47
|
-
|
|
82
|
+
async reconnectToStream(_input) {
|
|
83
|
+
if (this.#sessionId === undefined) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const { continuation } = await (await this.#options.getClient()).sessions.toolApprovals({
|
|
87
|
+
agentId: this.#options.agentId,
|
|
88
|
+
sessionId: this.#sessionId,
|
|
89
|
+
});
|
|
90
|
+
if (continuation?.state !== "queued" && continuation?.state !== "running") {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const result = await (await this.#options.getClient()).sessions.joinToolApprovalContinuation({
|
|
94
|
+
agentId: this.#options.agentId,
|
|
95
|
+
sessionId: this.#sessionId,
|
|
96
|
+
continuationId: continuation.id,
|
|
97
|
+
});
|
|
98
|
+
return this.processResponseStream(result.toStream());
|
|
99
|
+
}
|
|
100
|
+
async #sendApprovalContinuation(input, last) {
|
|
101
|
+
if (this.#sessionId === undefined) {
|
|
102
|
+
throw new Error("Tool approval requires an existing Session.");
|
|
103
|
+
}
|
|
104
|
+
const lastStep = last.parts.findLastIndex((part) => part.type === "step-start");
|
|
105
|
+
let continuationId;
|
|
106
|
+
for (const part of last.parts.slice(lastStep + 1)) {
|
|
107
|
+
if (isToolUIPart(part) && part.state === "approval-responded") {
|
|
108
|
+
const decision = await (await this.#options.getClient()).sessions.decideToolApproval({
|
|
109
|
+
agentId: this.#options.agentId,
|
|
110
|
+
sessionId: this.#sessionId,
|
|
111
|
+
approvalId: part.approval.id,
|
|
112
|
+
approved: part.approval.approved,
|
|
113
|
+
reason: part.approval.reason,
|
|
114
|
+
abortSignal: input.abortSignal,
|
|
115
|
+
});
|
|
116
|
+
continuationId = decision.continuationId;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (continuationId === undefined) {
|
|
120
|
+
throw new Error("Tool approval response is missing an approval.");
|
|
121
|
+
}
|
|
122
|
+
const continuation = await (await this.#options.getClient()).sessions.joinToolApprovalContinuation({
|
|
123
|
+
agentId: this.#options.agentId,
|
|
124
|
+
sessionId: this.#sessionId,
|
|
125
|
+
continuationId,
|
|
126
|
+
abortSignal: input.abortSignal,
|
|
127
|
+
});
|
|
128
|
+
return this.processResponseStream(continuation.toStream());
|
|
48
129
|
}
|
|
49
130
|
}
|
package/dist/generation.js
CHANGED
|
@@ -2,7 +2,6 @@ import { createTextStreamResponse, parsePartialJson } from "ai";
|
|
|
2
2
|
import { sessionIdSchema } from "./contracts/ids.js";
|
|
3
3
|
import { BlazingAgentsError } from "./errors.js";
|
|
4
4
|
import { requestStream } from "./http.js";
|
|
5
|
-
// --- chat ---
|
|
6
5
|
export async function chat(config, input) {
|
|
7
6
|
const body = buildChatBody(input);
|
|
8
7
|
/**
|
|
@@ -259,7 +258,6 @@ function buildStatelessGenerationBody(input, output) {
|
|
|
259
258
|
}
|
|
260
259
|
return body;
|
|
261
260
|
}
|
|
262
|
-
// --- completion ---
|
|
263
261
|
export async function completion(config, input) {
|
|
264
262
|
const body = buildStatelessGenerationBody(input, { type: "text" });
|
|
265
263
|
const path = `/v1/agents/${input.agentId}/generation`;
|
|
@@ -280,11 +278,6 @@ function buildCompletionResult(response) {
|
|
|
280
278
|
}
|
|
281
279
|
return text;
|
|
282
280
|
})();
|
|
283
|
-
/**
|
|
284
|
-
* Attach a no-op rejection handler so the promise doesn't trigger an
|
|
285
|
-
* unhandled-rejection warning if the caller only uses `textStream` or
|
|
286
|
-
* `toResponse()` without awaiting `text`.
|
|
287
|
-
*/
|
|
288
281
|
textPromise.catch(() => {
|
|
289
282
|
/* no-op — prevents unhandled rejection if the caller never awaits */
|
|
290
283
|
});
|
|
@@ -295,7 +288,6 @@ function buildCompletionResult(response) {
|
|
|
295
288
|
toResponse,
|
|
296
289
|
};
|
|
297
290
|
}
|
|
298
|
-
// --- object ---
|
|
299
291
|
export async function objectGeneration(config, input) {
|
|
300
292
|
const body = buildStatelessGenerationBody(input, {
|
|
301
293
|
type: "object",
|
|
@@ -360,7 +352,6 @@ function buildObjectResult(response) {
|
|
|
360
352
|
toResponse,
|
|
361
353
|
};
|
|
362
354
|
}
|
|
363
|
-
// --- helpers ---
|
|
364
355
|
function buildStatelessGenerationStreams(response, resourceName) {
|
|
365
356
|
const requestId = response.headers.get("x-request-id") ?? undefined;
|
|
366
357
|
const location = response.headers.get("location");
|
package/dist/http.js
CHANGED
|
@@ -4,12 +4,6 @@ const DIAGNOSTIC_BODY_LIMIT_BYTES = 64 * 1024;
|
|
|
4
4
|
const INVALID_RESPONSE_MESSAGE = "The server returned an invalid response.";
|
|
5
5
|
const NETWORK_ERROR_MESSAGE = "Network request failed (fetch threw before any HTTP exchange).";
|
|
6
6
|
const REQUEST_ABORTED_MESSAGE = "The request was aborted before any HTTP response.";
|
|
7
|
-
/**
|
|
8
|
-
* The fetch client — a thin wrapper in the stripe/openai-node shape.
|
|
9
|
-
* `apiKey` rides the `Authorization: Bearer ${apiKey}` header; `baseUrl`
|
|
10
|
-
* defaults to `DEFAULT_BASE_URL` in `client.ts`
|
|
11
|
-
* (`https://api.blazingagents.com`). No OpenAI wire compatibility.
|
|
12
|
-
*/
|
|
13
7
|
function buildUrl(baseUrl, path, query) {
|
|
14
8
|
const url = `${baseUrl}${path}`;
|
|
15
9
|
if (!query) {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
* `@blazingagents/sdk` — the resource-style client SDK for the
|
|
3
3
|
* Blazing Agents `/v1` API. `ai` is a peer dependency (`^7`);
|
|
4
4
|
* `UIMessage` is re-exported from `ai`, never redeclared.
|
|
5
|
-
*
|
|
6
|
-
* This is the package's entry point — a barrel file that re-exports the
|
|
7
|
-
* public surface from the internal modules.
|
|
8
5
|
*/
|
|
9
6
|
export type { UIMessage } from "ai";
|
|
10
7
|
export { BlazingAgentsChatTransport, type BlazingAgentsChatTransportOptions, } from "./chat-transport.ts";
|
|
@@ -12,7 +9,7 @@ export { BlazingAgents } from "./client.ts";
|
|
|
12
9
|
export type { ApprovalDecision, ApprovalPolicy, ToolReference, } from "./contracts/entities/agent-approval.ts";
|
|
13
10
|
export type { Agent, AgentResponse, AgentsResponse, AgentVersion, AgentVersionsListQuery, AgentVersionsResponse, CreateAgentBody, UpdateAgentBody, } from "./contracts/entities/agents.ts";
|
|
14
11
|
export type { ArtifactDownloadUrlResponse, ArtifactListItem, ArtifactsListResponse, } from "./contracts/entities/artifacts.ts";
|
|
15
|
-
export type { ChatConfiguration, ChatConnection, ChatConnectionsResponse, ChatCredentials, ChatHealth, ChatIdentity, CreateChatConnectionBody, RotateChatConnectionBody, UpdateChatConnectionBody, } from "./contracts/entities/chat-connections.ts";
|
|
12
|
+
export type { ChatConfiguration, ChatConnection, ChatConnectionsResponse, ChatCredentials, ChatDeliveriesResponse, ChatDelivery, ChatDeliveryListStatus, ChatDeliveryStatus, ChatHealth, ChatIdentity, CreateChatConnectionBody, RotateChatConnectionBody, TenantChatDelivery, UpdateChatConnectionBody, } from "./contracts/entities/chat-connections.ts";
|
|
16
13
|
export type { CreateMcpConnectionBody, McpAttachmentResponse, McpAttachmentsResponse, McpConnectionAuthType, McpConnectionOauthConnectResponse, McpConnectionReconnectResult, McpConnectionResponse, McpConnectionStatus, McpConnectionTestResponse, ReconnectMcpConnectionBody, UpdateMcpAttachmentBody, UpdateMcpConnectionBody, } from "./contracts/entities/mcp-connections.ts";
|
|
17
14
|
export type { CreateMerchantConnectionBody, MerchantBindingResponse, MerchantBindingsResponse, MerchantConnection, MerchantConnectionResponse, MerchantCustomerBinding, MerchantGuard, MerchantProviderKind, MerchantUsageEvent, MerchantUsageEventResponse, MerchantUsageEventStatus, MerchantUsageEventsResponse, MerchantUsageSummary, MerchantUsageSummaryResponse, UpdateMerchantConnectionBody, UpsertMerchantBindingBody, } from "./contracts/entities/merchant.ts";
|
|
18
15
|
export type { CreateProviderBody, ProviderListItem, ProviderModel, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ProviderType, ThinkingLevelsResponse, UpdateProviderBody, } from "./contracts/entities/providers.ts";
|
|
@@ -23,4 +20,4 @@ export type { CreateWorkspaceBody, UpdateWorkspaceBody, Workspace, WorkspaceNetw
|
|
|
23
20
|
export { BlazingAgentsDirectChatTransport, type BlazingAgentsDirectChatTransportOptions, } from "./direct-chat-transport.ts";
|
|
24
21
|
export { BlazingAgentsError } from "./errors.ts";
|
|
25
22
|
export { createChatRelay, createCompletionRelay, type RelayContext, type SessionOwnershipStore, } from "./relay.ts";
|
|
26
|
-
export type { AgentClient, AgentSkillsResource, AgentsListOptions, AgentsResource, AgentVersionsListOptions, ArtifactsResource, AttributionInput, BlazingAgentsErrorCode, BlazingAgentsOptions, BlazingAgentsRequestOptions, BlazingAgentsUIMessage, BlazingAgentsUIMessageChunk, ChatConnectionsResource, 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, SessionsResource, SkillsListOptions, TasksResource, TenantResource, TerminalStreamResult, UsageResource, WorkspacesListOptions, WorkspacesResource, } from "./types.ts";
|
|
23
|
+
export type { AgentClient, AgentSkillsResource, AgentsListOptions, AgentsResource, AgentVersionsListOptions, 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, SessionsResource, SkillsListOptions, TasksResource, TenantResource, TerminalStreamResult, UsageResource, WorkspacesListOptions, WorkspacesResource, } from "./types.ts";
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
* `@blazingagents/sdk` — the resource-style client SDK for the
|
|
3
3
|
* Blazing Agents `/v1` API. `ai` is a peer dependency (`^7`);
|
|
4
4
|
* `UIMessage` is re-exported from `ai`, never redeclared.
|
|
5
|
-
*
|
|
6
|
-
* This is the package's entry point — a barrel file that re-exports the
|
|
7
|
-
* public surface from the internal modules.
|
|
8
5
|
*/
|
|
9
6
|
// biome-ignore lint/performance/noBarrelFile: package entry point
|
|
10
7
|
export { BlazingAgentsChatTransport, } from "./chat-transport.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ChatDeliveriesResource, HttpConfig } from "../types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* `client.chatDeliveries` — `GET /v1/chat-deliveries`, the Tenant-wide
|
|
4
|
+
* delivery feed across all Chat Connections, newest first.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createChatDeliveriesResource(config: HttpConfig): ChatDeliveriesResource;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { chatDeliveriesResponseSchema } from "../contracts/entities/chat-connections.js";
|
|
2
|
+
import { requestJson } from "../http.js";
|
|
3
|
+
/**
|
|
4
|
+
* `client.chatDeliveries` — `GET /v1/chat-deliveries`, the Tenant-wide
|
|
5
|
+
* delivery feed across all Chat Connections, newest first.
|
|
6
|
+
*/
|
|
7
|
+
export function createChatDeliveriesResource(config) {
|
|
8
|
+
return {
|
|
9
|
+
async list({ abortSignal, status, ...query } = {}) {
|
|
10
|
+
return await requestJson(config, "/v1/chat-deliveries", {
|
|
11
|
+
query: {
|
|
12
|
+
...query,
|
|
13
|
+
// Multi-value filters serialize as one comma-separated parameter.
|
|
14
|
+
status: status?.length ? status.join(",") : undefined,
|
|
15
|
+
},
|
|
16
|
+
signal: abortSignal,
|
|
17
|
+
}, chatDeliveriesResponseSchema);
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ApiErrorCode } from "./contracts/api.ts";
|
|
|
3
3
|
import type { Agent, AgentsResponse, AgentVersion, AgentVersionsResponse, 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
|
-
import type { ChatConnection, ChatConnectionsResponse, CreateChatConnectionBody, RotateChatConnectionBody, UpdateChatConnectionBody } from "./contracts/entities/chat-connections.ts";
|
|
6
|
+
import type { ChatConnection, ChatConnectionsResponse, ChatDeliveriesResponse, ChatDeliveryListStatus, CreateChatConnectionBody, RotateChatConnectionBody, UpdateChatConnectionBody } from "./contracts/entities/chat-connections.ts";
|
|
7
7
|
import type { CreateMcpConnectionBody, McpAttachmentResponse, McpAttachmentsResponse, McpConnectionOauthConnectResponse, McpConnectionReconnectResult, McpConnectionResponse, McpConnectionsResponse, McpConnectionTestResponse, ReconnectMcpConnectionBody, UpdateMcpAttachmentBody, UpdateMcpConnectionBody } from "./contracts/entities/mcp-connections.ts";
|
|
8
8
|
import type { CreateMemoryBody, MemoriesListResponse, MemoryResponse, UpdateMemoryBody } from "./contracts/entities/memories.ts";
|
|
9
9
|
import type { CreateMerchantConnectionBody, MerchantBindingResponse, MerchantBindingsResponse, MerchantConnectionResponse, MerchantUsageEventResponse, MerchantUsageEventStatus, MerchantUsageEventsResponse, MerchantUsageSummaryResponse, UpdateMerchantConnectionBody, UpsertMerchantBindingBody } from "./contracts/entities/merchant.ts";
|
|
@@ -19,11 +19,7 @@ export type KnownBlazingAgentsErrorCode = ApiErrorCode | "invalid_response" | "n
|
|
|
19
19
|
export type BlazingAgentsErrorCode = KnownBlazingAgentsErrorCode | (string & {});
|
|
20
20
|
export type BlazingAgentsFetch = (input: string, init?: BlazingAgentsRequestInit) => Promise<Response>;
|
|
21
21
|
export interface BlazingAgentsRequestInit extends RequestInit {
|
|
22
|
-
/**
|
|
23
|
-
* The SDK never sends multipart bodies via the global `FormData`; the
|
|
24
|
-
* skill upload path passes a `FormData` instance directly. This slot
|
|
25
|
-
* exists only so the type carries the union cleanly.
|
|
26
|
-
*/
|
|
22
|
+
/** Widened so multipart uploads can pass a `FormData` body. */
|
|
27
23
|
body?: BodyInit | FormData | null;
|
|
28
24
|
}
|
|
29
25
|
export interface RequestOptions {
|
|
@@ -34,11 +30,6 @@ export interface RequestOptions {
|
|
|
34
30
|
* automatically by `fetch` when given a `FormData` body).
|
|
35
31
|
*/
|
|
36
32
|
headers?: Record<string, string>;
|
|
37
|
-
/**
|
|
38
|
-
* JSON body (object — serialized by the helper) or `undefined` for
|
|
39
|
-
* GET/DELETE. Multipart uploads bypass this and pass `FormData` via
|
|
40
|
-
* `extra.body`.
|
|
41
|
-
*/
|
|
42
33
|
json?: unknown;
|
|
43
34
|
method?: string;
|
|
44
35
|
/**
|
|
@@ -600,4 +591,19 @@ export interface ChatConnectionsResource {
|
|
|
600
591
|
chatConnectionId: string;
|
|
601
592
|
} & ResourceRequestOptions): Promise<ChatConnection>;
|
|
602
593
|
}
|
|
594
|
+
export interface ChatDeliveriesListOptions extends ResourceRequestOptions {
|
|
595
|
+
cursor?: string;
|
|
596
|
+
limit?: number;
|
|
597
|
+
/** ISO 8601 date-time; inclusive lower bound on `createdAt`. */
|
|
598
|
+
since?: string;
|
|
599
|
+
/** `failed` and/or `ambiguous`; omitted means both. */
|
|
600
|
+
status?: readonly ChatDeliveryListStatus[];
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* `client.chatDeliveries` — the Tenant's deliveries across all Chat
|
|
604
|
+
* Connections behind `GET /v1/chat-deliveries`, newest first.
|
|
605
|
+
*/
|
|
606
|
+
export interface ChatDeliveriesResource {
|
|
607
|
+
list(input?: ChatDeliveriesListOptions): Promise<ChatDeliveriesResponse>;
|
|
608
|
+
}
|
|
603
609
|
export {};
|