@blazingagents/sdk 0.55.0 → 0.56.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/entities/agents.d.ts +0 -1
- package/dist/contracts/entities/agents.js +1 -2
- package/dist/contracts/entities/attribution.js +5 -1
- package/dist/contracts/entities/chat.js +2 -2
- package/dist/contracts/entities/mcp-connections.js +2 -5
- package/dist/contracts/entities/prompts.js +1 -1
- package/dist/contracts/entities/sessions.d.ts +0 -1
- package/dist/contracts/entities/tasks.d.ts +0 -2
- package/dist/contracts/entities/tasks.js +2 -2
- package/dist/contracts/entities/workspaces.js +2 -2
- package/dist/contracts/limitations.d.ts +2 -0
- package/dist/contracts/limitations.js +2 -0
- package/package.json +1 -1
|
@@ -388,7 +388,6 @@ export declare const agentConfigSchema: z.ZodObject<{
|
|
|
388
388
|
write_todos: "write_todos";
|
|
389
389
|
}>>;
|
|
390
390
|
instructions: z.ZodString;
|
|
391
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
392
391
|
mcpConnectionIds: z.ZodArray<z.ZodString>;
|
|
393
392
|
}, z.core.$strip>;
|
|
394
393
|
export declare const createAgentBodySchema: z.ZodObject<{
|
|
@@ -123,7 +123,6 @@ export const agentConfigSchema = z
|
|
|
123
123
|
memoryInjectionEnabled: agentResponseSchema.shape.memoryInjectionEnabled,
|
|
124
124
|
tools: agentResponseSchema.shape.tools,
|
|
125
125
|
instructions: agentResponseSchema.shape.instructions,
|
|
126
|
-
metadata: agentResponseSchema.shape.metadata,
|
|
127
126
|
mcpConnectionIds: agentResponseSchema.shape.mcpConnectionIds,
|
|
128
127
|
})
|
|
129
128
|
.strip()
|
|
@@ -150,7 +149,7 @@ const agentFieldDescriptions = {
|
|
|
150
149
|
tools: "Built-in tools the agent can use. Each tool is enabled individually and is off until listed. File tools such as `read` and `bash` run in the attached workspace.",
|
|
151
150
|
instructions: "Instructions the agent follows on every turn.",
|
|
152
151
|
userId: "Your end user's ID, used for attribution. An empty string means a tenant-level agent. It cannot change after creation.",
|
|
153
|
-
metadata: "Your own key-value data, returned unchanged.",
|
|
152
|
+
metadata: "Your own key-value data, returned unchanged. At most 128 KiB as JSON.",
|
|
154
153
|
mcpConnectionIds: "IDs of the MCP connections attached to the agent.",
|
|
155
154
|
};
|
|
156
155
|
export const createAgentBodySchema = z
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { MAX_METADATA_BYTES } from "../limitations.js";
|
|
2
3
|
/**
|
|
3
4
|
* End-user attribution — the uniform ownership dimension on every
|
|
4
5
|
* tenant-owned product resource (ADR-0001). `userId` is an opaque
|
|
@@ -11,7 +12,10 @@ import { z } from "zod";
|
|
|
11
12
|
* sessions, tasks, task runs, artifacts, and usage rows.
|
|
12
13
|
*/
|
|
13
14
|
export const userIdSchema = z.string();
|
|
14
|
-
export const metadataSchema = z
|
|
15
|
+
export const metadataSchema = z
|
|
16
|
+
.record(z.string(), z.unknown())
|
|
17
|
+
.refine((metadata) => new TextEncoder().encode(JSON.stringify(metadata)).length <=
|
|
18
|
+
MAX_METADATA_BYTES, { message: "Metadata must be at most 128 KiB as JSON." });
|
|
15
19
|
/**
|
|
16
20
|
* The create-body shape for an attributed resource: both fields optional
|
|
17
21
|
* with tenant-level defaults (`userId: ''`, `metadata: {}`). `userId` is
|
|
@@ -256,7 +256,7 @@ export const chatRequestBodySchema = z
|
|
|
256
256
|
.describe("Your end user's ID. Starting a session records it on the session, and every turn in that session keeps the session's end user."),
|
|
257
257
|
metadata: metadataSchema
|
|
258
258
|
.optional()
|
|
259
|
-
.describe("Your own key-value data. Recorded on a new session and on the turn's usage. An omitted value records the session's metadata on the turn's usage."),
|
|
259
|
+
.describe("Your own key-value data. Recorded on a new session and on the turn's usage. An omitted value records the session's metadata on the turn's usage. At most 128 KiB as JSON."),
|
|
260
260
|
/**
|
|
261
261
|
* `chatFunctionDefinitionsSchema` validates the value; `z.custom` is opaque
|
|
262
262
|
* to the OpenAPI generator, so `meta` declares the wire shape.
|
|
@@ -327,7 +327,7 @@ export const generationRequestBodySchema = z
|
|
|
327
327
|
.describe("Your end user's ID, used for usage attribution."),
|
|
328
328
|
metadata: metadataSchema
|
|
329
329
|
.default({})
|
|
330
|
-
.describe("Your own key-value data, recorded with the usage."),
|
|
330
|
+
.describe("Your own key-value data, recorded with the usage. At most 128 KiB as JSON."),
|
|
331
331
|
})
|
|
332
332
|
.strict()
|
|
333
333
|
.refine((body) => body.prompt === undefined
|
|
@@ -2,7 +2,6 @@ import { z } from "zod";
|
|
|
2
2
|
import { mcpConnectionIdSchema } from "../ids.js";
|
|
3
3
|
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
4
|
import { atLeastOneFieldMessage, hasObjectKeys, hasUniqueValues, } from "../utils.js";
|
|
5
|
-
const OPAQUE_MCP_OAUTH_TOKEN_PATTERN = /^[A-Za-z0-9_-]{43}$/;
|
|
6
5
|
export const mcpConnectionAuthTypeSchema = z.enum([
|
|
7
6
|
"none",
|
|
8
7
|
"bearer",
|
|
@@ -216,12 +215,10 @@ export const mcpOauthAuthorizationLaunchResponseSchema = z
|
|
|
216
215
|
.url()
|
|
217
216
|
.refine((value) => {
|
|
218
217
|
const url = new URL(value);
|
|
219
|
-
return (url.
|
|
218
|
+
return ((url.protocol === "https:" || url.protocol === "http:") &&
|
|
220
219
|
url.username === "" &&
|
|
221
220
|
url.password === "" &&
|
|
222
|
-
url.hash === ""
|
|
223
|
-
url.searchParams.size === 1 &&
|
|
224
|
-
OPAQUE_MCP_OAUTH_TOKEN_PATTERN.test(url.searchParams.get("setup") ?? ""));
|
|
221
|
+
url.hash === "");
|
|
225
222
|
}),
|
|
226
223
|
})
|
|
227
224
|
.strip();
|
|
@@ -70,7 +70,7 @@ const promptFieldDescriptions = {
|
|
|
70
70
|
name: "Display name, 1 to 80 characters.",
|
|
71
71
|
template: "Message template, up to 10,240 characters. Mark each variable as `{{name}}`; names match `[A-Za-z_][A-Za-z0-9_]*`, and a template can use up to 10 of them.",
|
|
72
72
|
agentId: "ID of an agent in your tenant to link the prompt to, or `null` for no link. Deleting the agent also deletes its linked prompts.",
|
|
73
|
-
metadata: "Your own key-value data, returned unchanged.",
|
|
73
|
+
metadata: "Your own key-value data, returned unchanged. At most 128 KiB as JSON.",
|
|
74
74
|
};
|
|
75
75
|
export const promptsListQuerySchema = z
|
|
76
76
|
.object({
|
|
@@ -145,7 +145,6 @@ export declare const sessionResponseSchema: z.ZodObject<{
|
|
|
145
145
|
write_todos: "write_todos";
|
|
146
146
|
}>>;
|
|
147
147
|
instructions: z.ZodString;
|
|
148
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
149
148
|
mcpConnectionIds: z.ZodArray<z.ZodString>;
|
|
150
149
|
}, z.core.$strip>;
|
|
151
150
|
forkedFrom: z.ZodNullable<z.ZodObject<{
|
|
@@ -371,7 +371,6 @@ export declare const taskRunResponseSchema: z.ZodObject<{
|
|
|
371
371
|
write_todos: "write_todos";
|
|
372
372
|
}>>;
|
|
373
373
|
instructions: z.ZodString;
|
|
374
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
375
374
|
mcpConnectionIds: z.ZodArray<z.ZodString>;
|
|
376
375
|
}, z.core.$strip>;
|
|
377
376
|
sessionId: z.ZodNullable<z.ZodString>;
|
|
@@ -510,7 +509,6 @@ export declare const taskRunsListResponseSchema: z.ZodObject<{
|
|
|
510
509
|
write_todos: "write_todos";
|
|
511
510
|
}>>;
|
|
512
511
|
instructions: z.ZodString;
|
|
513
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
514
512
|
mcpConnectionIds: z.ZodArray<z.ZodString>;
|
|
515
513
|
}, z.core.$strip>;
|
|
516
514
|
sessionId: z.ZodNullable<z.ZodString>;
|
|
@@ -101,7 +101,7 @@ const taskFieldDescriptions = {
|
|
|
101
101
|
enabled: "Whether the schedule fires. A disabled task can still be started on demand.",
|
|
102
102
|
submit: "Start a run as soon as the task is created.",
|
|
103
103
|
userId: "Your end user's ID, used for attribution. An empty string means a tenant-level task. It cannot change after creation.",
|
|
104
|
-
metadata: "Your own key-value data, returned unchanged and copied to each run.",
|
|
104
|
+
metadata: "Your own key-value data, returned unchanged and copied to each run. At most 128 KiB as JSON.",
|
|
105
105
|
};
|
|
106
106
|
export const createTaskBodySchema = z
|
|
107
107
|
.object({
|
|
@@ -138,7 +138,7 @@ export const updateTaskBodySchema = z
|
|
|
138
138
|
enabled: z.boolean().optional().describe(taskFieldDescriptions.enabled),
|
|
139
139
|
metadata: metadataSchema
|
|
140
140
|
.optional()
|
|
141
|
-
.describe("Your own key-value data. Replaces the current metadata."),
|
|
141
|
+
.describe("Your own key-value data. Replaces the current metadata. At most 128 KiB as JSON."),
|
|
142
142
|
})
|
|
143
143
|
.strict()
|
|
144
144
|
.refine(hasObjectKeys, {
|
|
@@ -52,7 +52,7 @@ export const createWorkspaceBodySchema = z
|
|
|
52
52
|
.describe('Your own ID for the end user who owns the workspace. `""` means a tenant-level workspace. It cannot be changed later.'),
|
|
53
53
|
metadata: metadataSchema
|
|
54
54
|
.default({})
|
|
55
|
-
.describe("Your own key-value data, returned as sent."),
|
|
55
|
+
.describe("Your own key-value data, returned as sent. At most 128 KiB as JSON."),
|
|
56
56
|
networkPolicy: workspaceNetworkPolicySchema
|
|
57
57
|
.default({ mode: "unrestricted" })
|
|
58
58
|
.describe(networkPolicyDescription),
|
|
@@ -66,7 +66,7 @@ export const updateWorkspaceBodySchema = z
|
|
|
66
66
|
.describe(`New display name, up to ${MAX_WORKSPACE_NAME_LENGTH} characters, or \`null\` to clear it.`),
|
|
67
67
|
metadata: metadataSchema
|
|
68
68
|
.optional()
|
|
69
|
-
.describe("Replaces the workspace's metadata."),
|
|
69
|
+
.describe("Replaces the workspace's metadata. At most 128 KiB as JSON."),
|
|
70
70
|
networkPolicy: workspaceNetworkPolicySchema
|
|
71
71
|
.optional()
|
|
72
72
|
.describe(`Replaces the network policy. ${networkPolicyDescription}`),
|
|
@@ -39,6 +39,8 @@ export declare const MAX_MCP_ATTACHMENT_METADATA_KEY_LENGTH = 64;
|
|
|
39
39
|
/** Agents — name ≤ 80, instructions ≤ 3000. */
|
|
40
40
|
export declare const MAX_AGENT_NAME_LENGTH = 80;
|
|
41
41
|
export declare const MAX_AGENT_INSTRUCTIONS_LENGTH = 3000;
|
|
42
|
+
/** Metadata — 128 KiB of compact JSON on every resource that takes it. */
|
|
43
|
+
export declare const MAX_METADATA_BYTES: number;
|
|
42
44
|
/** Artifacts — 10 MiB per file. */
|
|
43
45
|
export declare const MAX_ARTIFACT_BYTES: number;
|
|
44
46
|
/** Memories — 10 KiB of text per memory. */
|
|
@@ -39,6 +39,8 @@ export const MAX_MCP_ATTACHMENT_METADATA_KEY_LENGTH = 64;
|
|
|
39
39
|
/** Agents — name ≤ 80, instructions ≤ 3000. */
|
|
40
40
|
export const MAX_AGENT_NAME_LENGTH = 80;
|
|
41
41
|
export const MAX_AGENT_INSTRUCTIONS_LENGTH = 3000;
|
|
42
|
+
/** Metadata — 128 KiB of compact JSON on every resource that takes it. */
|
|
43
|
+
export const MAX_METADATA_BYTES = 128 * 1024;
|
|
42
44
|
/** Artifacts — 10 MiB per file. */
|
|
43
45
|
export const MAX_ARTIFACT_BYTES = 10 * 1024 * 1024;
|
|
44
46
|
/** Memories — 10 KiB of text per memory. */
|