@blazingagents/sdk 0.19.0 → 0.21.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 (85) hide show
  1. package/README.md +17 -1
  2. package/dist/approvals.d.ts +4 -12
  3. package/dist/approvals.js +12 -13
  4. package/dist/chat-transport.d.ts +18 -1
  5. package/dist/chat-transport.js +16 -0
  6. package/dist/client.d.ts +28 -5
  7. package/dist/client.js +39 -7
  8. package/dist/contracts/api.d.ts +40 -6
  9. package/dist/contracts/api.js +30 -2
  10. package/dist/contracts/entities/agent-tools.d.ts +5 -2
  11. package/dist/contracts/entities/agent-tools.js +5 -2
  12. package/dist/contracts/entities/agents.d.ts +4 -0
  13. package/dist/contracts/entities/agents.js +9 -0
  14. package/dist/contracts/entities/chat.d.ts +11 -10
  15. package/dist/contracts/entities/chat.js +11 -7
  16. package/dist/contracts/entities/mcp-connections.d.ts +3 -1
  17. package/dist/contracts/entities/mcp-connections.js +3 -1
  18. package/dist/contracts/entities/prompts.d.ts +13 -0
  19. package/dist/contracts/entities/prompts.js +13 -0
  20. package/dist/contracts/entities/session-inputs.d.ts +29 -87
  21. package/dist/contracts/entities/session-inputs.js +21 -19
  22. package/dist/contracts/entities/sessions.d.ts +27 -17
  23. package/dist/contracts/entities/sessions.js +23 -8
  24. package/dist/contracts/entities/skills.d.ts +3 -0
  25. package/dist/contracts/entities/skills.js +3 -0
  26. package/dist/contracts/entities/tasks.d.ts +1 -0
  27. package/dist/contracts/entities/usage.d.ts +4 -1
  28. package/dist/contracts/entities/usage.js +7 -1
  29. package/dist/contracts/entities/workspaces.d.ts +17 -6
  30. package/dist/contracts/entities/workspaces.js +3 -7
  31. package/dist/contracts/ids.d.ts +31 -0
  32. package/dist/contracts/ids.js +34 -0
  33. package/dist/contracts/index.d.ts +7 -6
  34. package/dist/contracts/index.js +4 -4
  35. package/dist/contracts/utils.d.ts +10 -0
  36. package/dist/contracts/utils.js +10 -0
  37. package/dist/direct-chat-transport.d.ts +30 -3
  38. package/dist/direct-chat-transport.js +40 -35
  39. package/dist/errors.d.ts +9 -0
  40. package/dist/errors.js +9 -0
  41. package/dist/functions.d.ts +35 -2
  42. package/dist/functions.js +60 -4
  43. package/dist/generation.d.ts +34 -2
  44. package/dist/generation.js +97 -19
  45. package/dist/http.d.ts +26 -0
  46. package/dist/http.js +43 -0
  47. package/dist/index.d.ts +4 -4
  48. package/dist/relay.d.ts +26 -3
  49. package/dist/relay.js +25 -10
  50. package/dist/resources/agents.d.ts +5 -0
  51. package/dist/resources/agents.js +38 -0
  52. package/dist/resources/artifacts.d.ts +2 -0
  53. package/dist/resources/artifacts.js +14 -0
  54. package/dist/resources/chat-connections.d.ts +5 -0
  55. package/dist/resources/chat-connections.js +32 -0
  56. package/dist/resources/chat-deliveries.d.ts +2 -0
  57. package/dist/resources/chat-deliveries.js +5 -0
  58. package/dist/resources/mcp-connections.d.ts +5 -0
  59. package/dist/resources/mcp-connections.js +26 -0
  60. package/dist/resources/memories.d.ts +2 -0
  61. package/dist/resources/memories.js +17 -0
  62. package/dist/resources/merchant-bindings.d.ts +2 -0
  63. package/dist/resources/merchant-bindings.js +11 -0
  64. package/dist/resources/merchant-connection.d.ts +2 -0
  65. package/dist/resources/merchant-connection.js +14 -0
  66. package/dist/resources/merchant-usage-events.d.ts +2 -0
  67. package/dist/resources/merchant-usage-events.js +20 -0
  68. package/dist/resources/prompts.d.ts +5 -0
  69. package/dist/resources/prompts.js +20 -0
  70. package/dist/resources/providers.d.ts +2 -0
  71. package/dist/resources/providers.js +23 -0
  72. package/dist/resources/sessions.d.ts +2 -0
  73. package/dist/resources/sessions.js +42 -39
  74. package/dist/resources/skills.d.ts +5 -0
  75. package/dist/resources/skills.js +35 -0
  76. package/dist/resources/tasks.d.ts +2 -0
  77. package/dist/resources/tasks.js +32 -0
  78. package/dist/resources/tenant.d.ts +2 -0
  79. package/dist/resources/tenant.js +8 -0
  80. package/dist/resources/usage.d.ts +2 -0
  81. package/dist/resources/usage.js +14 -0
  82. package/dist/resources/workspaces.d.ts +5 -0
  83. package/dist/resources/workspaces.js +20 -0
  84. package/dist/types.d.ts +691 -48
  85. package/package.json +1 -1
@@ -24,6 +24,10 @@ export declare const sessionsListResponseSchema: z.ZodObject<{
24
24
  }, z.core.$strip>>;
25
25
  nextCursor: z.ZodNullable<z.ZodString>;
26
26
  }, z.core.$strip>;
27
+ export declare const sessionForkedFromSchema: z.ZodObject<{
28
+ sessionId: z.ZodString;
29
+ messageId: z.ZodString;
30
+ }, z.core.$strip>;
27
31
  export declare const sessionResponseSchema: z.ZodObject<{
28
32
  id: z.ZodString;
29
33
  messageCount: z.ZodNumber;
@@ -127,6 +131,10 @@ export declare const sessionResponseSchema: z.ZodObject<{
127
131
  metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
128
132
  mcpConnectionIds: z.ZodArray<z.ZodString>;
129
133
  }, z.core.$strip>;
134
+ forkedFrom: z.ZodNullable<z.ZodObject<{
135
+ sessionId: z.ZodString;
136
+ messageId: z.ZodString;
137
+ }, z.core.$strip>>;
130
138
  }, z.core.$strip>;
131
139
  /**
132
140
  * `GET /v1/sessions/latest` list item — one per Agent: the Agent's most
@@ -181,6 +189,7 @@ export declare const sessionMessageSchema: z.ZodObject<{
181
189
  system: "system";
182
190
  user: "user";
183
191
  }>;
192
+ branchable: z.ZodBoolean;
184
193
  parts: z.ZodArray<z.ZodObject<{
185
194
  type: z.ZodString;
186
195
  }, z.core.$loose>>;
@@ -203,6 +212,7 @@ export declare const sessionMessagesResponseSchema: z.ZodObject<{
203
212
  system: "system";
204
213
  user: "user";
205
214
  }>;
215
+ branchable: z.ZodBoolean;
206
216
  parts: z.ZodArray<z.ZodObject<{
207
217
  type: z.ZodString;
208
218
  }, z.core.$loose>>;
@@ -216,14 +226,14 @@ export declare const sessionMessagesQuerySchema: z.ZodObject<{
216
226
  cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
217
227
  after: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
228
  }, z.core.$strict>;
219
- /** Decision-only input for one server-owned Tool approval. */
220
- export declare const decideToolApprovalBodySchema: z.ZodObject<{
229
+ /** One decision in the current Tool approval round. */
230
+ export declare const toolApprovalDecisionSchema: z.ZodObject<{
231
+ approvalId: z.ZodString;
221
232
  approved: z.ZodBoolean;
222
233
  reason: z.ZodOptional<z.ZodString>;
223
234
  }, z.core.$strict>;
224
235
  export declare const toolApprovalContinuationStateSchema: z.ZodEnum<{
225
236
  failed: "failed";
226
- queued: "queued";
227
237
  running: "running";
228
238
  succeeded: "succeeded";
229
239
  waiting: "waiting";
@@ -273,7 +283,6 @@ export declare const toolApprovalContinuationSchema: z.ZodObject<{
273
283
  id: z.ZodString;
274
284
  state: z.ZodEnum<{
275
285
  failed: "failed";
276
- queued: "queued";
277
286
  running: "running";
278
287
  succeeded: "succeeded";
279
288
  waiting: "waiting";
@@ -325,24 +334,25 @@ export declare const toolApprovalsResponseSchema: z.ZodObject<{
325
334
  id: z.ZodString;
326
335
  state: z.ZodEnum<{
327
336
  failed: "failed";
328
- queued: "queued";
329
337
  running: "running";
330
338
  succeeded: "succeeded";
331
339
  waiting: "waiting";
332
340
  }>;
333
341
  }, z.core.$strip>>;
334
342
  }, z.core.$strip>;
335
- export declare const toolApprovalDecisionResponseSchema: z.ZodObject<{
336
- continuationId: z.ZodString;
337
- state: z.ZodEnum<{
338
- failed: "failed";
339
- queued: "queued";
340
- running: "running";
341
- succeeded: "succeeded";
342
- waiting: "waiting";
343
- }>;
344
- }, z.core.$strip>;
343
+ export declare const continueToolApprovalsBodySchema: z.ZodObject<{
344
+ decisions: z.ZodArray<z.ZodObject<{
345
+ approvalId: z.ZodString;
346
+ approved: z.ZodBoolean;
347
+ reason: z.ZodOptional<z.ZodString>;
348
+ }, z.core.$strict>>;
349
+ functions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
350
+ description: z.ZodString;
351
+ inputSchema: z.ZodCustom<z.core.JSONSchema.JSONSchema, z.core.JSONSchema.JSONSchema>;
352
+ }, z.core.$strict>>>;
353
+ }, z.core.$strict>;
345
354
  export type SessionListItem = z.infer<typeof sessionListItemSchema>;
355
+ export type SessionForkedFrom = z.infer<typeof sessionForkedFromSchema>;
346
356
  export type SessionResponse = z.infer<typeof sessionResponseSchema>;
347
357
  export type SessionsListResponse = z.infer<typeof sessionsListResponseSchema>;
348
358
  export type LatestSessionListItem = z.infer<typeof latestSessionListItemSchema>;
@@ -350,8 +360,8 @@ export type LatestSessionsListResponse = z.infer<typeof latestSessionsListRespon
350
360
  export type SessionMessage = z.infer<typeof sessionMessageSchema>;
351
361
  export type SessionMessagesResponse = z.infer<typeof sessionMessagesResponseSchema>;
352
362
  export type SessionMessagesQuery = z.infer<typeof sessionMessagesQuerySchema>;
353
- export type DecideToolApprovalBody = z.infer<typeof decideToolApprovalBodySchema>;
363
+ export type ToolApprovalDecision = z.infer<typeof toolApprovalDecisionSchema>;
364
+ export type ContinueToolApprovalsBody = z.infer<typeof continueToolApprovalsBodySchema>;
354
365
  export type ToolApprovalContinuationState = z.infer<typeof toolApprovalContinuationStateSchema>;
355
366
  export type ToolApprovalState = z.infer<typeof toolApprovalStateSchema>;
356
367
  export type ToolApprovalsResponse = z.infer<typeof toolApprovalsResponseSchema>;
357
- export type ToolApprovalDecisionResponse = z.infer<typeof toolApprovalDecisionResponseSchema>;
@@ -5,6 +5,7 @@ import { DEFAULT_SESSION_MESSAGES_LIMIT, MAX_SESSION_MESSAGES_LIMIT, } from "../
5
5
  import { toolExecutionReferenceSchema } from "./agent-approval.js";
6
6
  import { agentConfigSchema, agentSchema } from "./agents.js";
7
7
  import { metadataSchema, userIdSchema } from "./attribution.js";
8
+ import { chatFunctionDefinitionsSchema } from "./chat.js";
8
9
  /**
9
10
  * `GET /v1/agents/{agentId}/sessions` list item. `agentId`/`tenantId` never
10
11
  * leak to the wire; `userId`/`metadata` come from the first successful Turn.
@@ -21,8 +22,17 @@ export const sessionListItemSchema = z
21
22
  })
22
23
  .strip();
23
24
  export const sessionsListResponseSchema = paginatedResponseSchema(sessionListItemSchema);
25
+ export const sessionForkedFromSchema = z
26
+ .object({
27
+ sessionId: sessionIdSchema,
28
+ messageId: z.string().min(1),
29
+ })
30
+ .strip();
24
31
  export const sessionResponseSchema = sessionListItemSchema
25
- .extend({ agentConfig: agentConfigSchema })
32
+ .extend({
33
+ agentConfig: agentConfigSchema,
34
+ forkedFrom: sessionForkedFromSchema.nullable(),
35
+ })
26
36
  .strip();
27
37
  /**
28
38
  * `GET /v1/sessions/latest` list item — one per Agent: the Agent's most
@@ -48,6 +58,7 @@ export const sessionMessageSchema = z
48
58
  .object({
49
59
  id: z.string().min(1),
50
60
  role: z.enum(["system", "user", "assistant"]),
61
+ branchable: z.boolean(),
51
62
  parts: z
52
63
  .array(z
53
64
  .object({
@@ -90,16 +101,16 @@ export const sessionMessagesQuerySchema = z
90
101
  message: "cursor and after are mutually exclusive.",
91
102
  path: ["after"],
92
103
  });
93
- /** Decision-only input for one server-owned Tool approval. */
94
- export const decideToolApprovalBodySchema = z
104
+ /** One decision in the current Tool approval round. */
105
+ export const toolApprovalDecisionSchema = z
95
106
  .object({
107
+ approvalId: z.string().min(1),
96
108
  approved: z.boolean(),
97
109
  reason: z.string().trim().min(1).max(1000).optional(),
98
110
  })
99
111
  .strict();
100
112
  export const toolApprovalContinuationStateSchema = z.enum([
101
113
  "waiting",
102
- "queued",
103
114
  "running",
104
115
  "succeeded",
105
116
  "failed",
@@ -130,9 +141,13 @@ export const toolApprovalsResponseSchema = z
130
141
  continuation: toolApprovalContinuationSchema.nullable(),
131
142
  })
132
143
  .strip();
133
- export const toolApprovalDecisionResponseSchema = z
144
+ export const continueToolApprovalsBodySchema = z
134
145
  .object({
135
- continuationId: z.string().min(1),
136
- state: toolApprovalContinuationStateSchema,
146
+ decisions: z
147
+ .array(toolApprovalDecisionSchema)
148
+ .min(1)
149
+ .refine((decisions) => new Set(decisions.map((decision) => decision.approvalId)).size ===
150
+ decisions.length, { message: "Approval IDs must be distinct." }),
151
+ functions: chatFunctionDefinitionsSchema.optional(),
137
152
  })
138
- .strip();
153
+ .strict();
@@ -151,6 +151,9 @@ export interface SkillMarkdownFrontmatterParseFailure {
151
151
  success: false;
152
152
  }
153
153
  export type SkillMarkdownFrontmatterParseResult = SkillMarkdownFrontmatterParseSuccess | SkillMarkdownFrontmatterParseFailure;
154
+ /**
155
+ * Parses and validates YAML frontmatter from Skill Markdown.
156
+ */
154
157
  export declare function parseSkillMarkdownFrontmatter(content: string): SkillMarkdownFrontmatterParseResult;
155
158
  export type Skill = z.infer<typeof skillSchema>;
156
159
  export type SkillDetail = z.infer<typeof skillDetailSchema>;
@@ -126,6 +126,9 @@ export const skillCopyResultSchema = z.discriminatedUnion("status", [
126
126
  ]);
127
127
  export const skillCopyResultsSchema = z.array(skillCopyResultSchema);
128
128
  const frontmatterPattern = /^---\n([\s\S]*?)\n---(?:\n|$)/;
129
+ /**
130
+ * Parses and validates YAML frontmatter from Skill Markdown.
131
+ */
129
132
  export function parseSkillMarkdownFrontmatter(content) {
130
133
  const normalized = content.replaceAll("\r\n", "\n");
131
134
  const match = frontmatterPattern.exec(normalized);
@@ -716,6 +716,7 @@ export declare const taskRunMessagesResponseSchema: z.ZodObject<{
716
716
  system: "system";
717
717
  user: "user";
718
718
  }>;
719
+ branchable: z.ZodBoolean;
719
720
  parts: z.ZodArray<z.ZodObject<{
720
721
  type: z.ZodString;
721
722
  }, z.core.$loose>>;
@@ -175,7 +175,10 @@ export declare const usageOverviewResponseSchema: z.ZodObject<{
175
175
  }, z.core.$strip>>;
176
176
  activeAgentCount: z.ZodNumber;
177
177
  }, z.core.$strip>;
178
- /** Applies the request-dependent ranking and daily-series guarantees. */
178
+ /**
179
+ * Applies the request-dependent ranking and daily-series guarantees.
180
+ * @param query - Ranking limit and date range used to validate the response.
181
+ */
179
182
  export declare function usageOverviewResponseSchemaForQuery(query?: Partial<UsageOverviewQuery>): z.ZodObject<{
180
183
  totals: z.ZodObject<{
181
184
  inputTokens: z.ZodNumber;
@@ -3,6 +3,9 @@ import { agentIdSchema, sessionIdSchema } from "../ids.js";
3
3
  import { DEFAULT_USAGE_OVERVIEW_TOP_N, DEFAULT_USAGE_RANGE_DAYS, DEFAULT_USAGE_SESSION_TOP_N, MAX_USAGE_OVERVIEW_TOP_N, MAX_USAGE_RANGE_DAYS, MAX_USAGE_SESSION_TOP_N, } from "../limitations.js";
4
4
  import { hasUniqueValues } from "../utils.js";
5
5
  import { userIdSchema } from "./attribution.js";
6
+ /**
7
+ * Adds a validation issue when the usage date range is invalid.
8
+ */
6
9
  function validateUsageRange(value, ctx) {
7
10
  if ((value.from === undefined) !== (value.to === undefined)) {
8
11
  ctx.addIssue({
@@ -185,7 +188,10 @@ export const usageOverviewResponseSchema = z
185
188
  });
186
189
  }
187
190
  });
188
- /** Applies the request-dependent ranking and daily-series guarantees. */
191
+ /**
192
+ * Applies the request-dependent ranking and daily-series guarantees.
193
+ * @param query - Ranking limit and date range used to validate the response.
194
+ */
189
195
  export function usageOverviewResponseSchemaForQuery(query = {}) {
190
196
  const limit = query.limit ?? DEFAULT_USAGE_OVERVIEW_TOP_N;
191
197
  const expectedDays = query.from && query.to
@@ -1,10 +1,9 @@
1
1
  import { z } from "zod";
2
2
  export declare const workspaceNameSchema: z.ZodString;
3
- export declare const workspaceBackupSchema: z.ZodObject<{
4
- dir: z.ZodLiteral<"/workspace">;
5
- id: z.ZodUUID;
6
- localBucket: z.ZodOptional<z.ZodBoolean>;
7
- }, z.core.$strict>;
3
+ export declare const workspaceTierSchema: z.ZodEnum<{
4
+ core: "core";
5
+ plus: "plus";
6
+ }>;
8
7
  export declare const workspaceNetworkPolicySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
9
8
  mode: z.ZodLiteral<"unrestricted">;
10
9
  }, z.core.$strict>, z.ZodObject<{
@@ -16,6 +15,10 @@ export declare const workspaceNetworkPolicySchema: z.ZodDiscriminatedUnion<[z.Zo
16
15
  export declare const workspaceSchema: z.ZodObject<{
17
16
  id: z.ZodString;
18
17
  tenantId: z.ZodString;
18
+ tier: z.ZodEnum<{
19
+ core: "core";
20
+ plus: "plus";
21
+ }>;
19
22
  name: z.ZodNullable<z.ZodString>;
20
23
  userId: z.ZodString;
21
24
  metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -32,6 +35,10 @@ export declare const workspaceSchema: z.ZodObject<{
32
35
  }, z.core.$strip>;
33
36
  export declare const createWorkspaceBodySchema: z.ZodObject<{
34
37
  name: z.ZodOptional<z.ZodString>;
38
+ tier: z.ZodDefault<z.ZodEnum<{
39
+ core: "core";
40
+ plus: "plus";
41
+ }>>;
35
42
  userId: z.ZodDefault<z.ZodString>;
36
43
  metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
37
44
  networkPolicy: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -64,6 +71,10 @@ export declare const workspacesListResponseSchema: z.ZodObject<{
64
71
  data: z.ZodArray<z.ZodObject<{
65
72
  id: z.ZodString;
66
73
  tenantId: z.ZodString;
74
+ tier: z.ZodEnum<{
75
+ core: "core";
76
+ plus: "plus";
77
+ }>;
67
78
  name: z.ZodNullable<z.ZodString>;
68
79
  userId: z.ZodString;
69
80
  metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -81,7 +92,7 @@ export declare const workspacesListResponseSchema: z.ZodObject<{
81
92
  nextCursor: z.ZodNullable<z.ZodString>;
82
93
  }, z.core.$strip>;
83
94
  export type Workspace = z.infer<typeof workspaceSchema>;
84
- export type WorkspaceBackup = z.infer<typeof workspaceBackupSchema>;
95
+ export type WorkspaceTier = z.infer<typeof workspaceTierSchema>;
85
96
  export type WorkspaceNetworkPolicy = z.infer<typeof workspaceNetworkPolicySchema>;
86
97
  export type CreateWorkspaceBody = z.input<typeof createWorkspaceBodySchema>;
87
98
  export type UpdateWorkspaceBody = z.infer<typeof updateWorkspaceBodySchema>;
@@ -9,13 +9,7 @@ export const workspaceNameSchema = z
9
9
  .trim()
10
10
  .min(1)
11
11
  .max(MAX_WORKSPACE_NAME_LENGTH);
12
- export const workspaceBackupSchema = z
13
- .object({
14
- dir: z.literal("/workspace"),
15
- id: z.uuid(),
16
- localBucket: z.boolean().optional(),
17
- })
18
- .strict();
12
+ export const workspaceTierSchema = z.enum(["core", "plus"]);
19
13
  export const workspaceNetworkPolicySchema = z.discriminatedUnion("mode", [
20
14
  z.object({ mode: z.literal("unrestricted") }).strict(),
21
15
  z
@@ -35,6 +29,7 @@ export const workspaceSchema = z
35
29
  .object({
36
30
  id: workspaceIdSchema,
37
31
  tenantId: tenantIdSchema,
32
+ tier: workspaceTierSchema,
38
33
  name: workspaceNameSchema.nullable(),
39
34
  userId: userIdSchema,
40
35
  metadata: metadataSchema,
@@ -46,6 +41,7 @@ export const workspaceSchema = z
46
41
  export const createWorkspaceBodySchema = z
47
42
  .object({
48
43
  name: workspaceNameSchema.optional(),
44
+ tier: workspaceTierSchema.default("core"),
49
45
  userId: userIdSchema.default(""),
50
46
  metadata: metadataSchema.default({}),
51
47
  networkPolicy: workspaceNetworkPolicySchema.default({
@@ -1,20 +1,42 @@
1
1
  import { z } from "zod";
2
2
  export declare const ADMIN_AGENT_ID_PREFIX = "ag_adm";
3
+ /** Creates a Tenant ID with a 16-character base62 body. */
3
4
  export declare const createTenantId: () => string;
5
+ /**
6
+ * Creates an Agent ID outside the reserved administrator prefix.
7
+ */
4
8
  export declare const createAgentId: () => string;
9
+ /**
10
+ * Creates an Agent ID with the reserved administrator prefix.
11
+ */
5
12
  export declare const mintAdminAgentId: () => string;
13
+ /** Creates a Session ID with a 16-character base62 body. */
6
14
  export declare const createSessionId: () => string;
15
+ /** Creates a Api Key ID with a 16-character base62 body. */
7
16
  export declare const createApiKeyId: () => string;
17
+ /** Creates a Provider ID with a 16-character base62 body. */
8
18
  export declare const createProviderId: () => string;
19
+ /** Creates a Mcp Connection ID with a 16-character base62 body. */
9
20
  export declare const createMcpConnectionId: () => string;
21
+ /** Creates a Workspace ID with a 16-character base62 body. */
10
22
  export declare const createWorkspaceId: () => string;
23
+ /** Creates a Artifact ID with a 16-character base62 body. */
11
24
  export declare const createArtifactId: () => string;
25
+ /** Creates a Task ID with a 16-character base62 body. */
12
26
  export declare const createTaskId: () => string;
27
+ /** Creates a Task Run ID with a 16-character base62 body. */
13
28
  export declare const createTaskRunId: () => string;
29
+ /** Creates a Memory ID with a 16-character base62 body. */
14
30
  export declare const createMemoryId: () => string;
31
+ /** Creates a Prompt ID with a 16-character base62 body. */
15
32
  export declare const createPromptId: () => string;
33
+ /** Creates a Request ID with a 16-character base62 body. */
16
34
  export declare const createRequestId: () => string;
35
+ /** Creates a Checkout Attempt ID with a 16-character base62 body. */
17
36
  export declare const createCheckoutAttemptId: () => string;
37
+ /**
38
+ * Creates a Skill ID with a 16-character base62 body.
39
+ */
18
40
  export declare const createSkillId: () => string;
19
41
  /**
20
42
  * API keys — `ba_` + 40 base62 chars (~230 bits entropy). The full token is
@@ -22,14 +44,23 @@ export declare const createSkillId: () => string;
22
44
  * are stored. (docs/adr/0004-unified-v1-dual-credential-auth.md)
23
45
  */
24
46
  export declare const API_KEY_TOKEN_PREFIX = "ba_";
47
+ /**
48
+ * Creates an API key token with a 40-character random base62 body.
49
+ * @returns A ba_ token with 40 random base62 characters.
50
+ */
25
51
  export declare function createApiKeyToken(): string;
26
52
  /**
27
53
  * The display fragment is `ba_` + the first 2 chars of the random body —
28
54
  * safe to store (~12 of ~230 bits revealed).
55
+ * @param token - API key token with the ba_ prefix.
56
+ * @returns The prefix and first two characters of the token body.
29
57
  */
30
58
  export declare function apiKeyFragmentFromToken(token: string): string;
31
59
  export declare const tenantIdSchema: z.ZodString;
32
60
  export declare const agentIdSchema: z.ZodString;
61
+ /**
62
+ * Checks the administrator prefix and validates the complete Agent ID.
63
+ */
33
64
  export declare const isAdminAgentId: (id: string) => boolean;
34
65
  export declare const sessionIdSchema: z.ZodString;
35
66
  export declare const apiKeyIdSchema: z.ZodString;
@@ -12,22 +12,47 @@ const createNanoId13 = customAlphabet(BASE62, 13);
12
12
  const createAgentIdFirstChar = customAlphabet(BASE62.replace("a", ""), 1);
13
13
  const createNanoId15 = customAlphabet(BASE62, 15);
14
14
  const createNanoId40 = customAlphabet(BASE62, 40);
15
+ /**
16
+ * Creates a generator for prefixed IDs with a 16-character base62 body.
17
+ */
15
18
  const platformId = (prefix) => () => `${prefix}_${createNanoId16()}`;
19
+ /** Creates a Tenant ID with a 16-character base62 body. */
16
20
  export const createTenantId = platformId("ten");
21
+ /**
22
+ * Creates an Agent ID outside the reserved administrator prefix.
23
+ */
17
24
  export const createAgentId = () => `ag_${createAgentIdFirstChar()}${createNanoId15()}`;
25
+ /**
26
+ * Creates an Agent ID with the reserved administrator prefix.
27
+ */
18
28
  export const mintAdminAgentId = () => `${ADMIN_AGENT_ID_PREFIX}${createNanoId13()}`;
29
+ /** Creates a Session ID with a 16-character base62 body. */
19
30
  export const createSessionId = platformId("ss");
31
+ /** Creates a Api Key ID with a 16-character base62 body. */
20
32
  export const createApiKeyId = platformId("ak");
33
+ /** Creates a Provider ID with a 16-character base62 body. */
21
34
  export const createProviderId = platformId("prv");
35
+ /** Creates a Mcp Connection ID with a 16-character base62 body. */
22
36
  export const createMcpConnectionId = platformId("mcp");
37
+ /** Creates a Workspace ID with a 16-character base62 body. */
23
38
  export const createWorkspaceId = platformId("ws");
39
+ /** Creates a Artifact ID with a 16-character base62 body. */
24
40
  export const createArtifactId = platformId("at");
41
+ /** Creates a Task ID with a 16-character base62 body. */
25
42
  export const createTaskId = platformId("tk");
43
+ /** Creates a Task Run ID with a 16-character base62 body. */
26
44
  export const createTaskRunId = platformId("tr");
45
+ /** Creates a Memory ID with a 16-character base62 body. */
27
46
  export const createMemoryId = platformId("mem");
47
+ /** Creates a Prompt ID with a 16-character base62 body. */
28
48
  export const createPromptId = platformId("prompt");
49
+ /** Creates a Request ID with a 16-character base62 body. */
29
50
  export const createRequestId = platformId("req");
51
+ /** Creates a Checkout Attempt ID with a 16-character base62 body. */
30
52
  export const createCheckoutAttemptId = platformId("ca");
53
+ /**
54
+ * Creates a Skill ID with a 16-character base62 body.
55
+ */
31
56
  export const createSkillId = () => `skill_${createNanoId16()}`;
32
57
  /**
33
58
  * API keys — `ba_` + 40 base62 chars (~230 bits entropy). The full token is
@@ -35,12 +60,18 @@ export const createSkillId = () => `skill_${createNanoId16()}`;
35
60
  * are stored. (docs/adr/0004-unified-v1-dual-credential-auth.md)
36
61
  */
37
62
  export const API_KEY_TOKEN_PREFIX = "ba_";
63
+ /**
64
+ * Creates an API key token with a 40-character random base62 body.
65
+ * @returns A ba_ token with 40 random base62 characters.
66
+ */
38
67
  export function createApiKeyToken() {
39
68
  return `${API_KEY_TOKEN_PREFIX}${createNanoId40()}`;
40
69
  }
41
70
  /**
42
71
  * The display fragment is `ba_` + the first 2 chars of the random body —
43
72
  * safe to store (~12 of ~230 bits revealed).
73
+ * @param token - API key token with the ba_ prefix.
74
+ * @returns The prefix and first two characters of the token body.
44
75
  */
45
76
  export function apiKeyFragmentFromToken(token) {
46
77
  if (!token.startsWith(API_KEY_TOKEN_PREFIX)) {
@@ -52,6 +83,9 @@ export function apiKeyFragmentFromToken(token) {
52
83
  // Schemas — one per id prefix, mirroring the migration check constraints.
53
84
  export const tenantIdSchema = z.string().regex(/^ten_[0-9A-Za-z]{16}$/);
54
85
  export const agentIdSchema = z.string().regex(/^ag_[0-9A-Za-z]{16}$/);
86
+ /**
87
+ * Checks the administrator prefix and validates the complete Agent ID.
88
+ */
55
89
  export const isAdminAgentId = (id) => id.startsWith(ADMIN_AGENT_ID_PREFIX) && z.validate(agentIdSchema, id);
56
90
  export const sessionIdSchema = z.string().regex(/^ss_[0-9A-Za-z]{16}$/);
57
91
  export const apiKeyIdSchema = z.string().regex(/^ak_[0-9A-Za-z]{16}$/);
@@ -7,21 +7,22 @@ export { agentConfigSchema, agentResponseSchema, agentSchema, agentStatusSchema,
7
7
  export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.ts";
8
8
  export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.ts";
9
9
  export type { ChatFunctionCallEvent, ChatFunctionDefinition, ChatFunctionDefinitions, ChatFunctionOutcome, ClaimChatFunctionBody, PromptVariables, ResolveChatFunctionBody, UsageSummary, } from "./entities/chat.ts";
10
- 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, resumeToolApprovalContinuationBodySchema, usageSummarySchema, } from "./entities/chat.ts";
10
+ 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";
11
11
  export { chatConfigurationSchema, chatConnectionSchema, chatConnectionsResponseSchema, chatCredentialsSchema, chatDeliveriesResponseSchema, chatDeliveryListStatusSchema, chatDeliverySchema, chatDeliveryStatusSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, tenantChatDeliverySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.ts";
12
12
  export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.ts";
13
13
  export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.ts";
14
14
  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";
15
15
  export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptSchema, promptsListQuerySchema, promptsResponseSchema, promptTemplateSchema, renderPromptTemplate, updatePromptBodySchema, } from "./entities/prompts.ts";
16
16
  export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.ts";
17
- export type { ResumeSessionInputsResponse, RunSessionInputsBody, SessionActivity, SessionInput, SessionInputMode, SessionInputResponse, SessionInputState, SessionInputsQuery, SessionInputsResponse, StopSessionBody, StopSessionResponse, SubmitSessionInputBody, } from "./entities/session-inputs.ts";
18
- export { resumeSessionInputsResponseSchema, runSessionInputsBodySchema, sessionActivitySchema, sessionInputModeSchema, sessionInputRequestIdSchema, sessionInputResponseSchema, sessionInputSchema, sessionInputStateSchema, sessionInputsQuerySchema, sessionInputsResponseSchema, stopSessionBodySchema, stopSessionResponseSchema, submitSessionInputBodySchema, } from "./entities/session-inputs.ts";
19
- export type { ToolApprovalDecisionResponse, ToolApprovalsResponse, } from "./entities/sessions.ts";
20
- export { decideToolApprovalBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionResponseSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.ts";
17
+ export type { ChatSteerConsumedEvent, SessionActivity, SessionInput, SessionInputResponse, SessionInputState, SessionInputsQuery, SessionInputsResponse, StopSessionBody, StopSessionResponse, SubmitSessionInputBody, } from "./entities/session-inputs.ts";
18
+ export { chatSteerConsumedEventSchema, sessionActivitySchema, sessionInputRequestIdSchema, sessionInputResponseSchema, sessionInputSchema, sessionInputStateSchema, sessionInputsQuerySchema, sessionInputsResponseSchema, stopSessionBodySchema, stopSessionResponseSchema, submitSessionInputBodySchema, } from "./entities/session-inputs.ts";
19
+ export type { ContinueToolApprovalsBody, SessionForkedFrom, ToolApprovalContinuationState, ToolApprovalDecision, ToolApprovalsResponse, } from "./entities/sessions.ts";
20
+ export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionForkedFromSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.ts";
21
21
  export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.ts";
22
22
  export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, taskSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.ts";
23
23
  export { quotaSchema, subscriptionStatusSchema, tenantDeletionSchema, tenantResponseSchema, tenantSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.ts";
24
24
  export type { SessionUsageQuery, SessionUsageResponse, UsageBucket, UsageOverviewQuery, UsageOverviewResponse, UsageResponse, UsageTotals, } from "./entities/usage.ts";
25
25
  export { sessionUsageQuerySchema, sessionUsageResponseSchema, usageOverviewQuerySchema, usageOverviewResponseSchema, usageResponseSchema, } from "./entities/usage.ts";
26
- export { createWorkspaceBodySchema, updateWorkspaceBodySchema, workspaceSchema, workspacesListResponseSchema, } from "./entities/workspaces.ts";
26
+ export type { WorkspaceTier } from "./entities/workspaces.ts";
27
+ export { createWorkspaceBodySchema, updateWorkspaceBodySchema, workspaceSchema, workspacesListResponseSchema, workspaceTierSchema, } from "./entities/workspaces.ts";
27
28
  export { agentIdSchema, apiKeyTokenSchema, functionCallIdSchema, isAdminAgentId, promptIdSchema, sessionIdSchema, } from "./ids.ts";
@@ -6,18 +6,18 @@ export { chatFunctionNameSchema } from "./entities/agent-tools.js";
6
6
  export { agentConfigSchema, agentResponseSchema, agentSchema, agentStatusSchema, agentsListQuerySchema, agentsResponseSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.js";
7
7
  export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.js";
8
8
  export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.js";
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, resumeToolApprovalContinuationBodySchema, usageSummarySchema, } from "./entities/chat.js";
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, chatDeliveryListStatusSchema, chatDeliverySchema, chatDeliveryStatusSchema, chatHealthCheckSchema, chatHealthSchema, chatIdentitySchema, createChatConnectionBodySchema, rotateChatConnectionBodySchema, tenantChatDeliverySchema, updateChatConnectionBodySchema, } from "./entities/chat-connections.js";
11
11
  export { approveMcpOauthAuthorizationBodySchema, createMcpConnectionBodySchema, mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, mcpConnectionAuthTypeSchema, mcpConnectionOauthConnectResponseSchema, mcpConnectionReconnectResultSchema, mcpConnectionResponseSchema, mcpConnectionStatusSchema, mcpConnectionsResponseSchema, mcpConnectionTestErrorCodeSchema, mcpConnectionTestResponseSchema, mcpOauthAuthorizationLaunchResponseSchema, reconnectMcpConnectionBodySchema, updateMcpAttachmentBodySchema, updateMcpConnectionBodySchema, } from "./entities/mcp-connections.js";
12
12
  export { createMemoryBodySchema, memoriesListResponseSchema, memoryResponseSchema, memorySchema, updateMemoryBodySchema, } from "./entities/memories.js";
13
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";
14
14
  export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptSchema, 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
- export { resumeSessionInputsResponseSchema, runSessionInputsBodySchema, sessionActivitySchema, sessionInputModeSchema, sessionInputRequestIdSchema, sessionInputResponseSchema, sessionInputSchema, sessionInputStateSchema, sessionInputsQuerySchema, sessionInputsResponseSchema, stopSessionBodySchema, stopSessionResponseSchema, submitSessionInputBodySchema, } from "./entities/session-inputs.js";
17
- export { decideToolApprovalBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionResponseSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.js";
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, } from "./entities/sessions.js";
18
18
  export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.js";
19
19
  export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, taskSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.js";
20
20
  export { quotaSchema, subscriptionStatusSchema, tenantDeletionSchema, tenantResponseSchema, tenantSchema, tenantSettingsResponseSchema, updateTenantSettingsBodySchema, } from "./entities/tenants.js";
21
21
  export { sessionUsageQuerySchema, sessionUsageResponseSchema, usageOverviewQuerySchema, usageOverviewResponseSchema, usageResponseSchema, } from "./entities/usage.js";
22
- export { createWorkspaceBodySchema, updateWorkspaceBodySchema, workspaceSchema, workspacesListResponseSchema, } from "./entities/workspaces.js";
22
+ export { createWorkspaceBodySchema, updateWorkspaceBodySchema, workspaceSchema, workspacesListResponseSchema, workspaceTierSchema, } from "./entities/workspaces.js";
23
23
  export { agentIdSchema, apiKeyTokenSchema, functionCallIdSchema, isAdminAgentId, promptIdSchema, sessionIdSchema, } from "./ids.js";
@@ -1,3 +1,13 @@
1
1
  export declare const atLeastOneFieldMessage = "At least one field must be provided.";
2
+ /**
3
+ * Checks whether the object has at least one own enumerable key.
4
+ * @param value - Value to inspect.
5
+ * @returns Whether at least one own enumerable key exists.
6
+ */
2
7
  export declare function hasObjectKeys(value: object): boolean;
8
+ /**
9
+ * Checks whether every string in the array is unique.
10
+ * @param values - Values to inspect or substitute.
11
+ * @returns Whether no string occurs more than once.
12
+ */
3
13
  export declare function hasUniqueValues(values: string[]): boolean;
@@ -1,7 +1,17 @@
1
1
  export const atLeastOneFieldMessage = "At least one field must be provided.";
2
+ /**
3
+ * Checks whether the object has at least one own enumerable key.
4
+ * @param value - Value to inspect.
5
+ * @returns Whether at least one own enumerable key exists.
6
+ */
2
7
  export function hasObjectKeys(value) {
3
8
  return Object.keys(value).length > 0;
4
9
  }
10
+ /**
11
+ * Checks whether every string in the array is unique.
12
+ * @param values - Values to inspect or substitute.
13
+ * @returns Whether no string occurs more than once.
14
+ */
5
15
  export function hasUniqueValues(values) {
6
16
  return new Set(values).size === values.length;
7
17
  }
@@ -5,9 +5,16 @@ export type BlazingAgentsDirectChatTransportOptions = {
5
5
  agentId: string;
6
6
  /** Caller-local functions for every Turn and approved continuation of this chat. */
7
7
  functions?: ChatFunctions;
8
+ /**
9
+ * Returns the authenticated SDK client for the current request.
10
+ * @returns The SDK client for this request.
11
+ */
8
12
  getClient: () => BlazingAgents | Promise<BlazingAgents>;
9
13
  metadata?: Record<string, unknown>;
10
- /** Receives the Session ID before the response stream is consumed. */
14
+ /**
15
+ * Receives the Session ID before the response stream is consumed.
16
+ * @param sessionId - Session to look up or record.
17
+ */
11
18
  onSessionId?: (sessionId: string) => Promise<void> | void;
12
19
  sessionId?: string;
13
20
  userId?: string;
@@ -21,10 +28,30 @@ export type BlazingAgentsDirectChatTransportOptions = {
21
28
  /** Connects useChat directly to the SDK, including native streaming fetch clients. */
22
29
  export declare class BlazingAgentsDirectChatTransport<UI_MESSAGE extends UIMessage = UIMessage> extends DefaultChatTransport<UI_MESSAGE> {
23
30
  #private;
31
+ /**
32
+ * Creates a chat transport and validates any supplied Session ID.
33
+ * @param options - Configuration for this operation.
34
+ */
24
35
  constructor(options: BlazingAgentsDirectChatTransportOptions);
25
- runInputs(input?: {
36
+ /**
37
+ * Submits the supplied user messages directly to the SDK chat endpoint.
38
+ * @param input - Operation input and optional cancellation signal.
39
+ * @returns The decoded AI SDK message-chunk stream.
40
+ */
41
+ sendUserMessages(input: {
42
+ messages: UI_MESSAGE[];
26
43
  abortSignal?: AbortSignal;
27
44
  }): Promise<ReadableStream<import("ai").UIMessageChunk<unknown, import("ai").UIDataTypes>>>;
45
+ /**
46
+ * Submits the latest user message or complete assistant approval round to the chat.
47
+ * @param input - Operation input and optional cancellation signal.
48
+ * @returns The decoded AI SDK message-chunk stream.
49
+ */
28
50
  sendMessages(input: Parameters<ChatTransport<UI_MESSAGE>["sendMessages"]>[0]): Promise<ReadableStream<import("ai").UIMessageChunk<unknown, import("ai").UIDataTypes>>>;
29
- reconnectToStream(_input: Parameters<ChatTransport<UI_MESSAGE>["reconnectToStream"]>[0]): Promise<ReadableStream<import("ai").UIMessageChunk<unknown, import("ai").UIDataTypes>> | null>;
51
+ /**
52
+ * Returns null because reconnecting to an existing stream is unsupported.
53
+ * @param _input - Unused reconnect request.
54
+ * @returns A promise resolving to null.
55
+ */
56
+ reconnectToStream(_input: Parameters<ChatTransport<UI_MESSAGE>["reconnectToStream"]>[0]): Promise<null>;
30
57
  }