@blazingagents/sdk 0.34.0 → 0.36.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.
Files changed (74) hide show
  1. package/dist/chat-transport.js +4 -1
  2. package/dist/client.d.ts +18 -2
  3. package/dist/client.js +16 -15
  4. package/dist/contracts/entities/agents.d.ts +7 -6
  5. package/dist/contracts/entities/agents.js +129 -36
  6. package/dist/contracts/entities/chat-connections.d.ts +9 -8
  7. package/dist/contracts/entities/chat-connections.js +70 -40
  8. package/dist/contracts/entities/chat.d.ts +8 -4
  9. package/dist/contracts/entities/chat.js +102 -28
  10. package/dist/contracts/entities/mcp-connections.d.ts +2 -0
  11. package/dist/contracts/entities/mcp-connections.js +36 -23
  12. package/dist/contracts/entities/memories.d.ts +1 -0
  13. package/dist/contracts/entities/memories.js +5 -3
  14. package/dist/contracts/entities/merchant.js +28 -9
  15. package/dist/contracts/entities/prompts.d.ts +2 -2
  16. package/dist/contracts/entities/prompts.js +42 -15
  17. package/dist/contracts/entities/providers.js +14 -6
  18. package/dist/contracts/entities/sessions.d.ts +10 -4
  19. package/dist/contracts/entities/sessions.js +5 -4
  20. package/dist/contracts/entities/skills.js +6 -3
  21. package/dist/contracts/entities/tasks.d.ts +4 -7
  22. package/dist/contracts/entities/tasks.js +45 -15
  23. package/dist/contracts/entities/tenants.d.ts +2 -28
  24. package/dist/contracts/entities/tenants.js +15 -22
  25. package/dist/contracts/entities/usage.d.ts +1 -1
  26. package/dist/contracts/entities/usage.js +16 -6
  27. package/dist/contracts/entities/workspaces.d.ts +1 -1
  28. package/dist/contracts/entities/workspaces.js +26 -10
  29. package/dist/contracts/index.d.ts +18 -13
  30. package/dist/contracts/index.js +12 -12
  31. package/dist/contracts/limitations.d.ts +2 -4
  32. package/dist/contracts/limitations.js +2 -4
  33. package/dist/direct-chat-transport.js +2 -1
  34. package/dist/errors.d.ts +11 -0
  35. package/dist/errors.js +21 -0
  36. package/dist/http.d.ts +3 -1
  37. package/dist/http.js +74 -2
  38. package/dist/index.d.ts +18 -1
  39. package/dist/resources/agents.d.ts +120 -1
  40. package/dist/resources/agents.js +1 -33
  41. package/dist/resources/artifacts.d.ts +42 -1
  42. package/dist/resources/artifacts.js +0 -12
  43. package/dist/resources/chat-connections.d.ts +110 -1
  44. package/dist/resources/chat-connections.js +31 -44
  45. package/dist/resources/chat-deliveries.d.ts +23 -1
  46. package/dist/resources/chat-deliveries.js +2 -4
  47. package/dist/resources/mcp-connections.d.ts +63 -1
  48. package/dist/resources/mcp-connections.js +10 -24
  49. package/dist/resources/memories.d.ts +58 -1
  50. package/dist/resources/memories.js +0 -15
  51. package/dist/resources/merchant-bindings.d.ts +39 -1
  52. package/dist/resources/merchant-bindings.js +0 -9
  53. package/dist/resources/merchant-connection.d.ts +37 -1
  54. package/dist/resources/merchant-connection.js +15 -16
  55. package/dist/resources/merchant-usage-events.d.ts +66 -1
  56. package/dist/resources/merchant-usage-events.js +0 -18
  57. package/dist/resources/prompts.d.ts +50 -1
  58. package/dist/resources/prompts.js +0 -15
  59. package/dist/resources/providers.d.ts +64 -1
  60. package/dist/resources/providers.js +7 -25
  61. package/dist/resources/sessions.d.ts +124 -1
  62. package/dist/resources/sessions.js +5 -36
  63. package/dist/resources/skills.d.ts +95 -1
  64. package/dist/resources/skills.js +0 -27
  65. package/dist/resources/tasks.d.ts +107 -1
  66. package/dist/resources/tasks.js +0 -30
  67. package/dist/resources/tenant.d.ts +23 -1
  68. package/dist/resources/tenant.js +2 -10
  69. package/dist/resources/usage.d.ts +34 -1
  70. package/dist/resources/usage.js +2 -15
  71. package/dist/resources/workspaces.d.ts +50 -1
  72. package/dist/resources/workspaces.js +0 -15
  73. package/dist/types.d.ts +17 -1083
  74. package/package.json +1 -2
@@ -4,7 +4,7 @@ import { agentIdSchema, sessionIdSchema } from "../ids.js";
4
4
  import { toolExecutionReferenceSchema } from "./agent-approval.js";
5
5
  import { agentConfigSchema, agentResponseSchema } from "./agents.js";
6
6
  import { metadataSchema, userIdSchema } from "./attribution.js";
7
- import { chatFunctionDefinitionsSchema } from "./chat.js";
7
+ import { chatRequestBodySchema } from "./chat.js";
8
8
  /**
9
9
  * `GET /v1/agents/{agentId}/sessions` list item. `agentId`/`tenantId` never
10
10
  * leak to the wire; `userId`/`metadata` come from the first successful Turn.
@@ -106,7 +106,7 @@ export const toolApprovalStateSchema = z
106
106
  decidedAt: z.iso.datetime({ offset: true }).nullable().optional(),
107
107
  approvalId: z.string().min(1),
108
108
  decision: z.enum(["pending", "approved", "denied"]),
109
- input: z.json(),
109
+ input: z.json().meta({ type: "object" }),
110
110
  reason: z.string().nullable(),
111
111
  toolCallId: z.string().min(1),
112
112
  toolName: z.string().min(1),
@@ -130,8 +130,9 @@ export const continueToolApprovalsBodySchema = z
130
130
  .array(toolApprovalDecisionSchema)
131
131
  .min(1)
132
132
  .refine((decisions) => new Set(decisions.map((decision) => decision.approvalId)).size ===
133
- decisions.length, { message: "Approval IDs must be distinct." }),
134
- functions: chatFunctionDefinitionsSchema.optional(),
133
+ decisions.length, { message: "Approval IDs must be distinct." })
134
+ .describe("One decision for every approval in the current round."),
135
+ functions: chatRequestBodySchema.shape.functions,
135
136
  })
136
137
  .strict();
137
138
  /**
@@ -55,8 +55,10 @@ export const skillDetailSchema = skillSchema
55
55
  export const skillsListResponseSchema = paginatedResponseSchema(skillSchema);
56
56
  export const createSkillBodySchema = z
57
57
  .object({
58
- path: z.literal("SKILL.md"),
59
- content: z.string(),
58
+ path: z.literal("SKILL.md").describe("Always `SKILL.md`."),
59
+ content: z
60
+ .string()
61
+ .describe("The `SKILL.md` document. It must start with YAML frontmatter that sets `name` and `description`."),
60
62
  })
61
63
  .strict();
62
64
  export const skillArchiveTypeSchema = z.enum(["zip", "tar", "tar.gz"]);
@@ -68,7 +70,8 @@ export const copySkillBodySchema = z
68
70
  .max(MAX_SKILL_COPY_DESTINATIONS)
69
71
  .refine(hasUniqueValues, {
70
72
  message: "Destination Agent ids must be unique.",
71
- }),
73
+ })
74
+ .describe("IDs of the agents to copy the skill to, each listed once. Send 1 to 30."),
72
75
  })
73
76
  .strict();
74
77
  const skillCopyCreatedResultSchema = z
@@ -41,13 +41,8 @@ export declare const taskScheduleInputSchema: z.ZodDiscriminatedUnion<[z.ZodObje
41
41
  timezone: z.ZodDefault<z.ZodString>;
42
42
  }, z.core.$strict>;
43
43
  }, z.core.$strict>], "kind">;
44
- /**
45
- * `POST /v1/tasks` — schedule present = scheduled task; absent = on-demand.
46
- * `submit: true` enqueues a run immediately. An optional `idempotencyKey`
47
- * makes retries return the original Task and initial run id. Without a key,
48
- * each call creates a new Task. Run creation has its own idempotency key.
49
- */
50
44
  export declare const createTaskBodySchema: z.ZodObject<{
45
+ idempotencyKey: z.ZodOptional<z.ZodString>;
51
46
  agentId: z.ZodString;
52
47
  name: z.ZodString;
53
48
  prompt: z.ZodString;
@@ -71,7 +66,6 @@ export declare const createTaskBodySchema: z.ZodObject<{
71
66
  }, z.core.$strict>], "kind">>>;
72
67
  enabled: z.ZodDefault<z.ZodBoolean>;
73
68
  submit: z.ZodDefault<z.ZodBoolean>;
74
- idempotencyKey: z.ZodOptional<z.ZodString>;
75
69
  userId: z.ZodDefault<z.ZodString>;
76
70
  metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
77
71
  }, z.core.$strict>;
@@ -601,6 +595,9 @@ export declare const taskRunMessagesResponseSchema: z.ZodObject<{
601
595
  succeeded: "succeeded";
602
596
  }>;
603
597
  }, z.core.$strip>;
598
+ export type TaskListItem = z.infer<typeof taskListItemSchema>;
599
+ export type TaskRunStatus = z.infer<typeof taskRunStatusSchema>;
600
+ export type TaskScheduleInput = z.infer<typeof taskScheduleInputSchema>;
604
601
  export type TasksListResponse = z.infer<typeof tasksListResponseSchema>;
605
602
  export type TaskResponse = z.infer<typeof taskResponseSchema>;
606
603
  export type TaskRunResponse = z.infer<typeof taskRunResponseSchema>;
@@ -110,27 +110,52 @@ const taskPromptSchema = z.string().trim().min(1).max(MAX_TASK_PROMPT_LENGTH);
110
110
  * makes retries return the original Task and initial run id. Without a key,
111
111
  * each call creates a new Task. Run creation has its own idempotency key.
112
112
  */
113
+ const taskFieldDescriptions = {
114
+ agentId: "ID of the agent that runs the task. It cannot change later.",
115
+ name: "Display name, 1 to 80 characters.",
116
+ prompt: "The prompt the agent receives on every run, 1 to 6,000 characters.",
117
+ schedule: "When the task runs by itself: `once` at a time, every `everyMs` milliseconds (at least 60,000) for `interval`, or a five-field cron expression in an IANA timezone for `cron`. `null` means the task runs only when you start it.",
118
+ enabled: "Whether the schedule fires. A disabled task can still be started on demand.",
119
+ submit: "Start a run as soon as the task is created.",
120
+ userId: "Your end user's ID, used for attribution. An empty string means a tenant-level task. It cannot change after creation.",
121
+ metadata: "Your own key-value data, returned unchanged and copied to each run.",
122
+ };
113
123
  export const createTaskBodySchema = z
114
124
  .object({
115
- agentId: agentIdSchema,
116
- name: taskNameSchema,
117
- prompt: taskPromptSchema,
118
- schedule: taskScheduleInputSchema.nullable().default(null),
119
- enabled: z.boolean().default(true),
120
- submit: z.boolean().default(false),
121
- idempotencyKey: z.string().trim().min(1).optional(),
122
- userId: userIdSchema.default(""),
123
- metadata: metadataSchema.default({}),
125
+ idempotencyKey: z
126
+ .string()
127
+ .trim()
128
+ .min(1)
129
+ .optional()
130
+ .describe("Retry the same creation with this key to return the current task and its original initial run. Changed requests or deleted tasks return a conflict."),
131
+ agentId: agentIdSchema.describe(taskFieldDescriptions.agentId),
132
+ name: taskNameSchema.describe(taskFieldDescriptions.name),
133
+ prompt: taskPromptSchema.describe(taskFieldDescriptions.prompt),
134
+ schedule: taskScheduleInputSchema
135
+ .nullable()
136
+ .default(null)
137
+ .describe(taskFieldDescriptions.schedule),
138
+ enabled: z.boolean().default(true).describe(taskFieldDescriptions.enabled),
139
+ submit: z.boolean().default(false).describe(taskFieldDescriptions.submit),
140
+ userId: userIdSchema.default("").describe(taskFieldDescriptions.userId),
141
+ metadata: metadataSchema
142
+ .default({})
143
+ .describe(taskFieldDescriptions.metadata),
124
144
  })
125
145
  .strict();
126
146
  // `PATCH /v1/tasks/{taskId}` — `agentId` and `userId` are immutable.
127
147
  export const updateTaskBodySchema = z
128
148
  .object({
129
- name: taskNameSchema.optional(),
130
- prompt: taskPromptSchema.optional(),
131
- schedule: taskScheduleInputSchema.nullable().optional(),
132
- enabled: z.boolean().optional(),
133
- metadata: metadataSchema.optional(),
149
+ name: taskNameSchema.optional().describe(taskFieldDescriptions.name),
150
+ prompt: taskPromptSchema.optional().describe(taskFieldDescriptions.prompt),
151
+ schedule: taskScheduleInputSchema
152
+ .nullable()
153
+ .optional()
154
+ .describe(taskFieldDescriptions.schedule),
155
+ enabled: z.boolean().optional().describe(taskFieldDescriptions.enabled),
156
+ metadata: metadataSchema
157
+ .optional()
158
+ .describe("Your own key-value data. Replaces the current metadata."),
134
159
  })
135
160
  .strict()
136
161
  .refine(hasObjectKeys, {
@@ -139,7 +164,12 @@ export const updateTaskBodySchema = z
139
164
  // `POST /v1/tasks/{taskId}/runs` — optional client idempotency key.
140
165
  export const createTaskRunBodySchema = z
141
166
  .object({
142
- idempotencyKey: z.string().trim().min(1).optional(),
167
+ idempotencyKey: z
168
+ .string()
169
+ .trim()
170
+ .min(1)
171
+ .optional()
172
+ .describe("Your own key for this run. Retrying with the same key returns the same run instead of starting another."),
143
173
  })
144
174
  .strict();
145
175
  /**
@@ -1,32 +1,4 @@
1
1
  import { z } from "zod";
2
- /**
3
- * `GET /v1/me` (JWT-only) — the tenant record. `authUserId` is a uuid
4
- * referencing `auth.users(id)` per the migration.
5
- */
6
- export declare const tenantSchema: z.ZodObject<{
7
- id: z.ZodString;
8
- authUserId: z.ZodUUID;
9
- email: z.ZodString;
10
- name: z.ZodString;
11
- createdAt: z.ZodISODateTime;
12
- updatedAt: z.ZodISODateTime;
13
- }, z.core.$strip>;
14
- export declare const subscriptionStatusSchema: z.ZodEnum<{
15
- active: "active";
16
- inactive: "inactive";
17
- }>;
18
- export declare const tenantResponseSchema: z.ZodObject<{
19
- id: z.ZodString;
20
- authUserId: z.ZodUUID;
21
- email: z.ZodString;
22
- name: z.ZodString;
23
- createdAt: z.ZodISODateTime;
24
- updatedAt: z.ZodISODateTime;
25
- subscriptionStatus: z.ZodEnum<{
26
- active: "active";
27
- inactive: "inactive";
28
- }>;
29
- }, z.core.$strip>;
30
2
  /**
31
3
  * Tenant deletion lifecycle — `requestedAt` marks the tenant deleting and
32
4
  * `deletesAt` is the scheduled permanent-deletion time (24 hours after
@@ -76,5 +48,7 @@ export declare const updateTenantSettingsBodySchema: z.ZodObject<{
76
48
  resetDay: z.ZodNumber;
77
49
  }, z.core.$strict>>>;
78
50
  }, z.core.$strict>;
51
+ export type Quota = z.infer<typeof quotaSchema>;
52
+ export type TenantDeletion = z.infer<typeof tenantDeletionSchema>;
79
53
  export type TenantSettingsResponse = z.infer<typeof tenantSettingsResponseSchema>;
80
54
  export type UpdateTenantSettingsBody = z.infer<typeof updateTenantSettingsBodySchema>;
@@ -1,25 +1,6 @@
1
1
  import { z } from "zod";
2
- import { tenantIdSchema } from "../ids.js";
3
2
  import { MAX_QUOTA_RESET_DAY, MAX_TENANT_NAME_LENGTH, MIN_QUOTA_RESET_DAY, } from "../limitations.js";
4
3
  import { atLeastOneFieldMessage, hasObjectKeys } from "../utils.js";
5
- /**
6
- * `GET /v1/me` (JWT-only) — the tenant record. `authUserId` is a uuid
7
- * referencing `auth.users(id)` per the migration.
8
- */
9
- export const tenantSchema = z
10
- .object({
11
- id: tenantIdSchema,
12
- authUserId: z.uuid(),
13
- email: z.string().min(1),
14
- name: z.string().min(1),
15
- createdAt: z.iso.datetime({ offset: true }),
16
- updatedAt: z.iso.datetime({ offset: true }),
17
- })
18
- .strip();
19
- export const subscriptionStatusSchema = z.enum(["active", "inactive"]);
20
- export const tenantResponseSchema = tenantSchema
21
- .extend({ subscriptionStatus: subscriptionStatusSchema })
22
- .strip();
23
4
  /**
24
5
  * Tenant deletion lifecycle — `requestedAt` marks the tenant deleting and
25
6
  * `deletesAt` is the scheduled permanent-deletion time (24 hours after
@@ -62,9 +43,21 @@ export const tenantSettingsResponseSchema = tenantSettingsSchema
62
43
  .strip();
63
44
  export const updateTenantSettingsBodySchema = z
64
45
  .object({
65
- monetizationEnabled: z.boolean().optional(),
66
- name: z.string().trim().min(1).max(MAX_TENANT_NAME_LENGTH).optional(),
67
- quota: quotaSchema.nullable().optional(),
46
+ monetizationEnabled: z
47
+ .boolean()
48
+ .optional()
49
+ .describe("Bill usage to your end users through your merchant account. Turning it off drops usage events your merchant has not yet accepted."),
50
+ name: z
51
+ .string()
52
+ .trim()
53
+ .min(1)
54
+ .max(MAX_TENANT_NAME_LENGTH)
55
+ .optional()
56
+ .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."),
68
61
  })
69
62
  .strict()
70
63
  .refine(hasObjectKeys, {
@@ -35,9 +35,9 @@ export declare const usageTotalsSchema: z.ZodObject<{
35
35
  durationMs: z.ZodNumber;
36
36
  }, z.core.$strip>;
37
37
  export declare const sessionUsageQuerySchema: z.ZodObject<{
38
- sessionIds: z.ZodArray<z.ZodString>;
39
38
  from: z.ZodOptional<z.ZodISODate>;
40
39
  to: z.ZodOptional<z.ZodISODate>;
40
+ sessionIds: z.ZodArray<z.ZodString>;
41
41
  }, z.core.$strict>;
42
42
  export declare const sessionUsageResponseSchema: z.ZodObject<{
43
43
  data: z.ZodArray<z.ZodObject<{
@@ -34,20 +34,30 @@ function validateUsageRange(value, ctx) {
34
34
  }
35
35
  }
36
36
  }
37
+ const usageRangeFields = {
38
+ from: z.iso
39
+ .date()
40
+ .optional()
41
+ .describe("First UTC day to include, as `YYYY-MM-DD`. Send it with `to`, or leave both out for the last 30 days ending today."),
42
+ to: z.iso
43
+ .date()
44
+ .optional()
45
+ .describe(`Last UTC day to include, as \`YYYY-MM-DD\`. It must not be before \`from\` and can be at most ${MAX_USAGE_RANGE_DAYS} days after it.`),
46
+ };
37
47
  /**
38
48
  * Query for the bounded dashboard-oriented usage overview. The date range has
39
49
  * the same semantics as `UsageQuery`; `limit` bounds each ranking.
40
50
  */
41
51
  export const usageOverviewQuerySchema = z
42
52
  .object({
43
- from: z.iso.date().optional(),
44
- to: z.iso.date().optional(),
53
+ ...usageRangeFields,
45
54
  limit: z
46
55
  .number()
47
56
  .int()
48
57
  .min(1)
49
58
  .max(MAX_USAGE_OVERVIEW_TOP_N)
50
- .default(DEFAULT_USAGE_OVERVIEW_TOP_N),
59
+ .default(DEFAULT_USAGE_OVERVIEW_TOP_N)
60
+ .describe(`Rows to return in each ranked breakdown (\`byAgent\`, \`byUser\`, \`byModel\`), from 1 to ${MAX_USAGE_OVERVIEW_TOP_N}.`),
51
61
  })
52
62
  .strict()
53
63
  .superRefine(validateUsageRange);
@@ -89,9 +99,9 @@ export const sessionUsageQuerySchema = z
89
99
  .max(100)
90
100
  .refine(hasUniqueValues, {
91
101
  message: "Session ids must be unique.",
92
- }),
93
- from: z.iso.date().optional(),
94
- to: z.iso.date().optional(),
102
+ })
103
+ .describe("One to 100 distinct session IDs. Every session must be visible to the caller."),
104
+ ...usageRangeFields,
95
105
  })
96
106
  .strict()
97
107
  .superRefine(validateUsageRange);
@@ -34,11 +34,11 @@ export declare const workspaceSchema: z.ZodObject<{
34
34
  updatedAt: z.ZodISODateTime;
35
35
  }, z.core.$strip>;
36
36
  export declare const createWorkspaceBodySchema: z.ZodObject<{
37
- name: z.ZodOptional<z.ZodString>;
38
37
  tier: z.ZodDefault<z.ZodEnum<{
39
38
  core: "core";
40
39
  plus: "plus";
41
40
  }>>;
41
+ name: z.ZodOptional<z.ZodString>;
42
42
  userId: z.ZodDefault<z.ZodString>;
43
43
  metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
44
44
  networkPolicy: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -38,22 +38,38 @@ export const workspaceSchema = z
38
38
  updatedAt: z.iso.datetime({ offset: true }),
39
39
  })
40
40
  .strip();
41
+ const networkPolicyDescription = "Which hosts the workspace can reach: `unrestricted`, `allowlist` with `allowedHosts`, or `offline`.";
41
42
  export const createWorkspaceBodySchema = z
42
43
  .object({
43
- name: workspaceNameSchema.optional(),
44
- tier: workspaceTierSchema.default("core"),
45
- userId: userIdSchema.default(""),
46
- metadata: metadataSchema.default({}),
47
- networkPolicy: workspaceNetworkPolicySchema.default({
48
- mode: "unrestricted",
49
- }),
44
+ tier: workspaceTierSchema
45
+ .default("core")
46
+ .describe("Workspace tier, fixed at creation. Core loses its files when the workspace stops; Plus keeps them when it stops while idle."),
47
+ name: workspaceNameSchema
48
+ .optional()
49
+ .describe(`Display name, up to ${MAX_WORKSPACE_NAME_LENGTH} characters. Leave it out for an unnamed workspace.`),
50
+ userId: userIdSchema
51
+ .default("")
52
+ .describe('Your own ID for the end user who owns the workspace. `""` means a tenant-level workspace. It cannot be changed later.'),
53
+ metadata: metadataSchema
54
+ .default({})
55
+ .describe("Your own key-value data, returned as sent."),
56
+ networkPolicy: workspaceNetworkPolicySchema
57
+ .default({ mode: "unrestricted" })
58
+ .describe(networkPolicyDescription),
50
59
  })
51
60
  .strict();
52
61
  export const updateWorkspaceBodySchema = z
53
62
  .object({
54
- name: workspaceNameSchema.nullable().optional(),
55
- metadata: metadataSchema.optional(),
56
- networkPolicy: workspaceNetworkPolicySchema.optional(),
63
+ name: workspaceNameSchema
64
+ .nullable()
65
+ .optional()
66
+ .describe(`New display name, up to ${MAX_WORKSPACE_NAME_LENGTH} characters, or \`null\` to clear it.`),
67
+ metadata: metadataSchema
68
+ .optional()
69
+ .describe("Replaces the workspace's metadata."),
70
+ networkPolicy: workspaceNetworkPolicySchema
71
+ .optional()
72
+ .describe(`Replaces the network policy. ${networkPolicyDescription}`),
57
73
  })
58
74
  .strict()
59
75
  .refine(hasObjectKeys, { message: "At least one field is required." });
@@ -4,28 +4,33 @@ export type { ApprovalDecision, ApprovalPolicy, ToolExecutionReference, ToolRefe
4
4
  export { approvalDecisionSchema, approvalPolicySchema, toolExecutionReferenceSchema, toolReferenceSchema, } from "./entities/agent-approval.ts";
5
5
  export type { AgentToolDefinition, AgentToolFileAccessTag, AgentToolGroupTag, AgentToolName, AgentToolTag, AgentToolTags, } from "./entities/agent-tools.ts";
6
6
  export { AGENT_TOOL_FILE_ACCESS_TAGS, AGENT_TOOL_GROUPS, AGENT_TOOL_TAGS, AGENT_TOOLS, agentToolNames, chatFunctionNameSchema, } from "./entities/agent-tools.ts";
7
- export { agentConfigSchema, agentResponseSchema, agentStatusSchema, agentsListQuerySchema, agentsResponseSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.ts";
8
- export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.ts";
9
- export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.ts";
7
+ export type { AgentStatus } from "./entities/agents.ts";
8
+ export { agentConfigSchema, agentInstructionsSchema, agentModelIdSchema, agentResponseSchema, agentStatusSchema, agentsListQuerySchema, agentsResponseSchema, agentToolsSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.ts";
9
+ export { artifactDownloadUrlResponseSchema, artifactFilenameSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.ts";
10
+ export { attributionCreateInputSchema, metadataSchema, userIdSchema, } from "./entities/attribution.ts";
10
11
  export type { ChatFunctionCallEvent, ChatFunctionDefinition, ChatFunctionDefinitions, ChatFunctionOutcome, ClaimChatFunctionBody, PromptVariables, ResolveChatFunctionBody, UsageSummary, } from "./entities/chat.ts";
11
12
  export { blazingAgentsChatMessageMetadataSchema, chatFunctionCallEventSchema, chatFunctionDefinitionSchema, chatFunctionDefinitionsSchema, chatFunctionOutcomeSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, claimChatFunctionBodySchema, claimChatFunctionResponseSchema, generationRequestBodySchema, jsonSchemaShapeSchema, MAX_CHAT_FUNCTION_DEFINITIONS_BYTES, MAX_CHAT_FUNCTION_PAYLOAD_BYTES, MAX_CHAT_FUNCTIONS, promptVariablesSchema, resolveChatFunctionBodySchema, resolveChatFunctionResponseSchema, usageSummarySchema, } from "./entities/chat.ts";
12
13
  export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatDeliveriesResponseSchema, chatDeliveryListSchema, chatDeliveryListStatusSchema, chatDeliveryResultSchema, chatDeliverySchema, chatDeliveryStatusSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, repairChatDeliveryBodySchema, rotateChatConnectionBodySchema, tenantChatDeliverySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.ts";
13
- export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.ts";
14
- export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.ts";
15
- export { createMerchantConnectionBodySchema, merchantBindingResponseSchema, merchantBindingsResponseSchema, merchantConnectionResponseSchema, merchantConnectionSchema, merchantConnectionStatusSchema, merchantCustomerBindingSchema, merchantEnvironmentSchema, merchantGuardSchema, merchantProviderSchema, merchantUsageEventNextAction, merchantUsageEventNextActionSchema, merchantUsageEventSchema, merchantUsageEventStatusSchema, merchantUsageEventsResponseSchema, merchantUsageSummaryQuerySchema, merchantUsageSummaryResponseSchema, merchantUsageSummarySchema, merchantWorkflowIssueSchema, updateMerchantConnectionBodySchema, upsertMerchantBindingBodySchema, } from "./entities/merchant.ts";
14
+ export type { McpConnectionLiveDetails, McpConnectionTestErrorCode, } from "./entities/mcp-connections.ts";
15
+ export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, forwardedMetadataKeysSchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionLiveDetailsSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.ts";
16
+ export type { CreateMemoryBody, Memory, UpdateMemoryBody, } from "./entities/memories.ts";
17
+ export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, memoryTextSchema, updateMemoryBodySchema, } from "./entities/memories.ts";
18
+ export { createMerchantConnectionBodySchema, merchantBindingResponseSchema, merchantBindingsResponseSchema, merchantConnectionResponseSchema, merchantConnectionSchema, merchantConnectionStatusSchema, merchantCustomerBindingSchema, merchantEnvironmentSchema, merchantGuardSchema, merchantProviderSchema, merchantUsageEventNextAction, merchantUsageEventNextActionSchema, merchantUsageEventResponseSchema, merchantUsageEventSchema, merchantUsageEventStatusSchema, merchantUsageEventsResponseSchema, merchantUsageSummaryQuerySchema, merchantUsageSummaryResponseSchema, merchantUsageSummarySchema, merchantWorkflowIssueSchema, updateMerchantConnectionBodySchema, upsertMerchantBindingBodySchema, } from "./entities/merchant.ts";
16
19
  export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptsListQuerySchema, promptsResponseSchema, promptTemplateSchema, renderPromptTemplate, updatePromptBodySchema, } from "./entities/prompts.ts";
17
20
  export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.ts";
18
21
  export type { ChatSteerConsumedEvent, SessionActivity, SessionInput, SessionInputResponse, SessionInputState, SessionInputsQuery, SessionInputsResponse, StopSessionBody, StopSessionResponse, SubmitSessionInputBody, } from "./entities/session-inputs.ts";
19
22
  export { chatSteerConsumedEventSchema, sessionActivitySchema, sessionInputRequestIdSchema, sessionInputResponseSchema, sessionInputSchema, sessionInputStateSchema, sessionInputsQuerySchema, sessionInputsResponseSchema, stopSessionBodySchema, stopSessionResponseSchema, submitSessionInputBodySchema, } from "./entities/session-inputs.ts";
20
- export type { ContinueToolApprovalsBody, SessionForkedFrom, ToolApprovalContinuationState, ToolApprovalDecision, ToolApprovalsResponse, TurnStreamErrorEvent, } from "./entities/sessions.ts";
21
- export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionForkedFromSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, turnStreamErrorEventSchema, } from "./entities/sessions.ts";
22
- export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.ts";
23
+ export type { ContinueToolApprovalsBody, LatestSessionListItem, SessionForkedFrom, SessionListItem, SessionMessage, ToolApprovalContinuationState, ToolApprovalDecision, ToolApprovalsResponse, TurnStreamErrorEvent, } from "./entities/sessions.ts";
24
+ export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionForkedFromSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, turnStreamErrorEventSchema, } from "./entities/sessions.ts";
25
+ export { copySkillBodySchema, createSkillBodySchema, skillArchiveTypeSchema, skillCopyResultsSchema, skillDescriptionSchema, skillDetailSchema, skillFilePathSchema, skillMetadataSchema, skillNameSchema, skillSchema, skillsListResponseSchema, } from "./entities/skills.ts";
23
26
  export type { SpendingLimit, SpendingLimitResponse, SpendingLimitStopDetails, UpdateSpendingLimitBody, } from "./entities/spending-limits.ts";
24
27
  export { nextSpendingLimitReset, spendingLimitPeriodSchema, spendingLimitResetIntervalSchema, spendingLimitResponseSchema, spendingLimitSchema, spendingLimitStopDetailsSchema, updateSpendingLimitBodySchema, } from "./entities/spending-limits.ts";
25
- export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.ts";
26
- export { quotaSchema, subscriptionStatusSchema, tenantDeletionSchema, tenantResponseSchema, tenantSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.ts";
28
+ export type { CreateTaskBody, TaskListItem, TaskRunStatus, TaskScheduleInput, UpdateTaskBody, } from "./entities/tasks.ts";
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 { Quota, TenantDeletion, UpdateTenantSettingsBody, } from "./entities/tenants.ts";
31
+ export { quotaSchema, tenantDeletionSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.ts";
27
32
  export type { SessionUsageQuery, SessionUsageResponse, UsageBucket, UsageOverviewQuery, UsageOverviewResponse, UsageResponse, UsageTotals, } from "./entities/usage.ts";
28
33
  export { sessionUsageQuerySchema, sessionUsageResponseSchema, usageOverviewQuerySchema, usageOverviewResponseSchema, usageResponseSchema, } from "./entities/usage.ts";
29
34
  export type { WorkspaceTier } from "./entities/workspaces.ts";
30
- export { createWorkspaceBodySchema, updateWorkspaceBodySchema, workspaceSchema, workspacesListResponseSchema, workspaceTierSchema, } from "./entities/workspaces.ts";
31
- export { agentIdSchema, apiKeyTokenSchema, functionCallIdSchema, isAdminAgentId, promptIdSchema, sessionIdSchema, } from "./ids.ts";
35
+ export { createWorkspaceBodySchema, updateWorkspaceBodySchema, workspaceNetworkPolicySchema, workspaceSchema, workspacesListResponseSchema, workspaceTierSchema, } from "./entities/workspaces.ts";
36
+ export { agentIdSchema, apiKeyTokenSchema, chatDeliveryIdSchema, functionCallIdSchema, isAdminAgentId, merchantUsageEventIdSchema, promptIdSchema, sessionIdSchema, } from "./ids.ts";
@@ -3,22 +3,22 @@
3
3
  export { receivedApiErrorResponseSchema } from "./api.js";
4
4
  export { approvalDecisionSchema, approvalPolicySchema, toolExecutionReferenceSchema, toolReferenceSchema, } from "./entities/agent-approval.js";
5
5
  export { AGENT_TOOL_FILE_ACCESS_TAGS, AGENT_TOOL_GROUPS, AGENT_TOOL_TAGS, AGENT_TOOLS, agentToolNames, chatFunctionNameSchema, } from "./entities/agent-tools.js";
6
- export { agentConfigSchema, agentResponseSchema, agentStatusSchema, agentsListQuerySchema, agentsResponseSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.js";
7
- export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.js";
8
- export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.js";
6
+ export { agentConfigSchema, agentInstructionsSchema, agentModelIdSchema, agentResponseSchema, agentStatusSchema, agentsListQuerySchema, agentsResponseSchema, agentToolsSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.js";
7
+ export { artifactDownloadUrlResponseSchema, artifactFilenameSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.js";
8
+ export { attributionCreateInputSchema, metadataSchema, userIdSchema, } from "./entities/attribution.js";
9
9
  export { blazingAgentsChatMessageMetadataSchema, chatFunctionCallEventSchema, chatFunctionDefinitionSchema, chatFunctionDefinitionsSchema, chatFunctionOutcomeSchema, chatModeSchema, chatRequestBodySchema, chatTriggerSchema, claimChatFunctionBodySchema, claimChatFunctionResponseSchema, generationRequestBodySchema, jsonSchemaShapeSchema, MAX_CHAT_FUNCTION_DEFINITIONS_BYTES, MAX_CHAT_FUNCTION_PAYLOAD_BYTES, MAX_CHAT_FUNCTIONS, promptVariablesSchema, resolveChatFunctionBodySchema, resolveChatFunctionResponseSchema, usageSummarySchema, } from "./entities/chat.js";
10
10
  export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatDeliveriesResponseSchema, chatDeliveryListSchema, chatDeliveryListStatusSchema, chatDeliveryResultSchema, chatDeliverySchema, chatDeliveryStatusSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, repairChatDeliveryBodySchema, rotateChatConnectionBodySchema, tenantChatDeliverySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.js";
11
- export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.js";
12
- export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.js";
13
- export { createMerchantConnectionBodySchema, merchantBindingResponseSchema, merchantBindingsResponseSchema, merchantConnectionResponseSchema, merchantConnectionSchema, merchantConnectionStatusSchema, merchantCustomerBindingSchema, merchantEnvironmentSchema, merchantGuardSchema, merchantProviderSchema, merchantUsageEventNextAction, merchantUsageEventNextActionSchema, merchantUsageEventSchema, merchantUsageEventStatusSchema, merchantUsageEventsResponseSchema, merchantUsageSummaryQuerySchema, merchantUsageSummaryResponseSchema, merchantUsageSummarySchema, merchantWorkflowIssueSchema, updateMerchantConnectionBodySchema, upsertMerchantBindingBodySchema, } from "./entities/merchant.js";
11
+ export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, forwardedMetadataKeysSchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionLiveDetailsSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.js";
12
+ export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, memoryTextSchema, updateMemoryBodySchema, } from "./entities/memories.js";
13
+ export { createMerchantConnectionBodySchema, merchantBindingResponseSchema, merchantBindingsResponseSchema, merchantConnectionResponseSchema, merchantConnectionSchema, merchantConnectionStatusSchema, merchantCustomerBindingSchema, merchantEnvironmentSchema, merchantGuardSchema, merchantProviderSchema, merchantUsageEventNextAction, merchantUsageEventNextActionSchema, merchantUsageEventResponseSchema, merchantUsageEventSchema, merchantUsageEventStatusSchema, merchantUsageEventsResponseSchema, merchantUsageSummaryQuerySchema, merchantUsageSummaryResponseSchema, merchantUsageSummarySchema, merchantWorkflowIssueSchema, updateMerchantConnectionBodySchema, upsertMerchantBindingBodySchema, } from "./entities/merchant.js";
14
14
  export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptsListQuerySchema, promptsResponseSchema, promptTemplateSchema, renderPromptTemplate, updatePromptBodySchema, } from "./entities/prompts.js";
15
15
  export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.js";
16
16
  export { chatSteerConsumedEventSchema, sessionActivitySchema, sessionInputRequestIdSchema, sessionInputResponseSchema, sessionInputSchema, sessionInputStateSchema, sessionInputsQuerySchema, sessionInputsResponseSchema, stopSessionBodySchema, stopSessionResponseSchema, submitSessionInputBodySchema, } from "./entities/session-inputs.js";
17
- export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionForkedFromSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, turnStreamErrorEventSchema, } from "./entities/sessions.js";
18
- export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.js";
17
+ export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionForkedFromSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, turnStreamErrorEventSchema, } from "./entities/sessions.js";
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
- export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.js";
21
- export { quotaSchema, subscriptionStatusSchema, tenantDeletionSchema, tenantResponseSchema, tenantSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.js";
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 { quotaSchema, tenantDeletionSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.js";
22
22
  export { sessionUsageQuerySchema, sessionUsageResponseSchema, usageOverviewQuerySchema, usageOverviewResponseSchema, usageResponseSchema, } from "./entities/usage.js";
23
- export { createWorkspaceBodySchema, updateWorkspaceBodySchema, workspaceSchema, workspacesListResponseSchema, workspaceTierSchema, } from "./entities/workspaces.js";
24
- export { agentIdSchema, apiKeyTokenSchema, functionCallIdSchema, isAdminAgentId, promptIdSchema, sessionIdSchema, } from "./ids.js";
23
+ export { createWorkspaceBodySchema, updateWorkspaceBodySchema, workspaceNetworkPolicySchema, workspaceSchema, workspacesListResponseSchema, workspaceTierSchema, } from "./entities/workspaces.js";
24
+ export { agentIdSchema, apiKeyTokenSchema, chatDeliveryIdSchema, functionCallIdSchema, isAdminAgentId, merchantUsageEventIdSchema, promptIdSchema, sessionIdSchema, } from "./ids.js";
@@ -10,8 +10,8 @@ export declare const MAX_WORKSPACE_NAME_LENGTH = 80;
10
10
  export declare const MAX_SKILL_NAME_LENGTH = 64;
11
11
  export declare const MAX_SKILL_DESCRIPTION_LENGTH = 1024;
12
12
  export declare const MAX_SKILL_COPY_DESTINATIONS = 30;
13
- export declare const DEFAULT_PROMPTS_LIST_LIMIT = 50;
14
- export declare const MAX_PROMPTS_LIST_LIMIT = 100;
13
+ export declare const DEFAULT_RESOURCES_LIST_LIMIT = 50;
14
+ export declare const MAX_RESOURCES_LIST_LIMIT = 100;
15
15
  export declare const MAX_PROMPT_TEMPLATE_BYTES: number;
16
16
  export declare const MAX_PROMPT_VARIABLES = 10;
17
17
  export declare const MAX_PROMPT_NAME_LENGTH = 80;
@@ -38,8 +38,6 @@ export declare const MAX_MCP_ATTACHMENT_METADATA_KEYS = 32;
38
38
  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
- export declare const DEFAULT_AGENTS_LIST_LIMIT = 50;
42
- export declare const MAX_AGENTS_LIST_LIMIT = 100;
43
41
  export declare const MAX_AGENT_INSTRUCTIONS_LENGTH = 3000;
44
42
  /** Artifacts — 10 MiB per file. */
45
43
  export declare const MAX_ARTIFACT_BYTES: number;
@@ -10,8 +10,8 @@ export const MAX_WORKSPACE_NAME_LENGTH = 80;
10
10
  export const MAX_SKILL_NAME_LENGTH = 64;
11
11
  export const MAX_SKILL_DESCRIPTION_LENGTH = 1024;
12
12
  export const MAX_SKILL_COPY_DESTINATIONS = 30;
13
- export const DEFAULT_PROMPTS_LIST_LIMIT = 50;
14
- export const MAX_PROMPTS_LIST_LIMIT = 100;
13
+ export const DEFAULT_RESOURCES_LIST_LIMIT = 50;
14
+ export const MAX_RESOURCES_LIST_LIMIT = 100;
15
15
  export const MAX_PROMPT_TEMPLATE_BYTES = 10 * 1024;
16
16
  export const MAX_PROMPT_VARIABLES = 10;
17
17
  export const MAX_PROMPT_NAME_LENGTH = 80;
@@ -38,8 +38,6 @@ export const MAX_MCP_ATTACHMENT_METADATA_KEYS = 32;
38
38
  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
- export const DEFAULT_AGENTS_LIST_LIMIT = 50;
42
- export const MAX_AGENTS_LIST_LIMIT = 100;
43
41
  export const MAX_AGENT_INSTRUCTIONS_LENGTH = 3000;
44
42
  /** Artifacts — 10 MiB per file. */
45
43
  export const MAX_ARTIFACT_BYTES = 10 * 1024 * 1024;
@@ -2,6 +2,7 @@ import { lastAssistantMessageIsCompleteWithApprovalResponses, } from "ai";
2
2
  import { extractApprovalDecisions } from "./approvals.js";
3
3
  import { ChatStreamTransport } from "./chat-stream-transport.js";
4
4
  import { sessionIdSchema } from "./contracts/ids.js";
5
+ import { parseClientInput } from "./errors.js";
5
6
  /** Connects useChat directly to the SDK, including native streaming fetch clients. */
6
7
  export class BlazingAgentsDirectChatTransport extends ChatStreamTransport {
7
8
  #options;
@@ -16,7 +17,7 @@ export class BlazingAgentsDirectChatTransport extends ChatStreamTransport {
16
17
  this.#sessionId =
17
18
  options.sessionId === undefined
18
19
  ? undefined
19
- : sessionIdSchema.parse(options.sessionId);
20
+ : parseClientInput(sessionIdSchema, options.sessionId, "sessionId");
20
21
  }
21
22
  /**
22
23
  * Submits the supplied user messages directly to the SDK chat endpoint.
package/dist/errors.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  import type { BlazingAgentsErrorCode } from "./types.ts";
2
3
  declare const BLAZING_AGENTS_ERROR_SYMBOL: unique symbol;
3
4
  export declare class BlazingAgentsError extends Error {
@@ -39,4 +40,14 @@ export declare class BlazingAgentsError extends Error {
39
40
  */
40
41
  static isInstance(error: unknown): error is BlazingAgentsError;
41
42
  }
43
+ /**
44
+ * Parses caller input the SDK must check before any request, such as a value
45
+ * that becomes a header or transport state.
46
+ * @param schema - Schema the value must satisfy.
47
+ * @param value - Caller-supplied value.
48
+ * @param param - Name of the caller parameter, reported on the error.
49
+ * @returns The parsed value.
50
+ * @throws BlazingAgentsError - With code `invalid_request` if the value is invalid.
51
+ */
52
+ export declare function parseClientInput<Schema extends z.ZodType>(schema: Schema, value: unknown, param: string): z.output<Schema>;
42
53
  export {};
package/dist/errors.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  /**
2
3
  * The SDK's single error class. Server codes remain open for forward
3
4
  * compatibility; SDK-local codes distinguish transport, response, abort, and
@@ -53,3 +54,23 @@ export class BlazingAgentsError extends Error {
53
54
  return BLAZING_AGENTS_ERROR_SYMBOL in error;
54
55
  }
55
56
  }
57
+ /**
58
+ * Parses caller input the SDK must check before any request, such as a value
59
+ * that becomes a header or transport state.
60
+ * @param schema - Schema the value must satisfy.
61
+ * @param value - Caller-supplied value.
62
+ * @param param - Name of the caller parameter, reported on the error.
63
+ * @returns The parsed value.
64
+ * @throws BlazingAgentsError - With code `invalid_request` if the value is invalid.
65
+ */
66
+ export function parseClientInput(schema, value, param) {
67
+ const parsed = schema.safeParse(value);
68
+ if (!parsed.success) {
69
+ throw new BlazingAgentsError({
70
+ code: "invalid_request",
71
+ message: `Invalid ${param}: ${z.prettifyError(parsed.error)}`,
72
+ param,
73
+ }, { cause: parsed.error });
74
+ }
75
+ return parsed.data;
76
+ }
package/dist/http.d.ts CHANGED
@@ -2,7 +2,9 @@ import { BlazingAgentsError } from "./errors.ts";
2
2
  import type { HttpConfig, RequestOptions } from "./types.ts";
3
3
  /**
4
4
  * Builds an endpoint path, encoding each interpolated value so it stays inside
5
- * one path segment or query value.
5
+ * one path segment. `encodeURIComponent` leaves `.` and `..` unchanged, and
6
+ * URL normalization would resolve them against the parent path, so those and
7
+ * the empty segment are rejected.
6
8
  */
7
9
  export declare function apiPath(template: TemplateStringsArray, ...values: string[]): string;
8
10
  /**