@blazingagents/sdk 0.40.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +0 -2
- package/dist/client.js +0 -3
- package/dist/contracts/api.d.ts +9 -3
- package/dist/contracts/api.js +9 -3
- package/dist/contracts/entities/chat-connections.d.ts +0 -153
- package/dist/contracts/entities/chat-connections.js +1 -63
- package/dist/contracts/entities/mcp-connections.d.ts +0 -3
- package/dist/contracts/entities/mcp-connections.js +0 -3
- package/dist/contracts/entities/merchant.d.ts +0 -34
- package/dist/contracts/entities/merchant.js +0 -16
- package/dist/contracts/entities/session-inputs.d.ts +4 -12
- package/dist/contracts/entities/session-inputs.js +0 -2
- package/dist/contracts/entities/sessions.d.ts +1 -1
- package/dist/contracts/entities/spending-limits.d.ts +0 -5
- package/dist/contracts/entities/spending-limits.js +1 -3
- package/dist/contracts/entities/tasks.d.ts +12 -186
- package/dist/contracts/entities/tasks.js +2 -2
- package/dist/contracts/ids.d.ts +0 -1
- package/dist/contracts/ids.js +0 -1
- package/dist/contracts/index.d.ts +4 -4
- package/dist/contracts/index.js +4 -4
- package/dist/index.d.ts +1 -2
- package/dist/resources/agents.d.ts +1 -1
- package/dist/resources/chat-connections.d.ts +1 -30
- package/dist/resources/chat-connections.js +1 -12
- package/dist/resources/merchant-usage-events.d.ts +3 -12
- package/dist/resources/merchant-usage-events.js +1 -4
- package/dist/resources/sessions.d.ts +2 -2
- package/dist/resources/workspaces.d.ts +1 -2
- package/dist/resources/workspaces.js +5 -3
- package/package.json +1 -1
- package/dist/resources/chat-deliveries.d.ts +0 -30
- package/dist/resources/chat-deliveries.js +0 -23
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type AgentsResource } from "./resources/agents.ts";
|
|
2
2
|
import { type ArtifactsResource } from "./resources/artifacts.ts";
|
|
3
3
|
import { type ChatConnectionsResource } from "./resources/chat-connections.ts";
|
|
4
|
-
import { type ChatDeliveriesResource } from "./resources/chat-deliveries.ts";
|
|
5
4
|
import { type McpConnectionsResource } from "./resources/mcp-connections.ts";
|
|
6
5
|
import { type MemoriesResource } from "./resources/memories.ts";
|
|
7
6
|
import { type MerchantBindingsResource } from "./resources/merchant-bindings.ts";
|
|
@@ -18,7 +17,6 @@ import type { AgentClient, BlazingAgentsOptions, BlazingAgentsRequestOptions, Ch
|
|
|
18
17
|
export declare class BlazingAgents {
|
|
19
18
|
#private;
|
|
20
19
|
readonly chatConnections: ChatConnectionsResource;
|
|
21
|
-
readonly chatDeliveries: ChatDeliveriesResource;
|
|
22
20
|
readonly agents: AgentsResource;
|
|
23
21
|
readonly sessions: SessionsResource;
|
|
24
22
|
readonly providers: ProvidersResource;
|
package/dist/client.js
CHANGED
|
@@ -4,7 +4,6 @@ import { chat, completion, continueChat, objectGeneration, } from "./generation.
|
|
|
4
4
|
import { createAgentsResource, createUserAgentsResource, } from "./resources/agents.js";
|
|
5
5
|
import { createArtifactsResource, } from "./resources/artifacts.js";
|
|
6
6
|
import { createChatConnectionsResource, } from "./resources/chat-connections.js";
|
|
7
|
-
import { createChatDeliveriesResource, } from "./resources/chat-deliveries.js";
|
|
8
7
|
import { createMcpConnectionsResource, } from "./resources/mcp-connections.js";
|
|
9
8
|
import { createMemoriesResource, } from "./resources/memories.js";
|
|
10
9
|
import { createMerchantBindingsResource, } from "./resources/merchant-bindings.js";
|
|
@@ -61,7 +60,6 @@ function createUserClient(config) {
|
|
|
61
60
|
export class BlazingAgents {
|
|
62
61
|
#config;
|
|
63
62
|
chatConnections;
|
|
64
|
-
chatDeliveries;
|
|
65
63
|
agents;
|
|
66
64
|
sessions;
|
|
67
65
|
providers;
|
|
@@ -91,7 +89,6 @@ export class BlazingAgents {
|
|
|
91
89
|
onResponse: options.onResponse,
|
|
92
90
|
};
|
|
93
91
|
this.chatConnections = createChatConnectionsResource(this.#config);
|
|
94
|
-
this.chatDeliveries = createChatDeliveriesResource(this.#config);
|
|
95
92
|
this.agents = createAgentsResource(this.#config);
|
|
96
93
|
this.sessions = createSessionsResource(this.#config);
|
|
97
94
|
this.providers = createProvidersResource(this.#config);
|
package/dist/contracts/api.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import type { BlazingAgentsErrorCode } from "../types.ts";
|
|
2
3
|
/**
|
|
3
4
|
* `/v1` error envelope — see docs/adr/0003-ai-sdk-native-wire-protocol.md.
|
|
4
5
|
* Closed producer code set; `code` is what SDKs switch on and `message` is
|
|
@@ -7,6 +8,7 @@ import { z } from "zod";
|
|
|
7
8
|
*/
|
|
8
9
|
export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
9
10
|
admin_agent_managed: "admin_agent_managed";
|
|
11
|
+
agent_busy: "agent_busy";
|
|
10
12
|
agent_disabled: "agent_disabled";
|
|
11
13
|
agent_mcp_connection_not_found: "agent_mcp_connection_not_found";
|
|
12
14
|
agent_mcp_connections_invalid: "agent_mcp_connections_invalid";
|
|
@@ -14,7 +16,6 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
|
14
16
|
artifact_session_cap_reached: "artifact_session_cap_reached";
|
|
15
17
|
chat_webhook_conflict: "chat_webhook_conflict";
|
|
16
18
|
chat_webhook_registration_failed: "chat_webhook_registration_failed";
|
|
17
|
-
checkout_evidence_mismatch: "checkout_evidence_mismatch";
|
|
18
19
|
forbidden: "forbidden";
|
|
19
20
|
function_call_conflict: "function_call_conflict";
|
|
20
21
|
idempotency_conflict: "idempotency_conflict";
|
|
@@ -34,7 +35,6 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
|
34
35
|
merchant_account_mismatch: "merchant_account_mismatch";
|
|
35
36
|
merchant_balance_required: "merchant_balance_required";
|
|
36
37
|
merchant_binding_not_found: "merchant_binding_not_found";
|
|
37
|
-
merchant_binding_required: "merchant_binding_required";
|
|
38
38
|
merchant_connection_in_use: "merchant_connection_in_use";
|
|
39
39
|
merchant_connection_not_found: "merchant_connection_not_found";
|
|
40
40
|
merchant_credential_invalid: "merchant_credential_invalid";
|
|
@@ -93,9 +93,15 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
|
93
93
|
workspace_in_use: "workspace_in_use";
|
|
94
94
|
workspace_not_found: "workspace_not_found";
|
|
95
95
|
}>;
|
|
96
|
+
/**
|
|
97
|
+
* A code as received: any non-empty string, so a server newer than this SDK
|
|
98
|
+
* can send a code the SDK does not list. The type keeps autocomplete for the
|
|
99
|
+
* listed codes.
|
|
100
|
+
*/
|
|
101
|
+
export declare const receivedApiErrorCodeSchema: z.ZodType<BlazingAgentsErrorCode>;
|
|
96
102
|
export declare const receivedApiErrorResponseSchema: z.ZodObject<{
|
|
97
103
|
error: z.ZodObject<{
|
|
98
|
-
code: z.
|
|
104
|
+
code: z.ZodType<BlazingAgentsErrorCode, unknown, z.core.$ZodTypeInternals<BlazingAgentsErrorCode, unknown>>;
|
|
99
105
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
100
106
|
message: z.ZodString;
|
|
101
107
|
param: z.ZodOptional<z.ZodString>;
|
package/dist/contracts/api.js
CHANGED
|
@@ -24,10 +24,10 @@ export const apiErrorCodeSchema = z.enum([
|
|
|
24
24
|
"rate_limited",
|
|
25
25
|
"internal",
|
|
26
26
|
"service_unavailable",
|
|
27
|
-
"checkout_evidence_mismatch",
|
|
28
27
|
"subscription_already_paid",
|
|
29
28
|
"subscription_not_cancelled",
|
|
30
29
|
"agent_disabled",
|
|
30
|
+
"agent_busy",
|
|
31
31
|
"admin_agent_managed",
|
|
32
32
|
"agent_mcp_connection_not_found",
|
|
33
33
|
"agent_mcp_connections_invalid",
|
|
@@ -80,7 +80,6 @@ export const apiErrorCodeSchema = z.enum([
|
|
|
80
80
|
"merchant_provider_unavailable",
|
|
81
81
|
"merchant_customer_not_found",
|
|
82
82
|
"merchant_binding_not_found",
|
|
83
|
-
"merchant_binding_required",
|
|
84
83
|
"merchant_account_mismatch",
|
|
85
84
|
"merchant_event_not_found",
|
|
86
85
|
"merchant_event_state_conflict",
|
|
@@ -93,7 +92,14 @@ export const apiErrorCodeSchema = z.enum([
|
|
|
93
92
|
"tenant_deletion_not_ready",
|
|
94
93
|
"tenant_not_deleting",
|
|
95
94
|
]);
|
|
96
|
-
|
|
95
|
+
/**
|
|
96
|
+
* A code as received: any non-empty string, so a server newer than this SDK
|
|
97
|
+
* can send a code the SDK does not list. The type keeps autocomplete for the
|
|
98
|
+
* listed codes.
|
|
99
|
+
*/
|
|
100
|
+
export const receivedApiErrorCodeSchema = z
|
|
101
|
+
.string()
|
|
102
|
+
.min(1);
|
|
97
103
|
const receivedApiErrorSchema = z
|
|
98
104
|
.object({
|
|
99
105
|
code: receivedApiErrorCodeSchema,
|
|
@@ -185,156 +185,3 @@ export declare const chatConnectionsResponseSchema: z.ZodObject<{
|
|
|
185
185
|
}, z.core.$strip>;
|
|
186
186
|
export type ChatConnectionsResponse = z.output<typeof chatConnectionsResponseSchema>;
|
|
187
187
|
export type RotateChatConnectionBody = z.input<typeof rotateChatConnectionBodySchema>;
|
|
188
|
-
export declare const chatDeliveryStatusSchema: z.ZodEnum<{
|
|
189
|
-
ambiguous: "ambiguous";
|
|
190
|
-
confirmed: "confirmed";
|
|
191
|
-
failed: "failed";
|
|
192
|
-
pending: "pending";
|
|
193
|
-
}>;
|
|
194
|
-
export type ChatDeliveryStatus = z.infer<typeof chatDeliveryStatusSchema>;
|
|
195
|
-
export declare const chatDeliveryListStatusSchema: z.ZodEnum<{
|
|
196
|
-
ambiguous: "ambiguous";
|
|
197
|
-
failed: "failed";
|
|
198
|
-
}>;
|
|
199
|
-
export type ChatDeliveryListStatus = z.infer<typeof chatDeliveryListStatusSchema>;
|
|
200
|
-
export declare const chatDeliverySchema: z.ZodObject<{
|
|
201
|
-
id: z.ZodString;
|
|
202
|
-
kind: z.ZodEnum<{
|
|
203
|
-
card: "card";
|
|
204
|
-
reply: "reply";
|
|
205
|
-
}>;
|
|
206
|
-
status: z.ZodEnum<{
|
|
207
|
-
ambiguous: "ambiguous";
|
|
208
|
-
confirmed: "confirmed";
|
|
209
|
-
failed: "failed";
|
|
210
|
-
pending: "pending";
|
|
211
|
-
}>;
|
|
212
|
-
attempt: z.ZodNumber;
|
|
213
|
-
credentialVersion: z.ZodNumber;
|
|
214
|
-
representation: z.ZodString;
|
|
215
|
-
diagnostic: z.ZodNullable<z.ZodString>;
|
|
216
|
-
receipts: z.ZodUnknown;
|
|
217
|
-
sessionId: z.ZodString;
|
|
218
|
-
messageId: z.ZodNullable<z.ZodString>;
|
|
219
|
-
approvalId: z.ZodNullable<z.ZodString>;
|
|
220
|
-
threadId: z.ZodString;
|
|
221
|
-
createdAt: z.ZodString;
|
|
222
|
-
updatedAt: z.ZodString;
|
|
223
|
-
}, z.core.$strip>;
|
|
224
|
-
export type ChatDelivery = z.infer<typeof chatDeliverySchema>;
|
|
225
|
-
export declare const tenantChatDeliverySchema: z.ZodObject<{
|
|
226
|
-
id: z.ZodString;
|
|
227
|
-
kind: z.ZodEnum<{
|
|
228
|
-
card: "card";
|
|
229
|
-
reply: "reply";
|
|
230
|
-
}>;
|
|
231
|
-
status: z.ZodEnum<{
|
|
232
|
-
ambiguous: "ambiguous";
|
|
233
|
-
confirmed: "confirmed";
|
|
234
|
-
failed: "failed";
|
|
235
|
-
pending: "pending";
|
|
236
|
-
}>;
|
|
237
|
-
attempt: z.ZodNumber;
|
|
238
|
-
credentialVersion: z.ZodNumber;
|
|
239
|
-
representation: z.ZodString;
|
|
240
|
-
diagnostic: z.ZodNullable<z.ZodString>;
|
|
241
|
-
receipts: z.ZodUnknown;
|
|
242
|
-
sessionId: z.ZodString;
|
|
243
|
-
messageId: z.ZodNullable<z.ZodString>;
|
|
244
|
-
approvalId: z.ZodNullable<z.ZodString>;
|
|
245
|
-
threadId: z.ZodString;
|
|
246
|
-
createdAt: z.ZodString;
|
|
247
|
-
updatedAt: z.ZodString;
|
|
248
|
-
connectionId: z.ZodString;
|
|
249
|
-
agentId: z.ZodString;
|
|
250
|
-
platform: z.ZodEnum<{
|
|
251
|
-
slack: "slack";
|
|
252
|
-
telegram: "telegram";
|
|
253
|
-
}>;
|
|
254
|
-
}, z.core.$strict>;
|
|
255
|
-
export type TenantChatDelivery = z.infer<typeof tenantChatDeliverySchema>;
|
|
256
|
-
export declare const chatDeliveriesResponseSchema: z.ZodObject<{
|
|
257
|
-
data: z.ZodArray<z.ZodObject<{
|
|
258
|
-
id: z.ZodString;
|
|
259
|
-
kind: z.ZodEnum<{
|
|
260
|
-
card: "card";
|
|
261
|
-
reply: "reply";
|
|
262
|
-
}>;
|
|
263
|
-
status: z.ZodEnum<{
|
|
264
|
-
ambiguous: "ambiguous";
|
|
265
|
-
confirmed: "confirmed";
|
|
266
|
-
failed: "failed";
|
|
267
|
-
pending: "pending";
|
|
268
|
-
}>;
|
|
269
|
-
attempt: z.ZodNumber;
|
|
270
|
-
credentialVersion: z.ZodNumber;
|
|
271
|
-
representation: z.ZodString;
|
|
272
|
-
diagnostic: z.ZodNullable<z.ZodString>;
|
|
273
|
-
receipts: z.ZodUnknown;
|
|
274
|
-
sessionId: z.ZodString;
|
|
275
|
-
messageId: z.ZodNullable<z.ZodString>;
|
|
276
|
-
approvalId: z.ZodNullable<z.ZodString>;
|
|
277
|
-
threadId: z.ZodString;
|
|
278
|
-
createdAt: z.ZodString;
|
|
279
|
-
updatedAt: z.ZodString;
|
|
280
|
-
connectionId: z.ZodString;
|
|
281
|
-
agentId: z.ZodString;
|
|
282
|
-
platform: z.ZodEnum<{
|
|
283
|
-
slack: "slack";
|
|
284
|
-
telegram: "telegram";
|
|
285
|
-
}>;
|
|
286
|
-
}, z.core.$strict>>;
|
|
287
|
-
nextCursor: z.ZodNullable<z.ZodString>;
|
|
288
|
-
}, z.core.$strip>;
|
|
289
|
-
export type ChatDeliveriesResponse = z.infer<typeof chatDeliveriesResponseSchema>;
|
|
290
|
-
export declare const chatDeliveryListSchema: z.ZodObject<{
|
|
291
|
-
data: z.ZodArray<z.ZodObject<{
|
|
292
|
-
id: z.ZodString;
|
|
293
|
-
kind: z.ZodEnum<{
|
|
294
|
-
card: "card";
|
|
295
|
-
reply: "reply";
|
|
296
|
-
}>;
|
|
297
|
-
status: z.ZodEnum<{
|
|
298
|
-
ambiguous: "ambiguous";
|
|
299
|
-
confirmed: "confirmed";
|
|
300
|
-
failed: "failed";
|
|
301
|
-
pending: "pending";
|
|
302
|
-
}>;
|
|
303
|
-
attempt: z.ZodNumber;
|
|
304
|
-
credentialVersion: z.ZodNumber;
|
|
305
|
-
representation: z.ZodString;
|
|
306
|
-
diagnostic: z.ZodNullable<z.ZodString>;
|
|
307
|
-
receipts: z.ZodUnknown;
|
|
308
|
-
sessionId: z.ZodString;
|
|
309
|
-
messageId: z.ZodNullable<z.ZodString>;
|
|
310
|
-
approvalId: z.ZodNullable<z.ZodString>;
|
|
311
|
-
threadId: z.ZodString;
|
|
312
|
-
createdAt: z.ZodString;
|
|
313
|
-
updatedAt: z.ZodString;
|
|
314
|
-
}, z.core.$strip>>;
|
|
315
|
-
nextCursor: z.ZodNullable<z.ZodString>;
|
|
316
|
-
}, z.core.$strip>;
|
|
317
|
-
export type ChatDeliveryList = z.infer<typeof chatDeliveryListSchema>;
|
|
318
|
-
export declare const repairChatDeliveryBodySchema: z.ZodObject<{
|
|
319
|
-
expectedAttempt: z.ZodNumber;
|
|
320
|
-
previousSenderStopped: z.ZodLiteral<true>;
|
|
321
|
-
acceptDuplicateRisk: z.ZodLiteral<true>;
|
|
322
|
-
}, z.core.$strict>;
|
|
323
|
-
export type RepairChatDeliveryBody = z.input<typeof repairChatDeliveryBodySchema>;
|
|
324
|
-
export declare const chatDeliveryResultSchema: z.ZodObject<{
|
|
325
|
-
id: z.ZodString;
|
|
326
|
-
sessionId: z.ZodString;
|
|
327
|
-
threadId: z.ZodString;
|
|
328
|
-
connectionId: z.ZodString;
|
|
329
|
-
kind: z.ZodEnum<{
|
|
330
|
-
card: "card";
|
|
331
|
-
reply: "reply";
|
|
332
|
-
}>;
|
|
333
|
-
status: z.ZodEnum<{
|
|
334
|
-
ambiguous: "ambiguous";
|
|
335
|
-
confirmed: "confirmed";
|
|
336
|
-
failed: "failed";
|
|
337
|
-
}>;
|
|
338
|
-
attempt: z.ZodNumber;
|
|
339
|
-
}, z.core.$strip>;
|
|
340
|
-
export type ChatDeliveryResult = z.infer<typeof chatDeliveryResultSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { agentIdSchema, chatConnectionIdSchema,
|
|
2
|
+
import { agentIdSchema, chatConnectionIdSchema, tenantIdSchema, } from "../ids.js";
|
|
3
3
|
const slackBotToken = z
|
|
4
4
|
.string()
|
|
5
5
|
.min(8)
|
|
@@ -165,65 +165,3 @@ export const chatConnectionSchema = z
|
|
|
165
165
|
export const chatConnectionsResponseSchema = z
|
|
166
166
|
.object({ chatConnections: chatConnectionSchema.array() })
|
|
167
167
|
.strip();
|
|
168
|
-
export const chatDeliveryStatusSchema = z.enum([
|
|
169
|
-
"pending",
|
|
170
|
-
"confirmed",
|
|
171
|
-
"failed",
|
|
172
|
-
"ambiguous",
|
|
173
|
-
]);
|
|
174
|
-
export const chatDeliveryListStatusSchema = z.enum(["failed", "ambiguous"]);
|
|
175
|
-
export const chatDeliverySchema = z
|
|
176
|
-
.object({
|
|
177
|
-
id: chatDeliveryIdSchema,
|
|
178
|
-
kind: z.enum(["reply", "card"]),
|
|
179
|
-
status: z.enum(["pending", "confirmed", "failed", "ambiguous"]),
|
|
180
|
-
attempt: z.number().int().nonnegative(),
|
|
181
|
-
credentialVersion: z.number().int().nonnegative(),
|
|
182
|
-
representation: z.string(),
|
|
183
|
-
diagnostic: z.string().nullable(),
|
|
184
|
-
receipts: z.unknown(),
|
|
185
|
-
sessionId: z.string(),
|
|
186
|
-
messageId: z.string().nullable(),
|
|
187
|
-
approvalId: z.string().nullable(),
|
|
188
|
-
threadId: z.string(),
|
|
189
|
-
createdAt: z.string(),
|
|
190
|
-
updatedAt: z.string(),
|
|
191
|
-
})
|
|
192
|
-
.strip();
|
|
193
|
-
export const tenantChatDeliverySchema = chatDeliverySchema
|
|
194
|
-
.extend({
|
|
195
|
-
connectionId: chatConnectionIdSchema,
|
|
196
|
-
agentId: agentIdSchema,
|
|
197
|
-
platform: z.enum(["slack", "telegram"]),
|
|
198
|
-
})
|
|
199
|
-
.strict();
|
|
200
|
-
export const chatDeliveriesResponseSchema = z
|
|
201
|
-
.object({
|
|
202
|
-
data: z.array(tenantChatDeliverySchema),
|
|
203
|
-
nextCursor: z.string().nullable(),
|
|
204
|
-
})
|
|
205
|
-
.strip();
|
|
206
|
-
export const chatDeliveryListSchema = z
|
|
207
|
-
.object({
|
|
208
|
-
data: z.array(chatDeliverySchema),
|
|
209
|
-
nextCursor: z.string().nullable(),
|
|
210
|
-
})
|
|
211
|
-
.strip();
|
|
212
|
-
export const repairChatDeliveryBodySchema = z
|
|
213
|
-
.object({
|
|
214
|
-
expectedAttempt: z.number().int().min(0).max(99),
|
|
215
|
-
previousSenderStopped: z.literal(true),
|
|
216
|
-
acceptDuplicateRisk: z.literal(true),
|
|
217
|
-
})
|
|
218
|
-
.strict();
|
|
219
|
-
export const chatDeliveryResultSchema = z
|
|
220
|
-
.object({
|
|
221
|
-
id: chatDeliveryIdSchema,
|
|
222
|
-
sessionId: z.string(),
|
|
223
|
-
threadId: z.string(),
|
|
224
|
-
connectionId: chatConnectionIdSchema,
|
|
225
|
-
kind: z.enum(["reply", "card"]),
|
|
226
|
-
status: z.enum(["confirmed", "failed", "ambiguous"]),
|
|
227
|
-
attempt: z.number().int().nonnegative(),
|
|
228
|
-
})
|
|
229
|
-
.strip();
|
|
@@ -145,9 +145,6 @@ export declare const reconnectMcpConnectionBodySchema: z.ZodDiscriminatedUnion<[
|
|
|
145
145
|
export declare const mcpOauthAuthorizationLaunchResponseSchema: z.ZodObject<{
|
|
146
146
|
authorizationUrl: z.ZodString;
|
|
147
147
|
}, z.core.$strip>;
|
|
148
|
-
export declare const approveMcpOauthAuthorizationBodySchema: z.ZodObject<{
|
|
149
|
-
setupToken: z.ZodString;
|
|
150
|
-
}, z.core.$strict>;
|
|
151
148
|
export declare const mcpConnectionLiveDetailsSchema: z.ZodObject<{
|
|
152
149
|
server: z.ZodObject<{
|
|
153
150
|
name: z.ZodString;
|
|
@@ -241,9 +241,6 @@ export const mcpOauthAuthorizationLaunchResponseSchema = z
|
|
|
241
241
|
}),
|
|
242
242
|
})
|
|
243
243
|
.strip();
|
|
244
|
-
export const approveMcpOauthAuthorizationBodySchema = z
|
|
245
|
-
.object({ setupToken: z.string().regex(OPAQUE_MCP_OAUTH_TOKEN_PATTERN) })
|
|
246
|
-
.strict();
|
|
247
244
|
export const mcpConnectionLiveDetailsSchema = z
|
|
248
245
|
.object({
|
|
249
246
|
server: z
|
|
@@ -12,10 +12,6 @@ export declare const merchantEnvironmentSchema: z.ZodEnum<{
|
|
|
12
12
|
live: "live";
|
|
13
13
|
sandbox: "sandbox";
|
|
14
14
|
}>;
|
|
15
|
-
export declare const merchantConnectionStatusSchema: z.ZodEnum<{
|
|
16
|
-
active: "active";
|
|
17
|
-
disconnected: "disconnected";
|
|
18
|
-
}>;
|
|
19
15
|
export declare const merchantGuardSchema: z.ZodObject<{
|
|
20
16
|
enabled: z.ZodBoolean;
|
|
21
17
|
productIds: z.ZodArray<z.ZodString>;
|
|
@@ -32,10 +28,6 @@ export declare const merchantConnectionSchema: z.ZodObject<{
|
|
|
32
28
|
live: "live";
|
|
33
29
|
sandbox: "sandbox";
|
|
34
30
|
}>;
|
|
35
|
-
status: z.ZodEnum<{
|
|
36
|
-
active: "active";
|
|
37
|
-
disconnected: "disconnected";
|
|
38
|
-
}>;
|
|
39
31
|
merchantAccountId: z.ZodString;
|
|
40
32
|
keyFragment: z.ZodString;
|
|
41
33
|
guard: z.ZodObject<{
|
|
@@ -59,10 +51,6 @@ export declare const merchantConnectionResponseSchema: z.ZodObject<{
|
|
|
59
51
|
live: "live";
|
|
60
52
|
sandbox: "sandbox";
|
|
61
53
|
}>;
|
|
62
|
-
status: z.ZodEnum<{
|
|
63
|
-
active: "active";
|
|
64
|
-
disconnected: "disconnected";
|
|
65
|
-
}>;
|
|
66
54
|
merchantAccountId: z.ZodString;
|
|
67
55
|
keyFragment: z.ZodString;
|
|
68
56
|
guard: z.ZodObject<{
|
|
@@ -95,10 +83,6 @@ export declare const createMerchantConnectionBodySchema: z.ZodObject<{
|
|
|
95
83
|
export type CreateMerchantConnectionBody = z.infer<typeof createMerchantConnectionBodySchema>;
|
|
96
84
|
export declare const updateMerchantConnectionBodySchema: z.ZodObject<{
|
|
97
85
|
credential: z.ZodOptional<z.ZodString>;
|
|
98
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
99
|
-
active: "active";
|
|
100
|
-
disconnected: "disconnected";
|
|
101
|
-
}>>;
|
|
102
86
|
guard: z.ZodOptional<z.ZodObject<{
|
|
103
87
|
enabled: z.ZodBoolean;
|
|
104
88
|
productIds: z.ZodArray<z.ZodString>;
|
|
@@ -143,8 +127,6 @@ export declare const merchantUsageEventStatusSchema: z.ZodEnum<{
|
|
|
143
127
|
failed: "failed";
|
|
144
128
|
incomplete: "incomplete";
|
|
145
129
|
pending: "pending";
|
|
146
|
-
uncertain: "uncertain";
|
|
147
|
-
unmapped: "unmapped";
|
|
148
130
|
}>;
|
|
149
131
|
export type MerchantUsageEventStatus = z.infer<typeof merchantUsageEventStatusSchema>;
|
|
150
132
|
export declare const merchantWorkflowIssueSchema: z.ZodEnum<{
|
|
@@ -153,7 +135,6 @@ export declare const merchantWorkflowIssueSchema: z.ZodEnum<{
|
|
|
153
135
|
recovery_exhausted: "recovery_exhausted";
|
|
154
136
|
}>;
|
|
155
137
|
export declare const merchantUsageEventNextActionSchema: z.ZodEnum<{
|
|
156
|
-
bind_and_release: "bind_and_release";
|
|
157
138
|
discard: "discard";
|
|
158
139
|
investigate: "investigate";
|
|
159
140
|
none: "none";
|
|
@@ -198,8 +179,6 @@ export declare const merchantUsageEventSchema: z.ZodObject<{
|
|
|
198
179
|
failed: "failed";
|
|
199
180
|
incomplete: "incomplete";
|
|
200
181
|
pending: "pending";
|
|
201
|
-
uncertain: "uncertain";
|
|
202
|
-
unmapped: "unmapped";
|
|
203
182
|
}>;
|
|
204
183
|
payload: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
205
184
|
attemptCount: z.ZodNumber;
|
|
@@ -213,7 +192,6 @@ export declare const merchantUsageEventSchema: z.ZodObject<{
|
|
|
213
192
|
recovery_exhausted: "recovery_exhausted";
|
|
214
193
|
}>>;
|
|
215
194
|
nextAction: z.ZodEnum<{
|
|
216
|
-
bind_and_release: "bind_and_release";
|
|
217
195
|
discard: "discard";
|
|
218
196
|
investigate: "investigate";
|
|
219
197
|
none: "none";
|
|
@@ -261,8 +239,6 @@ export declare const merchantUsageEventResponseSchema: z.ZodObject<{
|
|
|
261
239
|
failed: "failed";
|
|
262
240
|
incomplete: "incomplete";
|
|
263
241
|
pending: "pending";
|
|
264
|
-
uncertain: "uncertain";
|
|
265
|
-
unmapped: "unmapped";
|
|
266
242
|
}>;
|
|
267
243
|
payload: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
268
244
|
attemptCount: z.ZodNumber;
|
|
@@ -276,7 +252,6 @@ export declare const merchantUsageEventResponseSchema: z.ZodObject<{
|
|
|
276
252
|
recovery_exhausted: "recovery_exhausted";
|
|
277
253
|
}>>;
|
|
278
254
|
nextAction: z.ZodEnum<{
|
|
279
|
-
bind_and_release: "bind_and_release";
|
|
280
255
|
discard: "discard";
|
|
281
256
|
investigate: "investigate";
|
|
282
257
|
none: "none";
|
|
@@ -325,8 +300,6 @@ export declare const merchantUsageEventsResponseSchema: z.ZodObject<{
|
|
|
325
300
|
failed: "failed";
|
|
326
301
|
incomplete: "incomplete";
|
|
327
302
|
pending: "pending";
|
|
328
|
-
uncertain: "uncertain";
|
|
329
|
-
unmapped: "unmapped";
|
|
330
303
|
}>;
|
|
331
304
|
payload: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
332
305
|
attemptCount: z.ZodNumber;
|
|
@@ -340,7 +313,6 @@ export declare const merchantUsageEventsResponseSchema: z.ZodObject<{
|
|
|
340
313
|
recovery_exhausted: "recovery_exhausted";
|
|
341
314
|
}>>;
|
|
342
315
|
nextAction: z.ZodEnum<{
|
|
343
|
-
bind_and_release: "bind_and_release";
|
|
344
316
|
discard: "discard";
|
|
345
317
|
investigate: "investigate";
|
|
346
318
|
none: "none";
|
|
@@ -359,9 +331,7 @@ export type MerchantUsageEventsResponse = z.infer<typeof merchantUsageEventsResp
|
|
|
359
331
|
export declare const merchantUsageSummaryCountsSchema: z.ZodObject<{
|
|
360
332
|
pending: z.ZodNumber;
|
|
361
333
|
accepted: z.ZodNumber;
|
|
362
|
-
uncertain: z.ZodNumber;
|
|
363
334
|
failed: z.ZodNumber;
|
|
364
|
-
unmapped: z.ZodNumber;
|
|
365
335
|
incomplete: z.ZodNumber;
|
|
366
336
|
expired: z.ZodNumber;
|
|
367
337
|
discarded: z.ZodNumber;
|
|
@@ -376,9 +346,7 @@ export declare const merchantUsageSummarySchema: z.ZodObject<{
|
|
|
376
346
|
counts: z.ZodObject<{
|
|
377
347
|
pending: z.ZodNumber;
|
|
378
348
|
accepted: z.ZodNumber;
|
|
379
|
-
uncertain: z.ZodNumber;
|
|
380
349
|
failed: z.ZodNumber;
|
|
381
|
-
unmapped: z.ZodNumber;
|
|
382
350
|
incomplete: z.ZodNumber;
|
|
383
351
|
expired: z.ZodNumber;
|
|
384
352
|
discarded: z.ZodNumber;
|
|
@@ -401,9 +369,7 @@ export declare const merchantUsageSummaryResponseSchema: z.ZodObject<{
|
|
|
401
369
|
counts: z.ZodObject<{
|
|
402
370
|
pending: z.ZodNumber;
|
|
403
371
|
accepted: z.ZodNumber;
|
|
404
|
-
uncertain: z.ZodNumber;
|
|
405
372
|
failed: z.ZodNumber;
|
|
406
|
-
unmapped: z.ZodNumber;
|
|
407
373
|
incomplete: z.ZodNumber;
|
|
408
374
|
expired: z.ZodNumber;
|
|
409
375
|
discarded: z.ZodNumber;
|
|
@@ -10,10 +10,6 @@ import { providerTypeSchema } from "./providers.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export const merchantProviderSchema = z.enum(["polar", "dodo"]);
|
|
12
12
|
export const merchantEnvironmentSchema = z.enum(["sandbox", "live"]);
|
|
13
|
-
export const merchantConnectionStatusSchema = z.enum([
|
|
14
|
-
"active",
|
|
15
|
-
"disconnected",
|
|
16
|
-
]);
|
|
17
13
|
export const merchantGuardSchema = z
|
|
18
14
|
.object({
|
|
19
15
|
enabled: z.boolean(),
|
|
@@ -34,7 +30,6 @@ export const merchantConnectionSchema = z
|
|
|
34
30
|
id: merchantConnectionIdSchema,
|
|
35
31
|
provider: merchantProviderSchema,
|
|
36
32
|
environment: merchantEnvironmentSchema,
|
|
37
|
-
status: merchantConnectionStatusSchema,
|
|
38
33
|
merchantAccountId: z.string().min(1),
|
|
39
34
|
keyFragment: providerKeyFragmentSchema,
|
|
40
35
|
guard: merchantGuardSchema,
|
|
@@ -66,9 +61,6 @@ export const updateMerchantConnectionBodySchema = z
|
|
|
66
61
|
.min(1)
|
|
67
62
|
.optional()
|
|
68
63
|
.describe("A replacement credential. It must belong to the same merchant account as the current one."),
|
|
69
|
-
status: merchantConnectionStatusSchema
|
|
70
|
-
.optional()
|
|
71
|
-
.describe("`active` sends usage events to your provider. While `disconnected`, deliveries fail and can be retried after you set it back to `active`, and turns are refused if the guard is on."),
|
|
72
64
|
guard: merchantGuardSchema
|
|
73
65
|
.optional()
|
|
74
66
|
.describe("The complete guard configuration, replacing the current one."),
|
|
@@ -103,8 +95,6 @@ export const merchantUsageEventStatusSchema = z.enum([
|
|
|
103
95
|
"pending",
|
|
104
96
|
"accepted",
|
|
105
97
|
"failed",
|
|
106
|
-
"uncertain",
|
|
107
|
-
"unmapped",
|
|
108
98
|
"incomplete",
|
|
109
99
|
"discarded",
|
|
110
100
|
"expired",
|
|
@@ -118,7 +108,6 @@ export const merchantUsageEventNextActionSchema = z.enum([
|
|
|
118
108
|
"none",
|
|
119
109
|
"wait",
|
|
120
110
|
"retry",
|
|
121
|
-
"bind_and_release",
|
|
122
111
|
"investigate",
|
|
123
112
|
"discard",
|
|
124
113
|
]);
|
|
@@ -169,9 +158,7 @@ export const merchantUsageSummaryCountsSchema = z
|
|
|
169
158
|
.object({
|
|
170
159
|
pending: z.number().int().nonnegative(),
|
|
171
160
|
accepted: z.number().int().nonnegative(),
|
|
172
|
-
uncertain: z.number().int().nonnegative(),
|
|
173
161
|
failed: z.number().int().nonnegative(),
|
|
174
|
-
unmapped: z.number().int().nonnegative(),
|
|
175
162
|
incomplete: z.number().int().nonnegative(),
|
|
176
163
|
expired: z.number().int().nonnegative(),
|
|
177
164
|
discarded: z.number().int().nonnegative(),
|
|
@@ -219,10 +206,7 @@ export function merchantUsageEventNextAction(event) {
|
|
|
219
206
|
case "pending":
|
|
220
207
|
return event.workflowIssue === null ? "wait" : "retry";
|
|
221
208
|
case "failed":
|
|
222
|
-
case "uncertain":
|
|
223
209
|
return "retry";
|
|
224
|
-
case "unmapped":
|
|
225
|
-
return "bind_and_release";
|
|
226
210
|
case "incomplete":
|
|
227
211
|
return "investigate";
|
|
228
212
|
case "expired":
|
|
@@ -2,28 +2,24 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const sessionInputStateSchema: z.ZodEnum<{
|
|
3
3
|
accepted: "accepted";
|
|
4
4
|
committed: "committed";
|
|
5
|
-
delivered: "delivered";
|
|
6
5
|
not_placed: "not_placed";
|
|
7
|
-
uncertain: "uncertain";
|
|
8
6
|
}>;
|
|
9
7
|
export declare const sessionInputRequestIdSchema: z.ZodString;
|
|
10
8
|
export declare const sessionInputSchema: z.ZodObject<{
|
|
11
9
|
requestId: z.ZodString;
|
|
12
10
|
sequence: z.ZodNumber;
|
|
13
11
|
message: z.ZodObject<{
|
|
12
|
+
role: z.ZodLiteral<"user">;
|
|
14
13
|
id: z.ZodString;
|
|
15
14
|
parts: z.ZodArray<z.ZodObject<{
|
|
16
15
|
type: z.ZodString;
|
|
17
16
|
}, z.core.$loose>>;
|
|
18
17
|
metadata: z.ZodOptional<z.ZodUnknown>;
|
|
19
|
-
role: z.ZodLiteral<"user">;
|
|
20
18
|
}, z.core.$loose>;
|
|
21
19
|
state: z.ZodEnum<{
|
|
22
20
|
accepted: "accepted";
|
|
23
21
|
committed: "committed";
|
|
24
|
-
delivered: "delivered";
|
|
25
22
|
not_placed: "not_placed";
|
|
26
|
-
uncertain: "uncertain";
|
|
27
23
|
}>;
|
|
28
24
|
turnId: z.ZodString;
|
|
29
25
|
createdAt: z.ZodISODateTime;
|
|
@@ -49,19 +45,17 @@ export declare const sessionInputResponseSchema: z.ZodObject<{
|
|
|
49
45
|
requestId: z.ZodString;
|
|
50
46
|
sequence: z.ZodNumber;
|
|
51
47
|
message: z.ZodObject<{
|
|
48
|
+
role: z.ZodLiteral<"user">;
|
|
52
49
|
id: z.ZodString;
|
|
53
50
|
parts: z.ZodArray<z.ZodObject<{
|
|
54
51
|
type: z.ZodString;
|
|
55
52
|
}, z.core.$loose>>;
|
|
56
53
|
metadata: z.ZodOptional<z.ZodUnknown>;
|
|
57
|
-
role: z.ZodLiteral<"user">;
|
|
58
54
|
}, z.core.$loose>;
|
|
59
55
|
state: z.ZodEnum<{
|
|
60
56
|
accepted: "accepted";
|
|
61
57
|
committed: "committed";
|
|
62
|
-
delivered: "delivered";
|
|
63
58
|
not_placed: "not_placed";
|
|
64
|
-
uncertain: "uncertain";
|
|
65
59
|
}>;
|
|
66
60
|
turnId: z.ZodString;
|
|
67
61
|
createdAt: z.ZodISODateTime;
|
|
@@ -88,19 +82,17 @@ export declare const sessionInputsResponseSchema: z.ZodObject<{
|
|
|
88
82
|
requestId: z.ZodString;
|
|
89
83
|
sequence: z.ZodNumber;
|
|
90
84
|
message: z.ZodObject<{
|
|
85
|
+
role: z.ZodLiteral<"user">;
|
|
91
86
|
id: z.ZodString;
|
|
92
87
|
parts: z.ZodArray<z.ZodObject<{
|
|
93
88
|
type: z.ZodString;
|
|
94
89
|
}, z.core.$loose>>;
|
|
95
90
|
metadata: z.ZodOptional<z.ZodUnknown>;
|
|
96
|
-
role: z.ZodLiteral<"user">;
|
|
97
91
|
}, z.core.$loose>;
|
|
98
92
|
state: z.ZodEnum<{
|
|
99
93
|
accepted: "accepted";
|
|
100
94
|
committed: "committed";
|
|
101
|
-
delivered: "delivered";
|
|
102
95
|
not_placed: "not_placed";
|
|
103
|
-
uncertain: "uncertain";
|
|
104
96
|
}>;
|
|
105
97
|
turnId: z.ZodString;
|
|
106
98
|
createdAt: z.ZodISODateTime;
|
|
@@ -164,12 +156,12 @@ export declare const chatSteerConsumedEventSchema: z.ZodObject<{
|
|
|
164
156
|
requestId: z.ZodString;
|
|
165
157
|
sequence: z.ZodNumber;
|
|
166
158
|
message: z.ZodObject<{
|
|
159
|
+
role: z.ZodLiteral<"user">;
|
|
167
160
|
id: z.ZodString;
|
|
168
161
|
parts: z.ZodArray<z.ZodObject<{
|
|
169
162
|
type: z.ZodString;
|
|
170
163
|
}, z.core.$loose>>;
|
|
171
164
|
metadata: z.ZodOptional<z.ZodUnknown>;
|
|
172
|
-
role: z.ZodLiteral<"user">;
|
|
173
165
|
}, z.core.$loose>;
|
|
174
166
|
turnId: z.ZodString;
|
|
175
167
|
}, z.core.$strip>;
|
|
@@ -3,10 +3,8 @@ import { turnIdSchema } from "../ids.js";
|
|
|
3
3
|
import { sessionMessageSchema } from "./sessions.js";
|
|
4
4
|
export const sessionInputStateSchema = z.enum([
|
|
5
5
|
"accepted",
|
|
6
|
-
"delivered",
|
|
7
6
|
"committed",
|
|
8
7
|
"not_placed",
|
|
9
|
-
"uncertain",
|
|
10
8
|
]);
|
|
11
9
|
export const sessionInputRequestIdSchema = z
|
|
12
10
|
.string()
|