@blazingagents/sdk 0.24.0 → 0.26.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 (40) hide show
  1. package/dist/contracts/api.d.ts +1 -245
  2. package/dist/contracts/api.js +1 -121
  3. package/dist/contracts/entities/agent-tools.d.ts +0 -4
  4. package/dist/contracts/entities/agent-tools.js +0 -15
  5. package/dist/contracts/entities/agents.d.ts +2 -109
  6. package/dist/contracts/entities/agents.js +15 -16
  7. package/dist/contracts/entities/artifacts.d.ts +0 -30
  8. package/dist/contracts/entities/artifacts.js +1 -36
  9. package/dist/contracts/entities/attribution.d.ts +0 -2
  10. package/dist/contracts/entities/chat-connections.d.ts +0 -3
  11. package/dist/contracts/entities/chat-connections.js +0 -3
  12. package/dist/contracts/entities/chat.d.ts +1 -17
  13. package/dist/contracts/entities/chat.js +4 -13
  14. package/dist/contracts/entities/mcp-connections.d.ts +0 -168
  15. package/dist/contracts/entities/mcp-connections.js +1 -171
  16. package/dist/contracts/entities/memories.d.ts +0 -8
  17. package/dist/contracts/entities/memories.js +2 -15
  18. package/dist/contracts/entities/merchant.d.ts +0 -19
  19. package/dist/contracts/entities/merchant.js +1 -26
  20. package/dist/contracts/entities/prompts.d.ts +1 -14
  21. package/dist/contracts/entities/prompts.js +2 -3
  22. package/dist/contracts/entities/providers.d.ts +0 -28
  23. package/dist/contracts/entities/providers.js +1 -24
  24. package/dist/contracts/entities/sessions.d.ts +0 -9
  25. package/dist/contracts/entities/sessions.js +4 -21
  26. package/dist/contracts/entities/skills.d.ts +0 -52
  27. package/dist/contracts/entities/skills.js +2 -60
  28. package/dist/contracts/entities/tasks.d.ts +1 -168
  29. package/dist/contracts/entities/tasks.js +5 -14
  30. package/dist/contracts/entities/tenants.d.ts +0 -6
  31. package/dist/contracts/entities/usage.d.ts +0 -1
  32. package/dist/contracts/entities/workspaces.d.ts +0 -6
  33. package/dist/contracts/entities/workspaces.js +2 -14
  34. package/dist/contracts/ids.d.ts +1 -68
  35. package/dist/contracts/ids.js +5 -92
  36. package/dist/contracts/index.d.ts +3 -3
  37. package/dist/contracts/index.js +3 -3
  38. package/dist/contracts/limitations.d.ts +8 -81
  39. package/dist/contracts/limitations.js +8 -82
  40. package/package.json +6 -6
@@ -32,40 +32,10 @@ export declare const artifactsListResponseSchema: z.ZodObject<{
32
32
  }, z.core.$strip>>;
33
33
  nextCursor: z.ZodNullable<z.ZodString>;
34
34
  }, z.core.$strip>;
35
- export declare const artifactsListQuerySchema: z.ZodObject<{
36
- agentId: z.ZodOptional<z.ZodString>;
37
- sessionId: z.ZodOptional<z.ZodString>;
38
- cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
- }, z.core.$strict>;
40
- export declare const publishArtifactsInputSchema: z.ZodObject<{
41
- paths: z.ZodArray<z.ZodString>;
42
- }, z.core.$strict>;
43
- export declare const publishArtifactResultSchema: z.ZodUnion<readonly [z.ZodObject<{
44
- artifactId: z.ZodString;
45
- path: z.ZodString;
46
- }, z.core.$strip>, z.ZodObject<{
47
- error: z.ZodLiteral<true>;
48
- message: z.ZodString;
49
- path: z.ZodString;
50
- }, z.core.$strip>]>;
51
- export declare const publishArtifactsOutputSchema: z.ZodObject<{
52
- results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
53
- artifactId: z.ZodString;
54
- path: z.ZodString;
55
- }, z.core.$strip>, z.ZodObject<{
56
- error: z.ZodLiteral<true>;
57
- message: z.ZodString;
58
- path: z.ZodString;
59
- }, z.core.$strip>]>>;
60
- }, z.core.$strip>;
61
35
  export declare const artifactDownloadUrlResponseSchema: z.ZodObject<{
62
36
  url: z.ZodURL;
63
37
  expiresAt: z.ZodISODateTime;
64
38
  }, z.core.$strip>;
65
39
  export type ArtifactListItem = z.infer<typeof artifactListItemSchema>;
66
40
  export type ArtifactsListResponse = z.infer<typeof artifactsListResponseSchema>;
67
- export type ArtifactsListQuery = z.infer<typeof artifactsListQuerySchema>;
68
- export type PublishArtifactsInput = z.infer<typeof publishArtifactsInputSchema>;
69
- export type PublishArtifactResult = z.infer<typeof publishArtifactResultSchema>;
70
- export type PublishArtifactsOutput = z.infer<typeof publishArtifactsOutputSchema>;
71
41
  export type ArtifactDownloadUrlResponse = z.infer<typeof artifactDownloadUrlResponseSchema>;
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { paginatedResponseSchema } from "../api.js";
3
3
  import { agentIdSchema, artifactIdSchema, sessionIdSchema, tenantIdSchema, } from "../ids.js";
4
- import { MAX_ARTIFACT_BYTES, MAX_ARTIFACT_PUBLICATIONS_PER_CALL, } from "../limitations.js";
4
+ import { MAX_ARTIFACT_BYTES } from "../limitations.js";
5
5
  import { metadataSchema, userIdSchema } from "./attribution.js";
6
6
  export const artifactFilenameSchema = z
7
7
  .string()
@@ -28,41 +28,6 @@ export const artifactListItemSchema = z
28
28
  })
29
29
  .strip();
30
30
  export const artifactsListResponseSchema = paginatedResponseSchema(artifactListItemSchema);
31
- export const artifactsListQuerySchema = z
32
- .object({
33
- agentId: agentIdSchema.optional(),
34
- sessionId: sessionIdSchema.optional(),
35
- cursor: z.string().nullable().optional(),
36
- })
37
- .strict();
38
- export const publishArtifactsInputSchema = z
39
- .object({
40
- paths: z
41
- .array(z.string().trim().min(1))
42
- .min(1)
43
- .max(MAX_ARTIFACT_PUBLICATIONS_PER_CALL),
44
- })
45
- .strict();
46
- export const publishArtifactResultSchema = z.union([
47
- z
48
- .object({
49
- artifactId: artifactIdSchema,
50
- path: z.string().trim().min(1),
51
- })
52
- .strip(),
53
- z
54
- .object({
55
- error: z.literal(true),
56
- message: z.string().trim().min(1),
57
- path: z.string().trim().min(1),
58
- })
59
- .strip(),
60
- ]);
61
- export const publishArtifactsOutputSchema = z
62
- .object({
63
- results: z.array(publishArtifactResultSchema).min(1),
64
- })
65
- .strip();
66
31
  export const artifactDownloadUrlResponseSchema = z
67
32
  .object({
68
33
  url: z.url(),
@@ -23,5 +23,3 @@ export declare const attributionCreateInputSchema: z.ZodObject<{
23
23
  userId: z.ZodDefault<z.ZodString>;
24
24
  metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
25
25
  }, z.core.$strict>;
26
- export type UserId = z.infer<typeof userIdSchema>;
27
- export type Metadata = z.infer<typeof metadataSchema>;
@@ -56,9 +56,6 @@ export declare const updateChatConnectionBodySchema: z.ZodObject<{
56
56
  channelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
57
57
  }, z.core.$strict>>;
58
58
  }, z.core.$strict>;
59
- export declare const chatConnectionParamsSchema: z.ZodObject<{
60
- id: z.ZodString;
61
- }, z.core.$strip>;
62
59
  export declare const chatHealthCheckSchema: z.ZodObject<{
63
60
  code: z.ZodString;
64
61
  status: z.ZodEnum<{
@@ -90,9 +90,6 @@ export const updateChatConnectionBodySchema = z
90
90
  .refine((body) => body.name !== undefined ||
91
91
  (body.configuration !== undefined &&
92
92
  Object.keys(body.configuration).length > 0), { message: "Provide a name or a configuration change" });
93
- export const chatConnectionParamsSchema = z.object({
94
- id: chatConnectionIdSchema,
95
- });
96
93
  export const chatHealthCheckSchema = z
97
94
  .object({
98
95
  code: z.string(),
@@ -3,7 +3,6 @@ import { z } from "zod";
3
3
  * Re-exported AI SDK types — every service, the SDK, and the dashboard
4
4
  * consume these from one place.
5
5
  */
6
- export type { UIMessage, UIMessageChunk } from "ai";
7
6
  export declare const chatModeSchema: z.ZodEnum<{
8
7
  create: "create";
9
8
  resume: "resume";
@@ -311,24 +310,8 @@ export declare const generationRequestBodySchema: z.ZodObject<{
311
310
  userId?: string | undefined;
312
311
  metadata?: Record<string, unknown> | undefined;
313
312
  }>>;
314
- /**
315
- * Mid-stream error chunk — the AI SDK native `{ type: 'error', errorText }`
316
- * shape (docs/adr/0003-ai-sdk-native-wire-protocol.md). `errorText` is a plain string:
317
- * safe human-readable prose produced by our server-side `onError` mapping —
318
- * no JSON stuffed in the string, no client-side parsing. `useChat` routes it
319
- * to `onError`, never into the transcript.
320
- */
321
- export declare const chatStreamErrorChunkSchema: z.ZodObject<{
322
- type: z.ZodLiteral<"error">;
323
- errorText: z.ZodString;
324
- }, z.core.$strip>;
325
- export type ChatMode = z.infer<typeof chatModeSchema>;
326
- export type ChatTrigger = z.infer<typeof chatTriggerSchema>;
327
313
  export type UsageSummary = z.infer<typeof usageSummarySchema>;
328
314
  export type BlazingAgentsChatMessageMetadata = z.infer<typeof blazingAgentsChatMessageMetadataSchema>;
329
- export type ChatRequestBody = z.infer<typeof chatRequestBodySchema>;
330
- export type GenerationRequestBody = z.infer<typeof generationRequestBodySchema>;
331
- export type ChatStreamErrorChunk = z.infer<typeof chatStreamErrorChunkSchema>;
332
315
  export type PromptVariables = z.infer<typeof promptVariablesSchema>;
333
316
  export type ChatFunctionDefinition = z.infer<typeof chatFunctionDefinitionSchema>;
334
317
  export type ChatFunctionDefinitions = z.infer<typeof chatFunctionDefinitionsSchema>;
@@ -336,3 +319,4 @@ export type ChatFunctionCallEvent = z.infer<typeof chatFunctionCallEventSchema>;
336
319
  export type ChatFunctionOutcome = z.infer<typeof chatFunctionOutcomeSchema>;
337
320
  export type ClaimChatFunctionBody = z.infer<typeof claimChatFunctionBodySchema>;
338
321
  export type ResolveChatFunctionBody = z.infer<typeof resolveChatFunctionBodySchema>;
322
+ export {};
@@ -3,6 +3,10 @@ import { agentIdSchema, functionCallIdSchema, promptIdSchema, sessionIdSchema, t
3
3
  import { chatFunctionNameSchema } from "./agent-tools.js";
4
4
  import { agentModelIdSchema } from "./agents.js";
5
5
  import { metadataSchema, userIdSchema } from "./attribution.js";
6
+ /**
7
+ * Re-exported AI SDK types — every service, the SDK, and the dashboard
8
+ * consume these from one place.
9
+ */
6
10
  export const chatModeSchema = z.enum(["create", "resume"]);
7
11
  export const chatTriggerSchema = z.enum([
8
12
  "submit-message",
@@ -249,16 +253,3 @@ export const generationRequestBodySchema = z
249
253
  message: "Provide either `prompt` or `promptId` (+`variables`); they are mutually exclusive, and `variables` is only allowed with `promptId`.",
250
254
  path: ["prompt"],
251
255
  });
252
- /**
253
- * Mid-stream error chunk — the AI SDK native `{ type: 'error', errorText }`
254
- * shape (docs/adr/0003-ai-sdk-native-wire-protocol.md). `errorText` is a plain string:
255
- * safe human-readable prose produced by our server-side `onError` mapping —
256
- * no JSON stuffed in the string, no client-side parsing. `useChat` routes it
257
- * to `onError`, never into the transcript.
258
- */
259
- export const chatStreamErrorChunkSchema = z
260
- .object({
261
- type: z.literal("error"),
262
- errorText: z.string(),
263
- })
264
- .strip();
@@ -16,165 +16,6 @@ export declare const mcpConnectionTestErrorCodeSchema: z.ZodEnum<{
16
16
  MCP_CONNECTION_INVALID: "MCP_CONNECTION_INVALID";
17
17
  MCP_CONNECTION_UNREACHABLE: "MCP_CONNECTION_UNREACHABLE";
18
18
  }>;
19
- /**
20
- * Mirrors the MCP SDK's SEP-2352 issuer-identity comparison.
21
- */
22
- export declare function mcpOauthIssuersMatch(a: string, b: string): boolean;
23
- export declare const mcpOauthClientCredentialsBundleSchema: z.ZodObject<{
24
- clientInformation: z.ZodObject<{
25
- client_id: z.ZodString;
26
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
27
- client_secret: z.ZodString;
28
- }, z.core.$loose>;
29
- discoveryState: z.ZodNullable<z.ZodObject<{
30
- authorizationServerMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
31
- authorizationServerUrl: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
32
- resourceMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
33
- resourceMetadataUrl: z.ZodOptional<z.ZodString>;
34
- }, z.core.$loose>>;
35
- scope: z.ZodNullable<z.ZodString>;
36
- tokens: z.ZodNullable<z.ZodObject<{
37
- access_token: z.ZodString;
38
- expires_in: z.ZodOptional<z.ZodNumber>;
39
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
40
- refresh_token: z.ZodOptional<z.ZodString>;
41
- scope: z.ZodOptional<z.ZodString>;
42
- token_type: z.ZodString;
43
- }, z.core.$strict>>;
44
- type: z.ZodLiteral<"oauth_client_credentials">;
45
- version: z.ZodLiteral<1>;
46
- }, z.core.$strict>;
47
- export declare const mcpOauthAuthorizationCodeBundleSchema: z.ZodObject<{
48
- clientInformation: z.ZodNullable<z.ZodObject<{
49
- client_id: z.ZodString;
50
- client_secret: z.ZodOptional<z.ZodString>;
51
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
52
- }, z.core.$loose>>;
53
- discoveryState: z.ZodNullable<z.ZodObject<{
54
- authorizationServerMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
55
- authorizationServerUrl: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
56
- resourceMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
57
- resourceMetadataUrl: z.ZodOptional<z.ZodString>;
58
- }, z.core.$loose>>;
59
- scope: z.ZodNullable<z.ZodString>;
60
- tokens: z.ZodNullable<z.ZodObject<{
61
- access_token: z.ZodString;
62
- expires_in: z.ZodOptional<z.ZodNumber>;
63
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
64
- refresh_token: z.ZodOptional<z.ZodString>;
65
- scope: z.ZodOptional<z.ZodString>;
66
- token_type: z.ZodString;
67
- }, z.core.$strict>>;
68
- type: z.ZodLiteral<"oauth_authorization_code">;
69
- version: z.ZodLiteral<1>;
70
- }, z.core.$strict>;
71
- export declare const mcpOauthAuthorizationTransactionBundleSchema: z.ZodObject<{
72
- clientInformation: z.ZodNullable<z.ZodObject<{
73
- client_id: z.ZodString;
74
- client_secret: z.ZodOptional<z.ZodString>;
75
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
76
- }, z.core.$loose>>;
77
- codeVerifier: z.ZodNullable<z.ZodString>;
78
- credentialVersion: z.ZodNumber;
79
- discoveryState: z.ZodNullable<z.ZodObject<{
80
- authorizationServerMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
81
- authorizationServerUrl: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
82
- resourceMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
83
- resourceMetadataUrl: z.ZodOptional<z.ZodString>;
84
- }, z.core.$loose>>;
85
- expectedIssuer: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
86
- expectedResource: z.ZodString;
87
- redirectUri: z.ZodString;
88
- scope: z.ZodNullable<z.ZodString>;
89
- type: z.ZodLiteral<"oauth_authorization_code_transaction">;
90
- version: z.ZodLiteral<1>;
91
- }, z.core.$strict>;
92
- export declare const mcpBearerCredentialBundleSchema: z.ZodObject<{
93
- bearerToken: z.ZodString;
94
- type: z.ZodLiteral<"bearer">;
95
- version: z.ZodLiteral<1>;
96
- }, z.core.$strict>;
97
- export declare const mcpCredentialBundleSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
98
- bearerToken: z.ZodString;
99
- type: z.ZodLiteral<"bearer">;
100
- version: z.ZodLiteral<1>;
101
- }, z.core.$strict>, z.ZodObject<{
102
- clientInformation: z.ZodNullable<z.ZodObject<{
103
- client_id: z.ZodString;
104
- client_secret: z.ZodOptional<z.ZodString>;
105
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
106
- }, z.core.$loose>>;
107
- discoveryState: z.ZodNullable<z.ZodObject<{
108
- authorizationServerMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
109
- authorizationServerUrl: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
110
- resourceMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
111
- resourceMetadataUrl: z.ZodOptional<z.ZodString>;
112
- }, z.core.$loose>>;
113
- scope: z.ZodNullable<z.ZodString>;
114
- tokens: z.ZodNullable<z.ZodObject<{
115
- access_token: z.ZodString;
116
- expires_in: z.ZodOptional<z.ZodNumber>;
117
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
118
- refresh_token: z.ZodOptional<z.ZodString>;
119
- scope: z.ZodOptional<z.ZodString>;
120
- token_type: z.ZodString;
121
- }, z.core.$strict>>;
122
- type: z.ZodLiteral<"oauth_authorization_code">;
123
- version: z.ZodLiteral<1>;
124
- }, z.core.$strict>, z.ZodObject<{
125
- clientInformation: z.ZodObject<{
126
- client_id: z.ZodString;
127
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
128
- client_secret: z.ZodString;
129
- }, z.core.$loose>;
130
- discoveryState: z.ZodNullable<z.ZodObject<{
131
- authorizationServerMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
132
- authorizationServerUrl: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
133
- resourceMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
134
- resourceMetadataUrl: z.ZodOptional<z.ZodString>;
135
- }, z.core.$loose>>;
136
- scope: z.ZodNullable<z.ZodString>;
137
- tokens: z.ZodNullable<z.ZodObject<{
138
- access_token: z.ZodString;
139
- expires_in: z.ZodOptional<z.ZodNumber>;
140
- issuer: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
141
- refresh_token: z.ZodOptional<z.ZodString>;
142
- scope: z.ZodOptional<z.ZodString>;
143
- token_type: z.ZodString;
144
- }, z.core.$strict>>;
145
- type: z.ZodLiteral<"oauth_client_credentials">;
146
- version: z.ZodLiteral<1>;
147
- }, z.core.$strict>], "type">;
148
- export declare const mcpConnectionSchema: z.ZodObject<{
149
- id: z.ZodString;
150
- tenantId: z.ZodString;
151
- name: z.ZodString;
152
- url: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
153
- authType: z.ZodEnum<{
154
- bearer: "bearer";
155
- none: "none";
156
- oauth_authorization_code: "oauth_authorization_code";
157
- oauth_client_credentials: "oauth_client_credentials";
158
- }>;
159
- status: z.ZodEnum<{
160
- connected: "connected";
161
- error: "error";
162
- needs_auth: "needs_auth";
163
- }>;
164
- credentialVersion: z.ZodNumber;
165
- credentialFragment: z.ZodNullable<z.ZodString>;
166
- lastAuthErrorCode: z.ZodNullable<z.ZodEnum<{
167
- MCP_CONNECTION_AUTHENTICATION_FAILED: "MCP_CONNECTION_AUTHENTICATION_FAILED";
168
- MCP_CONNECTION_DISCOVERY_FAILED: "MCP_CONNECTION_DISCOVERY_FAILED";
169
- MCP_CONNECTION_INVALID: "MCP_CONNECTION_INVALID";
170
- MCP_CONNECTION_UNREACHABLE: "MCP_CONNECTION_UNREACHABLE";
171
- }>>;
172
- oauthIssuer: z.ZodNullable<z.ZodString>;
173
- oauthResource: z.ZodNullable<z.ZodString>;
174
- tokenExpiresAt: z.ZodNullable<z.ZodISODateTime>;
175
- createdAt: z.ZodISODateTime;
176
- updatedAt: z.ZodISODateTime;
177
- }, z.core.$strict>;
178
19
  export declare const mcpConnectionResponseSchema: z.ZodObject<{
179
20
  id: z.ZodString;
180
21
  name: z.ZodString;
@@ -400,14 +241,7 @@ export declare const mcpConnectionReconnectResultSchema: z.ZodDiscriminatedUnion
400
241
  }, z.core.$strip>;
401
242
  }, z.core.$strip>], "status">;
402
243
  export type McpConnectionAuthType = z.infer<typeof mcpConnectionAuthTypeSchema>;
403
- export type McpCredentialBundle = z.infer<typeof mcpCredentialBundleSchema>;
404
- export type McpOauthClientCredentialsBundle = z.infer<typeof mcpOauthClientCredentialsBundleSchema>;
405
- export type McpOauthAuthorizationCodeBundle = z.infer<typeof mcpOauthAuthorizationCodeBundleSchema>;
406
- export type McpOauthAuthorizationTransactionBundle = z.infer<typeof mcpOauthAuthorizationTransactionBundleSchema>;
407
244
  export type McpConnectionStatus = z.infer<typeof mcpConnectionStatusSchema>;
408
- export type McpConnectionTestErrorCode = z.infer<typeof mcpConnectionTestErrorCodeSchema>;
409
- export type McpConnectionLiveDetails = z.infer<typeof mcpConnectionLiveDetailsSchema>;
410
- export type McpConnection = z.infer<typeof mcpConnectionSchema>;
411
245
  export type McpConnectionResponse = z.infer<typeof mcpConnectionResponseSchema>;
412
246
  export type McpConnectionsResponse = z.infer<typeof mcpConnectionsResponseSchema>;
413
247
  export type CreateMcpConnectionBody = z.infer<typeof createMcpConnectionBodySchema>;
@@ -416,8 +250,6 @@ export type ReconnectMcpConnectionBody = z.infer<typeof reconnectMcpConnectionBo
416
250
  export type McpConnectionTestResponse = z.infer<typeof mcpConnectionTestResponseSchema>;
417
251
  export type McpConnectionReconnectResult = z.infer<typeof mcpConnectionReconnectResultSchema>;
418
252
  export type McpConnectionOauthConnectResponse = z.infer<typeof mcpConnectionOauthConnectResponseSchema>;
419
- export type ApproveMcpOauthAuthorizationBody = z.infer<typeof approveMcpOauthAuthorizationBodySchema>;
420
- export type McpOauthAuthorizationLaunchResponse = z.infer<typeof mcpOauthAuthorizationLaunchResponseSchema>;
421
253
  export type McpAttachmentResponse = z.infer<typeof mcpAttachmentResponseSchema>;
422
254
  export type McpAttachmentsResponse = z.infer<typeof mcpAttachmentsResponseSchema>;
423
255
  export type UpdateMcpAttachmentBody = z.infer<typeof updateMcpAttachmentBodySchema>;
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { mcpConnectionIdSchema, tenantIdSchema } from "../ids.js";
2
+ import { mcpConnectionIdSchema } from "../ids.js";
3
3
  import { MAX_MCP_ATTACHMENT_METADATA_KEY_LENGTH, MAX_MCP_ATTACHMENT_METADATA_KEYS, MAX_MCP_BEARER_TOKEN_LENGTH, MAX_MCP_CONNECTION_NAME_LENGTH, MAX_MCP_CONNECTION_TEST_LATENCY_MS, MAX_MCP_CONNECTION_URL_LENGTH, MAX_MCP_OAUTH_CLIENT_ID_LENGTH, MAX_MCP_OAUTH_CLIENT_SECRET_LENGTH, MAX_MCP_OAUTH_SCOPE_LENGTH, MAX_MCP_SERVER_NAME_LENGTH, MAX_MCP_SERVER_VERSION_LENGTH, MAX_MCP_TOOL_NAME_LENGTH, MAX_MCP_TOOLS_PER_CONNECTION, } from "../limitations.js";
4
4
  import { atLeastOneFieldMessage, hasObjectKeys, hasUniqueValues, } from "../utils.js";
5
5
  const OPAQUE_MCP_OAUTH_TOKEN_PATTERN = /^[A-Za-z0-9_-]{43}$/;
@@ -40,165 +40,13 @@ const oauthClientSecretSchema = z
40
40
  .min(1)
41
41
  .max(MAX_MCP_OAUTH_CLIENT_SECRET_LENGTH)
42
42
  .regex(/^[!-~]+$/, "Client secret must contain visible ASCII characters only");
43
- const storedOauthClientIdSchema = z
44
- .string()
45
- .min(1)
46
- .max(MAX_MCP_OAUTH_CLIENT_ID_LENGTH);
47
- const storedOauthClientSecretSchema = z
48
- .string()
49
- .min(1)
50
- .max(MAX_MCP_OAUTH_CLIENT_SECRET_LENGTH);
51
43
  const oauthScopeSchema = z
52
44
  .string()
53
45
  .trim()
54
46
  .min(1)
55
47
  .max(MAX_MCP_OAUTH_SCOPE_LENGTH)
56
48
  .regex(/^[\x20-\x7e]+$/, "Scope must contain printable ASCII characters only");
57
- const oauthIssuerSchema = z
58
- .string()
59
- .trim()
60
- .url()
61
- .refine((value) => {
62
- try {
63
- const url = new URL(value);
64
- return ((url.protocol === "http:" || url.protocol === "https:") &&
65
- url.username === "" &&
66
- url.password === "" &&
67
- url.search === "" &&
68
- url.hash === "");
69
- }
70
- catch {
71
- return false;
72
- }
73
- }, {
74
- message: "OAuth issuer must be an http(s) URL without credentials, query, or fragment",
75
- })
76
- .transform((value) => new URL(value).toString());
77
49
  const credentialFragmentSchema = z.string().min(1).max(4).nullable();
78
- /**
79
- * Mirrors the MCP SDK's SEP-2352 issuer-identity comparison.
80
- */
81
- export function mcpOauthIssuersMatch(a, b) {
82
- return (a === b ||
83
- (a.endsWith("/") && a.slice(0, -1) === b) ||
84
- (b.endsWith("/") && b.slice(0, -1) === a));
85
- }
86
- const oauthClientInformationSchema = z.looseObject({
87
- client_id: storedOauthClientIdSchema,
88
- client_secret: storedOauthClientSecretSchema.optional(),
89
- issuer: oauthIssuerSchema,
90
- });
91
- const oauthConfidentialClientInformationSchema = oauthClientInformationSchema.safeExtend({
92
- client_secret: oauthClientSecretSchema,
93
- });
94
- const oauthTokensSchema = z
95
- .object({
96
- access_token: z.string().min(1),
97
- expires_in: z.number().positive().optional(),
98
- issuer: oauthIssuerSchema,
99
- refresh_token: z.string().optional(),
100
- scope: z.string().optional(),
101
- token_type: z.string().min(1),
102
- })
103
- .strict();
104
- const oauthDiscoveryStateSchema = z.looseObject({
105
- authorizationServerMetadata: z.record(z.string(), z.unknown()).optional(),
106
- authorizationServerUrl: oauthIssuerSchema,
107
- resourceMetadata: z.record(z.string(), z.unknown()).optional(),
108
- resourceMetadataUrl: z.string().url().optional(),
109
- });
110
- export const mcpOauthClientCredentialsBundleSchema = z
111
- .object({
112
- clientInformation: oauthConfidentialClientInformationSchema,
113
- discoveryState: oauthDiscoveryStateSchema.nullable(),
114
- scope: oauthScopeSchema.nullable(),
115
- tokens: oauthTokensSchema.nullable(),
116
- type: z.literal("oauth_client_credentials"),
117
- version: z.literal(1),
118
- })
119
- .strict()
120
- .superRefine((bundle, context) => {
121
- if (bundle.tokens &&
122
- bundle.tokens.issuer !== bundle.clientInformation.issuer) {
123
- context.addIssue({
124
- code: "custom",
125
- message: "OAuth token issuer must match the client issuer",
126
- path: ["tokens", "issuer"],
127
- });
128
- }
129
- });
130
- export const mcpOauthAuthorizationCodeBundleSchema = z
131
- .object({
132
- clientInformation: oauthClientInformationSchema.nullable(),
133
- discoveryState: oauthDiscoveryStateSchema.nullable(),
134
- scope: oauthScopeSchema.nullable(),
135
- tokens: oauthTokensSchema.nullable(),
136
- type: z.literal("oauth_authorization_code"),
137
- version: z.literal(1),
138
- })
139
- .strict()
140
- .superRefine((bundle, context) => {
141
- if (bundle.tokens && !bundle.clientInformation) {
142
- context.addIssue({
143
- code: "custom",
144
- message: "OAuth tokens require client information",
145
- path: ["clientInformation"],
146
- });
147
- return;
148
- }
149
- if (bundle.tokens &&
150
- bundle.tokens.issuer !== bundle.clientInformation?.issuer) {
151
- context.addIssue({
152
- code: "custom",
153
- message: "OAuth token issuer must match the client issuer",
154
- path: ["tokens", "issuer"],
155
- });
156
- }
157
- });
158
- export const mcpOauthAuthorizationTransactionBundleSchema = z
159
- .object({
160
- clientInformation: oauthClientInformationSchema.nullable(),
161
- codeVerifier: z.string().min(1).max(1024).nullable(),
162
- credentialVersion: z.number().int().nonnegative(),
163
- discoveryState: oauthDiscoveryStateSchema.nullable(),
164
- expectedIssuer: oauthIssuerSchema,
165
- expectedResource: z.string().url(),
166
- redirectUri: z.string().url(),
167
- scope: oauthScopeSchema.nullable(),
168
- type: z.literal("oauth_authorization_code_transaction"),
169
- version: z.literal(1),
170
- })
171
- .strict()
172
- .superRefine((bundle, context) => {
173
- if (bundle.clientInformation &&
174
- bundle.clientInformation.issuer !== bundle.expectedIssuer) {
175
- context.addIssue({
176
- code: "custom",
177
- message: "OAuth client issuer must match the expected issuer",
178
- path: ["clientInformation", "issuer"],
179
- });
180
- }
181
- if ((bundle.codeVerifier !== null || bundle.discoveryState !== null) &&
182
- bundle.clientInformation === null) {
183
- context.addIssue({
184
- code: "custom",
185
- message: "An active OAuth transaction requires client information",
186
- path: ["clientInformation"],
187
- });
188
- }
189
- });
190
- export const mcpBearerCredentialBundleSchema = z
191
- .object({
192
- bearerToken: bearerTokenSchema,
193
- type: z.literal("bearer"),
194
- version: z.literal(1),
195
- })
196
- .strict();
197
- export const mcpCredentialBundleSchema = z.discriminatedUnion("type", [
198
- mcpBearerCredentialBundleSchema,
199
- mcpOauthAuthorizationCodeBundleSchema,
200
- mcpOauthClientCredentialsBundleSchema,
201
- ]);
202
50
  const mcpConnectionUrlSchema = z
203
51
  .string()
204
52
  .trim()
@@ -220,24 +68,6 @@ const mcpConnectionUrlSchema = z
220
68
  message: "URL must use http(s) without credentials, query, or fragment",
221
69
  })
222
70
  .transform((value) => new URL(value).toString());
223
- export const mcpConnectionSchema = z
224
- .object({
225
- id: mcpConnectionIdSchema,
226
- tenantId: tenantIdSchema,
227
- name: mcpConnectionNameSchema,
228
- url: mcpConnectionUrlSchema,
229
- authType: mcpConnectionAuthTypeSchema,
230
- status: mcpConnectionStatusSchema,
231
- credentialVersion: z.number().int().nonnegative(),
232
- credentialFragment: credentialFragmentSchema,
233
- lastAuthErrorCode: mcpConnectionTestErrorCodeSchema.nullable(),
234
- oauthIssuer: z.string().url().nullable(),
235
- oauthResource: z.string().url().nullable(),
236
- tokenExpiresAt: z.iso.datetime({ offset: true }).nullable(),
237
- createdAt: z.iso.datetime({ offset: true }),
238
- updatedAt: z.iso.datetime({ offset: true }),
239
- })
240
- .strict();
241
71
  export const mcpConnectionResponseSchema = z
242
72
  .object({
243
73
  id: mcpConnectionIdSchema,
@@ -35,12 +35,6 @@ export declare const memoriesListResponseSchema: z.ZodObject<{
35
35
  }, z.core.$strip>>;
36
36
  nextCursor: z.ZodNullable<z.ZodString>;
37
37
  }, z.core.$strip>;
38
- export declare const memoriesListQuerySchema: z.ZodObject<{
39
- userId: z.ZodOptional<z.ZodString>;
40
- search: z.ZodOptional<z.ZodString>;
41
- cursor: z.ZodOptional<z.ZodString>;
42
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
43
- }, z.core.$strict>;
44
38
  export declare const createMemoryBodySchema: z.ZodObject<{
45
39
  text: z.ZodString;
46
40
  userId: z.ZodDefault<z.ZodString>;
@@ -48,9 +42,7 @@ export declare const createMemoryBodySchema: z.ZodObject<{
48
42
  export declare const updateMemoryBodySchema: z.ZodObject<{
49
43
  text: z.ZodString;
50
44
  }, z.core.$strict>;
51
- export type Memory = z.infer<typeof memorySchema>;
52
45
  export type MemoryResponse = z.infer<typeof memoryResponseSchema>;
53
- export type MemoriesListQuery = z.infer<typeof memoriesListQuerySchema>;
54
46
  export type MemoriesListResponse = z.infer<typeof memoriesListResponseSchema>;
55
47
  export type CreateMemoryBody = z.input<typeof createMemoryBodySchema>;
56
48
  export type UpdateMemoryBody = z.infer<typeof updateMemoryBodySchema>;
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
- import { cursorSchema, paginatedResponseSchema } from "../api.js";
2
+ import { paginatedResponseSchema } from "../api.js";
3
3
  import { agentIdSchema, memoryIdSchema, tenantIdSchema } from "../ids.js";
4
- import { DEFAULT_MEMORIES_LIST_LIMIT, MAX_MEMORIES_LIST_LIMIT, MAX_MEMORY_TEXT_BYTES, } from "../limitations.js";
4
+ import { MAX_MEMORY_TEXT_BYTES } from "../limitations.js";
5
5
  import { userIdSchema } from "./attribution.js";
6
6
  /**
7
7
  * Memory — a single Agent-owned text row (Agent Memories PRD). `userId` is
@@ -36,19 +36,6 @@ export const memoryResponseSchema = z
36
36
  })
37
37
  .strip();
38
38
  export const memoriesListResponseSchema = paginatedResponseSchema(memorySchema);
39
- export const memoriesListQuerySchema = z
40
- .object({
41
- userId: userIdSchema.optional(),
42
- search: z.string().trim().min(1).optional(),
43
- cursor: cursorSchema.optional(),
44
- limit: z.coerce
45
- .number()
46
- .int()
47
- .min(1)
48
- .max(MAX_MEMORIES_LIST_LIMIT)
49
- .default(DEFAULT_MEMORIES_LIST_LIMIT),
50
- })
51
- .strict();
52
39
  export const createMemoryBodySchema = z
53
40
  .object({
54
41
  text: memoryTextSchema,
@@ -113,11 +113,6 @@ export declare const merchantCustomerBindingSchema: z.ZodObject<{
113
113
  updatedAt: z.ZodISODateTime;
114
114
  }, z.core.$strip>;
115
115
  export type MerchantCustomerBinding = z.infer<typeof merchantCustomerBindingSchema>;
116
- export declare const merchantBindingsListQuerySchema: z.ZodObject<{
117
- userId: z.ZodOptional<z.ZodString>;
118
- cursor: z.ZodOptional<z.ZodString>;
119
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
120
- }, z.core.$strict>;
121
116
  export declare const merchantBindingsResponseSchema: z.ZodObject<{
122
117
  bindings: z.ZodArray<z.ZodObject<{
123
118
  userId: z.ZodString;
@@ -291,20 +286,6 @@ export declare const merchantUsageEventResponseSchema: z.ZodObject<{
291
286
  }, z.core.$strip>;
292
287
  }, z.core.$strip>;
293
288
  export type MerchantUsageEventResponse = z.infer<typeof merchantUsageEventResponseSchema>;
294
- export declare const merchantUsageEventsListQuerySchema: z.ZodObject<{
295
- status: z.ZodOptional<z.ZodEnum<{
296
- accepted: "accepted";
297
- discarded: "discarded";
298
- expired: "expired";
299
- failed: "failed";
300
- incomplete: "incomplete";
301
- pending: "pending";
302
- uncertain: "uncertain";
303
- unmapped: "unmapped";
304
- }>>;
305
- cursor: z.ZodOptional<z.ZodString>;
306
- limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
307
- }, z.core.$strict>;
308
289
  export declare const merchantUsageEventsResponseSchema: z.ZodObject<{
309
290
  events: z.ZodArray<z.ZodObject<{
310
291
  id: z.ZodString;