@blazingagents/sdk 0.43.1 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contracts/api.d.ts +0 -1
- package/dist/contracts/api.js +0 -1
- package/dist/contracts/entities/agent-approval.d.ts +3 -0
- package/dist/contracts/entities/agent-tools.d.ts +7 -2
- package/dist/contracts/entities/agent-tools.js +7 -1
- package/dist/contracts/entities/agents.d.ts +16 -0
- package/dist/contracts/entities/attribution.d.ts +1 -1
- package/dist/contracts/entities/attribution.js +1 -1
- package/dist/contracts/entities/chat.d.ts +2 -2
- package/dist/contracts/entities/chat.js +2 -1
- package/dist/contracts/entities/mcp-connections.d.ts +0 -18
- package/dist/contracts/entities/mcp-connections.js +4 -20
- package/dist/contracts/entities/sessions.d.ts +6 -1
- package/dist/contracts/entities/tasks.d.ts +9 -3
- package/dist/contracts/entities/tasks.js +4 -4
- package/dist/contracts/entities/tenants.d.ts +0 -25
- package/dist/contracts/entities/tenants.js +1 -22
- package/dist/contracts/index.d.ts +2 -2
- package/dist/contracts/index.js +1 -1
- package/dist/contracts/limitations.d.ts +0 -2
- package/dist/contracts/limitations.js +0 -3
- package/dist/generation.js +13 -2
- package/dist/resources/tenant.d.ts +1 -2
- package/dist/resources/tenant.js +1 -2
- package/package.json +1 -1
package/dist/contracts/api.d.ts
CHANGED
|
@@ -60,7 +60,6 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
|
60
60
|
provider_name_conflict: "provider_name_conflict";
|
|
61
61
|
provider_not_found: "provider_not_found";
|
|
62
62
|
provider_required: "provider_required";
|
|
63
|
-
quota_exceeded: "quota_exceeded";
|
|
64
63
|
rate_limited: "rate_limited";
|
|
65
64
|
service_unavailable: "service_unavailable";
|
|
66
65
|
session_busy: "session_busy";
|
package/dist/contracts/api.js
CHANGED
|
@@ -20,6 +20,7 @@ export declare const toolReferenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
20
20
|
save_memory: "save_memory";
|
|
21
21
|
search_memories: "search_memories";
|
|
22
22
|
update_memory: "update_memory";
|
|
23
|
+
web_fetch: "web_fetch";
|
|
23
24
|
web_search: "web_search";
|
|
24
25
|
write: "write";
|
|
25
26
|
write_todos: "write_todos";
|
|
@@ -49,6 +50,7 @@ export declare const toolExecutionReferenceSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
49
50
|
save_memory: "save_memory";
|
|
50
51
|
search_memories: "search_memories";
|
|
51
52
|
update_memory: "update_memory";
|
|
53
|
+
web_fetch: "web_fetch";
|
|
52
54
|
web_search: "web_search";
|
|
53
55
|
write: "write";
|
|
54
56
|
write_todos: "write_todos";
|
|
@@ -84,6 +86,7 @@ export declare const approvalPolicySchema: z.ZodObject<{
|
|
|
84
86
|
save_memory: "save_memory";
|
|
85
87
|
search_memories: "search_memories";
|
|
86
88
|
update_memory: "update_memory";
|
|
89
|
+
web_fetch: "web_fetch";
|
|
87
90
|
web_search: "web_search";
|
|
88
91
|
write: "write";
|
|
89
92
|
write_todos: "write_todos";
|
|
@@ -20,7 +20,7 @@ export declare const AGENT_TOOL_GROUPS: readonly [{
|
|
|
20
20
|
}, {
|
|
21
21
|
readonly tag: "web";
|
|
22
22
|
readonly name: "Web";
|
|
23
|
-
readonly description: "Search the public web
|
|
23
|
+
readonly description: "Search the public web and read pages by URL.";
|
|
24
24
|
}];
|
|
25
25
|
export type AgentToolGroupTag = (typeof AGENT_TOOL_GROUPS)[number]["tag"];
|
|
26
26
|
/**
|
|
@@ -114,6 +114,11 @@ declare const CATALOG: readonly [{
|
|
|
114
114
|
readonly tags: readonly ["web"];
|
|
115
115
|
readonly requiresWorkspace: false;
|
|
116
116
|
readonly description: "Search the public web for current results. Each search consumes Usage credit.";
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "web_fetch";
|
|
119
|
+
readonly tags: readonly ["web"];
|
|
120
|
+
readonly requiresWorkspace: false;
|
|
121
|
+
readonly description: "Read a public web page or text document by URL, returned as markdown.";
|
|
117
122
|
}];
|
|
118
123
|
export type AgentToolName = (typeof CATALOG)[number]["name"];
|
|
119
124
|
/** Declared rather than inferred, so `tool.tags.includes(tag)` accepts any tag. */
|
|
@@ -122,7 +127,7 @@ export declare const AGENT_TOOLS: readonly (AgentToolDefinition & {
|
|
|
122
127
|
})[];
|
|
123
128
|
export declare const agentToolNames: readonly AgentToolName[];
|
|
124
129
|
/** Built-in tool names an approval policy can reference. */
|
|
125
|
-
export declare const builtinToolNames: readonly [...("bash" | "delete_memory" | "edit" | "get_memory" | "glob" | "grep" | "publish_artifacts" | "read" | "save_memory" | "search_memories" | "update_memory" | "web_search" | "write" | "write_todos")[], "activate_skill"];
|
|
130
|
+
export declare const builtinToolNames: readonly [...("bash" | "delete_memory" | "edit" | "get_memory" | "glob" | "grep" | "publish_artifacts" | "read" | "save_memory" | "search_memories" | "update_memory" | "web_fetch" | "web_search" | "write" | "write_todos")[], "activate_skill"];
|
|
126
131
|
/**
|
|
127
132
|
* A model-facing tool name. Built-in tool names and the `mcp__` prefix used
|
|
128
133
|
* for MCP tools are reserved so a caller function never shadows them.
|
|
@@ -24,7 +24,7 @@ export const AGENT_TOOL_GROUPS = [
|
|
|
24
24
|
{
|
|
25
25
|
tag: "web",
|
|
26
26
|
name: "Web",
|
|
27
|
-
description: "Search the public web
|
|
27
|
+
description: "Search the public web and read pages by URL.",
|
|
28
28
|
},
|
|
29
29
|
];
|
|
30
30
|
/**
|
|
@@ -126,6 +126,12 @@ const CATALOG = [
|
|
|
126
126
|
requiresWorkspace: false,
|
|
127
127
|
description: "Search the public web for current results. Each search consumes Usage credit.",
|
|
128
128
|
},
|
|
129
|
+
{
|
|
130
|
+
name: "web_fetch",
|
|
131
|
+
tags: ["web"],
|
|
132
|
+
requiresWorkspace: false,
|
|
133
|
+
description: "Read a public web page or text document by URL, returned as markdown.",
|
|
134
|
+
},
|
|
129
135
|
];
|
|
130
136
|
/** Declared rather than inferred, so `tool.tags.includes(tag)` accepts any tag. */
|
|
131
137
|
export const AGENT_TOOLS = CATALOG;
|
|
@@ -14,6 +14,7 @@ export declare const agentToolsSchema: z.ZodArray<z.ZodEnum<{
|
|
|
14
14
|
save_memory: "save_memory";
|
|
15
15
|
search_memories: "search_memories";
|
|
16
16
|
update_memory: "update_memory";
|
|
17
|
+
web_fetch: "web_fetch";
|
|
17
18
|
web_search: "web_search";
|
|
18
19
|
write: "write";
|
|
19
20
|
write_todos: "write_todos";
|
|
@@ -47,6 +48,7 @@ export declare const agentResponseSchema: z.ZodObject<{
|
|
|
47
48
|
save_memory: "save_memory";
|
|
48
49
|
search_memories: "search_memories";
|
|
49
50
|
update_memory: "update_memory";
|
|
51
|
+
web_fetch: "web_fetch";
|
|
50
52
|
web_search: "web_search";
|
|
51
53
|
write: "write";
|
|
52
54
|
write_todos: "write_todos";
|
|
@@ -87,6 +89,7 @@ export declare const agentResponseSchema: z.ZodObject<{
|
|
|
87
89
|
save_memory: "save_memory";
|
|
88
90
|
search_memories: "search_memories";
|
|
89
91
|
update_memory: "update_memory";
|
|
92
|
+
web_fetch: "web_fetch";
|
|
90
93
|
web_search: "web_search";
|
|
91
94
|
write: "write";
|
|
92
95
|
write_todos: "write_todos";
|
|
@@ -126,6 +129,7 @@ export declare const agentResponseSchema: z.ZodObject<{
|
|
|
126
129
|
save_memory: "save_memory";
|
|
127
130
|
search_memories: "search_memories";
|
|
128
131
|
update_memory: "update_memory";
|
|
132
|
+
web_fetch: "web_fetch";
|
|
129
133
|
web_search: "web_search";
|
|
130
134
|
write: "write";
|
|
131
135
|
write_todos: "write_todos";
|
|
@@ -167,6 +171,7 @@ export declare const agentsResponseSchema: z.ZodObject<{
|
|
|
167
171
|
save_memory: "save_memory";
|
|
168
172
|
search_memories: "search_memories";
|
|
169
173
|
update_memory: "update_memory";
|
|
174
|
+
web_fetch: "web_fetch";
|
|
170
175
|
web_search: "web_search";
|
|
171
176
|
write: "write";
|
|
172
177
|
write_todos: "write_todos";
|
|
@@ -207,6 +212,7 @@ export declare const agentsResponseSchema: z.ZodObject<{
|
|
|
207
212
|
save_memory: "save_memory";
|
|
208
213
|
search_memories: "search_memories";
|
|
209
214
|
update_memory: "update_memory";
|
|
215
|
+
web_fetch: "web_fetch";
|
|
210
216
|
web_search: "web_search";
|
|
211
217
|
write: "write";
|
|
212
218
|
write_todos: "write_todos";
|
|
@@ -246,6 +252,7 @@ export declare const agentsResponseSchema: z.ZodObject<{
|
|
|
246
252
|
save_memory: "save_memory";
|
|
247
253
|
search_memories: "search_memories";
|
|
248
254
|
update_memory: "update_memory";
|
|
255
|
+
web_fetch: "web_fetch";
|
|
249
256
|
web_search: "web_search";
|
|
250
257
|
write: "write";
|
|
251
258
|
write_todos: "write_todos";
|
|
@@ -294,6 +301,7 @@ export declare const agentConfigSchema: z.ZodObject<{
|
|
|
294
301
|
save_memory: "save_memory";
|
|
295
302
|
search_memories: "search_memories";
|
|
296
303
|
update_memory: "update_memory";
|
|
304
|
+
web_fetch: "web_fetch";
|
|
297
305
|
web_search: "web_search";
|
|
298
306
|
write: "write";
|
|
299
307
|
write_todos: "write_todos";
|
|
@@ -334,6 +342,7 @@ export declare const agentConfigSchema: z.ZodObject<{
|
|
|
334
342
|
save_memory: "save_memory";
|
|
335
343
|
search_memories: "search_memories";
|
|
336
344
|
update_memory: "update_memory";
|
|
345
|
+
web_fetch: "web_fetch";
|
|
337
346
|
web_search: "web_search";
|
|
338
347
|
write: "write";
|
|
339
348
|
write_todos: "write_todos";
|
|
@@ -370,6 +379,7 @@ export declare const agentConfigSchema: z.ZodObject<{
|
|
|
370
379
|
save_memory: "save_memory";
|
|
371
380
|
search_memories: "search_memories";
|
|
372
381
|
update_memory: "update_memory";
|
|
382
|
+
web_fetch: "web_fetch";
|
|
373
383
|
web_search: "web_search";
|
|
374
384
|
write: "write";
|
|
375
385
|
write_todos: "write_todos";
|
|
@@ -406,6 +416,7 @@ export declare const createAgentBodySchema: z.ZodObject<{
|
|
|
406
416
|
save_memory: "save_memory";
|
|
407
417
|
search_memories: "search_memories";
|
|
408
418
|
update_memory: "update_memory";
|
|
419
|
+
web_fetch: "web_fetch";
|
|
409
420
|
web_search: "web_search";
|
|
410
421
|
write: "write";
|
|
411
422
|
write_todos: "write_todos";
|
|
@@ -446,6 +457,7 @@ export declare const createAgentBodySchema: z.ZodObject<{
|
|
|
446
457
|
save_memory: "save_memory";
|
|
447
458
|
search_memories: "search_memories";
|
|
448
459
|
update_memory: "update_memory";
|
|
460
|
+
web_fetch: "web_fetch";
|
|
449
461
|
web_search: "web_search";
|
|
450
462
|
write: "write";
|
|
451
463
|
write_todos: "write_todos";
|
|
@@ -483,6 +495,7 @@ export declare const createAgentBodySchema: z.ZodObject<{
|
|
|
483
495
|
save_memory: "save_memory";
|
|
484
496
|
search_memories: "search_memories";
|
|
485
497
|
update_memory: "update_memory";
|
|
498
|
+
web_fetch: "web_fetch";
|
|
486
499
|
web_search: "web_search";
|
|
487
500
|
write: "write";
|
|
488
501
|
write_todos: "write_todos";
|
|
@@ -516,6 +529,7 @@ export declare const updateAgentBodySchema: z.ZodObject<{
|
|
|
516
529
|
save_memory: "save_memory";
|
|
517
530
|
search_memories: "search_memories";
|
|
518
531
|
update_memory: "update_memory";
|
|
532
|
+
web_fetch: "web_fetch";
|
|
519
533
|
web_search: "web_search";
|
|
520
534
|
write: "write";
|
|
521
535
|
write_todos: "write_todos";
|
|
@@ -556,6 +570,7 @@ export declare const updateAgentBodySchema: z.ZodObject<{
|
|
|
556
570
|
save_memory: "save_memory";
|
|
557
571
|
search_memories: "search_memories";
|
|
558
572
|
update_memory: "update_memory";
|
|
573
|
+
web_fetch: "web_fetch";
|
|
559
574
|
web_search: "web_search";
|
|
560
575
|
write: "write";
|
|
561
576
|
write_todos: "write_todos";
|
|
@@ -593,6 +608,7 @@ export declare const updateAgentBodySchema: z.ZodObject<{
|
|
|
593
608
|
save_memory: "save_memory";
|
|
594
609
|
search_memories: "search_memories";
|
|
595
610
|
update_memory: "update_memory";
|
|
611
|
+
web_fetch: "web_fetch";
|
|
596
612
|
web_search: "web_search";
|
|
597
613
|
write: "write";
|
|
598
614
|
write_todos: "write_todos";
|
|
@@ -4,7 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
* tenant-owned product resource (ADR-0001). `userId` is an opaque
|
|
5
5
|
* tenant-chosen string (`''` = tenant-level, immutable after creation);
|
|
6
6
|
* `metadata` is a mutable jsonb object. Neither is ever on tenant config
|
|
7
|
-
* (apikeys, providers
|
|
7
|
+
* (apikeys, providers).
|
|
8
8
|
*
|
|
9
9
|
* These are the shared zod primitives every attributed entity reuses so the
|
|
10
10
|
* two fields stay shape-identical across agents, Workspaces, prompts,
|
|
@@ -4,7 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
* tenant-owned product resource (ADR-0001). `userId` is an opaque
|
|
5
5
|
* tenant-chosen string (`''` = tenant-level, immutable after creation);
|
|
6
6
|
* `metadata` is a mutable jsonb object. Neither is ever on tenant config
|
|
7
|
-
* (apikeys, providers
|
|
7
|
+
* (apikeys, providers).
|
|
8
8
|
*
|
|
9
9
|
* These are the shared zod primitives every attributed entity reuses so the
|
|
10
10
|
* two fields stay shape-identical across agents, Workspaces, prompts,
|
|
@@ -30,7 +30,7 @@ export declare const usageSummarySchema: z.ZodObject<{
|
|
|
30
30
|
outputTokens: z.ZodNumber;
|
|
31
31
|
reasoningTokens: z.ZodNullable<z.ZodNumber>;
|
|
32
32
|
turnId: z.ZodString;
|
|
33
|
-
sessionId: z.
|
|
33
|
+
sessionId: z.ZodNullable<z.ZodString>;
|
|
34
34
|
stepUsages: z.ZodArray<z.ZodObject<{
|
|
35
35
|
inputTokens: z.ZodNumber;
|
|
36
36
|
outputTokens: z.ZodNumber;
|
|
@@ -62,7 +62,7 @@ export declare const blazingAgentsChatMessageMetadataSchema: z.ZodObject<{
|
|
|
62
62
|
outputTokens: z.ZodNumber;
|
|
63
63
|
reasoningTokens: z.ZodNullable<z.ZodNumber>;
|
|
64
64
|
turnId: z.ZodString;
|
|
65
|
-
sessionId: z.
|
|
65
|
+
sessionId: z.ZodNullable<z.ZodString>;
|
|
66
66
|
stepUsages: z.ZodArray<z.ZodObject<{
|
|
67
67
|
inputTokens: z.ZodNumber;
|
|
68
68
|
outputTokens: z.ZodNumber;
|
|
@@ -37,7 +37,8 @@ export const usageSummarySchema = z
|
|
|
37
37
|
outputTokens: z.number().int().min(0),
|
|
38
38
|
reasoningTokens: z.number().int().min(0).nullable(),
|
|
39
39
|
turnId: turnIdSchema,
|
|
40
|
-
|
|
40
|
+
/** Null for a stateless generation, which has no Session. */
|
|
41
|
+
sessionId: sessionIdSchema.nullable(),
|
|
41
42
|
stepUsages: z.array(z
|
|
42
43
|
.object({
|
|
43
44
|
inputTokens: z.number().int().min(0),
|
|
@@ -3,7 +3,6 @@ export declare const mcpConnectionAuthTypeSchema: z.ZodEnum<{
|
|
|
3
3
|
bearer: "bearer";
|
|
4
4
|
none: "none";
|
|
5
5
|
oauth_authorization_code: "oauth_authorization_code";
|
|
6
|
-
oauth_client_credentials: "oauth_client_credentials";
|
|
7
6
|
}>;
|
|
8
7
|
export declare const mcpConnectionStatusSchema: z.ZodEnum<{
|
|
9
8
|
connected: "connected";
|
|
@@ -24,7 +23,6 @@ export declare const mcpConnectionResponseSchema: z.ZodObject<{
|
|
|
24
23
|
bearer: "bearer";
|
|
25
24
|
none: "none";
|
|
26
25
|
oauth_authorization_code: "oauth_authorization_code";
|
|
27
|
-
oauth_client_credentials: "oauth_client_credentials";
|
|
28
26
|
}>;
|
|
29
27
|
status: z.ZodEnum<{
|
|
30
28
|
connected: "connected";
|
|
@@ -53,7 +51,6 @@ export declare const mcpConnectionsResponseSchema: z.ZodObject<{
|
|
|
53
51
|
bearer: "bearer";
|
|
54
52
|
none: "none";
|
|
55
53
|
oauth_authorization_code: "oauth_authorization_code";
|
|
56
|
-
oauth_client_credentials: "oauth_client_credentials";
|
|
57
54
|
}>;
|
|
58
55
|
status: z.ZodEnum<{
|
|
59
56
|
connected: "connected";
|
|
@@ -111,13 +108,6 @@ export declare const createMcpConnectionBodySchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
111
108
|
scope: z.ZodOptional<z.ZodString>;
|
|
112
109
|
url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
113
110
|
name: z.ZodString;
|
|
114
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
115
|
-
authType: z.ZodLiteral<"oauth_client_credentials">;
|
|
116
|
-
clientId: z.ZodString;
|
|
117
|
-
clientSecret: z.ZodString;
|
|
118
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
119
|
-
url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
120
|
-
name: z.ZodString;
|
|
121
111
|
}, z.core.$strict>], "authType">;
|
|
122
112
|
export declare const updateMcpConnectionBodySchema: z.ZodObject<{
|
|
123
113
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -135,12 +125,6 @@ export declare const reconnectMcpConnectionBodySchema: z.ZodDiscriminatedUnion<[
|
|
|
135
125
|
clientSecret: z.ZodOptional<z.ZodString>;
|
|
136
126
|
scope: z.ZodOptional<z.ZodString>;
|
|
137
127
|
url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
138
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
139
|
-
authType: z.ZodLiteral<"oauth_client_credentials">;
|
|
140
|
-
clientId: z.ZodString;
|
|
141
|
-
clientSecret: z.ZodString;
|
|
142
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
143
|
-
url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
144
128
|
}, z.core.$strict>], "authType">;
|
|
145
129
|
export declare const mcpOauthAuthorizationLaunchResponseSchema: z.ZodObject<{
|
|
146
130
|
authorizationUrl: z.ZodString;
|
|
@@ -183,7 +167,6 @@ export declare const mcpConnectionReconnectResultSchema: z.ZodDiscriminatedUnion
|
|
|
183
167
|
bearer: "bearer";
|
|
184
168
|
none: "none";
|
|
185
169
|
oauth_authorization_code: "oauth_authorization_code";
|
|
186
|
-
oauth_client_credentials: "oauth_client_credentials";
|
|
187
170
|
}>;
|
|
188
171
|
status: z.ZodEnum<{
|
|
189
172
|
connected: "connected";
|
|
@@ -213,7 +196,6 @@ export declare const mcpConnectionReconnectResultSchema: z.ZodDiscriminatedUnion
|
|
|
213
196
|
bearer: "bearer";
|
|
214
197
|
none: "none";
|
|
215
198
|
oauth_authorization_code: "oauth_authorization_code";
|
|
216
|
-
oauth_client_credentials: "oauth_client_credentials";
|
|
217
199
|
}>;
|
|
218
200
|
status: z.ZodEnum<{
|
|
219
201
|
connected: "connected";
|
|
@@ -7,7 +7,6 @@ export const mcpConnectionAuthTypeSchema = z.enum([
|
|
|
7
7
|
"none",
|
|
8
8
|
"bearer",
|
|
9
9
|
"oauth_authorization_code",
|
|
10
|
-
"oauth_client_credentials",
|
|
11
10
|
]);
|
|
12
11
|
export const mcpConnectionStatusSchema = z.enum([
|
|
13
12
|
"connected",
|
|
@@ -38,20 +37,20 @@ const oauthClientIdSchema = z
|
|
|
38
37
|
.min(1)
|
|
39
38
|
.max(MAX_MCP_OAUTH_CLIENT_ID_LENGTH)
|
|
40
39
|
.regex(/^[!-~]+$/, "Client ID must contain visible ASCII characters only")
|
|
41
|
-
.describe("OAuth client ID.
|
|
40
|
+
.describe("OAuth client ID. Optional, but send it together with `clientSecret`.");
|
|
42
41
|
const oauthClientSecretSchema = z
|
|
43
42
|
.string()
|
|
44
43
|
.min(1)
|
|
45
44
|
.max(MAX_MCP_OAUTH_CLIENT_SECRET_LENGTH)
|
|
46
45
|
.regex(/^[!-~]+$/, "Client secret must contain visible ASCII characters only")
|
|
47
|
-
.describe("OAuth client secret.
|
|
46
|
+
.describe("OAuth client secret. Optional, but send it together with `clientId`. Never returned.");
|
|
48
47
|
const oauthScopeSchema = z
|
|
49
48
|
.string()
|
|
50
49
|
.trim()
|
|
51
50
|
.min(1)
|
|
52
51
|
.max(MAX_MCP_OAUTH_SCOPE_LENGTH)
|
|
53
52
|
.regex(/^[\x20-\x7e]+$/, "Scope must contain printable ASCII characters only")
|
|
54
|
-
.describe("OAuth scope to request. Optional
|
|
53
|
+
.describe("OAuth scope to request. Optional.");
|
|
55
54
|
const credentialFragmentSchema = z.string().min(1).max(4).nullable();
|
|
56
55
|
const mcpConnectionUrlSchema = z
|
|
57
56
|
.string()
|
|
@@ -75,7 +74,7 @@ const mcpConnectionUrlSchema = z
|
|
|
75
74
|
})
|
|
76
75
|
.transform((value) => new URL(value).toString());
|
|
77
76
|
const mcpConnectionUrlInputSchema = mcpConnectionUrlSchema.describe("Streamable HTTP URL of the MCP server. Use `https`, with no credentials, query, or fragment.");
|
|
78
|
-
const authTypeDescription = "How Blazing Agents authenticates to the MCP server: `none`, `bearer`,
|
|
77
|
+
const authTypeDescription = "How Blazing Agents authenticates to the MCP server: `none`, `bearer`, or `oauth_authorization_code`. The other fields you send depend on it.";
|
|
79
78
|
export const mcpConnectionResponseSchema = z
|
|
80
79
|
.object({
|
|
81
80
|
id: mcpConnectionIdSchema,
|
|
@@ -146,13 +145,6 @@ const createBearerMcpConnectionBodySchema = z
|
|
|
146
145
|
bearerToken: bearerTokenSchema,
|
|
147
146
|
})
|
|
148
147
|
.strict();
|
|
149
|
-
const oauthClientCredentialsFields = {
|
|
150
|
-
authType: z.literal("oauth_client_credentials").describe(authTypeDescription),
|
|
151
|
-
clientId: oauthClientIdSchema,
|
|
152
|
-
clientSecret: oauthClientSecretSchema,
|
|
153
|
-
scope: oauthScopeSchema.optional(),
|
|
154
|
-
url: mcpConnectionUrlInputSchema,
|
|
155
|
-
};
|
|
156
148
|
const oauthAuthorizationCodeFields = {
|
|
157
149
|
authType: z.literal("oauth_authorization_code").describe(authTypeDescription),
|
|
158
150
|
clientId: oauthClientIdSchema.optional(),
|
|
@@ -166,18 +158,11 @@ const createOauthAuthorizationCodeMcpConnectionBodySchema = z
|
|
|
166
158
|
name: mcpConnectionNameInputSchema,
|
|
167
159
|
})
|
|
168
160
|
.strict();
|
|
169
|
-
const createOauthClientCredentialsMcpConnectionBodySchema = z
|
|
170
|
-
.object({
|
|
171
|
-
...oauthClientCredentialsFields,
|
|
172
|
-
name: mcpConnectionNameInputSchema,
|
|
173
|
-
})
|
|
174
|
-
.strict();
|
|
175
161
|
export const createMcpConnectionBodySchema = z
|
|
176
162
|
.discriminatedUnion("authType", [
|
|
177
163
|
createNoneMcpConnectionBodySchema,
|
|
178
164
|
createBearerMcpConnectionBodySchema,
|
|
179
165
|
createOauthAuthorizationCodeMcpConnectionBodySchema,
|
|
180
|
-
createOauthClientCredentialsMcpConnectionBodySchema,
|
|
181
166
|
])
|
|
182
167
|
.superRefine((body, context) => {
|
|
183
168
|
if (body.authType === "oauth_authorization_code" &&
|
|
@@ -213,7 +198,6 @@ export const reconnectMcpConnectionBodySchema = z
|
|
|
213
198
|
})
|
|
214
199
|
.strict(),
|
|
215
200
|
z.object(oauthAuthorizationCodeFields).strict(),
|
|
216
|
-
z.object(oauthClientCredentialsFields).strict(),
|
|
217
201
|
])
|
|
218
202
|
.superRefine((body, context) => {
|
|
219
203
|
if (body.authType === "oauth_authorization_code" &&
|
|
@@ -60,6 +60,7 @@ export declare const sessionResponseSchema: z.ZodObject<{
|
|
|
60
60
|
save_memory: "save_memory";
|
|
61
61
|
search_memories: "search_memories";
|
|
62
62
|
update_memory: "update_memory";
|
|
63
|
+
web_fetch: "web_fetch";
|
|
63
64
|
web_search: "web_search";
|
|
64
65
|
write: "write";
|
|
65
66
|
write_todos: "write_todos";
|
|
@@ -100,6 +101,7 @@ export declare const sessionResponseSchema: z.ZodObject<{
|
|
|
100
101
|
save_memory: "save_memory";
|
|
101
102
|
search_memories: "search_memories";
|
|
102
103
|
update_memory: "update_memory";
|
|
104
|
+
web_fetch: "web_fetch";
|
|
103
105
|
web_search: "web_search";
|
|
104
106
|
write: "write";
|
|
105
107
|
write_todos: "write_todos";
|
|
@@ -136,6 +138,7 @@ export declare const sessionResponseSchema: z.ZodObject<{
|
|
|
136
138
|
save_memory: "save_memory";
|
|
137
139
|
search_memories: "search_memories";
|
|
138
140
|
update_memory: "update_memory";
|
|
141
|
+
web_fetch: "web_fetch";
|
|
139
142
|
web_search: "web_search";
|
|
140
143
|
write: "write";
|
|
141
144
|
write_todos: "write_todos";
|
|
@@ -262,6 +265,7 @@ export declare const toolApprovalStateSchema: z.ZodObject<{
|
|
|
262
265
|
save_memory: "save_memory";
|
|
263
266
|
search_memories: "search_memories";
|
|
264
267
|
update_memory: "update_memory";
|
|
268
|
+
web_fetch: "web_fetch";
|
|
265
269
|
web_search: "web_search";
|
|
266
270
|
write: "write";
|
|
267
271
|
write_todos: "write_todos";
|
|
@@ -314,6 +318,7 @@ export declare const toolApprovalsResponseSchema: z.ZodObject<{
|
|
|
314
318
|
save_memory: "save_memory";
|
|
315
319
|
search_memories: "search_memories";
|
|
316
320
|
update_memory: "update_memory";
|
|
321
|
+
web_fetch: "web_fetch";
|
|
317
322
|
web_search: "web_search";
|
|
318
323
|
write: "write";
|
|
319
324
|
write_todos: "write_todos";
|
|
@@ -368,7 +373,7 @@ export declare const turnStreamErrorEventSchema: z.ZodObject<{
|
|
|
368
373
|
type: z.ZodLiteral<"data-ba-error">;
|
|
369
374
|
transient: z.ZodLiteral<true>;
|
|
370
375
|
data: z.ZodObject<{
|
|
371
|
-
code: z.ZodCustom<"admin_agent_managed" | "agent_busy" | "agent_disabled" | "agent_mcp_connection_not_found" | "agent_mcp_connections_invalid" | "api_key_limit_reached" | "artifact_session_cap_reached" | "chat_webhook_conflict" | "chat_webhook_registration_failed" | "forbidden" | "function_call_conflict" | "idempotency_conflict" | "input_idempotency_conflict" | "insufficient_scope" | "internal" | "invalid_cursor" | "invalid_request" | "mcp_connection_authentication_failed" | "mcp_connection_discovery_failed" | "mcp_connection_in_use" | "mcp_connection_invalid" | "mcp_connection_limit_reached" | "mcp_connection_name_conflict" | "mcp_connection_stale_credential_version" | "mcp_connection_unreachable" | "merchant_account_mismatch" | "merchant_balance_required" | "merchant_binding_not_found" | "merchant_connection_in_use" | "merchant_connection_not_found" | "merchant_credential_invalid" | "merchant_customer_not_found" | "merchant_customer_unmapped" | "merchant_eligibility_unavailable" | "merchant_event_not_found" | "merchant_event_state_conflict" | "merchant_provider_unavailable" | "merchant_subscription_required" | "message_id_conflict" | "message_not_found" | "model_discovery_unsupported" | "model_not_found" | "model_spending_limit_exceeded" | "model_validation_unavailable" | "not_found" | "prompt_variable_missing" | "prompt_variable_unknown" | "provider_historical_use" | "provider_in_use" | "provider_limit_reached" | "provider_name_conflict" | "provider_not_found" | "provider_required" | "
|
|
376
|
+
code: z.ZodCustom<"admin_agent_managed" | "agent_busy" | "agent_disabled" | "agent_mcp_connection_not_found" | "agent_mcp_connections_invalid" | "api_key_limit_reached" | "artifact_session_cap_reached" | "chat_webhook_conflict" | "chat_webhook_registration_failed" | "forbidden" | "function_call_conflict" | "idempotency_conflict" | "input_idempotency_conflict" | "insufficient_scope" | "internal" | "invalid_cursor" | "invalid_request" | "mcp_connection_authentication_failed" | "mcp_connection_discovery_failed" | "mcp_connection_in_use" | "mcp_connection_invalid" | "mcp_connection_limit_reached" | "mcp_connection_name_conflict" | "mcp_connection_stale_credential_version" | "mcp_connection_unreachable" | "merchant_account_mismatch" | "merchant_balance_required" | "merchant_binding_not_found" | "merchant_connection_in_use" | "merchant_connection_not_found" | "merchant_credential_invalid" | "merchant_customer_not_found" | "merchant_customer_unmapped" | "merchant_eligibility_unavailable" | "merchant_event_not_found" | "merchant_event_state_conflict" | "merchant_provider_unavailable" | "merchant_subscription_required" | "message_id_conflict" | "message_not_found" | "model_discovery_unsupported" | "model_not_found" | "model_spending_limit_exceeded" | "model_validation_unavailable" | "not_found" | "prompt_variable_missing" | "prompt_variable_unknown" | "provider_historical_use" | "provider_in_use" | "provider_limit_reached" | "provider_name_conflict" | "provider_not_found" | "provider_required" | "rate_limited" | "service_unavailable" | "session_busy" | "session_fork_deleted" | "session_fork_unavailable" | "session_turn_unresponsive" | "session_version_mismatch" | "skill_invalid_archive" | "skill_invalid_markdown" | "skill_limit_reached" | "skill_name_conflict" | "skill_not_found" | "skill_too_many_files" | "skill_uncompressed_too_large" | "steer_not_available" | "subscription_already_paid" | "subscription_not_cancelled" | "subscription_required" | "task_active_run_exists" | "tenant_deleting" | "tenant_deletion_in_progress" | "tenant_deletion_not_ready" | "tenant_not_deleting" | "tool_approval_continuation_settled" | "tool_approval_decision_conflict" | "turn_interrupted" | "unauthorized" | "usage_credit_required" | "validation_failed" | "workspace_busy" | "workspace_in_use" | "workspace_not_found" | (string & {}), "admin_agent_managed" | "agent_busy" | "agent_disabled" | "agent_mcp_connection_not_found" | "agent_mcp_connections_invalid" | "api_key_limit_reached" | "artifact_session_cap_reached" | "chat_webhook_conflict" | "chat_webhook_registration_failed" | "forbidden" | "function_call_conflict" | "idempotency_conflict" | "input_idempotency_conflict" | "insufficient_scope" | "internal" | "invalid_cursor" | "invalid_request" | "mcp_connection_authentication_failed" | "mcp_connection_discovery_failed" | "mcp_connection_in_use" | "mcp_connection_invalid" | "mcp_connection_limit_reached" | "mcp_connection_name_conflict" | "mcp_connection_stale_credential_version" | "mcp_connection_unreachable" | "merchant_account_mismatch" | "merchant_balance_required" | "merchant_binding_not_found" | "merchant_connection_in_use" | "merchant_connection_not_found" | "merchant_credential_invalid" | "merchant_customer_not_found" | "merchant_customer_unmapped" | "merchant_eligibility_unavailable" | "merchant_event_not_found" | "merchant_event_state_conflict" | "merchant_provider_unavailable" | "merchant_subscription_required" | "message_id_conflict" | "message_not_found" | "model_discovery_unsupported" | "model_not_found" | "model_spending_limit_exceeded" | "model_validation_unavailable" | "not_found" | "prompt_variable_missing" | "prompt_variable_unknown" | "provider_historical_use" | "provider_in_use" | "provider_limit_reached" | "provider_name_conflict" | "provider_not_found" | "provider_required" | "rate_limited" | "service_unavailable" | "session_busy" | "session_fork_deleted" | "session_fork_unavailable" | "session_turn_unresponsive" | "session_version_mismatch" | "skill_invalid_archive" | "skill_invalid_markdown" | "skill_limit_reached" | "skill_name_conflict" | "skill_not_found" | "skill_too_many_files" | "skill_uncompressed_too_large" | "steer_not_available" | "subscription_already_paid" | "subscription_not_cancelled" | "subscription_required" | "task_active_run_exists" | "tenant_deleting" | "tenant_deletion_in_progress" | "tenant_deletion_not_ready" | "tenant_not_deleting" | "tool_approval_continuation_settled" | "tool_approval_decision_conflict" | "turn_interrupted" | "unauthorized" | "usage_credit_required" | "validation_failed" | "workspace_busy" | "workspace_in_use" | "workspace_not_found" | (string & {})>;
|
|
372
377
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
373
378
|
message: z.ZodString;
|
|
374
379
|
}, z.core.$strict>;
|
|
@@ -98,9 +98,9 @@ export declare const createTaskRunBodySchema: z.ZodObject<{
|
|
|
98
98
|
}, z.core.$strict>;
|
|
99
99
|
/**
|
|
100
100
|
* Task run status. `blocked` is the soft-block terminal state for an expected
|
|
101
|
-
* admission denial, such as
|
|
102
|
-
*
|
|
103
|
-
*
|
|
101
|
+
* admission denial, such as a missing subscription or insufficient Usage
|
|
102
|
+
* credit. Like the other terminal statuses, it sets `finishedAt` and frees the
|
|
103
|
+
* task's active-run slot for the next scheduled fire.
|
|
104
104
|
*/
|
|
105
105
|
export declare const taskRunStatusSchema: z.ZodEnum<{
|
|
106
106
|
blocked: "blocked";
|
|
@@ -284,6 +284,7 @@ export declare const taskRunResponseSchema: z.ZodObject<{
|
|
|
284
284
|
save_memory: "save_memory";
|
|
285
285
|
search_memories: "search_memories";
|
|
286
286
|
update_memory: "update_memory";
|
|
287
|
+
web_fetch: "web_fetch";
|
|
287
288
|
web_search: "web_search";
|
|
288
289
|
write: "write";
|
|
289
290
|
write_todos: "write_todos";
|
|
@@ -324,6 +325,7 @@ export declare const taskRunResponseSchema: z.ZodObject<{
|
|
|
324
325
|
save_memory: "save_memory";
|
|
325
326
|
search_memories: "search_memories";
|
|
326
327
|
update_memory: "update_memory";
|
|
328
|
+
web_fetch: "web_fetch";
|
|
327
329
|
web_search: "web_search";
|
|
328
330
|
write: "write";
|
|
329
331
|
write_todos: "write_todos";
|
|
@@ -360,6 +362,7 @@ export declare const taskRunResponseSchema: z.ZodObject<{
|
|
|
360
362
|
save_memory: "save_memory";
|
|
361
363
|
search_memories: "search_memories";
|
|
362
364
|
update_memory: "update_memory";
|
|
365
|
+
web_fetch: "web_fetch";
|
|
363
366
|
web_search: "web_search";
|
|
364
367
|
write: "write";
|
|
365
368
|
write_todos: "write_todos";
|
|
@@ -419,6 +422,7 @@ export declare const taskRunsListResponseSchema: z.ZodObject<{
|
|
|
419
422
|
save_memory: "save_memory";
|
|
420
423
|
search_memories: "search_memories";
|
|
421
424
|
update_memory: "update_memory";
|
|
425
|
+
web_fetch: "web_fetch";
|
|
422
426
|
web_search: "web_search";
|
|
423
427
|
write: "write";
|
|
424
428
|
write_todos: "write_todos";
|
|
@@ -459,6 +463,7 @@ export declare const taskRunsListResponseSchema: z.ZodObject<{
|
|
|
459
463
|
save_memory: "save_memory";
|
|
460
464
|
search_memories: "search_memories";
|
|
461
465
|
update_memory: "update_memory";
|
|
466
|
+
web_fetch: "web_fetch";
|
|
462
467
|
web_search: "web_search";
|
|
463
468
|
write: "write";
|
|
464
469
|
write_todos: "write_todos";
|
|
@@ -495,6 +500,7 @@ export declare const taskRunsListResponseSchema: z.ZodObject<{
|
|
|
495
500
|
save_memory: "save_memory";
|
|
496
501
|
search_memories: "search_memories";
|
|
497
502
|
update_memory: "update_memory";
|
|
503
|
+
web_fetch: "web_fetch";
|
|
498
504
|
web_search: "web_search";
|
|
499
505
|
write: "write";
|
|
500
506
|
write_todos: "write_todos";
|
|
@@ -174,9 +174,9 @@ export const createTaskRunBodySchema = z
|
|
|
174
174
|
.strict();
|
|
175
175
|
/**
|
|
176
176
|
* Task run status. `blocked` is the soft-block terminal state for an expected
|
|
177
|
-
* admission denial, such as
|
|
178
|
-
*
|
|
179
|
-
*
|
|
177
|
+
* admission denial, such as a missing subscription or insufficient Usage
|
|
178
|
+
* credit. Like the other terminal statuses, it sets `finishedAt` and frees the
|
|
179
|
+
* task's active-run slot for the next scheduled fire.
|
|
180
180
|
*/
|
|
181
181
|
export const taskRunStatusSchema = z.enum([
|
|
182
182
|
"queued",
|
|
@@ -244,7 +244,7 @@ export const taskRunResponseSchema = z
|
|
|
244
244
|
error: z.string().nullable(),
|
|
245
245
|
errorCode: receivedApiErrorCodeSchema
|
|
246
246
|
.nullable()
|
|
247
|
-
.describe("Machine-readable reason a run ended `blocked` or `failed`: one of the API error codes, such as `usage_credit_required
|
|
247
|
+
.describe("Machine-readable reason a run ended `blocked` or `failed`: one of the API error codes, such as `usage_credit_required` or `provider_required`. `null` for every other run, and for a failure without a code; `error` carries the message."),
|
|
248
248
|
userId: userIdSchema,
|
|
249
249
|
metadata: metadataSchema,
|
|
250
250
|
startedAt: z.iso.datetime({ offset: true }).nullable(),
|
|
@@ -9,30 +9,11 @@ export declare const tenantDeletionSchema: z.ZodObject<{
|
|
|
9
9
|
deletesAt: z.ZodISODateTime;
|
|
10
10
|
requestedAt: z.ZodISODateTime;
|
|
11
11
|
}, z.core.$strict>;
|
|
12
|
-
/**
|
|
13
|
-
* Quota — `GET/PATCH /v1/tenant` carries the tenant's self-set quota.
|
|
14
|
-
* `null` means unlimited (no quota row).
|
|
15
|
-
*/
|
|
16
|
-
export declare const quotaSchema: z.ZodObject<{
|
|
17
|
-
monthlyTokenLimit: z.ZodNullable<z.ZodNumber>;
|
|
18
|
-
monthlyRequestLimit: z.ZodNullable<z.ZodNumber>;
|
|
19
|
-
resetDay: z.ZodNumber;
|
|
20
|
-
}, z.core.$strict>;
|
|
21
12
|
export declare const tenantSettingsSchema: z.ZodObject<{
|
|
22
13
|
name: z.ZodString;
|
|
23
|
-
quota: z.ZodNullable<z.ZodObject<{
|
|
24
|
-
monthlyTokenLimit: z.ZodNullable<z.ZodNumber>;
|
|
25
|
-
monthlyRequestLimit: z.ZodNullable<z.ZodNumber>;
|
|
26
|
-
resetDay: z.ZodNumber;
|
|
27
|
-
}, z.core.$strip>>;
|
|
28
14
|
}, z.core.$strip>;
|
|
29
15
|
export declare const tenantSettingsResponseSchema: z.ZodObject<{
|
|
30
16
|
name: z.ZodString;
|
|
31
|
-
quota: z.ZodNullable<z.ZodObject<{
|
|
32
|
-
monthlyTokenLimit: z.ZodNullable<z.ZodNumber>;
|
|
33
|
-
monthlyRequestLimit: z.ZodNullable<z.ZodNumber>;
|
|
34
|
-
resetDay: z.ZodNumber;
|
|
35
|
-
}, z.core.$strip>>;
|
|
36
17
|
deletion: z.ZodNullable<z.ZodObject<{
|
|
37
18
|
deletesAt: z.ZodISODateTime;
|
|
38
19
|
requestedAt: z.ZodISODateTime;
|
|
@@ -42,13 +23,7 @@ export declare const tenantSettingsResponseSchema: z.ZodObject<{
|
|
|
42
23
|
export declare const updateTenantSettingsBodySchema: z.ZodObject<{
|
|
43
24
|
monetizationEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
44
25
|
name: z.ZodOptional<z.ZodString>;
|
|
45
|
-
quota: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
46
|
-
monthlyTokenLimit: z.ZodNullable<z.ZodNumber>;
|
|
47
|
-
monthlyRequestLimit: z.ZodNullable<z.ZodNumber>;
|
|
48
|
-
resetDay: z.ZodNumber;
|
|
49
|
-
}, z.core.$strict>>>;
|
|
50
26
|
}, z.core.$strict>;
|
|
51
|
-
export type Quota = z.infer<typeof quotaSchema>;
|
|
52
27
|
export type TenantDeletion = z.infer<typeof tenantDeletionSchema>;
|
|
53
28
|
export type TenantSettingsResponse = z.infer<typeof tenantSettingsResponseSchema>;
|
|
54
29
|
export type UpdateTenantSettingsBody = z.infer<typeof updateTenantSettingsBodySchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { MAX_TENANT_NAME_LENGTH } from "../limitations.js";
|
|
3
3
|
import { atLeastOneFieldMessage, hasObjectKeys } from "../utils.js";
|
|
4
4
|
/**
|
|
5
5
|
* Tenant deletion lifecycle — `requestedAt` marks the tenant deleting and
|
|
@@ -13,26 +13,9 @@ export const tenantDeletionSchema = z
|
|
|
13
13
|
requestedAt: z.iso.datetime({ offset: true }),
|
|
14
14
|
})
|
|
15
15
|
.strict();
|
|
16
|
-
/**
|
|
17
|
-
* Quota — `GET/PATCH /v1/tenant` carries the tenant's self-set quota.
|
|
18
|
-
* `null` means unlimited (no quota row).
|
|
19
|
-
*/
|
|
20
|
-
export const quotaSchema = z
|
|
21
|
-
.object({
|
|
22
|
-
monthlyTokenLimit: z.number().int().positive().nullable(),
|
|
23
|
-
monthlyRequestLimit: z.number().int().positive().nullable(),
|
|
24
|
-
resetDay: z
|
|
25
|
-
.number()
|
|
26
|
-
.int()
|
|
27
|
-
.min(MIN_QUOTA_RESET_DAY)
|
|
28
|
-
.max(MAX_QUOTA_RESET_DAY),
|
|
29
|
-
})
|
|
30
|
-
.strict()
|
|
31
|
-
.refine(({ monthlyRequestLimit, monthlyTokenLimit }) => monthlyRequestLimit !== null || monthlyTokenLimit !== null, { message: "At least one quota limit is required" });
|
|
32
16
|
export const tenantSettingsSchema = z
|
|
33
17
|
.object({
|
|
34
18
|
name: z.string().trim().min(1).max(MAX_TENANT_NAME_LENGTH),
|
|
35
|
-
quota: quotaSchema.strip().nullable(),
|
|
36
19
|
})
|
|
37
20
|
.strip();
|
|
38
21
|
export const tenantSettingsResponseSchema = tenantSettingsSchema
|
|
@@ -54,10 +37,6 @@ export const updateTenantSettingsBodySchema = z
|
|
|
54
37
|
.max(MAX_TENANT_NAME_LENGTH)
|
|
55
38
|
.optional()
|
|
56
39
|
.describe("Display name of your tenant."),
|
|
57
|
-
quota: quotaSchema
|
|
58
|
-
.nullable()
|
|
59
|
-
.optional()
|
|
60
|
-
.describe("The whole monthly quota, replacing the current one, or `null` to remove it. Send `monthlyTokenLimit`, `monthlyRequestLimit`, and `resetDay`, with at least one limit set."),
|
|
61
40
|
})
|
|
62
41
|
.strict()
|
|
63
42
|
.refine(hasObjectKeys, {
|
|
@@ -27,8 +27,8 @@ export type { SpendingLimit, SpendingLimitResponse, SpendingLimitStopDetails, Up
|
|
|
27
27
|
export { nextSpendingLimitReset, spendingLimitPeriodSchema, spendingLimitResetIntervalSchema, spendingLimitResponseSchema, spendingLimitSchema, spendingLimitStopDetailsSchema, updateSpendingLimitBodySchema, } from "./entities/spending-limits.ts";
|
|
28
28
|
export type { CreateTaskBody, TaskListItem, TaskRunStatus, TaskScheduleInput, UpdateTaskBody, } from "./entities/tasks.ts";
|
|
29
29
|
export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskLatestRunSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.ts";
|
|
30
|
-
export type {
|
|
31
|
-
export {
|
|
30
|
+
export type { TenantDeletion, UpdateTenantSettingsBody, } from "./entities/tenants.ts";
|
|
31
|
+
export { tenantDeletionSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.ts";
|
|
32
32
|
export type { SessionUsageQuery, SessionUsageResponse, UsageBucket, UsageOverviewQuery, UsageOverviewResponse, UsageResponse, UsageTotals, } from "./entities/usage.ts";
|
|
33
33
|
export { sessionUsageQuerySchema, sessionUsageResponseSchema, usageOverviewQuerySchema, usageOverviewResponseSchema, usageResponseSchema, } from "./entities/usage.ts";
|
|
34
34
|
export type { WorkspaceTier } from "./entities/workspaces.ts";
|
package/dist/contracts/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSes
|
|
|
18
18
|
export { copySkillBodySchema, createSkillBodySchema, skillArchiveTypeSchema, skillCopyResultsSchema, skillDescriptionSchema, skillDetailSchema, skillFilePathSchema, skillMetadataSchema, skillNameSchema, skillSchema, skillsListResponseSchema, } from "./entities/skills.js";
|
|
19
19
|
export { nextSpendingLimitReset, spendingLimitPeriodSchema, spendingLimitResetIntervalSchema, spendingLimitResponseSchema, spendingLimitSchema, spendingLimitStopDetailsSchema, updateSpendingLimitBodySchema, } from "./entities/spending-limits.js";
|
|
20
20
|
export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskLatestRunSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.js";
|
|
21
|
-
export {
|
|
21
|
+
export { tenantDeletionSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.js";
|
|
22
22
|
export { sessionUsageQuerySchema, sessionUsageResponseSchema, usageOverviewQuerySchema, usageOverviewResponseSchema, usageResponseSchema, } from "./entities/usage.js";
|
|
23
23
|
export { createWorkspaceBodySchema, updateWorkspaceBodySchema, workspaceNetworkPolicySchema, workspaceSchema, workspacesListResponseSchema, workspaceTierSchema, } from "./entities/workspaces.js";
|
|
24
24
|
export { agentIdSchema, apiKeyTokenSchema, functionCallIdSchema, isAdminAgentId, merchantUsageEventIdSchema, promptIdSchema, sessionIdSchema, } from "./ids.js";
|
|
@@ -47,8 +47,6 @@ export declare const MAX_USAGE_RANGE_DAYS = 31;
|
|
|
47
47
|
export declare const DEFAULT_USAGE_RANGE_DAYS = 30;
|
|
48
48
|
export declare const DEFAULT_USAGE_OVERVIEW_TOP_N = 5;
|
|
49
49
|
export declare const MAX_USAGE_OVERVIEW_TOP_N = 20;
|
|
50
|
-
export declare const MIN_QUOTA_RESET_DAY = 1;
|
|
51
|
-
export declare const MAX_QUOTA_RESET_DAY = 28;
|
|
52
50
|
/**
|
|
53
51
|
* Tenant (workspace) — display name ≤ 80, set via `PATCH /v1/tenant`.
|
|
54
52
|
*/
|
|
@@ -48,9 +48,6 @@ export const MAX_USAGE_RANGE_DAYS = 31;
|
|
|
48
48
|
export const DEFAULT_USAGE_RANGE_DAYS = 30;
|
|
49
49
|
export const DEFAULT_USAGE_OVERVIEW_TOP_N = 5;
|
|
50
50
|
export const MAX_USAGE_OVERVIEW_TOP_N = 20;
|
|
51
|
-
// Quota — reset day between 1 and 28.
|
|
52
|
-
export const MIN_QUOTA_RESET_DAY = 1;
|
|
53
|
-
export const MAX_QUOTA_RESET_DAY = 28;
|
|
54
51
|
/**
|
|
55
52
|
* Tenant (workspace) — display name ≤ 80, set via `PATCH /v1/tenant`.
|
|
56
53
|
*/
|
package/dist/generation.js
CHANGED
|
@@ -145,6 +145,18 @@ function buildChatResult(config, response, resumeSessionId, dispatch) {
|
|
|
145
145
|
sessionIdError = error;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
+
const { functions } = dispatch;
|
|
149
|
+
/**
|
|
150
|
+
* Function calls are dispatched against the Session, so without its id the
|
|
151
|
+
* stream cannot be filtered; refuse it rather than pass private
|
|
152
|
+
* `data-ba-function-call` frames through.
|
|
153
|
+
*/
|
|
154
|
+
if (functions && sessionId === undefined) {
|
|
155
|
+
response.body?.cancel().catch(() => {
|
|
156
|
+
/* no-op — the stream is discarded */
|
|
157
|
+
});
|
|
158
|
+
throw sessionIdError;
|
|
159
|
+
}
|
|
148
160
|
const sessionIdPromise = sessionId === undefined
|
|
149
161
|
? Promise.reject(sessionIdError)
|
|
150
162
|
: Promise.resolve(sessionId);
|
|
@@ -162,8 +174,7 @@ function buildChatResult(config, response, resumeSessionId, dispatch) {
|
|
|
162
174
|
turnIdPromise.catch(() => {
|
|
163
175
|
/* no-op — prevents unhandled rejection if the caller never awaits */
|
|
164
176
|
});
|
|
165
|
-
const
|
|
166
|
-
const streamResponse = functions && sessionId !== undefined
|
|
177
|
+
const streamResponse = functions && sessionId
|
|
167
178
|
? withFilteredBody(response, (body) => dispatchChatFunctions(config, { ...dispatch, functions, sessionId }, body))
|
|
168
179
|
: response;
|
|
169
180
|
return {
|
|
@@ -22,8 +22,7 @@ export interface TenantResource {
|
|
|
22
22
|
updateSpendingLimit(input: UpdateSpendingLimitBody & ResourceRequestOptions): Promise<SpendingLimitResponse>;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* `client.tenant` — get/patch over `/v1/tenant` (the tenant
|
|
26
|
-
* quota row). `quota: null` means unlimited (no row).
|
|
25
|
+
* `client.tenant` — get/patch over `/v1/tenant` (the tenant settings).
|
|
27
26
|
* @param config - Shared authentication and transport configuration.
|
|
28
27
|
* @returns The configured resource client.
|
|
29
28
|
*/
|
package/dist/resources/tenant.js
CHANGED
|
@@ -2,8 +2,7 @@ import { spendingLimitResponseSchema, } from "../contracts/entities/spending-lim
|
|
|
2
2
|
import { tenantSettingsResponseSchema, } from "../contracts/entities/tenants.js";
|
|
3
3
|
import { requestJson } from "../http.js";
|
|
4
4
|
/**
|
|
5
|
-
* `client.tenant` — get/patch over `/v1/tenant` (the tenant
|
|
6
|
-
* quota row). `quota: null` means unlimited (no row).
|
|
5
|
+
* `client.tenant` — get/patch over `/v1/tenant` (the tenant settings).
|
|
7
6
|
* @param config - Shared authentication and transport configuration.
|
|
8
7
|
* @returns The configured resource client.
|
|
9
8
|
*/
|