@blazingagents/sdk 0.56.1 → 0.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contracts/api-error-codes.d.ts +1 -1
- package/dist/contracts/api-error-codes.js +1 -5
- package/dist/contracts/api.d.ts +8 -5
- package/dist/contracts/api.js +7 -0
- package/dist/contracts/entities/artifacts.d.ts +2 -2
- package/dist/contracts/entities/artifacts.js +1 -1
- package/dist/contracts/entities/attribution.d.ts +1 -1
- package/dist/contracts/entities/attribution.js +1 -1
- package/dist/contracts/entities/chat-connections.d.ts +1 -1
- package/dist/contracts/entities/chat-connections.js +2 -3
- package/dist/contracts/entities/mcp-connections.d.ts +6 -2
- package/dist/contracts/entities/mcp-connections.js +5 -11
- package/dist/contracts/entities/memories.d.ts +0 -13
- package/dist/contracts/entities/memories.js +0 -5
- package/dist/contracts/entities/merchant.d.ts +7 -88
- package/dist/contracts/entities/merchant.js +7 -22
- package/dist/contracts/entities/providers.d.ts +8 -5
- package/dist/contracts/entities/providers.js +7 -18
- package/dist/contracts/entities/session-inputs.d.ts +1 -1
- package/dist/contracts/entities/session-inputs.js +1 -1
- package/dist/contracts/entities/sessions.d.ts +8 -3
- package/dist/contracts/entities/sessions.js +4 -3
- package/dist/contracts/entities/skills.d.ts +27 -25
- package/dist/contracts/entities/skills.js +2 -2
- package/dist/contracts/entities/tasks.d.ts +0 -5
- package/dist/contracts/entities/tasks.js +5 -22
- package/dist/contracts/index.d.ts +4 -4
- package/dist/contracts/index.js +4 -4
- package/dist/contracts/utils.d.ts +9 -0
- package/dist/contracts/utils.js +16 -0
- package/dist/http.d.ts +6 -0
- package/dist/http.js +10 -0
- package/dist/index.d.ts +1 -1
- package/dist/relay.js +1 -1
- package/dist/resources/agents.d.ts +2 -2
- package/dist/resources/agents.js +3 -3
- package/dist/resources/artifacts.d.ts +1 -0
- package/dist/resources/artifacts.js +1 -0
- package/dist/resources/memories.d.ts +7 -7
- package/dist/resources/memories.js +4 -4
- package/dist/resources/merchant-bindings.d.ts +3 -3
- package/dist/resources/merchant-bindings.js +2 -2
- package/dist/resources/merchant-connection.d.ts +5 -5
- package/dist/resources/merchant-connection.js +3 -3
- package/dist/resources/merchant-usage-events.d.ts +9 -9
- package/dist/resources/merchant-usage-events.js +5 -5
- package/dist/resources/skills.js +1 -9
- package/dist/resources/tasks.d.ts +10 -7
- package/dist/resources/tasks.js +9 -4
- package/dist/resources/workspaces.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Every `error.code` the API contract lists. */
|
|
2
|
-
export declare const apiErrorCodes: readonly ["invalid_request", "idempotency_conflict", "input_idempotency_conflict", "steer_not_available", "validation_failed", "unauthorized", "not_found", "model_spending_limit_exceeded", "subscription_required", "usage_credit_required", "rate_limited", "internal", "service_unavailable", "subscription_already_paid", "subscription_not_cancelled", "agent_disabled", "agent_busy", "agent_deleting", "admin_agent_managed", "
|
|
2
|
+
export declare const apiErrorCodes: readonly ["invalid_request", "idempotency_conflict", "input_idempotency_conflict", "steer_not_available", "validation_failed", "unauthorized", "not_found", "model_spending_limit_exceeded", "subscription_required", "usage_credit_required", "rate_limited", "internal", "service_unavailable", "subscription_already_paid", "subscription_not_cancelled", "agent_disabled", "agent_busy", "agent_deleting", "admin_agent_managed", "agent_mcp_connections_invalid", "provider_required", "api_key_limit_reached", "artifact_session_cap_reached", "invalid_cursor", "message_not_found", "prompt_variable_missing", "prompt_variable_unknown", "provider_in_use", "provider_historical_use", "provider_limit_reached", "provider_name_conflict", "provider_not_found", "model_discovery_unsupported", "model_not_found", "model_validation_unavailable", "mcp_connection_not_found", "mcp_connection_limit_reached", "mcp_connection_name_conflict", "mcp_connection_stale_credential_version", "mcp_connection_invalid", "mcp_connection_authentication_failed", "mcp_connection_in_use", "mcp_connection_unreachable", "mcp_connection_discovery_failed", "mcp_connection_needs_auth", "workspace_not_found", "workspace_in_use", "workspace_busy", "session_busy", "session_turn_unresponsive", "session_fork_unavailable", "session_fork_deleted", "message_id_conflict", "session_version_mismatch", "tool_approval_continuation_settled", "tool_approval_decision_conflict", "tool_approval_outdated", "function_call_conflict", "skill_invalid_archive", "skill_invalid_markdown", "skill_limit_reached", "skill_name_conflict", "skill_too_many_files", "skill_uncompressed_too_large", "task_active_run_exists", "chat_webhook_conflict", "chat_webhook_registration_failed", "merchant_connection_in_use", "merchant_credential_invalid", "merchant_provider_unavailable", "merchant_customer_not_found", "merchant_account_mismatch", "merchant_event_state_conflict", "merchant_customer_unmapped", "forbidden", "insufficient_scope", "merchant_subscription_required", "merchant_balance_required", "merchant_eligibility_unavailable", "tenant_deleting", "tenant_deletion_in_progress", "tenant_deletion_not_ready", "tenant_not_deleting"];
|
|
@@ -20,7 +20,6 @@ export const apiErrorCodes = [
|
|
|
20
20
|
"agent_busy",
|
|
21
21
|
"agent_deleting",
|
|
22
22
|
"admin_agent_managed",
|
|
23
|
-
"agent_mcp_connection_not_found",
|
|
24
23
|
"agent_mcp_connections_invalid",
|
|
25
24
|
"provider_required",
|
|
26
25
|
"api_key_limit_reached",
|
|
@@ -37,6 +36,7 @@ export const apiErrorCodes = [
|
|
|
37
36
|
"model_discovery_unsupported",
|
|
38
37
|
"model_not_found",
|
|
39
38
|
"model_validation_unavailable",
|
|
39
|
+
"mcp_connection_not_found",
|
|
40
40
|
"mcp_connection_limit_reached",
|
|
41
41
|
"mcp_connection_name_conflict",
|
|
42
42
|
"mcp_connection_stale_credential_version",
|
|
@@ -63,20 +63,16 @@ export const apiErrorCodes = [
|
|
|
63
63
|
"skill_invalid_markdown",
|
|
64
64
|
"skill_limit_reached",
|
|
65
65
|
"skill_name_conflict",
|
|
66
|
-
"skill_not_found",
|
|
67
66
|
"skill_too_many_files",
|
|
68
67
|
"skill_uncompressed_too_large",
|
|
69
68
|
"task_active_run_exists",
|
|
70
69
|
"chat_webhook_conflict",
|
|
71
70
|
"chat_webhook_registration_failed",
|
|
72
|
-
"merchant_connection_not_found",
|
|
73
71
|
"merchant_connection_in_use",
|
|
74
72
|
"merchant_credential_invalid",
|
|
75
73
|
"merchant_provider_unavailable",
|
|
76
74
|
"merchant_customer_not_found",
|
|
77
|
-
"merchant_binding_not_found",
|
|
78
75
|
"merchant_account_mismatch",
|
|
79
|
-
"merchant_event_not_found",
|
|
80
76
|
"merchant_event_state_conflict",
|
|
81
77
|
"merchant_customer_unmapped",
|
|
82
78
|
"forbidden",
|
package/dist/contracts/api.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
|
11
11
|
agent_busy: "agent_busy";
|
|
12
12
|
agent_deleting: "agent_deleting";
|
|
13
13
|
agent_disabled: "agent_disabled";
|
|
14
|
-
agent_mcp_connection_not_found: "agent_mcp_connection_not_found";
|
|
15
14
|
agent_mcp_connections_invalid: "agent_mcp_connections_invalid";
|
|
16
15
|
api_key_limit_reached: "api_key_limit_reached";
|
|
17
16
|
artifact_session_cap_reached: "artifact_session_cap_reached";
|
|
@@ -32,18 +31,16 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
|
32
31
|
mcp_connection_limit_reached: "mcp_connection_limit_reached";
|
|
33
32
|
mcp_connection_name_conflict: "mcp_connection_name_conflict";
|
|
34
33
|
mcp_connection_needs_auth: "mcp_connection_needs_auth";
|
|
34
|
+
mcp_connection_not_found: "mcp_connection_not_found";
|
|
35
35
|
mcp_connection_stale_credential_version: "mcp_connection_stale_credential_version";
|
|
36
36
|
mcp_connection_unreachable: "mcp_connection_unreachable";
|
|
37
37
|
merchant_account_mismatch: "merchant_account_mismatch";
|
|
38
38
|
merchant_balance_required: "merchant_balance_required";
|
|
39
|
-
merchant_binding_not_found: "merchant_binding_not_found";
|
|
40
39
|
merchant_connection_in_use: "merchant_connection_in_use";
|
|
41
|
-
merchant_connection_not_found: "merchant_connection_not_found";
|
|
42
40
|
merchant_credential_invalid: "merchant_credential_invalid";
|
|
43
41
|
merchant_customer_not_found: "merchant_customer_not_found";
|
|
44
42
|
merchant_customer_unmapped: "merchant_customer_unmapped";
|
|
45
43
|
merchant_eligibility_unavailable: "merchant_eligibility_unavailable";
|
|
46
|
-
merchant_event_not_found: "merchant_event_not_found";
|
|
47
44
|
merchant_event_state_conflict: "merchant_event_state_conflict";
|
|
48
45
|
merchant_provider_unavailable: "merchant_provider_unavailable";
|
|
49
46
|
merchant_subscription_required: "merchant_subscription_required";
|
|
@@ -73,7 +70,6 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
|
73
70
|
skill_invalid_markdown: "skill_invalid_markdown";
|
|
74
71
|
skill_limit_reached: "skill_limit_reached";
|
|
75
72
|
skill_name_conflict: "skill_name_conflict";
|
|
76
|
-
skill_not_found: "skill_not_found";
|
|
77
73
|
skill_too_many_files: "skill_too_many_files";
|
|
78
74
|
skill_uncompressed_too_large: "skill_uncompressed_too_large";
|
|
79
75
|
steer_not_available: "steer_not_available";
|
|
@@ -111,6 +107,13 @@ export declare const receivedApiErrorResponseSchema: z.ZodObject<{
|
|
|
111
107
|
}, z.core.$loose>;
|
|
112
108
|
export type ApiErrorCode = z.infer<typeof apiErrorCodeSchema>;
|
|
113
109
|
export declare const cursorSchema: z.ZodString;
|
|
110
|
+
/**
|
|
111
|
+
* Creates a schema for a whole list, which no cursor pages.
|
|
112
|
+
* @param itemSchema - Item Schema.
|
|
113
|
+
*/
|
|
114
|
+
export declare function listResponseSchema<T extends z.ZodTypeAny>(itemSchema: T): z.ZodObject<{
|
|
115
|
+
data: z.ZodArray<T>;
|
|
116
|
+
}, z.core.$strip>;
|
|
114
117
|
/**
|
|
115
118
|
* Creates a schema for a data page and nullable next cursor.
|
|
116
119
|
* @param itemSchema - Item Schema.
|
package/dist/contracts/api.js
CHANGED
|
@@ -29,6 +29,13 @@ export const receivedApiErrorResponseSchema = z
|
|
|
29
29
|
})
|
|
30
30
|
.passthrough();
|
|
31
31
|
export const cursorSchema = z.string().trim().min(1);
|
|
32
|
+
/**
|
|
33
|
+
* Creates a schema for a whole list, which no cursor pages.
|
|
34
|
+
* @param itemSchema - Item Schema.
|
|
35
|
+
*/
|
|
36
|
+
export function listResponseSchema(itemSchema) {
|
|
37
|
+
return z.object({ data: z.array(itemSchema) }).strip();
|
|
38
|
+
}
|
|
32
39
|
/**
|
|
33
40
|
* Creates a schema for a data page and nullable next cursor.
|
|
34
41
|
* @param itemSchema - Item Schema.
|
|
@@ -4,7 +4,7 @@ export declare const artifactFilenameSchema: z.ZodString;
|
|
|
4
4
|
* Public metadata returned by Tenant-level Artifact resources.
|
|
5
5
|
*/
|
|
6
6
|
export declare const artifactListItemSchema: z.ZodObject<{
|
|
7
|
-
|
|
7
|
+
id: z.ZodString;
|
|
8
8
|
agentId: z.ZodString;
|
|
9
9
|
tenantId: z.ZodString;
|
|
10
10
|
sessionId: z.ZodString;
|
|
@@ -18,7 +18,7 @@ export declare const artifactListItemSchema: z.ZodObject<{
|
|
|
18
18
|
}, z.core.$strip>;
|
|
19
19
|
export declare const artifactsListResponseSchema: z.ZodObject<{
|
|
20
20
|
data: z.ZodArray<z.ZodObject<{
|
|
21
|
-
|
|
21
|
+
id: z.ZodString;
|
|
22
22
|
agentId: z.ZodString;
|
|
23
23
|
tenantId: z.ZodString;
|
|
24
24
|
sessionId: z.ZodString;
|
|
@@ -16,7 +16,7 @@ export declare const metadataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
|
16
16
|
* The create-body shape for an attributed resource: both fields optional
|
|
17
17
|
* with tenant-level defaults (`userId: ''`, `metadata: {}`). `userId` is
|
|
18
18
|
* set at creation and immutable — update bodies accept `metadata` only
|
|
19
|
-
* (they do not include `userId`, so a `userId` in
|
|
19
|
+
* (they do not include `userId`, so a `userId` in an update body is rejected
|
|
20
20
|
* by the update body's `.strict()`).
|
|
21
21
|
*/
|
|
22
22
|
export declare const attributionCreateInputSchema: z.ZodObject<{
|
|
@@ -20,7 +20,7 @@ export const metadataSchema = z
|
|
|
20
20
|
* The create-body shape for an attributed resource: both fields optional
|
|
21
21
|
* with tenant-level defaults (`userId: ''`, `metadata: {}`). `userId` is
|
|
22
22
|
* set at creation and immutable — update bodies accept `metadata` only
|
|
23
|
-
* (they do not include `userId`, so a `userId` in
|
|
23
|
+
* (they do not include `userId`, so a `userId` in an update body is rejected
|
|
24
24
|
* by the update body's `.strict()`).
|
|
25
25
|
*/
|
|
26
26
|
export const attributionCreateInputSchema = z
|
|
@@ -138,7 +138,7 @@ export type ChatIdentity = z.output<typeof chatIdentitySchema>;
|
|
|
138
138
|
export type ChatConnection = z.output<typeof chatConnectionSchema>;
|
|
139
139
|
export type UpdateChatConnectionBody = z.output<typeof updateChatConnectionBodySchema>;
|
|
140
140
|
export declare const chatConnectionsResponseSchema: z.ZodObject<{
|
|
141
|
-
|
|
141
|
+
data: z.ZodArray<z.ZodObject<{
|
|
142
142
|
id: z.ZodString;
|
|
143
143
|
tenantId: z.ZodString;
|
|
144
144
|
agentId: z.ZodString;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { listResponseSchema } from "../api.js";
|
|
2
3
|
import { agentIdSchema, chatConnectionIdSchema, tenantIdSchema, } from "../ids.js";
|
|
3
4
|
const slackBotToken = z
|
|
4
5
|
.string()
|
|
@@ -162,6 +163,4 @@ export const chatConnectionSchema = z
|
|
|
162
163
|
webhookUrl: z.url(),
|
|
163
164
|
})
|
|
164
165
|
.strip();
|
|
165
|
-
export const chatConnectionsResponseSchema =
|
|
166
|
-
.object({ chatConnections: chatConnectionSchema.array() })
|
|
167
|
-
.strip();
|
|
166
|
+
export const chatConnectionsResponseSchema = listResponseSchema(chatConnectionSchema);
|
|
@@ -17,6 +17,7 @@ export declare const mcpConnectionTestErrorCodeSchema: z.ZodEnum<{
|
|
|
17
17
|
}>;
|
|
18
18
|
export declare const mcpConnectionResponseSchema: z.ZodObject<{
|
|
19
19
|
id: z.ZodString;
|
|
20
|
+
tenantId: z.ZodString;
|
|
20
21
|
name: z.ZodString;
|
|
21
22
|
url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
22
23
|
authType: z.ZodEnum<{
|
|
@@ -43,8 +44,9 @@ export declare const mcpConnectionResponseSchema: z.ZodObject<{
|
|
|
43
44
|
updatedAt: z.ZodISODateTime;
|
|
44
45
|
}, z.core.$strip>;
|
|
45
46
|
export declare const mcpConnectionsResponseSchema: z.ZodObject<{
|
|
46
|
-
|
|
47
|
+
data: z.ZodArray<z.ZodObject<{
|
|
47
48
|
id: z.ZodString;
|
|
49
|
+
tenantId: z.ZodString;
|
|
48
50
|
name: z.ZodString;
|
|
49
51
|
url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
50
52
|
authType: z.ZodEnum<{
|
|
@@ -80,7 +82,7 @@ export declare const mcpAttachmentResponseSchema: z.ZodObject<{
|
|
|
80
82
|
updatedAt: z.ZodISODateTime;
|
|
81
83
|
}, z.core.$strip>;
|
|
82
84
|
export declare const mcpAttachmentsResponseSchema: z.ZodObject<{
|
|
83
|
-
|
|
85
|
+
data: z.ZodArray<z.ZodObject<{
|
|
84
86
|
mcpConnectionId: z.ZodString;
|
|
85
87
|
forwardUserId: z.ZodBoolean;
|
|
86
88
|
forwardedMetadataKeys: z.ZodArray<z.ZodString>;
|
|
@@ -161,6 +163,7 @@ export declare const mcpConnectionReconnectResultSchema: z.ZodDiscriminatedUnion
|
|
|
161
163
|
status: z.ZodLiteral<"connected">;
|
|
162
164
|
connection: z.ZodObject<{
|
|
163
165
|
id: z.ZodString;
|
|
166
|
+
tenantId: z.ZodString;
|
|
164
167
|
name: z.ZodString;
|
|
165
168
|
url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
166
169
|
authType: z.ZodEnum<{
|
|
@@ -190,6 +193,7 @@ export declare const mcpConnectionReconnectResultSchema: z.ZodDiscriminatedUnion
|
|
|
190
193
|
status: z.ZodLiteral<"needs_auth">;
|
|
191
194
|
connection: z.ZodObject<{
|
|
192
195
|
id: z.ZodString;
|
|
196
|
+
tenantId: z.ZodString;
|
|
193
197
|
name: z.ZodString;
|
|
194
198
|
url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
195
199
|
authType: z.ZodEnum<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { listResponseSchema } from "../api.js";
|
|
3
|
+
import { mcpConnectionIdSchema, tenantIdSchema } from "../ids.js";
|
|
3
4
|
import { MAX_MCP_ATTACHMENT_METADATA_KEY_LENGTH, MAX_MCP_ATTACHMENT_METADATA_KEYS, MAX_MCP_BEARER_TOKEN_LENGTH, MAX_MCP_CONNECTION_NAME_LENGTH, MAX_MCP_CONNECTION_TEST_LATENCY_MS, MAX_MCP_CONNECTION_URL_LENGTH, MAX_MCP_OAUTH_CLIENT_ID_LENGTH, MAX_MCP_OAUTH_CLIENT_SECRET_LENGTH, MAX_MCP_OAUTH_SCOPE_LENGTH, MAX_MCP_SERVER_NAME_LENGTH, MAX_MCP_SERVER_VERSION_LENGTH, MAX_MCP_TOOL_NAME_LENGTH, MAX_MCP_TOOLS_PER_CONNECTION, } from "../limitations.js";
|
|
4
5
|
import { atLeastOneFieldMessage, hasObjectKeys, hasUniqueValues, } from "../utils.js";
|
|
5
6
|
export const mcpConnectionAuthTypeSchema = z.enum([
|
|
@@ -77,6 +78,7 @@ const authTypeDescription = "How Blazing Agents authenticates to the MCP server:
|
|
|
77
78
|
export const mcpConnectionResponseSchema = z
|
|
78
79
|
.object({
|
|
79
80
|
id: mcpConnectionIdSchema,
|
|
81
|
+
tenantId: tenantIdSchema,
|
|
80
82
|
name: mcpConnectionNameSchema,
|
|
81
83
|
url: mcpConnectionUrlSchema,
|
|
82
84
|
authType: mcpConnectionAuthTypeSchema,
|
|
@@ -90,11 +92,7 @@ export const mcpConnectionResponseSchema = z
|
|
|
90
92
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
91
93
|
})
|
|
92
94
|
.strip();
|
|
93
|
-
export const mcpConnectionsResponseSchema =
|
|
94
|
-
.object({
|
|
95
|
-
mcpConnections: z.array(mcpConnectionResponseSchema),
|
|
96
|
-
})
|
|
97
|
-
.strip();
|
|
95
|
+
export const mcpConnectionsResponseSchema = listResponseSchema(mcpConnectionResponseSchema);
|
|
98
96
|
export const forwardedMetadataKeysSchema = z
|
|
99
97
|
.array(z.string().min(1).max(MAX_MCP_ATTACHMENT_METADATA_KEY_LENGTH))
|
|
100
98
|
.max(MAX_MCP_ATTACHMENT_METADATA_KEYS)
|
|
@@ -110,11 +108,7 @@ export const mcpAttachmentResponseSchema = z
|
|
|
110
108
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
111
109
|
})
|
|
112
110
|
.strip();
|
|
113
|
-
export const mcpAttachmentsResponseSchema =
|
|
114
|
-
.object({
|
|
115
|
-
mcpAttachments: z.array(mcpAttachmentResponseSchema),
|
|
116
|
-
})
|
|
117
|
-
.strip();
|
|
111
|
+
export const mcpAttachmentsResponseSchema = listResponseSchema(mcpAttachmentResponseSchema);
|
|
118
112
|
export const updateMcpAttachmentBodySchema = z
|
|
119
113
|
.object({
|
|
120
114
|
forwardUserId: z
|
|
@@ -10,18 +10,6 @@ export declare const memorySchema: z.ZodObject<{
|
|
|
10
10
|
updatedAt: z.ZodISODateTime;
|
|
11
11
|
lastAccessedAt: z.ZodISODateTime;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
|
-
export declare const memoryResponseSchema: z.ZodObject<{
|
|
14
|
-
memory: z.ZodObject<{
|
|
15
|
-
id: z.ZodString;
|
|
16
|
-
tenantId: z.ZodString;
|
|
17
|
-
agentId: z.ZodString;
|
|
18
|
-
userId: z.ZodString;
|
|
19
|
-
text: z.ZodString;
|
|
20
|
-
createdAt: z.ZodISODateTime;
|
|
21
|
-
updatedAt: z.ZodISODateTime;
|
|
22
|
-
lastAccessedAt: z.ZodISODateTime;
|
|
23
|
-
}, z.core.$strip>;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
13
|
export declare const memoriesListResponseSchema: z.ZodObject<{
|
|
26
14
|
data: z.ZodArray<z.ZodObject<{
|
|
27
15
|
id: z.ZodString;
|
|
@@ -43,7 +31,6 @@ export declare const updateMemoryBodySchema: z.ZodObject<{
|
|
|
43
31
|
text: z.ZodString;
|
|
44
32
|
}, z.core.$strict>;
|
|
45
33
|
export type Memory = z.infer<typeof memorySchema>;
|
|
46
|
-
export type MemoryResponse = z.infer<typeof memoryResponseSchema>;
|
|
47
34
|
export type MemoriesListResponse = z.infer<typeof memoriesListResponseSchema>;
|
|
48
35
|
export type CreateMemoryBody = z.input<typeof createMemoryBodySchema>;
|
|
49
36
|
export type UpdateMemoryBody = z.infer<typeof updateMemoryBodySchema>;
|
|
@@ -30,11 +30,6 @@ export const memorySchema = z
|
|
|
30
30
|
lastAccessedAt: z.iso.datetime({ offset: true }),
|
|
31
31
|
})
|
|
32
32
|
.strip();
|
|
33
|
-
export const memoryResponseSchema = z
|
|
34
|
-
.object({
|
|
35
|
-
memory: memorySchema,
|
|
36
|
-
})
|
|
37
|
-
.strip();
|
|
38
33
|
export const memoriesListResponseSchema = paginatedResponseSchema(memorySchema);
|
|
39
34
|
export const createMemoryBodySchema = z
|
|
40
35
|
.object({
|
|
@@ -20,6 +20,7 @@ export declare const merchantGuardSchema: z.ZodObject<{
|
|
|
20
20
|
export type MerchantGuard = z.infer<typeof merchantGuardSchema>;
|
|
21
21
|
export declare const merchantConnectionSchema: z.ZodObject<{
|
|
22
22
|
id: z.ZodString;
|
|
23
|
+
tenantId: z.ZodString;
|
|
23
24
|
provider: z.ZodEnum<{
|
|
24
25
|
dodo: "dodo";
|
|
25
26
|
polar: "polar";
|
|
@@ -40,9 +41,11 @@ export declare const merchantConnectionSchema: z.ZodObject<{
|
|
|
40
41
|
updatedAt: z.ZodISODateTime;
|
|
41
42
|
}, z.core.$strip>;
|
|
42
43
|
export type MerchantConnection = z.infer<typeof merchantConnectionSchema>;
|
|
44
|
+
/** `GET /v1/merchant-connection`: `connection` is `null` while none exists. */
|
|
43
45
|
export declare const merchantConnectionResponseSchema: z.ZodObject<{
|
|
44
46
|
connection: z.ZodNullable<z.ZodObject<{
|
|
45
47
|
id: z.ZodString;
|
|
48
|
+
tenantId: z.ZodString;
|
|
46
49
|
provider: z.ZodEnum<{
|
|
47
50
|
dodo: "dodo";
|
|
48
51
|
polar: "polar";
|
|
@@ -98,7 +101,7 @@ export declare const merchantCustomerBindingSchema: z.ZodObject<{
|
|
|
98
101
|
}, z.core.$strip>;
|
|
99
102
|
export type MerchantCustomerBinding = z.infer<typeof merchantCustomerBindingSchema>;
|
|
100
103
|
export declare const merchantBindingsResponseSchema: z.ZodObject<{
|
|
101
|
-
|
|
104
|
+
data: z.ZodArray<z.ZodObject<{
|
|
102
105
|
userId: z.ZodString;
|
|
103
106
|
customerId: z.ZodString;
|
|
104
107
|
createdAt: z.ZodISODateTime;
|
|
@@ -111,15 +114,6 @@ export declare const upsertMerchantBindingBodySchema: z.ZodObject<{
|
|
|
111
114
|
customerId: z.ZodString;
|
|
112
115
|
}, z.core.$strict>;
|
|
113
116
|
export type UpsertMerchantBindingBody = z.infer<typeof upsertMerchantBindingBodySchema>;
|
|
114
|
-
export declare const merchantBindingResponseSchema: z.ZodObject<{
|
|
115
|
-
binding: z.ZodObject<{
|
|
116
|
-
userId: z.ZodString;
|
|
117
|
-
customerId: z.ZodString;
|
|
118
|
-
createdAt: z.ZodISODateTime;
|
|
119
|
-
updatedAt: z.ZodISODateTime;
|
|
120
|
-
}, z.core.$strip>;
|
|
121
|
-
}, z.core.$strip>;
|
|
122
|
-
export type MerchantBindingResponse = z.infer<typeof merchantBindingResponseSchema>;
|
|
123
117
|
export declare const merchantUsageEventStatusSchema: z.ZodEnum<{
|
|
124
118
|
accepted: "accepted";
|
|
125
119
|
discarded: "discarded";
|
|
@@ -138,6 +132,7 @@ export declare const merchantUsageEventNextActionSchema: z.ZodEnum<{
|
|
|
138
132
|
}>;
|
|
139
133
|
export declare const merchantUsageEventSchema: z.ZodObject<{
|
|
140
134
|
id: z.ZodString;
|
|
135
|
+
tenantId: z.ZodString;
|
|
141
136
|
turnId: z.ZodString;
|
|
142
137
|
connectionId: z.ZodString;
|
|
143
138
|
provider: z.ZodEnum<{
|
|
@@ -190,65 +185,10 @@ export declare const merchantUsageEventSchema: z.ZodObject<{
|
|
|
190
185
|
}>;
|
|
191
186
|
}, z.core.$strip>;
|
|
192
187
|
export type MerchantUsageEvent = z.infer<typeof merchantUsageEventSchema>;
|
|
193
|
-
export declare const merchantUsageEventResponseSchema: z.ZodObject<{
|
|
194
|
-
event: z.ZodObject<{
|
|
195
|
-
id: z.ZodString;
|
|
196
|
-
turnId: z.ZodString;
|
|
197
|
-
connectionId: z.ZodString;
|
|
198
|
-
provider: z.ZodEnum<{
|
|
199
|
-
dodo: "dodo";
|
|
200
|
-
polar: "polar";
|
|
201
|
-
}>;
|
|
202
|
-
userId: z.ZodString;
|
|
203
|
-
customerId: z.ZodNullable<z.ZodString>;
|
|
204
|
-
agentId: z.ZodString;
|
|
205
|
-
sessionId: z.ZodNullable<z.ZodString>;
|
|
206
|
-
model: z.ZodString;
|
|
207
|
-
modelProvider: z.ZodEnum<{
|
|
208
|
-
anthropic: "anthropic";
|
|
209
|
-
custom: "custom";
|
|
210
|
-
google: "google";
|
|
211
|
-
openai: "openai";
|
|
212
|
-
openrouter: "openrouter";
|
|
213
|
-
vercel_ai_gateway: "vercel_ai_gateway";
|
|
214
|
-
}>;
|
|
215
|
-
inputTokens: z.ZodNumber;
|
|
216
|
-
outputTokens: z.ZodNumber;
|
|
217
|
-
totalTokens: z.ZodNumber;
|
|
218
|
-
turnStatus: z.ZodEnum<{
|
|
219
|
-
cancelled: "cancelled";
|
|
220
|
-
failed: "failed";
|
|
221
|
-
succeeded: "succeeded";
|
|
222
|
-
}>;
|
|
223
|
-
startedAt: z.ZodISODateTime;
|
|
224
|
-
occurredAt: z.ZodISODateTime;
|
|
225
|
-
status: z.ZodEnum<{
|
|
226
|
-
accepted: "accepted";
|
|
227
|
-
discarded: "discarded";
|
|
228
|
-
expired: "expired";
|
|
229
|
-
failed: "failed";
|
|
230
|
-
incomplete: "incomplete";
|
|
231
|
-
pending: "pending";
|
|
232
|
-
}>;
|
|
233
|
-
payload: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
234
|
-
attemptCount: z.ZodNumber;
|
|
235
|
-
attemptGeneration: z.ZodNumber;
|
|
236
|
-
lastAttemptAt: z.ZodNullable<z.ZodISODateTime>;
|
|
237
|
-
lastErrorCode: z.ZodNullable<z.ZodString>;
|
|
238
|
-
acceptedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
239
|
-
nextAction: z.ZodEnum<{
|
|
240
|
-
discard: "discard";
|
|
241
|
-
investigate: "investigate";
|
|
242
|
-
none: "none";
|
|
243
|
-
retry: "retry";
|
|
244
|
-
wait: "wait";
|
|
245
|
-
}>;
|
|
246
|
-
}, z.core.$strip>;
|
|
247
|
-
}, z.core.$strip>;
|
|
248
|
-
export type MerchantUsageEventResponse = z.infer<typeof merchantUsageEventResponseSchema>;
|
|
249
188
|
export declare const merchantUsageEventsResponseSchema: z.ZodObject<{
|
|
250
|
-
|
|
189
|
+
data: z.ZodArray<z.ZodObject<{
|
|
251
190
|
id: z.ZodString;
|
|
191
|
+
tenantId: z.ZodString;
|
|
252
192
|
turnId: z.ZodString;
|
|
253
193
|
connectionId: z.ZodString;
|
|
254
194
|
provider: z.ZodEnum<{
|
|
@@ -344,27 +284,6 @@ export type MerchantUsageSummary = z.infer<typeof merchantUsageSummarySchema>;
|
|
|
344
284
|
export declare const merchantUsageSummaryQuerySchema: z.ZodObject<{
|
|
345
285
|
days: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
346
286
|
}, z.core.$strict>;
|
|
347
|
-
export declare const merchantUsageSummaryResponseSchema: z.ZodObject<{
|
|
348
|
-
summary: z.ZodObject<{
|
|
349
|
-
counts: z.ZodObject<{
|
|
350
|
-
pending: z.ZodNumber;
|
|
351
|
-
accepted: z.ZodNumber;
|
|
352
|
-
failed: z.ZodNumber;
|
|
353
|
-
incomplete: z.ZodNumber;
|
|
354
|
-
expired: z.ZodNumber;
|
|
355
|
-
discarded: z.ZodNumber;
|
|
356
|
-
}, z.core.$strict>;
|
|
357
|
-
lastAcceptedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
358
|
-
oldestPendingOccurredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
359
|
-
daily: z.ZodArray<z.ZodObject<{
|
|
360
|
-
day: z.ZodISODate;
|
|
361
|
-
acceptedEvents: z.ZodNumber;
|
|
362
|
-
acceptedTokens: z.ZodNumber;
|
|
363
|
-
pendingEvents: z.ZodNumber;
|
|
364
|
-
}, z.core.$strict>>;
|
|
365
|
-
}, z.core.$strict>;
|
|
366
|
-
}, z.core.$strip>;
|
|
367
|
-
export type MerchantUsageSummaryResponse = z.infer<typeof merchantUsageSummaryResponseSchema>;
|
|
368
287
|
/**
|
|
369
288
|
* The action a Tenant takes on an event. `automaticDeliveryStopped` is true
|
|
370
289
|
* when the delivery of a `pending` event stopped. Blazing Agents retries it on
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { paginatedResponseSchema } from "../api.js";
|
|
3
|
+
import { agentIdSchema, merchantConnectionIdSchema, merchantUsageEventIdSchema, providerKeyFragmentSchema, sessionIdSchema, tenantIdSchema, turnIdSchema, } from "../ids.js";
|
|
3
4
|
import { DEFAULT_MERCHANT_USAGE_SUMMARY_DAYS, MAX_MERCHANT_PRODUCT_IDS, MAX_MERCHANT_USAGE_SUMMARY_DAYS, } from "../limitations.js";
|
|
4
5
|
import { hasUniqueValues } from "../utils.js";
|
|
5
6
|
import { userIdSchema } from "./attribution.js";
|
|
@@ -28,6 +29,7 @@ export const merchantGuardSchema = z
|
|
|
28
29
|
export const merchantConnectionSchema = z
|
|
29
30
|
.object({
|
|
30
31
|
id: merchantConnectionIdSchema,
|
|
32
|
+
tenantId: tenantIdSchema,
|
|
31
33
|
provider: merchantProviderSchema,
|
|
32
34
|
environment: merchantEnvironmentSchema,
|
|
33
35
|
merchantAccountId: z.string().min(1),
|
|
@@ -38,6 +40,7 @@ export const merchantConnectionSchema = z
|
|
|
38
40
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
39
41
|
})
|
|
40
42
|
.strip();
|
|
43
|
+
/** `GET /v1/merchant-connection`: `connection` is `null` while none exists. */
|
|
41
44
|
export const merchantConnectionResponseSchema = z
|
|
42
45
|
.object({ connection: merchantConnectionSchema.nullable() })
|
|
43
46
|
.strip();
|
|
@@ -74,12 +77,7 @@ export const merchantCustomerBindingSchema = z
|
|
|
74
77
|
updatedAt: z.iso.datetime({ offset: true }),
|
|
75
78
|
})
|
|
76
79
|
.strip();
|
|
77
|
-
export const merchantBindingsResponseSchema =
|
|
78
|
-
.object({
|
|
79
|
-
bindings: z.array(merchantCustomerBindingSchema),
|
|
80
|
-
nextCursor: z.string().nullable(),
|
|
81
|
-
})
|
|
82
|
-
.strip();
|
|
80
|
+
export const merchantBindingsResponseSchema = paginatedResponseSchema(merchantCustomerBindingSchema);
|
|
83
81
|
export const upsertMerchantBindingBodySchema = z
|
|
84
82
|
.object({
|
|
85
83
|
customerId: z
|
|
@@ -88,9 +86,6 @@ export const upsertMerchantBindingBodySchema = z
|
|
|
88
86
|
.describe("The ID of the customer in your billing provider."),
|
|
89
87
|
})
|
|
90
88
|
.strict();
|
|
91
|
-
export const merchantBindingResponseSchema = z
|
|
92
|
-
.object({ binding: merchantCustomerBindingSchema })
|
|
93
|
-
.strip();
|
|
94
89
|
export const merchantUsageEventStatusSchema = z.enum([
|
|
95
90
|
"pending",
|
|
96
91
|
"accepted",
|
|
@@ -109,6 +104,7 @@ export const merchantUsageEventNextActionSchema = z.enum([
|
|
|
109
104
|
export const merchantUsageEventSchema = z
|
|
110
105
|
.object({
|
|
111
106
|
id: merchantUsageEventIdSchema,
|
|
107
|
+
tenantId: tenantIdSchema,
|
|
112
108
|
turnId: turnIdSchema,
|
|
113
109
|
connectionId: merchantConnectionIdSchema,
|
|
114
110
|
provider: merchantProviderSchema,
|
|
@@ -134,15 +130,7 @@ export const merchantUsageEventSchema = z
|
|
|
134
130
|
nextAction: merchantUsageEventNextActionSchema,
|
|
135
131
|
})
|
|
136
132
|
.strip();
|
|
137
|
-
export const
|
|
138
|
-
.object({ event: merchantUsageEventSchema })
|
|
139
|
-
.strip();
|
|
140
|
-
export const merchantUsageEventsResponseSchema = z
|
|
141
|
-
.object({
|
|
142
|
-
events: z.array(merchantUsageEventSchema),
|
|
143
|
-
nextCursor: z.string().nullable(),
|
|
144
|
-
})
|
|
145
|
-
.strip();
|
|
133
|
+
export const merchantUsageEventsResponseSchema = paginatedResponseSchema(merchantUsageEventSchema);
|
|
146
134
|
/**
|
|
147
135
|
* Delivery-health aggregate behind `GET /v1/merchant-usage-events/summary` —
|
|
148
136
|
* all-time status counts plus a UTC daily window so a dashboard can show
|
|
@@ -185,9 +173,6 @@ export const merchantUsageSummaryQuerySchema = z
|
|
|
185
173
|
.describe(`UTC days in the \`daily\` series, ending today, from 1 to ${MAX_MERCHANT_USAGE_SUMMARY_DAYS}.`),
|
|
186
174
|
})
|
|
187
175
|
.strict();
|
|
188
|
-
export const merchantUsageSummaryResponseSchema = z
|
|
189
|
-
.object({ summary: merchantUsageSummarySchema })
|
|
190
|
-
.strip();
|
|
191
176
|
/**
|
|
192
177
|
* The action a Tenant takes on an event. `automaticDeliveryStopped` is true
|
|
193
178
|
* when the delivery of a `pending` event stopped. Blazing Agents retries it on
|
|
@@ -14,11 +14,12 @@ export declare const providerTypeSchema: z.ZodEnum<{
|
|
|
14
14
|
}>;
|
|
15
15
|
export type ProviderType = z.infer<typeof providerTypeSchema>;
|
|
16
16
|
/**
|
|
17
|
-
* `GET /v1/providers/{
|
|
18
|
-
*
|
|
17
|
+
* `GET /v1/providers/{providerId}` wire response. The Vault pointer stays
|
|
18
|
+
* internal.
|
|
19
19
|
*/
|
|
20
20
|
export declare const providerResponseSchema: z.ZodObject<{
|
|
21
21
|
id: z.ZodString;
|
|
22
|
+
tenantId: z.ZodString;
|
|
22
23
|
name: z.ZodString;
|
|
23
24
|
providerType: z.ZodEnum<{
|
|
24
25
|
anthropic: "anthropic";
|
|
@@ -35,6 +36,7 @@ export declare const providerResponseSchema: z.ZodObject<{
|
|
|
35
36
|
}, z.core.$strip>;
|
|
36
37
|
export declare const providerListItemSchema: z.ZodObject<{
|
|
37
38
|
id: z.ZodString;
|
|
39
|
+
tenantId: z.ZodString;
|
|
38
40
|
name: z.ZodString;
|
|
39
41
|
providerType: z.ZodEnum<{
|
|
40
42
|
anthropic: "anthropic";
|
|
@@ -49,8 +51,9 @@ export declare const providerListItemSchema: z.ZodObject<{
|
|
|
49
51
|
}, z.core.$strip>;
|
|
50
52
|
export type ProviderListItem = z.infer<typeof providerListItemSchema>;
|
|
51
53
|
export declare const providersResponseSchema: z.ZodObject<{
|
|
52
|
-
|
|
54
|
+
data: z.ZodArray<z.ZodObject<{
|
|
53
55
|
id: z.ZodString;
|
|
56
|
+
tenantId: z.ZodString;
|
|
54
57
|
name: z.ZodString;
|
|
55
58
|
providerType: z.ZodEnum<{
|
|
56
59
|
anthropic: "anthropic";
|
|
@@ -65,7 +68,7 @@ export declare const providersResponseSchema: z.ZodObject<{
|
|
|
65
68
|
}, z.core.$strip>>;
|
|
66
69
|
}, z.core.$strip>;
|
|
67
70
|
export declare const providerModelsResponseSchema: z.ZodObject<{
|
|
68
|
-
|
|
71
|
+
data: z.ZodArray<z.ZodObject<{
|
|
69
72
|
id: z.ZodString;
|
|
70
73
|
}, z.core.$strip>>;
|
|
71
74
|
}, z.core.$strip>;
|
|
@@ -94,7 +97,7 @@ export declare const updateProviderBodySchema: z.ZodObject<{
|
|
|
94
97
|
}, z.core.$strict>;
|
|
95
98
|
export type ProvidersResponse = z.infer<typeof providersResponseSchema>;
|
|
96
99
|
export type ProviderModelsResponse = z.infer<typeof providerModelsResponseSchema>;
|
|
97
|
-
export type ProviderModel = ProviderModelsResponse["
|
|
100
|
+
export type ProviderModel = ProviderModelsResponse["data"][number];
|
|
98
101
|
export interface DeleteProviderOptions {
|
|
99
102
|
confirmSnapshotInvalidation?: boolean;
|
|
100
103
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { listResponseSchema } from "../api.js";
|
|
3
|
+
import { providerIdSchema, providerKeyFragmentSchema, tenantIdSchema, } from "../ids.js";
|
|
3
4
|
import { MAX_PROVIDER_NAME_LENGTH } from "../limitations.js";
|
|
4
5
|
/**
|
|
5
6
|
* Provider type — the enum of model providers we support. Selects catalog
|
|
@@ -21,12 +22,13 @@ const providerNameSchema = z
|
|
|
21
22
|
.max(MAX_PROVIDER_NAME_LENGTH);
|
|
22
23
|
const providerBaseUrlSchema = z.string().trim().min(1).url().or(z.literal(""));
|
|
23
24
|
/**
|
|
24
|
-
* `GET /v1/providers/{
|
|
25
|
-
*
|
|
25
|
+
* `GET /v1/providers/{providerId}` wire response. The Vault pointer stays
|
|
26
|
+
* internal.
|
|
26
27
|
*/
|
|
27
28
|
export const providerResponseSchema = z
|
|
28
29
|
.object({
|
|
29
30
|
id: providerIdSchema,
|
|
31
|
+
tenantId: tenantIdSchema,
|
|
30
32
|
name: providerNameSchema,
|
|
31
33
|
providerType: providerTypeSchema,
|
|
32
34
|
baseUrl: z.string().nullable(),
|
|
@@ -39,21 +41,8 @@ export const providerListItemSchema = providerResponseSchema.omit({
|
|
|
39
41
|
baseUrl: true,
|
|
40
42
|
keyFragment: true,
|
|
41
43
|
});
|
|
42
|
-
export const providersResponseSchema =
|
|
43
|
-
|
|
44
|
-
providers: z.array(providerListItemSchema),
|
|
45
|
-
})
|
|
46
|
-
.strip();
|
|
47
|
-
export const providerModelsResponseSchema = z
|
|
48
|
-
.object({
|
|
49
|
-
models: z.array(z
|
|
50
|
-
.object({
|
|
51
|
-
id: z.string().trim().min(1),
|
|
52
|
-
})
|
|
53
|
-
.strip()),
|
|
54
|
-
})
|
|
55
|
-
.strip()
|
|
56
|
-
.meta({ id: "ProviderModelList" });
|
|
44
|
+
export const providersResponseSchema = listResponseSchema(providerListItemSchema);
|
|
45
|
+
export const providerModelsResponseSchema = listResponseSchema(z.object({ id: z.string().trim().min(1) }).strip()).meta({ id: "ProviderModelList" });
|
|
57
46
|
/**
|
|
58
47
|
* `POST /v1/providers` — name, type, optional base URL, and the API key
|
|
59
48
|
* (plaintext, never stored — goes to Vault). `custom` providers require a
|
|
@@ -41,7 +41,7 @@ export declare const sessionActivitySchema: z.ZodObject<{
|
|
|
41
41
|
turnId: z.ZodNullable<z.ZodString>;
|
|
42
42
|
}, z.core.$strip>;
|
|
43
43
|
export declare const sessionInputResponseSchema: z.ZodObject<{
|
|
44
|
-
|
|
44
|
+
input: z.ZodObject<{
|
|
45
45
|
requestId: z.ZodString;
|
|
46
46
|
sequence: z.ZodNumber;
|
|
47
47
|
message: z.ZodObject<{
|